@juliantanx/aiusage 1.5.3 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.js +202 -17
- package/dist/web/_app/immutable/chunks/{entry.DhBBmiYe.js → entry.BtjCrbiQ.js} +2 -2
- package/dist/web/_app/immutable/chunks/{stores.CSRSkpU3.js → stores.YDlXfj0w.js} +1 -1
- package/dist/web/_app/immutable/entry/{app.C_5glR-X.js → app.RcQYJvro.js} +2 -2
- package/dist/web/_app/immutable/entry/start.DAyKzWev.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.DJfx41KV.js → 0.DssNB1JP.js} +1 -1
- package/dist/web/_app/immutable/nodes/{1.BLZj3WNW.js → 1.D4HMlRNK.js} +1 -1
- package/dist/web/_app/immutable/nodes/{11.Bu1W8Jx8.js → 11.8-cT1ns9.js} +1 -1
- package/dist/web/_app/immutable/nodes/{2.JQynNxpe.js → 2.CJH1Fs0K.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +6 -6
- package/package.json +3 -3
- package/dist/web/_app/immutable/entry/start.B0qYhR-d.js +0 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
Track tokens, cost, sessions, models, projects, tool calls, and quota pressure across **20+ AI coding tools** in one local dashboard. Local use needs no account, sends no telemetry, and does not require cloud sync.
|
|
25
25
|
|
|
26
26
|
<p align="center">
|
|
27
|
-
<img src="https://cdn.jsdelivr.net/gh/juliantanx/aiusage@
|
|
27
|
+
<img src="https://cdn.jsdelivr.net/gh/juliantanx/aiusage@main/packages/site/static/screenshots/aiusage-demo.gif" alt="AIUsage dashboard demo" width="92%" />
|
|
28
28
|
</p>
|
|
29
29
|
|
|
30
30
|
## Highlights
|
|
@@ -90,7 +90,7 @@ Full CLI reference: [aiusage.jtanx.com/docs#cli-reference](https://aiusage.jtanx
|
|
|
90
90
|
| `Qoder` | `OpenClaw` | `KiloCode` | `Kelivo` | `Copilot` |
|
|
91
91
|
| `Gemini CLI` | `Kimi Code` | `CodeBuddy` | `Kiro` | `Grok Build` |
|
|
92
92
|
| `Antigravity` | `Roo Code` | `Zed` | `Goose` | `oh-my-pi` |
|
|
93
|
-
| `pi` | `Craft` | `Droid` | | |
|
|
93
|
+
| `pi` | `Craft` | `Droid` | `ZCode` | |
|
|
94
94
|
|
|
95
95
|
Default paths and environment variable overrides are documented in [Data Sources](https://aiusage.jtanx.com/docs#settings-sources) and [Source Env Vars](https://aiusage.jtanx.com/docs#settings-env).
|
|
96
96
|
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,8 @@ var TOOLS = [
|
|
|
49
49
|
"omp",
|
|
50
50
|
"pi",
|
|
51
51
|
"craft",
|
|
52
|
-
"droid"
|
|
52
|
+
"droid",
|
|
53
|
+
"zcode"
|
|
53
54
|
];
|
|
54
55
|
var MODEL_PROVIDER_MAP = [
|
|
55
56
|
["claude-", "anthropic"],
|
|
@@ -257,8 +258,9 @@ var ClaudeCodeParser = class {
|
|
|
257
258
|
}, context.exchangeRate);
|
|
258
259
|
const costSource = model === "unknown" ? "unknown" : "pricing";
|
|
259
260
|
const provider = inferProvider(model);
|
|
261
|
+
const messageId = parsed.message.id;
|
|
260
262
|
const record = {
|
|
261
|
-
id: generateRecordId(context.deviceInstanceId, context.sourceFile, context.lineOffset),
|
|
263
|
+
id: messageId ? generateRecordId(context.deviceInstanceId, messageId, 0) : generateRecordId(context.deviceInstanceId, context.sourceFile, context.lineOffset),
|
|
262
264
|
ts: ts22,
|
|
263
265
|
ingestedAt: context.now,
|
|
264
266
|
updatedAt: context.now,
|
|
@@ -1414,8 +1416,8 @@ function defaultQoderDbPath() {
|
|
|
1414
1416
|
return join3(home, "Library", "Application Support", "Qoder", "SharedClientCache", "cache", "db", "local.db");
|
|
1415
1417
|
}
|
|
1416
1418
|
if (plat === "win32") {
|
|
1417
|
-
const
|
|
1418
|
-
return join3(
|
|
1419
|
+
const appData = process.env.APPDATA ?? join3(home, "AppData", "Roaming");
|
|
1420
|
+
return join3(appData, "Qoder", "SharedClientCache", "cache", "db", "local.db");
|
|
1419
1421
|
}
|
|
1420
1422
|
const xdgDataHome = process.env.XDG_DATA_HOME ?? join3(home, ".local", "share");
|
|
1421
1423
|
return join3(xdgDataHome, "Qoder", "SharedClientCache", "cache", "db", "local.db");
|
|
@@ -1460,6 +1462,9 @@ function defaultZedDbPath() {
|
|
|
1460
1462
|
}
|
|
1461
1463
|
return join3(xdgDataDir(home, "zed"), "threads", "threads.db");
|
|
1462
1464
|
}
|
|
1465
|
+
function defaultZcodeDbPath() {
|
|
1466
|
+
return join3(homedir2(), ".zcode", "cli", "db", "db.sqlite");
|
|
1467
|
+
}
|
|
1463
1468
|
function probeClaudeCode(ctx) {
|
|
1464
1469
|
const override = envOverride("claude-code", ctx.env);
|
|
1465
1470
|
if (override) return override;
|
|
@@ -1671,6 +1676,15 @@ function probeZed(ctx) {
|
|
|
1671
1676
|
const dbPath = defaultZedDbPath();
|
|
1672
1677
|
return existsSync3(dbPath) ? dbPath : null;
|
|
1673
1678
|
}
|
|
1679
|
+
function probeZcode(ctx) {
|
|
1680
|
+
const override = envOverride("zcode", ctx.env);
|
|
1681
|
+
if (override) return override;
|
|
1682
|
+
if (ctx.env.ZCODE_HOME) return join3(ctx.env.ZCODE_HOME, "cli", "db", "db.sqlite");
|
|
1683
|
+
const legacy = ctx.legacySources?.["zcode"];
|
|
1684
|
+
if (legacy) return legacy;
|
|
1685
|
+
const dbPath = defaultZcodeDbPath();
|
|
1686
|
+
return existsSync3(dbPath) ? dbPath : null;
|
|
1687
|
+
}
|
|
1674
1688
|
function probeGoose(ctx) {
|
|
1675
1689
|
const override = envOverride("goose", ctx.env);
|
|
1676
1690
|
if (override) return override;
|
|
@@ -1753,6 +1767,7 @@ var TOOL_REGISTRY = [
|
|
|
1753
1767
|
{ tool: "antigravity", sourceKey: "antigravity", label: "Antigravity", probe: probeAntigravity },
|
|
1754
1768
|
{ tool: "roocode", sourceKey: "roocode", label: "Roo Code", probe: probeRooCode },
|
|
1755
1769
|
{ tool: "zed", sourceKey: "zed", label: "Zed", probe: probeZed },
|
|
1770
|
+
{ tool: "zcode", sourceKey: "zcode", label: "ZCode", probe: probeZcode },
|
|
1756
1771
|
{ tool: "goose", sourceKey: "goose", label: "Goose", probe: probeGoose },
|
|
1757
1772
|
{ tool: "omp", sourceKey: "omp", label: "oh-my-pi", probe: probeOmp },
|
|
1758
1773
|
{ tool: "pi", sourceKey: "pi", label: "pi", probe: probePi },
|
|
@@ -4957,22 +4972,28 @@ function createApiServer(db, options) {
|
|
|
4957
4972
|
byTool[row.tool] = { tokens: row.tokens, cost: row.cost };
|
|
4958
4973
|
}
|
|
4959
4974
|
const drJoin = getDateRangeFilter(range, from, to, "r", weekStart);
|
|
4960
|
-
const
|
|
4975
|
+
const drJoinO = drJoin.where.replaceAll("r.ts", "COALESCE(r.ts, tc.ts)");
|
|
4976
|
+
const dfJoinRaw = df.where ? df.where.replace(/device_instance_id/g, "r.device_instance_id") : "";
|
|
4977
|
+
const dfJoin = dfJoinRaw.replace(
|
|
4978
|
+
/r\.device_instance_id\s*=\s*@\w+/,
|
|
4979
|
+
"(r.device_instance_id IS NULL OR r.device_instance_id = @deviceId)"
|
|
4980
|
+
);
|
|
4961
4981
|
const tfJoin = getToolFilter(tool, "r");
|
|
4982
|
+
const tfJoinO = tfJoin.where.replaceAll("r.tool", "COALESCE(r.tool, tc.tool)");
|
|
4962
4983
|
const topToolCalls = db.prepare(`
|
|
4963
4984
|
SELECT tc.name, COUNT(*) AS count
|
|
4964
4985
|
FROM tool_calls tc
|
|
4965
|
-
JOIN records r ON r.id = tc.record_id
|
|
4966
|
-
WHERE 1=1 ${dfJoin} ${
|
|
4986
|
+
LEFT JOIN records r ON r.id = tc.record_id
|
|
4987
|
+
WHERE 1=1 ${dfJoin} ${drJoinO} ${tfJoinO}
|
|
4967
4988
|
GROUP BY tc.name ORDER BY count DESC LIMIT 10
|
|
4968
4989
|
`).all({ ...drJoin.params, ...df.params, ...tfJoin.params });
|
|
4969
4990
|
const topMcpServersRaw = db.prepare(`
|
|
4970
4991
|
SELECT tc.name, COUNT(*) AS count
|
|
4971
4992
|
FROM tool_calls tc
|
|
4972
|
-
JOIN records r ON r.id = tc.record_id
|
|
4993
|
+
LEFT JOIN records r ON r.id = tc.record_id
|
|
4973
4994
|
WHERE tc.name LIKE 'mcp\\_\\_%' ESCAPE '\\'
|
|
4974
4995
|
AND INSTR(SUBSTR(tc.name, 6), '__') > 0
|
|
4975
|
-
${dfJoin} ${
|
|
4996
|
+
${dfJoin} ${drJoinO} ${tfJoinO}
|
|
4976
4997
|
GROUP BY tc.name ORDER BY count DESC
|
|
4977
4998
|
`).all({ ...drJoin.params, ...df.params, ...tfJoin.params });
|
|
4978
4999
|
const mcpServerMap = /* @__PURE__ */ new Map();
|
|
@@ -5226,9 +5247,17 @@ function createApiServer(db, options) {
|
|
|
5226
5247
|
json(res, { toolCalls: [] });
|
|
5227
5248
|
return;
|
|
5228
5249
|
}
|
|
5229
|
-
const
|
|
5250
|
+
const drRaw = getDateRangeFilter(range, from, to, "r", weekStart);
|
|
5251
|
+
const dr = {
|
|
5252
|
+
where: drRaw.where.replaceAll("r.ts", "COALESCE(r.ts, tc.ts)"),
|
|
5253
|
+
params: drRaw.params
|
|
5254
|
+
};
|
|
5230
5255
|
const tool = url.searchParams.get("tool");
|
|
5231
|
-
const
|
|
5256
|
+
const tfRaw = getToolFilter(tool, "r");
|
|
5257
|
+
const tf = {
|
|
5258
|
+
where: tfRaw.where.replaceAll("r.tool", "COALESCE(r.tool, tc.tool)"),
|
|
5259
|
+
params: tfRaw.params
|
|
5260
|
+
};
|
|
5232
5261
|
const toolType = url.searchParams.get("toolType");
|
|
5233
5262
|
if (toolType && !["mcp", "skill", "builtin"].includes(toolType)) {
|
|
5234
5263
|
json(res, { error: { code: "INVALID_PARAM", message: "Invalid toolType" } }, 400);
|
|
@@ -5237,14 +5266,14 @@ function createApiServer(db, options) {
|
|
|
5237
5266
|
const ttf = getToolTypeFilter(toolType);
|
|
5238
5267
|
const totalRow = db.prepare(`
|
|
5239
5268
|
SELECT COUNT(*) AS total FROM tool_calls tc
|
|
5240
|
-
JOIN records r ON r.id = tc.record_id
|
|
5269
|
+
LEFT JOIN records r ON r.id = tc.record_id
|
|
5241
5270
|
WHERE 1=1 ${dr.where} ${tf.where} ${ttf}
|
|
5242
5271
|
`).get({ ...dr.params, ...tf.params });
|
|
5243
5272
|
const total = totalRow.total || 1;
|
|
5244
5273
|
const rows = db.prepare(`
|
|
5245
5274
|
SELECT tc.name, COUNT(*) AS count
|
|
5246
5275
|
FROM tool_calls tc
|
|
5247
|
-
JOIN records r ON r.id = tc.record_id
|
|
5276
|
+
LEFT JOIN records r ON r.id = tc.record_id
|
|
5248
5277
|
WHERE 1=1 ${dr.where} ${tf.where} ${ttf}
|
|
5249
5278
|
GROUP BY tc.name ORDER BY count DESC
|
|
5250
5279
|
`).all({ ...dr.params, ...tf.params });
|
|
@@ -6109,7 +6138,8 @@ function defaultFileData() {
|
|
|
6109
6138
|
"omp": {},
|
|
6110
6139
|
"pi": {},
|
|
6111
6140
|
"craft": {},
|
|
6112
|
-
"droid": {}
|
|
6141
|
+
"droid": {},
|
|
6142
|
+
"zcode": {}
|
|
6113
6143
|
};
|
|
6114
6144
|
}
|
|
6115
6145
|
var WatermarkManager = class {
|
|
@@ -6129,7 +6159,7 @@ var WatermarkManager = class {
|
|
|
6129
6159
|
if (parsed && typeof parsed === "object" && !("files" in parsed)) {
|
|
6130
6160
|
return { files: { ...defaultFileData(), ...parsed } };
|
|
6131
6161
|
}
|
|
6132
|
-
return { files: { ...defaultFileData(), ...parsed.files ?? {} }, opencode: parsed.opencode ?? null, hermes: parsed.hermes ?? null, qoder: parsed.qoder ?? null, cursor: parsed.cursor ?? null, goose: parsed.goose ?? null, zed: parsed.zed ?? null, kiro: parsed.kiro ?? null };
|
|
6162
|
+
return { files: { ...defaultFileData(), ...parsed.files ?? {} }, opencode: parsed.opencode ?? null, hermes: parsed.hermes ?? null, qoder: parsed.qoder ?? null, cursor: parsed.cursor ?? null, goose: parsed.goose ?? null, zed: parsed.zed ?? null, kiro: parsed.kiro ?? null, zcode: parsed.zcode ?? null, zcodeTools: parsed.zcodeTools ?? null };
|
|
6133
6163
|
} catch {
|
|
6134
6164
|
return { files: defaultFileData() };
|
|
6135
6165
|
}
|
|
@@ -6198,6 +6228,18 @@ var WatermarkManager = class {
|
|
|
6198
6228
|
setKiroCursor(cursor) {
|
|
6199
6229
|
this.data.kiro = cursor;
|
|
6200
6230
|
}
|
|
6231
|
+
getZcodeCursor() {
|
|
6232
|
+
return this.data.zcode ?? null;
|
|
6233
|
+
}
|
|
6234
|
+
setZcodeCursor(cursor) {
|
|
6235
|
+
this.data.zcode = cursor;
|
|
6236
|
+
}
|
|
6237
|
+
getZcodeToolCursor() {
|
|
6238
|
+
return this.data.zcodeTools ?? null;
|
|
6239
|
+
}
|
|
6240
|
+
setZcodeToolCursor(cursor) {
|
|
6241
|
+
this.data.zcodeTools = cursor;
|
|
6242
|
+
}
|
|
6201
6243
|
};
|
|
6202
6244
|
|
|
6203
6245
|
// src/commands/parse-opencode.ts
|
|
@@ -6972,6 +7014,109 @@ function runParseKiro(db, options) {
|
|
|
6972
7014
|
return { records: [], nextCursor: null, errors: ["no supported Kiro tables found"] };
|
|
6973
7015
|
}
|
|
6974
7016
|
|
|
7017
|
+
// src/commands/parse-zcode.ts
|
|
7018
|
+
function normalizeZcodeModel(value) {
|
|
7019
|
+
if (typeof value !== "string") return "unknown";
|
|
7020
|
+
const trimmed = value.trim();
|
|
7021
|
+
if (!trimmed) return "unknown";
|
|
7022
|
+
return trimmed.toLowerCase();
|
|
7023
|
+
}
|
|
7024
|
+
function runParseZcode(db, options) {
|
|
7025
|
+
const { dbPath, device, deviceInstanceId, platform: platform5, now, cursor, toolCursor, exchangeRate } = options;
|
|
7026
|
+
const records = [];
|
|
7027
|
+
const toolCalls = [];
|
|
7028
|
+
const errors = [];
|
|
7029
|
+
let nextCursor = null;
|
|
7030
|
+
let nextToolCursor = null;
|
|
7031
|
+
const modelRows = db.prepare(`
|
|
7032
|
+
SELECT m.id, m.session_id, m.model_id, m.started_at,
|
|
7033
|
+
m.input_tokens, m.output_tokens, m.reasoning_tokens,
|
|
7034
|
+
m.cache_creation_input_tokens, m.cache_read_input_tokens,
|
|
7035
|
+
s.directory
|
|
7036
|
+
FROM model_usage m
|
|
7037
|
+
LEFT JOIN session s ON s.id = m.session_id
|
|
7038
|
+
WHERE m.status = 'completed'
|
|
7039
|
+
AND (m.started_at > ? OR (m.started_at = ? AND m.id > ?))
|
|
7040
|
+
ORDER BY m.started_at, m.id
|
|
7041
|
+
`).all(
|
|
7042
|
+
cursor?.lastStartedAt ?? 0,
|
|
7043
|
+
cursor?.lastStartedAt ?? 0,
|
|
7044
|
+
cursor?.lastId ?? ""
|
|
7045
|
+
);
|
|
7046
|
+
for (const row of modelRows) {
|
|
7047
|
+
nextCursor = { lastStartedAt: Number(row.started_at), lastId: String(row.id) };
|
|
7048
|
+
const inputTokens = Number(row.input_tokens) || 0;
|
|
7049
|
+
const outputTokens = Number(row.output_tokens) || 0;
|
|
7050
|
+
const thinkingTokens = Number(row.reasoning_tokens) || 0;
|
|
7051
|
+
const cacheReadTokens = Number(row.cache_read_input_tokens) || 0;
|
|
7052
|
+
const cacheWriteTokens = Number(row.cache_creation_input_tokens) || 0;
|
|
7053
|
+
if (inputTokens + outputTokens + thinkingTokens + cacheReadTokens + cacheWriteTokens === 0) continue;
|
|
7054
|
+
const model = normalizeZcodeModel(row.model_id);
|
|
7055
|
+
const provider = inferProvider(model);
|
|
7056
|
+
const ts3 = Number(row.started_at) || now;
|
|
7057
|
+
const recordId = generateRecordId(deviceInstanceId, `${dbPath}:${row.id}`, ts3);
|
|
7058
|
+
const tokenArgs = { inputTokens, outputTokens, cacheReadTokens, cacheWriteTokens, thinkingTokens };
|
|
7059
|
+
const calculatedCost = model !== "unknown" ? calculateCost(model, tokenArgs, exchangeRate) : 0;
|
|
7060
|
+
records.push({
|
|
7061
|
+
id: recordId,
|
|
7062
|
+
ts: ts3,
|
|
7063
|
+
ingestedAt: now,
|
|
7064
|
+
updatedAt: now,
|
|
7065
|
+
lineOffset: 0,
|
|
7066
|
+
tool: "zcode",
|
|
7067
|
+
model,
|
|
7068
|
+
provider,
|
|
7069
|
+
inputTokens,
|
|
7070
|
+
outputTokens,
|
|
7071
|
+
cacheReadTokens,
|
|
7072
|
+
cacheWriteTokens,
|
|
7073
|
+
thinkingTokens,
|
|
7074
|
+
cost: calculatedCost,
|
|
7075
|
+
costSource: calculatedCost > 0 ? "pricing" : "unknown",
|
|
7076
|
+
sessionId: String(row.session_id ?? "unknown"),
|
|
7077
|
+
sourceFile: dbPath,
|
|
7078
|
+
device,
|
|
7079
|
+
deviceInstanceId,
|
|
7080
|
+
platform: platform5,
|
|
7081
|
+
cwd: typeof row.directory === "string" && row.directory ? row.directory : ""
|
|
7082
|
+
});
|
|
7083
|
+
}
|
|
7084
|
+
const toolRows = db.prepare(`
|
|
7085
|
+
SELECT id, tool_name, started_at
|
|
7086
|
+
FROM tool_usage
|
|
7087
|
+
WHERE status = 'completed'
|
|
7088
|
+
AND (started_at > ? OR (started_at = ? AND id > ?))
|
|
7089
|
+
ORDER BY started_at, id
|
|
7090
|
+
`).all(
|
|
7091
|
+
toolCursor?.lastStartedAt ?? 0,
|
|
7092
|
+
toolCursor?.lastStartedAt ?? 0,
|
|
7093
|
+
toolCursor?.lastId ?? ""
|
|
7094
|
+
);
|
|
7095
|
+
let callIndex = 0;
|
|
7096
|
+
for (const row of toolRows) {
|
|
7097
|
+
nextToolCursor = { lastStartedAt: Number(row.started_at), lastId: String(row.id) };
|
|
7098
|
+
const name = typeof row.tool_name === "string" && row.tool_name.trim() ? row.tool_name.trim() : "unknown";
|
|
7099
|
+
const ts3 = Number(row.started_at) || now;
|
|
7100
|
+
toolCalls.push({
|
|
7101
|
+
id: generateOrphanToolCallId("zcode", name, ts3, callIndex),
|
|
7102
|
+
recordId: null,
|
|
7103
|
+
name,
|
|
7104
|
+
ts: ts3,
|
|
7105
|
+
callIndex,
|
|
7106
|
+
// insertToolCall reads (tc as any).tool for orphan calls
|
|
7107
|
+
tool: "zcode"
|
|
7108
|
+
});
|
|
7109
|
+
callIndex++;
|
|
7110
|
+
}
|
|
7111
|
+
return {
|
|
7112
|
+
records,
|
|
7113
|
+
toolCalls,
|
|
7114
|
+
nextCursor: records.length > 0 ? nextCursor : null,
|
|
7115
|
+
nextToolCursor: toolCalls.length > 0 ? nextToolCursor : null,
|
|
7116
|
+
errors
|
|
7117
|
+
};
|
|
7118
|
+
}
|
|
7119
|
+
|
|
6975
7120
|
// src/commands/parse.ts
|
|
6976
7121
|
function extractCwdFromJson(data) {
|
|
6977
7122
|
if (typeof data.cwd === "string" && data.cwd) return data.cwd;
|
|
@@ -7578,6 +7723,45 @@ async function runParse(db, filterTool, options) {
|
|
|
7578
7723
|
errors.push(`${zedDbPath}: ${e instanceof Error ? e.message : e}`);
|
|
7579
7724
|
}
|
|
7580
7725
|
}
|
|
7726
|
+
if (!filterTool || filterTool === "zcode") {
|
|
7727
|
+
const zcodeDbPath = getDbPath("zcode") ?? "";
|
|
7728
|
+
if (existsSync8(zcodeDbPath)) {
|
|
7729
|
+
try {
|
|
7730
|
+
const zcodeDb = new Database2(zcodeDbPath, { readonly: true });
|
|
7731
|
+
try {
|
|
7732
|
+
const result = runParseZcode(zcodeDb, {
|
|
7733
|
+
dbPath: zcodeDbPath,
|
|
7734
|
+
device,
|
|
7735
|
+
deviceInstanceId,
|
|
7736
|
+
platform: devicePlatform,
|
|
7737
|
+
now: Date.now(),
|
|
7738
|
+
cursor: wm.getZcodeCursor(),
|
|
7739
|
+
toolCursor: wm.getZcodeToolCursor(),
|
|
7740
|
+
exchangeRate
|
|
7741
|
+
});
|
|
7742
|
+
for (const record of result.records) insertRecord(db, record);
|
|
7743
|
+
for (const tc of result.toolCalls) insertToolCall(db, tc);
|
|
7744
|
+
if (result.nextCursor) {
|
|
7745
|
+
wm.setZcodeCursor(result.nextCursor);
|
|
7746
|
+
}
|
|
7747
|
+
if (result.nextToolCursor) {
|
|
7748
|
+
wm.setZcodeToolCursor(result.nextToolCursor);
|
|
7749
|
+
}
|
|
7750
|
+
if (result.nextCursor || result.nextToolCursor) {
|
|
7751
|
+
wm.save();
|
|
7752
|
+
}
|
|
7753
|
+
parsedCount += result.records.length;
|
|
7754
|
+
toolCallCount += result.toolCalls.length;
|
|
7755
|
+
errors.push(...result.errors);
|
|
7756
|
+
onProgress({ phase: "Parsing SQLite", tool: "zcode", current: 1, total: 1, records: parsedCount, toolCalls: toolCallCount });
|
|
7757
|
+
} finally {
|
|
7758
|
+
zcodeDb.close();
|
|
7759
|
+
}
|
|
7760
|
+
} catch (e) {
|
|
7761
|
+
errors.push(`${zcodeDbPath}: ${e instanceof Error ? e.message : e}`);
|
|
7762
|
+
}
|
|
7763
|
+
}
|
|
7764
|
+
}
|
|
7581
7765
|
if (deviceInstanceId !== "unknown") {
|
|
7582
7766
|
db.prepare(
|
|
7583
7767
|
`UPDATE records SET device_instance_id = ?, device = ? WHERE device_instance_id = 'unknown'`
|
|
@@ -7937,7 +8121,8 @@ var RECORD_ID_SYNC_TOOLS = /* @__PURE__ */ new Set([
|
|
|
7937
8121
|
"goose",
|
|
7938
8122
|
"zed",
|
|
7939
8123
|
"kiro",
|
|
7940
|
-
"roocode"
|
|
8124
|
+
"roocode",
|
|
8125
|
+
"zcode"
|
|
7941
8126
|
]);
|
|
7942
8127
|
function mapStatsRecordToSyncRecord(record) {
|
|
7943
8128
|
const id = record.sourceFile.startsWith("synced/") ? record.id : RECORD_ID_SYNC_TOOLS.has(record.tool) ? record.id : generateSyncRecordId(record.deviceInstanceId, record.sourceFile, record.lineOffset);
|
|
@@ -10383,7 +10568,7 @@ ${dashboardStatusLine()}
|
|
|
10383
10568
|
import { join as join15 } from "path";
|
|
10384
10569
|
var DB_PATH2 = join15(AIUSAGE_DIR, "cache.db");
|
|
10385
10570
|
var program = new Command();
|
|
10386
|
-
program.name("aiusage").version(true ? "1.5.
|
|
10571
|
+
program.name("aiusage").version(true ? "1.5.5" : "dev").description("CLI tool for AI usage statistics");
|
|
10387
10572
|
program.action(() => {
|
|
10388
10573
|
const unknownCommand = program.args.find((arg) => typeof arg === "string");
|
|
10389
10574
|
if (unknownCommand) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var mt=Object.defineProperty;var wt=(e,n,t)=>n in e?mt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var P=(e,n,t)=>wt(e,typeof n!="symbol"?n+"":n,t);import{o as Oe,t as yt}from"./scheduler.DsWd5xup.js";import{w as ye}from"./index.m3oCcA6N.js";new URL("sveltekit-internal://");function _t(e,n){return e==="/"||n==="ignore"?e:n==="never"?e.endsWith("/")?e.slice(0,-1):e:n==="always"&&!e.endsWith("/")?e+"/":e}function vt(e){return e.split("%25").map(decodeURI).join("%25")}function bt(e){for(const n in e)e[n]=decodeURIComponent(e[n]);return e}function ue({href:e}){return e.split("#")[0]}function At(e,n,t,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(o,c){if(c==="get"||c==="getAll"||c==="has")return f=>(t(f),o[c](f));n();const i=Reflect.get(o,c);return typeof i=="function"?i.bind(o):i}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const o of s)Object.defineProperty(a,o,{get(){return n(),e[o]},enumerable:!0,configurable:!0});return a}const Et="/__data.json",kt=".html__data.json";function St(e){return e.endsWith(".html")?e.replace(/\.html$/,kt):e.replace(/\/$/,"")+Et}function Rt(...e){let n=5381;for(const t of e)if(typeof t=="string"){let r=t.length;for(;r;)n=n*33^t.charCodeAt(--r)}else if(ArrayBuffer.isView(t)){const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=r.length;for(;a;)n=n*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function It(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r<n.length;r++)t[r]=n.charCodeAt(r);return t.buffer}const He=window.fetch;window.fetch=(e,n)=>((e instanceof Request?e.method:(n==null?void 0:n.method)||"GET")!=="GET"&&M.delete(_e(e)),He(e,n));const M=new Map;function Ut(e,n){const t=_e(e,n),r=document.querySelector(t);if(r!=null&&r.textContent){let{body:a,...s}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&M.set(t,{body:a,init:s,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=It(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,n)}function Tt(e,n,t){if(M.size>0){const r=_e(e,t),a=M.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(t==null?void 0:t.cache))return new Response(a.body,a.init);M.delete(r)}}return window.fetch(n,t)}function _e(e,n){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(n!=null&&n.headers||n!=null&&n.body){const a=[];n.headers&&a.push([...new Headers(n.headers)].join(",")),n.body&&(typeof n.body=="string"||ArrayBuffer.isView(n.body))&&a.push(n.body),r+=`[data-hash="${Rt(...a)}"]`}return r}const Lt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Pt(e){const n=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Ot(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return n.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return n.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((i,f)=>{if(f%2){if(i.startsWith("x+"))return de(String.fromCharCode(parseInt(i.slice(2),16)));if(i.startsWith("u+"))return de(String.fromCharCode(...i.slice(2).split("-").map(l=>parseInt(l,16))));const h=Lt.exec(i),[,u,g,p,d]=h;return n.push({name:p,matcher:d,optional:!!u,rest:!!g,chained:g?f===1&&o[0]==="":!1}),g?"(.*?)":u?"([^/]*)?":"([^/]+?)"}return de(i)}).join("")}).join("")}/?$`),params:n}}function jt(e){return!/^\([^)]+\)$/.test(e)}function Ot(e){return e.slice(1).split("/").filter(jt)}function Nt(e,n,t){const r={},a=e.slice(1),s=a.filter(c=>c!==void 0);let o=0;for(let c=0;c<n.length;c+=1){const i=n[c];let f=a[c-o];if(i.chained&&i.rest&&o&&(f=a.slice(c-o,c+1).filter(h=>h).join("/"),o=0),f===void 0){i.rest&&(r[i.name]="");continue}if(!i.matcher||t[i.matcher](f)){r[i.name]=f;const h=n[c+1],u=a[c+1];h&&!h.rest&&h.optional&&u&&i.chained&&(o=0),!h&&!u&&Object.keys(r).length===s.length&&(o=0);continue}if(i.optional&&i.chained){o++;continue}return}if(!o)return r}function de(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function $t({nodes:e,server_loads:n,dictionary:t,matchers:r}){const a=new Set(n);return Object.entries(t).map(([c,[i,f,h]])=>{const{pattern:u,params:g}=Pt(c),p={id:c,exec:d=>{const l=u.exec(d);if(l)return Nt(l,g,r)},errors:[1,...h||[]].map(d=>e[d]),layouts:[0,...f||[]].map(o),leaf:s(i)};return p.errors.length=p.layouts.length=Math.max(p.errors.length,p.layouts.length),p});function s(c){const i=c<0;return i&&(c=~c),[i,e[c]]}function o(c){return c===void 0?c:[a.has(c),e[c]]}}function Ke(e,n=JSON.parse){try{return n(sessionStorage[e])}catch{}}function Ne(e,n,t=JSON.stringify){const r=t(n);try{sessionStorage[e]=r}catch{}}var Me;const L=((Me=globalThis.__sveltekit_16j729l)==null?void 0:Me.base)??"";var qe;const xt=((qe=globalThis.__sveltekit_16j729l)==null?void 0:qe.assets)??L,Ct="1781033150474",We="sveltekit:snapshot",Ye="sveltekit:scroll",Je="sveltekit:states",Dt="sveltekit:pageurl",C="sveltekit:history",H="sveltekit:navigation",z={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},J=location.origin;function ze(e){if(e instanceof URL)return e;let n=document.baseURI;if(!n){const t=document.getElementsByTagName("base");n=t.length?t[0].href:document.URL}return new URL(e,n)}function ve(){return{x:pageXOffset,y:pageYOffset}}function x(e,n){return e.getAttribute(`data-sveltekit-${n}`)}const $e={...z,"":z.hover};function Xe(e){let n=e.assignedSlot??e.parentNode;return(n==null?void 0:n.nodeType)===11&&(n=n.host),n}function Ze(e,n){for(;e&&e!==n;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Xe(e)}}function ge(e,n,t){let r;try{r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||oe(r,n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(r==null?void 0:r.origin)===J&&e.hasAttribute("download");return{url:r,external:s,target:a,download:o}}function X(e){let n=null,t=null,r=null,a=null,s=null,o=null,c=e;for(;c&&c!==document.documentElement;)r===null&&(r=x(c,"preload-code")),a===null&&(a=x(c,"preload-data")),n===null&&(n=x(c,"keepfocus")),t===null&&(t=x(c,"noscroll")),s===null&&(s=x(c,"reload")),o===null&&(o=x(c,"replacestate")),c=Xe(c);function i(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:$e[r??"off"],preload_data:$e[a??"off"],keepfocus:i(n),noscroll:i(t),reload:i(s),replace_state:i(o)}}function xe(e){const n=ye(e);let t=!0;function r(){t=!0,n.update(o=>o)}function a(o){t=!1,n.set(o)}function s(o){let c;return n.subscribe(i=>{(c===void 0||t&&i!==c)&&o(c=i)})}return{notify:r,set:a,subscribe:s}}const Qe={v:()=>{}};function Bt(){const{set:e,subscribe:n}=ye(!1);let t;async function r(){clearTimeout(t);try{const a=await fetch(`${xt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==Ct;return o&&(e(!0),Qe.v(),clearTimeout(t)),o}catch{return!1}}return{subscribe:n,check:r}}function oe(e,n,t){return e.origin!==J||!e.pathname.startsWith(n)?!0:t?!(e.pathname===n+"/"||e.protocol==="file:"&&e.pathname.replace(/\/[^/]+\.html?$/,"")===n):!1}function Ft(e){return Uint8Array.fromBase64(e).buffer}function Vt(e){return Uint8Array.from(Buffer.from(e,"base64")).buffer}function Mt(e){const n=atob(e),t=n.length,r=new Uint8Array(t);for(let a=0;a<t;a++)r[a]=n.charCodeAt(a);return r.buffer}const qt=typeof Uint8Array.fromBase64=="function";var Ge;const Gt=typeof process=="object"&&((Ge=process.versions)==null?void 0:Ge.node)!==void 0,Ht=qt?Ft:Gt?Vt:Mt,Kt=-1,Wt=-2,Yt=-3,Jt=-4,zt=-5,Xt=-6,Zt=-7;function Qt(e,n){if(typeof e=="number")return s(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const t=e,r=Array(t.length);let a=null;function s(o,c=!1){if(o===Kt)return;if(o===Yt)return NaN;if(o===Jt)return 1/0;if(o===zt)return-1/0;if(o===Xt)return-0;if(c||typeof o!="number")throw new Error("Invalid input");if(o in r)return r[o];const i=t[o];if(!i||typeof i!="object")r[o]=i;else if(Array.isArray(i))if(typeof i[0]=="string"){const f=i[0],h=n&&Object.hasOwn(n,f)?n[f]:void 0;if(h){let u=i[1];if(typeof u!="number"&&(u=t.push(i[1])-1),a??(a=new Set),a.has(u))throw new Error("Invalid circular reference");return a.add(u),r[o]=h(s(u)),a.delete(u),r[o]}switch(f){case"Date":r[o]=new Date(i[1]);break;case"Set":const u=new Set;r[o]=u;for(let d=1;d<i.length;d+=1)u.add(s(i[d]));break;case"Map":const g=new Map;r[o]=g;for(let d=1;d<i.length;d+=2)g.set(s(i[d]),s(i[d+1]));break;case"RegExp":r[o]=new RegExp(i[1],i[2]);break;case"Object":{const d=i[1];if(typeof t[d]=="object"&&t[d][0]!=="BigInt")throw new Error("Invalid input");r[o]=Object(s(d));break}case"BigInt":r[o]=BigInt(i[1]);break;case"null":const p=Object.create(null);r[o]=p;for(let d=1;d<i.length;d+=2){if(i[d]==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");p[i[d]]=s(i[d+1])}break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Float16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":case"DataView":{if(t[i[1]][0]!=="ArrayBuffer")throw new Error("Invalid data");const d=globalThis[f],l=s(i[1]);r[o]=i[2]!==void 0?new d(l,i[2],i[3]):new d(l);break}case"ArrayBuffer":{const d=i[1];if(typeof d!="string")throw new Error("Invalid ArrayBuffer encoding");const l=Ht(d);r[o]=l;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const d=f.slice(9);r[o]=Temporal[d].from(i[1]);break}case"URL":{const d=new URL(i[1]);r[o]=d;break}case"URLSearchParams":{const d=new URLSearchParams(i[1]);r[o]=d;break}default:throw new Error(`Unknown type ${f}`)}}else if(i[0]===Zt){const f=i[1];if(!Number.isInteger(f)||f<0)throw new Error("Invalid input");const h=new Array(f);r[o]=h;for(let u=2;u<i.length;u+=2){const g=i[u];if(!Number.isInteger(g)||g<0||g>=f)throw new Error("Invalid input");h[g]=s(i[u+1])}}else{const f=new Array(i.length);r[o]=f;for(let h=0;h<i.length;h+=1){const u=i[h];u!==Wt&&(f[h]=s(u))}}else{const f={};r[o]=f;for(const h of Object.keys(i)){if(h==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const u=i[h];f[h]=s(u)}}return r[o]}return s(0)}const et=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...et];const en=new Set([...et]);[...en];function tn(e){return e.filter(n=>n!=null)}class se{constructor(n,t){this.status=n,typeof t=="string"?this.body={message:t}:t?this.body=t:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class be{constructor(n,t){this.status=n,this.location=t}}class Ae extends Error{constructor(n,t,r){super(r),this.status=n,this.text=t}}const nn="x-sveltekit-invalidated",rn="x-sveltekit-trailing-slash";function Z(e){return e instanceof se||e instanceof Ae?e.status:500}function an(e){return e instanceof Ae?e.text:"Internal Error"}let I,K,he;const on=Oe.toString().includes("$$")||/function \w+\(\) \{\}/.test(Oe.toString());on?(I={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},K={current:null},he={current:!1}):(I=new class{constructor(){P(this,"data",$state.raw({}));P(this,"form",$state.raw(null));P(this,"error",$state.raw(null));P(this,"params",$state.raw({}));P(this,"route",$state.raw({id:null}));P(this,"state",$state.raw({}));P(this,"status",$state.raw(-1));P(this,"url",$state.raw(new URL("https://example.com")))}},K=new class{constructor(){P(this,"current",$state.raw(null))}},he=new class{constructor(){P(this,"current",$state.raw(!1))}},Qe.v=()=>he.current=!0);function sn(e){Object.assign(I,e)}const cn=new Set(["icon","shortcut icon","apple-touch-icon"]),$=Ke(Ye)??{},W=Ke(We)??{},O={url:xe({}),page:xe({}),navigating:ye(null),updated:Bt()};function Ee(e){$[e]=ve()}function ln(e,n){let t=e+1;for(;$[t];)delete $[t],t+=1;for(t=n+1;W[t];)delete W[t],t+=1}function B(e){return location.href=e.href,new Promise(()=>{})}async function tt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(L||"/");e&&await e.update()}}function Ce(){}let ie,me,Q,j,we,A;const nt=[],ee=[];let U=null;const rt=new Set,fn=new Set,q=new Set;let y={branch:[],error:null,url:null},ke=!1,te=!1,De=!0,Y=!1,F=!1,at=!1,Se=!1,ot,R,T,ne;const G=new Set;async function Rn(e,n,t){var a,s,o,c;document.URL!==location.href&&(location.href=location.href),A=e,await((s=(a=e.hooks).init)==null?void 0:s.call(a)),ie=$t(e),j=document.documentElement,we=n,me=e.nodes[0],Q=e.nodes[1],me(),Q(),R=(o=history.state)==null?void 0:o[C],T=(c=history.state)==null?void 0:c[H],R||(R=T=Date.now(),history.replaceState({...history.state,[C]:R,[H]:T},""));const r=$[R];r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y)),t?await yn(we,t):mn(location.href,{replaceState:!0}),wn()}function un(){nt.length=0,Se=!1}function st(e){ee.some(n=>n==null?void 0:n.snapshot)&&(W[e]=ee.map(n=>{var t;return(t=n==null?void 0:n.snapshot)==null?void 0:t.capture()}))}function it(e){var n;(n=W[e])==null||n.forEach((t,r)=>{var a,s;(s=(a=ee[r])==null?void 0:a.snapshot)==null||s.restore(t)})}function Be(){Ee(R),Ne(Ye,$),st(T),Ne(We,W)}async function Re(e,n,t,r){return V({type:"goto",url:ze(e),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:t,nav_token:r,accept:()=>{n.invalidateAll&&(Se=!0)}})}async function dn(e){if(e.id!==(U==null?void 0:U.id)){const n={};G.add(n),U={id:e.id,token:n,promise:lt({...e,preload:n}).then(t=>(G.delete(n),t.type==="loaded"&&t.state.error&&(U=null),t))}}return U.promise}async function pe(e){const n=ie.find(t=>t.exec(ft(e)));n&&await Promise.all([...n.layouts,n.leaf].map(t=>t==null?void 0:t[1]()))}function ct(e,n,t){var s;y=e.state;const r=document.querySelector("style[data-sveltekit]");r&&r.remove(),Object.assign(I,e.props.page),ot=new A.root({target:n,props:{...e.props,stores:O,components:ee},hydrate:t,sync:!1}),it(T);const a={from:null,to:{params:y.params,route:{id:((s=y.route)==null?void 0:s.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};q.forEach(o=>o(a)),te=!0}function re({url:e,params:n,branch:t,status:r,error:a,route:s,form:o}){let c="never";if(L&&(e.pathname===L||e.pathname===L+"/"))c="always";else for(const p of t)(p==null?void 0:p.slash)!==void 0&&(c=p.slash);e.pathname=_t(e.pathname,c),e.search=e.search;const i={type:"loaded",state:{url:e,params:n,branch:t,error:a,route:s},props:{constructors:tn(t).map(p=>p.node.component),page:Le(I)}};o!==void 0&&(i.props.form=o);let f={},h=!I,u=0;for(let p=0;p<Math.max(t.length,y.branch.length);p+=1){const d=t[p],l=y.branch[p];(d==null?void 0:d.data)!==(l==null?void 0:l.data)&&(h=!0),d&&(f={...f,...d.data},h&&(i.props[`data_${u}`]=f),u+=1)}return(!y.url||e.href!==y.url.href||y.error!==a||o!==void 0&&o!==I.form||h)&&(i.props.page={error:a,params:n,route:{id:(s==null?void 0:s.id)??null},state:{},status:r,url:new URL(e),form:o??null,data:h?f:I.data}),i}async function Ie({loader:e,parent:n,url:t,params:r,route:a,server_data_node:s}){var h,u,g;let o=null,c=!0;const i={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},f=await e();if((h=f.universal)!=null&&h.load){let p=function(...l){for(const m of l){const{href:b}=new URL(m,t);i.dependencies.add(b)}};const d={route:new Proxy(a,{get:(l,m)=>(c&&(i.route=!0),l[m])}),params:new Proxy(r,{get:(l,m)=>(c&&i.params.add(m),l[m])}),data:(s==null?void 0:s.data)??null,url:At(t,()=>{c&&(i.url=!0)},l=>{c&&i.search_params.add(l)},A.hash),async fetch(l,m){let b;l instanceof Request?(b=l.url,m={body:l.method==="GET"||l.method==="HEAD"?void 0:await l.blob(),cache:l.cache,credentials:l.credentials,headers:[...l.headers].length?l.headers:void 0,integrity:l.integrity,keepalive:l.keepalive,method:l.method,mode:l.mode,redirect:l.redirect,referrer:l.referrer,referrerPolicy:l.referrerPolicy,signal:l.signal,...m}):b=l;const k=new URL(b,t);return c&&p(k.href),k.origin===t.origin&&(b=k.href.slice(t.origin.length)),te?Tt(b,k.href,m):Ut(b,m)},setHeaders:()=>{},depends:p,parent(){return c&&(i.parent=!0),n()},untrack(l){c=!1;try{return l()}finally{c=!0}}};o=await f.universal.load.call(null,d)??null}return{node:f,loader:e,server:s,universal:(u=f.universal)!=null&&u.load?{type:"data",data:o,uses:i}:null,data:o??(s==null?void 0:s.data)??null,slash:((g=f.universal)==null?void 0:g.trailingSlash)??(s==null?void 0:s.slash)}}function Fe(e,n,t,r,a,s){if(Se)return!0;if(!a)return!1;if(a.parent&&e||a.route&&n||a.url&&t)return!0;for(const o of a.search_params)if(r.has(o))return!0;for(const o of a.params)if(s[o]!==y.params[o])return!0;for(const o of a.dependencies)if(nt.some(c=>c(new URL(o))))return!0;return!1}function Ue(e,n){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?n??null:null}function hn(e,n){if(!e)return new Set(n.searchParams.keys());const t=new Set([...e.searchParams.keys(),...n.searchParams.keys()]);for(const r of t){const a=e.searchParams.getAll(r),s=n.searchParams.getAll(r);a.every(o=>s.includes(o))&&s.every(o=>a.includes(o))&&t.delete(r)}return t}function Ve({error:e,url:n,route:t,params:r}){return{type:"loaded",state:{error:e,url:n,route:t,params:r,branch:[]},props:{page:Le(I),constructors:[]}}}async function lt({id:e,invalidating:n,url:t,params:r,route:a,preload:s}){if((U==null?void 0:U.id)===e)return G.delete(U.token),U.promise;const{errors:o,layouts:c,leaf:i}=a,f=[...c,i];o.forEach(w=>w==null?void 0:w().catch(()=>{})),f.forEach(w=>w==null?void 0:w[1]().catch(()=>{}));let h=null;const u=y.url?e!==ae(y.url):!1,g=y.route?a.id!==y.route.id:!1,p=hn(y.url,t);let d=!1;const l=f.map((w,_)=>{var N;const E=y.branch[_],S=!!(w!=null&&w[0])&&((E==null?void 0:E.loader)!==w[1]||Fe(d,g,u,p,(N=E.server)==null?void 0:N.uses,r));return S&&(d=!0),S});if(l.some(Boolean)){try{h=await ht(t,l)}catch(w){const _=await D(w,{url:t,params:r,route:{id:e}});return G.has(s)?Ve({error:_,url:t,params:r,route:a}):ce({status:Z(w),error:_,url:t,route:a})}if(h.type==="redirect")return h}const m=h==null?void 0:h.nodes;let b=!1;const k=f.map(async(w,_)=>{var le;if(!w)return;const E=y.branch[_],S=m==null?void 0:m[_];if((!S||S.type==="skip")&&w[1]===(E==null?void 0:E.loader)&&!Fe(b,g,u,p,(le=E.universal)==null?void 0:le.uses,r))return E;if(b=!0,(S==null?void 0:S.type)==="error")throw S;return Ie({loader:w[1],url:t,params:r,route:a,parent:async()=>{var je;const Pe={};for(let fe=0;fe<_;fe+=1)Object.assign(Pe,(je=await k[fe])==null?void 0:je.data);return Pe},server_data_node:Ue(S===void 0&&w[0]?{type:"skip"}:S??null,w[0]?E==null?void 0:E.server:void 0)})});for(const w of k)w.catch(()=>{});const v=[];for(let w=0;w<f.length;w+=1)if(f[w])try{v.push(await k[w])}catch(_){if(_ instanceof be)return{type:"redirect",location:_.location};if(G.has(s))return Ve({error:await D(_,{params:r,url:t,route:{id:a.id}}),url:t,params:r,route:a});let E=Z(_),S;if(m!=null&&m.includes(_))E=_.status??E,S=_.error;else if(_ instanceof se)S=_.body;else{if(await O.updated.check())return await tt(),await B(t);S=await D(_,{params:r,url:t,route:{id:a.id}})}const N=await pn(w,v,o);return N?re({url:t,params:r,branch:v.slice(0,N.idx).concat(N.node),status:E,error:S,route:a}):await dt(t,{id:a.id},S,E)}else v.push(void 0);return re({url:t,params:r,branch:v,status:200,error:null,route:a,form:n?void 0:null})}async function pn(e,n,t){for(;e--;)if(t[e]){let r=e;for(;!n[r];)r-=1;try{return{idx:r+1,node:{node:await t[e](),loader:t[e],data:{},server:null,universal:null}}}catch{continue}}}async function ce({status:e,error:n,url:t,route:r}){const a={};let s=null;if(A.server_loads[0]===0)try{const c=await ht(t,[!0]);if(c.type!=="data"||c.nodes[0]&&c.nodes[0].type!=="data")throw 0;s=c.nodes[0]??null}catch{(t.origin!==J||t.pathname!==location.pathname||ke)&&await B(t)}try{const c=await Ie({loader:me,url:t,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ue(s)}),i={node:await Q(),loader:Q,universal:null,server:null,data:null};return re({url:t,params:a,branch:[c,i],status:e,error:n,route:null})}catch(c){if(c instanceof be)return Re(new URL(c.location,location.href),{},0);throw c}}function Te(e,n){if(!e||oe(e,L,A.hash))return;let t;try{if(t=A.hooks.reroute({url:new URL(e)})??e,typeof t=="string"){const a=new URL(e);A.hash?a.hash=t:a.pathname=t,t=a}}catch{return}const r=ft(t);for(const a of ie){const s=a.exec(r);if(s)return{id:ae(e),invalidating:n,route:a,params:bt(s),url:e}}}function ft(e){return vt(A.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(L.length))||"/"}function ae(e){return(A.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function ut({url:e,type:n,intent:t,delta:r}){let a=!1;const s=gt(y,t,e,n);r!==void 0&&(s.navigation.delta=r);const o={...s.navigation,cancel:()=>{a=!0,s.reject(new Error("navigation cancelled"))}};return Y||rt.forEach(c=>c(o)),a?null:s}async function V({type:e,url:n,popped:t,keepfocus:r,noscroll:a,replace_state:s,state:o={},redirect_count:c=0,nav_token:i={},accept:f=Ce,block:h=Ce}){const u=Te(n,!1),g=ut({url:n,type:e,delta:t==null?void 0:t.delta,intent:u});if(!g){h();return}const p=R,d=T;f(),Y=!0,te&&O.navigating.set(K.current=g.navigation),ne=i;let l=u&&await lt(u);if(!l){if(oe(n,L,A.hash))return await B(n);l=await dt(n,{id:null},await D(new Ae(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(u==null?void 0:u.url)||n,ne!==i)return g.reject(new Error("navigation aborted")),!1;if(l.type==="redirect")if(c>=20)l=await ce({status:500,error:await D(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return Re(new URL(l.location,n).href,{},c+1,i),!1;else l.props.page.status>=400&&await O.updated.check()&&(await tt(),await B(n));if(un(),Ee(p),st(d),l.props.page.url.pathname!==n.pathname&&(n.pathname=l.props.page.url.pathname),o=t?t.state:o,!t){const v=s?0:1,w={[C]:R+=v,[H]:T+=v,[Je]:o};(s?history.replaceState:history.pushState).call(history,w,"",n),s||ln(R,T)}if(U=null,l.props.page.state=o,te){y=l.state,l.props.page&&(l.props.page.url=n);const v=(await Promise.all(Array.from(fn,w=>w(g.navigation)))).filter(w=>typeof w=="function");if(v.length>0){let w=function(){v.forEach(_=>{q.delete(_)})};v.push(w),v.forEach(_=>{q.add(_)})}ot.$set(l.props),sn(l.props.page),at=!0}else ct(l,we,!1);const{activeElement:m}=document;await yt();const b=t?t.scroll:a?ve():null;if(De){const v=n.hash&&document.getElementById(decodeURIComponent(A.hash?n.hash.split("#")[2]??"":n.hash.slice(1)));b?scrollTo(b.x,b.y):v?v.scrollIntoView():scrollTo(0,0)}const k=document.activeElement!==m&&document.activeElement!==document.body;!r&&!k&&_n(),De=!0,l.props.page&&Object.assign(I,l.props.page),Y=!1,e==="popstate"&&it(T),g.fulfil(void 0),q.forEach(v=>v(g.navigation)),O.navigating.set(K.current=null)}async function dt(e,n,t,r){return e.origin===J&&e.pathname===location.pathname&&!ke?await ce({status:r,error:t,url:e,route:n}):await B(e)}function gn(){let e;j.addEventListener("mousemove",s=>{const o=s.target;clearTimeout(e),e=setTimeout(()=>{r(o,2)},20)});function n(s){s.defaultPrevented||r(s.composedPath()[0],1)}j.addEventListener("mousedown",n),j.addEventListener("touchstart",n,{passive:!0});const t=new IntersectionObserver(s=>{for(const o of s)o.isIntersecting&&(pe(new URL(o.target.href)),t.unobserve(o.target))},{threshold:0});function r(s,o){const c=Ze(s,j);if(!c)return;const{url:i,external:f,download:h}=ge(c,L,A.hash);if(f||h)return;const u=X(c),g=i&&ae(y.url)===ae(i);if(!u.reload&&!g)if(o<=u.preload_data){const p=Te(i,!1);p&&dn(p)}else o<=u.preload_code&&pe(i)}function a(){t.disconnect();for(const s of j.querySelectorAll("a")){const{url:o,external:c,download:i}=ge(s,L,A.hash);if(c||i)continue;const f=X(s);f.reload||(f.preload_code===z.viewport&&t.observe(s),f.preload_code===z.eager&&pe(o))}}q.add(a),a()}function D(e,n){if(e instanceof se)return e.body;const t=Z(e),r=an(e);return A.hooks.handleError({error:e,event:n,status:t,message:r})??{message:r}}function mn(e,n={}){return e=new URL(ze(e)),e.origin!==J?Promise.reject(new Error("goto: invalid URL")):Re(e,n,0)}function wn(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let r=!1;if(Be(),!Y){const a=gt(y,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};rt.forEach(o=>o(s))}r?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Be()}),(n=navigator.connection)!=null&&n.saveData||gn(),j.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const r=Ze(t.composedPath()[0],j);if(!r)return;const{url:a,external:s,target:o,download:c}=ge(r,L,A.hash);if(!a)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const i=X(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||c)return;const[h,u]=(A.hash?a.hash.replace(/^#/,""):a.href).split("#"),g=h===ue(location);if(s||i.reload&&(!g||!u)){ut({url:a,type:"link"})?Y=!0:t.preventDefault();return}if(u!==void 0&&g){const[,p]=y.url.href.split("#");if(p===u){if(t.preventDefault(),u===""||u==="top"&&r.ownerDocument.getElementById("top")===null)window.scrollTo({top:0});else{const d=r.ownerDocument.getElementById(decodeURIComponent(u));d&&(d.scrollIntoView(),d.focus())}return}if(F=!0,Ee(R),e(a),!i.replace_state)return;F=!1}t.preventDefault(),await new Promise(p=>{requestAnimationFrame(()=>{setTimeout(p,0)}),setTimeout(p,100)}),V({type:"link",url:a,keepfocus:i.keepfocus,noscroll:i.noscroll,replace_state:i.replace_state??a.href===location.href})}),j.addEventListener("submit",t=>{if(t.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(t.target),a=t.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const c=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(oe(c,L,!1))return;const i=t.target,f=X(i);if(f.reload)return;t.preventDefault(),t.stopPropagation();const h=new FormData(i),u=a==null?void 0:a.getAttribute("name");u&&h.append(u,(a==null?void 0:a.getAttribute("value"))??""),c.search=new URLSearchParams(h).toString(),V({type:"form",url:c,keepfocus:f.keepfocus,noscroll:f.noscroll,replace_state:f.replace_state??c.href===location.href})}),addEventListener("popstate",async t=>{var r;if((r=t.state)!=null&&r[C]){const a=t.state[C];if(ne={},a===R)return;const s=$[a],o=t.state[Je]??{},c=new URL(t.state[Dt]??location.href),i=t.state[H],f=y.url?ue(location)===ue(y.url):!1;if(i===T&&(at||f)){o!==I.state&&(I.state=o),e(c),$[R]=ve(),s&&scrollTo(s.x,s.y),R=a;return}const u=a-R;await V({type:"popstate",url:c,popped:{state:o,scroll:s,delta:u},accept:()=>{R=a,T=i},block:()=>{history.go(-u)},nav_token:ne})}else if(!F){const a=new URL(location.href);e(a)}}),addEventListener("hashchange",()=>{F?(F=!1,history.replaceState({...history.state,[C]:++R,[H]:T},"",location.href)):A.hash&&y.url.hash===location.hash&&V({type:"goto",url:y.url})});for(const t of document.querySelectorAll("link"))cn.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&O.navigating.set(K.current=null)});function e(t){y.url=I.url=t,O.page.set(Le(I)),O.page.notify()}}async function yn(e,{status:n=200,error:t,node_ids:r,params:a,route:s,data:o,form:c}){ke=!0;const i=new URL(location.href);({params:a={},route:s={id:null}}=Te(i,!1)||{});let f,h=!0;try{const u=r.map(async(d,l)=>{const m=o[l];return m!=null&&m.uses&&(m.uses=pt(m.uses)),Ie({loader:A.nodes[d],url:i,params:a,route:s,parent:async()=>{const b={};for(let k=0;k<l;k+=1)Object.assign(b,(await u[k]).data);return b},server_data_node:Ue(m)})}),g=await Promise.all(u),p=ie.find(({id:d})=>d===s.id);if(p){const d=p.layouts;for(let l=0;l<d.length;l++)d[l]||g.splice(l,0,void 0)}f=re({url:i,params:a,branch:g,status:n,error:t,form:c,route:p??null})}catch(u){if(u instanceof be){await B(new URL(u.location,location.href));return}f=await ce({status:Z(u),error:await D(u,{url:i,params:a,route:s}),url:i,route:s}),e.textContent="",h=!1}f.props.page&&(f.props.page.state={}),ct(f,e,h)}async function ht(e,n){var a;const t=new URL(e);t.pathname=St(e.pathname),e.pathname.endsWith("/")&&t.searchParams.append(rn,"1"),t.searchParams.append(nn,n.map(s=>s?"1":"0").join(""));const r=await He(t.href);if(!r.ok){let s;throw(a=r.headers.get("content-type"))!=null&&a.includes("application/json")?s=await r.json():r.status===404?s="Not Found":r.status===500&&(s="Internal Error"),new se(r.status,s)}return new Promise(async s=>{var u;const o=new Map,c=r.body.getReader(),i=new TextDecoder;function f(g){return Qt(g,{...A.decoders,Promise:p=>new Promise((d,l)=>{o.set(p,{fulfil:d,reject:l})})})}let h="";for(;;){const{done:g,value:p}=await c.read();if(g&&!h)break;for(h+=!p&&h?`
|
|
1
|
+
var mt=Object.defineProperty;var wt=(e,n,t)=>n in e?mt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var P=(e,n,t)=>wt(e,typeof n!="symbol"?n+"":n,t);import{o as je,t as yt}from"./scheduler.DsWd5xup.js";import{w as ye}from"./index.m3oCcA6N.js";new URL("sveltekit-internal://");function _t(e,n){return e==="/"||n==="ignore"?e:n==="never"?e.endsWith("/")?e.slice(0,-1):e:n==="always"&&!e.endsWith("/")?e+"/":e}function vt(e){return e.split("%25").map(decodeURI).join("%25")}function bt(e){for(const n in e)e[n]=decodeURIComponent(e[n]);return e}function ue({href:e}){return e.split("#")[0]}function At(e,n,t,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(o,c){if(c==="get"||c==="getAll"||c==="has")return f=>(t(f),o[c](f));n();const i=Reflect.get(o,c);return typeof i=="function"?i.bind(o):i}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const o of s)Object.defineProperty(a,o,{get(){return n(),e[o]},enumerable:!0,configurable:!0});return a}const Et="/__data.json",kt=".html__data.json";function St(e){return e.endsWith(".html")?e.replace(/\.html$/,kt):e.replace(/\/$/,"")+Et}function Rt(...e){let n=5381;for(const t of e)if(typeof t=="string"){let r=t.length;for(;r;)n=n*33^t.charCodeAt(--r)}else if(ArrayBuffer.isView(t)){const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=r.length;for(;a;)n=n*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function It(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r<n.length;r++)t[r]=n.charCodeAt(r);return t.buffer}const He=window.fetch;window.fetch=(e,n)=>((e instanceof Request?e.method:(n==null?void 0:n.method)||"GET")!=="GET"&&M.delete(_e(e)),He(e,n));const M=new Map;function Ut(e,n){const t=_e(e,n),r=document.querySelector(t);if(r!=null&&r.textContent){let{body:a,...s}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&M.set(t,{body:a,init:s,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=It(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,n)}function Tt(e,n,t){if(M.size>0){const r=_e(e,t),a=M.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(t==null?void 0:t.cache))return new Response(a.body,a.init);M.delete(r)}}return window.fetch(n,t)}function _e(e,n){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(n!=null&&n.headers||n!=null&&n.body){const a=[];n.headers&&a.push([...new Headers(n.headers)].join(",")),n.body&&(typeof n.body=="string"||ArrayBuffer.isView(n.body))&&a.push(n.body),r+=`[data-hash="${Rt(...a)}"]`}return r}const Lt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Pt(e){const n=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${jt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return n.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return n.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((i,f)=>{if(f%2){if(i.startsWith("x+"))return de(String.fromCharCode(parseInt(i.slice(2),16)));if(i.startsWith("u+"))return de(String.fromCharCode(...i.slice(2).split("-").map(l=>parseInt(l,16))));const h=Lt.exec(i),[,u,g,p,d]=h;return n.push({name:p,matcher:d,optional:!!u,rest:!!g,chained:g?f===1&&o[0]==="":!1}),g?"(.*?)":u?"([^/]*)?":"([^/]+?)"}return de(i)}).join("")}).join("")}/?$`),params:n}}function Ot(e){return!/^\([^)]+\)$/.test(e)}function jt(e){return e.slice(1).split("/").filter(Ot)}function Nt(e,n,t){const r={},a=e.slice(1),s=a.filter(c=>c!==void 0);let o=0;for(let c=0;c<n.length;c+=1){const i=n[c];let f=a[c-o];if(i.chained&&i.rest&&o&&(f=a.slice(c-o,c+1).filter(h=>h).join("/"),o=0),f===void 0){i.rest&&(r[i.name]="");continue}if(!i.matcher||t[i.matcher](f)){r[i.name]=f;const h=n[c+1],u=a[c+1];h&&!h.rest&&h.optional&&u&&i.chained&&(o=0),!h&&!u&&Object.keys(r).length===s.length&&(o=0);continue}if(i.optional&&i.chained){o++;continue}return}if(!o)return r}function de(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function xt({nodes:e,server_loads:n,dictionary:t,matchers:r}){const a=new Set(n);return Object.entries(t).map(([c,[i,f,h]])=>{const{pattern:u,params:g}=Pt(c),p={id:c,exec:d=>{const l=u.exec(d);if(l)return Nt(l,g,r)},errors:[1,...h||[]].map(d=>e[d]),layouts:[0,...f||[]].map(o),leaf:s(i)};return p.errors.length=p.layouts.length=Math.max(p.errors.length,p.layouts.length),p});function s(c){const i=c<0;return i&&(c=~c),[i,e[c]]}function o(c){return c===void 0?c:[a.has(c),e[c]]}}function Ke(e,n=JSON.parse){try{return n(sessionStorage[e])}catch{}}function Ne(e,n,t=JSON.stringify){const r=t(n);try{sessionStorage[e]=r}catch{}}var Me;const L=((Me=globalThis.__sveltekit_1gx35br)==null?void 0:Me.base)??"";var qe;const $t=((qe=globalThis.__sveltekit_1gx35br)==null?void 0:qe.assets)??L,Ct="1781662306648",We="sveltekit:snapshot",Ye="sveltekit:scroll",Je="sveltekit:states",Dt="sveltekit:pageurl",C="sveltekit:history",H="sveltekit:navigation",z={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},J=location.origin;function ze(e){if(e instanceof URL)return e;let n=document.baseURI;if(!n){const t=document.getElementsByTagName("base");n=t.length?t[0].href:document.URL}return new URL(e,n)}function ve(){return{x:pageXOffset,y:pageYOffset}}function $(e,n){return e.getAttribute(`data-sveltekit-${n}`)}const xe={...z,"":z.hover};function Xe(e){let n=e.assignedSlot??e.parentNode;return(n==null?void 0:n.nodeType)===11&&(n=n.host),n}function Ze(e,n){for(;e&&e!==n;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Xe(e)}}function ge(e,n,t){let r;try{r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||oe(r,n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(r==null?void 0:r.origin)===J&&e.hasAttribute("download");return{url:r,external:s,target:a,download:o}}function X(e){let n=null,t=null,r=null,a=null,s=null,o=null,c=e;for(;c&&c!==document.documentElement;)r===null&&(r=$(c,"preload-code")),a===null&&(a=$(c,"preload-data")),n===null&&(n=$(c,"keepfocus")),t===null&&(t=$(c,"noscroll")),s===null&&(s=$(c,"reload")),o===null&&(o=$(c,"replacestate")),c=Xe(c);function i(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:xe[r??"off"],preload_data:xe[a??"off"],keepfocus:i(n),noscroll:i(t),reload:i(s),replace_state:i(o)}}function $e(e){const n=ye(e);let t=!0;function r(){t=!0,n.update(o=>o)}function a(o){t=!1,n.set(o)}function s(o){let c;return n.subscribe(i=>{(c===void 0||t&&i!==c)&&o(c=i)})}return{notify:r,set:a,subscribe:s}}const Qe={v:()=>{}};function Bt(){const{set:e,subscribe:n}=ye(!1);let t;async function r(){clearTimeout(t);try{const a=await fetch(`${$t}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==Ct;return o&&(e(!0),Qe.v(),clearTimeout(t)),o}catch{return!1}}return{subscribe:n,check:r}}function oe(e,n,t){return e.origin!==J||!e.pathname.startsWith(n)?!0:t?!(e.pathname===n+"/"||e.protocol==="file:"&&e.pathname.replace(/\/[^/]+\.html?$/,"")===n):!1}function Ft(e){return Uint8Array.fromBase64(e).buffer}function Vt(e){return Uint8Array.from(Buffer.from(e,"base64")).buffer}function Mt(e){const n=atob(e),t=n.length,r=new Uint8Array(t);for(let a=0;a<t;a++)r[a]=n.charCodeAt(a);return r.buffer}const qt=typeof Uint8Array.fromBase64=="function";var Ge;const Gt=typeof process=="object"&&((Ge=process.versions)==null?void 0:Ge.node)!==void 0,Ht=qt?Ft:Gt?Vt:Mt,Kt=-1,Wt=-2,Yt=-3,Jt=-4,zt=-5,Xt=-6,Zt=-7;function Qt(e,n){if(typeof e=="number")return s(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const t=e,r=Array(t.length);let a=null;function s(o,c=!1){if(o===Kt)return;if(o===Yt)return NaN;if(o===Jt)return 1/0;if(o===zt)return-1/0;if(o===Xt)return-0;if(c||typeof o!="number")throw new Error("Invalid input");if(o in r)return r[o];const i=t[o];if(!i||typeof i!="object")r[o]=i;else if(Array.isArray(i))if(typeof i[0]=="string"){const f=i[0],h=n&&Object.hasOwn(n,f)?n[f]:void 0;if(h){let u=i[1];if(typeof u!="number"&&(u=t.push(i[1])-1),a??(a=new Set),a.has(u))throw new Error("Invalid circular reference");return a.add(u),r[o]=h(s(u)),a.delete(u),r[o]}switch(f){case"Date":r[o]=new Date(i[1]);break;case"Set":const u=new Set;r[o]=u;for(let d=1;d<i.length;d+=1)u.add(s(i[d]));break;case"Map":const g=new Map;r[o]=g;for(let d=1;d<i.length;d+=2)g.set(s(i[d]),s(i[d+1]));break;case"RegExp":r[o]=new RegExp(i[1],i[2]);break;case"Object":{const d=i[1];if(typeof t[d]=="object"&&t[d][0]!=="BigInt")throw new Error("Invalid input");r[o]=Object(s(d));break}case"BigInt":r[o]=BigInt(i[1]);break;case"null":const p=Object.create(null);r[o]=p;for(let d=1;d<i.length;d+=2){if(i[d]==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");p[i[d]]=s(i[d+1])}break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Float16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":case"DataView":{if(t[i[1]][0]!=="ArrayBuffer")throw new Error("Invalid data");const d=globalThis[f],l=s(i[1]);r[o]=i[2]!==void 0?new d(l,i[2],i[3]):new d(l);break}case"ArrayBuffer":{const d=i[1];if(typeof d!="string")throw new Error("Invalid ArrayBuffer encoding");const l=Ht(d);r[o]=l;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const d=f.slice(9);r[o]=Temporal[d].from(i[1]);break}case"URL":{const d=new URL(i[1]);r[o]=d;break}case"URLSearchParams":{const d=new URLSearchParams(i[1]);r[o]=d;break}default:throw new Error(`Unknown type ${f}`)}}else if(i[0]===Zt){const f=i[1];if(!Number.isInteger(f)||f<0)throw new Error("Invalid input");const h=new Array(f);r[o]=h;for(let u=2;u<i.length;u+=2){const g=i[u];if(!Number.isInteger(g)||g<0||g>=f)throw new Error("Invalid input");h[g]=s(i[u+1])}}else{const f=new Array(i.length);r[o]=f;for(let h=0;h<i.length;h+=1){const u=i[h];u!==Wt&&(f[h]=s(u))}}else{const f={};r[o]=f;for(const h of Object.keys(i)){if(h==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const u=i[h];f[h]=s(u)}}return r[o]}return s(0)}const et=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...et];const en=new Set([...et]);[...en];function tn(e){return e.filter(n=>n!=null)}class se{constructor(n,t){this.status=n,typeof t=="string"?this.body={message:t}:t?this.body=t:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class be{constructor(n,t){this.status=n,this.location=t}}class Ae extends Error{constructor(n,t,r){super(r),this.status=n,this.text=t}}const nn="x-sveltekit-invalidated",rn="x-sveltekit-trailing-slash";function Z(e){return e instanceof se||e instanceof Ae?e.status:500}function an(e){return e instanceof Ae?e.text:"Internal Error"}let I,K,he;const on=je.toString().includes("$$")||/function \w+\(\) \{\}/.test(je.toString());on?(I={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},K={current:null},he={current:!1}):(I=new class{constructor(){P(this,"data",$state.raw({}));P(this,"form",$state.raw(null));P(this,"error",$state.raw(null));P(this,"params",$state.raw({}));P(this,"route",$state.raw({id:null}));P(this,"state",$state.raw({}));P(this,"status",$state.raw(-1));P(this,"url",$state.raw(new URL("https://example.com")))}},K=new class{constructor(){P(this,"current",$state.raw(null))}},he=new class{constructor(){P(this,"current",$state.raw(!1))}},Qe.v=()=>he.current=!0);function sn(e){Object.assign(I,e)}const cn=new Set(["icon","shortcut icon","apple-touch-icon"]),x=Ke(Ye)??{},W=Ke(We)??{},j={url:$e({}),page:$e({}),navigating:ye(null),updated:Bt()};function Ee(e){x[e]=ve()}function ln(e,n){let t=e+1;for(;x[t];)delete x[t],t+=1;for(t=n+1;W[t];)delete W[t],t+=1}function B(e){return location.href=e.href,new Promise(()=>{})}async function tt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(L||"/");e&&await e.update()}}function Ce(){}let ie,me,Q,O,we,A;const nt=[],ee=[];let U=null;const rt=new Set,fn=new Set,q=new Set;let y={branch:[],error:null,url:null},ke=!1,te=!1,De=!0,Y=!1,F=!1,at=!1,Se=!1,ot,R,T,ne;const G=new Set;async function Rn(e,n,t){var a,s,o,c;document.URL!==location.href&&(location.href=location.href),A=e,await((s=(a=e.hooks).init)==null?void 0:s.call(a)),ie=xt(e),O=document.documentElement,we=n,me=e.nodes[0],Q=e.nodes[1],me(),Q(),R=(o=history.state)==null?void 0:o[C],T=(c=history.state)==null?void 0:c[H],R||(R=T=Date.now(),history.replaceState({...history.state,[C]:R,[H]:T},""));const r=x[R];r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y)),t?await yn(we,t):mn(location.href,{replaceState:!0}),wn()}function un(){nt.length=0,Se=!1}function st(e){ee.some(n=>n==null?void 0:n.snapshot)&&(W[e]=ee.map(n=>{var t;return(t=n==null?void 0:n.snapshot)==null?void 0:t.capture()}))}function it(e){var n;(n=W[e])==null||n.forEach((t,r)=>{var a,s;(s=(a=ee[r])==null?void 0:a.snapshot)==null||s.restore(t)})}function Be(){Ee(R),Ne(Ye,x),st(T),Ne(We,W)}async function Re(e,n,t,r){return V({type:"goto",url:ze(e),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:t,nav_token:r,accept:()=>{n.invalidateAll&&(Se=!0)}})}async function dn(e){if(e.id!==(U==null?void 0:U.id)){const n={};G.add(n),U={id:e.id,token:n,promise:lt({...e,preload:n}).then(t=>(G.delete(n),t.type==="loaded"&&t.state.error&&(U=null),t))}}return U.promise}async function pe(e){const n=ie.find(t=>t.exec(ft(e)));n&&await Promise.all([...n.layouts,n.leaf].map(t=>t==null?void 0:t[1]()))}function ct(e,n,t){var s;y=e.state;const r=document.querySelector("style[data-sveltekit]");r&&r.remove(),Object.assign(I,e.props.page),ot=new A.root({target:n,props:{...e.props,stores:j,components:ee},hydrate:t,sync:!1}),it(T);const a={from:null,to:{params:y.params,route:{id:((s=y.route)==null?void 0:s.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};q.forEach(o=>o(a)),te=!0}function re({url:e,params:n,branch:t,status:r,error:a,route:s,form:o}){let c="never";if(L&&(e.pathname===L||e.pathname===L+"/"))c="always";else for(const p of t)(p==null?void 0:p.slash)!==void 0&&(c=p.slash);e.pathname=_t(e.pathname,c),e.search=e.search;const i={type:"loaded",state:{url:e,params:n,branch:t,error:a,route:s},props:{constructors:tn(t).map(p=>p.node.component),page:Le(I)}};o!==void 0&&(i.props.form=o);let f={},h=!I,u=0;for(let p=0;p<Math.max(t.length,y.branch.length);p+=1){const d=t[p],l=y.branch[p];(d==null?void 0:d.data)!==(l==null?void 0:l.data)&&(h=!0),d&&(f={...f,...d.data},h&&(i.props[`data_${u}`]=f),u+=1)}return(!y.url||e.href!==y.url.href||y.error!==a||o!==void 0&&o!==I.form||h)&&(i.props.page={error:a,params:n,route:{id:(s==null?void 0:s.id)??null},state:{},status:r,url:new URL(e),form:o??null,data:h?f:I.data}),i}async function Ie({loader:e,parent:n,url:t,params:r,route:a,server_data_node:s}){var h,u,g;let o=null,c=!0;const i={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},f=await e();if((h=f.universal)!=null&&h.load){let p=function(...l){for(const m of l){const{href:b}=new URL(m,t);i.dependencies.add(b)}};const d={route:new Proxy(a,{get:(l,m)=>(c&&(i.route=!0),l[m])}),params:new Proxy(r,{get:(l,m)=>(c&&i.params.add(m),l[m])}),data:(s==null?void 0:s.data)??null,url:At(t,()=>{c&&(i.url=!0)},l=>{c&&i.search_params.add(l)},A.hash),async fetch(l,m){let b;l instanceof Request?(b=l.url,m={body:l.method==="GET"||l.method==="HEAD"?void 0:await l.blob(),cache:l.cache,credentials:l.credentials,headers:[...l.headers].length?l.headers:void 0,integrity:l.integrity,keepalive:l.keepalive,method:l.method,mode:l.mode,redirect:l.redirect,referrer:l.referrer,referrerPolicy:l.referrerPolicy,signal:l.signal,...m}):b=l;const k=new URL(b,t);return c&&p(k.href),k.origin===t.origin&&(b=k.href.slice(t.origin.length)),te?Tt(b,k.href,m):Ut(b,m)},setHeaders:()=>{},depends:p,parent(){return c&&(i.parent=!0),n()},untrack(l){c=!1;try{return l()}finally{c=!0}}};o=await f.universal.load.call(null,d)??null}return{node:f,loader:e,server:s,universal:(u=f.universal)!=null&&u.load?{type:"data",data:o,uses:i}:null,data:o??(s==null?void 0:s.data)??null,slash:((g=f.universal)==null?void 0:g.trailingSlash)??(s==null?void 0:s.slash)}}function Fe(e,n,t,r,a,s){if(Se)return!0;if(!a)return!1;if(a.parent&&e||a.route&&n||a.url&&t)return!0;for(const o of a.search_params)if(r.has(o))return!0;for(const o of a.params)if(s[o]!==y.params[o])return!0;for(const o of a.dependencies)if(nt.some(c=>c(new URL(o))))return!0;return!1}function Ue(e,n){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?n??null:null}function hn(e,n){if(!e)return new Set(n.searchParams.keys());const t=new Set([...e.searchParams.keys(),...n.searchParams.keys()]);for(const r of t){const a=e.searchParams.getAll(r),s=n.searchParams.getAll(r);a.every(o=>s.includes(o))&&s.every(o=>a.includes(o))&&t.delete(r)}return t}function Ve({error:e,url:n,route:t,params:r}){return{type:"loaded",state:{error:e,url:n,route:t,params:r,branch:[]},props:{page:Le(I),constructors:[]}}}async function lt({id:e,invalidating:n,url:t,params:r,route:a,preload:s}){if((U==null?void 0:U.id)===e)return G.delete(U.token),U.promise;const{errors:o,layouts:c,leaf:i}=a,f=[...c,i];o.forEach(w=>w==null?void 0:w().catch(()=>{})),f.forEach(w=>w==null?void 0:w[1]().catch(()=>{}));let h=null;const u=y.url?e!==ae(y.url):!1,g=y.route?a.id!==y.route.id:!1,p=hn(y.url,t);let d=!1;const l=f.map((w,_)=>{var N;const E=y.branch[_],S=!!(w!=null&&w[0])&&((E==null?void 0:E.loader)!==w[1]||Fe(d,g,u,p,(N=E.server)==null?void 0:N.uses,r));return S&&(d=!0),S});if(l.some(Boolean)){try{h=await ht(t,l)}catch(w){const _=await D(w,{url:t,params:r,route:{id:e}});return G.has(s)?Ve({error:_,url:t,params:r,route:a}):ce({status:Z(w),error:_,url:t,route:a})}if(h.type==="redirect")return h}const m=h==null?void 0:h.nodes;let b=!1;const k=f.map(async(w,_)=>{var le;if(!w)return;const E=y.branch[_],S=m==null?void 0:m[_];if((!S||S.type==="skip")&&w[1]===(E==null?void 0:E.loader)&&!Fe(b,g,u,p,(le=E.universal)==null?void 0:le.uses,r))return E;if(b=!0,(S==null?void 0:S.type)==="error")throw S;return Ie({loader:w[1],url:t,params:r,route:a,parent:async()=>{var Oe;const Pe={};for(let fe=0;fe<_;fe+=1)Object.assign(Pe,(Oe=await k[fe])==null?void 0:Oe.data);return Pe},server_data_node:Ue(S===void 0&&w[0]?{type:"skip"}:S??null,w[0]?E==null?void 0:E.server:void 0)})});for(const w of k)w.catch(()=>{});const v=[];for(let w=0;w<f.length;w+=1)if(f[w])try{v.push(await k[w])}catch(_){if(_ instanceof be)return{type:"redirect",location:_.location};if(G.has(s))return Ve({error:await D(_,{params:r,url:t,route:{id:a.id}}),url:t,params:r,route:a});let E=Z(_),S;if(m!=null&&m.includes(_))E=_.status??E,S=_.error;else if(_ instanceof se)S=_.body;else{if(await j.updated.check())return await tt(),await B(t);S=await D(_,{params:r,url:t,route:{id:a.id}})}const N=await pn(w,v,o);return N?re({url:t,params:r,branch:v.slice(0,N.idx).concat(N.node),status:E,error:S,route:a}):await dt(t,{id:a.id},S,E)}else v.push(void 0);return re({url:t,params:r,branch:v,status:200,error:null,route:a,form:n?void 0:null})}async function pn(e,n,t){for(;e--;)if(t[e]){let r=e;for(;!n[r];)r-=1;try{return{idx:r+1,node:{node:await t[e](),loader:t[e],data:{},server:null,universal:null}}}catch{continue}}}async function ce({status:e,error:n,url:t,route:r}){const a={};let s=null;if(A.server_loads[0]===0)try{const c=await ht(t,[!0]);if(c.type!=="data"||c.nodes[0]&&c.nodes[0].type!=="data")throw 0;s=c.nodes[0]??null}catch{(t.origin!==J||t.pathname!==location.pathname||ke)&&await B(t)}try{const c=await Ie({loader:me,url:t,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ue(s)}),i={node:await Q(),loader:Q,universal:null,server:null,data:null};return re({url:t,params:a,branch:[c,i],status:e,error:n,route:null})}catch(c){if(c instanceof be)return Re(new URL(c.location,location.href),{},0);throw c}}function Te(e,n){if(!e||oe(e,L,A.hash))return;let t;try{if(t=A.hooks.reroute({url:new URL(e)})??e,typeof t=="string"){const a=new URL(e);A.hash?a.hash=t:a.pathname=t,t=a}}catch{return}const r=ft(t);for(const a of ie){const s=a.exec(r);if(s)return{id:ae(e),invalidating:n,route:a,params:bt(s),url:e}}}function ft(e){return vt(A.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(L.length))||"/"}function ae(e){return(A.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function ut({url:e,type:n,intent:t,delta:r}){let a=!1;const s=gt(y,t,e,n);r!==void 0&&(s.navigation.delta=r);const o={...s.navigation,cancel:()=>{a=!0,s.reject(new Error("navigation cancelled"))}};return Y||rt.forEach(c=>c(o)),a?null:s}async function V({type:e,url:n,popped:t,keepfocus:r,noscroll:a,replace_state:s,state:o={},redirect_count:c=0,nav_token:i={},accept:f=Ce,block:h=Ce}){const u=Te(n,!1),g=ut({url:n,type:e,delta:t==null?void 0:t.delta,intent:u});if(!g){h();return}const p=R,d=T;f(),Y=!0,te&&j.navigating.set(K.current=g.navigation),ne=i;let l=u&&await lt(u);if(!l){if(oe(n,L,A.hash))return await B(n);l=await dt(n,{id:null},await D(new Ae(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(u==null?void 0:u.url)||n,ne!==i)return g.reject(new Error("navigation aborted")),!1;if(l.type==="redirect")if(c>=20)l=await ce({status:500,error:await D(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return Re(new URL(l.location,n).href,{},c+1,i),!1;else l.props.page.status>=400&&await j.updated.check()&&(await tt(),await B(n));if(un(),Ee(p),st(d),l.props.page.url.pathname!==n.pathname&&(n.pathname=l.props.page.url.pathname),o=t?t.state:o,!t){const v=s?0:1,w={[C]:R+=v,[H]:T+=v,[Je]:o};(s?history.replaceState:history.pushState).call(history,w,"",n),s||ln(R,T)}if(U=null,l.props.page.state=o,te){y=l.state,l.props.page&&(l.props.page.url=n);const v=(await Promise.all(Array.from(fn,w=>w(g.navigation)))).filter(w=>typeof w=="function");if(v.length>0){let w=function(){v.forEach(_=>{q.delete(_)})};v.push(w),v.forEach(_=>{q.add(_)})}ot.$set(l.props),sn(l.props.page),at=!0}else ct(l,we,!1);const{activeElement:m}=document;await yt();const b=t?t.scroll:a?ve():null;if(De){const v=n.hash&&document.getElementById(decodeURIComponent(A.hash?n.hash.split("#")[2]??"":n.hash.slice(1)));b?scrollTo(b.x,b.y):v?v.scrollIntoView():scrollTo(0,0)}const k=document.activeElement!==m&&document.activeElement!==document.body;!r&&!k&&_n(),De=!0,l.props.page&&Object.assign(I,l.props.page),Y=!1,e==="popstate"&&it(T),g.fulfil(void 0),q.forEach(v=>v(g.navigation)),j.navigating.set(K.current=null)}async function dt(e,n,t,r){return e.origin===J&&e.pathname===location.pathname&&!ke?await ce({status:r,error:t,url:e,route:n}):await B(e)}function gn(){let e;O.addEventListener("mousemove",s=>{const o=s.target;clearTimeout(e),e=setTimeout(()=>{r(o,2)},20)});function n(s){s.defaultPrevented||r(s.composedPath()[0],1)}O.addEventListener("mousedown",n),O.addEventListener("touchstart",n,{passive:!0});const t=new IntersectionObserver(s=>{for(const o of s)o.isIntersecting&&(pe(new URL(o.target.href)),t.unobserve(o.target))},{threshold:0});function r(s,o){const c=Ze(s,O);if(!c)return;const{url:i,external:f,download:h}=ge(c,L,A.hash);if(f||h)return;const u=X(c),g=i&&ae(y.url)===ae(i);if(!u.reload&&!g)if(o<=u.preload_data){const p=Te(i,!1);p&&dn(p)}else o<=u.preload_code&&pe(i)}function a(){t.disconnect();for(const s of O.querySelectorAll("a")){const{url:o,external:c,download:i}=ge(s,L,A.hash);if(c||i)continue;const f=X(s);f.reload||(f.preload_code===z.viewport&&t.observe(s),f.preload_code===z.eager&&pe(o))}}q.add(a),a()}function D(e,n){if(e instanceof se)return e.body;const t=Z(e),r=an(e);return A.hooks.handleError({error:e,event:n,status:t,message:r})??{message:r}}function mn(e,n={}){return e=new URL(ze(e)),e.origin!==J?Promise.reject(new Error("goto: invalid URL")):Re(e,n,0)}function wn(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let r=!1;if(Be(),!Y){const a=gt(y,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};rt.forEach(o=>o(s))}r?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Be()}),(n=navigator.connection)!=null&&n.saveData||gn(),O.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const r=Ze(t.composedPath()[0],O);if(!r)return;const{url:a,external:s,target:o,download:c}=ge(r,L,A.hash);if(!a)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const i=X(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||c)return;const[h,u]=(A.hash?a.hash.replace(/^#/,""):a.href).split("#"),g=h===ue(location);if(s||i.reload&&(!g||!u)){ut({url:a,type:"link"})?Y=!0:t.preventDefault();return}if(u!==void 0&&g){const[,p]=y.url.href.split("#");if(p===u){if(t.preventDefault(),u===""||u==="top"&&r.ownerDocument.getElementById("top")===null)window.scrollTo({top:0});else{const d=r.ownerDocument.getElementById(decodeURIComponent(u));d&&(d.scrollIntoView(),d.focus())}return}if(F=!0,Ee(R),e(a),!i.replace_state)return;F=!1}t.preventDefault(),await new Promise(p=>{requestAnimationFrame(()=>{setTimeout(p,0)}),setTimeout(p,100)}),V({type:"link",url:a,keepfocus:i.keepfocus,noscroll:i.noscroll,replace_state:i.replace_state??a.href===location.href})}),O.addEventListener("submit",t=>{if(t.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(t.target),a=t.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const c=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(oe(c,L,!1))return;const i=t.target,f=X(i);if(f.reload)return;t.preventDefault(),t.stopPropagation();const h=new FormData(i),u=a==null?void 0:a.getAttribute("name");u&&h.append(u,(a==null?void 0:a.getAttribute("value"))??""),c.search=new URLSearchParams(h).toString(),V({type:"form",url:c,keepfocus:f.keepfocus,noscroll:f.noscroll,replace_state:f.replace_state??c.href===location.href})}),addEventListener("popstate",async t=>{var r;if((r=t.state)!=null&&r[C]){const a=t.state[C];if(ne={},a===R)return;const s=x[a],o=t.state[Je]??{},c=new URL(t.state[Dt]??location.href),i=t.state[H],f=y.url?ue(location)===ue(y.url):!1;if(i===T&&(at||f)){o!==I.state&&(I.state=o),e(c),x[R]=ve(),s&&scrollTo(s.x,s.y),R=a;return}const u=a-R;await V({type:"popstate",url:c,popped:{state:o,scroll:s,delta:u},accept:()=>{R=a,T=i},block:()=>{history.go(-u)},nav_token:ne})}else if(!F){const a=new URL(location.href);e(a)}}),addEventListener("hashchange",()=>{F?(F=!1,history.replaceState({...history.state,[C]:++R,[H]:T},"",location.href)):A.hash&&y.url.hash===location.hash&&V({type:"goto",url:y.url})});for(const t of document.querySelectorAll("link"))cn.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&j.navigating.set(K.current=null)});function e(t){y.url=I.url=t,j.page.set(Le(I)),j.page.notify()}}async function yn(e,{status:n=200,error:t,node_ids:r,params:a,route:s,data:o,form:c}){ke=!0;const i=new URL(location.href);({params:a={},route:s={id:null}}=Te(i,!1)||{});let f,h=!0;try{const u=r.map(async(d,l)=>{const m=o[l];return m!=null&&m.uses&&(m.uses=pt(m.uses)),Ie({loader:A.nodes[d],url:i,params:a,route:s,parent:async()=>{const b={};for(let k=0;k<l;k+=1)Object.assign(b,(await u[k]).data);return b},server_data_node:Ue(m)})}),g=await Promise.all(u),p=ie.find(({id:d})=>d===s.id);if(p){const d=p.layouts;for(let l=0;l<d.length;l++)d[l]||g.splice(l,0,void 0)}f=re({url:i,params:a,branch:g,status:n,error:t,form:c,route:p??null})}catch(u){if(u instanceof be){await B(new URL(u.location,location.href));return}f=await ce({status:Z(u),error:await D(u,{url:i,params:a,route:s}),url:i,route:s}),e.textContent="",h=!1}f.props.page&&(f.props.page.state={}),ct(f,e,h)}async function ht(e,n){var a;const t=new URL(e);t.pathname=St(e.pathname),e.pathname.endsWith("/")&&t.searchParams.append(rn,"1"),t.searchParams.append(nn,n.map(s=>s?"1":"0").join(""));const r=await He(t.href);if(!r.ok){let s;throw(a=r.headers.get("content-type"))!=null&&a.includes("application/json")?s=await r.json():r.status===404?s="Not Found":r.status===500&&(s="Internal Error"),new se(r.status,s)}return new Promise(async s=>{var u;const o=new Map,c=r.body.getReader(),i=new TextDecoder;function f(g){return Qt(g,{...A.decoders,Promise:p=>new Promise((d,l)=>{o.set(p,{fulfil:d,reject:l})})})}let h="";for(;;){const{done:g,value:p}=await c.read();if(g&&!h)break;for(h+=!p&&h?`
|
|
2
2
|
`:i.decode(p,{stream:!0});;){const d=h.indexOf(`
|
|
3
|
-
`);if(d===-1)break;const l=JSON.parse(h.slice(0,d));if(h=h.slice(d+1),l.type==="redirect")return s(l);if(l.type==="data")(u=l.nodes)==null||u.forEach(m=>{(m==null?void 0:m.type)==="data"&&(m.uses=pt(m.uses),m.data=f(m.data))}),s(l);else if(l.type==="chunk"){const{id:m,data:b,error:k}=l,v=o.get(m);o.delete(m),k?v.reject(f(k)):v.fulfil(f(b))}}}})}function pt(e){return{dependencies:new Set((e==null?void 0:e.dependencies)??[]),params:new Set((e==null?void 0:e.params)??[]),parent:!!(e!=null&&e.parent),route:!!(e!=null&&e.route),url:!!(e!=null&&e.url),search_params:new Set((e==null?void 0:e.search_params)??[])}}function _n(){const e=document.querySelector("[autofocus]");if(e)e.focus();else{const n=document.body,t=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),t!==null?n.setAttribute("tabindex",t):n.removeAttribute("tabindex");const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let s=0;s<r.rangeCount;s+=1)a.push(r.getRangeAt(s));setTimeout(()=>{if(r.rangeCount===a.length){for(let s=0;s<r.rangeCount;s+=1){const o=a[s],c=r.getRangeAt(s);if(o.commonAncestorContainer!==c.commonAncestorContainer||o.startContainer!==c.startContainer||o.endContainer!==c.endContainer||o.startOffset!==c.startOffset||o.endOffset!==c.endOffset)return}r.removeAllRanges()}})}}}function gt(e,n,t,r){var i,f;let a,s;const o=new Promise((h,u)=>{a=h,s=u});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:((i=e.route)==null?void 0:i.id)??null},url:e.url},to:t&&{params:(n==null?void 0:n.params)??null,route:{id:((f=n==null?void 0:n.route)==null?void 0:f.id)??null},url:t},willUnload:!n,type:r,complete:o},fulfil:a,reject:s}}function Le(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}export{Rn as a,
|
|
3
|
+
`);if(d===-1)break;const l=JSON.parse(h.slice(0,d));if(h=h.slice(d+1),l.type==="redirect")return s(l);if(l.type==="data")(u=l.nodes)==null||u.forEach(m=>{(m==null?void 0:m.type)==="data"&&(m.uses=pt(m.uses),m.data=f(m.data))}),s(l);else if(l.type==="chunk"){const{id:m,data:b,error:k}=l,v=o.get(m);o.delete(m),k?v.reject(f(k)):v.fulfil(f(b))}}}})}function pt(e){return{dependencies:new Set((e==null?void 0:e.dependencies)??[]),params:new Set((e==null?void 0:e.params)??[]),parent:!!(e!=null&&e.parent),route:!!(e!=null&&e.route),url:!!(e!=null&&e.url),search_params:new Set((e==null?void 0:e.search_params)??[])}}function _n(){const e=document.querySelector("[autofocus]");if(e)e.focus();else{const n=document.body,t=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),t!==null?n.setAttribute("tabindex",t):n.removeAttribute("tabindex");const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let s=0;s<r.rangeCount;s+=1)a.push(r.getRangeAt(s));setTimeout(()=>{if(r.rangeCount===a.length){for(let s=0;s<r.rangeCount;s+=1){const o=a[s],c=r.getRangeAt(s);if(o.commonAncestorContainer!==c.commonAncestorContainer||o.startContainer!==c.startContainer||o.endContainer!==c.endContainer||o.startOffset!==c.startOffset||o.endOffset!==c.endOffset)return}r.removeAllRanges()}})}}}function gt(e,n,t,r){var i,f;let a,s;const o=new Promise((h,u)=>{a=h,s=u});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:((i=e.route)==null?void 0:i.id)??null},url:e.url},to:t&&{params:(n==null?void 0:n.params)??null,route:{id:((f=n==null?void 0:n.route)==null?void 0:f.id)??null},url:t},willUnload:!n,type:r,complete:o},fulfil:a,reject:s}}function Le(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}export{Rn as a,j as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./entry.
|
|
1
|
+
import{s as e}from"./entry.BtjCrbiQ.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.
|
|
2
|
-
import{s as C,h as N,o as B,t as U,b as T}from"../chunks/scheduler.DsWd5xup.js";import{S as F,i as G,d as h,l as E,m as g,F as I,G as D,a as k,g as H,r as w,j as W,H as R,k as L,u as O,n as A,q as y,o as V,x as d,c as z,e as J,h as K,s as Q,f as X,t as Y}from"../chunks/index.BfJlbjrK.js";const Z="modulepreload",M=function(s,e){return new URL(s,e).href},S={},u=function(e,n,i){let o=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),l=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));o=Promise.allSettled(n.map(_=>{if(_=M(_,i),_ in S)return;S[_]=!0;const a=_.endsWith(".css"),m=a?'[rel="stylesheet"]':"";if(!!i)for(let b=t.length-1;b>=0;b--){const P=t[b];if(P.href===_&&(!a||P.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${_}"]${m}`))return;const p=document.createElement("link");if(p.rel=a?"stylesheet":Z,a||(p.as="script"),p.crossOrigin="",p.href=_,l&&p.setAttribute("nonce",l),document.head.appendChild(p),a)return new Promise((b,P)=>{p.addEventListener("load",b),p.addEventListener("error",()=>P(new Error(`Unable to preload CSS for ${_}`)))})}))}function f(t){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=t,window.dispatchEvent(r),!r.defaultPrevented)throw t}return o.then(t=>{for(const r of t||[])r.status==="rejected"&&f(r.reason);return e().catch(f)})},ae={};function $(s){let e,n,i;var o=s[1][0];function f(t,r){return{props:{data:t[3],form:t[2]}}}return o&&(e=R(o,f(s)),s[12](e)),{c(){e&&O(e.$$.fragment),n=w()},l(t){e&&y(e.$$.fragment,t),n=w()},m(t,r){e&&A(e,t,r),k(t,n,r),i=!0},p(t,r){if(r&2&&o!==(o=t[1][0])){if(e){I();const l=e;E(l.$$.fragment,1,0,()=>{L(l,1)}),D()}o?(e=R(o,f(t)),t[12](e),O(e.$$.fragment),g(e.$$.fragment,1),A(e,n.parentNode,n)):e=null}else if(o){const l={};r&8&&(l.data=t[3]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&E(e.$$.fragment,t),i=!1},d(t){t&&h(n),s[12](null),e&&L(e,t)}}}function x(s){let e,n,i;var o=s[1][0];function f(t,r){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return o&&(e=R(o,f(s)),s[11](e)),{c(){e&&O(e.$$.fragment),n=w()},l(t){e&&y(e.$$.fragment,t),n=w()},m(t,r){e&&A(e,t,r),k(t,n,r),i=!0},p(t,r){if(r&2&&o!==(o=t[1][0])){if(e){I();const l=e;E(l.$$.fragment,1,0,()=>{L(l,1)}),D()}o?(e=R(o,f(t)),t[11](e),O(e.$$.fragment),g(e.$$.fragment,1),A(e,n.parentNode,n)):e=null}else if(o){const l={};r&8&&(l.data=t[3]),r&8215&&(l.$$scope={dirty:r,ctx:t}),e.$set(l)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&E(e.$$.fragment,t),i=!1},d(t){t&&h(n),s[11](null),e&&L(e,t)}}}function ee(s){let e,n,i;var o=s[1][1];function f(t,r){return{props:{data:t[4],form:t[2]}}}return o&&(e=R(o,f(s)),s[10](e)),{c(){e&&O(e.$$.fragment),n=w()},l(t){e&&y(e.$$.fragment,t),n=w()},m(t,r){e&&A(e,t,r),k(t,n,r),i=!0},p(t,r){if(r&2&&o!==(o=t[1][1])){if(e){I();const l=e;E(l.$$.fragment,1,0,()=>{L(l,1)}),D()}o?(e=R(o,f(t)),t[10](e),O(e.$$.fragment),g(e.$$.fragment,1),A(e,n.parentNode,n)):e=null}else if(o){const l={};r&16&&(l.data=t[4]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&E(e.$$.fragment,t),i=!1},d(t){t&&h(n),s[10](null),e&&L(e,t)}}}function j(s){let e,n=s[6]&&q(s);return{c(){e=K("div"),n&&n.c(),this.h()},l(i){e=z(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var o=J(e);n&&n.l(o),o.forEach(h),this.h()},h(){V(e,"id","svelte-announcer"),V(e,"aria-live","assertive"),V(e,"aria-atomic","true"),d(e,"position","absolute"),d(e,"left","0"),d(e,"top","0"),d(e,"clip","rect(0 0 0 0)"),d(e,"clip-path","inset(50%)"),d(e,"overflow","hidden"),d(e,"white-space","nowrap"),d(e,"width","1px"),d(e,"height","1px")},m(i,o){k(i,e,o),n&&n.m(e,null)},p(i,o){i[6]?n?n.p(i,o):(n=q(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&h(e),n&&n.d()}}}function q(s){let e;return{c(){e=Y(s[7])},l(n){e=X(n,s[7])},m(n,i){k(n,e,i)},p(n,i){i&128&&Q(e,n[7])},d(n){n&&h(e)}}}function te(s){let e,n,i,o,f;const t=[x,$],r=[];function l(a,m){return a[1][1]?0:1}e=l(s),n=r[e]=t[e](s);let _=s[5]&&j(s);return{c(){n.c(),i=W(),_&&_.c(),o=w()},l(a){n.l(a),i=H(a),_&&_.l(a),o=w()},m(a,m){r[e].m(a,m),k(a,i,m),_&&_.m(a,m),k(a,o,m),f=!0},p(a,[m]){let v=e;e=l(a),e===v?r[e].p(a,m):(I(),E(r[v],1,1,()=>{r[v]=null}),D(),n=r[e],n?n.p(a,m):(n=r[e]=t[e](a),n.c()),g(n,1),n.m(i.parentNode,i)),a[5]?_?_.p(a,m):(_=j(a),_.c(),_.m(o.parentNode,o)):_&&(_.d(1),_=null)},i(a){f||(g(n),f=!0)},o(a){E(n),f=!1},d(a){a&&(h(i),h(o)),r[e].d(a),_&&_.d(a)}}}function ne(s,e,n){let{stores:i}=e,{page:o}=e,{constructors:f}=e,{components:t=[]}=e,{form:r}=e,{data_0:l=null}=e,{data_1:_=null}=e;N(i.page.notify);let a=!1,m=!1,v=null;B(()=>{const c=i.page.subscribe(()=>{a&&(n(6,m=!0),U().then(()=>{n(7,v=document.title||"untitled page")}))});return n(5,a=!0),c});function p(c){T[c?"unshift":"push"](()=>{t[1]=c,n(0,t)})}function b(c){T[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}function P(c){T[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}return s.$$set=c=>{"stores"in c&&n(8,i=c.stores),"page"in c&&n(9,o=c.page),"constructors"in c&&n(1,f=c.constructors),"components"in c&&n(0,t=c.components),"form"in c&&n(2,r=c.form),"data_0"in c&&n(3,l=c.data_0),"data_1"in c&&n(4,_=c.data_1)},s.$$.update=()=>{s.$$.dirty&768&&i.page.set(o)},[t,f,r,l,_,a,m,v,i,o,p,b,P]}class le extends F{constructor(e){super(),G(this,e,ne,te,C,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const _e=[()=>u(()=>import("../nodes/0.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.DssNB1JP.js","../chunks/scheduler.DsWd5xup.js","../chunks/index.BfJlbjrK.js","../chunks/api.DVLAklIn.js","../chunks/stores.YDlXfj0w.js","../chunks/entry.BtjCrbiQ.js","../chunks/index.m3oCcA6N.js","../chunks/i18n.DApJIXOT.js","../chunks/stores.BSI_cVy6.js","../assets/0.BYjLgame.css","../nodes/1.D4HMlRNK.js","../nodes/2.CJH1Fs0K.js","../assets/2.GIkI4O03.css","../nodes/3.Chtgl9hh.js","../chunks/ToolSelector.0iI1cXVj.js","../assets/ToolSelector.BewzNVhC.css","../assets/3.H3-dDI9U.css","../nodes/4.BIau4H47.js","../assets/4.BOWlKC54.css","../nodes/5.DtYG5yJy.js","../assets/5.CLn2x9cs.css","../nodes/6.B-ud4zCO.js","../assets/6.C1lxHTyi.css","../nodes/7.7Fm6yzqA.js","../assets/7.CahA9iix.css","../nodes/8.Chp3dlzK.js","../assets/8.9jvt5Dym.css","../nodes/9.PMJrdCxq.js","../assets/9.DsmA__AV.css","../nodes/10.CnTuhaua.js","../assets/10.DpWloLoX.css","../nodes/11.8-cT1ns9.js","../assets/11.4MyEKiO6.css","../nodes/12.BCT8Dv1G.js","../assets/12.C1f-IaHK.css","../nodes/13.Cu-n0wZ9.js","../assets/13.CAQKz1hf.css","../nodes/14.u96Ucsue.js","../assets/14.Bcofmxqa.css","../nodes/15.CMhy_NGl.js","../assets/15.F0aA4smG.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{s as C,h as N,o as B,t as U,b as T}from"../chunks/scheduler.DsWd5xup.js";import{S as F,i as G,d as h,l as E,m as g,F as I,G as D,a as k,g as H,r as w,j as W,H as R,k as L,u as O,n as A,q as y,o as V,x as d,c as z,e as J,h as K,s as Q,f as X,t as Y}from"../chunks/index.BfJlbjrK.js";const Z="modulepreload",M=function(s,e){return new URL(s,e).href},S={},u=function(e,n,i){let o=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),l=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));o=Promise.allSettled(n.map(_=>{if(_=M(_,i),_ in S)return;S[_]=!0;const a=_.endsWith(".css"),m=a?'[rel="stylesheet"]':"";if(!!i)for(let b=t.length-1;b>=0;b--){const P=t[b];if(P.href===_&&(!a||P.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${_}"]${m}`))return;const p=document.createElement("link");if(p.rel=a?"stylesheet":Z,a||(p.as="script"),p.crossOrigin="",p.href=_,l&&p.setAttribute("nonce",l),document.head.appendChild(p),a)return new Promise((b,P)=>{p.addEventListener("load",b),p.addEventListener("error",()=>P(new Error(`Unable to preload CSS for ${_}`)))})}))}function f(t){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=t,window.dispatchEvent(r),!r.defaultPrevented)throw t}return o.then(t=>{for(const r of t||[])r.status==="rejected"&&f(r.reason);return e().catch(f)})},ae={};function $(s){let e,n,i;var o=s[1][0];function f(t,r){return{props:{data:t[3],form:t[2]}}}return o&&(e=R(o,f(s)),s[12](e)),{c(){e&&O(e.$$.fragment),n=w()},l(t){e&&y(e.$$.fragment,t),n=w()},m(t,r){e&&A(e,t,r),k(t,n,r),i=!0},p(t,r){if(r&2&&o!==(o=t[1][0])){if(e){I();const l=e;E(l.$$.fragment,1,0,()=>{L(l,1)}),D()}o?(e=R(o,f(t)),t[12](e),O(e.$$.fragment),g(e.$$.fragment,1),A(e,n.parentNode,n)):e=null}else if(o){const l={};r&8&&(l.data=t[3]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&E(e.$$.fragment,t),i=!1},d(t){t&&h(n),s[12](null),e&&L(e,t)}}}function x(s){let e,n,i;var o=s[1][0];function f(t,r){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return o&&(e=R(o,f(s)),s[11](e)),{c(){e&&O(e.$$.fragment),n=w()},l(t){e&&y(e.$$.fragment,t),n=w()},m(t,r){e&&A(e,t,r),k(t,n,r),i=!0},p(t,r){if(r&2&&o!==(o=t[1][0])){if(e){I();const l=e;E(l.$$.fragment,1,0,()=>{L(l,1)}),D()}o?(e=R(o,f(t)),t[11](e),O(e.$$.fragment),g(e.$$.fragment,1),A(e,n.parentNode,n)):e=null}else if(o){const l={};r&8&&(l.data=t[3]),r&8215&&(l.$$scope={dirty:r,ctx:t}),e.$set(l)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&E(e.$$.fragment,t),i=!1},d(t){t&&h(n),s[11](null),e&&L(e,t)}}}function ee(s){let e,n,i;var o=s[1][1];function f(t,r){return{props:{data:t[4],form:t[2]}}}return o&&(e=R(o,f(s)),s[10](e)),{c(){e&&O(e.$$.fragment),n=w()},l(t){e&&y(e.$$.fragment,t),n=w()},m(t,r){e&&A(e,t,r),k(t,n,r),i=!0},p(t,r){if(r&2&&o!==(o=t[1][1])){if(e){I();const l=e;E(l.$$.fragment,1,0,()=>{L(l,1)}),D()}o?(e=R(o,f(t)),t[10](e),O(e.$$.fragment),g(e.$$.fragment,1),A(e,n.parentNode,n)):e=null}else if(o){const l={};r&16&&(l.data=t[4]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&g(e.$$.fragment,t),i=!0)},o(t){e&&E(e.$$.fragment,t),i=!1},d(t){t&&h(n),s[10](null),e&&L(e,t)}}}function j(s){let e,n=s[6]&&q(s);return{c(){e=K("div"),n&&n.c(),this.h()},l(i){e=z(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var o=J(e);n&&n.l(o),o.forEach(h),this.h()},h(){V(e,"id","svelte-announcer"),V(e,"aria-live","assertive"),V(e,"aria-atomic","true"),d(e,"position","absolute"),d(e,"left","0"),d(e,"top","0"),d(e,"clip","rect(0 0 0 0)"),d(e,"clip-path","inset(50%)"),d(e,"overflow","hidden"),d(e,"white-space","nowrap"),d(e,"width","1px"),d(e,"height","1px")},m(i,o){k(i,e,o),n&&n.m(e,null)},p(i,o){i[6]?n?n.p(i,o):(n=q(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&h(e),n&&n.d()}}}function q(s){let e;return{c(){e=Y(s[7])},l(n){e=X(n,s[7])},m(n,i){k(n,e,i)},p(n,i){i&128&&Q(e,n[7])},d(n){n&&h(e)}}}function te(s){let e,n,i,o,f;const t=[x,$],r=[];function l(a,m){return a[1][1]?0:1}e=l(s),n=r[e]=t[e](s);let _=s[5]&&j(s);return{c(){n.c(),i=W(),_&&_.c(),o=w()},l(a){n.l(a),i=H(a),_&&_.l(a),o=w()},m(a,m){r[e].m(a,m),k(a,i,m),_&&_.m(a,m),k(a,o,m),f=!0},p(a,[m]){let v=e;e=l(a),e===v?r[e].p(a,m):(I(),E(r[v],1,1,()=>{r[v]=null}),D(),n=r[e],n?n.p(a,m):(n=r[e]=t[e](a),n.c()),g(n,1),n.m(i.parentNode,i)),a[5]?_?_.p(a,m):(_=j(a),_.c(),_.m(o.parentNode,o)):_&&(_.d(1),_=null)},i(a){f||(g(n),f=!0)},o(a){E(n),f=!1},d(a){a&&(h(i),h(o)),r[e].d(a),_&&_.d(a)}}}function ne(s,e,n){let{stores:i}=e,{page:o}=e,{constructors:f}=e,{components:t=[]}=e,{form:r}=e,{data_0:l=null}=e,{data_1:_=null}=e;N(i.page.notify);let a=!1,m=!1,v=null;B(()=>{const c=i.page.subscribe(()=>{a&&(n(6,m=!0),U().then(()=>{n(7,v=document.title||"untitled page")}))});return n(5,a=!0),c});function p(c){T[c?"unshift":"push"](()=>{t[1]=c,n(0,t)})}function b(c){T[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}function P(c){T[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}return s.$$set=c=>{"stores"in c&&n(8,i=c.stores),"page"in c&&n(9,o=c.page),"constructors"in c&&n(1,f=c.constructors),"components"in c&&n(0,t=c.components),"form"in c&&n(2,r=c.form),"data_0"in c&&n(3,l=c.data_0),"data_1"in c&&n(4,_=c.data_1)},s.$$.update=()=>{s.$$.dirty&768&&i.page.set(o)},[t,f,r,l,_,a,m,v,i,o,p,b,P]}class le extends F{constructor(e){super(),G(this,e,ne,te,C,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const _e=[()=>u(()=>import("../nodes/0.DssNB1JP.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),()=>u(()=>import("../nodes/1.D4HMlRNK.js"),__vite__mapDeps([10,1,2,4,5,6]),import.meta.url),()=>u(()=>import("../nodes/2.CJH1Fs0K.js"),__vite__mapDeps([11,1,2,3,6,7,8,12]),import.meta.url),()=>u(()=>import("../nodes/3.Chtgl9hh.js"),__vite__mapDeps([13,1,2,3,8,6,7,14,15,16]),import.meta.url),()=>u(()=>import("../nodes/4.BIau4H47.js"),__vite__mapDeps([17,1,2,3,7,6,18]),import.meta.url),()=>u(()=>import("../nodes/5.DtYG5yJy.js"),__vite__mapDeps([19,1,2,3,8,6,7,14,15,20]),import.meta.url),()=>u(()=>import("../nodes/6.B-ud4zCO.js"),__vite__mapDeps([21,1,2,3,8,6,7,14,15,22]),import.meta.url),()=>u(()=>import("../nodes/7.7Fm6yzqA.js"),__vite__mapDeps([23,1,2,3,7,6,8,24]),import.meta.url),()=>u(()=>import("../nodes/8.Chp3dlzK.js"),__vite__mapDeps([25,1,2,3,8,6,7,14,15,26]),import.meta.url),()=>u(()=>import("../nodes/9.PMJrdCxq.js"),__vite__mapDeps([27,1,2,3,7,6,28]),import.meta.url),()=>u(()=>import("../nodes/10.CnTuhaua.js"),__vite__mapDeps([29,1,2,3,8,6,7,14,15,30]),import.meta.url),()=>u(()=>import("../nodes/11.8-cT1ns9.js"),__vite__mapDeps([31,1,2,3,4,5,6,8,7,32]),import.meta.url),()=>u(()=>import("../nodes/12.BCT8Dv1G.js"),__vite__mapDeps([33,1,2,3,7,6,8,34]),import.meta.url),()=>u(()=>import("../nodes/13.Cu-n0wZ9.js"),__vite__mapDeps([35,1,2,7,6,36]),import.meta.url),()=>u(()=>import("../nodes/14.u96Ucsue.js"),__vite__mapDeps([37,1,2,3,8,6,7,14,15,38]),import.meta.url),()=>u(()=>import("../nodes/15.CMhy_NGl.js"),__vite__mapDeps([39,1,2,3,8,6,7,14,15,40]),import.meta.url)],ce=[],fe={"/":[2],"/cost":[3],"/leaderboard":[4],"/models":[5],"/overview":[6],"/pricing":[7],"/projects":[8],"/quotas":[9],"/sessions":[10],"/sessions/[sessionId]":[11],"/settings":[12],"/support":[13],"/tokens":[14],"/tool-calls":[15]},re={handleError:({error:s})=>{console.error(s)},reroute:()=>{},transport:{}},ie=Object.fromEntries(Object.entries(re.transport).map(([s,e])=>[s,e.decode])),ue=!1,me=(s,e)=>ie[s](e);export{me as decode,ie as decoders,fe as dictionary,ue as hash,re as hooks,ae as matchers,_e as nodes,le as root,ce as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"../chunks/entry.BtjCrbiQ.js";export{t as start};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as x,z as ee,x as w,A as te,B as le,C as ne,D as Yt,E as I,c as ft,o as Nl,e as wl,n as lt,r as dt}from"../chunks/scheduler.DsWd5xup.js";import{S as se,i as ae,d as c,v as Mt,l as q,m as E,I as ct,a as Z,b as u,J as Me,e as v,r as Ue,K as Ae,k as j,n as R,q as J,u as F,G as Re,g as B,j as P,w as ke,o as r,c as k,h as N,s as ce,A as ht,E as gl,C as Ye,f as he,t as de,H as Xe,z as ye,F as Fe}from"../chunks/index.BfJlbjrK.js";import{e as xe,a as Gt,L as El,M as ql}from"../chunks/api.DVLAklIn.js";import{p as Ml}from"../chunks/stores.
|
|
1
|
+
import{s as x,z as ee,x as w,A as te,B as le,C as ne,D as Yt,E as I,c as ft,o as Nl,e as wl,n as lt,r as dt}from"../chunks/scheduler.DsWd5xup.js";import{S as se,i as ae,d as c,v as Mt,l as q,m as E,I as ct,a as Z,b as u,J as Me,e as v,r as Ue,K as Ae,k as j,n as R,q as J,u as F,G as Re,g as B,j as P,w as ke,o as r,c as k,h as N,s as ce,A as ht,E as gl,C as Ye,f as he,t as de,H as Xe,z as ye,F as Fe}from"../chunks/index.BfJlbjrK.js";import{e as xe,a as Gt,L as El,M as ql}from"../chunks/api.DVLAklIn.js";import{p as Ml}from"../chunks/stores.YDlXfj0w.js";import{a as Et,t as Al,l as Sl}from"../chunks/i18n.DApJIXOT.js";import{w as pl}from"../chunks/index.m3oCcA6N.js";import{g as Tl,e as Kt}from"../chunks/stores.BSI_cVy6.js";const Cl=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function oe(a,e){const s={},t={},n={$$scope:1};let l=a.length;for(;l--;){const o=a[l],i=e[l];if(i){for(const $ in o)$ in i||(t[$]=1);for(const $ in i)n[$]||(s[$]=i[$],n[$]=1);a[l]=i}else for(const $ in o)n[$]=1}for(const o in t)o in s||(s[o]=void 0);return s}function _e(a){return typeof a=="object"&&a!==null?a:{}}const vl="aiusage-theme";function qt(){return typeof window>"u"?"system":localStorage.getItem(vl)||"system"}function bl(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const At=pl(qt()),Il=pl(bl());function Zt(){At.update(a=>a==="system"?"dark":a==="dark"?"light":"system")}function Hl(){if(typeof window>"u")return;const a=window.matchMedia("(prefers-color-scheme: dark)");function e(s){const t=s==="system"?bl():s;document.documentElement.setAttribute("data-theme",t),Il.set(t)}e(qt()),At.subscribe(s=>{localStorage.setItem(vl,s),e(s)}),a.addEventListener("change",()=>{qt()==="system"&&e("system")})}function Dl({pathname:a,authEnabled:e,authenticated:s,authLoading:t}){const n=a==="/";return t?n?"public-home":"loading":!e||s?"shell":n?"public-home":"login-page"}/**
|
|
2
2
|
* @license lucide-svelte v1.0.1 - ISC
|
|
3
3
|
*
|
|
4
4
|
* ISC License
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as x,n as u,c as S}from"../chunks/scheduler.DsWd5xup.js";import{S as j,i as q,d as c,s as h,a as _,b as d,c as v,e as g,f as b,g as y,h as E,t as $,j as C}from"../chunks/index.BfJlbjrK.js";import{p as H}from"../chunks/stores.
|
|
1
|
+
import{s as x,n as u,c as S}from"../chunks/scheduler.DsWd5xup.js";import{S as j,i as q,d as c,s as h,a as _,b as d,c as v,e as g,f as b,g as y,h as E,t as $,j as C}from"../chunks/index.BfJlbjrK.js";import{p as H}from"../chunks/stores.YDlXfj0w.js";function P(p){var f;let a,s=p[0].status+"",r,o,n,i=((f=p[0].error)==null?void 0:f.message)+"",m;return{c(){a=E("h1"),r=$(s),o=C(),n=E("p"),m=$(i)},l(e){a=v(e,"H1",{});var t=g(a);r=b(t,s),t.forEach(c),o=y(e),n=v(e,"P",{});var l=g(n);m=b(l,i),l.forEach(c)},m(e,t){_(e,a,t),d(a,r),_(e,o,t),_(e,n,t),d(n,m)},p(e,[t]){var l;t&1&&s!==(s=e[0].status+"")&&h(r,s),t&1&&i!==(i=((l=e[0].error)==null?void 0:l.message)+"")&&h(m,i)},i:u,o:u,d(e){e&&(c(a),c(o),c(n))}}}function k(p,a,s){let r;return S(p,H,o=>s(0,r=o)),[r]}class B extends j{constructor(a){super(),q(this,a,k,P,x,{})}}export{B as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as ml,n as ls,c as Zs,o as bl}from"../chunks/scheduler.DsWd5xup.js";import{S as kl,i as zl,d as n,s as I,a as W,b as s,o,p as ql,g as q,c as f,e as h,f as N,r as ys,j as E,h as v,t as S,v as rs,x as K,C as ts}from"../chunks/index.BfJlbjrK.js";import{z as El,e as Ke}from"../chunks/api.DVLAklIn.js";import{p as Tl}from"../chunks/stores.CSRSkpU3.js";import{f as Ts,b as $}from"../chunks/stores.BSI_cVy6.js";import{t as gl}from"../chunks/i18n.DApJIXOT.js";function xs(a,e,t){const l=a.slice();l[16]=e[t],l[19]=t;const i=l[16].inputTokens+l[16].outputTokens+(l[16].cacheReadTokens||0)+(l[16].cacheWriteTokens||0)+(l[16].thinkingTokens||0);return l[17]=i,l}function el(a,e,t){const l=a.slice();return l[20]=e[t],l}function Pl(a,e,t){const l=a.slice();return l[6]=e[t],l}function Nl(a,e,t){const l=a.slice();return l[6]=e[t],l}function Sl(a,e,t){const l=a.slice();return l[6]=e[t],l}function Al(a){const e=a.slice(),t=e[0].session;e[13]=t;const l=e[0].records;e[14]=l;const i=e[13].inputTokens+e[13].outputTokens+(e[13].cacheReadTokens||0)+(e[13].cacheWriteTokens||0)+(e[13].thinkingTokens||0);return e[15]=i,e}function sl(a){let e,t,l,i,c=a[13].tool+"",r,_,p,u=a[13].model+"",k,P,b,m=pl(a[13].firstTs)+"",C,w,T,d,g,D=a[3]("sessions.detail.meta.sessionId")+"",O,ae,M=a[13].sessionId+"",H,Ne,pe,oe=_l(a[13].duration)+"",_e,Re,ie,y,J,re,Se=a[3]("sessions.detail.meta.cost")+"",ce,Ae,fe,me=Ts(a[13].cost)+"",We,Me,ne,ve,te=a[3]("sessions.detail.meta.totalTokens")+"",be,He,de,Ie=$(a[15])+"",De,B,j,F,U=a[3]("sessions.detail.meta.apiCalls")+"",G,A,R,ke=a[13].recordCount+"",he,Fe,ue,we,Le=a[3]("sessions.detail.meta.toolCalls")+"",Q,je,Ve,ze=a[13].toolCallCount+"",Ue,Oe,X,qe,Qe,as=a[3]("sessions.detail.meta.input")+"",cs,Ps,Xe,Ge,Ns,Ye,is=$(a[13].inputTokens)+"",fs,Ss,Ee,Ze,ns=a[3]("sessions.detail.meta.output")+"",vs,As,ye,Be,Is,xe,os=$(a[13].outputTokens)+"",ds,Ds,hs,us,ps,Te,x=a[13].cwd&&ll(a),ee=a[13].cacheReadTokens&&tl(a),se=a[13].cacheWriteTokens&&al(a),le=a[13].thinkingTokens&&il(a),Ce=Ke(a[14]),Y=[];for(let z=0;z<Ce.length;z+=1)Y[z]=ul(xs(a,Ce,z));let Z=null;return Ce.length||(Z=nl(a)),{c(){e=v("div"),t=v("div"),l=v("div"),i=v("span"),r=S(c),_=E(),p=v("span"),k=S(u),P=E(),b=v("div"),C=S(m),w=E(),x&&x.c(),T=E(),d=v("div"),g=v("span"),O=S(D),ae=S(": "),H=S(M),Ne=E(),pe=v("span"),_e=S(oe),Re=E(),ie=v("div"),y=v("div"),J=v("div"),re=v("span"),ce=S(Se),Ae=E(),fe=v("span"),We=S(me),Me=E(),ne=v("div"),ve=v("span"),be=S(te),He=E(),de=v("span"),De=S(Ie),B=E(),j=v("div"),F=v("span"),G=S(U),A=E(),R=v("span"),he=S(ke),Fe=E(),ue=v("div"),we=v("span"),Q=S(Le),je=E(),Ve=v("span"),Ue=S(ze),Oe=E(),X=v("div"),qe=v("div"),Qe=v("span"),cs=S(as),Ps=E(),Xe=v("span"),Ge=v("span"),Ns=E(),Ye=v("span"),fs=S(is),Ss=E(),Ee=v("div"),Ze=v("span"),vs=S(ns),As=E(),ye=v("span"),Be=v("span"),Is=E(),xe=v("span"),ds=S(os),Ds=E(),ee&&ee.c(),hs=E(),se&&se.c(),us=E(),le&&le.c(),ps=E(),Te=v("div");for(let z=0;z<Y.length;z+=1)Y[z].c();Z&&Z.c(),this.h()},l(z){e=f(z,"DIV",{class:!0});var V=h(e);t=f(V,"DIV",{class:!0});var L=h(t);l=f(L,"DIV",{class:!0});var Je=h(l);i=f(Je,"SPAN",{class:!0});var Cs=h(i);r=N(Cs,c),Cs.forEach(n),_=q(Je),p=f(Je,"SPAN",{class:!0});var Rs=h(p);k=N(Rs,u),Rs.forEach(n),Je.forEach(n),P=q(L),b=f(L,"DIV",{class:!0});var Ws=h(b);C=N(Ws,m),Ws.forEach(n),w=q(L),x&&x.l(L),T=q(L),d=f(L,"DIV",{class:!0});var _s=h(d);g=f(_s,"SPAN",{class:!0});var ms=h(g);O=N(ms,D),ae=N(ms,": "),H=N(ms,M),ms.forEach(n),Ne=q(_s),pe=f(_s,"SPAN",{class:!0});var Ms=h(pe);_e=N(Ms,oe),Ms.forEach(n),_s.forEach(n),L.forEach(n),Re=q(V),ie=f(V,"DIV",{class:!0});var bs=h(ie);y=f(bs,"DIV",{class:!0});var $e=h(y);J=f($e,"DIV",{class:!0});var ks=h(J);re=f(ks,"SPAN",{class:!0});var Hs=h(re);ce=N(Hs,Se),Hs.forEach(n),Ae=q(ks),fe=f(ks,"SPAN",{class:!0});var Ls=h(fe);We=N(Ls,me),Ls.forEach(n),ks.forEach(n),Me=q($e),ne=f($e,"DIV",{class:!0});var zs=h(ne);ve=f(zs,"SPAN",{class:!0});var js=h(ve);be=N(js,te),js.forEach(n),He=q(zs),de=f(zs,"SPAN",{class:!0});var $s=h(de);De=N($s,Ie),$s.forEach(n),zs.forEach(n),B=q($e),j=f($e,"DIV",{class:!0});var qs=h(j);F=f(qs,"SPAN",{class:!0});var Fs=h(F);G=N(Fs,U),Fs.forEach(n),A=q(qs),R=f(qs,"SPAN",{class:!0});var Us=h(R);he=N(Us,ke),Us.forEach(n),qs.forEach(n),Fe=q($e),ue=f($e,"DIV",{class:!0});var Es=h(ue);we=f(Es,"SPAN",{class:!0});var Gs=h(we);Q=N(Gs,Le),Gs.forEach(n),je=q(Es),Ve=f(Es,"SPAN",{class:!0});var Bs=h(Ve);Ue=N(Bs,ze),Bs.forEach(n),Es.forEach(n),$e.forEach(n),Oe=q(bs),X=f(bs,"DIV",{class:!0});var ge=h(X);qe=f(ge,"DIV",{class:!0});var es=h(qe);Qe=f(es,"SPAN",{class:!0});var Js=h(Qe);cs=N(Js,as),Js.forEach(n),Ps=q(es),Xe=f(es,"SPAN",{class:!0});var Ks=h(Xe);Ge=f(Ks,"SPAN",{class:!0,style:!0}),h(Ge).forEach(n),Ks.forEach(n),Ns=q(es),Ye=f(es,"SPAN",{class:!0});var Os=h(Ye);fs=N(Os,is),Os.forEach(n),es.forEach(n),Ss=q(ge),Ee=f(ge,"DIV",{class:!0});var ss=h(Ee);Ze=f(ss,"SPAN",{class:!0});var Qs=h(Ze);vs=N(Qs,ns),Qs.forEach(n),As=q(ss),ye=f(ss,"SPAN",{class:!0});var Xs=h(ye);Be=f(Xs,"SPAN",{class:!0,style:!0}),h(Be).forEach(n),Xs.forEach(n),Is=q(ss),xe=f(ss,"SPAN",{class:!0});var Ys=h(xe);ds=N(Ys,os),Ys.forEach(n),ss.forEach(n),Ds=q(ge),ee&&ee.l(ge),hs=q(ge),se&&se.l(ge),us=q(ge),le&&le.l(ge),ge.forEach(n),bs.forEach(n),V.forEach(n),ps=q(z),Te=f(z,"DIV",{class:!0});var ws=h(Te);for(let Vs=0;Vs<Y.length;Vs+=1)Y[Vs].l(ws);Z&&Z.l(ws),ws.forEach(n),this.h()},h(){o(i,"class","id-tool svelte-qlezb4"),o(p,"class","id-model mono svelte-qlezb4"),o(l,"class","id-row svelte-qlezb4"),o(b,"class","id-time mono svelte-qlezb4"),o(g,"class","id-session mono svelte-qlezb4"),o(pe,"class","id-duration mono svelte-qlezb4"),o(d,"class","id-footer svelte-qlezb4"),o(t,"class","identity card svelte-qlezb4"),o(re,"class","metric-label svelte-qlezb4"),o(fe,"class","metric-value mono accent svelte-qlezb4"),o(J,"class","metric-cell svelte-qlezb4"),o(ve,"class","metric-label svelte-qlezb4"),o(de,"class","metric-value mono svelte-qlezb4"),o(ne,"class","metric-cell svelte-qlezb4"),o(F,"class","metric-label svelte-qlezb4"),o(R,"class","metric-value mono svelte-qlezb4"),o(j,"class","metric-cell svelte-qlezb4"),o(we,"class","metric-label svelte-qlezb4"),o(Ve,"class","metric-value mono svelte-qlezb4"),o(ue,"class","metric-cell svelte-qlezb4"),o(y,"class","metrics-grid svelte-qlezb4"),o(Qe,"class","tb-label svelte-qlezb4"),o(Ge,"class","tb-fill tb-input svelte-qlezb4"),K(Ge,"width",Pe(a[13].inputTokens,a[15])+"%"),o(Xe,"class","tb-bar svelte-qlezb4"),o(Ye,"class","tb-value mono svelte-qlezb4"),o(qe,"class","tb-row svelte-qlezb4"),o(Ze,"class","tb-label svelte-qlezb4"),o(Be,"class","tb-fill tb-output svelte-qlezb4"),K(Be,"width",Pe(a[13].outputTokens,a[15])+"%"),o(ye,"class","tb-bar svelte-qlezb4"),o(xe,"class","tb-value mono svelte-qlezb4"),o(Ee,"class","tb-row svelte-qlezb4"),o(X,"class","token-breakdown svelte-qlezb4"),o(ie,"class","metrics card svelte-qlezb4"),o(e,"class","detail-header svelte-qlezb4"),o(Te,"class","timeline svelte-qlezb4")},m(z,V){W(z,e,V),s(e,t),s(t,l),s(l,i),s(i,r),s(l,_),s(l,p),s(p,k),s(t,P),s(t,b),s(b,C),s(t,w),x&&x.m(t,null),s(t,T),s(t,d),s(d,g),s(g,O),s(g,ae),s(g,H),s(d,Ne),s(d,pe),s(pe,_e),s(e,Re),s(e,ie),s(ie,y),s(y,J),s(J,re),s(re,ce),s(J,Ae),s(J,fe),s(fe,We),s(y,Me),s(y,ne),s(ne,ve),s(ve,be),s(ne,He),s(ne,de),s(de,De),s(y,B),s(y,j),s(j,F),s(F,G),s(j,A),s(j,R),s(R,he),s(y,Fe),s(y,ue),s(ue,we),s(we,Q),s(ue,je),s(ue,Ve),s(Ve,Ue),s(ie,Oe),s(ie,X),s(X,qe),s(qe,Qe),s(Qe,cs),s(qe,Ps),s(qe,Xe),s(Xe,Ge),s(qe,Ns),s(qe,Ye),s(Ye,fs),s(X,Ss),s(X,Ee),s(Ee,Ze),s(Ze,vs),s(Ee,As),s(Ee,ye),s(ye,Be),s(Ee,Is),s(Ee,xe),s(xe,ds),s(X,Ds),ee&&ee.m(X,null),s(X,hs),se&&se.m(X,null),s(X,us),le&&le.m(X,null),W(z,ps,V),W(z,Te,V);for(let L=0;L<Y.length;L+=1)Y[L]&&Y[L].m(Te,null);Z&&Z.m(Te,null)},p(z,V){if(V&1&&c!==(c=z[13].tool+"")&&I(r,c),V&1&&u!==(u=z[13].model+"")&&I(k,u),V&1&&m!==(m=pl(z[13].firstTs)+"")&&I(C,m),z[13].cwd?x?x.p(z,V):(x=ll(z),x.c(),x.m(t,T)):x&&(x.d(1),x=null),V&8&&D!==(D=z[3]("sessions.detail.meta.sessionId")+"")&&I(O,D),V&1&&M!==(M=z[13].sessionId+"")&&I(H,M),V&1&&oe!==(oe=_l(z[13].duration)+"")&&I(_e,oe),V&8&&Se!==(Se=z[3]("sessions.detail.meta.cost")+"")&&I(ce,Se),V&1&&me!==(me=Ts(z[13].cost)+"")&&I(We,me),V&8&&te!==(te=z[3]("sessions.detail.meta.totalTokens")+"")&&I(be,te),V&1&&Ie!==(Ie=$(z[15])+"")&&I(De,Ie),V&8&&U!==(U=z[3]("sessions.detail.meta.apiCalls")+"")&&I(G,U),V&1&&ke!==(ke=z[13].recordCount+"")&&I(he,ke),V&8&&Le!==(Le=z[3]("sessions.detail.meta.toolCalls")+"")&&I(Q,Le),V&1&&ze!==(ze=z[13].toolCallCount+"")&&I(Ue,ze),V&8&&as!==(as=z[3]("sessions.detail.meta.input")+"")&&I(cs,as),V&1&&K(Ge,"width",Pe(z[13].inputTokens,z[15])+"%"),V&1&&is!==(is=$(z[13].inputTokens)+"")&&I(fs,is),V&8&&ns!==(ns=z[3]("sessions.detail.meta.output")+"")&&I(vs,ns),V&1&&K(Be,"width",Pe(z[13].outputTokens,z[15])+"%"),V&1&&os!==(os=$(z[13].outputTokens)+"")&&I(ds,os),z[13].cacheReadTokens?ee?ee.p(z,V):(ee=tl(z),ee.c(),ee.m(X,hs)):ee&&(ee.d(1),ee=null),z[13].cacheWriteTokens?se?se.p(z,V):(se=al(z),se.c(),se.m(X,us)):se&&(se.d(1),se=null),z[13].thinkingTokens?le?le.p(z,V):(le=il(z),le.c(),le.m(X,null)):le&&(le.d(1),le=null),V&25){Ce=Ke(z[14]);let L;for(L=0;L<Ce.length;L+=1){const Je=xs(z,Ce,L);Y[L]?Y[L].p(Je,V):(Y[L]=ul(Je),Y[L].c(),Y[L].m(Te,null))}for(;L<Y.length;L+=1)Y[L].d(1);Y.length=Ce.length,!Ce.length&&Z?Z.p(z,V):Ce.length?Z&&(Z.d(1),Z=null):(Z=nl(z),Z.c(),Z.m(Te,null))}},d(z){z&&(n(e),n(ps),n(Te)),x&&x.d(),ee&&ee.d(),se&&se.d(),le&&le.d(),rs(Y,z),Z&&Z.d()}}}function Il(a){let e,t;return{c(){e=v("div"),t=S(a[1]),this.h()},l(l){e=f(l,"DIV",{class:!0});var i=h(e);t=N(i,a[1]),i.forEach(n),this.h()},h(){o(e,"class","state-msg error")},m(l,i){W(l,e,i),s(e,t)},p(l,i){i&2&&I(t,l[1])},d(l){l&&n(e)}}}function Dl(a){let e,t,l='<div class="ph-line ph-w40 svelte-qlezb4"></div> <div class="ph-line ph-w60 svelte-qlezb4"></div> <div class="ph-line ph-w80 svelte-qlezb4"></div> <div class="id-footer svelte-qlezb4" style="margin-top:auto; padding-top:0.5rem; border-top:1px solid var(--border-subtle);"><div class="ph-line ph-w50 svelte-qlezb4"></div> <div class="ph-line ph-w20 svelte-qlezb4"></div></div>',i,c,r,_,p,u,k,P=Ke([1,2,3,4]),b=[];for(let d=0;d<4;d+=1)b[d]=Cl(Sl(a,P,d));let m=Ke([1,2]),C=[];for(let d=0;d<2;d+=1)C[d]=Rl(Nl(a,m,d));let w=Ke([1,2,3]),T=[];for(let d=0;d<3;d+=1)T[d]=Wl(Pl(a,w,d));return{c(){e=v("div"),t=v("div"),t.innerHTML=l,i=E(),c=v("div"),r=v("div");for(let d=0;d<4;d+=1)b[d].c();_=E(),p=v("div");for(let d=0;d<2;d+=1)C[d].c();u=E(),k=v("div");for(let d=0;d<3;d+=1)T[d].c();this.h()},l(d){e=f(d,"DIV",{class:!0});var g=h(e);t=f(g,"DIV",{class:!0,"data-svelte-h":!0}),ts(t)!=="svelte-cj5h4s"&&(t.innerHTML=l),i=q(g),c=f(g,"DIV",{class:!0});var D=h(c);r=f(D,"DIV",{class:!0});var O=h(r);for(let H=0;H<4;H+=1)b[H].l(O);O.forEach(n),_=q(D),p=f(D,"DIV",{style:!0});var ae=h(p);for(let H=0;H<2;H+=1)C[H].l(ae);ae.forEach(n),D.forEach(n),g.forEach(n),u=q(d),k=f(d,"DIV",{class:!0});var M=h(k);for(let H=0;H<3;H+=1)T[H].l(M);M.forEach(n),this.h()},h(){o(t,"class","identity card svelte-qlezb4"),o(r,"class","metrics-grid svelte-qlezb4"),K(p,"padding-top","0.5rem"),K(p,"border-top","1px solid var(--border-subtle)"),K(p,"display","flex"),K(p,"flex-direction","column"),K(p,"gap","0.3rem"),o(c,"class","metrics card svelte-qlezb4"),o(e,"class","detail-header svelte-qlezb4"),o(k,"class","timeline svelte-qlezb4")},m(d,g){W(d,e,g),s(e,t),s(e,i),s(e,c),s(c,r);for(let D=0;D<4;D+=1)b[D]&&b[D].m(r,null);s(c,_),s(c,p);for(let D=0;D<2;D+=1)C[D]&&C[D].m(p,null);W(d,u,g),W(d,k,g);for(let D=0;D<3;D+=1)T[D]&&T[D].m(k,null)},p:ls,d(d){d&&(n(e),n(u),n(k)),rs(b,d),rs(C,d),rs(T,d)}}}function ll(a){let e,t=a[13].cwd+"",l,i;return{c(){e=v("div"),l=S(t),this.h()},l(c){e=f(c,"DIV",{class:!0,title:!0});var r=h(e);l=N(r,t),r.forEach(n),this.h()},h(){o(e,"class","id-path mono svelte-qlezb4"),o(e,"title",i=a[13].cwd)},m(c,r){W(c,e,r),s(e,l)},p(c,r){r&1&&t!==(t=c[13].cwd+"")&&I(l,t),r&1&&i!==(i=c[13].cwd)&&o(e,"title",i)},d(c){c&&n(e)}}}function tl(a){let e,t,l=a[3]("sessions.detail.meta.cacheRead")+"",i,c,r,_,p,u,k=$(a[13].cacheReadTokens)+"",P;return{c(){e=v("div"),t=v("span"),i=S(l),c=E(),r=v("span"),_=v("span"),p=E(),u=v("span"),P=S(k),this.h()},l(b){e=f(b,"DIV",{class:!0});var m=h(e);t=f(m,"SPAN",{class:!0});var C=h(t);i=N(C,l),C.forEach(n),c=q(m),r=f(m,"SPAN",{class:!0});var w=h(r);_=f(w,"SPAN",{class:!0,style:!0}),h(_).forEach(n),w.forEach(n),p=q(m),u=f(m,"SPAN",{class:!0});var T=h(u);P=N(T,k),T.forEach(n),m.forEach(n),this.h()},h(){o(t,"class","tb-label svelte-qlezb4"),o(_,"class","tb-fill tb-cache-read svelte-qlezb4"),K(_,"width",Pe(a[13].cacheReadTokens,a[15])+"%"),o(r,"class","tb-bar svelte-qlezb4"),o(u,"class","tb-value mono svelte-qlezb4"),o(e,"class","tb-row svelte-qlezb4")},m(b,m){W(b,e,m),s(e,t),s(t,i),s(e,c),s(e,r),s(r,_),s(e,p),s(e,u),s(u,P)},p(b,m){m&8&&l!==(l=b[3]("sessions.detail.meta.cacheRead")+"")&&I(i,l),m&1&&K(_,"width",Pe(b[13].cacheReadTokens,b[15])+"%"),m&1&&k!==(k=$(b[13].cacheReadTokens)+"")&&I(P,k)},d(b){b&&n(e)}}}function al(a){let e,t,l=a[3]("sessions.detail.meta.cacheWrite")+"",i,c,r,_,p,u,k=$(a[13].cacheWriteTokens)+"",P;return{c(){e=v("div"),t=v("span"),i=S(l),c=E(),r=v("span"),_=v("span"),p=E(),u=v("span"),P=S(k),this.h()},l(b){e=f(b,"DIV",{class:!0});var m=h(e);t=f(m,"SPAN",{class:!0});var C=h(t);i=N(C,l),C.forEach(n),c=q(m),r=f(m,"SPAN",{class:!0});var w=h(r);_=f(w,"SPAN",{class:!0,style:!0}),h(_).forEach(n),w.forEach(n),p=q(m),u=f(m,"SPAN",{class:!0});var T=h(u);P=N(T,k),T.forEach(n),m.forEach(n),this.h()},h(){o(t,"class","tb-label svelte-qlezb4"),o(_,"class","tb-fill tb-cache-write svelte-qlezb4"),K(_,"width",Pe(a[13].cacheWriteTokens,a[15])+"%"),o(r,"class","tb-bar svelte-qlezb4"),o(u,"class","tb-value mono svelte-qlezb4"),o(e,"class","tb-row svelte-qlezb4")},m(b,m){W(b,e,m),s(e,t),s(t,i),s(e,c),s(e,r),s(r,_),s(e,p),s(e,u),s(u,P)},p(b,m){m&8&&l!==(l=b[3]("sessions.detail.meta.cacheWrite")+"")&&I(i,l),m&1&&K(_,"width",Pe(b[13].cacheWriteTokens,b[15])+"%"),m&1&&k!==(k=$(b[13].cacheWriteTokens)+"")&&I(P,k)},d(b){b&&n(e)}}}function il(a){let e,t,l=a[3]("sessions.detail.meta.thinking")+"",i,c,r,_,p,u,k=$(a[13].thinkingTokens)+"",P;return{c(){e=v("div"),t=v("span"),i=S(l),c=E(),r=v("span"),_=v("span"),p=E(),u=v("span"),P=S(k),this.h()},l(b){e=f(b,"DIV",{class:!0});var m=h(e);t=f(m,"SPAN",{class:!0});var C=h(t);i=N(C,l),C.forEach(n),c=q(m),r=f(m,"SPAN",{class:!0});var w=h(r);_=f(w,"SPAN",{class:!0,style:!0}),h(_).forEach(n),w.forEach(n),p=q(m),u=f(m,"SPAN",{class:!0});var T=h(u);P=N(T,k),T.forEach(n),m.forEach(n),this.h()},h(){o(t,"class","tb-label svelte-qlezb4"),o(_,"class","tb-fill tb-thinking svelte-qlezb4"),K(_,"width",Pe(a[13].thinkingTokens,a[15])+"%"),o(r,"class","tb-bar svelte-qlezb4"),o(u,"class","tb-value mono svelte-qlezb4"),o(e,"class","tb-row svelte-qlezb4")},m(b,m){W(b,e,m),s(e,t),s(t,i),s(e,c),s(e,r),s(r,_),s(e,p),s(e,u),s(u,P)},p(b,m){m&8&&l!==(l=b[3]("sessions.detail.meta.thinking")+"")&&I(i,l),m&1&&K(_,"width",Pe(b[13].thinkingTokens,b[15])+"%"),m&1&&k!==(k=$(b[13].thinkingTokens)+"")&&I(P,k)},d(b){b&&n(e)}}}function nl(a){let e,t,l=a[3]("sessions.noData")+"",i,c,r,_=a[3]("sessions.noDataHint")+"",p,u;return{c(){e=v("div"),t=v("h2"),i=S(l),c=E(),r=v("p"),p=S(_),u=E(),this.h()},l(k){e=f(k,"DIV",{class:!0});var P=h(e);t=f(P,"H2",{});var b=h(t);i=N(b,l),b.forEach(n),c=q(P),r=f(P,"P",{});var m=h(r);p=N(m,_),m.forEach(n),u=q(P),P.forEach(n),this.h()},h(){o(e,"class","state-msg")},m(k,P){W(k,e,P),s(e,t),s(t,i),s(e,c),s(e,r),s(r,p),s(e,u)},p(k,P){P&8&&l!==(l=k[3]("sessions.noData")+"")&&I(i,l),P&8&&_!==(_=k[3]("sessions.noDataHint")+"")&&I(p,_)},d(k){k&&n(e)}}}function ol(a){let e,t,l=a[4](a[16].ts-a[14][a[19]-1].ts)+"",i;return{c(){e=v("div"),t=v("span"),i=S(l),this.h()},l(c){e=f(c,"DIV",{class:!0});var r=h(e);t=f(r,"SPAN",{class:!0});var _=h(t);i=N(_,l),_.forEach(n),r.forEach(n),this.h()},h(){o(t,"class","gap-text svelte-qlezb4"),o(e,"class","gap-divider svelte-qlezb4")},m(c,r){W(c,e,r),s(e,t),s(t,i)},p(c,r){r&1&&l!==(l=c[4](c[16].ts-c[14][c[19]-1].ts)+"")&&I(i,l)},d(c){c&&n(e)}}}function rl(a){let e,t,l,i,c=$(a[16].cacheReadTokens)+"",r,_;return{c(){e=v("span"),t=v("span"),l=E(),i=v("span"),r=S(c),this.h()},l(p){e=f(p,"SPAN",{class:!0,title:!0});var u=h(e);t=f(u,"SPAN",{class:!0}),h(t).forEach(n),l=q(u),i=f(u,"SPAN",{class:!0});var k=h(i);r=N(k,c),k.forEach(n),u.forEach(n),this.h()},h(){o(t,"class","rt-dot rt-cache-read svelte-qlezb4"),o(i,"class","rt-val mono svelte-qlezb4"),o(e,"class","rt-item svelte-qlezb4"),o(e,"title",_=a[3]("sessions.detail.meta.cacheRead"))},m(p,u){W(p,e,u),s(e,t),s(e,l),s(e,i),s(i,r)},p(p,u){u&1&&c!==(c=$(p[16].cacheReadTokens)+"")&&I(r,c),u&8&&_!==(_=p[3]("sessions.detail.meta.cacheRead"))&&o(e,"title",_)},d(p){p&&n(e)}}}function cl(a){let e,t,l,i,c=$(a[16].cacheWriteTokens)+"",r,_;return{c(){e=v("span"),t=v("span"),l=E(),i=v("span"),r=S(c),this.h()},l(p){e=f(p,"SPAN",{class:!0,title:!0});var u=h(e);t=f(u,"SPAN",{class:!0}),h(t).forEach(n),l=q(u),i=f(u,"SPAN",{class:!0});var k=h(i);r=N(k,c),k.forEach(n),u.forEach(n),this.h()},h(){o(t,"class","rt-dot rt-cache-write svelte-qlezb4"),o(i,"class","rt-val mono svelte-qlezb4"),o(e,"class","rt-item svelte-qlezb4"),o(e,"title",_=a[3]("sessions.detail.meta.cacheWrite"))},m(p,u){W(p,e,u),s(e,t),s(e,l),s(e,i),s(i,r)},p(p,u){u&1&&c!==(c=$(p[16].cacheWriteTokens)+"")&&I(r,c),u&8&&_!==(_=p[3]("sessions.detail.meta.cacheWrite"))&&o(e,"title",_)},d(p){p&&n(e)}}}function fl(a){let e,t,l,i,c=$(a[16].thinkingTokens)+"",r,_;return{c(){e=v("span"),t=v("span"),l=E(),i=v("span"),r=S(c),this.h()},l(p){e=f(p,"SPAN",{class:!0,title:!0});var u=h(e);t=f(u,"SPAN",{class:!0}),h(t).forEach(n),l=q(u),i=f(u,"SPAN",{class:!0});var k=h(i);r=N(k,c),k.forEach(n),u.forEach(n),this.h()},h(){o(t,"class","rt-dot rt-thinking svelte-qlezb4"),o(i,"class","rt-val mono svelte-qlezb4"),o(e,"class","rt-item svelte-qlezb4"),o(e,"title",_=a[3]("sessions.detail.meta.thinking"))},m(p,u){W(p,e,u),s(e,t),s(e,l),s(e,i),s(i,r)},p(p,u){u&1&&c!==(c=$(p[16].thinkingTokens)+"")&&I(r,c),u&8&&_!==(_=p[3]("sessions.detail.meta.thinking"))&&o(e,"title",_)},d(p){p&&n(e)}}}function vl(a){let e,t=Ke(a[16].toolCalls),l=[];for(let i=0;i<t.length;i+=1)l[i]=hl(el(a,t,i));return{c(){e=v("div");for(let i=0;i<l.length;i+=1)l[i].c();this.h()},l(i){e=f(i,"DIV",{class:!0});var c=h(e);for(let r=0;r<l.length;r+=1)l[r].l(c);c.forEach(n),this.h()},h(){o(e,"class","tool-calls svelte-qlezb4")},m(i,c){W(i,e,c);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(e,null)},p(i,c){if(c&1){t=Ke(i[16].toolCalls);let r;for(r=0;r<t.length;r+=1){const _=el(i,t,r);l[r]?l[r].p(_,c):(l[r]=hl(_),l[r].c(),l[r].m(e,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=t.length}},d(i){i&&n(e),rs(l,i)}}}function dl(a){let e,t=gs(a[20].ts-a[16].ts)+"",l;return{c(){e=v("span"),l=S(t),this.h()},l(i){e=f(i,"SPAN",{class:!0});var c=h(e);l=N(c,t),c.forEach(n),this.h()},h(){o(e,"class","tc-offset mono muted svelte-qlezb4")},m(i,c){W(i,e,c),s(e,l)},p(i,c){c&1&&t!==(t=gs(i[20].ts-i[16].ts)+"")&&I(l,t)},d(i){i&&n(e)}}}function wl(a){let e,t="skill";return{c(){e=v("span"),e.textContent=t,this.h()},l(l){e=f(l,"SPAN",{class:!0,"data-svelte-h":!0}),ts(e)!=="svelte-slxz3u"&&(e.textContent=t),this.h()},h(){o(e,"class","badge badge-skill svelte-qlezb4")},m(l,i){W(l,e,i)},d(l){l&&n(e)}}}function Vl(a){let e,t="mcp";return{c(){e=v("span"),e.textContent=t,this.h()},l(l){e=f(l,"SPAN",{class:!0,"data-svelte-h":!0}),ts(e)!=="svelte-uwmdxw"&&(e.textContent=t),this.h()},h(){o(e,"class","badge badge-mcp svelte-qlezb4")},m(l,i){W(l,e,i)},d(l){l&&n(e)}}}function hl(a){let e,t,l,i=a[20].callIndex+1+"",c,r,_,p=a[20].displayName+"",u,k,P,b,m=a[20].ts!=null&&dl(a);function C(d,g){if(d[20].type==="mcp")return Vl;if(d[20].type==="skill")return wl}let w=C(a),T=w&&w(a);return{c(){e=v("div"),t=v("span"),l=S("#"),c=S(i),r=E(),_=v("span"),u=S(p),k=E(),m&&m.c(),P=E(),T&&T.c(),b=E(),this.h()},l(d){e=f(d,"DIV",{class:!0});var g=h(e);t=f(g,"SPAN",{class:!0});var D=h(t);l=N(D,"#"),c=N(D,i),D.forEach(n),r=q(g),_=f(g,"SPAN",{class:!0});var O=h(_);u=N(O,p),O.forEach(n),k=q(g),m&&m.l(g),P=q(g),T&&T.l(g),b=q(g),g.forEach(n),this.h()},h(){o(t,"class","tc-index mono muted svelte-qlezb4"),o(_,"class","tc-name mono svelte-qlezb4"),o(e,"class","tool-call svelte-qlezb4")},m(d,g){W(d,e,g),s(e,t),s(t,l),s(t,c),s(e,r),s(e,_),s(_,u),s(e,k),m&&m.m(e,null),s(e,P),T&&T.m(e,null),s(e,b)},p(d,g){g&1&&i!==(i=d[20].callIndex+1+"")&&I(c,i),g&1&&p!==(p=d[20].displayName+"")&&I(u,p),d[20].ts!=null?m?m.p(d,g):(m=dl(d),m.c(),m.m(e,P)):m&&(m.d(1),m=null),w!==(w=C(d))&&(T&&T.d(1),T=w&&w(d),T&&(T.c(),T.m(e,b)))},d(d){d&&n(e),m&&m.d(),T&&T.d()}}}function ul(a){let e,t,l,i,c,r,_=a[19]+1+"",p,u,k,P=gs(a[16].ts-a[13].firstTs)+"",b,m,C,w=a[16].model+"",T,d,g,D=Ts(a[16].cost)+"",O,ae,M,H,Ne,pe,oe,_e=$(a[16].inputTokens)+"",Re,ie,y,J,re,Se,ce,Ae=$(a[16].outputTokens)+"",fe,me,We,Me,ne,ve,te,be=$(a[17])+"",He,de,Ie,De,B=a[19]>0&&a[16].ts-a[14][a[19]-1].ts>1e3&&ol(a),j=a[16].cacheReadTokens&&rl(a),F=a[16].cacheWriteTokens&&cl(a),U=a[16].thinkingTokens&&fl(a),G=a[16].toolCalls&&a[16].toolCalls.length>0&&vl(a);return{c(){B&&B.c(),e=E(),t=v("div"),l=v("div"),i=v("div"),c=v("span"),r=S("#"),p=S(_),u=E(),k=v("span"),b=S(P),m=E(),C=v("span"),T=S(w),d=E(),g=v("span"),O=S(D),ae=E(),M=v("div"),H=v("span"),Ne=v("span"),pe=E(),oe=v("span"),Re=S(_e),y=E(),J=v("span"),re=v("span"),Se=E(),ce=v("span"),fe=S(Ae),We=E(),j&&j.c(),Me=E(),F&&F.c(),ne=E(),U&&U.c(),ve=E(),te=v("span"),He=S(be),Ie=E(),G&&G.c(),De=E(),this.h()},l(A){B&&B.l(A),e=q(A),t=f(A,"DIV",{class:!0});var R=h(t);l=f(R,"DIV",{class:!0});var ke=h(l);i=f(ke,"DIV",{class:!0});var he=h(i);c=f(he,"SPAN",{class:!0});var Fe=h(c);r=N(Fe,"#"),p=N(Fe,_),Fe.forEach(n),u=q(he),k=f(he,"SPAN",{class:!0});var ue=h(k);b=N(ue,P),ue.forEach(n),m=q(he),C=f(he,"SPAN",{class:!0});var we=h(C);T=N(we,w),we.forEach(n),he.forEach(n),d=q(ke),g=f(ke,"SPAN",{class:!0});var Le=h(g);O=N(Le,D),Le.forEach(n),ke.forEach(n),ae=q(R),M=f(R,"DIV",{class:!0});var Q=h(M);H=f(Q,"SPAN",{class:!0,title:!0});var je=h(H);Ne=f(je,"SPAN",{class:!0}),h(Ne).forEach(n),pe=q(je),oe=f(je,"SPAN",{class:!0});var Ve=h(oe);Re=N(Ve,_e),Ve.forEach(n),je.forEach(n),y=q(Q),J=f(Q,"SPAN",{class:!0,title:!0});var ze=h(J);re=f(ze,"SPAN",{class:!0}),h(re).forEach(n),Se=q(ze),ce=f(ze,"SPAN",{class:!0});var Ue=h(ce);fe=N(Ue,Ae),Ue.forEach(n),ze.forEach(n),We=q(Q),j&&j.l(Q),Me=q(Q),F&&F.l(Q),ne=q(Q),U&&U.l(Q),ve=q(Q),te=f(Q,"SPAN",{class:!0,title:!0});var Oe=h(te);He=N(Oe,be),Oe.forEach(n),Q.forEach(n),Ie=q(R),G&&G.l(R),De=q(R),R.forEach(n),this.h()},h(){o(c,"class","record-index mono svelte-qlezb4"),o(k,"class","record-relts mono muted svelte-qlezb4"),o(C,"class","record-model mono svelte-qlezb4"),o(i,"class","record-meta-left svelte-qlezb4"),o(g,"class","record-cost mono accent svelte-qlezb4"),o(l,"class","record-header svelte-qlezb4"),o(Ne,"class","rt-dot rt-input svelte-qlezb4"),o(oe,"class","rt-val mono svelte-qlezb4"),o(H,"class","rt-item svelte-qlezb4"),o(H,"title",ie=a[3]("sessions.detail.meta.input")),o(re,"class","rt-dot rt-output svelte-qlezb4"),o(ce,"class","rt-val mono svelte-qlezb4"),o(J,"class","rt-item svelte-qlezb4"),o(J,"title",me=a[3]("sessions.detail.meta.output")),o(te,"class","rt-total mono muted svelte-qlezb4"),o(te,"title",de=a[3]("sessions.detail.meta.totalTokens")),o(M,"class","record-tokens svelte-qlezb4"),o(t,"class","record-card card svelte-qlezb4")},m(A,R){B&&B.m(A,R),W(A,e,R),W(A,t,R),s(t,l),s(l,i),s(i,c),s(c,r),s(c,p),s(i,u),s(i,k),s(k,b),s(i,m),s(i,C),s(C,T),s(l,d),s(l,g),s(g,O),s(t,ae),s(t,M),s(M,H),s(H,Ne),s(H,pe),s(H,oe),s(oe,Re),s(M,y),s(M,J),s(J,re),s(J,Se),s(J,ce),s(ce,fe),s(M,We),j&&j.m(M,null),s(M,Me),F&&F.m(M,null),s(M,ne),U&&U.m(M,null),s(M,ve),s(M,te),s(te,He),s(t,Ie),G&&G.m(t,null),s(t,De)},p(A,R){A[19]>0&&A[16].ts-A[14][A[19]-1].ts>1e3?B?B.p(A,R):(B=ol(A),B.c(),B.m(e.parentNode,e)):B&&(B.d(1),B=null),R&1&&P!==(P=gs(A[16].ts-A[13].firstTs)+"")&&I(b,P),R&1&&w!==(w=A[16].model+"")&&I(T,w),R&1&&D!==(D=Ts(A[16].cost)+"")&&I(O,D),R&1&&_e!==(_e=$(A[16].inputTokens)+"")&&I(Re,_e),R&8&&ie!==(ie=A[3]("sessions.detail.meta.input"))&&o(H,"title",ie),R&1&&Ae!==(Ae=$(A[16].outputTokens)+"")&&I(fe,Ae),R&8&&me!==(me=A[3]("sessions.detail.meta.output"))&&o(J,"title",me),A[16].cacheReadTokens?j?j.p(A,R):(j=rl(A),j.c(),j.m(M,Me)):j&&(j.d(1),j=null),A[16].cacheWriteTokens?F?F.p(A,R):(F=cl(A),F.c(),F.m(M,ne)):F&&(F.d(1),F=null),A[16].thinkingTokens?U?U.p(A,R):(U=fl(A),U.c(),U.m(M,ve)):U&&(U.d(1),U=null),R&1&&be!==(be=$(A[17])+"")&&I(He,be),R&8&&de!==(de=A[3]("sessions.detail.meta.totalTokens"))&&o(te,"title",de),A[16].toolCalls&&A[16].toolCalls.length>0?G?G.p(A,R):(G=vl(A),G.c(),G.m(t,De)):G&&(G.d(1),G=null)},d(A){A&&(n(e),n(t)),B&&B.d(A),j&&j.d(),F&&F.d(),U&&U.d(),G&&G.d()}}}function Cl(a){let e,t='<div class="ph-line ph-w60 svelte-qlezb4" style="height:0.5rem;margin-bottom:0.25rem"></div> <div class="ph-line ph-w40 svelte-qlezb4" style="height:0.85rem"></div> ';return{c(){e=v("div"),e.innerHTML=t,this.h()},l(l){e=f(l,"DIV",{class:!0,"data-svelte-h":!0}),ts(e)!=="svelte-sj1wh2"&&(e.innerHTML=t),this.h()},h(){o(e,"class","metric-cell svelte-qlezb4")},m(l,i){W(l,e,i)},p:ls,d(l){l&&n(e)}}}function Rl(a){let e,t='<div class="ph-line ph-w60 svelte-qlezb4" style="height:0.5rem"></div> <div class="ph-line svelte-qlezb4" style="height:6px;border-radius:3px"></div> <div class="ph-line ph-w50 svelte-qlezb4" style="height:0.5rem"></div> ';return{c(){e=v("div"),e.innerHTML=t,this.h()},l(l){e=f(l,"DIV",{style:!0,"data-svelte-h":!0}),ts(e)!=="svelte-1h640di"&&(e.innerHTML=t),this.h()},h(){K(e,"display","grid"),K(e,"grid-template-columns","5.5rem 1fr 4.5rem"),K(e,"gap","0.5rem"),K(e,"align-items","center")},m(l,i){W(l,e,i)},p:ls,d(l){l&&n(e)}}}function Wl(a){let e,t='<div style="display:flex;justify-content:space-between;margin-bottom:0.375rem"><div class="ph-line ph-w40 svelte-qlezb4"></div> <div class="ph-line ph-w20 svelte-qlezb4"></div></div> <div style="display:flex;gap:0.75rem;margin-bottom:0.375rem"><div class="ph-line ph-w20 svelte-qlezb4"></div> <div class="ph-line ph-w20 svelte-qlezb4"></div></div> ';return{c(){e=v("div"),e.innerHTML=t,this.h()},l(l){e=f(l,"DIV",{class:!0,"data-svelte-h":!0}),ts(e)!=="svelte-8o0mhs"&&(e.innerHTML=t),this.h()},h(){o(e,"class","record-card card svelte-qlezb4")},m(l,i){W(l,e,i)},p:ls,d(l){l&&n(e)}}}function Ml(a){let e,t,l,i,c=a[3]("sessions.detail.back")+"",r,_,p,u=a[3]("sessions.detail.title")+"",k,P,b;document.title=e=a[3]("sessions.detail.title")+" — AIUsage";function m(d,g){if(d[2])return Dl;if(d[1])return Il;if(d[0])return sl}function C(d,g){return g===sl?Al(d):d}let w=m(a),T=w&&w(C(a,w));return{c(){t=E(),l=v("div"),i=v("a"),r=S(c),_=E(),p=v("h1"),k=S(u),P=E(),T&&T.c(),b=ys(),this.h()},l(d){ql("svelte-11yx7zf",document.head).forEach(n),t=q(d),l=f(d,"DIV",{class:!0});var D=h(l);i=f(D,"A",{class:!0,href:!0});var O=h(i);r=N(O,c),O.forEach(n),_=q(D),p=f(D,"H1",{});var ae=h(p);k=N(ae,u),ae.forEach(n),D.forEach(n),P=q(d),T&&T.l(d),b=ys(),this.h()},h(){o(i,"class","back-link svelte-qlezb4"),o(i,"href","/sessions"),o(l,"class","page-header")},m(d,g){W(d,t,g),W(d,l,g),s(l,i),s(i,r),s(l,_),s(l,p),s(p,k),W(d,P,g),T&&T.m(d,g),W(d,b,g)},p(d,[g]){g&8&&e!==(e=d[3]("sessions.detail.title")+" — AIUsage")&&(document.title=e),g&8&&c!==(c=d[3]("sessions.detail.back")+"")&&I(r,c),g&8&&u!==(u=d[3]("sessions.detail.title")+"")&&I(k,u),w===(w=m(d))&&T?T.p(C(d,w),g):(T&&T.d(1),T=w&&w(C(d,w)),T&&(T.c(),T.m(b.parentNode,b)))},i:ls,o:ls,d(d){d&&(n(t),n(l),n(P),n(b)),T&&T.d(d)}}}function pl(a){return new Date(a).toLocaleString()}function _l(a){if(!a||a<1e3)return"< 1s";const e=Math.floor(a/1e3),t=Math.floor(e/60),l=Math.floor(t/60);return l>0?`${l}h ${t%60}m ${e%60}s`:t===0?`${e}s`:`${t}m ${e%60}s`}function gs(a){if(a<=0)return"+0ms";if(a<1e3)return`+${a}ms`;const e=a/1e3;return`+${e%1===0?e.toFixed(0):e.toFixed(1)}s`}function Pe(a,e){return!e||!a?0:Math.round(a/e*1e3)/10}function Hl(a,e,t){let l,i;Zs(a,Tl,u=>t(5,l=u)),Zs(a,gl,u=>t(3,i=u));let c=null,r=null,_=!0;function p(u){return`— ${Math.round(u/1e3)}s ${i("sessions.detail.gap")} —`}return bl(async()=>{const u=l.params.sessionId,k=l.url.searchParams.get("tool")||"",P=l.url.searchParams.get("device")||"";try{t(0,c=await El(u,{tool:k,device:P}))}catch(b){t(1,r=b instanceof Error?b.message:"Failed to load session")}finally{t(2,_=!1)}}),[c,r,_,i,p]}class Bl extends kl{constructor(e){super(),zl(this,e,Hl,Ml,ml,{})}}export{Bl as component};
|
|
1
|
+
import{s as ml,n as ls,c as Zs,o as bl}from"../chunks/scheduler.DsWd5xup.js";import{S as kl,i as zl,d as n,s as I,a as W,b as s,o,p as ql,g as q,c as f,e as h,f as N,r as ys,j as E,h as v,t as S,v as rs,x as K,C as ts}from"../chunks/index.BfJlbjrK.js";import{z as El,e as Ke}from"../chunks/api.DVLAklIn.js";import{p as Tl}from"../chunks/stores.YDlXfj0w.js";import{f as Ts,b as $}from"../chunks/stores.BSI_cVy6.js";import{t as gl}from"../chunks/i18n.DApJIXOT.js";function xs(a,e,t){const l=a.slice();l[16]=e[t],l[19]=t;const i=l[16].inputTokens+l[16].outputTokens+(l[16].cacheReadTokens||0)+(l[16].cacheWriteTokens||0)+(l[16].thinkingTokens||0);return l[17]=i,l}function el(a,e,t){const l=a.slice();return l[20]=e[t],l}function Pl(a,e,t){const l=a.slice();return l[6]=e[t],l}function Nl(a,e,t){const l=a.slice();return l[6]=e[t],l}function Sl(a,e,t){const l=a.slice();return l[6]=e[t],l}function Al(a){const e=a.slice(),t=e[0].session;e[13]=t;const l=e[0].records;e[14]=l;const i=e[13].inputTokens+e[13].outputTokens+(e[13].cacheReadTokens||0)+(e[13].cacheWriteTokens||0)+(e[13].thinkingTokens||0);return e[15]=i,e}function sl(a){let e,t,l,i,c=a[13].tool+"",r,_,p,u=a[13].model+"",k,P,b,m=pl(a[13].firstTs)+"",C,w,T,d,g,D=a[3]("sessions.detail.meta.sessionId")+"",O,ae,M=a[13].sessionId+"",H,Ne,pe,oe=_l(a[13].duration)+"",_e,Re,ie,y,J,re,Se=a[3]("sessions.detail.meta.cost")+"",ce,Ae,fe,me=Ts(a[13].cost)+"",We,Me,ne,ve,te=a[3]("sessions.detail.meta.totalTokens")+"",be,He,de,Ie=$(a[15])+"",De,B,j,F,U=a[3]("sessions.detail.meta.apiCalls")+"",G,A,R,ke=a[13].recordCount+"",he,Fe,ue,we,Le=a[3]("sessions.detail.meta.toolCalls")+"",Q,je,Ve,ze=a[13].toolCallCount+"",Ue,Oe,X,qe,Qe,as=a[3]("sessions.detail.meta.input")+"",cs,Ps,Xe,Ge,Ns,Ye,is=$(a[13].inputTokens)+"",fs,Ss,Ee,Ze,ns=a[3]("sessions.detail.meta.output")+"",vs,As,ye,Be,Is,xe,os=$(a[13].outputTokens)+"",ds,Ds,hs,us,ps,Te,x=a[13].cwd&&ll(a),ee=a[13].cacheReadTokens&&tl(a),se=a[13].cacheWriteTokens&&al(a),le=a[13].thinkingTokens&&il(a),Ce=Ke(a[14]),Y=[];for(let z=0;z<Ce.length;z+=1)Y[z]=ul(xs(a,Ce,z));let Z=null;return Ce.length||(Z=nl(a)),{c(){e=v("div"),t=v("div"),l=v("div"),i=v("span"),r=S(c),_=E(),p=v("span"),k=S(u),P=E(),b=v("div"),C=S(m),w=E(),x&&x.c(),T=E(),d=v("div"),g=v("span"),O=S(D),ae=S(": "),H=S(M),Ne=E(),pe=v("span"),_e=S(oe),Re=E(),ie=v("div"),y=v("div"),J=v("div"),re=v("span"),ce=S(Se),Ae=E(),fe=v("span"),We=S(me),Me=E(),ne=v("div"),ve=v("span"),be=S(te),He=E(),de=v("span"),De=S(Ie),B=E(),j=v("div"),F=v("span"),G=S(U),A=E(),R=v("span"),he=S(ke),Fe=E(),ue=v("div"),we=v("span"),Q=S(Le),je=E(),Ve=v("span"),Ue=S(ze),Oe=E(),X=v("div"),qe=v("div"),Qe=v("span"),cs=S(as),Ps=E(),Xe=v("span"),Ge=v("span"),Ns=E(),Ye=v("span"),fs=S(is),Ss=E(),Ee=v("div"),Ze=v("span"),vs=S(ns),As=E(),ye=v("span"),Be=v("span"),Is=E(),xe=v("span"),ds=S(os),Ds=E(),ee&&ee.c(),hs=E(),se&&se.c(),us=E(),le&&le.c(),ps=E(),Te=v("div");for(let z=0;z<Y.length;z+=1)Y[z].c();Z&&Z.c(),this.h()},l(z){e=f(z,"DIV",{class:!0});var V=h(e);t=f(V,"DIV",{class:!0});var L=h(t);l=f(L,"DIV",{class:!0});var Je=h(l);i=f(Je,"SPAN",{class:!0});var Cs=h(i);r=N(Cs,c),Cs.forEach(n),_=q(Je),p=f(Je,"SPAN",{class:!0});var Rs=h(p);k=N(Rs,u),Rs.forEach(n),Je.forEach(n),P=q(L),b=f(L,"DIV",{class:!0});var Ws=h(b);C=N(Ws,m),Ws.forEach(n),w=q(L),x&&x.l(L),T=q(L),d=f(L,"DIV",{class:!0});var _s=h(d);g=f(_s,"SPAN",{class:!0});var ms=h(g);O=N(ms,D),ae=N(ms,": "),H=N(ms,M),ms.forEach(n),Ne=q(_s),pe=f(_s,"SPAN",{class:!0});var Ms=h(pe);_e=N(Ms,oe),Ms.forEach(n),_s.forEach(n),L.forEach(n),Re=q(V),ie=f(V,"DIV",{class:!0});var bs=h(ie);y=f(bs,"DIV",{class:!0});var $e=h(y);J=f($e,"DIV",{class:!0});var ks=h(J);re=f(ks,"SPAN",{class:!0});var Hs=h(re);ce=N(Hs,Se),Hs.forEach(n),Ae=q(ks),fe=f(ks,"SPAN",{class:!0});var Ls=h(fe);We=N(Ls,me),Ls.forEach(n),ks.forEach(n),Me=q($e),ne=f($e,"DIV",{class:!0});var zs=h(ne);ve=f(zs,"SPAN",{class:!0});var js=h(ve);be=N(js,te),js.forEach(n),He=q(zs),de=f(zs,"SPAN",{class:!0});var $s=h(de);De=N($s,Ie),$s.forEach(n),zs.forEach(n),B=q($e),j=f($e,"DIV",{class:!0});var qs=h(j);F=f(qs,"SPAN",{class:!0});var Fs=h(F);G=N(Fs,U),Fs.forEach(n),A=q(qs),R=f(qs,"SPAN",{class:!0});var Us=h(R);he=N(Us,ke),Us.forEach(n),qs.forEach(n),Fe=q($e),ue=f($e,"DIV",{class:!0});var Es=h(ue);we=f(Es,"SPAN",{class:!0});var Gs=h(we);Q=N(Gs,Le),Gs.forEach(n),je=q(Es),Ve=f(Es,"SPAN",{class:!0});var Bs=h(Ve);Ue=N(Bs,ze),Bs.forEach(n),Es.forEach(n),$e.forEach(n),Oe=q(bs),X=f(bs,"DIV",{class:!0});var ge=h(X);qe=f(ge,"DIV",{class:!0});var es=h(qe);Qe=f(es,"SPAN",{class:!0});var Js=h(Qe);cs=N(Js,as),Js.forEach(n),Ps=q(es),Xe=f(es,"SPAN",{class:!0});var Ks=h(Xe);Ge=f(Ks,"SPAN",{class:!0,style:!0}),h(Ge).forEach(n),Ks.forEach(n),Ns=q(es),Ye=f(es,"SPAN",{class:!0});var Os=h(Ye);fs=N(Os,is),Os.forEach(n),es.forEach(n),Ss=q(ge),Ee=f(ge,"DIV",{class:!0});var ss=h(Ee);Ze=f(ss,"SPAN",{class:!0});var Qs=h(Ze);vs=N(Qs,ns),Qs.forEach(n),As=q(ss),ye=f(ss,"SPAN",{class:!0});var Xs=h(ye);Be=f(Xs,"SPAN",{class:!0,style:!0}),h(Be).forEach(n),Xs.forEach(n),Is=q(ss),xe=f(ss,"SPAN",{class:!0});var Ys=h(xe);ds=N(Ys,os),Ys.forEach(n),ss.forEach(n),Ds=q(ge),ee&&ee.l(ge),hs=q(ge),se&&se.l(ge),us=q(ge),le&&le.l(ge),ge.forEach(n),bs.forEach(n),V.forEach(n),ps=q(z),Te=f(z,"DIV",{class:!0});var ws=h(Te);for(let Vs=0;Vs<Y.length;Vs+=1)Y[Vs].l(ws);Z&&Z.l(ws),ws.forEach(n),this.h()},h(){o(i,"class","id-tool svelte-qlezb4"),o(p,"class","id-model mono svelte-qlezb4"),o(l,"class","id-row svelte-qlezb4"),o(b,"class","id-time mono svelte-qlezb4"),o(g,"class","id-session mono svelte-qlezb4"),o(pe,"class","id-duration mono svelte-qlezb4"),o(d,"class","id-footer svelte-qlezb4"),o(t,"class","identity card svelte-qlezb4"),o(re,"class","metric-label svelte-qlezb4"),o(fe,"class","metric-value mono accent svelte-qlezb4"),o(J,"class","metric-cell svelte-qlezb4"),o(ve,"class","metric-label svelte-qlezb4"),o(de,"class","metric-value mono svelte-qlezb4"),o(ne,"class","metric-cell svelte-qlezb4"),o(F,"class","metric-label svelte-qlezb4"),o(R,"class","metric-value mono svelte-qlezb4"),o(j,"class","metric-cell svelte-qlezb4"),o(we,"class","metric-label svelte-qlezb4"),o(Ve,"class","metric-value mono svelte-qlezb4"),o(ue,"class","metric-cell svelte-qlezb4"),o(y,"class","metrics-grid svelte-qlezb4"),o(Qe,"class","tb-label svelte-qlezb4"),o(Ge,"class","tb-fill tb-input svelte-qlezb4"),K(Ge,"width",Pe(a[13].inputTokens,a[15])+"%"),o(Xe,"class","tb-bar svelte-qlezb4"),o(Ye,"class","tb-value mono svelte-qlezb4"),o(qe,"class","tb-row svelte-qlezb4"),o(Ze,"class","tb-label svelte-qlezb4"),o(Be,"class","tb-fill tb-output svelte-qlezb4"),K(Be,"width",Pe(a[13].outputTokens,a[15])+"%"),o(ye,"class","tb-bar svelte-qlezb4"),o(xe,"class","tb-value mono svelte-qlezb4"),o(Ee,"class","tb-row svelte-qlezb4"),o(X,"class","token-breakdown svelte-qlezb4"),o(ie,"class","metrics card svelte-qlezb4"),o(e,"class","detail-header svelte-qlezb4"),o(Te,"class","timeline svelte-qlezb4")},m(z,V){W(z,e,V),s(e,t),s(t,l),s(l,i),s(i,r),s(l,_),s(l,p),s(p,k),s(t,P),s(t,b),s(b,C),s(t,w),x&&x.m(t,null),s(t,T),s(t,d),s(d,g),s(g,O),s(g,ae),s(g,H),s(d,Ne),s(d,pe),s(pe,_e),s(e,Re),s(e,ie),s(ie,y),s(y,J),s(J,re),s(re,ce),s(J,Ae),s(J,fe),s(fe,We),s(y,Me),s(y,ne),s(ne,ve),s(ve,be),s(ne,He),s(ne,de),s(de,De),s(y,B),s(y,j),s(j,F),s(F,G),s(j,A),s(j,R),s(R,he),s(y,Fe),s(y,ue),s(ue,we),s(we,Q),s(ue,je),s(ue,Ve),s(Ve,Ue),s(ie,Oe),s(ie,X),s(X,qe),s(qe,Qe),s(Qe,cs),s(qe,Ps),s(qe,Xe),s(Xe,Ge),s(qe,Ns),s(qe,Ye),s(Ye,fs),s(X,Ss),s(X,Ee),s(Ee,Ze),s(Ze,vs),s(Ee,As),s(Ee,ye),s(ye,Be),s(Ee,Is),s(Ee,xe),s(xe,ds),s(X,Ds),ee&&ee.m(X,null),s(X,hs),se&&se.m(X,null),s(X,us),le&&le.m(X,null),W(z,ps,V),W(z,Te,V);for(let L=0;L<Y.length;L+=1)Y[L]&&Y[L].m(Te,null);Z&&Z.m(Te,null)},p(z,V){if(V&1&&c!==(c=z[13].tool+"")&&I(r,c),V&1&&u!==(u=z[13].model+"")&&I(k,u),V&1&&m!==(m=pl(z[13].firstTs)+"")&&I(C,m),z[13].cwd?x?x.p(z,V):(x=ll(z),x.c(),x.m(t,T)):x&&(x.d(1),x=null),V&8&&D!==(D=z[3]("sessions.detail.meta.sessionId")+"")&&I(O,D),V&1&&M!==(M=z[13].sessionId+"")&&I(H,M),V&1&&oe!==(oe=_l(z[13].duration)+"")&&I(_e,oe),V&8&&Se!==(Se=z[3]("sessions.detail.meta.cost")+"")&&I(ce,Se),V&1&&me!==(me=Ts(z[13].cost)+"")&&I(We,me),V&8&&te!==(te=z[3]("sessions.detail.meta.totalTokens")+"")&&I(be,te),V&1&&Ie!==(Ie=$(z[15])+"")&&I(De,Ie),V&8&&U!==(U=z[3]("sessions.detail.meta.apiCalls")+"")&&I(G,U),V&1&&ke!==(ke=z[13].recordCount+"")&&I(he,ke),V&8&&Le!==(Le=z[3]("sessions.detail.meta.toolCalls")+"")&&I(Q,Le),V&1&&ze!==(ze=z[13].toolCallCount+"")&&I(Ue,ze),V&8&&as!==(as=z[3]("sessions.detail.meta.input")+"")&&I(cs,as),V&1&&K(Ge,"width",Pe(z[13].inputTokens,z[15])+"%"),V&1&&is!==(is=$(z[13].inputTokens)+"")&&I(fs,is),V&8&&ns!==(ns=z[3]("sessions.detail.meta.output")+"")&&I(vs,ns),V&1&&K(Be,"width",Pe(z[13].outputTokens,z[15])+"%"),V&1&&os!==(os=$(z[13].outputTokens)+"")&&I(ds,os),z[13].cacheReadTokens?ee?ee.p(z,V):(ee=tl(z),ee.c(),ee.m(X,hs)):ee&&(ee.d(1),ee=null),z[13].cacheWriteTokens?se?se.p(z,V):(se=al(z),se.c(),se.m(X,us)):se&&(se.d(1),se=null),z[13].thinkingTokens?le?le.p(z,V):(le=il(z),le.c(),le.m(X,null)):le&&(le.d(1),le=null),V&25){Ce=Ke(z[14]);let L;for(L=0;L<Ce.length;L+=1){const Je=xs(z,Ce,L);Y[L]?Y[L].p(Je,V):(Y[L]=ul(Je),Y[L].c(),Y[L].m(Te,null))}for(;L<Y.length;L+=1)Y[L].d(1);Y.length=Ce.length,!Ce.length&&Z?Z.p(z,V):Ce.length?Z&&(Z.d(1),Z=null):(Z=nl(z),Z.c(),Z.m(Te,null))}},d(z){z&&(n(e),n(ps),n(Te)),x&&x.d(),ee&&ee.d(),se&&se.d(),le&&le.d(),rs(Y,z),Z&&Z.d()}}}function Il(a){let e,t;return{c(){e=v("div"),t=S(a[1]),this.h()},l(l){e=f(l,"DIV",{class:!0});var i=h(e);t=N(i,a[1]),i.forEach(n),this.h()},h(){o(e,"class","state-msg error")},m(l,i){W(l,e,i),s(e,t)},p(l,i){i&2&&I(t,l[1])},d(l){l&&n(e)}}}function Dl(a){let e,t,l='<div class="ph-line ph-w40 svelte-qlezb4"></div> <div class="ph-line ph-w60 svelte-qlezb4"></div> <div class="ph-line ph-w80 svelte-qlezb4"></div> <div class="id-footer svelte-qlezb4" style="margin-top:auto; padding-top:0.5rem; border-top:1px solid var(--border-subtle);"><div class="ph-line ph-w50 svelte-qlezb4"></div> <div class="ph-line ph-w20 svelte-qlezb4"></div></div>',i,c,r,_,p,u,k,P=Ke([1,2,3,4]),b=[];for(let d=0;d<4;d+=1)b[d]=Cl(Sl(a,P,d));let m=Ke([1,2]),C=[];for(let d=0;d<2;d+=1)C[d]=Rl(Nl(a,m,d));let w=Ke([1,2,3]),T=[];for(let d=0;d<3;d+=1)T[d]=Wl(Pl(a,w,d));return{c(){e=v("div"),t=v("div"),t.innerHTML=l,i=E(),c=v("div"),r=v("div");for(let d=0;d<4;d+=1)b[d].c();_=E(),p=v("div");for(let d=0;d<2;d+=1)C[d].c();u=E(),k=v("div");for(let d=0;d<3;d+=1)T[d].c();this.h()},l(d){e=f(d,"DIV",{class:!0});var g=h(e);t=f(g,"DIV",{class:!0,"data-svelte-h":!0}),ts(t)!=="svelte-cj5h4s"&&(t.innerHTML=l),i=q(g),c=f(g,"DIV",{class:!0});var D=h(c);r=f(D,"DIV",{class:!0});var O=h(r);for(let H=0;H<4;H+=1)b[H].l(O);O.forEach(n),_=q(D),p=f(D,"DIV",{style:!0});var ae=h(p);for(let H=0;H<2;H+=1)C[H].l(ae);ae.forEach(n),D.forEach(n),g.forEach(n),u=q(d),k=f(d,"DIV",{class:!0});var M=h(k);for(let H=0;H<3;H+=1)T[H].l(M);M.forEach(n),this.h()},h(){o(t,"class","identity card svelte-qlezb4"),o(r,"class","metrics-grid svelte-qlezb4"),K(p,"padding-top","0.5rem"),K(p,"border-top","1px solid var(--border-subtle)"),K(p,"display","flex"),K(p,"flex-direction","column"),K(p,"gap","0.3rem"),o(c,"class","metrics card svelte-qlezb4"),o(e,"class","detail-header svelte-qlezb4"),o(k,"class","timeline svelte-qlezb4")},m(d,g){W(d,e,g),s(e,t),s(e,i),s(e,c),s(c,r);for(let D=0;D<4;D+=1)b[D]&&b[D].m(r,null);s(c,_),s(c,p);for(let D=0;D<2;D+=1)C[D]&&C[D].m(p,null);W(d,u,g),W(d,k,g);for(let D=0;D<3;D+=1)T[D]&&T[D].m(k,null)},p:ls,d(d){d&&(n(e),n(u),n(k)),rs(b,d),rs(C,d),rs(T,d)}}}function ll(a){let e,t=a[13].cwd+"",l,i;return{c(){e=v("div"),l=S(t),this.h()},l(c){e=f(c,"DIV",{class:!0,title:!0});var r=h(e);l=N(r,t),r.forEach(n),this.h()},h(){o(e,"class","id-path mono svelte-qlezb4"),o(e,"title",i=a[13].cwd)},m(c,r){W(c,e,r),s(e,l)},p(c,r){r&1&&t!==(t=c[13].cwd+"")&&I(l,t),r&1&&i!==(i=c[13].cwd)&&o(e,"title",i)},d(c){c&&n(e)}}}function tl(a){let e,t,l=a[3]("sessions.detail.meta.cacheRead")+"",i,c,r,_,p,u,k=$(a[13].cacheReadTokens)+"",P;return{c(){e=v("div"),t=v("span"),i=S(l),c=E(),r=v("span"),_=v("span"),p=E(),u=v("span"),P=S(k),this.h()},l(b){e=f(b,"DIV",{class:!0});var m=h(e);t=f(m,"SPAN",{class:!0});var C=h(t);i=N(C,l),C.forEach(n),c=q(m),r=f(m,"SPAN",{class:!0});var w=h(r);_=f(w,"SPAN",{class:!0,style:!0}),h(_).forEach(n),w.forEach(n),p=q(m),u=f(m,"SPAN",{class:!0});var T=h(u);P=N(T,k),T.forEach(n),m.forEach(n),this.h()},h(){o(t,"class","tb-label svelte-qlezb4"),o(_,"class","tb-fill tb-cache-read svelte-qlezb4"),K(_,"width",Pe(a[13].cacheReadTokens,a[15])+"%"),o(r,"class","tb-bar svelte-qlezb4"),o(u,"class","tb-value mono svelte-qlezb4"),o(e,"class","tb-row svelte-qlezb4")},m(b,m){W(b,e,m),s(e,t),s(t,i),s(e,c),s(e,r),s(r,_),s(e,p),s(e,u),s(u,P)},p(b,m){m&8&&l!==(l=b[3]("sessions.detail.meta.cacheRead")+"")&&I(i,l),m&1&&K(_,"width",Pe(b[13].cacheReadTokens,b[15])+"%"),m&1&&k!==(k=$(b[13].cacheReadTokens)+"")&&I(P,k)},d(b){b&&n(e)}}}function al(a){let e,t,l=a[3]("sessions.detail.meta.cacheWrite")+"",i,c,r,_,p,u,k=$(a[13].cacheWriteTokens)+"",P;return{c(){e=v("div"),t=v("span"),i=S(l),c=E(),r=v("span"),_=v("span"),p=E(),u=v("span"),P=S(k),this.h()},l(b){e=f(b,"DIV",{class:!0});var m=h(e);t=f(m,"SPAN",{class:!0});var C=h(t);i=N(C,l),C.forEach(n),c=q(m),r=f(m,"SPAN",{class:!0});var w=h(r);_=f(w,"SPAN",{class:!0,style:!0}),h(_).forEach(n),w.forEach(n),p=q(m),u=f(m,"SPAN",{class:!0});var T=h(u);P=N(T,k),T.forEach(n),m.forEach(n),this.h()},h(){o(t,"class","tb-label svelte-qlezb4"),o(_,"class","tb-fill tb-cache-write svelte-qlezb4"),K(_,"width",Pe(a[13].cacheWriteTokens,a[15])+"%"),o(r,"class","tb-bar svelte-qlezb4"),o(u,"class","tb-value mono svelte-qlezb4"),o(e,"class","tb-row svelte-qlezb4")},m(b,m){W(b,e,m),s(e,t),s(t,i),s(e,c),s(e,r),s(r,_),s(e,p),s(e,u),s(u,P)},p(b,m){m&8&&l!==(l=b[3]("sessions.detail.meta.cacheWrite")+"")&&I(i,l),m&1&&K(_,"width",Pe(b[13].cacheWriteTokens,b[15])+"%"),m&1&&k!==(k=$(b[13].cacheWriteTokens)+"")&&I(P,k)},d(b){b&&n(e)}}}function il(a){let e,t,l=a[3]("sessions.detail.meta.thinking")+"",i,c,r,_,p,u,k=$(a[13].thinkingTokens)+"",P;return{c(){e=v("div"),t=v("span"),i=S(l),c=E(),r=v("span"),_=v("span"),p=E(),u=v("span"),P=S(k),this.h()},l(b){e=f(b,"DIV",{class:!0});var m=h(e);t=f(m,"SPAN",{class:!0});var C=h(t);i=N(C,l),C.forEach(n),c=q(m),r=f(m,"SPAN",{class:!0});var w=h(r);_=f(w,"SPAN",{class:!0,style:!0}),h(_).forEach(n),w.forEach(n),p=q(m),u=f(m,"SPAN",{class:!0});var T=h(u);P=N(T,k),T.forEach(n),m.forEach(n),this.h()},h(){o(t,"class","tb-label svelte-qlezb4"),o(_,"class","tb-fill tb-thinking svelte-qlezb4"),K(_,"width",Pe(a[13].thinkingTokens,a[15])+"%"),o(r,"class","tb-bar svelte-qlezb4"),o(u,"class","tb-value mono svelte-qlezb4"),o(e,"class","tb-row svelte-qlezb4")},m(b,m){W(b,e,m),s(e,t),s(t,i),s(e,c),s(e,r),s(r,_),s(e,p),s(e,u),s(u,P)},p(b,m){m&8&&l!==(l=b[3]("sessions.detail.meta.thinking")+"")&&I(i,l),m&1&&K(_,"width",Pe(b[13].thinkingTokens,b[15])+"%"),m&1&&k!==(k=$(b[13].thinkingTokens)+"")&&I(P,k)},d(b){b&&n(e)}}}function nl(a){let e,t,l=a[3]("sessions.noData")+"",i,c,r,_=a[3]("sessions.noDataHint")+"",p,u;return{c(){e=v("div"),t=v("h2"),i=S(l),c=E(),r=v("p"),p=S(_),u=E(),this.h()},l(k){e=f(k,"DIV",{class:!0});var P=h(e);t=f(P,"H2",{});var b=h(t);i=N(b,l),b.forEach(n),c=q(P),r=f(P,"P",{});var m=h(r);p=N(m,_),m.forEach(n),u=q(P),P.forEach(n),this.h()},h(){o(e,"class","state-msg")},m(k,P){W(k,e,P),s(e,t),s(t,i),s(e,c),s(e,r),s(r,p),s(e,u)},p(k,P){P&8&&l!==(l=k[3]("sessions.noData")+"")&&I(i,l),P&8&&_!==(_=k[3]("sessions.noDataHint")+"")&&I(p,_)},d(k){k&&n(e)}}}function ol(a){let e,t,l=a[4](a[16].ts-a[14][a[19]-1].ts)+"",i;return{c(){e=v("div"),t=v("span"),i=S(l),this.h()},l(c){e=f(c,"DIV",{class:!0});var r=h(e);t=f(r,"SPAN",{class:!0});var _=h(t);i=N(_,l),_.forEach(n),r.forEach(n),this.h()},h(){o(t,"class","gap-text svelte-qlezb4"),o(e,"class","gap-divider svelte-qlezb4")},m(c,r){W(c,e,r),s(e,t),s(t,i)},p(c,r){r&1&&l!==(l=c[4](c[16].ts-c[14][c[19]-1].ts)+"")&&I(i,l)},d(c){c&&n(e)}}}function rl(a){let e,t,l,i,c=$(a[16].cacheReadTokens)+"",r,_;return{c(){e=v("span"),t=v("span"),l=E(),i=v("span"),r=S(c),this.h()},l(p){e=f(p,"SPAN",{class:!0,title:!0});var u=h(e);t=f(u,"SPAN",{class:!0}),h(t).forEach(n),l=q(u),i=f(u,"SPAN",{class:!0});var k=h(i);r=N(k,c),k.forEach(n),u.forEach(n),this.h()},h(){o(t,"class","rt-dot rt-cache-read svelte-qlezb4"),o(i,"class","rt-val mono svelte-qlezb4"),o(e,"class","rt-item svelte-qlezb4"),o(e,"title",_=a[3]("sessions.detail.meta.cacheRead"))},m(p,u){W(p,e,u),s(e,t),s(e,l),s(e,i),s(i,r)},p(p,u){u&1&&c!==(c=$(p[16].cacheReadTokens)+"")&&I(r,c),u&8&&_!==(_=p[3]("sessions.detail.meta.cacheRead"))&&o(e,"title",_)},d(p){p&&n(e)}}}function cl(a){let e,t,l,i,c=$(a[16].cacheWriteTokens)+"",r,_;return{c(){e=v("span"),t=v("span"),l=E(),i=v("span"),r=S(c),this.h()},l(p){e=f(p,"SPAN",{class:!0,title:!0});var u=h(e);t=f(u,"SPAN",{class:!0}),h(t).forEach(n),l=q(u),i=f(u,"SPAN",{class:!0});var k=h(i);r=N(k,c),k.forEach(n),u.forEach(n),this.h()},h(){o(t,"class","rt-dot rt-cache-write svelte-qlezb4"),o(i,"class","rt-val mono svelte-qlezb4"),o(e,"class","rt-item svelte-qlezb4"),o(e,"title",_=a[3]("sessions.detail.meta.cacheWrite"))},m(p,u){W(p,e,u),s(e,t),s(e,l),s(e,i),s(i,r)},p(p,u){u&1&&c!==(c=$(p[16].cacheWriteTokens)+"")&&I(r,c),u&8&&_!==(_=p[3]("sessions.detail.meta.cacheWrite"))&&o(e,"title",_)},d(p){p&&n(e)}}}function fl(a){let e,t,l,i,c=$(a[16].thinkingTokens)+"",r,_;return{c(){e=v("span"),t=v("span"),l=E(),i=v("span"),r=S(c),this.h()},l(p){e=f(p,"SPAN",{class:!0,title:!0});var u=h(e);t=f(u,"SPAN",{class:!0}),h(t).forEach(n),l=q(u),i=f(u,"SPAN",{class:!0});var k=h(i);r=N(k,c),k.forEach(n),u.forEach(n),this.h()},h(){o(t,"class","rt-dot rt-thinking svelte-qlezb4"),o(i,"class","rt-val mono svelte-qlezb4"),o(e,"class","rt-item svelte-qlezb4"),o(e,"title",_=a[3]("sessions.detail.meta.thinking"))},m(p,u){W(p,e,u),s(e,t),s(e,l),s(e,i),s(i,r)},p(p,u){u&1&&c!==(c=$(p[16].thinkingTokens)+"")&&I(r,c),u&8&&_!==(_=p[3]("sessions.detail.meta.thinking"))&&o(e,"title",_)},d(p){p&&n(e)}}}function vl(a){let e,t=Ke(a[16].toolCalls),l=[];for(let i=0;i<t.length;i+=1)l[i]=hl(el(a,t,i));return{c(){e=v("div");for(let i=0;i<l.length;i+=1)l[i].c();this.h()},l(i){e=f(i,"DIV",{class:!0});var c=h(e);for(let r=0;r<l.length;r+=1)l[r].l(c);c.forEach(n),this.h()},h(){o(e,"class","tool-calls svelte-qlezb4")},m(i,c){W(i,e,c);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(e,null)},p(i,c){if(c&1){t=Ke(i[16].toolCalls);let r;for(r=0;r<t.length;r+=1){const _=el(i,t,r);l[r]?l[r].p(_,c):(l[r]=hl(_),l[r].c(),l[r].m(e,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=t.length}},d(i){i&&n(e),rs(l,i)}}}function dl(a){let e,t=gs(a[20].ts-a[16].ts)+"",l;return{c(){e=v("span"),l=S(t),this.h()},l(i){e=f(i,"SPAN",{class:!0});var c=h(e);l=N(c,t),c.forEach(n),this.h()},h(){o(e,"class","tc-offset mono muted svelte-qlezb4")},m(i,c){W(i,e,c),s(e,l)},p(i,c){c&1&&t!==(t=gs(i[20].ts-i[16].ts)+"")&&I(l,t)},d(i){i&&n(e)}}}function wl(a){let e,t="skill";return{c(){e=v("span"),e.textContent=t,this.h()},l(l){e=f(l,"SPAN",{class:!0,"data-svelte-h":!0}),ts(e)!=="svelte-slxz3u"&&(e.textContent=t),this.h()},h(){o(e,"class","badge badge-skill svelte-qlezb4")},m(l,i){W(l,e,i)},d(l){l&&n(e)}}}function Vl(a){let e,t="mcp";return{c(){e=v("span"),e.textContent=t,this.h()},l(l){e=f(l,"SPAN",{class:!0,"data-svelte-h":!0}),ts(e)!=="svelte-uwmdxw"&&(e.textContent=t),this.h()},h(){o(e,"class","badge badge-mcp svelte-qlezb4")},m(l,i){W(l,e,i)},d(l){l&&n(e)}}}function hl(a){let e,t,l,i=a[20].callIndex+1+"",c,r,_,p=a[20].displayName+"",u,k,P,b,m=a[20].ts!=null&&dl(a);function C(d,g){if(d[20].type==="mcp")return Vl;if(d[20].type==="skill")return wl}let w=C(a),T=w&&w(a);return{c(){e=v("div"),t=v("span"),l=S("#"),c=S(i),r=E(),_=v("span"),u=S(p),k=E(),m&&m.c(),P=E(),T&&T.c(),b=E(),this.h()},l(d){e=f(d,"DIV",{class:!0});var g=h(e);t=f(g,"SPAN",{class:!0});var D=h(t);l=N(D,"#"),c=N(D,i),D.forEach(n),r=q(g),_=f(g,"SPAN",{class:!0});var O=h(_);u=N(O,p),O.forEach(n),k=q(g),m&&m.l(g),P=q(g),T&&T.l(g),b=q(g),g.forEach(n),this.h()},h(){o(t,"class","tc-index mono muted svelte-qlezb4"),o(_,"class","tc-name mono svelte-qlezb4"),o(e,"class","tool-call svelte-qlezb4")},m(d,g){W(d,e,g),s(e,t),s(t,l),s(t,c),s(e,r),s(e,_),s(_,u),s(e,k),m&&m.m(e,null),s(e,P),T&&T.m(e,null),s(e,b)},p(d,g){g&1&&i!==(i=d[20].callIndex+1+"")&&I(c,i),g&1&&p!==(p=d[20].displayName+"")&&I(u,p),d[20].ts!=null?m?m.p(d,g):(m=dl(d),m.c(),m.m(e,P)):m&&(m.d(1),m=null),w!==(w=C(d))&&(T&&T.d(1),T=w&&w(d),T&&(T.c(),T.m(e,b)))},d(d){d&&n(e),m&&m.d(),T&&T.d()}}}function ul(a){let e,t,l,i,c,r,_=a[19]+1+"",p,u,k,P=gs(a[16].ts-a[13].firstTs)+"",b,m,C,w=a[16].model+"",T,d,g,D=Ts(a[16].cost)+"",O,ae,M,H,Ne,pe,oe,_e=$(a[16].inputTokens)+"",Re,ie,y,J,re,Se,ce,Ae=$(a[16].outputTokens)+"",fe,me,We,Me,ne,ve,te,be=$(a[17])+"",He,de,Ie,De,B=a[19]>0&&a[16].ts-a[14][a[19]-1].ts>1e3&&ol(a),j=a[16].cacheReadTokens&&rl(a),F=a[16].cacheWriteTokens&&cl(a),U=a[16].thinkingTokens&&fl(a),G=a[16].toolCalls&&a[16].toolCalls.length>0&&vl(a);return{c(){B&&B.c(),e=E(),t=v("div"),l=v("div"),i=v("div"),c=v("span"),r=S("#"),p=S(_),u=E(),k=v("span"),b=S(P),m=E(),C=v("span"),T=S(w),d=E(),g=v("span"),O=S(D),ae=E(),M=v("div"),H=v("span"),Ne=v("span"),pe=E(),oe=v("span"),Re=S(_e),y=E(),J=v("span"),re=v("span"),Se=E(),ce=v("span"),fe=S(Ae),We=E(),j&&j.c(),Me=E(),F&&F.c(),ne=E(),U&&U.c(),ve=E(),te=v("span"),He=S(be),Ie=E(),G&&G.c(),De=E(),this.h()},l(A){B&&B.l(A),e=q(A),t=f(A,"DIV",{class:!0});var R=h(t);l=f(R,"DIV",{class:!0});var ke=h(l);i=f(ke,"DIV",{class:!0});var he=h(i);c=f(he,"SPAN",{class:!0});var Fe=h(c);r=N(Fe,"#"),p=N(Fe,_),Fe.forEach(n),u=q(he),k=f(he,"SPAN",{class:!0});var ue=h(k);b=N(ue,P),ue.forEach(n),m=q(he),C=f(he,"SPAN",{class:!0});var we=h(C);T=N(we,w),we.forEach(n),he.forEach(n),d=q(ke),g=f(ke,"SPAN",{class:!0});var Le=h(g);O=N(Le,D),Le.forEach(n),ke.forEach(n),ae=q(R),M=f(R,"DIV",{class:!0});var Q=h(M);H=f(Q,"SPAN",{class:!0,title:!0});var je=h(H);Ne=f(je,"SPAN",{class:!0}),h(Ne).forEach(n),pe=q(je),oe=f(je,"SPAN",{class:!0});var Ve=h(oe);Re=N(Ve,_e),Ve.forEach(n),je.forEach(n),y=q(Q),J=f(Q,"SPAN",{class:!0,title:!0});var ze=h(J);re=f(ze,"SPAN",{class:!0}),h(re).forEach(n),Se=q(ze),ce=f(ze,"SPAN",{class:!0});var Ue=h(ce);fe=N(Ue,Ae),Ue.forEach(n),ze.forEach(n),We=q(Q),j&&j.l(Q),Me=q(Q),F&&F.l(Q),ne=q(Q),U&&U.l(Q),ve=q(Q),te=f(Q,"SPAN",{class:!0,title:!0});var Oe=h(te);He=N(Oe,be),Oe.forEach(n),Q.forEach(n),Ie=q(R),G&&G.l(R),De=q(R),R.forEach(n),this.h()},h(){o(c,"class","record-index mono svelte-qlezb4"),o(k,"class","record-relts mono muted svelte-qlezb4"),o(C,"class","record-model mono svelte-qlezb4"),o(i,"class","record-meta-left svelte-qlezb4"),o(g,"class","record-cost mono accent svelte-qlezb4"),o(l,"class","record-header svelte-qlezb4"),o(Ne,"class","rt-dot rt-input svelte-qlezb4"),o(oe,"class","rt-val mono svelte-qlezb4"),o(H,"class","rt-item svelte-qlezb4"),o(H,"title",ie=a[3]("sessions.detail.meta.input")),o(re,"class","rt-dot rt-output svelte-qlezb4"),o(ce,"class","rt-val mono svelte-qlezb4"),o(J,"class","rt-item svelte-qlezb4"),o(J,"title",me=a[3]("sessions.detail.meta.output")),o(te,"class","rt-total mono muted svelte-qlezb4"),o(te,"title",de=a[3]("sessions.detail.meta.totalTokens")),o(M,"class","record-tokens svelte-qlezb4"),o(t,"class","record-card card svelte-qlezb4")},m(A,R){B&&B.m(A,R),W(A,e,R),W(A,t,R),s(t,l),s(l,i),s(i,c),s(c,r),s(c,p),s(i,u),s(i,k),s(k,b),s(i,m),s(i,C),s(C,T),s(l,d),s(l,g),s(g,O),s(t,ae),s(t,M),s(M,H),s(H,Ne),s(H,pe),s(H,oe),s(oe,Re),s(M,y),s(M,J),s(J,re),s(J,Se),s(J,ce),s(ce,fe),s(M,We),j&&j.m(M,null),s(M,Me),F&&F.m(M,null),s(M,ne),U&&U.m(M,null),s(M,ve),s(M,te),s(te,He),s(t,Ie),G&&G.m(t,null),s(t,De)},p(A,R){A[19]>0&&A[16].ts-A[14][A[19]-1].ts>1e3?B?B.p(A,R):(B=ol(A),B.c(),B.m(e.parentNode,e)):B&&(B.d(1),B=null),R&1&&P!==(P=gs(A[16].ts-A[13].firstTs)+"")&&I(b,P),R&1&&w!==(w=A[16].model+"")&&I(T,w),R&1&&D!==(D=Ts(A[16].cost)+"")&&I(O,D),R&1&&_e!==(_e=$(A[16].inputTokens)+"")&&I(Re,_e),R&8&&ie!==(ie=A[3]("sessions.detail.meta.input"))&&o(H,"title",ie),R&1&&Ae!==(Ae=$(A[16].outputTokens)+"")&&I(fe,Ae),R&8&&me!==(me=A[3]("sessions.detail.meta.output"))&&o(J,"title",me),A[16].cacheReadTokens?j?j.p(A,R):(j=rl(A),j.c(),j.m(M,Me)):j&&(j.d(1),j=null),A[16].cacheWriteTokens?F?F.p(A,R):(F=cl(A),F.c(),F.m(M,ne)):F&&(F.d(1),F=null),A[16].thinkingTokens?U?U.p(A,R):(U=fl(A),U.c(),U.m(M,ve)):U&&(U.d(1),U=null),R&1&&be!==(be=$(A[17])+"")&&I(He,be),R&8&&de!==(de=A[3]("sessions.detail.meta.totalTokens"))&&o(te,"title",de),A[16].toolCalls&&A[16].toolCalls.length>0?G?G.p(A,R):(G=vl(A),G.c(),G.m(t,De)):G&&(G.d(1),G=null)},d(A){A&&(n(e),n(t)),B&&B.d(A),j&&j.d(),F&&F.d(),U&&U.d(),G&&G.d()}}}function Cl(a){let e,t='<div class="ph-line ph-w60 svelte-qlezb4" style="height:0.5rem;margin-bottom:0.25rem"></div> <div class="ph-line ph-w40 svelte-qlezb4" style="height:0.85rem"></div> ';return{c(){e=v("div"),e.innerHTML=t,this.h()},l(l){e=f(l,"DIV",{class:!0,"data-svelte-h":!0}),ts(e)!=="svelte-sj1wh2"&&(e.innerHTML=t),this.h()},h(){o(e,"class","metric-cell svelte-qlezb4")},m(l,i){W(l,e,i)},p:ls,d(l){l&&n(e)}}}function Rl(a){let e,t='<div class="ph-line ph-w60 svelte-qlezb4" style="height:0.5rem"></div> <div class="ph-line svelte-qlezb4" style="height:6px;border-radius:3px"></div> <div class="ph-line ph-w50 svelte-qlezb4" style="height:0.5rem"></div> ';return{c(){e=v("div"),e.innerHTML=t,this.h()},l(l){e=f(l,"DIV",{style:!0,"data-svelte-h":!0}),ts(e)!=="svelte-1h640di"&&(e.innerHTML=t),this.h()},h(){K(e,"display","grid"),K(e,"grid-template-columns","5.5rem 1fr 4.5rem"),K(e,"gap","0.5rem"),K(e,"align-items","center")},m(l,i){W(l,e,i)},p:ls,d(l){l&&n(e)}}}function Wl(a){let e,t='<div style="display:flex;justify-content:space-between;margin-bottom:0.375rem"><div class="ph-line ph-w40 svelte-qlezb4"></div> <div class="ph-line ph-w20 svelte-qlezb4"></div></div> <div style="display:flex;gap:0.75rem;margin-bottom:0.375rem"><div class="ph-line ph-w20 svelte-qlezb4"></div> <div class="ph-line ph-w20 svelte-qlezb4"></div></div> ';return{c(){e=v("div"),e.innerHTML=t,this.h()},l(l){e=f(l,"DIV",{class:!0,"data-svelte-h":!0}),ts(e)!=="svelte-8o0mhs"&&(e.innerHTML=t),this.h()},h(){o(e,"class","record-card card svelte-qlezb4")},m(l,i){W(l,e,i)},p:ls,d(l){l&&n(e)}}}function Ml(a){let e,t,l,i,c=a[3]("sessions.detail.back")+"",r,_,p,u=a[3]("sessions.detail.title")+"",k,P,b;document.title=e=a[3]("sessions.detail.title")+" — AIUsage";function m(d,g){if(d[2])return Dl;if(d[1])return Il;if(d[0])return sl}function C(d,g){return g===sl?Al(d):d}let w=m(a),T=w&&w(C(a,w));return{c(){t=E(),l=v("div"),i=v("a"),r=S(c),_=E(),p=v("h1"),k=S(u),P=E(),T&&T.c(),b=ys(),this.h()},l(d){ql("svelte-11yx7zf",document.head).forEach(n),t=q(d),l=f(d,"DIV",{class:!0});var D=h(l);i=f(D,"A",{class:!0,href:!0});var O=h(i);r=N(O,c),O.forEach(n),_=q(D),p=f(D,"H1",{});var ae=h(p);k=N(ae,u),ae.forEach(n),D.forEach(n),P=q(d),T&&T.l(d),b=ys(),this.h()},h(){o(i,"class","back-link svelte-qlezb4"),o(i,"href","/sessions"),o(l,"class","page-header")},m(d,g){W(d,t,g),W(d,l,g),s(l,i),s(i,r),s(l,_),s(l,p),s(p,k),W(d,P,g),T&&T.m(d,g),W(d,b,g)},p(d,[g]){g&8&&e!==(e=d[3]("sessions.detail.title")+" — AIUsage")&&(document.title=e),g&8&&c!==(c=d[3]("sessions.detail.back")+"")&&I(r,c),g&8&&u!==(u=d[3]("sessions.detail.title")+"")&&I(k,u),w===(w=m(d))&&T?T.p(C(d,w),g):(T&&T.d(1),T=w&&w(C(d,w)),T&&(T.c(),T.m(b.parentNode,b)))},i:ls,o:ls,d(d){d&&(n(t),n(l),n(P),n(b)),T&&T.d(d)}}}function pl(a){return new Date(a).toLocaleString()}function _l(a){if(!a||a<1e3)return"< 1s";const e=Math.floor(a/1e3),t=Math.floor(e/60),l=Math.floor(t/60);return l>0?`${l}h ${t%60}m ${e%60}s`:t===0?`${e}s`:`${t}m ${e%60}s`}function gs(a){if(a<=0)return"+0ms";if(a<1e3)return`+${a}ms`;const e=a/1e3;return`+${e%1===0?e.toFixed(0):e.toFixed(1)}s`}function Pe(a,e){return!e||!a?0:Math.round(a/e*1e3)/10}function Hl(a,e,t){let l,i;Zs(a,Tl,u=>t(5,l=u)),Zs(a,gl,u=>t(3,i=u));let c=null,r=null,_=!0;function p(u){return`— ${Math.round(u/1e3)}s ${i("sessions.detail.gap")} —`}return bl(async()=>{const u=l.params.sessionId,k=l.url.searchParams.get("tool")||"",P=l.url.searchParams.get("device")||"";try{t(0,c=await El(u,{tool:k,device:P}))}catch(b){t(1,r=b instanceof Error?b.message:"Failed to load session")}finally{t(2,_=!1)}}),[c,r,_,i,p]}class Bl extends kl{constructor(e){super(),zl(this,e,Hl,Ml,ml,{})}}export{Bl as component};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{n as Bt,x as _s,y as Rs,s as Fs,c as tt,o as Os,e as Ms,r as qs}from"../chunks/scheduler.DsWd5xup.js";import{S as Ls,i as Ws,d as i,s as j,o as u,a as B,b as l,w as Ge,p as Bs,g as E,c as f,e as _,C as At,f as y,r as Pt,j as k,h,t as b,v as Ks,z as Se,x as We}from"../chunks/index.BfJlbjrK.js";import{a as Us,r as zs,S as ps,x as Hs,e as Vt,h as Gs,j as Js,i as Qs}from"../chunks/api.DVLAklIn.js";import{w as Ys}from"../chunks/index.m3oCcA6N.js";import{t as Xs}from"../chunks/i18n.DApJIXOT.js";import{f as Zs,e as xs,g as $s}from"../chunks/stores.BSI_cVy6.js";const As=typeof window<"u";let el=As?()=>window.performance.now():()=>Date.now(),Ps=As?e=>requestAnimationFrame(e):Bt;const rt=new Set;function Vs(e){rt.forEach(t=>{t.c(e)||(rt.delete(t),t.f())}),rt.size!==0&&Ps(Vs)}function tl(e){let t;return rt.size===0&&Ps(Vs),{promise:new Promise(s=>{rt.add(t={c:e,f:s})}),abort(){rt.delete(t)}}}function ms(e){return Object.prototype.toString.call(e)==="[object Date]"}function Tt(e){const t=e-1;return t*t*t+1}function Kt(e,t){if(e===t||e!==e)return()=>e;const s=typeof e;if(s!==typeof t||Array.isArray(e)!==Array.isArray(t))throw new Error("Cannot interpolate values of different type");if(Array.isArray(e)){const a=t.map((n,r)=>Kt(e[r],n));return n=>a.map(r=>r(n))}if(s==="object"){if(!e||!t)throw new Error("Object cannot be null");if(ms(e)&&ms(t)){e=e.getTime(),t=t.getTime();const r=t-e;return o=>new Date(e+o*r)}const a=Object.keys(t),n={};return a.forEach(r=>{n[r]=Kt(e[r],t[r])}),r=>{const o={};return a.forEach(c=>{o[c]=n[c](r)}),o}}if(s==="number"){const a=t-e;return n=>e+n*a}throw new Error(`Cannot interpolate ${s} values`)}function It(e,t={}){const s=Ys(e);let a,n=e;function r(o,c){if(e==null)return s.set(e=o),Promise.resolve();n=o;let v=a,d=!1,{delay:S=0,duration:w=400,easing:N=Rs,interpolate:L=Kt}=_s(_s({},t),c);if(w===0)return v&&(v.abort(),v=null),s.set(e=n),Promise.resolve();const Z=el()+S;let K;return a=tl(J=>{if(J<Z)return!0;d||(K=L(e,o),typeof w=="function"&&(w=w(e,o)),d=!0),v&&(v.abort(),v=null);const z=J-Z;return z>w?(s.set(e=o),!1):(s.set(e=K(N(z/w))),!0)}),a.promise}return{set:r,update:(o,c)=>r(o(n,e),c),subscribe:s.subscribe}}function gs(e,t,s){const a=e.slice();a[56]=t[s];const n=hl(a[56].utilization);return a[57]=n,a}function ys(e,t,s){const a=e.slice();return a[60]=t[s],a}function bs(e){let t,s,a,n,r,o=e[20]("home.cfgTitle")+"",c,v,d,S="✕",w,N,L,Z=e[20]("home.timeRange")+"",K,J,z,U,Y,X,te=e[20]("home.numFormat")+"",H,P,M,q,T=e[20]("home.numExact")+"",C,x,A,W=e[20]("home.numExactEx")+"",g,R,V,$=e[20]("home.numShort")+"",ne,pe,ie,ee=e[20]("home.numShortEx")+"",_e,me,ce,se,be=e[20]("home.refreshInfo")+"",le,we,ae,ge=e[20]("nav.settings")+"",De,qe,oe,re=e[20]("home.seconds")+"",ye,Te,Be,Ee=Vt(e[24]),Q=[];for(let I=0;I<Ee.length;I+=1)Q[I]=Es(ys(e,Ee,I));return{c(){t=h("div"),s=k(),a=h("div"),n=h("div"),r=h("span"),c=b(o),v=k(),d=h("button"),d.textContent=S,w=k(),N=h("div"),L=h("div"),K=b(Z),J=k(),z=h("div");for(let I=0;I<Q.length;I+=1)Q[I].c();U=k(),Y=h("div"),X=h("div"),H=b(te),P=k(),M=h("div"),q=h("button"),C=b(T),x=k(),A=h("span"),g=b(W),R=k(),V=h("button"),ne=b($),pe=k(),ie=h("span"),_e=b(ee),me=k(),ce=h("div"),se=h("span"),le=b(be),we=k(),ae=h("a"),De=b(ge),qe=b(`
|
|
2
2
|
· `),oe=b(e[3]),ye=b(re),this.h()},l(I){t=f(I,"DIV",{class:!0}),_(t).forEach(i),s=E(I),a=f(I,"DIV",{class:!0,role:!0});var F=_(a);n=f(F,"DIV",{class:!0});var p=_(n);r=f(p,"SPAN",{class:!0});var G=_(r);c=y(G,o),G.forEach(i),v=E(p),d=f(p,"BUTTON",{class:!0,"data-svelte-h":!0}),At(d)!=="svelte-1k5uq1k"&&(d.textContent=S),p.forEach(i),w=E(F),N=f(F,"DIV",{class:!0});var O=_(N);L=f(O,"DIV",{class:!0});var Ie=_(L);K=y(Ie,Z),Ie.forEach(i),J=E(O),z=f(O,"DIV",{class:!0});var st=_(z);for(let ze=0;ze<Q.length;ze+=1)Q[ze].l(st);st.forEach(i),O.forEach(i),U=E(F),Y=f(F,"DIV",{class:!0});var Ne=_(Y);X=f(Ne,"DIV",{class:!0});var Je=_(X);H=y(Je,te),Je.forEach(i),P=E(Ne),M=f(Ne,"DIV",{class:!0});var Ke=_(M);q=f(Ke,"BUTTON",{class:!0});var Qe=_(q);C=y(Qe,T),x=E(Qe),A=f(Qe,"SPAN",{class:!0});var Ae=_(A);g=y(Ae,W),Ae.forEach(i),Qe.forEach(i),R=E(Ke),V=f(Ke,"BUTTON",{class:!0});var Pe=_(V);ne=y(Pe,$),pe=E(Pe),ie=f(Pe,"SPAN",{class:!0});var Ye=_(ie);_e=y(Ye,ee),Ye.forEach(i),Pe.forEach(i),Ke.forEach(i),Ne.forEach(i),me=E(F),ce=f(F,"DIV",{class:!0});var xe=_(ce);se=f(xe,"SPAN",{class:!0});var Ve=_(se);le=y(Ve,be),we=E(Ve),ae=f(Ve,"A",{href:!0,class:!0});var Ue=_(ae);De=y(Ue,ge),Ue.forEach(i),qe=y(Ve,`
|
|
3
|
-
· `),oe=y(Ve,e[3]),ye=y(Ve,re),Ve.forEach(i),xe.forEach(i),F.forEach(i),this.h()},h(){u(t,"class","overlay-backdrop svelte-2ysxjc"),u(r,"class","cfg-title svelte-2ysxjc"),u(d,"class","cfg-close svelte-2ysxjc"),u(n,"class","cfg-header svelte-2ysxjc"),u(L,"class","cfg-label svelte-2ysxjc"),u(z,"class","cfg-pills svelte-2ysxjc"),u(N,"class","cfg-section svelte-2ysxjc"),u(X,"class","cfg-label svelte-2ysxjc"),u(A,"class","pill-eg svelte-2ysxjc"),u(q,"class","pill svelte-2ysxjc"),Se(q,"active",e[0].precision==="exact"),u(ie,"class","pill-eg svelte-2ysxjc"),u(V,"class","pill svelte-2ysxjc"),Se(V,"active",e[0].precision==="abbr"),u(M,"class","cfg-pills svelte-2ysxjc"),u(Y,"class","cfg-section svelte-2ysxjc"),u(ae,"href","/settings"),u(ae,"class","settings-link svelte-2ysxjc"),u(se,"class","refresh-info-text svelte-2ysxjc"),u(ce,"class","cfg-refresh-info svelte-2ysxjc"),u(a,"class","config-panel svelte-2ysxjc"),u(a,"role","dialog")},m(I,F){B(I,t,F),B(I,s,F),B(I,a,F),l(a,n),l(n,r),l(r,c),l(n,v),l(n,d),l(a,w),l(a,N),l(N,L),l(L,K),l(N,J),l(N,z);for(let p=0;p<Q.length;p+=1)Q[p]&&Q[p].m(z,null);l(a,U),l(a,Y),l(Y,X),l(X,H),l(Y,P),l(Y,M),l(M,q),l(q,C),l(q,x),l(q,A),l(A,g),l(M,R),l(M,V),l(V,ne),l(V,pe),l(V,ie),l(ie,_e),l(a,me),l(a,ce),l(ce,se),l(se,le),l(se,we),l(se,ae),l(ae,De),l(se,qe),l(se,oe),l(se,ye),Te||(Be=[Ge(t,"click",e[40]),Ge(d,"click",e[41]),Ge(q,"click",e[43]),Ge(V,"click",e[44]),Ge(ae,"click",e[45])],Te=!0)},p(I,F){if(F[0]&1048576&&o!==(o=I[20]("home.cfgTitle")+"")&&j(c,o),F[0]&1048576&&Z!==(Z=I[20]("home.timeRange")+"")&&j(K,Z),F[0]&17825793|F[1]&2){Ee=Vt(I[24]);let p;for(p=0;p<Ee.length;p+=1){const G=ys(I,Ee,p);Q[p]?Q[p].p(G,F):(Q[p]=Es(G),Q[p].c(),Q[p].m(z,null))}for(;p<Q.length;p+=1)Q[p].d(1);Q.length=Ee.length}F[0]&1048576&&te!==(te=I[20]("home.numFormat")+"")&&j(H,te),F[0]&1048576&&T!==(T=I[20]("home.numExact")+"")&&j(C,T),F[0]&1048576&&W!==(W=I[20]("home.numExactEx")+"")&&j(g,W),F[0]&1&&Se(q,"active",I[0].precision==="exact"),F[0]&1048576&&$!==($=I[20]("home.numShort")+"")&&j(ne,$),F[0]&1048576&&ee!==(ee=I[20]("home.numShortEx")+"")&&j(_e,ee),F[0]&1&&Se(V,"active",I[0].precision==="abbr"),F[0]&1048576&&be!==(be=I[20]("home.refreshInfo")+"")&&j(le,be),F[0]&1048576&&ge!==(ge=I[20]("nav.settings")+"")&&j(De,ge),F[0]&8&&j(oe,I[3]),F[0]&1048576&&re!==(re=I[20]("home.seconds")+"")&&j(ye,re)},d(I){I&&(i(t),i(s),i(a)),Ks(Q,I),Te=!1,qs(Be)}}}function Es(e){let t,s=e[20](e[60].tKey)+"",a,n,r,o;function c(){return e[42](e[60])}return{c(){t=h("button"),a=b(s),n=k(),this.h()},l(v){t=f(v,"BUTTON",{class:!0});var d=_(t);a=y(d,s),n=E(d),d.forEach(i),this.h()},h(){u(t,"class","pill svelte-2ysxjc"),Se(t,"active",e[0].range===e[60].value)},m(v,d){B(v,t,d),l(t,a),l(t,n),r||(o=Ge(t,"click",c),r=!0)},p(v,d){e=v,d[0]&1048576&&s!==(s=e[20](e[60].tKey)+"")&&j(a,s),d[0]&16777217&&Se(t,"active",e[0].range===e[60].value)},d(v){v&&i(t),r=!1,o()}}}function ks(e){let t,s=[],a=new Map,n=Vt(e[9]);const r=o=>o[56].tool+o[56].tier;for(let o=0;o<n.length;o+=1){let c=gs(e,n,o),v=r(c);a.set(v,s[o]=js(v,c))}return{c(){t=h("div");for(let o=0;o<s.length;o+=1)s[o].c();this.h()},l(o){t=f(o,"DIV",{class:!0});var c=_(t);for(let v=0;v<s.length;v+=1)s[v].l(c);c.forEach(i),this.h()},h(){u(t,"class","quota-warning-list svelte-2ysxjc")},m(o,c){B(o,t,c);for(let v=0;v<s.length;v+=1)s[v]&&s[v].m(t,null)},p(o,c){c[0]&1074790912|c[1]&1&&(n=Vt(o[9]),s=Gs(s,c,r,1,o,n,a,t,Qs,js,null,gs))},d(o){o&&i(t);for(let c=0;c<s.length;c+=1)s[c].d()}}}function js(e,t){let s,a,n=t[57]==="red"?"▲":"△",r,o,c,v,d=(t[30][t[56].tool]??t[56].tool)+"",S,w,N=(t[31][t[56].tier]??t[56].tier)+"",L,Z,K=t[20]("home.quotaWarningDesc")+"",J,z,U,Y=t[56].utilization+"",X,te,H,P,M=t[20]("home.quotaWarningLink")+"",q,T,C;return{key:e,first:null,c(){s=h("div"),a=h("span"),r=b(n),o=k(),c=h("span"),v=h("strong"),S=b(d),w=k(),L=b(N),Z=k(),J=b(K),z=b(": "),U=h("strong"),X=b(Y),te=b("%"),H=k(),P=h("a"),q=b(M),T=b(" →"),C=k(),this.h()},l(x){s=f(x,"DIV",{class:!0});var A=_(s);a=f(A,"SPAN",{class:!0});var W=_(a);r=y(W,n),W.forEach(i),o=E(A),c=f(A,"SPAN",{class:!0});var g=_(c);v=f(g,"STRONG",{});var R=_(v);S=y(R,d),R.forEach(i),w=E(g),L=y(g,N),Z=E(g),J=y(g,K),z=y(g,": "),U=f(g,"STRONG",{});var V=_(U);X=y(V,Y),te=y(V,"%"),V.forEach(i),g.forEach(i),H=E(A),P=f(A,"A",{href:!0,class:!0});var $=_(P);q=y($,M),T=y($," →"),$.forEach(i),C=E(A),A.forEach(i),this.h()},h(){u(a,"class","warn-icon svelte-2ysxjc"),u(c,"class","warn-text svelte-2ysxjc"),u(P,"href","/quotas"),u(P,"class","warn-link svelte-2ysxjc"),u(s,"class","quota-warning svelte-2ysxjc"),Se(s,"quota-red",t[57]==="red"),Se(s,"quota-orange",t[57]==="orange"),this.first=s},m(x,A){B(x,s,A),l(s,a),l(a,r),l(s,o),l(s,c),l(c,v),l(v,S),l(c,w),l(c,L),l(c,Z),l(c,J),l(c,z),l(c,U),l(U,X),l(U,te),l(s,H),l(s,P),l(P,q),l(P,T),l(s,C)},p(x,A){t=x,A[0]&512&&n!==(n=t[57]==="red"?"▲":"△")&&j(r,n),A[0]&512&&d!==(d=(t[30][t[56].tool]??t[56].tool)+"")&&j(S,d),A[0]&512&&N!==(N=(t[31][t[56].tier]??t[56].tier)+"")&&j(L,N),A[0]&1048576&&K!==(K=t[20]("home.quotaWarningDesc")+"")&&j(J,K),A[0]&512&&Y!==(Y=t[56].utilization+"")&&j(X,Y),A[0]&1048576&&M!==(M=t[20]("home.quotaWarningLink")+"")&&j(q,M),A[0]&512&&Se(s,"quota-red",t[57]==="red"),A[0]&512&&Se(s,"quota-orange",t[57]==="orange")},d(x){x&&i(s)}}}function sl(e){let t,s,a=e[20]("home.counterLabel")+"",n,r,o,c=e[19](e[21])+"",v,d,S,w,N,L=e[20]("home.input")+"",Z,K,J,z=nt(e[1].inputTokens)+"",U,Y,X,te,H,P,M=e[20]("home.output")+"",q,T,C,x=nt(e[1].outputTokens)+"",A,W,g,R,V,$,ne=e[20]("home.cache")+"",pe,ie,ee,_e=nt((e[1].cacheReadTokens||0)+(e[1].cacheWriteTokens||0))+"",me,ce,se,be,le,we,ae,ge=(e[3]>0?e[20]("home.refreshNow"):e[20]("home.refreshBtn"))+"",De,qe,oe,re,ye,Te=e[20]("overview.totalCost")+"",Be,Ee,Q,I,F,p,G,O=e[20]("overview.totalSessions")+"",Ie,st,Ne,Je=Math.round(e[22]).toLocaleString()+"",Ke,Qe,Ae,Pe,Ye=e[20]("overview.activeDays")+"",xe,Ve,Ue,ze=Math.round(e[23]).toLocaleString()+"",ut,ft,He,ke,Ce,ht,Ct,Re,vt,Rt,Fe,dt,Ft,Oe,_t,Ot,je,lt,it=e[20]("home.input")+"",pt,Mt,at,ct=e[20]("home.output")+"",mt,qt,$e,Ut="Cache Read",Lt,et,zt="Cache Write",Wt,Ht,ue=e[3]>0&&Ss(e);function Gt(m,D){return m[3]>0?rl:nl}let gt=Gt(e),Me=gt(e),fe=e[16]>9&&ws(e),he=e[15]>9&&Ds(e),ve=e[14]>9&&Ts(e),de=e[13]>9&&Is(e);return{c(){t=h("section"),s=h("div"),n=b(a),r=k(),o=h("div"),v=b(c),d=k(),S=h("div"),w=h("div"),N=h("span"),Z=b(L),K=k(),J=h("span"),U=b(z),Y=k(),X=h("div"),te=k(),H=h("div"),P=h("span"),q=b(M),T=k(),C=h("span"),A=b(x),W=k(),g=h("div"),R=k(),V=h("div"),$=h("span"),pe=b(ne),ie=k(),ee=h("span"),me=b(_e),ce=k(),se=h("div"),ue&&ue.c(),be=k(),le=h("div"),Me.c(),we=k(),ae=h("button"),De=b(ge),qe=k(),oe=h("div"),re=h("div"),ye=h("span"),Be=b(Te),Ee=k(),Q=h("span"),I=b(e[10]),F=k(),p=h("div"),G=h("span"),Ie=b(O),st=k(),Ne=h("span"),Ke=b(Je),Qe=k(),Ae=h("div"),Pe=h("span"),xe=b(Ye),Ve=k(),Ue=h("span"),ut=b(ze),ft=k(),He=h("div"),ke=h("div"),Ce=h("div"),fe&&fe.c(),Ct=k(),Re=h("div"),he&&he.c(),Rt=k(),Fe=h("div"),ve&&ve.c(),Ft=k(),Oe=h("div"),de&&de.c(),Ot=k(),je=h("div"),lt=h("span"),pt=b(it),Mt=k(),at=h("span"),mt=b(ct),qt=k(),$e=h("span"),$e.textContent=Ut,Lt=k(),et=h("span"),et.textContent=zt,this.h()},l(m){t=f(m,"SECTION",{class:!0});var D=_(t);s=f(D,"DIV",{class:!0});var Jt=_(s);n=y(Jt,a),Jt.forEach(i),r=E(D),o=f(D,"DIV",{class:!0});var Qt=_(o);v=y(Qt,c),Qt.forEach(i),d=E(D),S=f(D,"DIV",{class:!0});var Le=_(S);w=f(Le,"DIV",{class:!0});var yt=_(w);N=f(yt,"SPAN",{class:!0});var Yt=_(N);Z=y(Yt,L),Yt.forEach(i),K=E(yt),J=f(yt,"SPAN",{class:!0});var Xt=_(J);U=y(Xt,z),Xt.forEach(i),yt.forEach(i),Y=E(Le),X=f(Le,"DIV",{class:!0}),_(X).forEach(i),te=E(Le),H=f(Le,"DIV",{class:!0});var bt=_(H);P=f(bt,"SPAN",{class:!0});var Zt=_(P);q=y(Zt,M),Zt.forEach(i),T=E(bt),C=f(bt,"SPAN",{class:!0});var xt=_(C);A=y(xt,x),xt.forEach(i),bt.forEach(i),W=E(Le),g=f(Le,"DIV",{class:!0}),_(g).forEach(i),R=E(Le),V=f(Le,"DIV",{class:!0});var Et=_(V);$=f(Et,"SPAN",{class:!0});var $t=_($);pe=y($t,ne),$t.forEach(i),ie=E(Et),ee=f(Et,"SPAN",{class:!0});var es=_(ee);me=y(es,_e),es.forEach(i),Et.forEach(i),Le.forEach(i),ce=E(D),se=f(D,"DIV",{class:!0});var ts=_(se);ue&&ue.l(ts),ts.forEach(i),be=E(D),le=f(D,"DIV",{class:!0});var kt=_(le);Me.l(kt),we=E(kt),ae=f(kt,"BUTTON",{class:!0});var ss=_(ae);De=y(ss,ge),ss.forEach(i),kt.forEach(i),D.forEach(i),qe=E(m),oe=f(m,"DIV",{class:!0});var ot=_(oe);re=f(ot,"DIV",{class:!0});var jt=_(re);ye=f(jt,"SPAN",{class:!0});var ls=_(ye);Be=y(ls,Te),ls.forEach(i),Ee=E(jt),Q=f(jt,"SPAN",{class:!0});var as=_(Q);I=y(as,e[10]),as.forEach(i),jt.forEach(i),F=E(ot),p=f(ot,"DIV",{class:!0});var St=_(p);G=f(St,"SPAN",{class:!0});var os=_(G);Ie=y(os,O),os.forEach(i),st=E(St),Ne=f(St,"SPAN",{class:!0});var ns=_(Ne);Ke=y(ns,Je),ns.forEach(i),St.forEach(i),Qe=E(ot),Ae=f(ot,"DIV",{class:!0});var wt=_(Ae);Pe=f(wt,"SPAN",{class:!0});var rs=_(Pe);xe=y(rs,Ye),rs.forEach(i),Ve=E(wt),Ue=f(wt,"SPAN",{class:!0});var is=_(Ue);ut=y(is,ze),is.forEach(i),wt.forEach(i),ot.forEach(i),ft=E(m),He=f(m,"DIV",{class:!0});var Dt=_(He);ke=f(Dt,"DIV",{class:!0});var Xe=_(ke);Ce=f(Xe,"DIV",{class:!0,style:!0,title:!0});var cs=_(Ce);fe&&fe.l(cs),cs.forEach(i),Ct=E(Xe),Re=f(Xe,"DIV",{class:!0,style:!0,title:!0});var us=_(Re);he&&he.l(us),us.forEach(i),Rt=E(Xe),Fe=f(Xe,"DIV",{class:!0,style:!0,title:!0});var fs=_(Fe);ve&&ve.l(fs),fs.forEach(i),Ft=E(Xe),Oe=f(Xe,"DIV",{class:!0,style:!0,title:!0});var hs=_(Oe);de&&de.l(hs),hs.forEach(i),Xe.forEach(i),Ot=E(Dt),je=f(Dt,"DIV",{class:!0});var Ze=_(je);lt=f(Ze,"SPAN",{class:!0});var vs=_(lt);pt=y(vs,it),vs.forEach(i),Mt=E(Ze),at=f(Ze,"SPAN",{class:!0});var ds=_(at);mt=y(ds,ct),ds.forEach(i),qt=E(Ze),$e=f(Ze,"SPAN",{class:!0,"data-svelte-h":!0}),At($e)!=="svelte-1dlj92d"&&($e.textContent=Ut),Lt=E(Ze),et=f(Ze,"SPAN",{class:!0,"data-svelte-h":!0}),At(et)!=="svelte-g1qgcf"&&(et.textContent=zt),Ze.forEach(i),Dt.forEach(i),this.h()},h(){u(s,"class","counter-label svelte-2ysxjc"),u(o,"class","counter-number svelte-2ysxjc"),Se(o,"refreshing",e[7]),u(N,"class","sub-label svelte-2ysxjc"),u(J,"class","sub-value svelte-2ysxjc"),u(w,"class","sub-item svelte-2ysxjc"),u(X,"class","sub-divider svelte-2ysxjc"),u(P,"class","sub-label svelte-2ysxjc"),u(C,"class","sub-value svelte-2ysxjc"),u(H,"class","sub-item svelte-2ysxjc"),u(g,"class","sub-divider svelte-2ysxjc"),u($,"class","sub-label svelte-2ysxjc"),u(ee,"class","sub-value svelte-2ysxjc"),u(V,"class","sub-item svelte-2ysxjc"),u(S,"class","counter-sub svelte-2ysxjc"),u(se,"class","refresh-bar-track svelte-2ysxjc"),u(ae,"class","now-btn svelte-2ysxjc"),u(le,"class","refresh-meta svelte-2ysxjc"),u(t,"class","counter-section svelte-2ysxjc"),u(ye,"class","stat-label svelte-2ysxjc"),u(Q,"class","stat-value stat-cost svelte-2ysxjc"),u(re,"class","stat-block svelte-2ysxjc"),u(G,"class","stat-label svelte-2ysxjc"),u(Ne,"class","stat-value svelte-2ysxjc"),u(p,"class","stat-block svelte-2ysxjc"),u(Pe,"class","stat-label svelte-2ysxjc"),u(Ue,"class","stat-value svelte-2ysxjc"),u(Ae,"class","stat-block svelte-2ysxjc"),u(oe,"class","stats-strip svelte-2ysxjc"),u(Ce,"class","seg seg-input svelte-2ysxjc"),We(Ce,"width",(e[8]?e[16]:0)+"%"),u(Ce,"title",ht=e[20]("home.input")+" "+e[16].toFixed(1)+"%"),u(Re,"class","seg seg-output svelte-2ysxjc"),We(Re,"width",(e[8]?e[15]:0)+"%"),u(Re,"title",vt=e[20]("home.output")+" "+e[15].toFixed(1)+"%"),u(Fe,"class","seg seg-cr svelte-2ysxjc"),We(Fe,"width",(e[8]?e[14]:0)+"%"),u(Fe,"title",dt="Cache R "+e[14].toFixed(1)+"%"),u(Oe,"class","seg seg-cw svelte-2ysxjc"),We(Oe,"width",(e[8]?e[13]:0)+"%"),u(Oe,"title",_t="Cache W "+e[13].toFixed(1)+"%"),u(ke,"class","comp-bar svelte-2ysxjc"),u(lt,"class","leg leg-i svelte-2ysxjc"),u(at,"class","leg leg-o svelte-2ysxjc"),u($e,"class","leg leg-cr svelte-2ysxjc"),u(et,"class","leg leg-cw svelte-2ysxjc"),u(je,"class","comp-legend svelte-2ysxjc"),u(He,"class","comp-wrap svelte-2ysxjc")},m(m,D){B(m,t,D),l(t,s),l(s,n),l(t,r),l(t,o),l(o,v),l(t,d),l(t,S),l(S,w),l(w,N),l(N,Z),l(w,K),l(w,J),l(J,U),l(S,Y),l(S,X),l(S,te),l(S,H),l(H,P),l(P,q),l(H,T),l(H,C),l(C,A),l(S,W),l(S,g),l(S,R),l(S,V),l(V,$),l($,pe),l(V,ie),l(V,ee),l(ee,me),l(t,ce),l(t,se),ue&&ue.m(se,null),l(t,be),l(t,le),Me.m(le,null),l(le,we),l(le,ae),l(ae,De),B(m,qe,D),B(m,oe,D),l(oe,re),l(re,ye),l(ye,Be),l(re,Ee),l(re,Q),l(Q,I),l(oe,F),l(oe,p),l(p,G),l(G,Ie),l(p,st),l(p,Ne),l(Ne,Ke),l(oe,Qe),l(oe,Ae),l(Ae,Pe),l(Pe,xe),l(Ae,Ve),l(Ae,Ue),l(Ue,ut),B(m,ft,D),B(m,He,D),l(He,ke),l(ke,Ce),fe&&fe.m(Ce,null),l(ke,Ct),l(ke,Re),he&&he.m(Re,null),l(ke,Rt),l(ke,Fe),ve&&ve.m(Fe,null),l(ke,Ft),l(ke,Oe),de&&de.m(Oe,null),l(He,Ot),l(He,je),l(je,lt),l(lt,pt),l(je,Mt),l(je,at),l(at,mt),l(je,qt),l(je,$e),l(je,Lt),l(je,et),Wt||(Ht=Ge(ae,"click",e[29]),Wt=!0)},p(m,D){D[0]&1048576&&a!==(a=m[20]("home.counterLabel")+"")&&j(n,a),D[0]&2621440&&c!==(c=m[19](m[21])+"")&&j(v,c),D[0]&128&&Se(o,"refreshing",m[7]),D[0]&1048576&&L!==(L=m[20]("home.input")+"")&&j(Z,L),D[0]&2&&z!==(z=nt(m[1].inputTokens)+"")&&j(U,z),D[0]&1048576&&M!==(M=m[20]("home.output")+"")&&j(q,M),D[0]&2&&x!==(x=nt(m[1].outputTokens)+"")&&j(A,x),D[0]&1048576&&ne!==(ne=m[20]("home.cache")+"")&&j(pe,ne),D[0]&2&&_e!==(_e=nt((m[1].cacheReadTokens||0)+(m[1].cacheWriteTokens||0))+"")&&j(me,_e),m[3]>0?ue?ue.p(m,D):(ue=Ss(m),ue.c(),ue.m(se,null)):ue&&(ue.d(1),ue=null),gt===(gt=Gt(m))&&Me?Me.p(m,D):(Me.d(1),Me=gt(m),Me&&(Me.c(),Me.m(le,we))),D[0]&1048584&&ge!==(ge=(m[3]>0?m[20]("home.refreshNow"):m[20]("home.refreshBtn"))+"")&&j(De,ge),D[0]&1048576&&Te!==(Te=m[20]("overview.totalCost")+"")&&j(Be,Te),D[0]&1024&&j(I,m[10]),D[0]&1048576&&O!==(O=m[20]("overview.totalSessions")+"")&&j(Ie,O),D[0]&4194304&&Je!==(Je=Math.round(m[22]).toLocaleString()+"")&&j(Ke,Je),D[0]&1048576&&Ye!==(Ye=m[20]("overview.activeDays")+"")&&j(xe,Ye),D[0]&8388608&&ze!==(ze=Math.round(m[23]).toLocaleString()+"")&&j(ut,ze),m[16]>9?fe?fe.p(m,D):(fe=ws(m),fe.c(),fe.m(Ce,null)):fe&&(fe.d(1),fe=null),D[0]&65792&&We(Ce,"width",(m[8]?m[16]:0)+"%"),D[0]&1114112&&ht!==(ht=m[20]("home.input")+" "+m[16].toFixed(1)+"%")&&u(Ce,"title",ht),m[15]>9?he?he.p(m,D):(he=Ds(m),he.c(),he.m(Re,null)):he&&(he.d(1),he=null),D[0]&33024&&We(Re,"width",(m[8]?m[15]:0)+"%"),D[0]&1081344&&vt!==(vt=m[20]("home.output")+" "+m[15].toFixed(1)+"%")&&u(Re,"title",vt),m[14]>9?ve?ve.p(m,D):(ve=Ts(m),ve.c(),ve.m(Fe,null)):ve&&(ve.d(1),ve=null),D[0]&16640&&We(Fe,"width",(m[8]?m[14]:0)+"%"),D[0]&16384&&dt!==(dt="Cache R "+m[14].toFixed(1)+"%")&&u(Fe,"title",dt),m[13]>9?de?de.p(m,D):(de=Is(m),de.c(),de.m(Oe,null)):de&&(de.d(1),de=null),D[0]&8448&&We(Oe,"width",(m[8]?m[13]:0)+"%"),D[0]&8192&&_t!==(_t="Cache W "+m[13].toFixed(1)+"%")&&u(Oe,"title",_t),D[0]&1048576&&it!==(it=m[20]("home.input")+"")&&j(pt,it),D[0]&1048576&&ct!==(ct=m[20]("home.output")+"")&&j(mt,ct)},d(m){m&&(i(t),i(qe),i(oe),i(ft),i(He)),ue&&ue.d(),Me.d(),fe&&fe.d(),he&&he.d(),ve&&ve.d(),de&&de.d(),Wt=!1,Ht()}}}function ll(e){let t,s,a=e[20]("common.noData")+"",n,r,o,c=e[20]("common.noDataHint")+"",v;return{c(){t=h("div"),s=h("span"),n=b(a),r=k(),o=h("span"),v=b(c),this.h()},l(d){t=f(d,"DIV",{class:!0});var S=_(t);s=f(S,"SPAN",{class:!0});var w=_(s);n=y(w,a),w.forEach(i),r=E(S),o=f(S,"SPAN",{class:!0});var N=_(o);v=y(N,c),N.forEach(i),S.forEach(i),this.h()},h(){u(s,"class","empty-title svelte-2ysxjc"),u(o,"class","empty-hint svelte-2ysxjc"),u(t,"class","splash-empty svelte-2ysxjc")},m(d,S){B(d,t,S),l(t,s),l(s,n),l(t,r),l(t,o),l(o,v)},p(d,S){S[0]&1048576&&a!==(a=d[20]("common.noData")+"")&&j(n,a),S[0]&1048576&&c!==(c=d[20]("common.noDataHint")+"")&&j(v,c)},d(d){d&&i(t)}}}function al(e){let t,s,a,n,r,o=e[20]("home.refreshBtn")+"",c,v,d;return{c(){t=h("div"),s=h("span"),a=b(e[5]),n=k(),r=h("button"),c=b(o),this.h()},l(S){t=f(S,"DIV",{class:!0});var w=_(t);s=f(w,"SPAN",{class:!0});var N=_(s);a=y(N,e[5]),N.forEach(i),n=E(w),r=f(w,"BUTTON",{class:!0});var L=_(r);c=y(L,o),L.forEach(i),w.forEach(i),this.h()},h(){u(s,"class","err-msg svelte-2ysxjc"),u(r,"class","retry-btn svelte-2ysxjc"),u(t,"class","splash-error svelte-2ysxjc")},m(S,w){B(S,t,w),l(t,s),l(s,a),l(t,n),l(t,r),l(r,c),v||(d=Ge(r,"click",e[29]),v=!0)},p(S,w){w[0]&32&&j(a,S[5]),w[0]&1048576&&o!==(o=S[20]("home.refreshBtn")+"")&&j(c,o)},d(S){S&&i(t),v=!1,d()}}}function ol(e){let t,s,a=e[20]("common.loading")+"",n;return{c(){t=h("div"),s=h("span"),n=b(a),this.h()},l(r){t=f(r,"DIV",{class:!0});var o=_(t);s=f(o,"SPAN",{class:!0});var c=_(s);n=y(c,a),c.forEach(i),o.forEach(i),this.h()},h(){u(s,"class","splash-text svelte-2ysxjc"),u(t,"class","splash-loading svelte-2ysxjc")},m(r,o){B(r,t,o),l(t,s),l(s,n)},p(r,o){o[0]&1048576&&a!==(a=r[20]("common.loading")+"")&&j(n,a)},d(r){r&&i(t)}}}function Ss(e){let t;return{c(){t=h("div"),this.h()},l(s){t=f(s,"DIV",{class:!0,style:!0}),_(t).forEach(i),this.h()},h(){u(t,"class","refresh-bar-fill svelte-2ysxjc"),We(t,"width",e[12]+"%")},m(s,a){B(s,t,a)},p(s,a){a[0]&4096&&We(t,"width",s[12]+"%")},d(s){s&&i(t)}}}function nl(e){let t,s=e[20]("home.manualMode")+"",a;return{c(){t=h("span"),a=b(s)},l(n){t=f(n,"SPAN",{});var r=_(t);a=y(r,s),r.forEach(i)},m(n,r){B(n,t,r),l(t,a)},p(n,r){r[0]&1048576&&s!==(s=n[20]("home.manualMode")+"")&&j(a,s)},d(n){n&&i(t)}}}function rl(e){let t;function s(r,o){return r[2]>0?cl:il}let a=s(e),n=a(e);return{c(){n.c(),t=Pt()},l(r){n.l(r),t=Pt()},m(r,o){n.m(r,o),B(r,t,o)},p(r,o){a===(a=s(r))&&n?n.p(r,o):(n.d(1),n=a(r),n&&(n.c(),n.m(t.parentNode,t)))},d(r){r&&i(t),n.d(r)}}}function il(e){let t,s=e[20]("home.refreshing")+"",a;return{c(){t=h("span"),a=b(s),this.h()},l(n){t=f(n,"SPAN",{class:!0});var r=_(t);a=y(r,s),r.forEach(i),this.h()},h(){u(t,"class","refreshing-label svelte-2ysxjc")},m(n,r){B(n,t,r),l(t,a)},p(n,r){r[0]&1048576&&s!==(s=n[20]("home.refreshing")+"")&&j(a,s)},d(n){n&&i(t)}}}function cl(e){let t,s=e[20]("home.nextRefresh")+"",a,n,r,o=e[20]("home.seconds")+"",c;return{c(){t=h("span"),a=b(s),n=k(),r=b(e[2]),c=b(o)},l(v){t=f(v,"SPAN",{});var d=_(t);a=y(d,s),n=E(d),r=y(d,e[2]),c=y(d,o),d.forEach(i)},m(v,d){B(v,t,d),l(t,a),l(t,n),l(t,r),l(t,c)},p(v,d){d[0]&1048576&&s!==(s=v[20]("home.nextRefresh")+"")&&j(a,s),d[0]&4&&j(r,v[2]),d[0]&1048576&&o!==(o=v[20]("home.seconds")+"")&&j(c,o)},d(v){v&&i(t)}}}function ws(e){let t,s=e[20]("home.input")+"",a,n,r=e[16].toFixed(0)+"",o,c;return{c(){t=h("span"),a=b(s),n=k(),o=b(r),c=b("%"),this.h()},l(v){t=f(v,"SPAN",{class:!0});var d=_(t);a=y(d,s),n=E(d),o=y(d,r),c=y(d,"%"),d.forEach(i),this.h()},h(){u(t,"class","seg-lbl svelte-2ysxjc")},m(v,d){B(v,t,d),l(t,a),l(t,n),l(t,o),l(t,c)},p(v,d){d[0]&1048576&&s!==(s=v[20]("home.input")+"")&&j(a,s),d[0]&65536&&r!==(r=v[16].toFixed(0)+"")&&j(o,r)},d(v){v&&i(t)}}}function Ds(e){let t,s=e[20]("home.output")+"",a,n,r=e[15].toFixed(0)+"",o,c;return{c(){t=h("span"),a=b(s),n=k(),o=b(r),c=b("%"),this.h()},l(v){t=f(v,"SPAN",{class:!0});var d=_(t);a=y(d,s),n=E(d),o=y(d,r),c=y(d,"%"),d.forEach(i),this.h()},h(){u(t,"class","seg-lbl svelte-2ysxjc")},m(v,d){B(v,t,d),l(t,a),l(t,n),l(t,o),l(t,c)},p(v,d){d[0]&1048576&&s!==(s=v[20]("home.output")+"")&&j(a,s),d[0]&32768&&r!==(r=v[15].toFixed(0)+"")&&j(o,r)},d(v){v&&i(t)}}}function Ts(e){let t,s,a=e[14].toFixed(0)+"",n,r;return{c(){t=h("span"),s=b("Cache R "),n=b(a),r=b("%"),this.h()},l(o){t=f(o,"SPAN",{class:!0});var c=_(t);s=y(c,"Cache R "),n=y(c,a),r=y(c,"%"),c.forEach(i),this.h()},h(){u(t,"class","seg-lbl svelte-2ysxjc")},m(o,c){B(o,t,c),l(t,s),l(t,n),l(t,r)},p(o,c){c[0]&16384&&a!==(a=o[14].toFixed(0)+"")&&j(n,a)},d(o){o&&i(t)}}}function Is(e){let t,s,a=e[13].toFixed(0)+"",n,r;return{c(){t=h("span"),s=b("Cache W "),n=b(a),r=b("%"),this.h()},l(o){t=f(o,"SPAN",{class:!0});var c=_(t);s=y(c,"Cache W "),n=y(c,a),r=y(c,"%"),c.forEach(i),this.h()},h(){u(t,"class","seg-lbl svelte-2ysxjc")},m(o,c){B(o,t,c),l(t,s),l(t,n),l(t,r)},p(o,c){c[0]&8192&&a!==(a=o[13].toFixed(0)+"")&&j(n,a)},d(o){o&&i(t)}}}function ul(e){let t,s,a,n,r='<span class="live-dot svelte-2ysxjc"></span> <span class="live-label svelte-2ysxjc">LIVE</span>',o,c,v=e[20](e[11])+"",d,S,w,N,L,Z,K,J,z,U,Y,X,te,H,P,M,q,T=e[4]&&bs(e),C=e[9].length>0&&ks(e);function x(g,R){return g[6]?ol:g[5]?al:!g[1]||g[1].totalTokens===0?ll:sl}let A=x(e),W=A(e);return{c(){t=k(),T&&T.c(),s=k(),a=h("div"),n=h("div"),n.innerHTML=r,o=k(),c=h("span"),d=b(v),S=k(),w=h("div"),N=h("span"),L=b(e[18]),Z=k(),K=h("span"),J=b(e[17]),z=k(),U=h("button"),Y=b("⚙"),te=k(),C&&C.c(),H=k(),W.c(),P=Pt(),this.h()},l(g){Bs("svelte-uofodc",document.head).forEach(i),t=E(g),T&&T.l(g),s=E(g),a=f(g,"DIV",{class:!0});var V=_(a);n=f(V,"DIV",{class:!0,"data-svelte-h":!0}),At(n)!=="svelte-1q8byeo"&&(n.innerHTML=r),o=E(V),c=f(V,"SPAN",{class:!0});var $=_(c);d=y($,v),$.forEach(i),S=E(V),w=f(V,"DIV",{class:!0});var ne=_(w);N=f(ne,"SPAN",{class:!0});var pe=_(N);L=y(pe,e[18]),pe.forEach(i),Z=E(ne),K=f(ne,"SPAN",{class:!0});var ie=_(K);J=y(ie,e[17]),ie.forEach(i),ne.forEach(i),z=E(V),U=f(V,"BUTTON",{class:!0,title:!0});var ee=_(U);Y=y(ee,"⚙"),ee.forEach(i),V.forEach(i),te=E(g),C&&C.l(g),H=E(g),W.l(g),P=Pt(),this.h()},h(){document.title="AIUsage",u(n,"class","live-indicator svelte-2ysxjc"),u(c,"class","range-badge svelte-2ysxjc"),u(N,"class","clock-time svelte-2ysxjc"),u(K,"class","clock-date svelte-2ysxjc"),u(w,"class","clock-block svelte-2ysxjc"),u(U,"class","cfg-btn svelte-2ysxjc"),u(U,"title",X=e[20]("home.cfgTitle")),u(a,"class","top-bar svelte-2ysxjc")},m(g,R){B(g,t,R),T&&T.m(g,R),B(g,s,R),B(g,a,R),l(a,n),l(a,o),l(a,c),l(c,d),l(a,S),l(a,w),l(w,N),l(N,L),l(w,Z),l(w,K),l(K,J),l(a,z),l(a,U),l(U,Y),B(g,te,R),C&&C.m(g,R),B(g,H,R),W.m(g,R),B(g,P,R),M||(q=Ge(U,"click",e[46]),M=!0)},p(g,R){g[4]?T?T.p(g,R):(T=bs(g),T.c(),T.m(s.parentNode,s)):T&&(T.d(1),T=null),R[0]&1050624&&v!==(v=g[20](g[11])+"")&&j(d,v),R[0]&262144&&j(L,g[18]),R[0]&131072&&j(J,g[17]),R[0]&1048576&&X!==(X=g[20]("home.cfgTitle"))&&u(U,"title",X),g[9].length>0?C?C.p(g,R):(C=ks(g),C.c(),C.m(H.parentNode,H)):C&&(C.d(1),C=null),A===(A=x(g))&&W?W.p(g,R):(W.d(1),W=A(g),W&&(W.c(),W.m(P.parentNode,P)))},i:Bt,o:Bt,d(g){g&&(i(t),i(s),i(a),i(te),i(H),i(P)),T&&T.d(g),C&&C.d(g),W.d(g),M=!1,q()}}}const Cs="aiusage-home-display";function Nt(){return{range:"all",precision:"exact"}}function fl(){if(typeof window>"u")return Nt();try{return{...Nt(),...JSON.parse(localStorage.getItem(Cs)||"{}")}}catch{return Nt()}}function Ns(e){typeof window<"u"&&localStorage.setItem(Cs,JSON.stringify(e))}function hl(e){return e>=90?"red":"orange"}function nt(e){return e>=1e9?(e/1e9).toFixed(1)+"B":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}function vl(e,t,s){let a,n,r,o,c,v,d,S,w,N,L,Z,K,J,z,U,Y,X,te;tt(e,xs,p=>s(38,J=p)),tt(e,$s,p=>s(39,z=p)),tt(e,Xs,p=>s(20,U=p));const H=[{tKey:"range.allTime",value:"all"},{tKey:"range.today",value:"day"},{tKey:"range.week",value:"week"},{tKey:"range.month",value:"month"},{tKey:"range.last30",value:"last30"}];let P=Nt(),M=!1,q=3e4,T=null,C=null,x=!0,A=!1,W=!1;const g=It(0,{duration:2600,easing:Tt});tt(e,g,p=>s(21,Y=p));const R=It(0,{duration:2300,easing:Tt});tt(e,R,p=>s(37,K=p));const V=It(0,{duration:1900,easing:Tt});tt(e,V,p=>s(22,X=p));const $=It(0,{duration:1600,easing:Tt});tt(e,$,p=>s(23,te=p));async function ne(p=!1){const G=p?500:2600;s(5,C=null);try{const O=await Js({range:P.range});O&&(s(1,T=O),g.set(O.totalTokens,{duration:G}),R.set(O.totalCost,{duration:Math.round(G*.88)}),V.set(O.totalSessions||0,{duration:Math.round(G*.73)}),$.set(O.activeDays,{duration:Math.round(G*.62)}),s(8,W=!1),setTimeout(()=>{s(8,W=!0)},p?80:400))}catch(O){s(5,C=O instanceof Error?O.message:"Failed to load"),s(1,T=null)}}async function pe(){s(6,x=!0),g.set(0,{duration:0}),R.set(0,{duration:0}),V.set(0,{duration:0}),$.set(0,{duration:0}),s(8,W=!1),await ne(!1),s(6,x=!1)}async function ie(){s(7,A=!0),await ne(!0),s(7,A=!1)}let ee=0,_e=null,me=null;function ce(){clearInterval(_e),clearTimeout(me);const p=Math.round(q/1e3);if(!p){s(2,ee=0);return}s(2,ee=p),_e=setInterval(()=>{s(2,ee=Math.max(0,ee-1))},1e3),me=setTimeout(()=>{ie().then(ce)},q)}function se(){clearInterval(_e),clearTimeout(me),ie().then(()=>ce())}function be(p){var G;s(34,q=((G=p==null?void 0:p.detail)==null?void 0:G.refreshInterval)??3e4),ce()}let le=new Date,we=null;Os(async()=>{s(0,P=fl()),we=setInterval(()=>{s(35,le=new Date)},1e3);try{const p=await Us();p!=null&&p.refreshInterval&&s(34,q=p.refreshInterval)}catch{}await zs().catch(()=>{}),await Promise.all([pe(),ge()]),ce(),window.addEventListener(ps,be)}),Ms(()=>{clearInterval(we),clearInterval(_e),clearTimeout(me),window.removeEventListener(ps,be)});let ae=[];async function ge(){try{const p=await Hs(),G=[];for(const O of(p==null?void 0:p.quotas)??[])if(O.success)for(const Ie of O.tiers??[])Ie.utilization>=80&&G.push({tool:O.tool,tier:Ie.name,utilization:Math.round(Ie.utilization)});s(9,ae=G)}catch{}}const De={"claude-code":"Claude Code",codex:"Codex"},qe={five_hour:"5h",seven_day:"7d",seven_day_opus:"7d Opus",seven_day_sonnet:"7d Sonnet",seven_day_omelette:"7d Design",weekly_limit:"weekly"};function oe(p){s(0,P={...P,range:p}),Ns(P),pe().then(()=>ce())}function re(p){s(0,P={...P,precision:p}),Ns(P)}const ye=()=>s(4,M=!1),Te=()=>s(4,M=!1),Be=p=>oe(p.value),Ee=()=>re("exact"),Q=()=>re("abbr"),I=()=>s(4,M=!1),F=()=>s(4,M=!M);return e.$$.update=()=>{var p;e.$$.dirty[0]&1&&s(19,a=G=>{const O=Math.round(G);if(P.precision==="abbr"){if(O>=1e9)return(O/1e9).toFixed(3)+"B";if(O>=1e6)return(O/1e6).toFixed(3)+"M";if(O>=1e3)return(O/1e3).toFixed(1)+"K"}return O.toLocaleString()}),e.$$.dirty[1]&16&&s(18,n=le.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})),e.$$.dirty[1]&16&&s(17,r=le.toLocaleDateString([],{month:"short",day:"numeric",year:"numeric"})),e.$$.dirty[0]&2&&s(36,o=T?(T.inputTokens||0)+(T.outputTokens||0)+(T.cacheReadTokens||0)+(T.cacheWriteTokens||0):0),e.$$.dirty[0]&2|e.$$.dirty[1]&32&&s(16,c=o>0?T.inputTokens/o*100:0),e.$$.dirty[0]&2|e.$$.dirty[1]&32&&s(15,v=o>0?T.outputTokens/o*100:0),e.$$.dirty[0]&2|e.$$.dirty[1]&32&&s(14,d=o>0?T.cacheReadTokens/o*100:0),e.$$.dirty[0]&2|e.$$.dirty[1]&32&&s(13,S=o>0?T.cacheWriteTokens/o*100:0),e.$$.dirty[1]&8&&s(3,w=Math.round(q/1e3)),e.$$.dirty[0]&12&&s(12,N=w>0?(1-ee/w)*100:0),e.$$.dirty[0]&1&&s(11,L=((p=H.find(G=>G.value===P.range))==null?void 0:p.tKey)??"range.allTime"),e.$$.dirty[1]&448&&s(10,Z=Zs(K))},[P,T,ee,w,M,C,x,A,W,ae,Z,L,N,S,d,v,c,r,n,a,U,Y,X,te,H,g,R,V,$,se,De,qe,oe,re,q,le,o,K,J,z,ye,Te,Be,Ee,Q,I,F]}class bl extends Ls{constructor(t){super(),Ws(this,t,vl,ul,Fs,{},null,[-1,-1,-1])}}export{bl as component};
|
|
3
|
+
· `),oe=y(Ve,e[3]),ye=y(Ve,re),Ve.forEach(i),xe.forEach(i),F.forEach(i),this.h()},h(){u(t,"class","overlay-backdrop svelte-2ysxjc"),u(r,"class","cfg-title svelte-2ysxjc"),u(d,"class","cfg-close svelte-2ysxjc"),u(n,"class","cfg-header svelte-2ysxjc"),u(L,"class","cfg-label svelte-2ysxjc"),u(z,"class","cfg-pills svelte-2ysxjc"),u(N,"class","cfg-section svelte-2ysxjc"),u(X,"class","cfg-label svelte-2ysxjc"),u(A,"class","pill-eg svelte-2ysxjc"),u(q,"class","pill svelte-2ysxjc"),Se(q,"active",e[0].precision==="exact"),u(ie,"class","pill-eg svelte-2ysxjc"),u(V,"class","pill svelte-2ysxjc"),Se(V,"active",e[0].precision==="abbr"),u(M,"class","cfg-pills svelte-2ysxjc"),u(Y,"class","cfg-section svelte-2ysxjc"),u(ae,"href","/settings"),u(ae,"class","settings-link svelte-2ysxjc"),u(se,"class","refresh-info-text svelte-2ysxjc"),u(ce,"class","cfg-refresh-info svelte-2ysxjc"),u(a,"class","config-panel svelte-2ysxjc"),u(a,"role","dialog")},m(I,F){B(I,t,F),B(I,s,F),B(I,a,F),l(a,n),l(n,r),l(r,c),l(n,v),l(n,d),l(a,w),l(a,N),l(N,L),l(L,K),l(N,J),l(N,z);for(let p=0;p<Q.length;p+=1)Q[p]&&Q[p].m(z,null);l(a,U),l(a,Y),l(Y,X),l(X,H),l(Y,P),l(Y,M),l(M,q),l(q,C),l(q,x),l(q,A),l(A,g),l(M,R),l(M,V),l(V,ne),l(V,pe),l(V,ie),l(ie,_e),l(a,me),l(a,ce),l(ce,se),l(se,le),l(se,we),l(se,ae),l(ae,De),l(se,qe),l(se,oe),l(se,ye),Te||(Be=[Ge(t,"click",e[40]),Ge(d,"click",e[41]),Ge(q,"click",e[43]),Ge(V,"click",e[44]),Ge(ae,"click",e[45])],Te=!0)},p(I,F){if(F[0]&1048576&&o!==(o=I[20]("home.cfgTitle")+"")&&j(c,o),F[0]&1048576&&Z!==(Z=I[20]("home.timeRange")+"")&&j(K,Z),F[0]&17825793|F[1]&2){Ee=Vt(I[24]);let p;for(p=0;p<Ee.length;p+=1){const G=ys(I,Ee,p);Q[p]?Q[p].p(G,F):(Q[p]=Es(G),Q[p].c(),Q[p].m(z,null))}for(;p<Q.length;p+=1)Q[p].d(1);Q.length=Ee.length}F[0]&1048576&&te!==(te=I[20]("home.numFormat")+"")&&j(H,te),F[0]&1048576&&T!==(T=I[20]("home.numExact")+"")&&j(C,T),F[0]&1048576&&W!==(W=I[20]("home.numExactEx")+"")&&j(g,W),F[0]&1&&Se(q,"active",I[0].precision==="exact"),F[0]&1048576&&$!==($=I[20]("home.numShort")+"")&&j(ne,$),F[0]&1048576&&ee!==(ee=I[20]("home.numShortEx")+"")&&j(_e,ee),F[0]&1&&Se(V,"active",I[0].precision==="abbr"),F[0]&1048576&&be!==(be=I[20]("home.refreshInfo")+"")&&j(le,be),F[0]&1048576&&ge!==(ge=I[20]("nav.settings")+"")&&j(De,ge),F[0]&8&&j(oe,I[3]),F[0]&1048576&&re!==(re=I[20]("home.seconds")+"")&&j(ye,re)},d(I){I&&(i(t),i(s),i(a)),Ks(Q,I),Te=!1,qs(Be)}}}function Es(e){let t,s=e[20](e[60].tKey)+"",a,n,r,o;function c(){return e[42](e[60])}return{c(){t=h("button"),a=b(s),n=k(),this.h()},l(v){t=f(v,"BUTTON",{class:!0});var d=_(t);a=y(d,s),n=E(d),d.forEach(i),this.h()},h(){u(t,"class","pill svelte-2ysxjc"),Se(t,"active",e[0].range===e[60].value)},m(v,d){B(v,t,d),l(t,a),l(t,n),r||(o=Ge(t,"click",c),r=!0)},p(v,d){e=v,d[0]&1048576&&s!==(s=e[20](e[60].tKey)+"")&&j(a,s),d[0]&16777217&&Se(t,"active",e[0].range===e[60].value)},d(v){v&&i(t),r=!1,o()}}}function ks(e){let t,s=[],a=new Map,n=Vt(e[9]);const r=o=>o[56].tool+o[56].tier;for(let o=0;o<n.length;o+=1){let c=gs(e,n,o),v=r(c);a.set(v,s[o]=js(v,c))}return{c(){t=h("div");for(let o=0;o<s.length;o+=1)s[o].c();this.h()},l(o){t=f(o,"DIV",{class:!0});var c=_(t);for(let v=0;v<s.length;v+=1)s[v].l(c);c.forEach(i),this.h()},h(){u(t,"class","quota-warning-list svelte-2ysxjc")},m(o,c){B(o,t,c);for(let v=0;v<s.length;v+=1)s[v]&&s[v].m(t,null)},p(o,c){c[0]&1074790912|c[1]&1&&(n=Vt(o[9]),s=Gs(s,c,r,1,o,n,a,t,Qs,js,null,gs))},d(o){o&&i(t);for(let c=0;c<s.length;c+=1)s[c].d()}}}function js(e,t){let s,a,n=t[57]==="red"?"▲":"△",r,o,c,v,d=(t[30][t[56].tool]??t[56].tool)+"",S,w,N=(t[31][t[56].tier]??t[56].tier)+"",L,Z,K=t[20]("home.quotaWarningDesc")+"",J,z,U,Y=t[56].utilization+"",X,te,H,P,M=t[20]("home.quotaWarningLink")+"",q,T,C;return{key:e,first:null,c(){s=h("div"),a=h("span"),r=b(n),o=k(),c=h("span"),v=h("strong"),S=b(d),w=k(),L=b(N),Z=k(),J=b(K),z=b(": "),U=h("strong"),X=b(Y),te=b("%"),H=k(),P=h("a"),q=b(M),T=b(" →"),C=k(),this.h()},l(x){s=f(x,"DIV",{class:!0});var A=_(s);a=f(A,"SPAN",{class:!0});var W=_(a);r=y(W,n),W.forEach(i),o=E(A),c=f(A,"SPAN",{class:!0});var g=_(c);v=f(g,"STRONG",{});var R=_(v);S=y(R,d),R.forEach(i),w=E(g),L=y(g,N),Z=E(g),J=y(g,K),z=y(g,": "),U=f(g,"STRONG",{});var V=_(U);X=y(V,Y),te=y(V,"%"),V.forEach(i),g.forEach(i),H=E(A),P=f(A,"A",{href:!0,class:!0});var $=_(P);q=y($,M),T=y($," →"),$.forEach(i),C=E(A),A.forEach(i),this.h()},h(){u(a,"class","warn-icon svelte-2ysxjc"),u(c,"class","warn-text svelte-2ysxjc"),u(P,"href","/quotas"),u(P,"class","warn-link svelte-2ysxjc"),u(s,"class","quota-warning svelte-2ysxjc"),Se(s,"quota-red",t[57]==="red"),Se(s,"quota-orange",t[57]==="orange"),this.first=s},m(x,A){B(x,s,A),l(s,a),l(a,r),l(s,o),l(s,c),l(c,v),l(v,S),l(c,w),l(c,L),l(c,Z),l(c,J),l(c,z),l(c,U),l(U,X),l(U,te),l(s,H),l(s,P),l(P,q),l(P,T),l(s,C)},p(x,A){t=x,A[0]&512&&n!==(n=t[57]==="red"?"▲":"△")&&j(r,n),A[0]&512&&d!==(d=(t[30][t[56].tool]??t[56].tool)+"")&&j(S,d),A[0]&512&&N!==(N=(t[31][t[56].tier]??t[56].tier)+"")&&j(L,N),A[0]&1048576&&K!==(K=t[20]("home.quotaWarningDesc")+"")&&j(J,K),A[0]&512&&Y!==(Y=t[56].utilization+"")&&j(X,Y),A[0]&1048576&&M!==(M=t[20]("home.quotaWarningLink")+"")&&j(q,M),A[0]&512&&Se(s,"quota-red",t[57]==="red"),A[0]&512&&Se(s,"quota-orange",t[57]==="orange")},d(x){x&&i(s)}}}function sl(e){let t,s,a=e[20]("home.counterLabel")+"",n,r,o,c=e[19](e[21])+"",v,d,S,w,N,L=e[20]("home.input")+"",Z,K,J,z=nt(e[1].inputTokens)+"",U,Y,X,te,H,P,M=e[20]("home.output")+"",q,T,C,x=nt(e[1].outputTokens)+"",A,W,g,R,V,$,ne=e[20]("home.cache")+"",pe,ie,ee,_e=nt((e[1].cacheReadTokens||0)+(e[1].cacheWriteTokens||0))+"",me,ce,se,be,le,we,ae,ge=(e[3]>0?e[20]("home.refreshNow"):e[20]("home.refreshBtn"))+"",De,qe,oe,re,ye,Te=e[20]("overview.totalCost")+"",Be,Ee,Q,I,F,p,G,O=e[20]("overview.totalSessions")+"",Ie,st,Ne,Je=Math.round(e[22]).toLocaleString()+"",Ke,Qe,Ae,Pe,Ye=e[20]("overview.activeDays")+"",xe,Ve,Ue,ze=Math.round(e[23]).toLocaleString()+"",ut,ft,He,ke,Ce,ht,Ct,Re,vt,Rt,Fe,dt,Ft,Oe,_t,Ot,je,lt,it=e[20]("home.input")+"",pt,Mt,at,ct=e[20]("home.output")+"",mt,qt,$e,Ut="Cache Read",Lt,et,zt="Cache Write",Wt,Ht,ue=e[3]>0&&Ss(e);function Gt(m,D){return m[3]>0?rl:nl}let gt=Gt(e),Me=gt(e),fe=e[16]>9&&ws(e),he=e[15]>9&&Ds(e),ve=e[14]>9&&Ts(e),de=e[13]>9&&Is(e);return{c(){t=h("section"),s=h("div"),n=b(a),r=k(),o=h("div"),v=b(c),d=k(),S=h("div"),w=h("div"),N=h("span"),Z=b(L),K=k(),J=h("span"),U=b(z),Y=k(),X=h("div"),te=k(),H=h("div"),P=h("span"),q=b(M),T=k(),C=h("span"),A=b(x),W=k(),g=h("div"),R=k(),V=h("div"),$=h("span"),pe=b(ne),ie=k(),ee=h("span"),me=b(_e),ce=k(),se=h("div"),ue&&ue.c(),be=k(),le=h("div"),Me.c(),we=k(),ae=h("button"),De=b(ge),qe=k(),oe=h("div"),re=h("div"),ye=h("span"),Be=b(Te),Ee=k(),Q=h("span"),I=b(e[10]),F=k(),p=h("div"),G=h("span"),Ie=b(O),st=k(),Ne=h("span"),Ke=b(Je),Qe=k(),Ae=h("div"),Pe=h("span"),xe=b(Ye),Ve=k(),Ue=h("span"),ut=b(ze),ft=k(),He=h("div"),ke=h("div"),Ce=h("div"),fe&&fe.c(),Ct=k(),Re=h("div"),he&&he.c(),Rt=k(),Fe=h("div"),ve&&ve.c(),Ft=k(),Oe=h("div"),de&&de.c(),Ot=k(),je=h("div"),lt=h("span"),pt=b(it),Mt=k(),at=h("span"),mt=b(ct),qt=k(),$e=h("span"),$e.textContent=Ut,Lt=k(),et=h("span"),et.textContent=zt,this.h()},l(m){t=f(m,"SECTION",{class:!0});var D=_(t);s=f(D,"DIV",{class:!0});var Jt=_(s);n=y(Jt,a),Jt.forEach(i),r=E(D),o=f(D,"DIV",{class:!0});var Qt=_(o);v=y(Qt,c),Qt.forEach(i),d=E(D),S=f(D,"DIV",{class:!0});var Le=_(S);w=f(Le,"DIV",{class:!0});var yt=_(w);N=f(yt,"SPAN",{class:!0});var Yt=_(N);Z=y(Yt,L),Yt.forEach(i),K=E(yt),J=f(yt,"SPAN",{class:!0});var Xt=_(J);U=y(Xt,z),Xt.forEach(i),yt.forEach(i),Y=E(Le),X=f(Le,"DIV",{class:!0}),_(X).forEach(i),te=E(Le),H=f(Le,"DIV",{class:!0});var bt=_(H);P=f(bt,"SPAN",{class:!0});var Zt=_(P);q=y(Zt,M),Zt.forEach(i),T=E(bt),C=f(bt,"SPAN",{class:!0});var xt=_(C);A=y(xt,x),xt.forEach(i),bt.forEach(i),W=E(Le),g=f(Le,"DIV",{class:!0}),_(g).forEach(i),R=E(Le),V=f(Le,"DIV",{class:!0});var Et=_(V);$=f(Et,"SPAN",{class:!0});var $t=_($);pe=y($t,ne),$t.forEach(i),ie=E(Et),ee=f(Et,"SPAN",{class:!0});var es=_(ee);me=y(es,_e),es.forEach(i),Et.forEach(i),Le.forEach(i),ce=E(D),se=f(D,"DIV",{class:!0});var ts=_(se);ue&&ue.l(ts),ts.forEach(i),be=E(D),le=f(D,"DIV",{class:!0});var kt=_(le);Me.l(kt),we=E(kt),ae=f(kt,"BUTTON",{class:!0});var ss=_(ae);De=y(ss,ge),ss.forEach(i),kt.forEach(i),D.forEach(i),qe=E(m),oe=f(m,"DIV",{class:!0});var ot=_(oe);re=f(ot,"DIV",{class:!0});var jt=_(re);ye=f(jt,"SPAN",{class:!0});var ls=_(ye);Be=y(ls,Te),ls.forEach(i),Ee=E(jt),Q=f(jt,"SPAN",{class:!0});var as=_(Q);I=y(as,e[10]),as.forEach(i),jt.forEach(i),F=E(ot),p=f(ot,"DIV",{class:!0});var St=_(p);G=f(St,"SPAN",{class:!0});var os=_(G);Ie=y(os,O),os.forEach(i),st=E(St),Ne=f(St,"SPAN",{class:!0});var ns=_(Ne);Ke=y(ns,Je),ns.forEach(i),St.forEach(i),Qe=E(ot),Ae=f(ot,"DIV",{class:!0});var wt=_(Ae);Pe=f(wt,"SPAN",{class:!0});var rs=_(Pe);xe=y(rs,Ye),rs.forEach(i),Ve=E(wt),Ue=f(wt,"SPAN",{class:!0});var is=_(Ue);ut=y(is,ze),is.forEach(i),wt.forEach(i),ot.forEach(i),ft=E(m),He=f(m,"DIV",{class:!0});var Dt=_(He);ke=f(Dt,"DIV",{class:!0});var Xe=_(ke);Ce=f(Xe,"DIV",{class:!0,style:!0,title:!0});var cs=_(Ce);fe&&fe.l(cs),cs.forEach(i),Ct=E(Xe),Re=f(Xe,"DIV",{class:!0,style:!0,title:!0});var us=_(Re);he&&he.l(us),us.forEach(i),Rt=E(Xe),Fe=f(Xe,"DIV",{class:!0,style:!0,title:!0});var fs=_(Fe);ve&&ve.l(fs),fs.forEach(i),Ft=E(Xe),Oe=f(Xe,"DIV",{class:!0,style:!0,title:!0});var hs=_(Oe);de&&de.l(hs),hs.forEach(i),Xe.forEach(i),Ot=E(Dt),je=f(Dt,"DIV",{class:!0});var Ze=_(je);lt=f(Ze,"SPAN",{class:!0});var vs=_(lt);pt=y(vs,it),vs.forEach(i),Mt=E(Ze),at=f(Ze,"SPAN",{class:!0});var ds=_(at);mt=y(ds,ct),ds.forEach(i),qt=E(Ze),$e=f(Ze,"SPAN",{class:!0,"data-svelte-h":!0}),At($e)!=="svelte-1dlj92d"&&($e.textContent=Ut),Lt=E(Ze),et=f(Ze,"SPAN",{class:!0,"data-svelte-h":!0}),At(et)!=="svelte-g1qgcf"&&(et.textContent=zt),Ze.forEach(i),Dt.forEach(i),this.h()},h(){u(s,"class","counter-label svelte-2ysxjc"),u(o,"class","counter-number svelte-2ysxjc"),Se(o,"refreshing",e[7]),u(N,"class","sub-label svelte-2ysxjc"),u(J,"class","sub-value svelte-2ysxjc"),u(w,"class","sub-item svelte-2ysxjc"),u(X,"class","sub-divider svelte-2ysxjc"),u(P,"class","sub-label svelte-2ysxjc"),u(C,"class","sub-value svelte-2ysxjc"),u(H,"class","sub-item svelte-2ysxjc"),u(g,"class","sub-divider svelte-2ysxjc"),u($,"class","sub-label svelte-2ysxjc"),u(ee,"class","sub-value svelte-2ysxjc"),u(V,"class","sub-item svelte-2ysxjc"),u(S,"class","counter-sub svelte-2ysxjc"),u(se,"class","refresh-bar-track svelte-2ysxjc"),u(ae,"class","now-btn svelte-2ysxjc"),u(le,"class","refresh-meta svelte-2ysxjc"),u(t,"class","counter-section svelte-2ysxjc"),u(ye,"class","stat-label svelte-2ysxjc"),u(Q,"class","stat-value stat-cost svelte-2ysxjc"),u(re,"class","stat-block svelte-2ysxjc"),u(G,"class","stat-label svelte-2ysxjc"),u(Ne,"class","stat-value svelte-2ysxjc"),u(p,"class","stat-block svelte-2ysxjc"),u(Pe,"class","stat-label svelte-2ysxjc"),u(Ue,"class","stat-value svelte-2ysxjc"),u(Ae,"class","stat-block svelte-2ysxjc"),u(oe,"class","stats-strip svelte-2ysxjc"),u(Ce,"class","seg seg-input svelte-2ysxjc"),We(Ce,"width",(e[8]?e[16]:0)+"%"),u(Ce,"title",ht=e[20]("home.input")+" "+e[16].toFixed(1)+"%"),u(Re,"class","seg seg-output svelte-2ysxjc"),We(Re,"width",(e[8]?e[15]:0)+"%"),u(Re,"title",vt=e[20]("home.output")+" "+e[15].toFixed(1)+"%"),u(Fe,"class","seg seg-cr svelte-2ysxjc"),We(Fe,"width",(e[8]?e[14]:0)+"%"),u(Fe,"title",dt="Cache R "+e[14].toFixed(1)+"%"),u(Oe,"class","seg seg-cw svelte-2ysxjc"),We(Oe,"width",(e[8]?e[13]:0)+"%"),u(Oe,"title",_t="Cache W "+e[13].toFixed(1)+"%"),u(ke,"class","comp-bar svelte-2ysxjc"),u(lt,"class","leg leg-i svelte-2ysxjc"),u(at,"class","leg leg-o svelte-2ysxjc"),u($e,"class","leg leg-cr svelte-2ysxjc"),u(et,"class","leg leg-cw svelte-2ysxjc"),u(je,"class","comp-legend svelte-2ysxjc"),u(He,"class","comp-wrap svelte-2ysxjc")},m(m,D){B(m,t,D),l(t,s),l(s,n),l(t,r),l(t,o),l(o,v),l(t,d),l(t,S),l(S,w),l(w,N),l(N,Z),l(w,K),l(w,J),l(J,U),l(S,Y),l(S,X),l(S,te),l(S,H),l(H,P),l(P,q),l(H,T),l(H,C),l(C,A),l(S,W),l(S,g),l(S,R),l(S,V),l(V,$),l($,pe),l(V,ie),l(V,ee),l(ee,me),l(t,ce),l(t,se),ue&&ue.m(se,null),l(t,be),l(t,le),Me.m(le,null),l(le,we),l(le,ae),l(ae,De),B(m,qe,D),B(m,oe,D),l(oe,re),l(re,ye),l(ye,Be),l(re,Ee),l(re,Q),l(Q,I),l(oe,F),l(oe,p),l(p,G),l(G,Ie),l(p,st),l(p,Ne),l(Ne,Ke),l(oe,Qe),l(oe,Ae),l(Ae,Pe),l(Pe,xe),l(Ae,Ve),l(Ae,Ue),l(Ue,ut),B(m,ft,D),B(m,He,D),l(He,ke),l(ke,Ce),fe&&fe.m(Ce,null),l(ke,Ct),l(ke,Re),he&&he.m(Re,null),l(ke,Rt),l(ke,Fe),ve&&ve.m(Fe,null),l(ke,Ft),l(ke,Oe),de&&de.m(Oe,null),l(He,Ot),l(He,je),l(je,lt),l(lt,pt),l(je,Mt),l(je,at),l(at,mt),l(je,qt),l(je,$e),l(je,Lt),l(je,et),Wt||(Ht=Ge(ae,"click",e[29]),Wt=!0)},p(m,D){D[0]&1048576&&a!==(a=m[20]("home.counterLabel")+"")&&j(n,a),D[0]&2621440&&c!==(c=m[19](m[21])+"")&&j(v,c),D[0]&128&&Se(o,"refreshing",m[7]),D[0]&1048576&&L!==(L=m[20]("home.input")+"")&&j(Z,L),D[0]&2&&z!==(z=nt(m[1].inputTokens)+"")&&j(U,z),D[0]&1048576&&M!==(M=m[20]("home.output")+"")&&j(q,M),D[0]&2&&x!==(x=nt(m[1].outputTokens)+"")&&j(A,x),D[0]&1048576&&ne!==(ne=m[20]("home.cache")+"")&&j(pe,ne),D[0]&2&&_e!==(_e=nt((m[1].cacheReadTokens||0)+(m[1].cacheWriteTokens||0))+"")&&j(me,_e),m[3]>0?ue?ue.p(m,D):(ue=Ss(m),ue.c(),ue.m(se,null)):ue&&(ue.d(1),ue=null),gt===(gt=Gt(m))&&Me?Me.p(m,D):(Me.d(1),Me=gt(m),Me&&(Me.c(),Me.m(le,we))),D[0]&1048584&&ge!==(ge=(m[3]>0?m[20]("home.refreshNow"):m[20]("home.refreshBtn"))+"")&&j(De,ge),D[0]&1048576&&Te!==(Te=m[20]("overview.totalCost")+"")&&j(Be,Te),D[0]&1024&&j(I,m[10]),D[0]&1048576&&O!==(O=m[20]("overview.totalSessions")+"")&&j(Ie,O),D[0]&4194304&&Je!==(Je=Math.round(m[22]).toLocaleString()+"")&&j(Ke,Je),D[0]&1048576&&Ye!==(Ye=m[20]("overview.activeDays")+"")&&j(xe,Ye),D[0]&8388608&&ze!==(ze=Math.round(m[23]).toLocaleString()+"")&&j(ut,ze),m[16]>9?fe?fe.p(m,D):(fe=ws(m),fe.c(),fe.m(Ce,null)):fe&&(fe.d(1),fe=null),D[0]&65792&&We(Ce,"width",(m[8]?m[16]:0)+"%"),D[0]&1114112&&ht!==(ht=m[20]("home.input")+" "+m[16].toFixed(1)+"%")&&u(Ce,"title",ht),m[15]>9?he?he.p(m,D):(he=Ds(m),he.c(),he.m(Re,null)):he&&(he.d(1),he=null),D[0]&33024&&We(Re,"width",(m[8]?m[15]:0)+"%"),D[0]&1081344&&vt!==(vt=m[20]("home.output")+" "+m[15].toFixed(1)+"%")&&u(Re,"title",vt),m[14]>9?ve?ve.p(m,D):(ve=Ts(m),ve.c(),ve.m(Fe,null)):ve&&(ve.d(1),ve=null),D[0]&16640&&We(Fe,"width",(m[8]?m[14]:0)+"%"),D[0]&16384&&dt!==(dt="Cache R "+m[14].toFixed(1)+"%")&&u(Fe,"title",dt),m[13]>9?de?de.p(m,D):(de=Is(m),de.c(),de.m(Oe,null)):de&&(de.d(1),de=null),D[0]&8448&&We(Oe,"width",(m[8]?m[13]:0)+"%"),D[0]&8192&&_t!==(_t="Cache W "+m[13].toFixed(1)+"%")&&u(Oe,"title",_t),D[0]&1048576&&it!==(it=m[20]("home.input")+"")&&j(pt,it),D[0]&1048576&&ct!==(ct=m[20]("home.output")+"")&&j(mt,ct)},d(m){m&&(i(t),i(qe),i(oe),i(ft),i(He)),ue&&ue.d(),Me.d(),fe&&fe.d(),he&&he.d(),ve&&ve.d(),de&&de.d(),Wt=!1,Ht()}}}function ll(e){let t,s,a=e[20]("common.noData")+"",n,r,o,c=e[20]("common.noDataHint")+"",v;return{c(){t=h("div"),s=h("span"),n=b(a),r=k(),o=h("span"),v=b(c),this.h()},l(d){t=f(d,"DIV",{class:!0});var S=_(t);s=f(S,"SPAN",{class:!0});var w=_(s);n=y(w,a),w.forEach(i),r=E(S),o=f(S,"SPAN",{class:!0});var N=_(o);v=y(N,c),N.forEach(i),S.forEach(i),this.h()},h(){u(s,"class","empty-title svelte-2ysxjc"),u(o,"class","empty-hint svelte-2ysxjc"),u(t,"class","splash-empty svelte-2ysxjc")},m(d,S){B(d,t,S),l(t,s),l(s,n),l(t,r),l(t,o),l(o,v)},p(d,S){S[0]&1048576&&a!==(a=d[20]("common.noData")+"")&&j(n,a),S[0]&1048576&&c!==(c=d[20]("common.noDataHint")+"")&&j(v,c)},d(d){d&&i(t)}}}function al(e){let t,s,a,n,r,o=e[20]("home.refreshBtn")+"",c,v,d;return{c(){t=h("div"),s=h("span"),a=b(e[5]),n=k(),r=h("button"),c=b(o),this.h()},l(S){t=f(S,"DIV",{class:!0});var w=_(t);s=f(w,"SPAN",{class:!0});var N=_(s);a=y(N,e[5]),N.forEach(i),n=E(w),r=f(w,"BUTTON",{class:!0});var L=_(r);c=y(L,o),L.forEach(i),w.forEach(i),this.h()},h(){u(s,"class","err-msg svelte-2ysxjc"),u(r,"class","retry-btn svelte-2ysxjc"),u(t,"class","splash-error svelte-2ysxjc")},m(S,w){B(S,t,w),l(t,s),l(s,a),l(t,n),l(t,r),l(r,c),v||(d=Ge(r,"click",e[29]),v=!0)},p(S,w){w[0]&32&&j(a,S[5]),w[0]&1048576&&o!==(o=S[20]("home.refreshBtn")+"")&&j(c,o)},d(S){S&&i(t),v=!1,d()}}}function ol(e){let t,s,a=e[20]("common.loading")+"",n;return{c(){t=h("div"),s=h("span"),n=b(a),this.h()},l(r){t=f(r,"DIV",{class:!0});var o=_(t);s=f(o,"SPAN",{class:!0});var c=_(s);n=y(c,a),c.forEach(i),o.forEach(i),this.h()},h(){u(s,"class","splash-text svelte-2ysxjc"),u(t,"class","splash-loading svelte-2ysxjc")},m(r,o){B(r,t,o),l(t,s),l(s,n)},p(r,o){o[0]&1048576&&a!==(a=r[20]("common.loading")+"")&&j(n,a)},d(r){r&&i(t)}}}function Ss(e){let t;return{c(){t=h("div"),this.h()},l(s){t=f(s,"DIV",{class:!0,style:!0}),_(t).forEach(i),this.h()},h(){u(t,"class","refresh-bar-fill svelte-2ysxjc"),We(t,"width",e[12]+"%")},m(s,a){B(s,t,a)},p(s,a){a[0]&4096&&We(t,"width",s[12]+"%")},d(s){s&&i(t)}}}function nl(e){let t,s=e[20]("home.manualMode")+"",a;return{c(){t=h("span"),a=b(s)},l(n){t=f(n,"SPAN",{});var r=_(t);a=y(r,s),r.forEach(i)},m(n,r){B(n,t,r),l(t,a)},p(n,r){r[0]&1048576&&s!==(s=n[20]("home.manualMode")+"")&&j(a,s)},d(n){n&&i(t)}}}function rl(e){let t;function s(r,o){return r[2]>0?cl:il}let a=s(e),n=a(e);return{c(){n.c(),t=Pt()},l(r){n.l(r),t=Pt()},m(r,o){n.m(r,o),B(r,t,o)},p(r,o){a===(a=s(r))&&n?n.p(r,o):(n.d(1),n=a(r),n&&(n.c(),n.m(t.parentNode,t)))},d(r){r&&i(t),n.d(r)}}}function il(e){let t,s=e[20]("home.refreshing")+"",a;return{c(){t=h("span"),a=b(s),this.h()},l(n){t=f(n,"SPAN",{class:!0});var r=_(t);a=y(r,s),r.forEach(i),this.h()},h(){u(t,"class","refreshing-label svelte-2ysxjc")},m(n,r){B(n,t,r),l(t,a)},p(n,r){r[0]&1048576&&s!==(s=n[20]("home.refreshing")+"")&&j(a,s)},d(n){n&&i(t)}}}function cl(e){let t,s=e[20]("home.nextRefresh")+"",a,n,r,o=e[20]("home.seconds")+"",c;return{c(){t=h("span"),a=b(s),n=k(),r=b(e[2]),c=b(o)},l(v){t=f(v,"SPAN",{});var d=_(t);a=y(d,s),n=E(d),r=y(d,e[2]),c=y(d,o),d.forEach(i)},m(v,d){B(v,t,d),l(t,a),l(t,n),l(t,r),l(t,c)},p(v,d){d[0]&1048576&&s!==(s=v[20]("home.nextRefresh")+"")&&j(a,s),d[0]&4&&j(r,v[2]),d[0]&1048576&&o!==(o=v[20]("home.seconds")+"")&&j(c,o)},d(v){v&&i(t)}}}function ws(e){let t,s=e[20]("home.input")+"",a,n,r=e[16].toFixed(0)+"",o,c;return{c(){t=h("span"),a=b(s),n=k(),o=b(r),c=b("%"),this.h()},l(v){t=f(v,"SPAN",{class:!0});var d=_(t);a=y(d,s),n=E(d),o=y(d,r),c=y(d,"%"),d.forEach(i),this.h()},h(){u(t,"class","seg-lbl svelte-2ysxjc")},m(v,d){B(v,t,d),l(t,a),l(t,n),l(t,o),l(t,c)},p(v,d){d[0]&1048576&&s!==(s=v[20]("home.input")+"")&&j(a,s),d[0]&65536&&r!==(r=v[16].toFixed(0)+"")&&j(o,r)},d(v){v&&i(t)}}}function Ds(e){let t,s=e[20]("home.output")+"",a,n,r=e[15].toFixed(0)+"",o,c;return{c(){t=h("span"),a=b(s),n=k(),o=b(r),c=b("%"),this.h()},l(v){t=f(v,"SPAN",{class:!0});var d=_(t);a=y(d,s),n=E(d),o=y(d,r),c=y(d,"%"),d.forEach(i),this.h()},h(){u(t,"class","seg-lbl svelte-2ysxjc")},m(v,d){B(v,t,d),l(t,a),l(t,n),l(t,o),l(t,c)},p(v,d){d[0]&1048576&&s!==(s=v[20]("home.output")+"")&&j(a,s),d[0]&32768&&r!==(r=v[15].toFixed(0)+"")&&j(o,r)},d(v){v&&i(t)}}}function Ts(e){let t,s,a=e[14].toFixed(0)+"",n,r;return{c(){t=h("span"),s=b("Cache R "),n=b(a),r=b("%"),this.h()},l(o){t=f(o,"SPAN",{class:!0});var c=_(t);s=y(c,"Cache R "),n=y(c,a),r=y(c,"%"),c.forEach(i),this.h()},h(){u(t,"class","seg-lbl svelte-2ysxjc")},m(o,c){B(o,t,c),l(t,s),l(t,n),l(t,r)},p(o,c){c[0]&16384&&a!==(a=o[14].toFixed(0)+"")&&j(n,a)},d(o){o&&i(t)}}}function Is(e){let t,s,a=e[13].toFixed(0)+"",n,r;return{c(){t=h("span"),s=b("Cache W "),n=b(a),r=b("%"),this.h()},l(o){t=f(o,"SPAN",{class:!0});var c=_(t);s=y(c,"Cache W "),n=y(c,a),r=y(c,"%"),c.forEach(i),this.h()},h(){u(t,"class","seg-lbl svelte-2ysxjc")},m(o,c){B(o,t,c),l(t,s),l(t,n),l(t,r)},p(o,c){c[0]&8192&&a!==(a=o[13].toFixed(0)+"")&&j(n,a)},d(o){o&&i(t)}}}function ul(e){let t,s,a,n,r='<span class="live-dot svelte-2ysxjc"></span> <span class="live-label svelte-2ysxjc">LIVE</span>',o,c,v=e[20](e[11])+"",d,S,w,N,L,Z,K,J,z,U,Y,X,te,H,P,M,q,T=e[4]&&bs(e),C=e[9].length>0&&ks(e);function x(g,R){return g[6]?ol:g[5]?al:!g[1]||g[1].totalTokens===0?ll:sl}let A=x(e),W=A(e);return{c(){t=k(),T&&T.c(),s=k(),a=h("div"),n=h("div"),n.innerHTML=r,o=k(),c=h("span"),d=b(v),S=k(),w=h("div"),N=h("span"),L=b(e[18]),Z=k(),K=h("span"),J=b(e[17]),z=k(),U=h("button"),Y=b("⚙"),te=k(),C&&C.c(),H=k(),W.c(),P=Pt(),this.h()},l(g){Bs("svelte-uofodc",document.head).forEach(i),t=E(g),T&&T.l(g),s=E(g),a=f(g,"DIV",{class:!0});var V=_(a);n=f(V,"DIV",{class:!0,"data-svelte-h":!0}),At(n)!=="svelte-1q8byeo"&&(n.innerHTML=r),o=E(V),c=f(V,"SPAN",{class:!0});var $=_(c);d=y($,v),$.forEach(i),S=E(V),w=f(V,"DIV",{class:!0});var ne=_(w);N=f(ne,"SPAN",{class:!0});var pe=_(N);L=y(pe,e[18]),pe.forEach(i),Z=E(ne),K=f(ne,"SPAN",{class:!0});var ie=_(K);J=y(ie,e[17]),ie.forEach(i),ne.forEach(i),z=E(V),U=f(V,"BUTTON",{class:!0,title:!0});var ee=_(U);Y=y(ee,"⚙"),ee.forEach(i),V.forEach(i),te=E(g),C&&C.l(g),H=E(g),W.l(g),P=Pt(),this.h()},h(){document.title="AIUsage",u(n,"class","live-indicator svelte-2ysxjc"),u(c,"class","range-badge svelte-2ysxjc"),u(N,"class","clock-time svelte-2ysxjc"),u(K,"class","clock-date svelte-2ysxjc"),u(w,"class","clock-block svelte-2ysxjc"),u(U,"class","cfg-btn svelte-2ysxjc"),u(U,"title",X=e[20]("home.cfgTitle")),u(a,"class","top-bar svelte-2ysxjc")},m(g,R){B(g,t,R),T&&T.m(g,R),B(g,s,R),B(g,a,R),l(a,n),l(a,o),l(a,c),l(c,d),l(a,S),l(a,w),l(w,N),l(N,L),l(w,Z),l(w,K),l(K,J),l(a,z),l(a,U),l(U,Y),B(g,te,R),C&&C.m(g,R),B(g,H,R),W.m(g,R),B(g,P,R),M||(q=Ge(U,"click",e[46]),M=!0)},p(g,R){g[4]?T?T.p(g,R):(T=bs(g),T.c(),T.m(s.parentNode,s)):T&&(T.d(1),T=null),R[0]&1050624&&v!==(v=g[20](g[11])+"")&&j(d,v),R[0]&262144&&j(L,g[18]),R[0]&131072&&j(J,g[17]),R[0]&1048576&&X!==(X=g[20]("home.cfgTitle"))&&u(U,"title",X),g[9].length>0?C?C.p(g,R):(C=ks(g),C.c(),C.m(H.parentNode,H)):C&&(C.d(1),C=null),A===(A=x(g))&&W?W.p(g,R):(W.d(1),W=A(g),W&&(W.c(),W.m(P.parentNode,P)))},i:Bt,o:Bt,d(g){g&&(i(t),i(s),i(a),i(te),i(H),i(P)),T&&T.d(g),C&&C.d(g),W.d(g),M=!1,q()}}}const Cs="aiusage-home-display";function Nt(){return{range:"all",precision:"exact"}}function fl(){if(typeof window>"u")return Nt();try{return{...Nt(),...JSON.parse(localStorage.getItem(Cs)||"{}")}}catch{return Nt()}}function Ns(e){typeof window<"u"&&localStorage.setItem(Cs,JSON.stringify(e))}function hl(e){return e>=90?"red":"orange"}function nt(e){return e>=1e9?(e/1e9).toFixed(1)+"B":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toLocaleString()}function vl(e,t,s){let a,n,r,o,c,v,d,S,w,N,L,Z,K,J,z,U,Y,X,te;tt(e,xs,p=>s(38,J=p)),tt(e,$s,p=>s(39,z=p)),tt(e,Xs,p=>s(20,U=p));const H=[{tKey:"range.allTime",value:"all"},{tKey:"range.today",value:"day"},{tKey:"range.week",value:"week"},{tKey:"range.month",value:"month"},{tKey:"range.last30",value:"last30"}];let P=Nt(),M=!1,q=3e4,T=null,C=null,x=!0,A=!1,W=!1;const g=It(0,{duration:2600,easing:Tt});tt(e,g,p=>s(21,Y=p));const R=It(0,{duration:2300,easing:Tt});tt(e,R,p=>s(37,K=p));const V=It(0,{duration:1900,easing:Tt});tt(e,V,p=>s(22,X=p));const $=It(0,{duration:1600,easing:Tt});tt(e,$,p=>s(23,te=p));async function ne(p=!1){const G=p?500:2600;s(5,C=null);try{const O=await Js({range:P.range});O&&(s(1,T=O),g.set(O.totalTokens,{duration:G}),R.set(O.totalCost,{duration:Math.round(G*.88)}),V.set(O.totalSessions||0,{duration:Math.round(G*.73)}),$.set(O.activeDays,{duration:Math.round(G*.62)}),s(8,W=!1),setTimeout(()=>{s(8,W=!0)},p?80:400))}catch(O){s(5,C=O instanceof Error?O.message:"Failed to load"),s(1,T=null)}}async function pe(){s(6,x=!0),g.set(0,{duration:0}),R.set(0,{duration:0}),V.set(0,{duration:0}),$.set(0,{duration:0}),s(8,W=!1),await ne(!1),s(6,x=!1)}async function ie(){s(7,A=!0),await ne(!0),s(7,A=!1)}let ee=0,_e=null,me=null;function ce(){clearInterval(_e),clearTimeout(me);const p=Math.round(q/1e3);if(!p){s(2,ee=0);return}s(2,ee=p),_e=setInterval(()=>{s(2,ee=Math.max(0,ee-1))},1e3),me=setTimeout(()=>{ie().then(ce)},q)}function se(){clearInterval(_e),clearTimeout(me),ie().then(()=>ce())}function be(p){var G;s(34,q=((G=p==null?void 0:p.detail)==null?void 0:G.refreshInterval)??3e4),ce()}let le=new Date,we=null;Os(async()=>{s(0,P=fl()),we=setInterval(()=>{s(35,le=new Date)},1e3);try{const p=await Us();p!=null&&p.refreshInterval&&s(34,q=p.refreshInterval)}catch{}await zs().catch(()=>{}),await Promise.all([pe(),ge()]),ce(),window.addEventListener(ps,be)}),Ms(()=>{clearInterval(we),clearInterval(_e),clearTimeout(me),typeof window<"u"&&window.removeEventListener(ps,be)});let ae=[];async function ge(){try{const p=await Hs(),G=[];for(const O of(p==null?void 0:p.quotas)??[])if(O.success)for(const Ie of O.tiers??[])Ie.utilization>=80&&G.push({tool:O.tool,tier:Ie.name,utilization:Math.round(Ie.utilization)});s(9,ae=G)}catch{}}const De={"claude-code":"Claude Code",codex:"Codex"},qe={five_hour:"5h",seven_day:"7d",seven_day_opus:"7d Opus",seven_day_sonnet:"7d Sonnet",seven_day_omelette:"7d Design",weekly_limit:"weekly"};function oe(p){s(0,P={...P,range:p}),Ns(P),pe().then(()=>ce())}function re(p){s(0,P={...P,precision:p}),Ns(P)}const ye=()=>s(4,M=!1),Te=()=>s(4,M=!1),Be=p=>oe(p.value),Ee=()=>re("exact"),Q=()=>re("abbr"),I=()=>s(4,M=!1),F=()=>s(4,M=!M);return e.$$.update=()=>{var p;e.$$.dirty[0]&1&&s(19,a=G=>{const O=Math.round(G);if(P.precision==="abbr"){if(O>=1e9)return(O/1e9).toFixed(3)+"B";if(O>=1e6)return(O/1e6).toFixed(3)+"M";if(O>=1e3)return(O/1e3).toFixed(1)+"K"}return O.toLocaleString()}),e.$$.dirty[1]&16&&s(18,n=le.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})),e.$$.dirty[1]&16&&s(17,r=le.toLocaleDateString([],{month:"short",day:"numeric",year:"numeric"})),e.$$.dirty[0]&2&&s(36,o=T?(T.inputTokens||0)+(T.outputTokens||0)+(T.cacheReadTokens||0)+(T.cacheWriteTokens||0):0),e.$$.dirty[0]&2|e.$$.dirty[1]&32&&s(16,c=o>0?T.inputTokens/o*100:0),e.$$.dirty[0]&2|e.$$.dirty[1]&32&&s(15,v=o>0?T.outputTokens/o*100:0),e.$$.dirty[0]&2|e.$$.dirty[1]&32&&s(14,d=o>0?T.cacheReadTokens/o*100:0),e.$$.dirty[0]&2|e.$$.dirty[1]&32&&s(13,S=o>0?T.cacheWriteTokens/o*100:0),e.$$.dirty[1]&8&&s(3,w=Math.round(q/1e3)),e.$$.dirty[0]&12&&s(12,N=w>0?(1-ee/w)*100:0),e.$$.dirty[0]&1&&s(11,L=((p=H.find(G=>G.value===P.range))==null?void 0:p.tKey)??"range.allTime"),e.$$.dirty[1]&448&&s(10,Z=Zs(K))},[P,T,ee,w,M,C,x,A,W,ae,Z,L,N,S,d,v,c,r,n,a,U,Y,X,te,H,g,R,V,$,se,De,qe,oe,re,q,le,o,K,J,z,ye,Te,Be,Ee,Q,I,F]}class bl extends Ls{constructor(t){super(),Ws(this,t,vl,ul,Fs,{},null,[-1,-1,-1])}}export{bl as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1781662306648"}
|
package/dist/web/index.html
CHANGED
|
@@ -19,26 +19,26 @@
|
|
|
19
19
|
})();
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
|
-
<link rel="modulepreload" href="/_app/immutable/entry/start.
|
|
23
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/entry.
|
|
22
|
+
<link rel="modulepreload" href="/_app/immutable/entry/start.DAyKzWev.js">
|
|
23
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/entry.BtjCrbiQ.js">
|
|
24
24
|
<link rel="modulepreload" href="/_app/immutable/chunks/scheduler.DsWd5xup.js">
|
|
25
25
|
<link rel="modulepreload" href="/_app/immutable/chunks/index.m3oCcA6N.js">
|
|
26
|
-
<link rel="modulepreload" href="/_app/immutable/entry/app.
|
|
26
|
+
<link rel="modulepreload" href="/_app/immutable/entry/app.RcQYJvro.js">
|
|
27
27
|
<link rel="modulepreload" href="/_app/immutable/chunks/index.BfJlbjrK.js">
|
|
28
28
|
</head>
|
|
29
29
|
<body data-sveltekit-preload-data="hover">
|
|
30
30
|
<div style="display: contents">
|
|
31
31
|
<script>
|
|
32
32
|
{
|
|
33
|
-
|
|
33
|
+
__sveltekit_1gx35br = {
|
|
34
34
|
base: ""
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
const element = document.currentScript.parentElement;
|
|
38
38
|
|
|
39
39
|
Promise.all([
|
|
40
|
-
import("/_app/immutable/entry/start.
|
|
41
|
-
import("/_app/immutable/entry/app.
|
|
40
|
+
import("/_app/immutable/entry/start.DAyKzWev.js"),
|
|
41
|
+
import("/_app/immutable/entry/app.RcQYJvro.js")
|
|
42
42
|
]).then(([kit, app]) => {
|
|
43
43
|
kit.start(app, element);
|
|
44
44
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juliantanx/aiusage",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Track and analyze AI coding assistant usage across Claude Code, Codex, and more",
|
|
6
6
|
"keywords": [
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"tsx": "^4.0.0",
|
|
55
55
|
"typescript": "^5.7.0",
|
|
56
56
|
"vitest": "^3.0.0",
|
|
57
|
-
"@aiusage/core": "1.5.
|
|
58
|
-
"@aiusage/web": "1.5.
|
|
57
|
+
"@aiusage/core": "1.5.5",
|
|
58
|
+
"@aiusage/web": "1.5.5"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "tsup && node scripts/copy-web.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as t}from"../chunks/entry.DhBBmiYe.js";export{t as start};
|