@deepseek-insight/dsi 0.11.3 → 0.11.4

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.
Files changed (36) hide show
  1. package/.agents/skills/dsi-plugin-rack/SKILL.md +5 -0
  2. package/.agents/skills/dsi-skill-shelf/SKILL.md +5 -0
  3. package/.agents/skills/glass-dsh/DESIGN.md +36 -0
  4. package/.agents/skills/glass-dsh/SKILL.md +112 -0
  5. package/.agents/skills/glass-dsh/scripts/_connect.mjs +120 -0
  6. package/.agents/skills/glass-dsh/scripts/gesture.mjs +98 -0
  7. package/.agents/skills/glass-dsh/scripts/glass-dsh.mjs +63 -0
  8. package/.agents/skills/glass-dsh/scripts/probe-dsh.mjs +59 -0
  9. package/build/client/_app/immutable/chunks/{DAFsxYyZ.js → BQI9wyZo.js} +1 -1
  10. package/build/client/_app/immutable/chunks/C-zV0ulT.js +1 -0
  11. package/build/client/_app/immutable/chunks/C2MzPOYY.js +2 -0
  12. package/build/client/_app/immutable/chunks/DQy5rtST.js +1 -0
  13. package/build/client/_app/immutable/entry/{app.B3Jpw67t.js → app.CaHTeMGs.js} +2 -2
  14. package/build/client/_app/immutable/entry/start.D9CL1tVI.js +1 -0
  15. package/build/client/_app/immutable/nodes/{1.DbxOgdbH.js → 1.AoWxyOCL.js} +1 -1
  16. package/build/client/_app/immutable/nodes/{2.bJkyxVXf.js → 2.BiOhzV1A.js} +2 -2
  17. package/build/client/_app/version.json +1 -1
  18. package/build/handler.js +4 -4
  19. package/build/index.js +4 -4
  20. package/build/server/chunks/chunks/{internal2.js-B5x__0aq.js → internal2.js-y5mpUnMs.js} +2 -2
  21. package/build/server/chunks/chunks/{state.js-DsQO24cN.js → state.js-DgYQBCjR.js} +2 -2
  22. package/build/server/chunks/entries/pages/{_error.svelte.js-DImBUaQF.js → _error.svelte.js-BIJ7nQ2M.js} +3 -3
  23. package/build/server/chunks/entries/pages/{_page.svelte.js-CO5I0GZ2.js → _page.svelte.js-u9R9oLkN.js} +4 -4
  24. package/build/server/chunks/{handler-veh0A37V.js → handler-B33Zuq6Y.js} +3 -3
  25. package/build/server/chunks/{index.js-D63-CxtE.js → index.js-_yRI545U.js} +2 -2
  26. package/build/server/chunks/{manifest.js-DJgcuJpZ.js → manifest.js-mKEDDCRk.js} +4 -4
  27. package/build/server/chunks/nodes/1.js-Cw3CxJ6F.js +9 -0
  28. package/build/server/chunks/nodes/{2.js-BoWRQ_XI.js → 2.js-qAWSZ3SP.js} +3 -3
  29. package/package.json +1 -1
  30. package/template/.dsi/prompts.sqlite-shm +0 -0
  31. package/template/.dsi/prompts.sqlite-wal +0 -0
  32. package/build/client/_app/immutable/chunks/B5lb1z82.js +0 -1
  33. package/build/client/_app/immutable/chunks/CWAff5t1.js +0 -1
  34. package/build/client/_app/immutable/chunks/ClnxU8JH.js +0 -2
  35. package/build/client/_app/immutable/entry/start.BEEYbYm7.js +0 -1
  36. package/build/server/chunks/nodes/1.js-BPYsraeg.js +0 -9
@@ -1,3 +1,8 @@
1
+ ---
2
+ name: dsi-plugin-rack
3
+ description: Use when asked to install or uninstall a dsh plugin from the plugins reference (~/.dsi/resources/plugins-reff.md) — dsh-delegated apply via rack.mjs, snapshot-first cache, manifest-recorded removes per the Plugin Rack ADR. Reserved keyword /dsi-plugin-rack.
4
+ ---
5
+
1
6
  # dsi-plugin-rack
2
7
 
3
8
  Install and uninstall dsh plugins from the plugins reference (~/.dsi/resources/plugins-reff.md), cached at ~/.dsi/resources/pgr-cache.json. Implements the ADR "The Plugin Rack" (dev/architectural-decission/2026-09/, 2026-09-27).
@@ -1,3 +1,8 @@
1
+ ---
2
+ name: dsi-skill-shelf
3
+ description: Use when asked to install or uninstall agent skills from the SKR reference (~/.dsi/resources/skills-reff.md) — signed installs and signature-gated uninstalls via shelf.mjs, unstable tier opt-in, collision abort, per the Skill Shelf ADR. Reserved keyword /dsi-skill-shelf.
4
+ ---
5
+
1
6
  # dsi-skill-shelf
2
7
 
3
8
  Install and uninstall agent skills from the SKR reference (`~/.dsi/resources/skills-reff.md`). Implements the ADR 'The Skill Shelf' (dev/architectural-decission/2026-09/, 2026-09-20).
@@ -0,0 +1,36 @@
1
+ # glass-dsh — short design (approved 2026-11-09)
2
+
3
+ **Intent.** One skill that owns the creator-mode verification loop for a new DSH
4
+ web-UI plugin: install → probe → real gestures → persistence → restore, ending in
5
+ a gate report the operator can trust. Plugin craft stays in the harness's
6
+ `cordis-plugin-development` skill.
7
+
8
+ **Approaches considered** (operator decision 2026-11-09, recorded in ADR-0045
9
+ Amendment 6 D12–D15):
10
+ - *Full creator loop* (chosen) vs verification-only half — the operator picked the loop.
11
+ - *Own driver scripts* (chosen) vs reusing glass-dsi's `_connect.mjs` — decoupling beats
12
+ shared-drift risk at this size (accepted duplication, D1/D12 give-up).
13
+ - *Repo `skills/` folder* (chosen, operator override) + `~/.agents/skills/` mirror for
14
+ the slash menu — same pattern as every DSI skill.
15
+ - *Probe-then-env port resolution* (chosen, D13): `--dsh-url`/`--dsh-port` argument >
16
+ `DSH_PORT` env > default `3080`; CLI `--port` applies at boot, so the env/arg the agent
17
+ sees is authoritative — stated first in SKILL.md.
18
+
19
+ **Goals.** Five machine-checkable gates (console baseline, origin tab pick, real
20
+ gestures with control assertions, localStorage persistence, state restore) runnable
21
+ against any slot-rendering DSH plugin with plugin-supplied selectors.
22
+
23
+ **Non-goals.** No plugin authoring; no DSI-surface verification (glass-dsi); no
24
+ foreign URLs (glass-url); no changes to sibling glass skills; no synthetic-event
25
+ "testing" (D15); no state files (the floor registry is the only truth, ADR-0030).
26
+
27
+ **Constraints.** playwright-core resolves only from the DSI repo root; the glass
28
+ session is claimed by harness-session identity or refused loudly (D7); a failing
29
+ gate ends the run with a report (D11 stop-loss).
30
+
31
+ **Left to the builder.** Per-plugin selectors and store keys come from the plugin's
32
+ own client module; the gesture composition (which verbs, which order) is the
33
+ calling agent's judgment inside the gates.
34
+
35
+ **Status:** built and gate-verified on the live sticky-notes plugin 2026-11-09 —
36
+ see completion notes in the spec folder.
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: glass-dsh
3
+ description: "Use when a newly created DSH web-UI plugin (plugin_manager returned application=applied) must be verified live on the DSH page of the operator's glass browser — probe, real gestures, persistence and restore gates per ADR-0045. NOT for DSI's own workspace surface (that is glass-dsi) or arbitrary foreign URLs (that is glass-url). Reserved keyword /glass-dsh."
4
+ ---
5
+
6
+ # glass-dsh — verify a new DSH web-UI plugin on the operator's glass, creator mode
7
+
8
+ Use when you just created and installed a **DSH web-UI plugin** (`plugin_manager`
9
+ returned `application: applied`) and must prove it live on the glass browser —
10
+ the surface at the DSH GUI (`http://127.0.0.1:3080/` by default). This skill owns
11
+ the full creator loop's verification half: the plugin CRAFT itself (manifest,
12
+ locale, icon, slot choice) belongs to the harness's `cordis-plugin-development`
13
+ skill — defer to it first, then run THIS skill.
14
+
15
+ **Dispatch rule (ADR-0045 Amendment 6, the three hands):**
16
+ - Verifying DSI's own workspace surface → `glass-dsi` (its driver DIES without a
17
+ DSI tab; it cannot verify DSH work — observed live 2026-11-09).
18
+ - Driving an arbitrary foreign URL → `glass-url` (opens a NEW tab; never touches
19
+ the DSI tab).
20
+ - Verifying a newly created **DSH plugin** on the DSH page → **this skill**.
21
+
22
+ ## The law (every gate cites ADR-0045)
23
+
24
+ 1. **The registry is the only way in.** Never launch your own browser; never
25
+ POST your own glass session (orphans can never be adopted — the operator must
26
+ click the Browser chip). ADR-0030.
27
+ 2. **The glass is claimed by identity, never by index.** `_connect.mjs`
28
+ resolves `--owner-session` flag > `GLASS_OWNER_SESSION` > `DSH_SESSION_ID`;
29
+ multiple glasses with no match = loud refusal. D7.
30
+ 3. **The DSH tab is picked by ORIGIN compare, never a port substring.** D13.
31
+ 4. **Console-error baseline (Gate 0) before any gesture.** A
32
+ `slot entry crashed in '<slot>'` naming your plugin is an automatic FAIL with
33
+ the stack in the report — element presence alone verifies nothing (observed
34
+ live: the only signal of a dead plugin was the console crash). D14.
35
+ 5. **Real gestures only; every read gates on a control.** `page.mouse` /
36
+ `page.keyboard` with stepped moves; synthetic `dispatchEvent` is not
37
+ verification. Assert the gesture moved what it should before reading
38
+ counters. D15. Failure branches live in §gates below.
39
+ 6. **A refusal is an answer; stop-loss.** A failing gate ENDS the run with a
40
+ report — no improvised fixes beyond the plugin under test. D11.
41
+ 7. **Restore user state.** Clear and label anything you seeded. Gate 5.
42
+
43
+ ## DSH base resolution (probe then env; D13)
44
+
45
+ Order: explicit argument > environment > default.
46
+
47
+ 1. `--dsh-url <url>` or `--dsh-port <n>` argument (highest).
48
+ 2. `DSH_PORT` env — note: when the floor was booted with the CLI `--port` flag
49
+ it wins over the env at boot time, so if the operator booted with `--port`
50
+ but exported no `DSH_PORT`, ONLY the explicit argument form can find the
51
+ tab; state which source resolved the base in the report.
52
+ 3. Default `http://127.0.0.1:3080/`.
53
+
54
+ The floor registry (glass sessions) is resolved separately: `DSI_UI` env when
55
+ set, else probe `5175` then `5174` (`/api/browser`). A floor stamps its own
56
+ addresses at boot — agents in a floor's conversations drive that floor's glass.
57
+
58
+ ## Environment contract (D6)
59
+
60
+ - Run `node skills/glass-dsh/scripts/*.mjs` from the **DSI repo root** so
61
+ `playwright-core` resolves; plain node ESM, no build step.
62
+ - Every verb prints ONE JSON verdict on stdout and exits 0/1; failures print
63
+ `{"error": ...}` via `die()` — a refusal is an answer, quote it.
64
+ - No state files between runs: every run re-derives session and tab from the
65
+ registry and the resolved origin.
66
+
67
+ ## The loop (creator mode)
68
+
69
+ 1. **Install** — via the harness `plugin_manager` (`install_bundle`; replacing
70
+ an installed package = `remove_bundle` then `install_bundle` again —
71
+ observed 2026-11-09). This skill starts when `application: applied`.
72
+ 2. **Probe (Gates 0–2)** —
73
+ `node skills/glass-dsh/scripts/probe-dsh.mjs --expect '<selector>' --store '<localStorageKey>'`
74
+ → reloads the DSH tab, arms the console listener, emits
75
+ `{launcherProbe, consoleErrors, crashedSlots, moduleLoader}`.
76
+ 3. **Gestures (Gates 3–4)** — one verb per process, composition in your hands:
77
+ `glass-dsh.mjs eval --b64` for reads, `gesture.mjs click|type|drag|control|persist`
78
+ for real input. Each verb prints `{before, after, moved}` — quote the pair.
79
+ 4. **Restore (Gate 5)** — clear seeded state via the page's own store, reload,
80
+ re-probe: launcher present, console clean, store empty.
81
+ 5. **Report** — table of before/after numbers, the gesture that produced them,
82
+ gates passed/failed, what was seeded and cleared.
83
+
84
+ ## Gates (machine-checkable)
85
+
86
+ | Gate | Asserts | Verb |
87
+ |---|---|---|
88
+ | 0 | glass session exists, owned by you | `probe-dsh.mjs` (dies loudly otherwise) |
89
+ | 1 | DSH tab found by origin | `glass-dsh.mjs pages` (origin classification) |
90
+ | 2 | console baseline clean of the plugin's slot crash | `probe-dsh.mjs` (`crashedSlots`) |
91
+ | 3 | real gesture moved its control | `gesture.mjs` (`moved: true` + control expr) |
92
+ | 4 | persistence via the plugin's own store | `gesture.mjs persist` before/after reload |
93
+ | 5 | state restored | `probe-dsh.mjs` re-run after cleanup |
94
+
95
+ ## Failure branches (the 2026-11-09 sticky-notes incidents)
96
+
97
+ | Symptom | Root cause | Remedy |
98
+ |---|---|---|
99
+ | Plugin entry absent, console has `slot entry crashed in '<slot>': TypeError ...` | a thrown factory/component blanks the slot entry | Gate 2 FAIL → fix the plugin module, reinstall, re-probe |
100
+ | Click on element X times out: `X ... subtree intercepts pointer events` | another plugin element covers the target (stacked notes) | drag the covering element aside first, or click the TOPMOST instance (`.last()`); then report the overlap as a plugin defect |
101
+ | Click "succeeds" but the button's handler never fires | an ancestor's `setPointerCapture` on pointerdown retargets the derived click | plugin defect: skip capture when `e.target.closest('button')` |
102
+ | Drag moved nothing but gates "pass" | geometry lied or the drag clamped at viewport bounds | control gate (`moved: true`) is mandatory before reading counters; fix coordinates inside the container |
103
+ | `no glass ...` / multiple glasses | no panel, or foreign ownership | operator clicks the Browser chip in THIS conversation; `--owner-session <id>` if env lacks identity |## Reserved keys
104
+
105
+ Plugin selectors and localStorage keys are plugin-owned (read them from the
106
+ plugin's client module — e.g. sticky-notes uses `.sticky-notes-launcher` and
107
+ `dsh-sticky-notes:v1`). This skill hardcodes none.
108
+
109
+ ---
110
+ Driver scripts: `scripts/_connect.mjs` (header lists exports), `scripts/glass-dsh.mjs`,
111
+ `scripts/probe-dsh.mjs`, `scripts/gesture.mjs`.
112
+ Companions: ADR-0045 Amendment 6; spec `dev/specs/2026-11/2026-11-09 - Glass DSH Skill/`.
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * _connect.mjs — shared glass connection for the glass-dsh driver (skills/glass-dsh).
4
+ * Dated copy 2026-11-09; derived from glass-dsi's helper (ADR-0045 D1/D12 —
5
+ * accepted duplication, each copy dated and attributed).
6
+ *
7
+ * EXPORTS (do not guess — this header is the contract):
8
+ * die(msg) — print a JSON error and exit 1.
9
+ * identityFrom(argv) — caller identity, first-wins: --owner-session flag
10
+ * > GLASS_OWNER_SESSION > DSH_SESSION_ID env.
11
+ * pickSession(sessions, envId)
12
+ * — PURE D7 resolver: match identity to ownerSessionId;
13
+ * NEVER a registry index. { session } | { session:null, error }.
14
+ * resolveDsiBase({env, fetchImpl, timeoutMs})
15
+ * — the floor that owns the registry: DSI_UI env wins,
16
+ * else probe http://127.0.0.1:5175 then :5174 (/api/browser).
17
+ * Returns { base, reg }; dies loudly when no floor answers.
18
+ * resolveDshBase(argv, env)
19
+ * — the DSH surface to verify (D13, probe-then-env):
20
+ * --dsh-url / --dsh-port argument > DSH_PORT env >
21
+ * default http://127.0.0.1:3080. Returns origin string.
22
+ * connect(argv) — resolveDsiBase → pickSession → chromium.connectOverCDP
23
+ * → { session, browser, ctx, floorBase, dshOrigin }.
24
+ * Dies loudly on ambiguity (D7) or CDP failure.
25
+ * pickByOrigin(ctx, origin) — the page whose URL ORIGIN equals `origin`
26
+ * (never a port substring, never positional). Dies when
27
+ * absent, naming the resolved origin.
28
+ */
29
+ import { chromium } from 'playwright-core';
30
+
31
+ const DEFAULT_FLOOR_BASES = ['http://127.0.0.1:5175', 'http://127.0.0.1:5174'];
32
+
33
+ export function die(msg) {
34
+ console.error(JSON.stringify({ error: msg }));
35
+ process.exit(1);
36
+ }
37
+
38
+ export function identityFrom(argv) {
39
+ const flag = argv.indexOf('--owner-session');
40
+ if (flag !== -1 && argv[flag + 1]) return argv[flag + 1];
41
+ if (process.env.GLASS_OWNER_SESSION) return process.env.GLASS_OWNER_SESSION;
42
+ if (process.env.DSH_SESSION_ID) return process.env.DSH_SESSION_ID;
43
+ return undefined;
44
+ }
45
+
46
+ export function pickSession(sessions, envId) {
47
+ const list = sessions ?? [];
48
+ if (envId) {
49
+ const mine = list.filter((s) => (s.ownerSessionId ?? null) === envId);
50
+ if (mine.length === 1) return { session: mine[0], degraded: false };
51
+ if (mine.length > 1) {
52
+ const newest = [...mine]
53
+ .sort((a, b) => String(a.createdAt ?? '').localeCompare(String(b.createdAt ?? '')))
54
+ .at(-1);
55
+ return { session: newest, degraded: false, note: 'multiple glasses owned by ' + envId + ' — newest wins' };
56
+ }
57
+ if (list.length === 1 && (list[0].ownerSessionId ?? null) === null) {
58
+ return { session: list[0], degraded: true, note: 'legacy session without ownerSessionId — degraded match' };
59
+ }
60
+ return { session: null, error: 'no glass owned by ' + envId + ' — your glass is dead or never summoned (the operator clicks the Browser chip in THIS conversation); live glasses belong to other conversations and are untouchable (D7)' };
61
+ }
62
+ if (list.length === 1) {
63
+ return { session: list[0], degraded: true, note: 'no explicit identity in env — degraded single-session resolution' };
64
+ }
65
+ return { session: null, error: 'multiple live glasses and no explicit identity — pass --owner-session <id>; refusing to guess (D7)' };
66
+ }
67
+
68
+ export async function resolveDsiBase({ env = process.env, fetchImpl = fetch, timeoutMs = 3000 } = {}) {
69
+ const candidates = env.DSI_UI && /^http:\/\//.test(env.DSI_UI)
70
+ ? [env.DSI_UI.replace(/\/$/, '')]
71
+ : [...DEFAULT_FLOOR_BASES];
72
+ const probes = await Promise.all(candidates.map(async (base) => {
73
+ try {
74
+ const res = await fetchImpl(base + '/api/browser', { signal: AbortSignal.timeout(timeoutMs) });
75
+ if (!res.ok) return { base, reg: null };
76
+ return { base, reg: await res.json() };
77
+ } catch { return { base, reg: null }; }
78
+ }));
79
+ const answered = probes.filter((p) => p.reg?.sessions);
80
+ if (answered.length === 0) {
81
+ die('no DSI floor answers — probed ' + candidates.join(', ') +
82
+ ' (the glass session registry lives on the DSI floor; open the glass from the floor panel)');
83
+ }
84
+ return answered[0];
85
+ }
86
+
87
+ /** D13 — explicit argument > DSH_PORT env > default 3080; returns an origin string. */
88
+ export function resolveDshBase(argv = [], env = process.env) {
89
+ const urlFlag = argv.indexOf('--dsh-url');
90
+ if (urlFlag !== -1 && argv[urlFlag + 1]) return new URL(argv[urlFlag + 1]).origin;
91
+ const portFlag = argv.indexOf('--dsh-port');
92
+ if (portFlag !== -1 && argv[portFlag + 1]) return new URL('http://127.0.0.1:' + argv[portFlag + 1]).origin;
93
+ if (env.DSH_PORT) return new URL('http://127.0.0.1:' + env.DSH_PORT).origin;
94
+ return new URL('http://127.0.0.1:3080').origin;
95
+ }
96
+
97
+ export function originOf(url) {
98
+ try { return new URL(url).origin; } catch { return null; }
99
+ }
100
+
101
+ export async function connect(argv = []) {
102
+ const { base, reg } = await resolveDsiBase({ env: process.env });
103
+ const { session, degraded, note, error } = pickSession(reg.sessions, identityFrom(argv));
104
+ if (!session) die(error ?? 'no glass session resolved — the operator clicks the Browser chip');
105
+ if (degraded || note) console.error(JSON.stringify({ warn: note ?? 'degraded', sessionId: session.id }));
106
+ const browser = await chromium.connectOverCDP('http://127.0.0.1:' + session.port).catch(() => null);
107
+ if (!browser) die('CDP connect failed on port ' + session.port);
108
+ const ctx = browser.contexts()[0];
109
+ const dshOrigin = resolveDshBase(argv, process.env);
110
+ return { session, browser, ctx, floorBase: base, dshOrigin };
111
+ }
112
+
113
+ export function pickByOrigin(ctx, origin) {
114
+ const page = ctx.pages().find((p) => originOf(p.url()) === origin);
115
+ if (!page) {
116
+ die('no DSH tab at origin ' + origin + ' in the glass — open ' + origin +
117
+ ' (or pass --dsh-url/--dsh-port for a second floor); refusing positional guesses (D13)');
118
+ }
119
+ return page;
120
+ }
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * gesture.mjs — real-gesture verbs for the glass-dsh skill (Gates 3–5, D15).
4
+ * Real mouse/keyboard only: synthetic dispatchEvent is not verification.
5
+ * One verb per process; each prints {before, after, moved|delta} JSON.
6
+ * Run from the DSI repo root (playwright-core resolves there).
7
+ *
8
+ * Verbs:
9
+ * click <selector> real click (raises interception as an error, never force-clicks)
10
+ * type <selector> <text> real click into the element + page.keyboard.type
11
+ * drag <selector> <dx> <dy> real mouse down → 10 stepped moves with waits → up, on the element's box
12
+ * control <js-expr> control gate: evaluate an assertion expression → {pass, result}
13
+ * persist <localStorageKey> read a store key from the DSH tab → {raw}
14
+ *
15
+ * Flags: --dsh-url|--dsh-port|--owner-session (see _connect.mjs); --substr <s> selects a tab by URL
16
+ * substring for reads (never positional, D10); input verbs always target the DSH-origin tab.
17
+ */
18
+ import { connect, pickByOrigin, originOf, die } from './_connect.mjs';
19
+
20
+ const argv = process.argv.slice(2);
21
+ const verb = argv[0];
22
+ function opt(name) {
23
+ const i = argv.indexOf(name);
24
+ return i !== -1 ? argv[i + 1] : undefined;
25
+ }
26
+ const substr = opt('--substr');
27
+
28
+ const { ctx, dshOrigin } = await connect(argv);
29
+ function page() {
30
+ if (substr) {
31
+ const p = ctx.pages().find((p) => p.url().includes(substr));
32
+ if (!p) die('no tab whose URL contains ' + JSON.stringify(substr));
33
+ return p;
34
+ }
35
+ return pickByOrigin(ctx, dshOrigin);
36
+ }
37
+
38
+ if (verb === 'click') {
39
+ const sel = argv[1];
40
+ if (!sel) die('click needs a selector');
41
+ const p = page();
42
+ const before = await p.evaluate((s) => !!document.querySelector(s), sel);
43
+ await p.locator(sel).first().click(); // locator.click raises interception loudly (no force)
44
+ console.log(JSON.stringify({ verb: 'click', selector: sel, before, after: true, moved: before !== true }));
45
+ } else if (verb === 'type') {
46
+ const sel = argv[1], text = argv[2];
47
+ if (!sel || text === undefined) die('type needs <selector> <text>');
48
+ const p = page();
49
+ const loc = p.locator(sel).first();
50
+ await loc.click();
51
+ await p.keyboard.type(text);
52
+ const after = await loc.inputValue().catch(() => undefined);
53
+ console.log(JSON.stringify({ verb: 'type', selector: sel, before: '', after, moved: after === text }));
54
+ } else if (verb === 'drag') {
55
+ const sel = argv[1], dx = Number(argv[2]), dy = Number(argv[3]);
56
+ if (!sel || !Number.isFinite(dx) || !Number.isFinite(dy)) die('drag needs <selector> <dx> <dy>');
57
+ const p = page();
58
+ const posBefore = await p.evaluate((s) => {
59
+ const el = document.querySelector(s);
60
+ if (!el) return null;
61
+ const host = el.closest('[style*="left"]') ?? el;
62
+ return { x: host.style.left, y: host.style.top };
63
+ }, sel);
64
+ if (!posBefore) die('no element for ' + sel);
65
+ const box = await p.locator(sel).first().boundingBox();
66
+ if (!box) die('boundingBox failed for ' + sel);
67
+ const sx = box.x + box.width / 2, sy = box.y + Math.min(box.height / 2, 8);
68
+ await p.mouse.move(sx, sy);
69
+ await p.mouse.down();
70
+ for (let i = 1; i <= 10; i++) {
71
+ await p.mouse.move(sx + (dx * i) / 10, sy + (dy * i) / 10);
72
+ await new Promise((r) => setTimeout(r, 20));
73
+ }
74
+ await p.mouse.up();
75
+ await new Promise((r) => setTimeout(r, 300));
76
+ const posAfter = await p.evaluate((s) => {
77
+ const el = document.querySelector(s);
78
+ const host = el?.closest('[style*="left"]') ?? el;
79
+ return { x: host.style.left, y: host.style.top };
80
+ }, sel);
81
+ const moved = JSON.stringify(posBefore) !== JSON.stringify(posAfter);
82
+ console.log(JSON.stringify({ verb: 'drag', selector: sel, before: posBefore, after: posAfter, moved }));
83
+ } else if (verb === 'control') {
84
+ const expr = argv[1];
85
+ if (!expr) die('control needs a JS assertion expression');
86
+ const p = page();
87
+ const result = await p.evaluate('!!(' + expr + ')');
88
+ console.log(JSON.stringify({ verb: 'control', expr, pass: result === true, result }));
89
+ } else if (verb === 'persist') {
90
+ const key = argv[1];
91
+ if (!key) die('persist needs a localStorage key');
92
+ const p = page();
93
+ const raw = await p.evaluate((k) => window.localStorage.getItem(k), key);
94
+ console.log(JSON.stringify({ verb: 'persist', key, raw }));
95
+ } else {
96
+ die('unknown verb ' + JSON.stringify(verb) + ' — click | type | drag | control | persist');
97
+ }
98
+ process.exit(0);
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * glass-dsh.mjs — origin-aware driver verbs for the glass-dsh skill (D13).
4
+ * Run from the DSI repo root (playwright-core resolves there). One JSON verdict
5
+ * on stdout; loud die() on refusal (D7/D11).
6
+ *
7
+ * Verbs:
8
+ * pages list CDP pages with origin classification vs the resolved DSH origin
9
+ * eval --b64 <b64> [substr] evaluate base64 JS in the DSH tab (or the tab whose URL contains substr);
10
+ * D10 grammar law: with --b64, a leftover argument IS the substring — never positional
11
+ * shot <path> screenshot of the DSH tab
12
+ *
13
+ * Flags: --dsh-url <url> | --dsh-port <n> | --owner-session <id> (see _connect.mjs)
14
+ */
15
+ import { connect, pickByOrigin, originOf, die } from './_connect.mjs';
16
+
17
+ const argv = process.argv.slice(2);
18
+ const verb = argv[0];
19
+
20
+ function pick(ctx, dshOrigin, substr) {
21
+ if (substr) {
22
+ const page = ctx.pages().find((p) => p.url().includes(substr));
23
+ if (!page) die('no tab whose URL contains ' + JSON.stringify(substr) + ' — refusing positional guesses (D2/D10)');
24
+ return page;
25
+ }
26
+ return pickByOrigin(ctx, dshOrigin);
27
+ }
28
+
29
+ const { ctx, dshOrigin } = await connect(argv);
30
+
31
+ if (verb === 'pages') {
32
+ const pages = ctx.pages().map((p) => ({
33
+ url: p.url(),
34
+ origin: originOf(p.url()),
35
+ isDsh: originOf(p.url()) === dshOrigin,
36
+ }));
37
+ console.log(JSON.stringify({ dshOrigin, pages }));
38
+ } else if (verb === 'eval') {
39
+ const rest = argv.slice(1);
40
+ const b64 = rest.indexOf('--b64');
41
+ let expr, substr = undefined;
42
+ if (b64 !== -1) {
43
+ expr = Buffer.from(rest[b64 + 1] ?? '', 'base64').toString('utf8');
44
+ const leftover = rest[b64 + 2];
45
+ if (leftover) substr = leftover; // D10: leftover argument IS the substring
46
+ } else {
47
+ expr = rest[0];
48
+ if (!expr) die('eval needs inline JS or --b64 <b64> [substr]');
49
+ substr = rest[1];
50
+ }
51
+ const page = pick(ctx, dshOrigin, substr);
52
+ const result = await page.evaluate(expr);
53
+ console.log(JSON.stringify({ url: page.url(), result }));
54
+ } else if (verb === 'shot') {
55
+ const path = argv[1];
56
+ if (!path) die('shot needs a file path');
57
+ const page = pickByOrigin(ctx, dshOrigin);
58
+ await page.screenshot({ path, fullPage: false });
59
+ console.log(JSON.stringify({ ok: true, path, url: page.url() }));
60
+ } else {
61
+ die('unknown verb ' + JSON.stringify(verb) + ' — pages | eval --b64 <b64> [substr] | shot <path>');
62
+ }
63
+ process.exit(0);
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * probe-dsh.mjs — Gates 0–2 of the glass-dsh skill: console baseline + crash scan.
4
+ * Reloads the DSH tab, arms a console listener, and emits ONE JSON verdict.
5
+ * Evidence over presence: `slot entry crashed in '<slot>'` naming the plugin is
6
+ * an automatic FAIL (D14) even when everything else looks fine.
7
+ *
8
+ * Usage (from the DSI repo root):
9
+ * node skills/glass-dsh/scripts/probe-dsh.mjs [--expect '<selector>'] [--store '<localStorageKey>']
10
+ * [--plugin-id '<plugin id>'] [--dsh-url|--dsh-port|--owner-session]
11
+ *
12
+ * Emits: { dshOrigin, url, moduleLoader, expectPresent?, storeRaw?,
13
+ * consoleErrors, crashedSlots, pass }
14
+ * pass=false when a crashedSlot matches --plugin-id (or any crash, if no id given).
15
+ */
16
+ import { connect, pickByOrigin } from './_connect.mjs';
17
+
18
+ const argv = process.argv.slice(2);
19
+ function opt(name) {
20
+ const i = argv.indexOf(name);
21
+ return i !== -1 ? argv[i + 1] : undefined;
22
+ }
23
+ const expectSel = opt('--expect');
24
+ const storeKey = opt('--store');
25
+ const pluginId = opt('--plugin-id');
26
+
27
+ const { ctx, dshOrigin } = await connect(argv);
28
+ const page = pickByOrigin(ctx, dshOrigin);
29
+
30
+ const errors = [];
31
+ const onConsole = (m) => { if (m.type() === 'error') errors.push(m.text().slice(0, 500)); };
32
+ page.on('console', onConsole);
33
+
34
+ await page.reload({ waitUntil: 'networkidle' }).catch(() => {});
35
+ await new Promise((r) => setTimeout(r, 2500));
36
+
37
+ const probe = await page.evaluate(({ expectSel, storeKey }) => {
38
+ const el = expectSel ? document.querySelector(expectSel) : null;
39
+ return {
40
+ moduleLoader: typeof window.__ModuleLoader__ !== 'undefined' && typeof window.__ModuleLoader__.load === 'function',
41
+ expectPresent: expectSel ? !!el : undefined,
42
+ expectText: el && expectSel ? (el.textContent || '').slice(0, 80) : undefined,
43
+ storeRaw: storeKey ? window.localStorage.getItem(storeKey) : undefined,
44
+ };
45
+ }, { expectSel, storeKey });
46
+
47
+ page.off('console', onConsole);
48
+
49
+ const crashedSlots = errors
50
+ .filter((t) => t.includes("slot entry crashed in '"))
51
+ .map((t) => {
52
+ const slot = t.split("slot entry crashed in '")[1]?.split("'")[0] ?? '?';
53
+ return { slot, text: t };
54
+ });
55
+ const relevant = crashedSlots.filter((c) => !pluginId || c.text.includes(pluginId));
56
+ const pass = relevant.length === 0 && errors.length === 0;
57
+
58
+ console.log(JSON.stringify({ dshOrigin, url: page.url(), ...probe, consoleErrors: errors, crashedSlots, pass }));
59
+ process.exit(0);
@@ -1 +1 @@
1
- import{Tt as e,ct as t}from"./0Tfhif1V.js";import{a as n}from"./ClnxU8JH.js";import{m as r}from"./D9jhmf3I.js";var i={},a=[`en`,`zh`,`id`,`es`],o=`dsi.locale`,s=3456e4,c=[`cookie`,`preferredLanguage`,`baseLocale`],l=[],u=typeof window>`u`;globalThis.__paraglide=globalThis.__paraglide??{},globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};var d=!1,f=()=>{let e=c;!u&&typeof window<`u`&&window.location?.href&&(e=P(window.location.href));let t=p(e,typeof window<`u`?window.location?.href:void 0);if(t)return d||(d=!0,h(t,{reload:!1})),t;throw Error(`No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found`)};function p(e,t){let n;for(let t of e){if(t===`cookie`)n=D();else if(t===`baseLocale`)n=`en`;else if(t===`preferredLanguage`&&!u)n=O();else if(I(t)&&F.has(t)){let e=F.get(t);if(e){let t=e.getLocale();if(t instanceof Promise)continue;if(t!==void 0)return v(t)}}let e=_(n);if(e)return e}}var m=e=>{e?window.location.href=e:window.location.reload()},h=(e,t)=>{let n={reload:!0,...t},r;try{r=f()}catch{}let i=[],a=c;!u&&typeof window<`u`&&window.location?.href&&(a=P(window.location.href));for(let t of a)if(t===`cookie`){if(u||typeof document>`u`||typeof window>`u`)continue;let t=`${o}=${e}; path=/; max-age=${s}`;document.cookie=t,T()}else if(t===`baseLocale`)continue;else if(I(t)&&F.has(t)){let n=F.get(t);if(n){let r=n.setLocale(e);r instanceof Promise&&(r=r.catch(e=>{throw Error(`Custom strategy "${t}" setLocale failed.`,{cause:e})}),i.push(r))}}let l=()=>{!u&&n.reload&&window.location&&e!==r&&m(void 0)};if(i.length)return Promise.all(i).then(()=>{l()});l()},g=()=>typeof window<`u`?window.location.origin:`http://fallback.com`;function _(e){if(typeof e!=`string`)return;let t=e.toLowerCase();for(let e of a)if(e.toLowerCase()===t)return e}function v(e){let t=_(e);if(t)return t;throw Error(`Invalid locale: ${e}. Expected one of: ${a.join(`, `)}`)}function y(e){return e}function b(e,t){return e.exec(t.href)}var x=o.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),S=RegExp(`(?:^|;\\s*)${x}=([^;]*)`),C=Symbol(),w=C;function T(){w=C}function E(){typeof queueMicrotask==`function`?queueMicrotask(T):Promise.resolve().then(T)}function D(){if(typeof document>`u`)return;if(w!==C)return w;let e=document.cookie.match(S)?.[1];return w=_(e),E(),w}function O(){if(!navigator?.languages?.length)return;let e=navigator.languages.map(e=>({fullTag:e,baseTag:e.split(`-`)[0]}));for(let t of e){let e=_(t.fullTag);if(e)return e;let n=_(t.baseTag);if(n)return n}}function k(e){return A(e)}function A(e){let t=y(typeof e==`string`?new URL(e,g()):new URL(e)),n=t.pathname.split(`/`).filter(Boolean);return n.length>0&&_(n[0])&&(t.pathname=`/`+n.slice(1).join(`/`)),y(t)}var j,M;function N(e){if(l.length===0)return;let t=typeof e==`string`?e:e.href;if(j===t)return M;let n=y(new URL(t,`http://example.com`)),r=k(n),a=r.href===n.href?[n]:[n,r],o;for(let e of a){for(let t of l)if(b(new i(t.match,e.href),e)){o=t;break}if(o)break}return j=t,M=o,o}function P(e){let t=N(e);return t&&t.exclude!==!0&&Array.isArray(t.strategy)?t.strategy:c}var F=new Map;function I(e){return typeof e==`string`&&/^custom-[A-Za-z0-9_-]+$/.test(e)}var L=t({locale:`en`});function R(){let t=e(L).locale;try{let e=f();if(r.includes(e))return e}catch{}return r.includes(t)?t:`en`}async function z(e){if(r.includes(e)){await h(e,{reload:!1});try{localStorage.setItem(`dsi.locale`,e)}catch{}L.locale=e}}function B(t){e(L).locale;try{let e=f();if(r.includes(e))return t()}catch{}return t()}var V=()=>`← Back to the workspace`,H=()=>`← 返回工作区`,U=()=>`← Kembali ke workspace`,W=()=>`← Volver al workspace`,ee=((e={},t={})=>{let n=t.locale??f();return n===`zh`?H(e):n===`id`?U(e):n===`es`?W(e):V(e)}),G=()=>`DSH host unreachable`,K=()=>`DSH 主机不可达`,q=()=>`Host DSH tidak dapat dijangkau`,J=()=>`Host DSH inalcanzable`,Y=((e={},t={})=>{let n=t.locale??f();return n===`zh`?K(e):n===`id`?q(e):n===`es`?J(e):G(e)}),X=()=>`It may have been reaped, or the link predates this host's ledger.`,Z=()=>`它可能已被回收,或链接早于此主机的账本。`,Q=()=>`Mungkin sudah dihapus, atau tautannya lebih tua dari ledger host ini.`,$=()=>`Puede haber sido recolectada, o el enlace es anterior al libro mayor de este host.`,te=((e={},t={})=>{let n=t.locale??f();return n===`zh`?Z(e):n===`id`?Q(e):n===`es`?$(e):X(e)}),ne=()=>`Session not found`,re=()=>`会话未找到`,ie=()=>`Sesi tidak ditemukan`,ae=()=>`Sesión no encontrada`,oe=((e={},t={})=>{let n=t.locale??f();return n===`zh`?re(e):n===`id`?ie(e):n===`es`?ae(e):ne(e)}),se=()=>`Unexpected error`,ce=()=>`意外错误`,le=()=>`Kesalahan tak terduga`,ue=()=>`Error inesperado`,de=((e={},t={})=>{let n=t.locale??f();return n===`zh`?ce(e):n===`id`?le(e):n===`es`?ue(e):se(e)}),fe={get data(){return n.data},get error(){return n.error},get form(){return n.form},get params(){return n.params},get route(){return n.route},get state(){return n.state},get status(){return n.status},get url(){return n.url}};export{Y as a,z as c,te as i,B as l,de as n,ee as o,oe as r,R as s,fe as t,f as u};
1
+ import{Tt as e,ct as t}from"./0Tfhif1V.js";import{a as n}from"./C2MzPOYY.js";import{m as r}from"./D9jhmf3I.js";var i={},a=[`en`,`zh`,`id`,`es`],o=`dsi.locale`,s=3456e4,c=[`cookie`,`preferredLanguage`,`baseLocale`],l=[],u=typeof window>`u`;globalThis.__paraglide=globalThis.__paraglide??{},globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};var d=!1,f=()=>{let e=c;!u&&typeof window<`u`&&window.location?.href&&(e=P(window.location.href));let t=p(e,typeof window<`u`?window.location?.href:void 0);if(t)return d||(d=!0,h(t,{reload:!1})),t;throw Error(`No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found`)};function p(e,t){let n;for(let t of e){if(t===`cookie`)n=D();else if(t===`baseLocale`)n=`en`;else if(t===`preferredLanguage`&&!u)n=O();else if(I(t)&&F.has(t)){let e=F.get(t);if(e){let t=e.getLocale();if(t instanceof Promise)continue;if(t!==void 0)return v(t)}}let e=_(n);if(e)return e}}var m=e=>{e?window.location.href=e:window.location.reload()},h=(e,t)=>{let n={reload:!0,...t},r;try{r=f()}catch{}let i=[],a=c;!u&&typeof window<`u`&&window.location?.href&&(a=P(window.location.href));for(let t of a)if(t===`cookie`){if(u||typeof document>`u`||typeof window>`u`)continue;let t=`${o}=${e}; path=/; max-age=${s}`;document.cookie=t,T()}else if(t===`baseLocale`)continue;else if(I(t)&&F.has(t)){let n=F.get(t);if(n){let r=n.setLocale(e);r instanceof Promise&&(r=r.catch(e=>{throw Error(`Custom strategy "${t}" setLocale failed.`,{cause:e})}),i.push(r))}}let l=()=>{!u&&n.reload&&window.location&&e!==r&&m(void 0)};if(i.length)return Promise.all(i).then(()=>{l()});l()},g=()=>typeof window<`u`?window.location.origin:`http://fallback.com`;function _(e){if(typeof e!=`string`)return;let t=e.toLowerCase();for(let e of a)if(e.toLowerCase()===t)return e}function v(e){let t=_(e);if(t)return t;throw Error(`Invalid locale: ${e}. Expected one of: ${a.join(`, `)}`)}function y(e){return e}function b(e,t){return e.exec(t.href)}var x=o.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),S=RegExp(`(?:^|;\\s*)${x}=([^;]*)`),C=Symbol(),w=C;function T(){w=C}function E(){typeof queueMicrotask==`function`?queueMicrotask(T):Promise.resolve().then(T)}function D(){if(typeof document>`u`)return;if(w!==C)return w;let e=document.cookie.match(S)?.[1];return w=_(e),E(),w}function O(){if(!navigator?.languages?.length)return;let e=navigator.languages.map(e=>({fullTag:e,baseTag:e.split(`-`)[0]}));for(let t of e){let e=_(t.fullTag);if(e)return e;let n=_(t.baseTag);if(n)return n}}function k(e){return A(e)}function A(e){let t=y(typeof e==`string`?new URL(e,g()):new URL(e)),n=t.pathname.split(`/`).filter(Boolean);return n.length>0&&_(n[0])&&(t.pathname=`/`+n.slice(1).join(`/`)),y(t)}var j,M;function N(e){if(l.length===0)return;let t=typeof e==`string`?e:e.href;if(j===t)return M;let n=y(new URL(t,`http://example.com`)),r=k(n),a=r.href===n.href?[n]:[n,r],o;for(let e of a){for(let t of l)if(b(new i(t.match,e.href),e)){o=t;break}if(o)break}return j=t,M=o,o}function P(e){let t=N(e);return t&&t.exclude!==!0&&Array.isArray(t.strategy)?t.strategy:c}var F=new Map;function I(e){return typeof e==`string`&&/^custom-[A-Za-z0-9_-]+$/.test(e)}var L=t({locale:`en`});function R(){let t=e(L).locale;try{let e=f();if(r.includes(e))return e}catch{}return r.includes(t)?t:`en`}async function z(e){if(r.includes(e)){await h(e,{reload:!1});try{localStorage.setItem(`dsi.locale`,e)}catch{}L.locale=e}}function B(t){e(L).locale;try{let e=f();if(r.includes(e))return t()}catch{}return t()}var V=()=>`← Back to the workspace`,H=()=>`← 返回工作区`,U=()=>`← Kembali ke workspace`,W=()=>`← Volver al workspace`,ee=((e={},t={})=>{let n=t.locale??f();return n===`zh`?H(e):n===`id`?U(e):n===`es`?W(e):V(e)}),G=()=>`DSH host unreachable`,K=()=>`DSH 主机不可达`,q=()=>`Host DSH tidak dapat dijangkau`,J=()=>`Host DSH inalcanzable`,Y=((e={},t={})=>{let n=t.locale??f();return n===`zh`?K(e):n===`id`?q(e):n===`es`?J(e):G(e)}),X=()=>`It may have been reaped, or the link predates this host's ledger.`,Z=()=>`它可能已被回收,或链接早于此主机的账本。`,Q=()=>`Mungkin sudah dihapus, atau tautannya lebih tua dari ledger host ini.`,$=()=>`Puede haber sido recolectada, o el enlace es anterior al libro mayor de este host.`,te=((e={},t={})=>{let n=t.locale??f();return n===`zh`?Z(e):n===`id`?Q(e):n===`es`?$(e):X(e)}),ne=()=>`Session not found`,re=()=>`会话未找到`,ie=()=>`Sesi tidak ditemukan`,ae=()=>`Sesión no encontrada`,oe=((e={},t={})=>{let n=t.locale??f();return n===`zh`?re(e):n===`id`?ie(e):n===`es`?ae(e):ne(e)}),se=()=>`Unexpected error`,ce=()=>`意外错误`,le=()=>`Kesalahan tak terduga`,ue=()=>`Error inesperado`,de=((e={},t={})=>{let n=t.locale??f();return n===`zh`?ce(e):n===`id`?le(e):n===`es`?ue(e):se(e)}),fe={get data(){return n.data},get error(){return n.error},get form(){return n.form},get params(){return n.params},get route(){return n.route},get state(){return n.state},get status(){return n.status},get url(){return n.url}};export{Y as a,z as c,te as i,B as l,de as n,ee as o,oe as r,R as s,fe as t,f as u};
@@ -0,0 +1 @@
1
+ import{r as e}from"../nodes/2.BiOhzV1A.js";export{e as stringify};
@@ -0,0 +1,2 @@
1
+ import{J as e,K as t,Y as n,ft as r,q as i,r as a,t as o,ut as s,vt as c}from"./0Tfhif1V.js";var l=class{constructor(e,t){this.status=e,this.body=typeof t==`string`?{message:t}:t||{message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}},u=class{constructor(e,t){try{new Headers({location:t})}catch{throw Error(`Invalid redirect location ${JSON.stringify(t)}: this string contains characters that cannot be used in HTTP headers`)}this.status=e,this.location=t}},d=class extends Error{constructor(e,t,n){super(n),this.status=e,this.text=t}};new URL(`sveltekit-internal://`);function f(e,t){return e===`/`||t===`ignore`?e:t===`never`?e.endsWith(`/`)?e.slice(0,-1):e:t===`always`&&!e.endsWith(`/`)?e+`/`:e}function p(e){return e.split(`%25`).map(decodeURI).join(`%25`)}function ee(e){for(let t in e)e[t]=decodeURIComponent(e[t]);return e}function m({href:e}){return e.split(`#`)[0]}function h(e,t,n,r=!1){let i=new URL(e);Object.defineProperty(i,"searchParams",{value:new Proxy(i.searchParams,{get(e,r){if(r===`get`||r===`getAll`||r===`has`)return(t,...i)=>(n(t),e[r](t,...i));t();let i=Reflect.get(e,r);return typeof i==`function`?i.bind(e):i}}),enumerable:!0,configurable:!0});let a=[`href`,`pathname`,`search`,`toString`,`toJSON`];r&&a.push(`hash`);for(let n of a)Object.defineProperty(i,n,{get(){return t(),e[n]},enumerable:!0,configurable:!0});return i}function g(){}function _(...e){let t=5381;for(let n of e)if(typeof n==`string`){let e=n.length;for(;e;)t=t*33^n.charCodeAt(--e)}else if(ArrayBuffer.isView(n)){let e=new Uint8Array(n.buffer,n.byteOffset,n.byteLength),r=e.length;for(;r;)t=t*33^e[--r]}else throw TypeError(`value must be a string or TypedArray`);return(t>>>0).toString(36)}new TextEncoder;function te(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var v=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||`GET`)!==`GET`&&y.delete(b(e)),v(e,t));var y=new Map;function ne(e,t){let n=b(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:e,...t}=JSON.parse(r.textContent);r.getAttribute(`data-b64`)!==null&&(e=te(e));let i=r.getAttribute(`data-ttl`);return i&&y.set(n,{body:e,init:t,ttl:1e3*Number(i)}),Promise.resolve(new Response(e,t))}return window.fetch(e,t)}function re(e,t,n){if(y.size>0){let t=b(e,n),r=y.get(t);if(r){if(performance.now()<r.ttl&&[`default`,`force-cache`,`only-if-cached`,void 0].includes(n?.cache))return new Response(r.body,r.init);y.delete(t)}}return window.fetch(t,n)}function b(e,t){let n=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){let e=[];t.headers&&e.push([...new Headers(t.headers)].join(`,`)),t.body&&(typeof t.body==`string`||ArrayBuffer.isView(t.body))&&e.push(t.body),n+=`[data-hash="${_(...e)}"]`}return n}var x=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/,ie=/^\/\((?:[^)]+)\)$/;function ae(e){let t=[];return{pattern:e===`/`||ie.test(e)?/^\/$/:RegExp(`^${se(e).map(e=>{let n=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(e);if(n)return t.push({name:n[1],matcher:n[2],optional:!1,rest:!0,chained:!0}),`(?:/([^]*))?`;let r=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(e);if(r)return t.push({name:r[1],matcher:r[2],optional:!0,rest:!1,chained:!0}),`(?:/([^/]+))?`;if(!e)return;let i=e.split(/\[(.+?)\](?!\])/);return`/`+i.map((e,n)=>{if(n%2){if(e.startsWith(`x+`))return le(String.fromCharCode(parseInt(e.slice(2),16)));if(e.startsWith(`u+`))return le(String.fromCharCode(...e.slice(2).split(`-`).map(e=>parseInt(e,16))));let[,r,a,o,s]=x.exec(e);return t.push({name:o,matcher:s,optional:!!r,rest:!!a,chained:a?n===1&&i[0]===``:!1}),a?`([^]*?)`:r?`([^/]*)?`:`([^/]+?)`}return le(e)}).join(``)}).join(``)}/?$`),params:t}}function oe(e){return e!==``&&!/^\([^)]+\)$/.test(e)}function se(e){return e.slice(1).split(`/`).filter(oe)}function ce(e,t,n){let r={},i=e.slice(1),a=i.filter(e=>e!==void 0),o=0;for(let e=0;e<t.length;e+=1){let s=t[e],c=i[e-o];if(s.chained&&s.rest&&o&&(c=i.slice(e-o,e+1).filter(e=>e).join(`/`),o=0),c===void 0){if(s.rest)c=``;else continue}if(!s.matcher||n[s.matcher](c)){r[s.name]=c;let n=t[e+1],l=i[e+1];n&&!n.rest&&n.optional&&l&&s.chained&&(o=0),!n&&!l&&Object.keys(r).length===a.length&&(o=0);continue}if(s.optional&&s.chained){o++;continue}return}if(!o)return r}function le(e){return e.normalize().replace(/[[\]]/g,`\\$&`).replace(/%/g,`%25`).replace(/\//g,`%2[Ff]`).replace(/\?/g,`%3[Ff]`).replace(/#/g,`%23`).replace(/[.*+?^${}()|\\]/g,`\\$&`)}var ue=/\[(\[)?(\.\.\.)?(\w+?)(?:=(\w+))?\]\]?/g;function de(e,t){let n=se(e),r=e!=`/`&&e.endsWith(`/`);return`/`+n.map(n=>n.replace(ue,(n,r,i,a)=>{let o=t[a];if(!o){if(r||i&&o!==void 0)return``;throw Error(`Missing parameter '${a}' in route ${e}`)}if(o.startsWith(`/`)||o.endsWith(`/`))throw Error(`Parameter '${a}' in route ${e} cannot start or end with a slash -- this would cause an invalid route like foo//bar`);return o})).filter(Boolean).join(`/`)+(r?`/`:``)}function fe({nodes:e,server_loads:t,dictionary:n,matchers:r}){let i=new Set(t);return Object.entries(n).map(([t,[n,i,s]])=>{let{pattern:c,params:l}=ae(t),u={id:t,exec:e=>{let t=c.exec(e);if(t)return ce(t,l,r)},errors:[1,...s||[]].map(t=>e[t]),layouts:[0,...i||[]].map(o),leaf:a(n)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function a(t){let n=t<0;return n&&(t=~t),[n,e[t]]}function o(t){return t===void 0?t:[i.has(t),e[t]]}}function pe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function me(e,t,n=JSON.stringify){let r=n(t);try{sessionStorage[e]=r}catch{}}var S=globalThis.__sveltekit_mb3kxh?.base??``,he=globalThis.__sveltekit_mb3kxh?.assets??S??``,ge=``;function _e(...e){if(!e[0].startsWith(`/`))throw Error(`Cannot use \`resolve(...)\` with a non-absolute pathname or route ID (got "${e[0]}"). \`resolve\` is only for internal pathnames and route IDs; external URLs should be used directly.`);return S+ge+de(e[0],e[1])}var ve=`1794210971034`,ye=`sveltekit:snapshot`,be=`sveltekit:scroll`,xe=`sveltekit:states`,Se=`sveltekit:pageurl`,C=`sveltekit:history`,w=`sveltekit:navigation`,T={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},E=location.origin;function Ce(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){let e=document.getElementsByTagName(`base`);t=e.length?e[0].href:document.URL}return new URL(e,t)}function D(){return{x:pageXOffset,y:pageYOffset}}function O(e,t){return e.getAttribute(`data-sveltekit-${t}`)}var we={...T,"":T.hover};function Te(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Ee(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()===`A`&&e.hasAttribute(`href`))return e;e=Te(e)}}function De(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){let e=location.hash.split(`#`)[1]||`/`;r.hash=`#${e}${r.hash}`}}catch{}let i=e instanceof SVGAElement?e.target.baseVal:e.target,a=!r||!!i||A(r,t,n)||(e.getAttribute(`rel`)||``).split(/\s+/).includes(`external`),o=r?.origin===E&&e.hasAttribute(`download`);return{url:r,external:a,target:i,download:o}}function k(e){let t=null,n=null,r=null,i=null,a=null,o=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=O(s,`preload-code`)),i===null&&(i=O(s,`preload-data`)),t===null&&(t=O(s,`keepfocus`)),n===null&&(n=O(s,`noscroll`)),a===null&&(a=O(s,`reload`)),o===null&&(o=O(s,`replacestate`)),s=Te(s);function c(e){switch(e){case``:case`true`:return!0;case`off`:case`false`:return!1;default:return}}return{preload_code:we[r??`off`],preload_data:we[i??`off`],keepfocus:c(t),noscroll:c(n),reload:c(a),replace_state:c(o)}}function Oe(e){let t=c(e),n=!0;function r(){n=!0,t.update(e=>e)}function i(e){n=!1,t.set(e)}function a(e){let r;return t.subscribe(t=>{(r===void 0||n&&t!==r)&&e(r=t)})}return{notify:r,set:i,subscribe:a}}var ke={v:g};function Ae(){let{set:e,subscribe:t}=c(!1),n;async function r(){clearTimeout(n);try{let t=await fetch(`${he}/_app/version.json`,{headers:{pragma:`no-cache`,"cache-control":`no-cache`}});if(!t.ok)return!1;let r=(await t.json()).version!==ve;return r&&(e(!0),ke.v(),clearTimeout(n)),r}catch{return!1}}return{subscribe:t,check:r}}function A(e,t,n){return e.origin!==E||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function je(e){}var Me=2**32-1,Ne=Me-1,Pe=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Fe(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getPrototypeOf(t)===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Pe}function Ie(e){return Object.prototype.toString.call(e).slice(8,-1)}function Le(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)}function Re(e){return!(!Number.isInteger(e)||e<0||e>Ne)}function ze(e){return!(!Number.isInteger(e)||e<0||e>Me)}function Be(e){if(e.length===0||e.length>1&&e.charCodeAt(0)===48)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<48||n>57)return!1}return Re(+e)}function Ve(e){for(var t=e.length-1;t>=0&&!Be(e[t]);t--);return t+1}function He(e){let t=Object.keys(e);return t.length=Ve(t),t}function Ue(e){return Uint8Array.fromBase64(e).buffer}function We(e){return Uint8Array.from(Buffer.from(e,`base64`)).buffer}function Ge(e){let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r.buffer}var Ke=typeof Uint8Array.fromBase64==`function`,qe=typeof process==`object`&&process.versions?.node!==void 0,Je=Ke?Ue:qe?We:Ge;function Ye(e,t){if(!t)return e;let n={};for(let r of Object.keys(e))n[r]=t[r]??e[r];return n}var Xe=Object.freeze({kind:`not-plain`}),Ze=Object.freeze({kind:`symbol-keys`});Object.freeze({identify:e=>e,typeOf:e=>e===null?`null`:typeof e,toPrimitive:e=>e,tagOf:e=>Ie(e),isThenable:e=>typeof e.then==`function`,toPromise:e=>Promise.resolve(e),unbox:e=>e.valueOf(),toISOString:e=>isNaN(e.getDate())?``:e.toISOString(),toStringValue:e=>e.toString(),regExpInfo:e=>({source:e.source,flags:e.flags}),valuesOf:e=>e,entriesOf:e=>e,viewInfo:e=>({buffer:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength,length:e.length,bufferByteLength:e.buffer.byteLength}),toArrayBuffer:e=>e,lengthOf:e=>e.length,hasOwn:(e,t)=>Object.hasOwn(e,t),indicesOf:e=>He(e),shapeOf:e=>Fe(e)?Le(e).length>0?Ze:{kind:Object.getPrototypeOf(e)===null?`null-proto`:`plain`,keys:Object.keys(e)}:Xe,get:(e,t)=>e[t]});var Qe=Object.freeze({fromPrimitive:e=>e,fromISOString:e=>new Date(e),fromStringValue:(e,t)=>e===`URL`?new URL(t):e===`URLSearchParams`?new URLSearchParams(t):Temporal[e.slice(9)].from(t),fromArrayBuffer:e=>e,fromRegExpInfo:(e,t)=>new RegExp(e,t),fromViewInfo:(e,t,n,r)=>{let i=globalThis[e];return n===void 0?new i(t):new i(t,n,r)},box:e=>Object(e),createArray:e=>Array(e),createSparseArray:e=>{let t=[];return t[Ne]=void 0,delete t[Ne],t.length=e,t},createObject:()=>({}),createNullPrototypeObject:()=>Object.create(null),createSet:()=>new Set,createMap:()=>new Map,set:(e,t,n)=>{e[t]=n},addValue:(e,t)=>{e.add(t)},addEntry:(e,t,n)=>{e.set(t,n)}});function $e(e,t,n){let r=Ye(Qe,n?.operations);if(typeof e==`number`)return s(e,!0);if(!Array.isArray(e)||e.length===0)throw Error(`Invalid input`);let i=e,a=Array(i.length),o=null;function s(e,n=!1){if(e===-1)return r.fromPrimitive(void 0);if(e===-3)return r.fromPrimitive(NaN);if(e===-4)return r.fromPrimitive(1/0);if(e===-5)return r.fromPrimitive(-1/0);if(e===-6)return r.fromPrimitive(-0);if(n||typeof e!=`number`)throw Error(`Invalid input`);if(e in a)return a[e];let c=i[e];if(!c||typeof c!=`object`)a[e]=r.fromPrimitive(c);else if(Array.isArray(c)){if(typeof c[0]==`string`){let n=c[0],l=t&&Object.hasOwn(t,n)?t[n]:void 0;if(l){let t=c[1];if(typeof t!=`number`&&(t=i.push(c[1])-1),Object.hasOwn(a,t))return a[e]=l(a[t]);if(o??=new Set,o.has(t))throw Error(`Invalid circular reference`);return o.add(t),a[e]=l(s(t)),o.delete(t),a[e]}switch(n){case`Date`:a[e]=r.fromISOString(c[1]);break;case`Set`:let t=r.createSet();a[e]=t;for(let e=1;e<c.length;e+=1)r.addValue(t,s(c[e]));break;case`Map`:let o=r.createMap();a[e]=o;for(let e=1;e<c.length;e+=2)r.addEntry(o,s(c[e]),s(c[e+1]));break;case`RegExp`:a[e]=r.fromRegExpInfo(c[1],c[2]);break;case`Object`:{let t=c[1];if(typeof i[t]==`object`&&i[t][0]!==`BigInt`)throw Error(`Invalid input`);a[e]=r.box(s(t));break}case`BigInt`:a[e]=r.fromPrimitive(BigInt(c[1]));break;case`null`:let l=r.createNullPrototypeObject();a[e]=l;for(let e=1;e<c.length;e+=2){if(c[e]===`__proto__`)throw Error("Cannot parse an object with a `__proto__` property");r.set(l,c[e],s(c[e+1]))}break;case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:case`Int16Array`:case`Uint16Array`:case`Float16Array`:case`Int32Array`:case`Uint32Array`:case`Float32Array`:case`Float64Array`:case`BigInt64Array`:case`BigUint64Array`:case`DataView`:{if(i[c[1]][0]!==`ArrayBuffer`)throw Error(`Invalid data`);let t=s(c[1]);a[e]=r.fromViewInfo(n,t,c[2],c[3]);break}case`ArrayBuffer`:{let t=c[1];if(typeof t!=`string`)throw Error(`Invalid ArrayBuffer encoding`);a[e]=r.fromArrayBuffer(Je(t));break}case`URL`:case`URLSearchParams`:case`Temporal.Duration`:case`Temporal.Instant`:case`Temporal.PlainDate`:case`Temporal.PlainTime`:case`Temporal.PlainDateTime`:case`Temporal.PlainMonthDay`:case`Temporal.PlainYearMonth`:case`Temporal.ZonedDateTime`:a[e]=r.fromStringValue(n,c[1]);break;default:throw Error(`Unknown type ${n}`)}}else if(c[0]===-7){let t=c[1];if(!ze(t))throw Error(`Invalid input`);let n=r.createSparseArray(t);a[e]=n;for(let e=2;e<c.length;e+=2){let i=c[e];if(!Re(i)||i>=t)throw Error(`Invalid input`);r.set(n,i,s(c[e+1]))}}else{let t=r.createArray(c.length);a[e]=t;for(let e=0;e<c.length;e+=1){let n=c[e];n!==-2&&r.set(t,e,s(n))}}}else{let t=r.createObject();a[e]=t;for(let e of Object.keys(c)){if(e===`__proto__`)throw Error("Cannot parse an object with a `__proto__` property");r.set(t,e,s(c[e]))}}return a[e]}return s(0)}var et=new Set([`load`,`prerender`,`csr`,`ssr`,`trailingSlash`,`config`]);[...et],[...new Set([...et])];function tt(e){return e.filter(e=>e!=null)}var nt=`x-sveltekit-invalidated`,rt=`x-sveltekit-trailing-slash`;function j(e,t){return e+`/`+t}function it(e){return e instanceof l||e instanceof d?e.status:500}function at(e){return e instanceof d?e.text:`Internal Error`}var M,N,ot,st=a.toString().includes(`$$`)||/function \w+\(\) \{\}/.test(a.toString()),ct=`a:`;st?(M={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(ct)},N={current:null},ot={current:!1}):(M=new class{#e=r({});get data(){return t(this.#e)}set data(e){s(this.#e,e)}#t=r(null);get form(){return t(this.#t)}set form(e){s(this.#t,e)}#n=r(null);get error(){return t(this.#n)}set error(e){s(this.#n,e)}#r=r({});get params(){return t(this.#r)}set params(e){s(this.#r,e)}#i=r({id:null});get route(){return t(this.#i)}set route(e){s(this.#i,e)}#a=r({});get state(){return t(this.#a)}set state(e){s(this.#a,e)}#o=r(-1);get status(){return t(this.#o)}set status(e){s(this.#o,e)}#s=r(new URL(ct));get url(){return t(this.#s)}set url(e){s(this.#s,e)}},N=new class{#e=r(null);get current(){return t(this.#e)}set current(e){s(this.#e,e)}},ot=new class{#e=r(!1);get current(){return t(this.#e)}set current(e){s(this.#e,e)}},ke.v=()=>ot.current=!0);function lt(e){Object.assign(M,e)}var ut=`/__data.json`,dt=`.html__data.json`;function ft(e){return e.endsWith(`.html`)?e.replace(/\.html$/,dt):e.replace(/\/$/,``)+ut}var pt={spanContext(){return mt},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},mt={traceId:``,spanId:``,traceFlags:0};async function*ht(e,t){let n=!1,r=``,i=new TextDecoder;for(;;){let a=r.indexOf(t);for(;a!==-1;)yield r.slice(0,a),r=r.slice(a+t.length),a=r.indexOf(t);if(n){r&&(yield r);return}let o=await e.read();n=o.done,o.value&&(r+=i.decode(o.value,{stream:!0})),n&&(r+=i.decode())}}async function*gt(e){for await(let t of ht(e,`
2
+ `)){let e=t.trim();e&&(yield JSON.parse(e))}}var{onMount:_t,tick:vt}=o,yt=n??(e=>e()),bt=new Set([`icon`,`shortcut icon`,`apple-touch-icon`]),P=null,F=pe(`sveltekit:scroll`)??{},I=pe(`sveltekit:snapshot`)??{},L={url:Oe({}),page:Oe({}),navigating:c(null),updated:Ae()};function xt(e){F[e]=D()}function St(e,t){let n=e+1;for(;F[n];)delete F[n],n+=1;for(n=t+1;I[n];)delete I[n],n+=1}function R(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(g)}async function Ct(){if(`serviceWorker`in navigator){let e=await navigator.serviceWorker.getRegistration(S||`/`);e&&await e.update()}}var wt,Tt,Et,z,Dt,B,Ot={},kt={},At=[],jt=[],V=null;function Mt(){V?.fork?.then(e=>e?.discard()),V=null,Q={element:void 0,href:void 0}}var Nt=new Map,Pt=new Set,Ft=new Set,H=new Set,U={branch:[],error:null,url:null,nav:null},It=!1,Lt=!1,Rt=!0,W=!1,G=!1,zt=!1,Bt=!1,Vt,K,q,J,Y=new Set,Ht=new Map,Ut=new Map;async function Wt(e,t,n){if(globalThis.__sveltekit_mb3kxh.data){let{q:e={},p:t={},l:n={},f:r={}}=globalThis.__sveltekit_mb3kxh.data;for(let t in e)Ot[t]=e[t];for(let e in n)Ot[e]=n[e];for(let e in r)Ot[e]=r[e];for(let e in t)kt[e]=t[e]}document.URL!==location.href&&(location.href=location.href),B=e,await e.hooks.init?.(),wt=fe(e),z=document.documentElement,Dt=t,Tt=e.nodes[0],Et=e.nodes[1],Tt(),Et(),K=history.state?.[C],q=history.state?.[w],K||(K=q=Date.now(),history.replaceState({...history.state,[C]:K,[w]:q},``));let r=F[K];function i(){r&&(history.scrollRestoration=`manual`,scrollTo(r.x,r.y))}n?(i(),await xn(Dt,n)):(await Z({type:`enter`,url:Ce(B.hash?kn(new URL(location.href)):location.href),replace_state:!0}),i()),bn()}function Gt(){At.length=0,Bt=!1}function Kt(e){jt.some(e=>e?.snapshot)&&(I[e]=jt.map(e=>e?.snapshot?.capture()))}function qt(e){I[e]?.forEach((e,t)=>{jt[t]?.snapshot?.restore(e)})}function Jt(){xt(K),me(be,F),Kt(q),me(ye,I)}async function Yt(t,n,r,i){let a,o;n.invalidateAll&&Mt(),await Z({type:`goto`,url:Ce(t),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:r,nav_token:i,accept:()=>{if(n.invalidateAll){Bt=!0,a=new Set;for(let[e,t]of Ht)for(let[n,r]of t)r.resource?.reset(),a.add(j(e,n));o=new Set;for(let[e,t]of Ut)for(let n of t.keys())o.add(j(e,n))}n.invalidate&&n.invalidate.forEach(vn)}}),n.invalidateAll&&e().then(e).then(()=>{for(let[e,t]of Ht)for(let[n,{resource:r}]of t)a?.has(j(e,n))&&r.start();for(let[e,t]of Ut)for(let[n,{resource:r}]of t)o?.has(j(e,n))&&r.reconnect()})}async function Xt(e){if(e.id!==V?.id){Mt();let t={};Y.add(t),V={id:e.id,token:t,promise:sn({...e,preload:t}).then(e=>(Y.delete(t),e.type===`loaded`&&e.state.error&&Mt(),e)),fork:null}}return V.promise}async function Zt(e){let t=(await X(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(e=>e[1]()))}async function Qt(e,t,n){let r={params:U.params,route:{id:U.route?.id??null},url:new URL(location.href)};if(U={...e.state,nav:r},lt(e.props.page),Vt=new B.root({target:t,props:{...e.props,stores:L,components:jt},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),n){let e={from:null,to:{...r,scroll:F[K]??D()},willUnload:!1,type:`enter`,complete:Promise.resolve()};H.forEach(t=>t(e))}qt(q),Lt=!0}async function $t({url:e,params:t,branch:n,errors:r,status:i,error:a,route:o,form:s}){let c=`never`;if(S&&(e.pathname===S||e.pathname===S+`/`))c=`always`;else for(let e of n)e?.slash!==void 0&&(c=e.slash);e.pathname=f(e.pathname,c),e.search=e.search;let l={type:`loaded`,state:{url:e,params:t,branch:n,error:a,route:o},props:{constructors:tt(n).map(e=>e.node.component),page:On(M)}};s!==void 0&&(l.props.form=s);let u={},d=!M,p=0;for(let e=0;e<Math.max(n.length,U.branch.length);e+=1){let t=n[e],r=U.branch[e];t?.data!==r?.data&&(d=!0),t&&(u={...u,...t.data},d&&(l.props[`data_${p}`]=u),p+=1)}return(!U.url||e.href!==U.url.href||U.error!==a||s!==void 0&&s!==M.form||d)&&(l.props.page={error:a,params:t,route:{id:o?.id??null},state:{},status:i,url:new URL(e),form:s??null,data:d?u:M.data}),l}async function en({loader:e,parent:t,url:n,params:r,route:i,server_data_node:a}){let o=null,s=!0,c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();if(l.universal?.load){function e(...e){for(let t of e){let{href:e}=new URL(t,n);c.dependencies.add(e)}}let u={tracing:{enabled:!1,root:pt,current:pt},route:new Proxy(i,{get:(e,t)=>(s&&(c.route=!0),e[t])}),params:new Proxy(r,{get:(e,t)=>(s&&c.params.add(t),e[t])}),data:a?.data??null,url:h(n,()=>{s&&(c.url=!0)},e=>{s&&c.search_params.add(e)},B.hash),async fetch(t,r){t instanceof Request&&(r={body:t.method===`GET`||t.method===`HEAD`?void 0:await t.blob(),cache:t.cache,credentials:t.credentials,headers:[...t.headers].length>0?t?.headers:void 0,integrity:t.integrity,keepalive:t.keepalive,method:t.method,mode:t.mode,redirect:t.redirect,referrer:t.referrer,referrerPolicy:t.referrerPolicy,signal:t.signal,...r});let{resolved:i,promise:a}=tn(t,r,n);return s&&e(i.href),a},setHeaders:g,depends:e,parent(){return s&&(c.parent=!0),t()},untrack(e){s=!1;try{return e()}finally{s=!0}}};o=await l.universal.load.call(null,u)??null}return{node:l,loader:e,server:a,universal:l.universal?.load?{type:`data`,data:o,uses:c}:null,data:o??a?.data??null,slash:l.universal?.trailingSlash??a?.slash}}function tn(e,t,n){let r=e instanceof Request?e.url:e,i=new URL(r,n);return i.origin===n.origin&&(r=i.href.slice(n.origin.length)),{resolved:i,promise:Lt?re(r,i.href,t):ne(r,t)}}function nn(e,t,n,r,i,a){if(Bt)return!0;if(!i)return!1;if(i.parent&&e||i.route&&t||i.url&&n)return!0;for(let e of i.search_params)if(r.has(e))return!0;for(let e of i.params)if(a[e]!==U.params[e])return!0;for(let e of i.dependencies)if(At.some(t=>t(new URL(e))))return!0;return!1}function rn(e,t){return e?.type===`data`?e:e?.type===`skip`?t??null:null}function an(e,t){if(!e)return new Set(t.searchParams.keys());let n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(let r of n){let i=e.searchParams.getAll(r),a=t.searchParams.getAll(r);i.every(e=>a.includes(e))&&a.every(e=>i.includes(e))&&n.delete(r)}return n}function on({error:e,url:t,route:n,params:r}){return{type:`loaded`,state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:On(M),constructors:[]}}}async function sn({id:e,invalidating:t,url:n,params:r,route:i,preload:a}){if(V?.id===e)return Y.delete(V.token),V.promise;let{errors:o,layouts:s,leaf:c}=i,d=[...s,c];o.forEach(e=>e?.().catch(g)),d.forEach(e=>e?.[1]().catch(g));let f=null,p=U.url?e!==fn(U.url):!1,ee=U.route?i.id!==U.route.id:!1,m=an(U.url,n),h=!1;{let t=d.map((e,t)=>{let n=U.branch[t],i=!!e?.[0]&&(n?.loader!==e[1]||nn(h,ee,p,m,n.server?.uses,r));return i&&(h=!0),i});if(t.some(Boolean)){try{f=await Sn(n,t)}catch(t){let o=await $(t,{url:n,params:r,route:{id:e}});return a&&Y.has(a)?on({error:o,url:n,params:r,route:i}):ln({status:it(t),error:o,url:n,route:i})}if(f.type===`redirect`)return f}}let _=f?.nodes,te=!1,v=d.map(async(e,t)=>{if(!e)return;let a=U.branch[t],o=_?.[t];if((!o||o.type===`skip`)&&e[1]===a?.loader&&!nn(te,ee,p,m,a.universal?.uses,r))return a;if(te=!0,o?.type===`error`)throw o;return en({loader:e[1],url:n,params:r,route:i,parent:async()=>{let e={};for(let n=0;n<t;n+=1)Object.assign(e,(await v[n])?.data);return e},server_data_node:rn(o===void 0&&e[0]?{type:`skip`}:o??null,e[0]?a?.server:void 0)})});for(let e of v)e.catch(g);let y=[];for(let e=0;e<d.length;e+=1)if(d[e])try{y.push(await v[e])}catch(t){if(t instanceof u)return{type:`redirect`,location:t.location};if(a&&Y.has(a))return on({error:await $(t,{params:r,url:n,route:{id:i.id}}),url:n,params:r,route:i});let s=it(t),c;if(_?.includes(t))s=t.status??s,c=t.error;else if(t instanceof l)c=t.body;else{if(await L.updated.check())return await Ct(),await R(n);c=await $(t,{params:r,url:n,route:{id:i.id}})}let d=await cn(e,y,o);return d?$t({url:n,params:r,branch:y.slice(0,d.idx).concat(d.node),errors:o,status:s,error:c,route:i}):await mn(n,{id:i.id},c,s)}else y.push(void 0);return $t({url:n,params:r,branch:y,errors:o,status:200,error:null,route:i,form:t?void 0:null})}async function cn(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)--r;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function ln({status:e,error:t,url:n,route:r}){let i={},a=null;if(B.server_loads[0]===0)try{let e=await Sn(n,[!0]);if(e.type!==`data`||e.nodes[0]&&e.nodes[0].type!==`data`)throw 0;a=e.nodes[0]??null}catch(e){if(!(e instanceof l&&e.status===404)&&(n.origin!==E||n.pathname!==location.pathname||It))return await R(n)}try{return $t({url:n,params:i,branch:[await en({loader:Tt,url:n,params:i,route:r,parent:()=>Promise.resolve({}),server_data_node:rn(a)}),{node:await Et(),loader:Et,universal:null,server:null,data:null}],status:e,error:t,errors:[],route:null})}catch(t){if(t instanceof u){await Yt(new URL(t.location,location.href),{},0);return}let a=await B.get_error_template(),o=await $(t,{url:n,params:i,route:r}),s=a({status:e,message:String(o?.message??``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}),c=new DOMParser().parseFromString(s,`text/html`);throw document.documentElement.replaceChild(document.adoptNode(c.head),document.head),document.documentElement.replaceChild(document.adoptNode(c.body),document.body),t}}async function un(e){let t=e.href;if(Nt.has(t))return Nt.get(t);let n;try{let r=(async()=>{let t=await B.hooks.reroute({url:new URL(e),fetch:async(t,n)=>tn(t,n,e).promise})??e;if(typeof t==`string`){let n=new URL(e);B.hash?n.hash=t:n.pathname=t,t=n}return t})();Nt.set(t,r),n=await r}catch{Nt.delete(t);return}return n}async function X(e,t){if(e&&!A(e,S,B.hash)){let n=await un(e);if(!n)return;let r=dn(n);for(let n of wt){let i=n.exec(r);if(i)return{id:fn(e),invalidating:t,route:n,params:ee(i),url:e}}}}function dn(e){return p(B.hash?e.hash.replace(/^#/,``).replace(/[?#].+/,``):e.pathname.slice(S.length))||`/`}function fn(e){return(B.hash?e.hash.replace(/^#/,``):e.pathname)+e.search}function pn({url:e,type:t,intent:n,delta:r,event:i,scroll:a}){let o=!1,s=Dn(U,n,e,t,a??null);r!==void 0&&(s.navigation.delta=r),i!==void 0&&(s.navigation.event=i);let c={...s.navigation,cancel:()=>{o=!0,s.reject(Error(`navigation cancelled`))}};return W||Pt.forEach(e=>e(c)),o?null:s}async function Z({type:t,url:n,popped:r,keepfocus:a,noscroll:o,replace_state:s,state:c={},redirect_count:l=0,nav_token:u={},accept:f=g,block:p=g,event:ee}){let m=J;J=u;let h=await X(n,!1),_=t===`enter`?Dn(U,h,n,t):pn({url:n,type:t,delta:r?.delta,intent:h,scroll:r?.scroll,event:ee});if(!_){p(),J===u&&(J=m);return}let te=K,v=q;f(),W=!0,Lt&&_.navigation.type!==`enter`&&L.navigating.set(N.current=_.navigation);let y=h&&await sn(h);if(!y){if(A(n,S,B.hash))return await R(n,s);y=await mn(n,{id:null},await $(new d(404,`Not Found`,`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404,s)}if(n=h?.url||n,J!==u){_.reject(Error(`navigation aborted`));return}if(!y)return;if(y.type===`redirect`){if(l<20){await Z({type:t,url:new URL(y.location,n),popped:r,keepfocus:a,noscroll:o,replace_state:s,state:c,redirect_count:l+1,nav_token:u}),_.fulfil(void 0);return}if(y=await ln({status:500,error:await $(Error(`Redirect loop`),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}}),!y)return}else if(y.props.page.status>=400&&await L.updated.check())return await Ct(),await R(n,s);if(Gt(),xt(te),Kt(v),y.props.page.url.pathname!==n.pathname&&(n.pathname=y.props.page.url.pathname),c=r?r.state:c,!r){let e=+!s,t={[C]:K+=e,[w]:q+=e,[xe]:c};(s?history.replaceState:history.pushState).call(history,t,``,n),s||St(K,q)}let ne=h&&V?.id===h.id?V.fork:null;V?.fork&&!ne?Mt():(V=null,Q={element:void 0,href:void 0}),y.props.page.state=c;let re;if(Lt){let e=(await Promise.all(Array.from(Ft,e=>e(_.navigation)))).filter(e=>typeof e==`function`);if(e.length>0){function t(){e.forEach(e=>{H.delete(e)})}e.push(t),e.forEach(e=>{H.add(e)})}let t=_.navigation.to;U={...y.state,nav:{params:t.params,route:t.route,url:t.url}},y.props.page&&(y.props.page.url=n),!a&&document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur();let r=ne&&await ne;r?re=r.commit():(P=null,Vt.$set(y.props),P&&Object.assign(y.props.page,P),lt(y.props.page),re=i?.()),zt=!0}else await Qt(y,Dt,!1);let{activeElement:b}=document;if(await re,await e(),await e(),J!==u){_.reject(Error(`navigation aborted`));return}y.props.page&&P&&Object.assign(y.props.page,P);let x=null;if(Rt){let e=r?r.scroll:o?D():null;e?scrollTo(e.x,e.y):(x=n.hash&&document.getElementById(An(n)))?x.scrollIntoView():scrollTo(0,0)}let ie=document.activeElement!==b&&document.activeElement!==document.body;!a&&!ie&&En(n,!x),Rt=!0,W=!1,_.fulfil(void 0),_.navigation.to&&(_.navigation.to.scroll=D()),H.forEach(e=>e(_.navigation)),t===`popstate`&&qt(q),L.navigating.set(N.current=null)}async function mn(e,t,n,r,i){return e.origin===E&&e.pathname===location.pathname&&!It?await ln({status:r,error:n,url:e,route:t}):await R(e,i)}var Q={element:void 0,href:void 0};function hn(){let e,t;z.addEventListener(`mousemove`,t=>{let n=t.target;clearTimeout(e),e=setTimeout(()=>{i(n,T.hover)},20)});function n(e){e.defaultPrevented||i(e.composedPath()[0],T.tap)}z.addEventListener(`mousedown`,n),z.addEventListener(`touchstart`,n,{passive:!0});let r=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&(Zt(new URL(t.target.href)),r.unobserve(t.target))},{threshold:0});async function i(e,n){let r=Ee(e,z),i=r===Q.element&&r?.href===Q.href&&n>=t;if(!r||i)return;let{url:a,external:o,download:s}=De(r,S,B.hash);if(o||s)return;let c=k(r),l=a&&fn(U.url)===fn(a);if(!(c.reload||l)){if(n<=c.preload_data){Q={element:r,href:r.href},t=T.tap;let e=await X(a,!1);if(!e)return;Xt(e)}else n<=c.preload_code&&(Q={element:r,href:r.href},t=n,Zt(a))}}function a(){r.disconnect();for(let e of z.querySelectorAll(`a`)){let{url:t,external:n,download:i}=De(e,S,B.hash);if(n||i)continue;let a=k(e);a.reload||(a.preload_code===T.viewport&&r.observe(e),a.preload_code===T.eager&&Zt(t))}}H.add(a),a()}function $(e,t){if(e instanceof l)return e.body;let n=it(e),r=at(e);return B.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function gn(e,t){_t(()=>(e.add(t),()=>{e.delete(t)}))}function _n(e){gn(H,e)}function vn(e){if(typeof e==`function`)At.push(e);else{let{href:t}=new URL(e,location.href);At.push(e=>e.href===t)}}function yn(e,t){let n={[C]:K,[w]:q,[Se]:M.url.href,[xe]:t};history.replaceState(n,``,Ce(e)),M.state=t,Vt.$set({page:yt(()=>On(M))})}function bn(){history.scrollRestoration=`manual`,addEventListener(`beforeunload`,e=>{let t=!1;if(Jt(),!W){let e=Dn(U,void 0,null,`leave`),n={...e.navigation,cancel:()=>{t=!0,e.reject(Error(`navigation cancelled`))}};Pt.forEach(e=>e(n))}t?(e.preventDefault(),e.returnValue=``):history.scrollRestoration=`auto`}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&Jt()}),navigator.connection?.saveData||hn(),z.addEventListener(`click`,async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;let n=Ee(t.composedPath()[0],z);if(!n)return;let{url:r,external:i,target:a,download:o}=De(n,S,B.hash);if(!r)return;if(a===`_parent`||a===`_top`){if(window.parent!==window)return}else if(a&&a!==`_self`)return;let s=k(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&r.protocol!==`https:`&&r.protocol!==`http:`||o)return;let[c,l]=(B.hash?r.hash.replace(/^#/,``):r.href).split(`#`),u=c===m(location);if(i||s.reload&&(!u||!l)){pn({url:r,type:`link`,event:t})?W=!0:t.preventDefault();return}if(l!==void 0&&u){let[,i]=U.url.href.split(`#`);if(i===l){if(t.preventDefault(),l===``||l===`top`&&n.ownerDocument.getElementById(`top`)===null)scrollTo({top:0});else{let e=n.ownerDocument.getElementById(decodeURIComponent(l));e&&(e.scrollIntoView(),e.focus())}return}if(G=!0,xt(K),e(r),!s.replace_state)return;G=!1}t.preventDefault(),await new Promise(e=>{requestAnimationFrame(()=>{setTimeout(e,0)}),setTimeout(e,100)}),await Z({type:`link`,url:r,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??r.href===location.href,event:t})}),z.addEventListener(`submit`,e=>{if(e.defaultPrevented)return;let t=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if((n?.formTarget||t.target)===`_blank`||(n?.formMethod||t.method)!==`get`)return;let r=new URL(n?.hasAttribute(`formaction`)&&n?.formAction||t.action);if(A(r,S,!1))return;let i=e.target,a=k(i);if(a.reload)return;e.preventDefault(),e.stopPropagation();let o=new FormData(i,n);r.search=new URLSearchParams(o).toString(),Z({type:`form`,url:r,keepfocus:a.keepfocus,noscroll:a.noscroll,replace_state:a.replace_state??r.href===location.href,event:e})}),addEventListener(`popstate`,async t=>{if(!Tn){if(t.state?.[`sveltekit:history`]){let n=t.state[C];if(J={},n===K)return;let r=F[n],i=t.state[`sveltekit:states`]??{},a=new URL(t.state[`sveltekit:pageurl`]??location.href),o=t.state[w],s=U.url?m(location)===m(U.url):!1;if(o===q&&(zt||s)){i!==M.state&&(M.state=i),e(a),F[K]=D(),r&&scrollTo(r.x,r.y),K=n;return}let c=n-K;await Z({type:`popstate`,url:a,popped:{state:i,scroll:r,delta:c},accept:()=>{K=n,q=o},block:()=>{history.go(-c)},nav_token:J,event:t})}else G||(e(new URL(location.href)),B.hash&&location.reload())}}),addEventListener(`hashchange`,()=>{G&&(G=!1,history.replaceState({...history.state,[C]:++K,[w]:q},``,location.href))});for(let e of document.querySelectorAll(`link`))bt.has(e.rel)&&(e.href=e.href);addEventListener(`pageshow`,e=>{e.persisted&&L.navigating.set(N.current=null)});function e(e){U.url=M.url=e,L.page.set(On(M)),L.page.notify()}}async function xn(e,{status:t=200,error:n,node_ids:r,params:i,route:a,server_route:o,data:s,form:c}){It=!0;let l=new URL(location.href),d;({params:i={},route:a={id:null}}=await X(l,!1)||{}),d=wt.find(({id:e})=>e===a.id);let f,p=!0;try{let e=r.map(async(t,n)=>{let r=s[n];return r?.uses&&(r.uses=wn(r.uses)),en({loader:B.nodes[t],url:l,params:i,route:a,parent:async()=>{let t={};for(let r=0;r<n;r+=1)Object.assign(t,(await e[r]).data);return t},server_data_node:rn(r)})}),o=await Promise.all(e);if(d){let e=d.layouts;for(let t=0;t<e.length;t++)e[t]||o.splice(t,0,void 0)}f=await $t({url:l,params:i,branch:o,status:t,error:n,errors:d?.errors,form:c,route:d??null})}catch(t){if(t instanceof u)return await R(new URL(t.location,location.href));f=await ln({status:it(t),error:await $(t,{url:l,params:i,route:a}),url:l,route:a}),e.textContent=``,p=!1}f&&(f.props.page&&(f.props.page.state={}),await Qt(f,e,p))}async function Sn(e,t){let n=new URL(e);n.pathname=ft(e.pathname),e.pathname.endsWith(`/`)&&n.searchParams.append(rt,`1`),n.searchParams.append(nt,t.map(e=>e?`1`:`0`).join(``));let r=await(0,window.fetch)(n.href,{});if(!r.ok){let e;throw r.headers.get(`content-type`)?.includes(`application/json`)?e=await r.json():r.status===404?e=`Not Found`:r.status===500&&(e=`Internal Error`),new l(r.status,e)}return new Promise((e,t)=>{Cn(e,r).catch(t)})}async function Cn(e,t){let n=t.body.getReader(),r=new Map;function i(e){return $e(e,{...B.decoders,Promise:e=>new Promise((t,n)=>{r.set(e,{fulfil:t,reject:n})})})}for await(let t of gt(n)){if(t.type===`redirect`)return e(t);if(t.type===`data`)t.nodes?.forEach(e=>{e?.type===`data`&&(e.uses=wn(e.uses),e.data=i(e.data))}),e(t);else if(t.type===`chunk`){let{id:e,data:n,error:a}=t,o=r.get(e);r.delete(e),a?o.reject(i(a)):o.fulfil(i(n))}}}function wn(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??[])}}var Tn=!1;function En(e,t=!0){let n=document.querySelector(`[autofocus]`);if(n)n.focus();else{let n=An(e);if(n&&document.getElementById(n)){let{x:r,y:i}=D();setTimeout(()=>{let a=history.state;Tn=!0,location.replace(new URL(`#${n}`,location.href)),history.replaceState(a,``,e),t&&scrollTo(r,i),Tn=!1})}else{let e=document.body,t=e.getAttribute(`tabindex`);e.tabIndex=-1,e.focus({preventScroll:!0,focusVisible:!1}),t===null?e.removeAttribute(`tabindex`):e.setAttribute(`tabindex`,t)}let r=getSelection();if(r&&r.type!==`None`){let e=[];for(let t=0;t<r.rangeCount;t+=1)e.push(r.getRangeAt(t));setTimeout(()=>{if(r.rangeCount===e.length){for(let t=0;t<r.rangeCount;t+=1){let n=e[t],i=r.getRangeAt(t);if(n.commonAncestorContainer!==i.commonAncestorContainer||n.startContainer!==i.startContainer||n.endContainer!==i.endContainer||n.startOffset!==i.startOffset||n.endOffset!==i.endOffset)return}r.removeAllRanges()}})}}}function Dn(e,t,n,r,i=null){let a,o,s=new Promise((e,t)=>{a=e,o=t});return s.catch(g),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:D()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:i},willUnload:!t,type:r,complete:s},fulfil:a,reject:o}}function On(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 kn(e){let t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function An(e){let t;if(B.hash){let[,,n]=e.hash.split(`#`,3);t=n??``}else t=e.hash.slice(1);return decodeURIComponent(t)}export{M as a,N as i,yn as n,je as o,Wt as r,_e as s,_n as t};
@@ -0,0 +1 @@
1
+ import{U as e}from"../nodes/2.BiOhzV1A.js";export{e as startPanelResize};