commit 072e234bad982120a9d748f7a8ac787d96936c3e Author: Araozu Date: Sun Oct 6 20:21:13 2024 -0500 Init diff --git a/.air.toml b/.air.toml new file mode 100644 index 0000000..a552166 --- /dev/null +++ b/.air.toml @@ -0,0 +1,51 @@ +root = "." +testdata_dir = "testdata" +tmp_dir = "tmp" + +[build] + args_bin = [] + bin = "./tmp/main" + cmd = "go build -o ./tmp/main ." + delay = 100 + exclude_dir = ["public", "tmp", "vendor", "testdata"] + exclude_file = [] + exclude_regex = ["_test.go"] + exclude_unchanged = false + follow_symlink = false + full_bin = "" + include_dir = [] + include_ext = ["go", "tpl", "tmpl", "html"] + include_file = [] + kill_delay = "0s" + log = "build-errors.log" + poll = false + poll_interval = 0 + post_cmd = [] + pre_cmd = [] + rerun = false + rerun_delay = 0 + send_interrupt = false + stop_on_error = false + +[color] + app = "" + build = "yellow" + main = "magenta" + runner = "green" + watcher = "cyan" + +[log] + main_only = false + time = false + +[misc] + clean_on_exit = false + +[proxy] + app_port = 0 + enabled = false + proxy_port = 0 + +[screen] + clear_on_rebuild = false + keep_scroll = true diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..2463bbb --- /dev/null +++ b/.env.example @@ -0,0 +1,9 @@ +PORT=8080 +APP_ENV=local + +DB_HOST=localhost +DB_PORT=5432 +DB_DATABASE=acide +DB_USERNAME=root +DB_PASSWORD=123456789 +DB_SCHEMA=public diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1666735 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +node_modules +public/css/output.css +.env +tmp + diff --git a/README.md b/README.md new file mode 100644 index 0000000..9b8763c --- /dev/null +++ b/README.md @@ -0,0 +1,57 @@ +# Go fullstack template + +## Installation & Set Up + +1. Install [the Go Programming Language](https://go.dev) +2. Install [Air](https://github.com/air-verse/air) by running: + +```sh +go install github.com/air-verse/air@latest +``` + +3. Install [Templ](https://templ.guide/) by running: + +```sh +go install github.com/a-h/templ/cmd/templ@latest +``` + +4. Install [Node.js](https://nodejs.org/en) +5. Install Go deps with `go mod tidy` +6. Install Node deps with `npm install` + +## VSCode setup + +To best use this template install Go & Templ LSPs: + +- [gopls](https://marketplace.visualstudio.com/items?itemName=golang.Go) +- [templ](https://marketplace.visualstudio.com/items?itemName=a-h.templ) + +## Neovim setup + +You can install `gopls` and `templ` with Mason. + +## Running + +Just run: + +```sh +npm run dev +``` + +This will start 3 processes: + +- Tailwind watch +- Air +- Templ watch + + +## Building + +Compile the Go binary: + +```sh +go build main.go +``` + +And ship it along the `public` folder + diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..aeb88d6 --- /dev/null +++ b/go.mod @@ -0,0 +1,31 @@ +module acide + +go 1.23.1 + +require ( + github.com/a-h/templ v0.2.778 + github.com/labstack/echo v3.3.10+incompatible + gorm.io/gorm v1.25.12 +) + +require ( + github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/jackc/pgx/v5 v5.5.5 // indirect + github.com/jackc/puddle/v2 v2.2.1 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/joho/godotenv v1.5.1 + github.com/labstack/gommon v0.4.2 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/valyala/fasttemplate v1.2.2 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.23.0 // indirect + golang.org/x/text v0.18.0 // indirect + gorm.io/driver/postgres v1.5.9 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..a4ac02d --- /dev/null +++ b/go.sum @@ -0,0 +1,63 @@ +github.com/a-h/templ v0.2.778 h1:VzhOuvWECrwOec4790lcLlZpP4Iptt5Q4K9aFxQmtaM= +github.com/a-h/templ v0.2.778/go.mod h1:lq48JXoUvuQrU0VThrK31yFwdRjTCnIE5bcPCM9IP1w= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw= +github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= +github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= +github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg= +github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s= +github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0= +github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= +github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/driver/postgres v1.5.9 h1:DkegyItji119OlcaLjqN11kHoUgZ/j13E0jkJZgD6A8= +gorm.io/driver/postgres v1.5.9/go.mod h1:DX3GReXH+3FPWGrrgffdvCk3DQ1dwDPdmbenSkweRGI= +gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8= +gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ= diff --git a/main.go b/main.go new file mode 100644 index 0000000..e7aaf62 --- /dev/null +++ b/main.go @@ -0,0 +1,16 @@ +package main + +import ( + "acide/src" + "fmt" + "log" +) + +func main() { + server := src.NewServer() + log.Print("HTTP server started") + err := server.ListenAndServe() + if err != nil { + panic(fmt.Sprintf("cannot start server: %s", err)) + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..1b68bdd --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "acide", + "version": "1.0.0", + "description": "", + "main": "main.go", + "scripts": { + "dev": "concurrently 'air' 'tailwindcss -i ./public/css/input.css -o ./public/css/output.css --watch' 'templ generate --watch'", + "air": "air", + "tailwind:watch": "tailwindcss -i ./public/css/input.css -o ./public/css/output.css --watch", + "tailwind:build": "tailwindcss -i ./public/css/input.css -o ./public/css/output.css --minify", + "temple:watch": "templ generate --watch" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "concurrently": "^9.0.1", + "tailwindcss": "^3.4.13" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..3ef1122 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,973 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + concurrently: + specifier: ^9.0.1 + version: 9.0.1 + tailwindcss: + specifier: ^3.4.13 + version: 3.4.13 + +packages: + + '@alloc/quick-lru@5.2.0': + resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} + engines: {node: '>=10'} + + '@isaacs/cliui@8.0.2': + resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} + engines: {node: '>=12'} + + '@jridgewell/gen-mapping@0.3.5': + resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} + engines: {node: '>=6.0.0'} + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/set-array@1.2.1': + resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} + engines: {node: '>=6.0.0'} + + '@jridgewell/sourcemap-codec@1.5.0': + resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + + '@jridgewell/trace-mapping@0.3.25': + resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + + '@nodelib/fs.scandir@2.1.5': + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + + '@nodelib/fs.stat@2.0.5': + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + + '@nodelib/fs.walk@1.2.8': + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + + '@pkgjs/parseargs@0.11.0': + resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} + engines: {node: '>=14'} + + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-regex@6.1.0: + resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} + engines: {node: '>=12'} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + + ansi-styles@6.2.1: + resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} + engines: {node: '>=12'} + + any-promise@1.3.0: + resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} + + anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + + arg@5.0.2: + resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} + + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + binary-extensions@2.3.0: + resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} + engines: {node: '>=8'} + + brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + camelcase-css@2.0.1: + resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==} + engines: {node: '>= 6'} + + chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + + chokidar@3.6.0: + resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} + engines: {node: '>= 8.10.0'} + + cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + commander@4.1.1: + resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} + engines: {node: '>= 6'} + + concurrently@9.0.1: + resolution: {integrity: sha512-wYKvCd/f54sTXJMSfV6Ln/B8UrfLBKOYa+lzc6CHay3Qek+LorVSBdMVfyewFhRbH0Rbabsk4D+3PL/VjQ5gzg==} + engines: {node: '>=18'} + hasBin: true + + cross-spawn@7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + + cssesc@3.0.0: + resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} + engines: {node: '>=4'} + hasBin: true + + didyoumean@1.2.2: + resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} + + dlv@1.1.3: + resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} + + eastasianwidth@0.2.0: + resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + + emoji-regex@9.2.2: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + + fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + engines: {node: '>=8.6.0'} + + fastq@1.17.1: + resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + foreground-child@3.3.0: + resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} + engines: {node: '>=14'} + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + + glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + + glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + + glob@10.4.5: + resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} + hasBin: true + + has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + + is-binary-path@2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + + is-core-module@2.15.1: + resolution: {integrity: sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==} + engines: {node: '>= 0.4'} + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + jackspeak@3.4.3: + resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + + jiti@1.21.6: + resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} + hasBin: true + + lilconfig@2.1.0: + resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} + engines: {node: '>=10'} + + lilconfig@3.1.2: + resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} + engines: {node: '>=14'} + + lines-and-columns@1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + + lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + + lru-cache@10.4.3: + resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + + merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + minimatch@9.0.5: + resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} + engines: {node: '>=16 || 14 >=14.17'} + + minipass@7.1.2: + resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} + engines: {node: '>=16 || 14 >=14.17'} + + mz@2.7.0: + resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} + + nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + + object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + + object-hash@3.0.0: + resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} + engines: {node: '>= 6'} + + package-json-from-dist@1.0.0: + resolution: {integrity: sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + + path-scurry@1.11.1: + resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} + engines: {node: '>=16 || 14 >=14.18'} + + picocolors@1.1.0: + resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} + + picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + + pify@2.3.0: + resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} + engines: {node: '>=0.10.0'} + + pirates@4.0.6: + resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} + engines: {node: '>= 6'} + + postcss-import@15.1.0: + resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} + engines: {node: '>=14.0.0'} + peerDependencies: + postcss: ^8.0.0 + + postcss-js@4.0.1: + resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==} + engines: {node: ^12 || ^14 || >= 16} + peerDependencies: + postcss: ^8.4.21 + + postcss-load-config@4.0.2: + resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} + engines: {node: '>= 14'} + peerDependencies: + postcss: '>=8.0.9' + ts-node: '>=9.0.0' + peerDependenciesMeta: + postcss: + optional: true + ts-node: + optional: true + + postcss-nested@6.2.0: + resolution: {integrity: sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==} + engines: {node: '>=12.0'} + peerDependencies: + postcss: ^8.2.14 + + postcss-selector-parser@6.1.2: + resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} + engines: {node: '>=4'} + + postcss-value-parser@4.2.0: + resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} + + postcss@8.4.47: + resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==} + engines: {node: ^10 || ^12 || >=14} + + queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + + read-cache@1.0.0: + resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} + + readdirp@3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + resolve@1.22.8: + resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + hasBin: true + + reusify@1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + + run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + + rxjs@7.8.1: + resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + shell-quote@1.8.1: + resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==} + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + string-width@5.1.2: + resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} + engines: {node: '>=12'} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + strip-ansi@7.1.0: + resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + engines: {node: '>=12'} + + sucrase@3.35.0: + resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} + engines: {node: '>=16 || 14 >=14.17'} + hasBin: true + + supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + + supports-color@8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + + supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + + tailwindcss@3.4.13: + resolution: {integrity: sha512-KqjHOJKogOUt5Bs752ykCeiwvi0fKVkr5oqsFNt/8px/tA8scFPIlkygsf6jXrfCqGHz7VflA6+yytWuM+XhFw==} + engines: {node: '>=14.0.0'} + hasBin: true + + thenify-all@1.6.0: + resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} + engines: {node: '>=0.8'} + + thenify@3.3.1: + resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tree-kill@1.2.2: + resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} + hasBin: true + + ts-interface-checker@0.1.13: + resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + + tslib@2.7.0: + resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} + + util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + + wrap-ansi@8.1.0: + resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} + engines: {node: '>=12'} + + y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + + yaml@2.5.1: + resolution: {integrity: sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==} + engines: {node: '>= 14'} + hasBin: true + + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + + yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + +snapshots: + + '@alloc/quick-lru@5.2.0': {} + + '@isaacs/cliui@8.0.2': + dependencies: + string-width: 5.1.2 + string-width-cjs: string-width@4.2.3 + strip-ansi: 7.1.0 + strip-ansi-cjs: strip-ansi@6.0.1 + wrap-ansi: 8.1.0 + wrap-ansi-cjs: wrap-ansi@7.0.0 + + '@jridgewell/gen-mapping@0.3.5': + dependencies: + '@jridgewell/set-array': 1.2.1 + '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/trace-mapping': 0.3.25 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/set-array@1.2.1': {} + + '@jridgewell/sourcemap-codec@1.5.0': {} + + '@jridgewell/trace-mapping@0.3.25': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.0 + + '@nodelib/fs.scandir@2.1.5': + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + + '@nodelib/fs.stat@2.0.5': {} + + '@nodelib/fs.walk@1.2.8': + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.17.1 + + '@pkgjs/parseargs@0.11.0': + optional: true + + ansi-regex@5.0.1: {} + + ansi-regex@6.1.0: {} + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + + ansi-styles@6.2.1: {} + + any-promise@1.3.0: {} + + anymatch@3.1.3: + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + + arg@5.0.2: {} + + balanced-match@1.0.2: {} + + binary-extensions@2.3.0: {} + + brace-expansion@2.0.1: + dependencies: + balanced-match: 1.0.2 + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + camelcase-css@2.0.1: {} + + chalk@4.1.2: + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + + chokidar@3.6.0: + dependencies: + anymatch: 3.1.3 + braces: 3.0.3 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + + cliui@8.0.1: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.4: {} + + commander@4.1.1: {} + + concurrently@9.0.1: + dependencies: + chalk: 4.1.2 + lodash: 4.17.21 + rxjs: 7.8.1 + shell-quote: 1.8.1 + supports-color: 8.1.1 + tree-kill: 1.2.2 + yargs: 17.7.2 + + cross-spawn@7.0.3: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + + cssesc@3.0.0: {} + + didyoumean@1.2.2: {} + + dlv@1.1.3: {} + + eastasianwidth@0.2.0: {} + + emoji-regex@8.0.0: {} + + emoji-regex@9.2.2: {} + + escalade@3.2.0: {} + + fast-glob@3.3.2: + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.8 + + fastq@1.17.1: + dependencies: + reusify: 1.0.4 + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + foreground-child@3.3.0: + dependencies: + cross-spawn: 7.0.3 + signal-exit: 4.1.0 + + fsevents@2.3.3: + optional: true + + function-bind@1.1.2: {} + + get-caller-file@2.0.5: {} + + glob-parent@5.1.2: + dependencies: + is-glob: 4.0.3 + + glob-parent@6.0.2: + dependencies: + is-glob: 4.0.3 + + glob@10.4.5: + dependencies: + foreground-child: 3.3.0 + jackspeak: 3.4.3 + minimatch: 9.0.5 + minipass: 7.1.2 + package-json-from-dist: 1.0.0 + path-scurry: 1.11.1 + + has-flag@4.0.0: {} + + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + + is-binary-path@2.1.0: + dependencies: + binary-extensions: 2.3.0 + + is-core-module@2.15.1: + dependencies: + hasown: 2.0.2 + + is-extglob@2.1.1: {} + + is-fullwidth-code-point@3.0.0: {} + + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + + is-number@7.0.0: {} + + isexe@2.0.0: {} + + jackspeak@3.4.3: + dependencies: + '@isaacs/cliui': 8.0.2 + optionalDependencies: + '@pkgjs/parseargs': 0.11.0 + + jiti@1.21.6: {} + + lilconfig@2.1.0: {} + + lilconfig@3.1.2: {} + + lines-and-columns@1.2.4: {} + + lodash@4.17.21: {} + + lru-cache@10.4.3: {} + + merge2@1.4.1: {} + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + + minimatch@9.0.5: + dependencies: + brace-expansion: 2.0.1 + + minipass@7.1.2: {} + + mz@2.7.0: + dependencies: + any-promise: 1.3.0 + object-assign: 4.1.1 + thenify-all: 1.6.0 + + nanoid@3.3.7: {} + + normalize-path@3.0.0: {} + + object-assign@4.1.1: {} + + object-hash@3.0.0: {} + + package-json-from-dist@1.0.0: {} + + path-key@3.1.1: {} + + path-parse@1.0.7: {} + + path-scurry@1.11.1: + dependencies: + lru-cache: 10.4.3 + minipass: 7.1.2 + + picocolors@1.1.0: {} + + picomatch@2.3.1: {} + + pify@2.3.0: {} + + pirates@4.0.6: {} + + postcss-import@15.1.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + read-cache: 1.0.0 + resolve: 1.22.8 + + postcss-js@4.0.1(postcss@8.4.47): + dependencies: + camelcase-css: 2.0.1 + postcss: 8.4.47 + + postcss-load-config@4.0.2(postcss@8.4.47): + dependencies: + lilconfig: 3.1.2 + yaml: 2.5.1 + optionalDependencies: + postcss: 8.4.47 + + postcss-nested@6.2.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-selector-parser: 6.1.2 + + postcss-selector-parser@6.1.2: + dependencies: + cssesc: 3.0.0 + util-deprecate: 1.0.2 + + postcss-value-parser@4.2.0: {} + + postcss@8.4.47: + dependencies: + nanoid: 3.3.7 + picocolors: 1.1.0 + source-map-js: 1.2.1 + + queue-microtask@1.2.3: {} + + read-cache@1.0.0: + dependencies: + pify: 2.3.0 + + readdirp@3.6.0: + dependencies: + picomatch: 2.3.1 + + require-directory@2.1.1: {} + + resolve@1.22.8: + dependencies: + is-core-module: 2.15.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + + reusify@1.0.4: {} + + run-parallel@1.2.0: + dependencies: + queue-microtask: 1.2.3 + + rxjs@7.8.1: + dependencies: + tslib: 2.7.0 + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} + + shell-quote@1.8.1: {} + + signal-exit@4.1.0: {} + + source-map-js@1.2.1: {} + + string-width@4.2.3: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + + string-width@5.1.2: + dependencies: + eastasianwidth: 0.2.0 + emoji-regex: 9.2.2 + strip-ansi: 7.1.0 + + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + + strip-ansi@7.1.0: + dependencies: + ansi-regex: 6.1.0 + + sucrase@3.35.0: + dependencies: + '@jridgewell/gen-mapping': 0.3.5 + commander: 4.1.1 + glob: 10.4.5 + lines-and-columns: 1.2.4 + mz: 2.7.0 + pirates: 4.0.6 + ts-interface-checker: 0.1.13 + + supports-color@7.2.0: + dependencies: + has-flag: 4.0.0 + + supports-color@8.1.1: + dependencies: + has-flag: 4.0.0 + + supports-preserve-symlinks-flag@1.0.0: {} + + tailwindcss@3.4.13: + dependencies: + '@alloc/quick-lru': 5.2.0 + arg: 5.0.2 + chokidar: 3.6.0 + didyoumean: 1.2.2 + dlv: 1.1.3 + fast-glob: 3.3.2 + glob-parent: 6.0.2 + is-glob: 4.0.3 + jiti: 1.21.6 + lilconfig: 2.1.0 + micromatch: 4.0.8 + normalize-path: 3.0.0 + object-hash: 3.0.0 + picocolors: 1.1.0 + postcss: 8.4.47 + postcss-import: 15.1.0(postcss@8.4.47) + postcss-js: 4.0.1(postcss@8.4.47) + postcss-load-config: 4.0.2(postcss@8.4.47) + postcss-nested: 6.2.0(postcss@8.4.47) + postcss-selector-parser: 6.1.2 + resolve: 1.22.8 + sucrase: 3.35.0 + transitivePeerDependencies: + - ts-node + + thenify-all@1.6.0: + dependencies: + thenify: 3.3.1 + + thenify@3.3.1: + dependencies: + any-promise: 1.3.0 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + tree-kill@1.2.2: {} + + ts-interface-checker@0.1.13: {} + + tslib@2.7.0: {} + + util-deprecate@1.0.2: {} + + which@2.0.2: + dependencies: + isexe: 2.0.0 + + wrap-ansi@7.0.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + wrap-ansi@8.1.0: + dependencies: + ansi-styles: 6.2.1 + string-width: 5.1.2 + strip-ansi: 7.1.0 + + y18n@5.0.8: {} + + yaml@2.5.1: {} + + yargs-parser@21.1.1: {} + + yargs@17.7.2: + dependencies: + cliui: 8.0.1 + escalade: 3.2.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 diff --git a/public/css/input.css b/public/css/input.css new file mode 100644 index 0000000..b5c61c9 --- /dev/null +++ b/public/css/input.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/public/js/_hyperscript.min.js b/public/js/_hyperscript.min.js new file mode 100644 index 0000000..355c78a --- /dev/null +++ b/public/js/_hyperscript.min.js @@ -0,0 +1 @@ +(function(e,t){const r=t(e);if(typeof exports==="object"&&typeof exports["nodeName"]!=="string"){module.exports=r}else{e["_hyperscript"]=r;if("document"in e)e["_hyperscript"].browserInit()}})(typeof self!=="undefined"?self:this,(e=>{"use strict";const t={dynamicResolvers:[function(e,t){if(e==="Fixed"){return Number(t).toFixed()}else if(e.indexOf("Fixed:")===0){let r=e.split(":")[1];return Number(t).toFixed(parseInt(r))}}],String:function(e){if(e.toString){return e.toString()}else{return""+e}},Int:function(e){return parseInt(e)},Float:function(e){return parseFloat(e)},Number:function(e){return Number(e)},Date:function(e){return new Date(e)},Array:function(e){return Array.from(e)},JSON:function(e){return JSON.stringify(e)},Object:function(e){if(e instanceof String){e=e.toString()}if(typeof e==="string"){return JSON.parse(e)}else{return Object.assign({},e)}}};const r={attributes:"_, script, data-script",defaultTransition:"all 500ms ease-in",disableSelector:"[disable-scripting], [data-disable-scripting]",hideShowStrategies:{},conversions:t};class n{static OP_TABLE={"+":"PLUS","-":"MINUS","*":"MULTIPLY","/":"DIVIDE",".":"PERIOD","..":"ELLIPSIS","\\":"BACKSLASH",":":"COLON","%":"PERCENT","|":"PIPE","!":"EXCLAMATION","?":"QUESTION","#":"POUND","&":"AMPERSAND",$:"DOLLAR",";":"SEMI",",":"COMMA","(":"L_PAREN",")":"R_PAREN","<":"L_ANG",">":"R_ANG","<=":"LTE_ANG",">=":"GTE_ANG","==":"EQ","===":"EQQ","!=":"NEQ","!==":"NEQQ","{":"L_BRACE","}":"R_BRACE","[":"L_BRACKET","]":"R_BRACKET","=":"EQUALS"};static isValidCSSClassChar(e){return n.isAlpha(e)||n.isNumeric(e)||e==="-"||e==="_"||e===":"}static isValidCSSIDChar(e){return n.isAlpha(e)||n.isNumeric(e)||e==="-"||e==="_"||e===":"}static isWhitespace(e){return e===" "||e==="\t"||n.isNewline(e)}static positionString(e){return"[Line: "+e.line+", Column: "+e.column+"]"}static isNewline(e){return e==="\r"||e==="\n"}static isNumeric(e){return e>="0"&&e<="9"}static isAlpha(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}static isIdentifierChar(e,t){return e==="_"||e==="$"}static isReservedChar(e){return e==="`"||e==="^"}static isValidSingleQuoteStringStart(e){if(e.length>0){var t=e[e.length-1];if(t.type==="IDENTIFIER"||t.type==="CLASS_REF"||t.type==="ID_REF"){return false}if(t.op&&(t.value===">"||t.value===")")){return false}}return true}static tokenize(e,t){var r=[];var a=e;var o=0;var s=0;var u=1;var l="";var c=0;function f(){return t&&c===0}while(o=0){return this.consumeToken()}}requireToken(e,t){var r=this.matchToken(e,t);if(r){return r}else{this.raiseError(this,"Expected '"+e+"' but found '"+this.currentToken().value+"'")}}peekToken(e,t,r){t=t||0;r=r||"IDENTIFIER";if(this.tokens[t]&&this.tokens[t].value===e&&this.tokens[t].type===r){return this.tokens[t]}}matchToken(e,t){if(this.follows.indexOf(e)!==-1){return}t=t||"IDENTIFIER";if(this.currentToken()&&this.currentToken().value===e&&this.currentToken().type===t){return this.consumeToken()}}consumeToken(){var e=this.tokens.shift();this.consumed.push(e);this._lastConsumed=e;this.consumeWhitespace();return e}consumeUntil(e,t){var r=[];var n=this.token(0,true);while((t==null||n.type!==t)&&(e==null||n.value!==e)&&n.type!=="EOF"){var i=this.tokens.shift();this.consumed.push(i);r.push(n);n=this.token(0,true)}this.consumeWhitespace();return r}lastWhitespace(){if(this.consumed[this.consumed.length-1]&&this.consumed[this.consumed.length-1].type==="WHITESPACE"){return this.consumed[this.consumed.length-1].value}else{return""}}consumeUntilWhitespace(){return this.consumeUntil(null,"WHITESPACE")}hasMore(){return this.tokens.length>0}token(e,t){var r;var n=0;do{if(!t){while(this.tokens[n]&&this.tokens[n].type==="WHITESPACE"){n++}}r=this.tokens[n];e--;n++}while(e>-1);if(r){return r}else{return{type:"EOF",value:"<<>>"}}}currentToken(){return this.token(0)}lastMatch(){return this._lastConsumed}static sourceFor=function(){return this.programSource.substring(this.startToken.start,this.endToken.end)};static lineFor=function(){return this.programSource.split("\n")[this.startToken.line-1]};follows=[];pushFollow(e){this.follows.push(e)}popFollow(){this.follows.pop()}clearFollows(){var e=this.follows;this.follows=[];return e}restoreFollows(e){this.follows=e}}class a{constructor(e){this.runtime=e;this.possessivesDisabled=false;this.addGrammarElement("feature",(function(e,t,r){if(r.matchOpToken("(")){var n=e.requireElement("feature",r);r.requireOpToken(")");return n}var i=e.FEATURES[r.currentToken().value||""];if(i){return i(e,t,r)}}));this.addGrammarElement("command",(function(e,t,r){if(r.matchOpToken("(")){const t=e.requireElement("command",r);r.requireOpToken(")");return t}var n=e.COMMANDS[r.currentToken().value||""];let i;if(n){i=n(e,t,r)}else if(r.currentToken().type==="IDENTIFIER"){i=e.parseElement("pseudoCommand",r)}if(i){return e.parseElement("indirectStatement",r,i)}return i}));this.addGrammarElement("commandList",(function(e,t,r){if(r.hasMore()){var n=e.parseElement("command",r);if(n){r.matchToken("then");const t=e.parseElement("commandList",r);if(t)n.next=t;return n}}return{type:"emptyCommandListCommand",op:function(e){return t.findNext(this,e)},execute:function(e){return t.unifiedExec(this,e)}}}));this.addGrammarElement("leaf",(function(e,t,r){var n=e.parseAnyOf(e.LEAF_EXPRESSIONS,r);if(n==null){return e.parseElement("symbol",r)}return n}));this.addGrammarElement("indirectExpression",(function(e,t,r,n){for(var i=0;i{this.unifiedExec(e,t)})).catch((e=>{this.unifiedExec({op:function(){throw e}},t)}));return}else if(r===o.HALT){if(t.meta.finallyHandler&&!t.meta.handlingFinally){t.meta.handlingFinally=true;e=t.meta.finallyHandler}else{if(t.meta.onHalt){t.meta.onHalt()}if(t.meta.currentException){if(t.meta.reject){t.meta.reject(t.meta.currentException);return}else{throw t.meta.currentException}}else{return}}}else{e=r}}}unifiedEval(e,t){var r=[t];var n=false;var i=false;if(e.args){for(var a=0;a{r=this.wrapArrays(r);Promise.all(r).then((function(r){if(i){this.unwrapAsyncs(r)}try{var a=e.op.apply(e,r);t(a)}catch(e){n(e)}})).catch((function(e){n(e)}))}))}else{if(i){this.unwrapAsyncs(r)}return e.op.apply(e,r)}}_scriptAttrs=null;getScriptAttributes(){if(this._scriptAttrs==null){this._scriptAttrs=r.attributes.replace(/ /g,"").split(",")}return this._scriptAttrs}getScript(e){for(var t=0;t{this.initElement(e,e instanceof HTMLScriptElement&&e.type==="text/hyperscript"?document.body:e)}))}}initElement(e,t){if(e.closest&&e.closest(r.disableSelector)){return}var n=this.getInternalData(e);if(!n.initialized){var i=this.getScript(e);if(i){try{n.initialized=true;n.script=i;const r=this.lexer,s=this.parser;var a=r.tokenize(i);var o=s.parseHyperScript(a);if(!o)return;o.apply(t||e,e);setTimeout((()=>{this.triggerEvent(t||e,"load",{hyperscript:true})}),1)}catch(t){this.triggerEvent(e,"exception",{error:t});console.error("hyperscript errors were found on the following element:",e,"\n\n",t.message,t.stack)}}}}internalDataMap=new WeakMap;getInternalData(e){var t=this.internalDataMap.get(e);if(typeof t==="undefined"){this.internalDataMap.set(e,t={})}return t}typeCheck(e,t,r){if(e==null&&r){return true}var n=Object.prototype.toString.call(e).slice(8,-1);return n===t}getElementScope(e){var t=e.meta&&e.meta.owner;if(t){var r=this.getInternalData(t);var n="elementScope";if(e.meta.feature&&e.meta.feature.behavior){n=e.meta.feature.behavior+"Scope"}var i=h(r,n);return i}else{return{}}}isReservedWord(e){return["meta","it","result","locals","event","target","detail","sender","body"].includes(e)}isHyperscriptContext(e){return e instanceof f}resolveSymbol(t,r,n){if(t==="me"||t==="my"||t==="I"){return r.me}if(t==="it"||t==="its"||t==="result"){return r.result}if(t==="you"||t==="your"||t==="yourself"){return r.you}else{if(n==="global"){return e[t]}else if(n==="element"){var i=this.getElementScope(r);return i[t]}else if(n==="local"){return r.locals[t]}else{if(r.meta&&r.meta.context){var a=r.meta.context[t];if(typeof a!=="undefined"){return a}if(r.meta.context.detail){a=r.meta.context.detail[t];if(typeof a!=="undefined"){return a}}}if(this.isHyperscriptContext(r)&&!this.isReservedWord(t)){var o=r.locals[t]}else{var o=r[t]}if(typeof o!=="undefined"){return o}else{var i=this.getElementScope(r);o=i[t];if(typeof o!=="undefined"){return o}else{return e[t]}}}}}setSymbol(t,r,n,i){if(n==="global"){e[t]=i}else if(n==="element"){var a=this.getElementScope(r);a[t]=i}else if(n==="local"){r.locals[t]=i}else{if(this.isHyperscriptContext(r)&&!this.isReservedWord(t)&&typeof r.locals[t]!=="undefined"){r.locals[t]=i}else{var a=this.getElementScope(r);var o=a[t];if(typeof o!=="undefined"){a[t]=i}else{if(this.isHyperscriptContext(r)&&!this.isReservedWord(t)){r.locals[t]=i}else{r[t]=i}}}}}findNext(e,t){if(e){if(e.resolveNext){return e.resolveNext(t)}else if(e.next){return e.next}else{return this.findNext(e.parent,t)}}}flatGet(e,t,r){if(e!=null){var n=r(e,t);if(typeof n!=="undefined"){return n}if(this.shouldAutoIterate(e)){var i=[];for(var a of e){var o=r(a,t);i.push(o)}return i}}}resolveProperty(e,t){return this.flatGet(e,t,((e,t)=>e[t]))}resolveAttribute(e,t){return this.flatGet(e,t,((e,t)=>e.getAttribute&&e.getAttribute(t)))}resolveStyle(e,t){return this.flatGet(e,t,((e,t)=>e.style&&e.style[t]))}resolveComputedStyle(e,t){return this.flatGet(e,t,((e,t)=>getComputedStyle(e).getPropertyValue(t)))}assignToNamespace(t,r,n,i){let a;if(typeof document!=="undefined"&&t===document.body){a=e}else{a=this.getHyperscriptFeatures(t)}var o;while((o=r.shift())!==undefined){var s=a[o];if(s==null){s={};a[o]=s}a=s}a[n]=i}getHyperTrace(e,t){var r=[];var n=e;while(n.meta.caller){n=n.meta.caller}if(n.meta.traceMap){return n.meta.traceMap.get(t,r)}}registerHyperTrace(e,t){var r=[];var n=null;while(e!=null){r.push(e);n=e;e=e.meta.caller}if(n.meta.traceMap==null){n.meta.traceMap=new Map}if(!n.meta.traceMap.get(t)){var i={trace:r,print:function(e){e=e||console.error;e("hypertrace /// ");var t=0;for(var n=0;n",i.meta.feature.displayName.padEnd(t+2),"-",i.meta.owner)}}};n.meta.traceMap.set(t,i)}}escapeSelector(e){return e.replace(/:/g,(function(e){return"\\"+e}))}nullCheck(e,t){if(e==null){throw new Error("'"+t.sourceFor()+"' is null")}}isEmpty(e){return e==undefined||e.length===0}doesExist(e){if(e==null){return false}if(this.shouldAutoIterate(e)){for(const t of e){return true}return false}return true}getRootNode(e){if(e&&e instanceof Node){var t=e.getRootNode();if(t instanceof Document||t instanceof ShadowRoot)return t}return document}getEventQueueFor(e,t){let r=this.getInternalData(e);var n=r.eventQueues;if(n==null){n=new Map;r.eventQueues=n}var i=n.get(t);if(i==null){i={queue:[],executing:false};n.set(t,i)}return i}beepValueToConsole(e,t,r){if(this.triggerEvent(e,"hyperscript:beep",{element:e,expression:t,value:r})){var n;if(r){if(r instanceof m){n="ElementCollection"}else if(r.constructor){n=r.constructor.name}else{n="unknown"}}else{n="object (null)"}var a=r;if(n==="String"){a='"'+a+'"'}else if(r instanceof m){a=Array.from(r)}console.log("///_ BEEP! The expression ("+i.sourceFor.call(t).replace("beep! ","")+") evaluates to:",a,"of type "+n)}}hyperscriptUrl="document"in e&&document.currentScript?document.currentScript.src:null}function s(){let e=document.cookie.split("; ").map((e=>{let t=e.split("=");return{name:t[0],value:decodeURIComponent(t[1])}}));return e}function u(e){document.cookie=e+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT"}function l(){for(const e of s()){u(e.name)}}const c=new Proxy({},{get(e,t){if(t==="then"||t==="asyncWrapper"){return null}else if(t==="length"){return s().length}else if(t==="clear"){return u}else if(t==="clearAll"){return l}else if(typeof t==="string"){if(!isNaN(t)){return s()[parseInt(t)]}else{let e=document.cookie.split("; ").find((e=>e.startsWith(t+"=")))?.split("=")[1];if(e){return decodeURIComponent(e)}}}else if(t===Symbol.iterator){return s()[t]}},set(e,t,r){var n=null;if("string"===typeof r){n=encodeURIComponent(r);n+=";samesite=lax"}else{n=encodeURIComponent(r.value);if(r.expires){n+=";expires="+r.maxAge}if(r.maxAge){n+=";max-age="+r.maxAge}if(r.partitioned){n+=";partitioned="+r.partitioned}if(r.path){n+=";path="+r.path}if(r.samesite){n+=";samesite="+r.path}if(r.secure){n+=";secure="+r.path}}document.cookie=t+"="+n;return true}});class f{constructor(t,r,n,i,a){this.meta={parser:a.parser,lexer:a.lexer,runtime:a,owner:t,feature:r,iterators:{},ctx:this};this.locals={cookies:c};this.me=n,this.you=undefined;this.result=undefined;this.event=i;this.target=i?i.target:null;this.detail=i?i.detail:null;this.sender=i?i.detail?i.detail.sender:null:null;this.body="document"in e?document.body:null;a.addFeatures(t,this)}}class m{constructor(e,t,r){this._css=e;this.relativeToElement=t;this.escape=r;this[p]=true}get css(){if(this.escape){return o.prototype.escapeSelector(this._css)}else{return this._css}}get className(){return this._css.substr(1)}get id(){return this.className()}contains(e){for(let t of this){if(t.contains(e)){return true}}return false}get length(){return this.selectMatches().length}[Symbol.iterator](){let e=this.selectMatches();return e[Symbol.iterator]()}selectMatches(){let e=o.prototype.getRootNode(this.relativeToElement).querySelectorAll(this.css);return e}}const p=Symbol();function h(e,t){var r=e[t];if(r){return r}else{var n={};e[t]=n;return n}}function v(e){try{return JSON.parse(e)}catch(e){d(e);return null}}function d(e){if(console.error){console.error(e)}else if(console.log){console.log("ERROR: ",e)}}function E(e,t){return new(e.bind.apply(e,[e].concat(t)))}function T(t){t.addLeafExpression("parenthesized",(function(e,t,r){if(r.matchOpToken("(")){var n=r.clearFollows();try{var i=e.requireElement("expression",r)}finally{r.restoreFollows(n)}r.requireOpToken(")");return i}}));t.addLeafExpression("string",(function(e,t,r){var i=r.matchTokenType("STRING");if(!i)return;var a=i.value;var o;if(i.template){var s=n.tokenize(a,true);o=e.parseStringTemplate(s)}else{o=[]}return{type:"string",token:i,args:o,op:function(e){var t="";for(var r=1;re instanceof Element))}get css(){let e="",t=0;for(const r of this.templateParts){if(r instanceof Element){e+="[data-hs-query-id='"+t+++"']"}else e+=r}return e}[Symbol.iterator](){this.elements.forEach(((e,t)=>e.dataset.hsQueryId=t));const e=super[Symbol.iterator]();this.elements.forEach((e=>e.removeAttribute("data-hs-query-id")));return e}}t.addLeafExpression("queryRef",(function(e,t,i){var a=i.matchOpToken("<");if(!a)return;var o=i.consumeUntil("/");i.requireOpToken("/");i.requireOpToken(">");var s=o.map((function(e){if(e.type==="STRING"){return'"'+e.value+'"'}else{return e.value}})).join("");var u,l,c;if(s.indexOf("$")>=0){u=true;l=n.tokenize(s,true);c=e.parseStringTemplate(l)}return{type:"queryRef",css:s,args:c,op:function(e,...t){if(u){return new r(s,e.me,t)}else{return new m(s,e.me)}},evaluate:function(e){return t.unifiedEval(this,e)}}}));t.addLeafExpression("attributeRef",(function(e,t,r){var n=r.matchTokenType("ATTRIBUTE_REF");if(!n)return;if(!n.value)return;var i=n.value;if(i.indexOf("[")===0){var a=i.substring(2,i.length-1)}else{var a=i.substring(1)}var o="["+a+"]";var s=a.split("=");var u=s[0];var l=s[1];if(l){if(l.indexOf('"')===0){l=l.substring(1,l.length-1)}}return{type:"attributeRef",name:u,css:o,value:l,op:function(e){var t=e.you||e.me;if(t){return t.getAttribute(u)}},evaluate:function(e){return t.unifiedEval(this,e)}}}));t.addLeafExpression("styleRef",(function(e,t,r){var n=r.matchTokenType("STYLE_REF");if(!n)return;if(!n.value)return;var i=n.value.substr(1);if(i.startsWith("computed-")){i=i.substr("computed-".length);return{type:"computedStyleRef",name:i,op:function(e){var r=e.you||e.me;if(r){return t.resolveComputedStyle(r,i)}},evaluate:function(e){return t.unifiedEval(this,e)}}}else{return{type:"styleRef",name:i,op:function(e){var r=e.you||e.me;if(r){return t.resolveStyle(r,i)}},evaluate:function(e){return t.unifiedEval(this,e)}}}}));t.addGrammarElement("objectKey",(function(e,t,r){var n;if(n=r.matchTokenType("STRING")){return{type:"objectKey",key:n.value,evaluate:function(){return n.value}}}else if(r.matchOpToken("[")){var i=e.parseElement("expression",r);r.requireOpToken("]");return{type:"objectKey",expr:i,args:[i],op:function(e,t){return t},evaluate:function(e){return t.unifiedEval(this,e)}}}else{var a="";do{n=r.matchTokenType("IDENTIFIER")||r.matchOpToken("-");if(n)a+=n.value}while(n);return{type:"objectKey",key:a,evaluate:function(){return a}}}}));t.addLeafExpression("objectLiteral",(function(e,t,r){if(!r.matchOpToken("{"))return;var n=[];var i=[];if(!r.matchOpToken("}")){do{var a=e.requireElement("objectKey",r);r.requireOpToken(":");var o=e.requireElement("expression",r);i.push(o);n.push(a)}while(r.matchOpToken(","));r.requireOpToken("}")}return{type:"objectLiteral",args:[n,i],op:function(e,t,r){var n={};for(var i=0;i");var a=e.requireElement("expression",r);return{type:"blockLiteral",args:n,expr:a,evaluate:function(e){var t=function(){for(var t=0;t=0;a--){var o=i[a];if(o.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING){return o}}if(n){return i[i.length-1]}};var l=function(e,t,r,n){var i=[];o.prototype.forEach(t,(function(t){if(t.matches(r)||t===e){i.push(t)}}));for(var a=0;a","<=",">=","==","===","!=","!==");var a=i?i.value:null;var o=true;var s=false;if(a==null){if(r.matchToken("is")||r.matchToken("am")){if(r.matchToken("not")){if(r.matchToken("in")){a="not in"}else if(r.matchToken("a")){a="not a";s=true}else if(r.matchToken("empty")){a="not empty";o=false}else{if(r.matchToken("really")){a="!=="}else{a="!="}if(r.matchToken("equal")){r.matchToken("to")}}}else if(r.matchToken("in")){a="in"}else if(r.matchToken("a")){a="a";s=true}else if(r.matchToken("empty")){a="empty";o=false}else if(r.matchToken("less")){r.requireToken("than");if(r.matchToken("or")){r.requireToken("equal");r.requireToken("to");a="<="}else{a="<"}}else if(r.matchToken("greater")){r.requireToken("than");if(r.matchToken("or")){r.requireToken("equal");r.requireToken("to");a=">="}else{a=">"}}else{if(r.matchToken("really")){a="==="}else{a="=="}if(r.matchToken("equal")){r.matchToken("to")}}}else if(r.matchToken("equals")){a="=="}else if(r.matchToken("really")){r.requireToken("equals");a="==="}else if(r.matchToken("exist")||r.matchToken("exists")){a="exist";o=false}else if(r.matchToken("matches")||r.matchToken("match")){a="match"}else if(r.matchToken("contains")||r.matchToken("contain")){a="contain"}else if(r.matchToken("includes")||r.matchToken("include")){a="include"}else if(r.matchToken("do")||r.matchToken("does")){r.requireToken("not");if(r.matchToken("matches")||r.matchToken("match")){a="not match"}else if(r.matchToken("contains")||r.matchToken("contain")){a="not contain"}else if(r.matchToken("exist")||r.matchToken("exist")){a="not exist";o=false}else if(r.matchToken("include")){a="not include"}else{e.raiseParseError(r,"Expected matches or contains")}}}if(a){var u,l,c;if(s){u=r.requireTokenType("IDENTIFIER");l=!r.matchOpToken("!")}else if(o){c=e.requireElement("mathExpression",r);if(a==="match"||a==="not match"){c=c.css?c.css:c}}var m=n;n={type:"comparisonOperator",operator:a,typeName:u,nullOk:l,lhs:n,rhs:c,args:[n,c],op:function(e,r,n){if(a==="=="){return r==n}else if(a==="!="){return r!=n}if(a==="==="){return r===n}else if(a==="!=="){return r!==n}if(a==="match"){return r!=null&&p(m,r,n)}if(a==="not match"){return r==null||!p(m,r,n)}if(a==="in"){return n!=null&&f(c,n,r)}if(a==="not in"){return n==null||!f(c,n,r)}if(a==="contain"){return r!=null&&f(m,r,n)}if(a==="not contain"){return r==null||!f(m,r,n)}if(a==="include"){return r!=null&&f(m,r,n)}if(a==="not include"){return r==null||!f(m,r,n)}if(a==="==="){return r===n}else if(a==="!=="){return r!==n}else if(a==="<"){return r"){return r>n}else if(a==="<="){return r<=n}else if(a===">="){return r>=n}else if(a==="empty"){return t.isEmpty(r)}else if(a==="not empty"){return!t.isEmpty(r)}else if(a==="exist"){return t.doesExist(r)}else if(a==="not exist"){return!t.doesExist(r)}else if(a==="a"){return t.typeCheck(r,u.value,l)}else if(a==="not a"){return!t.typeCheck(r,u.value,l)}else{throw"Unknown comparison : "+a}},evaluate:function(e){return t.unifiedEval(this,e)}}}return n}));t.addGrammarElement("comparisonExpression",(function(e,t,r){return e.parseAnyOf(["comparisonOperator","mathExpression"],r)}));t.addGrammarElement("logicalOperator",(function(e,t,r){var n=e.parseElement("comparisonExpression",r);var i,a=null;i=r.matchToken("and")||r.matchToken("or");while(i){a=a||i;if(a.value!==i.value){e.raiseParseError(r,"You must parenthesize logical operations with different operators")}var o=e.requireElement("comparisonExpression",r);const s=i.value;n={type:"logicalOperator",operator:s,lhs:n,rhs:o,args:[n,o],op:function(e,t,r){if(s==="and"){return t&&r}else{return t||r}},evaluate:function(e){return t.unifiedEval(this,e)}};i=r.matchToken("and")||r.matchToken("or")}return n}));t.addGrammarElement("logicalExpression",(function(e,t,r){return e.parseAnyOf(["logicalOperator","mathExpression"],r)}));t.addGrammarElement("asyncExpression",(function(e,t,r){if(r.matchToken("async")){var n=e.requireElement("logicalExpression",r);var i={type:"asyncExpression",value:n,evaluate:function(e){return{asyncWrapper:true,value:this.value.evaluate(e)}}};return i}else{return e.parseElement("logicalExpression",r)}}));t.addGrammarElement("expression",(function(e,t,r){r.matchToken("the");return e.parseElement("asyncExpression",r)}));t.addGrammarElement("assignableExpression",(function(e,t,r){r.matchToken("the");var n=e.parseElement("primaryExpression",r);if(n&&(n.type==="symbol"||n.type==="ofExpression"||n.type==="propertyAccess"||n.type==="attributeRefAccess"||n.type==="attributeRef"||n.type==="styleRef"||n.type==="arrayIndex"||n.type==="possessive")){return n}else{e.raiseParseError(r,"A target expression must be writable. The expression type '"+(n&&n.type)+"' is not.")}return n}));t.addGrammarElement("hyperscript",(function(e,t,r){var n=[];if(r.hasMore()){while(e.featureStart(r.currentToken())||r.currentToken().value==="("){var i=e.requireElement("feature",r);n.push(i);r.matchToken("end")}}return{type:"hyperscript",features:n,apply:function(e,t,r){for(const i of n){i.install(e,t,r)}}}}));var v=function(e){var t=[];if(e.token(0).value==="("&&(e.token(1).value===")"||e.token(2).value===","||e.token(2).value===")")){e.matchOpToken("(");do{t.push(e.requireTokenType("IDENTIFIER"))}while(e.matchOpToken(","));e.requireOpToken(")")}return t};t.addFeature("on",(function(e,t,r){if(!r.matchToken("on"))return;var n=false;if(r.matchToken("every")){n=true}var i=[];var a=null;do{var o=e.requireElement("eventName",r,"Expected event name");var s=o.evaluate();if(a){a=a+" or "+s}else{a="on "+s}var u=v(r);var l=null;if(r.matchOpToken("[")){l=e.requireElement("expression",r);r.requireOpToken("]")}var c,f,m;if(r.currentToken().type==="NUMBER"){var p=r.consumeToken();if(!p.value)return;c=parseInt(p.value);if(r.matchToken("to")){var h=r.consumeToken();if(!h.value)return;f=parseInt(h.value)}else if(r.matchToken("and")){m=true;r.requireToken("on")}}var d,E;if(s==="intersection"){d={};if(r.matchToken("with")){d["with"]=e.requireElement("expression",r).evaluate()}if(r.matchToken("having")){do{if(r.matchToken("margin")){d["rootMargin"]=e.requireElement("stringLike",r).evaluate()}else if(r.matchToken("threshold")){d["threshold"]=e.requireElement("expression",r).evaluate()}else{e.raiseParseError(r,"Unknown intersection config specification")}}while(r.matchToken("and"))}}else if(s==="mutation"){E={};if(r.matchToken("of")){do{if(r.matchToken("anything")){E["attributes"]=true;E["subtree"]=true;E["characterData"]=true;E["childList"]=true}else if(r.matchToken("childList")){E["childList"]=true}else if(r.matchToken("attributes")){E["attributes"]=true;E["attributeOldValue"]=true}else if(r.matchToken("subtree")){E["subtree"]=true}else if(r.matchToken("characterData")){E["characterData"]=true;E["characterDataOldValue"]=true}else if(r.currentToken().type==="ATTRIBUTE_REF"){var T=r.consumeToken();if(E["attributeFilter"]==null){E["attributeFilter"]=[]}if(T.value.indexOf("@")==0){E["attributeFilter"].push(T.value.substring(1))}else{e.raiseParseError(r,"Only shorthand attribute references are allowed here")}}else{e.raiseParseError(r,"Unknown mutation config specification")}}while(r.matchToken("or"))}else{E["attributes"]=true;E["characterData"]=true;E["childList"]=true}}var y=null;var k=false;if(r.matchToken("from")){if(r.matchToken("elsewhere")){k=true}else{r.pushFollow("or");try{y=e.requireElement("expression",r)}finally{r.popFollow()}if(!y){e.raiseParseError(r,'Expected either target value or "elsewhere".')}}}if(y===null&&k===false&&r.matchToken("elsewhere")){k=true}if(r.matchToken("in")){var x=e.parseElement("unaryExpression",r)}if(r.matchToken("debounced")){r.requireToken("at");var g=e.requireElement("unaryExpression",r);var b=g.evaluate({})}else if(r.matchToken("throttled")){r.requireToken("at");var g=e.requireElement("unaryExpression",r);var w=g.evaluate({})}i.push({execCount:0,every:n,on:s,args:u,filter:l,from:y,inExpr:x,elsewhere:k,startCount:c,endCount:f,unbounded:m,debounceTime:b,throttleTime:w,mutationSpec:E,intersectionSpec:d,debounced:undefined,lastExec:undefined})}while(r.matchToken("or"));var S=true;if(!n){if(r.matchToken("queue")){if(r.matchToken("all")){var q=true;var S=false}else if(r.matchToken("first")){var N=true}else if(r.matchToken("none")){var I=true}else{r.requireToken("last")}}}var C=e.requireElement("commandList",r);e.ensureTerminated(C);var R,A;if(r.matchToken("catch")){R=r.requireTokenType("IDENTIFIER").value;A=e.requireElement("commandList",r);e.ensureTerminated(A)}if(r.matchToken("finally")){var L=e.requireElement("commandList",r);e.ensureTerminated(L)}var O={displayName:a,events:i,start:C,every:n,execCount:0,errorHandler:A,errorSymbol:R,execute:function(e){let r=t.getEventQueueFor(e.me,O);if(r.executing&&n===false){if(I||N&&r.queue.length>0){return}if(S){r.queue.length=0}r.queue.push(e);return}O.execCount++;r.executing=true;e.meta.onHalt=function(){r.executing=false;var e=r.queue.shift();if(e){setTimeout((function(){O.execute(e)}),1)}};e.meta.reject=function(r){console.error(r.message?r.message:r);var n=t.getHyperTrace(e,r);if(n){n.print()}t.triggerEvent(e.me,"exception",{error:r})};C.execute(e)},install:function(e,r){for(const r of O.events){var n;if(r.elsewhere){n=[document]}else if(r.from){n=r.from.evaluate(t.makeContext(e,O,e,null))}else{n=[e]}t.implicitLoop(n,(function(n){var i=r.on;if(n==null){console.warn("'%s' feature ignored because target does not exists:",a,e);return}if(r.mutationSpec){i="hyperscript:mutation";const e=new MutationObserver((function(e,r){if(!O.executing){t.triggerEvent(n,i,{mutationList:e,observer:r})}}));e.observe(n,r.mutationSpec)}if(r.intersectionSpec){i="hyperscript:intersection";const e=new IntersectionObserver((function(r){for(const o of r){var a={observer:e};a=Object.assign(a,o);a["intersecting"]=o.isIntersecting;t.triggerEvent(n,i,a)}}),r.intersectionSpec);e.observe(n)}var o=n.addEventListener||n.on;o.call(n,i,(function a(o){if(typeof Node!=="undefined"&&e instanceof Node&&n!==e&&!e.isConnected){n.removeEventListener(i,a);return}var s=t.makeContext(e,O,e,o);if(r.elsewhere&&e.contains(o.target)){return}if(r.from){s.result=n}for(const e of r.args){let t=s.event[e.value];if(t!==undefined){s.locals[e.value]=t}else if("detail"in s.event){s.locals[e.value]=s.event["detail"][e.value]}}s.meta.errorHandler=A;s.meta.errorSymbol=R;s.meta.finallyHandler=L;if(r.filter){var u=s.meta.context;s.meta.context=s.event;try{var l=r.filter.evaluate(s);if(l){}else{return}}finally{s.meta.context=u}}if(r.inExpr){var c=o.target;while(true){if(c.matches&&c.matches(r.inExpr.css)){s.result=c;break}else{c=c.parentElement;if(c==null){return}}}}r.execCount++;if(r.startCount){if(r.endCount){if(r.execCountr.endCount){return}}else if(r.unbounded){if(r.execCount{var a=false;for(const s of i){var o=n=>{e.result=n;if(s.args){for(const t of s.args){e.locals[t.value]=n[t.value]||(n.detail?n.detail[t.value]:null)}}if(!a){a=true;r(t.findNext(this,e))}};if(s.name){n.addEventListener(s.name,o,{once:true})}else if(s.time!=null){setTimeout(o,s.time,s.time)}}}))}};return n}else{var s;if(r.matchToken("a")){r.requireToken("tick");s=0}else{s=e.requireElement("expression",r)}n={type:"waitCmd",time:s,args:[s],op:function(e,r){return new Promise((n=>{setTimeout((()=>{n(t.findNext(this,e))}),r)}))},execute:function(e){return t.unifiedExec(this,e)}};return n}}));t.addGrammarElement("dotOrColonPath",(function(e,t,r){var n=r.matchTokenType("IDENTIFIER");if(n){var i=[n.value];var a=r.matchOpToken(".")||r.matchOpToken(":");if(a){do{i.push(r.requireTokenType("IDENTIFIER","NUMBER").value)}while(r.matchOpToken(a.value))}return{type:"dotOrColonPath",path:i,evaluate:function(){return i.join(a?a.value:"")}}}}));t.addGrammarElement("eventName",(function(e,t,r){var n;if(n=r.matchTokenType("STRING")){return{evaluate:function(){return n.value}}}return e.parseElement("dotOrColonPath",r)}));function d(e,t,r,n){var i=t.requireElement("eventName",n);var a=t.parseElement("namedArgumentList",n);if(e==="send"&&n.matchToken("to")||e==="trigger"&&n.matchToken("on")){var o=t.requireElement("expression",n)}else{var o=t.requireElement("implicitMeTarget",n)}var s={eventName:i,details:a,to:o,args:[o,i,a],op:function(e,t,n,i){r.nullCheck(t,o);r.implicitLoop(t,(function(t){r.triggerEvent(t,n,i,e.me)}));return r.findNext(s,e)}};return s}t.addCommand("trigger",(function(e,t,r){if(r.matchToken("trigger")){return d("trigger",e,t,r)}}));t.addCommand("send",(function(e,t,r){if(r.matchToken("send")){return d("send",e,t,r)}}));var T=function(e,t,r,n){if(n){if(e.commandBoundary(r.currentToken())){e.raiseParseError(r,"'return' commands must return a value. If you do not wish to return a value, use 'exit' instead.")}else{var i=e.requireElement("expression",r)}}var a={value:i,args:[i],op:function(e,r){var n=e.meta.resolve;e.meta.returned=true;e.meta.returnValue=r;if(n){if(r){n(r)}else{n()}}return t.HALT}};return a};t.addCommand("return",(function(e,t,r){if(r.matchToken("return")){return T(e,t,r,true)}}));t.addCommand("exit",(function(e,t,r){if(r.matchToken("exit")){return T(e,t,r,false)}}));t.addCommand("halt",(function(e,t,r){if(r.matchToken("halt")){if(r.matchToken("the")){r.requireToken("event");if(r.matchOpToken("'")){r.requireToken("s")}var n=true}if(r.matchToken("bubbling")){var i=true}else if(r.matchToken("default")){var a=true}var o=T(e,t,r,false);var s={keepExecuting:true,bubbling:i,haltDefault:a,exit:o,op:function(e){if(e.event){if(i){e.event.stopPropagation()}else if(a){e.event.preventDefault()}else{e.event.stopPropagation();e.event.preventDefault()}if(n){return t.findNext(this,e)}else{return o}}}};return s}}));t.addCommand("log",(function(e,t,r){if(!r.matchToken("log"))return;var n=[e.parseElement("expression",r)];while(r.matchOpToken(",")){n.push(e.requireElement("expression",r))}if(r.matchToken("with")){var i=e.requireElement("expression",r)}var a={exprs:n,withExpr:i,args:[i,n],op:function(e,r,n){if(r){r.apply(null,n)}else{console.log.apply(null,n)}return t.findNext(this,e)}};return a}));t.addCommand("beep!",(function(e,t,r){if(!r.matchToken("beep!"))return;var n=[e.parseElement("expression",r)];while(r.matchOpToken(",")){n.push(e.requireElement("expression",r))}var i={exprs:n,args:[n],op:function(e,r){for(let i=0;i{if(!r.matchToken("pick"))return;r.matchToken("the");if(r.matchToken("item")||r.matchToken("items")||r.matchToken("character")||r.matchToken("characters")){const n=g(e,t,r);r.requireToken("from");const i=e.requireElement("expression",r);return{args:[i,n.from,n.to],op(e,r,i,a){if(n.toEnd)a=r.length;if(!n.includeStart)i++;if(n.includeEnd)a++;if(a==null||a==undefined)a=i+1;e.result=r.slice(i,a);return t.findNext(this,e)}}}if(r.matchToken("match")){r.matchToken("of");const n=e.parseElement("expression",r);let i="";if(r.matchOpToken("|")){i=r.requireToken("identifier").value}r.requireToken("from");const a=e.parseElement("expression",r);return{args:[a,n],op(e,r,n){e.result=new RegExp(n,i).exec(r);return t.findNext(this,e)}}}if(r.matchToken("matches")){r.matchToken("of");const n=e.parseElement("expression",r);let i="gu";if(r.matchOpToken("|")){i="g"+r.requireToken("identifier").value.replace("g","")}console.log("flags",i);r.requireToken("from");const a=e.parseElement("expression",r);return{args:[a,n],op(e,r,n){e.result=new w(n,i,r);return t.findNext(this,e)}}}}));t.addCommand("increment",(function(e,t,r){if(!r.matchToken("increment"))return;var n;var i=e.parseElement("assignableExpression",r);if(r.matchToken("by")){n=e.requireElement("expression",r)}var a={type:"implicitIncrementOp",target:i,args:[i,n],op:function(e,t,r){t=t?parseFloat(t):0;r=n?parseFloat(r):1;var i=t+r;e.result=i;return i},evaluate:function(e){return t.unifiedEval(this,e)}};return k(e,t,r,i,a)}));t.addCommand("decrement",(function(e,t,r){if(!r.matchToken("decrement"))return;var n;var i=e.parseElement("assignableExpression",r);if(r.matchToken("by")){n=e.requireElement("expression",r)}var a={type:"implicitDecrementOp",target:i,args:[i,n],op:function(e,t,r){t=t?parseFloat(t):0;r=n?parseFloat(r):1;var i=t-r;e.result=i;return i},evaluate:function(e){return t.unifiedEval(this,e)}};return k(e,t,r,i,a)}));function S(e,t){var r="text";var n;e.matchToken("a")||e.matchToken("an");if(e.matchToken("json")||e.matchToken("Object")){r="json"}else if(e.matchToken("response")){r="response"}else if(e.matchToken("html")){r="html"}else if(e.matchToken("text")){}else{n=t.requireElement("dotOrColonPath",e).evaluate()}return{type:r,conversion:n}}t.addCommand("fetch",(function(e,t,r){if(!r.matchToken("fetch"))return;var n=e.requireElement("stringLike",r);if(r.matchToken("as")){var i=S(r,e)}if(r.matchToken("with")&&r.currentToken().value!=="{"){var a=e.parseElement("nakedNamedArgumentList",r)}else{var a=e.parseElement("objectLiteral",r)}if(i==null&&r.matchToken("as")){i=S(r,e)}var o=i?i.type:"text";var s=i?i.conversion:null;var u={url:n,argExpressions:a,args:[n,a],op:function(e,r,n){var i=n||{};i["sender"]=e.me;i["headers"]=i["headers"]||{};var a=new AbortController;let l=e.me.addEventListener("fetch:abort",(function(){a.abort()}),{once:true});i["signal"]=a.signal;t.triggerEvent(e.me,"hyperscript:beforeFetch",i);t.triggerEvent(e.me,"fetch:beforeRequest",i);n=i;var c=false;if(n.timeout){setTimeout((function(){if(!c){a.abort()}}),n.timeout)}return fetch(r,n).then((function(r){let n={response:r};t.triggerEvent(e.me,"fetch:afterResponse",n);r=n.response;if(o==="response"){e.result=r;t.triggerEvent(e.me,"fetch:afterRequest",{result:r});c=true;return t.findNext(u,e)}if(o==="json"){return r.json().then((function(r){e.result=r;t.triggerEvent(e.me,"fetch:afterRequest",{result:r});c=true;return t.findNext(u,e)}))}return r.text().then((function(r){if(s)r=t.convertValue(r,s);if(o==="html")r=t.convertValue(r,"Fragment");e.result=r;t.triggerEvent(e.me,"fetch:afterRequest",{result:r});c=true;return t.findNext(u,e)}))})).catch((function(r){t.triggerEvent(e.me,"fetch:error",{reason:r});throw r})).finally((function(){e.me.removeEventListener("fetch:abort",l)}))}};return u}))}function y(e){e.addCommand("settle",(function(e,t,r){if(r.matchToken("settle")){if(!e.commandBoundary(r.currentToken())){var n=e.requireElement("expression",r)}else{var n=e.requireElement("implicitMeTarget",r)}var i={type:"settleCmd",args:[n],op:function(e,r){t.nullCheck(r,n);var a=null;var o=false;var s=false;var u=new Promise((function(e){a=e}));r.addEventListener("transitionstart",(function(){s=true}),{once:true});setTimeout((function(){if(!s&&!o){a(t.findNext(i,e))}}),500);r.addEventListener("transitionend",(function(){if(!o){a(t.findNext(i,e))}}),{once:true});return u},execute:function(e){return t.unifiedExec(this,e)}};return i}}));e.addCommand("add",(function(e,t,r){if(r.matchToken("add")){var n=e.parseElement("classRef",r);var i=null;var a=null;if(n==null){i=e.parseElement("attributeRef",r);if(i==null){a=e.parseElement("styleLiteral",r);if(a==null){e.raiseParseError(r,"Expected either a class reference or attribute expression")}}}else{var o=[n];while(n=e.parseElement("classRef",r)){o.push(n)}}if(r.matchToken("to")){var s=e.requireElement("expression",r)}else{var s=e.requireElement("implicitMeTarget",r)}if(r.matchToken("when")){if(a){e.raiseParseError(r,"Only class and properties are supported with a when clause")}var u=e.requireElement("expression",r)}if(o){return{classRefs:o,to:s,args:[s,o],op:function(e,r,n){t.nullCheck(r,s);t.forEach(n,(function(n){t.implicitLoop(r,(function(r){if(u){e.result=r;let i=t.evaluateNoPromise(u,e);if(i){if(r instanceof Element)r.classList.add(n.className)}else{if(r instanceof Element)r.classList.remove(n.className)}e.result=null}else{if(r instanceof Element)r.classList.add(n.className)}}))}));return t.findNext(this,e)}}}else if(i){return{type:"addCmd",attributeRef:i,to:s,args:[s],op:function(e,r,n){t.nullCheck(r,s);t.implicitLoop(r,(function(r){if(u){e.result=r;let n=t.evaluateNoPromise(u,e);if(n){r.setAttribute(i.name,i.value)}else{r.removeAttribute(i.name)}e.result=null}else{r.setAttribute(i.name,i.value)}}));return t.findNext(this,e)},execute:function(e){return t.unifiedExec(this,e)}}}else{return{type:"addCmd",cssDeclaration:a,to:s,args:[s,a],op:function(e,r,n){t.nullCheck(r,s);t.implicitLoop(r,(function(e){e.style.cssText+=n}));return t.findNext(this,e)},execute:function(e){return t.unifiedExec(this,e)}}}}}));e.addGrammarElement("styleLiteral",(function(e,t,r){if(!r.matchOpToken("{"))return;var n=[""];var i=[];while(r.hasMore()){if(r.matchOpToken("\\")){r.consumeToken()}else if(r.matchOpToken("}")){break}else if(r.matchToken("$")){var a=r.matchOpToken("{");var o=e.parseElement("expression",r);if(a)r.requireOpToken("}");i.push(o);n.push("")}else{var s=r.consumeToken();n[n.length-1]+=r.source.substring(s.start,s.end)}n[n.length-1]+=r.lastWhitespace()}return{type:"styleLiteral",args:[i],op:function(e,t){var r="";n.forEach((function(e,n){r+=e;if(n in t)r+=t[n]}));return r},evaluate:function(e){return t.unifiedEval(this,e)}}}));e.addCommand("remove",(function(e,t,r){if(r.matchToken("remove")){var n=e.parseElement("classRef",r);var i=null;var a=null;if(n==null){i=e.parseElement("attributeRef",r);if(i==null){a=e.parseElement("expression",r);if(a==null){e.raiseParseError(r,"Expected either a class reference, attribute expression or value expression")}}}else{var o=[n];while(n=e.parseElement("classRef",r)){o.push(n)}}if(r.matchToken("from")){var s=e.requireElement("expression",r)}else{if(a==null){var s=e.requireElement("implicitMeTarget",r)}}if(a){return{elementExpr:a,from:s,args:[a,s],op:function(e,r,n){t.nullCheck(r,a);t.implicitLoop(r,(function(e){if(e.parentElement&&(n==null||n.contains(e))){e.parentElement.removeChild(e)}}));return t.findNext(this,e)}}}else{return{classRefs:o,attributeRef:i,elementExpr:a,from:s,args:[o,s],op:function(e,r,n){t.nullCheck(n,s);if(r){t.forEach(r,(function(e){t.implicitLoop(n,(function(t){t.classList.remove(e.className)}))}))}else{t.implicitLoop(n,(function(e){e.removeAttribute(i.name)}))}return t.findNext(this,e)}}}}}));e.addCommand("toggle",(function(e,t,r){if(r.matchToken("toggle")){r.matchAnyToken("the","my");if(r.currentToken().type==="STYLE_REF"){let t=r.consumeToken();var n=t.value.substr(1);var a=true;var o=i(e,r,n);if(r.matchToken("of")){r.pushFollow("with");try{var s=e.requireElement("expression",r)}finally{r.popFollow()}}else{var s=e.requireElement("implicitMeTarget",r)}}else if(r.matchToken("between")){var u=true;var l=e.parseElement("classRef",r);r.requireToken("and");var c=e.requireElement("classRef",r)}else{var l=e.parseElement("classRef",r);var f=null;if(l==null){f=e.parseElement("attributeRef",r);if(f==null){e.raiseParseError(r,"Expected either a class reference or attribute expression")}}else{var m=[l];while(l=e.parseElement("classRef",r)){m.push(l)}}}if(a!==true){if(r.matchToken("on")){var s=e.requireElement("expression",r)}else{var s=e.requireElement("implicitMeTarget",r)}}if(r.matchToken("for")){var p=e.requireElement("expression",r)}else if(r.matchToken("until")){var h=e.requireElement("dotOrColonPath",r,"Expected event name");if(r.matchToken("from")){var v=e.requireElement("expression",r)}}var d={classRef:l,classRef2:c,classRefs:m,attributeRef:f,on:s,time:p,evt:h,from:v,toggle:function(e,r,n,i){t.nullCheck(e,s);if(a){t.implicitLoop(e,(function(e){o("toggle",e)}))}else if(u){t.implicitLoop(e,(function(e){if(e.classList.contains(r.className)){e.classList.remove(r.className);e.classList.add(n.className)}else{e.classList.add(r.className);e.classList.remove(n.className)}}))}else if(i){t.forEach(i,(function(r){t.implicitLoop(e,(function(e){e.classList.toggle(r.className)}))}))}else{t.forEach(e,(function(e){if(e.hasAttribute(f.name)){e.removeAttribute(f.name)}else{e.setAttribute(f.name,f.value)}}))}},args:[s,p,h,v,l,c,m],op:function(e,r,n,i,a,o,s,u){if(n){return new Promise((function(i){d.toggle(r,o,s,u);setTimeout((function(){d.toggle(r,o,s,u);i(t.findNext(d,e))}),n)}))}else if(i){return new Promise((function(n){var l=a||e.me;l.addEventListener(i,(function(){d.toggle(r,o,s,u);n(t.findNext(d,e))}),{once:true});d.toggle(r,o,s,u)}))}else{this.toggle(r,o,s,u);return t.findNext(d,e)}}};return d}}));var t={display:function(r,n,i){if(i){n.style.display=i}else if(r==="toggle"){if(getComputedStyle(n).display==="none"){t.display("show",n,i)}else{t.display("hide",n,i)}}else if(r==="hide"){const t=e.runtime.getInternalData(n);if(t.originalDisplay==null){t.originalDisplay=n.style.display}n.style.display="none"}else{const t=e.runtime.getInternalData(n);if(t.originalDisplay&&t.originalDisplay!=="none"){n.style.display=t.originalDisplay}else{n.style.removeProperty("display")}}},visibility:function(e,r,n){if(n){r.style.visibility=n}else if(e==="toggle"){if(getComputedStyle(r).visibility==="hidden"){t.visibility("show",r,n)}else{t.visibility("hide",r,n)}}else if(e==="hide"){r.style.visibility="hidden"}else{r.style.visibility="visible"}},opacity:function(e,r,n){if(n){r.style.opacity=n}else if(e==="toggle"){if(getComputedStyle(r).opacity==="0"){t.opacity("show",r,n)}else{t.opacity("hide",r,n)}}else if(e==="hide"){r.style.opacity="0"}else{r.style.opacity="1"}}};var n=function(e,t,r){var n;var i=r.currentToken();if(i.value==="when"||i.value==="with"||e.commandBoundary(i)){n=e.parseElement("implicitMeTarget",r)}else{n=e.parseElement("expression",r)}return n};var i=function(e,n,i){var a=r.defaultHideShowStrategy;var o=t;if(r.hideShowStrategies){o=Object.assign(o,r.hideShowStrategies)}i=i||a||"display";var s=o[i];if(s==null){e.raiseParseError(n,"Unknown show/hide strategy : "+i)}return s};e.addCommand("hide",(function(e,t,r){if(r.matchToken("hide")){var a=n(e,t,r);var o=null;if(r.matchToken("with")){o=r.requireTokenType("IDENTIFIER","STYLE_REF").value;if(o.indexOf("*")===0){o=o.substr(1)}}var s=i(e,r,o);return{target:a,args:[a],op:function(e,r){t.nullCheck(r,a);t.implicitLoop(r,(function(e){s("hide",e)}));return t.findNext(this,e)}}}}));e.addCommand("show",(function(e,t,r){if(r.matchToken("show")){var a=n(e,t,r);var o=null;if(r.matchToken("with")){o=r.requireTokenType("IDENTIFIER","STYLE_REF").value;if(o.indexOf("*")===0){o=o.substr(1)}}var s=null;if(r.matchOpToken(":")){var u=r.consumeUntilWhitespace();r.matchTokenType("WHITESPACE");s=u.map((function(e){return e.value})).join("")}if(r.matchToken("when")){var l=e.requireElement("expression",r)}var c=i(e,r,o);return{target:a,when:l,args:[a],op:function(e,r){t.nullCheck(r,a);t.implicitLoop(r,(function(r){if(l){e.result=r;let n=t.evaluateNoPromise(l,e);if(n){c("show",r,s)}else{c("hide",r)}e.result=null}else{c("show",r,s)}}));return t.findNext(this,e)}}}}));e.addCommand("take",(function(e,t,r){if(r.matchToken("take")){let u=null;let l=[];while(u=e.parseElement("classRef",r)){l.push(u)}var n=null;var i=null;let c=l.length>0;if(!c){n=e.parseElement("attributeRef",r);if(n==null){e.raiseParseError(r,"Expected either a class reference or attribute expression")}if(r.matchToken("with")){i=e.requireElement("expression",r)}}if(r.matchToken("from")){var a=e.requireElement("expression",r)}if(r.matchToken("for")){var o=e.requireElement("expression",r)}else{var o=e.requireElement("implicitMeTarget",r)}if(c){var s={classRefs:l,from:a,forElt:o,args:[l,a,o],op:function(e,r,n,i){t.nullCheck(i,o);t.implicitLoop(r,(function(e){var r=e.className;if(n){t.implicitLoop(n,(function(e){e.classList.remove(r)}))}else{t.implicitLoop(e,(function(e){e.classList.remove(r)}))}t.implicitLoop(i,(function(e){e.classList.add(r)}))}));return t.findNext(this,e)}};return s}else{var s={attributeRef:n,from:a,forElt:o,args:[a,o,i],op:function(e,r,i,s){t.nullCheck(r,a);t.nullCheck(i,o);t.implicitLoop(r,(function(e){if(!s){e.removeAttribute(n.name)}else{e.setAttribute(n.name,s)}}));t.implicitLoop(i,(function(e){e.setAttribute(n.name,n.value||"")}));return t.findNext(this,e)}};return s}}}));function a(t,r,n,i){if(n!=null){var a=t.resolveSymbol(n,r)}else{var a=r}if(a instanceof Element||a instanceof HTMLDocument){while(a.firstChild)a.removeChild(a.firstChild);a.append(e.runtime.convertValue(i,"Fragment"));t.processNode(a)}else{if(n!=null){t.setSymbol(n,r,null,i)}else{throw"Don't know how to put a value into "+typeof r}}}e.addCommand("put",(function(e,t,r){if(r.matchToken("put")){var n=e.requireElement("expression",r);var i=r.matchAnyToken("into","before","after");if(i==null&&r.matchToken("at")){r.matchToken("the");i=r.matchAnyToken("start","end");r.requireToken("of")}if(i==null){e.raiseParseError(r,"Expected one of 'into', 'before', 'at start of', 'at end of', 'after'")}var o=e.requireElement("expression",r);var s=i.value;var u=false;var l=false;var c=null;var f=null;if(o.type==="arrayIndex"&&s==="into"){u=true;f=o.prop;c=o.root}else if(o.prop&&o.root&&s==="into"){f=o.prop.value;c=o.root}else if(o.type==="symbol"&&s==="into"){l=true;f=o.name}else if(o.type==="attributeRef"&&s==="into"){var m=true;f=o.name;c=e.requireElement("implicitMeTarget",r)}else if(o.type==="styleRef"&&s==="into"){var p=true;f=o.name;c=e.requireElement("implicitMeTarget",r)}else if(o.attribute&&s==="into"){var m=o.attribute.type==="attributeRef";var p=o.attribute.type==="styleRef";f=o.attribute.name;c=o.root}else{c=o}var h={target:o,operation:s,symbolWrite:l,value:n,args:[c,f,n],op:function(e,r,n,i){if(l){a(t,e,n,i)}else{t.nullCheck(r,c);if(s==="into"){if(m){t.implicitLoop(r,(function(e){e.setAttribute(n,i)}))}else if(p){t.implicitLoop(r,(function(e){e.style[n]=i}))}else if(u){r[n]=i}else{t.implicitLoop(r,(function(e){a(t,e,n,i)}))}}else{var o=s==="before"?Element.prototype.before:s==="after"?Element.prototype.after:s==="start"?Element.prototype.prepend:s==="end"?Element.prototype.append:Element.prototype.append;t.implicitLoop(r,(function(e){o.call(e,i instanceof Node?i:t.convertValue(i,"Fragment"));if(e.parentElement){t.processNode(e.parentElement)}else{t.processNode(e)}}))}}return t.findNext(this,e)}};return h}}));function o(e,t,r){var n;if(r.matchToken("the")||r.matchToken("element")||r.matchToken("elements")||r.currentToken().type==="CLASS_REF"||r.currentToken().type==="ID_REF"||r.currentToken().op&&r.currentToken().value==="<"){e.possessivesDisabled=true;try{n=e.parseElement("expression",r)}finally{delete e.possessivesDisabled}if(r.matchOpToken("'")){r.requireToken("s")}}else if(r.currentToken().type==="IDENTIFIER"&&r.currentToken().value==="its"){var i=r.matchToken("its");n={type:"pseudopossessiveIts",token:i,name:i.value,evaluate:function(e){return t.resolveSymbol("it",e)}}}else{r.matchToken("my")||r.matchToken("me");n=e.parseElement("implicitMeTarget",r)}return n}e.addCommand("transition",(function(e,t,n){if(n.matchToken("transition")){var i=o(e,t,n);var a=[];var s=[];var u=[];var l=n.currentToken();while(!e.commandBoundary(l)&&l.value!=="over"&&l.value!=="using"){if(n.currentToken().type==="STYLE_REF"){let e=n.consumeToken();let t=e.value.substr(1);a.push({type:"styleRefValue",evaluate:function(){return t}})}else{a.push(e.requireElement("stringLike",n))}if(n.matchToken("from")){s.push(e.requireElement("expression",n))}else{s.push(null)}n.requireToken("to");if(n.matchToken("initial")){u.push({type:"initial_literal",evaluate:function(){return"initial"}})}else{u.push(e.requireElement("expression",n))}l=n.currentToken()}if(n.matchToken("over")){var c=e.requireElement("expression",n)}else if(n.matchToken("using")){var f=e.requireElement("expression",n)}var m={to:u,args:[i,a,s,u,f,c],op:function(e,n,a,o,s,u,l){t.nullCheck(n,i);var c=[];t.implicitLoop(n,(function(e){var n=new Promise((function(n,i){var c=e.style.transition;if(l){e.style.transition="all "+l+"ms ease-in"}else if(u){e.style.transition=u}else{e.style.transition=r.defaultTransition}var f=t.getInternalData(e);var m=getComputedStyle(e);var p={};for(var h=0;he.forEach((e=>S(e))))).then((()=>n((function(){a();k.processNode(document.documentElement);e.document.addEventListener("htmx:load",(function(e){k.processNode(e.detail.elt)}))}))));function n(e){if(document.readyState!=="loading"){setTimeout(e)}else{document.addEventListener("DOMContentLoaded",e)}}function i(){var e=document.querySelector('meta[name="htmx-config"]');if(e){return v(e.content)}else{return null}}function a(){var e=i();if(e){Object.assign(r,e)}}}const S=Object.assign(b,{config:r,use(e){e(S)},internals:{lexer:x,parser:g,runtime:k,Lexer:n,Tokens:i,Parser:a,Runtime:o},ElementCollection:m,addFeature:g.addFeature.bind(g),addCommand:g.addCommand.bind(g),addLeafExpression:g.addLeafExpression.bind(g),addIndirectExpression:g.addIndirectExpression.bind(g),evaluate:k.evaluate.bind(k),parse:k.parse.bind(k),processNode:k.processNode.bind(k),version:"0.9.12",browserInit:w});return S})); diff --git a/public/js/htmx.min.js b/public/js/htmx.min.js new file mode 100644 index 0000000..de9e7dd --- /dev/null +++ b/public/js/htmx.min.js @@ -0,0 +1 @@ +var htmx = function() { "use strict"; const Q = { onLoad: null, process: null, on: null, off: null, trigger: null, ajax: null, find: null, findAll: null, closest: null, values: function(e, t) { const n = cn(e, t || "post"); return n.values }, remove: null, addClass: null, removeClass: null, toggleClass: null, takeClass: null, swap: null, defineExtension: null, removeExtension: null, logAll: null, logNone: null, logger: null, config: { historyEnabled: true, historyCacheSize: 10, refreshOnHistoryMiss: false, defaultSwapStyle: "innerHTML", defaultSwapDelay: 0, defaultSettleDelay: 20, includeIndicatorStyles: true, indicatorClass: "htmx-indicator", requestClass: "htmx-request", addedClass: "htmx-added", settlingClass: "htmx-settling", swappingClass: "htmx-swapping", allowEval: true, allowScriptTags: true, inlineScriptNonce: "", inlineStyleNonce: "", attributesToSettle: ["class", "style", "width", "height"], withCredentials: false, timeout: 0, wsReconnectDelay: "full-jitter", wsBinaryType: "blob", disableSelector: "[hx-disable], [data-hx-disable]", scrollBehavior: "instant", defaultFocusScroll: false, getCacheBusterParam: false, globalViewTransitions: false, methodsThatUseUrlParams: ["get", "delete"], selfRequestsOnly: true, ignoreTitle: false, scrollIntoViewOnBoost: true, triggerSpecsCache: null, disableInheritance: false, responseHandling: [{ code: "204", swap: false }, { code: "[23]..", swap: true }, { code: "[45]..", swap: false, error: true }], allowNestedOobSwaps: true }, parseInterval: null, _: null, version: "2.0.2" }; Q.onLoad = $; Q.process = Dt; Q.on = be; Q.off = we; Q.trigger = de; Q.ajax = Hn; Q.find = r; Q.findAll = p; Q.closest = g; Q.remove = K; Q.addClass = Y; Q.removeClass = o; Q.toggleClass = W; Q.takeClass = ge; Q.swap = ze; Q.defineExtension = Bn; Q.removeExtension = Un; Q.logAll = z; Q.logNone = J; Q.parseInterval = h; Q._ = _; const n = { addTriggerHandler: Et, bodyContains: le, canAccessLocalStorage: j, findThisElement: Ee, filterValues: hn, swap: ze, hasAttribute: s, getAttributeValue: te, getClosestAttributeValue: re, getClosestMatch: T, getExpressionVars: Cn, getHeaders: dn, getInputValues: cn, getInternalData: ie, getSwapSpecification: pn, getTriggerSpecs: lt, getTarget: Ce, makeFragment: D, mergeObjects: ue, makeSettleInfo: xn, oobSwap: Te, querySelectorExt: ae, settleImmediately: Gt, shouldCancel: ht, triggerEvent: de, triggerErrorEvent: fe, withExtensions: Bt }; const v = ["get", "post", "put", "delete", "patch"]; const O = v.map(function(e) { return "[hx-" + e + "], [data-hx-" + e + "]" }).join(", "); const R = e("head"); function e(e, t = false) { return new RegExp(`<${e}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${e}>`, t ? "gim" : "im") } function h(e) { if (e == undefined) { return undefined } let t = NaN; if (e.slice(-2) == "ms") { t = parseFloat(e.slice(0, -2)) } else if (e.slice(-1) == "s") { t = parseFloat(e.slice(0, -1)) * 1e3 } else if (e.slice(-1) == "m") { t = parseFloat(e.slice(0, -1)) * 1e3 * 60 } else { t = parseFloat(e) } return isNaN(t) ? undefined : t } function ee(e, t) { return e instanceof Element && e.getAttribute(t) } function s(e, t) { return !!e.hasAttribute && (e.hasAttribute(t) || e.hasAttribute("data-" + t)) } function te(e, t) { return ee(e, t) || ee(e, "data-" + t) } function u(e) { const t = e.parentElement; if (!t && e.parentNode instanceof ShadowRoot) return e.parentNode; return t } function ne() { return document } function H(e, t) { return e.getRootNode ? e.getRootNode({ composed: t }) : ne() } function T(e, t) { while (e && !t(e)) { e = u(e) } return e || null } function q(e, t, n) { const r = te(t, n); const o = te(t, "hx-disinherit"); var i = te(t, "hx-inherit"); if (e !== t) { if (Q.config.disableInheritance) { if (i && (i === "*" || i.split(" ").indexOf(n) >= 0)) { return r } else { return null } } if (o && (o === "*" || o.split(" ").indexOf(n) >= 0)) { return "unset" } } return r } function re(t, n) { let r = null; T(t, function(e) { return !!(r = q(t, ce(e), n)) }); if (r !== "unset") { return r } } function f(e, t) { const n = e instanceof Element && (e.matches || e.matchesSelector || e.msMatchesSelector || e.mozMatchesSelector || e.webkitMatchesSelector || e.oMatchesSelector); return !!n && n.call(e, t) } function L(e) { const t = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i; const n = t.exec(e); if (n) { return n[1].toLowerCase() } else { return "" } } function N(e) { const t = new DOMParser; return t.parseFromString(e, "text/html") } function A(e, t) { while (t.childNodes.length > 0) { e.append(t.childNodes[0]) } } function I(e) { const t = ne().createElement("script"); se(e.attributes, function(e) { t.setAttribute(e.name, e.value) }); t.textContent = e.textContent; t.async = false; if (Q.config.inlineScriptNonce) { t.nonce = Q.config.inlineScriptNonce } return t } function P(e) { return e.matches("script") && (e.type === "text/javascript" || e.type === "module" || e.type === "") } function k(e) { Array.from(e.querySelectorAll("script")).forEach(e => { if (P(e)) { const t = I(e); const n = e.parentNode; try { n.insertBefore(t, e) } catch (e) { w(e) } finally { e.remove() } } }) } function D(e) { const t = e.replace(R, ""); const n = L(t); let r; if (n === "html") { r = new DocumentFragment; const i = N(e); A(r, i.body); r.title = i.title } else if (n === "body") { r = new DocumentFragment; const i = N(t); A(r, i.body); r.title = i.title } else { const i = N('"); r = i.querySelector("template").content; r.title = i.title; var o = r.querySelector("title"); if (o && o.parentNode === r) { o.remove(); r.title = o.innerText } } if (r) { if (Q.config.allowScriptTags) { k(r) } else { r.querySelectorAll("script").forEach(e => e.remove()) } } return r } function oe(e) { if (e) { e() } } function t(e, t) { return Object.prototype.toString.call(e) === "[object " + t + "]" } function M(e) { return typeof e === "function" } function X(e) { return t(e, "Object") } function ie(e) { const t = "htmx-internal-data"; let n = e[t]; if (!n) { n = e[t] = {} } return n } function F(t) { const n = []; if (t) { for (let e = 0; e < t.length; e++) { n.push(t[e]) } } return n } function se(t, n) { if (t) { for (let e = 0; e < t.length; e++) { n(t[e]) } } } function B(e) { const t = e.getBoundingClientRect(); const n = t.top; const r = t.bottom; return n < window.innerHeight && r >= 0 } function le(e) { const t = e.getRootNode && e.getRootNode(); if (t && t instanceof window.ShadowRoot) { return ne().body.contains(t.host) } else { return ne().body.contains(e) } } function U(e) { return e.trim().split(/\s+/) } function ue(e, t) { for (const n in t) { if (t.hasOwnProperty(n)) { e[n] = t[n] } } return e } function S(e) { try { return JSON.parse(e) } catch (e) { w(e); return null } } function j() { const e = "htmx:localStorageTest"; try { localStorage.setItem(e, e); localStorage.removeItem(e); return true } catch (e) { return false } } function V(t) { try { const e = new URL(t); if (e) { t = e.pathname + e.search } if (!/^\/$/.test(t)) { t = t.replace(/\/+$/, "") } return t } catch (e) { return t } } function _(e) { return vn(ne().body, function() { return eval(e) }) } function $(t) { const e = Q.on("htmx:load", function(e) { t(e.detail.elt) }); return e } function z() { Q.logger = function(e, t, n) { if (console) { console.log(t, e, n) } } } function J() { Q.logger = null } function r(e, t) { if (typeof e !== "string") { return e.querySelector(t) } else { return r(ne(), e) } } function p(e, t) { if (typeof e !== "string") { return e.querySelectorAll(t) } else { return p(ne(), e) } } function E() { return window } function K(e, t) { e = y(e); if (t) { E().setTimeout(function() { K(e); e = null }, t) } else { u(e).removeChild(e) } } function ce(e) { return e instanceof Element ? e : null } function G(e) { return e instanceof HTMLElement ? e : null } function Z(e) { return typeof e === "string" ? e : null } function d(e) { return e instanceof Element || e instanceof Document || e instanceof DocumentFragment ? e : null } function Y(e, t, n) { e = ce(y(e)); if (!e) { return } if (n) { E().setTimeout(function() { Y(e, t); e = null }, n) } else { e.classList && e.classList.add(t) } } function o(e, t, n) { let r = ce(y(e)); if (!r) { return } if (n) { E().setTimeout(function() { o(r, t); r = null }, n) } else { if (r.classList) { r.classList.remove(t); if (r.classList.length === 0) { r.removeAttribute("class") } } } } function W(e, t) { e = y(e); e.classList.toggle(t) } function ge(e, t) { e = y(e); se(e.parentElement.children, function(e) { o(e, t) }); Y(ce(e), t) } function g(e, t) { e = ce(y(e)); if (e && e.closest) { return e.closest(t) } else { do { if (e == null || f(e, t)) { return e } } while (e = e && ce(u(e))); return null } } function l(e, t) { return e.substring(0, t.length) === t } function pe(e, t) { return e.substring(e.length - t.length) === t } function i(e) { const t = e.trim(); if (l(t, "<") && pe(t, "/>")) { return t.substring(1, t.length - 2) } else { return t } } function m(e, t, n) { e = y(e); if (t.indexOf("closest ") === 0) { return [g(ce(e), i(t.substr(8)))] } else if (t.indexOf("find ") === 0) { return [r(d(e), i(t.substr(5)))] } else if (t === "next") { return [ce(e).nextElementSibling] } else if (t.indexOf("next ") === 0) { return [me(e, i(t.substr(5)), !!n)] } else if (t === "previous") { return [ce(e).previousElementSibling] } else if (t.indexOf("previous ") === 0) { return [ye(e, i(t.substr(9)), !!n)] } else if (t === "document") { return [document] } else if (t === "window") { return [window] } else if (t === "body") { return [document.body] } else if (t === "root") { return [H(e, !!n)] } else if (t.indexOf("global ") === 0) { return m(e, t.slice(7), true) } else { return F(d(H(e, !!n)).querySelectorAll(i(t))) } } var me = function(t, e, n) { const r = d(H(t, n)).querySelectorAll(e); for (let e = 0; e < r.length; e++) { const o = r[e]; if (o.compareDocumentPosition(t) === Node.DOCUMENT_POSITION_PRECEDING) { return o } } }; var ye = function(t, e, n) { const r = d(H(t, n)).querySelectorAll(e); for (let e = r.length - 1; e >= 0; e--) { const o = r[e]; if (o.compareDocumentPosition(t) === Node.DOCUMENT_POSITION_FOLLOWING) { return o } } }; function ae(e, t) { if (typeof e !== "string") { return m(e, t)[0] } else { return m(ne().body, e)[0] } } function y(e, t) { if (typeof e === "string") { return r(d(t) || document, e) } else { return e } } function xe(e, t, n) { if (M(t)) { return { target: ne().body, event: Z(e), listener: t } } else { return { target: y(e), event: Z(t), listener: n } } } function be(t, n, r) { _n(function() { const e = xe(t, n, r); e.target.addEventListener(e.event, e.listener) }); const e = M(n); return e ? n : r } function we(t, n, r) { _n(function() { const e = xe(t, n, r); e.target.removeEventListener(e.event, e.listener) }); return M(n) ? n : r } const ve = ne().createElement("output"); function Se(e, t) { const n = re(e, t); if (n) { if (n === "this") { return [Ee(e, t)] } else { const r = m(e, n); if (r.length === 0) { w('The selector "' + n + '" on ' + t + " returned no matches!"); return [ve] } else { return r } } } } function Ee(e, t) { return ce(T(e, function(e) { return te(ce(e), t) != null })) } function Ce(e) { const t = re(e, "hx-target"); if (t) { if (t === "this") { return Ee(e, "hx-target") } else { return ae(e, t) } } else { const n = ie(e); if (n.boosted) { return ne().body } else { return e } } } function Oe(t) { const n = Q.config.attributesToSettle; for (let e = 0; e < n.length; e++) { if (t === n[e]) { return true } } return false } function Re(t, n) { se(t.attributes, function(e) { if (!n.hasAttribute(e.name) && Oe(e.name)) { t.removeAttribute(e.name) } }); se(n.attributes, function(e) { if (Oe(e.name)) { t.setAttribute(e.name, e.value) } }) } function He(t, e) { const n = jn(e); for (let e = 0; e < n.length; e++) { const r = n[e]; try { if (r.isInlineSwap(t)) { return true } } catch (e) { w(e) } } return t === "outerHTML" } function Te(e, o, i) { let t = "#" + ee(o, "id"); let s = "outerHTML"; if (e === "true") { } else if (e.indexOf(":") > 0) { s = e.substr(0, e.indexOf(":")); t = e.substr(e.indexOf(":") + 1, e.length) } else { s = e } const n = ne().querySelectorAll(t); if (n) { se(n, function(e) { let t; const n = o.cloneNode(true); t = ne().createDocumentFragment(); t.appendChild(n); if (!He(s, e)) { t = d(n) } const r = { shouldSwap: true, target: e, fragment: t }; if (!de(e, "htmx:oobBeforeSwap", r)) return; e = r.target; if (r.shouldSwap) { _e(s, e, e, t, i) } se(i.elts, function(e) { de(e, "htmx:oobAfterSwap", r) }) }); o.parentNode.removeChild(o) } else { o.parentNode.removeChild(o); fe(ne().body, "htmx:oobErrorNoTarget", { content: o }) } return e } function qe(e) { se(p(e, "[hx-preserve], [data-hx-preserve]"), function(e) { const t = te(e, "id"); const n = ne().getElementById(t); if (n != null) { e.parentNode.replaceChild(n, e) } }) } function Le(l, e, u) { se(e.querySelectorAll("[id]"), function(t) { const n = ee(t, "id"); if (n && n.length > 0) { const r = n.replace("'", "\\'"); const o = t.tagName.replace(":", "\\:"); const e = d(l); const i = e && e.querySelector(o + "[id='" + r + "']"); if (i && i !== e) { const s = t.cloneNode(); Re(t, i); u.tasks.push(function() { Re(t, s) }) } } }) } function Ne(e) { return function() { o(e, Q.config.addedClass); Dt(ce(e)); Ae(d(e)); de(e, "htmx:load") } } function Ae(e) { const t = "[autofocus]"; const n = G(f(e, t) ? e : e.querySelector(t)); if (n != null) { n.focus() } } function c(e, t, n, r) { Le(e, n, r); while (n.childNodes.length > 0) { const o = n.firstChild; Y(ce(o), Q.config.addedClass); e.insertBefore(o, t); if (o.nodeType !== Node.TEXT_NODE && o.nodeType !== Node.COMMENT_NODE) { r.tasks.push(Ne(o)) } } } function Ie(e, t) { let n = 0; while (n < e.length) { t = (t << 5) - t + e.charCodeAt(n++) | 0 } return t } function Pe(t) { let n = 0; if (t.attributes) { for (let e = 0; e < t.attributes.length; e++) { const r = t.attributes[e]; if (r.value) { n = Ie(r.name, n); n = Ie(r.value, n) } } } return n } function ke(t) { const n = ie(t); if (n.onHandlers) { for (let e = 0; e < n.onHandlers.length; e++) { const r = n.onHandlers[e]; we(t, r.event, r.listener) } delete n.onHandlers } } function De(e) { const t = ie(e); if (t.timeout) { clearTimeout(t.timeout) } if (t.listenerInfos) { se(t.listenerInfos, function(e) { if (e.on) { we(e.on, e.trigger, e.listener) } }) } ke(e); se(Object.keys(t), function(e) { delete t[e] }) } function a(e) { de(e, "htmx:beforeCleanupElement"); De(e); if (e.children) { se(e.children, function(e) { a(e) }) } } function Me(t, e, n) { if (t instanceof Element && t.tagName === "BODY") { return Ve(t, e, n) } let r; const o = t.previousSibling; c(u(t), t, e, n); if (o == null) { r = u(t).firstChild } else { r = o.nextSibling } n.elts = n.elts.filter(function(e) { return e !== t }); while (r && r !== t) { if (r instanceof Element) { n.elts.push(r) } r = r.nextSibling } a(t); if (t instanceof Element) { t.remove() } else { t.parentNode.removeChild(t) } } function Xe(e, t, n) { return c(e, e.firstChild, t, n) } function Fe(e, t, n) { return c(u(e), e, t, n) } function Be(e, t, n) { return c(e, null, t, n) } function Ue(e, t, n) { return c(u(e), e.nextSibling, t, n) } function je(e) { a(e); return u(e).removeChild(e) } function Ve(e, t, n) { const r = e.firstChild; c(e, r, t, n); if (r) { while (r.nextSibling) { a(r.nextSibling); e.removeChild(r.nextSibling) } a(r); e.removeChild(r) } } function _e(t, e, n, r, o) { switch (t) { case "none": return; case "outerHTML": Me(n, r, o); return; case "afterbegin": Xe(n, r, o); return; case "beforebegin": Fe(n, r, o); return; case "beforeend": Be(n, r, o); return; case "afterend": Ue(n, r, o); return; case "delete": je(n); return; default: var i = jn(e); for (let e = 0; e < i.length; e++) { const s = i[e]; try { const l = s.handleSwap(t, n, r, o); if (l) { if (Array.isArray(l)) { for (let e = 0; e < l.length; e++) { const u = l[e]; if (u.nodeType !== Node.TEXT_NODE && u.nodeType !== Node.COMMENT_NODE) { o.tasks.push(Ne(u)) } } } return } } catch (e) { w(e) } } if (t === "innerHTML") { Ve(n, r, o) } else { _e(Q.config.defaultSwapStyle, e, n, r, o) } } } function $e(e, n) { var t = p(e, "[hx-swap-oob], [data-hx-swap-oob]"); se(t, function(e) { if (Q.config.allowNestedOobSwaps || e.parentElement === null) { const t = te(e, "hx-swap-oob"); if (t != null) { Te(t, e, n) } } else { e.removeAttribute("hx-swap-oob"); e.removeAttribute("data-hx-swap-oob") } }); return t.length > 0 } function ze(e, t, r, o) { if (!o) { o = {} } e = y(e); const n = document.activeElement; let i = {}; try { i = { elt: n, start: n ? n.selectionStart : null, end: n ? n.selectionEnd : null } } catch (e) { } const s = xn(e); if (r.swapStyle === "textContent") { e.textContent = t } else { let n = D(t); s.title = n.title; if (o.selectOOB) { const u = o.selectOOB.split(","); for (let t = 0; t < u.length; t++) { const c = u[t].split(":", 2); let e = c[0].trim(); if (e.indexOf("#") === 0) { e = e.substring(1) } const a = c[1] || "true"; const f = n.querySelector("#" + e); if (f) { Te(a, f, s) } } } $e(n, s); se(p(n, "template"), function(e) { if ($e(e.content, s)) { e.remove() } }); if (o.select) { const d = ne().createDocumentFragment(); se(n.querySelectorAll(o.select), function(e) { d.appendChild(e) }); n = d } qe(n); _e(r.swapStyle, o.contextElement, e, n, s) } if (i.elt && !le(i.elt) && ee(i.elt, "id")) { const h = document.getElementById(ee(i.elt, "id")); const g = { preventScroll: r.focusScroll !== undefined ? !r.focusScroll : !Q.config.defaultFocusScroll }; if (h) { if (i.start && h.setSelectionRange) { try { h.setSelectionRange(i.start, i.end) } catch (e) { } } h.focus(g) } } e.classList.remove(Q.config.swappingClass); se(s.elts, function(e) { if (e.classList) { e.classList.add(Q.config.settlingClass) } de(e, "htmx:afterSwap", o.eventInfo) }); if (o.afterSwapCallback) { o.afterSwapCallback() } if (!r.ignoreTitle) { Dn(s.title) } const l = function() { se(s.tasks, function(e) { e.call() }); se(s.elts, function(e) { if (e.classList) { e.classList.remove(Q.config.settlingClass) } de(e, "htmx:afterSettle", o.eventInfo) }); if (o.anchor) { const e = ce(y("#" + o.anchor)); if (e) { e.scrollIntoView({ block: "start", behavior: "auto" }) } } bn(s.elts, r); if (o.afterSettleCallback) { o.afterSettleCallback() } }; if (r.settleDelay > 0) { E().setTimeout(l, r.settleDelay) } else { l() } } function Je(e, t, n) { const r = e.getResponseHeader(t); if (r.indexOf("{") === 0) { const o = S(r); for (const i in o) { if (o.hasOwnProperty(i)) { let e = o[i]; if (X(e)) { n = e.target !== undefined ? e.target : n } else { e = { value: e } } de(n, i, e) } } } else { const s = r.split(","); for (let e = 0; e < s.length; e++) { de(n, s[e].trim(), []) } } } const Ke = /\s/; const x = /[\s,]/; const Ge = /[_$a-zA-Z]/; const Ze = /[_$a-zA-Z0-9]/; const Ye = ['"', "'", "/"]; const We = /[^\s]/; const Qe = /[{(]/; const et = /[})]/; function tt(e) { const t = []; let n = 0; while (n < e.length) { if (Ge.exec(e.charAt(n))) { var r = n; while (Ze.exec(e.charAt(n + 1))) { n++ } t.push(e.substr(r, n - r + 1)) } else if (Ye.indexOf(e.charAt(n)) !== -1) { const o = e.charAt(n); var r = n; n++; while (n < e.length && e.charAt(n) !== o) { if (e.charAt(n) === "\\") { n++ } n++ } t.push(e.substr(r, n - r + 1)) } else { const i = e.charAt(n); t.push(i) } n++ } return t } function nt(e, t, n) { return Ge.exec(e.charAt(0)) && e !== "true" && e !== "false" && e !== "this" && e !== n && t !== "." } function rt(r, o, i) { if (o[0] === "[") { o.shift(); let e = 1; let t = " return (function(" + i + "){ return ("; let n = null; while (o.length > 0) { const s = o[0]; if (s === "]") { e--; if (e === 0) { if (n === null) { t = t + "true" } o.shift(); t += ")})"; try { const l = vn(r, function() { return Function(t)() }, function() { return true }); l.source = t; return l } catch (e) { fe(ne().body, "htmx:syntax:error", { error: e, source: t }); return null } } } else if (s === "[") { e++ } if (nt(s, n, i)) { t += "((" + i + "." + s + ") ? (" + i + "." + s + ") : (window." + s + "))" } else { t = t + s } n = o.shift() } } } function b(e, t) { let n = ""; while (e.length > 0 && !t.test(e[0])) { n += e.shift() } return n } function ot(e) { let t; if (e.length > 0 && Qe.test(e[0])) { e.shift(); t = b(e, et).trim(); e.shift() } else { t = b(e, x) } return t } const it = "input, textarea, select"; function st(e, t, n) { const r = []; const o = tt(t); do { b(o, We); const l = o.length; const u = b(o, /[,\[\s]/); if (u !== "") { if (u === "every") { const c = { trigger: "every" }; b(o, We); c.pollInterval = h(b(o, /[,\[\s]/)); b(o, We); var i = rt(e, o, "event"); if (i) { c.eventFilter = i } r.push(c) } else { const a = { trigger: u }; var i = rt(e, o, "event"); if (i) { a.eventFilter = i } while (o.length > 0 && o[0] !== ",") { b(o, We); const f = o.shift(); if (f === "changed") { a.changed = true } else if (f === "once") { a.once = true } else if (f === "consume") { a.consume = true } else if (f === "delay" && o[0] === ":") { o.shift(); a.delay = h(b(o, x)) } else if (f === "from" && o[0] === ":") { o.shift(); if (Qe.test(o[0])) { var s = ot(o) } else { var s = b(o, x); if (s === "closest" || s === "find" || s === "next" || s === "previous") { o.shift(); const d = ot(o); if (d.length > 0) { s += " " + d } } } a.from = s } else if (f === "target" && o[0] === ":") { o.shift(); a.target = ot(o) } else if (f === "throttle" && o[0] === ":") { o.shift(); a.throttle = h(b(o, x)) } else if (f === "queue" && o[0] === ":") { o.shift(); a.queue = b(o, x) } else if (f === "root" && o[0] === ":") { o.shift(); a[f] = ot(o) } else if (f === "threshold" && o[0] === ":") { o.shift(); a[f] = b(o, x) } else { fe(e, "htmx:syntax:error", { token: o.shift() }) } } r.push(a) } } if (o.length === l) { fe(e, "htmx:syntax:error", { token: o.shift() }) } b(o, We) } while (o[0] === "," && o.shift()); if (n) { n[t] = r } return r } function lt(e) { const t = te(e, "hx-trigger"); let n = []; if (t) { const r = Q.config.triggerSpecsCache; n = r && r[t] || st(e, t, r) } if (n.length > 0) { return n } else if (f(e, "form")) { return [{ trigger: "submit" }] } else if (f(e, 'input[type="button"], input[type="submit"]')) { return [{ trigger: "click" }] } else if (f(e, it)) { return [{ trigger: "change" }] } else { return [{ trigger: "click" }] } } function ut(e) { ie(e).cancelled = true } function ct(e, t, n) { const r = ie(e); r.timeout = E().setTimeout(function() { if (le(e) && r.cancelled !== true) { if (!pt(n, e, Xt("hx:poll:trigger", { triggerSpec: n, target: e }))) { t(e) } ct(e, t, n) } }, n.pollInterval) } function at(e) { return location.hostname === e.hostname && ee(e, "href") && ee(e, "href").indexOf("#") !== 0 } function ft(e) { return g(e, Q.config.disableSelector) } function dt(t, n, e) { if (t instanceof HTMLAnchorElement && at(t) && (t.target === "" || t.target === "_self") || t.tagName === "FORM" && String(ee(t, "method")).toLowerCase() !== "dialog") { n.boosted = true; let r, o; if (t.tagName === "A") { r = "get"; o = ee(t, "href") } else { const i = ee(t, "method"); r = i ? i.toLowerCase() : "get"; if (r === "get") { } o = ee(t, "action") } e.forEach(function(e) { mt(t, function(e, t) { const n = ce(e); if (ft(n)) { a(n); return } he(r, o, n, t) }, n, e, true) }) } } function ht(e, t) { const n = ce(t); if (!n) { return false } if (e.type === "submit" || e.type === "click") { if (n.tagName === "FORM") { return true } if (f(n, 'input[type="submit"], button') && g(n, "form") !== null) { return true } if (n instanceof HTMLAnchorElement && n.href && (n.getAttribute("href") === "#" || n.getAttribute("href").indexOf("#") !== 0)) { return true } } return false } function gt(e, t) { return ie(e).boosted && e instanceof HTMLAnchorElement && t.type === "click" && (t.ctrlKey || t.metaKey) } function pt(e, t, n) { const r = e.eventFilter; if (r) { try { return r.call(t, n) !== true } catch (e) { const o = r.source; fe(ne().body, "htmx:eventFilter:error", { error: e, source: o }); return true } } return false } function mt(s, l, e, u, c) { const a = ie(s); let t; if (u.from) { t = m(s, u.from) } else { t = [s] } if (u.changed) { t.forEach(function(e) { const t = ie(e); t.lastValue = e.value }) } se(t, function(o) { const i = function(e) { if (!le(s)) { o.removeEventListener(u.trigger, i); return } if (gt(s, e)) { return } if (c || ht(e, s)) { e.preventDefault() } if (pt(u, s, e)) { return } const t = ie(e); t.triggerSpec = u; if (t.handledFor == null) { t.handledFor = [] } if (t.handledFor.indexOf(s) < 0) { t.handledFor.push(s); if (u.consume) { e.stopPropagation() } if (u.target && e.target) { if (!f(ce(e.target), u.target)) { return } } if (u.once) { if (a.triggeredOnce) { return } else { a.triggeredOnce = true } } if (u.changed) { const n = ie(o); const r = o.value; if (n.lastValue === r) { return } n.lastValue = r } if (a.delayed) { clearTimeout(a.delayed) } if (a.throttle) { return } if (u.throttle > 0) { if (!a.throttle) { de(s, "htmx:trigger"); l(s, e); a.throttle = E().setTimeout(function() { a.throttle = null }, u.throttle) } } else if (u.delay > 0) { a.delayed = E().setTimeout(function() { de(s, "htmx:trigger"); l(s, e) }, u.delay) } else { de(s, "htmx:trigger"); l(s, e) } } }; if (e.listenerInfos == null) { e.listenerInfos = [] } e.listenerInfos.push({ trigger: u.trigger, listener: i, on: o }); o.addEventListener(u.trigger, i) }) } let yt = false; let xt = null; function bt() { if (!xt) { xt = function() { yt = true }; window.addEventListener("scroll", xt); setInterval(function() { if (yt) { yt = false; se(ne().querySelectorAll("[hx-trigger*='revealed'],[data-hx-trigger*='revealed']"), function(e) { wt(e) }) } }, 200) } } function wt(e) { if (!s(e, "data-hx-revealed") && B(e)) { e.setAttribute("data-hx-revealed", "true"); const t = ie(e); if (t.initHash) { de(e, "revealed") } else { e.addEventListener("htmx:afterProcessNode", function() { de(e, "revealed") }, { once: true }) } } } function vt(e, t, n, r) { const o = function() { if (!n.loaded) { n.loaded = true; t(e) } }; if (r > 0) { E().setTimeout(o, r) } else { o() } } function St(t, n, e) { let i = false; se(v, function(r) { if (s(t, "hx-" + r)) { const o = te(t, "hx-" + r); i = true; n.path = o; n.verb = r; e.forEach(function(e) { Et(t, e, n, function(e, t) { const n = ce(e); if (g(n, Q.config.disableSelector)) { a(n); return } he(r, o, n, t) }) }) } }); return i } function Et(r, e, t, n) { if (e.trigger === "revealed") { bt(); mt(r, n, t, e); wt(ce(r)) } else if (e.trigger === "intersect") { const o = {}; if (e.root) { o.root = ae(r, e.root) } if (e.threshold) { o.threshold = parseFloat(e.threshold) } const i = new IntersectionObserver(function(t) { for (let e = 0; e < t.length; e++) { const n = t[e]; if (n.isIntersecting) { de(r, "intersect"); break } } }, o); i.observe(ce(r)); mt(ce(r), n, t, e) } else if (e.trigger === "load") { if (!pt(e, r, Xt("load", { elt: r }))) { vt(ce(r), n, t, e.delay) } } else if (e.pollInterval > 0) { t.polling = true; ct(ce(r), n, e) } else { mt(r, n, t, e) } } function Ct(e) { const t = ce(e); if (!t) { return false } const n = t.attributes; for (let e = 0; e < n.length; e++) { const r = n[e].name; if (l(r, "hx-on:") || l(r, "data-hx-on:") || l(r, "hx-on-") || l(r, "data-hx-on-")) { return true } } return false } const Ot = (new XPathEvaluator).createExpression('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or' + ' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]'); function Rt(e, t) { if (Ct(e)) { t.push(ce(e)) } const n = Ot.evaluate(e); let r = null; while (r = n.iterateNext()) t.push(ce(r)) } function Ht(e) { const t = []; if (e instanceof DocumentFragment) { for (const n of e.childNodes) { Rt(n, t) } } else { Rt(e, t) } return t } function Tt(e) { if (e.querySelectorAll) { const n = ", [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost]"; const r = []; for (const i in Xn) { const s = Xn[i]; if (s.getSelectors) { var t = s.getSelectors(); if (t) { r.push(t) } } } const o = e.querySelectorAll(O + n + ", form, [type='submit']," + " [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger]" + r.flat().map(e => ", " + e).join("")); return o } else { return [] } } function qt(e) { const t = g(ce(e.target), "button, input[type='submit']"); const n = Nt(e); if (n) { n.lastButtonClicked = t } } function Lt(e) { const t = Nt(e); if (t) { t.lastButtonClicked = null } } function Nt(e) { const t = g(ce(e.target), "button, input[type='submit']"); if (!t) { return } const n = y("#" + ee(t, "form"), t.getRootNode()) || g(t, "form"); if (!n) { return } return ie(n) } function At(e) { e.addEventListener("click", qt); e.addEventListener("focusin", qt); e.addEventListener("focusout", Lt) } function It(t, e, n) { const r = ie(t); if (!Array.isArray(r.onHandlers)) { r.onHandlers = [] } let o; const i = function(e) { vn(t, function() { if (ft(t)) { return } if (!o) { o = new Function("event", n) } o.call(t, e) }) }; t.addEventListener(e, i); r.onHandlers.push({ event: e, listener: i }) } function Pt(t) { ke(t); for (let e = 0; e < t.attributes.length; e++) { const n = t.attributes[e].name; const r = t.attributes[e].value; if (l(n, "hx-on") || l(n, "data-hx-on")) { const o = n.indexOf("-on") + 3; const i = n.slice(o, o + 1); if (i === "-" || i === ":") { let e = n.slice(o + 1); if (l(e, ":")) { e = "htmx" + e } else if (l(e, "-")) { e = "htmx:" + e.slice(1) } else if (l(e, "htmx-")) { e = "htmx:" + e.slice(5) } It(t, e, r) } } } } function kt(t) { if (g(t, Q.config.disableSelector)) { a(t); return } const n = ie(t); if (n.initHash !== Pe(t)) { De(t); n.initHash = Pe(t); de(t, "htmx:beforeProcessNode"); if (t.value) { n.lastValue = t.value } const e = lt(t); const r = St(t, n, e); if (!r) { if (re(t, "hx-boost") === "true") { dt(t, n, e) } else if (s(t, "hx-trigger")) { e.forEach(function(e) { Et(t, e, n, function() { }) }) } } if (t.tagName === "FORM" || ee(t, "type") === "submit" && s(t, "form")) { At(t) } de(t, "htmx:afterProcessNode") } } function Dt(e) { e = y(e); if (g(e, Q.config.disableSelector)) { a(e); return } kt(e); se(Tt(e), function(e) { kt(e) }); se(Ht(e), Pt) } function Mt(e) { return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase() } function Xt(e, t) { let n; if (window.CustomEvent && typeof window.CustomEvent === "function") { n = new CustomEvent(e, { bubbles: true, cancelable: true, composed: true, detail: t }) } else { n = ne().createEvent("CustomEvent"); n.initCustomEvent(e, true, true, t) } return n } function fe(e, t, n) { de(e, t, ue({ error: t }, n)) } function Ft(e) { return e === "htmx:afterProcessNode" } function Bt(e, t) { se(jn(e), function(e) { try { t(e) } catch (e) { w(e) } }) } function w(e) { if (console.error) { console.error(e) } else if (console.log) { console.log("ERROR: ", e) } } function de(e, t, n) { e = y(e); if (n == null) { n = {} } n.elt = e; const r = Xt(t, n); if (Q.logger && !Ft(t)) { Q.logger(e, t, n) } if (n.error) { w(n.error); de(e, "htmx:error", { errorInfo: n }) } let o = e.dispatchEvent(r); const i = Mt(t); if (o && i !== t) { const s = Xt(i, r.detail); o = o && e.dispatchEvent(s) } Bt(ce(e), function(e) { o = o && (e.onEvent(t, r) !== false && !r.defaultPrevented) }); return o } let Ut = location.pathname + location.search; function jt() { const e = ne().querySelector("[hx-history-elt],[data-hx-history-elt]"); return e || ne().body } function Vt(t, e) { if (!j()) { return } const n = $t(e); const r = ne().title; const o = window.scrollY; if (Q.config.historyCacheSize <= 0) { localStorage.removeItem("htmx-history-cache"); return } t = V(t); const i = S(localStorage.getItem("htmx-history-cache")) || []; for (let e = 0; e < i.length; e++) { if (i[e].url === t) { i.splice(e, 1); break } } const s = { url: t, content: n, title: r, scroll: o }; de(ne().body, "htmx:historyItemCreated", { item: s, cache: i }); i.push(s); while (i.length > Q.config.historyCacheSize) { i.shift() } while (i.length > 0) { try { localStorage.setItem("htmx-history-cache", JSON.stringify(i)); break } catch (e) { fe(ne().body, "htmx:historyCacheError", { cause: e, cache: i }); i.shift() } } } function _t(t) { if (!j()) { return null } t = V(t); const n = S(localStorage.getItem("htmx-history-cache")) || []; for (let e = 0; e < n.length; e++) { if (n[e].url === t) { return n[e] } } return null } function $t(e) { const t = Q.config.requestClass; const n = e.cloneNode(true); se(p(n, "." + t), function(e) { o(e, t) }); se(p(n, "[data-disabled-by-htmx]"), function(e) { e.removeAttribute("disabled") }); return n.innerHTML } function zt() { const e = jt(); const t = Ut || location.pathname + location.search; let n; try { n = ne().querySelector('[hx-history="false" i],[data-hx-history="false" i]') } catch (e) { n = ne().querySelector('[hx-history="false"],[data-hx-history="false"]') } if (!n) { de(ne().body, "htmx:beforeHistorySave", { path: t, historyElt: e }); Vt(t, e) } if (Q.config.historyEnabled) history.replaceState({ htmx: true }, ne().title, window.location.href) } function Jt(e) { if (Q.config.getCacheBusterParam) { e = e.replace(/org\.htmx\.cache-buster=[^&]*&?/, ""); if (pe(e, "&") || pe(e, "?")) { e = e.slice(0, -1) } } if (Q.config.historyEnabled) { history.pushState({ htmx: true }, "", e) } Ut = e } function Kt(e) { if (Q.config.historyEnabled) history.replaceState({ htmx: true }, "", e); Ut = e } function Gt(e) { se(e, function(e) { e.call(undefined) }) } function Zt(o) { const e = new XMLHttpRequest; const i = { path: o, xhr: e }; de(ne().body, "htmx:historyCacheMiss", i); e.open("GET", o, true); e.setRequestHeader("HX-Request", "true"); e.setRequestHeader("HX-History-Restore-Request", "true"); e.setRequestHeader("HX-Current-URL", ne().location.href); e.onload = function() { if (this.status >= 200 && this.status < 400) { de(ne().body, "htmx:historyCacheMissLoad", i); const e = D(this.response); const t = e.querySelector("[hx-history-elt],[data-hx-history-elt]") || e; const n = jt(); const r = xn(n); Dn(e.title); Ve(n, t, r); Gt(r.tasks); Ut = o; de(ne().body, "htmx:historyRestore", { path: o, cacheMiss: true, serverResponse: this.response }) } else { fe(ne().body, "htmx:historyCacheMissLoadError", i) } }; e.send() } function Yt(e) { zt(); e = e || location.pathname + location.search; const t = _t(e); if (t) { const n = D(t.content); const r = jt(); const o = xn(r); Dn(n.title); Ve(r, n, o); Gt(o.tasks); E().setTimeout(function() { window.scrollTo(0, t.scroll) }, 0); Ut = e; de(ne().body, "htmx:historyRestore", { path: e, item: t }) } else { if (Q.config.refreshOnHistoryMiss) { window.location.reload(true) } else { Zt(e) } } } function Wt(e) { let t = Se(e, "hx-indicator"); if (t == null) { t = [e] } se(t, function(e) { const t = ie(e); t.requestCount = (t.requestCount || 0) + 1; e.classList.add.call(e.classList, Q.config.requestClass) }); return t } function Qt(e) { let t = Se(e, "hx-disabled-elt"); if (t == null) { t = [] } se(t, function(e) { const t = ie(e); t.requestCount = (t.requestCount || 0) + 1; e.setAttribute("disabled", ""); e.setAttribute("data-disabled-by-htmx", "") }); return t } function en(e, t) { se(e, function(e) { const t = ie(e); t.requestCount = (t.requestCount || 0) - 1; if (t.requestCount === 0) { e.classList.remove.call(e.classList, Q.config.requestClass) } }); se(t, function(e) { const t = ie(e); t.requestCount = (t.requestCount || 0) - 1; if (t.requestCount === 0) { e.removeAttribute("disabled"); e.removeAttribute("data-disabled-by-htmx") } }) } function tn(t, n) { for (let e = 0; e < t.length; e++) { const r = t[e]; if (r.isSameNode(n)) { return true } } return false } function nn(e) { const t = e; if (t.name === "" || t.name == null || t.disabled || g(t, "fieldset[disabled]")) { return false } if (t.type === "button" || t.type === "submit" || t.tagName === "image" || t.tagName === "reset" || t.tagName === "file") { return false } if (t.type === "checkbox" || t.type === "radio") { return t.checked } return true } function rn(t, e, n) { if (t != null && e != null) { if (Array.isArray(e)) { e.forEach(function(e) { n.append(t, e) }) } else { n.append(t, e) } } } function on(t, n, r) { if (t != null && n != null) { let e = r.getAll(t); if (Array.isArray(n)) { e = e.filter(e => n.indexOf(e) < 0) } else { e = e.filter(e => e !== n) } r.delete(t); se(e, e => r.append(t, e)) } } function sn(t, n, r, o, i) { if (o == null || tn(t, o)) { return } else { t.push(o) } if (nn(o)) { const s = ee(o, "name"); let e = o.value; if (o instanceof HTMLSelectElement && o.multiple) { e = F(o.querySelectorAll("option:checked")).map(function(e) { return e.value }) } if (o instanceof HTMLInputElement && o.files) { e = F(o.files) } rn(s, e, n); if (i) { ln(o, r) } } if (o instanceof HTMLFormElement) { se(o.elements, function(e) { if (t.indexOf(e) >= 0) { on(e.name, e.value, n) } else { t.push(e) } if (i) { ln(e, r) } }); new FormData(o).forEach(function(e, t) { if (e instanceof File && e.name === "") { return } rn(t, e, n) }) } } function ln(e, t) { const n = e; if (n.willValidate) { de(n, "htmx:validation:validate"); if (!n.checkValidity()) { t.push({ elt: n, message: n.validationMessage, validity: n.validity }); de(n, "htmx:validation:failed", { message: n.validationMessage, validity: n.validity }) } } } function un(n, e) { for (const t of e.keys()) { n.delete(t) } e.forEach(function(e, t) { n.append(t, e) }); return n } function cn(e, t) { const n = []; const r = new FormData; const o = new FormData; const i = []; const s = ie(e); if (s.lastButtonClicked && !le(s.lastButtonClicked)) { s.lastButtonClicked = null } let l = e instanceof HTMLFormElement && e.noValidate !== true || te(e, "hx-validate") === "true"; if (s.lastButtonClicked) { l = l && s.lastButtonClicked.formNoValidate !== true } if (t !== "get") { sn(n, o, i, g(e, "form"), l) } sn(n, r, i, e, l); if (s.lastButtonClicked || e.tagName === "BUTTON" || e.tagName === "INPUT" && ee(e, "type") === "submit") { const c = s.lastButtonClicked || e; const a = ee(c, "name"); rn(a, c.value, o) } const u = Se(e, "hx-include"); se(u, function(e) { sn(n, r, i, ce(e), l); if (!f(e, "form")) { se(d(e).querySelectorAll(it), function(e) { sn(n, r, i, e, l) }) } }); un(r, o); return { errors: i, formData: r, values: An(r) } } function an(e, t, n) { if (e !== "") { e += "&" } if (String(n) === "[object Object]") { n = JSON.stringify(n) } const r = encodeURIComponent(n); e += encodeURIComponent(t) + "=" + r; return e } function fn(e) { e = Ln(e); let n = ""; e.forEach(function(e, t) { n = an(n, t, e) }); return n } function dn(e, t, n) { const r = { "HX-Request": "true", "HX-Trigger": ee(e, "id"), "HX-Trigger-Name": ee(e, "name"), "HX-Target": te(t, "id"), "HX-Current-URL": ne().location.href }; wn(e, "hx-headers", false, r); if (n !== undefined) { r["HX-Prompt"] = n } if (ie(e).boosted) { r["HX-Boosted"] = "true" } return r } function hn(n, e) { const t = re(e, "hx-params"); if (t) { if (t === "none") { return new FormData } else if (t === "*") { return n } else if (t.indexOf("not ") === 0) { se(t.substr(4).split(","), function(e) { e = e.trim(); n.delete(e) }); return n } else { const r = new FormData; se(t.split(","), function(t) { t = t.trim(); if (n.has(t)) { n.getAll(t).forEach(function(e) { r.append(t, e) }) } }); return r } } else { return n } } function gn(e) { return !!ee(e, "href") && ee(e, "href").indexOf("#") >= 0 } function pn(e, t) { const n = t || re(e, "hx-swap"); const r = { swapStyle: ie(e).boosted ? "innerHTML" : Q.config.defaultSwapStyle, swapDelay: Q.config.defaultSwapDelay, settleDelay: Q.config.defaultSettleDelay }; if (Q.config.scrollIntoViewOnBoost && ie(e).boosted && !gn(e)) { r.show = "top" } if (n) { const s = U(n); if (s.length > 0) { for (let e = 0; e < s.length; e++) { const l = s[e]; if (l.indexOf("swap:") === 0) { r.swapDelay = h(l.substr(5)) } else if (l.indexOf("settle:") === 0) { r.settleDelay = h(l.substr(7)) } else if (l.indexOf("transition:") === 0) { r.transition = l.substr(11) === "true" } else if (l.indexOf("ignoreTitle:") === 0) { r.ignoreTitle = l.substr(12) === "true" } else if (l.indexOf("scroll:") === 0) { const u = l.substr(7); var o = u.split(":"); const c = o.pop(); var i = o.length > 0 ? o.join(":") : null; r.scroll = c; r.scrollTarget = i } else if (l.indexOf("show:") === 0) { const a = l.substr(5); var o = a.split(":"); const f = o.pop(); var i = o.length > 0 ? o.join(":") : null; r.show = f; r.showTarget = i } else if (l.indexOf("focus-scroll:") === 0) { const d = l.substr("focus-scroll:".length); r.focusScroll = d == "true" } else if (e == 0) { r.swapStyle = l } else { w("Unknown modifier in hx-swap: " + l) } } } } return r } function mn(e) { return re(e, "hx-encoding") === "multipart/form-data" || f(e, "form") && ee(e, "enctype") === "multipart/form-data" } function yn(t, n, r) { let o = null; Bt(n, function(e) { if (o == null) { o = e.encodeParameters(t, r, n) } }); if (o != null) { return o } else { if (mn(n)) { return un(new FormData, Ln(r)) } else { return fn(r) } } } function xn(e) { return { tasks: [], elts: [e] } } function bn(e, t) { const n = e[0]; const r = e[e.length - 1]; if (t.scroll) { var o = null; if (t.scrollTarget) { o = ce(ae(n, t.scrollTarget)) } if (t.scroll === "top" && (n || o)) { o = o || n; o.scrollTop = 0 } if (t.scroll === "bottom" && (r || o)) { o = o || r; o.scrollTop = o.scrollHeight } } if (t.show) { var o = null; if (t.showTarget) { let e = t.showTarget; if (t.showTarget === "window") { e = "body" } o = ce(ae(n, e)) } if (t.show === "top" && (n || o)) { o = o || n; o.scrollIntoView({ block: "start", behavior: Q.config.scrollBehavior }) } if (t.show === "bottom" && (r || o)) { o = o || r; o.scrollIntoView({ block: "end", behavior: Q.config.scrollBehavior }) } } } function wn(r, e, o, i) { if (i == null) { i = {} } if (r == null) { return i } const s = te(r, e); if (s) { let e = s.trim(); let t = o; if (e === "unset") { return null } if (e.indexOf("javascript:") === 0) { e = e.substr(11); t = true } else if (e.indexOf("js:") === 0) { e = e.substr(3); t = true } if (e.indexOf("{") !== 0) { e = "{" + e + "}" } let n; if (t) { n = vn(r, function() { return Function("return (" + e + ")")() }, {}) } else { n = S(e) } for (const l in n) { if (n.hasOwnProperty(l)) { if (i[l] == null) { i[l] = n[l] } } } } return wn(ce(u(r)), e, o, i) } function vn(e, t, n) { if (Q.config.allowEval) { return t() } else { fe(e, "htmx:evalDisallowedError"); return n } } function Sn(e, t) { return wn(e, "hx-vars", true, t) } function En(e, t) { return wn(e, "hx-vals", false, t) } function Cn(e) { return ue(Sn(e), En(e)) } function On(t, n, r) { if (r !== null) { try { t.setRequestHeader(n, r) } catch (e) { t.setRequestHeader(n, encodeURIComponent(r)); t.setRequestHeader(n + "-URI-AutoEncoded", "true") } } } function Rn(t) { if (t.responseURL && typeof URL !== "undefined") { try { const e = new URL(t.responseURL); return e.pathname + e.search } catch (e) { fe(ne().body, "htmx:badResponseUrl", { url: t.responseURL }) } } } function C(e, t) { return t.test(e.getAllResponseHeaders()) } function Hn(e, t, n) { e = e.toLowerCase(); if (n) { if (n instanceof Element || typeof n === "string") { return he(e, t, null, null, { targetOverride: y(n), returnPromise: true }) } else { return he(e, t, y(n.source), n.event, { handler: n.handler, headers: n.headers, values: n.values, targetOverride: y(n.target), swapOverride: n.swap, select: n.select, returnPromise: true }) } } else { return he(e, t, null, null, { returnPromise: true }) } } function Tn(e) { const t = []; while (e) { t.push(e); e = e.parentElement } return t } function qn(e, t, n) { let r; let o; if (typeof URL === "function") { o = new URL(t, document.location.href); const i = document.location.origin; r = i === o.origin } else { o = t; r = l(t, document.location.origin) } if (Q.config.selfRequestsOnly) { if (!r) { return false } } return de(e, "htmx:validateUrl", ue({ url: o, sameHost: r }, n)) } function Ln(e) { if (e instanceof FormData) return e; const t = new FormData; for (const n in e) { if (e.hasOwnProperty(n)) { if (typeof e[n].forEach === "function") { e[n].forEach(function(e) { t.append(n, e) }) } else if (typeof e[n] === "object" && !(e[n] instanceof Blob)) { t.append(n, JSON.stringify(e[n])) } else { t.append(n, e[n]) } } } return t } function Nn(r, o, e) { return new Proxy(e, { get: function(t, e) { if (typeof e === "number") return t[e]; if (e === "length") return t.length; if (e === "push") { return function(e) { t.push(e); r.append(o, e) } } if (typeof t[e] === "function") { return function() { t[e].apply(t, arguments); r.delete(o); t.forEach(function(e) { r.append(o, e) }) } } if (t[e] && t[e].length === 1) { return t[e][0] } else { return t[e] } }, set: function(e, t, n) { e[t] = n; r.delete(o); e.forEach(function(e) { r.append(o, e) }); return true } }) } function An(r) { return new Proxy(r, { get: function(e, t) { if (typeof t === "symbol") { return Reflect.get(e, t) } if (t === "toJSON") { return () => Object.fromEntries(r) } if (t in e) { if (typeof e[t] === "function") { return function() { return r[t].apply(r, arguments) } } else { return e[t] } } const n = r.getAll(t); if (n.length === 0) { return undefined } else if (n.length === 1) { return n[0] } else { return Nn(e, t, n) } }, set: function(t, n, e) { if (typeof n !== "string") { return false } t.delete(n); if (typeof e.forEach === "function") { e.forEach(function(e) { t.append(n, e) }) } else if (typeof e === "object" && !(e instanceof Blob)) { t.append(n, JSON.stringify(e)) } else { t.append(n, e) } return true }, deleteProperty: function(e, t) { if (typeof t === "string") { e.delete(t) } return true }, ownKeys: function(e) { return Reflect.ownKeys(Object.fromEntries(e)) }, getOwnPropertyDescriptor: function(e, t) { return Reflect.getOwnPropertyDescriptor(Object.fromEntries(e), t) } }) } function he(t, n, r, o, i, D) { let s = null; let l = null; i = i != null ? i : {}; if (i.returnPromise && typeof Promise !== "undefined") { var e = new Promise(function(e, t) { s = e; l = t }) } if (r == null) { r = ne().body } const M = i.handler || Mn; const X = i.select || null; if (!le(r)) { oe(s); return e } const u = i.targetOverride || ce(Ce(r)); if (u == null || u == ve) { fe(r, "htmx:targetError", { target: te(r, "hx-target") }); oe(l); return e } let c = ie(r); const a = c.lastButtonClicked; if (a) { const L = ee(a, "formaction"); if (L != null) { n = L } const N = ee(a, "formmethod"); if (N != null) { if (N.toLowerCase() !== "dialog") { t = N } } } const f = re(r, "hx-confirm"); if (D === undefined) { const K = function(e) { return he(t, n, r, o, i, !!e) }; const G = { target: u, elt: r, path: n, verb: t, triggeringEvent: o, etc: i, issueRequest: K, question: f }; if (de(r, "htmx:confirm", G) === false) { oe(s); return e } } let d = r; let h = re(r, "hx-sync"); let g = null; let F = false; if (h) { const A = h.split(":"); const I = A[0].trim(); if (I === "this") { d = Ee(r, "hx-sync") } else { d = ce(ae(r, I)) } h = (A[1] || "drop").trim(); c = ie(d); if (h === "drop" && c.xhr && c.abortable !== true) { oe(s); return e } else if (h === "abort") { if (c.xhr) { oe(s); return e } else { F = true } } else if (h === "replace") { de(d, "htmx:abort") } else if (h.indexOf("queue") === 0) { const Z = h.split(" "); g = (Z[1] || "last").trim() } } if (c.xhr) { if (c.abortable) { de(d, "htmx:abort") } else { if (g == null) { if (o) { const P = ie(o); if (P && P.triggerSpec && P.triggerSpec.queue) { g = P.triggerSpec.queue } } if (g == null) { g = "last" } } if (c.queuedRequests == null) { c.queuedRequests = [] } if (g === "first" && c.queuedRequests.length === 0) { c.queuedRequests.push(function() { he(t, n, r, o, i) }) } else if (g === "all") { c.queuedRequests.push(function() { he(t, n, r, o, i) }) } else if (g === "last") { c.queuedRequests = []; c.queuedRequests.push(function() { he(t, n, r, o, i) }) } oe(s); return e } } const p = new XMLHttpRequest; c.xhr = p; c.abortable = F; const m = function() { c.xhr = null; c.abortable = false; if (c.queuedRequests != null && c.queuedRequests.length > 0) { const e = c.queuedRequests.shift(); e() } }; const B = re(r, "hx-prompt"); if (B) { var y = prompt(B); if (y === null || !de(r, "htmx:prompt", { prompt: y, target: u })) { oe(s); m(); return e } } if (f && !D) { if (!confirm(f)) { oe(s); m(); return e } } let x = dn(r, u, y); if (t !== "get" && !mn(r)) { x["Content-Type"] = "application/x-www-form-urlencoded" } if (i.headers) { x = ue(x, i.headers) } const U = cn(r, t); let b = U.errors; const j = U.formData; if (i.values) { un(j, Ln(i.values)) } const V = Ln(Cn(r)); const w = un(j, V); let v = hn(w, r); if (Q.config.getCacheBusterParam && t === "get") { v.set("org.htmx.cache-buster", ee(u, "id") || "true") } if (n == null || n === "") { n = ne().location.href } const S = wn(r, "hx-request"); const _ = ie(r).boosted; let E = Q.config.methodsThatUseUrlParams.indexOf(t) >= 0; const C = { boosted: _, useUrlParams: E, formData: v, parameters: An(v), unfilteredFormData: w, unfilteredParameters: An(w), headers: x, target: u, verb: t, errors: b, withCredentials: i.credentials || S.credentials || Q.config.withCredentials, timeout: i.timeout || S.timeout || Q.config.timeout, path: n, triggeringEvent: o }; if (!de(r, "htmx:configRequest", C)) { oe(s); m(); return e } n = C.path; t = C.verb; x = C.headers; v = Ln(C.parameters); b = C.errors; E = C.useUrlParams; if (b && b.length > 0) { de(r, "htmx:validation:halted", C); oe(s); m(); return e } const $ = n.split("#"); const z = $[0]; const O = $[1]; let R = n; if (E) { R = z; const Y = !v.keys().next().done; if (Y) { if (R.indexOf("?") < 0) { R += "?" } else { R += "&" } R += fn(v); if (O) { R += "#" + O } } } if (!qn(r, R, C)) { fe(r, "htmx:invalidPath", C); oe(l); return e } p.open(t.toUpperCase(), R, true); p.overrideMimeType("text/html"); p.withCredentials = C.withCredentials; p.timeout = C.timeout; if (S.noHeaders) { } else { for (const k in x) { if (x.hasOwnProperty(k)) { const W = x[k]; On(p, k, W) } } } const H = { xhr: p, target: u, requestConfig: C, etc: i, boosted: _, select: X, pathInfo: { requestPath: n, finalRequestPath: R, responsePath: null, anchor: O } }; p.onload = function() { try { const t = Tn(r); H.pathInfo.responsePath = Rn(p); M(r, H); if (H.keepIndicators !== true) { en(T, q) } de(r, "htmx:afterRequest", H); de(r, "htmx:afterOnLoad", H); if (!le(r)) { let e = null; while (t.length > 0 && e == null) { const n = t.shift(); if (le(n)) { e = n } } if (e) { de(e, "htmx:afterRequest", H); de(e, "htmx:afterOnLoad", H) } } oe(s); m() } catch (e) { fe(r, "htmx:onLoadError", ue({ error: e }, H)); throw e } }; p.onerror = function() { en(T, q); fe(r, "htmx:afterRequest", H); fe(r, "htmx:sendError", H); oe(l); m() }; p.onabort = function() { en(T, q); fe(r, "htmx:afterRequest", H); fe(r, "htmx:sendAbort", H); oe(l); m() }; p.ontimeout = function() { en(T, q); fe(r, "htmx:afterRequest", H); fe(r, "htmx:timeout", H); oe(l); m() }; if (!de(r, "htmx:beforeRequest", H)) { oe(s); m(); return e } var T = Wt(r); var q = Qt(r); se(["loadstart", "loadend", "progress", "abort"], function(t) { se([p, p.upload], function(e) { e.addEventListener(t, function(e) { de(r, "htmx:xhr:" + t, { lengthComputable: e.lengthComputable, loaded: e.loaded, total: e.total }) }) }) }); de(r, "htmx:beforeSend", H); const J = E ? null : yn(p, r, v); p.send(J); return e } function In(e, t) { const n = t.xhr; let r = null; let o = null; if (C(n, /HX-Push:/i)) { r = n.getResponseHeader("HX-Push"); o = "push" } else if (C(n, /HX-Push-Url:/i)) { r = n.getResponseHeader("HX-Push-Url"); o = "push" } else if (C(n, /HX-Replace-Url:/i)) { r = n.getResponseHeader("HX-Replace-Url"); o = "replace" } if (r) { if (r === "false") { return {} } else { return { type: o, path: r } } } const i = t.pathInfo.finalRequestPath; const s = t.pathInfo.responsePath; const l = re(e, "hx-push-url"); const u = re(e, "hx-replace-url"); const c = ie(e).boosted; let a = null; let f = null; if (l) { a = "push"; f = l } else if (u) { a = "replace"; f = u } else if (c) { a = "push"; f = s || i } if (f) { if (f === "false") { return {} } if (f === "true") { f = s || i } if (t.pathInfo.anchor && f.indexOf("#") === -1) { f = f + "#" + t.pathInfo.anchor } return { type: a, path: f } } else { return {} } } function Pn(e, t) { var n = new RegExp(e.code); return n.test(t.toString(10)) } function kn(e) { for (var t = 0; t < Q.config.responseHandling.length; t++) { var n = Q.config.responseHandling[t]; if (Pn(n, e.status)) { return n } } return { swap: false } } function Dn(e) { if (e) { const t = r("title"); if (t) { t.innerHTML = e } else { window.document.title = e } } } function Mn(o, i) { const s = i.xhr; let l = i.target; const e = i.etc; const u = i.select; if (!de(o, "htmx:beforeOnLoad", i)) return; if (C(s, /HX-Trigger:/i)) { Je(s, "HX-Trigger", o) } if (C(s, /HX-Location:/i)) { zt(); let e = s.getResponseHeader("HX-Location"); var t; if (e.indexOf("{") === 0) { t = S(e); e = t.path; delete t.path } Hn("get", e, t).then(function() { Jt(e) }); return } const n = C(s, /HX-Refresh:/i) && s.getResponseHeader("HX-Refresh") === "true"; if (C(s, /HX-Redirect:/i)) { i.keepIndicators = true; location.href = s.getResponseHeader("HX-Redirect"); n && location.reload(); return } if (n) { i.keepIndicators = true; location.reload(); return } if (C(s, /HX-Retarget:/i)) { if (s.getResponseHeader("HX-Retarget") === "this") { i.target = o } else { i.target = ce(ae(o, s.getResponseHeader("HX-Retarget"))) } } const c = In(o, i); const r = kn(s); const a = r.swap; let f = !!r.error; let d = Q.config.ignoreTitle || r.ignoreTitle; let h = r.select; if (r.target) { i.target = ce(ae(o, r.target)) } var g = e.swapOverride; if (g == null && r.swapOverride) { g = r.swapOverride } if (C(s, /HX-Retarget:/i)) { if (s.getResponseHeader("HX-Retarget") === "this") { i.target = o } else { i.target = ce(ae(o, s.getResponseHeader("HX-Retarget"))) } } if (C(s, /HX-Reswap:/i)) { g = s.getResponseHeader("HX-Reswap") } var p = s.response; var m = ue({ shouldSwap: a, serverResponse: p, isError: f, ignoreTitle: d, selectOverride: h }, i); if (r.event && !de(l, r.event, m)) return; if (!de(l, "htmx:beforeSwap", m)) return; l = m.target; p = m.serverResponse; f = m.isError; d = m.ignoreTitle; h = m.selectOverride; i.target = l; i.failed = f; i.successful = !f; if (m.shouldSwap) { if (s.status === 286) { ut(o) } Bt(o, function(e) { p = e.transformResponse(p, s, o) }); if (c.type) { zt() } if (C(s, /HX-Reswap:/i)) { g = s.getResponseHeader("HX-Reswap") } var y = pn(o, g); if (!y.hasOwnProperty("ignoreTitle")) { y.ignoreTitle = d } l.classList.add(Q.config.swappingClass); let n = null; let r = null; if (u) { h = u } if (C(s, /HX-Reselect:/i)) { h = s.getResponseHeader("HX-Reselect") } const x = re(o, "hx-select-oob"); const b = re(o, "hx-select"); let e = function() { try { if (c.type) { de(ne().body, "htmx:beforeHistoryUpdate", ue({ history: c }, i)); if (c.type === "push") { Jt(c.path); de(ne().body, "htmx:pushedIntoHistory", { path: c.path }) } else { Kt(c.path); de(ne().body, "htmx:replacedInHistory", { path: c.path }) } } ze(l, p, y, { select: h || b, selectOOB: x, eventInfo: i, anchor: i.pathInfo.anchor, contextElement: o, afterSwapCallback: function() { if (C(s, /HX-Trigger-After-Swap:/i)) { let e = o; if (!le(o)) { e = ne().body } Je(s, "HX-Trigger-After-Swap", e) } }, afterSettleCallback: function() { if (C(s, /HX-Trigger-After-Settle:/i)) { let e = o; if (!le(o)) { e = ne().body } Je(s, "HX-Trigger-After-Settle", e) } oe(n) } }) } catch (e) { fe(o, "htmx:swapError", i); oe(r); throw e } }; let t = Q.config.globalViewTransitions; if (y.hasOwnProperty("transition")) { t = y.transition } if (t && de(o, "htmx:beforeTransition", i) && typeof Promise !== "undefined" && document.startViewTransition) { const w = new Promise(function(e, t) { n = e; r = t }); const v = e; e = function() { document.startViewTransition(function() { v(); return w }) } } if (y.swapDelay > 0) { E().setTimeout(e, y.swapDelay) } else { e() } } if (f) { fe(o, "htmx:responseError", ue({ error: "Response Status Error Code " + s.status + " from " + i.pathInfo.requestPath }, i)) } } const Xn = {}; function Fn() { return { init: function(e) { return null }, getSelectors: function() { return null }, onEvent: function(e, t) { return true }, transformResponse: function(e, t, n) { return e }, isInlineSwap: function(e) { return false }, handleSwap: function(e, t, n, r) { return false }, encodeParameters: function(e, t, n) { return null } } } function Bn(e, t) { if (t.init) { t.init(n) } Xn[e] = ue(Fn(), t) } function Un(e) { delete Xn[e] } function jn(e, n, r) { if (n == undefined) { n = [] } if (e == undefined) { return n } if (r == undefined) { r = [] } const t = te(e, "hx-ext"); if (t) { se(t.split(","), function(e) { e = e.replace(/ /g, ""); if (e.slice(0, 7) == "ignore:") { r.push(e.slice(7)); return } if (r.indexOf(e) < 0) { const t = Xn[e]; if (t && n.indexOf(t) < 0) { n.push(t) } } }) } return jn(ce(u(e)), n, r) } var Vn = false; ne().addEventListener("DOMContentLoaded", function() { Vn = true }); function _n(e) { if (Vn || ne().readyState === "complete") { e() } else { ne().addEventListener("DOMContentLoaded", e) } } function $n() { if (Q.config.includeIndicatorStyles !== false) { const e = Q.config.inlineStyleNonce ? ` nonce="${Q.config.inlineStyleNonce}"` : ""; ne().head.insertAdjacentHTML("beforeend", " ." + Q.config.indicatorClass + "{opacity:0} ." + Q.config.requestClass + " ." + Q.config.indicatorClass + "{opacity:1; transition: opacity 200ms ease-in;} ." + Q.config.requestClass + "." + Q.config.indicatorClass + "{opacity:1; transition: opacity 200ms ease-in;} ") } } function zn() { const e = ne().querySelector('meta[name="htmx-config"]'); if (e) { return S(e.content) } else { return null } } function Jn() { const e = zn(); if (e) { Q.config = ue(Q.config, e) } } _n(function() { Jn(); $n(); let e = ne().body; Dt(e); const t = ne().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']"); e.addEventListener("htmx:abort", function(e) { const t = e.target; const n = ie(t); if (n && n.xhr) { n.xhr.abort() } }); const n = window.onpopstate ? window.onpopstate.bind(window) : null; window.onpopstate = function(e) { if (e.state && e.state.htmx) { Yt(); se(t, function(e) { de(e, "htmx:restored", { document: ne(), triggerEvent: de }) }) } else { if (n) { n(e) } } }; E().setTimeout(function() { de(e, "htmx:load", {}); e = null }, 0) }); return Q }(); diff --git a/src/database/db.go b/src/database/db.go new file mode 100644 index 0000000..3888f6e --- /dev/null +++ b/src/database/db.go @@ -0,0 +1,35 @@ +package database + +import ( + "fmt" + "log" + "os" + + "gorm.io/driver/postgres" + "gorm.io/gorm" +) + +var ( + database = os.Getenv("DB_DATABASE") + password = os.Getenv("DB_PASSWORD") + username = os.Getenv("DB_USERNAME") + port = os.Getenv("DB_PORT") + host = os.Getenv("DB_HOST") + schema = os.Getenv("DB_SCHEMA") + dbHandle *gorm.DB +) + +func New() *gorm.DB { + // Reuse Connection + if dbHandle != nil { + return dbHandle + } + + dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%s sslmode=disable", host, username, password, database, port) + db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{}) + if err != nil { + log.Fatal(err) + } + dbHandle = db + return db +} diff --git a/src/modules/auth/login.go b/src/modules/auth/login.go new file mode 100644 index 0000000..7ae16db --- /dev/null +++ b/src/modules/auth/login.go @@ -0,0 +1,14 @@ +package auth + +import ( + "acide/src/utils" + "net/http" + + "github.com/labstack/echo" +) + +// Renders the login form +func login(c echo.Context) error { + + return utils.RenderTempl(c, http.StatusOK, LoginTempl()) +} diff --git a/src/modules/auth/login.templ b/src/modules/auth/login.templ new file mode 100644 index 0000000..bae60b4 --- /dev/null +++ b/src/modules/auth/login.templ @@ -0,0 +1,11 @@ +package auth + +import "acide/src/utils" + +templ LoginTempl() { + @utils.SkeletonTempl() { +
+ This is the Login template +
+ } +} diff --git a/src/modules/auth/login_templ.go b/src/modules/auth/login_templ.go new file mode 100644 index 0000000..2bd13a8 --- /dev/null +++ b/src/modules/auth/login_templ.go @@ -0,0 +1,60 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package auth + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "acide/src/utils" + +func LoginTempl() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
This is the Login template
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = utils.SkeletonTempl().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/src/modules/auth/setup.go b/src/modules/auth/setup.go new file mode 100644 index 0000000..8dc3b0e --- /dev/null +++ b/src/modules/auth/setup.go @@ -0,0 +1,39 @@ +package auth + +import ( + "log" + + "github.com/labstack/echo" + "gorm.io/gorm" +) + +// Represents a User in the Database +type User struct { + gorm.Model + Name string + Password string +} + +// A package-level database handle. +// It is set up by the [SetupSchema] func, +// which should be called before the webserver +// begins to accept connections +var db *gorm.DB + +// Creates all the database tables that this module requires, +// and sets up the database handle for this module +func SetupSchema(dbHandle *gorm.DB) { + dbHandle.AutoMigrate(&User{}) + db = dbHandle +} + +// Registers all the routes that this module (auth) provides +func SetupRoutes(g *echo.Group) { + log.Print("Setting up the auth module") + + // To just render an HTML template with HTTP 200 status: + // g.GET("/login", echo.WrapHandler(templ.Handler(LoginTempl()))) + + // To include custom rendering logic: + g.GET("/login", login) +} diff --git a/src/routes.go b/src/routes.go new file mode 100644 index 0000000..c8824fe --- /dev/null +++ b/src/routes.go @@ -0,0 +1,45 @@ +package src + +import ( + "acide/src/modules/auth" + "net/http" + "os" + + "github.com/labstack/echo" + "github.com/labstack/echo/middleware" +) + +var dev = os.Getenv("DEV") != "" + +// Sets up the Echo server, and registers all routes and sub routes +func (s *Server) RegisterRoutes() http.Handler { + e := echo.New() + e.Use(middleware.Logger()) + e.Use(middleware.Recover()) + // e.Use(middleware.CSRF()) + + // Static files + staticFilesFolder := disableCacheInDevMode(http.StripPrefix("/public", + http.FileServer(http.Dir("public")))) + e.GET("/public/*", echo.WrapHandler(staticFilesFolder)) + + // TODO: Register subroutes here + // login.SetupRoutes(e.Group("/auth")) + auth.SetupRoutes(e.Group("/auth")) + + e.GET("/", func(ctx echo.Context) error { + return ctx.String(http.StatusOK, "Hello") + }) + + return e +} + +func disableCacheInDevMode(next http.Handler) http.Handler { + if !dev { + return next + } + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Cache-Control", "no-store") + next.ServeHTTP(w, r) + }) +} diff --git a/src/server.go b/src/server.go new file mode 100644 index 0000000..a927651 --- /dev/null +++ b/src/server.go @@ -0,0 +1,47 @@ +package src + +import ( + "acide/src/database" + "fmt" + "net/http" + "os" + "strconv" + "time" + + _ "github.com/joho/godotenv/autoload" + + "gorm.io/gorm" +) + +type Server struct { + port int + db *gorm.DB +} + +// Creates a new Server +func NewServer() *http.Server { + portEnv := os.Getenv("PORT") + port, err := strconv.Atoi(portEnv) + if err != nil { + panic(fmt.Sprintf("Error converting PORT env variable to int.\n%s\n%s", portEnv, err)) + } + + NewServer := &Server{ + port: port, + db: database.New(), + } + + // TODO: Register DB schemas here + // login.SetupSchema(NewServer.db) + + // Declare Server config + server := &http.Server{ + Addr: fmt.Sprintf(":%d", NewServer.port), + Handler: NewServer.RegisterRoutes(), + IdleTimeout: time.Minute, + ReadTimeout: 10 * time.Second, + WriteTimeout: 30 * time.Second, + } + + return server +} diff --git a/src/utils/utils.go b/src/utils/utils.go new file mode 100644 index 0000000..3922fb0 --- /dev/null +++ b/src/utils/utils.go @@ -0,0 +1,21 @@ +package utils + +import ( + "bytes" + "errors" + "log" + + "github.com/a-h/templ" + "github.com/labstack/echo" +) + +// Renders a template and sends it with a custom http status code +func RenderTempl(c echo.Context, status int, cmp templ.Component) error { + var buff bytes.Buffer + if err := cmp.Render(c.Request().Context(), &buff); err != nil { + log.Print(err) + return errors.New("Error rendering templ component") + } + + return c.HTML(status, buff.String()) +} diff --git a/src/utils/utils.templ b/src/utils/utils.templ new file mode 100644 index 0000000..c39bc52 --- /dev/null +++ b/src/utils/utils.templ @@ -0,0 +1,18 @@ +package utils + +templ SkeletonTempl() { + + + + + Acide Template + + + + +
+ { children... } +
+ + +} diff --git a/src/utils/utils_templ.go b/src/utils/utils_templ.go new file mode 100644 index 0000000..6e6bc93 --- /dev/null +++ b/src/utils/utils_templ.go @@ -0,0 +1,48 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.778 +package utils + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func SkeletonTempl() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Acide Template
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return templ_7745c5c3_Err + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/tailwind.config.cjs b/tailwind.config.cjs new file mode 100644 index 0000000..d19aa78 --- /dev/null +++ b/tailwind.config.cjs @@ -0,0 +1,11 @@ +/** @type {import('tailwindcss').Config} */ +export default { + content: [ + "./src/**/*.{html,templ}", + ], + theme: { + extend: {}, + }, + plugins: [], +} +