glyph-server 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,88 +1,104 @@
1
- # Glyph CLI
2
-
3
- ```sh
4
- npm install --global glyph-server
5
- glyph help
6
- glyph version
7
- ```
8
-
9
- Node.js 22+ is required. Installation downloads the exact matching native release,
10
- checks its SHA-256 and version, and supports Windows x64, macOS x64/arm64 and glibc
11
- Linux x64/arm64. Rust is not required. `glyph-server` remains a compatibility alias.
12
-
13
- ## Your own server
14
-
15
- ```sh
16
- glyph setup cloudflare
17
- glyph deploy --config glyph-cloudflare/wrangler.json
18
- ```
19
-
20
- The guided setup uses **your** Cloudflare account, creates a D1 database, applies
21
- the included migrations and deploys the prebuilt Worker. R2 media/image storage
22
- is optional and off unless selected; enable R2 in your own account first. It
23
- never copies Glyph's production domains, database IDs or secrets. The password
24
- is hashed locally; Wrangler stores the hash as a secret. Sign in to your own
25
- Cloudflare account when prompted. No Rust, Git checkout or separate desktop
26
- repository is required.
27
-
28
- The setup uses the documented [D1 creation/migration commands](https://developers.cloudflare.com/d1/wrangler-commands/)
29
- and optional [R2 bucket commands](https://developers.cloudflare.com/workers/wrangler/commands/r2/).
30
- For YouTube, deploy your own [companion](https://github.com/glyphmusic/companion)
31
- and set `YTDLP_SERVICE_URL` / `YTDLP_SERVICE_TOKEN` with Wrangler's secret commands
32
- against your generated config. Without a companion the key-free sources still work.
33
-
34
- To host a native server instead: `glyph setup`, then `glyph serve` or
35
- `glyph service install`. Install yt-dlp and FFmpeg for YouTube/encoded audio;
36
- native r-dlp can be selected through `GLYPH_RDLP_PATH`. Cloudflare accounts/sync
37
- use D1; the native server currently has no account storage backend.
38
-
39
- ## Manage and inspect
40
-
41
- ```sh
42
- glyph remote login https://your-server.example
43
- glyph version all
44
- glyph version server
45
- glyph version companion
46
- glyph version r-dlp
47
- glyph check companion
48
- glyph check r-dlp
49
- glyph check all
50
- glyph remote limits --require-account true
51
- ```
52
-
53
- The remembered server is used automatically; pass `--server <url>` to select
54
- another server, or `--local` to inspect this machine's companion and tools.
55
- Companion checks include the running Glyph version, enabled/ready state and the
56
- installed r-dlp, yt-dlp and FFmpeg versions. Installed tool versions are distinct
57
- from an image tag or an already-loaded persistent worker.
58
-
59
- ## Updates
60
-
61
- ```sh
62
- glyph update # npm CLI update
63
- glyph update cli --check
64
- glyph update server --check
65
- glyph update server # authenticated native-server update
66
- glyph update companion --check
67
- glyph update companion
68
- glyph update r-dlp --check
69
- glyph update r-dlp
70
- glyph update server --worker-config glyph-cloudflare/wrangler.json
71
- glyph check companion --compose-dir /path/to/companion-project
72
- glyph update companion --compose-dir /path/to/companion-project
73
- ```
74
-
75
- The Worker update applies your configured migrations and deploys the bundled
76
- Worker using your Cloudflare login. A remote native update replaces its verified
77
- binary and reports when a restart is required; verify the running version after
78
- restarting. Docker images should be updated/recreated through their deployment
79
- instead of modifying binaries inside an immutable container. The CLI does not
80
- claim a running process was updated merely because a file was replaced.
81
-
82
- r-dlp updates use its own release/checksum manifest and reload the extractor pool
83
- after installation. An old companion without management endpoints must first be
84
- updated through its deployment. npm-managed native processes are upgraded with
85
- `glyph update cli` and restarted through the updated CLI, preserving the old
86
- versioned executable while it is running.
87
-
88
- Source, licenses and releases: https://github.com/glyphmusic/server
1
+ # Glyph CLI
2
+
3
+ ```sh
4
+ npm install --global glyph-server
5
+ glyph help
6
+ glyph version
7
+ ```
8
+
9
+ Node.js 22+ is required. Installation downloads the exact matching native release,
10
+ checks its SHA-256 and version, and supports Windows x64, macOS x64/arm64 and glibc
11
+ Linux x64/arm64. Rust is not required. `glyph-server` remains a compatibility alias.
12
+
13
+ ## Your own server
14
+
15
+ ```sh
16
+ glyph setup cloudflare
17
+ glyph deploy --config glyph-cloudflare/wrangler.json
18
+ ```
19
+
20
+ The guided setup uses **your** Cloudflare account, creates a D1 database, applies
21
+ the included migrations and deploys the prebuilt Worker. R2 media/image storage
22
+ is optional and off unless selected; enable R2 in your own account first. It
23
+ never copies Glyph's production domains, database IDs or secrets. The password
24
+ is hashed locally; Wrangler stores the hash as a secret. Sign in to your own
25
+ Cloudflare account when prompted. No Rust, Git checkout or separate desktop
26
+ repository is required.
27
+
28
+ The setup uses the documented [D1 creation/migration commands](https://developers.cloudflare.com/d1/wrangler-commands/)
29
+ and optional [R2 bucket commands](https://developers.cloudflare.com/workers/wrangler/commands/r2/).
30
+ For YouTube, deploy your own [companion](https://github.com/glyphmusic/companion)
31
+ and set `YTDLP_SERVICE_URL` / `YTDLP_SERVICE_TOKEN` with Wrangler's secret commands
32
+ against your generated config. Without a companion the key-free sources still work.
33
+
34
+ To host a native server instead: `glyph setup`, then `glyph serve` or
35
+ `glyph service install`. Install yt-dlp and FFmpeg for YouTube/encoded audio;
36
+ native r-dlp can be selected through `GLYPH_RDLP_PATH`. Cloudflare accounts/sync
37
+ use D1; the native server currently has no account storage backend.
38
+
39
+ ## Manage and inspect
40
+
41
+ ```sh
42
+ glyph remote login https://your-server.example
43
+ glyph version all
44
+ glyph version server
45
+ glyph version companion
46
+ glyph version r-dlp
47
+ glyph check companion
48
+ glyph check r-dlp
49
+ glyph check all
50
+ glyph remote limits --require-account true
51
+ ```
52
+
53
+ The remembered server is used automatically; pass `--server <url>` to select
54
+ another server, or `--local` to inspect this machine's companion and tools.
55
+ Companion checks include the running Glyph version, enabled/ready state and the
56
+ installed r-dlp, yt-dlp and FFmpeg versions. Installed tool versions are distinct
57
+ from an image tag or an already-loaded persistent worker.
58
+
59
+ ## Change options
60
+
61
+ ```sh
62
+ glyph config list # own server: every server.toml option
63
+ glyph config set rate_limit_per_min 120
64
+ glyph config set lastfm_api_key # asked without echo
65
+ glyph cloudflare list # Cloudflare: values in wrangler.json
66
+ glyph cloudflare set REQUIRE_ACCOUNT true # then: glyph deploy
67
+ glyph cloudflare secret LASTFM_API_KEY # applies at once
68
+ glyph cloudflare domain glyph.example.com
69
+ ```
70
+
71
+ `glyph config` validates values and shows where each one comes from (file,
72
+ environment variable or default). `glyph cloudflare` only edits generated
73
+ `wrangler.json` projects; live limits still change with `glyph remote`.
74
+
75
+ ## Updates
76
+
77
+ ```sh
78
+ glyph update # npm CLI update
79
+ glyph update cli --check
80
+ glyph update server --check
81
+ glyph update server # authenticated native-server update
82
+ glyph update companion --check
83
+ glyph update companion
84
+ glyph update r-dlp --check
85
+ glyph update r-dlp
86
+ glyph update server --worker-config glyph-cloudflare/wrangler.json
87
+ glyph check companion --compose-dir /path/to/companion-project
88
+ glyph update companion --compose-dir /path/to/companion-project
89
+ ```
90
+
91
+ The Worker update applies your configured migrations and deploys the bundled
92
+ Worker using your Cloudflare login. A remote native update replaces its verified
93
+ binary and reports when a restart is required; verify the running version after
94
+ restarting. Docker images should be updated/recreated through their deployment
95
+ instead of modifying binaries inside an immutable container. The CLI does not
96
+ claim a running process was updated merely because a file was replaced.
97
+
98
+ r-dlp updates use its own release/checksum manifest and reload the extractor pool
99
+ after installation. An old companion without management endpoints must first be
100
+ updated through its deployment. npm-managed native processes are upgraded with
101
+ `glyph update cli` and restarted through the updated CLI, preserving the old
102
+ versioned executable while it is running.
103
+
104
+ Source, licenses and releases: https://github.com/glyphmusic/server
package/bin/glyph.cjs CHANGED
@@ -1,65 +1,76 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
- const {spawnSync} = require('node:child_process');
4
- const path = require('node:path');
5
- async function main() {
6
- const args = process.argv.slice(2);
7
- if((args[0]==='update' && ['cli','--help',undefined].includes(args[1]) || args[0]==='self-update') && args.includes('--help')) {
8
- console.log('glyph update [cli] [--check]\nUpdates the npm CLI package. Running servers are left running.');return;
9
- }
10
- if(['version','check','update'].includes(args[0]) && ['companion','r-dlp'].includes(args[1]) && args.includes('--compose-dir')) {
11
- if(args.length!==4 || args[2]!=='--compose-dir' || !args[3]) throw new Error('Usage: glyph check|version|update companion|r-dlp --compose-dir /path/to/project');
12
- require('../lib/companion.cjs').manage(args[3],args[0]==='update');return;
13
- }
14
- if ((args[0] === 'update' && (!args[1] || args[1] === 'cli')) || args[0] === 'self-update') {
15
- const offset=args[1]==='cli'?2:1;
16
- if(args.slice(offset).some(arg=>arg!=='--check') || args.slice(offset).length>1) throw new Error('Usage: glyph update [cli] [--check]');
17
- const check = args.includes('--check');
18
- if (check) {
19
- const result = process.platform === 'win32'
20
- ? spawnSync(process.env.ComSpec || 'cmd.exe',['/d','/s','/c','npm view glyph-server version'],{stdio:'inherit'})
21
- : spawnSync('npm',['view','glyph-server','version'],{stdio:'inherit'});
22
- if (result.error) throw result.error;
23
- console.log(`Installed CLI: ${require('../package.json').version}`);
24
- process.exitCode = result.status ?? 1; return;
25
- }
26
- // No native child is running during replacement. Existing servers use
27
- // their versioned cache copy and keep running until explicitly restarted.
28
- const result = process.platform === 'win32'
29
- ? spawnSync(process.env.ComSpec || 'cmd.exe',['/d','/s','/c','npm install --global glyph-server@latest'],{stdio:'inherit'})
30
- : spawnSync('npm',['install','--global','glyph-server@latest'],{stdio:'inherit'});
31
- if (result.error) throw result.error;
32
- if (result.status === 0) {
33
- const file=await require('../lib/install.cjs').install();
34
- const verified=spawnSync(file,['--version'],{stdio:'inherit'});
35
- if(verified.status!==0) throw new Error('npm finished, but the installed CLI could not be verified');
36
- console.log('CLI updated and verified. Running servers/companions retain their current version until restarted.');
37
- }
38
- process.exitCode = result.status ?? 1; return;
39
- }
40
- if (args[0] === 'setup' && args[1] === 'cloudflare') {
41
- if(args.includes('--help')) {console.log('glyph setup cloudflare [--dir project-directory]\nCreates your own Cloudflare resources and deploys the included Worker.');return;}
42
- if(args.length!==2 && !(args.length===4 && args[2]==='--dir')) throw new Error('Usage: glyph setup cloudflare [--dir project-directory]');
43
- const readline=require('node:readline/promises').createInterface({input:process.stdin,output:process.stdout});
44
- const question=text=>readline.question(text); question.close=()=>readline.close();
45
- try {await require('../lib/cloudflare.cjs').setup({dir:args[3]?path.resolve(args[3]):undefined,question});}
46
- finally {readline.close();}
47
- return;
48
- }
49
- if (args[0] === 'deploy' || (args[0] === 'update' && args[1] === 'server' && args.includes('--worker-config'))) {
50
- const flag=args[0]==='deploy'?'--config':'--worker-config';
51
- const index=args.indexOf(flag);
52
- if(args.includes('--help')) {console.log('glyph deploy [--config wrangler.json]\nglyph update server --worker-config wrangler.json');return;}
53
- const offset=args[0]==='deploy'?1:2;
54
- if(args.length!==offset && !(args.length===offset+2 && index===offset && args[index+1])) throw new Error(`Usage: glyph deploy --config /path/to/wrangler.json`);
55
- const fallback=require('node:fs').existsSync('wrangler.json')?'wrangler.json':'glyph-cloudflare/wrangler.json';
56
- await require('../lib/cloudflare.cjs').deploy(args[index+1] && index>=0 ? args[index+1] : fallback);
57
- return;
58
- }
59
- const file = await require('../lib/install.cjs').install();
60
- const result = spawnSync(file,args,{stdio:'inherit',env:{...process.env,GLYPH_NPM_MANAGED:'1'}});
61
- if (result.error) throw result.error;
62
- process.exitCode = result.status ?? 1;
63
- if(result.status===0 && (args[0]==='help' || args.includes('--help'))) console.log('\nWith npm: glyph setup cloudflare [--dir directory] | glyph deploy [--config wrangler.json]\nCloudflare update: glyph update server --worker-config wrangler.json');
64
- }
65
- main().catch(error => {console.error(`glyph: ${error.message}`);process.exitCode=1;});
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ const {spawnSync} = require('node:child_process');
4
+ const path = require('node:path');
5
+ async function main() {
6
+ const args = process.argv.slice(2);
7
+ if((args[0]==='update' && ['cli','--help',undefined].includes(args[1]) || args[0]==='self-update') && args.includes('--help')) {
8
+ console.log('glyph update [cli] [--check]\nUpdates the npm CLI package. Running servers are left running.');return;
9
+ }
10
+ if(['version','check','update'].includes(args[0]) && ['companion','r-dlp'].includes(args[1]) && args.includes('--compose-dir')) {
11
+ if(args.length!==4 || args[2]!=='--compose-dir' || !args[3]) throw new Error('Usage: glyph check|version|update companion|r-dlp --compose-dir /path/to/project');
12
+ require('../lib/companion.cjs').manage(args[3],args[0]==='update');return;
13
+ }
14
+ if ((args[0] === 'update' && (!args[1] || args[1] === 'cli')) || args[0] === 'self-update') {
15
+ const offset=args[1]==='cli'?2:1;
16
+ if(args.slice(offset).some(arg=>arg!=='--check') || args.slice(offset).length>1) throw new Error('Usage: glyph update [cli] [--check]');
17
+ const check = args.includes('--check');
18
+ if (check) {
19
+ const result = process.platform === 'win32'
20
+ ? spawnSync(process.env.ComSpec || 'cmd.exe',['/d','/s','/c','npm view glyph-server version'],{stdio:'inherit'})
21
+ : spawnSync('npm',['view','glyph-server','version'],{stdio:'inherit'});
22
+ if (result.error) throw result.error;
23
+ console.log(`Installed CLI: ${require('../package.json').version}`);
24
+ process.exitCode = result.status ?? 1; return;
25
+ }
26
+ // No native child is running during replacement. Existing servers use
27
+ // their versioned cache copy and keep running until explicitly restarted.
28
+ const result = process.platform === 'win32'
29
+ ? spawnSync(process.env.ComSpec || 'cmd.exe',['/d','/s','/c','npm install --global glyph-server@latest'],{stdio:'inherit'})
30
+ : spawnSync('npm',['install','--global','glyph-server@latest'],{stdio:'inherit'});
31
+ if (result.error) throw result.error;
32
+ if (result.status === 0) {
33
+ const file=await require('../lib/install.cjs').install();
34
+ const verified=spawnSync(file,['--version'],{stdio:'inherit'});
35
+ if(verified.status!==0) throw new Error('npm finished, but the installed CLI could not be verified');
36
+ console.log('CLI updated and verified. Running servers/companions retain their current version until restarted.');
37
+ }
38
+ process.exitCode = result.status ?? 1; return;
39
+ }
40
+ if (args[0] === 'setup' && args[1] === 'cloudflare') {
41
+ if(args.includes('--help')) {console.log('glyph setup cloudflare [--dir project-directory]\nCreates your own Cloudflare resources and deploys the included Worker.');return;}
42
+ if(args.length!==2 && !(args.length===4 && args[2]==='--dir')) throw new Error('Usage: glyph setup cloudflare [--dir project-directory]');
43
+ const readline=require('node:readline/promises').createInterface({input:process.stdin,output:process.stdout});
44
+ const question=text=>readline.question(text); question.close=()=>readline.close();
45
+ try {await require('../lib/cloudflare.cjs').setup({dir:args[3]?path.resolve(args[3]):undefined,question});}
46
+ finally {readline.close();}
47
+ return;
48
+ }
49
+ if (args[0] === 'cloudflare') {
50
+ const cf=require('../lib/cloudflare.cjs');
51
+ if(args.length<2 || args.includes('--help') || args[1]==='help') {console.log(cf.configHelp());return;}
52
+ const rest=args.slice(1);const at=rest.indexOf('--config');
53
+ let file=require('node:fs').existsSync('wrangler.json')?'wrangler.json':'glyph-cloudflare/wrangler.json';
54
+ if(at>=0) {if(!rest[at+1]) throw new Error('--config needs a path');file=rest[at+1];rest.splice(at,2);}
55
+ const [action,name,...value]=rest;
56
+ const valid=action==='list'?rest.length===1:action==='set'?Boolean(name)&&value.length===1:['unset','secret','domain'].includes(action)?Boolean(name)&&value.length===0:false;
57
+ if(!valid) throw new Error('Usage:\n'+cf.configHelp());
58
+ cf.configure(file,action,name,value[0]);return;
59
+ }
60
+ if (args[0] === 'deploy' || (args[0] === 'update' && args[1] === 'server' && args.includes('--worker-config'))) {
61
+ const flag=args[0]==='deploy'?'--config':'--worker-config';
62
+ const index=args.indexOf(flag);
63
+ if(args.includes('--help')) {console.log('glyph deploy [--config wrangler.json]\nglyph update server --worker-config wrangler.json');return;}
64
+ const offset=args[0]==='deploy'?1:2;
65
+ if(args.length!==offset && !(args.length===offset+2 && index===offset && args[index+1])) throw new Error(`Usage: glyph deploy --config /path/to/wrangler.json`);
66
+ const fallback=require('node:fs').existsSync('wrangler.json')?'wrangler.json':'glyph-cloudflare/wrangler.json';
67
+ await require('../lib/cloudflare.cjs').deploy(args[index+1] && index>=0 ? args[index+1] : fallback);
68
+ return;
69
+ }
70
+ const file = await require('../lib/install.cjs').install();
71
+ const result = spawnSync(file,args,{stdio:'inherit',env:{...process.env,GLYPH_NPM_MANAGED:'1'}});
72
+ if (result.error) throw result.error;
73
+ process.exitCode = result.status ?? 1;
74
+ if(result.status===0 && (args[0]==='help' || args.includes('--help'))) console.log('\nWith npm: glyph setup cloudflare [--dir directory] | glyph deploy [--config wrangler.json]\nCloudflare options: glyph cloudflare list|set|unset|secret|domain (glyph cloudflare --help)\nCloudflare update: glyph update server --worker-config wrangler.json');
75
+ }
76
+ main().catch(error => {console.error(`glyph: ${error.message}`);process.exitCode=1;});
package/bin/prepack.cjs CHANGED
@@ -1,14 +1,14 @@
1
- 'use strict';
2
- const fs = require('node:fs');
3
- const path = require('node:path');
4
- const root = path.resolve(__dirname,'../..');
5
- for (const name of ['LICENSE-MIT','LICENSE-APACHE']) fs.copyFileSync(path.join(root,name),path.resolve(__dirname,'..',name));
6
- const worker = path.join(root,'crates/glyph-server-worker/build');
7
- fs.mkdirSync(path.resolve(__dirname,'../worker'),{recursive:true});
8
- for (const name of ['index.js','index_bg.wasm']) {
9
- if (!fs.existsSync(path.join(worker,name))) throw new Error('Build the Worker before packing the npm release');
10
- fs.copyFileSync(path.join(worker,name),path.resolve(__dirname,'../worker',name));
11
- }
12
-
13
- fs.cpSync(path.join(root,'crates/glyph-server-worker/migrations'),path.resolve(__dirname,'../worker/migrations'),{recursive:true});
14
- fs.writeFileSync(path.resolve(__dirname,'../worker/package.json'),JSON.stringify({type:'module'}));
1
+ 'use strict';
2
+ const fs = require('node:fs');
3
+ const path = require('node:path');
4
+ const root = path.resolve(__dirname,'../..');
5
+ for (const name of ['LICENSE-MIT','LICENSE-APACHE']) fs.copyFileSync(path.join(root,name),path.resolve(__dirname,'..',name));
6
+ const worker = path.join(root,'crates/glyph-server-worker/build');
7
+ fs.mkdirSync(path.resolve(__dirname,'../worker'),{recursive:true});
8
+ for (const name of ['index.js','index_bg.wasm']) {
9
+ if (!fs.existsSync(path.join(worker,name))) throw new Error('Build the Worker before packing the npm release');
10
+ fs.copyFileSync(path.join(worker,name),path.resolve(__dirname,'../worker',name));
11
+ }
12
+
13
+ fs.cpSync(path.join(root,'crates/glyph-server-worker/migrations'),path.resolve(__dirname,'../worker/migrations'),{recursive:true});
14
+ fs.writeFileSync(path.resolve(__dirname,'../worker/package.json'),JSON.stringify({type:'module'}));
@@ -108,4 +108,87 @@ async function deploy(file,{run=wrangler,copy=copyPayload,healthFetch=fetch}={})
108
108
  console.log(`Verified Glyph ${health.server_version}: ${origin}\nNext: glyph remote login ${origin}`);
109
109
  } else console.log('Deployment finished. Check your configured public URL with glyph version server --server <url>.');
110
110
  }
111
- module.exports={wrangler,template,setup,deploy,copyPayload};
111
+ // Options of a deployed Worker. Plain values live in wrangler.json `vars`
112
+ // (applied by the next `glyph deploy`); secrets go to Cloudflare directly.
113
+ const VARS={
114
+ RATE_LIMIT_PER_MIN:{help:'anonymous requests per minute and IP (default 60)',check:v=>/^\d{1,6}$/.test(v)},
115
+ YOUTUBE_DAILY_BUDGET_UNITS:{help:'YouTube Data API units per day (default 9000)',check:v=>/^\d{1,9}$/.test(v)},
116
+ REQUIRE_ACCOUNT:{help:'true = only signed-in apps may use the API',check:v=>/^(true|false)$/.test(v)},
117
+ PUBLIC_ORIGIN:{help:'HTTPS origin of this Worker; accounts and passkeys are bound to it',check:v=>httpsOrigin(v)},
118
+ SHARE_ORIGIN:{help:'origin of short /p/ links (its domain must route /p/* here)',check:v=>httpsOrigin(v)},
119
+ YTDLP_SERVICE_URL:{help:'HTTPS URL of your companion (YouTube); pair with secret YTDLP_SERVICE_TOKEN',check:v=>httpsOrigin(v)},
120
+ };
121
+ const SECRETS={
122
+ YOUTUBE_API_KEY:'YouTube Data API key (playlist import)',
123
+ JAMENDO_CLIENT_ID:'Jamendo client ID',
124
+ SOUNDCLOUD_CLIENT_ID:'SoundCloud client ID',
125
+ SOUNDCLOUD_CLIENT_SECRET:'SoundCloud client secret',
126
+ SPOTIFY_CLIENT_ID:'Spotify client ID (playlist import)',
127
+ SPOTIFY_CLIENT_SECRET:'Spotify client secret',
128
+ LASTFM_API_KEY:'Last.fm API key (radio, similar artists)',
129
+ YTDLP_SERVICE_TOKEN:'companion token, 32+ characters',
130
+ GLYPH_SERVER_BEARER:'shared bearer every app must send (private server)',
131
+ };
132
+ function httpsOrigin(v) {
133
+ try {const u=new URL(v);return u.protocol==='https:' && !u.username && !u.password && u.pathname==='/' && !u.search && !u.hash && u.origin===v;}
134
+ catch {return false;}
135
+ }
136
+ function writeConfig(file,config) {fs.writeFileSync(file,JSON.stringify(config,null,2)+'\n');}
137
+ const PASSKEY_WARNING='Warning: passkeys registered on the old origin stop working on the new one; password sign-in keeps working.';
138
+ function configHelp() {
139
+ const pad=Math.max(...Object.keys({...VARS,...SECRETS}).map(k=>k.length));
140
+ return ['glyph cloudflare list values in wrangler.json',
141
+ 'glyph cloudflare set <NAME> <value> change a value, then run glyph deploy',
142
+ 'glyph cloudflare unset <NAME> back to the default, then run glyph deploy',
143
+ 'glyph cloudflare secret <NAME> store a secret in Cloudflare (asked without echo, applies at once)',
144
+ 'glyph cloudflare domain <host> serve on your own domain (custom domain + PUBLIC_ORIGIN)',
145
+ 'All take [--config wrangler.json]. Runtime limits (rate, accounts, companion, MCP) also change live with glyph remote.',
146
+ '','Values:',...Object.entries(VARS).map(([k,v])=>` ${k.padEnd(pad)} ${v.help}`),
147
+ '','Secrets:',...Object.entries(SECRETS).map(([k,v])=>` ${k.padEnd(pad)} ${v}`)].join('\n');
148
+ }
149
+ function configure(file,action,name,value,{run=wrangler,log=console.log}={}) {
150
+ file=path.resolve(file);
151
+ if(!fs.existsSync(file)) throw new Error(`${file} not found; run glyph setup cloudflare first or pass --config.`);
152
+ if(path.extname(file)!=='.json') throw new Error('Only generated wrangler.json projects can be changed here; edit TOML projects by hand.');
153
+ const config=readConfig(file);config.vars=config.vars||{};
154
+ const key=String(name||'').toUpperCase();
155
+ if(action==='list') {
156
+ for(const [k,v] of Object.entries(VARS)) log(`${k} = ${config.vars[k]??'(default)'}\n ${v.help}`);
157
+ const custom=Object.keys(config.vars).filter(k=>!VARS[k]);
158
+ if(custom.length) log(`other vars: ${custom.join(', ')}`);
159
+ log(`custom domain: ${(config.routes||[]).filter(r=>r.custom_domain).map(r=>r.pattern).join(', ')||'none (workers.dev)'}`);
160
+ log(`Secrets are not readable; list their names with: npx wrangler secret list --config ${file}`);
161
+ return;
162
+ }
163
+ if(action==='set' || action==='unset') {
164
+ if(!VARS[key]) throw new Error(`Unknown value ${name||''}. ${SECRETS[key]?`${key} is a secret: glyph cloudflare secret ${key}`:'See glyph cloudflare --help.'}`);
165
+ if(action==='set') {
166
+ const v=String(value??'').trim().replace(/\/$/,'');
167
+ if(!VARS[key].check(v)) throw new Error(`${key}: invalid value. ${VARS[key].help}`);
168
+ if(key==='PUBLIC_ORIGIN' && config.vars.PUBLIC_ORIGIN && config.vars.PUBLIC_ORIGIN!==v) log(PASSKEY_WARNING);
169
+ config.vars[key]=v;
170
+ } else delete config.vars[key];
171
+ writeConfig(file,config);
172
+ log(`${key} ${action==='set'?'= '+config.vars[key]:'removed'} in ${file}. Run glyph deploy --config ${file} to apply.`);
173
+ return;
174
+ }
175
+ if(action==='secret') {
176
+ if(!SECRETS[key]) throw new Error(`Unknown secret ${name||''}. ${VARS[key]?`${key} is a plain value: glyph cloudflare set ${key} <value>`:'See glyph cloudflare --help.'}`);
177
+ run(['secret','put',key,'--config',file]);
178
+ log(`${key} stored in Cloudflare; the Worker uses it right away.`);
179
+ return;
180
+ }
181
+ if(action==='domain') {
182
+ const host=String(name||'').trim().toLowerCase();
183
+ if(!/^(?=.{4,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/.test(host)) throw new Error('Use a hostname like glyph.example.com (no scheme or path); its zone must be on your Cloudflare account.');
184
+ const origin=`https://${host}`;
185
+ if(config.vars.PUBLIC_ORIGIN && config.vars.PUBLIC_ORIGIN!==origin) log(PASSKEY_WARNING);
186
+ config.routes=[...(config.routes||[]).filter(r=>!r.custom_domain),{pattern:host,custom_domain:true}];
187
+ config.vars.PUBLIC_ORIGIN=origin;
188
+ writeConfig(file,config);
189
+ log(`${host} set as custom domain and PUBLIC_ORIGIN. Run glyph deploy --config ${file} to apply.`);
190
+ return;
191
+ }
192
+ throw new Error('Usage:\n'+configHelp());
193
+ }
194
+ module.exports={wrangler,template,setup,deploy,copyPayload,configure,configHelp,VARS,SECRETS};
package/lib/install.cjs CHANGED
@@ -1,105 +1,105 @@
1
- 'use strict';
2
- const fs = require('node:fs');
3
- const path = require('node:path');
4
- const os = require('node:os');
5
- const zlib = require('node:zlib');
6
- const crypto = require('node:crypto');
7
- const { spawnSync } = require('node:child_process');
8
- const pkg = require('../package.json');
9
- const MAX = 128 * 1024 * 1024;
10
-
11
- function target(platform = process.platform, arch = process.arch) {
12
- const targets = { 'win32-x64': 'x86_64-pc-windows-msvc', 'linux-x64': 'x86_64-unknown-linux-gnu',
13
- 'linux-arm64': 'aarch64-unknown-linux-gnu', 'darwin-x64': 'x86_64-apple-darwin', 'darwin-arm64': 'aarch64-apple-darwin' };
14
- const value = targets[`${platform}-${arch}`];
15
- if (!value) throw new Error(`Unsupported platform ${platform}/${arch}. Download a compatible Glyph release instead.`);
16
- if (platform === process.platform && platform === 'linux' && process.report?.getReport().header.glibcVersionRuntime === undefined) {
17
- throw new Error('This Glyph build needs glibc Linux; Alpine/musl is not supported.');
18
- }
19
- return value;
20
- }
21
- function checksum(text, name) {
22
- const entries = text.trim().split(/\r?\n/).map(line => line.match(/^([a-fA-F0-9]{64})\s+\*?(.+)$/))
23
- .filter(m => m && m[2] === name);
24
- if (entries.length !== 1) throw new Error(`No unique SHA-256 checksum for ${name}`);
25
- return entries[0][1].toLowerCase();
26
- }
27
- // Parse into memory, never extract archive paths onto the filesystem.
28
- function unpack(bytes, zip, names) {
29
- if (zip) {
30
- let eocd = -1;
31
- for (let i = bytes.length - 22; i >= Math.max(0,bytes.length - 65557); i--) {
32
- if (bytes.readUInt32LE(i) === 0x06054b50) { eocd = i; break; }
33
- }
34
- if (eocd < 0) throw new Error('Invalid ZIP archive');
35
- let at = bytes.readUInt32LE(eocd + 16);
36
- for (let n = 0; n < bytes.readUInt16LE(eocd + 10); n++) {
37
- if (at + 46 > bytes.length || bytes.readUInt32LE(at) !== 0x02014b50) throw new Error('Invalid ZIP directory');
38
- const nameLen = bytes.readUInt16LE(at + 28);
39
- const name = bytes.subarray(at + 46,at + 46 + nameLen).toString();
40
- const method = bytes.readUInt16LE(at + 10);
41
- const size = bytes.readUInt32LE(at + 24);
42
- const compressed = bytes.readUInt32LE(at + 20);
43
- const local = bytes.readUInt32LE(at + 42);
44
- if (names.includes(name)) {
45
- if (size > MAX || local + 30 > bytes.length || bytes.readUInt32LE(local) !== 0x04034b50) throw new Error('Invalid ZIP member');
46
- const start = local + 30 + bytes.readUInt16LE(local + 26) + bytes.readUInt16LE(local + 28);
47
- if (start + compressed > bytes.length) throw new Error('Truncated ZIP member');
48
- const raw = bytes.subarray(start,start + compressed);
49
- const result = method === 0 ? raw : method === 8 ? zlib.inflateRawSync(raw,{maxOutputLength:MAX}) : null;
50
- if (!result || result.length !== size) throw new Error('Unsupported or invalid ZIP member');
51
- return result;
52
- }
53
- at += 46 + nameLen + bytes.readUInt16LE(at + 30) + bytes.readUInt16LE(at + 32);
54
- }
55
- } else {
56
- const tar = zlib.gunzipSync(bytes,{maxOutputLength:MAX});
57
- for (let at = 0; at + 512 <= tar.length;) {
58
- const name = tar.subarray(at,at + 100).toString().split('\0')[0].replace(/^\.\//,'');
59
- const prefix = tar.subarray(at + 345,at + 500).toString().split('\0')[0];
60
- const size = parseInt(tar.subarray(at + 124,at + 136).toString().replace(/\0.*$/,'').trim() || '0',8);
61
- if (!Number.isSafeInteger(size) || size < 0 || at + 512 + size > tar.length) throw new Error('Invalid TAR member');
62
- if (!prefix && names.includes(name) && [0,48].includes(tar[at + 156])) return tar.subarray(at + 512,at + 512 + size);
63
- at += 512 + Math.ceil(size / 512) * 512;
64
- }
65
- }
66
- throw new Error('Glyph executable missing from release archive');
67
- }
68
- async function download(url, max = MAX) {
69
- const response = await fetch(url,{signal:AbortSignal.timeout(120000)});
70
- if (!response.ok) throw new Error(`Release download failed (HTTP ${response.status}). This CLI version must have a published GitHub release.`);
71
- const chunks = []; let size = 0;
72
- for await (const bytes of response.body) {
73
- size += bytes.length;
74
- if (size > max) throw new Error('Release download exceeds size limit');
75
- chunks.push(bytes);
76
- }
77
- return Buffer.concat(chunks);
78
- }
79
- function executable() {
80
- const base = process.platform === 'win32' ? (process.env.LOCALAPPDATA || os.homedir()) : (process.env.XDG_CACHE_HOME || path.join(os.homedir(),'.cache'));
81
- return path.join(base,'glyph','cli',pkg.version,target(),process.platform === 'win32' ? 'glyph.exe' : 'glyph');
82
- }
83
- function verify(file, expected = pkg.version) {
84
- const result = spawnSync(file,['--version'],{encoding:'utf8',timeout:10000,windowsHide:true});
85
- return result.status === 0 && result.stdout.trim() === `glyph ${expected}`;
86
- }
87
- async function install() {
88
- const file = executable();
89
- if (fs.existsSync(file) && verify(file)) return file;
90
- const name = `glyph-server-${pkg.version}-${target()}.${process.platform === 'win32' ? 'zip' : 'tar.gz'}`;
91
- const base = `https://github.com/glyphmusic/server/releases/download/v${pkg.version}`;
92
- const [archive, manifest] = await Promise.all([download(`${base}/${name}`),download(`${base}/SHA256SUMS.txt`,65536)]);
93
- const hash = crypto.createHash('sha256').update(archive).digest('hex');
94
- if (hash !== checksum(manifest.toString(),name)) throw new Error('SHA-256 mismatch; installation aborted');
95
- const binary = unpack(archive,process.platform === 'win32',['glyph','glyph.exe','glyph-server','glyph-server.exe']);
96
- fs.mkdirSync(path.dirname(file),{recursive:true,mode:0o700});
97
- const staged = `${file}.${process.pid}.${crypto.randomBytes(6).toString('hex')}.new${process.platform === 'win32' ? '.exe' : ''}`;
98
- try {
99
- fs.writeFileSync(staged,binary,{mode:0o755,flag:'wx'});
100
- if (!verify(staged)) throw new Error('Downloaded executable has the wrong Glyph version');
101
- fs.renameSync(staged,file);
102
- } finally { fs.rmSync(staged,{force:true}); }
103
- return file;
104
- }
105
- module.exports = {target,checksum,unpack,download,executable,verify,install};
1
+ 'use strict';
2
+ const fs = require('node:fs');
3
+ const path = require('node:path');
4
+ const os = require('node:os');
5
+ const zlib = require('node:zlib');
6
+ const crypto = require('node:crypto');
7
+ const { spawnSync } = require('node:child_process');
8
+ const pkg = require('../package.json');
9
+ const MAX = 128 * 1024 * 1024;
10
+
11
+ function target(platform = process.platform, arch = process.arch) {
12
+ const targets = { 'win32-x64': 'x86_64-pc-windows-msvc', 'linux-x64': 'x86_64-unknown-linux-gnu',
13
+ 'linux-arm64': 'aarch64-unknown-linux-gnu', 'darwin-x64': 'x86_64-apple-darwin', 'darwin-arm64': 'aarch64-apple-darwin' };
14
+ const value = targets[`${platform}-${arch}`];
15
+ if (!value) throw new Error(`Unsupported platform ${platform}/${arch}. Download a compatible Glyph release instead.`);
16
+ if (platform === process.platform && platform === 'linux' && process.report?.getReport().header.glibcVersionRuntime === undefined) {
17
+ throw new Error('This Glyph build needs glibc Linux; Alpine/musl is not supported.');
18
+ }
19
+ return value;
20
+ }
21
+ function checksum(text, name) {
22
+ const entries = text.trim().split(/\r?\n/).map(line => line.match(/^([a-fA-F0-9]{64})\s+\*?(.+)$/))
23
+ .filter(m => m && m[2] === name);
24
+ if (entries.length !== 1) throw new Error(`No unique SHA-256 checksum for ${name}`);
25
+ return entries[0][1].toLowerCase();
26
+ }
27
+ // Parse into memory, never extract archive paths onto the filesystem.
28
+ function unpack(bytes, zip, names) {
29
+ if (zip) {
30
+ let eocd = -1;
31
+ for (let i = bytes.length - 22; i >= Math.max(0,bytes.length - 65557); i--) {
32
+ if (bytes.readUInt32LE(i) === 0x06054b50) { eocd = i; break; }
33
+ }
34
+ if (eocd < 0) throw new Error('Invalid ZIP archive');
35
+ let at = bytes.readUInt32LE(eocd + 16);
36
+ for (let n = 0; n < bytes.readUInt16LE(eocd + 10); n++) {
37
+ if (at + 46 > bytes.length || bytes.readUInt32LE(at) !== 0x02014b50) throw new Error('Invalid ZIP directory');
38
+ const nameLen = bytes.readUInt16LE(at + 28);
39
+ const name = bytes.subarray(at + 46,at + 46 + nameLen).toString();
40
+ const method = bytes.readUInt16LE(at + 10);
41
+ const size = bytes.readUInt32LE(at + 24);
42
+ const compressed = bytes.readUInt32LE(at + 20);
43
+ const local = bytes.readUInt32LE(at + 42);
44
+ if (names.includes(name)) {
45
+ if (size > MAX || local + 30 > bytes.length || bytes.readUInt32LE(local) !== 0x04034b50) throw new Error('Invalid ZIP member');
46
+ const start = local + 30 + bytes.readUInt16LE(local + 26) + bytes.readUInt16LE(local + 28);
47
+ if (start + compressed > bytes.length) throw new Error('Truncated ZIP member');
48
+ const raw = bytes.subarray(start,start + compressed);
49
+ const result = method === 0 ? raw : method === 8 ? zlib.inflateRawSync(raw,{maxOutputLength:MAX}) : null;
50
+ if (!result || result.length !== size) throw new Error('Unsupported or invalid ZIP member');
51
+ return result;
52
+ }
53
+ at += 46 + nameLen + bytes.readUInt16LE(at + 30) + bytes.readUInt16LE(at + 32);
54
+ }
55
+ } else {
56
+ const tar = zlib.gunzipSync(bytes,{maxOutputLength:MAX});
57
+ for (let at = 0; at + 512 <= tar.length;) {
58
+ const name = tar.subarray(at,at + 100).toString().split('\0')[0].replace(/^\.\//,'');
59
+ const prefix = tar.subarray(at + 345,at + 500).toString().split('\0')[0];
60
+ const size = parseInt(tar.subarray(at + 124,at + 136).toString().replace(/\0.*$/,'').trim() || '0',8);
61
+ if (!Number.isSafeInteger(size) || size < 0 || at + 512 + size > tar.length) throw new Error('Invalid TAR member');
62
+ if (!prefix && names.includes(name) && [0,48].includes(tar[at + 156])) return tar.subarray(at + 512,at + 512 + size);
63
+ at += 512 + Math.ceil(size / 512) * 512;
64
+ }
65
+ }
66
+ throw new Error('Glyph executable missing from release archive');
67
+ }
68
+ async function download(url, max = MAX) {
69
+ const response = await fetch(url,{signal:AbortSignal.timeout(120000)});
70
+ if (!response.ok) throw new Error(`Release download failed (HTTP ${response.status}). This CLI version must have a published GitHub release.`);
71
+ const chunks = []; let size = 0;
72
+ for await (const bytes of response.body) {
73
+ size += bytes.length;
74
+ if (size > max) throw new Error('Release download exceeds size limit');
75
+ chunks.push(bytes);
76
+ }
77
+ return Buffer.concat(chunks);
78
+ }
79
+ function executable() {
80
+ const base = process.platform === 'win32' ? (process.env.LOCALAPPDATA || os.homedir()) : (process.env.XDG_CACHE_HOME || path.join(os.homedir(),'.cache'));
81
+ return path.join(base,'glyph','cli',pkg.version,target(),process.platform === 'win32' ? 'glyph.exe' : 'glyph');
82
+ }
83
+ function verify(file, expected = pkg.version) {
84
+ const result = spawnSync(file,['--version'],{encoding:'utf8',timeout:10000,windowsHide:true});
85
+ return result.status === 0 && result.stdout.trim() === `glyph ${expected}`;
86
+ }
87
+ async function install() {
88
+ const file = executable();
89
+ if (fs.existsSync(file) && verify(file)) return file;
90
+ const name = `glyph-server-${pkg.version}-${target()}.${process.platform === 'win32' ? 'zip' : 'tar.gz'}`;
91
+ const base = `https://github.com/glyphmusic/server/releases/download/v${pkg.version}`;
92
+ const [archive, manifest] = await Promise.all([download(`${base}/${name}`),download(`${base}/SHA256SUMS.txt`,65536)]);
93
+ const hash = crypto.createHash('sha256').update(archive).digest('hex');
94
+ if (hash !== checksum(manifest.toString(),name)) throw new Error('SHA-256 mismatch; installation aborted');
95
+ const binary = unpack(archive,process.platform === 'win32',['glyph','glyph.exe','glyph-server','glyph-server.exe']);
96
+ fs.mkdirSync(path.dirname(file),{recursive:true,mode:0o700});
97
+ const staged = `${file}.${process.pid}.${crypto.randomBytes(6).toString('hex')}.new${process.platform === 'win32' ? '.exe' : ''}`;
98
+ try {
99
+ fs.writeFileSync(staged,binary,{mode:0o755,flag:'wx'});
100
+ if (!verify(staged)) throw new Error('Downloaded executable has the wrong Glyph version');
101
+ fs.renameSync(staged,file);
102
+ } finally { fs.rmSync(staged,{force:true}); }
103
+ return file;
104
+ }
105
+ module.exports = {target,checksum,unpack,download,executable,verify,install};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glyph-server",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Glyph CLI: install, diagnose and manage Glyph servers and companions",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "repository": { "type": "git", "url": "git+https://github.com/glyphmusic/server.git" },
package/worker/index.js CHANGED
@@ -1,5 +1,2 @@
1
- import{WorkerEntrypoint as Rt}from"cloudflare:workers";var Y=globalThis.__worker_init_state={criticalError:!1,instanceId:0};import nt from"./index_bg.wasm";var A=class{constructor(){throw new Error("cannot invoke `new` directly")}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,ht.unregister(this),t}free(){let t=this.__destroy_into_raw();f();try{c.__wbg_containerstartupoptions_free(t,0)}catch(e){a(e)}}get enableInternet(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr);let t;f();try{t=c.__wbg_get_containerstartupoptions_enableInternet(this.__wbg_ptr)}catch(e){a(e)}return t===16777215?void 0:t!==0}get entrypoint(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr);let t;f();try{t=c.__wbg_get_containerstartupoptions_entrypoint(this.__wbg_ptr)}catch(n){a(n)}var e=st(t[0],t[1]);return c.__wbindgen_free(t[0],t[1]*4,4),e}get env(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr);let t;f();try{t=c.__wbg_get_containerstartupoptions_env(this.__wbg_ptr)}catch(e){a(e)}return t}set enableInternet(t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr),u(t)||l(t),f();try{c.__wbg_set_containerstartupoptions_enableInternet(this.__wbg_ptr,u(t)?16777215:t?1:0)}catch(e){a(e)}}set entrypoint(t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr);let e=N(t,c.__wbindgen_malloc),n=m;f();try{c.__wbg_set_containerstartupoptions_entrypoint(this.__wbg_ptr,e,n)}catch(o){a(o)}}set env(t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr),f();try{c.__wbg_set_containerstartupoptions_env(this.__wbg_ptr,t)}catch(e){a(e)}}};Symbol.dispose&&(A.prototype[Symbol.dispose]=A.prototype.free);var z=class{constructor(){throw new Error("cannot invoke `new` directly")}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,pt.unregister(this),t}free(){let t=this.__destroy_into_raw();f();try{c.__wbg_intounderlyingbytesource_free(t,0)}catch(e){a(e)}}get autoAllocateChunkSize(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr);let t;f();try{t=c.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr)}catch(e){a(e)}return t>>>0}cancel(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");let t=this.__destroy_into_raw();s(t),f();try{c.intounderlyingbytesource_cancel(t)}catch(e){a(e)}}pull(t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr);let e;f();try{e=c.intounderlyingbytesource_pull(this.__wbg_ptr,t)}catch(n){a(n)}return e}start(t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr),f();try{c.intounderlyingbytesource_start(this.__wbg_ptr,t)}catch(e){a(e)}}get type(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr);let t;f();try{t=c.intounderlyingbytesource_type(this.__wbg_ptr)}catch(e){a(e)}return wt[t]}};Symbol.dispose&&(z.prototype[Symbol.dispose]=z.prototype.free);var P=class{constructor(){throw new Error("cannot invoke `new` directly")}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,yt.unregister(this),t}free(){let t=this.__destroy_into_raw();f();try{c.__wbg_intounderlyingsink_free(t,0)}catch(e){a(e)}}abort(t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");let e=this.__destroy_into_raw();s(e);let n;f();try{n=c.intounderlyingsink_abort(e,t)}catch(o){a(o)}return n}close(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");let t=this.__destroy_into_raw();s(t);let e;f();try{e=c.intounderlyingsink_close(t)}catch(n){a(n)}return e}write(t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr);let e;f();try{e=c.intounderlyingsink_write(this.__wbg_ptr,t)}catch(n){a(n)}return e}};Symbol.dispose&&(P.prototype[Symbol.dispose]=P.prototype.free);var M=class _{constructor(){throw new Error("cannot invoke `new` directly")}static __wrap(t){let e=Object.create(_.prototype);return e.__wbg_ptr=t,Object.defineProperty(e,"__wbg_inst",{value:g,writable:!0}),Z.register(e,{ptr:t,instance:g},e),e}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),t}free(){let t=this.__destroy_into_raw();f();try{c.__wbg_intounderlyingsource_free(t,0)}catch(e){a(e)}}cancel(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");let t=this.__destroy_into_raw();s(t),f();try{c.intounderlyingsource_cancel(t)}catch(e){a(e)}}pull(t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr);let e;f();try{e=c.intounderlyingsource_pull(this.__wbg_ptr,t)}catch(n){a(n)}return e}};Symbol.dispose&&(M.prototype[Symbol.dispose]=M.prototype.free);var x=class _{constructor(){throw new Error("cannot invoke `new` directly")}static __wrap(t){let e=Object.create(_.prototype);return e.__wbg_ptr=t,Object.defineProperty(e,"__wbg_inst",{value:g,writable:!0}),tt.register(e,{ptr:t,instance:g},e),e}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,tt.unregister(this),t}free(){let t=this.__destroy_into_raw();f();try{c.__wbg_minifyconfig_free(t,0)}catch(e){a(e)}}get css(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr);let t;f();try{t=c.__wbg_get_minifyconfig_css(this.__wbg_ptr)}catch(e){a(e)}return t!==0}get html(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr);let t;f();try{t=c.__wbg_get_minifyconfig_html(this.__wbg_ptr)}catch(e){a(e)}return t!==0}get js(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr);let t;f();try{t=c.__wbg_get_minifyconfig_js(this.__wbg_ptr)}catch(e){a(e)}return t!==0}set css(t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr),l(t),f();try{c.__wbg_set_minifyconfig_css(this.__wbg_ptr,t)}catch(e){a(e)}}set html(t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr),l(t),f();try{c.__wbg_set_minifyconfig_html(this.__wbg_ptr,t)}catch(e){a(e)}}set js(t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr),l(t),f();try{c.__wbg_set_minifyconfig_js(this.__wbg_ptr,t)}catch(e){a(e)}}};Symbol.dispose&&(x.prototype[Symbol.dispose]=x.prototype.free);var R=class{constructor(){throw new Error("cannot invoke `new` directly")}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,vt.unregister(this),t}free(){let t=this.__destroy_into_raw();f();try{c.__wbg_r2range_free(t,0)}catch(e){a(e)}}get length(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr);let t;f();try{t=c.__wbg_get_r2range_length(this.__wbg_ptr)}catch(e){a(e)}return t[0]===0?void 0:t[1]}get offset(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr);let t;f();try{t=c.__wbg_get_r2range_offset(this.__wbg_ptr)}catch(e){a(e)}return t[0]===0?void 0:t[1]}get suffix(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr);let t;f();try{t=c.__wbg_get_r2range_suffix(this.__wbg_ptr)}catch(e){a(e)}return t[0]===0?void 0:t[1]}set length(t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr),u(t)||s(t),f();try{c.__wbg_set_r2range_length(this.__wbg_ptr,!u(t),u(t)?0:t)}catch(e){a(e)}}set offset(t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr),u(t)||s(t),f();try{c.__wbg_set_r2range_offset(this.__wbg_ptr,!u(t),u(t)?0:t)}catch(e){a(e)}}set suffix(t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==g)throw new Error("Invalid stale object from previous Wasm instance");if(this.__wbg_ptr==0)throw new Error("Attempt to use a moved value");s(this.__wbg_ptr),u(t)||s(t),f();try{c.__wbg_set_r2range_suffix(this.__wbg_ptr,!u(t),u(t)?0:t)}catch(e){a(e)}}};Symbol.dispose&&(R.prototype[Symbol.dispose]=R.prototype.free);function U(){g++,I=null,j=null,S=null,typeof numBytesDecoded<"u"&&(numBytesDecoded=0),typeof m<"u"&&(m=0),K=!1,C=!1,H=new WebAssembly.Instance(nt,ct()),c=H.exports,c.__wbindgen_start()}function rt(){let _;f();try{_=c.__worker_init_state()}catch(t){a(t)}return _}function _t(_,t,e){let n;f();try{n=c.fetch(_,t,e)}catch(o){a(o)}return n}function ot(_,t,e){let n;f();try{n=c.scheduled(_,t,e)}catch(o){a(o)}return n}function ct(){return{__proto__:null,"./index_bg.js":{__proto__:null,__wbg_Error_30c8987f7c2ed4e2:function(){return r(function(t,e){return Error(h(t,e))},arguments)},__wbg_Number_14af1003b8dd5ead:function(){return r(function(t){return Number(t)},arguments)},__wbg_String_8564e559799eccda:function(){return r(function(t,e){let n=String(e),o=p(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg___wbindgen_bigint_get_as_i64_a2383202b9353e4c:function(t,e){let n=e,o=typeof n=="bigint"?n:void 0;u(o)||Et(o),b().setBigInt64(t+8,u(o)?BigInt(0):o,!0),b().setInt32(t+0,!u(o),!0)},__wbg___wbindgen_boolean_get_5b446f51afd21013:function(t){let e=t,n=typeof e=="boolean"?e:void 0;return u(n)||l(n),u(n)?16777215:n?1:0},__wbg___wbindgen_debug_string_4687d8d8c2017d52:function(t,e){let n=$(e),o=p(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},__wbg___wbindgen_in_92f62ee1427d9e49:function(t,e){let n=t in e;return l(n),n},__wbg___wbindgen_is_bigint_b123553bed3bb382:function(t){let e=typeof t=="bigint";return l(e),e},__wbg___wbindgen_is_function_1f9d30630b8b1d3d:function(t){let e=typeof t=="function";return l(e),e},__wbg___wbindgen_is_null_e343b7d08827ba72:function(t){let e=t===null;return l(e),e},__wbg___wbindgen_is_null_or_undefined_f9435d56bdcc06df:function(t){let e=t==null;return l(e),e},__wbg___wbindgen_is_object_3c45d4f2dde4e749:function(t){let e=t,n=typeof e=="object"&&e!==null;return l(n),n},__wbg___wbindgen_is_string_90b56bc79aad6f6c:function(t){let e=typeof t=="string";return l(e),e},__wbg___wbindgen_is_undefined_8865fb403f8fe9d8:function(t){let e=t===void 0;return l(e),e},__wbg___wbindgen_jsval_eq_02babf21faa37971:function(t,e){let n=t===e;return l(n),n},__wbg___wbindgen_jsval_loose_eq_677f21e468d6b461:function(t,e){let n=t==e;return l(n),n},__wbg___wbindgen_number_get_2e0e7dee9f701a71:function(t,e){let n=e,o=typeof n=="number"?n:void 0;u(o)||s(o),b().setFloat64(t+8,u(o)?0:o,!0),b().setInt32(t+0,!u(o),!0)},__wbg___wbindgen_reinit_3f79fdb34dee3ea9:function(){C=!0},__wbg___wbindgen_string_get_0380ccaa2f57f0d9:function(t,e){let n=e,o=typeof n=="string"?n:void 0;var i=u(o)?0:p(o,c.__wbindgen_malloc,c.__wbindgen_realloc),d=m;b().setInt32(t+4,d,!0),b().setInt32(t+0,i,!0)},__wbg___wbindgen_throw_41e9ee4f547fc59a:function(t,e){throw new WebAssembly.Exception(J,[new Error(h(t,e))])},__wbg__wbg_cb_unref_dcc1a90847f04c41:function(){return r(function(t){t._wbg_cb_unref()},arguments)},__wbg_all_2228d6712e7ddb97:function(){return r(function(t){return t.all()},arguments)},__wbg_arrayBuffer_7b8b2e9be0285525:function(){return r(function(t){return t.arrayBuffer()},arguments)},__wbg_batch_6b58fc32d9c19d60:function(){return r(function(t,e){return t.batch(e)},arguments)},__wbg_bind_1f842289d2018ed8:function(){return r(function(t,e){return t.bind(...e)},arguments)},__wbg_bodyUsed_3527d29edfc2c752:function(){return r(function(t){let e=t.bodyUsed;return l(e),e},arguments)},__wbg_body_4792166cb351f162:function(){return r(function(t){let e=t.body;return u(e)?0:v(e)},arguments)},__wbg_body_4e088733babc630d:function(){return r(function(t){let e=t.body;return u(e)?0:v(e)},arguments)},__wbg_body_a3a2b558805a2b84:function(){return r(function(t){return t.body},arguments)},__wbg_buffer_56ec2905a66f58b9:function(){return r(function(t){return t.buffer},arguments)},__wbg_byobRequest_54f7ce41d584549a:function(){return r(function(t){let e=t.byobRequest;return u(e)?0:v(e)},arguments)},__wbg_byteLength_9f985b8373f1f3fe:function(){return r(function(t){let e=t.byteLength;return s(e),e},arguments)},__wbg_byteOffset_0bd5a6a03553639c:function(){return r(function(t){let e=t.byteOffset;return s(e),e},arguments)},__wbg_cacheControl_6ea9be880720803d:function(){return r(function(t,e){let n=e.cacheControl;var o=u(n)?0:p(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg_cacheExpiry_ee9de6a8c623e1a8:function(){return r(function(t){let e=t.cacheExpiry;return u(e)?0:v(e)},arguments)},__wbg_caches_0c4f8c535a6a0595:function(){return r(function(t){return t.caches},arguments)},__wbg_call_1875a20c43a36133:function(){return r(function(t,e,n,o){return t.call(e,n,o)},arguments)},__wbg_call_187d372bd5fdd4aa:function(){return r(function(t,e,n){return t.call(e,n)},arguments)},__wbg_call_939a2607c4484b0b:function(){return r(function(t,e,n,o,i){return t.call(e,n,o,i)},arguments)},__wbg_cancel_7c2a08c8db4c73f3:function(){return r(function(t){return t.cancel()},arguments)},__wbg_catch_92594c2d17f55f12:function(){return r(function(t,e){return t.catch(e)},arguments)},__wbg_cause_19276d032a32d4bd:function(){return r(function(t){return t.cause},arguments)},__wbg_cf_909bcfb212a8822c:function(){return r(function(t){let e=t.cf;return u(e)?0:v(e)},arguments)},__wbg_cf_b47fe5ff6d015a0d:function(){return r(function(t){let e=t.cf;return u(e)?0:v(e)},arguments)},__wbg_clearTimeout_d49a4afcd9b218b7:function(){return r(function(t,e){t.clearTimeout(e)},arguments)},__wbg_clone_0bde657d3f85c2d1:function(){return r(function(t){return t.clone()},arguments)},__wbg_clone_946565396b302dfb:function(){return r(function(t){return t.clone()},arguments)},__wbg_close_185286988f30f252:function(){return r(function(t){t.close()},arguments)},__wbg_close_748f26698dabe269:function(){return r(function(t){t.close()},arguments)},__wbg_constructor_076176ce0f386e16:function(){return r(function(t){return t.constructor},arguments)},__wbg_contentDisposition_07447c7ffe1f25b9:function(){return r(function(t,e){let n=e.contentDisposition;var o=u(n)?0:p(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg_contentEncoding_0a83e35746c3ada7:function(){return r(function(t,e){let n=e.contentEncoding;var o=u(n)?0:p(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg_contentLanguage_ac8796c815bdf6a7:function(){return r(function(t,e){let n=e.contentLanguage;var o=u(n)?0:p(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg_contentType_e59097c6037d86e1:function(){return r(function(t,e){let n=e.contentType;var o=u(n)?0:p(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg_country_e8b34ad6526ea4f9:function(){return r(function(t,e){let n=e.country;var o=u(n)?0:p(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg_cron_76b7eba30bc0443e:function(){return r(function(t,e){let n=e.cron,o=p(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg_crypto_38df2bab126b63dc:function(){return r(function(t){return t.crypto},arguments)},__wbg_cursor_1c9a92814964774c:function(){return r(function(t,e){let n=e.cursor;var o=u(n)?0:p(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg_customMetadata_9734802d06bda433:function(){return r(function(t){return t.customMetadata},arguments)},__wbg_default_15d5007f8b46e0bc:function(){return r(function(t){return t.default},arguments)},__wbg_delete_4a8ee012c43b86c0:function(){return r(function(t,e,n){let o,i;try{return o=e,i=n,t.delete(h(e,n))}finally{f();try{c.__wbindgen_free(o,i,1)}catch(d){a(d)}}},arguments)},__wbg_delete_4f3412b083521508:function(){return r(function(t,e,n){var o=st(e,n);return c.__wbindgen_free(e,n*4,4),t.delete(o)},arguments)},__wbg_done_b41a1d26cdb37fb6:function(){return r(function(t){let e=t.done;return l(e),e},arguments)},__wbg_enqueue_4a01c128f9a0de16:function(){return r(function(t,e){t.enqueue(e)},arguments)},__wbg_entries_b55ec7e0dc443355:function(){return r(function(t){return t.entries()},arguments)},__wbg_error_757e9472f8410341:function(){return r(function(t,e){let n,o;try{n=t,o=e,console.error(h(t,e))}finally{f();try{c.__wbindgen_free(n,o,1)}catch(i){a(i)}}},arguments)},__wbg_error_a30e98d44009f1bb:function(){return r(function(t,e){console.error(t,e)},arguments)},__wbg_error_c9cf3fc2064683a9:function(){return r(function(t){console.error(t)},arguments)},__wbg_fetch_0e46da8cf7c730e4:function(){return r(function(t,e,n,o){return t.fetch(h(e,n),o)},arguments)},__wbg_fetch_7b5de4f88137a4dc:function(){return r(function(t,e,n){return t.fetch(e,n)},arguments)},__wbg_first_3f7220e4ae4ce878:function(){return r(function(t,e,n){return t.first(e===0?void 0:h(e,n))},arguments)},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return r(function(t,e){t.getRandomValues(e)},arguments)},__wbg_getReader_bf34f92ee19c42b4:function(){return r(function(t){return t.getReader()},arguments)},__wbg_getTime_f5a55efff2585d5d:function(){return r(function(t){return t.getTime()},arguments)},__wbg_get_31af05bd4842a84f:function(){return r(function(t,e){return Reflect.get(t,e)},arguments)},__wbg_get_6c896e0571ddae51:function(){return r(function(t,e){return t[e>>>0]},arguments)},__wbg_get_834ef2d65b3b5c73:function(){return r(function(t,e,n,o){let i,d;try{return i=e,d=n,t.get(h(e,n),o)}finally{f();try{c.__wbindgen_free(i,d,1)}catch(w){a(w)}}},arguments)},__wbg_get_88983e33467eae60:function(){return r(function(t,e){let n=Reflect.get(t,e);return u(n)?0:v(n)},arguments)},__wbg_get_done_7020b91c987365c7:function(){return r(function(t){let e=t.done;return u(e)||l(e),u(e)?16777215:e?1:0},arguments)},__wbg_get_f75619e20cb68514:function(){return r(function(t,e,n,o){let i=e.get(h(n,o));var d=u(i)?0:p(i,c.__wbindgen_malloc,c.__wbindgen_realloc),w=m;b().setInt32(t+4,w,!0),b().setInt32(t+0,d,!0)},arguments)},__wbg_get_unchecked_288889d017702237:function(){return r(function(t,e){return t[e>>>0]},arguments)},__wbg_get_value_87fbd6ad1283f2e7:function(){return r(function(t){return t.value},arguments)},__wbg_get_with_ref_key_6412cf3094599694:function(){return r(function(t,e){return t[e]},arguments)},__wbg_headers_6930a8bd09b630de:function(){return r(function(t){return t.headers},arguments)},__wbg_headers_eba93595f8944c2f:function(){return r(function(t){return t.headers},arguments)},__wbg_httpMetadata_529f7924a4f73fdd:function(){return r(function(t){return t.httpMetadata},arguments)},__wbg_instanceId_9b67ff33ae8bef8a:function(){return r(function(t){let e=t.instanceId;return s(e),e},arguments)},__wbg_instanceof_ArrayBuffer_a99f175873e5d9b8:function(){return r(function(t){let e;try{e=t instanceof ArrayBuffer}catch{e=!1}let n=e;return l(n),n},arguments)},__wbg_instanceof_Error_80a725f81f2e102d:function(){return r(function(t){let e;try{e=t instanceof Error}catch{e=!1}let n=e;return l(n),n},arguments)},__wbg_instanceof_ReadableStream_e2d77912575119ab:function(){return r(function(t){let e;try{e=t instanceof ReadableStream}catch{e=!1}let n=e;return l(n),n},arguments)},__wbg_instanceof_Response_b8758567269c30b2:function(){return r(function(t){let e;try{e=t instanceof Response}catch{e=!1}let n=e;return l(n),n},arguments)},__wbg_instanceof_Uint8Array_828cef2aaacafc31:function(){return r(function(t){let e;try{e=t instanceof Uint8Array}catch{e=!1}let n=e;return l(n),n},arguments)},__wbg_isArray_e15a2ff68ffdbef2:function(){return r(function(t){let e=Array.isArray(t);return l(e),e},arguments)},__wbg_isSafeInteger_717808ad6a54bd9e:function(){return r(function(t){let e=Number.isSafeInteger(t);return l(e),e},arguments)},__wbg_key_84de5b594a30a514:function(){return r(function(t,e){let n=e.key,o=p(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg_keys_440be172f17c0265:function(){return r(function(t){return Object.keys(t)},arguments)},__wbg_keys_bac434c8972731d5:function(){return r(function(t){return t.keys()},arguments)},__wbg_length_7f3c00c40364105e:function(){return r(function(t){let e=t.length;return s(e),e},arguments)},__wbg_length_d4bdea10311bd9cf:function(){return r(function(t){let e=t.length;return s(e),e},arguments)},__wbg_list_9f5101697159e282:function(){return r(function(t,e){return t.list(e)},arguments)},__wbg_log_17c30ef363c61cf4:function(){return r(function(t){console.log(t)},arguments)},__wbg_match_4ddd34bd7a34ad07:function(){return r(function(t,e,n,o){return t.match(h(e,n),o)},arguments)},__wbg_match_c2e851fa5be0ea84:function(){return r(function(t,e,n){return t.match(e,n)},arguments)},__wbg_message_5f8387f0c32b90a7:function(){return r(function(t){return t.message},arguments)},__wbg_meta_594bb85654c055e4:function(){return r(function(t){return t.meta},arguments)},__wbg_method_6d02ee0808a7de31:function(){return r(function(t,e){let n=e.method,o=p(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg_minifyconfig_new:function(){return r(function(t){return x.__wrap(t)},arguments)},__wbg_msCrypto_bd5a034af96bcba6:function(){return r(function(t){return t.msCrypto},arguments)},__wbg_name_e2eac7cdfa054f65:function(){return r(function(t){return t.name},arguments)},__wbg_name_f9b814d78e8e299f:function(){return r(function(t){return t.name},arguments)},__wbg_new_0_72d020f0c63443d4:function(){return r(function(){return new Date},arguments)},__wbg_new_1dbf7428bba60a42:function(){return r(function(t){return new Uint8Array(t)},arguments)},__wbg_new_227d7c05414eb861:function(){return r(function(){return new Error},arguments)},__wbg_new_28744009d011f847:function(){return r(function(){return new Map},arguments)},__wbg_new_343a093a3c2ffb4e:function(){return r(function(t,e){return new Error(h(t,e))},arguments)},__wbg_new_617a8cdb8bb1130e:function(){return r(function(){return new Object},arguments)},__wbg_new_83ca405eae412a62:function(){return r(function(){return new Headers},arguments)},__wbg_new_big_int_84cdc69174f81f5b:function(){return r(function(t){return new FixedLengthStream(t)},arguments)},__wbg_new_ee2291f50781bf1d:function(){return r(function(){return new Array},arguments)},__wbg_new_f569a2e335eed0bb:function(){return r(function(t){return new FixedLengthStream(t>>>0)},arguments)},__wbg_new_from_slice_9a868026ffa4208a:function(){return r(function(t,e){return new Uint8Array(O(t,e))},arguments)},__wbg_new_typed_b01cb72a8af741a3:function(){return r(function(t,e){try{var n={a:t,b:e},o=(d,w)=>{let y=n.a;n.a=0;try{return dt(y,n.b,d,w)}finally{n.a=y}};return new Promise(o)}finally{n.a=0}},arguments)},__wbg_new_with_byte_offset_and_length_2f5d7fc2a828b74d:function(){return r(function(t,e,n){return new Uint8Array(t,e>>>0,n>>>0)},arguments)},__wbg_new_with_headers_7eaf3e64bd3f0a23:function(){return r(function(t){return new Headers(t)},arguments)},__wbg_new_with_into_underlying_source_a57cfcc7c705351c:function(){return r(function(t,e){return new ReadableStream(M.__wrap(t),e)},arguments)},__wbg_new_with_length_3da0ad195f6f63ba:function(){return r(function(t){return new Uint8Array(t>>>0)},arguments)},__wbg_new_with_opt_buffer_source_and_init_c1b859a23c80afca:function(){return r(function(t,e){return new Response(t,e)},arguments)},__wbg_new_with_opt_readable_stream_and_init_df114f2d364f216d:function(){return r(function(t,e){return new Response(t,e)},arguments)},__wbg_new_with_opt_str_and_init_33bef1b272950372:function(){return r(function(t,e,n){return new Response(t===0?void 0:h(t,e),n)},arguments)},__wbg_new_with_str_and_init_4618dee4e950224f:function(){return r(function(t,e,n){return new Request(h(t,e),n)},arguments)},__wbg_next_f4aac29c42af995c:function(){return r(function(t){return t.next()},arguments)},__wbg_node_84ea875411254db1:function(){return r(function(t){return t.node},arguments)},__wbg_now_aa4ccb83129e9e55:function(){return r(function(){return Date.now()},arguments)},__wbg_objects_5b390b93a9ffcef3:function(){return r(function(t,e){let n=e.objects,o=N(n,c.__wbindgen_malloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg_pipeTo_ac05d32161ffb42c:function(){return r(function(t,e){return t.pipeTo(e)},arguments)},__wbg_prepare_6fe68a8990920f81:function(){return r(function(t,e,n){return t.prepare(h(e,n))},arguments)},__wbg_process_44c7a14e11e9f69e:function(){return r(function(t){return t.process},arguments)},__wbg_prototypesetcall_bc27214492979395:function(){return r(function(t,e,n){Uint8Array.prototype.set.call(O(t,e),n)},arguments)},__wbg_push_2baf45db356cf468:function(){return r(function(t,e){let n=t.push(e);return s(n),n},arguments)},__wbg_put_867461fd552109b2:function(){return r(function(t,e,n){return t.put(e,n)},arguments)},__wbg_put_bbca42771defa466:function(){return r(function(t,e,n,o){return t.put(h(e,n),o)},arguments)},__wbg_put_ece41e2507acd81b:function(){return r(function(t,e,n,o,i){let d,w;try{return d=e,w=n,t.put(h(e,n),o,i)}finally{f();try{c.__wbindgen_free(d,w,1)}catch(y){a(y)}}},arguments)},__wbg_queueMicrotask_9833f9a49df95a49:function(){return r(function(t){return t.queueMicrotask},arguments)},__wbg_queueMicrotask_a72f977e97f23c5f:function(){return r(function(t){queueMicrotask(t)},arguments)},__wbg_randomFillSync_6c25eac9869eb53c:function(){return r(function(t,e){t.randomFillSync(e)},arguments)},__wbg_read_2a943774344c9728:function(){return r(function(t){return t.read()},arguments)},__wbg_readable_4d43535945ae9ca0:function(){return r(function(t){return t.readable},arguments)},__wbg_region_539ec060a01aca98:function(){return r(function(t,e){let n=e.region;var o=u(n)?0:p(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg_releaseLock_eb64cd83aa9fcfe4:function(){return r(function(t){t.releaseLock()},arguments)},__wbg_require_b4edbdcf3e2a1ef0:function(){return r(function(){return module.require},arguments)},__wbg_resolve_0076e10020304ede:function(){return r(function(t){return Promise.resolve(t)},arguments)},__wbg_respond_c102fabcc79e5ef0:function(){return r(function(t,e){t.respond(e>>>0)},arguments)},__wbg_results_a5533c886ed43a9a:function(){return r(function(t){let e=t.results;return u(e)?0:v(e)},arguments)},__wbg_run_0ef9f3480a049b01:function(){return r(function(t){return t.run()},arguments)},__wbg_run_6e1f787af721bfe6:function(){return r(function(t,e,n){try{var o={a:e,b:n},i=()=>{let w=o.a;o.a=0;try{return ft(w,o.b)}finally{o.a=w}};let d=t.run(i);return l(d),d}finally{o.a=0}},arguments)},__wbg_scheduledTime_d6f16c8277d5313d:function(){return r(function(t){return t.scheduledTime},arguments)},__wbg_setTimeout_7fb1e1fe294b6ad9:function(){return r(function(t,e,n){let o=t.setTimeout(e,n);return s(o),o},arguments)},__wbg_set_145a351398b48c65:function(){return r(function(t,e,n){let o=Reflect.set(t,e,n);return l(o),o},arguments)},__wbg_set_575d3ddb70fe831d:function(){return r(function(t,e,n){t.set(O(e,n))},arguments)},__wbg_set_6ae97e73113c4f0b:function(){return r(function(t,e,n){return t.set(e,n)},arguments)},__wbg_set_6be42768c690e380:function(){return r(function(t,e,n){t[e]=n},arguments)},__wbg_set_af5932e3f78b5648:function(){return r(function(t,e,n,o,i){t.set(h(e,n),h(o,i))},arguments)},__wbg_set_bea140a88be9b277:function(){return r(function(t,e,n){t[e>>>0]=n},arguments)},__wbg_set_body_1fb0f1008bfc7df6:function(){return r(function(t,e){t.body=e},arguments)},__wbg_set_cache_7507c4cc5938ccc7:function(){return r(function(t,e){t.cache=lt[e]},arguments)},__wbg_set_criticalError_3904d60fe2a0b05b:function(){return r(function(t,e){t.criticalError=e!==0},arguments)},__wbg_set_headers_40ad33dcf016613f:function(){return r(function(t,e){t.headers=e},arguments)},__wbg_set_headers_69ef7c46a2e6c742:function(){return r(function(t,e){t.headers=e},arguments)},__wbg_set_high_water_mark_3a96edf83df7e06c:function(){return r(function(t,e){t.highWaterMark=e},arguments)},__wbg_set_ignore_method_5b0a1aa453c4d6d2:function(){return r(function(t,e){t.ignoreMethod=e!==0},arguments)},__wbg_set_instanceId_9ad5caac0a4e519c:function(){return r(function(t,e){t.instanceId=e>>>0},arguments)},__wbg_set_method_dcb32343247ec427:function(){return r(function(t,e,n){t.method=h(e,n)},arguments)},__wbg_set_redirect_cc128ab2411da334:function(){return r(function(t,e){t.redirect=mt[e]},arguments)},__wbg_set_signal_2dbd377604627f26:function(){return r(function(t,e){t.signal=e},arguments)},__wbg_set_status_678f122cbe435d95:function(){return r(function(t,e){t.status=e},arguments)},__wbg_size_023ff299b19aa360:function(){return r(function(t){return t.size},arguments)},__wbg_slice_6da4cdc5d543fcd0:function(){return r(function(t,e){let n=e.slice(),o=N(n,c.__wbindgen_malloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg_stack_3b0d974bbf31e44f:function(){return r(function(t,e){let n=e.stack,o=p(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg_static_accessor_CREATE_TASK_7e310091636beacc:function(){return r(function(){let t=typeof console>"u"?null:console?.createTask;return u(t)?0:v(t)},arguments)},__wbg_static_accessor_GLOBAL_266715b9d96ba635:function(){return r(function(){let t=typeof global>"u"?null:global;return u(t)?0:v(t)},arguments)},__wbg_static_accessor_GLOBAL_THIS_10fb7dc1ae063179:function(){return r(function(){let t=typeof globalThis>"u"?null:globalThis;return u(t)?0:v(t)},arguments)},__wbg_static_accessor_INIT_STATE_e3fce2ad8a08e94e:function(){return r(function(){return Y},arguments)},__wbg_static_accessor_SELF_0b583911f537483a:function(){return r(function(){let t=typeof self>"u"?null:self;return u(t)?0:v(t)},arguments)},__wbg_static_accessor_WINDOW_d7f903d1508cbdc4:function(){return r(function(){let t=typeof window>"u"?null:window;return u(t)?0:v(t)},arguments)},__wbg_status_ce0a98d3c57125f3:function(){return r(function(t){let e=t.status;return s(e),e},arguments)},__wbg_subarray_002b94d5e13d1411:function(){return r(function(t,e,n){return t.subarray(e>>>0,n>>>0)},arguments)},__wbg_then_c949d5a25a4e78f8:function(){return r(function(t,e,n){return t.then(e,n)},arguments)},__wbg_then_e71170d78fcf8954:function(){return r(function(t,e){return t.then(e)},arguments)},__wbg_truncated_cc05a4223c013ee9:function(){return r(function(t){let e=t.truncated;return l(e),e},arguments)},__wbg_uploaded_19ec3882ff291aab:function(){return r(function(t){return t.uploaded},arguments)},__wbg_url_7bfada5c2297bc70:function(){return r(function(t,e){let n=e.url,o=p(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=m;b().setInt32(t+4,i,!0),b().setInt32(t+0,o,!0)},arguments)},__wbg_value_f3c585ee8f5ba40c:function(){return r(function(t){return t.value},arguments)},__wbg_versions_276b2795b1c6a219:function(){return r(function(t){return t.versions},arguments)},__wbg_view_9c570f33e8d6ab96:function(){return r(function(t){let e=t.view;return u(e)?0:v(e)},arguments)},__wbg_waitUntil_c51e37673c596e00:function(){return r(function(t,e){t.waitUntil(e)},arguments)},__wbg_webSocket_2b7e8e9549bed673:function(){return r(function(t){let e=t.webSocket;return u(e)?0:v(e)},arguments)},__wbg_writable_44735d15a1cee85d:function(){return r(function(t){return t.writable},arguments)},__wbindgen_generic_0000000000000001:function(){return r(function(t,e){return D(t,e,gt)},arguments)},__wbindgen_generic_0000000000000002:function(){return r(function(t,e){return D(t,e,bt)},arguments)},__wbindgen_generic_0000000000000003:function(){return r(function(t,e){return D(t,e,at)},arguments)},__wbindgen_generic_0000000000000004:function(){return r(function(t){return t},arguments)},__wbindgen_generic_0000000000000005:function(){return r(function(t){return t},arguments)},__wbindgen_generic_0000000000000006:function(){return r(function(t,e){return O(t,e)},arguments)},__wbindgen_generic_0000000000000007:function(){return r(function(t,e){return h(t,e)},arguments)},__wbindgen_generic_0000000000000008:function(){return r(function(t){return BigInt.asUintN(64,t)},arguments)},__wbindgen_init_externref_table:function(){let t=c.__wbindgen_externrefs,e=t.grow(4);t.set(0,void 0),t.set(e+0,void 0),t.set(e+1,null),t.set(e+2,!0),t.set(e+3,!1)},__wbindgen_jstag:WebAssembly.JSTag,__wbindgen_rethrow_critical:function(t){throw new Error("Critical error",{cause:t})}}}}var J=new WebAssembly.Tag({parameters:["externref"]}),B,K=!1;function it(){K=!0;try{let _=G()[c.__abort_handler.value/4];_&&c.__wbindgen_export.get(_)()}catch{}}function a(_){throw _ instanceof WebAssembly.Exception&&_.is(J)?_.getArg(J,0):(G()[B]=1,it(),_)}function f(){if(B??=c.__instance_terminated.value/4,G()[B]){if(K||it(),C){U();return}throw new Error("Module terminated")}else C&&U()}function at(_,t){s(_),s(t),f();try{c.wasm_bindgen_c4ceaed92c40d81e___convert__closures_____invoke_______true_(_,t)}catch(e){a(e)}}function ft(_,t){s(_),s(t);let e;f();try{e=c.wasm_bindgen_c4ceaed92c40d81e___convert__closures_____invoke___bool__true_(_,t)}catch(n){a(n)}return e!==0}function bt(_,t,e){s(_),s(t),f();try{c.wasm_bindgen_c4ceaed92c40d81e___convert__closures_____invoke___wasm_bindgen_c4ceaed92c40d81e___JsValue______true_(_,t,e)}catch(n){a(n)}}function gt(_,t,e){s(_),s(t);let n;f();try{n=c.wasm_bindgen_c4ceaed92c40d81e___convert__closures_____invoke___wasm_bindgen_c4ceaed92c40d81e___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_c4ceaed92c40d81e___JsError___true_(_,t,e)}catch(o){a(o)}if(n[1])throw It(n[0])}function dt(_,t,e,n){s(_),s(t),f();try{c.wasm_bindgen_c4ceaed92c40d81e___convert__closures_____invoke___js_sys_39645a1f55c401c1___Function_fn_wasm_bindgen_c4ceaed92c40d81e___JsValue_____wasm_bindgen_c4ceaed92c40d81e___sys__Undefined___js_sys_39645a1f55c401c1___Function_fn_wasm_bindgen_c4ceaed92c40d81e___JsValue_____wasm_bindgen_c4ceaed92c40d81e___sys__Undefined_______true_(_,t,e,n)}catch(o){a(o)}}var wt=["bytes"],lt=["default","no-store","reload","no-cache","force-cache","only-if-cached"],mt=["follow","error","manual"],g=0,ht=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:_,instance:t})=>{t===g&&c.__wbg_containerstartupoptions_free(_,1)}),pt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:_,instance:t})=>{t===g&&c.__wbg_intounderlyingbytesource_free(_,1)}),yt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:_,instance:t})=>{t===g&&c.__wbg_intounderlyingsink_free(_,1)}),Z=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:_,instance:t})=>{t===g&&c.__wbg_intounderlyingsource_free(_,1)}),tt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:_,instance:t})=>{t===g&&c.__wbg_minifyconfig_free(_,1)}),vt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:_,instance:t})=>{t===g&&c.__wbg_r2range_free(_,1)});function v(_){let t=c.__externref_table_alloc();return c.__wbindgen_externrefs.set(t,_),t}function Et(_){if(typeof _!="bigint")throw new Error(`expected a bigint argument, found ${typeof _}`)}function l(_){if(typeof _!="boolean")throw new Error(`expected a boolean argument, found ${typeof _}`)}function s(_){if(typeof _!="number")throw new Error(`expected a number argument, found ${typeof _}`)}var et=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(_=>{_.instance===g&&c.__wbindgen_destroy_closure(_.a,_.b)});function $(_){let t=typeof _;if(t=="number"||t=="boolean"||_==null)return`${_}`;if(t=="string")return`"${_}"`;if(t=="symbol"){let o=_.description;return o==null?"Symbol":`Symbol(${o})`}if(t=="function"){let o=_.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(_)){let o=_.length,i="[";o>0&&(i+=$(_[0]));for(let d=1;d<o;d++)i+=", "+$(_[d]);return i+="]",i}let e=/\[object ([^\]]+)\]/.exec(toString.call(_)),n;if(e&&e.length>1)n=e[1];else return toString.call(_);if(n=="Object")try{return"Object("+JSON.stringify(_)+")"}catch{return"Object"}return _ instanceof Error?`${_.name}: ${_.message}
2
- ${_.stack}`:n}function st(_,t){_=_>>>0;let e=b(),n=[];for(let o=_;o<_+4*t;o+=4)n.push(c.__wbindgen_externrefs.get(e.getUint32(o,!0)));return c.__externref_drop_slice(_,t),n}function O(_,t){return _=_>>>0,W().subarray(_/1,_/1+t)}var I=null;function b(){return(I===null||I.buffer.detached===!0||I.buffer.detached===void 0&&I.buffer!==c.memory.buffer)&&(I=new DataView(c.memory.buffer)),I}var j=null;function G(){return(j===null||j.byteLength===0)&&(j=new Int32Array(c.memory.buffer)),j}function h(_,t){return xt(_>>>0,t)}var S=null;function W(){return(S===null||S.byteLength===0)&&(S=new Uint8Array(c.memory.buffer)),S}function u(_){return _==null}function r(_,t){try{return _.apply(this,t)}catch(e){let n=(function(){try{return e instanceof Error?`${e.message}
3
-
4
- Stack:
5
- ${e.stack}`:e.toString()}catch{return"<failed to stringify thrown value>"}})();throw console.error("wasm-bindgen: imported JS function that was not marked as `catch` threw an error:",n),e}}function D(_,t,e){let n={a:_,b:t,cnt:1,instance:g},o=(...i)=>{if(n.instance!==g)throw new Error("Cannot invoke closure from previous WASM instance");n.cnt++;let d=n.a;n.a=0;try{return e(d,n.b,...i)}finally{n.a=d,o._wbg_cb_unref()}};return o._wbg_cb_unref=()=>{--n.cnt===0&&(c.__wbindgen_destroy_closure(n.a,n.b),n.a=0,et.unregister(n))},et.register(o,n,n),o}function N(_,t){let e=t(_.length*4,4)>>>0;for(let n=0;n<_.length;n++){let o=v(_[n]);b().setUint32(e+4*n,o,!0)}return m=_.length,e}function p(_,t,e){if(typeof _!="string")throw new Error(`expected a string argument, found ${typeof _}`);if(e===void 0){let w=T.encode(_),y=t(w.length,1)>>>0;return W().subarray(y,y+w.length).set(w),m=w.length,y}let n=_.length,o=t(n,1)>>>0,i=W(),d=0;for(;d<n;d++){let w=_.charCodeAt(d);if(w>127)break;i[o+d]=w}if(d!==n){d!==0&&(_=_.slice(d)),o=e(o,n,n=d+_.length*3,1)>>>0;let w=W().subarray(o+d,o+n),y=T.encodeInto(_,w);if(y.read!==_.length)throw new Error("failed to pass whole string");d+=y.written,o=e(o,n,d,1)>>>0}return m=d,o}var C=!1;function It(_){let t=c.__wbindgen_externrefs.get(_);return c.__externref_table_dealloc(_),t}var ut=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});ut.decode();function xt(_,t){return ut.decode(W().subarray(_,_+t))}var T=new TextEncoder;"encodeInto"in T||(T.encodeInto=function(_,t){let e=T.encode(_);return t.set(e),{read:_.length,written:e.length}});var m=0,H=new WebAssembly.Instance(nt,ct()),c=H.exports;c.__wbindgen_start();Error.stackTraceLimit=100;var E=rt();function Q(){E.criticalError&&(console.log("Reinitializing Wasm application"),U(),E.criticalError=!1,E.instanceId++)}addEventListener("error",_=>{X(_.error)});function X(_){_ instanceof WebAssembly.RuntimeError&&(console.error("Critical",_),E.criticalError=!0)}var k=class extends Rt{};k.prototype.fetch=function(t){return _t.call(this,t,this.env,this.ctx)};k.prototype.scheduled=function(t){return ot.call(this,t,this.env,this.ctx)};k.prototype.__wasm=c;var kt={set:(_,t,e,n)=>Reflect.set(_.instance,t,e,n),has:(_,t)=>Reflect.has(_.instance,t),deleteProperty:(_,t)=>Reflect.deleteProperty(_.instance,t),apply:(_,t,e)=>Reflect.apply(_.instance,t,e),construct:(_,t,e)=>Reflect.construct(_.instance,t,e),getPrototypeOf:_=>Reflect.getPrototypeOf(_.instance),setPrototypeOf:(_,t)=>Reflect.setPrototypeOf(_.instance,t),isExtensible:_=>Reflect.isExtensible(_.instance),preventExtensions:_=>Reflect.preventExtensions(_.instance),getOwnPropertyDescriptor:(_,t)=>Reflect.getOwnPropertyDescriptor(_.instance,t),defineProperty:(_,t,e)=>Reflect.defineProperty(_.instance,t,e),ownKeys:_=>Reflect.ownKeys(_.instance)},L={construct(_,t,e){try{Q();let n={instance:Reflect.construct(_,t,e),instanceId:E.instanceId,ctor:_,args:t,newTarget:e};return new Proxy(n,{...kt,get(o,i,d){o.instanceId!==E.instanceId&&(o.instance=Reflect.construct(o.ctor,o.args,o.newTarget),o.instanceId=E.instanceId);let w=Reflect.get(o.instance,i,d);return typeof w!="function"?w:w.constructor===Function?new Proxy(w,{apply(y,V,q){Q();try{return y.apply(V,q)}catch(F){throw X(F),F}}}):new Proxy(w,{async apply(y,V,q){Q();try{return await y.apply(V,q)}catch(F){throw X(F),F}}})}})}catch(n){throw E.criticalError=!0,n}}},Tt=new Proxy(k,L),Mt=new Proxy(A,L),Ot=new Proxy(x,L),zt=new Proxy(R,L);export{Mt as ContainerStartupOptions,Ot as MinifyConfig,zt as R2Range,Tt as default};
1
+ import{WorkerEntrypoint as ve}from"cloudflare:workers";var K=globalThis.__worker_init_state={criticalError:!1,instanceId:0};import Z from"./index_bg.wasm";var I=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,we.unregister(this),e}free(){let e=this.__destroy_into_raw();s();try{c.__wbg_containerstartupoptions_free(e,0)}catch(t){i(t)}}get enableInternet(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let e;s();try{e=c.__wbg_get_containerstartupoptions_enableInternet(this.__wbg_ptr)}catch(t){i(t)}return e===16777215?void 0:e!==0}get entrypoint(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let e;s();try{e=c.__wbg_get_containerstartupoptions_entrypoint(this.__wbg_ptr)}catch(n){i(n)}var t=ce(e[0],e[1]);return c.__wbindgen_free(e[0],e[1]*4,4),t}get env(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let e;s();try{e=c.__wbg_get_containerstartupoptions_env(this.__wbg_ptr)}catch(t){i(t)}return e}set enableInternet(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");s();try{c.__wbg_set_containerstartupoptions_enableInternet(this.__wbg_ptr,b(e)?16777215:e?1:0)}catch(t){i(t)}}set entrypoint(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let t=J(e,c.__wbindgen_malloc),n=w;s();try{c.__wbg_set_containerstartupoptions_entrypoint(this.__wbg_ptr,t,n)}catch(r){i(r)}}set env(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");s();try{c.__wbg_set_containerstartupoptions_env(this.__wbg_ptr,e)}catch(t){i(t)}}};Symbol.dispose&&(I.prototype[Symbol.dispose]=I.prototype.free);var T=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,ge.unregister(this),e}free(){let e=this.__destroy_into_raw();s();try{c.__wbg_intounderlyingbytesource_free(e,0)}catch(t){i(t)}}get autoAllocateChunkSize(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let e;s();try{e=c.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr)}catch(t){i(t)}return e>>>0}cancel(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let e=this.__destroy_into_raw();s();try{c.intounderlyingbytesource_cancel(e)}catch(t){i(t)}}pull(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let t;s();try{t=c.intounderlyingbytesource_pull(this.__wbg_ptr,e)}catch(n){i(n)}return t}start(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");s();try{c.intounderlyingbytesource_start(this.__wbg_ptr,e)}catch(t){i(t)}}get type(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let e;s();try{e=c.intounderlyingbytesource_type(this.__wbg_ptr)}catch(t){i(t)}return ue[e]}};Symbol.dispose&&(T.prototype[Symbol.dispose]=T.prototype.free);var M=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,le.unregister(this),e}free(){let e=this.__destroy_into_raw();s();try{c.__wbg_intounderlyingsink_free(e,0)}catch(t){i(t)}}abort(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let t=this.__destroy_into_raw(),n;s();try{n=c.intounderlyingsink_abort(t,e)}catch(r){i(r)}return n}close(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let e=this.__destroy_into_raw(),t;s();try{t=c.intounderlyingsink_close(e)}catch(n){i(n)}return t}write(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let t;s();try{t=c.intounderlyingsink_write(this.__wbg_ptr,e)}catch(n){i(n)}return t}};Symbol.dispose&&(M.prototype[Symbol.dispose]=M.prototype.free);var S=class _{static __wrap(e){let t=Object.create(_.prototype);return t.__wbg_ptr=e,Object.defineProperty(t,"__wbg_inst",{value:f,writable:!0}),Q.register(t,{ptr:e,instance:f},t),t}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,Q.unregister(this),e}free(){let e=this.__destroy_into_raw();s();try{c.__wbg_intounderlyingsource_free(e,0)}catch(t){i(t)}}cancel(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let e=this.__destroy_into_raw();s();try{c.intounderlyingsource_cancel(e)}catch(t){i(t)}}pull(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let t;s();try{t=c.intounderlyingsource_pull(this.__wbg_ptr,e)}catch(n){i(n)}return t}};Symbol.dispose&&(S.prototype[Symbol.dispose]=S.prototype.free);var v=class _{static __wrap(e){let t=Object.create(_.prototype);return t.__wbg_ptr=e,Object.defineProperty(t,"__wbg_inst",{value:f,writable:!0}),X.register(t,{ptr:e,instance:f},t),t}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,X.unregister(this),e}free(){let e=this.__destroy_into_raw();s();try{c.__wbg_minifyconfig_free(e,0)}catch(t){i(t)}}get css(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let e;s();try{e=c.__wbg_get_minifyconfig_css(this.__wbg_ptr)}catch(t){i(t)}return e!==0}get html(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let e;s();try{e=c.__wbg_get_minifyconfig_html(this.__wbg_ptr)}catch(t){i(t)}return e!==0}get js(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let e;s();try{e=c.__wbg_get_minifyconfig_js(this.__wbg_ptr)}catch(t){i(t)}return e!==0}set css(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");s();try{c.__wbg_set_minifyconfig_css(this.__wbg_ptr,e)}catch(t){i(t)}}set html(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");s();try{c.__wbg_set_minifyconfig_html(this.__wbg_ptr,e)}catch(t){i(t)}}set js(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");s();try{c.__wbg_set_minifyconfig_js(this.__wbg_ptr,e)}catch(t){i(t)}}};Symbol.dispose&&(v.prototype[Symbol.dispose]=v.prototype.free);var x=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,he.unregister(this),e}free(){let e=this.__destroy_into_raw();s();try{c.__wbg_r2range_free(e,0)}catch(t){i(t)}}get length(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let e;s();try{e=c.__wbg_get_r2range_length(this.__wbg_ptr)}catch(t){i(t)}return e[0]===0?void 0:e[1]}get offset(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let e;s();try{e=c.__wbg_get_r2range_offset(this.__wbg_ptr)}catch(t){i(t)}return e[0]===0?void 0:e[1]}get suffix(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");let e;s();try{e=c.__wbg_get_r2range_suffix(this.__wbg_ptr)}catch(t){i(t)}return e[0]===0?void 0:e[1]}set length(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");s();try{c.__wbg_set_r2range_length(this.__wbg_ptr,!b(e),b(e)?0:e)}catch(t){i(t)}}set offset(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");s();try{c.__wbg_set_r2range_offset(this.__wbg_ptr,!b(e),b(e)?0:e)}catch(t){i(t)}}set suffix(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==f)throw new Error("Invalid stale object from previous Wasm instance");s();try{c.__wbg_set_r2range_suffix(this.__wbg_ptr,!b(e),b(e)?0:e)}catch(t){i(t)}}};Symbol.dispose&&(x.prototype[Symbol.dispose]=x.prototype.free);function O(){f++,m=null,R=null,F=null,typeof numBytesDecoded<"u"&&(numBytesDecoded=0),typeof w<"u"&&(w=0),N=!1,z=!1,B=new WebAssembly.Instance(Z,_e()),c=B.exports,c.__wbindgen_start()}function ee(){let _;s();try{_=c.__worker_init_state()}catch(e){i(e)}return _}function te(_,e,t){let n;s();try{n=c.fetch(_,e,t)}catch(r){i(r)}return n}function ne(_,e,t){let n;s();try{n=c.scheduled(_,e,t)}catch(r){i(r)}return n}function _e(){return{__proto__:null,"./index_bg.js":{__proto__:null,__wbg_Error_30c8987f7c2ed4e2:function(e,t){return Error(g(e,t))},__wbg_Number_14af1003b8dd5ead:function(e){return Number(e)},__wbg_String_8564e559799eccda:function(e,t){let n=String(t),r=l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg___wbindgen_bigint_get_as_i64_a2383202b9353e4c:function(e,t){let n=t,r=typeof n=="bigint"?n:void 0;a().setBigInt64(e+8,b(r)?BigInt(0):r,!0),a().setInt32(e+0,!b(r),!0)},__wbg___wbindgen_boolean_get_5b446f51afd21013:function(e){let t=e,n=typeof t=="boolean"?t:void 0;return b(n)?16777215:n?1:0},__wbg___wbindgen_debug_string_4687d8d8c2017d52:function(e,t){let n=D(t),r=l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg___wbindgen_in_92f62ee1427d9e49:function(e,t){return e in t},__wbg___wbindgen_is_bigint_b123553bed3bb382:function(e){return typeof e=="bigint"},__wbg___wbindgen_is_function_1f9d30630b8b1d3d:function(e){return typeof e=="function"},__wbg___wbindgen_is_null_e343b7d08827ba72:function(e){return e===null},__wbg___wbindgen_is_null_or_undefined_f9435d56bdcc06df:function(e){return e==null},__wbg___wbindgen_is_object_3c45d4f2dde4e749:function(e){let t=e;return typeof t=="object"&&t!==null},__wbg___wbindgen_is_string_90b56bc79aad6f6c:function(e){return typeof e=="string"},__wbg___wbindgen_is_undefined_8865fb403f8fe9d8:function(e){return e===void 0},__wbg___wbindgen_jsval_eq_02babf21faa37971:function(e,t){return e===t},__wbg___wbindgen_jsval_loose_eq_677f21e468d6b461:function(e,t){return e==t},__wbg___wbindgen_number_get_2e0e7dee9f701a71:function(e,t){let n=t,r=typeof n=="number"?n:void 0;a().setFloat64(e+8,b(r)?0:r,!0),a().setInt32(e+0,!b(r),!0)},__wbg___wbindgen_reinit_3f79fdb34dee3ea9:function(){z=!0},__wbg___wbindgen_string_get_0380ccaa2f57f0d9:function(e,t){let n=t,r=typeof n=="string"?n:void 0;var o=b(r)?0:l(r,c.__wbindgen_malloc,c.__wbindgen_realloc),u=w;a().setInt32(e+4,u,!0),a().setInt32(e+0,o,!0)},__wbg___wbindgen_throw_41e9ee4f547fc59a:function(e,t){throw new WebAssembly.Exception(V,[new Error(g(e,t))])},__wbg__wbg_cb_unref_dcc1a90847f04c41:function(e){e._wbg_cb_unref()},__wbg_all_2228d6712e7ddb97:function(e){return e.all()},__wbg_arrayBuffer_7b8b2e9be0285525:function(e){return e.arrayBuffer()},__wbg_batch_6b58fc32d9c19d60:function(e,t){return e.batch(t)},__wbg_bind_1f842289d2018ed8:function(e,t){return e.bind(...t)},__wbg_bodyUsed_3527d29edfc2c752:function(e){return e.bodyUsed},__wbg_body_4792166cb351f162:function(e){let t=e.body;return b(t)?0:y(t)},__wbg_body_4e088733babc630d:function(e){let t=e.body;return b(t)?0:y(t)},__wbg_body_a3a2b558805a2b84:function(e){return e.body},__wbg_buffer_56ec2905a66f58b9:function(e){return e.buffer},__wbg_byobRequest_54f7ce41d584549a:function(e){let t=e.byobRequest;return b(t)?0:y(t)},__wbg_byteLength_9f985b8373f1f3fe:function(e){return e.byteLength},__wbg_byteOffset_0bd5a6a03553639c:function(e){return e.byteOffset},__wbg_cacheControl_6ea9be880720803d:function(e,t){let n=t.cacheControl;var r=b(n)?0:l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg_cacheExpiry_ee9de6a8c623e1a8:function(e){let t=e.cacheExpiry;return b(t)?0:y(t)},__wbg_caches_0c4f8c535a6a0595:function(e){return e.caches},__wbg_call_1875a20c43a36133:function(e,t,n,r){return e.call(t,n,r)},__wbg_call_187d372bd5fdd4aa:function(e,t,n){return e.call(t,n)},__wbg_call_939a2607c4484b0b:function(e,t,n,r,o){return e.call(t,n,r,o)},__wbg_cancel_7c2a08c8db4c73f3:function(e){return e.cancel()},__wbg_catch_92594c2d17f55f12:function(e,t){return e.catch(t)},__wbg_cause_19276d032a32d4bd:function(e){return e.cause},__wbg_cf_909bcfb212a8822c:function(e){let t=e.cf;return b(t)?0:y(t)},__wbg_cf_b47fe5ff6d015a0d:function(e){let t=e.cf;return b(t)?0:y(t)},__wbg_clearTimeout_d49a4afcd9b218b7:function(e,t){e.clearTimeout(t)},__wbg_clone_0bde657d3f85c2d1:function(e){return e.clone()},__wbg_clone_946565396b302dfb:function(e){return e.clone()},__wbg_close_185286988f30f252:function(e){e.close()},__wbg_close_748f26698dabe269:function(e){e.close()},__wbg_constructor_076176ce0f386e16:function(e){return e.constructor},__wbg_contentDisposition_07447c7ffe1f25b9:function(e,t){let n=t.contentDisposition;var r=b(n)?0:l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg_contentEncoding_0a83e35746c3ada7:function(e,t){let n=t.contentEncoding;var r=b(n)?0:l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg_contentLanguage_ac8796c815bdf6a7:function(e,t){let n=t.contentLanguage;var r=b(n)?0:l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg_contentType_e59097c6037d86e1:function(e,t){let n=t.contentType;var r=b(n)?0:l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg_country_e8b34ad6526ea4f9:function(e,t){let n=t.country;var r=b(n)?0:l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg_cron_76b7eba30bc0443e:function(e,t){let n=t.cron,r=l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg_crypto_38df2bab126b63dc:function(e){return e.crypto},__wbg_cursor_1c9a92814964774c:function(e,t){let n=t.cursor;var r=b(n)?0:l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg_customMetadata_9734802d06bda433:function(e){return e.customMetadata},__wbg_default_15d5007f8b46e0bc:function(e){return e.default},__wbg_delete_4a8ee012c43b86c0:function(e,t,n){let r,o;try{return r=t,o=n,e.delete(g(t,n))}finally{s();try{c.__wbindgen_free(r,o,1)}catch(u){i(u)}}},__wbg_delete_4f3412b083521508:function(e,t,n){var r=ce(t,n);return c.__wbindgen_free(t,n*4,4),e.delete(r)},__wbg_done_b41a1d26cdb37fb6:function(e){return e.done},__wbg_enqueue_4a01c128f9a0de16:function(e,t){e.enqueue(t)},__wbg_entries_b55ec7e0dc443355:function(e){return e.entries()},__wbg_error_757e9472f8410341:function(e,t){let n,r;try{n=e,r=t,console.error(g(e,t))}finally{s();try{c.__wbindgen_free(n,r,1)}catch(o){i(o)}}},__wbg_error_a30e98d44009f1bb:function(e,t){console.error(e,t)},__wbg_error_c9cf3fc2064683a9:function(e){console.error(e)},__wbg_fetch_0e46da8cf7c730e4:function(e,t,n,r){return e.fetch(g(t,n),r)},__wbg_fetch_7b5de4f88137a4dc:function(e,t,n){return e.fetch(t,n)},__wbg_first_3f7220e4ae4ce878:function(e,t,n){return e.first(t===0?void 0:g(t,n))},__wbg_getRandomValues_c44a50d8cfdaebeb:function(e,t){e.getRandomValues(t)},__wbg_getReader_bf34f92ee19c42b4:function(e){return e.getReader()},__wbg_getTime_f5a55efff2585d5d:function(e){return e.getTime()},__wbg_get_31af05bd4842a84f:function(e,t){return Reflect.get(e,t)},__wbg_get_6c896e0571ddae51:function(e,t){return e[t>>>0]},__wbg_get_834ef2d65b3b5c73:function(e,t,n,r){let o,u;try{return o=t,u=n,e.get(g(t,n),r)}finally{s();try{c.__wbindgen_free(o,u,1)}catch(d){i(d)}}},__wbg_get_88983e33467eae60:function(e,t){let n=Reflect.get(e,t);return b(n)?0:y(n)},__wbg_get_done_7020b91c987365c7:function(e){let t=e.done;return b(t)?16777215:t?1:0},__wbg_get_f75619e20cb68514:function(e,t,n,r){let o=t.get(g(n,r));var u=b(o)?0:l(o,c.__wbindgen_malloc,c.__wbindgen_realloc),d=w;a().setInt32(e+4,d,!0),a().setInt32(e+0,u,!0)},__wbg_get_unchecked_288889d017702237:function(e,t){return e[t>>>0]},__wbg_get_value_87fbd6ad1283f2e7:function(e){return e.value},__wbg_get_with_ref_key_6412cf3094599694:function(e,t){return e[t]},__wbg_headers_6930a8bd09b630de:function(e){return e.headers},__wbg_headers_eba93595f8944c2f:function(e){return e.headers},__wbg_httpMetadata_529f7924a4f73fdd:function(e){return e.httpMetadata},__wbg_instanceId_9b67ff33ae8bef8a:function(e){return e.instanceId},__wbg_instanceof_ArrayBuffer_a99f175873e5d9b8:function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},__wbg_instanceof_Error_80a725f81f2e102d:function(e){let t;try{t=e instanceof Error}catch{t=!1}return t},__wbg_instanceof_ReadableStream_e2d77912575119ab:function(e){let t;try{t=e instanceof ReadableStream}catch{t=!1}return t},__wbg_instanceof_Response_b8758567269c30b2:function(e){let t;try{t=e instanceof Response}catch{t=!1}return t},__wbg_instanceof_Uint8Array_828cef2aaacafc31:function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},__wbg_isArray_e15a2ff68ffdbef2:function(e){return Array.isArray(e)},__wbg_isSafeInteger_717808ad6a54bd9e:function(e){return Number.isSafeInteger(e)},__wbg_key_84de5b594a30a514:function(e,t){let n=t.key,r=l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg_keys_440be172f17c0265:function(e){return Object.keys(e)},__wbg_keys_bac434c8972731d5:function(e){return e.keys()},__wbg_length_7f3c00c40364105e:function(e){return e.length},__wbg_length_d4bdea10311bd9cf:function(e){return e.length},__wbg_list_9f5101697159e282:function(e,t){return e.list(t)},__wbg_log_17c30ef363c61cf4:function(e){console.log(e)},__wbg_match_4ddd34bd7a34ad07:function(e,t,n,r){return e.match(g(t,n),r)},__wbg_match_c2e851fa5be0ea84:function(e,t,n){return e.match(t,n)},__wbg_message_5f8387f0c32b90a7:function(e){return e.message},__wbg_meta_594bb85654c055e4:function(e){return e.meta},__wbg_method_6d02ee0808a7de31:function(e,t){let n=t.method,r=l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg_minifyconfig_new:function(e){return v.__wrap(e)},__wbg_msCrypto_bd5a034af96bcba6:function(e){return e.msCrypto},__wbg_name_e2eac7cdfa054f65:function(e){return e.name},__wbg_name_f9b814d78e8e299f:function(e){return e.name},__wbg_new_0_72d020f0c63443d4:function(){return new Date},__wbg_new_1dbf7428bba60a42:function(e){return new Uint8Array(e)},__wbg_new_227d7c05414eb861:function(){return new Error},__wbg_new_28744009d011f847:function(){return new Map},__wbg_new_343a093a3c2ffb4e:function(e,t){return new Error(g(e,t))},__wbg_new_617a8cdb8bb1130e:function(){return new Object},__wbg_new_83ca405eae412a62:function(){return new Headers},__wbg_new_big_int_84cdc69174f81f5b:function(e){return new FixedLengthStream(e)},__wbg_new_ee2291f50781bf1d:function(){return new Array},__wbg_new_f569a2e335eed0bb:function(e){return new FixedLengthStream(e>>>0)},__wbg_new_from_slice_9a868026ffa4208a:function(e,t){return new Uint8Array(A(e,t))},__wbg_new_typed_b01cb72a8af741a3:function(e,t){try{var n={a:e,b:t},r=(u,d)=>{let h=n.a;n.a=0;try{return fe(h,n.b,u,d)}finally{n.a=h}};return new Promise(r)}finally{n.a=0}},__wbg_new_with_byte_offset_and_length_2f5d7fc2a828b74d:function(e,t,n){return new Uint8Array(e,t>>>0,n>>>0)},__wbg_new_with_headers_7eaf3e64bd3f0a23:function(e){return new Headers(e)},__wbg_new_with_into_underlying_source_a57cfcc7c705351c:function(e,t){return new ReadableStream(S.__wrap(e),t)},__wbg_new_with_length_3da0ad195f6f63ba:function(e){return new Uint8Array(e>>>0)},__wbg_new_with_opt_buffer_source_and_init_c1b859a23c80afca:function(e,t){return new Response(e,t)},__wbg_new_with_opt_readable_stream_and_init_df114f2d364f216d:function(e,t){return new Response(e,t)},__wbg_new_with_opt_str_and_init_33bef1b272950372:function(e,t,n){return new Response(e===0?void 0:g(e,t),n)},__wbg_new_with_str_and_init_4618dee4e950224f:function(e,t,n){return new Request(g(e,t),n)},__wbg_next_f4aac29c42af995c:function(e){return e.next()},__wbg_node_84ea875411254db1:function(e){return e.node},__wbg_now_aa4ccb83129e9e55:function(){return Date.now()},__wbg_objects_5b390b93a9ffcef3:function(e,t){let n=t.objects,r=J(n,c.__wbindgen_malloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg_pipeTo_ac05d32161ffb42c:function(e,t){return e.pipeTo(t)},__wbg_prepare_6fe68a8990920f81:function(e,t,n){return e.prepare(g(t,n))},__wbg_process_44c7a14e11e9f69e:function(e){return e.process},__wbg_prototypesetcall_bc27214492979395:function(e,t,n){Uint8Array.prototype.set.call(A(e,t),n)},__wbg_push_2baf45db356cf468:function(e,t){return e.push(t)},__wbg_put_867461fd552109b2:function(e,t,n){return e.put(t,n)},__wbg_put_bbca42771defa466:function(e,t,n,r){return e.put(g(t,n),r)},__wbg_put_ece41e2507acd81b:function(e,t,n,r,o){let u,d;try{return u=t,d=n,e.put(g(t,n),r,o)}finally{s();try{c.__wbindgen_free(u,d,1)}catch(h){i(h)}}},__wbg_queueMicrotask_9833f9a49df95a49:function(e){return e.queueMicrotask},__wbg_queueMicrotask_a72f977e97f23c5f:function(e){queueMicrotask(e)},__wbg_randomFillSync_6c25eac9869eb53c:function(e,t){e.randomFillSync(t)},__wbg_read_2a943774344c9728:function(e){return e.read()},__wbg_readable_4d43535945ae9ca0:function(e){return e.readable},__wbg_region_539ec060a01aca98:function(e,t){let n=t.region;var r=b(n)?0:l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg_releaseLock_eb64cd83aa9fcfe4:function(e){e.releaseLock()},__wbg_require_b4edbdcf3e2a1ef0:function(){return module.require},__wbg_resolve_0076e10020304ede:function(e){return Promise.resolve(e)},__wbg_respond_c102fabcc79e5ef0:function(e,t){e.respond(t>>>0)},__wbg_results_a5533c886ed43a9a:function(e){let t=e.results;return b(t)?0:y(t)},__wbg_run_0ef9f3480a049b01:function(e){return e.run()},__wbg_scheduledTime_d6f16c8277d5313d:function(e){return e.scheduledTime},__wbg_setTimeout_7fb1e1fe294b6ad9:function(e,t,n){return e.setTimeout(t,n)},__wbg_set_145a351398b48c65:function(e,t,n){return Reflect.set(e,t,n)},__wbg_set_575d3ddb70fe831d:function(e,t,n){e.set(A(t,n))},__wbg_set_6ae97e73113c4f0b:function(e,t,n){return e.set(t,n)},__wbg_set_6be42768c690e380:function(e,t,n){e[t]=n},__wbg_set_af5932e3f78b5648:function(e,t,n,r,o){e.set(g(t,n),g(r,o))},__wbg_set_bea140a88be9b277:function(e,t,n){e[t>>>0]=n},__wbg_set_body_1fb0f1008bfc7df6:function(e,t){e.body=t},__wbg_set_cache_7507c4cc5938ccc7:function(e,t){e.cache=be[t]},__wbg_set_criticalError_3904d60fe2a0b05b:function(e,t){e.criticalError=t!==0},__wbg_set_headers_40ad33dcf016613f:function(e,t){e.headers=t},__wbg_set_headers_69ef7c46a2e6c742:function(e,t){e.headers=t},__wbg_set_high_water_mark_3a96edf83df7e06c:function(e,t){e.highWaterMark=t},__wbg_set_ignore_method_5b0a1aa453c4d6d2:function(e,t){e.ignoreMethod=t!==0},__wbg_set_instanceId_9ad5caac0a4e519c:function(e,t){e.instanceId=t>>>0},__wbg_set_method_dcb32343247ec427:function(e,t,n){e.method=g(t,n)},__wbg_set_redirect_cc128ab2411da334:function(e,t){e.redirect=de[t]},__wbg_set_signal_2dbd377604627f26:function(e,t){e.signal=t},__wbg_set_status_678f122cbe435d95:function(e,t){e.status=t},__wbg_size_023ff299b19aa360:function(e){return e.size},__wbg_slice_6da4cdc5d543fcd0:function(e,t){let n=t.slice(),r=J(n,c.__wbindgen_malloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg_static_accessor_GLOBAL_266715b9d96ba635:function(){let e=typeof global>"u"?null:global;return b(e)?0:y(e)},__wbg_static_accessor_GLOBAL_THIS_10fb7dc1ae063179:function(){let e=typeof globalThis>"u"?null:globalThis;return b(e)?0:y(e)},__wbg_static_accessor_INIT_STATE_e3fce2ad8a08e94e:function(){return K},__wbg_static_accessor_SELF_0b583911f537483a:function(){let e=typeof self>"u"?null:self;return b(e)?0:y(e)},__wbg_static_accessor_WINDOW_d7f903d1508cbdc4:function(){let e=typeof window>"u"?null:window;return b(e)?0:y(e)},__wbg_status_ce0a98d3c57125f3:function(e){return e.status},__wbg_subarray_002b94d5e13d1411:function(e,t,n){return e.subarray(t>>>0,n>>>0)},__wbg_then_c949d5a25a4e78f8:function(e,t,n){return e.then(t,n)},__wbg_then_e71170d78fcf8954:function(e,t){return e.then(t)},__wbg_truncated_cc05a4223c013ee9:function(e){return e.truncated},__wbg_uploaded_19ec3882ff291aab:function(e){return e.uploaded},__wbg_url_7bfada5c2297bc70:function(e,t){let n=t.url,r=l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),o=w;a().setInt32(e+4,o,!0),a().setInt32(e+0,r,!0)},__wbg_value_f3c585ee8f5ba40c:function(e){return e.value},__wbg_versions_276b2795b1c6a219:function(e){return e.versions},__wbg_view_9c570f33e8d6ab96:function(e){let t=e.view;return b(t)?0:y(t)},__wbg_waitUntil_c51e37673c596e00:function(e,t){e.waitUntil(t)},__wbg_webSocket_2b7e8e9549bed673:function(e){let t=e.webSocket;return b(t)?0:y(t)},__wbg_writable_44735d15a1cee85d:function(e){return e.writable},__wbindgen_generic_0000000000000001:function(e,t){return C(e,t,ae)},__wbindgen_generic_0000000000000002:function(e,t){return C(e,t,se)},__wbindgen_generic_0000000000000003:function(e,t){return C(e,t,ie)},__wbindgen_generic_0000000000000004:function(e){return e},__wbindgen_generic_0000000000000005:function(e){return e},__wbindgen_generic_0000000000000006:function(e,t){return A(e,t)},__wbindgen_generic_0000000000000007:function(e,t){return g(e,t)},__wbindgen_generic_0000000000000008:function(e){return BigInt.asUintN(64,e)},__wbindgen_init_externref_table:function(){let e=c.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)},__wbindgen_jstag:WebAssembly.JSTag,__wbindgen_rethrow_critical:function(e){throw new Error("Critical error",{cause:e})}}}}var V=new WebAssembly.Tag({parameters:["externref"]}),q,N=!1;function re(){N=!0;try{let _=$()[c.__abort_handler.value/4];_&&c.__wbindgen_export.get(_)()}catch{}}function i(_){throw _ instanceof WebAssembly.Exception&&_.is(V)?_.getArg(V,0):($()[q]=1,re(),_)}function s(){if(q??=c.__instance_terminated.value/4,$()[q]){if(N||re(),z){O();return}throw new Error("Module terminated")}else z&&O()}function ie(_,e){s();try{c.wasm_bindgen_5360ddf1c2d9e5d6___convert__closures_____invoke_______true_(_,e)}catch(t){i(t)}}function se(_,e,t){s();try{c.wasm_bindgen_5360ddf1c2d9e5d6___convert__closures_____invoke___wasm_bindgen_5360ddf1c2d9e5d6___JsValue______true_(_,e,t)}catch(n){i(n)}}function ae(_,e,t){let n;s();try{n=c.wasm_bindgen_5360ddf1c2d9e5d6___convert__closures_____invoke___wasm_bindgen_5360ddf1c2d9e5d6___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_5360ddf1c2d9e5d6___JsError___true_(_,e,t)}catch(r){i(r)}if(n[1])throw ye(n[0])}function fe(_,e,t,n){s();try{c.wasm_bindgen_5360ddf1c2d9e5d6___convert__closures_____invoke___js_sys_6232fe8521f260d4___Function_fn_wasm_bindgen_5360ddf1c2d9e5d6___JsValue_____wasm_bindgen_5360ddf1c2d9e5d6___sys__Undefined___js_sys_6232fe8521f260d4___Function_fn_wasm_bindgen_5360ddf1c2d9e5d6___JsValue_____wasm_bindgen_5360ddf1c2d9e5d6___sys__Undefined_______true_(_,e,t,n)}catch(r){i(r)}}var ue=["bytes"],be=["default","no-store","reload","no-cache","force-cache","only-if-cached"],de=["follow","error","manual"],f=0,we=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:_,instance:e})=>{e===f&&c.__wbg_containerstartupoptions_free(_,1)}),ge=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:_,instance:e})=>{e===f&&c.__wbg_intounderlyingbytesource_free(_,1)}),le=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:_,instance:e})=>{e===f&&c.__wbg_intounderlyingsink_free(_,1)}),Q=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:_,instance:e})=>{e===f&&c.__wbg_intounderlyingsource_free(_,1)}),X=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:_,instance:e})=>{e===f&&c.__wbg_minifyconfig_free(_,1)}),he=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:_,instance:e})=>{e===f&&c.__wbg_r2range_free(_,1)});function y(_){let e=c.__externref_table_alloc();return c.__wbindgen_externrefs.set(e,_),e}var Y=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(_=>{_.instance===f&&c.__wbindgen_destroy_closure(_.a,_.b)});function D(_){let e=typeof _;if(e=="number"||e=="boolean"||_==null)return`${_}`;if(e=="string")return`"${_}"`;if(e=="symbol"){let r=_.description;return r==null?"Symbol":`Symbol(${r})`}if(e=="function"){let r=_.name;return typeof r=="string"&&r.length>0?`Function(${r})`:"Function"}if(Array.isArray(_)){let r=_.length,o="[";r>0&&(o+=D(_[0]));for(let u=1;u<r;u++)o+=", "+D(_[u]);return o+="]",o}let t=/\[object ([^\]]+)\]/.exec(toString.call(_)),n;if(t&&t.length>1)n=t[1];else return toString.call(_);if(n=="Object")try{return"Object("+JSON.stringify(_)+")"}catch{return"Object"}return _ instanceof Error?`${_.name}: ${_.message}
2
+ ${_.stack}`:n}function ce(_,e){_=_>>>0;let t=a(),n=[];for(let r=_;r<_+4*e;r+=4)n.push(c.__wbindgen_externrefs.get(t.getUint32(r,!0)));return c.__externref_drop_slice(_,e),n}function A(_,e){return _=_>>>0,j().subarray(_/1,_/1+e)}var m=null;function a(){return(m===null||m.buffer.detached===!0||m.buffer.detached===void 0&&m.buffer!==c.memory.buffer)&&(m=new DataView(c.memory.buffer)),m}var R=null;function $(){return(R===null||R.byteLength===0)&&(R=new Int32Array(c.memory.buffer)),R}function g(_,e){return pe(_>>>0,e)}var F=null;function j(){return(F===null||F.byteLength===0)&&(F=new Uint8Array(c.memory.buffer)),F}function b(_){return _==null}function C(_,e,t){let n={a:_,b:e,cnt:1,instance:f},r=(...o)=>{if(n.instance!==f)throw new Error("Cannot invoke closure from previous WASM instance");n.cnt++;let u=n.a;n.a=0;try{return t(u,n.b,...o)}finally{n.a=u,r._wbg_cb_unref()}};return r._wbg_cb_unref=()=>{--n.cnt===0&&(c.__wbindgen_destroy_closure(n.a,n.b),n.a=0,Y.unregister(n))},Y.register(r,n,n),r}function J(_,e){let t=e(_.length*4,4)>>>0;for(let n=0;n<_.length;n++){let r=y(_[n]);a().setUint32(t+4*n,r,!0)}return w=_.length,t}function l(_,e,t){if(t===void 0){let d=k.encode(_),h=e(d.length,1)>>>0;return j().subarray(h,h+d.length).set(d),w=d.length,h}let n=_.length,r=e(n,1)>>>0,o=j(),u=0;for(;u<n;u++){let d=_.charCodeAt(u);if(d>127)break;o[r+u]=d}if(u!==n){u!==0&&(_=_.slice(u)),r=t(r,n,n=u+_.length*3,1)>>>0;let d=j().subarray(r+u,r+n),h=k.encodeInto(_,d);u+=h.written,r=t(r,n,u,1)>>>0}return w=u,r}var z=!1;function ye(_){let e=c.__wbindgen_externrefs.get(_);return c.__externref_table_dealloc(_),e}var oe=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});oe.decode();function pe(_,e){return oe.decode(j().subarray(_,_+e))}var k=new TextEncoder;"encodeInto"in k||(k.encodeInto=function(_,e){let t=k.encode(_);return e.set(t),{read:_.length,written:t.length}});var w=0,B=new WebAssembly.Instance(Z,_e()),c=B.exports;c.__wbindgen_start();Error.stackTraceLimit=100;var p=ee();function H(){p.criticalError&&(console.log("Reinitializing Wasm application"),O(),p.criticalError=!1,p.instanceId++)}addEventListener("error",_=>{G(_.error)});function G(_){_ instanceof WebAssembly.RuntimeError&&(console.error("Critical",_),p.criticalError=!0)}var W=class extends ve{};W.prototype.fetch=function(e){return te.call(this,e,this.env,this.ctx)};W.prototype.scheduled=function(e){return ne.call(this,e,this.env,this.ctx)};var Ie={set:(_,e,t,n)=>Reflect.set(_.instance,e,t,n),has:(_,e)=>Reflect.has(_.instance,e),deleteProperty:(_,e)=>Reflect.deleteProperty(_.instance,e),apply:(_,e,t)=>Reflect.apply(_.instance,e,t),construct:(_,e,t)=>Reflect.construct(_.instance,e,t),getPrototypeOf:_=>Reflect.getPrototypeOf(_.instance),setPrototypeOf:(_,e)=>Reflect.setPrototypeOf(_.instance,e),isExtensible:_=>Reflect.isExtensible(_.instance),preventExtensions:_=>Reflect.preventExtensions(_.instance),getOwnPropertyDescriptor:(_,e)=>Reflect.getOwnPropertyDescriptor(_.instance,e),defineProperty:(_,e,t)=>Reflect.defineProperty(_.instance,e,t),ownKeys:_=>Reflect.ownKeys(_.instance)},P={construct(_,e,t){try{H();let n={instance:Reflect.construct(_,e,t),instanceId:p.instanceId,ctor:_,args:e,newTarget:t};return new Proxy(n,{...Ie,get(r,o,u){r.instanceId!==p.instanceId&&(r.instance=Reflect.construct(r.ctor,r.args,r.newTarget),r.instanceId=p.instanceId);let d=Reflect.get(r.instance,o,u);return typeof d!="function"?d:d.constructor===Function?new Proxy(d,{apply(h,U,L){H();try{return h.apply(U,L)}catch(E){throw G(E),E}}}):new Proxy(d,{async apply(h,U,L){H();try{return await h.apply(U,L)}catch(E){throw G(E),E}}})}})}catch(n){throw p.criticalError=!0,n}}},je=new Proxy(W,P),ke=new Proxy(I,P),Se=new Proxy(v,P),We=new Proxy(x,P);export{ke as ContainerStartupOptions,Se as MinifyConfig,We as R2Range,je as default};
Binary file
@@ -1,12 +1,12 @@
1
- -- Short playlist links (/p/<id>). Each belongs to the account that made it
2
- -- and is deleted with it.
3
- CREATE TABLE IF NOT EXISTS shares (
4
- id TEXT PRIMARY KEY,
5
- owner_id TEXT NOT NULL,
6
- code TEXT NOT NULL,
7
- name TEXT NOT NULL DEFAULT '',
8
- songs INTEGER NOT NULL DEFAULT 0,
9
- kind TEXT NOT NULL DEFAULT 'playlist',
10
- created_at INTEGER NOT NULL
11
- );
12
- CREATE INDEX IF NOT EXISTS shares_owner ON shares (owner_id);
1
+ -- Short playlist links (/p/<id>). Each belongs to the account that made it
2
+ -- and is deleted with it.
3
+ CREATE TABLE IF NOT EXISTS shares (
4
+ id TEXT PRIMARY KEY,
5
+ owner_id TEXT NOT NULL,
6
+ code TEXT NOT NULL,
7
+ name TEXT NOT NULL DEFAULT '',
8
+ songs INTEGER NOT NULL DEFAULT 0,
9
+ kind TEXT NOT NULL DEFAULT 'playlist',
10
+ created_at INTEGER NOT NULL
11
+ );
12
+ CREATE INDEX IF NOT EXISTS shares_owner ON shares (owner_id);
@@ -1,12 +1,12 @@
1
- -- Profiles: picture, banner and what other users may see (all off by default).
2
- -- playlists: JSON array of shown playlist ids; recent: JSON array of songs.
3
- CREATE TABLE IF NOT EXISTS profiles (
4
- user_id TEXT PRIMARY KEY,
5
- public INTEGER NOT NULL DEFAULT 0,
6
- show_recent INTEGER NOT NULL DEFAULT 0,
7
- playlists TEXT NOT NULL DEFAULT '[]',
8
- avatar TEXT,
9
- banner TEXT,
10
- recent TEXT,
11
- updated_at INTEGER NOT NULL DEFAULT 0
12
- );
1
+ -- Profiles: picture, banner and what other users may see (all off by default).
2
+ -- playlists: JSON array of shown playlist ids; recent: JSON array of songs.
3
+ CREATE TABLE IF NOT EXISTS profiles (
4
+ user_id TEXT PRIMARY KEY,
5
+ public INTEGER NOT NULL DEFAULT 0,
6
+ show_recent INTEGER NOT NULL DEFAULT 0,
7
+ playlists TEXT NOT NULL DEFAULT '[]',
8
+ avatar TEXT,
9
+ banner TEXT,
10
+ recent TEXT,
11
+ updated_at INTEGER NOT NULL DEFAULT 0
12
+ );
@@ -1,2 +1,2 @@
1
- -- Approximate region/country only; no IP address, GPS or precise coordinates.
2
- ALTER TABLE devices ADD COLUMN approximate_location TEXT;
1
+ -- Approximate region/country only; no IP address, GPS or precise coordinates.
2
+ ALTER TABLE devices ADD COLUMN approximate_location TEXT;
@@ -1,11 +1,11 @@
1
- -- Account all R2 objects; only audio/ and covers/ are automatically evictable.
2
- ALTER TABLE audio_cache ADD COLUMN state TEXT NOT NULL DEFAULT 'ready';
3
- ALTER TABLE audio_cache ADD COLUMN generation TEXT NOT NULL DEFAULT 'legacy';
4
- ALTER TABLE audio_cache ADD COLUMN hits INTEGER NOT NULL DEFAULT 0;
5
- ALTER TABLE audio_cache ADD COLUMN last_access INTEGER NOT NULL DEFAULT 0;
6
- ALTER TABLE audio_cache ADD COLUMN seen INTEGER NOT NULL DEFAULT 0;
7
- CREATE TABLE audio_cache_inventory (
8
- id INTEGER PRIMARY KEY CHECK(id=1), cursor TEXT, ready INTEGER NOT NULL DEFAULT 0,
9
- scan_id INTEGER NOT NULL DEFAULT 0, finished INTEGER NOT NULL DEFAULT 0
10
- );
11
- INSERT INTO audio_cache_inventory(id) VALUES (1);
1
+ -- Account all R2 objects; only audio/ and covers/ are automatically evictable.
2
+ ALTER TABLE audio_cache ADD COLUMN state TEXT NOT NULL DEFAULT 'ready';
3
+ ALTER TABLE audio_cache ADD COLUMN generation TEXT NOT NULL DEFAULT 'legacy';
4
+ ALTER TABLE audio_cache ADD COLUMN hits INTEGER NOT NULL DEFAULT 0;
5
+ ALTER TABLE audio_cache ADD COLUMN last_access INTEGER NOT NULL DEFAULT 0;
6
+ ALTER TABLE audio_cache ADD COLUMN seen INTEGER NOT NULL DEFAULT 0;
7
+ CREATE TABLE audio_cache_inventory (
8
+ id INTEGER PRIMARY KEY CHECK(id=1), cursor TEXT, ready INTEGER NOT NULL DEFAULT 0,
9
+ scan_id INTEGER NOT NULL DEFAULT 0, finished INTEGER NOT NULL DEFAULT 0
10
+ );
11
+ INSERT INTO audio_cache_inventory(id) VALUES (1);
@@ -1,10 +1,10 @@
1
- CREATE TABLE d1_storage_reservations (
2
- token TEXT PRIMARY KEY,
3
- bytes INTEGER NOT NULL CHECK(bytes>0),
4
- created INTEGER NOT NULL
5
- );
6
- CREATE INDEX logins_expires ON logins(expires);
7
- CREATE INDEX handle_holds_until ON handle_holds(until);
8
-
9
- CREATE TABLE d1_storage_watermark (id INTEGER PRIMARY KEY CHECK(id=1), bytes INTEGER NOT NULL, revision INTEGER NOT NULL DEFAULT 0);
10
- INSERT INTO d1_storage_watermark VALUES (1,0,0);
1
+ CREATE TABLE d1_storage_reservations (
2
+ token TEXT PRIMARY KEY,
3
+ bytes INTEGER NOT NULL CHECK(bytes>0),
4
+ created INTEGER NOT NULL
5
+ );
6
+ CREATE INDEX logins_expires ON logins(expires);
7
+ CREATE INDEX handle_holds_until ON handle_holds(until);
8
+
9
+ CREATE TABLE d1_storage_watermark (id INTEGER PRIMARY KEY CHECK(id=1), bytes INTEGER NOT NULL, revision INTEGER NOT NULL DEFAULT 0);
10
+ INSERT INTO d1_storage_watermark VALUES (1,0,0);
@@ -1,6 +1,6 @@
1
- -- Short leases deduplicate proactive quality preparation across Worker isolates.
2
- CREATE TABLE IF NOT EXISTS audio_variant_jobs (
3
- track_id TEXT PRIMARY KEY,
4
- expires INTEGER NOT NULL
5
- );
6
- CREATE INDEX IF NOT EXISTS audio_variant_jobs_expiry ON audio_variant_jobs(expires);
1
+ -- Short leases deduplicate proactive quality preparation across Worker isolates.
2
+ CREATE TABLE IF NOT EXISTS audio_variant_jobs (
3
+ track_id TEXT PRIMARY KEY,
4
+ expires INTEGER NOT NULL
5
+ );
6
+ CREATE INDEX IF NOT EXISTS audio_variant_jobs_expiry ON audio_variant_jobs(expires);
@@ -0,0 +1,11 @@
1
+ -- Short-lived mailbox for the MCP relay: tool calls waiting for a user's app,
2
+ -- their results, OAuth clients / authorizations / codes and MCP tokens.
3
+ -- `scope` is a user id or an internal namespace ("_client", "_token", ...).
4
+ CREATE TABLE IF NOT EXISTS mcp_mailbox (
5
+ scope TEXT NOT NULL,
6
+ key TEXT NOT NULL,
7
+ value TEXT NOT NULL,
8
+ expires INTEGER NOT NULL,
9
+ PRIMARY KEY (scope, key)
10
+ );
11
+ CREATE INDEX IF NOT EXISTS mcp_mailbox_expiry ON mcp_mailbox(expires);