@juspay/shooter 1.2.0 → 1.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/bin/shooter.cjs +182 -31
- package/build/client/_app/immutable/chunks/{B-K5Sh65.js → BN1NjBrw.js} +1 -1
- package/build/client/_app/immutable/chunks/BN1NjBrw.js.br +0 -0
- package/build/client/_app/immutable/chunks/BN1NjBrw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BYqGCrTe.js → CDVSripB.js} +1 -1
- package/build/client/_app/immutable/chunks/CDVSripB.js.br +0 -0
- package/build/client/_app/immutable/chunks/CDVSripB.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{C4mLaWWx.js → CF4lQ45j.js} +1 -1
- package/build/client/_app/immutable/chunks/CF4lQ45j.js.br +0 -0
- package/build/client/_app/immutable/chunks/CF4lQ45j.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.Z3zMnuSx.js → app.DwWiuoEC.js} +2 -2
- package/build/client/_app/immutable/entry/app.DwWiuoEC.js.br +0 -0
- package/build/client/_app/immutable/entry/app.DwWiuoEC.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.DG8BMhrh.js +1 -0
- package/build/client/_app/immutable/entry/start.DG8BMhrh.js.br +0 -0
- package/build/client/_app/immutable/entry/start.DG8BMhrh.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{0.D2YR8tTD.js → 0.ejabgzDQ.js} +1 -1
- package/build/client/_app/immutable/nodes/0.ejabgzDQ.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.ejabgzDQ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.B3m6rO4C.js → 1.BFK7Ubrr.js} +1 -1
- package/build/client/_app/immutable/nodes/1.BFK7Ubrr.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.BFK7Ubrr.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{2.CyRB2euU.js → 2.DV3saFiY.js} +1 -1
- package/build/client/_app/immutable/nodes/2.DV3saFiY.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.DV3saFiY.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{4.DEAcwl7l.js → 4.D6NIf10D.js} +1 -1
- package/build/client/_app/immutable/nodes/4.D6NIf10D.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.D6NIf10D.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{5.C6bLGWQR.js → 5.g3R-QfIW.js} +1 -1
- package/build/client/_app/immutable/nodes/5.g3R-QfIW.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.g3R-QfIW.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{6.ByTzlA2D.js → 6.DSpd_nYK.js} +1 -1
- package/build/client/_app/immutable/nodes/6.DSpd_nYK.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.DSpd_nYK.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{7.BPMfwzd2.js → 7.F9WBFTz2.js} +1 -1
- package/build/client/_app/immutable/nodes/7.F9WBFTz2.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.F9WBFTz2.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/server/chunks/{0-Vk38tI2J.js → 0-ePgrkfG9.js} +2 -2
- package/build/server/chunks/{0-Vk38tI2J.js.map → 0-ePgrkfG9.js.map} +1 -1
- package/build/server/chunks/{1-BvYQX5MR.js → 1-BV7u1xGo.js} +2 -2
- package/build/server/chunks/{1-BvYQX5MR.js.map → 1-BV7u1xGo.js.map} +1 -1
- package/build/server/chunks/{2-Cl7R4Qk2.js → 2-3p1kyvjQ.js} +2 -2
- package/build/server/chunks/{2-Cl7R4Qk2.js.map → 2-3p1kyvjQ.js.map} +1 -1
- package/build/server/chunks/{4-CnDeRm2Z.js → 4-ChFYfo_S.js} +2 -2
- package/build/server/chunks/{4-CnDeRm2Z.js.map → 4-ChFYfo_S.js.map} +1 -1
- package/build/server/chunks/{5-IxitzEvN.js → 5-q-tQLBBu.js} +2 -2
- package/build/server/chunks/{5-IxitzEvN.js.map → 5-q-tQLBBu.js.map} +1 -1
- package/build/server/chunks/{6-CyZ3r1iS.js → 6-BIaAbm8b.js} +2 -2
- package/build/server/chunks/{6-CyZ3r1iS.js.map → 6-BIaAbm8b.js.map} +1 -1
- package/build/server/chunks/{7-BmI7du46.js → 7--TmbCgrH.js} +2 -2
- package/build/server/chunks/{7-BmI7du46.js.map → 7--TmbCgrH.js.map} +1 -1
- package/build/server/index.js +1 -1
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +8 -8
- package/build/server/manifest.js.map +1 -1
- package/package.json +1 -1
- package/svelte.config.js +1 -1
- package/build/client/_app/immutable/chunks/B-K5Sh65.js.br +0 -0
- package/build/client/_app/immutable/chunks/B-K5Sh65.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BYqGCrTe.js.br +0 -0
- package/build/client/_app/immutable/chunks/BYqGCrTe.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C4mLaWWx.js.br +0 -0
- package/build/client/_app/immutable/chunks/C4mLaWWx.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.Z3zMnuSx.js.br +0 -0
- package/build/client/_app/immutable/entry/app.Z3zMnuSx.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.Dd-gIP4y.js +0 -1
- package/build/client/_app/immutable/entry/start.Dd-gIP4y.js.br +0 -2
- package/build/client/_app/immutable/entry/start.Dd-gIP4y.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.D2YR8tTD.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.D2YR8tTD.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.B3m6rO4C.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.B3m6rO4C.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.CyRB2euU.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.CyRB2euU.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.DEAcwl7l.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.DEAcwl7l.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.C6bLGWQR.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.C6bLGWQR.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.ByTzlA2D.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.ByTzlA2D.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.BPMfwzd2.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.BPMfwzd2.js.gz +0 -0
package/bin/shooter.cjs
CHANGED
|
@@ -103,6 +103,69 @@ switch (command) {
|
|
|
103
103
|
|
|
104
104
|
// ── start ───────────────────────────────────────────────────────────
|
|
105
105
|
|
|
106
|
+
function hasFlag(flag) {
|
|
107
|
+
return args.includes(flag);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function isCloudflaredAvailable() {
|
|
111
|
+
try {
|
|
112
|
+
execSync('which cloudflared', { stdio: 'ignore' });
|
|
113
|
+
return true;
|
|
114
|
+
} catch {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function startTunnel(port) {
|
|
120
|
+
const tunnelLog = path.join(LOG_DIR, 'tunnel.log');
|
|
121
|
+
fs.mkdirSync(LOG_DIR, { recursive: true });
|
|
122
|
+
|
|
123
|
+
const cf = spawn('cloudflared', ['tunnel', '--url', `http://localhost:${port}`], {
|
|
124
|
+
cwd: PKG_ROOT,
|
|
125
|
+
detached: true,
|
|
126
|
+
stdio: ['ignore', fs.openSync(tunnelLog, 'w'), fs.openSync(tunnelLog, 'w')],
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const tunnelPidFile = path.join(SHOOTER_HOME, 'tunnel.pid');
|
|
130
|
+
fs.writeFileSync(tunnelPidFile, String(cf.pid));
|
|
131
|
+
cf.unref();
|
|
132
|
+
|
|
133
|
+
// Poll for the tunnel URL (up to 15s)
|
|
134
|
+
const tunnelUrlFile = path.join(SHOOTER_HOME, '.tunnel_url');
|
|
135
|
+
let waited = 0;
|
|
136
|
+
const poll = setInterval(() => {
|
|
137
|
+
try {
|
|
138
|
+
const log = fs.readFileSync(tunnelLog, 'utf8');
|
|
139
|
+
const match = log.match(/https:\/\/[a-z0-9-]+\.trycloudflare\.com/);
|
|
140
|
+
if (match) {
|
|
141
|
+
clearInterval(poll);
|
|
142
|
+
fs.writeFileSync(tunnelUrlFile, match[0]);
|
|
143
|
+
console.log(`Tunnel active: ${match[0]}`);
|
|
144
|
+
}
|
|
145
|
+
} catch {}
|
|
146
|
+
waited += 1;
|
|
147
|
+
if (waited > 15) {
|
|
148
|
+
clearInterval(poll);
|
|
149
|
+
console.log('Tunnel is starting in the background. Check logs: ' + tunnelLog);
|
|
150
|
+
}
|
|
151
|
+
}, 1000);
|
|
152
|
+
|
|
153
|
+
return cf.pid;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function stopTunnel() {
|
|
157
|
+
const tunnelPidFile = path.join(SHOOTER_HOME, 'tunnel.pid');
|
|
158
|
+
const tunnelUrlFile = path.join(SHOOTER_HOME, '.tunnel_url');
|
|
159
|
+
try {
|
|
160
|
+
const pid = parseInt(fs.readFileSync(tunnelPidFile, 'utf8').trim(), 10);
|
|
161
|
+
if (!isNaN(pid)) {
|
|
162
|
+
try { process.kill(pid, 'SIGTERM'); } catch {}
|
|
163
|
+
}
|
|
164
|
+
try { fs.unlinkSync(tunnelPidFile); } catch {}
|
|
165
|
+
try { fs.unlinkSync(tunnelUrlFile); } catch {}
|
|
166
|
+
} catch {}
|
|
167
|
+
}
|
|
168
|
+
|
|
106
169
|
function startServer() {
|
|
107
170
|
const serverEntry = path.join(PKG_ROOT, 'server.ts');
|
|
108
171
|
|
|
@@ -120,36 +183,109 @@ function startServer() {
|
|
|
120
183
|
process.exit(0);
|
|
121
184
|
}
|
|
122
185
|
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
env: {
|
|
127
|
-
...process.env,
|
|
128
|
-
SHOOTER_PKG_ROOT: PKG_ROOT,
|
|
129
|
-
SHOOTER_HOME,
|
|
130
|
-
},
|
|
131
|
-
});
|
|
186
|
+
const daemon = hasFlag('--daemon') || hasFlag('-d');
|
|
187
|
+
const noTunnel = hasFlag('--no-tunnel');
|
|
188
|
+
const port = resolvePort();
|
|
132
189
|
|
|
133
|
-
|
|
134
|
-
|
|
190
|
+
if (daemon) {
|
|
191
|
+
// ── Daemon mode: detach, redirect to log file ──
|
|
192
|
+
fs.mkdirSync(LOG_DIR, { recursive: true });
|
|
193
|
+
const logFd = fs.openSync(LOG_FILE, 'a');
|
|
194
|
+
|
|
195
|
+
// Use tsx's register hook via --import so the child is the actual server process
|
|
196
|
+
// (not a wrapper that spawns another child)
|
|
197
|
+
const tsxLoader = path.join(PKG_ROOT, 'node_modules', 'tsx', 'dist', 'loader.mjs');
|
|
198
|
+
const tsxPreflight = path.join(PKG_ROOT, 'node_modules', 'tsx', 'dist', 'preflight.cjs');
|
|
199
|
+
const nodeArgs = [];
|
|
200
|
+
if (fs.existsSync(tsxPreflight)) {
|
|
201
|
+
nodeArgs.push('--require', tsxPreflight);
|
|
202
|
+
}
|
|
203
|
+
if (fs.existsSync(tsxLoader)) {
|
|
204
|
+
nodeArgs.push('--import', `file://${tsxLoader}`);
|
|
205
|
+
} else {
|
|
206
|
+
nodeArgs.push('--import', 'tsx');
|
|
207
|
+
}
|
|
208
|
+
nodeArgs.push(serverEntry);
|
|
209
|
+
|
|
210
|
+
const child = spawn(process.execPath, nodeArgs, {
|
|
211
|
+
cwd: PKG_ROOT,
|
|
212
|
+
detached: true,
|
|
213
|
+
stdio: ['ignore', logFd, logFd],
|
|
214
|
+
env: {
|
|
215
|
+
...process.env,
|
|
216
|
+
SHOOTER_PKG_ROOT: PKG_ROOT,
|
|
217
|
+
SHOOTER_HOME,
|
|
218
|
+
},
|
|
219
|
+
});
|
|
135
220
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
221
|
+
writePid(child.pid);
|
|
222
|
+
child.unref();
|
|
223
|
+
fs.closeSync(logFd);
|
|
224
|
+
|
|
225
|
+
console.log(`Shooter started in background (PID ${child.pid}).`);
|
|
226
|
+
console.log(` URL: http://localhost:${port}`);
|
|
227
|
+
console.log(` Logs: ${LOG_FILE}`);
|
|
228
|
+
|
|
229
|
+
// Wait briefly for server to be ready before starting tunnel
|
|
230
|
+
if (!noTunnel && isCloudflaredAvailable()) {
|
|
231
|
+
setTimeout(() => {
|
|
232
|
+
startTunnel(port);
|
|
233
|
+
}, 3000);
|
|
234
|
+
// Keep process alive long enough for tunnel URL to appear
|
|
235
|
+
setTimeout(() => process.exit(0), 20000);
|
|
236
|
+
} else {
|
|
237
|
+
if (!noTunnel && !isCloudflaredAvailable()) {
|
|
238
|
+
console.log(' (cloudflared not found — no tunnel. Install: brew install cloudflared)');
|
|
239
|
+
}
|
|
240
|
+
process.exit(0);
|
|
241
|
+
}
|
|
242
|
+
} else {
|
|
243
|
+
// ── Foreground mode: inherit stdio ──
|
|
244
|
+
const child = spawn(process.execPath, ['--import', 'tsx', serverEntry], {
|
|
245
|
+
cwd: PKG_ROOT,
|
|
246
|
+
stdio: 'inherit',
|
|
247
|
+
env: {
|
|
248
|
+
...process.env,
|
|
249
|
+
SHOOTER_PKG_ROOT: PKG_ROOT,
|
|
250
|
+
SHOOTER_HOME,
|
|
251
|
+
},
|
|
252
|
+
});
|
|
141
253
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
254
|
+
writePid(child.pid);
|
|
255
|
+
|
|
256
|
+
// Start tunnel in foreground mode too (unless --no-tunnel)
|
|
257
|
+
let tunnelStarted = false;
|
|
258
|
+
if (!noTunnel && isCloudflaredAvailable()) {
|
|
259
|
+
// Give server 3s to start before launching tunnel
|
|
260
|
+
setTimeout(() => {
|
|
261
|
+
startTunnel(port);
|
|
262
|
+
tunnelStarted = true;
|
|
263
|
+
}, 3000);
|
|
146
264
|
}
|
|
147
|
-
process.exit(code ?? 1);
|
|
148
|
-
});
|
|
149
265
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
266
|
+
child.on('error', (err) => {
|
|
267
|
+
removePid();
|
|
268
|
+
if (tunnelStarted) stopTunnel();
|
|
269
|
+
console.error('Failed to start Shooter server:', err.message);
|
|
270
|
+
process.exit(1);
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
child.on('exit', (code, signal) => {
|
|
274
|
+
removePid();
|
|
275
|
+
stopTunnel();
|
|
276
|
+
if (signal) {
|
|
277
|
+
process.exit(128 + (signalCode(signal) || 1));
|
|
278
|
+
}
|
|
279
|
+
process.exit(code ?? 1);
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
// Forward signals to the child so graceful shutdown works
|
|
283
|
+
for (const sig of ['SIGTERM', 'SIGINT', 'SIGHUP']) {
|
|
284
|
+
process.on(sig, () => {
|
|
285
|
+
child.kill(sig);
|
|
286
|
+
stopTunnel();
|
|
287
|
+
});
|
|
288
|
+
}
|
|
153
289
|
}
|
|
154
290
|
}
|
|
155
291
|
|
|
@@ -158,11 +294,14 @@ function startServer() {
|
|
|
158
294
|
function stopServer() {
|
|
159
295
|
const pid = readPid();
|
|
160
296
|
if (!pid) {
|
|
297
|
+
// Still try to stop tunnel even if server isn't running
|
|
298
|
+
stopTunnel();
|
|
161
299
|
console.log('Shooter is not running.');
|
|
162
300
|
process.exit(0);
|
|
163
301
|
}
|
|
164
302
|
|
|
165
303
|
console.log(`Stopping Shooter (PID ${pid})...`);
|
|
304
|
+
stopTunnel();
|
|
166
305
|
try {
|
|
167
306
|
process.kill(pid, 'SIGTERM');
|
|
168
307
|
// Wait briefly for clean shutdown
|
|
@@ -208,11 +347,17 @@ function showStatus() {
|
|
|
208
347
|
const pid = readPid();
|
|
209
348
|
const port = resolvePort();
|
|
210
349
|
const autostartEnabled = isAutostartInstalled();
|
|
350
|
+
const tunnelUrlFile = path.join(SHOOTER_HOME, '.tunnel_url');
|
|
351
|
+
let tunnelUrl = null;
|
|
352
|
+
try { tunnelUrl = fs.readFileSync(tunnelUrlFile, 'utf8').trim(); } catch {}
|
|
211
353
|
|
|
212
354
|
if (pid) {
|
|
213
355
|
console.log(`Shooter is running`);
|
|
214
356
|
console.log(` PID: ${pid}`);
|
|
215
357
|
console.log(` URL: http://localhost:${port}`);
|
|
358
|
+
if (tunnelUrl) {
|
|
359
|
+
console.log(` Tunnel: ${tunnelUrl}`);
|
|
360
|
+
}
|
|
216
361
|
console.log(` Autostart: ${autostartEnabled ? 'enabled' : 'disabled'}`);
|
|
217
362
|
console.log(` Logs: ${LOG_FILE}`);
|
|
218
363
|
console.log(` Home: ${SHOOTER_HOME}`);
|
|
@@ -476,12 +621,12 @@ function showHelp() {
|
|
|
476
621
|
`
|
|
477
622
|
Shooter v${pkg.version}
|
|
478
623
|
|
|
479
|
-
Usage: shooter [command]
|
|
624
|
+
Usage: shooter [command] [options]
|
|
480
625
|
|
|
481
626
|
Commands:
|
|
482
|
-
start Start the server (default)
|
|
483
|
-
stop Stop the running server
|
|
484
|
-
status Show server status
|
|
627
|
+
start Start the server (default, foreground)
|
|
628
|
+
stop Stop the running server and tunnel
|
|
629
|
+
status Show server status and tunnel URL
|
|
485
630
|
autostart on Start automatically on login (macOS/Linux)
|
|
486
631
|
autostart off Disable autostart
|
|
487
632
|
logs Tail server logs
|
|
@@ -489,9 +634,15 @@ Commands:
|
|
|
489
634
|
version Show version number
|
|
490
635
|
help Show this help message
|
|
491
636
|
|
|
637
|
+
Start options:
|
|
638
|
+
-d, --daemon Run in background (detach from terminal)
|
|
639
|
+
--no-tunnel Don't start a Cloudflare Tunnel
|
|
640
|
+
|
|
492
641
|
Examples:
|
|
493
|
-
shooter Start the server
|
|
494
|
-
shooter
|
|
642
|
+
shooter Start the server + tunnel (foreground)
|
|
643
|
+
shooter start -d Start in background (daemon mode)
|
|
644
|
+
shooter start --no-tunnel Start without Cloudflare Tunnel
|
|
645
|
+
shooter status Check status and tunnel URL
|
|
495
646
|
shooter autostart on Enable autostart on login
|
|
496
647
|
shooter logs Follow server logs
|
|
497
648
|
shooter setup Configure credentials
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bq as Se,u as De,o as U,z as A,y as T,aa as te,br as _t}from"./CZHsSL_X.js";class Re{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class xe{constructor(t,n){this.status=t,this.location=n}}class Le extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function mt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function vt(e){return e.split("%25").map(decodeURI).join("%25")}function wt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function ge({href:e}){return e.split("#")[0]}function yt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function bt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const kt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&W.delete(Ue(e)),kt(e,t));const W=new Map;function Et(e,t){const n=Ue(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&W.set(n,{body:a,init:i,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=bt(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function St(e,t,n){if(W.size>0){const r=Ue(e,n),a=W.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);W.delete(r)}}return window.fetch(t,n)}function Ue(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${yt(...a)}"]`}return r}const Rt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function xt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Ut(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return _e(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return _e(String.fromCharCode(...l.slice(2).split("-").map(_=>parseInt(_,16))));const f=Rt.exec(l),[,p,v,h,u]=f;return t.push({name:h,matcher:u,optional:!!p,rest:!!v,chained:v?c===1&&o[0]==="":!1}),v?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return _e(l)}).join("")}).join("")}/?$`),params:t}}function Lt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Ut(e){return e.slice(1).split("/").filter(Lt)}function At(e,t,n){const r={},a=e.slice(1),i=a.filter(s=>s!==void 0);let o=0;for(let s=0;s<t.length;s+=1){const l=t[s];let c=a[s-o];if(l.chained&&l.rest&&o&&(c=a.slice(s-o,s+1).filter(f=>f).join("/"),o=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const f=t[s+1],p=a[s+1];f&&!f.rest&&f.optional&&p&&l.chained&&(o=0),!f&&!p&&Object.keys(r).length===i.length&&(o=0);continue}if(l.optional&&l.chained){o++;continue}return}if(!o)return r}function _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Tt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([s,[l,c,f]])=>{const{pattern:p,params:v}=xt(s),h={id:s,exec:u=>{const _=p.exec(u);if(_)return At(_,v,r)},errors:[1,...f||[]].map(u=>e[u]),layouts:[0,...c||[]].map(o),leaf:i(l)};return h.errors.length=h.layouts.length=Math.max(h.errors.length,h.layouts.length),h});function i(s){const l=s<0;return l&&(s=~s),[l,e[s]]}function o(s){return s===void 0?s:[a.has(s),e[s]]}}function Ye(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Ve(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_19bb7ro?.base??"",It=globalThis.__sveltekit_19bb7ro?.assets??x??"",Ot="1775074163772",He="sveltekit:snapshot",Je="sveltekit:scroll",Xe="sveltekit:states",Pt="sveltekit:pageurl",V="sveltekit:history",Y="sveltekit:navigation",j={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},ue=location.origin;function Ae(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function q(){return{x:pageXOffset,y:pageYOffset}}function D(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Be={...j,"":j.hover};function Qe(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Ze(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Qe(e)}}function we(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const s=location.hash.split("#")[1]||"/";r.hash=`#${s}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||fe(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),o=r?.origin===ue&&e.hasAttribute("download");return{url:r,external:i,target:a,download:o}}function ne(e){let t=null,n=null,r=null,a=null,i=null,o=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=D(s,"preload-code")),a===null&&(a=D(s,"preload-data")),t===null&&(t=D(s,"keepfocus")),n===null&&(n=D(s,"noscroll")),i===null&&(i=D(s,"reload")),o===null&&(o=D(s,"replacestate")),s=Qe(s);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Be[r??"off"],preload_data:Be[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(o)}}function Ke(e){const t=Se(e);let n=!0;function r(){n=!0,t.update(o=>o)}function a(o){n=!1,t.set(o)}function i(o){let s;return t.subscribe(l=>{(s===void 0||n&&l!==s)&&o(s=l)})}return{notify:r,set:a,subscribe:i}}const et={v:()=>{}};function $t(){const{set:e,subscribe:t}=Se(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${It}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==Ot;return o&&(e(!0),et.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:t,check:r}}function fe(e,t,n){return e.origin!==ue||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function sn(e){}const tt=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...tt];const Ct=new Set([...tt]);[...Ct];function jt(e){return e.filter(t=>t!=null)}function Te(e){return e instanceof Re||e instanceof Le?e.status:500}function Nt(e){return e instanceof Le?e.text:"Internal Error"}let k,H,me;const qt=De.toString().includes("$$")||/function \w+\(\) \{\}/.test(De.toString()),Me="a:";qt?(k={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Me)},H={current:null},me={current:!1}):(k=new class{#e=U({});get data(){return A(this.#e)}set data(t){T(this.#e,t)}#t=U(null);get form(){return A(this.#t)}set form(t){T(this.#t,t)}#n=U(null);get error(){return A(this.#n)}set error(t){T(this.#n,t)}#r=U({});get params(){return A(this.#r)}set params(t){T(this.#r,t)}#a=U({id:null});get route(){return A(this.#a)}set route(t){T(this.#a,t)}#o=U({});get state(){return A(this.#o)}set state(t){T(this.#o,t)}#s=U(-1);get status(){return A(this.#s)}set status(t){T(this.#s,t)}#i=U(new URL(Me));get url(){return A(this.#i)}set url(t){T(this.#i,t)}},H=new class{#e=U(null);get current(){return A(this.#e)}set current(t){T(this.#e,t)}},me=new class{#e=U(!1);get current(){return A(this.#e)}set current(t){T(this.#e,t)}},et.v=()=>me.current=!0);function Dt(e){Object.assign(k,e)}const Vt=new Set(["icon","shortcut icon","apple-touch-icon"]);let F=null;const C=Ye(Je)??{},J=Ye(He)??{},$={url:Ke({}),page:Ke({}),navigating:Se(null),updated:$t()};function Ie(e){C[e]=q()}function Bt(e,t){let n=e+1;for(;C[n];)delete C[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function X(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function nt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function Fe(){}let Oe,ye,re,I,be,y;const ae=[],oe=[];let L=null;function ke(){L?.fork?.then(e=>e?.discard()),L=null}const ee=new Map,rt=new Set,Kt=new Set,z=new Set;let m={branch:[],error:null,url:null},at=!1,se=!1,Ge=!0,Q=!1,G=!1,ot=!1,Pe=!1,st,w,R,N;const ie=new Set,We=new Map;async function fn(e,t,n){globalThis.__sveltekit_19bb7ro?.data&&globalThis.__sveltekit_19bb7ro.data,document.URL!==location.href&&(location.href=location.href),y=e,await e.hooks.init?.(),Oe=Tt(e),I=document.documentElement,be=t,ye=e.nodes[0],re=e.nodes[1],ye(),re(),w=history.state?.[V],R=history.state?.[Y],w||(w=R=Date.now(),history.replaceState({...history.state,[V]:w,[Y]:R},""));const r=C[w];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await tn(be,n)):(await B({type:"enter",url:Ae(y.hash?an(new URL(location.href)):location.href),replace_state:!0}),a()),en()}function Mt(){ae.length=0,Pe=!1}function it(e){oe.some(t=>t?.snapshot)&&(J[e]=oe.map(t=>t?.snapshot?.capture()))}function lt(e){J[e]?.forEach((t,n)=>{oe[n]?.snapshot?.restore(t)})}function ze(){Ie(w),Ve(Je,C),it(R),Ve(He,J)}async function ct(e,t,n,r){let a;t.invalidateAll&&ke(),await B({type:"goto",url:Ae(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Pe=!0,a=[...We.keys()]),t.invalidate&&t.invalidate.forEach(Zt)}}),t.invalidateAll&&te().then(te).then(()=>{We.forEach(({resource:i},o)=>{a?.includes(o)&&i.refresh?.()})})}async function Ft(e){if(e.id!==L?.id){ke();const t={};ie.add(t),L={id:e.id,token:t,promise:ft({...e,preload:t}).then(n=>(ie.delete(t),n.type==="loaded"&&n.state.error&&ke(),n)),fork:null}}return L.promise}async function ve(e){const t=(await de(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function ut(e,t,n){const r={params:m.params,route:{id:m.route?.id??null},url:new URL(location.href)};m={...e.state,nav:r};const a=document.querySelector("style[data-sveltekit]");if(a&&a.remove(),Object.assign(k,e.props.page),st=new y.root({target:t,props:{...e.props,stores:$,components:oe},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),lt(R),n){const i={from:null,to:{...r,scroll:C[w]??q()},willUnload:!1,type:"enter",complete:Promise.resolve()};z.forEach(o=>o(i))}se=!0}async function le({url:e,params:t,branch:n,errors:r,status:a,error:i,route:o,form:s}){let l="never";if(x&&(e.pathname===x||e.pathname===x+"/"))l="always";else for(const u of n)u?.slash!==void 0&&(l=u.slash);e.pathname=mt(e.pathname,l),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:i,route:o},props:{constructors:jt(n).map(u=>u.node.component),page:qe(k)}};s!==void 0&&(c.props.form=s);let f={},p=!k,v=0;for(let u=0;u<Math.max(n.length,m.branch.length);u+=1){const _=n[u],g=m.branch[u];_?.data!==g?.data&&(p=!0),_&&(f={...f,..._.data},p&&(c.props[`data_${v}`]=f),v+=1)}return(!m.url||e.href!==m.url.href||m.error!==i||s!==void 0&&s!==k.form||p)&&(c.props.page={error:i,params:t,route:{id:o?.id??null},state:{},status:a,url:new URL(e),form:s??null,data:p?f:k.data}),c}async function $e({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let o=null;const s={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();return{node:l,loader:e,server:i,universal:l.universal?.load?{type:"data",data:o,uses:s}:null,data:o??i?.data??null,slash:l.universal?.trailingSlash??i?.slash}}function Gt(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const i=se?St(r,a.href,t):Et(r,t);return{resolved:a,promise:i}}function Wt(e,t,n,r,a,i){if(Pe)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const o of a.search_params)if(r.has(o))return!0;for(const o of a.params)if(i[o]!==m.params[o])return!0;for(const o of a.dependencies)if(ae.some(s=>s(new URL(o))))return!0;return!1}function Ce(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function zt(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),i=t.searchParams.getAll(r);a.every(o=>i.includes(o))&&i.every(o=>a.includes(o))&&n.delete(r)}return n}function Yt({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:qe(k),constructors:[]}}}async function ft({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return ie.delete(L.token),L.promise;const{errors:o,layouts:s,leaf:l}=a,c=[...s,l];o.forEach(g=>g?.().catch(()=>{})),c.forEach(g=>g?.[1]().catch(()=>{}));const f=m.url?e!==ce(m.url):!1,p=m.route?a.id!==m.route.id:!1,v=zt(m.url,n);let h=!1;const u=c.map(async(g,d)=>{if(!g)return;const E=m.branch[d];return g[1]===E?.loader&&!Wt(h,p,f,v,E.universal?.uses,r)?E:(h=!0,$e({loader:g[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let P=0;P<d;P+=1)Object.assign(O,(await u[P])?.data);return O},server_data_node:Ce(g[0]?{type:"skip"}:null,g[0]?E?.server:void 0)}))});for(const g of u)g.catch(()=>{});const _=[];for(let g=0;g<c.length;g+=1)if(c[g])try{_.push(await u[g])}catch(d){if(d instanceof xe)return{type:"redirect",location:d.location};if(ie.has(i))return Yt({error:await Z(d,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let E=Te(d),S;if(d instanceof Re)S=d.body;else{if(await $.updated.check())return await nt(),await X(n);S=await Z(d,{params:r,url:n,route:{id:a.id}})}const O=await Ht(g,_,o);return O?le({url:n,params:r,branch:_.slice(0,O.idx).concat(O.node),errors:o,status:E,error:S,route:a}):await ht(n,{id:a.id},S,E)}else _.push(void 0);return le({url:n,params:r,branch:_,errors:o,status:200,error:null,route:a,form:t?void 0:null})}async function Ht(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function je({status:e,error:t,url:n,route:r}){const a={};let i=null;try{const o=await $e({loader:ye,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ce(i)}),s={node:await re(),loader:re,universal:null,server:null,data:null};return le({url:n,params:a,branch:[o,s],status:e,error:t,errors:[],route:null})}catch(o){if(o instanceof xe)return ct(new URL(o.location,location.href),{},0);throw o}}async function Jt(e){const t=e.href;if(ee.has(t))return ee.get(t);let n;try{const r=(async()=>{let a=await y.hooks.reroute({url:new URL(e),fetch:async(i,o)=>Gt(i,o,e).promise})??e;if(typeof a=="string"){const i=new URL(e);y.hash?i.hash=a:i.pathname=a,a=i}return a})();ee.set(t,r),n=await r}catch{ee.delete(t);return}return n}async function de(e,t){if(e&&!fe(e,x,y.hash)){const n=await Jt(e);if(!n)return;const r=Xt(n);for(const a of Oe){const i=a.exec(r);if(i)return{id:ce(e),invalidating:t,route:a,params:wt(i),url:e}}}}function Xt(e){return vt(y.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function ce(e){return(y.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function dt({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let o=!1;const s=Ne(m,n,e,t,i??null);r!==void 0&&(s.navigation.delta=r),a!==void 0&&(s.navigation.event=a);const l={...s.navigation,cancel:()=>{o=!0,s.reject(new Error("navigation cancelled"))}};return Q||rt.forEach(c=>c(l)),o?null:s}async function B({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:o={},redirect_count:s=0,nav_token:l={},accept:c=Fe,block:f=Fe,event:p}){const v=N;N=l;const h=await de(t,!1),u=e==="enter"?Ne(m,h,t,e):dt({url:t,type:e,delta:n?.delta,intent:h,scroll:n?.scroll,event:p});if(!u){f(),N===l&&(N=v);return}const _=w,g=R;c(),Q=!0,se&&u.navigation.type!=="enter"&&$.navigating.set(H.current=u.navigation);let d=h&&await ft(h);if(!d){if(fe(t,x,y.hash))return await X(t,i);d=await ht(t,{id:null},await Z(new Le(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=h?.url||t,N!==l)return u.reject(new Error("navigation aborted")),!1;if(d.type==="redirect"){if(s<20){await B({type:e,url:new URL(d.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:o,redirect_count:s+1,nav_token:l}),u.fulfil(void 0);return}d=await je({status:500,error:await Z(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else d.props.page.status>=400&&await $.updated.check()&&(await nt(),await X(t,i));if(Mt(),Ie(_),it(g),d.props.page.url.pathname!==t.pathname&&(t.pathname=d.props.page.url.pathname),o=n?n.state:o,!n){const b=i?0:1,K={[V]:w+=b,[Y]:R+=b,[Xe]:o};(i?history.replaceState:history.pushState).call(history,K,"",t),i||Bt(w,R)}const E=h&&L?.id===h.id?L.fork:null;L=null,d.props.page.state=o;let S;if(se){const b=(await Promise.all(Array.from(Kt,M=>M(u.navigation)))).filter(M=>typeof M=="function");if(b.length>0){let M=function(){b.forEach(pe=>{z.delete(pe)})};b.push(M),b.forEach(pe=>{z.add(pe)})}const K=u.navigation.to;m={...d.state,nav:{params:K.params,route:K.route,url:K.url}},d.props.page&&(d.props.page.url=t);const he=E&&await E;he?S=he.commit():(F=null,st.$set(d.props),F&&Object.assign(d.props.page,F),Dt(d.props.page),S=_t?.()),ot=!0}else await ut(d,be,!1);const{activeElement:O}=document;await S,await te(),await te();let P=null;if(Ge){const b=n?n.scroll:a?q():null;b?scrollTo(b.x,b.y):(P=t.hash&&document.getElementById(pt(t)))?P.scrollIntoView():scrollTo(0,0)}const gt=document.activeElement!==O&&document.activeElement!==document.body;!r&&!gt&&rn(t,!P),Ge=!0,d.props.page&&(F&&Object.assign(d.props.page,F),Object.assign(k,d.props.page)),Q=!1,e==="popstate"&<(R),u.fulfil(void 0),u.navigation.to&&(u.navigation.to.scroll=q()),z.forEach(b=>b(u.navigation)),$.navigating.set(H.current=null)}async function ht(e,t,n,r,a){return e.origin===ue&&e.pathname===location.pathname&&!at?await je({status:r,error:n,url:e,route:t}):await X(e,a)}function Qt(){let e,t={element:void 0,href:void 0},n;I.addEventListener("mousemove",s=>{const l=s.target;clearTimeout(e),e=setTimeout(()=>{i(l,j.hover)},20)});function r(s){s.defaultPrevented||i(s.composedPath()[0],j.tap)}I.addEventListener("mousedown",r),I.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(s=>{for(const l of s)l.isIntersecting&&(ve(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(s,l){const c=Ze(s,I),f=c===t.element&&c?.href===t.href&&l>=n;if(!c||f)return;const{url:p,external:v,download:h}=we(c,x,y.hash);if(v||h)return;const u=ne(c),_=p&&ce(m.url)===ce(p);if(!(u.reload||_))if(l<=u.preload_data){t={element:c,href:c.href},n=j.tap;const g=await de(p,!1);if(!g)return;Ft(g)}else l<=u.preload_code&&(t={element:c,href:c.href},n=l,ve(p))}function o(){a.disconnect();for(const s of I.querySelectorAll("a")){const{url:l,external:c,download:f}=we(s,x,y.hash);if(c||f)continue;const p=ne(s);p.reload||(p.preload_code===j.viewport&&a.observe(s),p.preload_code===j.eager&&ve(l))}}z.add(o),o()}function Z(e,t){if(e instanceof Re)return e.body;const n=Te(e),r=Nt(e);return y.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function dn(e,t={}){return e=new URL(Ae(e)),e.origin!==ue?Promise.reject(new Error("goto: invalid URL")):ct(e,t,0)}function Zt(e){if(typeof e=="function")ae.push(e);else{const{href:t}=new URL(e,location.href);ae.push(n=>n.href===t)}}function en(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(ze(),!Q){const r=Ne(m,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};rt.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&ze()}),navigator.connection?.saveData||Qt(),I.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=Ze(t.composedPath()[0],I);if(!n)return;const{url:r,external:a,target:i,download:o}=we(n,x,y.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const s=ne(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||o)return;const[c,f]=(y.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=c===ge(location);if(a||s.reload&&(!p||!f)){dt({url:r,type:"link",event:t})?Q=!0:t.preventDefault();return}if(f!==void 0&&p){const[,v]=m.url.href.split("#");if(v===f){if(t.preventDefault(),f===""||f==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const h=n.ownerDocument.getElementById(decodeURIComponent(f));h&&(h.scrollIntoView(),h.focus())}return}if(G=!0,Ie(w),e(r),!s.replace_state)return;G=!1}t.preventDefault(),await new Promise(v=>{requestAnimationFrame(()=>{setTimeout(v,0)}),setTimeout(v,100)}),await B({type:"link",url:r,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??r.href===location.href,event:t})}),I.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const o=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(fe(o,x,!1))return;const s=t.target,l=ne(s);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(s,r);o.search=new URLSearchParams(c).toString(),B({type:"form",url:o,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??o.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Ee){if(t.state?.[V]){const n=t.state[V];if(N={},n===w)return;const r=C[n],a=t.state[Xe]??{},i=new URL(t.state[Pt]??location.href),o=t.state[Y],s=m.url?ge(location)===ge(m.url):!1;if(o===R&&(ot||s)){a!==k.state&&(k.state=a),e(i),C[w]=q(),r&&scrollTo(r.x,r.y),w=n;return}const c=n-w;await B({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{w=n,R=o},block:()=>{history.go(-c)},nav_token:N,event:t})}else if(!G){const n=new URL(location.href);e(n),y.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[V]:++w,[Y]:R},"",location.href))});for(const t of document.querySelectorAll("link"))Vt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&$.navigating.set(H.current=null)});function e(t){m.url=k.url=t,$.page.set(qe(k)),$.page.notify()}}async function tn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:o,data:s,form:l}){at=!0;const c=new URL(location.href);let f;({params:a={},route:i={id:null}}=await de(c,!1)||{}),f=Oe.find(({id:h})=>h===i.id);let p,v=!0;try{const h=r.map(async(_,g)=>{const d=s[g];return d?.uses&&(d.uses=nn(d.uses)),$e({loader:y.nodes[_],url:c,params:a,route:i,parent:async()=>{const E={};for(let S=0;S<g;S+=1)Object.assign(E,(await h[S]).data);return E},server_data_node:Ce(d)})}),u=await Promise.all(h);if(f){const _=f.layouts;for(let g=0;g<_.length;g++)_[g]||u.splice(g,0,void 0)}p=await le({url:c,params:a,branch:u,status:t,error:n,errors:f?.errors,form:l,route:f??null})}catch(h){if(h instanceof xe){await X(new URL(h.location,location.href));return}p=await je({status:Te(h),error:await Z(h,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",v=!1}p.props.page&&(p.props.page.state={}),await ut(p,e,v)}function nn(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let Ee=!1;function rn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=pt(e);if(r&&document.getElementById(r)){const{x:i,y:o}=q();setTimeout(()=>{const s=history.state;Ee=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(s,"",e),t&&scrollTo(i,o),Ee=!1})}else{const i=document.body,o=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),o!==null?i.setAttribute("tabindex",o):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let o=0;o<a.rangeCount;o+=1)i.push(a.getRangeAt(o));setTimeout(()=>{if(a.rangeCount===i.length){for(let o=0;o<a.rangeCount;o+=1){const s=i[o],l=a.getRangeAt(o);if(s.commonAncestorContainer!==l.commonAncestorContainer||s.startContainer!==l.startContainer||s.endContainer!==l.endContainer||s.startOffset!==l.startOffset||s.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function Ne(e,t,n,r,a=null){let i,o;const s=new Promise((c,f)=>{i=c,o=f});return s.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:q()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:s},fulfil:i,reject:o}}function qe(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function an(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function pt(e){let t;if(y.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{fn as a,dn as g,sn as l,k as p,$ as s};
|
|
1
|
+
import{bq as Se,u as ze,o as U,z as A,y as T,aa as te,br as _t}from"./CZHsSL_X.js";class Re{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class xe{constructor(t,n){this.status=t,this.location=n}}class Le extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function mt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function wt(e){return e.split("%25").map(decodeURI).join("%25")}function vt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function ge({href:e}){return e.split("#")[0]}function yt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function bt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const kt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&G.delete(Ue(e)),kt(e,t));const G=new Map;function Et(e,t){const n=Ue(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&G.set(n,{body:a,init:i,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=bt(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function St(e,t,n){if(G.size>0){const r=Ue(e,n),a=G.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);G.delete(r)}}return window.fetch(t,n)}function Ue(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${yt(...a)}"]`}return r}const Rt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function xt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Ut(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return _e(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return _e(String.fromCharCode(...l.slice(2).split("-").map(_=>parseInt(_,16))));const f=Rt.exec(l),[,p,w,h,u]=f;return t.push({name:h,matcher:u,optional:!!p,rest:!!w,chained:w?c===1&&o[0]==="":!1}),w?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return _e(l)}).join("")}).join("")}/?$`),params:t}}function Lt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Ut(e){return e.slice(1).split("/").filter(Lt)}function At(e,t,n){const r={},a=e.slice(1),i=a.filter(s=>s!==void 0);let o=0;for(let s=0;s<t.length;s+=1){const l=t[s];let c=a[s-o];if(l.chained&&l.rest&&o&&(c=a.slice(s-o,s+1).filter(f=>f).join("/"),o=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const f=t[s+1],p=a[s+1];f&&!f.rest&&f.optional&&p&&l.chained&&(o=0),!f&&!p&&Object.keys(r).length===i.length&&(o=0);continue}if(l.optional&&l.chained){o++;continue}return}if(!o)return r}function _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Tt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([s,[l,c,f]])=>{const{pattern:p,params:w}=xt(s),h={id:s,exec:u=>{const _=p.exec(u);if(_)return At(_,w,r)},errors:[1,...f||[]].map(u=>e[u]),layouts:[0,...c||[]].map(o),leaf:i(l)};return h.errors.length=h.layouts.length=Math.max(h.errors.length,h.layouts.length),h});function i(s){const l=s<0;return l&&(s=~s),[l,e[s]]}function o(s){return s===void 0?s:[a.has(s),e[s]]}}function Ye(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function De(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_10z9zqw?.base??"",It=globalThis.__sveltekit_10z9zqw?.assets??x??"",Ot="1775159415510",He="sveltekit:snapshot",Je="sveltekit:scroll",Xe="sveltekit:states",Pt="sveltekit:pageurl",D="sveltekit:history",Y="sveltekit:navigation",j={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},ue=location.origin;function Ae(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function q(){return{x:pageXOffset,y:pageYOffset}}function z(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Ve={...j,"":j.hover};function Qe(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Ze(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Qe(e)}}function ve(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const s=location.hash.split("#")[1]||"/";r.hash=`#${s}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||fe(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),o=r?.origin===ue&&e.hasAttribute("download");return{url:r,external:i,target:a,download:o}}function ne(e){let t=null,n=null,r=null,a=null,i=null,o=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=z(s,"preload-code")),a===null&&(a=z(s,"preload-data")),t===null&&(t=z(s,"keepfocus")),n===null&&(n=z(s,"noscroll")),i===null&&(i=z(s,"reload")),o===null&&(o=z(s,"replacestate")),s=Qe(s);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Ve[r??"off"],preload_data:Ve[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(o)}}function Be(e){const t=Se(e);let n=!0;function r(){n=!0,t.update(o=>o)}function a(o){n=!1,t.set(o)}function i(o){let s;return t.subscribe(l=>{(s===void 0||n&&l!==s)&&o(s=l)})}return{notify:r,set:a,subscribe:i}}const et={v:()=>{}};function $t(){const{set:e,subscribe:t}=Se(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${It}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==Ot;return o&&(e(!0),et.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:t,check:r}}function fe(e,t,n){return e.origin!==ue||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function sn(e){}const tt=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...tt];const Ct=new Set([...tt]);[...Ct];function jt(e){return e.filter(t=>t!=null)}function Te(e){return e instanceof Re||e instanceof Le?e.status:500}function Nt(e){return e instanceof Le?e.text:"Internal Error"}let k,H,me;const qt=ze.toString().includes("$$")||/function \w+\(\) \{\}/.test(ze.toString()),Ke="a:";qt?(k={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Ke)},H={current:null},me={current:!1}):(k=new class{#e=U({});get data(){return A(this.#e)}set data(t){T(this.#e,t)}#t=U(null);get form(){return A(this.#t)}set form(t){T(this.#t,t)}#n=U(null);get error(){return A(this.#n)}set error(t){T(this.#n,t)}#r=U({});get params(){return A(this.#r)}set params(t){T(this.#r,t)}#a=U({id:null});get route(){return A(this.#a)}set route(t){T(this.#a,t)}#o=U({});get state(){return A(this.#o)}set state(t){T(this.#o,t)}#s=U(-1);get status(){return A(this.#s)}set status(t){T(this.#s,t)}#i=U(new URL(Ke));get url(){return A(this.#i)}set url(t){T(this.#i,t)}},H=new class{#e=U(null);get current(){return A(this.#e)}set current(t){T(this.#e,t)}},me=new class{#e=U(!1);get current(){return A(this.#e)}set current(t){T(this.#e,t)}},et.v=()=>me.current=!0);function zt(e){Object.assign(k,e)}const Dt=new Set(["icon","shortcut icon","apple-touch-icon"]);let M=null;const C=Ye(Je)??{},J=Ye(He)??{},$={url:Be({}),page:Be({}),navigating:Se(null),updated:$t()};function Ie(e){C[e]=q()}function Vt(e,t){let n=e+1;for(;C[n];)delete C[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function X(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function nt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function Me(){}let Oe,ye,re,I,be,y;const ae=[],oe=[];let L=null;function ke(){L?.fork?.then(e=>e?.discard()),L=null}const ee=new Map,rt=new Set,Bt=new Set,W=new Set;let m={branch:[],error:null,url:null},at=!1,se=!1,Fe=!0,Q=!1,F=!1,ot=!1,Pe=!1,st,v,R,N;const ie=new Set,Ge=new Map;async function fn(e,t,n){globalThis.__sveltekit_10z9zqw?.data&&globalThis.__sveltekit_10z9zqw.data,document.URL!==location.href&&(location.href=location.href),y=e,await e.hooks.init?.(),Oe=Tt(e),I=document.documentElement,be=t,ye=e.nodes[0],re=e.nodes[1],ye(),re(),v=history.state?.[D],R=history.state?.[Y],v||(v=R=Date.now(),history.replaceState({...history.state,[D]:v,[Y]:R},""));const r=C[v];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await tn(be,n)):(await V({type:"enter",url:Ae(y.hash?an(new URL(location.href)):location.href),replace_state:!0}),a()),en()}function Kt(){ae.length=0,Pe=!1}function it(e){oe.some(t=>t?.snapshot)&&(J[e]=oe.map(t=>t?.snapshot?.capture()))}function lt(e){J[e]?.forEach((t,n)=>{oe[n]?.snapshot?.restore(t)})}function We(){Ie(v),De(Je,C),it(R),De(He,J)}async function ct(e,t,n,r){let a;t.invalidateAll&&ke(),await V({type:"goto",url:Ae(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Pe=!0,a=[...Ge.keys()]),t.invalidate&&t.invalidate.forEach(Zt)}}),t.invalidateAll&&te().then(te).then(()=>{Ge.forEach(({resource:i},o)=>{a?.includes(o)&&i.refresh?.()})})}async function Mt(e){if(e.id!==L?.id){ke();const t={};ie.add(t),L={id:e.id,token:t,promise:ft({...e,preload:t}).then(n=>(ie.delete(t),n.type==="loaded"&&n.state.error&&ke(),n)),fork:null}}return L.promise}async function we(e){const t=(await de(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function ut(e,t,n){const r={params:m.params,route:{id:m.route?.id??null},url:new URL(location.href)};m={...e.state,nav:r};const a=document.querySelector("style[data-sveltekit]");if(a&&a.remove(),Object.assign(k,e.props.page),st=new y.root({target:t,props:{...e.props,stores:$,components:oe},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),lt(R),n){const i={from:null,to:{...r,scroll:C[v]??q()},willUnload:!1,type:"enter",complete:Promise.resolve()};W.forEach(o=>o(i))}se=!0}async function le({url:e,params:t,branch:n,errors:r,status:a,error:i,route:o,form:s}){let l="never";if(x&&(e.pathname===x||e.pathname===x+"/"))l="always";else for(const u of n)u?.slash!==void 0&&(l=u.slash);e.pathname=mt(e.pathname,l),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:i,route:o},props:{constructors:jt(n).map(u=>u.node.component),page:qe(k)}};s!==void 0&&(c.props.form=s);let f={},p=!k,w=0;for(let u=0;u<Math.max(n.length,m.branch.length);u+=1){const _=n[u],g=m.branch[u];_?.data!==g?.data&&(p=!0),_&&(f={...f,..._.data},p&&(c.props[`data_${w}`]=f),w+=1)}return(!m.url||e.href!==m.url.href||m.error!==i||s!==void 0&&s!==k.form||p)&&(c.props.page={error:i,params:t,route:{id:o?.id??null},state:{},status:a,url:new URL(e),form:s??null,data:p?f:k.data}),c}async function $e({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let o=null;const s={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();return{node:l,loader:e,server:i,universal:l.universal?.load?{type:"data",data:o,uses:s}:null,data:o??i?.data??null,slash:l.universal?.trailingSlash??i?.slash}}function Ft(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const i=se?St(r,a.href,t):Et(r,t);return{resolved:a,promise:i}}function Gt(e,t,n,r,a,i){if(Pe)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const o of a.search_params)if(r.has(o))return!0;for(const o of a.params)if(i[o]!==m.params[o])return!0;for(const o of a.dependencies)if(ae.some(s=>s(new URL(o))))return!0;return!1}function Ce(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Wt(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),i=t.searchParams.getAll(r);a.every(o=>i.includes(o))&&i.every(o=>a.includes(o))&&n.delete(r)}return n}function Yt({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:qe(k),constructors:[]}}}async function ft({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return ie.delete(L.token),L.promise;const{errors:o,layouts:s,leaf:l}=a,c=[...s,l];o.forEach(g=>g?.().catch(()=>{})),c.forEach(g=>g?.[1]().catch(()=>{}));const f=m.url?e!==ce(m.url):!1,p=m.route?a.id!==m.route.id:!1,w=Wt(m.url,n);let h=!1;const u=c.map(async(g,d)=>{if(!g)return;const E=m.branch[d];return g[1]===E?.loader&&!Gt(h,p,f,w,E.universal?.uses,r)?E:(h=!0,$e({loader:g[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let P=0;P<d;P+=1)Object.assign(O,(await u[P])?.data);return O},server_data_node:Ce(g[0]?{type:"skip"}:null,g[0]?E?.server:void 0)}))});for(const g of u)g.catch(()=>{});const _=[];for(let g=0;g<c.length;g+=1)if(c[g])try{_.push(await u[g])}catch(d){if(d instanceof xe)return{type:"redirect",location:d.location};if(ie.has(i))return Yt({error:await Z(d,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let E=Te(d),S;if(d instanceof Re)S=d.body;else{if(await $.updated.check())return await nt(),await X(n);S=await Z(d,{params:r,url:n,route:{id:a.id}})}const O=await Ht(g,_,o);return O?le({url:n,params:r,branch:_.slice(0,O.idx).concat(O.node),errors:o,status:E,error:S,route:a}):await ht(n,{id:a.id},S,E)}else _.push(void 0);return le({url:n,params:r,branch:_,errors:o,status:200,error:null,route:a,form:t?void 0:null})}async function Ht(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function je({status:e,error:t,url:n,route:r}){const a={};let i=null;try{const o=await $e({loader:ye,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ce(i)}),s={node:await re(),loader:re,universal:null,server:null,data:null};return le({url:n,params:a,branch:[o,s],status:e,error:t,errors:[],route:null})}catch(o){if(o instanceof xe)return ct(new URL(o.location,location.href),{},0);throw o}}async function Jt(e){const t=e.href;if(ee.has(t))return ee.get(t);let n;try{const r=(async()=>{let a=await y.hooks.reroute({url:new URL(e),fetch:async(i,o)=>Ft(i,o,e).promise})??e;if(typeof a=="string"){const i=new URL(e);y.hash?i.hash=a:i.pathname=a,a=i}return a})();ee.set(t,r),n=await r}catch{ee.delete(t);return}return n}async function de(e,t){if(e&&!fe(e,x,y.hash)){const n=await Jt(e);if(!n)return;const r=Xt(n);for(const a of Oe){const i=a.exec(r);if(i)return{id:ce(e),invalidating:t,route:a,params:vt(i),url:e}}}}function Xt(e){return wt(y.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function ce(e){return(y.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function dt({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let o=!1;const s=Ne(m,n,e,t,i??null);r!==void 0&&(s.navigation.delta=r),a!==void 0&&(s.navigation.event=a);const l={...s.navigation,cancel:()=>{o=!0,s.reject(new Error("navigation cancelled"))}};return Q||rt.forEach(c=>c(l)),o?null:s}async function V({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:o={},redirect_count:s=0,nav_token:l={},accept:c=Me,block:f=Me,event:p}){const w=N;N=l;const h=await de(t,!1),u=e==="enter"?Ne(m,h,t,e):dt({url:t,type:e,delta:n?.delta,intent:h,scroll:n?.scroll,event:p});if(!u){f(),N===l&&(N=w);return}const _=v,g=R;c(),Q=!0,se&&u.navigation.type!=="enter"&&$.navigating.set(H.current=u.navigation);let d=h&&await ft(h);if(!d){if(fe(t,x,y.hash))return await X(t,i);d=await ht(t,{id:null},await Z(new Le(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=h?.url||t,N!==l)return u.reject(new Error("navigation aborted")),!1;if(d.type==="redirect"){if(s<20){await V({type:e,url:new URL(d.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:o,redirect_count:s+1,nav_token:l}),u.fulfil(void 0);return}d=await je({status:500,error:await Z(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else d.props.page.status>=400&&await $.updated.check()&&(await nt(),await X(t,i));if(Kt(),Ie(_),it(g),d.props.page.url.pathname!==t.pathname&&(t.pathname=d.props.page.url.pathname),o=n?n.state:o,!n){const b=i?0:1,B={[D]:v+=b,[Y]:R+=b,[Xe]:o};(i?history.replaceState:history.pushState).call(history,B,"",t),i||Vt(v,R)}const E=h&&L?.id===h.id?L.fork:null;L=null,d.props.page.state=o;let S;if(se){const b=(await Promise.all(Array.from(Bt,K=>K(u.navigation)))).filter(K=>typeof K=="function");if(b.length>0){let K=function(){b.forEach(pe=>{W.delete(pe)})};b.push(K),b.forEach(pe=>{W.add(pe)})}const B=u.navigation.to;m={...d.state,nav:{params:B.params,route:B.route,url:B.url}},d.props.page&&(d.props.page.url=t);const he=E&&await E;he?S=he.commit():(M=null,st.$set(d.props),M&&Object.assign(d.props.page,M),zt(d.props.page),S=_t?.()),ot=!0}else await ut(d,be,!1);const{activeElement:O}=document;await S,await te(),await te();let P=null;if(Fe){const b=n?n.scroll:a?q():null;b?scrollTo(b.x,b.y):(P=t.hash&&document.getElementById(pt(t)))?P.scrollIntoView():scrollTo(0,0)}const gt=document.activeElement!==O&&document.activeElement!==document.body;!r&&!gt&&rn(t,!P),Fe=!0,d.props.page&&(M&&Object.assign(d.props.page,M),Object.assign(k,d.props.page)),Q=!1,e==="popstate"&<(R),u.fulfil(void 0),u.navigation.to&&(u.navigation.to.scroll=q()),W.forEach(b=>b(u.navigation)),$.navigating.set(H.current=null)}async function ht(e,t,n,r,a){return e.origin===ue&&e.pathname===location.pathname&&!at?await je({status:r,error:n,url:e,route:t}):await X(e,a)}function Qt(){let e,t={element:void 0,href:void 0},n;I.addEventListener("mousemove",s=>{const l=s.target;clearTimeout(e),e=setTimeout(()=>{i(l,j.hover)},20)});function r(s){s.defaultPrevented||i(s.composedPath()[0],j.tap)}I.addEventListener("mousedown",r),I.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(s=>{for(const l of s)l.isIntersecting&&(we(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(s,l){const c=Ze(s,I),f=c===t.element&&c?.href===t.href&&l>=n;if(!c||f)return;const{url:p,external:w,download:h}=ve(c,x,y.hash);if(w||h)return;const u=ne(c),_=p&&ce(m.url)===ce(p);if(!(u.reload||_))if(l<=u.preload_data){t={element:c,href:c.href},n=j.tap;const g=await de(p,!1);if(!g)return;Mt(g)}else l<=u.preload_code&&(t={element:c,href:c.href},n=l,we(p))}function o(){a.disconnect();for(const s of I.querySelectorAll("a")){const{url:l,external:c,download:f}=ve(s,x,y.hash);if(c||f)continue;const p=ne(s);p.reload||(p.preload_code===j.viewport&&a.observe(s),p.preload_code===j.eager&&we(l))}}W.add(o),o()}function Z(e,t){if(e instanceof Re)return e.body;const n=Te(e),r=Nt(e);return y.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function dn(e,t={}){return e=new URL(Ae(e)),e.origin!==ue?Promise.reject(new Error("goto: invalid URL")):ct(e,t,0)}function Zt(e){if(typeof e=="function")ae.push(e);else{const{href:t}=new URL(e,location.href);ae.push(n=>n.href===t)}}function en(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(We(),!Q){const r=Ne(m,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};rt.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&We()}),navigator.connection?.saveData||Qt(),I.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=Ze(t.composedPath()[0],I);if(!n)return;const{url:r,external:a,target:i,download:o}=ve(n,x,y.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const s=ne(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||o)return;const[c,f]=(y.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=c===ge(location);if(a||s.reload&&(!p||!f)){dt({url:r,type:"link",event:t})?Q=!0:t.preventDefault();return}if(f!==void 0&&p){const[,w]=m.url.href.split("#");if(w===f){if(t.preventDefault(),f===""||f==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const h=n.ownerDocument.getElementById(decodeURIComponent(f));h&&(h.scrollIntoView(),h.focus())}return}if(F=!0,Ie(v),e(r),!s.replace_state)return;F=!1}t.preventDefault(),await new Promise(w=>{requestAnimationFrame(()=>{setTimeout(w,0)}),setTimeout(w,100)}),await V({type:"link",url:r,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??r.href===location.href,event:t})}),I.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const o=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(fe(o,x,!1))return;const s=t.target,l=ne(s);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(s,r);o.search=new URLSearchParams(c).toString(),V({type:"form",url:o,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??o.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Ee){if(t.state?.[D]){const n=t.state[D];if(N={},n===v)return;const r=C[n],a=t.state[Xe]??{},i=new URL(t.state[Pt]??location.href),o=t.state[Y],s=m.url?ge(location)===ge(m.url):!1;if(o===R&&(ot||s)){a!==k.state&&(k.state=a),e(i),C[v]=q(),r&&scrollTo(r.x,r.y),v=n;return}const c=n-v;await V({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{v=n,R=o},block:()=>{history.go(-c)},nav_token:N,event:t})}else if(!F){const n=new URL(location.href);e(n),y.hash&&location.reload()}}}),addEventListener("hashchange",()=>{F&&(F=!1,history.replaceState({...history.state,[D]:++v,[Y]:R},"",location.href))});for(const t of document.querySelectorAll("link"))Dt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&$.navigating.set(H.current=null)});function e(t){m.url=k.url=t,$.page.set(qe(k)),$.page.notify()}}async function tn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:o,data:s,form:l}){at=!0;const c=new URL(location.href);let f;({params:a={},route:i={id:null}}=await de(c,!1)||{}),f=Oe.find(({id:h})=>h===i.id);let p,w=!0;try{const h=r.map(async(_,g)=>{const d=s[g];return d?.uses&&(d.uses=nn(d.uses)),$e({loader:y.nodes[_],url:c,params:a,route:i,parent:async()=>{const E={};for(let S=0;S<g;S+=1)Object.assign(E,(await h[S]).data);return E},server_data_node:Ce(d)})}),u=await Promise.all(h);if(f){const _=f.layouts;for(let g=0;g<_.length;g++)_[g]||u.splice(g,0,void 0)}p=await le({url:c,params:a,branch:u,status:t,error:n,errors:f?.errors,form:l,route:f??null})}catch(h){if(h instanceof xe){await X(new URL(h.location,location.href));return}p=await je({status:Te(h),error:await Z(h,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",w=!1}p.props.page&&(p.props.page.state={}),await ut(p,e,w)}function nn(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let Ee=!1;function rn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=pt(e);if(r&&document.getElementById(r)){const{x:i,y:o}=q();setTimeout(()=>{const s=history.state;Ee=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(s,"",e),t&&scrollTo(i,o),Ee=!1})}else{const i=document.body,o=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),o!==null?i.setAttribute("tabindex",o):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let o=0;o<a.rangeCount;o+=1)i.push(a.getRangeAt(o));setTimeout(()=>{if(a.rangeCount===i.length){for(let o=0;o<a.rangeCount;o+=1){const s=i[o],l=a.getRangeAt(o);if(s.commonAncestorContainer!==l.commonAncestorContainer||s.startContainer!==l.startContainer||s.endContainer!==l.endContainer||s.startOffset!==l.startOffset||s.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function Ne(e,t,n,r,a=null){let i,o;const s=new Promise((c,f)=>{i=c,o=f});return s.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:q()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:s},fulfil:i,reject:o}}function qe(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function an(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function pt(e){let t;if(y.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{fn as a,dn as g,sn as l,k as p,$ as s};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./
|
|
1
|
+
import{s as e}from"./BN1NjBrw.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as r,p as e}from"./
|
|
1
|
+
import{s as r,p as e}from"./BN1NjBrw.js";const a={get params(){return e.params},get url(){return e.url}};r.updated.check;const s=a;export{s as p};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.
|
|
2
|
-
import{_}from"../chunks/PPVm8Dsz.js";import{h as j,k as G,b as H,l as q,m as J,n as K,e as Q,d as k,ab as U,i as W,y as R,Y as X,z as u,ac as Z,ad as $,ae as tt,p as et,_ as rt,a0 as at,u as st,aa as ot,f as b,s as nt,w as it,o as O,c as ct,r as ut,t as _t,B as p}from"../chunks/CZHsSL_X.js";import{B as mt,j as dt,m as lt,u as ft,a as v,c as T,f as w,t as ht,s as vt}from"../chunks/r0JawsZc.js";import{i as A}from"../chunks/B8XegpSE.js";import{p as x,b as D}from"../chunks/Bu1aqm5j.js";function I(s,t,a){var n;j&&(n=W,G());var o=new mt(s);H(()=>{var e=t()??null;if(j){var r=J(n),c=r===U,P=e!==null;if(c!==P){var g=K();Q(g),o.anchor=g,k(!1),o.ensure(e,e&&(f=>a(f,e))),k(!0);return}}o.ensure(e,e&&(f=>a(f,e)))},q)}function gt(s){return class extends yt{constructor(t){super({component:s,...t})}}}class yt{#e;#t;constructor(t){var a=new Map,n=(e,r)=>{var c=tt(r,!1,!1);return a.set(e,c),c};const o=new Proxy({...t.props||{},$$events:{}},{get(e,r){return u(a.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===X?!0:(u(a.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,c){return R(a.get(r)??n(r,c),c),Reflect.set(e,r,c)}});this.#t=(t.hydrate?dt:lt)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&Z(),this.#e=o.$$events;for(const e of Object.keys(this.#t))e==="$set"||e==="$destroy"||e==="$on"||$(this,e,{get(){return this.#t[e]},set(r){this.#t[e]=r},enumerable:!0});this.#t.$set=e=>{Object.assign(o,e)},this.#t.$destroy=()=>{ft(this.#t)}}$set(t){this.#t.$set(t)}$on(t,a){this.#e[t]=this.#e[t]||[];const n=(...o)=>a.call(this,...o);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(o=>o!==n)}}$destroy(){this.#t.$destroy()}}const It={};var Et=w('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),bt=w("<!> <!>",1);function Rt(s,t){et(t,!0);let a=x(t,"components",23,()=>[]),n=x(t,"data_0",3,null),o=x(t,"data_1",3,null);rt(()=>t.stores.page.set(t.page)),at(()=>{t.stores,t.page,t.constructors,a(),t.form,n(),o(),t.stores.page.notify()});let e=O(!1),r=O(!1),c=O(null);st(()=>{const i=t.stores.page.subscribe(()=>{u(e)&&(R(r,!0),ot().then(()=>{R(c,document.title||"untitled page",!0)}))});return R(e,!0),i});const P=p(()=>t.constructors[1]);var g=bt(),f=b(g);{var C=i=>{const m=p(()=>t.constructors[0]);var d=T(),y=b(d);I(y,()=>u(m),(l,h)=>{D(h(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(E,Ot)=>{var L=T(),N=b(L);I(N,()=>u(P),(Y,F)=>{D(F(Y,{get data(){return o()},get form(){return t.form},get params(){return t.page.params}}),z=>a()[1]=z,()=>a()?.[1])}),v(E,L)},$$slots:{default:!0}}),E=>a()[0]=E,()=>a()?.[0])}),v(i,d)},S=i=>{const m=p(()=>t.constructors[0]);var d=T(),y=b(d);I(y,()=>u(m),(l,h)=>{D(h(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),E=>a()[0]=E,()=>a()?.[0])}),v(i,d)};A(f,i=>{t.constructors[1]?i(C):i(S,-1)})}var B=nt(f,2);{var M=i=>{var m=Et(),d=ct(m);{var y=l=>{var h=ht();_t(()=>vt(h,u(c))),v(l,h)};A(d,l=>{u(r)&&l(y)})}ut(m),v(i,m)};A(B,i=>{u(e)&&i(M)})}v(s,g),it()}const Lt=gt(Rt),jt=[()=>_(()=>import("../nodes/0.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.ejabgzDQ.js","../chunks/r0JawsZc.js","../chunks/CZHsSL_X.js","../chunks/CQjSATpv.js","../assets/markdown.Dc-OSJWY.css","../chunks/BN1NjBrw.js","../chunks/CDVSripB.js","../assets/0.BhZOCxO4.css","../nodes/1.BFK7Ubrr.js","../chunks/B8XegpSE.js","../chunks/BOYo8yTr.js","../assets/1.BYutk3aU.css","../nodes/2.DV3saFiY.js","../chunks/B5NAKyil.js","../chunks/Bu1aqm5j.js","../assets/Phone.FQEfwCX2.css","../chunks/UJOiqIYE.js","../chunks/DSU1n5N_.js","../chunks/CSoRdFvv.js","../chunks/DjsDGxCa.js","../chunks/BLszSzTT.js","../assets/2.CAShZ7lQ.css","../nodes/3.3yohCM25.js","../assets/3.DGDHCVnW.css","../nodes/4.D6NIf10D.js","../chunks/CF4lQ45j.js","../assets/4.BFUut--w.css","../nodes/5.g3R-QfIW.js","../chunks/DVkn4r72.js","../assets/ChatView.CwWbzIL-.css","../assets/5.BTOx7yt7.css","../nodes/6.DSpd_nYK.js","../assets/6.eZGZN-BF.css","../nodes/7.F9WBFTz2.js","../chunks/PPVm8Dsz.js","../assets/7.DwS5ZHBh.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_}from"../chunks/PPVm8Dsz.js";import{h as j,k as G,b as H,l as q,m as J,n as K,e as Q,d as k,ab as U,i as W,y as R,Y as X,z as u,ac as Z,ad as $,ae as tt,p as et,_ as rt,a0 as at,u as st,aa as ot,f as b,s as nt,w as it,o as O,c as ct,r as ut,t as _t,B as p}from"../chunks/CZHsSL_X.js";import{B as mt,j as dt,m as lt,u as ft,a as v,c as T,f as w,t as ht,s as vt}from"../chunks/r0JawsZc.js";import{i as A}from"../chunks/B8XegpSE.js";import{p as x,b as D}from"../chunks/Bu1aqm5j.js";function I(s,t,a){var n;j&&(n=W,G());var o=new mt(s);H(()=>{var e=t()??null;if(j){var r=J(n),c=r===U,P=e!==null;if(c!==P){var g=K();Q(g),o.anchor=g,k(!1),o.ensure(e,e&&(f=>a(f,e))),k(!0);return}}o.ensure(e,e&&(f=>a(f,e)))},q)}function gt(s){return class extends yt{constructor(t){super({component:s,...t})}}}class yt{#e;#t;constructor(t){var a=new Map,n=(e,r)=>{var c=tt(r,!1,!1);return a.set(e,c),c};const o=new Proxy({...t.props||{},$$events:{}},{get(e,r){return u(a.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===X?!0:(u(a.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,c){return R(a.get(r)??n(r,c),c),Reflect.set(e,r,c)}});this.#t=(t.hydrate?dt:lt)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&Z(),this.#e=o.$$events;for(const e of Object.keys(this.#t))e==="$set"||e==="$destroy"||e==="$on"||$(this,e,{get(){return this.#t[e]},set(r){this.#t[e]=r},enumerable:!0});this.#t.$set=e=>{Object.assign(o,e)},this.#t.$destroy=()=>{ft(this.#t)}}$set(t){this.#t.$set(t)}$on(t,a){this.#e[t]=this.#e[t]||[];const n=(...o)=>a.call(this,...o);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(o=>o!==n)}}$destroy(){this.#t.$destroy()}}const It={};var Et=w('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),bt=w("<!> <!>",1);function Rt(s,t){et(t,!0);let a=x(t,"components",23,()=>[]),n=x(t,"data_0",3,null),o=x(t,"data_1",3,null);rt(()=>t.stores.page.set(t.page)),at(()=>{t.stores,t.page,t.constructors,a(),t.form,n(),o(),t.stores.page.notify()});let e=O(!1),r=O(!1),c=O(null);st(()=>{const i=t.stores.page.subscribe(()=>{u(e)&&(R(r,!0),ot().then(()=>{R(c,document.title||"untitled page",!0)}))});return R(e,!0),i});const P=p(()=>t.constructors[1]);var g=bt(),f=b(g);{var C=i=>{const m=p(()=>t.constructors[0]);var d=T(),y=b(d);I(y,()=>u(m),(l,h)=>{D(h(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(E,Ot)=>{var L=T(),N=b(L);I(N,()=>u(P),(Y,F)=>{D(F(Y,{get data(){return o()},get form(){return t.form},get params(){return t.page.params}}),z=>a()[1]=z,()=>a()?.[1])}),v(E,L)},$$slots:{default:!0}}),E=>a()[0]=E,()=>a()?.[0])}),v(i,d)},S=i=>{const m=p(()=>t.constructors[0]);var d=T(),y=b(d);I(y,()=>u(m),(l,h)=>{D(h(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),E=>a()[0]=E,()=>a()?.[0])}),v(i,d)};A(f,i=>{t.constructors[1]?i(C):i(S,-1)})}var B=nt(f,2);{var M=i=>{var m=Et(),d=ct(m);{var y=l=>{var h=ht();_t(()=>vt(h,u(c))),v(l,h)};A(d,l=>{u(r)&&l(y)})}ut(m),v(i,m)};A(B,i=>{u(e)&&i(M)})}v(s,g),it()}const Lt=gt(Rt),jt=[()=>_(()=>import("../nodes/0.ejabgzDQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),()=>_(()=>import("../nodes/1.BFK7Ubrr.js"),__vite__mapDeps([8,1,2,9,10,5,6,11]),import.meta.url),()=>_(()=>import("../nodes/2.DV3saFiY.js"),__vite__mapDeps([12,1,2,9,13,3,4,14,15,10,5,16,17,18,19,20,21]),import.meta.url),()=>_(()=>import("../nodes/3.3yohCM25.js"),__vite__mapDeps([22,1,2,9,10,13,3,4,14,15,17,19,23]),import.meta.url),()=>_(()=>import("../nodes/4.D6NIf10D.js"),__vite__mapDeps([24,1,2,9,13,3,4,14,15,10,5,25,16,17,18,19,20,26]),import.meta.url),()=>_(()=>import("../nodes/5.g3R-QfIW.js"),__vite__mapDeps([27,1,2,9,10,13,3,4,14,15,25,5,16,28,29,30]),import.meta.url),()=>_(()=>import("../nodes/6.DSpd_nYK.js"),__vite__mapDeps([31,1,2,9,13,3,4,14,15,10,5,16,17,18,19,20,32]),import.meta.url),()=>_(()=>import("../nodes/7.F9WBFTz2.js"),__vite__mapDeps([33,34,1,2,9,10,13,3,4,14,15,5,6,18,19,28,29,35]),import.meta.url)],kt=[],wt={"/":[2],"/config":[3],"/project":[4],"/session/[id]":[5],"/terminals":[6],"/terminals/[id]":[7]},V={handleError:(({error:s})=>{console.error(s)}),reroute:(()=>{}),transport:{}},Pt=Object.fromEntries(Object.entries(V.transport).map(([s,t])=>[s,t.decode])),Vt=Object.fromEntries(Object.entries(V.transport).map(([s,t])=>[s,t.encode])),Ct=!1,St=(s,t)=>Pt[s](t);export{St as decode,Pt as decoders,wt as dictionary,Vt as encoders,Ct as hash,V as hooks,It as matchers,jt as nodes,Lt as root,kt as server_loads};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as o,a as r}from"../chunks/BN1NjBrw.js";export{o as load_css,r as start};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as j,f as A,s as z,d as H,b as M,g as V,h as W}from"../chunks/r0JawsZc.js";import{t as C,s as i,c as t,r as e,p as I,u as O,w as D,y as f,z as L,o as P}from"../chunks/CZHsSL_X.js";import{a as v,s as T}from"../chunks/CQjSATpv.js";import{g as E}from"../chunks/
|
|
1
|
+
import{a as j,f as A,s as z,d as H,b as M,g as V,h as W}from"../chunks/r0JawsZc.js";import{t as C,s as i,c as t,r as e,p as I,u as O,w as D,y as f,z as L,o as P}from"../chunks/CZHsSL_X.js";import{a as v,s as T}from"../chunks/CQjSATpv.js";import{g as E}from"../chunks/BN1NjBrw.js";import{p as F}from"../chunks/CDVSripB.js";var G=A('<div><span class="status-dot"></span> <span> </span></div>');function J(u,c){function s(a){switch(a){case"degraded":return"Degraded";case"error":return"Offline";case"healthy":return"Online";default:return"Checking"}}function p(a){switch(a){case"degraded":return"degraded";case"error":return"offline";case"healthy":return"online";default:return""}}var n=G(),r=i(t(n),2),d=t(r,!0);e(r),e(n),C((a,h)=>{v(n,1,`status-badge ${a??""}`),z(d,h)},[()=>p(c.status),()=>s(c.status)]),j(u,n)}var K=A('<div class="app"><header class="header"><div class="header-content"><a href="/" class="logo"><img src="/app-icon.png" alt="Shooter" class="logo-icon" width="24" height="24"/> <span class="logo-text">Shooter</span></a> <div class="nav-right svelte-12qhfyh"><!> <button aria-label="Settings"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg></button></div></div></header> <div class="content-area svelte-12qhfyh"><!></div> <nav class="bottom-tabs svelte-12qhfyh"><div class="bottom-tabs-inner svelte-12qhfyh"><a href="/"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path></svg> <span>Projects</span></a> <a href="/terminals"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" y1="19" x2="20" y2="19"></line></svg> <span>Terminals</span></a></div></nav></div>');function Y(u,c){I(c,!0);const s=()=>W(F,"$page",p),[p,n]=V();let r=P("unknown");O(()=>{d();const o=setInterval(()=>{d()},3e4);return()=>{clearInterval(o)}});async function d(){try{const o=await fetch("/api/health");if(!o.ok){f(r,"error");return}const l=await o.json();f(r,l.status==="healthy"||l.status==="degraded"||l.status==="error"?l.status:"unknown",!0)}catch{f(r,"error")}}var a=K(),h=t(a),m=t(h),y=i(t(m),2),k=t(y);J(k,{get status(){return L(r)}});var b=i(k,2);e(y),e(m),e(h);var g=i(h,2),$=t(g);T($,()=>c.children),e(g);var w=i(g,2),_=t(w),x=t(_);let S;var B=i(x,2);let q;e(_),e(w),e(a),C((o,l)=>{v(b,1,`btn-gear ${s().url.pathname==="/config"?"btn-gear-active":""}`,"svelte-12qhfyh"),S=v(x,1,"tab-item svelte-12qhfyh",null,S,o),q=v(B,1,"tab-item svelte-12qhfyh",null,q,l)},[()=>({active:s().url.pathname==="/"||s().url.pathname.startsWith("/project")||s().url.pathname.startsWith("/session")}),()=>({active:s().url.pathname.startsWith("/terminals")})]),M("click",b,()=>E("/config")),j(u,a),D(),n()}H(["click"]);export{Y as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as P,b as x,a as i,g as V,f as q,s as w,h as C,t as d}from"../chunks/r0JawsZc.js";import{F as D,_ as J,a0 as k,I as K,a1 as j,a2 as L,z as S,a3 as M,V as N,a4 as O,p as Q,t as y,w as R,c as f,s as g,x as U,$ as W,r as v}from"../chunks/CZHsSL_X.js";import{i as $}from"../chunks/B8XegpSE.js";import{h as X}from"../chunks/BOYo8yTr.js";import{g as Y}from"../chunks/
|
|
1
|
+
import{d as P,b as x,a as i,g as V,f as q,s as w,h as C,t as d}from"../chunks/r0JawsZc.js";import{F as D,_ as J,a0 as k,I as K,a1 as j,a2 as L,z as S,a3 as M,V as N,a4 as O,p as Q,t as y,w as R,c as f,s as g,x as U,$ as W,r as v}from"../chunks/CZHsSL_X.js";import{i as $}from"../chunks/B8XegpSE.js";import{h as X}from"../chunks/BOYo8yTr.js";import{g as Y}from"../chunks/BN1NjBrw.js";import{p as Z}from"../chunks/CDVSripB.js";function ee(n=!1){const s=D,t=s.l.u;if(!t)return;let p=()=>M(s.s);if(n){let l=0,a={};const m=N(()=>{let c=!1;const u=s.s;for(const o in u)u[o]!==a[o]&&(a[o]=u[o],c=!0);return c&&l++,l});p=()=>S(m)}t.b.length&&J(()=>{G(s,p),j(t.b)}),k(()=>{const l=K(()=>t.m.map(L));return()=>{for(const a of l)typeof a=="function"&&a()}}),t.a.length&&k(()=>{G(s,p),j(t.a)})}function G(n,s){if(n.l.s)for(const t of n.l.s)S(t);s()}O();var te=q('<main class="error-page svelte-1j96wlh"><div class="error-content svelte-1j96wlh"><div class="error-code svelte-1j96wlh"> </div> <h1 class="error-title svelte-1j96wlh"><!></h1> <p class="error-message svelte-1j96wlh"><!></p> <div class="error-actions svelte-1j96wlh"><button class="error-btn svelte-1j96wlh">Go Home</button> <button class="error-btn error-btn-secondary svelte-1j96wlh">Go Back</button></div></div></main>');function ce(n,s){Q(s,!1);const t=()=>C(Z,"$page",p),[p,l]=V();ee();var a=te();X("1j96wlh",e=>{U(()=>{W.title="Error - Shooter"})});var m=f(a),c=f(m),u=f(c,!0);v(c);var o=g(c,2),T=f(o);{var z=e=>{var r=d("Page not found");i(e,r)},A=e=>{var r=d("Something went wrong");i(e,r)};$(T,e=>{t().status===404?e(z):e(A,-1)})}v(o);var h=g(o,2),B=f(h);{var E=e=>{var r=d();y(()=>w(r,t().error.message)),i(e,r)},F=e=>{var r=d("The page you're looking for doesn't exist or has been moved.");i(e,r)},H=e=>{var r=d("An unexpected error occurred. Try refreshing or going back.");i(e,r)};$(B,e=>{t().error?.message?e(E):t().status===404?e(F,1):e(H,-1)})}v(h);var _=g(h,2),b=f(_),I=g(b,2);v(_),v(m),v(a),y(()=>w(u,t().status)),x("click",b,()=>Y("/")),x("click",I,()=>{history.back()}),i(n,a),R(),l()}P(["click"]);export{ce as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f,f as u,s as S}from"../chunks/r0JawsZc.js";import{p as ue,o as g,q as pe,u as he,v as me,w as ge,x as _e,y as r,z as s,$ as ye,c as o,s as d,f as F,A as Ce,r as t,B as q,t as xe}from"../chunks/CZHsSL_X.js";import{i as E}from"../chunks/B8XegpSE.js";import{B as L,a as Se,e as J,i as be,P as Pe,s as $e}from"../chunks/B5NAKyil.js";import{h as je}from"../chunks/BOYo8yTr.js";import{g as Ie}from"../chunks/
|
|
1
|
+
import{a as f,f as u,s as S}from"../chunks/r0JawsZc.js";import{p as ue,o as g,q as pe,u as he,v as me,w as ge,x as _e,y as r,z as s,$ as ye,c as o,s as d,f as F,A as Ce,r as t,B as q,t as xe}from"../chunks/CZHsSL_X.js";import{i as E}from"../chunks/B8XegpSE.js";import{B as L,a as Se,e as J,i as be,P as Pe,s as $e}from"../chunks/B5NAKyil.js";import{h as je}from"../chunks/BOYo8yTr.js";import{g as Ie}from"../chunks/BN1NjBrw.js";import{g as ke,s as we,c as Ae,S as Ee}from"../chunks/UJOiqIYE.js";import{i as Le}from"../chunks/DSU1n5N_.js";import{E as D}from"../chunks/CSoRdFvv.js";import{I as Me}from"../chunks/DjsDGxCa.js";import"../chunks/CQjSATpv.js";import{f as Te}from"../chunks/BLszSzTT.js";var Be=u('<meta name="description" content="Claude Code sessions across all projects"/>'),Re=u("<!> Refresh",1),Ke=u('<div class="loading-container"></div>'),Ne=u('<a class="session-card"><div class="session-card-header"><div><h3 class="session-card-title"> </h3> <div class="session-card-subtitle"> </div></div> <!></div> <div class="session-stats"><span><strong> </strong> </span></div></a>'),Oe=u('<div style="text-align: center; padding: 1rem;"><!></div>'),ze=u('<div class="projects-container svelte-1uha8ag"></div> <!>',1),Fe=u('<main class="main"><div class="page-header svelte-1uha8ag"><div class="page-header-content svelte-1uha8ag"><div><h1 class="page-title svelte-1uha8ag">Projects</h1> <p class="page-description svelte-1uha8ag">Claude Code sessions across all projects</p></div> <div class="page-actions svelte-1uha8ag"><!></div></div></div> <!> <!></main>');function es(G,H){ue(H,!0);const V=1e4,M=20;let n=g(pe([])),p=g(!1),b=!1,h=g(null),C=null,_=g(null),T=g(!1),P=g(0);he(()=>{Z();const e=ke("shooter_projects");e&&(r(n,e,!0),r(p,!1)),x(),C=setInterval(()=>{s(h)?.apiKey&&s(P)<=M&&x()},V)}),me(()=>{C&&(clearInterval(C),C=null)});function Z(){try{const e=localStorage.getItem("shooter_config");if(e){const a=JSON.parse(e);Le(a)?r(h,a,!0):(localStorage.removeItem("shooter_config"),r(h,null))}}catch{}}async function x(e=!1,a=!1){if(!s(h)?.apiKey||b)return;b=!0,s(n).length===0&&r(p,!0);const l=e?s(P):0;try{const y=await fetch(`${a?"/api/sessions?refresh=true&":"/api/sessions?"}limit=${M}&offset=${l}`,{headers:{Authorization:`Bearer ${s(h).apiKey}`}});if(!y.ok){r(_,`Failed to load projects (HTTP ${y.status})`);return}r(_,null);const i=await y.json();e?r(n,[...s(n),...i.projects],!0):r(n,i.projects,!0),r(P,s(n).length,!0),r(T,i.total!==void 0?s(n).length<i.total:!1,!0),we("shooter_projects",s(n))}catch(v){r(_,"Failed to load projects"),console.error("Failed to fetch sessions:",v)}finally{r(p,!1),b=!1}}async function Q(){await x(!0)}async function U(){r(p,!0),Ae("shooter_projects"),await x(!1,!0)}function W(){Ie("/config")}function X(){return s(n).reduce((e,a)=>e+a.sessionCount,0)}var $=Fe();je("1uha8ag",e=>{var a=Be();_e(()=>{ye.title="Projects - Shooter"}),f(e,a)});var j=o($),B=o(j),R=d(o(B),2),Y=o(R);L(Y,{classes:"btn-secondary",onclick:U,get disabled(){return s(p)},children:(e,a)=>{var l=Re(),v=F(l);Me(v,{name:"refresh",size:14}),Ce(),f(e,l)},$$slots:{default:!0}}),t(R),t(B),t(j);var K=d(j,2);{var ee=e=>{Se(e,{get text(){return s(_)},classes:"banner-error"})};E(K,e=>{s(_)&&e(ee)})}var se=d(K,2);{var ae=e=>{var a=Ke();J(a,20,()=>Array(5),be,(l,v)=>{Ee(l,{classes:"shimmer-card"})}),t(a),f(e,a)},te=e=>{D(e,{icon:"settings",title:"Configuration Required",description:"Set up your API credentials to start tracking sessions",children:(a,l)=>{L(a,{classes:"btn-primary",onclick:W,text:"Configure Settings"})}})},re=e=>{D(e,{icon:"bell",title:"No sessions yet",description:"Claude Code sessions will appear here once JSONL files are found"})},oe=q(()=>X()===0),ie=e=>{var a=ze(),l=F(a);J(l,21,()=>s(n),i=>i.id,(i,c)=>{var m=Ne(),I=o(m),k=o(I),w=o(k),ne=o(w,!0);t(w);var N=d(w,2),le=o(N,!0);t(N),t(k);var ce=d(k,2);{let fe=q(()=>Te(s(c).lastModified));Pe(ce,{get text(){return`Last updated ${s(fe)??""}`},classes:"pill-session-time"})}t(I);var O=d(I,2),z=o(O),A=o(z),de=o(A,!0);t(A);var ve=d(A);t(z),t(O),t(m),xe(()=>{$e(m,"href",`/project?id=${s(c).id??""}`),S(ne,s(c).name),S(le,s(c).fullPath),S(de,s(c).sessionCount),S(ve,` ${s(c).sessionCount===1?"session":"sessions"}`)}),f(i,m)}),t(l);var v=d(l,2);{var y=i=>{var c=Oe(),m=o(c);L(m,{classes:"btn-secondary",onclick:Q,text:"Load More"}),t(c),f(i,c)};E(v,i=>{s(T)&&i(y)})}f(e,a)};E(se,e=>{s(p)&&s(n).length===0?e(ae):s(h)?.apiKey?s(oe)?e(re,2):e(ie,-1):e(te,1)})}t($),f(G,$),ge()}export{es as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u,f as p,s as b}from"../chunks/r0JawsZc.js";import{p as Qe,o as w,q as We,u as Xe,v as Ye,w as et,D as tt,z as e,y as c,$ as at,c as n,s as l,r as o,B as f,f as L,A as Q,t as W}from"../chunks/CZHsSL_X.js";import{i as j}from"../chunks/B8XegpSE.js";import{a as st,e as de,i as rt,B as N,P as D,s as ot}from"../chunks/B5NAKyil.js";import{h as nt}from"../chunks/BOYo8yTr.js";import{g as it}from"../chunks/
|
|
1
|
+
import{a as u,f as p,s as b}from"../chunks/r0JawsZc.js";import{p as Qe,o as w,q as We,u as Xe,v as Ye,w as et,D as tt,z as e,y as c,$ as at,c as n,s as l,r as o,B as f,f as L,A as Q,t as W}from"../chunks/CZHsSL_X.js";import{i as j}from"../chunks/B8XegpSE.js";import{a as st,e as de,i as rt,B as N,P as D,s as ot}from"../chunks/B5NAKyil.js";import{h as nt}from"../chunks/BOYo8yTr.js";import{g as it}from"../chunks/BN1NjBrw.js";import{p as ct}from"../chunks/CF4lQ45j.js";import{g as lt,s as dt,S as ve,c as vt}from"../chunks/UJOiqIYE.js";import{i as ut}from"../chunks/DSU1n5N_.js";import{E as ue}from"../chunks/CSoRdFvv.js";import{I as ft}from"../chunks/DjsDGxCa.js";import"../chunks/CQjSATpv.js";import{f as pt}from"../chunks/BLszSzTT.js";var mt=p('<meta name="description" content="Project sessions sorted by latest update"/>'),ht=p('<div class="loading-container"><!> <!></div>'),_t=p('<div class="project-back-row svelte-urn6fi"><a href="/" class="back-link"><span class="back-arrow">←</span> Back to Projects</a></div> <!>',1),gt=p("<!> Refresh",1),yt=p('<div class="session-card-subtitle"> </div>'),bt=p('<span class="connect-dot svelte-urn6fi"></span> Connect',1),jt=p('<a class="session-card"><div class="session-card-header"><div><h3 class="session-card-title"> </h3> <!></div> <div class="session-card-actions svelte-urn6fi"><!> <!></div></div> <div class="session-stats"><span><strong> </strong> messages</span> <!> <!></div> <div class="session-meta-row svelte-urn6fi"><span class="session-modified svelte-urn6fi"> </span> <span class="session-duration svelte-urn6fi"> </span></div></a>'),$t=p('<div style="text-align: center; padding: 1rem;"><!></div>'),Pt=p('<div class="sessions-container svelte-urn6fi"></div> <!>',1),xt=p('<div class="chat-session-header"><div class="chat-session-header-top svelte-urn6fi"><a href="/" class="back-link">← Back to Projects</a> <!></div> <h1 class="chat-session-title"> </h1> <div class="chat-session-meta"><span class="session-card-subtitle"> </span> <span> </span></div></div> <!>',1),St=p('<main class="main"><!> <!></main>');function Mt(fe,pe){Qe(pe,!0);const me=15e3,R=20;let i=w(null),g=w(!0),m=w(null),E=w(null),K=null,k=w(R),X=w(We([])),$=w(null);const P=f(()=>ct.url.searchParams.get("id")||""),he=f(()=>e(i)?e(i).sessions.slice(0,e(k)):[]),_e=f(()=>e(i)?e(k)<e(i).sessions.length:!1),ge=f(()=>new Set(e(X).filter(t=>t.sessionId).map(t=>t.sessionId)));Xe(()=>{ye();const t=lt(`shooter_project_${e(P)}`);t&&(c(i,t,!0),c(g,!1)),setTimeout(()=>{z(),M()},50),K=setInterval(()=>{e(m)?.apiKey&&e(P)&&(z(),M())},me)}),Ye(()=>{K&&(clearInterval(K),K=null)});function ye(){try{const t=localStorage.getItem("shooter_config");if(t){const a=JSON.parse(t);ut(a)?c(m,a,!0):(localStorage.removeItem("shooter_config"),c(m,null))}}catch{}}async function z(t=!1){if(!e(m)?.apiKey||!e(P)){c(g,!1);return}e(i)||c(g,!0);try{const d=await fetch(t?"/api/sessions?refresh=true":"/api/sessions",{headers:{Authorization:`Bearer ${e(m).apiKey}`}});if(!d.ok){c(E,`Failed to load project (HTTP ${d.status})`),c(g,!1);return}c(E,null);const h=(await d.json()).projects.find(C=>C.id===e(P))||null;c(i,h,!0),h&&dt(`shooter_project_${e(P)}`,h)}catch(a){console.error("Failed to fetch project:",a)}finally{c(g,!1)}}async function M(){if(e(m)?.apiKey)try{const t=await fetch("/api/sessions/detect",{headers:{Authorization:`Bearer ${e(m).apiKey}`}});if(t.ok){const a=await t.json();c(X,a.processes,!0)}}catch{}}async function Y(t,a,d){if(t.preventDefault(),t.stopPropagation(),!(!e(m)?.apiKey||!e(i)||e($))){c($,a,!0);try{const v=await fetch("/api/sessions/connect",{body:JSON.stringify({command:d,cwd:e(i).fullPath,sessionId:a}),headers:{Authorization:`Bearer ${e(m).apiKey}`,"Content-Type":"application/json"},method:"POST"});if(v.ok){const h=await v.json();it(`/terminals/${h.terminalId}`)}}catch(v){console.error("Failed to connect to session:",v)}finally{c($,null)}}}async function be(){c(g,!0),c(i,null),c(k,R),vt(`shooter_project_${e(P)}`),await z(!0),await M()}function je(){c(k,e(k)+R)}function ee(t){if(!t)return"";const a=new Date(t);return isNaN(a.getTime())?"":a.toLocaleDateString("en-US",{day:"numeric",hour:"2-digit",minute:"2-digit",month:"short"})}function $e(t,a){return t.length<=a?t:`${t.slice(0,a).trimEnd()}...`}var O=St();nt("urn6fi",t=>{var a=mt();tt(()=>{at.title=`${(e(i)?.name||"Project")??""} - Shooter`}),u(t,a)});var te=n(O);{var Pe=t=>{st(t,{get text(){return e(E)},classes:"banner-error"})};j(te,t=>{e(E)&&t(Pe)})}var xe=l(te,2);{var Se=t=>{var a=ht(),d=n(a);ve(d,{classes:"shimmer-header"});var v=l(d,2);de(v,16,()=>Array(4),rt,(h,C)=>{ve(h,{classes:"shimmer-card"})}),o(a),u(t,a)},we=t=>{var a=_t(),d=l(L(a),2);ue(d,{icon:"alert-triangle",title:"Project Not Found",description:"The requested project could not be found."}),u(t,a)},ke=t=>{var a=xt(),d=L(a),v=n(d),h=l(n(v),2);N(h,{classes:"btn-secondary",onclick:be,get disabled(){return e(g)},children:(y,q)=>{var I=gt(),J=L(I);ft(J,{name:"refresh",size:14}),Q(),u(y,I)},$$slots:{default:!0}}),o(v);var C=l(v,2),Ce=n(C,!0);o(C);var ae=l(C,2),F=n(ae),Ie=n(F,!0);o(F);var se=l(F,2),Be=n(se);o(se),o(ae),o(d);var Te=l(d,2);{var Ae=y=>{ue(y,{icon:"bell",title:"No sessions yet",description:"Sessions for this project will appear here"})},Ee=y=>{var q=Pt(),I=L(q);de(I,21,()=>e(he),x=>x.id,(x,r)=>{var B=jt(),T=n(B),G=n(T),H=n(G),Le=n(H,!0);o(H);var Ne=l(H,2);{var De=s=>{var _=yt(),A=n(_,!0);o(_),W(S=>b(A,S),[()=>$e(e(r).summary,80)]),u(s,_)};j(Ne,s=>{e(r).summary&&s(De)})}o(G);var re=l(G,2),oe=n(re);{let s=f(()=>pt(e(r).modified));D(oe,{get text(){return e(s)},classes:"pill-session-time"})}var Re=l(oe,2);{var ze=s=>{{let _=f(()=>e($)===e(r).id),A=f(()=>e($)===e(r).id);N(s,{classes:"btn-connect btn-xs",onclick:S=>Y(S,e(r).id,e(r).source==="opencode"?"opencode":"claude"),get disabled(){return e(_)},get showLoader(){return e(A)},children:(S,wt)=>{var Ze=bt();Q(),u(S,Ze)},$$slots:{default:!0}})}},Me=f(()=>e(ge).has(e(r).id)),Oe=s=>{{let _=f(()=>e($)===e(r).id),A=f(()=>e($)===e(r).id);N(s,{classes:"btn-resume btn-xs",onclick:S=>Y(S,e(r).id,e(r).source==="opencode"?"opencode":"claude"),get disabled(){return e(_)},get showLoader(){return e(A)},text:"Resume"})}};j(Re,s=>{e(Me)?s(ze):s(Oe,-1)})}o(re),o(T);var U=l(T,2),V=n(U),ne=n(V),Fe=n(ne,!0);o(ne),Q(),o(V);var ie=l(V,2);{var qe=s=>{D(s,{get text(){return`🌿 ${e(r).gitBranch??""}`},classes:"pill-git-branch"})};j(ie,s=>{e(r).gitBranch&&s(qe)})}var Je=l(ie,2);{var Ge=s=>{D(s,{text:"OpenCode",classes:"pill-source-opencode"})},He=s=>{D(s,{text:"Claude Code",classes:"pill-source-claude"})};j(Je,s=>{e(r).source==="opencode"?s(Ge):s(He,-1)})}o(U);var ce=l(U,2),Z=n(ce),Ue=n(Z);o(Z);var le=l(Z,2),Ve=n(le);o(le),o(ce),o(B),W((s,_)=>{ot(B,"href",`/session/${e(r).id??""}?project=${e(P)??""}`),b(Le,e(r).title),b(Fe,e(r).messageCount),b(Ue,`Last updated ${s??""}`),b(Ve,`Created ${_??""}`)},[()=>ee(e(r).modified),()=>ee(e(r).created)]),u(x,B)}),o(I);var J=l(I,2);{var Ke=x=>{var r=$t(),B=n(r);{let T=f(()=>`Load More (${e(i).sessions.length-e(k)} remaining)`);N(B,{classes:"btn-secondary",onclick:je,get text(){return e(T)}})}o(r),u(x,r)};j(J,x=>{e(_e)&&x(Ke)})}u(y,q)};j(Te,y=>{e(i).sessions.length===0?y(Ae):y(Ee,-1)})}W(()=>{b(Ce,e(i).name),b(Ie,e(i).fullPath),b(Be,`${e(i).sessionCount??""} sessions`)}),u(t,a)};j(xe,t=>{e(g)&&!e(i)?t(Se):e(i)?t(ke,-1):t(we,1)})}o(O),u(fe,O),et()}export{Mt as component};
|
|
Binary file
|
|
Binary file
|