@jefuriiij/synthra 0.16.1 → 0.17.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/CHANGELOG.md +17 -0
- package/README.md +2 -0
- package/dist/cli/index.js +680 -632
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/index.js +322 -90
- package/dist/dashboard/index.js.map +1 -1
- package/package.json +1 -1
package/dist/dashboard/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Hono } from "hono";
|
|
|
5
5
|
// package.json
|
|
6
6
|
var package_default = {
|
|
7
7
|
name: "@jefuriiij/synthra",
|
|
8
|
-
version: "0.
|
|
8
|
+
version: "0.17.0",
|
|
9
9
|
publishConfig: {
|
|
10
10
|
access: "public"
|
|
11
11
|
},
|
|
@@ -91,6 +91,60 @@ var package_default = {
|
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
+
// src/cli/doctor-command.ts
|
|
95
|
+
import { readFile as readFile2, stat } from "fs/promises";
|
|
96
|
+
import { homedir } from "os";
|
|
97
|
+
import { join as join2, resolve } from "path";
|
|
98
|
+
import spawn from "cross-spawn";
|
|
99
|
+
|
|
100
|
+
// src/graph/types.ts
|
|
101
|
+
var SCHEMA_VERSION = 2;
|
|
102
|
+
|
|
103
|
+
// src/hooks/claude-md.ts
|
|
104
|
+
import { readFile, writeFile } from "fs/promises";
|
|
105
|
+
import { basename, dirname } from "path";
|
|
106
|
+
var POLICY_VERSION = 9;
|
|
107
|
+
var POLICY_BEGIN = `<!-- synthra-policy v${POLICY_VERSION} BEGIN -->`;
|
|
108
|
+
var POLICY_END = `<!-- synthra-policy v${POLICY_VERSION} END -->`;
|
|
109
|
+
|
|
110
|
+
// src/shared/config.ts
|
|
111
|
+
function num(name, fallback) {
|
|
112
|
+
const v = process.env[name];
|
|
113
|
+
if (!v) return fallback;
|
|
114
|
+
const n = Number(v);
|
|
115
|
+
return Number.isFinite(n) ? n : fallback;
|
|
116
|
+
}
|
|
117
|
+
function str(name, fallback) {
|
|
118
|
+
return process.env[name] ?? fallback;
|
|
119
|
+
}
|
|
120
|
+
function loadConfig() {
|
|
121
|
+
return {
|
|
122
|
+
hardMaxReadChars: num("SYN_HARD_MAX_READ_CHARS", 4e3),
|
|
123
|
+
gateHintMaxChars: num("SYN_GATE_HINT_CHARS", 1200),
|
|
124
|
+
readDepsMaxChars: num("SYN_READ_DEPS_CHARS", 900),
|
|
125
|
+
turnReadBudgetChars: num("SYN_TURN_READ_BUDGET_CHARS", 18e3),
|
|
126
|
+
fallbackMaxCallsPerTurn: num("SYN_FALLBACK_MAX_CALLS_PER_TURN", 1),
|
|
127
|
+
retrieveCacheTtlSec: num("SYN_RETRIEVE_CACHE_TTL_SEC", 900),
|
|
128
|
+
// Auto-reindex: re-run the incremental scan + swap the in-memory graph this
|
|
129
|
+
// many ms after the last source-file change, so graph reads never go stale
|
|
130
|
+
// mid-session. Set SYN_NO_AUTOREINDEX to disable entirely.
|
|
131
|
+
reindexDebounceMs: num("SYN_REINDEX_DEBOUNCE_MS", 1e3),
|
|
132
|
+
autoReindex: !process.env.SYN_NO_AUTOREINDEX,
|
|
133
|
+
// Observe-only: log codebase-exploration Bash commands (grep/cat/find …) so
|
|
134
|
+
// the terminal bypass of the Moat can be measured. Never blocks. Opt out
|
|
135
|
+
// with SYN_NO_BASH_OBSERVE.
|
|
136
|
+
bashObserve: !process.env.SYN_NO_BASH_OBSERVE,
|
|
137
|
+
// The Dispatcher: per-prompt routing hints (best-fit agent/skill/model).
|
|
138
|
+
// Silent unless the top agent clears routeMinScore. SYN_NO_ROUTE disables.
|
|
139
|
+
route: !process.env.SYN_NO_ROUTE,
|
|
140
|
+
routeMinScore: num("SYN_ROUTE_MIN_SCORE", 3),
|
|
141
|
+
mcpPort: process.env.SYN_MCP_PORT ? num("SYN_MCP_PORT", 0) : null,
|
|
142
|
+
dashboardPort: num("SYN_DASHBOARD_PORT", 8901),
|
|
143
|
+
logLevel: str("SYN_LOG_LEVEL", "info"),
|
|
144
|
+
claudeBin: str("SYN_CLAUDE_BIN", "claude")
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
94
148
|
// src/shared/logger.ts
|
|
95
149
|
var LEVEL_PRIORITY = {
|
|
96
150
|
debug: 10,
|
|
@@ -115,6 +169,209 @@ var log = {
|
|
|
115
169
|
error: (m, ...a) => emit("error", m, ...a)
|
|
116
170
|
};
|
|
117
171
|
|
|
172
|
+
// src/shared/paths.ts
|
|
173
|
+
import { join } from "path";
|
|
174
|
+
function resolvePaths(projectRoot) {
|
|
175
|
+
const graphDir = join(projectRoot, ".synthra-graph");
|
|
176
|
+
const contextDir = join(projectRoot, ".synthra");
|
|
177
|
+
const claudeDir = join(projectRoot, ".claude");
|
|
178
|
+
return {
|
|
179
|
+
projectRoot,
|
|
180
|
+
graphDir,
|
|
181
|
+
contextDir,
|
|
182
|
+
infoGraph: join(graphDir, "info_graph.json"),
|
|
183
|
+
symbolIndex: join(graphDir, "symbol_index.json"),
|
|
184
|
+
sessionState: join(graphDir, "session.json"),
|
|
185
|
+
activityLog: join(graphDir, "activity.jsonl"),
|
|
186
|
+
tokenLog: join(graphDir, "token_log.jsonl"),
|
|
187
|
+
gateLog: join(graphDir, "gate_log.jsonl"),
|
|
188
|
+
bashLog: join(graphDir, "bash_log.jsonl"),
|
|
189
|
+
routeLog: join(graphDir, "route_log.jsonl"),
|
|
190
|
+
toolLog: join(graphDir, "tool_log.jsonl"),
|
|
191
|
+
accessLog: join(graphDir, "access_log.jsonl"),
|
|
192
|
+
learnStore: join(graphDir, "learn_store.json"),
|
|
193
|
+
parseCache: join(graphDir, "parse_cache.json"),
|
|
194
|
+
mcpPort: join(graphDir, "mcp_port"),
|
|
195
|
+
mcpServerLog: join(graphDir, "mcp_server.log"),
|
|
196
|
+
mcpServerErrLog: join(graphDir, "mcp_server.err.log"),
|
|
197
|
+
contextStore: join(contextDir, "context-store.json"),
|
|
198
|
+
contextMd: join(contextDir, "CONTEXT.md"),
|
|
199
|
+
branchesDir: join(contextDir, "branches"),
|
|
200
|
+
claudeDir,
|
|
201
|
+
claudeSettings: join(claudeDir, "settings.local.json"),
|
|
202
|
+
claudeHooksDir: join(claudeDir, "hooks"),
|
|
203
|
+
claudeMd: join(projectRoot, "CLAUDE.md"),
|
|
204
|
+
gitignore: join(projectRoot, ".gitignore")
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// src/cli/doctor-command.ts
|
|
209
|
+
var ICON = { ok: "\u2705", warn: "\u26A0\uFE0F", fail: "\u274C" };
|
|
210
|
+
function binWorks(bin, args) {
|
|
211
|
+
return new Promise((res) => {
|
|
212
|
+
let proc;
|
|
213
|
+
try {
|
|
214
|
+
proc = spawn(bin, args, { stdio: "ignore" });
|
|
215
|
+
} catch {
|
|
216
|
+
res(false);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
proc.on("error", () => res(false));
|
|
220
|
+
proc.on("exit", (code) => res(code === 0));
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
async function exists(path) {
|
|
224
|
+
try {
|
|
225
|
+
await stat(path);
|
|
226
|
+
return true;
|
|
227
|
+
} catch {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
async function runDoctorChecks(projectRoot) {
|
|
232
|
+
const paths = resolvePaths(projectRoot);
|
|
233
|
+
const cfg = loadConfig();
|
|
234
|
+
const checks = [];
|
|
235
|
+
const nodeMajor = Number(process.versions.node.split(".")[0]);
|
|
236
|
+
checks.push(
|
|
237
|
+
nodeMajor >= 18 ? { status: "ok", label: "Node", detail: `v${process.versions.node}` } : {
|
|
238
|
+
status: "fail",
|
|
239
|
+
label: "Node",
|
|
240
|
+
detail: `v${process.versions.node} \u2014 Synthra needs Node >= 18`
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
const hasJq = await binWorks("jq", ["--version"]);
|
|
244
|
+
if (process.platform === "win32") {
|
|
245
|
+
checks.push({
|
|
246
|
+
status: "ok",
|
|
247
|
+
label: "jq",
|
|
248
|
+
detail: hasJq ? "present (not required \u2014 Windows uses .ps1 hooks)" : "not required on Windows (.ps1 hooks)"
|
|
249
|
+
});
|
|
250
|
+
} else {
|
|
251
|
+
checks.push(
|
|
252
|
+
hasJq ? { status: "ok", label: "jq", detail: "present" } : {
|
|
253
|
+
status: "warn",
|
|
254
|
+
label: "jq",
|
|
255
|
+
detail: "missing \u2014 Stop/PreToolUse bash hooks silently no-op (no token logging or gating). Install jq (brew/apt)."
|
|
256
|
+
}
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
const hasClaude = await binWorks(cfg.claudeBin, ["--version"]);
|
|
260
|
+
checks.push(
|
|
261
|
+
hasClaude ? { status: "ok", label: "claude CLI", detail: `'${cfg.claudeBin}' on PATH` } : {
|
|
262
|
+
status: "warn",
|
|
263
|
+
label: "claude CLI",
|
|
264
|
+
detail: `'${cfg.claudeBin}' not found \u2014 MCP registration + IDE need it (set SYN_CLAUDE_BIN to override).`
|
|
265
|
+
}
|
|
266
|
+
);
|
|
267
|
+
if (!await exists(paths.infoGraph)) {
|
|
268
|
+
checks.push({
|
|
269
|
+
status: "warn",
|
|
270
|
+
label: "Graph",
|
|
271
|
+
detail: "no info_graph.json \u2014 run `syn .` (or `syn scan`) here."
|
|
272
|
+
});
|
|
273
|
+
} else {
|
|
274
|
+
try {
|
|
275
|
+
const graph = JSON.parse(await readFile2(paths.infoGraph, "utf8"));
|
|
276
|
+
const parts = [`${graph.symbol_count} symbols`, `${graph.file_count} files`];
|
|
277
|
+
let status = "ok";
|
|
278
|
+
const ageMs = Date.now() - Date.parse(graph.generated_at);
|
|
279
|
+
if (Number.isFinite(ageMs))
|
|
280
|
+
parts.push(`scanned ${Math.max(0, Math.round(ageMs / 6e4))}m ago`);
|
|
281
|
+
if (graph.schema_version !== SCHEMA_VERSION) {
|
|
282
|
+
status = "warn";
|
|
283
|
+
parts.push(`schema v${graph.schema_version} \u2260 v${SCHEMA_VERSION} (auto-rescans on serve)`);
|
|
284
|
+
}
|
|
285
|
+
if (graph.symbol_count === 0) {
|
|
286
|
+
status = "warn";
|
|
287
|
+
parts.push("0 symbols \u2014 unsupported language or nothing indexed");
|
|
288
|
+
}
|
|
289
|
+
checks.push({ status, label: "Graph", detail: parts.join(" \xB7 ") });
|
|
290
|
+
} catch {
|
|
291
|
+
checks.push({
|
|
292
|
+
status: "warn",
|
|
293
|
+
label: "Graph",
|
|
294
|
+
detail: "info_graph.json unreadable \u2014 re-run `syn scan`."
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
checks.push(
|
|
299
|
+
await exists(join2(projectRoot, ".mcp.json")) ? {
|
|
300
|
+
status: "ok",
|
|
301
|
+
label: "MCP registration",
|
|
302
|
+
detail: ".mcp.json present (IDE can see graph_* tools)"
|
|
303
|
+
} : {
|
|
304
|
+
status: "warn",
|
|
305
|
+
label: "MCP registration",
|
|
306
|
+
detail: "no .mcp.json \u2014 the IDE extension won't see Synthra's tools; run `syn .`."
|
|
307
|
+
}
|
|
308
|
+
);
|
|
309
|
+
if (!await exists(paths.claudeMd)) {
|
|
310
|
+
checks.push({
|
|
311
|
+
status: "warn",
|
|
312
|
+
label: "CLAUDE.md policy",
|
|
313
|
+
detail: "no CLAUDE.md \u2014 run `syn .` to scaffold + inject the policy block."
|
|
314
|
+
});
|
|
315
|
+
} else {
|
|
316
|
+
const md = await readFile2(paths.claudeMd, "utf8");
|
|
317
|
+
if (md.includes(`synthra-policy v${POLICY_VERSION} BEGIN`)) {
|
|
318
|
+
checks.push({
|
|
319
|
+
status: "ok",
|
|
320
|
+
label: "CLAUDE.md policy",
|
|
321
|
+
detail: `policy block v${POLICY_VERSION}`
|
|
322
|
+
});
|
|
323
|
+
} else {
|
|
324
|
+
const m = md.match(/synthra-policy v(\d+) BEGIN/);
|
|
325
|
+
checks.push({
|
|
326
|
+
status: "warn",
|
|
327
|
+
label: "CLAUDE.md policy",
|
|
328
|
+
detail: m ? `policy block is v${m[1]}, current is v${POLICY_VERSION} \u2014 re-run \`syn .\` to refresh.` : "no synthra-policy block \u2014 run `syn .`."
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
if (!await exists(paths.claudeSettings)) {
|
|
333
|
+
checks.push({
|
|
334
|
+
status: "warn",
|
|
335
|
+
label: "Hooks",
|
|
336
|
+
detail: "no .claude/settings.local.json \u2014 run `syn .` to install hooks."
|
|
337
|
+
});
|
|
338
|
+
} else {
|
|
339
|
+
const s = await readFile2(paths.claudeSettings, "utf8");
|
|
340
|
+
checks.push(
|
|
341
|
+
s.includes("synthra-hook=true") ? { status: "ok", label: "Hooks", detail: "registered in .claude/settings.local.json" } : {
|
|
342
|
+
status: "warn",
|
|
343
|
+
label: "Hooks",
|
|
344
|
+
detail: "settings.local.json present but no Synthra hooks \u2014 run `syn .`."
|
|
345
|
+
}
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
return checks;
|
|
349
|
+
}
|
|
350
|
+
function redactHome(text, home = homedir()) {
|
|
351
|
+
if (!home) return text;
|
|
352
|
+
const variants = [home, home.replace(/\\/g, "/"), home.replace(/\//g, "\\")];
|
|
353
|
+
let out = text;
|
|
354
|
+
for (const v of new Set(variants)) {
|
|
355
|
+
out = out.split(v).join("~");
|
|
356
|
+
}
|
|
357
|
+
return out;
|
|
358
|
+
}
|
|
359
|
+
function buildDiagnosticReport(checks, info) {
|
|
360
|
+
const lines = [
|
|
361
|
+
"### Synthra diagnostic report",
|
|
362
|
+
"",
|
|
363
|
+
`- Synthra: v${info.version}`,
|
|
364
|
+
`- OS: ${info.platform} ${info.arch}`,
|
|
365
|
+
`- Node: v${info.node}`,
|
|
366
|
+
`- claude bin: ${redactHome(info.claudeBin)}`,
|
|
367
|
+
""
|
|
368
|
+
];
|
|
369
|
+
for (const c of checks) {
|
|
370
|
+
lines.push(`- ${ICON[c.status]} **${c.label}** \u2014 ${redactHome(c.detail)}`);
|
|
371
|
+
}
|
|
372
|
+
return lines.join("\n");
|
|
373
|
+
}
|
|
374
|
+
|
|
118
375
|
// src/server/port.ts
|
|
119
376
|
import { createServer } from "net";
|
|
120
377
|
var PORT_RANGE_START = 8080;
|
|
@@ -126,23 +383,23 @@ async function findFreePort(start = PORT_RANGE_START, end = PORT_RANGE_END) {
|
|
|
126
383
|
throw new Error(`Synthra: no free port in ${start}-${end}`);
|
|
127
384
|
}
|
|
128
385
|
function isFree(port) {
|
|
129
|
-
return new Promise((
|
|
386
|
+
return new Promise((resolve2) => {
|
|
130
387
|
const s = createServer();
|
|
131
|
-
s.once("error", () =>
|
|
132
|
-
s.once("listening", () => s.close(() =>
|
|
388
|
+
s.once("error", () => resolve2(false));
|
|
389
|
+
s.once("listening", () => s.close(() => resolve2(true)));
|
|
133
390
|
s.listen(port, "127.0.0.1");
|
|
134
391
|
});
|
|
135
392
|
}
|
|
136
393
|
|
|
137
394
|
// src/dashboard/arsenal.ts
|
|
138
|
-
import { readFile, readdir } from "fs/promises";
|
|
139
|
-
import { homedir } from "os";
|
|
140
|
-
import { basename, dirname, join } from "path";
|
|
395
|
+
import { readFile as readFile3, readdir } from "fs/promises";
|
|
396
|
+
import { homedir as homedir2 } from "os";
|
|
397
|
+
import { basename as basename2, dirname as dirname2, join as join3 } from "path";
|
|
141
398
|
var DESC_MAX = 300;
|
|
142
399
|
var TOOLS_MAX = 200;
|
|
143
400
|
async function readText(path) {
|
|
144
401
|
try {
|
|
145
|
-
return await
|
|
402
|
+
return await readFile3(path, "utf8");
|
|
146
403
|
} catch {
|
|
147
404
|
return null;
|
|
148
405
|
}
|
|
@@ -218,7 +475,7 @@ function agentItem(fm, fallbackName, scope, source) {
|
|
|
218
475
|
}
|
|
219
476
|
async function scanSkillsDir(dir, scope, source, out) {
|
|
220
477
|
for (const name of await listNames(dir)) {
|
|
221
|
-
const md = await readText(
|
|
478
|
+
const md = await readText(join3(dir, name, "SKILL.md"));
|
|
222
479
|
if (md === null) continue;
|
|
223
480
|
out.push(skillItem(parseFrontmatter(md), name, scope, source));
|
|
224
481
|
}
|
|
@@ -226,9 +483,9 @@ async function scanSkillsDir(dir, scope, source, out) {
|
|
|
226
483
|
async function scanAgentsDir(dir, scope, source, out) {
|
|
227
484
|
for (const file of await listNames(dir)) {
|
|
228
485
|
if (!file.endsWith(".md")) continue;
|
|
229
|
-
const md = await readText(
|
|
486
|
+
const md = await readText(join3(dir, file));
|
|
230
487
|
if (md === null) continue;
|
|
231
|
-
out.push(agentItem(parseFrontmatter(md),
|
|
488
|
+
out.push(agentItem(parseFrontmatter(md), basename2(file, ".md"), scope, source));
|
|
232
489
|
}
|
|
233
490
|
}
|
|
234
491
|
function mcpItemsFrom(json, scope, source) {
|
|
@@ -259,33 +516,33 @@ function sortItems(items) {
|
|
|
259
516
|
}
|
|
260
517
|
var cache = null;
|
|
261
518
|
var CACHE_TTL_MS = 15e3;
|
|
262
|
-
async function computeArsenal(projectRoot, homeDir =
|
|
519
|
+
async function computeArsenal(projectRoot, homeDir = homedir2()) {
|
|
263
520
|
const key = `${projectRoot}\0${homeDir}`;
|
|
264
521
|
const now = Date.now();
|
|
265
522
|
if (cache && cache.key === key && now - cache.at < CACHE_TTL_MS) return cache.data;
|
|
266
|
-
const homeClaude =
|
|
267
|
-
const projClaude =
|
|
523
|
+
const homeClaude = join3(homeDir, ".claude");
|
|
524
|
+
const projClaude = join3(projectRoot, ".claude");
|
|
268
525
|
const skills = [];
|
|
269
526
|
const agents = [];
|
|
270
527
|
const mcp = [];
|
|
271
|
-
await scanSkillsDir(
|
|
272
|
-
await scanSkillsDir(
|
|
273
|
-
await scanAgentsDir(
|
|
274
|
-
await scanAgentsDir(
|
|
275
|
-
mcp.push(...mcpItemsFrom(await readJson(
|
|
528
|
+
await scanSkillsDir(join3(projClaude, "skills"), "project", void 0, skills);
|
|
529
|
+
await scanSkillsDir(join3(homeClaude, "skills"), "personal", void 0, skills);
|
|
530
|
+
await scanAgentsDir(join3(projClaude, "agents"), "project", void 0, agents);
|
|
531
|
+
await scanAgentsDir(join3(homeClaude, "agents"), "personal", void 0, agents);
|
|
532
|
+
mcp.push(...mcpItemsFrom(await readJson(join3(projectRoot, ".mcp.json")), "project", void 0));
|
|
276
533
|
mcp.push(
|
|
277
534
|
...mcpItemsFrom(
|
|
278
|
-
(await readJson(
|
|
535
|
+
(await readJson(join3(homeDir, ".claude.json")))?.mcpServers,
|
|
279
536
|
"personal",
|
|
280
537
|
void 0
|
|
281
538
|
)
|
|
282
539
|
);
|
|
283
540
|
const installedRaw = await readJson(
|
|
284
|
-
|
|
541
|
+
join3(homeClaude, "plugins", "installed_plugins.json")
|
|
285
542
|
);
|
|
286
543
|
const pluginsMap = installedRaw?.plugins ?? installedRaw ?? {};
|
|
287
544
|
const settings = await readJson(
|
|
288
|
-
|
|
545
|
+
join3(homeClaude, "settings.json")
|
|
289
546
|
);
|
|
290
547
|
const enabledMap = settings?.enabledPlugins ?? {};
|
|
291
548
|
let pluginCount = 0;
|
|
@@ -297,35 +554,35 @@ async function computeArsenal(projectRoot, homeDir = homedir()) {
|
|
|
297
554
|
const enabled = enabledMap[pluginKey] !== false;
|
|
298
555
|
const root = entry.installPath;
|
|
299
556
|
const manifest = await readJson(
|
|
300
|
-
|
|
557
|
+
join3(root, ".claude-plugin", "plugin.json")
|
|
301
558
|
);
|
|
302
559
|
const agentFiles = /* @__PURE__ */ new Set();
|
|
303
|
-
for (const f of await listNames(
|
|
304
|
-
if (f.endsWith(".md")) agentFiles.add(
|
|
560
|
+
for (const f of await listNames(join3(root, "agents"))) {
|
|
561
|
+
if (f.endsWith(".md")) agentFiles.add(join3(root, "agents", f));
|
|
305
562
|
}
|
|
306
|
-
for (const rel of manifest?.agents ?? []) agentFiles.add(
|
|
563
|
+
for (const rel of manifest?.agents ?? []) agentFiles.add(join3(root, rel));
|
|
307
564
|
const pAgents = [];
|
|
308
565
|
for (const file of agentFiles) {
|
|
309
566
|
const md = await readText(file);
|
|
310
567
|
if (md !== null)
|
|
311
|
-
pAgents.push(agentItem(parseFrontmatter(md),
|
|
568
|
+
pAgents.push(agentItem(parseFrontmatter(md), basename2(file, ".md"), "plugin", pluginName));
|
|
312
569
|
}
|
|
313
570
|
const skillMds = /* @__PURE__ */ new Set();
|
|
314
|
-
for (const name of await listNames(
|
|
315
|
-
skillMds.add(
|
|
571
|
+
for (const name of await listNames(join3(root, "skills"))) {
|
|
572
|
+
skillMds.add(join3(root, "skills", name, "SKILL.md"));
|
|
316
573
|
}
|
|
317
574
|
for (const rel of manifest?.skills ?? []) {
|
|
318
|
-
skillMds.add(rel.endsWith(".md") ?
|
|
575
|
+
skillMds.add(rel.endsWith(".md") ? join3(root, rel) : join3(root, rel, "SKILL.md"));
|
|
319
576
|
}
|
|
320
577
|
const pSkills = [];
|
|
321
578
|
for (const md of skillMds) {
|
|
322
579
|
const text = await readText(md);
|
|
323
580
|
if (text !== null)
|
|
324
581
|
pSkills.push(
|
|
325
|
-
skillItem(parseFrontmatter(text),
|
|
582
|
+
skillItem(parseFrontmatter(text), basename2(dirname2(md)), "plugin", pluginName)
|
|
326
583
|
);
|
|
327
584
|
}
|
|
328
|
-
const pMcp = mcpItemsFrom(await readJson(
|
|
585
|
+
const pMcp = mcpItemsFrom(await readJson(join3(root, ".mcp.json")), "plugin", pluginName);
|
|
329
586
|
for (const it of [...pSkills, ...pAgents, ...pMcp]) it.enabled = enabled;
|
|
330
587
|
skills.push(...pSkills);
|
|
331
588
|
agents.push(...pAgents);
|
|
@@ -355,11 +612,11 @@ async function computeArsenal(projectRoot, homeDir = homedir()) {
|
|
|
355
612
|
}
|
|
356
613
|
|
|
357
614
|
// src/dashboard/delta.ts
|
|
358
|
-
import { readFile as
|
|
615
|
+
import { readFile as readFile6 } from "fs/promises";
|
|
359
616
|
|
|
360
617
|
// src/learn/store.ts
|
|
361
|
-
import { appendFile, mkdir, readFile as
|
|
362
|
-
import { dirname as
|
|
618
|
+
import { appendFile, mkdir, readFile as readFile4, writeFile as writeFile2 } from "fs/promises";
|
|
619
|
+
import { dirname as dirname3 } from "path";
|
|
363
620
|
|
|
364
621
|
// src/learn/usage.ts
|
|
365
622
|
var LEARN_SCHEMA_VERSION = 1;
|
|
@@ -386,8 +643,8 @@ function decayFactor(fromTs, toMs, hl) {
|
|
|
386
643
|
function effectiveScores(store, nowMs) {
|
|
387
644
|
const hl = halfLifeMs();
|
|
388
645
|
const out = /* @__PURE__ */ new Map();
|
|
389
|
-
for (const [path,
|
|
390
|
-
const eff =
|
|
646
|
+
for (const [path, stat2] of Object.entries(store.files)) {
|
|
647
|
+
const eff = stat2.decayed * decayFactor(stat2.lastTs, nowMs, hl);
|
|
391
648
|
if (eff > 0.01) out.set(path, eff);
|
|
392
649
|
}
|
|
393
650
|
return out;
|
|
@@ -396,7 +653,7 @@ function effectiveScores(store, nowMs) {
|
|
|
396
653
|
// src/learn/store.ts
|
|
397
654
|
async function readLearnStore(path) {
|
|
398
655
|
try {
|
|
399
|
-
const raw = await
|
|
656
|
+
const raw = await readFile4(path, "utf8");
|
|
400
657
|
const parsed = JSON.parse(raw);
|
|
401
658
|
if (parsed.schema_version !== LEARN_SCHEMA_VERSION || typeof parsed.files !== "object" || parsed.files === null) {
|
|
402
659
|
return emptyStore();
|
|
@@ -411,42 +668,6 @@ async function readLearnStore(path) {
|
|
|
411
668
|
}
|
|
412
669
|
}
|
|
413
670
|
|
|
414
|
-
// src/shared/paths.ts
|
|
415
|
-
import { join as join2 } from "path";
|
|
416
|
-
function resolvePaths(projectRoot) {
|
|
417
|
-
const graphDir = join2(projectRoot, ".synthra-graph");
|
|
418
|
-
const contextDir = join2(projectRoot, ".synthra");
|
|
419
|
-
const claudeDir = join2(projectRoot, ".claude");
|
|
420
|
-
return {
|
|
421
|
-
projectRoot,
|
|
422
|
-
graphDir,
|
|
423
|
-
contextDir,
|
|
424
|
-
infoGraph: join2(graphDir, "info_graph.json"),
|
|
425
|
-
symbolIndex: join2(graphDir, "symbol_index.json"),
|
|
426
|
-
sessionState: join2(graphDir, "session.json"),
|
|
427
|
-
activityLog: join2(graphDir, "activity.jsonl"),
|
|
428
|
-
tokenLog: join2(graphDir, "token_log.jsonl"),
|
|
429
|
-
gateLog: join2(graphDir, "gate_log.jsonl"),
|
|
430
|
-
bashLog: join2(graphDir, "bash_log.jsonl"),
|
|
431
|
-
routeLog: join2(graphDir, "route_log.jsonl"),
|
|
432
|
-
toolLog: join2(graphDir, "tool_log.jsonl"),
|
|
433
|
-
accessLog: join2(graphDir, "access_log.jsonl"),
|
|
434
|
-
learnStore: join2(graphDir, "learn_store.json"),
|
|
435
|
-
parseCache: join2(graphDir, "parse_cache.json"),
|
|
436
|
-
mcpPort: join2(graphDir, "mcp_port"),
|
|
437
|
-
mcpServerLog: join2(graphDir, "mcp_server.log"),
|
|
438
|
-
mcpServerErrLog: join2(graphDir, "mcp_server.err.log"),
|
|
439
|
-
contextStore: join2(contextDir, "context-store.json"),
|
|
440
|
-
contextMd: join2(contextDir, "CONTEXT.md"),
|
|
441
|
-
branchesDir: join2(contextDir, "branches"),
|
|
442
|
-
claudeDir,
|
|
443
|
-
claudeSettings: join2(claudeDir, "settings.local.json"),
|
|
444
|
-
claudeHooksDir: join2(claudeDir, "hooks"),
|
|
445
|
-
claudeMd: join2(projectRoot, "CLAUDE.md"),
|
|
446
|
-
gitignore: join2(projectRoot, ".gitignore")
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
|
|
450
671
|
// src/shared/pricing.ts
|
|
451
672
|
var PRICING = {
|
|
452
673
|
// Fable-class — frontier tier (same 0.1× cache-read / 1.25× cache-write
|
|
@@ -479,20 +700,20 @@ function estimateCostUsd(usage) {
|
|
|
479
700
|
}
|
|
480
701
|
|
|
481
702
|
// src/shared/project-registry.ts
|
|
482
|
-
import { mkdir as mkdir2, readFile as
|
|
483
|
-
import { homedir as
|
|
484
|
-
import { basename as
|
|
485
|
-
var REGISTRY_DIR =
|
|
486
|
-
var REGISTRY_PATH =
|
|
487
|
-
var
|
|
703
|
+
import { mkdir as mkdir2, readFile as readFile5, writeFile as writeFile3 } from "fs/promises";
|
|
704
|
+
import { homedir as homedir3 } from "os";
|
|
705
|
+
import { basename as basename3, dirname as dirname4, join as join4 } from "path";
|
|
706
|
+
var REGISTRY_DIR = join4(homedir3(), ".synthra");
|
|
707
|
+
var REGISTRY_PATH = join4(REGISTRY_DIR, "projects.json");
|
|
708
|
+
var SCHEMA_VERSION2 = 1;
|
|
488
709
|
async function readRegistry() {
|
|
489
710
|
try {
|
|
490
|
-
const raw = await
|
|
711
|
+
const raw = await readFile5(REGISTRY_PATH, "utf8");
|
|
491
712
|
const parsed = JSON.parse(raw);
|
|
492
|
-
if (!Array.isArray(parsed.projects)) return { schema_version:
|
|
493
|
-
return { schema_version: parsed.schema_version ??
|
|
713
|
+
if (!Array.isArray(parsed.projects)) return { schema_version: SCHEMA_VERSION2, projects: [] };
|
|
714
|
+
return { schema_version: parsed.schema_version ?? SCHEMA_VERSION2, projects: parsed.projects };
|
|
494
715
|
} catch {
|
|
495
|
-
return { schema_version:
|
|
716
|
+
return { schema_version: SCHEMA_VERSION2, projects: [] };
|
|
496
717
|
}
|
|
497
718
|
}
|
|
498
719
|
async function listProjects() {
|
|
@@ -515,7 +736,7 @@ function topHotFiles(store, nowMs, limit = 8) {
|
|
|
515
736
|
}
|
|
516
737
|
async function readJsonl(path) {
|
|
517
738
|
try {
|
|
518
|
-
const text = await
|
|
739
|
+
const text = await readFile6(path, "utf8");
|
|
519
740
|
return text.split(/\r?\n/).filter((l) => l.length > 0).map((l) => {
|
|
520
741
|
try {
|
|
521
742
|
return JSON.parse(l);
|
|
@@ -527,7 +748,7 @@ async function readJsonl(path) {
|
|
|
527
748
|
return [];
|
|
528
749
|
}
|
|
529
750
|
}
|
|
530
|
-
function
|
|
751
|
+
function basename4(p) {
|
|
531
752
|
const parts = p.split(/[\\/]/);
|
|
532
753
|
return parts[parts.length - 1] || p;
|
|
533
754
|
}
|
|
@@ -628,7 +849,7 @@ function dedupeTokens(entries) {
|
|
|
628
849
|
async function computeDashboardData(activePaths, recentN = 500) {
|
|
629
850
|
const registered = await listProjects();
|
|
630
851
|
const activePath = activePaths.projectRoot;
|
|
631
|
-
const activeName =
|
|
852
|
+
const activeName = basename4(activePath);
|
|
632
853
|
const knownPaths = new Set(registered.map((p) => p.path));
|
|
633
854
|
const allEntries = [
|
|
634
855
|
...registered.map((p) => ({ path: p.path, name: p.name, last_seen: p.last_seen }))
|
|
@@ -748,7 +969,7 @@ async function computeDashboardData(activePaths, recentN = 500) {
|
|
|
748
969
|
}
|
|
749
970
|
|
|
750
971
|
// src/dashboard/built/index.html
|
|
751
|
-
var built_default = '<!doctype html>\n<html lang="en" class="dark">\n <head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <title>Synthra \xB7 Dashboard</title>\n <link rel="icon" href="/favicon.svg" type="image/svg+xml" />\n <link rel="preconnect" href="https://fonts.googleapis.com" />\n <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />\n <link\n href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap"\n rel="stylesheet"\n />\n <script type="module" crossorigin>(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible;function d(e){return typeof e==`function`}var f=()=>{};function p(e){for(var t=0;t<e.length;t++)e[t]()}function m(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function h(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var g=1<<24,_=1024,v=2048,y=4096,b=8192,ee=16384,x=32768,te=1<<25,ne=65536,re=1<<19,ie=1<<20,ae=1<<25,oe=65536,se=1<<21,ce=1<<22,le=1<<23,ue=Symbol(`$state`),de=Symbol(`legacy props`),fe=Symbol(``),pe=Symbol(`attributes`),me=Symbol(`class`),he=Symbol(`style`),ge=Symbol(`text`),_e=Symbol(`form reset`),ve=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},ye=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function be(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function xe(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Se(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Ce(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function we(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Te(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Ee(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function De(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Oe(){throw Error(`https://svelte.dev/e/set_context_after_init`)}function ke(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Ae(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function je(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Me(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Ne={},S=Symbol(`uninitialized`),Pe=`http://www.w3.org/1999/xhtml`,Fe=`http://www.w3.org/2000/svg`,Ie=`@attach`;function Le(){console.warn(`https://svelte.dev/e/derived_inert`)}function Re(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function ze(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function Be(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var C=!1;function Ve(e){C=e}var w;function He(e){if(e===null)throw Re(),Ne;return w=e}function Ue(){return He(wn(w))}function T(e){if(C){if(wn(w)!==null)throw Re(),Ne;w=e}}function We(e=1){if(C){for(var t=e,n=w;t--;)n=wn(n);w=n}}function Ge(e=!0){for(var t=0,n=w;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=wn(n);e&&n.remove(),n=i}}function Ke(e){if(!e||e.nodeType!==8)throw Re(),Ne;return e.data}function qe(e){return e===this.v}function Je(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Ye(e){return!Je(e,this.v)}var Xe=!1,Ze=!1;function Qe(){Ze=!0}var E=null;function $e(e){E=e}function et(e){return at(`getContext`).get(e)}function tt(e,t){let n=at(`setContext`);if(Xe){var r=B.f;!z&&r&32&&!E.i||Oe()}return n.set(e,t),t}function nt(e){return at(`hasContext`).has(e)}function rt(){return at(`getAllContexts`)}function D(e,t=!1,n){E={p:E,i:!1,c:null,e:null,s:e,x:null,r:B,l:Ze&&!t?{s:null,u:null,$:[]}:null}}function O(e){var t=E,n=t.e;if(n!==null){t.e=null;for(var r of n)Bn(r)}return e!==void 0&&(t.x=e),t.i=!0,E=t.p,e??{}}function it(){return!Ze||E!==null&&E.l===null}function at(e){return E===null&&be(e),E.c??=new Map(ot(E)||void 0)}function ot(e){let t=e.p;for(;t!==null;){let e=t.c;if(e!==null)return e;t=t.p}return null}var st=[];function ct(){var e=st;st=[],p(e)}function lt(e){if(st.length===0&&!Ht){var t=st;queueMicrotask(()=>{t===st&&ct()})}st.push(e)}function ut(){for(;st.length>0;)ct()}function dt(e){var t=B;if(t===null)return z.f|=le,e;if(!(t.f&32768)&&!(t.f&4))throw e;ft(e,t)}function ft(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}var pt=~(v|y|_);function k(e,t){e.f=e.f&pt|t}function mt(e){e.f&512||e.deps===null?k(e,_):k(e,y)}function ht(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=oe,ht(t.deps))}function gt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),ht(e.deps),k(e,_)}var _t=!1,vt=!1;function yt(e){var t=vt;try{return vt=!1,[e(),vt]}finally{vt=t}}function bt(e){let t=0,n=cn(0),r;return()=>{Ln()&&(V(n),Kn(()=>(t===0&&(r=Nr(()=>e(()=>fn(n)))),t+=1,()=>{lt(()=>{--t,t===0&&(r?.(),r=void 0,fn(n))})})))}}var xt=ne|re;function St(e,t,n,r){new Ct(e,t,n,r)}var Ct=class{parent;is_pending=!1;transform_error;#e;#t=C?w:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=bt(()=>(this.#m=cn(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=B;t.b=this,t.f|=128,n(e)},this.parent=B.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=qn(()=>{if(C){let e=this.#t;Ue();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},xt),C&&(this.#e=w)}#g(){try{this.#a=Yn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=Yn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=Yn(()=>e(this.#e)),lt(()=>{var e=this.#c=document.createDocumentFragment(),t=Sn();e.append(t),this.#a=this.#x(()=>Yn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,tr(this.#o,()=>{this.#o=null}),this.#b(j))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=Yn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();ar(this.#a,e);let t=this.#n.pending;this.#o=Yn(()=>t(this.#e))}else this.#b(j)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){gt(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=B,n=z,r=E;fr(this.#i),dr(this.#i),$e(this.#i.ctx);try{return Jt.ensure(),e()}catch(e){return dt(e),null}finally{fr(t),dr(n),$e(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&tr(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,lt(()=>{this.#d=!1,this.#m&&un(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),V(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;j?.is_fork?(this.#a&&j.skip_effect(this.#a),this.#o&&j.skip_effect(this.#o),this.#s&&j.skip_effect(this.#s),j.oncommit(()=>{this.#C(e)})):this.#C(e)}#C(e){this.#a&&=(R(this.#a),null),this.#o&&=(R(this.#o),null),this.#s&&=(R(this.#s),null),C&&(He(this.#t),We(),He(Ge()));var t=this.#n.onerror;let n=this.#n.failed;var r=!1,i=!1;let a=()=>{if(r){Be();return}r=!0,i&&Me(),this.#s!==null&&tr(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){ft(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return Yn(()=>{var t=B;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return ft(e,this.#i.parent),null}}))};lt(()=>{var t;try{t=this.transform_error(e)}catch(e){ft(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>ft(e,this.#i&&this.#i.parent)):o(t)})}};function wt(e,t,n,r){let i=it()?Ot:jt;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=B,c=Tt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){ft(e,s)}Et()}}var d=Dt();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>At(e))).then(u).catch(e=>ft(e,s)).finally(d)}l?l.then(()=>{c(),f(),Et()}):f()}function Tt(){var e=B,t=z,n=E,r=j;return function(i=!0){fr(e),dr(t),$e(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Et(e=!0){fr(null),dr(null),$e(null),e&&j?.deactivate()}function Dt(){var e=B,t=e.b,n=j,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function Ot(e){var t=2|v;return B!==null&&(B.f|=re),{ctx:E,deps:null,effects:null,equals:qe,f:t,fn:e,reactions:null,rv:0,v:S,wv:0,parent:B,ac:null}}var kt=Symbol(`obsolete`);function At(e,t,n){let r=B;r===null&&xe();var i=void 0,a=cn(S),o=!z,s=new Set;return Gn(()=>{var t=B,n=m();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==ve&&n.reject(e)}).finally(Et)}catch(e){n.reject(e),Et()}var c=j;if(o){if(t.f&32768)var l=Dt();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(kt);else for(let e of s.values())e.reject(kt);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==kt&&(c.activate(),t?(a.f|=le,un(a,t)):(a.f&8388608&&(a.f^=le),un(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),Rn(()=>{for(let e of s)e.reject(kt)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function A(e){let t=Ot(e);return Xe||mr(t),t}function jt(e){let t=Ot(e);return t.equals=Ye,t}function Mt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)R(t[n])}}function Nt(e){var t,n=B,r=e.parent;if(!cr&&r!==null&&e.v!==S&&r.f&24576)return Le(),e.v;fr(r);try{e.f&=~oe,Mt(e),t=Er(e)}finally{fr(n)}return t}function Pt(e){var t=Nt(e);if(!e.equals(t)&&(e.wv=Cr(),(!j?.is_fork||e.deps===null)&&(j===null?e.v=t:(j.capture(e,t,!0),zt?.capture(e,t,!0)),e.deps===null))){k(e,_);return}cr||(Bt===null?mt(e):(Ln()||j?.is_fork)&&Bt.set(e,t))}function Ft(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(ve),t.fn!==null&&(t.teardown=f),t.ac=null,Or(t,0),Zn(t))}function It(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&kr(t)}var Lt=null,Rt=null,j=null,zt=null,Bt=null,Vt=null,Ht=!1,Ut=!1,Wt=null,Gt=null,Kt=0,qt=1,Jt=class e{id=qt++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){Rt===null?Lt=Rt=this:(Rt.#n=this,this.#t=Rt),Rt=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)k(r,v),t(r);for(r of n.m)k(r,y),t(r)}this.#p.add(e)}#g(){this.#e=!0,Kt++>1e3&&(this.#S(),Xt());for(let e of this.#u)this.#d.delete(e),k(e,v),this.schedule(e);for(let e of this.#d)k(e,y),this.schedule(e);let t=this.#c;this.#c=[],this.apply();var n=Wt=[],r=[],i=Gt=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw rn(e),this.#h()||this.discard(),t}if(j=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(Wt=null,Gt=null,this.#h()){this.#b(r),this.#b(n);for(let[e,t]of this.#f)nn(e,t);i.length>0&&j.#g();return}let o=this.#v();if(o){this.#b(r),this.#b(n),o.#y(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),zt=this,Qt(r),Qt(n),zt=null,this.#s?.resolve();var s=j;if(this.#a===0&&(this.#c.length===0||s!==null)&&(this.#S(),Xe&&(this.#x(),j=s)),this.#c.length>0)if(s!==null){let e=s;e.#c.push(...this.#c.filter(t=>!e.#c.includes(t)))}else s=this;s!==null&&s.#g()}#_(e,t,n){e.f^=_;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=_:i&4?t.push(r):Xe&&i&16777224?n.push(r):wr(r)&&(i&16&&this.#d.add(r),kr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#v(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#y(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null)for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),k(i,v),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),j=this,this.#g()}#b(e){for(var t=0;t<e.length;t+=1)gt(e[t],this.#u,this.#d)}capture(e,t,n=!1){e.v!==S&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),Bt?.set(e,t)),this.is_fork||(e.v=t)}activate(){j=this}deactivate(){j=null,Bt=null}flush(){try{Ut=!0,j=this,this.#g()}finally{Kt=0,Vt=null,Wt=null,Gt=null,Ut=!1,j=null,Bt=null,on.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(kt);this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}#x(){for(let u=Lt;u!==null;u=u.#n){var e=u.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(u.current.has(r)){var n=u.current.get(r)[0];if(e&&i!==n)u.current.set(r,[i,a]);else continue}t.push(r)}if(e)for(let[e,t]of this.async_deriveds){let n=u.async_deriveds.get(e);n&&t.promise.then(n.resolve).catch(n.reject)}var r=[...u.current.keys()].filter(e=>!u.current.get(e)[1]);if(!(!u.#e||r.length===0)){var i=r.filter(e=>!this.current.has(e));if(i.length===0)e&&u.discard();else if(t.length>0){if(e)for(let e of this.#p)u.unskip_effect(e,e=>{e.f&4194320?u.schedule(e):u.#b([e])});u.activate();var a=new Set,o=new Map;for(var s of t)$t(s,i,a,o);o=new Map;var c=[...u.current].filter(([e,t])=>{let n=this.current.get(e);return n?n[0]!==t[0]||n[1]!==t[1]:!0}).map(([e])=>e);if(c.length>0)for(let e of this.#l)!(e.f&155648)&&en(e,c,o)&&(e.f&4194320?(k(e,v),u.schedule(e)):u.#u.add(e));if(u.#c.length>0&&!u.#m){u.apply();for(var l of u.#c)u.#_(l,[],[]);u.#c=[]}u.deactivate()}}}}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,lt(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=m()).promise}static ensure(){if(j===null){let t=j=new e;!Ut&&!Ht&<(()=>{t.#e||t.flush()})}return j}apply(){if(!Xe||!this.is_fork&&this.#t===null&&this.#n===null){Bt=null;return}Bt=new Map;for(let[e,[t]]of this.current)Bt.set(e,t);for(let t=Lt;t!==null;t=t.#n)if(!(t===this||t.is_fork)){var e=!1;if(t.id<this.id){for(let[n,[,r]]of t.current)if(!r&&this.current.has(n)){e=!0;break}}if(!e)for(let[e,n]of t.previous)Bt.has(e)||Bt.set(e,n)}}schedule(e){if(Vt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(Wt!==null&&t===B&&(Xe||(z===null||!(z.f&2))&&!_t))return;if(n&96){if(!(n&1024))return;t.f^=_}}this.#c.push(t)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null?Lt=t:e.#n=t,t===null?Rt=e:t.#t=e,this.linked=!1}}};function Yt(e){var t=Ht;Ht=!0;try{var n;for(e&&(j!==null&&!j.is_fork&&j.flush(),n=e());;){if(ut(),j===null)return n;j.flush()}}finally{Ht=t}}function Xt(){try{Ee()}catch(e){ft(e,Vt)}}var Zt=null;function Qt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&wr(r)&&(Zt=new Set,kr(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&er(r),Zt?.size>0)){on.clear();for(let e of Zt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Zt.has(n)&&(Zt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||kr(n)}}Zt.clear()}}Zt=null}}function $t(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?$t(i,t,n,r):e&4194320&&!(e&2048)&&en(i,t,r)&&(k(i,v),tn(i))}}function en(e,t,r){let i=r.get(e);if(i!==void 0)return i;if(e.deps!==null)for(let i of e.deps){if(n.call(t,i))return!0;if(i.f&2&&en(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function tn(e){j.schedule(e)}function nn(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),k(e,_);for(var n=e.first;n!==null;)nn(n,t),n=n.next}}function rn(e){k(e,_);for(var t=e.first;t!==null;)rn(t),t=t.next}var an=new Set,on=new Map,sn=!1;function cn(e,t){return{f:0,v:e,reactions:null,equals:qe,rv:0,wv:0}}function M(e,t){let n=cn(e,t);return mr(n),n}function ln(e,t=!1,n=!0){let r=cn(e);return t||(r.equals=Ye),Ze&&n&&E!==null&&E.l!==null&&(E.l.s??=[]).push(r),r}function N(e,t,n=!1){return z!==null&&(!ur||z.f&131072)&&it()&&z.f&4325394&&(pr===null||!pr.has(e))&&je(),un(e,n?mn(t):t,Gt)}function un(e,t,n=null){if(!e.equals(t)){on.set(e,cr?t:e.v);var r=Jt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&Nt(t),Bt===null&&mt(t)}e.wv=Cr(),pn(e,v,n),it()&&B!==null&&B.f&1024&&!(B.f&96)&&(_r===null?vr([e]):_r.push(e)),!r.is_fork&&an.size>0&&!sn&&dn()}return t}function dn(){sn=!1;for(let e of an){e.f&1024&&k(e,y);let t;try{t=wr(e)}catch{t=!0}t&&kr(e)}an.clear()}function fn(e){N(e,e.v+1)}function pn(e,t,n){var r=e.reactions;if(r!==null)for(var i=it(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===B)){var l=(c&v)===0;if(l&&k(s,t),c&131072)an.add(s);else if(c&2){var u=s;Bt?.delete(u),c&65536||(c&512&&(B===null||!(B.f&2097152))&&(s.f|=oe),pn(u,y,n))}else if(l){var d=s;c&16&&Zt!==null&&Zt.add(d),n===null?tn(d):n.push(d)}}}}function mn(t){if(typeof t!=`object`||!t||ue in t)return t;let n=l(t);if(n!==s&&n!==c)return t;var r=new Map,i=e(t),o=M(0),u=null,d=xr,f=e=>{if(xr===d)return e();var t=z,n=xr;dr(null),Sr(d);var r=e();return dr(t),Sr(n),r};return i&&r.set(`length`,M(t.length,u)),new Proxy(t,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&ke();var i=r.get(t);return i===void 0?f(()=>{var e=M(n.value,u);return r.set(t,e),e}):N(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>M(S,u));r.set(t,e),fn(o)}}else N(n,S),fn(o);return!0},get(e,n,i){if(n===ue)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>M(mn(s?e[n]:S),u)),r.set(n,o)),o!==void 0){var c=V(o);return c===S?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&`value`in n){var i=r.get(t);i&&(n.value=V(i))}else if(n===void 0){var a=r.get(t),o=a?.v;if(a!==void 0&&o!==S)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return n},has(e,t){if(t===ue)return!0;var n=r.get(t),i=n!==void 0&&n.v!==S||Reflect.has(e,t);return(n!==void 0||B!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>M(i?mn(e[t]):S,u)),r.set(t,n)),V(n)===S)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;d<c.v;d+=1){var p=r.get(d+``);p===void 0?d in e&&(p=f(()=>M(S,u)),r.set(d+``,p)):N(p,S)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>M(void 0,u)),N(c,mn(n)),r.set(t,c));else{l=c.v!==S;var m=f(()=>mn(n));N(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&N(g,_+1)}fn(o)}return!0},ownKeys(e){V(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==S});for(var[n,i]of r)i.v!==S&&!(n in e)&&t.push(n);return t},setPrototypeOf(){Ae()}})}function hn(e){try{if(typeof e==`object`&&e&&ue in e)return e[ue]}catch{}return e}function gn(e,t){return Object.is(hn(e),hn(t))}new Set([`copyWithin`,`fill`,`pop`,`push`,`reverse`,`shift`,`sort`,`splice`,`unshift`]);var _n,vn,yn,bn;function xn(){if(_n===void 0){_n=window,vn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;yn=a(t,`firstChild`).get,bn=a(t,`nextSibling`).get,u(e)&&(e[me]=void 0,e[pe]=null,e[he]=void 0,e.__e=void 0),u(n)&&(n[ge]=void 0)}}function Sn(e=``){return document.createTextNode(e)}function Cn(e){return yn.call(e)}function wn(e){return bn.call(e)}function P(e,t){if(!C)return Cn(e);var n=Cn(w);if(n===null)n=w.appendChild(Sn());else if(t&&n.nodeType!==3){var r=Sn();return n?.before(r),He(r),r}return t&&On(n),He(n),n}function F(e,t=!1){if(!C){var n=Cn(e);return n instanceof Comment&&n.data===``?wn(n):n}if(t){if(w?.nodeType!==3){var r=Sn();return w?.before(r),He(r),r}On(w)}return w}function I(e,t=1,n=!1){let r=C?w:e;for(var i;t--;)i=r,r=wn(r);if(!C)return r;if(n){if(r?.nodeType!==3){var a=Sn();return r===null?i?.after(a):r.before(a),He(a),a}On(r)}return He(r),r}function Tn(e){e.textContent=``}function En(){return!Xe||Zt!==null?!1:(B.f&x)!==0}function Dn(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function On(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function kn(e,t){if(t){let t=document.body;e.autofocus=!0,lt(()=>{document.activeElement===t&&e.focus()})}}var An=!1;function jn(){An||(An=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[_e]?.()})},{capture:!0}))}function Mn(e){var t=z,n=B;dr(null),fr(null);try{return e()}finally{dr(t),fr(n)}}function Nn(e,t,n,r=n){e.addEventListener(t,()=>Mn(n));let i=e[_e];i?e[_e]=()=>{i(),r(!0)}:e[_e]=()=>r(!0),jn()}function Pn(e){B===null&&(z===null&&Te(e),we()),cr&&Ce(e)}function Fn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function In(e,t){var n=B;n!==null&&n.f&8192&&(e|=b);var r={ctx:E,deps:null,nodes:null,f:e|v|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};j?.register_created_effect(r);var i=r;if(e&4)Wt===null?Jt.ensure().schedule(r):Wt.push(r);else if(t!==null){try{kr(r)}catch(e){throw R(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ne))}if(i!==null&&(i.parent=n,n!==null&&Fn(i,n),z!==null&&z.f&2&&!(e&64))){var a=z;(a.effects??=[]).push(i)}return r}function Ln(){return z!==null&&!ur}function Rn(e){let t=In(8,null);return k(t,_),t.teardown=e,t}function zn(e){Pn(`$effect`);var t=B.f;if(!z&&t&32&&E!==null&&!E.i){var n=E;(n.e??=[]).push(e)}else return Bn(e)}function Bn(e){return In(4|ie,e)}function Vn(e){return Pn(`$effect.pre`),In(8|ie,e)}function Hn(e){Jt.ensure();let t=In(64|re,e);return()=>{R(t)}}function Un(e){Jt.ensure();let t=In(64|re,e);return(e={})=>new Promise(n=>{e.outro?tr(t,()=>{R(t),n(void 0)}):(R(t),n(void 0))})}function Wn(e){return In(4,e)}function Gn(e){return In(ce|re,e)}function Kn(e,t=0){return In(8|t,e)}function L(e,t=[],n=[],r=[]){wt(r,t,n,t=>{In(8,()=>{e(...t.map(V))})})}function qn(e,t=0){return In(16|t,e)}function Jn(e,t=0){return In(g|t,e)}function Yn(e){return In(32|re,e)}function Xn(e){var t=e.teardown;if(t!==null){let e=cr,n=z;lr(!0),dr(null);try{t.call(null)}finally{lr(e),dr(n)}}}function Zn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&Mn(()=>{e.abort(ve)});var r=n.next;n.f&64?n.parent=null:R(n,t),n=r}}function Qn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||R(t),t=n}}function R(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&($n(e.nodes.start,e.nodes.end),n=!0),e.f|=te,Zn(e,t&&!n),Or(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Xn(e),e.f^=te,e.f|=ee;var i=e.parent;i!==null&&i.first!==null&&er(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function $n(e,t){for(;e!==null;){var n=e===t?null:wn(e);e.remove(),e=n}}function er(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function tr(e,t,n=!0){var r=[];nr(e,r,!0);var i=()=>{n&&R(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function nr(e,t,n){if(!(e.f&8192)){e.f^=b;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;nr(i,t,o?n:!1)}i=a}}}function rr(e){ir(e,!0)}function ir(e,t){if(e.f&8192){e.f^=b,e.f&1024||(k(e,v),Jt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;ir(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function ar(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:wn(n);t.append(n),n=i}}var or=null,sr=!1,cr=!1;function lr(e){cr=e}var z=null,ur=!1;function dr(e){z=e}var B=null;function fr(e){B=e}var pr=null;function mr(e){z!==null&&(!Xe||z.f&2)&&(pr??=new Set).add(e)}var hr=null,gr=0,_r=null;function vr(e){_r=e}var yr=1,br=0,xr=br;function Sr(e){xr=e}function Cr(){return++yr}function wr(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~oe),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(wr(a)&&Pt(a),a.wv>e.wv)return!0}t&512&&Bt===null&&k(e,_)}return!1}function Tr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!Xe&&pr!==null&&pr.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?Tr(a,t,!1):t===a&&(n?k(a,v):a.f&1024&&k(a,y),tn(a))}}function Er(e){var t=hr,n=gr,r=_r,i=z,a=pr,o=E,s=ur,c=xr,l=e.f;hr=null,gr=0,_r=null,z=l&96?null:e,pr=null,$e(e.ctx),ur=!1,xr=++br,e.ac!==null&&(Mn(()=>{e.ac.abort(ve)}),e.ac=null);try{e.f|=se;var u=e.fn,d=u();e.f|=x;var f=e.deps,p=j?.is_fork;if(hr!==null){var m;if(p||Or(e,gr),f!==null&&gr>0)for(f.length=gr+hr.length,m=0;m<hr.length;m++)f[gr+m]=hr[m];else e.deps=f=hr;if(Ln()&&e.f&512)for(m=gr;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&gr<f.length&&(Or(e,gr),f.length=gr);if(it()&&_r!==null&&!ur&&f!==null&&!(e.f&6146))for(m=0;m<_r.length;m++)Tr(_r[m],e);if(i!==null&&i!==e){if(br++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=br;if(t!==null)for(let e of t)e.rv=br;_r!==null&&(r===null?r=_r:r.push(..._r))}return e.f&8388608&&(e.f^=le),d}catch(e){return dt(e)}finally{e.f^=se,hr=t,gr=n,_r=r,z=i,pr=a,$e(o),ur=s,xr=c}}function Dr(e,r){let i=r.reactions;if(i!==null){var a=t.call(i,e);if(a!==-1){var o=i.length-1;o===0?i=r.reactions=null:(i[a]=i[o],i.pop())}}if(i===null&&r.f&2&&(hr===null||!n.call(hr,r))){var s=r;s.f&512&&(s.f^=512,s.f&=~oe),s.v!==S&&mt(s),Ft(s),Or(s,0)}}function Or(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Dr(e,n[r])}function kr(e){var t=e.f;if(!(t&16384)){k(e,_);var n=B,r=sr;B=e,sr=!0;try{t&16777232?Qn(e):Zn(e),Xn(e);var i=Er(e);e.teardown=typeof i==`function`?i:null,e.wv=yr}finally{sr=r,B=n}}}async function Ar(){if(Xe)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),Yt()}function V(e){var t=(e.f&2)!=0;if(or?.add(e),z!==null&&!ur&&!(B!==null&&B.f&16384)&&(pr===null||!pr.has(e))){var r=z.deps;if(z.f&2097152)e.rv<br&&(e.rv=br,hr===null&&r!==null&&r[gr]===e?gr++:hr===null?hr=[e]:hr.push(e));else{z.deps??=[],n.call(z.deps,e)||z.deps.push(e);var i=e.reactions;i===null?e.reactions=[z]:n.call(i,z)||i.push(z)}}if(cr&&on.has(e))return on.get(e);if(t){var a=e;if(cr){var o=a.v;return(!(a.f&1024)&&a.reactions!==null||Mr(a))&&(o=Nt(a)),on.set(a,o),o}var s=(a.f&512)==0&&!ur&&z!==null&&(sr||(z.f&512)!=0),c=(a.f&x)===0;wr(a)&&(s&&(a.f|=512),Pt(a)),s&&!c&&(It(a),jr(a))}if(Bt?.has(e))return Bt.get(e);if(e.f&8388608)throw e.v;return e.v}function jr(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(It(t),jr(t))}function Mr(e){if(e.v===S)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(on.has(t)||t.f&2&&Mr(t))return!0;return!1}function Nr(e){var t=ur;try{return ur=!0,e()}finally{ur=t}}function Pr(){return Symbol(Ie)}function Fr(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var Ir=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function Lr(e){return Ir.includes(e)}var Rr=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),zr={formnovalidate:`formNoValidate`,ismap:`isMap`,nomodule:`noModule`,playsinline:`playsInline`,readonly:`readOnly`,defaultvalue:`defaultValue`,defaultchecked:`defaultChecked`,srcobject:`srcObject`,novalidate:`noValidate`,allowfullscreen:`allowFullscreen`,disablepictureinpicture:`disablePictureInPicture`,disableremoteplayback:`disableRemotePlayback`};function Br(e){return e=e.toLowerCase(),zr[e]??e}[...Rr];var Vr=[`touchstart`,`touchmove`];function Hr(e){return Vr.includes(e)}var Ur=[`textarea`,`script`,`style`,`title`];function Wr(e){return Ur.includes(e)}var Gr=Symbol(`events`),Kr=new Set,qr=new Set;function Jr(e,t,n,r={}){function i(e){if(r.capture||$r.call(t,e),!e.cancelBubble)return Mn(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?lt(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Yr(e,t,n,r={}){var i=Jr(t,e,n,r);return()=>{e.removeEventListener(t,i,r)}}function Xr(e,t,n){(t[Gr]??={})[e]=n}function Zr(e){for(var t=0;t<e.length;t++)Kr.add(e[t]);for(var n of qr)n(e)}var Qr=null;function $r(e){var t=this,n=t.ownerDocument,r=e.type,a=e.composedPath?.()||[],o=a[0]||e.target;Qr=e;var s=0,c=Qr===e&&e[Gr];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[Gr]=t;return}var u=a.indexOf(t);if(u===-1)return;l<=u&&(s=l)}if(o=a[s]||e.target,o!==t){i(e,`currentTarget`,{configurable:!0,get(){return o||n}});var d=z,f=B;dr(null),fr(null);try{for(var p,m=[];o!==null&&o!==t;){try{var h=o[Gr]?.[r];h!=null&&(!o.disabled||e.target===o)&&h.call(o,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble)break;s++,o=s<a.length?a[s]:null}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[Gr]=t,delete e.currentTarget,dr(d),fr(f)}}}var ei=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function ti(e){return ei?.createHTML(e)??e}function ni(e){var t=Dn(`template`);return t.innerHTML=ti(e.replaceAll(`<!>`,`\\x3C!---->`)),t.content}function ri(e,t){var n=B;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function H(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(C)return ri(w,null),w;i===void 0&&(i=ni(a?e:`<!>`+e),n||(i=Cn(i)));var t=r||vn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Cn(t),s=t.lastChild;ri(o,s)}else ri(t,t);return t}}function ii(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(C)return ri(w,null),w;if(!o){var e=Cn(ni(a));if(i)for(o=document.createDocumentFragment();Cn(e);)o.appendChild(Cn(e));else o=Cn(e)}var t=o.cloneNode(!0);if(i){var n=Cn(t),r=t.lastChild;ri(n,r)}else ri(t,t);return t}}function ai(e,t){return ii(e,t,`svg`)}function oi(e=``){if(!C){var t=Sn(e+``);return ri(t,t),t}var n=w;return n.nodeType===3?On(n):(n.before(n=Sn()),He(n)),ri(n,n),n}function U(){if(C)return ri(w,null),w;var e=document.createDocumentFragment(),t=document.createComment(``),n=Sn();return e.append(t,n),ri(t,n),e}function W(e,t){if(C){var n=B;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=w),Ue();return}e!==null&&e.before(t)}function si(){if(C&&w&&w.nodeType===8&&w.textContent?.startsWith(`$`)){let e=w.textContent.substring(1);return Ue(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function G(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[ge]??=e.nodeValue)&&(e[ge]=n,e.nodeValue=`${n}`)}function ci(e,t){return ui(e,t)}var li=new Map;function ui(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){xn();var l=void 0,u=Un(()=>{var s=n??t.appendChild(Sn());St(s,{pending:()=>{}},t=>{D({});var n=E;if(o&&(n.c=o),a&&(i.$$events=a),C&&ri(t,null),l=e(t,i)||{},C&&(B.nodes.end=w,w===null||w.nodeType!==8||w.data!==`]`))throw Re(),Ne;O()},c);var u=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=Hr(r);for(let e of[t,document]){var a=li.get(e);a===void 0&&(a=new Map,li.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,$r,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(r(Kr)),qr.add(d),()=>{for(var e of u)for(let n of[t,document]){var r=li.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,$r),r.delete(e),r.size===0&&li.delete(n)):r.set(e,i)}qr.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return di.set(l,u),l}var di=new WeakMap;function fi(e,t){let n=di.get(e);return n?(di.delete(e),n(t)):Promise.resolve()}var pi=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)rr(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(rr(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(R(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();ar(r,t),t.append(Sn()),this.#n.set(e,{effect:r,fragment:t})}else R(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),tr(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(R(n.effect),this.#n.delete(e))};ensure(e,t){var n=j,r=En();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=Sn();i.append(a),this.#n.set(e,{effect:Yn(()=>t(a)),fragment:i})}else this.#t.set(e,Yn(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else C&&(this.anchor=w),this.#a(n)}};function K(e,t,n=!1){var r;C&&(r=w,Ue());var i=new pi(e),a=n?ne:0;function o(e,t){if(C){var n=Ke(r);if(e!==parseInt(n.substring(1))){var a=Ge();He(a),i.anchor=a,Ve(!1),i.ensure(e,t),Ve(!0);return}}i.ensure(e,t)}qn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var mi=Symbol(`NaN`);function hi(e,t,n){C&&Ue();var r=new pi(e),i=!it();qn(()=>{var e=t();e!==e&&(e=mi),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function gi(e,t){return t}function _i(e,t,n){for(var i=[],a=t.length,o,s=t.length,c=0;c<a;c++){let n=t[c];tr(n,()=>{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;vi(e,r(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else --s},!1)}if(s===0){var l=i.length===0&&n!==null;if(l){var u=n,d=u.parentNode;Tn(d),d.append(u),e.items.clear()}vi(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function vi(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=ae,ar(a,document.createDocumentFragment())):R(t[i],n)}}var yi;function q(t,n,i,a,o,s=null){var c=t,l=new Map;if(n&4){var u=t;c=C?He(Cn(u)):u.appendChild(Sn())}C&&Ue();var d=null,f=jt(()=>{var t=i();return e(t)?t:t==null?[]:r(t)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,xi(v,p,c,n,a),d!==null&&(p.length===0?d.f&33554432?(d.f^=ae,Ci(d,null,c)):rr(d):tr(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:qn(()=>{p=V(f);var e=p.length;let t=!1;C&&Ke(c)===`[!`!=(e===0)&&(c=Ge(),He(c),Ve(!1),t=!0);for(var r=new Set,u=j,v=En(),y=0;y<e;y+=1){C&&w.nodeType===8&&w.data===`]`&&(c=w,t=!0,Ve(!1));var b=p[y],ee=a(b,y),x=h?null:l.get(ee);x?(x.v&&un(x.v,b),x.i&&un(x.i,y),v&&u.unskip_effect(x.e)):(x=Si(l,h?c:yi??=Sn(),b,ee,y,o,n,i),h||(x.e.f|=ae),l.set(ee,x)),r.add(ee)}if(e===0&&s&&!d&&(h?d=Yn(()=>s(c)):(d=Yn(()=>s(yi??=Sn())),d.f|=ae)),e>r.size&&Se(``,``,``),C&&e>0&&He(Ge()),!h)if(m.set(u,r),v){for(let[e,t]of l)r.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u);t&&Ve(!0),V(f)}),flags:n,items:l,pending:m,outrogroups:null,fallback:d};h=!1,C&&(c=w)}function bi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function xi(e,t,n,i,a){var o=(i&8)!=0,s=t.length,c=e.items,l=bi(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v<s;v+=1)h=t[v],g=a(h,v),_=c.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<s;v+=1){if(h=t[v],g=a(h,v),_=c.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(rr(_),o&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432)if(_.f^=ae,_===l)Ci(_,null,n);else{var y=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),wi(e,d,_),wi(e,_,y),Ci(_,y,n),d=_,p=[],m=[],l=bi(d.next);continue}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var b=m[0],ee;d=b.prev;var x=p[0],te=p[p.length-1];for(ee=0;ee<p.length;ee+=1)Ci(p[ee],b,n);for(ee=0;ee<m.length;ee+=1)u.delete(m[ee]);wi(e,x.prev,te.next),wi(e,d,x),wi(e,te,b),l=b,d=te,--v,p=[],m=[]}else u.delete(_),Ci(_,l,n),wi(e,_.prev,_.next),wi(e,_,d===null?e.effect.first:d.next),wi(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;)(u??=new Set).add(l),m.push(l),l=bi(l.next);if(l===null)continue}_.f&33554432||p.push(_),d=_,l=bi(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(vi(e,r(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var ne=[];if(u!==void 0)for(_ of u)_.f&8192||ne.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&ne.push(l),l=bi(l.next);var re=ne.length;if(re>0){var ie=i&4&&s===0?n:null;if(o){for(v=0;v<re;v+=1)ne[v].nodes?.a?.measure();for(v=0;v<re;v+=1)ne[v].nodes?.a?.fix()}_i(e,ne,ie)}}o&<(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function Si(e,t,n,r,i,a,o,s){var c=o&1?o&16?cn(n):ln(n,!1,!1):null,l=o&2?cn(i):null;return{v:c,i:l,e:Yn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Ci(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=wn(r);if(a.before(r),r===i)return;r=o}}function wi(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function J(e,t,...n){var r=new pi(e);qn(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},ne)}function Ti(e,t,n){var r;C&&(r=w,Ue());var i=new pi(e);qn(()=>{var e=t()??null;if(C&&Ke(r)===`[`!=(e!==null)){var a=Ge();He(a),i.anchor=a,Ve(!1),i.ensure(e,e&&(t=>n(t,e))),Ve(!0);return}i.ensure(e,e&&(t=>n(t,e)))},ne)}function Ei(e,t,n,r,i,a){let o=C;C&&Ue();var s=null;C&&w.nodeType===1&&(s=w,Ue());var c=C?w:e,l=new pi(c,!1);qn(()=>{let e=t()||null;var a=i?i():n||e===`svg`?Fe:void 0;if(e===null){l.ensure(null,null);return}return l.ensure(e,t=>{if(e){if(s=C?s:Dn(e,a),ri(s,s),r){var n=null;C&&Wr(e)&&s.append(n=document.createComment(``));var i=C?Cn(s):s.appendChild(Sn());C&&(i===null?Ve(!1):He(i)),r(s,i),n?.remove()}B.nodes.end=s,t.before(s)}C&&He(t)}),()=>{}},ne),Rn(()=>{}),o&&(Ve(!0),He(c))}function Di(e,t){var n=void 0,r;Jn(()=>{n!==(n=t())&&(r&&=(R(r),null),n&&(r=Yn(()=>{Wn(()=>n(e))})))})}function Oi(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Oi(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function ki(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Oi(e))&&(r&&(r+=` `),r+=t);return r}function Ai(e){return typeof e==`object`?ki(e):e??``}var ji=[...` \n\\r\\f\\xA0\\v\uFEFF`];function Mi(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||ji.includes(r[o-1]))&&(s===r.length||ji.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Ni(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Pi(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Fi(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Pi)),i&&c.push(...Object.keys(i).map(Pi));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`\'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Pi(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Ni(r)),i&&(n+=Ni(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function Ii(e,t,n,r,i,a){var o=e[me];if(C||o!==n||o===void 0){var s=Mi(n,r,a);(!C||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[me]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function Li(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function Ri(e,t,n,r){var i=e[he];if(C||i!==t){var a=Fi(t,r);(!C||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[he]=t}else r&&(Array.isArray(r)?(Li(e,n?.[0],r[0]),Li(e,n?.[1],r[1],`important`)):Li(e,n,r));return r}function zi(t,n,r=!1){if(t.multiple){if(n==null)return;if(!e(n))return ze();for(var i of t.options)i.selected=n.includes(Vi(i));return}for(i of t.options)if(gn(Vi(i),n)){i.selected=!0;return}(!r||n!==void 0)&&(t.selectedIndex=-1)}function Bi(e){var t=new MutationObserver(()=>{zi(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),Rn(()=>{t.disconnect()})}function Vi(e){return`__value`in e?e.__value:e.value}var Hi=Symbol(`class`),Ui=Symbol(`style`),Wi=Symbol(`is custom element`),Gi=Symbol(`is html`),Ki=ye?`link`:`LINK`,qi=ye?`input`:`INPUT`,Ji=ye?`option`:`OPTION`,Yi=ye?`select`:`SELECT`;function Xi(e){if(C){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Qi(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Qi(e,`checked`,null),e.checked=r}}};e[_e]=n,lt(n),jn()}}function Zi(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function Qi(e,t,n,r){var i=ta(e);C&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Ki)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[fe]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ra(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function $i(e,t,n,r,i=!1,a=!1){if(C&&i&&e.nodeName===qi){var o=e;(o.type===`checkbox`?`defaultChecked`:`defaultValue`)in n||Xi(o)}var s=ta(e),c=s[Wi],l=!s[Gi];let u=C&&c;u&&Ve(!1);var d=t||{},f=e.nodeName===Ji;for(var p in t)p in n||(n[p]=null);n.class?n.class=Ai(n.class):(r||n[Hi])&&(n.class=null),n[Ui]&&(n.style??=null);var m=ra(e);if(e.nodeName===qi&&`type`in n&&(`value`in n||`__value`in n)){var h=n.type;(h!==d.type||h===void 0&&e.hasAttribute(`type`))&&(d.type=h,Qi(e,`type`,h,a))}for(let i in n){let o=n[i];if(f&&i===`value`&&o==null){e.value=e.__value=``,d[i]=o;continue}if(i===`class`){Ii(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,o,r,t?.[Hi],n[Hi]),d[i]=o,d[Hi]=n[Hi];continue}if(i===`style`){Ri(e,o,t?.[Ui],n[Ui]),d[i]=o,d[Ui]=n[Ui];continue}var g=d[i];if(!(o===g&&!(o===void 0&&e.hasAttribute(i)))){d[i]=o;var _=i[0]+i[1];if(_!==`$$`)if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var v=Lr(r);if(Fr(r)&&(r=r.slice(0,-7),t.capture=!0),!v&&g){if(o!=null)continue;e.removeEventListener(r,d[n],t),d[n]=null}if(v)Xr(r,e,o),Zr([r]);else if(o!=null){function a(e){d[i].call(this,e)}d[n]=Jr(r,e,a,t)}}else if(i===`style`)Qi(e,i,o);else if(i===`autofocus`)kn(e,!!o);else if(!c&&(i===`__value`||i===`value`&&o!=null))e.value=e.__value=o;else if(i===`selected`&&f)Zi(e,o);else{var y=i;l||(y=Br(y));var b=y===`defaultValue`||y===`defaultChecked`;if(o==null&&!c&&!b)if(s[i]=null,y===`value`||y===`checked`){let n=e,r=t===void 0;if(y===`value`){let e=n.defaultValue;n.removeAttribute(y),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(y),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i);else b||m.includes(y)&&(c||typeof o!=`string`)?(e[y]=o,y in s&&(s[y]=S)):typeof o!=`function`&&Qi(e,y,o,a)}}}return u&&Ve(!0),d}function ea(e,t,n=[],r=[],i=[],a,o=!1,s=!1){wt(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===Yi,l=!1;if(Jn(()=>{var u=t(...n.map(V)),d=$i(e,r,u,a,o,s);l&&c&&`value`in u&&zi(e,u.value);for(let e of Object.getOwnPropertySymbols(i))u[e]||R(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var f=u[t];t.description===`@attach`&&(!r||f!==r[t])&&(i[t]&&R(i[t]),i[t]=Yn(()=>Di(e,()=>f))),d[t]=f}r=d}),c){var u=e;Wn(()=>{zi(u,r.value,!0),Bi(u)})}l=!0})}function ta(e){return e[pe]??={[Wi]:e.nodeName.includes(`-`),[Gi]:e.namespaceURI===Pe}}var na=new Map;function ra(e){var t=e.getAttribute(`is`)||e.nodeName,n=na.get(t);if(n)return n;na.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var s in r=o(i),r)r[s].set&&s!==`innerHTML`&&s!==`textContent`&&s!==`innerText`&&n.push(s);i=l(i)}return n}function ia(e,t,n=t){var r=new WeakSet;Nn(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=aa(e)?oa(a):a,n(a),j!==null&&r.add(j),await Ar(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(C&&e.defaultValue!==e.value||Nr(t)==null&&e.value)&&(n(aa(e)?oa(e.value):e.value),j!==null&&r.add(j)),Kn(()=>{var n=t();if(e===document.activeElement){var i=Xe?zt:j;if(r.has(i))return}aa(e)&&n===oa(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function aa(e){var t=e.type;return t===`number`||t===`range`}function oa(e){return e===``?null:+e}var sa={get(e,t){if(!e.exclude.has(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.has(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))}};function ca(e,t,n){return new Proxy({props:e,exclude:t},sa)}var la={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(d(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];d(i)&&(i=i());let o=a(i,t);if(o&&o.set)return o.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(d(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=a(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===ue||t===de)return!1;for(let n of e.props)if(d(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(d(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function ua(...e){return new Proxy({props:e},la)}function Y(e,t,n,r){var i=!Ze||(n&2)!=0,o=(n&8)!=0,s=(n&16)!=0,c=r,l=!0,u=void 0,d=()=>s&&i?(u??=Ot(r),V(u)):(l&&(l=!1,c=s?Nr(r):r),c);let f;if(o){var p=ue in e||de in e;f=a(e,t)?.set??(p&&t in e?n=>e[t]=n:void 0)}var m,h=!1;o?[m,h]=yt(()=>e[t]):m=e[t],m===void 0&&r!==void 0&&(m=d(),f&&(i&&De(t),f(m)));var g=i?()=>{var n=e[t];return n===void 0?d():(l=!0,n)}:()=>{var n=e[t];return n!==void 0&&(c=void 0),n===void 0?c:n};if(i&&!(n&4))return g;if(f){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||h)&&f(t?g():e),e):g()})}var v=!1,y=(n&1?Ot:jt)(()=>(v=!1,g()));o&&V(y);var b=B;return(function(e,t){if(arguments.length>0){let n=t?V(y):i&&o?mn(e):e;return N(y,n),v=!0,c!==void 0&&(c=n),e}return cr&&v||b.f&16384?y.v:V(y)})}function da(e){E===null&&be(`onMount`),Ze&&E.l!==null?fa(E).m.push(e):zn(()=>{let t=Nr(e);if(typeof t==`function`)return t})}function fa(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var X=new class{#e=M(null);get data(){return V(this.#e)}set data(e){N(this.#e,e,!0)}#t=M(null);get arsenal(){return V(this.#t)}set arsenal(e){N(this.#t,e,!0)}#n=M(`connecting`);get status(){return V(this.#n)}set status(e){N(this.#n,e,!0)}#r=M(``);get clock(){return V(this.#r)}set clock(e){N(this.#r,e,!0)}#i=M(`overview`);get view(){return V(this.#i)}set view(e){N(this.#i,e,!0)}#a=M(!1);get arsenalLoading(){return V(this.#a)}set arsenalLoading(e){N(this.#a,e,!0)}#o=!1;#s=null;async tick(){try{let e=await fetch(`/data`);if(!e.ok)throw Error(`HTTP ${e.status}`);this.data=await e.json(),this.status=`live`,this.clock=new Date().toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}catch{this.status=`offline`}}start(){this.tick(),this.#s=setInterval(()=>void this.tick(),1e4)}stop(){this.#s&&clearInterval(this.#s)}async loadArsenal(e=!1){if(!(this.#o&&!e)){this.arsenalLoading=!0;try{let e=await fetch(`/arsenal`);e.ok&&(this.arsenal=await e.json(),this.#o=!0)}catch{}finally{this.arsenalLoading=!1}}}go(e){this.view=e,e===`arsenal`&&this.loadArsenal()}};function Z(e){return typeof e!=`number`||!Number.isFinite(e)?`0`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function pa(e){return typeof e!=`number`||!Number.isFinite(e)?`$0.00`:`$${e.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2})}`}function ma(e){if(!e)return`\u2014`;let t=new Date(e);if(Number.isNaN(t.getTime()))return`\u2014`;let n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()?t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):t.toLocaleDateString([],{month:`short`,day:`numeric`})}function ha(e){if(!e)return`unknown`;let t=e.toLowerCase();return t===`<synthetic>`?`unknown`:t.includes(`fable`)?`fable`:t.includes(`opus`)?`opus`:t.includes(`sonnet`)?`sonnet`:t.includes(`haiku`)?`haiku`:`unknown`}function ga(e){return!e||e===`<synthetic>`?`synthetic`:e.replace(/^claude-/,``)}function _a(e){if(!e)return``;let t=e.split(/[/\\\\]/).filter(Boolean);return t.length<=2?t.join(`/`):`\u2026/${t.slice(-2).join(`/`)}`}var va=[220,75,20,155,285,330,250,45];function ya(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return`oklch(72% 0.15 ${va[t%va.length]})`}var ba={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},xa=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Sa=Symbol(`lucide-context`),Ca=()=>et(Sa),wa=new Set([`$$slots`,`$$events`,`$$legacy`,`name`,`color`,`size`,`strokeWidth`,`absoluteStrokeWidth`,`iconNode`,`children`]),Ta=ai(`<svg><!><!></svg>`);function Ea(e,t){D(t,!0);let n=Ca()??{},r=Y(t,`color`,19,()=>n.color??`currentColor`),i=Y(t,`size`,19,()=>n.size??24),a=Y(t,`strokeWidth`,19,()=>n.strokeWidth??2),o=Y(t,`absoluteStrokeWidth`,19,()=>n.absoluteStrokeWidth??!1),s=Y(t,`iconNode`,19,()=>[]),c=ca(t,wa),l=A(()=>o()?Number(a())*24/Number(i()):a());var u=Ta();ea(u,e=>({...ba,...e,...c,width:i(),height:i(),stroke:r(),"stroke-width":V(l),class:[`lucide-icon lucide`,n.class,t.name&&`lucide-${t.name}`,t.class]}),[()=>!t.children&&!xa(c)&&{"aria-hidden":`true`}]);var d=P(u);q(d,17,s,gi,(e,t)=>{var n=A(()=>h(V(t),2));let r=()=>V(n)[0],i=()=>V(n)[1];var a=U();Ei(F(a),r,!0,(e,t)=>{ea(e,()=>({...i()}))}),W(e,a)}),J(I(d),()=>t.children??f),T(u),W(e,u),O()}var Da=new Set([`$$slots`,`$$events`,`$$legacy`]);function Oa(e,t){let n=ca(t,Da),r=[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`}]];Ea(e,ua({name:`layout-dashboard`},()=>n,{get iconNode(){return r}}))}var ka=new Set([`$$slots`,`$$events`,`$$legacy`]);function Aa(e,t){let n=ca(t,ka),r=[[`polyline`,{points:`14.5 17.5 3 6 3 3 6 3 17.5 14.5`}],[`line`,{x1:`13`,x2:`19`,y1:`19`,y2:`13`}],[`line`,{x1:`16`,x2:`20`,y1:`16`,y2:`20`}],[`line`,{x1:`19`,x2:`21`,y1:`21`,y2:`19`}],[`polyline`,{points:`14.5 6.5 18 3 21 3 21 6 17.5 9.5`}],[`line`,{x1:`5`,x2:`9`,y1:`14`,y2:`18`}],[`line`,{x1:`7`,x2:`4`,y1:`17`,y2:`20`}],[`line`,{x1:`3`,x2:`5`,y1:`19`,y2:`21`}]];Ea(e,ua({name:`swords`},()=>n,{get iconNode(){return r}}))}var ja=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ma(e,t){let n=ca(t,ja),r=[[`path`,{d:`m7 11 2-2-2-2`}],[`path`,{d:`M11 13h4`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}]];Ea(e,ua({name:`square-terminal`},()=>n,{get iconNode(){return r}}))}var Na=new Set([`$$slots`,`$$events`,`$$legacy`]);function Pa(e,t){let n=ca(t,Na),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}],[`path`,{d:`M12 17h.01`}]];Ea(e,ua({name:`circle-question-mark`},()=>n,{get iconNode(){return r}}))}var Fa=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ia(e,t){let n=ca(t,Fa),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}]];Ea(e,ua({name:`panel-left`},()=>n,{get iconNode(){return r}}))}var La=H(`<div class="min-w-0"><div class="font-serif text-lg leading-none text-foreground">Synth<em>ra</em></div> <div class="font-mono text-[10px] uppercase tracking-[0.18em] text-muted-foreground">Dashboard</div></div>`),Ra=H(`<span class="font-mono text-sm text-muted-foreground"> </span>`),za=H(`<span> </span>`),Ba=H(`<button><!> <!></button>`),Va=H(`<span>FAQ</span>`),Ha=H(`<div class="flex flex-col gap-1 rounded-lg bg-sidebar-accent/40 p-2.5"><div class="font-mono text-[10px] uppercase tracking-[0.14em] text-muted-foreground">Active</div> <div class="truncate font-mono text-sm text-sidebar-foreground"> </div> <div class="mt-1 flex items-center justify-between font-mono text-[10px] text-muted-foreground"><span> </span> <span>v__SYN_VERSION__</span></div></div>`),Ua=H(`<span class="text-xs">Collapse</span>`),Wa=H(`<aside><div class="flex items-center gap-2.5 px-1 py-2"><div class="grid size-8 shrink-0 place-items-center rounded-lg bg-primary/90 font-serif text-lg italic text-primary-foreground">S</div> <!></div> <div><span></span> <!></div> <div class="my-1 h-px bg-sidebar-border"></div> <nav class="flex flex-col gap-1"><!> <button title="FAQ"><!> <!></button></nav> <div class="flex-1"></div> <!> <button title="Toggle sidebar"><!> <!></button></aside>`);function Ga(e,t){D(t,!0);let n=M(!1),r=typeof window<`u`&&window.location.port||`8901`,i=[{id:`overview`,label:`Overview`,icon:Oa},{id:`arsenal`,label:`Arsenal`,icon:Aa},{id:`commands`,label:`Commands`,icon:Ma}];var a=Wa(),o=P(a),s=I(P(o),2),c=e=>{W(e,La())};K(s,e=>{V(n)||e(c)}),T(o);var l=I(o,2),u=P(l);let d;var f=I(u,2),p=e=>{var t=Ra(),n=P(t,!0);T(t),L(()=>G(n,X.status===`live`?`live \xB7 ${X.clock}`:X.status)),W(e,t)};K(f,e=>{V(n)||e(p)}),T(l);var m=I(l,4),h=P(m);q(h,17,()=>i,e=>e.id,(e,t)=>{var r=Ba(),i=P(r);Ti(i,()=>V(t).icon,(e,t)=>{t(e,{class:`size-4 shrink-0`})});var a=I(i,2),o=e=>{var n=za(),r=P(n,!0);T(n),L(()=>G(r,V(t).label)),W(e,n)};K(a,e=>{V(n)||e(o)}),T(r),L(()=>{Qi(r,`title`,V(t).label),Ii(r,1,`flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm transition-colors `+(X.view===V(t).id?`bg-sidebar-accent text-sidebar-accent-foreground`:`text-sidebar-foreground/75 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground`)+(V(n)?` justify-center`:``))}),Xr(`click`,r,()=>X.go(V(t).id)),W(e,r)});var g=I(h,2),_=P(g);Pa(_,{class:`size-4 shrink-0`});var v=I(_,2),y=e=>{W(e,Va())};K(v,e=>{V(n)||e(y)}),T(g),T(m);var b=I(m,4),ee=e=>{var t=Ha(),n=I(P(t),2),i=P(n,!0);T(n);var a=I(n,2),o=P(a),s=P(o);T(o),We(2),T(a),T(t),L(()=>{Qi(n,`title`,X.data?.active?.project_root??`\u2014`),G(i,X.data?.active?.project_name??`\u2014`),G(s,`port ${r??``}`)}),W(e,t)};K(b,e=>{V(n)||e(ee)});var x=I(b,2),te=P(x);Ia(te,{class:`size-4 shrink-0`});var ne=I(te,2),re=e=>{W(e,Ua())};K(ne,e=>{V(n)||e(re)}),T(x),T(a),L(()=>{Ii(a,1,`flex h-screen shrink-0 flex-col gap-1 border-r border-sidebar-border bg-sidebar p-3 transition-[width] duration-200 `+(V(n)?`w-[64px] items-center`:`w-[248px]`)),Ii(l,1,`flex items-center gap-2 rounded-md px-2 py-1.5 `+(V(n)?`justify-center`:``)),d=Ii(u,1,`size-2 shrink-0 rounded-full `+(X.status===`live`?`bg-[var(--c-fable)]`:X.status===`offline`?`bg-destructive`:`bg-muted-foreground`),null,d,{"animate-pulse":X.status===`live`}),Ii(g,1,`flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm text-sidebar-foreground/75 transition-colors hover:bg-sidebar-accent/50 hover:text-sidebar-foreground `+(V(n)?`justify-center`:``)),Ii(x,1,`mt-1 flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent/50 hover:text-sidebar-foreground `+(V(n)?`justify-center`:``))}),Xr(`click`,g,function(...e){t.onFaq?.apply(this,e)}),Xr(`click`,x,()=>N(n,!V(n))),W(e,a),O()}Zr([`click`]),Qe();var Ka=H(`<div class="flex flex-col gap-1 bg-card/70 p-4"><span class="font-mono text-xs uppercase tracking-[0.12em] text-muted-foreground"> </span> <span class="font-mono text-2xl tabular-nums text-foreground"> </span></div>`),qa=H(`<div class="grid grid-cols-2 gap-px overflow-hidden rounded-xl border bg-border sm:grid-cols-3 lg:grid-cols-5"></div>`);function Ja(e,t){D(t,!0);let n=A(()=>{let e=X.data?.global;return[{label:`Turns`,v:e?.total_turns??0},{label:`\u2193 Input`,v:e?.total_input_tokens??0},{label:`\u2191 Output`,v:e?.total_output_tokens??0},{label:`\u27F2 Cache R`,v:e?.total_cache_read??0},{label:`\uFF0B Cache W`,v:e?.total_cache_create??0}]});var r=qa();q(r,21,()=>V(n),e=>e.label,(e,t)=>{var n=Ka(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=P(a,!0);T(a),T(n),L(e=>{G(i,V(t).label),G(o,e)},[()=>Z(V(t).v)]),W(e,n)}),T(r),W(e,r),O()}var Ya=H(`<span class="font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground"> </span>`),Xa=H(`<header class="flex items-baseline justify-between gap-3"><span class="font-mono text-xs uppercase tracking-[0.14em] text-muted-foreground"> </span> <!></header>`),Za=H(`<section><!> <!></section>`);function Qa(e,t){let n=Y(t,`class`,3,``);var r=Za(),i=P(r),a=e=>{var n=Xa(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=e=>{var n=Ya(),r=P(n,!0);T(n),L(()=>G(r,t.meta)),W(e,n)};K(a,e=>{t.meta&&e(o)}),T(n),L(()=>G(i,t.title)),W(e,n)};K(i,e=>{t.title&&e(a)}),J(I(i,2),()=>t.children??f),T(r),L(()=>Ii(r,1,`flex h-full min-h-0 flex-col gap-3 rounded-xl border bg-card/55 p-4 transition-colors hover:bg-card/80 `+n())),W(e,r)}var $a=H(`<div class="flex flex-col gap-3"><div><div class="font-mono text-3xl text-[var(--money)]"> </div> <div class="font-mono text-sm text-muted-foreground"> </div></div> <div class="flex h-2 overflow-hidden rounded-full bg-border"><div class="h-full bg-muted-foreground/40"></div> <div class="h-full bg-[var(--money)]"></div></div> <div class="flex justify-between font-mono text-xs text-muted-foreground"><span>you paid <b class="text-foreground"> </b></span> <span>baseline <b class="text-foreground"> </b></span></div> <div class="rounded-md border border-dashed border-border px-3 py-2 text-center font-mono text-xs text-muted-foreground"><b class="text-foreground"> </b> blocks \xD7 <b class="text-foreground">500</b> tokens \xD7 <b class="text-foreground">$3</b>/M = <b class="text-[var(--money)]"> </b></div></div>`);function eo(e,t){D(t,!0);let n=A(()=>{let e=X.data?.global,t=e?.blocked_count??0,n=t*500*3/1e6,r=e?.estimated_cost_usd??0,i=r+n;return{blocks:t,money:n,paid:r,baseline:i,pct:i>0?n/i*100:0,tokens:e?.estimated_tokens_saved??0,paidWidth:i>0?r/i*100:100}});{let t=A(()=>`${V(n).pct.toFixed(1)}% off \xB7 floor`);Qa(e,{title:`Synthra savings`,get meta(){return V(t)},children:(e,t)=>{var r=$a(),i=P(r),a=P(i),o=P(a,!0);T(a);var s=I(a,2),c=P(s);T(s),T(i);var l=I(i,2),u=P(l),d=I(u,2);T(l);var f=I(l,2),p=P(f),m=I(P(p)),h=P(m,!0);T(m),T(p);var g=I(p,2),_=I(P(g)),v=P(_,!0);T(_),T(g),T(f);var y=I(f,2),b=P(y),ee=P(b,!0);T(b);var x=I(b,6),te=P(x,!0);T(x),T(y),T(r),L((e,t,r,i,a)=>{G(o,e),G(c,`${t??``} tokens avoided`),Ri(u,`width:${V(n).paidWidth}%`),Ri(d,`width:${100-V(n).paidWidth}%`),G(h,r),G(v,i),G(ee,V(n).blocks),G(te,a)},[()=>pa(V(n).money),()=>Z(V(n).tokens),()=>pa(V(n).paid),()=>pa(V(n).baseline),()=>pa(V(n).money)]),W(e,r)},$$slots:{default:!0}})}O()}var to=H(`<div class="font-mono text-3xl text-[var(--money)]"> </div> <div class="mt-1 flex flex-col gap-1 font-mono text-sm text-muted-foreground"><div class="flex justify-between"><span>Tokens (in+out)</span><span class="text-foreground"> </span></div> <div class="flex justify-between"><span>Avg / turn</span><span class="text-foreground"> </span></div></div>`,1);function no(e,t){D(t,!0);let n=A(()=>{let e=X.data?.global,t=e?.total_turns??0,n=e?.estimated_cost_usd??0;return{cost:n,tokens:(e?.total_input_tokens??0)+(e?.total_output_tokens??0),avg:t>0?n/t:0}});Qa(e,{title:`Total spend`,meta:`all time`,children:(e,t)=>{var r=to(),i=F(r),a=P(i,!0);T(i);var o=I(i,2),s=P(o),c=I(P(s)),l=P(c,!0);T(c),T(s);var u=I(s,2),d=I(P(u)),f=P(d,!0);T(d),T(u),T(o),L((e,t,n)=>{G(a,e),G(l,t),G(f,n)},[()=>pa(V(n).cost),()=>Z(V(n).tokens),()=>pa(V(n).avg)]),W(e,r)},$$slots:{default:!0}}),O()}var ro=ai(`<circle cx="70" cy="70" r="52" fill="none" stroke-width="14"></circle>`),io=H(`<div class="flex items-center gap-2 font-mono text-sm"><span class="size-2 rounded-sm"></span> <span class="flex-1 text-muted-foreground"> </span> <span class="tabular-nums text-foreground"> </span> <span class="w-9 text-right tabular-nums text-muted-foreground"> </span></div>`),ao=H(`<div class="text-sm text-muted-foreground">No turns yet.</div>`),oo=H(`<div class="flex items-center gap-4"><div class="relative size-[116px] shrink-0"><svg viewBox="0 0 140 140" class="size-full -rotate-90"><circle cx="70" cy="70" r="52" fill="none" stroke="var(--border)" stroke-width="14"></circle><!></svg> <div class="absolute inset-0 grid place-items-center"><div class="text-center"><div class="font-mono text-2xl text-foreground"> </div> <div class="font-mono text-[10px] uppercase text-muted-foreground">turns</div></div></div></div> <div class="flex min-w-0 flex-1 flex-col gap-1.5"></div></div>`);function so(e,t){D(t,!0);let n=[{fam:`fable`,label:`Fable`,color:`var(--c-fable)`},{fam:`opus`,label:`Opus`,color:`var(--c-opus)`},{fam:`sonnet`,label:`Sonnet`,color:`var(--c-sonnet)`},{fam:`haiku`,label:`Haiku`,color:`var(--c-haiku)`},{fam:`unknown`,label:`Other`,color:`var(--c-unknown)`}],r=2*Math.PI*52,i=A(()=>{let e={fable:0,opus:0,sonnet:0,haiku:0,unknown:0};for(let t of X.data?.projects??[])for(let[n,r]of Object.entries(t.models??{}))e[ha(n)]+=r;let t=n.reduce((t,n)=>t+e[n.fam],0),i=0;return{arcs:n.filter(t=>e[t.fam]>0).map(n=>{let a=e[n.fam],o=t>0?a/t*r:0,s={...n,n:a,len:o,offset:i,pct:t>0?Math.round(a/t*100):0};return i+=o,s}),total:t}});Qa(e,{title:`Model usage`,meta:`by turns`,children:(e,t)=>{var n=oo(),a=P(n),o=P(a);q(I(P(o)),17,()=>V(i).arcs,e=>e.fam,(e,t)=>{var n=ro();L(()=>{Qi(n,`stroke`,V(t).color),Qi(n,`stroke-dasharray`,`${V(t).len} ${r}`),Qi(n,`stroke-dashoffset`,-V(t).offset),Qi(n,`stroke-linecap`,V(i).arcs.length===1?`round`:`butt`)}),W(e,n)}),T(o);var s=I(o,2),c=P(s),l=P(c),u=P(l,!0);T(l),We(2),T(c),T(s),T(a);var d=I(a,2);q(d,21,()=>V(i).arcs,e=>e.fam,(e,t)=>{var n=io(),r=P(n),i=I(r,2),a=P(i,!0);T(i);var o=I(i,2),s=P(o,!0);T(o);var c=I(o,2),l=P(c);T(c),T(n),L(()=>{Ri(r,`background:${V(t).color}`),G(a,V(t).label),G(s,V(t).n),G(l,`${V(t).pct??``}%`)}),W(e,n)},e=>{W(e,ao())}),T(d),T(n),L(()=>G(u,V(i).total)),W(e,n)},$$slots:{default:!0}}),O()}function co(e){return typeof e==`object`&&!!e}var lo=[`string`,`number`,`bigint`,`boolean`];function uo(e){return e==null||lo.includes(typeof e)?!0:Array.isArray(e)?e.every(e=>uo(e)):typeof e==`object`?Object.getPrototypeOf(e)===Object.prototype:!1}var fo=Symbol(`box`),po=Symbol(`is-writable`);function Q(e,t){let n=A(e);return t?{[fo]:!0,[po]:!0,get current(){return V(n)},set current(e){t(e)}}:{[fo]:!0,get current(){return e()}}}function mo(e){return co(e)&&fo in e}function ho(e){let t=M(mn(e));return{[fo]:!0,[po]:!0,get current(){return V(t)},set current(e){N(t,e,!0)}}}function go(...e){return function(t){for(let n of e)if(n){if(t.defaultPrevented)return;typeof n==`function`?n.call(this,t):n.current?.call(this,t)}}}var _o=/\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g,vo=/\\n/g,yo=/^\\s*/,bo=/^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/,xo=/^:\\s*/,So=/^((?:\'(?:\\\\\'|.)*?\'|"(?:\\\\"|.)*?"|\\([^)]*?\\)|[^};])+)/,Co=/^[;\\s]*/,wo=/^\\s+|\\s+$/g,To=`\n`,Eo=`/`,Do=`*`,Oo=``,ko=`comment`,Ao=`declaration`;function jo(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(vo);t&&(n+=t.length);var i=e.lastIndexOf(To);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(yo)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(!(Eo!=e.charAt(0)||Do!=e.charAt(1))){for(var n=2;Oo!=e.charAt(n)&&(Do!=e.charAt(n)||Eo!=e.charAt(n+1));)++n;if(n+=2,Oo===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:ko,comment:o})}}function f(){var e=a(),t=c(bo);if(t){if(d(),!c(xo))return s(`property missing \':\'`);var n=c(So),r=e({type:Ao,property:Mo(t[0].replace(_o,Oo)),value:n?Mo(n[0].replace(_o,Oo)):Oo});return c(Co),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function Mo(e){return e?e.replace(wo,Oo):Oo}function No(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=jo(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}var Po=/\\d/,Fo=[`-`,`_`,`/`,`.`];function Io(e=``){if(!Po.test(e))return e!==e.toLowerCase()}function Lo(e){let t=[],n=``,r,i;for(let a of e){let e=Fo.includes(a);if(e===!0){t.push(n),n=``,r=void 0;continue}let o=Io(a);if(i===!1){if(r===!1&&o===!0){t.push(n),n=a,r=o;continue}if(r===!0&&o===!1&&n.length>1){let e=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=e+a,r=o;continue}}n+=a,r=o,i=e}return t.push(n),t}function Ro(e){return e?Lo(e).map(e=>Bo(e)).join(``):``}function zo(e){return Vo(Ro(e||``))}function Bo(e){return e?e[0].toUpperCase()+e.slice(1):``}function Vo(e){return e?e[0].toLowerCase()+e.slice(1):``}function Ho(e){if(!e)return{};let t={};function n(e,n){if(e.startsWith(`-moz-`)||e.startsWith(`-webkit-`)||e.startsWith(`-ms-`)||e.startsWith(`-o-`)){t[Ro(e)]=n;return}if(e.startsWith(`--`)){t[e]=n;return}t[zo(e)]=n}return No(e,n),t}function Uo(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function Wo(e,t){let n=RegExp(e,`g`);return e=>{if(typeof e!=`string`)throw TypeError(`expected an argument of type string, but got ${typeof e}`);return e.match(n)?e.replace(n,t):e}}var Go=Wo(/[A-Z]/,e=>`-${e.toLowerCase()}`);function Ko(e){if(!e||typeof e!=`object`||Array.isArray(e))throw TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${Go(t)}: ${e[t]};`).join(`\n`)}function qo(e={}){return Ko(e).replace(`\n`,` `)}var Jo=new Set(`onabort.onanimationcancel.onanimationend.onanimationiteration.onanimationstart.onauxclick.onbeforeinput.onbeforetoggle.onblur.oncancel.oncanplay.oncanplaythrough.onchange.onclick.onclose.oncompositionend.oncompositionstart.oncompositionupdate.oncontextlost.oncontextmenu.oncontextrestored.oncopy.oncuechange.oncut.ondblclick.ondrag.ondragend.ondragenter.ondragleave.ondragover.ondragstart.ondrop.ondurationchange.onemptied.onended.onerror.onfocus.onfocusin.onfocusout.onformdata.ongotpointercapture.oninput.oninvalid.onkeydown.onkeypress.onkeyup.onload.onloadeddata.onloadedmetadata.onloadstart.onlostpointercapture.onmousedown.onmouseenter.onmouseleave.onmousemove.onmouseout.onmouseover.onmouseup.onpaste.onpause.onplay.onplaying.onpointercancel.onpointerdown.onpointerenter.onpointerleave.onpointermove.onpointerout.onpointerover.onpointerup.onprogress.onratechange.onreset.onresize.onscroll.onscrollend.onsecuritypolicyviolation.onseeked.onseeking.onselect.onselectionchange.onselectstart.onslotchange.onstalled.onsubmit.onsuspend.ontimeupdate.ontoggle.ontouchcancel.ontouchend.ontouchmove.ontouchstart.ontransitioncancel.ontransitionend.ontransitionrun.ontransitionstart.onvolumechange.onwaiting.onwebkitanimationend.onwebkitanimationiteration.onwebkitanimationstart.onwebkittransitionend.onwheel`.split(`.`));function Yo(e){return Jo.has(e)}function Xo(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];if(r){for(let e of Object.keys(r)){let n=t[e],i=r[e],a=typeof n==`function`,o=typeof i==`function`;if(a&&typeof o&&Yo(e))t[e]=go(n,i);else if(a&&o)t[e]=Uo(n,i);else if(e===`class`){let r=uo(n),a=uo(i);r&&a?t[e]=ki(n,i):r?t[e]=ki(n):a&&(t[e]=ki(i))}else if(e===`style`){let r=typeof n==`object`,a=typeof i==`object`,o=typeof n==`string`,s=typeof i==`string`;if(r&&a)t[e]={...n,...i};else if(r&&s){let r=Ho(i);t[e]={...n,...r}}else if(o&&a)t[e]={...Ho(n),...i};else if(o&&s){let r=Ho(n),a=Ho(i);t[e]={...r,...a}}else r?t[e]=n:a?t[e]=i:o?t[e]=n:s&&(t[e]=i)}else t[e]=i===void 0?n:i}for(let e of Object.getOwnPropertySymbols(r)){let n=t[e],i=r[e];t[e]=i===void 0?n:i}}}return typeof t.style==`object`&&(t.style=qo(t.style).replaceAll(`\n`,` `)),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}var Zo=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function Qo(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var $o=class extends Map{#e=new Map;#t=M(0);#n=M(0);#r=xr||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return xr===this.#r?M(e):cn(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else return V(this.#t),!1;return V(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else{V(this.#t);return}return V(n),super.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),N(this.#n,super.size),fn(o);else if(i!==t){fn(r);var s=o.reactions===null?null:new Set(o.reactions);(s===null||!r.reactions?.every(e=>s.has(e)))&&fn(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),N(n,-1)),r&&(N(this.#n,super.size),fn(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;N(this.#n,0);for(var t of e.values())N(t,-1);fn(this.#t),e.clear()}}#a(){V(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)V(n)}keys(){return V(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return V(this.#n),super.size}};new class{#e;#t;constructor(e={}){let{window:t=Zo,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=bt(e=>{let n=Yr(t,`focusin`,e),r=Yr(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?Qo(this.#e):null}};var es=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return nt(this.#t)}get(){let e=et(this.#t);if(e===void 0)throw Error(`Context "${this.#e}" not found`);return e}getOr(e){let t=et(this.#t);return t===void 0?e:t}set(e){return tt(this.#t,e)}};function ts(e,t){switch(e){case`post`:zn(t);break;case`pre`:Vn(t);break}}function ns(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;ts(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=Nr(()=>n(t,o));return o=t,r})}function rs(e,t,n){let r=Hn(()=>{let i=!1;ns(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});zn(()=>r)}function is(e,t,n){ns(e,`post`,t,n)}function as(e,t,n){ns(e,`pre`,t,n)}is.pre=as;function os(e,t){rs(e,`post`,t)}function ss(e,t){rs(e,`pre`,t)}os.pre=ss;function cs(e,t){let n,r=null;return(...i)=>new Promise(a=>{r&&r(void 0),r=a,clearTimeout(n),n=setTimeout(async()=>{let t=await e(...i);r&&=(r(t),null)},t)})}function ls(e,t){let n=0,r=null;return(...i)=>{let a=Date.now();return n&&a-n<t?r??Promise.resolve(void 0):(n=a,r=e(...i),r)}}function us(e,t,n={},r){let{lazy:i=!1,once:a=!1,initialValue:o,debounce:s,throttle:c}=n,l=M(mn(o)),u=M(!1),d=M(void 0),f=M(mn([])),p=()=>{V(f).forEach(e=>e()),N(f,[],!0)},m=e=>{N(f,[...V(f),e],!0)},h=async(e,n,r=!1)=>{try{N(u,!0),N(d,void 0),p();let i=new AbortController;m(()=>i.abort());let a=await t(e,n,{data:V(l),refetching:r,onCleanup:m,signal:i.signal});return N(l,a,!0),a}catch(e){e instanceof DOMException&&e.name===`AbortError`||N(d,e,!0);return}finally{N(u,!1)}},g=s?cs(h,s):c?ls(h,c):h,_=Array.isArray(e)?e:[e],v;return r((t,n)=>{a&&v||(v=t,g(Array.isArray(e)?t:t[0],Array.isArray(e)?n:n?.[0]))},{lazy:i}),{get current(){return V(l)},get loading(){return V(u)},get error(){return V(d)},mutate:e=>{N(l,e,!0)},refetch:t=>{let n=_.map(e=>e());return g(Array.isArray(e)?n:n[0],Array.isArray(e)?n:n[0],t??!0)}}}function ds(e,t,n){return us(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];is(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}function fs(e,t,n){return us(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];is.pre(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}ds.pre=fs;function ps(e){zn(()=>()=>{e()})}function ms(e,t){return setTimeout(t,e)}function hs(e){Ar().then(e)}var gs=1,_s=9,vs=11;function ys(e){return co(e)&&e.nodeType===gs&&typeof e.nodeName==`string`}function bs(e){return co(e)&&e.nodeType===_s}function xs(e){return co(e)&&e.constructor?.name===`VisualViewport`}function Ss(e){return co(e)&&e.nodeType!==void 0}function Cs(e){return Ss(e)&&e.nodeType===vs&&`host`in e}function ws(e,t){if(!e||!t||!ys(e)||!ys(t))return!1;let n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&Cs(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ts(e){return bs(e)?e:xs(e)?e.document:e?.ownerDocument??document}function Es(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var Ds=class{element;#e=A(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return V(this.#e)}set root(e){N(this.#e,e)}constructor(e){typeof e==`function`?this.element=Q(e):this.element=e}getDocument=()=>Ts(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>Es(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)};function Os(e,t){return{[Pr()]:n=>mo(e)?(e.current=n,Nr(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e.current=null,t?.(null))}):(e(n),Nr(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e(null),t?.(null))})}}function ks(e){return e?``:void 0}function As(e){return e?`open`:`closed`}function js(e){return e===`starting`?{"data-starting-style":``}:e===`ending`?{"data-ending-style":``}:{}}var Ms=class{#e;#t;attrs;constructor(e){this.#e=e.getVariant?e.getVariant():null,this.#t=this.#e?`data-${this.#e}-`:`data-${e.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(e.parts.map(e=>[e,this.getAttr(e)]))}getAttr(e,t){return t?`data-${t}-${e}`:`${this.#t}${e}`}selector(e,t){return`[${this.getAttr(e,t)}]`}};function Ns(e){let t=new Ms(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}var Ps=typeof document<`u`,Fs=Is();function Is(){return Ps&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Ls(e){return e instanceof HTMLElement}function Rs(e){return e instanceof Element||e instanceof SVGElement}var zs=class{#e;#t=null;#n=null;#r=0;constructor(e){this.#e=e,ps(()=>this.#i())}#i(){this.#t!==null&&(window.cancelAnimationFrame(this.#t),this.#t=null),this.#n?.disconnect(),this.#n=null,this.#r++}run(e){this.#i();let t=this.#e.ref.current;if(!t)return;if(typeof t.getAnimations!=`function`){this.#a(e);return}let n=this.#r,r=()=>{n===this.#r&&this.#a(e)},i=()=>{if(n!==this.#r)return;let e=t.getAnimations();if(e.length===0){r();return}Promise.all(e.map(e=>e.finished)).then(()=>{r()}).catch(()=>{if(n===this.#r){if(t.getAnimations().some(e=>e.pending||e.playState!==`finished`)){i();return}r()}})},a=()=>{this.#t=window.requestAnimationFrame(()=>{this.#t=null,i()})};if(!this.#e.afterTick.current){a();return}this.#t=window.requestAnimationFrame(()=>{this.#t=null;let e=`data-starting-style`;if(!t.hasAttribute(e)){a();return}this.#n=new MutationObserver(()=>{n===this.#r&&(t.hasAttribute(e)||(this.#n?.disconnect(),this.#n=null,a()))}),this.#n.observe(t,{attributes:!0,attributeFilter:[e]})})}#a(e){let t=()=>{e()};this.#e.afterTick?hs(t):t()}},Bs=class{#e;#t;#n;#r=M(!1);#i=M(void 0);#a=!1;#o=null;constructor(e){this.#e=e,N(this.#r,e.open.current,!0),this.#t=e.enabled??!0,this.#n=new zs({ref:this.#e.ref,afterTick:this.#e.open}),ps(()=>this.#s()),is(()=>this.#e.open.current,e=>{if(!this.#a){this.#a=!0;return}if(this.#s(),!e&&this.#e.shouldSkipExitAnimation?.()){N(this.#r,!1),N(this.#i,void 0),this.#e.onComplete?.();return}if(e&&N(this.#r,!0),N(this.#i,e?`starting`:`ending`,!0),e&&(this.#o=window.requestAnimationFrame(()=>{this.#o=null,this.#e.open.current&&N(this.#i,void 0)})),!this.#t){e||N(this.#r,!1),N(this.#i,void 0),this.#e.onComplete?.();return}this.#n.run(()=>{e===this.#e.open.current&&(this.#e.open.current||N(this.#r,!1),N(this.#i,void 0),this.#e.onComplete?.())})})}get shouldRender(){return V(this.#r)}get transitionStatus(){return V(this.#i)}#s(){this.#o!==null&&(window.cancelAnimationFrame(this.#o),this.#o=null)}};function $(){}function Vs(e,t){return t===void 0?`bits-${e}`:`bits-${e}-${t}`}var Hs=Ns({component:`dialog`,parts:[`content`,`trigger`,`overlay`,`title`,`description`,`close`,`cancel`,`action`]}),Us=new es(`Dialog.Root | AlertDialog.Root`),Ws=class e{static create(t){let n=Us.getOr(null);return Us.set(new e(t,n))}opts;#e=M(null);get triggerNode(){return V(this.#e)}set triggerNode(e){N(this.#e,e,!0)}#t=M(null);get contentNode(){return V(this.#t)}set contentNode(e){N(this.#t,e,!0)}#n=M(null);get overlayNode(){return V(this.#n)}set overlayNode(e){N(this.#n,e,!0)}#r=M(null);get descriptionNode(){return V(this.#r)}set descriptionNode(e){N(this.#r,e,!0)}#i=M(void 0);get contentId(){return V(this.#i)}set contentId(e){N(this.#i,e,!0)}#a=M(void 0);get titleId(){return V(this.#a)}set titleId(e){N(this.#a,e,!0)}#o=M(void 0);get triggerId(){return V(this.#o)}set triggerId(e){N(this.#o,e,!0)}#s=M(void 0);get descriptionId(){return V(this.#s)}set descriptionId(e){N(this.#s,e,!0)}#c=M(null);get cancelNode(){return V(this.#c)}set cancelNode(e){N(this.#c,e,!0)}#l=M(0);get nestedOpenCount(){return V(this.#l)}set nestedOpenCount(e){N(this.#l,e,!0)}depth;parent;contentPresence;overlayPresence;constructor(e,t){this.opts=e,this.parent=t,this.depth=t?t.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new Bs({ref:Q(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new Bs({ref:Q(()=>this.overlayNode),open:this.opts.open,enabled:!0}),is(()=>this.opts.open.current,e=>{this.parent&&(e?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),ps(()=>{this.opts.open.current&&this.parent?.decrementNested()})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=e=>Hs.getAttr(e,this.opts.variant.current);incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}#u=A(()=>({"data-state":As(this.opts.open.current)}));get sharedProps(){return V(this.#u)}set sharedProps(e){N(this.#u,e)}},Gs=class e{static create(t){return new e(t,Us.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Os(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),this.root.handleClose())}#e=A(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:``,onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return V(this.#e)}set props(e){N(this.#e,e)}},Ks=class e{static create(t){return new e(t,Us.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.titleId=this.opts.id.current,this.attachment=Os(this.opts.ref),is.pre(()=>this.opts.id.current,e=>{this.root.titleId=e})}#e=A(()=>({id:this.opts.id.current,role:`heading`,"aria-level":this.opts.level.current,[this.root.getBitsAttr(`title`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return V(this.#e)}set props(e){N(this.#e,e)}},qs=class e{static create(t){return new e(t,Us.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.descriptionId=this.opts.id.current,this.attachment=Os(this.opts.ref,e=>{this.root.descriptionNode=e}),is.pre(()=>this.opts.id.current,e=>{this.root.descriptionId=e})}#e=A(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`description`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return V(this.#e)}set props(e){N(this.#e,e)}},Js=class e{static create(t){return new e(t,Us.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Os(this.opts.ref,e=>{this.root.contentNode=e,this.root.contentId=e?.id})}#e=A(()=>({open:this.root.opts.open.current}));get snippetProps(){return V(this.#e)}set snippetProps(e){N(this.#e,e)}#t=A(()=>({id:this.opts.id.current,role:this.root.opts.variant.current===`alert-dialog`?`alertdialog`:`dialog`,"aria-modal":`true`,"aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr(`content`)]:``,style:{pointerEvents:`auto`,outline:this.root.opts.variant.current===`alert-dialog`?`none`:void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:`layout style`},tabindex:this.root.opts.variant.current===`alert-dialog`?-1:void 0,"data-nested-open":ks(this.root.nestedOpenCount>0),"data-nested":ks(this.root.parent!==null),...js(this.root.contentPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return V(this.#t)}set props(e){N(this.#t,e)}get shouldRender(){return this.root.contentPresence.shouldRender}},Ys=class e{static create(t){return new e(t,Us.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Os(this.opts.ref,e=>this.root.overlayNode=e)}#e=A(()=>({open:this.root.opts.open.current}));get snippetProps(){return V(this.#e)}set snippetProps(e){N(this.#e,e)}#t=A(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`overlay`)]:``,style:{pointerEvents:`auto`,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":ks(this.root.nestedOpenCount>0),"data-nested":ks(this.root.parent!==null),...js(this.root.overlayPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return V(this.#t)}set props(e){N(this.#t,e)}get shouldRender(){return this.root.overlayPresence.shouldRender}},Xs=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`level`]),Zs=H(`<div><!></div>`);function Qs(e,t){let n=si();D(t,!0);let r=Y(t,`id`,19,()=>Vs(n)),i=Y(t,`ref`,15,null),a=Y(t,`level`,3,2),o=ca(t,Xs),s=Ks.create({id:Q(()=>r()),level:Q(()=>a()),ref:Q(()=>i(),e=>i(e))}),c=A(()=>Xo(o,s.props));var l=U(),u=F(l),d=e=>{var n=U();J(F(n),()=>t.child,()=>({props:V(c)})),W(e,n)},p=e=>{var n=Zs();ea(n,()=>({...V(c)})),J(P(n),()=>t.children??f),T(n),W(e,n)};K(u,e=>{t.child?e(d):e(p,-1)}),W(e,l),O()}function $s(e,t){var n=U();hi(F(n),()=>t.children,e=>{var n=U();J(F(n),()=>t.children??f),W(e,n)}),W(e,n)}var ec=new es(`BitsConfig`);function tc(){let e=new nc(null,{});return ec.getOr(e).opts}var nc=class{opts;constructor(e,t){let n=rc(e,t);this.opts={defaultPortalTo:n(e=>e.defaultPortalTo),defaultLocale:n(e=>e.defaultLocale)}}};function rc(e,t){return n=>Q(()=>{let r=n(t)?.current;if(r!==void 0)return r;if(e!==null)return n(e.opts)?.current})}function ic(e,t){return n=>{let r=tc();return Q(()=>{let i=n();if(i!==void 0)return i;let a=e(r).current;return a===void 0?t:a})}}var ac=ic(e=>e.defaultPortalTo,`body`);function oc(e,t){D(t,!0);let n=ac(()=>t.to),r=rt(),i=A(a);function a(){if(!Ps||t.disabled)return null;let e=null;return e=typeof n.current==`string`?document.querySelector(n.current):n.current,e}let o;function s(){o&&=(fi(o),null)}is([()=>V(i),()=>t.disabled],([e,n])=>{if(!e||n){s();return}return o=ci($s,{target:e,props:{children:t.children},context:r}),()=>{s()}});var c=U(),l=F(c),u=e=>{var n=U();J(F(n),()=>t.children??f),W(e,n)};K(l,e=>{t.disabled&&e(u)}),W(e,c),O()}var sc=class{eventName;options;constructor(e,t={bubbles:!0,cancelable:!0}){this.eventName=e,this.options=t}createEvent(e){return new CustomEvent(this.eventName,{...this.options,detail:e})}dispatch(e,t){let n=this.createEvent(t);return e.dispatchEvent(n),n}listen(e,t,n){return Yr(e,this.eventName,e=>{t(e)},n)}};function cc(e,t=500){let n=null,r=(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function lc(e,t){return e===t||e.contains(t)}function uc(e){return e?.ownerDocument??document}function dc(e,t){let{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return n<i.left||n>i.right||r<i.top||r>i.bottom}var fc=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],pc=fc.join(`,`),mc=typeof Element>`u`,hc=mc?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,gc=!mc&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},_c=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):_c(e.parentNode))},vc=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},yc=function(e,t,n){if(_c(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(pc));return t&&hc.call(e,pc)&&r.unshift(e),r=r.filter(n),r},bc=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!_c(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=bc(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{hc.call(a,pc)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!_c(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=bc(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},xc=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Sc=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||vc(e))&&!xc(e)?0:e.tabIndex},Cc=function(e,t){var n=Sc(e);return n<0&&t&&!xc(e)?0:n},wc=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Tc=function(e){return e.tagName===`INPUT`},Ec=function(e){return Tc(e)&&e.type===`hidden`},Dc=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Oc=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},kc=function(e){if(!e.name)return!0;var t=e.form||gc(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Oc(r,e.form);return!i||i===e},Ac=function(e){return Tc(e)&&e.type===`radio`},jc=function(e){return Ac(e)&&!kc(e)},Mc=function(e){var t=e&&gc(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=gc(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Nc=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Pc=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=hc.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(hc.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=gc(e);if(o&&!o.shadowRoot&&r(o)===!0)return Nc(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Mc(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Nc(e);return!1},Fc=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return hc.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Ic=function(e,t){return!(t.disabled||Ec(t)||Pc(t,e)||Dc(t)||Fc(t))},Lc=function(e,t){return!(jc(t)||Sc(t)<0||!Ic(e,t))},Rc=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},zc=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Cc(a,i),s=i?zc(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(wc).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Bc=function(e,t){return t||={},zc(t.getShadowRoot?bc([e],t.includeContainer,{filter:Lc.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Rc}):yc(e,t.includeContainer,Lc.bind(null,t)))},Vc=function(e,t){return t||={},t.getShadowRoot?bc([e],t.includeContainer,{filter:Ic.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):yc(e,t.includeContainer,Ic.bind(null,t))},Hc=fc.concat(`iframe:not([inert]):not([inert] *)`).join(`,`),Uc=function(e,t){if(t||={},!e)throw Error(`No node provided`);return hc.call(e,Hc)===!1?!1:Ic(t,e)},Wc=`data-context-menu-trigger`,Gc=`data-context-menu-content`;new es(`Menu.Root`),new es(`Menu.Root | Menu.Sub`),new es(`Menu.Content`),new es(`Menu.Group | Menu.RadioGroup`),new es(`Menu.RadioGroup`),new es(`Menu.CheckboxGroup`),new sc(`bitsmenuopen`,{bubbles:!1,cancelable:!0}),Ns({component:`menu`,parts:[`trigger`,`content`,`sub-trigger`,`item`,`group`,`group-heading`,`checkbox-group`,`checkbox-item`,`radio-group`,`radio-item`,`separator`,`sub-content`,`arrow`]}),globalThis.bitsDismissableLayers??=new Map;var Kc=class e{static create(t){return new e(t)}opts;#e;#t;#n={pointerdown:!1};#r=!1;#i=!1;#a=void 0;#o;#s=$;constructor(e){this.opts=e,this.#t=e.interactOutsideBehavior,this.#e=e.onInteractOutside,this.#o=e.onFocusOutside,zn(()=>{this.#a=uc(this.opts.ref.current)});let t=$,n=()=>{this.#g(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),t()};is([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return ms(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#t),t(),t=this.#l())}),n}),ps(()=>{this.#g.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#s(),t()})}#c=e=>{e.defaultPrevented||this.opts.ref.current&&hs(()=>{!this.opts.ref.current||this.#h(e.target)||e.target&&!this.#i&&this.#o.current?.(e)})};#l(){return Uo(Yr(this.#a,`pointerdown`,Uo(this.#f,this.#m),{capture:!0}),Yr(this.#a,`pointerdown`,Uo(this.#p,this.#d)),Yr(this.#a,`focusin`,this.#c))}#u=e=>{let t=e;t.defaultPrevented&&(t=Xc(e)),this.#e.current(e)};#d=cc(e=>{if(!this.opts.ref.current){this.#s();return}let t=this.opts.isValidEvent.current(e,this.opts.ref.current)||Yc(e,this.opts.ref.current);if(!this.#r||this.#_()||!t){this.#s();return}let n=e;if(n.defaultPrevented&&(n=Xc(n)),this.#t.current!==`close`&&this.#t.current!==`defer-otherwise-close`){this.#s();return}e.pointerType===`touch`?(this.#s(),this.#s=Yr(this.#a,`click`,this.#u,{once:!0})):this.#e.current(n)},10);#f=e=>{this.#n[e.type]=!0};#p=e=>{this.#n[e.type]=!1};#m=()=>{this.opts.ref.current&&(this.#r=Jc(this.opts.ref.current))};#h=e=>this.opts.ref.current?lc(this.opts.ref.current,e):!1;#g=cc(()=>{for(let e in this.#n)this.#n[e]=!1;this.#r=!1},20);#_(){return Object.values(this.#n).some(Boolean)}#v=()=>{this.#i=!0};#y=()=>{this.#i=!1};props={onfocuscapture:this.#v,onblurcapture:this.#y}};function qc(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([e,{current:t}])=>t===`close`||t===`ignore`)}function Jc(e){let t=[...globalThis.bitsDismissableLayers],n=qc(t);if(n)return n[0].opts.ref.current===e;let[r]=t[0];return r.opts.ref.current===e}function Yc(e,t){let n=e.target;if(!Rs(n))return!1;let r=!!n.closest(`[${Wc}]`),i=!!t.closest(`[${Gc}]`);return`button`in e&&e.button>0&&!r?!1:`button`in e&&e.button===0&&r&&i?!0:r&&i?!1:uc(n).documentElement.contains(n)&&!lc(t,n)&&dc(e,t)}function Xc(e){let t=e.currentTarget,n=e.target,r;r=e instanceof PointerEvent?new PointerEvent(e.type,e):new PointerEvent(`pointerdown`,e);let i=!1;return new Proxy(r,{get:(r,a)=>a===`currentTarget`?t:a===`target`?n:a===`preventDefault`?()=>{i=!0,typeof r.preventDefault==`function`&&r.preventDefault()}:a===`defaultPrevented`?i:a in r?r[a]:e[a]})}function Zc(e,t){D(t,!0);let n=Y(t,`interactOutsideBehavior`,3,`close`),r=Y(t,`onInteractOutside`,3,$),i=Y(t,`onFocusOutside`,3,$),a=Y(t,`isValidEvent`,3,()=>!1),o=Kc.create({id:Q(()=>t.id),interactOutsideBehavior:Q(()=>n()),onInteractOutside:Q(()=>r()),enabled:Q(()=>t.enabled),onFocusOutside:Q(()=>i()),isValidEvent:Q(()=>a()),ref:t.ref});var s=U();J(F(s),()=>t.children??f,()=>({props:o.props})),W(e,s),O()}globalThis.bitsEscapeLayers??=new Map;var Qc=class e{static create(t){return new e(t)}opts;domContext;constructor(e){this.opts=e,this.domContext=new Ds(this.opts.ref);let t=$;is(()=>e.enabled.current,n=>(n&&(globalThis.bitsEscapeLayers.set(this,e.escapeKeydownBehavior),t=this.#e()),()=>{t(),globalThis.bitsEscapeLayers.delete(this)}))}#e=()=>Yr(this.domContext.getDocument(),`keydown`,this.#t,{passive:!1});#t=e=>{if(e.key!==`Escape`||!$c(this))return;let t=new KeyboardEvent(e.type,e);e.preventDefault();let n=this.opts.escapeKeydownBehavior.current;n!==`close`&&n!==`defer-otherwise-close`||this.opts.onEscapeKeydown.current(t)}};function $c(e){let t=[...globalThis.bitsEscapeLayers],n=t.findLast(([e,{current:t}])=>t===`close`||t===`ignore`);if(n)return n[0]===e;let[r]=t[0];return r===e}function el(e,t){D(t,!0);let n=Y(t,`escapeKeydownBehavior`,3,`close`),r=Y(t,`onEscapeKeydown`,3,$);Qc.create({escapeKeydownBehavior:Q(()=>n()),onEscapeKeydown:Q(()=>r()),enabled:Q(()=>t.enabled),ref:t.ref});var i=U();J(F(i),()=>t.children??f),W(e,i),O()}var tl=class e{static instance;#e=ho([]);#t=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||=new e,this.instance}register(e){let t=this.getActive();t&&t!==e&&t.pause();let n=document.activeElement;n&&n!==document.body&&this.#n.set(e,n),this.#e.current=this.#e.current.filter(t=>t!==e),this.#e.current.unshift(e)}unregister(e){this.#e.current=this.#e.current.filter(t=>t!==e);let t=this.getActive();t&&t.resume()}getActive(){return this.#e.current[0]}setFocusMemory(e,t){this.#t.set(e,t)}getFocusMemory(e){return this.#t.get(e)}isActiveScope(e){return this.getActive()===e}setPreFocusMemory(e,t){this.#n.set(e,t)}getPreFocusMemory(e){return this.#n.get(e)}clearPreFocusMemory(e){this.#n.delete(e)}},nl=class e{#e=!1;#t=null;#n=tl.getInstance();#r=[];#i;constructor(e){this.#i=e}get paused(){return this.#e}pause(){this.#e=!0}resume(){this.#e=!1}#a(){for(let e of this.#r)e();this.#r=[]}mount(e){this.#t&&this.unmount(),this.#t=e,this.#n.register(this),this.#c(),this.#o()}unmount(){this.#t&&=(this.#a(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),null)}#o(){if(!this.#t)return;let e=new CustomEvent(`focusScope.onOpenAutoFocus`,{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(e),e.defaultPrevented||requestAnimationFrame(()=>{if(!this.#t)return;let e=this.#u();e?(e.focus(),this.#n.setFocusMemory(this,e)):this.#t.focus()})}#s(){let e=new CustomEvent(`focusScope.onCloseAutoFocus`,{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(e),!e.defaultPrevented){let e=this.#n.getPreFocusMemory(this);if(e&&document.contains(e))try{e.focus()}catch{document.body.focus()}}}#c(){if(!this.#t||!this.#i.trap.current)return;let e=this.#t,t=e.ownerDocument;this.#r.push(Yr(t,`focusin`,t=>{if(this.#e||!this.#n.isActiveScope(this))return;let n=t.target;if(n)if(e.contains(n))this.#n.setFocusMemory(this,n);else{let n=this.#n.getFocusMemory(this);if(n&&e.contains(n)&&Uc(n))t.preventDefault(),n.focus();else{let t=this.#u(),n=this.#d()[0];(t||n||e).focus()}}},{capture:!0}),Yr(e,`keydown`,e=>{if(!this.#i.loop||this.#e||e.key!==`Tab`||!this.#n.isActiveScope(this))return;let n=this.#l();if(n.length===0)return;let r=n[0],i=n[n.length-1];!e.shiftKey&&t.activeElement===i?(e.preventDefault(),r.focus()):e.shiftKey&&t.activeElement===r&&(e.preventDefault(),i.focus())}));let n=new MutationObserver(()=>{let t=this.#n.getFocusMemory(this);if(t&&!e.contains(t)){let t=this.#u(),n=this.#d()[0],r=t||n;r?(r.focus(),this.#n.setFocusMemory(this,r)):e.focus()}});n.observe(e,{childList:!0,subtree:!0}),this.#r.push(()=>n.disconnect())}#l(){return this.#t?Bc(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#l()[0]||null}#d(){return this.#t?Vc(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return is([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(n||=new e(t),n.mount(r)):n&&=(n.unmount(),null)}),ps(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}};function rl(e,t){D(t,!0);let n=Y(t,`enabled`,3,!1),r=Y(t,`trapFocus`,3,!1),i=Y(t,`loop`,3,!1),a=Y(t,`onCloseAutoFocus`,3,$),o=Y(t,`onOpenAutoFocus`,3,$),s=nl.use({enabled:Q(()=>n()),trap:Q(()=>r()),loop:i(),onCloseAutoFocus:Q(()=>a()),onOpenAutoFocus:Q(()=>o()),ref:t.ref});var c=U();J(F(c),()=>t.focusScope??f,()=>({props:s.props})),W(e,c),O()}var il=()=>{};globalThis.bitsTextSelectionLayers??=new Map;var al=class e{static create(t){return new e(t)}opts;domContext;#e=$;#t=!1;#n=il;#r=il;constructor(e){this.opts=e,this.domContext=new Ds(e.ref);let t=$;is(()=>[this.opts.enabled.current,this.opts.onPointerDown.current,this.opts.onPointerUp.current],([e,n,r])=>(this.#t=e,this.#n=n,this.#r=r,e&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),t(),t=this.#i()),()=>{this.#t=!1,t(),this.#s(),globalThis.bitsTextSelectionLayers.delete(this)}))}#i(){return Uo(Yr(this.domContext.getDocument(),`pointerdown`,this.#o),Yr(this.domContext.getDocument(),`pointerup`,go(this.#s,this.#a)))}#a=e=>{this.#r(e)};#o=e=>{let t=this.opts.ref.current,n=e.target;!Ls(t)||!Ls(n)||!this.#t||!ll(this)||!ws(t,n)||(this.#n(e),!e.defaultPrevented&&(this.#e=sl(t,this.domContext.getDocument().body)))};#s=()=>{this.#e(),this.#e=$}},ol=e=>e.style.userSelect||e.style.webkitUserSelect;function sl(e,t){let n=ol(t),r=ol(e);return cl(t,`none`),cl(e,`text`),()=>{cl(t,n),cl(e,r)}}function cl(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function ll(e){let t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;let n=t.at(-1);return n?n[0]===e:!1}function ul(e,t){D(t,!0);let n=Y(t,`preventOverflowTextSelection`,3,!0),r=Y(t,`onPointerDown`,3,$),i=Y(t,`onPointerUp`,3,$);al.create({id:Q(()=>t.id),onPointerDown:Q(()=>r()),onPointerUp:Q(()=>i()),enabled:Q(()=>t.enabled&&n()),ref:t.ref});var a=U();J(F(a),()=>t.children??f),W(e,a),O()}globalThis.bitsIdCounter??={current:0};function dl(e=`bits`){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}var fl=class{#e;#t=0;#n=M();#r;constructor(e){this.#e=e}#i(){--this.#t,this.#r&&this.#t<=0&&(this.#r(),N(this.#n,void 0),this.#r=void 0)}get(...e){return this.#t+=1,V(this.#n)===void 0&&(this.#r=Hn(()=>{N(this.#n,this.#e(...e),!0)})),zn(()=>()=>{this.#i()}),V(this.#n)}},pl=new $o,ml=M(null),hl=null,gl=null,_l=!1,vl=Q(()=>{for(let e of pl.values())if(e)return!0;return!1}),yl=null,bl=new fl(()=>{function e(){document.body.setAttribute(`style`,V(ml)??``),document.body.style.removeProperty(`--scrollbar-width`),Fs&&hl?.(),N(ml,null)}function t(){gl!==null&&(window.clearTimeout(gl),gl=null)}function n(e,n){t(),_l=!0,yl=Date.now();let r=yl,i=()=>{gl=null,yl===r&&(Sl(pl)?_l=!1:(_l=!1,n()))},a=e===null?24:e;gl=window.setTimeout(i,a)}function r(){V(ml)===null&&pl.size===0&&!_l&&N(ml,document.body.getAttribute(`style`),!0)}return is(()=>vl.current,()=>{if(!vl.current)return;r(),_l=!1;let e=getComputedStyle(document.documentElement),t=getComputedStyle(document.body),n=e.scrollbarGutter?.includes(`stable`)||t.scrollbarGutter?.includes(`stable`),i=window.innerWidth-document.documentElement.clientWidth,a={padding:Number.parseInt(t.paddingRight??`0`,10)+i,margin:Number.parseInt(t.marginRight??`0`,10)};i>0&&!n&&(document.body.style.paddingRight=`${a.padding}px`,document.body.style.marginRight=`${a.margin}px`,document.body.style.setProperty(`--scrollbar-width`,`${i}px`)),document.body.style.overflow=`hidden`,Fs&&(hl=Yr(document,`touchmove`,e=>{e.target===document.documentElement&&(e.touches.length>1||e.preventDefault())},{passive:!1})),hs(()=>{document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`})}),ps(()=>()=>{hl?.()}),{get lockMap(){return pl},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}}),xl=class{#e=dl();#t;#n=()=>null;#r;locked;constructor(e,t=()=>null){this.#t=e,this.#n=t,this.#r=bl.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#e,this.#t??!1),this.locked=Q(()=>this.#r.lockMap.get(this.#e)??!1,e=>this.#r.lockMap.set(this.#e,e)),ps(()=>{if(this.#r.lockMap.delete(this.#e),Sl(this.#r.lockMap))return;let e=this.#n();this.#r.scheduleCleanupIfNoNewLocks(e,()=>{this.#r.resetBodyStyle()})}))}};function Sl(e){for(let[t,n]of e)if(n)return!0;return!1}function Cl(e,t){D(t,!0);let n=Y(t,`preventScroll`,3,!0),r=Y(t,`restoreScrollDelay`,3,null);n()&&new xl(n(),()=>r()),O()}var wl=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`forceMount`,`child`,`children`,`ref`]),Tl=H(`<div><!></div>`);function El(e,t){let n=si();D(t,!0);let r=Y(t,`id`,19,()=>Vs(n)),i=Y(t,`forceMount`,3,!1),a=Y(t,`ref`,15,null),o=ca(t,wl),s=Ys.create({id:Q(()=>r()),ref:Q(()=>a(),e=>a(e))}),c=A(()=>Xo(o,s.props));var l=U(),u=F(l),d=e=>{var n=U(),r=F(n),i=e=>{var n=U(),r=F(n);{let e=A(()=>({props:Xo(V(c)),...s.snippetProps}));J(r,()=>t.child,()=>V(e))}W(e,n)},a=e=>{var n=Tl();ea(n,e=>({...e}),[()=>Xo(V(c))]),J(P(n),()=>t.children??f,()=>s.snippetProps),T(n),W(e,n)};K(r,e=>{t.child?e(i):e(a,-1)}),W(e,n)};K(u,e=>{(s.shouldRender||i())&&e(d)}),W(e,l),O()}var Dl=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`]),Ol=H(`<div><!></div>`);function kl(e,t){let n=si();D(t,!0);let r=Y(t,`id`,19,()=>Vs(n)),i=Y(t,`ref`,15,null),a=ca(t,Dl),o=qs.create({id:Q(()=>r()),ref:Q(()=>i(),e=>i(e))}),s=A(()=>Xo(a,o.props));var c=U(),l=F(c),u=e=>{var n=U();J(F(n),()=>t.child,()=>({props:V(s)})),W(e,n)},d=e=>{var n=Ol();ea(n,()=>({...V(s)})),J(P(n),()=>t.children??f),T(n),W(e,n)};K(l,e=>{t.child?e(u):e(d,-1)}),W(e,c),O()}function Al(e,t){D(t,!0);let n=Y(t,`open`,15,!1),r=Y(t,`onOpenChange`,3,$),i=Y(t,`onOpenChangeComplete`,3,$);Ws.create({variant:Q(()=>`dialog`),open:Q(()=>n(),e=>{n(e),r()(e)}),onOpenChangeComplete:Q(()=>i())});var a=U();J(F(a),()=>t.children??f),W(e,a),O()}var jl=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`disabled`]),Ml=H(`<button><!></button>`);function Nl(e,t){let n=si();D(t,!0);let r=Y(t,`id`,19,()=>Vs(n)),i=Y(t,`ref`,15,null),a=Y(t,`disabled`,3,!1),o=ca(t,jl),s=Gs.create({variant:Q(()=>`close`),id:Q(()=>r()),ref:Q(()=>i(),e=>i(e)),disabled:Q(()=>!!a())}),c=A(()=>Xo(o,s.props));var l=U(),u=F(l),d=e=>{var n=U();J(F(n),()=>t.child,()=>({props:V(c)})),W(e,n)},p=e=>{var n=Ml();ea(n,()=>({...V(c)})),J(P(n),()=>t.children??f),T(n),W(e,n)};K(u,e=>{t.child?e(d):e(p,-1)}),W(e,l),O()}var Pl=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`,`forceMount`,`onCloseAutoFocus`,`onOpenAutoFocus`,`onEscapeKeydown`,`onInteractOutside`,`trapFocus`,`preventScroll`,`restoreScrollDelay`]),Fl=H(`<!> <!>`,1),Il=H(`<!> <div><!></div>`,1);function Ll(e,t){let n=si();D(t,!0);let r=Y(t,`id`,19,()=>Vs(n)),i=Y(t,`ref`,15,null),a=Y(t,`forceMount`,3,!1),o=Y(t,`onCloseAutoFocus`,3,$),s=Y(t,`onOpenAutoFocus`,3,$),c=Y(t,`onEscapeKeydown`,3,$),l=Y(t,`onInteractOutside`,3,$),u=Y(t,`trapFocus`,3,!0),d=Y(t,`preventScroll`,3,!0),p=Y(t,`restoreScrollDelay`,3,null),m=ca(t,Pl),h=Js.create({id:Q(()=>r()),ref:Q(()=>i(),e=>i(e))}),g=A(()=>Xo(m,h.props));var _=U(),v=F(_),y=e=>{rl(e,{get ref(){return h.opts.ref},loop:!0,get trapFocus(){return u()},get enabled(){return h.root.opts.open.current},get onOpenAutoFocus(){return s()},get onCloseAutoFocus(){return o()},focusScope:(e,n)=>{let r=()=>n?.().props;el(e,ua(()=>V(g),{get enabled(){return h.root.opts.open.current},get ref(){return h.opts.ref},onEscapeKeydown:e=>{c()(e),!e.defaultPrevented&&h.root.handleClose()},children:(e,n)=>{Zc(e,ua(()=>V(g),{get ref(){return h.opts.ref},get enabled(){return h.root.opts.open.current},onInteractOutside:e=>{l()(e),!e.defaultPrevented&&h.root.handleClose()},children:(e,n)=>{ul(e,ua(()=>V(g),{get ref(){return h.opts.ref},get enabled(){return h.root.opts.open.current},children:(e,n)=>{var i=U(),a=F(i),o=e=>{var n=Fl(),i=F(n),a=e=>{Cl(e,{get preventScroll(){return d()},get restoreScrollDelay(){return p()}})};K(i,e=>{h.root.opts.open.current&&e(a)});var o=I(i,2);{let e=A(()=>({props:Xo(V(g),r()),...h.snippetProps}));J(o,()=>t.child,()=>V(e))}W(e,n)},s=e=>{var n=Il(),i=F(n);Cl(i,{get preventScroll(){return d()}});var a=I(i,2);ea(a,e=>({...e}),[()=>Xo(V(g),r())]),J(P(a),()=>t.children??f),T(a),W(e,n)};K(a,e=>{t.child?e(o):e(s,-1)}),W(e,i)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};K(v,e=>{(h.shouldRender||a())&&e(y)}),W(e,_),O()}var Rl=H(`<button class="flex flex-col gap-1 text-left"><div class="flex items-center gap-2 font-mono text-sm"><span class="size-2 shrink-0 rounded-sm"></span> <span class="flex-1 truncate text-foreground"> </span> <span class="tabular-nums text-muted-foreground"> </span></div> <div class="h-1 overflow-hidden rounded-full bg-border"><div class="h-full"></div></div></button>`),zl=H(`<div class="text-sm text-muted-foreground">No projects tracked yet \u2014 run <code class="text-foreground">syn .</code></div>`),Bl=H(`<div class="flex max-h-[260px] flex-col gap-2 overflow-y-auto pr-1"></div>`),Vl=H(`<div class="flex flex-col gap-0.5 bg-card p-3"><span class="font-mono text-[10px] uppercase tracking-[0.1em] text-muted-foreground"> </span> <span class="font-mono text-sm text-foreground"> </span></div>`),Hl=H(`<!> <!> <div class="mt-4 grid grid-cols-2 gap-px overflow-hidden rounded-lg border bg-border"></div> <!>`,1),Ul=H(`<!> <!>`,1);function Wl(e,t){D(t,!0);let n=M(!1),r=M(null),i=A(()=>X.data?.projects??[]),a=A(()=>Math.max(1,...V(i).map(e=>e.total_turns)));function o(e){let t=(X.data?.recent_turns??[]).find(t=>t.project_path===e.path);return t?ma(t.ts):e.last_seen?ma(e.last_seen):`\u2014`}function s(e){return[[`Cost`,pa(e.estimated_cost_usd)],[`Turns`,Z(e.total_turns)],[`Input`,Z(e.total_input_tokens)],[`Output`,Z(e.total_output_tokens)],[`Cache R`,Z(e.total_cache_read)],[`Cache W`,Z(e.total_cache_create)],[`Blocks`,Z(e.blocked_count)],[`Last active`,o(e)]]}var c=Ul(),l=F(c);Qa(l,{title:`Projects`,meta:`by turns`,children:(e,t)=>{var o=Bl();q(o,21,()=>V(i),e=>e.path,(e,t)=>{var i=Rl(),o=P(i),s=P(o),c=I(s,2),l=P(c,!0);T(c);var u=I(c,2),d=P(u,!0);T(u),T(o);var f=I(o,2),p=P(f);T(f),T(i),L((e,n,r)=>{Ri(s,e),G(l,V(t).name),G(d,n),Ri(p,r)},[()=>`background:${ya(V(t).name)}`,()=>Z(V(t).total_turns),()=>`width:${V(t).total_turns/V(a)*100}%; background:${ya(V(t).name)}`]),Xr(`click`,i,()=>{N(r,V(t),!0),N(n,!0)}),W(e,i)},e=>{W(e,zl())}),T(o),W(e,o)},$$slots:{default:!0}}),Ti(I(l,2),()=>Al,(e,t)=>{t(e,{get open(){return V(n)},set open(e){N(n,e,!0)},children:(e,t)=>{var n=U();Ti(F(n),()=>oc,(e,t)=>{t(e,{children:(e,t)=>{var n=Ul(),i=F(n);Ti(i,()=>El,(e,t)=>{t(e,{class:`fixed inset-0 z-50 bg-black/60`})}),Ti(I(i,2),()=>Ll,(e,t)=>{t(e,{class:`fixed left-1/2 top-1/2 z-50 w-[min(440px,92vw)] -translate-x-1/2 -translate-y-1/2 rounded-xl border bg-card p-5 text-card-foreground shadow-2xl`,children:(e,t)=>{var n=U(),i=F(n),a=e=>{var t=Hl(),n=F(t);{let e=A(()=>`color:${ya(V(r).name)}`);Ti(n,()=>Qs,(t,n)=>{n(t,{class:`font-serif text-xl`,get style(){return V(e)},children:(e,t)=>{We();var n=oi();L(()=>G(n,V(r).name)),W(e,n)},$$slots:{default:!0}})})}var i=I(n,2);Ti(i,()=>kl,(e,t)=>{t(e,{class:`truncate font-mono text-xs text-muted-foreground`,children:(e,t)=>{We();var n=oi();L(()=>G(n,V(r).path)),W(e,n)},$$slots:{default:!0}})});var a=I(i,2);q(a,21,()=>s(V(r)),([e,t])=>e,(e,t)=>{var n=A(()=>h(V(t),2));let r=()=>V(n)[0],i=()=>V(n)[1];var a=Vl(),o=P(a),s=P(o,!0);T(o);var c=I(o,2),l=P(c,!0);T(c),T(a),L(()=>{G(s,r()),G(l,i())}),W(e,a)}),T(a),Ti(I(a,2),()=>Nl,(e,t)=>{t(e,{class:`mt-4 w-full rounded-md border py-2 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:(e,t)=>{We(),W(e,oi(`Close`))},$$slots:{default:!0}})}),W(e,t)};K(i,e=>{V(r)&&e(a)}),W(e,n)},$$slots:{default:!0}})}),W(e,n)},$$slots:{default:!0}})}),W(e,n)},$$slots:{default:!0}})}),W(e,c),O()}Zr([`click`]);var Gl=H(`<div class="flex items-baseline justify-between font-mono text-sm"><span class="text-muted-foreground"> </span> <span class="tabular-nums text-foreground"> </span></div>`),Kl=H(`<div class="text-sm text-muted-foreground">No graph-tool calls yet.</div>`),ql=H(`<div class="font-mono text-2xl text-foreground"> <span class="text-sm text-muted-foreground">calls</span></div> <div class="flex flex-col gap-1.5"></div>`,1);function Jl(e,t){D(t,!0);let n=A(()=>{let e=X.data?.global?.tool_calls??{};return Object.entries(e).sort((e,t)=>t[1]-e[1]).slice(0,8)}),r=A(()=>X.data?.global?.total_tool_calls??0);Qa(e,{title:`Graph tools used`,meta:`all projects`,children:(e,t)=>{var i=ql(),a=F(i),o=P(a);We(),T(a);var s=I(a,2);q(s,21,()=>V(n),([e,t])=>e,(e,t)=>{var n=A(()=>h(V(t),2));let r=()=>V(n)[0],i=()=>V(n)[1];var a=Gl(),o=P(a),s=P(o,!0);T(o);var c=I(o,2),l=P(c,!0);T(c),T(a),L(()=>{G(s,r()),G(l,i())}),W(e,a)},e=>{W(e,Kl())}),T(s),L(e=>G(o,`${e??``} `),[()=>Z(V(r))]),W(e,i)},$$slots:{default:!0}}),O()}var Yl=H(`<tr class="border-t border-border/60"><td class="py-1.5 pr-2 text-muted-foreground"> </td><td class="max-w-[120px] truncate py-1.5 pr-2 text-foreground"> </td><td class="py-1.5 pr-2"><span class="inline-flex items-center gap-1.5 rounded px-1.5 py-0.5"><span class="size-1.5 rounded-sm"></span> </span></td><td class="py-1.5 pr-2 text-right tabular-nums text-foreground"> </td><td class="py-1.5 pr-2 text-right tabular-nums text-foreground"> </td><td class="py-1.5 pr-2 text-right tabular-nums text-muted-foreground"> </td><td class="py-1.5 text-right tabular-nums text-[var(--money)]"> </td></tr>`),Xl=H(`<tr><td colspan="7" class="py-6 text-center text-muted-foreground">No turns recorded yet.</td></tr>`),Zl=H(`<div class="flex items-center justify-end gap-3 pt-1 font-mono text-sm text-muted-foreground"><button class="rounded border px-2 py-1 disabled:opacity-40 enabled:hover:text-foreground">\u2039 Prev</button> <span> </span> <button class="rounded border px-2 py-1 disabled:opacity-40 enabled:hover:text-foreground">Next \u203A</button></div>`),Ql=H(`<div class="min-h-0 flex-1 overflow-x-auto"><table class="w-full border-collapse font-mono text-sm"><thead><tr class="text-left text-[10px] uppercase tracking-[0.1em] text-muted-foreground"><th class="py-1.5 pr-2 font-medium">Time</th><th class="py-1.5 pr-2 font-medium">Project</th><th class="py-1.5 pr-2 font-medium">Model</th><th class="py-1.5 pr-2 text-right font-medium">In</th><th class="py-1.5 pr-2 text-right font-medium">Out</th><th class="py-1.5 pr-2 text-right font-medium">Cache R/W</th><th class="py-1.5 text-right font-medium">Cost</th></tr></thead><tbody></tbody></table></div> <!>`,1);function $l(e,t){D(t,!0);let n=M(1),r=A(()=>X.data?.recent_turns??[]),i=A(()=>Math.max(1,Math.ceil(V(r).length/25)));zn(()=>{V(n)>V(i)&&N(n,V(i),!0)});let a=A(()=>V(r).slice((V(n)-1)*25,(V(n)-1)*25+25)),o=A(()=>V(r).length?(V(n)-1)*25+1:0),s=A(()=>Math.min(V(n)*25,V(r).length));{let t=A(()=>`showing ${V(o)}\u2013${V(s)} of ${V(r).length}`);Qa(e,{title:`Recent turns`,get meta(){return V(t)},children:(e,t)=>{var r=Ql(),o=F(r),s=P(o),c=I(P(s));q(c,21,()=>V(a),e=>e.ts+e.project_path+e.model,(e,t)=>{var n=Yl(),r=P(n),i=P(r,!0);T(r);var a=I(r),o=P(a,!0);T(a);var s=I(a),c=P(s),l=P(c),u=I(l);T(c),T(s);var d=I(s),f=P(d,!0);T(d);var p=I(d),m=P(p,!0);T(p);var h=I(p),g=P(h);T(h);var _=I(h),v=P(_,!0);T(_),T(n),L((e,n,r,s,d,p,h,_,y)=>{G(i,e),Qi(a,`title`,V(t).project_name),G(o,V(t).project_name),Ri(c,n),Ri(l,r),G(u,` ${s??``}`),G(f,d),G(m,p),G(g,`${h??``} / ${_??``}`),G(v,y)},[()=>ma(V(t).ts),()=>`color: var(--c-${ha(V(t).model)})`,()=>`background: var(--c-${ha(V(t).model)})`,()=>ga(V(t).model),()=>Z(V(t).input),()=>Z(V(t).output),()=>Z(V(t).cache_read),()=>Z(V(t).cache_create),()=>pa(V(t).cost_usd)]),W(e,n)},e=>{W(e,Xl())}),T(c),T(s),T(o);var l=I(o,2),u=e=>{var t=Zl(),r=P(t),a=I(r,2),o=P(a);T(a);var s=I(a,2);T(t),L(()=>{r.disabled=V(n)<=1,G(o,`page ${V(n)??``} of ${V(i)??``}`),s.disabled=V(n)>=V(i)}),Xr(`click`,r,()=>N(n,Math.max(1,V(n)-1),!0)),Xr(`click`,s,()=>N(n,Math.min(V(i),V(n)+1),!0)),W(e,t)};K(l,e=>{V(i)>1&&e(u)}),W(e,r)},$$slots:{default:!0}})}O()}Zr([`click`]);var eu=H(`<div class="font-mono text-xs text-muted-foreground" title="Codebase exploration via the terminal (rg / cat / find) \u2014 observe-only, not yet blocked"> <span> </span></div>`),tu=H(`<div class="flex items-baseline gap-2 font-mono text-xs"><span class="shrink-0 text-muted-foreground"> </span> <span> </span> <span class="truncate text-foreground/80"> </span></div>`),nu=H(`<div class="text-sm text-muted-foreground">No gate decisions yet.</div>`),ru=H(`<div class="mt-2 border-t border-border pt-2 text-[10px] uppercase tracking-wide text-muted-foreground">Terminal hunts (observe-only)</div> <!>`,1),iu=H(`<div class="font-mono text-2xl text-foreground"> <span class="text-sm text-muted-foreground">blocks</span></div> <!> <div class="flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto"><!> <!></div>`,1);function au(e,t){D(t,!0);let n=A(()=>(X.data?.recent_gates??[]).slice(0,50)),r=A(()=>X.data?.global?.blocked_count??0),i=A(()=>X.data?.global?.bash_explorations??0),a=A(()=>X.data?.global?.bash_avoidable??0),o=A(()=>(X.data?.recent_bash??[]).slice(0,12));Qa(e,{title:`The Moat`,meta:`PreToolUse`,children:(e,t)=>{var s=iu(),c=F(s),l=P(c);We(),T(c);var u=I(c,2),d=e=>{var t=eu(),n=P(t),r=I(n),o=P(r);T(r),T(t),L((e,t)=>{G(n,`\u21B3 ${e??``} terminal hunts \xB7 `),Ii(r,1,Ai(V(a)>0?`text-destructive`:``)),G(o,`${t??``} the graph could answer`)},[()=>Z(V(i)),()=>Z(V(a))]),W(e,t)};K(u,e=>{V(i)>0&&e(d)});var f=I(u,2),p=P(f);q(p,17,()=>V(n),e=>e.ts+e.query,(e,t)=>{var n=tu(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=P(a,!0);T(a);var s=I(a,2),c=P(s,!0);T(s),T(n),L(e=>{G(i,e),Ii(a,1,`shrink-0 rounded px-1 text-[10px] uppercase `+(V(t).decision===`block`?`bg-destructive/15 text-destructive`:`bg-[var(--c-fable)]/12 text-[var(--c-fable)]`)),G(o,V(t).decision),Qi(s,`title`,V(t).query??``),G(c,V(t).query??`\u2014`)},[()=>ma(V(t).ts)]),W(e,n)},e=>{W(e,nu())});var m=I(p,2),h=e=>{var t=ru();q(I(F(t),2),17,()=>V(o),e=>e.ts+e.query,(e,t)=>{var n=tu(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=P(a,!0);T(a);var s=I(a,2),c=P(s,!0);T(s),T(n),L(e=>{G(i,e),Ii(a,1,`shrink-0 rounded px-1 text-[10px] uppercase `+(V(t).avoidable?`bg-destructive/15 text-destructive`:`bg-muted text-muted-foreground`)),G(o,V(t).tool),Qi(s,`title`,V(t).query??``),G(c,V(t).query??`\u2014`)},[()=>ma(V(t).ts)]),W(e,n)}),W(e,t)};K(m,e=>{V(o).length>0&&e(h)}),T(f),L(e=>G(l,`${e??``} `),[()=>Z(V(r))]),W(e,s)},$$slots:{default:!0}}),O()}var ou=H(`<div class="flex items-baseline justify-between gap-3 font-mono text-sm"><span class="truncate text-muted-foreground"> </span> <span class="tabular-nums text-foreground"> </span></div>`),su=H(`<div class="text-sm text-muted-foreground">No usage learned yet \u2014 Synthra learns as you read/edit files.</div>`),cu=H(`<div class="font-mono text-2xl text-foreground"> <span class="text-sm text-muted-foreground">tracked</span></div> <div class="flex max-h-[190px] flex-col gap-1.5 overflow-y-auto"></div>`,1);function lu(e,t){D(t,!0);let n=A(()=>X.data?.active),r=A(()=>V(n)?.stats?.hot_files??[]);{let t=A(()=>V(n)?.project_name??`active project`);Qa(e,{title:`Hot files`,get meta(){return V(t)},children:(e,t)=>{var i=cu(),a=F(i),o=P(a);We(),T(a);var s=I(a,2);q(s,21,()=>V(r),e=>e.path,(e,t)=>{var n=ou(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=P(a,!0);T(a),T(n),L(e=>{Qi(n,`title`,V(t).path),G(i,e),G(o,V(t).score)},[()=>_a(V(t).path)]),W(e,n)},e=>{W(e,su())}),T(s),L(e=>G(o,`${e??``} `),[()=>Z(V(n)?.stats?.hot_files_total??0)]),W(e,i)},$$slots:{default:!0}})}O()}var uu=H(`<div class="grid grid-cols-1 gap-4 p-5 lg:grid-cols-3"><div class="lg:col-span-3 lg:row-start-1"><!></div> <div class="lg:col-start-1 lg:row-start-2"><!></div> <div class="lg:col-start-2 lg:row-start-2"><!></div> <div class="lg:col-start-1 lg:row-start-3"><!></div> <div class="lg:col-start-2 lg:row-start-3"><!></div> <div class="lg:col-start-1 lg:row-start-4"><!></div> <div class="lg:col-start-2 lg:row-start-4"><!></div> <div class="relative lg:col-start-3 lg:row-start-2 lg:row-span-3"><div class="lg:absolute lg:inset-0"><!></div></div> <div class="lg:col-span-3 lg:row-start-5"><!></div></div>`);function du(e){var t=uu(),n=P(t);Ja(P(n),{}),T(n);var r=I(n,2);eo(P(r),{}),T(r);var i=I(r,2);no(P(i),{}),T(i);var a=I(i,2);so(P(a),{}),T(a);var o=I(a,2);lu(P(o),{}),T(o);var s=I(o,2);Wl(P(s),{}),T(s);var c=I(s,2);Jl(P(c),{}),T(c);var l=I(c,2),u=P(l);au(P(u),{}),T(u),T(l);var d=I(l,2);$l(P(d),{}),T(d),T(t),W(e,t)}var fu=new Set([`$$slots`,`$$events`,`$$legacy`]);function pu(e,t){let n=ca(t,fu),r=[[`path`,{d:`M20 6 9 17l-5-5`}]];Ea(e,ua({name:`check`},()=>n,{get iconNode(){return r}}))}var mu=new Set([`$$slots`,`$$events`,`$$legacy`]);function hu(e,t){let n=ca(t,mu),r=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]];Ea(e,ua({name:`copy`},()=>n,{get iconNode(){return r}}))}var gu=H(`<p> </p>`),_u=H(`<div class="break-all"><span class="text-foreground/70"> </span> </div>`),vu=H(`<div class="mt-1 flex flex-col gap-0.5 font-mono text-xs text-muted-foreground/80"></div>`),yu=H(`<div role="button" tabindex="0" class="flex cursor-pointer flex-col gap-1.5 rounded-lg border bg-card/55 p-3 text-left transition-colors hover:bg-card/85"><div class="flex items-center gap-1.5"><span class="min-w-0 truncate font-mono text-sm text-foreground"> </span> <button type="button" title="Copy name" class="inline-flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground/60 transition-colors hover:bg-accent hover:text-foreground"><!></button> <span> </span></div> <!> <!></div>`);function bu(e,t){D(t,!0);let n=M(!1),r=M(!1),i,a=A(()=>t.item.scope===`plugin`?t.item.source??`plugin`:t.item.scope),o=A(()=>t.item.scope===`project`?`var(--c-fable)`:t.item.scope===`personal`?`var(--c-sonnet)`:`#9bc2ef`),s=A(()=>Object.entries(t.item.meta??{}));function c(){N(n,!V(n))}function l(e){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c())}async function u(e){e.stopPropagation();try{await navigator.clipboard.writeText(t.item.name),N(r,!0),clearTimeout(i),i=setTimeout(()=>N(r,!1),1200)}catch{}}var d=yu(),f=P(d),p=P(f),m=P(p,!0);T(p);var g=I(p,2),_=P(g),v=e=>{pu(e,{class:`size-3.5`,style:`color: var(--c-fable)`})},y=e=>{hu(e,{class:`size-3.5`})};K(_,e=>{V(r)?e(v):e(y,-1)}),T(g);var b=I(g,2);let ee;var x=P(b);T(b),T(f);var te=I(f,2),ne=e=>{var r=gu(),i=P(r,!0);T(r),L(()=>{Ii(r,1,`text-sm leading-snug text-muted-foreground `+(V(n)?``:`line-clamp-2`)),G(i,t.item.description)}),W(e,r)};K(te,e=>{t.item.description&&e(ne)});var re=I(te,2),ie=e=>{var t=vu();q(t,21,()=>V(s),([e,t])=>e,(e,t)=>{var n=A(()=>h(V(t),2));let r=()=>V(n)[0],i=()=>V(n)[1];var a=_u(),o=P(a),s=P(o);T(o);var c=I(o);T(a),L(()=>{G(s,`${r()??``}:`),G(c,` ${i()??``}`)}),W(e,a)}),T(t),W(e,t)};K(re,e=>{V(n)&&V(s).length&&e(ie)}),T(d),L(()=>{G(m,t.item.name),Qi(g,`aria-label`,`Copy "${t.item.name}"`),ee=Ii(b,1,`ml-auto shrink-0 rounded border px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wide`,null,ee,{"opacity-50":t.item.enabled===!1}),Ri(b,`color:${V(o)}; border-color:color-mix(in oklab, ${V(o)} 35%, transparent)`),G(x,`${V(a)??``}${t.item.enabled===!1?` \xB7 off`:``}`)}),Xr(`click`,d,c),Xr(`keydown`,d,l),Xr(`click`,g,u),W(e,d),O()}Zr([`click`,`keydown`]);var xu=H(`<span> </span>`),Su=H(`<button> <span class="opacity-60"> </span></button>`),Cu=H(`<div class="text-sm text-muted-foreground">Scanning your arsenal\u2026</div>`),wu=H(`<div class="text-sm text-muted-foreground"> </div>`),Tu=H(`<section class="flex flex-col gap-2"><div class="flex items-center gap-3 border-b border-border pb-1.5"><span class="size-1.5 shrink-0 rounded-sm"></span> <span class="font-mono text-xs uppercase tracking-[0.14em]"> </span> <span class="font-mono text-xs tracking-[0.1em] text-muted-foreground"> </span></div> <div class="grid grid-cols-1 items-start gap-2 md:grid-cols-2 2xl:grid-cols-3"></div></section>`),Eu=H(`<div class="flex flex-col gap-6"></div>`),Du=H(`<div class="flex h-full flex-col gap-4 p-5"><div class="flex flex-wrap items-center justify-between gap-3"><h1 class="font-serif text-2xl text-foreground">\u2694 Arsenal</h1> <div class="flex items-center gap-2 font-mono text-xs text-muted-foreground"><!> <button class="rounded border px-2 py-1 transition-colors hover:text-foreground">\u21BB Rescan</button></div></div> <div class="flex flex-wrap items-center gap-2"><!> <input placeholder="Filter by name or description\u2026" autocomplete="off" class="ml-auto w-full max-w-72 rounded-md border bg-card/60 px-3 py-1.5 text-sm outline-none transition-colors focus:border-ring"/></div> <!></div>`);function Ou(e,t){D(t,!0);let n=M(`skills`),r=M(``),i=A(()=>X.arsenal),a=[{id:`skills`,label:`Skills`},{id:`agents`,label:`Agents`},{id:`mcp`,label:`MCP`}],o=A(()=>{let e=V(i)?V(i)[V(n)]:[],t=V(r).toLowerCase().trim();return t?e.filter(e=>e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)||(e.source??``).toLowerCase().includes(t)):e}),s=A(()=>{let e=new Map;for(let t of V(o)){let n=t.scope===`plugin`?`plugin:${t.source??`plugin`}`:t.scope,r=e.get(n);r||(r={label:t.scope===`plugin`?t.source??`plugin`:t.scope===`project`?`In this project`:`Personal \xB7 this machine`,scope:t.scope,items:[]},e.set(n,r)),r.items.push(t)}return[...e.values()]});function c(e){return e===`project`?`var(--c-fable)`:e===`personal`?`var(--c-sonnet)`:`#9bc2ef`}let l=A(()=>V(i)?new Date(V(i).scanned_at).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):``);var u=Du(),d=P(u),f=I(P(d),2),p=P(f),m=e=>{var t=xu(),n=P(t);T(t),L(()=>G(n,`${V(i).counts.plugins??``} plugins \xB7 scanned ${V(l)??``}`)),W(e,t)};K(p,e=>{V(i)&&e(m)});var h=I(p,2);T(f),T(d);var g=I(d,2),_=P(g);q(_,17,()=>a,e=>e.id,(e,t)=>{var r=Su(),a=P(r),o=I(a),s=P(o,!0);T(o),T(r),L(()=>{Ii(r,1,`rounded-lg px-3 py-1.5 font-mono text-xs transition-colors `+(V(n)===V(t).id?`bg-accent text-accent-foreground`:`text-muted-foreground hover:text-foreground`)),G(a,`${V(t).label??``} `),G(s,V(i)?.counts?.[V(t).id]??0)}),Xr(`click`,r,()=>N(n,V(t).id,!0)),W(e,r)});var v=I(_,2);Xi(v),T(g);var y=I(g,2),b=e=>{W(e,Cu())},ee=e=>{var t=wu(),n=P(t,!0);T(t),L(()=>G(n,V(r)?`No matches.`:`Nothing installed in this category.`)),W(e,t)},x=e=>{var t=Eu();q(t,21,()=>V(s),e=>e.label+e.scope,(e,t)=>{var n=Tu(),r=P(n),i=P(r),a=I(i,2),o=P(a,!0);T(a);var s=I(a,2),l=P(s,!0);T(s),T(r);var u=I(r,2);q(u,21,()=>V(t).items,e=>e.scope+(e.source??``)+e.name,(e,t)=>{bu(e,{get item(){return V(t)}})}),T(u),T(n),L((e,n)=>{Ri(i,e),Ri(a,n),G(o,V(t).label),G(l,V(t).items.length)},[()=>`background:${c(V(t).scope)}`,()=>`color:${c(V(t).scope)}`]),W(e,n)}),T(t),W(e,t)};K(y,e=>{X.arsenalLoading&&!V(i)?e(b):V(s).length?e(x,-1):e(ee,1)}),T(u),Xr(`click`,h,()=>X.loadArsenal(!0)),ia(v,()=>V(r),e=>N(r,e)),W(e,u),O()}Zr([`click`]);var ku=H(`<div class="flex items-baseline gap-3 text-sm"><code class="shrink-0 font-mono text-xs text-[var(--c-sonnet)]"> </code> <span class="text-muted-foreground"> </span></div>`),Au=H(`<div class="mt-1 flex flex-col gap-1"></div>`),ju=H(`<div class="flex flex-col gap-1.5 rounded-lg border bg-card/55 p-4"><code class="font-mono text-sm text-foreground"> </code> <p class="text-sm leading-snug text-muted-foreground"> </p> <!></div>`),Mu=H(`<div class="flex h-full flex-col gap-4 p-5"><div class="flex flex-wrap items-center justify-between gap-3"><h1 class="font-serif text-2xl text-foreground">\u276F Commands</h1> <span class="font-mono text-xs text-muted-foreground">all paths default to the current directory</span></div> <div class="flex max-w-3xl flex-col gap-2.5"></div> <p class="max-w-3xl font-mono text-xs leading-relaxed text-muted-foreground">Install: <code class="text-foreground">npm install -g @jefuriiij/synthra</code> \xB7 macOS/Linux hooks\n additionally need <code class="text-foreground">jq</code> (<code>brew install jq</code>) \u2014 without it\n the hooks silently no-op while the MCP tools keep working.</p></div>`);function Nu(e){let t=[{cmd:`syn . [path]`,desc:`The default flow: scan the project, start the MCP server + dashboard, install the hooks, and register the MCP entry for the IDE. Runs as a background service \u2014 Ctrl+C stops it.`,opts:[{flag:`--full`,desc:`Re-parse every file, ignoring the incremental parse cache`},{flag:`--launch-cli`,desc:"Also spawn the `claude` CLI in this terminal"},{flag:`--resume <id>`,desc:`Resume a Claude session (requires --launch-cli)`}]},{cmd:`syn scan [path]`,desc:`Scan only \u2014 walk the project, parse it into the symbol graph, and write it to .synthra-graph/. No servers, no hooks.`,opts:[{flag:`--full`,desc:`Re-parse every file, ignoring the incremental parse cache`}]},{cmd:`syn serve [path]`,desc:`Start the HTTP MCP server only, against an already-scanned project.`},{cmd:`syn dashboard [path]`,desc:`Run this dashboard as a standalone process (no graph required) \u2014 token spend, savings, the Moat, and your Arsenal across every registered project.`},{cmd:`syn doctor [path]`,desc:`Diagnose the setup: Node version, jq (required by the macOS/Linux hooks), the claude CLI, graph freshness, .mcp.json registration, policy version, and installed hooks. Run this first when something feels off.`},{cmd:`syn remove [path]`,desc:`Uninstall Synthra from a project: deletes .synthra-graph/ and .synthra/, strips the CLAUDE.md policy block, Synthra\'s .gitignore entries, and its hooks \u2014 your own content in those files always survives. Also deregisters MCP and removes the project from this dashboard. Shows a summary and asks [y/N] first.`,opts:[{flag:`--yes`,desc:`Skip the confirmation prompt (required when not in a terminal)`}]},{cmd:`syn --version`,desc:`Print the installed Synthra version.`}];var n=Mu(),r=I(P(n),2);q(r,5,()=>t,e=>e.cmd,(e,t)=>{var n=ju(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=P(a,!0);T(a);var s=I(a,2),c=e=>{var n=Au();q(n,5,()=>V(t).opts,e=>e.flag,(e,t)=>{var n=ku(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=P(a,!0);T(a),T(n),L(()=>{G(i,V(t).flag),G(o,V(t).desc)}),W(e,n)}),T(n),W(e,n)};K(s,e=>{V(t).opts?.length&&e(c)}),T(n),L(()=>{G(i,V(t).cmd),G(o,V(t).desc)}),W(e,n)}),T(r),We(2),T(n),W(e,n)}var Pu=H(`<details class="rounded-lg border bg-card/50 p-3"><summary class="cursor-pointer text-sm font-medium text-foreground"> </summary> <p class="mt-2 text-[13px] leading-relaxed text-muted-foreground"> </p></details>`),Fu=H(`<!> <!> <div class="mt-4 flex flex-col gap-2"></div> <!>`,1),Iu=H(`<!> <!>`,1);function Lu(e,t){D(t,!0);let n=Y(t,`open`,15,!1),r=[{q:`Where do these numbers come from?`,a:`Synthra\'s Stop hook reads Claude Code\'s transcript JSONL after each turn and logs token usage to .synthra-graph/token_log.jsonl. The gate logs to gate_log.jsonl, tool calls to tool_log.jsonl. The dashboard reads those \u2014 it never feeds back into retrieval.`},{q:`How is cost calculated?`,a:`Token counts \xD7 Anthropic\'s published per-model rates (in src/shared/pricing.ts), summed across input, output, cache-read and cache-write. These are API-equivalent estimates, not your plan billing \u2014 useful for comparing sessions.`},{q:`What is the savings floor?`,a:`Each time the Moat blocks an exploratory Grep/Glob, we credit a deliberately conservative 500 tokens \xD7 $3/M input rate. Real savings are usually higher (it ignores cache thrash and follow-up reads the block also prevents). It\'s a floor, not a guess.`},{q:`What is the Moat?`,a:`A PreToolUse hook that intercepts Grep/Glob and, when the graph has confident context, blocks them and hands back the exact graph_read targets + signatures \u2014 so the agent reads ~50-token slices instead of whole files.`},{q:`What is the Arsenal view?`,a:`A scan of every skill, subagent, and MCP server available to you \u2014 project, personal (~/.claude), and plugin \u2014 with descriptions, so you never have to drop to the CLI to recall what\'s installed. MCP entries show name/type/url only; auth tokens are never read.`},{q:`What\'s the codebase graph?`,a:`tree-sitter parses your project into a symbol graph (files, symbols, imports, call edges). graph_read returns a symbol\'s source plus its dependency surface; graph_continue packs a context bundle.`},{q:`Where is everything stored?`,a:`.synthra-graph/ (machine-local, gitignored) holds the graph + logs; .synthra/ (git-tracked) holds branch-aware memory. Nothing leaves your machine.`},{q:`Why is my bill not lower already?`,a:`Savings land only when the agent actually uses the cheap path. v0.4\u20130.6 push the answer to the point of use (block payloads, edit recipes, dependency footers); a real dogfood session on the latest version is the true test.`}];var i=U();Ti(F(i),()=>Al,(e,t)=>{t(e,{get open(){return n()},set open(e){n(e)},children:(e,t)=>{var n=U();Ti(F(n),()=>oc,(e,t)=>{t(e,{children:(e,t)=>{var n=Iu(),i=F(n);Ti(i,()=>El,(e,t)=>{t(e,{class:`fixed inset-0 z-50 bg-black/60`})}),Ti(I(i,2),()=>Ll,(e,t)=>{t(e,{class:`fixed left-1/2 top-1/2 z-50 max-h-[85vh] w-[min(640px,92vw)] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-xl border bg-card p-6 text-card-foreground shadow-2xl`,children:(e,t)=>{var n=Fu(),i=F(n);Ti(i,()=>Qs,(e,t)=>{t(e,{class:`font-serif text-2xl`,children:(e,t)=>{We(),W(e,oi(`FAQ`))},$$slots:{default:!0}})});var a=I(i,2);Ti(a,()=>kl,(e,t)=>{t(e,{class:`text-xs text-muted-foreground`,children:(e,t)=>{We(),W(e,oi(`Where every number on this dashboard comes from.`))},$$slots:{default:!0}})});var o=I(a,2);q(o,21,()=>r,e=>e.q,(e,t)=>{var n=Pu(),r=P(n),i=P(r,!0);T(r);var a=I(r,2),o=P(a,!0);T(a),T(n),L(()=>{G(i,V(t).q),G(o,V(t).a)}),W(e,n)}),T(o),Ti(I(o,2),()=>Nl,(e,t)=>{t(e,{class:`mt-4 w-full rounded-md border py-2 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:(e,t)=>{We(),W(e,oi(`Close`))},$$slots:{default:!0}})}),W(e,n)},$$slots:{default:!0}})}),W(e,n)},$$slots:{default:!0}})}),W(e,n)},$$slots:{default:!0}})}),W(e,i),O()}var Ru=H(`<div class="flex h-screen w-screen overflow-hidden"><!> <main class="min-w-0 flex-1 overflow-y-auto"><!></main></div> <!>`,1);function zu(e,t){D(t,!0);let n=M(!1);da(()=>(X.start(),()=>X.stop()));var r=Ru(),i=F(r),a=P(i);Ga(a,{onFaq:()=>N(n,!0)});var o=I(a,2),s=P(o),c=e=>{du(e,{})},l=e=>{Nu(e,{})},u=e=>{Ou(e,{})};K(s,e=>{X.view===`overview`?e(c):X.view===`commands`?e(l,1):e(u,-1)}),T(o),T(i),Lu(I(i,2),{get open(){return V(n)},set open(e){N(n,e,!0)}}),W(e,r),O()}var Bu=document.getElementById(`app`);if(!Bu)throw Error(`missing #app mount node`);ci(zu,{target:Bu});</script>\n <style rel="stylesheet" crossorigin>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:var(--font-sans);--font-serif:var(--font-serif);--font-mono:var(--font-mono);--color-black:#000;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-medium:500;--tracking-wide:.025em;--leading-snug:1.375;--leading-relaxed:1.625;--radius-xl:.75rem;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}html,body{height:100%}body{background:radial-gradient(1200px 800px at 14% 16%, #2c5db81f, transparent 60%), var(--background);color:var(--foreground);font-family:var(--font-sans);-webkit-font-smoothing:antialiased}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{background:var(--border);border-radius:999px}::-webkit-scrollbar-track{background:0 0}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:0}.top-1\\/2{top:50%}.left-1\\/2{left:50%}.z-50{z-index:50}.my-1{margin-block:var(--spacing)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.inline{display:inline}.inline-flex{display:inline-flex}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-\\[116px\\]{width:116px;height:116px}.size-full{width:100%;height:100%}.h-1{height:var(--spacing)}.h-2{height:calc(var(--spacing) * 2)}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[85vh\\]{max-height:85vh}.max-h-\\[190px\\]{max-height:190px}.max-h-\\[260px\\]{max-height:260px}.min-h-0{min-height:0}.w-9{width:calc(var(--spacing) * 9)}.w-\\[64px\\]{width:64px}.w-\\[248px\\]{width:248px}.w-\\[min\\(440px\\,92vw\\)\\]{width:min(440px,92vw)}.w-\\[min\\(640px\\,92vw\\)\\]{width:min(640px,92vw)}.w-full{width:100%}.w-screen{width:100vw}.max-w-3xl{max-width:var(--container-3xl)}.max-w-72{max-width:calc(var(--spacing) * 72)}.max-w-\\[120px\\]{max-width:120px}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-rotate-90{rotate:-90deg}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-border,.border-border\\/60{border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){.border-border\\/60{border-color:color-mix(in oklab, var(--border) 60%, transparent)}}.border-sidebar-border{border-color:var(--sidebar-border)}.bg-\\[var\\(--c-fable\\)\\],.bg-\\[var\\(--c-fable\\)\\]\\/12{background-color:var(--c-fable)}@supports (color:color-mix(in lab, red, red)){.bg-\\[var\\(--c-fable\\)\\]\\/12{background-color:color-mix(in oklab, var(--c-fable) 12%, transparent)}}.bg-\\[var\\(--money\\)\\]{background-color:var(--money)}.bg-accent{background-color:var(--accent)}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-border{background-color:var(--border)}.bg-card,.bg-card\\/50{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/50{background-color:color-mix(in oklab, var(--card) 50%, transparent)}}.bg-card\\/55{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/55{background-color:color-mix(in oklab, var(--card) 55%, transparent)}}.bg-card\\/60{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/60{background-color:color-mix(in oklab, var(--card) 60%, transparent)}}.bg-card\\/70{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/70{background-color:color-mix(in oklab, var(--card) 70%, transparent)}}.bg-destructive,.bg-destructive\\/15{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/15{background-color:color-mix(in oklab, var(--destructive) 15%, transparent)}}.bg-muted{background-color:var(--muted)}.bg-muted-foreground,.bg-muted-foreground\\/40{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\\/40{background-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent)}}.bg-primary\\/90{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.bg-primary\\/90{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-accent,.bg-sidebar-accent\\/40{background-color:var(--sidebar-accent)}@supports (color:color-mix(in lab, red, red)){.bg-sidebar-accent\\/40{background-color:color-mix(in oklab, var(--sidebar-accent) 40%, transparent)}}.bg-sidebar-border{background-color:var(--sidebar-border)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pr-1{padding-right:var(--spacing)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.font-serif{font-family:var(--font-serif)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[13px\\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.tracking-\\[0\\.1em\\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\\[0\\.12em\\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\\[0\\.14em\\]{--tw-tracking:.14em;letter-spacing:.14em}.tracking-\\[0\\.18em\\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-all{word-break:break-all}.text-\\[var\\(--c-fable\\)\\]{color:var(--c-fable)}.text-\\[var\\(--c-sonnet\\)\\]{color:var(--c-sonnet)}.text-\\[var\\(--money\\)\\]{color:var(--money)}.text-accent-foreground{color:var(--accent-foreground)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground,.text-foreground\\/70{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/70{color:color-mix(in oklab, var(--foreground) 70%, transparent)}}.text-foreground\\/80{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/80{color:color-mix(in oklab, var(--foreground) 80%, transparent)}}.text-muted-foreground,.text-muted-foreground\\/60{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/60{color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.text-muted-foreground\\/80{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/80{color:color-mix(in oklab, var(--muted-foreground) 80%, transparent)}}.text-primary-foreground{color:var(--primary-foreground)}.text-sidebar-accent-foreground{color:var(--sidebar-accent-foreground)}.text-sidebar-foreground,.text-sidebar-foreground\\/60{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab, red, red)){.text-sidebar-foreground\\/60{color:color-mix(in oklab, var(--sidebar-foreground) 60%, transparent)}}.text-sidebar-foreground\\/75{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab, red, red)){.text-sidebar-foreground\\/75{color:color-mix(in oklab, var(--sidebar-foreground) 75%, transparent)}}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-card\\/80:hover{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-card\\/80:hover{background-color:color-mix(in oklab, var(--card) 80%, transparent)}}.hover\\:bg-card\\/85:hover{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-card\\/85:hover{background-color:color-mix(in oklab, var(--card) 85%, transparent)}}.hover\\:bg-sidebar-accent\\/50:hover{background-color:var(--sidebar-accent)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-sidebar-accent\\/50:hover{background-color:color-mix(in oklab, var(--sidebar-accent) 50%, transparent)}}.hover\\:text-foreground:hover{color:var(--foreground)}.hover\\:text-sidebar-foreground:hover{color:var(--sidebar-foreground)}}.focus\\:border-ring:focus{border-color:var(--ring)}@media (hover:hover){.enabled\\:hover\\:text-foreground:enabled:hover{color:var(--foreground)}}.disabled\\:opacity-40:disabled{opacity:.4}@media (width>=40rem){.sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (width>=48rem){.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width>=64rem){.lg\\:absolute{position:absolute}.lg\\:inset-0{inset:0}.lg\\:col-span-3{grid-column:span 3/span 3}.lg\\:col-start-1{grid-column-start:1}.lg\\:col-start-2{grid-column-start:2}.lg\\:col-start-3{grid-column-start:3}.lg\\:row-span-3{grid-row:span 3/span 3}.lg\\:row-start-1{grid-row-start:1}.lg\\:row-start-2{grid-row-start:2}.lg\\:row-start-3{grid-row-start:3}.lg\\:row-start-4{grid-row-start:4}.lg\\:row-start-5{grid-row-start:5}.lg\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (width>=96rem){.\\32 xl\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.75rem;--background:#04081a;--foreground:#ecf2fb;--card:#0a1733;--card-foreground:#ecf2fb;--popover:#0a1733;--popover-foreground:#ecf2fb;--primary:#2c5db8;--primary-foreground:#f4f7fc;--secondary:#122549;--secondary-foreground:#d7e6f7;--muted:#102146;--muted-foreground:#8ba0c2;--accent:#1b3a78;--accent-foreground:#ecf2fb;--destructive:#ff5d5d;--destructive-foreground:#fff5f5;--border:#9bc2ef24;--input:#9bc2ef2e;--ring:#5c8fe6;--sidebar:#081226;--sidebar-foreground:#d7e6f7;--sidebar-primary:#2c5db8;--sidebar-primary-foreground:#f4f7fc;--sidebar-accent:#122549;--sidebar-accent-foreground:#ecf2fb;--sidebar-border:#9bc2ef1f;--sidebar-ring:#5c8fe6;--c-fable:#2ee08f;--c-opus:#ff6338;--c-sonnet:#ffb938;--c-haiku:#7438ff;--c-unknown:#12cbf5;--money:#4ade9b;--font-sans:"Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-serif:"Instrument Serif", "Times New Roman", serif;--font-mono:"Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}\n/*$vite$:1*/</style>\n </head>\n <body>\n <div id="app"></div>\n </body>\n</html>\n';
|
|
972
|
+
var built_default = '<!doctype html>\n<html lang="en" class="dark">\n <head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <title>Synthra \xB7 Dashboard</title>\n <link rel="icon" href="/favicon.svg" type="image/svg+xml" />\n <link rel="preconnect" href="https://fonts.googleapis.com" />\n <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />\n <link\n href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap"\n rel="stylesheet"\n />\n <script type="module" crossorigin>(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible;function d(e){return typeof e==`function`}var f=()=>{};function p(e){for(var t=0;t<e.length;t++)e[t]()}function m(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function h(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var g=1<<24,_=1024,v=2048,y=4096,b=8192,x=16384,S=32768,ee=1<<25,te=65536,ne=1<<19,re=1<<20,ie=1<<25,ae=65536,oe=1<<21,se=1<<22,ce=1<<23,le=Symbol(`$state`),ue=Symbol(`legacy props`),de=Symbol(``),fe=Symbol(`attributes`),pe=Symbol(`class`),me=Symbol(`style`),he=Symbol(`text`),ge=Symbol(`form reset`),_e=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},ve=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function ye(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function be(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function xe(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Se(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Ce(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function we(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Te(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ee(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function De(){throw Error(`https://svelte.dev/e/set_context_after_init`)}function Oe(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function ke(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Ae(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function je(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Me={},C=Symbol(`uninitialized`),Ne=`http://www.w3.org/1999/xhtml`,Pe=`http://www.w3.org/2000/svg`,Fe=`@attach`;function Ie(){console.warn(`https://svelte.dev/e/derived_inert`)}function Le(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Re(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function ze(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var w=!1;function Be(e){w=e}var T;function Ve(e){if(e===null)throw Le(),Me;return T=e}function He(){return Ve(Sn(T))}function E(e){if(w){if(Sn(T)!==null)throw Le(),Me;T=e}}function D(e=1){if(w){for(var t=e,n=T;t--;)n=Sn(n);T=n}}function Ue(e=!0){for(var t=0,n=T;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Sn(n);e&&n.remove(),n=i}}function We(e){if(!e||e.nodeType!==8)throw Le(),Me;return e.data}function Ge(e){return e===this.v}function Ke(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function qe(e){return!Ke(e,this.v)}var Je=!1,Ye=!1;function Xe(){Ye=!0}var O=null;function Ze(e){O=e}function Qe(e){return rt(`getContext`).get(e)}function $e(e,t){let n=rt(`setContext`);if(Je){var r=V.f;!B&&r&32&&!O.i||De()}return n.set(e,t),t}function et(e){return rt(`hasContext`).has(e)}function tt(){return rt(`getAllContexts`)}function k(e,t=!1,n){O={p:O,i:!1,c:null,e:null,s:e,x:null,r:V,l:Ye&&!t?{s:null,u:null,$:[]}:null}}function A(e){var t=O,n=t.e;if(n!==null){t.e=null;for(var r of n)Rn(r)}return e!==void 0&&(t.x=e),t.i=!0,O=t.p,e??{}}function nt(){return!Ye||O!==null&&O.l===null}function rt(e){return O===null&&ye(e),O.c??=new Map(it(O)||void 0)}function it(e){let t=e.p;for(;t!==null;){let e=t.c;if(e!==null)return e;t=t.p}return null}var at=[];function ot(){var e=at;at=[],p(e)}function st(e){if(at.length===0&&!Bt){var t=at;queueMicrotask(()=>{t===at&&ot()})}at.push(e)}function ct(){for(;at.length>0;)ot()}function lt(e){var t=V;if(t===null)return B.f|=ce,e;if(!(t.f&32768)&&!(t.f&4))throw e;ut(e,t)}function ut(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}var dt=~(v|y|_);function j(e,t){e.f=e.f&dt|t}function ft(e){e.f&512||e.deps===null?j(e,_):j(e,y)}function pt(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=ae,pt(t.deps))}function mt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),pt(e.deps),j(e,_)}var ht=!1,gt=!1;function _t(e){var t=gt;try{return gt=!1,[e(),gt]}finally{gt=t}}function vt(e){let t=0,n=on(0),r;return()=>{Fn()&&(H(n),Wn(()=>(t===0&&(r=Mr(()=>e(()=>un(n)))),t+=1,()=>{st(()=>{--t,t===0&&(r?.(),r=void 0,un(n))})})))}}var yt=te|ne;function bt(e,t,n,r){new xt(e,t,n,r)}var xt=class{parent;is_pending=!1;transform_error;#e;#t=w?T:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=vt(()=>(this.#m=on(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=V;t.b=this,t.f|=128,n(e)},this.parent=V.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=Gn(()=>{if(w){let e=this.#t;He();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},yt),w&&(this.#e=T)}#g(){try{this.#a=qn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=qn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=qn(()=>e(this.#e)),st(()=>{var e=this.#c=document.createDocumentFragment(),t=bn();e.append(t),this.#a=this.#x(()=>qn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,er(this.#o,()=>{this.#o=null}),this.#b(N))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=qn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();ir(this.#a,e);let t=this.#n.pending;this.#o=qn(()=>t(this.#e))}else this.#b(N)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){mt(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=V,n=B,r=O;dr(this.#i),ur(this.#i),Ze(this.#i.ctx);try{return Kt.ensure(),e()}catch(e){return lt(e),null}finally{dr(t),ur(n),Ze(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&er(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,st(()=>{this.#d=!1,this.#m&&cn(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),H(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;N?.is_fork?(this.#a&&N.skip_effect(this.#a),this.#o&&N.skip_effect(this.#o),this.#s&&N.skip_effect(this.#s),N.oncommit(()=>{this.#C(e)})):this.#C(e)}#C(e){this.#a&&=(Zn(this.#a),null),this.#o&&=(Zn(this.#o),null),this.#s&&=(Zn(this.#s),null),w&&(Ve(this.#t),D(),Ve(Ue()));var t=this.#n.onerror;let n=this.#n.failed;var r=!1,i=!1;let a=()=>{if(r){ze();return}r=!0,i&&je(),this.#s!==null&&er(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){ut(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return qn(()=>{var t=V;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return ut(e,this.#i.parent),null}}))};st(()=>{var t;try{t=this.transform_error(e)}catch(e){ut(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>ut(e,this.#i&&this.#i.parent)):o(t)})}};function St(e,t,n,r){let i=nt()?Et:kt;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=V,c=Ct(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){ut(e,s)}wt()}}var d=Tt();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>Ot(e))).then(u).catch(e=>ut(e,s)).finally(d)}l?l.then(()=>{c(),f(),wt()}):f()}function Ct(){var e=V,t=B,n=O,r=N;return function(i=!0){dr(e),ur(t),Ze(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function wt(e=!0){dr(null),ur(null),Ze(null),e&&N?.deactivate()}function Tt(){var e=V,t=e.b,n=N,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function Et(e){var t=2|v;return V!==null&&(V.f|=ne),{ctx:O,deps:null,effects:null,equals:Ge,f:t,fn:e,reactions:null,rv:0,v:C,wv:0,parent:V,ac:null}}var Dt=Symbol(`obsolete`);function Ot(e,t,n){let r=V;r===null&&be();var i=void 0,a=on(C),o=!B,s=new Set;return Un(()=>{var t=V,n=m();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==_e&&n.reject(e)}).finally(wt)}catch(e){n.reject(e),wt()}var c=N;if(o){if(t.f&32768)var l=Tt();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(Dt);else for(let e of s.values())e.reject(Dt);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==Dt&&(c.activate(),t?(a.f|=ce,cn(a,t)):(a.f&8388608&&(a.f^=ce),cn(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),In(()=>{for(let e of s)e.reject(Dt)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function M(e){let t=Et(e);return Je||pr(t),t}function kt(e){let t=Et(e);return t.equals=qe,t}function At(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Zn(t[n])}}function jt(e){var t,n=V,r=e.parent;if(!sr&&r!==null&&e.v!==C&&r.f&24576)return Ie(),e.v;dr(r);try{e.f&=~ae,At(e),t=Tr(e)}finally{dr(n)}return t}function Mt(e){var t=jt(e);if(!e.equals(t)&&(e.wv=Sr(),(!N?.is_fork||e.deps===null)&&(N===null?e.v=t:(N.capture(e,t,!0),Lt?.capture(e,t,!0)),e.deps===null))){j(e,_);return}sr||(Rt===null?ft(e):(Fn()||N?.is_fork)&&Rt.set(e,t))}function Nt(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(_e),t.fn!==null&&(t.teardown=f),t.ac=null,Dr(t,0),Yn(t))}function Pt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&Or(t)}var Ft=null,It=null,N=null,Lt=null,Rt=null,zt=null,Bt=!1,Vt=!1,Ht=null,Ut=null,Wt=0,Gt=1,Kt=class e{id=Gt++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){It===null?Ft=It=this:(It.#n=this,this.#t=It),It=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)j(r,v),t(r);for(r of n.m)j(r,y),t(r)}this.#p.add(e)}#g(){this.#e=!0,Wt++>1e3&&(this.#S(),Jt());for(let e of this.#u)this.#d.delete(e),j(e,v),this.schedule(e);for(let e of this.#d)j(e,y),this.schedule(e);let t=this.#c;this.#c=[],this.apply();var n=Ht=[],r=[],i=Ut=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw tn(e),this.#h()||this.discard(),t}if(N=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(Ht=null,Ut=null,this.#h()){this.#b(r),this.#b(n);for(let[e,t]of this.#f)en(e,t);i.length>0&&N.#g();return}let o=this.#v();if(o){this.#b(r),this.#b(n),o.#y(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),Lt=this,Xt(r),Xt(n),Lt=null,this.#s?.resolve();var s=N;if(this.#a===0&&(this.#c.length===0||s!==null)&&(this.#S(),Je&&(this.#x(),N=s)),this.#c.length>0)if(s!==null){let e=s;e.#c.push(...this.#c.filter(t=>!e.#c.includes(t)))}else s=this;s!==null&&s.#g()}#_(e,t,n){e.f^=_;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=_:i&4?t.push(r):Je&&i&16777224?n.push(r):Cr(r)&&(i&16&&this.#d.add(r),Or(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#v(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#y(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null)for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),j(i,v),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),N=this,this.#g()}#b(e){for(var t=0;t<e.length;t+=1)mt(e[t],this.#u,this.#d)}capture(e,t,n=!1){e.v!==C&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),Rt?.set(e,t)),this.is_fork||(e.v=t)}activate(){N=this}deactivate(){N=null,Rt=null}flush(){try{Vt=!0,N=this,this.#g()}finally{Wt=0,zt=null,Ht=null,Ut=null,Vt=!1,N=null,Rt=null,rn.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(Dt);this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}#x(){for(let u=Ft;u!==null;u=u.#n){var e=u.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(u.current.has(r)){var n=u.current.get(r)[0];if(e&&i!==n)u.current.set(r,[i,a]);else continue}t.push(r)}if(e)for(let[e,t]of this.async_deriveds){let n=u.async_deriveds.get(e);n&&t.promise.then(n.resolve).catch(n.reject)}var r=[...u.current.keys()].filter(e=>!u.current.get(e)[1]);if(!(!u.#e||r.length===0)){var i=r.filter(e=>!this.current.has(e));if(i.length===0)e&&u.discard();else if(t.length>0){if(e)for(let e of this.#p)u.unskip_effect(e,e=>{e.f&4194320?u.schedule(e):u.#b([e])});u.activate();var a=new Set,o=new Map;for(var s of t)Zt(s,i,a,o);o=new Map;var c=[...u.current].filter(([e,t])=>{let n=this.current.get(e);return n?n[0]!==t[0]||n[1]!==t[1]:!0}).map(([e])=>e);if(c.length>0)for(let e of this.#l)!(e.f&155648)&&Qt(e,c,o)&&(e.f&4194320?(j(e,v),u.schedule(e)):u.#u.add(e));if(u.#c.length>0&&!u.#m){u.apply();for(var l of u.#c)u.#_(l,[],[]);u.#c=[]}u.deactivate()}}}}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,st(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=m()).promise}static ensure(){if(N===null){let t=N=new e;!Vt&&!Bt&&st(()=>{t.#e||t.flush()})}return N}apply(){if(!Je||!this.is_fork&&this.#t===null&&this.#n===null){Rt=null;return}Rt=new Map;for(let[e,[t]]of this.current)Rt.set(e,t);for(let t=Ft;t!==null;t=t.#n)if(!(t===this||t.is_fork)){var e=!1;if(t.id<this.id){for(let[n,[,r]]of t.current)if(!r&&this.current.has(n)){e=!0;break}}if(!e)for(let[e,n]of t.previous)Rt.has(e)||Rt.set(e,n)}}schedule(e){if(zt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(Ht!==null&&t===V&&(Je||(B===null||!(B.f&2))&&!ht))return;if(n&96){if(!(n&1024))return;t.f^=_}}this.#c.push(t)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null?Ft=t:e.#n=t,t===null?It=e:t.#t=e,this.linked=!1}}};function qt(e){var t=Bt;Bt=!0;try{var n;for(e&&(N!==null&&!N.is_fork&&N.flush(),n=e());;){if(ct(),N===null)return n;N.flush()}}finally{Bt=t}}function Jt(){try{Te()}catch(e){ut(e,zt)}}var Yt=null;function Xt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Cr(r)&&(Yt=new Set,Or(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&$n(r),Yt?.size>0)){rn.clear();for(let e of Yt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Yt.has(n)&&(Yt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Or(n)}}Yt.clear()}}Yt=null}}function Zt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?Zt(i,t,n,r):e&4194320&&!(e&2048)&&Qt(i,t,r)&&(j(i,v),$t(i))}}function Qt(e,t,r){let i=r.get(e);if(i!==void 0)return i;if(e.deps!==null)for(let i of e.deps){if(n.call(t,i))return!0;if(i.f&2&&Qt(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function $t(e){N.schedule(e)}function en(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),j(e,_);for(var n=e.first;n!==null;)en(n,t),n=n.next}}function tn(e){j(e,_);for(var t=e.first;t!==null;)tn(t),t=t.next}var nn=new Set,rn=new Map,an=!1;function on(e,t){return{f:0,v:e,reactions:null,equals:Ge,rv:0,wv:0}}function P(e,t){let n=on(e,t);return pr(n),n}function sn(e,t=!1,n=!0){let r=on(e);return t||(r.equals=qe),Ye&&n&&O!==null&&O.l!==null&&(O.l.s??=[]).push(r),r}function F(e,t,n=!1){return B!==null&&(!lr||B.f&131072)&&nt()&&B.f&4325394&&(fr===null||!fr.has(e))&&Ae(),cn(e,n?fn(t):t,Ut)}function cn(e,t,n=null){if(!e.equals(t)){rn.set(e,sr?t:e.v);var r=Kt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&jt(t),Rt===null&&ft(t)}e.wv=Sr(),dn(e,v,n),nt()&&V!==null&&V.f&1024&&!(V.f&96)&&(gr===null?_r([e]):gr.push(e)),!r.is_fork&&nn.size>0&&!an&&ln()}return t}function ln(){an=!1;for(let e of nn){e.f&1024&&j(e,y);let t;try{t=Cr(e)}catch{t=!0}t&&Or(e)}nn.clear()}function un(e){F(e,e.v+1)}function dn(e,t,n){var r=e.reactions;if(r!==null)for(var i=nt(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===V)){var l=(c&v)===0;if(l&&j(s,t),c&131072)nn.add(s);else if(c&2){var u=s;Rt?.delete(u),c&65536||(c&512&&(V===null||!(V.f&2097152))&&(s.f|=ae),dn(u,y,n))}else if(l){var d=s;c&16&&Yt!==null&&Yt.add(d),n===null?$t(d):n.push(d)}}}}function fn(t){if(typeof t!=`object`||!t||le in t)return t;let n=l(t);if(n!==s&&n!==c)return t;var r=new Map,i=e(t),o=P(0),u=null,d=br,f=e=>{if(br===d)return e();var t=B,n=br;ur(null),xr(d);var r=e();return ur(t),xr(n),r};return i&&r.set(`length`,P(t.length,u)),new Proxy(t,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&Oe();var i=r.get(t);return i===void 0?f(()=>{var e=P(n.value,u);return r.set(t,e),e}):F(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>P(C,u));r.set(t,e),un(o)}}else F(n,C),un(o);return!0},get(e,n,i){if(n===le)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>P(fn(s?e[n]:C),u)),r.set(n,o)),o!==void 0){var c=H(o);return c===C?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&`value`in n){var i=r.get(t);i&&(n.value=H(i))}else if(n===void 0){var a=r.get(t),o=a?.v;if(a!==void 0&&o!==C)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return n},has(e,t){if(t===le)return!0;var n=r.get(t),i=n!==void 0&&n.v!==C||Reflect.has(e,t);return(n!==void 0||V!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>P(i?fn(e[t]):C,u)),r.set(t,n)),H(n)===C)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;d<c.v;d+=1){var p=r.get(d+``);p===void 0?d in e&&(p=f(()=>P(C,u)),r.set(d+``,p)):F(p,C)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>P(void 0,u)),F(c,fn(n)),r.set(t,c));else{l=c.v!==C;var m=f(()=>fn(n));F(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&F(g,_+1)}un(o)}return!0},ownKeys(e){H(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==C});for(var[n,i]of r)i.v!==C&&!(n in e)&&t.push(n);return t},setPrototypeOf(){ke()}})}function pn(e){try{if(typeof e==`object`&&e&&le in e)return e[le]}catch{}return e}function mn(e,t){return Object.is(pn(e),pn(t))}new Set([`copyWithin`,`fill`,`pop`,`push`,`reverse`,`shift`,`sort`,`splice`,`unshift`]);var hn,gn,_n,vn;function yn(){if(hn===void 0){hn=window,gn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;_n=a(t,`firstChild`).get,vn=a(t,`nextSibling`).get,u(e)&&(e[pe]=void 0,e[fe]=null,e[me]=void 0,e.__e=void 0),u(n)&&(n[he]=void 0)}}function bn(e=``){return document.createTextNode(e)}function xn(e){return _n.call(e)}function Sn(e){return vn.call(e)}function I(e,t){if(!w)return xn(e);var n=xn(T);if(n===null)n=T.appendChild(bn());else if(t&&n.nodeType!==3){var r=bn();return n?.before(r),Ve(r),r}return t&&En(n),Ve(n),n}function L(e,t=!1){if(!w){var n=xn(e);return n instanceof Comment&&n.data===``?Sn(n):n}if(t){if(T?.nodeType!==3){var r=bn();return T?.before(r),Ve(r),r}En(T)}return T}function R(e,t=1,n=!1){let r=w?T:e;for(var i;t--;)i=r,r=Sn(r);if(!w)return r;if(n){if(r?.nodeType!==3){var a=bn();return r===null?i?.after(a):r.before(a),Ve(a),a}En(r)}return Ve(r),r}function Cn(e){e.textContent=``}function wn(){return!Je||Yt!==null?!1:(V.f&S)!==0}function Tn(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function En(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Dn(e,t){if(t){let t=document.body;e.autofocus=!0,st(()=>{document.activeElement===t&&e.focus()})}}var On=!1;function kn(){On||(On=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[ge]?.()})},{capture:!0}))}function An(e){var t=B,n=V;ur(null),dr(null);try{return e()}finally{ur(t),dr(n)}}function jn(e,t,n,r=n){e.addEventListener(t,()=>An(n));let i=e[ge];i?e[ge]=()=>{i(),r(!0)}:e[ge]=()=>r(!0),kn()}function Mn(e){V===null&&(B===null&&we(e),Ce()),sr&&Se(e)}function Nn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Pn(e,t){var n=V;n!==null&&n.f&8192&&(e|=b);var r={ctx:O,deps:null,nodes:null,f:e|v|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};N?.register_created_effect(r);var i=r;if(e&4)Ht===null?Kt.ensure().schedule(r):Ht.push(r);else if(t!==null){try{Or(r)}catch(e){throw Zn(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=te))}if(i!==null&&(i.parent=n,n!==null&&Nn(i,n),B!==null&&B.f&2&&!(e&64))){var a=B;(a.effects??=[]).push(i)}return r}function Fn(){return B!==null&&!lr}function In(e){let t=Pn(8,null);return j(t,_),t.teardown=e,t}function Ln(e){Mn(`$effect`);var t=V.f;if(!B&&t&32&&O!==null&&!O.i){var n=O;(n.e??=[]).push(e)}else return Rn(e)}function Rn(e){return Pn(4|re,e)}function zn(e){return Mn(`$effect.pre`),Pn(8|re,e)}function Bn(e){Kt.ensure();let t=Pn(64|ne,e);return()=>{Zn(t)}}function Vn(e){Kt.ensure();let t=Pn(64|ne,e);return(e={})=>new Promise(n=>{e.outro?er(t,()=>{Zn(t),n(void 0)}):(Zn(t),n(void 0))})}function Hn(e){return Pn(4,e)}function Un(e){return Pn(se|ne,e)}function Wn(e,t=0){return Pn(8|t,e)}function z(e,t=[],n=[],r=[]){St(r,t,n,t=>{Pn(8,()=>{e(...t.map(H))})})}function Gn(e,t=0){return Pn(16|t,e)}function Kn(e,t=0){return Pn(g|t,e)}function qn(e){return Pn(32|ne,e)}function Jn(e){var t=e.teardown;if(t!==null){let e=sr,n=B;cr(!0),ur(null);try{t.call(null)}finally{cr(e),ur(n)}}}function Yn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&An(()=>{e.abort(_e)});var r=n.next;n.f&64?n.parent=null:Zn(n,t),n=r}}function Xn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Zn(t),t=n}}function Zn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Qn(e.nodes.start,e.nodes.end),n=!0),e.f|=ee,Yn(e,t&&!n),Dr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Jn(e),e.f^=ee,e.f|=x;var i=e.parent;i!==null&&i.first!==null&&$n(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Qn(e,t){for(;e!==null;){var n=e===t?null:Sn(e);e.remove(),e=n}}function $n(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function er(e,t,n=!0){var r=[];tr(e,r,!0);var i=()=>{n&&Zn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function tr(e,t,n){if(!(e.f&8192)){e.f^=b;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;tr(i,t,o?n:!1)}i=a}}}function nr(e){rr(e,!0)}function rr(e,t){if(e.f&8192){e.f^=b,e.f&1024||(j(e,v),Kt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;rr(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function ir(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Sn(n);t.append(n),n=i}}var ar=null,or=!1,sr=!1;function cr(e){sr=e}var B=null,lr=!1;function ur(e){B=e}var V=null;function dr(e){V=e}var fr=null;function pr(e){B!==null&&(!Je||B.f&2)&&(fr??=new Set).add(e)}var mr=null,hr=0,gr=null;function _r(e){gr=e}var vr=1,yr=0,br=yr;function xr(e){br=e}function Sr(){return++vr}function Cr(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~ae),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Cr(a)&&Mt(a),a.wv>e.wv)return!0}t&512&&Rt===null&&j(e,_)}return!1}function wr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!Je&&fr!==null&&fr.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?wr(a,t,!1):t===a&&(n?j(a,v):a.f&1024&&j(a,y),$t(a))}}function Tr(e){var t=mr,n=hr,r=gr,i=B,a=fr,o=O,s=lr,c=br,l=e.f;mr=null,hr=0,gr=null,B=l&96?null:e,fr=null,Ze(e.ctx),lr=!1,br=++yr,e.ac!==null&&(An(()=>{e.ac.abort(_e)}),e.ac=null);try{e.f|=oe;var u=e.fn,d=u();e.f|=S;var f=e.deps,p=N?.is_fork;if(mr!==null){var m;if(p||Dr(e,hr),f!==null&&hr>0)for(f.length=hr+mr.length,m=0;m<mr.length;m++)f[hr+m]=mr[m];else e.deps=f=mr;if(Fn()&&e.f&512)for(m=hr;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&hr<f.length&&(Dr(e,hr),f.length=hr);if(nt()&&gr!==null&&!lr&&f!==null&&!(e.f&6146))for(m=0;m<gr.length;m++)wr(gr[m],e);if(i!==null&&i!==e){if(yr++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=yr;if(t!==null)for(let e of t)e.rv=yr;gr!==null&&(r===null?r=gr:r.push(...gr))}return e.f&8388608&&(e.f^=ce),d}catch(e){return lt(e)}finally{e.f^=oe,mr=t,hr=n,gr=r,B=i,fr=a,Ze(o),lr=s,br=c}}function Er(e,r){let i=r.reactions;if(i!==null){var a=t.call(i,e);if(a!==-1){var o=i.length-1;o===0?i=r.reactions=null:(i[a]=i[o],i.pop())}}if(i===null&&r.f&2&&(mr===null||!n.call(mr,r))){var s=r;s.f&512&&(s.f^=512,s.f&=~ae),s.v!==C&&ft(s),Nt(s),Dr(s,0)}}function Dr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Er(e,n[r])}function Or(e){var t=e.f;if(!(t&16384)){j(e,_);var n=V,r=or;V=e,or=!0;try{t&16777232?Xn(e):Yn(e),Jn(e);var i=Tr(e);e.teardown=typeof i==`function`?i:null,e.wv=vr}finally{or=r,V=n}}}async function kr(){if(Je)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),qt()}function H(e){var t=(e.f&2)!=0;if(ar?.add(e),B!==null&&!lr&&!(V!==null&&V.f&16384)&&(fr===null||!fr.has(e))){var r=B.deps;if(B.f&2097152)e.rv<yr&&(e.rv=yr,mr===null&&r!==null&&r[hr]===e?hr++:mr===null?mr=[e]:mr.push(e));else{B.deps??=[],n.call(B.deps,e)||B.deps.push(e);var i=e.reactions;i===null?e.reactions=[B]:n.call(i,B)||i.push(B)}}if(sr&&rn.has(e))return rn.get(e);if(t){var a=e;if(sr){var o=a.v;return(!(a.f&1024)&&a.reactions!==null||jr(a))&&(o=jt(a)),rn.set(a,o),o}var s=(a.f&512)==0&&!lr&&B!==null&&(or||(B.f&512)!=0),c=(a.f&S)===0;Cr(a)&&(s&&(a.f|=512),Mt(a)),s&&!c&&(Pt(a),Ar(a))}if(Rt?.has(e))return Rt.get(e);if(e.f&8388608)throw e.v;return e.v}function Ar(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(Pt(t),Ar(t))}function jr(e){if(e.v===C)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(rn.has(t)||t.f&2&&jr(t))return!0;return!1}function Mr(e){var t=lr;try{return lr=!0,e()}finally{lr=t}}function Nr(){return Symbol(Fe)}function Pr(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var Fr=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function Ir(e){return Fr.includes(e)}var Lr=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),Rr={formnovalidate:`formNoValidate`,ismap:`isMap`,nomodule:`noModule`,playsinline:`playsInline`,readonly:`readOnly`,defaultvalue:`defaultValue`,defaultchecked:`defaultChecked`,srcobject:`srcObject`,novalidate:`noValidate`,allowfullscreen:`allowFullscreen`,disablepictureinpicture:`disablePictureInPicture`,disableremoteplayback:`disableRemotePlayback`};function zr(e){return e=e.toLowerCase(),Rr[e]??e}[...Lr];var Br=[`touchstart`,`touchmove`];function Vr(e){return Br.includes(e)}var Hr=[`textarea`,`script`,`style`,`title`];function Ur(e){return Hr.includes(e)}var Wr=Symbol(`events`),Gr=new Set,Kr=new Set;function qr(e,t,n,r={}){function i(e){if(r.capture||Qr.call(t,e),!e.cancelBubble)return An(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?st(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Jr(e,t,n,r={}){var i=qr(t,e,n,r);return()=>{e.removeEventListener(t,i,r)}}function Yr(e,t,n){(t[Wr]??={})[e]=n}function Xr(e){for(var t=0;t<e.length;t++)Gr.add(e[t]);for(var n of Kr)n(e)}var Zr=null;function Qr(e){var t=this,n=t.ownerDocument,r=e.type,a=e.composedPath?.()||[],o=a[0]||e.target;Zr=e;var s=0,c=Zr===e&&e[Wr];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[Wr]=t;return}var u=a.indexOf(t);if(u===-1)return;l<=u&&(s=l)}if(o=a[s]||e.target,o!==t){i(e,`currentTarget`,{configurable:!0,get(){return o||n}});var d=B,f=V;ur(null),dr(null);try{for(var p,m=[];o!==null&&o!==t;){try{var h=o[Wr]?.[r];h!=null&&(!o.disabled||e.target===o)&&h.call(o,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble)break;s++,o=s<a.length?a[s]:null}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[Wr]=t,delete e.currentTarget,ur(d),dr(f)}}}var $r=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function ei(e){return $r?.createHTML(e)??e}function ti(e){var t=Tn(`template`);return t.innerHTML=ei(e.replaceAll(`<!>`,`\\x3C!---->`)),t.content}function ni(e,t){var n=V;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function U(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(w)return ni(T,null),T;i===void 0&&(i=ti(a?e:`<!>`+e),n||(i=xn(i)));var t=r||gn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=xn(t),s=t.lastChild;ni(o,s)}else ni(t,t);return t}}function ri(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(w)return ni(T,null),T;if(!o){var e=xn(ti(a));if(i)for(o=document.createDocumentFragment();xn(e);)o.appendChild(xn(e));else o=xn(e)}var t=o.cloneNode(!0);if(i){var n=xn(t),r=t.lastChild;ni(n,r)}else ni(t,t);return t}}function ii(e,t){return ri(e,t,`svg`)}function ai(e=``){if(!w){var t=bn(e+``);return ni(t,t),t}var n=T;return n.nodeType===3?En(n):(n.before(n=bn()),Ve(n)),ni(n,n),n}function W(){if(w)return ni(T,null),T;var e=document.createDocumentFragment(),t=document.createComment(``),n=bn();return e.append(t,n),ni(t,n),e}function G(e,t){if(w){var n=V;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=T),He();return}e!==null&&e.before(t)}function oi(){if(w&&T&&T.nodeType===8&&T.textContent?.startsWith(`$`)){let e=T.textContent.substring(1);return He(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function K(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[he]??=e.nodeValue)&&(e[he]=n,e.nodeValue=`${n}`)}function si(e,t){return li(e,t)}var ci=new Map;function li(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){yn();var l=void 0,u=Vn(()=>{var s=n??t.appendChild(bn());bt(s,{pending:()=>{}},t=>{k({});var n=O;if(o&&(n.c=o),a&&(i.$$events=a),w&&ni(t,null),l=e(t,i)||{},w&&(V.nodes.end=T,T===null||T.nodeType!==8||T.data!==`]`))throw Le(),Me;A()},c);var u=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=Vr(r);for(let e of[t,document]){var a=ci.get(e);a===void 0&&(a=new Map,ci.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Qr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(r(Gr)),Kr.add(d),()=>{for(var e of u)for(let n of[t,document]){var r=ci.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Qr),r.delete(e),r.size===0&&ci.delete(n)):r.set(e,i)}Kr.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return ui.set(l,u),l}var ui=new WeakMap;function di(e,t){let n=ui.get(e);return n?(ui.delete(e),n(t)):Promise.resolve()}var fi=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)nr(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(nr(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(Zn(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();ir(r,t),t.append(bn()),this.#n.set(e,{effect:r,fragment:t})}else Zn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),er(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(Zn(n.effect),this.#n.delete(e))};ensure(e,t){var n=N,r=wn();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=bn();i.append(a),this.#n.set(e,{effect:qn(()=>t(a)),fragment:i})}else this.#t.set(e,qn(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else w&&(this.anchor=T),this.#a(n)}};function q(e,t,n=!1){var r;w&&(r=T,He());var i=new fi(e),a=n?te:0;function o(e,t){if(w){var n=We(r);if(e!==parseInt(n.substring(1))){var a=Ue();Ve(a),i.anchor=a,Be(!1),i.ensure(e,t),Be(!0);return}}i.ensure(e,t)}Gn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var pi=Symbol(`NaN`);function mi(e,t,n){w&&He();var r=new fi(e),i=!nt();Gn(()=>{var e=t();e!==e&&(e=pi),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function hi(e,t){return t}function gi(e,t,n){for(var i=[],a=t.length,o,s=t.length,c=0;c<a;c++){let n=t[c];er(n,()=>{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;_i(e,r(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else --s},!1)}if(s===0){var l=i.length===0&&n!==null;if(l){var u=n,d=u.parentNode;Cn(d),d.append(u),e.items.clear()}_i(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function _i(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=ie,ir(a,document.createDocumentFragment())):Zn(t[i],n)}}var vi;function J(t,n,i,a,o,s=null){var c=t,l=new Map;if(n&4){var u=t;c=w?Ve(xn(u)):u.appendChild(bn())}w&&He();var d=null,f=kt(()=>{var t=i();return e(t)?t:t==null?[]:r(t)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,bi(v,p,c,n,a),d!==null&&(p.length===0?d.f&33554432?(d.f^=ie,Si(d,null,c)):nr(d):er(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:Gn(()=>{p=H(f);var e=p.length;let t=!1;w&&We(c)===`[!`!=(e===0)&&(c=Ue(),Ve(c),Be(!1),t=!0);for(var r=new Set,u=N,v=wn(),y=0;y<e;y+=1){w&&T.nodeType===8&&T.data===`]`&&(c=T,t=!0,Be(!1));var b=p[y],x=a(b,y),S=h?null:l.get(x);S?(S.v&&cn(S.v,b),S.i&&cn(S.i,y),v&&u.unskip_effect(S.e)):(S=xi(l,h?c:vi??=bn(),b,x,y,o,n,i),h||(S.e.f|=ie),l.set(x,S)),r.add(x)}if(e===0&&s&&!d&&(h?d=qn(()=>s(c)):(d=qn(()=>s(vi??=bn())),d.f|=ie)),e>r.size&&xe(``,``,``),w&&e>0&&Ve(Ue()),!h)if(m.set(u,r),v){for(let[e,t]of l)r.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u);t&&Be(!0),H(f)}),flags:n,items:l,pending:m,outrogroups:null,fallback:d};h=!1,w&&(c=T)}function yi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function bi(e,t,n,i,a){var o=(i&8)!=0,s=t.length,c=e.items,l=yi(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v<s;v+=1)h=t[v],g=a(h,v),_=c.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<s;v+=1){if(h=t[v],g=a(h,v),_=c.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(nr(_),o&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432)if(_.f^=ie,_===l)Si(_,null,n);else{var y=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),Ci(e,d,_),Ci(e,_,y),Si(_,y,n),d=_,p=[],m=[],l=yi(d.next);continue}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var b=m[0],x;d=b.prev;var S=p[0],ee=p[p.length-1];for(x=0;x<p.length;x+=1)Si(p[x],b,n);for(x=0;x<m.length;x+=1)u.delete(m[x]);Ci(e,S.prev,ee.next),Ci(e,d,S),Ci(e,ee,b),l=b,d=ee,--v,p=[],m=[]}else u.delete(_),Si(_,l,n),Ci(e,_.prev,_.next),Ci(e,_,d===null?e.effect.first:d.next),Ci(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;)(u??=new Set).add(l),m.push(l),l=yi(l.next);if(l===null)continue}_.f&33554432||p.push(_),d=_,l=yi(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(_i(e,r(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var te=[];if(u!==void 0)for(_ of u)_.f&8192||te.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&te.push(l),l=yi(l.next);var ne=te.length;if(ne>0){var re=i&4&&s===0?n:null;if(o){for(v=0;v<ne;v+=1)te[v].nodes?.a?.measure();for(v=0;v<ne;v+=1)te[v].nodes?.a?.fix()}gi(e,te,re)}}o&&st(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function xi(e,t,n,r,i,a,o,s){var c=o&1?o&16?on(n):sn(n,!1,!1):null,l=o&2?on(i):null;return{v:c,i:l,e:qn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Si(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=Sn(r);if(a.before(r),r===i)return;r=o}}function Ci(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Y(e,t,...n){var r=new fi(e);Gn(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},te)}function X(e,t,n){var r;w&&(r=T,He());var i=new fi(e);Gn(()=>{var e=t()??null;if(w&&We(r)===`[`!=(e!==null)){var a=Ue();Ve(a),i.anchor=a,Be(!1),i.ensure(e,e&&(t=>n(t,e))),Be(!0);return}i.ensure(e,e&&(t=>n(t,e)))},te)}function wi(e,t,n,r,i,a){let o=w;w&&He();var s=null;w&&T.nodeType===1&&(s=T,He());var c=w?T:e,l=new fi(c,!1);Gn(()=>{let e=t()||null;var a=i?i():n||e===`svg`?Pe:void 0;if(e===null){l.ensure(null,null);return}return l.ensure(e,t=>{if(e){if(s=w?s:Tn(e,a),ni(s,s),r){var n=null;w&&Ur(e)&&s.append(n=document.createComment(``));var i=w?xn(s):s.appendChild(bn());w&&(i===null?Be(!1):Ve(i)),r(s,i),n?.remove()}V.nodes.end=s,t.before(s)}w&&Ve(t)}),()=>{}},te),In(()=>{}),o&&(Be(!0),Ve(c))}function Ti(e,t){var n=void 0,r;Kn(()=>{n!==(n=t())&&(r&&=(Zn(r),null),n&&(r=qn(()=>{Hn(()=>n(e))})))})}function Ei(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ei(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Di(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ei(e))&&(r&&(r+=` `),r+=t);return r}function Oi(e){return typeof e==`object`?Di(e):e??``}var ki=[...` \n\\r\\f\\xA0\\v\uFEFF`];function Ai(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||ki.includes(r[o-1]))&&(s===r.length||ki.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function ji(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Mi(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Ni(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\\s*\\/\\*.*?\\*\\/\\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Mi)),i&&c.push(...Object.keys(i).map(Mi));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`\'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Mi(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=ji(r)),i&&(n+=ji(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function Pi(e,t,n,r,i,a){var o=e[pe];if(w||o!==n||o===void 0){var s=Ai(n,r,a);(!w||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[pe]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function Fi(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function Ii(e,t,n,r){var i=e[me];if(w||i!==t){var a=Ni(t,r);(!w||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[me]=t}else r&&(Array.isArray(r)?(Fi(e,n?.[0],r[0]),Fi(e,n?.[1],r[1],`important`)):Fi(e,n,r));return r}function Li(t,n,r=!1){if(t.multiple){if(n==null)return;if(!e(n))return Re();for(var i of t.options)i.selected=n.includes(zi(i));return}for(i of t.options)if(mn(zi(i),n)){i.selected=!0;return}(!r||n!==void 0)&&(t.selectedIndex=-1)}function Ri(e){var t=new MutationObserver(()=>{Li(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),In(()=>{t.disconnect()})}function zi(e){return`__value`in e?e.__value:e.value}var Bi=Symbol(`class`),Vi=Symbol(`style`),Hi=Symbol(`is custom element`),Ui=Symbol(`is html`),Wi=ve?`link`:`LINK`,Gi=ve?`input`:`INPUT`,Ki=ve?`option`:`OPTION`,qi=ve?`select`:`SELECT`;function Ji(e){if(w){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Xi(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Xi(e,`checked`,null),e.checked=r}}};e[ge]=n,st(n),kn()}}function Yi(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function Xi(e,t,n,r){var i=$i(e);w&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Wi)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[de]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ta(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Zi(e,t,n,r,i=!1,a=!1){if(w&&i&&e.nodeName===Gi){var o=e;(o.type===`checkbox`?`defaultChecked`:`defaultValue`)in n||Ji(o)}var s=$i(e),c=s[Hi],l=!s[Ui];let u=w&&c;u&&Be(!1);var d=t||{},f=e.nodeName===Ki;for(var p in t)p in n||(n[p]=null);n.class?n.class=Oi(n.class):(r||n[Bi])&&(n.class=null),n[Vi]&&(n.style??=null);var m=ta(e);if(e.nodeName===Gi&&`type`in n&&(`value`in n||`__value`in n)){var h=n.type;(h!==d.type||h===void 0&&e.hasAttribute(`type`))&&(d.type=h,Xi(e,`type`,h,a))}for(let i in n){let o=n[i];if(f&&i===`value`&&o==null){e.value=e.__value=``,d[i]=o;continue}if(i===`class`){Pi(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,o,r,t?.[Bi],n[Bi]),d[i]=o,d[Bi]=n[Bi];continue}if(i===`style`){Ii(e,o,t?.[Vi],n[Vi]),d[i]=o,d[Vi]=n[Vi];continue}var g=d[i];if(!(o===g&&!(o===void 0&&e.hasAttribute(i)))){d[i]=o;var _=i[0]+i[1];if(_!==`$$`)if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var v=Ir(r);if(Pr(r)&&(r=r.slice(0,-7),t.capture=!0),!v&&g){if(o!=null)continue;e.removeEventListener(r,d[n],t),d[n]=null}if(v)Yr(r,e,o),Xr([r]);else if(o!=null){function a(e){d[i].call(this,e)}d[n]=qr(r,e,a,t)}}else if(i===`style`)Xi(e,i,o);else if(i===`autofocus`)Dn(e,!!o);else if(!c&&(i===`__value`||i===`value`&&o!=null))e.value=e.__value=o;else if(i===`selected`&&f)Yi(e,o);else{var y=i;l||(y=zr(y));var b=y===`defaultValue`||y===`defaultChecked`;if(o==null&&!c&&!b)if(s[i]=null,y===`value`||y===`checked`){let n=e,r=t===void 0;if(y===`value`){let e=n.defaultValue;n.removeAttribute(y),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(y),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i);else b||m.includes(y)&&(c||typeof o!=`string`)?(e[y]=o,y in s&&(s[y]=C)):typeof o!=`function`&&Xi(e,y,o,a)}}}return u&&Be(!0),d}function Qi(e,t,n=[],r=[],i=[],a,o=!1,s=!1){St(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===qi,l=!1;if(Kn(()=>{var u=t(...n.map(H)),d=Zi(e,r,u,a,o,s);l&&c&&`value`in u&&Li(e,u.value);for(let e of Object.getOwnPropertySymbols(i))u[e]||Zn(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var f=u[t];t.description===`@attach`&&(!r||f!==r[t])&&(i[t]&&Zn(i[t]),i[t]=qn(()=>Ti(e,()=>f))),d[t]=f}r=d}),c){var u=e;Hn(()=>{Li(u,r.value,!0),Ri(u)})}l=!0})}function $i(e){return e[fe]??={[Hi]:e.nodeName.includes(`-`),[Ui]:e.namespaceURI===Ne}}var ea=new Map;function ta(e){var t=e.getAttribute(`is`)||e.nodeName,n=ea.get(t);if(n)return n;ea.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var s in r=o(i),r)r[s].set&&s!==`innerHTML`&&s!==`textContent`&&s!==`innerText`&&n.push(s);i=l(i)}return n}function na(e,t,n=t){var r=new WeakSet;jn(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=ra(e)?ia(a):a,n(a),N!==null&&r.add(N),await kr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(w&&e.defaultValue!==e.value||Mr(t)==null&&e.value)&&(n(ra(e)?ia(e.value):e.value),N!==null&&r.add(N)),Wn(()=>{var n=t();if(e===document.activeElement){var i=Je?Lt:N;if(r.has(i))return}ra(e)&&n===ia(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function ra(e){var t=e.type;return t===`number`||t===`range`}function ia(e){return e===``?null:+e}var aa={get(e,t){if(!e.exclude.has(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.has(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))}};function oa(e,t,n){return new Proxy({props:e,exclude:t},aa)}var sa={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(d(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];d(i)&&(i=i());let o=a(i,t);if(o&&o.set)return o.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(d(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=a(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===le||t===ue)return!1;for(let n of e.props)if(d(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(d(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function ca(...e){return new Proxy({props:e},sa)}function Z(e,t,n,r){var i=!Ye||(n&2)!=0,o=(n&8)!=0,s=(n&16)!=0,c=r,l=!0,u=void 0,d=()=>s&&i?(u??=Et(r),H(u)):(l&&(l=!1,c=s?Mr(r):r),c);let f;if(o){var p=le in e||ue in e;f=a(e,t)?.set??(p&&t in e?n=>e[t]=n:void 0)}var m,h=!1;o?[m,h]=_t(()=>e[t]):m=e[t],m===void 0&&r!==void 0&&(m=d(),f&&(i&&Ee(t),f(m)));var g=i?()=>{var n=e[t];return n===void 0?d():(l=!0,n)}:()=>{var n=e[t];return n!==void 0&&(c=void 0),n===void 0?c:n};if(i&&!(n&4))return g;if(f){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||h)&&f(t?g():e),e):g()})}var v=!1,y=(n&1?Et:kt)(()=>(v=!1,g()));o&&H(y);var b=V;return(function(e,t){if(arguments.length>0){let n=t?H(y):i&&o?fn(e):e;return F(y,n),v=!0,c!==void 0&&(c=n),e}return sr&&v||b.f&16384?y.v:H(y)})}function la(e){O===null&&ye(`onMount`),Ye&&O.l!==null?ua(O).m.push(e):Ln(()=>{let t=Mr(e);if(typeof t==`function`)return t})}function ua(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var Q=new class{#e=P(null);get data(){return H(this.#e)}set data(e){F(this.#e,e,!0)}#t=P(null);get arsenal(){return H(this.#t)}set arsenal(e){F(this.#t,e,!0)}#n=P(`connecting`);get status(){return H(this.#n)}set status(e){F(this.#n,e,!0)}#r=P(``);get clock(){return H(this.#r)}set clock(e){F(this.#r,e,!0)}#i=P(`overview`);get view(){return H(this.#i)}set view(e){F(this.#i,e,!0)}#a=P(!1);get arsenalLoading(){return H(this.#a)}set arsenalLoading(e){F(this.#a,e,!0)}#o=!1;#s=null;async tick(){try{let e=await fetch(`/data`);if(!e.ok)throw Error(`HTTP ${e.status}`);this.data=await e.json(),this.status=`live`,this.clock=new Date().toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}catch{this.status=`offline`}}start(){this.tick(),this.#s=setInterval(()=>void this.tick(),1e4)}stop(){this.#s&&clearInterval(this.#s)}#c=P(null);get report(){return H(this.#c)}set report(e){F(this.#c,e,!0)}#l=P(!1);get reportLoading(){return H(this.#l)}set reportLoading(e){F(this.#l,e,!0)}async loadReport(){this.reportLoading=!0;try{let e=await fetch(`/report`);e.ok&&(this.report=await e.json())}catch{}finally{this.reportLoading=!1}}async loadArsenal(e=!1){if(!(this.#o&&!e)){this.arsenalLoading=!0;try{let e=await fetch(`/arsenal`);e.ok&&(this.arsenal=await e.json(),this.#o=!0)}catch{}finally{this.arsenalLoading=!1}}}go(e){this.view=e,e===`arsenal`&&this.loadArsenal()}};function da(e){return typeof e!=`number`||!Number.isFinite(e)?`0`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function fa(e){return typeof e!=`number`||!Number.isFinite(e)?`$0.00`:`$${e.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2})}`}function pa(e){if(!e)return`\u2014`;let t=new Date(e);if(Number.isNaN(t.getTime()))return`\u2014`;let n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()?t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):t.toLocaleDateString([],{month:`short`,day:`numeric`})}function ma(e){if(!e)return`unknown`;let t=e.toLowerCase();return t===`<synthetic>`?`unknown`:t.includes(`fable`)?`fable`:t.includes(`opus`)?`opus`:t.includes(`sonnet`)?`sonnet`:t.includes(`haiku`)?`haiku`:`unknown`}function ha(e){return!e||e===`<synthetic>`?`synthetic`:e.replace(/^claude-/,``)}function ga(e){if(!e)return``;let t=e.split(/[/\\\\]/).filter(Boolean);return t.length<=2?t.join(`/`):`\u2026/${t.slice(-2).join(`/`)}`}var _a=[220,75,20,155,285,330,250,45];function va(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return`oklch(72% 0.15 ${_a[t%_a.length]})`}var ya={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},ba=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},xa=Symbol(`lucide-context`),Sa=()=>Qe(xa),Ca=new Set([`$$slots`,`$$events`,`$$legacy`,`name`,`color`,`size`,`strokeWidth`,`absoluteStrokeWidth`,`iconNode`,`children`]),wa=ii(`<svg><!><!></svg>`);function Ta(e,t){k(t,!0);let n=Sa()??{},r=Z(t,`color`,19,()=>n.color??`currentColor`),i=Z(t,`size`,19,()=>n.size??24),a=Z(t,`strokeWidth`,19,()=>n.strokeWidth??2),o=Z(t,`absoluteStrokeWidth`,19,()=>n.absoluteStrokeWidth??!1),s=Z(t,`iconNode`,19,()=>[]),c=oa(t,Ca),l=M(()=>o()?Number(a())*24/Number(i()):a());var u=wa();Qi(u,e=>({...ya,...e,...c,width:i(),height:i(),stroke:r(),"stroke-width":H(l),class:[`lucide-icon lucide`,n.class,t.name&&`lucide-${t.name}`,t.class]}),[()=>!t.children&&!ba(c)&&{"aria-hidden":`true`}]);var d=I(u);J(d,17,s,hi,(e,t)=>{var n=M(()=>h(H(t),2));let r=()=>H(n)[0],i=()=>H(n)[1];var a=W();wi(L(a),r,!0,(e,t)=>{Qi(e,()=>({...i()}))}),G(e,a)}),Y(R(d),()=>t.children??f),E(u),G(e,u),A()}var Ea=new Set([`$$slots`,`$$events`,`$$legacy`]);function Da(e,t){let n=oa(t,Ea),r=[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`}]];Ta(e,ca({name:`layout-dashboard`},()=>n,{get iconNode(){return r}}))}var Oa=new Set([`$$slots`,`$$events`,`$$legacy`]);function ka(e,t){let n=oa(t,Oa),r=[[`polyline`,{points:`14.5 17.5 3 6 3 3 6 3 17.5 14.5`}],[`line`,{x1:`13`,x2:`19`,y1:`19`,y2:`13`}],[`line`,{x1:`16`,x2:`20`,y1:`16`,y2:`20`}],[`line`,{x1:`19`,x2:`21`,y1:`21`,y2:`19`}],[`polyline`,{points:`14.5 6.5 18 3 21 3 21 6 17.5 9.5`}],[`line`,{x1:`5`,x2:`9`,y1:`14`,y2:`18`}],[`line`,{x1:`7`,x2:`4`,y1:`17`,y2:`20`}],[`line`,{x1:`3`,x2:`5`,y1:`19`,y2:`21`}]];Ta(e,ca({name:`swords`},()=>n,{get iconNode(){return r}}))}var Aa=new Set([`$$slots`,`$$events`,`$$legacy`]);function ja(e,t){let n=oa(t,Aa),r=[[`path`,{d:`m7 11 2-2-2-2`}],[`path`,{d:`M11 13h4`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}]];Ta(e,ca({name:`square-terminal`},()=>n,{get iconNode(){return r}}))}var Ma=new Set([`$$slots`,`$$events`,`$$legacy`]);function Na(e,t){let n=oa(t,Ma),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m4.93 4.93 4.24 4.24`}],[`path`,{d:`m14.83 9.17 4.24-4.24`}],[`path`,{d:`m14.83 14.83 4.24 4.24`}],[`path`,{d:`m9.17 14.83-4.24 4.24`}],[`circle`,{cx:`12`,cy:`12`,r:`4`}]];Ta(e,ca({name:`life-buoy`},()=>n,{get iconNode(){return r}}))}var Pa=new Set([`$$slots`,`$$events`,`$$legacy`]);function Fa(e,t){let n=oa(t,Pa),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}],[`path`,{d:`M12 17h.01`}]];Ta(e,ca({name:`circle-question-mark`},()=>n,{get iconNode(){return r}}))}var Ia=new Set([`$$slots`,`$$events`,`$$legacy`]);function La(e,t){let n=oa(t,Ia),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}]];Ta(e,ca({name:`panel-left`},()=>n,{get iconNode(){return r}}))}var Ra=U(`<div class="min-w-0"><div class="font-serif text-lg leading-none text-foreground">Synth<em>ra</em></div> <div class="font-mono text-[10px] uppercase tracking-[0.18em] text-muted-foreground">Dashboard</div></div>`),za=U(`<span class="font-mono text-sm text-muted-foreground"> </span>`),Ba=U(`<span> </span>`),Va=U(`<button><!> <!></button>`),Ha=U(`<span>Report</span>`),Ua=U(`<span>FAQ</span>`),Wa=U(`<div class="flex flex-col gap-1 rounded-lg bg-sidebar-accent/40 p-2.5"><div class="font-mono text-[10px] uppercase tracking-[0.14em] text-muted-foreground">Active</div> <div class="truncate font-mono text-sm text-sidebar-foreground"> </div> <div class="mt-1 flex items-center justify-between font-mono text-[10px] text-muted-foreground"><span> </span> <span>v__SYN_VERSION__</span></div></div>`),Ga=U(`<span class="text-xs">Collapse</span>`),Ka=U(`<aside><div class="flex items-center gap-2.5 px-1 py-2"><div class="grid size-8 shrink-0 place-items-center rounded-lg bg-primary/90 font-serif text-lg italic text-primary-foreground">S</div> <!></div> <div><span></span> <!></div> <div class="my-1 h-px bg-sidebar-border"></div> <nav class="flex flex-col gap-1"><!> <button title="Report an issue or suggest a feature"><!> <!></button> <button title="FAQ"><!> <!></button></nav> <div class="flex-1"></div> <!> <button title="Toggle sidebar"><!> <!></button></aside>`);function qa(e,t){k(t,!0);let n=P(!1),r=typeof window<`u`&&window.location.port||`8901`,i=[{id:`overview`,label:`Overview`,icon:Da},{id:`arsenal`,label:`Arsenal`,icon:ka},{id:`commands`,label:`Commands`,icon:ja}];var a=Ka(),o=I(a),s=R(I(o),2),c=e=>{G(e,Ra())};q(s,e=>{H(n)||e(c)}),E(o);var l=R(o,2),u=I(l);let d;var f=R(u,2),p=e=>{var t=za(),n=I(t,!0);E(t),z(()=>K(n,Q.status===`live`?`live \xB7 ${Q.clock}`:Q.status)),G(e,t)};q(f,e=>{H(n)||e(p)}),E(l);var m=R(l,4),h=I(m);J(h,17,()=>i,e=>e.id,(e,t)=>{var r=Va(),i=I(r);X(i,()=>H(t).icon,(e,t)=>{t(e,{class:`size-4 shrink-0`})});var a=R(i,2),o=e=>{var n=Ba(),r=I(n,!0);E(n),z(()=>K(r,H(t).label)),G(e,n)};q(a,e=>{H(n)||e(o)}),E(r),z(()=>{Xi(r,`title`,H(t).label),Pi(r,1,`flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm transition-colors `+(Q.view===H(t).id?`bg-sidebar-accent text-sidebar-accent-foreground`:`text-sidebar-foreground/75 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground`)+(H(n)?` justify-center`:``))}),Yr(`click`,r,()=>Q.go(H(t).id)),G(e,r)});var g=R(h,2),_=I(g);Na(_,{class:`size-4 shrink-0`});var v=R(_,2),y=e=>{G(e,Ha())};q(v,e=>{H(n)||e(y)}),E(g);var b=R(g,2),x=I(b);Fa(x,{class:`size-4 shrink-0`});var S=R(x,2),ee=e=>{G(e,Ua())};q(S,e=>{H(n)||e(ee)}),E(b),E(m);var te=R(m,4),ne=e=>{var t=Wa(),n=R(I(t),2),i=I(n,!0);E(n);var a=R(n,2),o=I(a),s=I(o);E(o),D(2),E(a),E(t),z(()=>{Xi(n,`title`,Q.data?.active?.project_root??`\u2014`),K(i,Q.data?.active?.project_name??`\u2014`),K(s,`port ${r??``}`)}),G(e,t)};q(te,e=>{H(n)||e(ne)});var re=R(te,2),ie=I(re);La(ie,{class:`size-4 shrink-0`});var ae=R(ie,2),oe=e=>{G(e,Ga())};q(ae,e=>{H(n)||e(oe)}),E(re),E(a),z(()=>{Pi(a,1,`flex h-screen shrink-0 flex-col gap-1 border-r border-sidebar-border bg-sidebar p-3 transition-[width] duration-200 `+(H(n)?`w-[64px] items-center`:`w-[248px]`)),Pi(l,1,`flex items-center gap-2 rounded-md px-2 py-1.5 `+(H(n)?`justify-center`:``)),d=Pi(u,1,`size-2 shrink-0 rounded-full `+(Q.status===`live`?`bg-[var(--c-fable)]`:Q.status===`offline`?`bg-destructive`:`bg-muted-foreground`),null,d,{"animate-pulse":Q.status===`live`}),Pi(g,1,`flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm text-sidebar-foreground/75 transition-colors hover:bg-sidebar-accent/50 hover:text-sidebar-foreground `+(H(n)?`justify-center`:``)),Pi(b,1,`flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm text-sidebar-foreground/75 transition-colors hover:bg-sidebar-accent/50 hover:text-sidebar-foreground `+(H(n)?`justify-center`:``)),Pi(re,1,`mt-1 flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent/50 hover:text-sidebar-foreground `+(H(n)?`justify-center`:``))}),Yr(`click`,g,function(...e){t.onReport?.apply(this,e)}),Yr(`click`,b,function(...e){t.onFaq?.apply(this,e)}),Yr(`click`,re,()=>F(n,!H(n))),G(e,a),A()}Xr([`click`]),Xe();var Ja=U(`<div class="flex flex-col gap-1 bg-card/70 p-4"><span class="font-mono text-xs uppercase tracking-[0.12em] text-muted-foreground"> </span> <span class="font-mono text-2xl tabular-nums text-foreground"> </span></div>`),Ya=U(`<div class="grid grid-cols-2 gap-px overflow-hidden rounded-xl border bg-border sm:grid-cols-3 lg:grid-cols-5"></div>`);function Xa(e,t){k(t,!0);let n=M(()=>{let e=Q.data?.global;return[{label:`Turns`,v:e?.total_turns??0},{label:`\u2193 Input`,v:e?.total_input_tokens??0},{label:`\u2191 Output`,v:e?.total_output_tokens??0},{label:`\u27F2 Cache R`,v:e?.total_cache_read??0},{label:`\uFF0B Cache W`,v:e?.total_cache_create??0}]});var r=Ya();J(r,21,()=>H(n),e=>e.label,(e,t)=>{var n=Ja(),r=I(n),i=I(r,!0);E(r);var a=R(r,2),o=I(a,!0);E(a),E(n),z(e=>{K(i,H(t).label),K(o,e)},[()=>da(H(t).v)]),G(e,n)}),E(r),G(e,r),A()}var Za=U(`<span class="font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground"> </span>`),Qa=U(`<header class="flex items-baseline justify-between gap-3"><span class="font-mono text-xs uppercase tracking-[0.14em] text-muted-foreground"> </span> <!></header>`),$a=U(`<section><!> <!></section>`);function eo(e,t){let n=Z(t,`class`,3,``);var r=$a(),i=I(r),a=e=>{var n=Qa(),r=I(n),i=I(r,!0);E(r);var a=R(r,2),o=e=>{var n=Za(),r=I(n,!0);E(n),z(()=>K(r,t.meta)),G(e,n)};q(a,e=>{t.meta&&e(o)}),E(n),z(()=>K(i,t.title)),G(e,n)};q(i,e=>{t.title&&e(a)}),Y(R(i,2),()=>t.children??f),E(r),z(()=>Pi(r,1,`flex h-full min-h-0 flex-col gap-3 rounded-xl border bg-card/55 p-4 transition-colors hover:bg-card/80 `+n())),G(e,r)}var to=U(`<div class="flex flex-col gap-3"><div><div class="font-mono text-3xl text-[var(--money)]"> </div> <div class="font-mono text-sm text-muted-foreground"> </div></div> <div class="flex h-2 overflow-hidden rounded-full bg-border"><div class="h-full bg-muted-foreground/40"></div> <div class="h-full bg-[var(--money)]"></div></div> <div class="flex justify-between font-mono text-xs text-muted-foreground"><span>you paid <b class="text-foreground"> </b></span> <span>baseline <b class="text-foreground"> </b></span></div> <div class="rounded-md border border-dashed border-border px-3 py-2 text-center font-mono text-xs text-muted-foreground"><b class="text-foreground"> </b> blocks \xD7 <b class="text-foreground">500</b> tokens \xD7 <b class="text-foreground">$3</b>/M = <b class="text-[var(--money)]"> </b></div></div>`);function no(e,t){k(t,!0);let n=M(()=>{let e=Q.data?.global,t=e?.blocked_count??0,n=t*500*3/1e6,r=e?.estimated_cost_usd??0,i=r+n;return{blocks:t,money:n,paid:r,baseline:i,pct:i>0?n/i*100:0,tokens:e?.estimated_tokens_saved??0,paidWidth:i>0?r/i*100:100}});{let t=M(()=>`${H(n).pct.toFixed(1)}% off \xB7 floor`);eo(e,{title:`Synthra savings`,get meta(){return H(t)},children:(e,t)=>{var r=to(),i=I(r),a=I(i),o=I(a,!0);E(a);var s=R(a,2),c=I(s);E(s),E(i);var l=R(i,2),u=I(l),d=R(u,2);E(l);var f=R(l,2),p=I(f),m=R(I(p)),h=I(m,!0);E(m),E(p);var g=R(p,2),_=R(I(g)),v=I(_,!0);E(_),E(g),E(f);var y=R(f,2),b=I(y),x=I(b,!0);E(b);var S=R(b,6),ee=I(S,!0);E(S),E(y),E(r),z((e,t,r,i,a)=>{K(o,e),K(c,`${t??``} tokens avoided`),Ii(u,`width:${H(n).paidWidth}%`),Ii(d,`width:${100-H(n).paidWidth}%`),K(h,r),K(v,i),K(x,H(n).blocks),K(ee,a)},[()=>fa(H(n).money),()=>da(H(n).tokens),()=>fa(H(n).paid),()=>fa(H(n).baseline),()=>fa(H(n).money)]),G(e,r)},$$slots:{default:!0}})}A()}var ro=U(`<div class="font-mono text-3xl text-[var(--money)]"> </div> <div class="mt-1 flex flex-col gap-1 font-mono text-sm text-muted-foreground"><div class="flex justify-between"><span>Tokens (in+out)</span><span class="text-foreground"> </span></div> <div class="flex justify-between"><span>Avg / turn</span><span class="text-foreground"> </span></div></div>`,1);function io(e,t){k(t,!0);let n=M(()=>{let e=Q.data?.global,t=e?.total_turns??0,n=e?.estimated_cost_usd??0;return{cost:n,tokens:(e?.total_input_tokens??0)+(e?.total_output_tokens??0),avg:t>0?n/t:0}});eo(e,{title:`Total spend`,meta:`all time`,children:(e,t)=>{var r=ro(),i=L(r),a=I(i,!0);E(i);var o=R(i,2),s=I(o),c=R(I(s)),l=I(c,!0);E(c),E(s);var u=R(s,2),d=R(I(u)),f=I(d,!0);E(d),E(u),E(o),z((e,t,n)=>{K(a,e),K(l,t),K(f,n)},[()=>fa(H(n).cost),()=>da(H(n).tokens),()=>fa(H(n).avg)]),G(e,r)},$$slots:{default:!0}}),A()}var ao=ii(`<circle cx="70" cy="70" r="52" fill="none" stroke-width="14"></circle>`),oo=U(`<div class="flex items-center gap-2 font-mono text-sm"><span class="size-2 rounded-sm"></span> <span class="flex-1 text-muted-foreground"> </span> <span class="tabular-nums text-foreground"> </span> <span class="w-9 text-right tabular-nums text-muted-foreground"> </span></div>`),so=U(`<div class="text-sm text-muted-foreground">No turns yet.</div>`),co=U(`<div class="flex items-center gap-4"><div class="relative size-[116px] shrink-0"><svg viewBox="0 0 140 140" class="size-full -rotate-90"><circle cx="70" cy="70" r="52" fill="none" stroke="var(--border)" stroke-width="14"></circle><!></svg> <div class="absolute inset-0 grid place-items-center"><div class="text-center"><div class="font-mono text-2xl text-foreground"> </div> <div class="font-mono text-[10px] uppercase text-muted-foreground">turns</div></div></div></div> <div class="flex min-w-0 flex-1 flex-col gap-1.5"></div></div>`);function lo(e,t){k(t,!0);let n=[{fam:`fable`,label:`Fable`,color:`var(--c-fable)`},{fam:`opus`,label:`Opus`,color:`var(--c-opus)`},{fam:`sonnet`,label:`Sonnet`,color:`var(--c-sonnet)`},{fam:`haiku`,label:`Haiku`,color:`var(--c-haiku)`},{fam:`unknown`,label:`Other`,color:`var(--c-unknown)`}],r=2*Math.PI*52,i=M(()=>{let e={fable:0,opus:0,sonnet:0,haiku:0,unknown:0};for(let t of Q.data?.projects??[])for(let[n,r]of Object.entries(t.models??{}))e[ma(n)]+=r;let t=n.reduce((t,n)=>t+e[n.fam],0),i=0;return{arcs:n.filter(t=>e[t.fam]>0).map(n=>{let a=e[n.fam],o=t>0?a/t*r:0,s={...n,n:a,len:o,offset:i,pct:t>0?Math.round(a/t*100):0};return i+=o,s}),total:t}});eo(e,{title:`Model usage`,meta:`by turns`,children:(e,t)=>{var n=co(),a=I(n),o=I(a);J(R(I(o)),17,()=>H(i).arcs,e=>e.fam,(e,t)=>{var n=ao();z(()=>{Xi(n,`stroke`,H(t).color),Xi(n,`stroke-dasharray`,`${H(t).len} ${r}`),Xi(n,`stroke-dashoffset`,-H(t).offset),Xi(n,`stroke-linecap`,H(i).arcs.length===1?`round`:`butt`)}),G(e,n)}),E(o);var s=R(o,2),c=I(s),l=I(c),u=I(l,!0);E(l),D(2),E(c),E(s),E(a);var d=R(a,2);J(d,21,()=>H(i).arcs,e=>e.fam,(e,t)=>{var n=oo(),r=I(n),i=R(r,2),a=I(i,!0);E(i);var o=R(i,2),s=I(o,!0);E(o);var c=R(o,2),l=I(c);E(c),E(n),z(()=>{Ii(r,`background:${H(t).color}`),K(a,H(t).label),K(s,H(t).n),K(l,`${H(t).pct??``}%`)}),G(e,n)},e=>{G(e,so())}),E(d),E(n),z(()=>K(u,H(i).total)),G(e,n)},$$slots:{default:!0}}),A()}function uo(e){return typeof e==`object`&&!!e}var fo=[`string`,`number`,`bigint`,`boolean`];function po(e){return e==null||fo.includes(typeof e)?!0:Array.isArray(e)?e.every(e=>po(e)):typeof e==`object`?Object.getPrototypeOf(e)===Object.prototype:!1}var mo=Symbol(`box`),ho=Symbol(`is-writable`);function $(e,t){let n=M(e);return t?{[mo]:!0,[ho]:!0,get current(){return H(n)},set current(e){t(e)}}:{[mo]:!0,get current(){return e()}}}function go(e){return uo(e)&&mo in e}function _o(e){let t=P(fn(e));return{[mo]:!0,[ho]:!0,get current(){return H(t)},set current(e){F(t,e,!0)}}}function vo(...e){return function(t){for(let n of e)if(n){if(t.defaultPrevented)return;typeof n==`function`?n.call(this,t):n.current?.call(this,t)}}}var yo=/\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g,bo=/\\n/g,xo=/^\\s*/,So=/^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/,Co=/^:\\s*/,wo=/^((?:\'(?:\\\\\'|.)*?\'|"(?:\\\\"|.)*?"|\\([^)]*?\\)|[^};])+)/,To=/^[;\\s]*/,Eo=/^\\s+|\\s+$/g,Do=`\n`,Oo=`/`,ko=`*`,Ao=``,jo=`comment`,Mo=`declaration`;function No(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(bo);t&&(n+=t.length);var i=e.lastIndexOf(Do);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(xo)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(!(Oo!=e.charAt(0)||ko!=e.charAt(1))){for(var n=2;Ao!=e.charAt(n)&&(ko!=e.charAt(n)||Oo!=e.charAt(n+1));)++n;if(n+=2,Ao===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:jo,comment:o})}}function f(){var e=a(),t=c(So);if(t){if(d(),!c(Co))return s(`property missing \':\'`);var n=c(wo),r=e({type:Mo,property:Po(t[0].replace(yo,Ao)),value:n?Po(n[0].replace(yo,Ao)):Ao});return c(To),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function Po(e){return e?e.replace(Eo,Ao):Ao}function Fo(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=No(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}var Io=/\\d/,Lo=[`-`,`_`,`/`,`.`];function Ro(e=``){if(!Io.test(e))return e!==e.toLowerCase()}function zo(e){let t=[],n=``,r,i;for(let a of e){let e=Lo.includes(a);if(e===!0){t.push(n),n=``,r=void 0;continue}let o=Ro(a);if(i===!1){if(r===!1&&o===!0){t.push(n),n=a,r=o;continue}if(r===!0&&o===!1&&n.length>1){let e=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=e+a,r=o;continue}}n+=a,r=o,i=e}return t.push(n),t}function Bo(e){return e?zo(e).map(e=>Ho(e)).join(``):``}function Vo(e){return Uo(Bo(e||``))}function Ho(e){return e?e[0].toUpperCase()+e.slice(1):``}function Uo(e){return e?e[0].toLowerCase()+e.slice(1):``}function Wo(e){if(!e)return{};let t={};function n(e,n){if(e.startsWith(`-moz-`)||e.startsWith(`-webkit-`)||e.startsWith(`-ms-`)||e.startsWith(`-o-`)){t[Bo(e)]=n;return}if(e.startsWith(`--`)){t[e]=n;return}t[Vo(e)]=n}return Fo(e,n),t}function Go(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function Ko(e,t){let n=RegExp(e,`g`);return e=>{if(typeof e!=`string`)throw TypeError(`expected an argument of type string, but got ${typeof e}`);return e.match(n)?e.replace(n,t):e}}var qo=Ko(/[A-Z]/,e=>`-${e.toLowerCase()}`);function Jo(e){if(!e||typeof e!=`object`||Array.isArray(e))throw TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${qo(t)}: ${e[t]};`).join(`\n`)}function Yo(e={}){return Jo(e).replace(`\n`,` `)}var Xo=new Set(`onabort.onanimationcancel.onanimationend.onanimationiteration.onanimationstart.onauxclick.onbeforeinput.onbeforetoggle.onblur.oncancel.oncanplay.oncanplaythrough.onchange.onclick.onclose.oncompositionend.oncompositionstart.oncompositionupdate.oncontextlost.oncontextmenu.oncontextrestored.oncopy.oncuechange.oncut.ondblclick.ondrag.ondragend.ondragenter.ondragleave.ondragover.ondragstart.ondrop.ondurationchange.onemptied.onended.onerror.onfocus.onfocusin.onfocusout.onformdata.ongotpointercapture.oninput.oninvalid.onkeydown.onkeypress.onkeyup.onload.onloadeddata.onloadedmetadata.onloadstart.onlostpointercapture.onmousedown.onmouseenter.onmouseleave.onmousemove.onmouseout.onmouseover.onmouseup.onpaste.onpause.onplay.onplaying.onpointercancel.onpointerdown.onpointerenter.onpointerleave.onpointermove.onpointerout.onpointerover.onpointerup.onprogress.onratechange.onreset.onresize.onscroll.onscrollend.onsecuritypolicyviolation.onseeked.onseeking.onselect.onselectionchange.onselectstart.onslotchange.onstalled.onsubmit.onsuspend.ontimeupdate.ontoggle.ontouchcancel.ontouchend.ontouchmove.ontouchstart.ontransitioncancel.ontransitionend.ontransitionrun.ontransitionstart.onvolumechange.onwaiting.onwebkitanimationend.onwebkitanimationiteration.onwebkitanimationstart.onwebkittransitionend.onwheel`.split(`.`));function Zo(e){return Xo.has(e)}function Qo(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];if(r){for(let e of Object.keys(r)){let n=t[e],i=r[e],a=typeof n==`function`,o=typeof i==`function`;if(a&&typeof o&&Zo(e))t[e]=vo(n,i);else if(a&&o)t[e]=Go(n,i);else if(e===`class`){let r=po(n),a=po(i);r&&a?t[e]=Di(n,i):r?t[e]=Di(n):a&&(t[e]=Di(i))}else if(e===`style`){let r=typeof n==`object`,a=typeof i==`object`,o=typeof n==`string`,s=typeof i==`string`;if(r&&a)t[e]={...n,...i};else if(r&&s){let r=Wo(i);t[e]={...n,...r}}else if(o&&a)t[e]={...Wo(n),...i};else if(o&&s){let r=Wo(n),a=Wo(i);t[e]={...r,...a}}else r?t[e]=n:a?t[e]=i:o?t[e]=n:s&&(t[e]=i)}else t[e]=i===void 0?n:i}for(let e of Object.getOwnPropertySymbols(r)){let n=t[e],i=r[e];t[e]=i===void 0?n:i}}}return typeof t.style==`object`&&(t.style=Yo(t.style).replaceAll(`\n`,` `)),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}var $o=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function es(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var ts=class extends Map{#e=new Map;#t=P(0);#n=P(0);#r=br||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return br===this.#r?P(e):on(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else return H(this.#t),!1;return H(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else{H(this.#t);return}return H(n),super.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),F(this.#n,super.size),un(o);else if(i!==t){un(r);var s=o.reactions===null?null:new Set(o.reactions);(s===null||!r.reactions?.every(e=>s.has(e)))&&un(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),F(n,-1)),r&&(F(this.#n,super.size),un(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;F(this.#n,0);for(var t of e.values())F(t,-1);un(this.#t),e.clear()}}#a(){H(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)H(n)}keys(){return H(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return H(this.#n),super.size}};new class{#e;#t;constructor(e={}){let{window:t=$o,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=vt(e=>{let n=Jr(t,`focusin`,e),r=Jr(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?es(this.#e):null}};var ns=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return et(this.#t)}get(){let e=Qe(this.#t);if(e===void 0)throw Error(`Context "${this.#e}" not found`);return e}getOr(e){let t=Qe(this.#t);return t===void 0?e:t}set(e){return $e(this.#t,e)}};function rs(e,t){switch(e){case`post`:Ln(t);break;case`pre`:zn(t);break}}function is(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;rs(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=Mr(()=>n(t,o));return o=t,r})}function as(e,t,n){let r=Bn(()=>{let i=!1;is(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});Ln(()=>r)}function os(e,t,n){is(e,`post`,t,n)}function ss(e,t,n){is(e,`pre`,t,n)}os.pre=ss;function cs(e,t){as(e,`post`,t)}function ls(e,t){as(e,`pre`,t)}cs.pre=ls;function us(e,t){let n,r=null;return(...i)=>new Promise(a=>{r&&r(void 0),r=a,clearTimeout(n),n=setTimeout(async()=>{let t=await e(...i);r&&=(r(t),null)},t)})}function ds(e,t){let n=0,r=null;return(...i)=>{let a=Date.now();return n&&a-n<t?r??Promise.resolve(void 0):(n=a,r=e(...i),r)}}function fs(e,t,n={},r){let{lazy:i=!1,once:a=!1,initialValue:o,debounce:s,throttle:c}=n,l=P(fn(o)),u=P(!1),d=P(void 0),f=P(fn([])),p=()=>{H(f).forEach(e=>e()),F(f,[],!0)},m=e=>{F(f,[...H(f),e],!0)},h=async(e,n,r=!1)=>{try{F(u,!0),F(d,void 0),p();let i=new AbortController;m(()=>i.abort());let a=await t(e,n,{data:H(l),refetching:r,onCleanup:m,signal:i.signal});return F(l,a,!0),a}catch(e){e instanceof DOMException&&e.name===`AbortError`||F(d,e,!0);return}finally{F(u,!1)}},g=s?us(h,s):c?ds(h,c):h,_=Array.isArray(e)?e:[e],v;return r((t,n)=>{a&&v||(v=t,g(Array.isArray(e)?t:t[0],Array.isArray(e)?n:n?.[0]))},{lazy:i}),{get current(){return H(l)},get loading(){return H(u)},get error(){return H(d)},mutate:e=>{F(l,e,!0)},refetch:t=>{let n=_.map(e=>e());return g(Array.isArray(e)?n:n[0],Array.isArray(e)?n:n[0],t??!0)}}}function ps(e,t,n){return fs(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];os(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}function ms(e,t,n){return fs(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];os.pre(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}ps.pre=ms;function hs(e){Ln(()=>()=>{e()})}function gs(e,t){return setTimeout(t,e)}function _s(e){kr().then(e)}var vs=1,ys=9,bs=11;function xs(e){return uo(e)&&e.nodeType===vs&&typeof e.nodeName==`string`}function Ss(e){return uo(e)&&e.nodeType===ys}function Cs(e){return uo(e)&&e.constructor?.name===`VisualViewport`}function ws(e){return uo(e)&&e.nodeType!==void 0}function Ts(e){return ws(e)&&e.nodeType===bs&&`host`in e}function Es(e,t){if(!e||!t||!xs(e)||!xs(t))return!1;let n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&Ts(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ds(e){return Ss(e)?e:Cs(e)?e.document:e?.ownerDocument??document}function Os(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var ks=class{element;#e=M(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return H(this.#e)}set root(e){F(this.#e,e)}constructor(e){typeof e==`function`?this.element=$(e):this.element=e}getDocument=()=>Ds(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>Os(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)};function As(e,t){return{[Nr()]:n=>go(e)?(e.current=n,Mr(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e.current=null,t?.(null))}):(e(n),Mr(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e(null),t?.(null))})}}function js(e){return e?``:void 0}function Ms(e){return e?`open`:`closed`}function Ns(e){return e===`starting`?{"data-starting-style":``}:e===`ending`?{"data-ending-style":``}:{}}var Ps=class{#e;#t;attrs;constructor(e){this.#e=e.getVariant?e.getVariant():null,this.#t=this.#e?`data-${this.#e}-`:`data-${e.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(e.parts.map(e=>[e,this.getAttr(e)]))}getAttr(e,t){return t?`data-${t}-${e}`:`${this.#t}${e}`}selector(e,t){return`[${this.getAttr(e,t)}]`}};function Fs(e){let t=new Ps(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}var Is=typeof document<`u`,Ls=Rs();function Rs(){return Is&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function zs(e){return e instanceof HTMLElement}function Bs(e){return e instanceof Element||e instanceof SVGElement}var Vs=class{#e;#t=null;#n=null;#r=0;constructor(e){this.#e=e,hs(()=>this.#i())}#i(){this.#t!==null&&(window.cancelAnimationFrame(this.#t),this.#t=null),this.#n?.disconnect(),this.#n=null,this.#r++}run(e){this.#i();let t=this.#e.ref.current;if(!t)return;if(typeof t.getAnimations!=`function`){this.#a(e);return}let n=this.#r,r=()=>{n===this.#r&&this.#a(e)},i=()=>{if(n!==this.#r)return;let e=t.getAnimations();if(e.length===0){r();return}Promise.all(e.map(e=>e.finished)).then(()=>{r()}).catch(()=>{if(n===this.#r){if(t.getAnimations().some(e=>e.pending||e.playState!==`finished`)){i();return}r()}})},a=()=>{this.#t=window.requestAnimationFrame(()=>{this.#t=null,i()})};if(!this.#e.afterTick.current){a();return}this.#t=window.requestAnimationFrame(()=>{this.#t=null;let e=`data-starting-style`;if(!t.hasAttribute(e)){a();return}this.#n=new MutationObserver(()=>{n===this.#r&&(t.hasAttribute(e)||(this.#n?.disconnect(),this.#n=null,a()))}),this.#n.observe(t,{attributes:!0,attributeFilter:[e]})})}#a(e){let t=()=>{e()};this.#e.afterTick?_s(t):t()}},Hs=class{#e;#t;#n;#r=P(!1);#i=P(void 0);#a=!1;#o=null;constructor(e){this.#e=e,F(this.#r,e.open.current,!0),this.#t=e.enabled??!0,this.#n=new Vs({ref:this.#e.ref,afterTick:this.#e.open}),hs(()=>this.#s()),os(()=>this.#e.open.current,e=>{if(!this.#a){this.#a=!0;return}if(this.#s(),!e&&this.#e.shouldSkipExitAnimation?.()){F(this.#r,!1),F(this.#i,void 0),this.#e.onComplete?.();return}if(e&&F(this.#r,!0),F(this.#i,e?`starting`:`ending`,!0),e&&(this.#o=window.requestAnimationFrame(()=>{this.#o=null,this.#e.open.current&&F(this.#i,void 0)})),!this.#t){e||F(this.#r,!1),F(this.#i,void 0),this.#e.onComplete?.();return}this.#n.run(()=>{e===this.#e.open.current&&(this.#e.open.current||F(this.#r,!1),F(this.#i,void 0),this.#e.onComplete?.())})})}get shouldRender(){return H(this.#r)}get transitionStatus(){return H(this.#i)}#s(){this.#o!==null&&(window.cancelAnimationFrame(this.#o),this.#o=null)}};function Us(){}function Ws(e,t){return t===void 0?`bits-${e}`:`bits-${e}-${t}`}var Gs=Fs({component:`dialog`,parts:[`content`,`trigger`,`overlay`,`title`,`description`,`close`,`cancel`,`action`]}),Ks=new ns(`Dialog.Root | AlertDialog.Root`),qs=class e{static create(t){let n=Ks.getOr(null);return Ks.set(new e(t,n))}opts;#e=P(null);get triggerNode(){return H(this.#e)}set triggerNode(e){F(this.#e,e,!0)}#t=P(null);get contentNode(){return H(this.#t)}set contentNode(e){F(this.#t,e,!0)}#n=P(null);get overlayNode(){return H(this.#n)}set overlayNode(e){F(this.#n,e,!0)}#r=P(null);get descriptionNode(){return H(this.#r)}set descriptionNode(e){F(this.#r,e,!0)}#i=P(void 0);get contentId(){return H(this.#i)}set contentId(e){F(this.#i,e,!0)}#a=P(void 0);get titleId(){return H(this.#a)}set titleId(e){F(this.#a,e,!0)}#o=P(void 0);get triggerId(){return H(this.#o)}set triggerId(e){F(this.#o,e,!0)}#s=P(void 0);get descriptionId(){return H(this.#s)}set descriptionId(e){F(this.#s,e,!0)}#c=P(null);get cancelNode(){return H(this.#c)}set cancelNode(e){F(this.#c,e,!0)}#l=P(0);get nestedOpenCount(){return H(this.#l)}set nestedOpenCount(e){F(this.#l,e,!0)}depth;parent;contentPresence;overlayPresence;constructor(e,t){this.opts=e,this.parent=t,this.depth=t?t.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new Hs({ref:$(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new Hs({ref:$(()=>this.overlayNode),open:this.opts.open,enabled:!0}),os(()=>this.opts.open.current,e=>{this.parent&&(e?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),hs(()=>{this.opts.open.current&&this.parent?.decrementNested()})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=e=>Gs.getAttr(e,this.opts.variant.current);incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}#u=M(()=>({"data-state":Ms(this.opts.open.current)}));get sharedProps(){return H(this.#u)}set sharedProps(e){F(this.#u,e)}},Js=class e{static create(t){return new e(t,Ks.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=As(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),this.root.handleClose())}#e=M(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:``,onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return H(this.#e)}set props(e){F(this.#e,e)}},Ys=class e{static create(t){return new e(t,Ks.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.titleId=this.opts.id.current,this.attachment=As(this.opts.ref),os.pre(()=>this.opts.id.current,e=>{this.root.titleId=e})}#e=M(()=>({id:this.opts.id.current,role:`heading`,"aria-level":this.opts.level.current,[this.root.getBitsAttr(`title`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return H(this.#e)}set props(e){F(this.#e,e)}},Xs=class e{static create(t){return new e(t,Ks.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.descriptionId=this.opts.id.current,this.attachment=As(this.opts.ref,e=>{this.root.descriptionNode=e}),os.pre(()=>this.opts.id.current,e=>{this.root.descriptionId=e})}#e=M(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`description`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return H(this.#e)}set props(e){F(this.#e,e)}},Zs=class e{static create(t){return new e(t,Ks.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=As(this.opts.ref,e=>{this.root.contentNode=e,this.root.contentId=e?.id})}#e=M(()=>({open:this.root.opts.open.current}));get snippetProps(){return H(this.#e)}set snippetProps(e){F(this.#e,e)}#t=M(()=>({id:this.opts.id.current,role:this.root.opts.variant.current===`alert-dialog`?`alertdialog`:`dialog`,"aria-modal":`true`,"aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr(`content`)]:``,style:{pointerEvents:`auto`,outline:this.root.opts.variant.current===`alert-dialog`?`none`:void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:`layout style`},tabindex:this.root.opts.variant.current===`alert-dialog`?-1:void 0,"data-nested-open":js(this.root.nestedOpenCount>0),"data-nested":js(this.root.parent!==null),...Ns(this.root.contentPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return H(this.#t)}set props(e){F(this.#t,e)}get shouldRender(){return this.root.contentPresence.shouldRender}},Qs=class e{static create(t){return new e(t,Ks.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=As(this.opts.ref,e=>this.root.overlayNode=e)}#e=M(()=>({open:this.root.opts.open.current}));get snippetProps(){return H(this.#e)}set snippetProps(e){F(this.#e,e)}#t=M(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`overlay`)]:``,style:{pointerEvents:`auto`,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":js(this.root.nestedOpenCount>0),"data-nested":js(this.root.parent!==null),...Ns(this.root.overlayPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return H(this.#t)}set props(e){F(this.#t,e)}get shouldRender(){return this.root.overlayPresence.shouldRender}},$s=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`level`]),ec=U(`<div><!></div>`);function tc(e,t){let n=oi();k(t,!0);let r=Z(t,`id`,19,()=>Ws(n)),i=Z(t,`ref`,15,null),a=Z(t,`level`,3,2),o=oa(t,$s),s=Ys.create({id:$(()=>r()),level:$(()=>a()),ref:$(()=>i(),e=>i(e))}),c=M(()=>Qo(o,s.props));var l=W(),u=L(l),d=e=>{var n=W();Y(L(n),()=>t.child,()=>({props:H(c)})),G(e,n)},p=e=>{var n=ec();Qi(n,()=>({...H(c)})),Y(I(n),()=>t.children??f),E(n),G(e,n)};q(u,e=>{t.child?e(d):e(p,-1)}),G(e,l),A()}function nc(e,t){var n=W();mi(L(n),()=>t.children,e=>{var n=W();Y(L(n),()=>t.children??f),G(e,n)}),G(e,n)}var rc=new ns(`BitsConfig`);function ic(){let e=new ac(null,{});return rc.getOr(e).opts}var ac=class{opts;constructor(e,t){let n=oc(e,t);this.opts={defaultPortalTo:n(e=>e.defaultPortalTo),defaultLocale:n(e=>e.defaultLocale)}}};function oc(e,t){return n=>$(()=>{let r=n(t)?.current;if(r!==void 0)return r;if(e!==null)return n(e.opts)?.current})}function sc(e,t){return n=>{let r=ic();return $(()=>{let i=n();if(i!==void 0)return i;let a=e(r).current;return a===void 0?t:a})}}var cc=sc(e=>e.defaultPortalTo,`body`);function lc(e,t){k(t,!0);let n=cc(()=>t.to),r=tt(),i=M(a);function a(){if(!Is||t.disabled)return null;let e=null;return e=typeof n.current==`string`?document.querySelector(n.current):n.current,e}let o;function s(){o&&=(di(o),null)}os([()=>H(i),()=>t.disabled],([e,n])=>{if(!e||n){s();return}return o=si(nc,{target:e,props:{children:t.children},context:r}),()=>{s()}});var c=W(),l=L(c),u=e=>{var n=W();Y(L(n),()=>t.children??f),G(e,n)};q(l,e=>{t.disabled&&e(u)}),G(e,c),A()}var uc=class{eventName;options;constructor(e,t={bubbles:!0,cancelable:!0}){this.eventName=e,this.options=t}createEvent(e){return new CustomEvent(this.eventName,{...this.options,detail:e})}dispatch(e,t){let n=this.createEvent(t);return e.dispatchEvent(n),n}listen(e,t,n){return Jr(e,this.eventName,e=>{t(e)},n)}};function dc(e,t=500){let n=null,r=(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function fc(e,t){return e===t||e.contains(t)}function pc(e){return e?.ownerDocument??document}function mc(e,t){let{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return n<i.left||n>i.right||r<i.top||r>i.bottom}var hc=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],gc=hc.join(`,`),_c=typeof Element>`u`,vc=_c?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,yc=!_c&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},bc=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):bc(e.parentNode))},xc=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},Sc=function(e,t,n){if(bc(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(gc));return t&&vc.call(e,gc)&&r.unshift(e),r=r.filter(n),r},Cc=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!bc(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=Cc(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{vc.call(a,gc)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!bc(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=Cc(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},wc=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Tc=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||xc(e))&&!wc(e)?0:e.tabIndex},Ec=function(e,t){var n=Tc(e);return n<0&&t&&!wc(e)?0:n},Dc=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Oc=function(e){return e.tagName===`INPUT`},kc=function(e){return Oc(e)&&e.type===`hidden`},Ac=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},jc=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Mc=function(e){if(!e.name)return!0;var t=e.form||yc(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=jc(r,e.form);return!i||i===e},Nc=function(e){return Oc(e)&&e.type===`radio`},Pc=function(e){return Nc(e)&&!Mc(e)},Fc=function(e){var t=e&&yc(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=yc(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Ic=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Lc=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=vc.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(vc.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=yc(e);if(o&&!o.shadowRoot&&r(o)===!0)return Ic(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Fc(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Ic(e);return!1},Rc=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return vc.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},zc=function(e,t){return!(t.disabled||kc(t)||Lc(t,e)||Ac(t)||Rc(t))},Bc=function(e,t){return!(Pc(t)||Tc(t)<0||!zc(e,t))},Vc=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Hc=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Ec(a,i),s=i?Hc(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Dc).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Uc=function(e,t){return t||={},Hc(t.getShadowRoot?Cc([e],t.includeContainer,{filter:Bc.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Vc}):Sc(e,t.includeContainer,Bc.bind(null,t)))},Wc=function(e,t){return t||={},t.getShadowRoot?Cc([e],t.includeContainer,{filter:zc.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Sc(e,t.includeContainer,zc.bind(null,t))},Gc=hc.concat(`iframe:not([inert]):not([inert] *)`).join(`,`),Kc=function(e,t){if(t||={},!e)throw Error(`No node provided`);return vc.call(e,Gc)===!1?!1:zc(t,e)},qc=`data-context-menu-trigger`,Jc=`data-context-menu-content`;new ns(`Menu.Root`),new ns(`Menu.Root | Menu.Sub`),new ns(`Menu.Content`),new ns(`Menu.Group | Menu.RadioGroup`),new ns(`Menu.RadioGroup`),new ns(`Menu.CheckboxGroup`),new uc(`bitsmenuopen`,{bubbles:!1,cancelable:!0}),Fs({component:`menu`,parts:[`trigger`,`content`,`sub-trigger`,`item`,`group`,`group-heading`,`checkbox-group`,`checkbox-item`,`radio-group`,`radio-item`,`separator`,`sub-content`,`arrow`]}),globalThis.bitsDismissableLayers??=new Map;var Yc=class e{static create(t){return new e(t)}opts;#e;#t;#n={pointerdown:!1};#r=!1;#i=!1;#a=void 0;#o;#s=Us;constructor(e){this.opts=e,this.#t=e.interactOutsideBehavior,this.#e=e.onInteractOutside,this.#o=e.onFocusOutside,Ln(()=>{this.#a=pc(this.opts.ref.current)});let t=Us,n=()=>{this.#g(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),t()};os([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return gs(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#t),t(),t=this.#l())}),n}),hs(()=>{this.#g.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#s(),t()})}#c=e=>{e.defaultPrevented||this.opts.ref.current&&_s(()=>{!this.opts.ref.current||this.#h(e.target)||e.target&&!this.#i&&this.#o.current?.(e)})};#l(){return Go(Jr(this.#a,`pointerdown`,Go(this.#f,this.#m),{capture:!0}),Jr(this.#a,`pointerdown`,Go(this.#p,this.#d)),Jr(this.#a,`focusin`,this.#c))}#u=e=>{let t=e;t.defaultPrevented&&(t=$c(e)),this.#e.current(e)};#d=dc(e=>{if(!this.opts.ref.current){this.#s();return}let t=this.opts.isValidEvent.current(e,this.opts.ref.current)||Qc(e,this.opts.ref.current);if(!this.#r||this.#_()||!t){this.#s();return}let n=e;if(n.defaultPrevented&&(n=$c(n)),this.#t.current!==`close`&&this.#t.current!==`defer-otherwise-close`){this.#s();return}e.pointerType===`touch`?(this.#s(),this.#s=Jr(this.#a,`click`,this.#u,{once:!0})):this.#e.current(n)},10);#f=e=>{this.#n[e.type]=!0};#p=e=>{this.#n[e.type]=!1};#m=()=>{this.opts.ref.current&&(this.#r=Zc(this.opts.ref.current))};#h=e=>this.opts.ref.current?fc(this.opts.ref.current,e):!1;#g=dc(()=>{for(let e in this.#n)this.#n[e]=!1;this.#r=!1},20);#_(){return Object.values(this.#n).some(Boolean)}#v=()=>{this.#i=!0};#y=()=>{this.#i=!1};props={onfocuscapture:this.#v,onblurcapture:this.#y}};function Xc(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([e,{current:t}])=>t===`close`||t===`ignore`)}function Zc(e){let t=[...globalThis.bitsDismissableLayers],n=Xc(t);if(n)return n[0].opts.ref.current===e;let[r]=t[0];return r.opts.ref.current===e}function Qc(e,t){let n=e.target;if(!Bs(n))return!1;let r=!!n.closest(`[${qc}]`),i=!!t.closest(`[${Jc}]`);return`button`in e&&e.button>0&&!r?!1:`button`in e&&e.button===0&&r&&i?!0:r&&i?!1:pc(n).documentElement.contains(n)&&!fc(t,n)&&mc(e,t)}function $c(e){let t=e.currentTarget,n=e.target,r;r=e instanceof PointerEvent?new PointerEvent(e.type,e):new PointerEvent(`pointerdown`,e);let i=!1;return new Proxy(r,{get:(r,a)=>a===`currentTarget`?t:a===`target`?n:a===`preventDefault`?()=>{i=!0,typeof r.preventDefault==`function`&&r.preventDefault()}:a===`defaultPrevented`?i:a in r?r[a]:e[a]})}function el(e,t){k(t,!0);let n=Z(t,`interactOutsideBehavior`,3,`close`),r=Z(t,`onInteractOutside`,3,Us),i=Z(t,`onFocusOutside`,3,Us),a=Z(t,`isValidEvent`,3,()=>!1),o=Yc.create({id:$(()=>t.id),interactOutsideBehavior:$(()=>n()),onInteractOutside:$(()=>r()),enabled:$(()=>t.enabled),onFocusOutside:$(()=>i()),isValidEvent:$(()=>a()),ref:t.ref});var s=W();Y(L(s),()=>t.children??f,()=>({props:o.props})),G(e,s),A()}globalThis.bitsEscapeLayers??=new Map;var tl=class e{static create(t){return new e(t)}opts;domContext;constructor(e){this.opts=e,this.domContext=new ks(this.opts.ref);let t=Us;os(()=>e.enabled.current,n=>(n&&(globalThis.bitsEscapeLayers.set(this,e.escapeKeydownBehavior),t=this.#e()),()=>{t(),globalThis.bitsEscapeLayers.delete(this)}))}#e=()=>Jr(this.domContext.getDocument(),`keydown`,this.#t,{passive:!1});#t=e=>{if(e.key!==`Escape`||!nl(this))return;let t=new KeyboardEvent(e.type,e);e.preventDefault();let n=this.opts.escapeKeydownBehavior.current;n!==`close`&&n!==`defer-otherwise-close`||this.opts.onEscapeKeydown.current(t)}};function nl(e){let t=[...globalThis.bitsEscapeLayers],n=t.findLast(([e,{current:t}])=>t===`close`||t===`ignore`);if(n)return n[0]===e;let[r]=t[0];return r===e}function rl(e,t){k(t,!0);let n=Z(t,`escapeKeydownBehavior`,3,`close`),r=Z(t,`onEscapeKeydown`,3,Us);tl.create({escapeKeydownBehavior:$(()=>n()),onEscapeKeydown:$(()=>r()),enabled:$(()=>t.enabled),ref:t.ref});var i=W();Y(L(i),()=>t.children??f),G(e,i),A()}var il=class e{static instance;#e=_o([]);#t=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||=new e,this.instance}register(e){let t=this.getActive();t&&t!==e&&t.pause();let n=document.activeElement;n&&n!==document.body&&this.#n.set(e,n),this.#e.current=this.#e.current.filter(t=>t!==e),this.#e.current.unshift(e)}unregister(e){this.#e.current=this.#e.current.filter(t=>t!==e);let t=this.getActive();t&&t.resume()}getActive(){return this.#e.current[0]}setFocusMemory(e,t){this.#t.set(e,t)}getFocusMemory(e){return this.#t.get(e)}isActiveScope(e){return this.getActive()===e}setPreFocusMemory(e,t){this.#n.set(e,t)}getPreFocusMemory(e){return this.#n.get(e)}clearPreFocusMemory(e){this.#n.delete(e)}},al=class e{#e=!1;#t=null;#n=il.getInstance();#r=[];#i;constructor(e){this.#i=e}get paused(){return this.#e}pause(){this.#e=!0}resume(){this.#e=!1}#a(){for(let e of this.#r)e();this.#r=[]}mount(e){this.#t&&this.unmount(),this.#t=e,this.#n.register(this),this.#c(),this.#o()}unmount(){this.#t&&=(this.#a(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),null)}#o(){if(!this.#t)return;let e=new CustomEvent(`focusScope.onOpenAutoFocus`,{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(e),e.defaultPrevented||requestAnimationFrame(()=>{if(!this.#t)return;let e=this.#u();e?(e.focus(),this.#n.setFocusMemory(this,e)):this.#t.focus()})}#s(){let e=new CustomEvent(`focusScope.onCloseAutoFocus`,{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(e),!e.defaultPrevented){let e=this.#n.getPreFocusMemory(this);if(e&&document.contains(e))try{e.focus()}catch{document.body.focus()}}}#c(){if(!this.#t||!this.#i.trap.current)return;let e=this.#t,t=e.ownerDocument;this.#r.push(Jr(t,`focusin`,t=>{if(this.#e||!this.#n.isActiveScope(this))return;let n=t.target;if(n)if(e.contains(n))this.#n.setFocusMemory(this,n);else{let n=this.#n.getFocusMemory(this);if(n&&e.contains(n)&&Kc(n))t.preventDefault(),n.focus();else{let t=this.#u(),n=this.#d()[0];(t||n||e).focus()}}},{capture:!0}),Jr(e,`keydown`,e=>{if(!this.#i.loop||this.#e||e.key!==`Tab`||!this.#n.isActiveScope(this))return;let n=this.#l();if(n.length===0)return;let r=n[0],i=n[n.length-1];!e.shiftKey&&t.activeElement===i?(e.preventDefault(),r.focus()):e.shiftKey&&t.activeElement===r&&(e.preventDefault(),i.focus())}));let n=new MutationObserver(()=>{let t=this.#n.getFocusMemory(this);if(t&&!e.contains(t)){let t=this.#u(),n=this.#d()[0],r=t||n;r?(r.focus(),this.#n.setFocusMemory(this,r)):e.focus()}});n.observe(e,{childList:!0,subtree:!0}),this.#r.push(()=>n.disconnect())}#l(){return this.#t?Uc(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#l()[0]||null}#d(){return this.#t?Wc(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return os([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(n||=new e(t),n.mount(r)):n&&=(n.unmount(),null)}),hs(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}};function ol(e,t){k(t,!0);let n=Z(t,`enabled`,3,!1),r=Z(t,`trapFocus`,3,!1),i=Z(t,`loop`,3,!1),a=Z(t,`onCloseAutoFocus`,3,Us),o=Z(t,`onOpenAutoFocus`,3,Us),s=al.use({enabled:$(()=>n()),trap:$(()=>r()),loop:i(),onCloseAutoFocus:$(()=>a()),onOpenAutoFocus:$(()=>o()),ref:t.ref});var c=W();Y(L(c),()=>t.focusScope??f,()=>({props:s.props})),G(e,c),A()}var sl=()=>{};globalThis.bitsTextSelectionLayers??=new Map;var cl=class e{static create(t){return new e(t)}opts;domContext;#e=Us;#t=!1;#n=sl;#r=sl;constructor(e){this.opts=e,this.domContext=new ks(e.ref);let t=Us;os(()=>[this.opts.enabled.current,this.opts.onPointerDown.current,this.opts.onPointerUp.current],([e,n,r])=>(this.#t=e,this.#n=n,this.#r=r,e&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),t(),t=this.#i()),()=>{this.#t=!1,t(),this.#s(),globalThis.bitsTextSelectionLayers.delete(this)}))}#i(){return Go(Jr(this.domContext.getDocument(),`pointerdown`,this.#o),Jr(this.domContext.getDocument(),`pointerup`,vo(this.#s,this.#a)))}#a=e=>{this.#r(e)};#o=e=>{let t=this.opts.ref.current,n=e.target;!zs(t)||!zs(n)||!this.#t||!fl(this)||!Es(t,n)||(this.#n(e),!e.defaultPrevented&&(this.#e=ul(t,this.domContext.getDocument().body)))};#s=()=>{this.#e(),this.#e=Us}},ll=e=>e.style.userSelect||e.style.webkitUserSelect;function ul(e,t){let n=ll(t),r=ll(e);return dl(t,`none`),dl(e,`text`),()=>{dl(t,n),dl(e,r)}}function dl(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function fl(e){let t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;let n=t.at(-1);return n?n[0]===e:!1}function pl(e,t){k(t,!0);let n=Z(t,`preventOverflowTextSelection`,3,!0),r=Z(t,`onPointerDown`,3,Us),i=Z(t,`onPointerUp`,3,Us);cl.create({id:$(()=>t.id),onPointerDown:$(()=>r()),onPointerUp:$(()=>i()),enabled:$(()=>t.enabled&&n()),ref:t.ref});var a=W();Y(L(a),()=>t.children??f),G(e,a),A()}globalThis.bitsIdCounter??={current:0};function ml(e=`bits`){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}var hl=class{#e;#t=0;#n=P();#r;constructor(e){this.#e=e}#i(){--this.#t,this.#r&&this.#t<=0&&(this.#r(),F(this.#n,void 0),this.#r=void 0)}get(...e){return this.#t+=1,H(this.#n)===void 0&&(this.#r=Bn(()=>{F(this.#n,this.#e(...e),!0)})),Ln(()=>()=>{this.#i()}),H(this.#n)}},gl=new ts,_l=P(null),vl=null,yl=null,bl=!1,xl=$(()=>{for(let e of gl.values())if(e)return!0;return!1}),Sl=null,Cl=new hl(()=>{function e(){document.body.setAttribute(`style`,H(_l)??``),document.body.style.removeProperty(`--scrollbar-width`),Ls&&vl?.(),F(_l,null)}function t(){yl!==null&&(window.clearTimeout(yl),yl=null)}function n(e,n){t(),bl=!0,Sl=Date.now();let r=Sl,i=()=>{yl=null,Sl===r&&(Tl(gl)?bl=!1:(bl=!1,n()))},a=e===null?24:e;yl=window.setTimeout(i,a)}function r(){H(_l)===null&&gl.size===0&&!bl&&F(_l,document.body.getAttribute(`style`),!0)}return os(()=>xl.current,()=>{if(!xl.current)return;r(),bl=!1;let e=getComputedStyle(document.documentElement),t=getComputedStyle(document.body),n=e.scrollbarGutter?.includes(`stable`)||t.scrollbarGutter?.includes(`stable`),i=window.innerWidth-document.documentElement.clientWidth,a={padding:Number.parseInt(t.paddingRight??`0`,10)+i,margin:Number.parseInt(t.marginRight??`0`,10)};i>0&&!n&&(document.body.style.paddingRight=`${a.padding}px`,document.body.style.marginRight=`${a.margin}px`,document.body.style.setProperty(`--scrollbar-width`,`${i}px`)),document.body.style.overflow=`hidden`,Ls&&(vl=Jr(document,`touchmove`,e=>{e.target===document.documentElement&&(e.touches.length>1||e.preventDefault())},{passive:!1})),_s(()=>{document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`})}),hs(()=>()=>{vl?.()}),{get lockMap(){return gl},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}}),wl=class{#e=ml();#t;#n=()=>null;#r;locked;constructor(e,t=()=>null){this.#t=e,this.#n=t,this.#r=Cl.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#e,this.#t??!1),this.locked=$(()=>this.#r.lockMap.get(this.#e)??!1,e=>this.#r.lockMap.set(this.#e,e)),hs(()=>{if(this.#r.lockMap.delete(this.#e),Tl(this.#r.lockMap))return;let e=this.#n();this.#r.scheduleCleanupIfNoNewLocks(e,()=>{this.#r.resetBodyStyle()})}))}};function Tl(e){for(let[t,n]of e)if(n)return!0;return!1}function El(e,t){k(t,!0);let n=Z(t,`preventScroll`,3,!0),r=Z(t,`restoreScrollDelay`,3,null);n()&&new wl(n(),()=>r()),A()}var Dl=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`forceMount`,`child`,`children`,`ref`]),Ol=U(`<div><!></div>`);function kl(e,t){let n=oi();k(t,!0);let r=Z(t,`id`,19,()=>Ws(n)),i=Z(t,`forceMount`,3,!1),a=Z(t,`ref`,15,null),o=oa(t,Dl),s=Qs.create({id:$(()=>r()),ref:$(()=>a(),e=>a(e))}),c=M(()=>Qo(o,s.props));var l=W(),u=L(l),d=e=>{var n=W(),r=L(n),i=e=>{var n=W(),r=L(n);{let e=M(()=>({props:Qo(H(c)),...s.snippetProps}));Y(r,()=>t.child,()=>H(e))}G(e,n)},a=e=>{var n=Ol();Qi(n,e=>({...e}),[()=>Qo(H(c))]),Y(I(n),()=>t.children??f,()=>s.snippetProps),E(n),G(e,n)};q(r,e=>{t.child?e(i):e(a,-1)}),G(e,n)};q(u,e=>{(s.shouldRender||i())&&e(d)}),G(e,l),A()}var Al=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`]),jl=U(`<div><!></div>`);function Ml(e,t){let n=oi();k(t,!0);let r=Z(t,`id`,19,()=>Ws(n)),i=Z(t,`ref`,15,null),a=oa(t,Al),o=Xs.create({id:$(()=>r()),ref:$(()=>i(),e=>i(e))}),s=M(()=>Qo(a,o.props));var c=W(),l=L(c),u=e=>{var n=W();Y(L(n),()=>t.child,()=>({props:H(s)})),G(e,n)},d=e=>{var n=jl();Qi(n,()=>({...H(s)})),Y(I(n),()=>t.children??f),E(n),G(e,n)};q(l,e=>{t.child?e(u):e(d,-1)}),G(e,c),A()}function Nl(e,t){k(t,!0);let n=Z(t,`open`,15,!1),r=Z(t,`onOpenChange`,3,Us),i=Z(t,`onOpenChangeComplete`,3,Us);qs.create({variant:$(()=>`dialog`),open:$(()=>n(),e=>{n(e),r()(e)}),onOpenChangeComplete:$(()=>i())});var a=W();Y(L(a),()=>t.children??f),G(e,a),A()}var Pl=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`disabled`]),Fl=U(`<button><!></button>`);function Il(e,t){let n=oi();k(t,!0);let r=Z(t,`id`,19,()=>Ws(n)),i=Z(t,`ref`,15,null),a=Z(t,`disabled`,3,!1),o=oa(t,Pl),s=Js.create({variant:$(()=>`close`),id:$(()=>r()),ref:$(()=>i(),e=>i(e)),disabled:$(()=>!!a())}),c=M(()=>Qo(o,s.props));var l=W(),u=L(l),d=e=>{var n=W();Y(L(n),()=>t.child,()=>({props:H(c)})),G(e,n)},p=e=>{var n=Fl();Qi(n,()=>({...H(c)})),Y(I(n),()=>t.children??f),E(n),G(e,n)};q(u,e=>{t.child?e(d):e(p,-1)}),G(e,l),A()}var Ll=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`,`forceMount`,`onCloseAutoFocus`,`onOpenAutoFocus`,`onEscapeKeydown`,`onInteractOutside`,`trapFocus`,`preventScroll`,`restoreScrollDelay`]),Rl=U(`<!> <!>`,1),zl=U(`<!> <div><!></div>`,1);function Bl(e,t){let n=oi();k(t,!0);let r=Z(t,`id`,19,()=>Ws(n)),i=Z(t,`ref`,15,null),a=Z(t,`forceMount`,3,!1),o=Z(t,`onCloseAutoFocus`,3,Us),s=Z(t,`onOpenAutoFocus`,3,Us),c=Z(t,`onEscapeKeydown`,3,Us),l=Z(t,`onInteractOutside`,3,Us),u=Z(t,`trapFocus`,3,!0),d=Z(t,`preventScroll`,3,!0),p=Z(t,`restoreScrollDelay`,3,null),m=oa(t,Ll),h=Zs.create({id:$(()=>r()),ref:$(()=>i(),e=>i(e))}),g=M(()=>Qo(m,h.props));var _=W(),v=L(_),y=e=>{ol(e,{get ref(){return h.opts.ref},loop:!0,get trapFocus(){return u()},get enabled(){return h.root.opts.open.current},get onOpenAutoFocus(){return s()},get onCloseAutoFocus(){return o()},focusScope:(e,n)=>{let r=()=>n?.().props;rl(e,ca(()=>H(g),{get enabled(){return h.root.opts.open.current},get ref(){return h.opts.ref},onEscapeKeydown:e=>{c()(e),!e.defaultPrevented&&h.root.handleClose()},children:(e,n)=>{el(e,ca(()=>H(g),{get ref(){return h.opts.ref},get enabled(){return h.root.opts.open.current},onInteractOutside:e=>{l()(e),!e.defaultPrevented&&h.root.handleClose()},children:(e,n)=>{pl(e,ca(()=>H(g),{get ref(){return h.opts.ref},get enabled(){return h.root.opts.open.current},children:(e,n)=>{var i=W(),a=L(i),o=e=>{var n=Rl(),i=L(n),a=e=>{El(e,{get preventScroll(){return d()},get restoreScrollDelay(){return p()}})};q(i,e=>{h.root.opts.open.current&&e(a)});var o=R(i,2);{let e=M(()=>({props:Qo(H(g),r()),...h.snippetProps}));Y(o,()=>t.child,()=>H(e))}G(e,n)},s=e=>{var n=zl(),i=L(n);El(i,{get preventScroll(){return d()}});var a=R(i,2);Qi(a,e=>({...e}),[()=>Qo(H(g),r())]),Y(I(a),()=>t.children??f),E(a),G(e,n)};q(a,e=>{t.child?e(o):e(s,-1)}),G(e,i)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};q(v,e=>{(h.shouldRender||a())&&e(y)}),G(e,_),A()}var Vl=U(`<button class="flex flex-col gap-1 text-left"><div class="flex items-center gap-2 font-mono text-sm"><span class="size-2 shrink-0 rounded-sm"></span> <span class="flex-1 truncate text-foreground"> </span> <span class="tabular-nums text-muted-foreground"> </span></div> <div class="h-1 overflow-hidden rounded-full bg-border"><div class="h-full"></div></div></button>`),Hl=U(`<div class="text-sm text-muted-foreground">No projects tracked yet \u2014 run <code class="text-foreground">syn .</code></div>`),Ul=U(`<div class="flex max-h-[260px] flex-col gap-2 overflow-y-auto pr-1"></div>`),Wl=U(`<div class="flex flex-col gap-0.5 bg-card p-3"><span class="font-mono text-[10px] uppercase tracking-[0.1em] text-muted-foreground"> </span> <span class="font-mono text-sm text-foreground"> </span></div>`),Gl=U(`<!> <!> <div class="mt-4 grid grid-cols-2 gap-px overflow-hidden rounded-lg border bg-border"></div> <!>`,1),Kl=U(`<!> <!>`,1);function ql(e,t){k(t,!0);let n=P(!1),r=P(null),i=M(()=>Q.data?.projects??[]),a=M(()=>Math.max(1,...H(i).map(e=>e.total_turns)));function o(e){let t=(Q.data?.recent_turns??[]).find(t=>t.project_path===e.path);return t?pa(t.ts):e.last_seen?pa(e.last_seen):`\u2014`}function s(e){return[[`Cost`,fa(e.estimated_cost_usd)],[`Turns`,da(e.total_turns)],[`Input`,da(e.total_input_tokens)],[`Output`,da(e.total_output_tokens)],[`Cache R`,da(e.total_cache_read)],[`Cache W`,da(e.total_cache_create)],[`Blocks`,da(e.blocked_count)],[`Last active`,o(e)]]}var c=Kl(),l=L(c);eo(l,{title:`Projects`,meta:`by turns`,children:(e,t)=>{var o=Ul();J(o,21,()=>H(i),e=>e.path,(e,t)=>{var i=Vl(),o=I(i),s=I(o),c=R(s,2),l=I(c,!0);E(c);var u=R(c,2),d=I(u,!0);E(u),E(o);var f=R(o,2),p=I(f);E(f),E(i),z((e,n,r)=>{Ii(s,e),K(l,H(t).name),K(d,n),Ii(p,r)},[()=>`background:${va(H(t).name)}`,()=>da(H(t).total_turns),()=>`width:${H(t).total_turns/H(a)*100}%; background:${va(H(t).name)}`]),Yr(`click`,i,()=>{F(r,H(t),!0),F(n,!0)}),G(e,i)},e=>{G(e,Hl())}),E(o),G(e,o)},$$slots:{default:!0}}),X(R(l,2),()=>Nl,(e,t)=>{t(e,{get open(){return H(n)},set open(e){F(n,e,!0)},children:(e,t)=>{var n=W();X(L(n),()=>lc,(e,t)=>{t(e,{children:(e,t)=>{var n=Kl(),i=L(n);X(i,()=>kl,(e,t)=>{t(e,{class:`fixed inset-0 z-50 bg-black/60`})}),X(R(i,2),()=>Bl,(e,t)=>{t(e,{class:`fixed left-1/2 top-1/2 z-50 w-[min(440px,92vw)] -translate-x-1/2 -translate-y-1/2 rounded-xl border bg-card p-5 text-card-foreground shadow-2xl`,children:(e,t)=>{var n=W(),i=L(n),a=e=>{var t=Gl(),n=L(t);{let e=M(()=>`color:${va(H(r).name)}`);X(n,()=>tc,(t,n)=>{n(t,{class:`font-serif text-xl`,get style(){return H(e)},children:(e,t)=>{D();var n=ai();z(()=>K(n,H(r).name)),G(e,n)},$$slots:{default:!0}})})}var i=R(n,2);X(i,()=>Ml,(e,t)=>{t(e,{class:`truncate font-mono text-xs text-muted-foreground`,children:(e,t)=>{D();var n=ai();z(()=>K(n,H(r).path)),G(e,n)},$$slots:{default:!0}})});var a=R(i,2);J(a,21,()=>s(H(r)),([e,t])=>e,(e,t)=>{var n=M(()=>h(H(t),2));let r=()=>H(n)[0],i=()=>H(n)[1];var a=Wl(),o=I(a),s=I(o,!0);E(o);var c=R(o,2),l=I(c,!0);E(c),E(a),z(()=>{K(s,r()),K(l,i())}),G(e,a)}),E(a),X(R(a,2),()=>Il,(e,t)=>{t(e,{class:`mt-4 w-full rounded-md border py-2 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:(e,t)=>{D(),G(e,ai(`Close`))},$$slots:{default:!0}})}),G(e,t)};q(i,e=>{H(r)&&e(a)}),G(e,n)},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}})}),G(e,c),A()}Xr([`click`]);var Jl=U(`<div class="flex items-baseline justify-between font-mono text-sm"><span class="text-muted-foreground"> </span> <span class="tabular-nums text-foreground"> </span></div>`),Yl=U(`<div class="text-sm text-muted-foreground">No graph-tool calls yet.</div>`),Xl=U(`<div class="font-mono text-2xl text-foreground"> <span class="text-sm text-muted-foreground">calls</span></div> <div class="flex flex-col gap-1.5"></div>`,1);function Zl(e,t){k(t,!0);let n=M(()=>{let e=Q.data?.global?.tool_calls??{};return Object.entries(e).sort((e,t)=>t[1]-e[1]).slice(0,8)}),r=M(()=>Q.data?.global?.total_tool_calls??0);eo(e,{title:`Graph tools used`,meta:`all projects`,children:(e,t)=>{var i=Xl(),a=L(i),o=I(a);D(),E(a);var s=R(a,2);J(s,21,()=>H(n),([e,t])=>e,(e,t)=>{var n=M(()=>h(H(t),2));let r=()=>H(n)[0],i=()=>H(n)[1];var a=Jl(),o=I(a),s=I(o,!0);E(o);var c=R(o,2),l=I(c,!0);E(c),E(a),z(()=>{K(s,r()),K(l,i())}),G(e,a)},e=>{G(e,Yl())}),E(s),z(e=>K(o,`${e??``} `),[()=>da(H(r))]),G(e,i)},$$slots:{default:!0}}),A()}var Ql=U(`<tr class="border-t border-border/60"><td class="py-1.5 pr-2 text-muted-foreground"> </td><td class="max-w-[120px] truncate py-1.5 pr-2 text-foreground"> </td><td class="py-1.5 pr-2"><span class="inline-flex items-center gap-1.5 rounded px-1.5 py-0.5"><span class="size-1.5 rounded-sm"></span> </span></td><td class="py-1.5 pr-2 text-right tabular-nums text-foreground"> </td><td class="py-1.5 pr-2 text-right tabular-nums text-foreground"> </td><td class="py-1.5 pr-2 text-right tabular-nums text-muted-foreground"> </td><td class="py-1.5 text-right tabular-nums text-[var(--money)]"> </td></tr>`),$l=U(`<tr><td colspan="7" class="py-6 text-center text-muted-foreground">No turns recorded yet.</td></tr>`),eu=U(`<div class="flex items-center justify-end gap-3 pt-1 font-mono text-sm text-muted-foreground"><button class="rounded border px-2 py-1 disabled:opacity-40 enabled:hover:text-foreground">\u2039 Prev</button> <span> </span> <button class="rounded border px-2 py-1 disabled:opacity-40 enabled:hover:text-foreground">Next \u203A</button></div>`),tu=U(`<div class="min-h-0 flex-1 overflow-x-auto"><table class="w-full border-collapse font-mono text-sm"><thead><tr class="text-left text-[10px] uppercase tracking-[0.1em] text-muted-foreground"><th class="py-1.5 pr-2 font-medium">Time</th><th class="py-1.5 pr-2 font-medium">Project</th><th class="py-1.5 pr-2 font-medium">Model</th><th class="py-1.5 pr-2 text-right font-medium">In</th><th class="py-1.5 pr-2 text-right font-medium">Out</th><th class="py-1.5 pr-2 text-right font-medium">Cache R/W</th><th class="py-1.5 text-right font-medium">Cost</th></tr></thead><tbody></tbody></table></div> <!>`,1);function nu(e,t){k(t,!0);let n=P(1),r=M(()=>Q.data?.recent_turns??[]),i=M(()=>Math.max(1,Math.ceil(H(r).length/25)));Ln(()=>{H(n)>H(i)&&F(n,H(i),!0)});let a=M(()=>H(r).slice((H(n)-1)*25,(H(n)-1)*25+25)),o=M(()=>H(r).length?(H(n)-1)*25+1:0),s=M(()=>Math.min(H(n)*25,H(r).length));{let t=M(()=>`showing ${H(o)}\u2013${H(s)} of ${H(r).length}`);eo(e,{title:`Recent turns`,get meta(){return H(t)},children:(e,t)=>{var r=tu(),o=L(r),s=I(o),c=R(I(s));J(c,21,()=>H(a),e=>e.ts+e.project_path+e.model,(e,t)=>{var n=Ql(),r=I(n),i=I(r,!0);E(r);var a=R(r),o=I(a,!0);E(a);var s=R(a),c=I(s),l=I(c),u=R(l);E(c),E(s);var d=R(s),f=I(d,!0);E(d);var p=R(d),m=I(p,!0);E(p);var h=R(p),g=I(h);E(h);var _=R(h),v=I(_,!0);E(_),E(n),z((e,n,r,s,d,p,h,_,y)=>{K(i,e),Xi(a,`title`,H(t).project_name),K(o,H(t).project_name),Ii(c,n),Ii(l,r),K(u,` ${s??``}`),K(f,d),K(m,p),K(g,`${h??``} / ${_??``}`),K(v,y)},[()=>pa(H(t).ts),()=>`color: var(--c-${ma(H(t).model)})`,()=>`background: var(--c-${ma(H(t).model)})`,()=>ha(H(t).model),()=>da(H(t).input),()=>da(H(t).output),()=>da(H(t).cache_read),()=>da(H(t).cache_create),()=>fa(H(t).cost_usd)]),G(e,n)},e=>{G(e,$l())}),E(c),E(s),E(o);var l=R(o,2),u=e=>{var t=eu(),r=I(t),a=R(r,2),o=I(a);E(a);var s=R(a,2);E(t),z(()=>{r.disabled=H(n)<=1,K(o,`page ${H(n)??``} of ${H(i)??``}`),s.disabled=H(n)>=H(i)}),Yr(`click`,r,()=>F(n,Math.max(1,H(n)-1),!0)),Yr(`click`,s,()=>F(n,Math.min(H(i),H(n)+1),!0)),G(e,t)};q(l,e=>{H(i)>1&&e(u)}),G(e,r)},$$slots:{default:!0}})}A()}Xr([`click`]);var ru=U(`<div class="font-mono text-xs text-muted-foreground" title="Codebase exploration via the terminal (rg / cat / find) \u2014 observe-only, not yet blocked"> <span> </span></div>`),iu=U(`<div class="flex items-baseline gap-2 font-mono text-xs"><span class="shrink-0 text-muted-foreground"> </span> <span> </span> <span class="truncate text-foreground/80"> </span></div>`),au=U(`<div class="text-sm text-muted-foreground">No gate decisions yet.</div>`),ou=U(`<div class="mt-2 border-t border-border pt-2 text-[10px] uppercase tracking-wide text-muted-foreground">Terminal hunts (observe-only)</div> <!>`,1),su=U(`<div class="font-mono text-2xl text-foreground"> <span class="text-sm text-muted-foreground">blocks</span></div> <!> <div class="flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto"><!> <!></div>`,1);function cu(e,t){k(t,!0);let n=M(()=>(Q.data?.recent_gates??[]).slice(0,50)),r=M(()=>Q.data?.global?.blocked_count??0),i=M(()=>Q.data?.global?.bash_explorations??0),a=M(()=>Q.data?.global?.bash_avoidable??0),o=M(()=>(Q.data?.recent_bash??[]).slice(0,12));eo(e,{title:`The Moat`,meta:`PreToolUse`,children:(e,t)=>{var s=su(),c=L(s),l=I(c);D(),E(c);var u=R(c,2),d=e=>{var t=ru(),n=I(t),r=R(n),o=I(r);E(r),E(t),z((e,t)=>{K(n,`\u21B3 ${e??``} terminal hunts \xB7 `),Pi(r,1,Oi(H(a)>0?`text-destructive`:``)),K(o,`${t??``} the graph could answer`)},[()=>da(H(i)),()=>da(H(a))]),G(e,t)};q(u,e=>{H(i)>0&&e(d)});var f=R(u,2),p=I(f);J(p,17,()=>H(n),e=>e.ts+e.query,(e,t)=>{var n=iu(),r=I(n),i=I(r,!0);E(r);var a=R(r,2),o=I(a,!0);E(a);var s=R(a,2),c=I(s,!0);E(s),E(n),z(e=>{K(i,e),Pi(a,1,`shrink-0 rounded px-1 text-[10px] uppercase `+(H(t).decision===`block`?`bg-destructive/15 text-destructive`:`bg-[var(--c-fable)]/12 text-[var(--c-fable)]`)),K(o,H(t).decision),Xi(s,`title`,H(t).query??``),K(c,H(t).query??`\u2014`)},[()=>pa(H(t).ts)]),G(e,n)},e=>{G(e,au())});var m=R(p,2),h=e=>{var t=ou();J(R(L(t),2),17,()=>H(o),e=>e.ts+e.query,(e,t)=>{var n=iu(),r=I(n),i=I(r,!0);E(r);var a=R(r,2),o=I(a,!0);E(a);var s=R(a,2),c=I(s,!0);E(s),E(n),z(e=>{K(i,e),Pi(a,1,`shrink-0 rounded px-1 text-[10px] uppercase `+(H(t).avoidable?`bg-destructive/15 text-destructive`:`bg-muted text-muted-foreground`)),K(o,H(t).tool),Xi(s,`title`,H(t).query??``),K(c,H(t).query??`\u2014`)},[()=>pa(H(t).ts)]),G(e,n)}),G(e,t)};q(m,e=>{H(o).length>0&&e(h)}),E(f),z(e=>K(l,`${e??``} `),[()=>da(H(r))]),G(e,s)},$$slots:{default:!0}}),A()}var lu=U(`<div class="flex items-baseline justify-between gap-3 font-mono text-sm"><span class="truncate text-muted-foreground"> </span> <span class="tabular-nums text-foreground"> </span></div>`),uu=U(`<div class="text-sm text-muted-foreground">No usage learned yet \u2014 Synthra learns as you read/edit files.</div>`),du=U(`<div class="font-mono text-2xl text-foreground"> <span class="text-sm text-muted-foreground">tracked</span></div> <div class="flex max-h-[190px] flex-col gap-1.5 overflow-y-auto"></div>`,1);function fu(e,t){k(t,!0);let n=M(()=>Q.data?.active),r=M(()=>H(n)?.stats?.hot_files??[]);{let t=M(()=>H(n)?.project_name??`active project`);eo(e,{title:`Hot files`,get meta(){return H(t)},children:(e,t)=>{var i=du(),a=L(i),o=I(a);D(),E(a);var s=R(a,2);J(s,21,()=>H(r),e=>e.path,(e,t)=>{var n=lu(),r=I(n),i=I(r,!0);E(r);var a=R(r,2),o=I(a,!0);E(a),E(n),z(e=>{Xi(n,`title`,H(t).path),K(i,e),K(o,H(t).score)},[()=>ga(H(t).path)]),G(e,n)},e=>{G(e,uu())}),E(s),z(e=>K(o,`${e??``} `),[()=>da(H(n)?.stats?.hot_files_total??0)]),G(e,i)},$$slots:{default:!0}})}A()}var pu=U(`<div class="grid grid-cols-1 gap-4 p-5 lg:grid-cols-3"><div class="lg:col-span-3 lg:row-start-1"><!></div> <div class="lg:col-start-1 lg:row-start-2"><!></div> <div class="lg:col-start-2 lg:row-start-2"><!></div> <div class="lg:col-start-1 lg:row-start-3"><!></div> <div class="lg:col-start-2 lg:row-start-3"><!></div> <div class="lg:col-start-1 lg:row-start-4"><!></div> <div class="lg:col-start-2 lg:row-start-4"><!></div> <div class="relative lg:col-start-3 lg:row-start-2 lg:row-span-3"><div class="lg:absolute lg:inset-0"><!></div></div> <div class="lg:col-span-3 lg:row-start-5"><!></div></div>`);function mu(e){var t=pu(),n=I(t);Xa(I(n),{}),E(n);var r=R(n,2);no(I(r),{}),E(r);var i=R(r,2);io(I(i),{}),E(i);var a=R(i,2);lo(I(a),{}),E(a);var o=R(a,2);fu(I(o),{}),E(o);var s=R(o,2);ql(I(s),{}),E(s);var c=R(s,2);Zl(I(c),{}),E(c);var l=R(c,2),u=I(l);cu(I(u),{}),E(u),E(l);var d=R(l,2);nu(I(d),{}),E(d),E(t),G(e,t)}var hu=new Set([`$$slots`,`$$events`,`$$legacy`]);function gu(e,t){let n=oa(t,hu),r=[[`path`,{d:`M20 6 9 17l-5-5`}]];Ta(e,ca({name:`check`},()=>n,{get iconNode(){return r}}))}var _u=new Set([`$$slots`,`$$events`,`$$legacy`]);function vu(e,t){let n=oa(t,_u),r=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]];Ta(e,ca({name:`copy`},()=>n,{get iconNode(){return r}}))}var yu=U(`<p> </p>`),bu=U(`<div class="break-all"><span class="text-foreground/70"> </span> </div>`),xu=U(`<div class="mt-1 flex flex-col gap-0.5 font-mono text-xs text-muted-foreground/80"></div>`),Su=U(`<div role="button" tabindex="0" class="flex cursor-pointer flex-col gap-1.5 rounded-lg border bg-card/55 p-3 text-left transition-colors hover:bg-card/85"><div class="flex items-center gap-1.5"><span class="min-w-0 truncate font-mono text-sm text-foreground"> </span> <button type="button" title="Copy name" class="inline-flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground/60 transition-colors hover:bg-accent hover:text-foreground"><!></button> <span> </span></div> <!> <!></div>`);function Cu(e,t){k(t,!0);let n=P(!1),r=P(!1),i,a=M(()=>t.item.scope===`plugin`?t.item.source??`plugin`:t.item.scope),o=M(()=>t.item.scope===`project`?`var(--c-fable)`:t.item.scope===`personal`?`var(--c-sonnet)`:`#9bc2ef`),s=M(()=>Object.entries(t.item.meta??{}));function c(){F(n,!H(n))}function l(e){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c())}async function u(e){e.stopPropagation();try{await navigator.clipboard.writeText(t.item.name),F(r,!0),clearTimeout(i),i=setTimeout(()=>F(r,!1),1200)}catch{}}var d=Su(),f=I(d),p=I(f),m=I(p,!0);E(p);var g=R(p,2),_=I(g),v=e=>{gu(e,{class:`size-3.5`,style:`color: var(--c-fable)`})},y=e=>{vu(e,{class:`size-3.5`})};q(_,e=>{H(r)?e(v):e(y,-1)}),E(g);var b=R(g,2);let x;var S=I(b);E(b),E(f);var ee=R(f,2),te=e=>{var r=yu(),i=I(r,!0);E(r),z(()=>{Pi(r,1,`text-sm leading-snug text-muted-foreground `+(H(n)?``:`line-clamp-2`)),K(i,t.item.description)}),G(e,r)};q(ee,e=>{t.item.description&&e(te)});var ne=R(ee,2),re=e=>{var t=xu();J(t,21,()=>H(s),([e,t])=>e,(e,t)=>{var n=M(()=>h(H(t),2));let r=()=>H(n)[0],i=()=>H(n)[1];var a=bu(),o=I(a),s=I(o);E(o);var c=R(o);E(a),z(()=>{K(s,`${r()??``}:`),K(c,` ${i()??``}`)}),G(e,a)}),E(t),G(e,t)};q(ne,e=>{H(n)&&H(s).length&&e(re)}),E(d),z(()=>{K(m,t.item.name),Xi(g,`aria-label`,`Copy "${t.item.name}"`),x=Pi(b,1,`ml-auto shrink-0 rounded border px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wide`,null,x,{"opacity-50":t.item.enabled===!1}),Ii(b,`color:${H(o)}; border-color:color-mix(in oklab, ${H(o)} 35%, transparent)`),K(S,`${H(a)??``}${t.item.enabled===!1?` \xB7 off`:``}`)}),Yr(`click`,d,c),Yr(`keydown`,d,l),Yr(`click`,g,u),G(e,d),A()}Xr([`click`,`keydown`]);var wu=U(`<span> </span>`),Tu=U(`<button> <span class="opacity-60"> </span></button>`),Eu=U(`<div class="text-sm text-muted-foreground">Scanning your arsenal\u2026</div>`),Du=U(`<div class="text-sm text-muted-foreground"> </div>`),Ou=U(`<section class="flex flex-col gap-2"><div class="flex items-center gap-3 border-b border-border pb-1.5"><span class="size-1.5 shrink-0 rounded-sm"></span> <span class="font-mono text-xs uppercase tracking-[0.14em]"> </span> <span class="font-mono text-xs tracking-[0.1em] text-muted-foreground"> </span></div> <div class="grid grid-cols-1 items-start gap-2 md:grid-cols-2 2xl:grid-cols-3"></div></section>`),ku=U(`<div class="flex flex-col gap-6"></div>`),Au=U(`<div class="flex h-full flex-col gap-4 p-5"><div class="flex flex-wrap items-center justify-between gap-3"><h1 class="font-serif text-2xl text-foreground">\u2694 Arsenal</h1> <div class="flex items-center gap-2 font-mono text-xs text-muted-foreground"><!> <button class="rounded border px-2 py-1 transition-colors hover:text-foreground">\u21BB Rescan</button></div></div> <div class="flex flex-wrap items-center gap-2"><!> <input placeholder="Filter by name or description\u2026" autocomplete="off" class="ml-auto w-full max-w-72 rounded-md border bg-card/60 px-3 py-1.5 text-sm outline-none transition-colors focus:border-ring"/></div> <!></div>`);function ju(e,t){k(t,!0);let n=P(`skills`),r=P(``),i=M(()=>Q.arsenal),a=[{id:`skills`,label:`Skills`},{id:`agents`,label:`Agents`},{id:`mcp`,label:`MCP`}],o=M(()=>{let e=H(i)?H(i)[H(n)]:[],t=H(r).toLowerCase().trim();return t?e.filter(e=>e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)||(e.source??``).toLowerCase().includes(t)):e}),s=M(()=>{let e=new Map;for(let t of H(o)){let n=t.scope===`plugin`?`plugin:${t.source??`plugin`}`:t.scope,r=e.get(n);r||(r={label:t.scope===`plugin`?t.source??`plugin`:t.scope===`project`?`In this project`:`Personal \xB7 this machine`,scope:t.scope,items:[]},e.set(n,r)),r.items.push(t)}return[...e.values()]});function c(e){return e===`project`?`var(--c-fable)`:e===`personal`?`var(--c-sonnet)`:`#9bc2ef`}let l=M(()=>H(i)?new Date(H(i).scanned_at).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):``);var u=Au(),d=I(u),f=R(I(d),2),p=I(f),m=e=>{var t=wu(),n=I(t);E(t),z(()=>K(n,`${H(i).counts.plugins??``} plugins \xB7 scanned ${H(l)??``}`)),G(e,t)};q(p,e=>{H(i)&&e(m)});var h=R(p,2);E(f),E(d);var g=R(d,2),_=I(g);J(_,17,()=>a,e=>e.id,(e,t)=>{var r=Tu(),a=I(r),o=R(a),s=I(o,!0);E(o),E(r),z(()=>{Pi(r,1,`rounded-lg px-3 py-1.5 font-mono text-xs transition-colors `+(H(n)===H(t).id?`bg-accent text-accent-foreground`:`text-muted-foreground hover:text-foreground`)),K(a,`${H(t).label??``} `),K(s,H(i)?.counts?.[H(t).id]??0)}),Yr(`click`,r,()=>F(n,H(t).id,!0)),G(e,r)});var v=R(_,2);Ji(v),E(g);var y=R(g,2),b=e=>{G(e,Eu())},x=e=>{var t=Du(),n=I(t,!0);E(t),z(()=>K(n,H(r)?`No matches.`:`Nothing installed in this category.`)),G(e,t)},S=e=>{var t=ku();J(t,21,()=>H(s),e=>e.label+e.scope,(e,t)=>{var n=Ou(),r=I(n),i=I(r),a=R(i,2),o=I(a,!0);E(a);var s=R(a,2),l=I(s,!0);E(s),E(r);var u=R(r,2);J(u,21,()=>H(t).items,e=>e.scope+(e.source??``)+e.name,(e,t)=>{Cu(e,{get item(){return H(t)}})}),E(u),E(n),z((e,n)=>{Ii(i,e),Ii(a,n),K(o,H(t).label),K(l,H(t).items.length)},[()=>`background:${c(H(t).scope)}`,()=>`color:${c(H(t).scope)}`]),G(e,n)}),E(t),G(e,t)};q(y,e=>{Q.arsenalLoading&&!H(i)?e(b):H(s).length?e(S,-1):e(x,1)}),E(u),Yr(`click`,h,()=>Q.loadArsenal(!0)),na(v,()=>H(r),e=>F(r,e)),G(e,u),A()}Xr([`click`]);var Mu=U(`<div class="flex items-baseline gap-3 text-sm"><code class="shrink-0 font-mono text-xs text-[var(--c-sonnet)]"> </code> <span class="text-muted-foreground"> </span></div>`),Nu=U(`<div class="mt-1 flex flex-col gap-1"></div>`),Pu=U(`<div class="flex flex-col gap-1.5 rounded-lg border bg-card/55 p-4"><code class="font-mono text-sm text-foreground"> </code> <p class="text-sm leading-snug text-muted-foreground"> </p> <!></div>`),Fu=U(`<div class="flex h-full flex-col gap-4 p-5"><div class="flex flex-wrap items-center justify-between gap-3"><h1 class="font-serif text-2xl text-foreground">\u276F Commands</h1> <span class="font-mono text-xs text-muted-foreground">all paths default to the current directory</span></div> <div class="flex max-w-3xl flex-col gap-2.5"></div> <p class="max-w-3xl font-mono text-xs leading-relaxed text-muted-foreground">Install: <code class="text-foreground">npm install -g @jefuriiij/synthra</code> \xB7 macOS/Linux hooks\n additionally need <code class="text-foreground">jq</code> (<code>brew install jq</code>) \u2014 without it\n the hooks silently no-op while the MCP tools keep working.</p></div>`);function Iu(e){let t=[{cmd:`syn . [path]`,desc:`The default flow: scan the project, start the MCP server + dashboard, install the hooks, and register the MCP entry for the IDE. Runs as a background service \u2014 Ctrl+C stops it.`,opts:[{flag:`--full`,desc:`Re-parse every file, ignoring the incremental parse cache`},{flag:`--launch-cli`,desc:"Also spawn the `claude` CLI in this terminal"},{flag:`--resume <id>`,desc:`Resume a Claude session (requires --launch-cli)`}]},{cmd:`syn scan [path]`,desc:`Scan only \u2014 walk the project, parse it into the symbol graph, and write it to .synthra-graph/. No servers, no hooks.`,opts:[{flag:`--full`,desc:`Re-parse every file, ignoring the incremental parse cache`}]},{cmd:`syn serve [path]`,desc:`Start the HTTP MCP server only, against an already-scanned project.`},{cmd:`syn dashboard [path]`,desc:`Run this dashboard as a standalone process (no graph required) \u2014 token spend, savings, the Moat, and your Arsenal across every registered project.`},{cmd:`syn doctor [path]`,desc:`Diagnose the setup: Node version, jq (required by the macOS/Linux hooks), the claude CLI, graph freshness, .mcp.json registration, policy version, and installed hooks. Run this first when something feels off.`,opts:[{flag:`--report`,desc:`Emit a copy-pasteable markdown diagnostic for GitHub issues (paths redacted)`}]},{cmd:`syn remove [path]`,desc:`Uninstall Synthra from a project: deletes .synthra-graph/ and .synthra/, strips the CLAUDE.md policy block, Synthra\'s .gitignore entries, and its hooks \u2014 your own content in those files always survives. Also deregisters MCP and removes the project from this dashboard. Shows a summary and asks [y/N] first.`,opts:[{flag:`--yes`,desc:`Skip the confirmation prompt (required when not in a terminal)`}]},{cmd:`syn --version`,desc:`Print the installed Synthra version.`}];var n=Fu(),r=R(I(n),2);J(r,5,()=>t,e=>e.cmd,(e,t)=>{var n=Pu(),r=I(n),i=I(r,!0);E(r);var a=R(r,2),o=I(a,!0);E(a);var s=R(a,2),c=e=>{var n=Nu();J(n,5,()=>H(t).opts,e=>e.flag,(e,t)=>{var n=Mu(),r=I(n),i=I(r,!0);E(r);var a=R(r,2),o=I(a,!0);E(a),E(n),z(()=>{K(i,H(t).flag),K(o,H(t).desc)}),G(e,n)}),E(n),G(e,n)};q(s,e=>{H(t).opts?.length&&e(c)}),E(n),z(()=>{K(i,H(t).cmd),K(o,H(t).desc)}),G(e,n)}),E(r),D(2),E(n),G(e,n)}var Lu=U(`<details class="rounded-lg border bg-card/50 p-3"><summary class="cursor-pointer text-sm font-medium text-foreground"> </summary> <p class="mt-2 text-[13px] leading-relaxed text-muted-foreground"> </p></details>`),Ru=U(`<!> <!> <div class="mt-4 flex flex-col gap-2"></div> <!>`,1),zu=U(`<!> <!>`,1);function Bu(e,t){k(t,!0);let n=Z(t,`open`,15,!1),r=[{q:`Where do these numbers come from?`,a:`Synthra\'s Stop hook reads Claude Code\'s transcript JSONL after each turn and logs token usage to .synthra-graph/token_log.jsonl. The gate logs to gate_log.jsonl, tool calls to tool_log.jsonl. The dashboard reads those \u2014 it never feeds back into retrieval.`},{q:`How is cost calculated?`,a:`Token counts \xD7 Anthropic\'s published per-model rates (in src/shared/pricing.ts), summed across input, output, cache-read and cache-write. These are API-equivalent estimates, not your plan billing \u2014 useful for comparing sessions.`},{q:`What is the savings floor?`,a:`Each time the Moat blocks an exploratory Grep/Glob, we credit a deliberately conservative 500 tokens \xD7 $3/M input rate. Real savings are usually higher (it ignores cache thrash and follow-up reads the block also prevents). It\'s a floor, not a guess.`},{q:`What is the Moat?`,a:`A PreToolUse hook that intercepts Grep/Glob and, when the graph has confident context, blocks them and hands back the exact graph_read targets + signatures \u2014 so the agent reads ~50-token slices instead of whole files.`},{q:`What is the Arsenal view?`,a:`A scan of every skill, subagent, and MCP server available to you \u2014 project, personal (~/.claude), and plugin \u2014 with descriptions, so you never have to drop to the CLI to recall what\'s installed. MCP entries show name/type/url only; auth tokens are never read.`},{q:`What\'s the codebase graph?`,a:`tree-sitter parses your project into a symbol graph (files, symbols, imports, call edges). graph_read returns a symbol\'s source plus its dependency surface; graph_continue packs a context bundle.`},{q:`Where is everything stored?`,a:`.synthra-graph/ (machine-local, gitignored) holds the graph + logs; .synthra/ (git-tracked) holds branch-aware memory. Nothing leaves your machine.`},{q:`Why is my bill not lower already?`,a:`Savings land only when the agent actually uses the cheap path. v0.4\u20130.6 push the answer to the point of use (block payloads, edit recipes, dependency footers); a real dogfood session on the latest version is the true test.`}];var i=W();X(L(i),()=>Nl,(e,t)=>{t(e,{get open(){return n()},set open(e){n(e)},children:(e,t)=>{var n=W();X(L(n),()=>lc,(e,t)=>{t(e,{children:(e,t)=>{var n=zu(),i=L(n);X(i,()=>kl,(e,t)=>{t(e,{class:`fixed inset-0 z-50 bg-black/60`})}),X(R(i,2),()=>Bl,(e,t)=>{t(e,{class:`fixed left-1/2 top-1/2 z-50 max-h-[85vh] w-[min(640px,92vw)] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-xl border bg-card p-6 text-card-foreground shadow-2xl`,children:(e,t)=>{var n=Ru(),i=L(n);X(i,()=>tc,(e,t)=>{t(e,{class:`font-serif text-2xl`,children:(e,t)=>{D(),G(e,ai(`FAQ`))},$$slots:{default:!0}})});var a=R(i,2);X(a,()=>Ml,(e,t)=>{t(e,{class:`text-xs text-muted-foreground`,children:(e,t)=>{D(),G(e,ai(`Where every number on this dashboard comes from.`))},$$slots:{default:!0}})});var o=R(a,2);J(o,21,()=>r,e=>e.q,(e,t)=>{var n=Lu(),r=I(n),i=I(r,!0);E(r);var a=R(r,2),o=I(a,!0);E(a),E(n),z(()=>{K(i,H(t).q),K(o,H(t).a)}),G(e,n)}),E(o),X(R(o,2),()=>Il,(e,t)=>{t(e,{class:`mt-4 w-full rounded-md border py-2 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:(e,t)=>{D(),G(e,ai(`Close`))},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}})}),G(e,i),A()}var Vu=U(`<div class="mt-4 text-sm text-muted-foreground">Running checks\u2026</div>`),Hu=U(`<div class="flex items-baseline gap-2 rounded-lg border bg-card/50 px-3 py-2"><span class="shrink-0"> </span> <span class="shrink-0 font-mono text-sm text-foreground"> </span> <span class="min-w-0 text-[13px] leading-snug text-muted-foreground"> </span></div>`),Uu=U(`<!> Copied`,1),Wu=U(`<!> Copy report`,1),Gu=U(`<div class="mt-3 font-mono text-xs text-muted-foreground"> </div> <div class="mt-3 flex flex-col gap-1.5"></div> <div class="mt-4 flex flex-wrap items-center gap-2"><button class="inline-flex items-center gap-1.5 rounded-md border px-3 py-2 text-sm text-foreground transition-colors hover:bg-accent"><!></button> <a target="_blank" rel="noreferrer" class="rounded-md border px-3 py-2 text-sm text-foreground transition-colors hover:bg-accent">Report a bug \u2197</a> <a target="_blank" rel="noreferrer" class="rounded-md border px-3 py-2 text-sm text-foreground transition-colors hover:bg-accent">Suggest a feature \u2197</a></div> <p class="mt-3 text-xs leading-relaxed text-muted-foreground">Nothing is sent automatically \u2014 copy the report and paste it into the issue. Paths are\n redacted (your home directory shows as <code>~</code>).</p>`,1),Ku=U(`<div class="mt-4 text-sm text-muted-foreground">Couldn\'t reach the dashboard server for the checks \u2014 you can still run <code class="text-foreground">syn doctor --report</code> in a terminal.</div>`),qu=U(`<!> <!> <!> <!>`,1),Ju=U(`<!> <!>`,1);function Yu(e,t){k(t,!0);let n=Z(t,`open`,15,!1),r=P(!1),i,a=`https://github.com/jefuriiij/synthra/issues/new`,o={ok:`\u2705`,warn:`\u26A0\uFE0F`,fail:`\u274C`};Ln(()=>{n()&&Q.loadReport()});async function s(){if(Q.report)try{await navigator.clipboard.writeText(Q.report.markdown),F(r,!0),clearTimeout(i),i=setTimeout(()=>F(r,!1),1200)}catch{}}var c=W();X(L(c),()=>Nl,(e,t)=>{t(e,{get open(){return n()},set open(e){n(e)},children:(e,t)=>{var n=W();X(L(n),()=>lc,(e,t)=>{t(e,{children:(e,t)=>{var n=Ju(),i=L(n);X(i,()=>kl,(e,t)=>{t(e,{class:`fixed inset-0 z-50 bg-black/60`})}),X(R(i,2),()=>Bl,(e,t)=>{t(e,{class:`fixed left-1/2 top-1/2 z-50 max-h-[85vh] w-[min(640px,92vw)] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-xl border bg-card p-6 text-card-foreground shadow-2xl`,children:(e,t)=>{var n=qu(),i=L(n);X(i,()=>tc,(e,t)=>{t(e,{class:`font-serif text-2xl`,children:(e,t)=>{D(),G(e,ai(`Report`))},$$slots:{default:!0}})});var c=R(i,2);X(c,()=>Ml,(e,t)=>{t(e,{class:`text-xs text-muted-foreground`,children:(e,t)=>{D(),G(e,ai(`Your setup, checked live \u2014 copy the diagnostic into a bug report, or suggest an idea.`))},$$slots:{default:!0}})});var l=R(c,2),u=e=>{G(e,Vu())},d=e=>{var t=Gu(),n=L(t),i=I(n);E(n);var c=R(n,2);J(c,21,()=>Q.report.checks,e=>e.label,(e,t)=>{var n=Hu(),r=I(n),i=I(r,!0);E(r);var a=R(r,2),s=I(a,!0);E(a);var c=R(a,2),l=I(c,!0);E(c),E(n),z(()=>{K(i,o[H(t).status]??`\u2022`),K(s,H(t).label),K(l,H(t).detail)}),G(e,n)}),E(c);var l=R(c,2),u=I(l),d=I(u),f=e=>{var t=Uu();gu(L(t),{class:`size-3.5`,style:`color: var(--c-fable)`}),D(),G(e,t)},p=e=>{var t=Wu();vu(L(t),{class:`size-3.5`}),D(),G(e,t)};q(d,e=>{H(r)?e(f):e(p,-1)}),E(u);var m=R(u,2);Xi(m,`href`,`${a}?template=bug_report.yml`),Xi(R(m,2),`href`,`${a}?template=feature_request.yml`),E(l),D(2),z(()=>K(i,`Synthra v${Q.report.version??``} \xB7 ${Q.report.platform??``}\n ${Q.report.arch??``} \xB7 Node v${Q.report.node??``}`)),Yr(`click`,u,s),G(e,t)},f=e=>{G(e,Ku())};q(l,e=>{Q.reportLoading&&!Q.report?e(u):Q.report?e(d,1):e(f,-1)}),X(R(l,2),()=>Il,(e,t)=>{t(e,{class:`mt-4 w-full rounded-md border py-2 text-sm text-muted-foreground transition-colors hover:text-foreground`,children:(e,t)=>{D(),G(e,ai(`Close`))},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}})}),G(e,n)},$$slots:{default:!0}})}),G(e,c),A()}Xr([`click`]);var Xu=U(`<div class="flex h-screen w-screen overflow-hidden"><!> <main class="min-w-0 flex-1 overflow-y-auto"><!></main></div> <!> <!>`,1);function Zu(e,t){k(t,!0);let n=P(!1),r=P(!1);la(()=>(Q.start(),()=>Q.stop()));var i=Xu(),a=L(i),o=I(a);qa(o,{onFaq:()=>F(n,!0),onReport:()=>F(r,!0)});var s=R(o,2),c=I(s),l=e=>{mu(e,{})},u=e=>{Iu(e,{})},d=e=>{ju(e,{})};q(c,e=>{Q.view===`overview`?e(l):Q.view===`commands`?e(u,1):e(d,-1)}),E(s),E(a);var f=R(a,2);Bu(f,{get open(){return H(n)},set open(e){F(n,e,!0)}}),Yu(R(f,2),{get open(){return H(r)},set open(e){F(r,e,!0)}}),G(e,i),A()}var Qu=document.getElementById(`app`);if(!Qu)throw Error(`missing #app mount node`);si(Zu,{target:Qu});</script>\n <style rel="stylesheet" crossorigin>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:var(--font-sans);--font-serif:var(--font-serif);--font-mono:var(--font-mono);--color-black:#000;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-medium:500;--tracking-wide:.025em;--leading-snug:1.375;--leading-relaxed:1.625;--radius-xl:.75rem;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}html,body{height:100%}body{background:radial-gradient(1200px 800px at 14% 16%, #2c5db81f, transparent 60%), var(--background);color:var(--foreground);font-family:var(--font-sans);-webkit-font-smoothing:antialiased}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{background:var(--border);border-radius:999px}::-webkit-scrollbar-track{background:0 0}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:0}.top-1\\/2{top:50%}.left-1\\/2{left:50%}.z-50{z-index:50}.my-1{margin-block:var(--spacing)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.inline{display:inline}.inline-flex{display:inline-flex}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-\\[116px\\]{width:116px;height:116px}.size-full{width:100%;height:100%}.h-1{height:var(--spacing)}.h-2{height:calc(var(--spacing) * 2)}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\[85vh\\]{max-height:85vh}.max-h-\\[190px\\]{max-height:190px}.max-h-\\[260px\\]{max-height:260px}.min-h-0{min-height:0}.w-9{width:calc(var(--spacing) * 9)}.w-\\[64px\\]{width:64px}.w-\\[248px\\]{width:248px}.w-\\[min\\(440px\\,92vw\\)\\]{width:min(440px,92vw)}.w-\\[min\\(640px\\,92vw\\)\\]{width:min(640px,92vw)}.w-full{width:100%}.w-screen{width:100vw}.max-w-3xl{max-width:var(--container-3xl)}.max-w-72{max-width:calc(var(--spacing) * 72)}.max-w-\\[120px\\]{max-width:120px}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-rotate-90{rotate:-90deg}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-border,.border-border\\/60{border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){.border-border\\/60{border-color:color-mix(in oklab, var(--border) 60%, transparent)}}.border-sidebar-border{border-color:var(--sidebar-border)}.bg-\\[var\\(--c-fable\\)\\],.bg-\\[var\\(--c-fable\\)\\]\\/12{background-color:var(--c-fable)}@supports (color:color-mix(in lab, red, red)){.bg-\\[var\\(--c-fable\\)\\]\\/12{background-color:color-mix(in oklab, var(--c-fable) 12%, transparent)}}.bg-\\[var\\(--money\\)\\]{background-color:var(--money)}.bg-accent{background-color:var(--accent)}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-border{background-color:var(--border)}.bg-card,.bg-card\\/50{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/50{background-color:color-mix(in oklab, var(--card) 50%, transparent)}}.bg-card\\/55{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/55{background-color:color-mix(in oklab, var(--card) 55%, transparent)}}.bg-card\\/60{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/60{background-color:color-mix(in oklab, var(--card) 60%, transparent)}}.bg-card\\/70{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\\/70{background-color:color-mix(in oklab, var(--card) 70%, transparent)}}.bg-destructive,.bg-destructive\\/15{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/15{background-color:color-mix(in oklab, var(--destructive) 15%, transparent)}}.bg-muted{background-color:var(--muted)}.bg-muted-foreground,.bg-muted-foreground\\/40{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\\/40{background-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent)}}.bg-primary\\/90{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.bg-primary\\/90{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-accent,.bg-sidebar-accent\\/40{background-color:var(--sidebar-accent)}@supports (color:color-mix(in lab, red, red)){.bg-sidebar-accent\\/40{background-color:color-mix(in oklab, var(--sidebar-accent) 40%, transparent)}}.bg-sidebar-border{background-color:var(--sidebar-border)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pr-1{padding-right:var(--spacing)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.font-serif{font-family:var(--font-serif)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[13px\\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.tracking-\\[0\\.1em\\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\\[0\\.12em\\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\\[0\\.14em\\]{--tw-tracking:.14em;letter-spacing:.14em}.tracking-\\[0\\.18em\\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-all{word-break:break-all}.text-\\[var\\(--c-fable\\)\\]{color:var(--c-fable)}.text-\\[var\\(--c-sonnet\\)\\]{color:var(--c-sonnet)}.text-\\[var\\(--money\\)\\]{color:var(--money)}.text-accent-foreground{color:var(--accent-foreground)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground,.text-foreground\\/70{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/70{color:color-mix(in oklab, var(--foreground) 70%, transparent)}}.text-foreground\\/80{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/80{color:color-mix(in oklab, var(--foreground) 80%, transparent)}}.text-muted-foreground,.text-muted-foreground\\/60{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/60{color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.text-muted-foreground\\/80{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/80{color:color-mix(in oklab, var(--muted-foreground) 80%, transparent)}}.text-primary-foreground{color:var(--primary-foreground)}.text-sidebar-accent-foreground{color:var(--sidebar-accent-foreground)}.text-sidebar-foreground,.text-sidebar-foreground\\/60{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab, red, red)){.text-sidebar-foreground\\/60{color:color-mix(in oklab, var(--sidebar-foreground) 60%, transparent)}}.text-sidebar-foreground\\/75{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab, red, red)){.text-sidebar-foreground\\/75{color:color-mix(in oklab, var(--sidebar-foreground) 75%, transparent)}}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-card\\/80:hover{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-card\\/80:hover{background-color:color-mix(in oklab, var(--card) 80%, transparent)}}.hover\\:bg-card\\/85:hover{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-card\\/85:hover{background-color:color-mix(in oklab, var(--card) 85%, transparent)}}.hover\\:bg-sidebar-accent\\/50:hover{background-color:var(--sidebar-accent)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-sidebar-accent\\/50:hover{background-color:color-mix(in oklab, var(--sidebar-accent) 50%, transparent)}}.hover\\:text-foreground:hover{color:var(--foreground)}.hover\\:text-sidebar-foreground:hover{color:var(--sidebar-foreground)}}.focus\\:border-ring:focus{border-color:var(--ring)}@media (hover:hover){.enabled\\:hover\\:text-foreground:enabled:hover{color:var(--foreground)}}.disabled\\:opacity-40:disabled{opacity:.4}@media (width>=40rem){.sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (width>=48rem){.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width>=64rem){.lg\\:absolute{position:absolute}.lg\\:inset-0{inset:0}.lg\\:col-span-3{grid-column:span 3/span 3}.lg\\:col-start-1{grid-column-start:1}.lg\\:col-start-2{grid-column-start:2}.lg\\:col-start-3{grid-column-start:3}.lg\\:row-span-3{grid-row:span 3/span 3}.lg\\:row-start-1{grid-row-start:1}.lg\\:row-start-2{grid-row-start:2}.lg\\:row-start-3{grid-row-start:3}.lg\\:row-start-4{grid-row-start:4}.lg\\:row-start-5{grid-row-start:5}.lg\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (width>=96rem){.\\32 xl\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.75rem;--background:#04081a;--foreground:#ecf2fb;--card:#0a1733;--card-foreground:#ecf2fb;--popover:#0a1733;--popover-foreground:#ecf2fb;--primary:#2c5db8;--primary-foreground:#f4f7fc;--secondary:#122549;--secondary-foreground:#d7e6f7;--muted:#102146;--muted-foreground:#8ba0c2;--accent:#1b3a78;--accent-foreground:#ecf2fb;--destructive:#ff5d5d;--destructive-foreground:#fff5f5;--border:#9bc2ef24;--input:#9bc2ef2e;--ring:#5c8fe6;--sidebar:#081226;--sidebar-foreground:#d7e6f7;--sidebar-primary:#2c5db8;--sidebar-primary-foreground:#f4f7fc;--sidebar-accent:#122549;--sidebar-accent-foreground:#ecf2fb;--sidebar-border:#9bc2ef1f;--sidebar-ring:#5c8fe6;--c-fable:#2ee08f;--c-opus:#ff6338;--c-sonnet:#ffb938;--c-haiku:#7438ff;--c-unknown:#12cbf5;--money:#4ade9b;--font-sans:"Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-serif:"Instrument Serif", "Times New Roman", serif;--font-mono:"Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}\n/*$vite$:1*/</style>\n </head>\n <body>\n <div id="app"></div>\n </body>\n</html>\n';
|
|
752
973
|
|
|
753
974
|
// src/dashboard/public/favicon.svg
|
|
754
975
|
var favicon_default = '<svg width="107" height="107" viewBox="0 0 107 107" fill="none" xmlns="http://www.w3.org/2000/svg">\n<rect x="0.5" y="0.5" width="106" height="106" rx="7.5" fill="url(#paint0_radial_21_11)"/>\n<rect x="0.5" y="0.5" width="106" height="106" rx="7.5" stroke="url(#paint1_linear_21_11)"/>\n<path d="M26.408 72.558C25.5813 72.558 24.6513 72.4753 23.618 72.31C22.626 72.1447 21.6753 71.938 20.766 71.69C19.898 71.442 19.216 71.1733 18.72 70.884C18.4307 70.7187 18.2033 70.5533 18.038 70.388C17.914 70.1813 17.852 69.8507 17.852 69.396L17.542 59.662C17.542 58.8353 17.8107 58.422 18.348 58.422C18.8027 58.422 19.1127 58.794 19.278 59.538L19.836 61.894C21.2413 67.8047 23.866 70.76 27.71 70.76C29.7767 70.76 31.4093 70.078 32.608 68.714C33.848 67.3087 34.468 65.3453 34.468 62.824C34.468 60.3853 33.8273 58.112 32.546 56.004C31.306 53.896 29.3013 51.8087 26.532 49.742C23.4733 47.5513 21.2413 45.4433 19.836 43.418C18.4307 41.3513 17.728 39.1607 17.728 36.846C17.728 33.7873 18.782 31.3487 20.89 29.53C23.0393 27.67 25.7673 26.74 29.074 26.74C30.314 26.74 31.5127 26.8847 32.67 27.174C33.8273 27.4633 34.778 27.8767 35.522 28.414C35.77 28.5793 35.956 28.7653 36.08 28.972C36.2453 29.1787 36.328 29.4473 36.328 29.778L36.514 39.14C36.514 39.8427 36.2453 40.194 35.708 40.194C35.336 40.194 35.0673 39.9047 34.902 39.326L34.468 37.776C33.5587 34.5933 32.608 32.2787 31.616 30.832C30.6653 29.344 29.2807 28.6 27.462 28.6C25.6847 28.6 24.2587 29.1787 23.184 30.336C22.1507 31.4933 21.634 33.126 21.634 35.234C21.634 37.0113 22.2127 38.706 23.37 40.318C24.5273 41.93 26.5527 43.8933 29.446 46.208C32.546 48.7293 34.7987 51.168 36.204 53.524C37.6507 55.8387 38.374 58.3187 38.374 60.964C38.374 63.2787 37.8573 65.304 36.824 67.04C35.7907 68.776 34.3647 70.14 32.546 71.132C30.7687 72.0827 28.7227 72.558 26.408 72.558ZM44.1831 84.71C43.0671 84.71 42.1784 84.3173 41.5171 83.532C40.8558 82.788 40.5251 81.92 40.5251 80.928C40.5251 80.1427 40.7524 79.4813 41.2071 78.944C41.6618 78.4067 42.2818 78.138 43.0671 78.138C43.7284 78.138 44.2038 78.2827 44.4931 78.572C44.7824 78.8613 44.9891 79.192 45.1131 79.564C45.2371 79.936 45.3611 80.2667 45.4851 80.556C45.6091 80.8453 45.8571 80.99 46.2291 80.99C46.6838 80.99 47.0971 80.6593 47.4691 79.998C47.8411 79.378 48.3578 78.0347 49.0191 75.968C49.4324 74.728 49.6804 73.6533 49.7631 72.744C49.8871 71.8347 49.8664 70.8633 49.7011 69.83C49.5771 68.7967 49.2671 67.536 48.7711 66.048L42.0131 44.534C41.7238 43.542 41.4344 42.9013 41.1451 42.612C40.8971 42.3227 40.4838 42.116 39.9051 41.992L38.9751 41.806C38.4378 41.682 38.1691 41.4133 38.1691 41C38.1691 40.5867 38.4584 40.38 39.0371 40.38H49.2671C49.8458 40.38 50.1351 40.5867 50.1351 41C50.1351 41.4547 49.8664 41.7233 49.3291 41.806L48.3371 41.93C47.3451 42.054 46.7044 42.302 46.4151 42.674C46.1671 43.0047 46.1878 43.6247 46.4771 44.534L51.9331 62.7C52.0571 63.1133 52.2431 63.32 52.4911 63.32C52.7804 63.32 52.9871 63.1133 53.1111 62.7L58.3811 45.65C58.7118 44.534 58.7944 43.7073 58.6291 43.17C58.5051 42.5913 57.9264 42.2193 56.8931 42.054L55.5911 41.806C55.0538 41.682 54.7851 41.4133 54.7851 41C54.7851 40.5867 55.0744 40.38 55.6531 40.38H63.5271C64.1058 40.38 64.3951 40.6073 64.3951 41.062C64.3951 41.4753 64.1471 41.7647 63.6511 41.93L63.0931 42.116C62.4731 42.3227 61.9564 42.6947 61.5431 43.232C61.1298 43.7693 60.6958 44.6993 60.2411 46.022L51.0031 74.852C50.0938 77.7453 49.2671 79.8947 48.5231 81.3C47.8204 82.7053 47.1384 83.6147 46.4771 84.028C45.8158 84.4827 45.0511 84.71 44.1831 84.71ZM64.9342 72C64.3142 72 64.0042 71.7727 64.0042 71.318C64.0042 70.946 64.2729 70.698 64.8102 70.574L65.5542 70.45C66.4222 70.2847 66.9802 70.0367 67.2282 69.706C67.5176 69.334 67.6622 68.714 67.6622 67.846V47.014C67.6622 46.27 67.5382 45.774 67.2902 45.526C67.0836 45.2367 66.6909 45.0507 66.1122 44.968L64.8102 44.782C64.2729 44.7407 64.0042 44.5133 64.0042 44.1C64.0042 43.7693 64.3349 43.542 64.9962 43.418C66.2776 43.2113 67.2489 42.8807 67.9102 42.426C68.6129 41.9713 69.3362 41.4133 70.0802 40.752C70.4522 40.38 70.7622 40.194 71.0102 40.194C71.3822 40.194 71.5682 40.442 71.5682 40.938V43.728C71.5682 44.1 71.6922 44.348 71.9402 44.472C72.2296 44.5547 72.5396 44.4307 72.8702 44.1C74.5236 42.5293 75.9702 41.4547 77.2102 40.876C78.4916 40.2973 79.8349 40.008 81.2402 40.008C83.1002 40.008 84.5882 40.6693 85.7042 41.992C86.8202 43.2733 87.3782 45.1747 87.3782 47.696V67.846C87.3782 68.714 87.5022 69.334 87.7502 69.706C88.0396 70.0367 88.6182 70.264 89.4862 70.388L90.8502 70.574C91.3049 70.6567 91.5322 70.9047 91.5322 71.318C91.5322 71.7727 91.2842 72 90.7882 72H80.3722C79.7936 72 79.5042 71.7727 79.5042 71.318C79.5042 70.9047 79.7316 70.6567 80.1862 70.574L81.0542 70.45C81.9222 70.326 82.4802 70.078 82.7282 69.706C83.0176 69.334 83.1622 68.714 83.1622 67.846V48.378C83.1622 46.3527 82.7902 44.9267 82.0462 44.1C81.3022 43.2733 80.2482 42.86 78.8842 42.86C77.5616 42.86 76.3629 43.2527 75.2882 44.038C74.2549 44.782 73.4282 45.7947 72.8082 47.076C72.1882 48.316 71.8782 49.7007 71.8782 51.23V67.846C71.8782 68.714 72.0022 69.334 72.2502 69.706C72.5396 70.078 73.1182 70.3053 73.9862 70.388L75.6602 70.574C76.1149 70.6567 76.3422 70.884 76.3422 71.256C76.3422 71.752 76.0322 72 75.4122 72H64.9342Z" fill="white"/>\n<defs>\n<radialGradient id="paint0_radial_21_11" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(14 16) rotate(43.5498) scale(167.638 156.2)">\n<stop stop-color="#2C5DB8"/>\n<stop offset="1" stop-color="#04081A"/>\n</radialGradient>\n<linearGradient id="paint1_linear_21_11" x1="1.77511" y1="1.50277e-06" x2="105.225" y2="107" gradientUnits="userSpaceOnUse">\n<stop stop-color="#5C8FE6"/>\n<stop offset="1" stop-color="#335080"/>\n</linearGradient>\n</defs>\n</svg>\n';
|
|
@@ -773,6 +994,17 @@ async function startDashboard(paths, preferredPort = 8901) {
|
|
|
773
994
|
});
|
|
774
995
|
app.get("/health", (c) => c.json({ ok: true }));
|
|
775
996
|
app.get("/arsenal", async (c) => c.json(await computeArsenal(paths.projectRoot)));
|
|
997
|
+
app.get("/report", async (c) => {
|
|
998
|
+
const checks = await runDoctorChecks(paths.projectRoot);
|
|
999
|
+
const info = {
|
|
1000
|
+
version: VERSION,
|
|
1001
|
+
platform: process.platform,
|
|
1002
|
+
arch: process.arch,
|
|
1003
|
+
node: process.versions.node,
|
|
1004
|
+
claudeBin: loadConfig().claudeBin
|
|
1005
|
+
};
|
|
1006
|
+
return c.json({ ...info, checks, markdown: buildDiagnosticReport(checks, info) });
|
|
1007
|
+
});
|
|
776
1008
|
app.get("/data", async (c) => {
|
|
777
1009
|
const data = await computeDashboardData(paths, RECENT_N);
|
|
778
1010
|
return c.json(data);
|
|
@@ -782,8 +1014,8 @@ async function startDashboard(paths, preferredPort = 8901) {
|
|
|
782
1014
|
port,
|
|
783
1015
|
url: `http://127.0.0.1:${port}`,
|
|
784
1016
|
async stop() {
|
|
785
|
-
await new Promise((
|
|
786
|
-
nodeServer.close((err) => err ? reject(err) :
|
|
1017
|
+
await new Promise((resolve2, reject) => {
|
|
1018
|
+
nodeServer.close((err) => err ? reject(err) : resolve2());
|
|
787
1019
|
});
|
|
788
1020
|
}
|
|
789
1021
|
};
|