dispach 0.1.2 → 0.2.0-pilot.1
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 +196 -118
- package/dist/APEv2Parser-2wqk09q7.js +5 -0
- package/dist/APEv2Parser-2wqk09q7.js.map +9 -0
- package/dist/AiffParser-zw4g2bdd.js +5 -0
- package/dist/AiffParser-zw4g2bdd.js.map +12 -0
- package/dist/App-ez7ve0yp.js +11 -0
- package/dist/{App-b1yrwrcq.js.map → App-ez7ve0yp.js.map} +6 -7
- package/dist/AsfParser-2hfcf5z2.js +5 -0
- package/dist/AsfParser-2hfcf5z2.js.map +14 -0
- package/dist/ConfigEditor-aamadrx3.js +6 -0
- package/dist/{ConfigEditor-n8hdw6r7.js.map → ConfigEditor-aamadrx3.js.map} +2 -2
- package/dist/DsdiffParser-n8smktvb.js +5 -0
- package/dist/DsdiffParser-n8smktvb.js.map +11 -0
- package/dist/DsfParser-npmjp4vr.js +5 -0
- package/dist/DsfParser-npmjp4vr.js.map +11 -0
- package/dist/FlacParser-xpbs2zmb.js +5 -0
- package/dist/FlacParser-xpbs2zmb.js.map +9 -0
- package/dist/KeyProbe-4fp152yv.js +5 -0
- package/dist/{KeyProbe-9jjeze5r.js.map → KeyProbe-4fp152yv.js.map} +2 -2
- package/dist/MP4Parser-es3afcmw.js +5 -0
- package/dist/MP4Parser-es3afcmw.js.map +12 -0
- package/dist/MatroskaParser-kxysj649.js +5 -0
- package/dist/MatroskaParser-kxysj649.js.map +13 -0
- package/dist/MpegParser-b3rr7b0f.js +5 -0
- package/dist/MpegParser-b3rr7b0f.js.map +13 -0
- package/dist/MusepackParser-sgjzmq0r.js +5 -0
- package/dist/MusepackParser-sgjzmq0r.js.map +16 -0
- package/dist/OggParser-x8h54ynf.js +5 -0
- package/dist/OggParser-x8h54ynf.js.map +18 -0
- package/dist/Picker-rq015kzc.js +5 -0
- package/dist/{Picker-hfeh1g6m.js.map → Picker-rq015kzc.js.map} +2 -2
- package/dist/SessionPicker-03zyvd2f.js +5 -0
- package/dist/{SessionPicker-zyqkg4dn.js.map → SessionPicker-03zyvd2f.js.map} +2 -2
- package/dist/SkillBrowser-8s8rjv98.js +5 -0
- package/dist/{SkillBrowser-3qdp8080.js.map → SkillBrowser-8s8rjv98.js.map} +2 -2
- package/dist/WavPackParser-w515nnw2.js +5 -0
- package/dist/WavPackParser-w515nnw2.js.map +11 -0
- package/dist/WaveParser-sb0w9m20.js +5 -0
- package/dist/WaveParser-sb0w9m20.js.map +13 -0
- package/dist/WizardApp-wr1tftcr.js +5 -0
- package/dist/{WizardApp-vzpbydy3.js.map → WizardApp-wr1tftcr.js.map} +3 -3
- package/dist/agents.d.ts +19 -3
- package/dist/agents.d.ts.map +1 -1
- package/dist/channels-gx951qdp.js +31 -0
- package/dist/channels-gx951qdp.js.map +10 -0
- package/dist/channels.d.ts +26 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/client.js +11 -11
- package/dist/client.js.map +3 -3
- package/dist/config-wvjeejgd.js +24 -0
- package/dist/{config-g7za9x13.js.map → config-wvjeejgd.js.map} +2 -2
- package/dist/credential-10dn3fxj.js +19 -0
- package/dist/{credential-npr6z8c8.js.map → credential-10dn3fxj.js.map} +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/index-10009hp8.js +11 -0
- package/dist/index-10009hp8.js.map +11 -0
- package/dist/index-1xwrkwh5.js +14 -0
- package/dist/index-1xwrkwh5.js.map +50 -0
- package/dist/index-34p39yfc.js +47 -0
- package/dist/index-34p39yfc.js.map +15 -0
- package/dist/index-3y96s740.js +6 -0
- package/dist/{index-hwpvhaza.js.map → index-3y96s740.js.map} +1 -1
- package/dist/index-4ybeefmn.js +6 -0
- package/dist/index-4ybeefmn.js.map +11 -0
- package/dist/index-59z88wrb.js +6 -0
- package/dist/{index-h9mw7b9d.js.map → index-59z88wrb.js.map} +2 -2
- package/dist/index-5fwzn21m.js +6 -0
- package/dist/{index-gz9x25tz.js.map → index-5fwzn21m.js.map} +2 -2
- package/dist/index-6dvnfk8y.js +6 -0
- package/dist/index-6dvnfk8y.js.map +10 -0
- package/dist/index-6p70fnb7.js +153 -0
- package/dist/index-6p70fnb7.js.map +20 -0
- package/dist/index-6s471ydn.js +12 -0
- package/dist/{index-j55s3ehk.js.map → index-6s471ydn.js.map} +2 -2
- package/dist/index-87wcawta.js +6 -0
- package/dist/{index-0d93hyfc.js.map → index-87wcawta.js.map} +2 -2
- package/dist/index-92gfcbw0.js +6 -0
- package/dist/index-92gfcbw0.js.map +9 -0
- package/dist/index-a0h0p20f.js +991 -0
- package/dist/{index-tv4yv7d2.js.map → index-a0h0p20f.js.map} +27 -23
- package/dist/index-bamw24xc.js +6 -0
- package/dist/{index-6q4wf8e3.js.map → index-bamw24xc.js.map} +1 -1
- package/dist/index-c8ge88a9.js +12 -0
- package/dist/{index-258d8bzg.js.map → index-c8ge88a9.js.map} +4 -3
- package/dist/index-cb2q8nae.js +6 -0
- package/dist/index-cb2q8nae.js.map +13 -0
- package/dist/index-ct6bw0a6.js +6 -0
- package/dist/{index-4z7axw4r.js.map → index-ct6bw0a6.js.map} +1 -1
- package/dist/index-cz6yjxyz.js +10 -0
- package/dist/index-cz6yjxyz.js.map +42 -0
- package/dist/index-d0c5abkw.js +6 -0
- package/dist/{index-vgc3y3rm.js.map → index-d0c5abkw.js.map} +3 -3
- package/dist/index-d0vagham.js +31 -0
- package/dist/index-d0vagham.js.map +188 -0
- package/dist/index-d0zxvr99.js +90 -0
- package/dist/index-d0zxvr99.js.map +13 -0
- package/dist/{index-s9mbq7h6.js → index-d9c97ver.js} +4 -4
- package/dist/{index-s9mbq7h6.js.map → index-d9c97ver.js.map} +1 -1
- package/dist/index-e508e0vt.js +6 -0
- package/dist/{index-tf71ap9v.js.map → index-e508e0vt.js.map} +1 -1
- package/dist/index-esq0knqx.js +6 -0
- package/dist/index-esq0knqx.js.map +10 -0
- package/dist/index-featyhps.js +6 -0
- package/dist/index-featyhps.js.map +10 -0
- package/dist/index-fnq44zdt.js +45 -0
- package/dist/index-fnq44zdt.js.map +74 -0
- package/dist/index-gmn80dwc.js +7 -0
- package/dist/{index-02dn6m2j.js.map → index-gmn80dwc.js.map} +2 -2
- package/dist/index-gwhx69qs.js +66 -0
- package/dist/index-gwhx69qs.js.map +12 -0
- package/dist/index-kjgzhf3w.js +9 -0
- package/dist/{index-6p999cx4.js.map → index-kjgzhf3w.js.map} +4 -6
- package/dist/index-m68cd91a.js +12 -0
- package/dist/index-m68cd91a.js.map +23 -0
- package/dist/{index-3g3ny01d.js → index-mhmgw54j.js} +4 -4
- package/dist/{index-3g3ny01d.js.map → index-mhmgw54j.js.map} +1 -1
- package/dist/{index-gme2egyq.js → index-qm612hwa.js} +4 -4
- package/dist/{index-gme2egyq.js.map → index-qm612hwa.js.map} +1 -1
- package/dist/{index-j7gyr5nx.js → index-qwntpbwe.js} +7 -7
- package/dist/{index-j7gyr5nx.js.map → index-qwntpbwe.js.map} +1 -1
- package/dist/index-qx3xdk4x.js +6 -0
- package/dist/{index-d4x6yvqh.js.map → index-qx3xdk4x.js.map} +3 -4
- package/dist/{index-4cf6v9nb.js → index-rh0meegk.js} +4 -4
- package/dist/{index-4cf6v9nb.js.map → index-rh0meegk.js.map} +1 -1
- package/dist/index-ryb159ff.js +9 -0
- package/dist/{index-ff514z3y.js.map → index-ryb159ff.js.map} +3 -5
- package/dist/{index-ammv5st7.js → index-s6zfpyqa.js} +6 -6
- package/dist/{index-ammv5st7.js.map → index-s6zfpyqa.js.map} +1 -1
- package/dist/index-s9va2kmc.js +429 -0
- package/dist/index-s9va2kmc.js.map +11 -0
- package/dist/index-v5dmsgpx.js +7 -0
- package/dist/index-v5dmsgpx.js.map +11 -0
- package/dist/index-vaj3mn3a.js +6 -0
- package/dist/index-vaj3mn3a.js.map +14 -0
- package/dist/index-vy0rbzws.js +6 -0
- package/dist/{index-fex44816.js.map → index-vy0rbzws.js.map} +2 -2
- package/dist/index-w0s77wfx.js +6 -0
- package/dist/{index-v8e92nfw.js.map → index-w0s77wfx.js.map} +1 -1
- package/dist/index-wx1jzjzr.js +6 -0
- package/dist/{index-qdbq8crg.js.map → index-wx1jzjzr.js.map} +2 -2
- package/dist/index-xbn26c8g.js +126 -0
- package/dist/index-xbn26c8g.js.map +14 -0
- package/dist/index-ytvwyp6k.js +6 -0
- package/dist/{index-9r0wyj6w.js.map → index-ytvwyp6k.js.map} +2 -2
- package/dist/{index-cqqb6gaq.js → index-yvnwpxbb.js} +5 -5
- package/dist/{index-cqqb6gaq.js.map → index-yvnwpxbb.js.map} +1 -1
- package/dist/index.js +379 -448
- package/dist/index.js.map +26 -28
- package/dist/init.d.ts.map +1 -1
- package/dist/lib/agent-secrets.d.ts +38 -0
- package/dist/lib/agent-secrets.d.ts.map +1 -0
- package/dist/lib/agent-template.d.ts +54 -0
- package/dist/lib/agent-template.d.ts.map +1 -0
- package/dist/lib/channel-actions.d.ts +103 -0
- package/dist/lib/channel-actions.d.ts.map +1 -0
- package/dist/lib/chat-frame.d.ts +12 -1
- package/dist/lib/chat-frame.d.ts.map +1 -1
- package/dist/lib/commands.d.ts +13 -0
- package/dist/lib/commands.d.ts.map +1 -1
- package/dist/lib/const.d.ts +1 -1
- package/dist/lib/daemon-plan.d.ts.map +1 -1
- package/dist/lib/help.d.ts.map +1 -1
- package/dist/lib/host-actions.d.ts +121 -0
- package/dist/lib/host-actions.d.ts.map +1 -0
- package/dist/lib/init-flow.d.ts +32 -0
- package/dist/lib/init-flow.d.ts.map +1 -1
- package/dist/lib/init-whatsapp.d.ts +52 -0
- package/dist/lib/init-whatsapp.d.ts.map +1 -0
- package/dist/lib/plugin-install.d.ts +120 -0
- package/dist/lib/plugin-install.d.ts.map +1 -0
- package/dist/lib/providers.d.ts.map +1 -1
- package/dist/lib/provision.d.ts +13 -0
- package/dist/lib/provision.d.ts.map +1 -1
- package/dist/lib/readme-table.d.ts +15 -0
- package/dist/lib/readme-table.d.ts.map +1 -0
- package/dist/lib/sandbox.d.ts +17 -0
- package/dist/lib/sandbox.d.ts.map +1 -1
- package/dist/lib/schema.d.ts +34 -1
- package/dist/lib/schema.d.ts.map +1 -1
- package/dist/lib/subcommand.d.ts.map +1 -1
- package/dist/lib/web-url.d.ts +15 -0
- package/dist/lib/web-url.d.ts.map +1 -0
- package/dist/lib/wizard.d.ts.map +1 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/plugins.d.ts +27 -8
- package/dist/plugins.d.ts.map +1 -1
- package/dist/restart.d.ts +21 -0
- package/dist/restart.d.ts.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/schedules.d.ts.map +1 -1
- package/dist/serve.d.ts.map +1 -1
- package/dist/sessions.d.ts.map +1 -1
- package/dist/skills.d.ts.map +1 -1
- package/dist/status.d.ts +16 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/web-61cjhpv2.js +14 -0
- package/dist/{web-vkb16r62.js.map → web-61cjhpv2.js.map} +3 -3
- package/dist/web.d.ts +2 -13
- package/dist/web.d.ts.map +1 -1
- package/dist/workspace.d.ts.map +1 -1
- package/dist/wrapper-9msjh1xg.js +5 -0
- package/dist/wrapper-9msjh1xg.js.map +9 -0
- package/package.json +6 -3
- package/dist/App-b1yrwrcq.js +0 -11
- package/dist/ConfigEditor-n8hdw6r7.js +0 -6
- package/dist/KeyProbe-9jjeze5r.js +0 -5
- package/dist/Picker-hfeh1g6m.js +0 -5
- package/dist/SessionPicker-zyqkg4dn.js +0 -5
- package/dist/SkillBrowser-3qdp8080.js +0 -5
- package/dist/WizardApp-vzpbydy3.js +0 -5
- package/dist/config-g7za9x13.js +0 -24
- package/dist/credential-npr6z8c8.js +0 -19
- package/dist/index-02dn6m2j.js +0 -7
- package/dist/index-0d93hyfc.js +0 -6
- package/dist/index-1c5113t4.js +0 -66
- package/dist/index-1c5113t4.js.map +0 -12
- package/dist/index-258d8bzg.js +0 -12
- package/dist/index-4z7axw4r.js +0 -6
- package/dist/index-6p999cx4.js +0 -9
- package/dist/index-6q4wf8e3.js +0 -6
- package/dist/index-9r0wyj6w.js +0 -6
- package/dist/index-d4x6yvqh.js +0 -6
- package/dist/index-fecm8xe7.js +0 -77
- package/dist/index-fecm8xe7.js.map +0 -12
- package/dist/index-fex44816.js +0 -6
- package/dist/index-ff514z3y.js +0 -14
- package/dist/index-gz9x25tz.js +0 -6
- package/dist/index-h9mw7b9d.js +0 -6
- package/dist/index-hwpvhaza.js +0 -6
- package/dist/index-j55s3ehk.js +0 -12
- package/dist/index-mtn0g9vc.js +0 -7
- package/dist/index-mtn0g9vc.js.map +0 -11
- package/dist/index-qdbq8crg.js +0 -6
- package/dist/index-tf71ap9v.js +0 -6
- package/dist/index-ttwyrdjs.js +0 -427
- package/dist/index-ttwyrdjs.js.map +0 -11
- package/dist/index-tv4yv7d2.js +0 -903
- package/dist/index-ty24n0jh.js +0 -167
- package/dist/index-ty24n0jh.js.map +0 -19
- package/dist/index-v8e92nfw.js +0 -6
- package/dist/index-vgc3y3rm.js +0 -6
- package/dist/index-whaw4b18.js +0 -6
- package/dist/index-whaw4b18.js.map +0 -10
- package/dist/web-vkb16r62.js +0 -14
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../server/dist/index.js", "../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/locales/en.js", "../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/external.js", "../src/lib/web-url.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"// src/approvals.ts\nfunction createApprovalRegistry(options = {}) {\n const now = options.now ?? (() => new Date);\n const waiting = new Map;\n const approver = (request) => new Promise((resolve) => {\n const entry = {\n pending: {\n approvalId: request.approvalId,\n agentId: request.agentId,\n slug: request.slug,\n callId: request.callId,\n match: request.match,\n mutating: request.mutating,\n reason: request.reason,\n requestedAt: now().toISOString()\n },\n settle: (granted) => {\n waiting.delete(request.approvalId);\n resolve(granted);\n }\n };\n waiting.set(request.approvalId, entry);\n request.signal.addEventListener(\"abort\", () => entry.settle(false), { once: true });\n });\n return {\n approver,\n pending: (agentId) => [...waiting.values()].map((entry) => entry.pending).filter((entry) => entry.agentId === agentId).sort((a, b) => a.requestedAt.localeCompare(b.requestedAt)),\n resolve: (approvalId, granted) => {\n const entry = waiting.get(approvalId);\n if (entry === undefined)\n return false;\n entry.settle(granted);\n return true;\n },\n get size() {\n return waiting.size;\n }\n };\n}\n// src/handler.ts\nimport { readFile } from \"node:fs/promises\";\nimport {\n EVENT_TYPES,\n editManifest,\n entryPhase,\n HarnessError,\n isHarnessError,\n isPhased,\n keyFingerprint as keyFingerprint2,\n keyLabelProblem,\n MAX_KEY_LABEL,\n manifestValueAt,\n nearest as nearest2,\n newKeyId,\n newKeySecret,\n newRunId,\n newTurnId,\n newWebhookSecret,\n PERSON_SETTABLE_PATHS,\n parseSettingValue,\n phasesFor,\n prepareScheduleWrite,\n SENDER_KINDS as SENDER_KINDS2,\n SETTINGS,\n scheduleSessionKey,\n settingByPath,\n USAGE_GROUPS,\n VERSION as VERSION2,\n webhookDeliverable\n} from \"@dispach/core\";\n\n// src/auth.ts\nimport { keyFingerprint } from \"@dispach/core\";\n\n// src/respond.ts\nfunction fail(error, status, extraHeaders = {}) {\n return new Response(JSON.stringify({ error }), {\n status,\n headers: { \"content-type\": \"application/json; charset=utf-8\", ...extraHeaders }\n });\n}\nfunction unauthorized() {\n return fail({\n code: \"unauthorized\",\n message: \"Missing or invalid bearer token.\",\n hint: \"Send Authorization: Bearer <token>, where the token is either the value of the variable named by server.tokenEnv or an operator key from POST /v1/keys. A revoked key, an expired one and a wrong one answer the same way on purpose.\"\n }, 401);\n}\nfunction claimSpent() {\n return fail({\n code: \"claim_spent\",\n message: \"That claim has already been exchanged.\",\n hint: \"A claim is good for one key. Use the key it minted; if it is lost, restart with --claim to print a new one — a claim lives in the process rather than the database, so it never outlives the boot that printed it.\"\n }, 401);\n}\nfunction forbidden(capability, what) {\n return fail({\n code: \"capability_required\",\n message: `This credential cannot ${what}.`,\n hint: `The key is scoped, and \"${capability}\" is not among its capabilities. GET /v1/keys shows what each key may do; mint another with POST /v1/keys, or use the server token. An unscoped key has all four.`,\n field: \"scope.can\"\n }, 403);\n}\nfunction timingSafe(a, b) {\n if (a.length !== b.length)\n return false;\n let diff = 0;\n for (let i = 0;i < a.length; i += 1)\n diff |= a.charCodeAt(i) ^ b.charCodeAt(i);\n return diff === 0;\n}\n\n// src/auth.ts\nfunction presentedToken(request) {\n const header = request.headers.get(\"authorization\") ?? \"\";\n return header.startsWith(\"Bearer \") ? header.slice(7) : \"\";\n}\nasync function authorise(input) {\n const presented = presentedToken(input.request);\n if (input.expected !== undefined && timingSafe(presented, input.expected)) {\n return { kind: \"token\" };\n }\n if (presented !== \"\") {\n const record = await input.keys.findLive(await keyFingerprint(presented), new Date(input.at).toISOString());\n if (record !== undefined) {\n await input.keys.touch(record.keyId, new Date(input.at).toISOString());\n return {\n kind: \"key\",\n keyId: record.keyId,\n ...record.scope === undefined ? {} : { scope: record.scope }\n };\n }\n if (input.claim !== undefined && timingSafe(presented, input.claim.token)) {\n if (input.request.method !== \"POST\" || input.pathname !== \"/v1/keys\")\n return unauthorized();\n if (!input.claim.live())\n return claimSpent();\n return { kind: \"claim\" };\n }\n }\n return unauthorized();\n}\nvar PROTOCOL = \"dispach.bearer\";\nfunction bearerFromProtocols(request) {\n const raw = request.headers.get(\"sec-websocket-protocol\");\n if (raw === null)\n return;\n const offered = raw.split(\",\").map((entry) => entry.trim());\n const at = offered.indexOf(PROTOCOL);\n return at === -1 ? undefined : offered[at + 1] ?? \"\";\n}\nfunction withBearerHeader(request, bearer) {\n const headers = new Headers(request.headers);\n headers.set(\"authorization\", `Bearer ${bearer}`);\n return new Request(request.url, { method: request.method, headers });\n}\n\n// src/openapi.ts\nimport { VERSION } from \"@dispach/core\";\nimport { z as z2 } from \"zod\";\n\n// src/wire-schemas.ts\nimport { nearest, SENDER_KINDS } from \"@dispach/core\";\nimport { z } from \"zod\";\nfunction refuse(schema, refusal) {\n return schema.meta({ ...refusal });\n}\nfunction annotate(schema, description) {\n return schema.meta({ description });\n}\nvar SenderSchema = z.object({\n id: refuse(z.string().trim().min(1), {\n code: \"sender_invalid\",\n hint: 'Send { \"from\": { \"id\": \"agent:ops-bot\", \"kind\": \"agent\" } }, or omit it entirely for a turn the token-holder is sending itself.',\n description: \"Stable identifier for the sender. Appears on the turn row and in events.\"\n }),\n kind: refuse(z.enum(SENDER_KINDS, {\n error: (issue) => {\n const got = typeof issue.input === \"string\" ? issue.input : undefined;\n const guess = got === undefined ? undefined : nearest(got, SENDER_KINDS);\n return `from.kind must be one of: ${SENDER_KINDS.join(\", \")}.${guess === undefined ? \"\" : ` Did you mean \"${guess}\"?`}`;\n }\n }), {\n code: \"sender_invalid\",\n hint: 'This field decides the trust boundary — \"agent\" fences the message and blocks mutating tools for the turn, \"user\" does not — so there is no default and an unknown value is refused rather than guessed at. A turn the token-holder is sending itself omits \"from\".',\n description: 'The trust boundary. \"agent\" fences the text as data and blocks mutating tools for the whole turn.'\n }),\n name: refuse(z.string().optional(), {\n code: \"sender_invalid\",\n hint: \"A display name, shown beside the sender id. Omit it rather than sending an empty string.\",\n description: \"Human-readable name for the sender.\"\n })\n}).meta({\n description: \"Attribution for a turn somebody other than the token-holder is sending. Omit for your own.\"\n});\nvar DeliverSchema = refuse(z.union([z.literal(\"none\"), z.object({ channel: z.string().min(1), to: z.string().min(1) })]), {\n code: \"deliver_invalid\",\n hint: 'A bare channel id is not enough on an API turn: the request has no originating conversation, so there is no recipient to infer. Send { \"channel\": \"tg\", \"to\": \"12345\" }, or \"none\" to read the reply from the event stream.',\n description: 'Where the reply goes. \"none\" leaves it on the event stream and in the store.'\n});\nvar MessageBody = z.object({\n text: refuse(z.string().trim().min(1), {\n code: \"message_text_required\",\n hint: 'Send { \"text\": \"...\" }. An empty turn would be billed for a full prompt and produce nothing.',\n description: \"What to say to the agent.\"\n }),\n sessionKey: annotate(z.string().min(1).optional(), \"Which conversation this belongs to. Defaults to `api:default`.\"),\n deliver: DeliverSchema.optional(),\n from: SenderSchema.optional(),\n stream: annotate(z.boolean().optional(), \"Stream the turn's events inline as SSE rather than returning a handle.\"),\n chunks: annotate(z.boolean().optional(), \"Include per-token `model.chunk` frames. Off by default — the reader decides.\")\n});\nvar ApprovalBody = z.object({\n granted: refuse(z.boolean(), {\n code: \"approval_decision_required\",\n hint: 'Send { \"granted\": true } or { \"granted\": false }. There is no default: one direction would deny a call over a typo and the other would grant one, and neither is a decision anybody made.',\n description: \"Whether the blocked tool call may proceed.\"\n })\n});\nvar KeyScopeBody = z.object({\n agents: z.array(z.string().min(1)).optional().meta({\n code: \"key_scope_agents_invalid\",\n hint: 'Send { \"agents\": [\"milo\"] } — a list of agent ids. Omit it for a key that reaches every agent. An id naming no agent on this server is reported rather than silently matching nothing.',\n description: \"Agent ids this key may reach. Absent means all of them.\"\n }),\n sessions: z.string().min(1).optional().meta({\n code: \"key_scope_sessions_invalid\",\n hint: 'Send { \"sessions\": \"team_42:\" } — a session-key prefix, with an optional trailing \"*\". A prefix rather than a list, because the conversations this key will cover do not exist yet when it is minted.',\n description: \"Session-key prefix. Absent means every session.\"\n }),\n can: z.array(z.enum([\"read\", \"chat\", \"write\", \"admin\"])).optional().meta({\n code: \"key_scope_can_invalid\",\n hint: 'Send { \"can\": [\"chat\", \"read\"] }. The four are read (every GET), chat (send a message, answer an approval, stop a turn), write (schedules, phase, clearing a session) and admin (keys, provisioning, start/stop/reload). Absent means all four; an empty array means none, and is honoured as written.',\n description: \"Capabilities this key may exercise. Absent means all four.\"\n }),\n expiresIn: z.number().int().positive().optional().meta({\n code: \"key_scope_expires_invalid\",\n hint: 'Send { \"expiresIn\": 3600 } — whole seconds from now, as a number. Relative rather than an absolute instant, because that would need the caller and this server to agree about the clock; the response reports the absolute expiresAt this server computed.',\n description: \"Seconds until this key stops authenticating. Absent means never.\"\n })\n});\nvar KeyBody = z.object({\n label: refuse(z.string(), {\n code: \"key_label_required\",\n hint: 'Send { \"label\": \"my browser\" }. A label is required rather than defaulted because it is the only thing distinguishing two credentials in a listing, and \"key 2\" is a name nobody can act on when deciding which to revoke.',\n description: \"How this credential is shown in a listing. Required; see `keyLabelProblem`.\"\n }),\n scope: KeyScopeBody.optional().meta({\n code: \"key_scope_invalid\",\n hint: 'Send { \"scope\": { \"agents\": [\"milo\"], \"can\": [\"chat\"] } }, or omit it entirely for a key that reaches everything — which is what every key minted before scopes existed does.',\n description: \"Opt-in narrowing. Absent is an unscoped key.\"\n })\n});\nvar PhaseBody = z.object({\n phase: refuse(z.string().min(1), {\n code: \"phase_invalid\",\n hint: \"Send the name of a phase this agent's manifest declares. `GET /v1/agents/:id` lists them.\",\n description: \"The phase to move this session into.\"\n })\n});\nvar StopBody = z.object({\n reason: refuse(z.string().optional(), {\n code: \"agent_stop_invalid\",\n hint: \"A short note, recorded on the row and shown wherever the agent is reported as off.\",\n description: \"Why, for whoever reads the listing later.\"\n })\n});\nvar ConfigBody = z.object({\n path: refuse(z.string().min(1), {\n code: \"config_path_unknown\",\n hint: \"GET /v1/agents/:id/config lists every field this surface may change, with what each one does.\",\n description: \"A dotted path, exactly as it appears in the manifest — `tools.pinned`, `model.main.id`.\"\n }),\n value: refuse(z.string(), {\n code: \"config_value_unreadable\",\n hint: 'Text, the way it is typed at a terminal: a bare word, a number, true or false, a list as [\"a\", \"b\"], or a map as {k: v}. Quote anything containing a colon or a \"#\".',\n description: \"The new value, as text. Read by the same parser the `config` command uses.\"\n }),\n confirm: annotate(z.boolean().optional(), \"Required only for a field whose own row carries a `confirm` sentence. Absent is not consent.\")\n});\nvar ChannelPatchBody = z.object({\n enabled: annotate(z.boolean().optional(), \"Switch the channel on or off. It takes effect at the agent's next start, because a channel is constructed at boot.\"),\n credential: refuse(z.string().min(1).optional(), {\n code: \"channel_credential_unreadable\",\n hint: \"The value goes into the .env beside the manifest at 0600, under the variable that channel's own entry names. Send a non-empty string; an empty one fails the load exactly as a missing variable does.\",\n description: \"The channel's credential — a Telegram bot token. Never returned by any route; only whether it is set.\"\n })\n});\nvar ProvisionBody = z.object({\n answers: refuse(z.record(z.string(), refuse(z.string(), {\n code: \"provision_answer_invalid\",\n hint: \"Answers arrive as strings from the terminal and from here, and are validated per step. Send the value as a string — including a boolean-looking choice, whose values are named in GET /v1/provision.\",\n description: \"One answer. Always text, whatever the step's type looks like.\"\n })).optional(), {\n code: \"provision_answers_required\",\n hint: 'Send { \"answers\": { \"name\": \"milo\", … } }. Every step you leave out takes its default, exactly as `init --yes` does with flags; GET /v1/provision lists them.',\n description: \"A subset of the wizard's steps, as strings. `GET /v1/provision` lists every step with its prompt, default and choices. Send this or `template`, not both.\"\n }),\n template: refuse(z.string().min(1).optional(), {\n code: \"provision_template_invalid\",\n hint: \"Send the template's name as a string. GET /v1/templates lists what this server has.\",\n description: \"Create the agent from a template in this server's sandbox instead of from answers. Needs `name`; takes `vars`.\"\n }),\n name: refuse(z.string().optional(), {\n code: \"provision_name_required\",\n hint: 'Send { \"template\": \"…\", \"name\": \"Acme store\" }. The id every route keys on is derived from it.',\n description: \"The new agent's name, with `template`. Its slug becomes the id; the template sees both as {{agent.name}} and {{agent.id}}.\"\n }),\n vars: refuse(z.record(z.string(), refuse(z.string(), {\n code: \"template_value_invalid\",\n hint: \"Template values are one line of text, sent as strings.\",\n description: \"One variable's value.\"\n })).optional(), {\n code: \"template_value_invalid\",\n hint: `Send { \"vars\": { \"store\": \"Acme\" } }, every value a string. GET /v1/templates lists each template's variables.`,\n description: \"Values for the template's declared variables. A secret variable's value goes to the agent's .env and is never returned.\"\n })\n});\nvar WebhookBody = z.object({\n url: refuse(z.string().min(1), {\n code: \"webhook_url_invalid\",\n hint: \"Send an absolute https:// URL. A receiver on a private network needs the operator to allow it in WEBHOOK_ALLOW.\",\n description: \"Where deliveries are POSTed. Checked against every address it resolves to, at subscribe and at every send.\"\n }),\n types: refuse(z.array(z.string()).min(1), {\n code: \"webhook_types_required\",\n hint: 'Send { \"types\": [\"turn.end\", \"approval.requested\"] }. Any event type except model.chunk; the wire spec lists them.',\n description: \"The event types to deliver. `model.chunk` is not deliverable.\"\n }),\n agents: refuse(z.array(z.string()).min(1).optional(), {\n code: \"webhook_scope_invalid\",\n hint: \"Send agent ids this credential can reach, or leave agents out to hear every agent it can reach.\",\n description: \"Narrow the subscription to these agents. It can never hear more than the creating credential reaches.\"\n })\n});\nvar SecretsBody = z.object({\n values: refuse(z.record(z.string(), refuse(z.string(), {\n code: \"secret_value_invalid\",\n hint: \"Send each value as a non-empty string.\",\n description: \"One variable's value. Written to the agent's .env at 0600; never returned.\"\n })), {\n code: \"secrets_values_required\",\n hint: 'Send { \"values\": { \"MODEL_API_KEY\": \"…\" } }. GET /v1/agents/:id/secrets lists the variables this agent reads.',\n description: \"Variables to write into the agent's .env, keyed by name. Only names the agent's manifest reads are accepted.\"\n })\n});\nfunction parseBody(schema, value) {\n const result = schema.safeParse(value ?? {});\n if (result.success)\n return { ok: true, value: result.data };\n const issue = result.error.issues[0];\n const path = (issue?.path ?? []).filter((part) => typeof part === \"string\");\n const meta = metaAt(schema, path);\n const generic = {\n code: \"request_body_invalid\",\n message: path.length === 0 ? issue?.message ?? \"The request body is invalid.\" : `${path.join(\".\")}: ${issue?.message}`,\n hint: \"The field above is the one to fix. GET /v1/openapi.json describes every body this server accepts, including the error code each field produces.\"\n };\n return {\n ok: false,\n error: {\n ...generic,\n ...meta?.code === undefined ? {} : { code: meta.code },\n ...meta?.hint === undefined ? {} : { hint: meta.hint },\n ...path.length === 0 ? {} : { field: path.join(\".\") }\n }\n };\n}\nfunction metaAt(schema, path) {\n let current = schema;\n let best = readRefusal(schema);\n for (const key of path) {\n current = descend(current, key);\n if (current === undefined)\n break;\n best = readRefusal(current) ?? best;\n }\n return best;\n}\nfunction readRefusal(schema) {\n const meta = schema?.meta();\n if (meta?.code === undefined && meta?.hint === undefined)\n return;\n return meta;\n}\nfunction descend(schema, key) {\n const inner = unwrap(schema);\n const shape = inner?.shape;\n if (shape?.[key] !== undefined)\n return unwrap(shape[key]);\n const valueType = inner?.def?.valueType;\n return valueType === undefined ? undefined : unwrap(valueType);\n}\nfunction unwrap(schema) {\n let current = schema;\n for (let guard = 0;guard < 8 && current !== undefined; guard += 1) {\n const next = current.def?.innerType;\n if (next === undefined)\n return current;\n current = next;\n }\n return current;\n}\n\n// src/openapi.ts\nvar DOCS = {\n \"GET /v1/health\": { summary: \"Liveness, the version, and how many agents are hosted.\" },\n \"GET /v1/ready\": {\n summary: \"Whether a turn can be served yet.\",\n statuses: [{ code: 503, when: \"still starting; channels may still be connecting\" }]\n },\n \"GET /v1/activity\": {\n summary: \"Whether the process is idle, and when it must next be woken. For an external waker.\",\n statuses: [{ code: 403, when: \"the key is scoped to agents or sessions\" }]\n },\n \"GET /v1/agents\": {\n summary: \"Every agent this server knows about, hosted or switched off.\"\n },\n \"GET /v1/agents/:id\": { summary: \"One agent, with its dialect, window, counts and warnings.\" },\n \"POST /v1/agents/:id/reload\": {\n summary: \"Re-read the manifest by replacing the agent with a new instance.\",\n statuses: [\n { code: 409, when: \"a turn is running — it is not aborted to apply a change\" },\n { code: 400, when: \"a team member, which has no manifest of its own\" }\n ]\n },\n \"GET /v1/provision\": {\n summary: \"The questions creating an agent asks, and whether this server can answer them.\"\n },\n \"POST /v1/agents\": {\n summary: \"Create an agent, from answers or from a template, and adopt it into this host, live.\",\n body: ProvisionBody,\n statuses: [\n { code: 201, when: \"created; `adopted` is empty with an `error` if it is not running\" },\n { code: 403, when: \"not a loopback bind\" },\n { code: 501, when: \"this server has no provisioner\" }\n ]\n },\n \"POST /v1/webhooks\": {\n summary: \"Subscribe a URL to event types. The signing secret is returned once.\",\n body: WebhookBody,\n statuses: [\n { code: 201, when: \"created; `secret` is in this response and no other\" },\n {\n code: 400,\n when: \"a refused URL, an undeliverable type, or agents outside this key's reach\"\n }\n ]\n },\n \"GET /v1/webhooks\": {\n summary: \"The subscriptions this credential can see, with their delivery health. Never a secret.\"\n },\n \"DELETE /v1/webhooks/:webhookId\": {\n summary: \"Delete a subscription and anything it still owed.\",\n statuses: [{ code: 404, when: \"no such subscription, or one outside this key's reach\" }]\n },\n \"GET /v1/usage\": {\n summary: \"What every agent in scope cost, per model call, grouped by agent, model, day or sender.\",\n statuses: [{ code: 400, when: \"an unknown grouping or a date that does not parse\" }]\n },\n \"GET /v1/agents/:id/usage\": {\n summary: \"What this agent cost, from the meter.\",\n statuses: [{ code: 400, when: \"an unknown grouping or a date that does not parse\" }]\n },\n \"GET /v1/agents/:id/turns\": {\n summary: \"Every turn this agent has taken, newest first, across sessions, paged by `before`.\",\n statuses: [{ code: 400, when: \"`limit` or `before` is not a positive whole number\" }]\n },\n \"GET /v1/templates\": {\n summary: \"The templates an agent can be created from, and the variables each declares.\"\n },\n \"GET /v1/agents/:id/secrets\": {\n summary: \"Which variables the agent's manifest reads, and whether each is set. Never a value.\",\n statuses: [{ code: 501, when: \"this server has no credential writer\" }]\n },\n \"PUT /v1/agents/:id/secrets\": {\n summary: \"Write the agent's credentials into its .env and apply them: reload or adopt.\",\n body: SecretsBody,\n statuses: [\n { code: 200, when: \"written; `applied` says whether the agent is running on them\" },\n { code: 400, when: \"a variable the manifest does not read, or an empty value\" },\n { code: 501, when: \"this server has no credential writer\" }\n ]\n },\n \"POST /v1/agents/:id/stop\": {\n summary: \"Switch an agent off durably and drop it from this host now.\",\n body: StopBody,\n statuses: [{ code: 409, when: \"a turn is running\" }]\n },\n \"POST /v1/agents/:id/start\": {\n summary: \"Switch it back on and have this host adopt it.\",\n statuses: [{ code: 501, when: \"this server cannot look up manifests\" }]\n },\n \"POST /v1/agents/:id/messages\": {\n summary: \"Start a turn. Returns once accepted; the turn runs detached.\",\n body: MessageBody,\n statuses: [\n { code: 202, when: \"accepted\" },\n {\n code: 429,\n when: \"over limits.maxConcurrentTurns or limits.tokens; nothing recorded\"\n }\n ]\n },\n \"POST /v1/agents/:id/turns/:turnId/stop\": {\n summary: \"Cooperatively stop a turn this API started.\",\n statuses: [{ code: 409, when: \"no cancel handle — a channel or schedule started it\" }]\n },\n \"GET /v1/agents/:id/turns/:turnId/stream\": {\n summary: \"One turn's events as SSE, replayed from the start and then live.\",\n query: [\n { name: \"chunks\", about: \"Include per-token frames. Off by default.\" },\n { name: \"types\", about: \"Narrow to these event types, comma-separated.\" }\n ],\n statuses: [{ code: 200, when: \"an event stream; see the event table in the wire spec\" }]\n },\n \"GET /v1/events\": {\n summary: \"Every event this process emits, as SSE. The firehose.\",\n query: [\n { name: \"agentId\", about: \"Narrow to one agent.\" },\n { name: \"sessionKey\", about: \"Narrow to one conversation.\" },\n { name: \"chunks\", about: \"Include per-token frames. Off by default.\" },\n { name: \"types\", about: \"Narrow to these event types, comma-separated.\" }\n ],\n statuses: [{ code: 200, when: \"an event stream; see the event table in the wire spec\" }]\n },\n \"GET /v1/agents/:id/approvals\": { summary: \"Questions waiting on a person, oldest first.\" },\n \"POST /v1/agents/:id/approvals/:approvalId\": {\n summary: \"Answer one blocked tool call.\",\n body: ApprovalBody\n },\n \"POST /v1/keys\": {\n summary: \"Mint an operator key. The secret is returned once and never again.\",\n body: KeyBody,\n statuses: [{ code: 201, when: \"minted\" }]\n },\n \"GET /v1/keys\": { summary: \"Every key, live and revoked. Never a secret.\" },\n \"DELETE /v1/keys/:keyId\": { summary: \"Revoke a key. A soft delete; the row survives.\" },\n \"GET /v1/agents/:id/turns/:turnId\": { summary: \"One turn's stored row.\" },\n \"GET /v1/agents/:id/sessions\": { summary: \"Conversations, most recently active first.\" },\n \"GET /v1/agents/:id/sessions/:key\": { summary: \"One conversation's summary.\" },\n \"GET /v1/agents/:id/sessions/:key/messages\": {\n summary: \"A page of a conversation's messages.\",\n query: [\n { name: \"limit\", about: \"How many to return.\" },\n { name: \"before\", about: \"Page backwards from this message id.\" }\n ]\n },\n \"DELETE /v1/agents/:id/sessions/:key\": {\n summary: \"Drop a conversation's history, turns and derived index.\"\n },\n \"POST /v1/agents/:id/sessions/:key/phase\": {\n summary: \"Move a session into a declared phase.\",\n body: PhaseBody\n },\n \"GET /v1/agents/:id/config\": {\n summary: \"Every manifest field this surface may set, what it does, and its current value.\"\n },\n \"PATCH /v1/agents/:id/config\": {\n summary: \"Set one manifest field, then replace the agent so it takes effect.\",\n statuses: [\n { code: 409, when: \"the field carries a confirm sentence and `confirm` was not true\" },\n { code: 409, when: \"the agent came from an object, so there is no manifest to edit\" },\n { code: 400, when: \"the path is not settable here, or the result would not validate\" }\n ]\n },\n \"PATCH /v1/agents/:id/channels/:channelId\": {\n summary: \"Connect or disconnect a channel, and set its credential.\",\n statuses: [\n {\n code: 400,\n when: \"neither `enabled` nor `credential` was sent, or the channel is unknown\"\n },\n { code: 409, when: \"the agent came from an object, so there is no manifest to edit\" },\n { code: 501, when: \"the host supplied no channel actions\" }\n ]\n },\n \"POST /v1/agents/:id/channels/:channelId/unpair\": {\n summary: \"Forget a channel's stored pairing, so the next start offers a new code.\",\n statuses: [\n { code: 404, when: \"this agent has no such channel\" },\n { code: 409, when: \"the channel stores no pairing — a typed credential is a PATCH\" }\n ]\n },\n \"GET /v1/agents/:id/schedules\": { summary: \"Every schedule, from the store.\" },\n \"POST /v1/agents/:id/schedules\": {\n summary: \"Create a schedule. Validated by the manifest's own schedule rules.\",\n statuses: [{ code: 201, when: \"created\" }]\n },\n \"GET /v1/agents/:id/schedules/:sid\": { summary: \"One schedule's row.\" },\n \"PATCH /v1/agents/:id/schedules/:sid\": {\n summary: \"Replace a schedule the API created.\",\n statuses: [\n { code: 409, when: \"the manifest declares it, so reconciliation would undo the write\" }\n ]\n },\n \"DELETE /v1/agents/:id/schedules/:sid\": {\n summary: \"Delete a schedule the API created.\",\n statuses: [\n { code: 409, when: \"the manifest declares it, so the next boot would re-create it\" }\n ]\n },\n \"POST /v1/agents/:id/schedules/:sid/run\": {\n summary: \"Fire a schedule now, out of band.\",\n statuses: [{ code: 429, when: \"over a governor limit; nothing recorded\" }]\n },\n \"GET /v1/agents/:id/tools\": { summary: \"The resolved catalogue, with trust and phases.\" },\n \"GET /v1/agents/:id/skills\": { summary: \"What the skills index holds.\" },\n \"GET /v1/agents/:id/context\": {\n summary: \"The prompt the next turn would be given, without running one.\",\n query: [\n { name: \"sessionKey\", about: \"Which conversation to assemble for.\" },\n { name: \"input\", about: \"Pretend this is the next message.\" }\n ]\n },\n \"POST /v1/channels/:channelId/webhook/:agentId\": {\n summary: \"A channel provider's webhook. Open by design; the provider authenticates itself.\"\n },\n \"GET /v1/openapi.json\": { summary: \"This document.\" },\n \"GET /docs\": { summary: \"A browser reference over this document.\" }\n};\nfunction isApiPath(pattern) {\n return pattern.startsWith(\"/v1/\") || pattern === \"/docs\";\n}\nfunction openapiDocument(input) {\n const paths = {};\n for (const route of input.routes) {\n if (!isApiPath(route.pattern))\n continue;\n const doc = DOCS[`${route.method} ${route.pattern}`];\n if (doc === undefined)\n continue;\n const openapiPath = route.pattern.replace(/:([A-Za-z0-9_]+)/g, \"{$1}\");\n const params = [...route.pattern.matchAll(/:([A-Za-z0-9_]+)/g)].map((match) => ({\n name: match[1],\n in: \"path\",\n required: true,\n schema: { type: \"string\" }\n }));\n const query = (doc.query ?? []).map((entry) => ({\n name: entry.name,\n in: \"query\",\n required: false,\n description: entry.about,\n schema: { type: \"string\" }\n }));\n const responses = {};\n for (const status of doc.statuses ?? []) {\n responses[String(status.code)] = { description: status.when };\n }\n if (responses[\"200\"] === undefined && responses[\"201\"] === undefined) {\n if (responses[\"202\"] === undefined)\n responses[\"200\"] = { description: \"OK\" };\n }\n responses[\"401\"] = { description: \"No credential, or one this server does not accept.\" };\n if (route.pattern.includes(\":id\")) {\n responses[\"404\"] = { description: \"No such agent, or it is switched off.\" };\n }\n paths[openapiPath] ??= {};\n const operation = {\n summary: doc.summary,\n ...params.length + query.length === 0 ? {} : { parameters: [...params, ...query] },\n responses\n };\n if (doc.body !== undefined) {\n operation.requestBody = {\n required: true,\n content: {\n \"application/json\": {\n schema: z2.toJSONSchema(doc.body, {\n target: \"draft-2020-12\",\n io: \"input\"\n })\n }\n }\n };\n }\n paths[openapiPath][route.method.toLowerCase()] = operation;\n }\n return {\n openapi: \"3.1.0\",\n info: {\n title: \"Dispach agent server\",\n version: VERSION,\n description: \"Generated from the router table and the request schemas — see openapi.ts. The binding contract is docs/04-SPEC-WIRE.md, which is checked against the code; @dispach/client's types are the response reference.\"\n },\n ...input.serverUrl === undefined ? {} : { servers: [{ url: input.serverUrl }] },\n components: {\n securitySchemes: {\n bearer: {\n type: \"http\",\n scheme: \"bearer\",\n description: \"An operator key or the configured token.\"\n }\n },\n schemas: {\n Error: {\n type: \"object\",\n description: \"Every failure has this shape. `hint` is never absent — it is the part that says what to do.\",\n properties: {\n error: {\n type: \"object\",\n required: [\"code\", \"message\", \"hint\"],\n properties: {\n code: { type: \"string\" },\n message: { type: \"string\" },\n hint: { type: \"string\" },\n field: { type: \"string\" }\n }\n }\n }\n }\n }\n },\n security: [{ bearer: [] }],\n paths\n };\n}\n\n// src/origin.ts\nvar LOOPBACK = new Set([\"127.0.0.1\", \"::1\", \"localhost\", \"[::1]\"]);\nfunction isLoopback(host) {\n return LOOPBACK.has(host.toLowerCase());\n}\nfunction hostOf(value) {\n const trimmed = value.trim();\n if (trimmed === \"\" || trimmed.toLowerCase() === \"null\")\n return;\n try {\n const url = new URL(trimmed.includes(\"://\") ? trimmed : `http://${trimmed}`);\n return url.hostname.toLowerCase().replace(/^\\[|\\]$/g, \"\");\n } catch {\n return;\n }\n}\nfunction loopbackName(host) {\n return isLoopback(host) || /^127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/.test(host);\n}\nfunction originProblem(request, policy) {\n const strict = isLoopback(policy.host);\n const rawHost = request.headers.get(\"host\");\n const rawOrigin = request.headers.get(\"origin\");\n if (strict) {\n const host = rawHost === null ? undefined : hostOf(rawHost);\n const named = policy.allowedHosts ?? [];\n const hostOk = host !== undefined && (loopbackName(host) || named.some((entry) => hostOf(entry) === host));\n if (!hostOk) {\n return {\n code: \"host_not_allowed\",\n message: `This server does not answer to the host ${rawHost ?? \"(absent)\"}.`,\n hint: \"It is bound to loopback, so only a loopback name or address can legitimately reach it — a request addressed to any other name arrived through DNS pointed at this machine, which is how a web page reaches a local server it was never given access to. Add the name to server.allowedHosts if a proxy on this machine needs it.\",\n field: \"server.allowedHosts\"\n };\n }\n }\n if (rawOrigin === null)\n return;\n const origin = hostOf(rawOrigin);\n if (origin !== undefined) {\n if (loopbackName(origin))\n return;\n if ((policy.allowedOrigins ?? []).some((entry) => hostOf(entry) === origin))\n return;\n if (!strict && rawHost !== null && hostOf(rawHost) === origin)\n return;\n }\n return {\n code: \"origin_not_allowed\",\n message: `Refusing a request from the origin ${rawOrigin}.`,\n hint: strict ? \"This server is bound to loopback, so a page served from anywhere else has no business calling it. Add the origin to server.allowedOrigins if you meant to allow it.\" : \"Only a page served from this server's own host may call it. Add the origin to server.allowedOrigins if you meant to allow it — there is no wildcard, deliberately.\",\n field: \"server.allowedOrigins\"\n };\n}\nfunction corsHeaders(request, policy) {\n const rawOrigin = request.headers.get(\"origin\");\n if (rawOrigin === null)\n return {};\n if (originProblem(request, policy) !== undefined)\n return {};\n return {\n \"access-control-allow-origin\": rawOrigin,\n vary: \"Origin\"\n };\n}\nfunction preflightHeaders(request, allow) {\n const asked = request.headers.get(\"access-control-request-headers\");\n return {\n \"access-control-allow-methods\": allow.join(\", \"),\n \"access-control-allow-headers\": asked ?? \"authorization, content-type\",\n \"access-control-max-age\": \"600\"\n };\n}\n\n// src/principal.ts\nimport { CAPABILITIES } from \"@dispach/core\";\nfunction can(principal, capability) {\n if (principal.kind !== \"key\")\n return principal.kind !== \"claim\";\n const allowed = principal.scope?.can;\n return allowed === undefined || allowed.includes(capability);\n}\nfunction reachesAgent(principal, agentId) {\n if (principal.kind !== \"key\")\n return principal.kind !== \"claim\";\n const agents = principal.scope?.agents;\n return agents === undefined || agents.includes(agentId);\n}\nfunction reachesSession(principal, sessionKey) {\n if (principal.kind !== \"key\")\n return principal.kind !== \"claim\";\n const prefix = principal.scope?.sessions;\n if (prefix === undefined)\n return true;\n return sessionKey.startsWith(prefix.endsWith(\"*\") ? prefix.slice(0, -1) : prefix);\n}\nfunction scopeFilter(principal) {\n if (principal.kind === \"claim\")\n return { agentIds: [] };\n if (principal.kind !== \"key\")\n return {};\n const agents = principal.scope?.agents;\n const prefix = principal.scope?.sessions;\n return {\n ...agents === undefined ? {} : { agentIds: agents },\n ...prefix === undefined ? {} : { sessionPrefix: prefix.endsWith(\"*\") ? prefix.slice(0, -1) : prefix }\n };\n}\nfunction isScoped(principal) {\n if (principal.kind !== \"key\")\n return false;\n const scope = principal.scope;\n return scope !== undefined && (scope.agents !== undefined || scope.sessions !== undefined || scope.can !== undefined);\n}\n\n// src/router.ts\nclass Router {\n #routes = [];\n add(method, pattern, handler, options) {\n this.#routes.push({\n method: method.toUpperCase(),\n pattern,\n handler,\n capability: options.capability,\n streaming: options.streaming === true,\n segments: split(pattern)\n });\n return this;\n }\n routes() {\n return this.#routes.map(({ method, pattern, handler, streaming, capability }) => ({\n method,\n pattern,\n handler,\n streaming,\n capability\n }));\n }\n match(method, pathname) {\n const parts = split(pathname);\n const pathMatches = [];\n for (const route of this.#routes) {\n const params = matchSegments(route.segments, parts);\n if (params === undefined)\n continue;\n pathMatches.push(route);\n if (route.method === method.toUpperCase()) {\n return {\n kind: \"found\",\n handler: route.handler,\n params,\n streaming: route.streaming,\n capability: route.capability\n };\n }\n }\n if (pathMatches.length > 0) {\n return { kind: \"method\", allowed: [...new Set(pathMatches.map((r) => r.method))] };\n }\n return { kind: \"none\" };\n }\n}\nfunction split(path) {\n return path.split(\"/\").filter((segment) => segment !== \"\");\n}\nfunction matchSegments(pattern, parts) {\n if (pattern.length !== parts.length)\n return;\n const params = {};\n for (const [index, expected] of pattern.entries()) {\n const actual = parts[index];\n if (actual === undefined)\n return;\n if (expected.startsWith(\":\")) {\n try {\n params[expected.slice(1)] = decodeURIComponent(actual);\n } catch {\n return;\n }\n continue;\n }\n if (expected !== actual)\n return;\n }\n return params;\n}\n\n// src/sse.ts\nvar HEARTBEAT_MS = 15000;\nfunction encodeFrame(frame) {\n const lines = [];\n if (frame.event !== undefined)\n lines.push(`event: ${frame.event}`);\n if (frame.id !== undefined)\n lines.push(`id: ${frame.id}`);\n const payload = typeof frame.data === \"string\" ? frame.data : JSON.stringify(frame.data);\n for (const line of payload.split(`\n`))\n lines.push(`data: ${line}`);\n return `${lines.join(`\n`)}\n\n`;\n}\nfunction sseResponse(options) {\n const encoder = new TextEncoder;\n let teardown;\n let heartbeat;\n let closed = false;\n const stream = new ReadableStream({\n start(controller) {\n const finish = () => {\n if (closed)\n return;\n closed = true;\n if (heartbeat !== undefined)\n clearInterval(heartbeat);\n teardown?.();\n teardown = undefined;\n try {\n controller.close();\n } catch {}\n };\n const send = (frame) => {\n if (closed)\n return;\n try {\n controller.enqueue(encoder.encode(encodeFrame(frame)));\n } catch {\n finish();\n }\n };\n options.signal?.addEventListener(\"abort\", finish, { once: true });\n const started = options.start({ send, close: finish });\n if (closed) {\n started?.();\n return;\n }\n teardown = started;\n heartbeat = setInterval(() => {\n if (closed)\n return;\n try {\n controller.enqueue(encoder.encode(`: ping\n\n`));\n } catch {\n finish();\n }\n }, options.heartbeatMs ?? HEARTBEAT_MS);\n heartbeat.unref?.();\n },\n cancel() {\n if (closed)\n return;\n closed = true;\n if (heartbeat !== undefined)\n clearInterval(heartbeat);\n teardown?.();\n teardown = undefined;\n }\n });\n return new Response(stream, {\n status: options.status ?? 200,\n headers: {\n \"content-type\": \"text/event-stream; charset=utf-8\",\n \"cache-control\": \"no-cache, no-transform\",\n connection: \"keep-alive\",\n \"x-accel-buffering\": \"no\"\n }\n });\n}\n\n// ../web/dist/assets/app.css\nvar app_default = ':root{--ground: #0b0b0c;--raised: #151517;--line: #26262a;--text: #e8e6e3;--dim: #8b8b93;--accent: #7aa2f7;--warn: #e0af68;--bad: #f7768e;--ok: #9ece6a;--mono: ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, monospace;--sans: -apple-system, BlinkMacSystemFont, \"Segoe UI\", system-ui, sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--ground);color:var(--text);font:14px / 1.55 var(--sans);-webkit-font-smoothing:antialiased}button{font:inherit;color:inherit;background:var(--raised);border:1px solid var(--line);border-radius:6px;padding:5px 11px;cursor:pointer}button:hover:not(:disabled){border-color:var(--dim)}button:disabled{opacity:.45;cursor:default}button.primary{background:var(--accent);border-color:var(--accent);color:#0b0b0c;font-weight:600}button.bad{color:var(--bad)}input,textarea{font:inherit;color:inherit;background:var(--ground);border:1px solid var(--line);border-radius:6px;padding:8px 10px;width:100%}input:focus,textarea:focus{outline:none;border-color:var(--accent)}.shell{display:grid;grid-template-columns:240px 1fr;height:100vh}.side{background:var(--raised);border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0}.side header{padding:14px 16px;border-bottom:1px solid var(--line)}.brand{font-weight:650;letter-spacing:.01em}.side nav{padding:8px;overflow-y:auto;flex:1;min-height:0}.side footer{padding:10px 12px;border-top:1px solid var(--line);display:flex;gap:8px;align-items:center}.row-button{display:block;width:100%;text-align:left;background:none;border:none;border-radius:6px;padding:7px 9px;font-family:var(--mono);font-size:12px}.row-button:hover{background:var(--ground)}.row-button[aria-current=true]{background:var(--ground);color:var(--accent)}.group{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--dim);padding:12px 9px 5px}.main{display:flex;flex-direction:column;min-height:0}.bar{display:flex;gap:14px;align-items:baseline;padding:12px 20px;border-bottom:1px solid var(--line);font-size:12px;color:var(--dim);min-height:44px}.bar strong{color:var(--text);font-size:14px;font-weight:600}.bar .spacer{flex:1}.scroll{flex:1;overflow-y:auto;min-height:0;padding:20px}.pad{max-width:780px;margin:0 auto}.row{margin:0 0 16px;white-space:pre-wrap;overflow-wrap:anywhere}.row.user{background:var(--raised);border:1px solid var(--line);border-radius:8px;padding:10px 13px}.label{font-family:var(--mono);font-size:11px;color:var(--dim);margin-bottom:4px}.tool{border-left:2px solid var(--line);padding-left:11px;font-family:var(--mono);font-size:12px}.tool .slug{color:var(--accent)}.tool .out{color:var(--dim);max-height:13em;overflow-y:auto;margin-top:5px}.tool.failed .slug{color:var(--bad)}.tool .mut{color:var(--warn);font-size:11px}.tool .out{display:inline}.fence{border:1px dashed var(--warn);border-radius:6px;padding:7px 9px;margin-top:5px}.fence .why{color:var(--warn);font-size:11px;margin-bottom:4px}.payload-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:28px;font-weight:600;letter-spacing:.18em;margin:10px 0;-webkit-user-select:all;user-select:all}.channel-input.stale .payload-code{opacity:.35}.payload-qr{display:block;width:240px;max-width:100%;height:auto;border-radius:6px;margin:8px 0}.channel-input.stale .payload-qr{opacity:.35}.note{font-size:12px;color:var(--dim);border-left:2px solid var(--line);padding-left:11px;white-space:pre-wrap}.note.bad{color:var(--bad);border-left-color:var(--bad)}.ask{border:1px solid var(--warn);border-radius:8px;padding:12px 14px;background:#17140e}.ask .what{font-family:var(--mono);font-size:12px;margin:6px 0 10px;white-space:pre-wrap;overflow-wrap:anywhere}.ask .buttons{display:flex;gap:8px}.ask .settled{font-size:12px;color:var(--dim)}details.fold summary{cursor:pointer;color:var(--dim);font-family:var(--mono);font-size:11px}details.fold[open] summary{margin-bottom:5px}details.fold .body{color:var(--dim);font-size:13px}.composer{border-top:1px solid var(--line);padding:12px 20px}.composer .inner{max-width:780px;margin:0 auto;display:flex;gap:9px;align-items:flex-end}.composer textarea{resize:none;min-height:40px;max-height:190px;font-family:var(--sans)}.hint{font-size:11px;color:var(--dim);max-width:780px;margin:6px auto 0}.card{border:1px solid var(--line);border-radius:8px;padding:16px 18px;margin-bottom:14px;background:var(--raised)}.card h2{margin:0 0 4px;font-size:15px}.card p{margin:0 0 12px;color:var(--dim);font-size:13px}table{width:100%;border-collapse:collapse;font-size:13px}th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--dim);font-weight:500;padding:0 10px 7px 0}td{padding:8px 10px 8px 0;border-top:1px solid var(--line);font-family:var(--mono);font-size:12px}td.revoked{color:var(--dim);text-decoration:line-through}.secret{font-family:var(--mono);font-size:12px;background:var(--ground);border:1px solid var(--ok);border-radius:6px;padding:9px 11px;overflow-wrap:anywhere;margin-bottom:8px}.gate{display:grid;place-items:center;height:100vh;padding:20px}.gate .card{max-width:460px;width:100%}.dot{width:7px;height:7px;border-radius:50%;display:inline-block;background:var(--dim)}.dot.live{background:var(--ok)}.dot.busy{background:var(--warn)}@media(max-width:720px){.shell{grid-template-columns:1fr}.side{display:none}}.agent-row{display:block}.agent-row .row-button:disabled{color:var(--dim);cursor:default}.agent-off{color:var(--warn);font-size:11px}.agent-note{display:flex;gap:6px;align-items:baseline;padding:0 9px 6px;font-size:11px;color:var(--dim)}.link{background:none;border:none;padding:0;color:var(--accent);font-size:11px;text-decoration:underline;cursor:pointer}.link:disabled{color:var(--dim);cursor:default;text-decoration:none}.empty{color:var(--dim);font-size:13px;max-width:60ch}.panel-table{width:100%;border-collapse:collapse;font-size:12px}.panel-table th{text-align:left;font-weight:500;font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--dim);padding:6px 10px 6px 0;border-bottom:1px solid var(--line)}.panel-table td{padding:9px 10px 9px 0;border-bottom:1px solid var(--line);vertical-align:top}.panel-table tr.off td{color:var(--dim)}.sub{color:var(--dim);font-size:11px;margin-top:2px;max-width:52ch}.channel{border:1px solid var(--line);border-radius:8px;padding:12px 14px;margin-bottom:12px}.channel h3{margin:0 0 6px;font-size:13px;font-weight:500}.status{margin:0;font-size:12px}.status-connected{color:var(--ok)}.status-error,.status-disconnected{color:var(--bad)}.status-needs_input{color:var(--warn)}.channel-input{margin-top:10px;padding:10px;border-radius:6px;background:var(--ground)}.payload{margin:0;font-family:var(--mono);font-size:11px;white-space:pre-wrap;word-break:break-all;max-height:9em;overflow-y:auto}.channel-input.stale .payload{opacity:.45}.warn{color:var(--warn);font-size:12px;margin:0 0 6px}select{font:inherit;color:inherit;background:var(--ground);border:1px solid var(--line);border-radius:6px;padding:8px 10px;width:100%}select:focus{outline:none;border-color:var(--accent)}.provision{display:flex;flex-direction:column;gap:16px;max-width:60ch}.provision>button[type=submit]{align-self:flex-start}.field label{display:block;font-size:12px;color:var(--dim);margin-bottom:5px}.field.invalid input,.field.invalid select{border-color:var(--bad)}.sub{color:var(--dim);font-size:11px}.error{color:var(--bad);font-size:13px;max-width:60ch}.ok{color:var(--ok);font-size:13px}.created{max-width:66ch;font-size:13px}.created h3{font-size:15px;font-weight:600;margin:0 0 10px}.created p{margin:0 0 10px}.blank-secrets{border:1px solid var(--warn);border-radius:6px;padding:11px 13px;margin:14px 0}.blank-secrets p{margin:0 0 6px}.blank-secrets p:last-child{margin:0}.config-row{border-bottom:1px solid var(--line);padding:14px 0;max-width:72ch}.config-row:first-of-type{padding-top:0}.config-head{display:flex;align-items:baseline;gap:8px}.config-row .sub{margin:4px 0 8px;max-width:68ch}.config-row input[type=text],.config-row input:not([type]),.config-row textarea{width:100%;font-family:var(--mono);font-size:12px}.config-row button{margin-top:8px}.config-row label input[type=checkbox]{width:auto;margin-right:4px;vertical-align:baseline}.form-grid{display:grid;grid-template-columns:6em 1fr;gap:8px 12px;align-items:start;max-width:60ch}.form-grid label{font-size:12px;color:var(--dim);padding-top:9px}.form-grid input,.form-grid select{width:100%}.form-grid>div>input+input{margin-top:6px}.warnings{border:1px solid var(--warn);border-radius:6px;padding:.75rem 1rem;margin-bottom:1rem}.warnings h3{margin:0;color:var(--warn)}.warnings .sub{margin:.25rem 0 .75rem;opacity:.8}.warning{margin-top:.5rem}.warning-message{margin:0}.warning .hint{margin:.15rem 0 0;opacity:.75}.channel-actions{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-top:.5rem}.channel-actions form{display:flex;gap:.35rem}.channel-actions input{min-width:14rem}.status-off{opacity:.7}\\n';\n\n// ../web/dist/assets/app.js\nvar app_default2 = `(function(){const c=document.createElement(\"link\").relList;if(c&&c.supports&&c.supports(\"modulepreload\"))return;for(const d of document.querySelectorAll('link[rel=\"modulepreload\"]'))s(d);new MutationObserver(d=>{for(const h of d)if(h.type===\"childList\")for(const v of h.addedNodes)v.tagName===\"LINK\"&&v.rel===\"modulepreload\"&&s(v)}).observe(document,{childList:!0,subtree:!0});function r(d){const h={};return d.integrity&&(h.integrity=d.integrity),d.referrerPolicy&&(h.referrerPolicy=d.referrerPolicy),d.crossOrigin===\"use-credentials\"?h.credentials=\"include\":d.crossOrigin===\"anonymous\"?h.credentials=\"omit\":h.credentials=\"same-origin\",h}function s(d){if(d.ep)return;d.ep=!0;const h=r(d);fetch(d.href,h)}})();function Lg(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,\"default\")?i.default:i}var Us={exports:{}},Za={};var bh;function Gg(){if(bh)return Za;bh=1;var i=Symbol.for(\"react.transitional.element\"),c=Symbol.for(\"react.fragment\");function r(s,d,h){var v=null;if(h!==void 0&&(v=\"\"+h),d.key!==void 0&&(v=\"\"+d.key),\"key\"in d){h={};for(var A in d)A!==\"key\"&&(h[A]=d[A])}else h=d;return d=h.ref,{$$typeof:i,type:s,key:v,ref:d!==void 0?d:null,props:h}}return Za.Fragment=c,Za.jsx=r,Za.jsxs=r,Za}var Sh;function Qg(){return Sh||(Sh=1,Us.exports=Gg()),Us.exports}var m=Qg(),Rs={exports:{}},oe={};var ph;function Xg(){if(ph)return oe;ph=1;var i=Symbol.for(\"react.transitional.element\"),c=Symbol.for(\"react.portal\"),r=Symbol.for(\"react.fragment\"),s=Symbol.for(\"react.strict_mode\"),d=Symbol.for(\"react.profiler\"),h=Symbol.for(\"react.consumer\"),v=Symbol.for(\"react.context\"),A=Symbol.for(\"react.forward_ref\"),p=Symbol.for(\"react.suspense\"),g=Symbol.for(\"react.memo\"),N=Symbol.for(\"react.lazy\"),E=Symbol.for(\"react.activity\"),j=Symbol.iterator;function B(b){return b===null||typeof b!=\"object\"?null:(b=j&&b[j]||b[\"@@iterator\"],typeof b==\"function\"?b:null)}var X={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,fe={};function L(b,U,Q){this.props=b,this.context=U,this.refs=fe,this.updater=Q||X}L.prototype.isReactComponent={},L.prototype.setState=function(b,U){if(typeof b!=\"object\"&&typeof b!=\"function\"&&b!=null)throw Error(\"takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,b,U,\"setState\")},L.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,\"forceUpdate\")};function ce(){}ce.prototype=L.prototype;function I(b,U,Q){this.props=b,this.context=U,this.refs=fe,this.updater=Q||X}var $=I.prototype=new ce;$.constructor=I,D($,L.prototype),$.isPureReactComponent=!0;var Ae=Array.isArray;function Z(){}var Y={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function V(b,U,Q){var W=Q.ref;return{$$typeof:i,type:b,key:U,ref:W!==void 0?W:null,props:Q}}function ne(b,U){return V(b.type,U,b.props)}function q(b){return typeof b==\"object\"&&b!==null&&b.$$typeof===i}function F(b){var U={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+b.replace(/[=:]/g,function(Q){return U[Q]})}var ee=/\\\\/+/g;function ue(b,U){return typeof b==\"object\"&&b!==null&&b.key!=null?F(\"\"+b.key):U.toString(36)}function Ye(b){switch(b.status){case\"fulfilled\":return b.value;case\"rejected\":throw b.reason;default:switch(typeof b.status==\"string\"?b.then(Z,Z):(b.status=\"pending\",b.then(function(U){b.status===\"pending\"&&(b.status=\"fulfilled\",b.value=U)},function(U){b.status===\"pending\"&&(b.status=\"rejected\",b.reason=U)})),b.status){case\"fulfilled\":return b.value;case\"rejected\":throw b.reason}}throw b}function M(b,U,Q,W,se){var re=typeof b;(re===\"undefined\"||re===\"boolean\")&&(b=null);var de=!1;if(b===null)de=!0;else switch(re){case\"bigint\":case\"string\":case\"number\":de=!0;break;case\"object\":switch(b.$$typeof){case i:case c:de=!0;break;case N:return de=b._init,M(de(b._payload),U,Q,W,se)}}if(de)return se=se(b),de=W===\"\"?\".\"+ue(b,0):W,Ae(se)?(Q=\"\",de!=null&&(Q=de.replace(ee,\"$&/\")+\"/\"),M(se,U,Q,\"\",function(nt){return nt})):se!=null&&(q(se)&&(se=ne(se,Q+(se.key==null||b&&b.key===se.key?\"\":(\"\"+se.key).replace(ee,\"$&/\")+\"/\")+de)),U.push(se)),1;de=0;var Me=W===\"\"?\".\":W+\":\";if(Ae(b))for(var Ne=0;Ne<b.length;Ne++)W=b[Ne],re=Me+ue(W,Ne),de+=M(W,U,Q,re,se);else if(Ne=B(b),typeof Ne==\"function\")for(b=Ne.call(b),Ne=0;!(W=b.next()).done;)W=W.value,re=Me+ue(W,Ne++),de+=M(W,U,Q,re,se);else if(re===\"object\"){if(typeof b.then==\"function\")return M(Ye(b),U,Q,W,se);throw U=String(b),Error(\"Objects are not valid as a React child (found: \"+(U===\"[object Object]\"?\"object with keys {\"+Object.keys(b).join(\", \")+\"}\":U)+\"). If you meant to render a collection of children, use an array instead.\")}return de}function G(b,U,Q){if(b==null)return b;var W=[],se=0;return M(b,W,\"\",\"\",function(re){return U.call(Q,re,se++)}),W}function ae(b){if(b._status===-1){var U=b._result;U=U(),U.then(function(Q){(b._status===0||b._status===-1)&&(b._status=1,b._result=Q)},function(Q){(b._status===0||b._status===-1)&&(b._status=2,b._result=Q)}),b._status===-1&&(b._status=0,b._result=U)}if(b._status===1)return b._result.default;throw b._result}var Te=typeof reportError==\"function\"?reportError:function(b){if(typeof window==\"object\"&&typeof window.ErrorEvent==\"function\"){var U=new window.ErrorEvent(\"error\",{bubbles:!0,cancelable:!0,message:typeof b==\"object\"&&b!==null&&typeof b.message==\"string\"?String(b.message):String(b),error:b});if(!window.dispatchEvent(U))return}else if(typeof process==\"object\"&&typeof process.emit==\"function\"){process.emit(\"uncaughtException\",b);return}console.error(b)},be={map:G,forEach:function(b,U,Q){G(b,function(){U.apply(this,arguments)},Q)},count:function(b){var U=0;return G(b,function(){U++}),U},toArray:function(b){return G(b,function(U){return U})||[]},only:function(b){if(!q(b))throw Error(\"React.Children.only expected to receive a single React element child.\");return b}};return oe.Activity=E,oe.Children=be,oe.Component=L,oe.Fragment=r,oe.Profiler=d,oe.PureComponent=I,oe.StrictMode=s,oe.Suspense=p,oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Y,oe.__COMPILER_RUNTIME={__proto__:null,c:function(b){return Y.H.useMemoCache(b)}},oe.cache=function(b){return function(){return b.apply(null,arguments)}},oe.cacheSignal=function(){return null},oe.cloneElement=function(b,U,Q){if(b==null)throw Error(\"The argument must be a React element, but you passed \"+b+\".\");var W=D({},b.props),se=b.key;if(U!=null)for(re in U.key!==void 0&&(se=\"\"+U.key),U)!K.call(U,re)||re===\"key\"||re===\"__self\"||re===\"__source\"||re===\"ref\"&&U.ref===void 0||(W[re]=U[re]);var re=arguments.length-2;if(re===1)W.children=Q;else if(1<re){for(var de=Array(re),Me=0;Me<re;Me++)de[Me]=arguments[Me+2];W.children=de}return V(b.type,se,W)},oe.createContext=function(b){return b={$$typeof:v,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null},b.Provider=b,b.Consumer={$$typeof:h,_context:b},b},oe.createElement=function(b,U,Q){var W,se={},re=null;if(U!=null)for(W in U.key!==void 0&&(re=\"\"+U.key),U)K.call(U,W)&&W!==\"key\"&&W!==\"__self\"&&W!==\"__source\"&&(se[W]=U[W]);var de=arguments.length-2;if(de===1)se.children=Q;else if(1<de){for(var Me=Array(de),Ne=0;Ne<de;Ne++)Me[Ne]=arguments[Ne+2];se.children=Me}if(b&&b.defaultProps)for(W in de=b.defaultProps,de)se[W]===void 0&&(se[W]=de[W]);return V(b,re,se)},oe.createRef=function(){return{current:null}},oe.forwardRef=function(b){return{$$typeof:A,render:b}},oe.isValidElement=q,oe.lazy=function(b){return{$$typeof:N,_payload:{_status:-1,_result:b},_init:ae}},oe.memo=function(b,U){return{$$typeof:g,type:b,compare:U===void 0?null:U}},oe.startTransition=function(b){var U=Y.T,Q={};Y.T=Q;try{var W=b(),se=Y.S;se!==null&&se(Q,W),typeof W==\"object\"&&W!==null&&typeof W.then==\"function\"&&W.then(Z,Te)}catch(re){Te(re)}finally{U!==null&&Q.types!==null&&(U.types=Q.types),Y.T=U}},oe.unstable_useCacheRefresh=function(){return Y.H.useCacheRefresh()},oe.use=function(b){return Y.H.use(b)},oe.useActionState=function(b,U,Q){return Y.H.useActionState(b,U,Q)},oe.useCallback=function(b,U){return Y.H.useCallback(b,U)},oe.useContext=function(b){return Y.H.useContext(b)},oe.useDebugValue=function(){},oe.useDeferredValue=function(b,U){return Y.H.useDeferredValue(b,U)},oe.useEffect=function(b,U){return Y.H.useEffect(b,U)},oe.useEffectEvent=function(b){return Y.H.useEffectEvent(b)},oe.useId=function(){return Y.H.useId()},oe.useImperativeHandle=function(b,U,Q){return Y.H.useImperativeHandle(b,U,Q)},oe.useInsertionEffect=function(b,U){return Y.H.useInsertionEffect(b,U)},oe.useLayoutEffect=function(b,U){return Y.H.useLayoutEffect(b,U)},oe.useMemo=function(b,U){return Y.H.useMemo(b,U)},oe.useOptimistic=function(b,U){return Y.H.useOptimistic(b,U)},oe.useReducer=function(b,U,Q){return Y.H.useReducer(b,U,Q)},oe.useRef=function(b){return Y.H.useRef(b)},oe.useState=function(b){return Y.H.useState(b)},oe.useSyncExternalStore=function(b,U,Q){return Y.H.useSyncExternalStore(b,U,Q)},oe.useTransition=function(){return Y.H.useTransition()},oe.version=\"19.2.8\",oe}var Eh;function yf(){return Eh||(Eh=1,Rs.exports=Xg()),Rs.exports}var k=yf(),Os={exports:{}},Va={},Ds={exports:{}},Bs={};var Th;function Kg(){return Th||(Th=1,(function(i){function c(M,G){var ae=M.length;M.push(G);e:for(;0<ae;){var Te=ae-1>>>1,be=M[Te];if(0<d(be,G))M[Te]=G,M[ae]=be,ae=Te;else break e}}function r(M){return M.length===0?null:M[0]}function s(M){if(M.length===0)return null;var G=M[0],ae=M.pop();if(ae!==G){M[0]=ae;e:for(var Te=0,be=M.length,b=be>>>1;Te<b;){var U=2*(Te+1)-1,Q=M[U],W=U+1,se=M[W];if(0>d(Q,ae))W<be&&0>d(se,Q)?(M[Te]=se,M[W]=ae,Te=W):(M[Te]=Q,M[U]=ae,Te=U);else if(W<be&&0>d(se,ae))M[Te]=se,M[W]=ae,Te=W;else break e}}return G}function d(M,G){var ae=M.sortIndex-G.sortIndex;return ae!==0?ae:M.id-G.id}if(i.unstable_now=void 0,typeof performance==\"object\"&&typeof performance.now==\"function\"){var h=performance;i.unstable_now=function(){return h.now()}}else{var v=Date,A=v.now();i.unstable_now=function(){return v.now()-A}}var p=[],g=[],N=1,E=null,j=3,B=!1,X=!1,D=!1,fe=!1,L=typeof setTimeout==\"function\"?setTimeout:null,ce=typeof clearTimeout==\"function\"?clearTimeout:null,I=typeof setImmediate<\"u\"?setImmediate:null;function $(M){for(var G=r(g);G!==null;){if(G.callback===null)s(g);else if(G.startTime<=M)s(g),G.sortIndex=G.expirationTime,c(p,G);else break;G=r(g)}}function Ae(M){if(D=!1,$(M),!X)if(r(p)!==null)X=!0,Z||(Z=!0,F());else{var G=r(g);G!==null&&Ye(Ae,G.startTime-M)}}var Z=!1,Y=-1,K=5,V=-1;function ne(){return fe?!0:!(i.unstable_now()-V<K)}function q(){if(fe=!1,Z){var M=i.unstable_now();V=M;var G=!0;try{e:{X=!1,D&&(D=!1,ce(Y),Y=-1),B=!0;var ae=j;try{t:{for($(M),E=r(p);E!==null&&!(E.expirationTime>M&&ne());){var Te=E.callback;if(typeof Te==\"function\"){E.callback=null,j=E.priorityLevel;var be=Te(E.expirationTime<=M);if(M=i.unstable_now(),typeof be==\"function\"){E.callback=be,$(M),G=!0;break t}E===r(p)&&s(p),$(M)}else s(p);E=r(p)}if(E!==null)G=!0;else{var b=r(g);b!==null&&Ye(Ae,b.startTime-M),G=!1}}break e}finally{E=null,j=ae,B=!1}G=void 0}}finally{G?F():Z=!1}}}var F;if(typeof I==\"function\")F=function(){I(q)};else if(typeof MessageChannel<\"u\"){var ee=new MessageChannel,ue=ee.port2;ee.port1.onmessage=q,F=function(){ue.postMessage(null)}}else F=function(){L(q,0)};function Ye(M,G){Y=L(function(){M(i.unstable_now())},G)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(M){M.callback=null},i.unstable_forceFrameRate=function(M){0>M||125<M?console.error(\"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"):K=0<M?Math.floor(1e3/M):5},i.unstable_getCurrentPriorityLevel=function(){return j},i.unstable_next=function(M){switch(j){case 1:case 2:case 3:var G=3;break;default:G=j}var ae=j;j=G;try{return M()}finally{j=ae}},i.unstable_requestPaint=function(){fe=!0},i.unstable_runWithPriority=function(M,G){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var ae=j;j=M;try{return G()}finally{j=ae}},i.unstable_scheduleCallback=function(M,G,ae){var Te=i.unstable_now();switch(typeof ae==\"object\"&&ae!==null?(ae=ae.delay,ae=typeof ae==\"number\"&&0<ae?Te+ae:Te):ae=Te,M){case 1:var be=-1;break;case 2:be=250;break;case 5:be=1073741823;break;case 4:be=1e4;break;default:be=5e3}return be=ae+be,M={id:N++,callback:G,priorityLevel:M,startTime:ae,expirationTime:be,sortIndex:-1},ae>Te?(M.sortIndex=ae,c(g,M),r(p)===null&&M===r(g)&&(D?(ce(Y),Y=-1):D=!0,Ye(Ae,ae-Te))):(M.sortIndex=be,c(p,M),X||B||(X=!0,Z||(Z=!0,F()))),M},i.unstable_shouldYield=ne,i.unstable_wrapCallback=function(M){var G=j;return function(){var ae=j;j=G;try{return M.apply(this,arguments)}finally{j=ae}}}})(Bs)),Bs}var Ah;function Zg(){return Ah||(Ah=1,Ds.exports=Kg()),Ds.exports}var Hs={exports:{}},at={};var zh;function Vg(){if(zh)return at;zh=1;var i=yf();function c(p){var g=\"https://react.dev/errors/\"+p;if(1<arguments.length){g+=\"?args[]=\"+encodeURIComponent(arguments[1]);for(var N=2;N<arguments.length;N++)g+=\"&args[]=\"+encodeURIComponent(arguments[N])}return\"Minified React error #\"+p+\"; visit \"+g+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}function r(){}var s={d:{f:r,r:function(){throw Error(c(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for(\"react.portal\");function h(p,g,N){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:E==null?null:\"\"+E,children:p,containerInfo:g,implementation:N}}var v=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function A(p,g){if(p===\"font\")return\"\";if(typeof g==\"string\")return g===\"use-credentials\"?g:\"\"}return at.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,at.createPortal=function(p,g){var N=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(c(299));return h(p,g,null,N)},at.flushSync=function(p){var g=v.T,N=s.p;try{if(v.T=null,s.p=2,p)return p()}finally{v.T=g,s.p=N,s.d.f()}},at.preconnect=function(p,g){typeof p==\"string\"&&(g?(g=g.crossOrigin,g=typeof g==\"string\"?g===\"use-credentials\"?g:\"\":void 0):g=null,s.d.C(p,g))},at.prefetchDNS=function(p){typeof p==\"string\"&&s.d.D(p)},at.preinit=function(p,g){if(typeof p==\"string\"&&g&&typeof g.as==\"string\"){var N=g.as,E=A(N,g.crossOrigin),j=typeof g.integrity==\"string\"?g.integrity:void 0,B=typeof g.fetchPriority==\"string\"?g.fetchPriority:void 0;N===\"style\"?s.d.S(p,typeof g.precedence==\"string\"?g.precedence:void 0,{crossOrigin:E,integrity:j,fetchPriority:B}):N===\"script\"&&s.d.X(p,{crossOrigin:E,integrity:j,fetchPriority:B,nonce:typeof g.nonce==\"string\"?g.nonce:void 0})}},at.preinitModule=function(p,g){if(typeof p==\"string\")if(typeof g==\"object\"&&g!==null){if(g.as==null||g.as===\"script\"){var N=A(g.as,g.crossOrigin);s.d.M(p,{crossOrigin:N,integrity:typeof g.integrity==\"string\"?g.integrity:void 0,nonce:typeof g.nonce==\"string\"?g.nonce:void 0})}}else g==null&&s.d.M(p)},at.preload=function(p,g){if(typeof p==\"string\"&&typeof g==\"object\"&&g!==null&&typeof g.as==\"string\"){var N=g.as,E=A(N,g.crossOrigin);s.d.L(p,N,{crossOrigin:E,integrity:typeof g.integrity==\"string\"?g.integrity:void 0,nonce:typeof g.nonce==\"string\"?g.nonce:void 0,type:typeof g.type==\"string\"?g.type:void 0,fetchPriority:typeof g.fetchPriority==\"string\"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy==\"string\"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet==\"string\"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes==\"string\"?g.imageSizes:void 0,media:typeof g.media==\"string\"?g.media:void 0})}},at.preloadModule=function(p,g){if(typeof p==\"string\")if(g){var N=A(g.as,g.crossOrigin);s.d.m(p,{as:typeof g.as==\"string\"&&g.as!==\"script\"?g.as:void 0,crossOrigin:N,integrity:typeof g.integrity==\"string\"?g.integrity:void 0})}else s.d.m(p)},at.requestFormReset=function(p){s.d.r(p)},at.unstable_batchedUpdates=function(p,g){return p(g)},at.useFormState=function(p,g,N){return v.H.useFormState(p,g,N)},at.useFormStatus=function(){return v.H.useHostTransitionStatus()},at.version=\"19.2.8\",at}var Ch;function kg(){if(Ch)return Hs.exports;Ch=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Hs.exports=Vg(),Hs.exports}var Nh;function Jg(){if(Nh)return Va;Nh=1;var i=Zg(),c=yf(),r=kg();function s(e){var t=\"https://react.dev/errors/\"+e;if(1<arguments.length){t+=\"?args[]=\"+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=\"&args[]=\"+encodeURIComponent(arguments[n])}return\"Minified React error #\"+e+\"; visit \"+t+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function v(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function A(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(h(e)!==e)throw Error(s(188))}function g(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(s(188));return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var u=a.alternate;if(u===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===u.child){for(u=a.child;u;){if(u===n)return p(a),e;if(u===l)return p(a),t;u=u.sibling}throw Error(s(188))}if(n.return!==l.return)n=a,l=u;else{for(var f=!1,o=a.child;o;){if(o===n){f=!0,n=a,l=u;break}if(o===l){f=!0,l=a,n=u;break}o=o.sibling}if(!f){for(o=u.child;o;){if(o===n){f=!0,n=u,l=a;break}if(o===l){f=!0,l=u,n=a;break}o=o.sibling}if(!f)throw Error(s(189))}}if(n.alternate!==l)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function N(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=N(e),t!==null)return t;e=e.sibling}return null}var E=Object.assign,j=Symbol.for(\"react.element\"),B=Symbol.for(\"react.transitional.element\"),X=Symbol.for(\"react.portal\"),D=Symbol.for(\"react.fragment\"),fe=Symbol.for(\"react.strict_mode\"),L=Symbol.for(\"react.profiler\"),ce=Symbol.for(\"react.consumer\"),I=Symbol.for(\"react.context\"),$=Symbol.for(\"react.forward_ref\"),Ae=Symbol.for(\"react.suspense\"),Z=Symbol.for(\"react.suspense_list\"),Y=Symbol.for(\"react.memo\"),K=Symbol.for(\"react.lazy\"),V=Symbol.for(\"react.activity\"),ne=Symbol.for(\"react.memo_cache_sentinel\"),q=Symbol.iterator;function F(e){return e===null||typeof e!=\"object\"?null:(e=q&&e[q]||e[\"@@iterator\"],typeof e==\"function\"?e:null)}var ee=Symbol.for(\"react.client.reference\");function ue(e){if(e==null)return null;if(typeof e==\"function\")return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e==\"string\")return e;switch(e){case D:return\"Fragment\";case L:return\"Profiler\";case fe:return\"StrictMode\";case Ae:return\"Suspense\";case Z:return\"SuspenseList\";case V:return\"Activity\"}if(typeof e==\"object\")switch(e.$$typeof){case X:return\"Portal\";case I:return e.displayName||\"Context\";case ce:return(e._context.displayName||\"Context\")+\".Consumer\";case $:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||\"\",e=e!==\"\"?\"ForwardRef(\"+e+\")\":\"ForwardRef\"),e;case Y:return t=e.displayName||null,t!==null?t:ue(e.type)||\"Memo\";case K:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var Ye=Array.isArray,M=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},Te=[],be=-1;function b(e){return{current:e}}function U(e){0>be||(e.current=Te[be],Te[be]=null,be--)}function Q(e,t){be++,Te[be]=e.current,e.current=t}var W=b(null),se=b(null),re=b(null),de=b(null);function Me(e,t){switch(Q(re,t),Q(se,e),Q(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Gd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Gd(t),e=Qd(t,e);else switch(e){case\"svg\":e=1;break;case\"math\":e=2;break;default:e=0}}U(W),Q(W,e)}function Ne(){U(W),U(se),U(re)}function nt(e){e.memoizedState!==null&&Q(de,e);var t=W.current,n=Qd(t,e.type);t!==n&&(Q(se,e),Q(W,n))}function al(e){se.current===e&&(U(W),U(se)),de.current===e&&(U(de),Ga._currentValue=ae)}var At,Fl;function zt(e){if(At===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\\\\n( *(at )?)/);At=t&&t[1]||\"\",Fl=-1<n.stack.indexOf(\\`\n at\\`)?\" (<anonymous>)\":-1<n.stack.indexOf(\"@\")?\"@unknown:0:0\":\"\"}return\\`\n\\`+At+e+Fl}var ul=!1;function Wl(e,t){if(!e||ul)return\"\";ul=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var O=function(){throw Error()};if(Object.defineProperty(O.prototype,\"props\",{set:function(){throw Error()}}),typeof Reflect==\"object\"&&Reflect.construct){try{Reflect.construct(O,[])}catch(_){var x=_}Reflect.construct(e,[],O)}else{try{O.call()}catch(_){x=_}e.call(O.prototype)}}else{try{throw Error()}catch(_){x=_}(O=e())&&typeof O.catch==\"function\"&&O.catch(function(){})}}catch(_){if(_&&x&&typeof _.stack==\"string\")return[_.stack,x.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName=\"DetermineComponentFrameRoot\";var a=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,\"name\");a&&a.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,\"name\",{value:\"DetermineComponentFrameRoot\"});var u=l.DetermineComponentFrameRoot(),f=u[0],o=u[1];if(f&&o){var y=f.split(\\`\n\\`),C=o.split(\\`\n\\`);for(a=l=0;l<y.length&&!y[l].includes(\"DetermineComponentFrameRoot\");)l++;for(;a<C.length&&!C[a].includes(\"DetermineComponentFrameRoot\");)a++;if(l===y.length||a===C.length)for(l=y.length-1,a=C.length-1;1<=l&&0<=a&&y[l]!==C[a];)a--;for(;1<=l&&0<=a;l--,a--)if(y[l]!==C[a]){if(l!==1||a!==1)do if(l--,a--,0>a||y[l]!==C[a]){var w=\\`\n\\`+y[l].replace(\" at new \",\" at \");return e.displayName&&w.includes(\"<anonymous>\")&&(w=w.replace(\"<anonymous>\",e.displayName)),w}while(1<=l&&0<=a);break}}}finally{ul=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:\"\")?zt(n):\"\"}function Wa(e,t){switch(e.tag){case 26:case 27:case 5:return zt(e.type);case 16:return zt(\"Lazy\");case 13:return e.child!==t&&t!==null?zt(\"Suspense Fallback\"):zt(\"Suspense\");case 19:return zt(\"SuspenseList\");case 0:case 15:return Wl(e.type,!1);case 11:return Wl(e.type.render,!1);case 1:return Wl(e.type,!0);case 31:return zt(\"Activity\");default:return\"\"}}function Ia(e){try{var t=\"\",n=null;do t+=Wa(e,n),n=e,e=e.return;while(e);return t}catch(l){return\\`\nError generating stack: \\`+l.message+\\`\n\\`+l.stack}}var il=Object.prototype.hasOwnProperty,cl=i.unstable_scheduleCallback,sl=i.unstable_cancelCallback,Si=i.unstable_shouldYield,fl=i.unstable_requestPaint,ut=i.unstable_now,H=i.unstable_getCurrentPriorityLevel,J=i.unstable_ImmediatePriority,he=i.unstable_UserBlockingPriority,De=i.unstable_NormalPriority,lt=i.unstable_LowPriority,rl=i.unstable_IdlePriority,Il=i.log,A0=i.unstable_setDisableYieldValue,Pl=null,mt=null;function on(e){if(typeof Il==\"function\"&&A0(e),mt&&typeof mt.setStrictMode==\"function\")try{mt.setStrictMode(Pl,e)}catch{}}var gt=Math.clz32?Math.clz32:N0,z0=Math.log,C0=Math.LN2;function N0(e){return e>>>=0,e===0?32:31-(z0(e)/C0|0)|0}var Pa=256,eu=262144,tu=4194304;function Hn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function nu(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,u=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var o=l&134217727;return o!==0?(l=o&~u,l!==0?a=Hn(l):(f&=o,f!==0?a=Hn(f):n||(n=o&~e,n!==0&&(a=Hn(n))))):(o=l&~u,o!==0?a=Hn(o):f!==0?a=Hn(f):n||(n=l&~e,n!==0&&(a=Hn(n)))),a===0?0:t!==0&&t!==a&&(t&u)===0&&(u=a&-a,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:a}function ea(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function j0(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ef(){var e=tu;return tu<<=1,(tu&62914560)===0&&(tu=4194304),e}function pi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ta(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function x0(e,t,n,l,a,u){var f=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,y=e.expirationTimes,C=e.hiddenUpdates;for(n=f&~n;0<n;){var w=31-gt(n),O=1<<w;o[w]=0,y[w]=-1;var x=C[w];if(x!==null)for(C[w]=null,w=0;w<x.length;w++){var _=x[w];_!==null&&(_.lane&=-536870913)}n&=~O}l!==0&&Tf(e,l,0),u!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=u&~(f&~t))}function Tf(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-gt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Af(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-gt(n),a=1<<l;a&t|e[l]&t&&(e[l]|=t),n&=~a}}function zf(e,t){var n=t&-t;return n=(n&42)!==0?1:Ei(n),(n&(e.suspendedLanes|t))!==0?0:n}function Ei(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ti(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Cf(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:oh(e.type))}function Nf(e,t){var n=G.p;try{return G.p=e,t()}finally{G.p=n}}var dn=Math.random().toString(36).slice(2),We=\"__reactFiber$\"+dn,ct=\"__reactProps$\"+dn,ol=\"__reactContainer$\"+dn,Ai=\"__reactEvents$\"+dn,_0=\"__reactListeners$\"+dn,M0=\"__reactHandles$\"+dn,jf=\"__reactResources$\"+dn,na=\"__reactMarker$\"+dn;function zi(e){delete e[We],delete e[ct],delete e[Ai],delete e[_0],delete e[M0]}function dl(e){var t=e[We];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ol]||n[We]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$d(e);e!==null;){if(n=e[We])return n;e=$d(e)}return t}e=n,n=e.parentNode}return null}function hl(e){if(e=e[We]||e[ol]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function la(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function ml(e){var t=e[jf];return t||(t=e[jf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function $e(e){e[na]=!0}var xf=new Set,_f={};function qn(e,t){gl(e,t),gl(e+\"Capture\",t)}function gl(e,t){for(_f[e]=t,e=0;e<t.length;e++)xf.add(t[e])}var w0=RegExp(\"^[:A-Z_a-z\\\\\\\\u00C0-\\\\\\\\u00D6\\\\\\\\u00D8-\\\\\\\\u00F6\\\\\\\\u00F8-\\\\\\\\u02FF\\\\\\\\u0370-\\\\\\\\u037D\\\\\\\\u037F-\\\\\\\\u1FFF\\\\\\\\u200C-\\\\\\\\u200D\\\\\\\\u2070-\\\\\\\\u218F\\\\\\\\u2C00-\\\\\\\\u2FEF\\\\\\\\u3001-\\\\\\\\uD7FF\\\\\\\\uF900-\\\\\\\\uFDCF\\\\\\\\uFDF0-\\\\\\\\uFFFD][:A-Z_a-z\\\\\\\\u00C0-\\\\\\\\u00D6\\\\\\\\u00D8-\\\\\\\\u00F6\\\\\\\\u00F8-\\\\\\\\u02FF\\\\\\\\u0370-\\\\\\\\u037D\\\\\\\\u037F-\\\\\\\\u1FFF\\\\\\\\u200C-\\\\\\\\u200D\\\\\\\\u2070-\\\\\\\\u218F\\\\\\\\u2C00-\\\\\\\\u2FEF\\\\\\\\u3001-\\\\\\\\uD7FF\\\\\\\\uF900-\\\\\\\\uFDCF\\\\\\\\uFDF0-\\\\\\\\uFFFD\\\\\\\\-.0-9\\\\\\\\u00B7\\\\\\\\u0300-\\\\\\\\u036F\\\\\\\\u203F-\\\\\\\\u2040]*$\"),Mf={},wf={};function U0(e){return il.call(wf,e)?!0:il.call(Mf,e)?!1:w0.test(e)?wf[e]=!0:(Mf[e]=!0,!1)}function lu(e,t,n){if(U0(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case\"undefined\":case\"function\":case\"symbol\":e.removeAttribute(t);return;case\"boolean\":var l=t.toLowerCase().slice(0,5);if(l!==\"data-\"&&l!==\"aria-\"){e.removeAttribute(t);return}}e.setAttribute(t,\"\"+n)}}function au(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case\"undefined\":case\"function\":case\"symbol\":case\"boolean\":e.removeAttribute(t);return}e.setAttribute(t,\"\"+n)}}function Vt(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case\"undefined\":case\"function\":case\"symbol\":case\"boolean\":e.removeAttribute(n);return}e.setAttributeNS(t,n,\"\"+l)}}function Ct(e){switch(typeof e){case\"bigint\":case\"boolean\":case\"number\":case\"string\":case\"undefined\":return e;case\"object\":return e;default:return\"\"}}function Uf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===\"input\"&&(t===\"checkbox\"||t===\"radio\")}function R0(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<\"u\"&&typeof l.get==\"function\"&&typeof l.set==\"function\"){var a=l.get,u=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(f){n=\"\"+f,u.call(this,f)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(f){n=\"\"+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ci(e){if(!e._valueTracker){var t=Uf(e)?\"checked\":\"value\";e._valueTracker=R0(e,t,\"\"+e[t])}}function Rf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l=\"\";return e&&(l=Uf(e)?e.checked?\"true\":\"false\":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function uu(e){if(e=e||(typeof document<\"u\"?document:void 0),typeof e>\"u\")return null;try{return e.activeElement||e.body}catch{return e.body}}var O0=/[\\\\n\"\\\\\\\\]/g;function Nt(e){return e.replace(O0,function(t){return\"\\\\\\\\\"+t.charCodeAt(0).toString(16)+\" \"})}function Ni(e,t,n,l,a,u,f,o){e.name=\"\",f!=null&&typeof f!=\"function\"&&typeof f!=\"symbol\"&&typeof f!=\"boolean\"?e.type=f:e.removeAttribute(\"type\"),t!=null?f===\"number\"?(t===0&&e.value===\"\"||e.value!=t)&&(e.value=\"\"+Ct(t)):e.value!==\"\"+Ct(t)&&(e.value=\"\"+Ct(t)):f!==\"submit\"&&f!==\"reset\"||e.removeAttribute(\"value\"),t!=null?ji(e,f,Ct(t)):n!=null?ji(e,f,Ct(n)):l!=null&&e.removeAttribute(\"value\"),a==null&&u!=null&&(e.defaultChecked=!!u),a!=null&&(e.checked=a&&typeof a!=\"function\"&&typeof a!=\"symbol\"),o!=null&&typeof o!=\"function\"&&typeof o!=\"symbol\"&&typeof o!=\"boolean\"?e.name=\"\"+Ct(o):e.removeAttribute(\"name\")}function Of(e,t,n,l,a,u,f,o){if(u!=null&&typeof u!=\"function\"&&typeof u!=\"symbol\"&&typeof u!=\"boolean\"&&(e.type=u),t!=null||n!=null){if(!(u!==\"submit\"&&u!==\"reset\"||t!=null)){Ci(e);return}n=n!=null?\"\"+Ct(n):\"\",t=t!=null?\"\"+Ct(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}l=l??a,l=typeof l!=\"function\"&&typeof l!=\"symbol\"&&!!l,e.checked=o?e.checked:!!l,e.defaultChecked=!!l,f!=null&&typeof f!=\"function\"&&typeof f!=\"symbol\"&&typeof f!=\"boolean\"&&(e.name=f),Ci(e)}function ji(e,t,n){t===\"number\"&&uu(e.ownerDocument)===e||e.defaultValue===\"\"+n||(e.defaultValue=\"\"+n)}function yl(e,t,n,l){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t[\"$\"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty(\"$\"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&l&&(e[n].defaultSelected=!0)}else{for(n=\"\"+Ct(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Df(e,t,n){if(t!=null&&(t=\"\"+Ct(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?\"\"+Ct(n):\"\"}function Bf(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(s(92));if(Ye(l)){if(1<l.length)throw Error(s(93));l=l[0]}n=l}n==null&&(n=\"\"),t=n}n=Ct(t),e.defaultValue=n,l=e.textContent,l===n&&l!==\"\"&&l!==null&&(e.value=l),Ci(e)}function vl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var D0=new Set(\"animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp\".split(\" \"));function Hf(e,t,n){var l=t.indexOf(\"--\")===0;n==null||typeof n==\"boolean\"||n===\"\"?l?e.setProperty(t,\"\"):t===\"float\"?e.cssFloat=\"\":e[t]=\"\":l?e.setProperty(t,n):typeof n!=\"number\"||n===0||D0.has(t)?t===\"float\"?e.cssFloat=n:e[t]=(\"\"+n).trim():e[t]=n+\"px\"}function qf(e,t,n){if(t!=null&&typeof t!=\"object\")throw Error(s(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf(\"--\")===0?e.setProperty(l,\"\"):l===\"float\"?e.cssFloat=\"\":e[l]=\"\");for(var a in t)l=t[a],t.hasOwnProperty(a)&&n[a]!==l&&Hf(e,a,l)}else for(var u in t)t.hasOwnProperty(u)&&Hf(e,u,t[u])}function xi(e){if(e.indexOf(\"-\")===-1)return!1;switch(e){case\"annotation-xml\":case\"color-profile\":case\"font-face\":case\"font-face-src\":case\"font-face-uri\":case\"font-face-format\":case\"font-face-name\":case\"missing-glyph\":return!1;default:return!0}}var B0=new Map([[\"acceptCharset\",\"accept-charset\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"],[\"crossOrigin\",\"crossorigin\"],[\"accentHeight\",\"accent-height\"],[\"alignmentBaseline\",\"alignment-baseline\"],[\"arabicForm\",\"arabic-form\"],[\"baselineShift\",\"baseline-shift\"],[\"capHeight\",\"cap-height\"],[\"clipPath\",\"clip-path\"],[\"clipRule\",\"clip-rule\"],[\"colorInterpolation\",\"color-interpolation\"],[\"colorInterpolationFilters\",\"color-interpolation-filters\"],[\"colorProfile\",\"color-profile\"],[\"colorRendering\",\"color-rendering\"],[\"dominantBaseline\",\"dominant-baseline\"],[\"enableBackground\",\"enable-background\"],[\"fillOpacity\",\"fill-opacity\"],[\"fillRule\",\"fill-rule\"],[\"floodColor\",\"flood-color\"],[\"floodOpacity\",\"flood-opacity\"],[\"fontFamily\",\"font-family\"],[\"fontSize\",\"font-size\"],[\"fontSizeAdjust\",\"font-size-adjust\"],[\"fontStretch\",\"font-stretch\"],[\"fontStyle\",\"font-style\"],[\"fontVariant\",\"font-variant\"],[\"fontWeight\",\"font-weight\"],[\"glyphName\",\"glyph-name\"],[\"glyphOrientationHorizontal\",\"glyph-orientation-horizontal\"],[\"glyphOrientationVertical\",\"glyph-orientation-vertical\"],[\"horizAdvX\",\"horiz-adv-x\"],[\"horizOriginX\",\"horiz-origin-x\"],[\"imageRendering\",\"image-rendering\"],[\"letterSpacing\",\"letter-spacing\"],[\"lightingColor\",\"lighting-color\"],[\"markerEnd\",\"marker-end\"],[\"markerMid\",\"marker-mid\"],[\"markerStart\",\"marker-start\"],[\"overlinePosition\",\"overline-position\"],[\"overlineThickness\",\"overline-thickness\"],[\"paintOrder\",\"paint-order\"],[\"panose-1\",\"panose-1\"],[\"pointerEvents\",\"pointer-events\"],[\"renderingIntent\",\"rendering-intent\"],[\"shapeRendering\",\"shape-rendering\"],[\"stopColor\",\"stop-color\"],[\"stopOpacity\",\"stop-opacity\"],[\"strikethroughPosition\",\"strikethrough-position\"],[\"strikethroughThickness\",\"strikethrough-thickness\"],[\"strokeDasharray\",\"stroke-dasharray\"],[\"strokeDashoffset\",\"stroke-dashoffset\"],[\"strokeLinecap\",\"stroke-linecap\"],[\"strokeLinejoin\",\"stroke-linejoin\"],[\"strokeMiterlimit\",\"stroke-miterlimit\"],[\"strokeOpacity\",\"stroke-opacity\"],[\"strokeWidth\",\"stroke-width\"],[\"textAnchor\",\"text-anchor\"],[\"textDecoration\",\"text-decoration\"],[\"textRendering\",\"text-rendering\"],[\"transformOrigin\",\"transform-origin\"],[\"underlinePosition\",\"underline-position\"],[\"underlineThickness\",\"underline-thickness\"],[\"unicodeBidi\",\"unicode-bidi\"],[\"unicodeRange\",\"unicode-range\"],[\"unitsPerEm\",\"units-per-em\"],[\"vAlphabetic\",\"v-alphabetic\"],[\"vHanging\",\"v-hanging\"],[\"vIdeographic\",\"v-ideographic\"],[\"vMathematical\",\"v-mathematical\"],[\"vectorEffect\",\"vector-effect\"],[\"vertAdvY\",\"vert-adv-y\"],[\"vertOriginX\",\"vert-origin-x\"],[\"vertOriginY\",\"vert-origin-y\"],[\"wordSpacing\",\"word-spacing\"],[\"writingMode\",\"writing-mode\"],[\"xmlnsXlink\",\"xmlns:xlink\"],[\"xHeight\",\"x-height\"]]),H0=/^[\\\\u0000-\\\\u001F ]*j[\\\\r\\\\n\\\\t]*a[\\\\r\\\\n\\\\t]*v[\\\\r\\\\n\\\\t]*a[\\\\r\\\\n\\\\t]*s[\\\\r\\\\n\\\\t]*c[\\\\r\\\\n\\\\t]*r[\\\\r\\\\n\\\\t]*i[\\\\r\\\\n\\\\t]*p[\\\\r\\\\n\\\\t]*t[\\\\r\\\\n\\\\t]*:/i;function iu(e){return H0.test(\"\"+e)?\"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')\":e}function kt(){}var _i=null;function Mi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bl=null,Sl=null;function Yf(e){var t=hl(e);if(t&&(e=t.stateNode)){var n=e[ct]||null;e:switch(e=t.stateNode,t.type){case\"input\":if(Ni(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===\"radio\"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name=\"'+Nt(\"\"+t)+'\"][type=\"radio\"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var a=l[ct]||null;if(!a)throw Error(s(90));Ni(l,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&Rf(l)}break e;case\"textarea\":Df(e,n.value,n.defaultValue);break e;case\"select\":t=n.value,t!=null&&yl(e,!!n.multiple,t,!1)}}}var wi=!1;function Lf(e,t,n){if(wi)return e(t,n);wi=!0;try{var l=e(t);return l}finally{if(wi=!1,(bl!==null||Sl!==null)&&(ku(),bl&&(t=bl,e=Sl,Sl=bl=null,Yf(t),e)))for(t=0;t<e.length;t++)Yf(e[t])}}function aa(e,t){var n=e.stateNode;if(n===null)return null;var l=n[ct]||null;if(l===null)return null;n=l[t];e:switch(t){case\"onClick\":case\"onClickCapture\":case\"onDoubleClick\":case\"onDoubleClickCapture\":case\"onMouseDown\":case\"onMouseDownCapture\":case\"onMouseMove\":case\"onMouseMoveCapture\":case\"onMouseUp\":case\"onMouseUpCapture\":case\"onMouseEnter\":(l=!l.disabled)||(e=e.type,l=!(e===\"button\"||e===\"input\"||e===\"select\"||e===\"textarea\")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!=\"function\")throw Error(s(231,t,typeof n));return n}var Jt=!(typeof window>\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"),Ui=!1;if(Jt)try{var ua={};Object.defineProperty(ua,\"passive\",{get:function(){Ui=!0}}),window.addEventListener(\"test\",ua,ua),window.removeEventListener(\"test\",ua,ua)}catch{Ui=!1}var hn=null,Ri=null,cu=null;function Gf(){if(cu)return cu;var e,t=Ri,n=t.length,l,a=\"value\"in hn?hn.value:hn.textContent,u=a.length;for(e=0;e<n&&t[e]===a[e];e++);var f=n-e;for(l=1;l<=f&&t[n-l]===a[u-l];l++);return cu=a.slice(e,1<l?1-l:void 0)}function su(e){var t=e.keyCode;return\"charCode\"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function fu(){return!0}function Qf(){return!1}function st(e){function t(n,l,a,u,f){this._reactName=n,this._targetInst=a,this.type=l,this.nativeEvent=u,this.target=f,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(u):u[o]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?fu:Qf,this.isPropagationStopped=Qf,this}return E(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!=\"unknown\"&&(n.returnValue=!1),this.isDefaultPrevented=fu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!=\"unknown\"&&(n.cancelBubble=!0),this.isPropagationStopped=fu)},persist:function(){},isPersistent:fu}),t}var Yn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ru=st(Yn),ia=E({},Yn,{view:0,detail:0}),q0=st(ia),Oi,Di,ca,ou=E({},ia,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hi,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return\"movementX\"in e?e.movementX:(e!==ca&&(ca&&e.type===\"mousemove\"?(Oi=e.screenX-ca.screenX,Di=e.screenY-ca.screenY):Di=Oi=0,ca=e),Oi)},movementY:function(e){return\"movementY\"in e?e.movementY:Di}}),Xf=st(ou),Y0=E({},ou,{dataTransfer:0}),L0=st(Y0),G0=E({},ia,{relatedTarget:0}),Bi=st(G0),Q0=E({},Yn,{animationName:0,elapsedTime:0,pseudoElement:0}),X0=st(Q0),K0=E({},Yn,{clipboardData:function(e){return\"clipboardData\"in e?e.clipboardData:window.clipboardData}}),Z0=st(K0),V0=E({},Yn,{data:0}),Kf=st(V0),k0={Esc:\"Escape\",Spacebar:\" \",Left:\"ArrowLeft\",Up:\"ArrowUp\",Right:\"ArrowRight\",Down:\"ArrowDown\",Del:\"Delete\",Win:\"OS\",Menu:\"ContextMenu\",Apps:\"ContextMenu\",Scroll:\"ScrollLock\",MozPrintableKey:\"Unidentified\"},J0={8:\"Backspace\",9:\"Tab\",12:\"Clear\",13:\"Enter\",16:\"Shift\",17:\"Control\",18:\"Alt\",19:\"Pause\",20:\"CapsLock\",27:\"Escape\",32:\" \",33:\"PageUp\",34:\"PageDown\",35:\"End\",36:\"Home\",37:\"ArrowLeft\",38:\"ArrowUp\",39:\"ArrowRight\",40:\"ArrowDown\",45:\"Insert\",46:\"Delete\",112:\"F1\",113:\"F2\",114:\"F3\",115:\"F4\",116:\"F5\",117:\"F6\",118:\"F7\",119:\"F8\",120:\"F9\",121:\"F10\",122:\"F11\",123:\"F12\",144:\"NumLock\",145:\"ScrollLock\",224:\"Meta\"},$0={Alt:\"altKey\",Control:\"ctrlKey\",Meta:\"metaKey\",Shift:\"shiftKey\"};function F0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$0[e])?!!t[e]:!1}function Hi(){return F0}var W0=E({},ia,{key:function(e){if(e.key){var t=k0[e.key]||e.key;if(t!==\"Unidentified\")return t}return e.type===\"keypress\"?(e=su(e),e===13?\"Enter\":String.fromCharCode(e)):e.type===\"keydown\"||e.type===\"keyup\"?J0[e.keyCode]||\"Unidentified\":\"\"},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hi,charCode:function(e){return e.type===\"keypress\"?su(e):0},keyCode:function(e){return e.type===\"keydown\"||e.type===\"keyup\"?e.keyCode:0},which:function(e){return e.type===\"keypress\"?su(e):e.type===\"keydown\"||e.type===\"keyup\"?e.keyCode:0}}),I0=st(W0),P0=E({},ou,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zf=st(P0),em=E({},ia,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hi}),tm=st(em),nm=E({},Yn,{propertyName:0,elapsedTime:0,pseudoElement:0}),lm=st(nm),am=E({},ou,{deltaX:function(e){return\"deltaX\"in e?e.deltaX:\"wheelDeltaX\"in e?-e.wheelDeltaX:0},deltaY:function(e){return\"deltaY\"in e?e.deltaY:\"wheelDeltaY\"in e?-e.wheelDeltaY:\"wheelDelta\"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),um=st(am),im=E({},Yn,{newState:0,oldState:0}),cm=st(im),sm=[9,13,27,32],qi=Jt&&\"CompositionEvent\"in window,sa=null;Jt&&\"documentMode\"in document&&(sa=document.documentMode);var fm=Jt&&\"TextEvent\"in window&&!sa,Vf=Jt&&(!qi||sa&&8<sa&&11>=sa),kf=\" \",Jf=!1;function $f(e,t){switch(e){case\"keyup\":return sm.indexOf(t.keyCode)!==-1;case\"keydown\":return t.keyCode!==229;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function Ff(e){return e=e.detail,typeof e==\"object\"&&\"data\"in e?e.data:null}var pl=!1;function rm(e,t){switch(e){case\"compositionend\":return Ff(t);case\"keypress\":return t.which!==32?null:(Jf=!0,kf);case\"textInput\":return e=t.data,e===kf&&Jf?null:e;default:return null}}function om(e,t){if(pl)return e===\"compositionend\"||!qi&&$f(e,t)?(e=Gf(),cu=Ri=hn=null,pl=!1,e):null;switch(e){case\"paste\":return null;case\"keypress\":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case\"compositionend\":return Vf&&t.locale!==\"ko\"?null:t.data;default:return null}}var dm={color:!0,date:!0,datetime:!0,\"datetime-local\":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Wf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===\"input\"?!!dm[e.type]:t===\"textarea\"}function If(e,t,n,l){bl?Sl?Sl.push(l):Sl=[l]:bl=l,t=ei(t,\"onChange\"),0<t.length&&(n=new ru(\"onChange\",\"change\",null,n,l),e.push({event:n,listeners:t}))}var fa=null,ra=null;function hm(e){Dd(e,0)}function du(e){var t=la(e);if(Rf(t))return e}function Pf(e,t){if(e===\"change\")return t}var er=!1;if(Jt){var Yi;if(Jt){var Li=\"oninput\"in document;if(!Li){var tr=document.createElement(\"div\");tr.setAttribute(\"oninput\",\"return;\"),Li=typeof tr.oninput==\"function\"}Yi=Li}else Yi=!1;er=Yi&&(!document.documentMode||9<document.documentMode)}function nr(){fa&&(fa.detachEvent(\"onpropertychange\",lr),ra=fa=null)}function lr(e){if(e.propertyName===\"value\"&&du(ra)){var t=[];If(t,ra,e,Mi(e)),Lf(hm,t)}}function mm(e,t,n){e===\"focusin\"?(nr(),fa=t,ra=n,fa.attachEvent(\"onpropertychange\",lr)):e===\"focusout\"&&nr()}function gm(e){if(e===\"selectionchange\"||e===\"keyup\"||e===\"keydown\")return du(ra)}function ym(e,t){if(e===\"click\")return du(t)}function vm(e,t){if(e===\"input\"||e===\"change\")return du(t)}function bm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yt=typeof Object.is==\"function\"?Object.is:bm;function oa(e,t){if(yt(e,t))return!0;if(typeof e!=\"object\"||e===null||typeof t!=\"object\"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var a=n[l];if(!il.call(t,a)||!yt(e[a],t[a]))return!1}return!0}function ar(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ur(e,t){var n=ar(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ar(n)}}function ir(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ir(e,t.parentNode):\"contains\"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=uu(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==\"string\"}catch{n=!1}if(n)e=t.contentWindow;else break;t=uu(e.document)}return t}function Gi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===\"input\"&&(e.type===\"text\"||e.type===\"search\"||e.type===\"tel\"||e.type===\"url\"||e.type===\"password\")||t===\"textarea\"||e.contentEditable===\"true\")}var Sm=Jt&&\"documentMode\"in document&&11>=document.documentMode,El=null,Qi=null,da=null,Xi=!1;function sr(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xi||El==null||El!==uu(l)||(l=El,\"selectionStart\"in l&&Gi(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),da&&oa(da,l)||(da=l,l=ei(Qi,\"onSelect\"),0<l.length&&(t=new ru(\"onSelect\",\"select\",null,t,n),e.push({event:t,listeners:l}),t.target=El)))}function Ln(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[\"Webkit\"+e]=\"webkit\"+t,n[\"Moz\"+e]=\"moz\"+t,n}var Tl={animationend:Ln(\"Animation\",\"AnimationEnd\"),animationiteration:Ln(\"Animation\",\"AnimationIteration\"),animationstart:Ln(\"Animation\",\"AnimationStart\"),transitionrun:Ln(\"Transition\",\"TransitionRun\"),transitionstart:Ln(\"Transition\",\"TransitionStart\"),transitioncancel:Ln(\"Transition\",\"TransitionCancel\"),transitionend:Ln(\"Transition\",\"TransitionEnd\")},Ki={},fr={};Jt&&(fr=document.createElement(\"div\").style,\"AnimationEvent\"in window||(delete Tl.animationend.animation,delete Tl.animationiteration.animation,delete Tl.animationstart.animation),\"TransitionEvent\"in window||delete Tl.transitionend.transition);function Gn(e){if(Ki[e])return Ki[e];if(!Tl[e])return e;var t=Tl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in fr)return Ki[e]=t[n];return e}var rr=Gn(\"animationend\"),or=Gn(\"animationiteration\"),dr=Gn(\"animationstart\"),pm=Gn(\"transitionrun\"),Em=Gn(\"transitionstart\"),Tm=Gn(\"transitioncancel\"),hr=Gn(\"transitionend\"),mr=new Map,Zi=\"abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel\".split(\" \");Zi.push(\"scrollEnd\");function Dt(e,t){mr.set(e,t),qn(t,[e])}var hu=typeof reportError==\"function\"?reportError:function(e){if(typeof window==\"object\"&&typeof window.ErrorEvent==\"function\"){var t=new window.ErrorEvent(\"error\",{bubbles:!0,cancelable:!0,message:typeof e==\"object\"&&e!==null&&typeof e.message==\"string\"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==\"object\"&&typeof process.emit==\"function\"){process.emit(\"uncaughtException\",e);return}console.error(e)},jt=[],Al=0,Vi=0;function mu(){for(var e=Al,t=Vi=Al=0;t<e;){var n=jt[t];jt[t++]=null;var l=jt[t];jt[t++]=null;var a=jt[t];jt[t++]=null;var u=jt[t];if(jt[t++]=null,l!==null&&a!==null){var f=l.pending;f===null?a.next=a:(a.next=f.next,f.next=a),l.pending=a}u!==0&&gr(n,a,u)}}function gu(e,t,n,l){jt[Al++]=e,jt[Al++]=t,jt[Al++]=n,jt[Al++]=l,Vi|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function ki(e,t,n,l){return gu(e,t,n,l),yu(e)}function Qn(e,t){return gu(e,null,null,t),yu(e)}function gr(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var a=!1,u=e.return;u!==null;)u.childLanes|=n,l=u.alternate,l!==null&&(l.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(a=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,a&&t!==null&&(a=31-gt(n),e=u.hiddenUpdates,l=e[a],l===null?e[a]=[t]:l.push(t),t.lane=n|536870912),u):null}function yu(e){if(50<Oa)throw Oa=0,ns=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var zl={};function Am(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vt(e,t,n,l){return new Am(e,t,n,l)}function Ji(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $t(e,t){var n=e.alternate;return n===null?(n=vt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function yr(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function vu(e,t,n,l,a,u){var f=0;if(l=e,typeof e==\"function\")Ji(e)&&(f=1);else if(typeof e==\"string\")f=xg(e,n,W.current)?26:e===\"html\"||e===\"head\"||e===\"body\"?27:5;else e:switch(e){case V:return e=vt(31,n,t,a),e.elementType=V,e.lanes=u,e;case D:return Xn(n.children,a,u,t);case fe:f=8,a|=24;break;case L:return e=vt(12,n,t,a|2),e.elementType=L,e.lanes=u,e;case Ae:return e=vt(13,n,t,a),e.elementType=Ae,e.lanes=u,e;case Z:return e=vt(19,n,t,a),e.elementType=Z,e.lanes=u,e;default:if(typeof e==\"object\"&&e!==null)switch(e.$$typeof){case I:f=10;break e;case ce:f=9;break e;case $:f=11;break e;case Y:f=14;break e;case K:f=16,l=null;break e}f=29,n=Error(s(130,e===null?\"null\":typeof e,\"\")),l=null}return t=vt(f,n,t,a),t.elementType=e,t.type=l,t.lanes=u,t}function Xn(e,t,n,l){return e=vt(7,e,l,t),e.lanes=n,e}function $i(e,t,n){return e=vt(6,e,null,t),e.lanes=n,e}function vr(e){var t=vt(18,null,null,0);return t.stateNode=e,t}function Fi(e,t,n){return t=vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var br=new WeakMap;function xt(e,t){if(typeof e==\"object\"&&e!==null){var n=br.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ia(t)},br.set(e,t),t)}return{value:e,source:t,stack:Ia(t)}}var Cl=[],Nl=0,bu=null,ha=0,_t=[],Mt=0,mn=null,Yt=1,Lt=\"\";function Ft(e,t){Cl[Nl++]=ha,Cl[Nl++]=bu,bu=e,ha=t}function Sr(e,t,n){_t[Mt++]=Yt,_t[Mt++]=Lt,_t[Mt++]=mn,mn=e;var l=Yt;e=Lt;var a=32-gt(l)-1;l&=~(1<<a),n+=1;var u=32-gt(t)+a;if(30<u){var f=a-a%5;u=(l&(1<<f)-1).toString(32),l>>=f,a-=f,Yt=1<<32-gt(t)+a|n<<a|l,Lt=u+e}else Yt=1<<u|n<<a|l,Lt=e}function Wi(e){e.return!==null&&(Ft(e,1),Sr(e,1,0))}function Ii(e){for(;e===bu;)bu=Cl[--Nl],Cl[Nl]=null,ha=Cl[--Nl],Cl[Nl]=null;for(;e===mn;)mn=_t[--Mt],_t[Mt]=null,Lt=_t[--Mt],_t[Mt]=null,Yt=_t[--Mt],_t[Mt]=null}function pr(e,t){_t[Mt++]=Yt,_t[Mt++]=Lt,_t[Mt++]=mn,Yt=t.id,Lt=t.overflow,mn=e}var Ie=null,Be=null,Ee=!1,gn=null,wt=!1,Pi=Error(s(519));function yn(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?\"text\":\"HTML\",\"\"));throw ma(xt(t,e)),Pi}function Er(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[We]=e,t[ct]=l,n){case\"dialog\":ve(\"cancel\",t),ve(\"close\",t);break;case\"iframe\":case\"object\":case\"embed\":ve(\"load\",t);break;case\"video\":case\"audio\":for(n=0;n<Ba.length;n++)ve(Ba[n],t);break;case\"source\":ve(\"error\",t);break;case\"img\":case\"image\":case\"link\":ve(\"error\",t),ve(\"load\",t);break;case\"details\":ve(\"toggle\",t);break;case\"input\":ve(\"invalid\",t),Of(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case\"select\":ve(\"invalid\",t);break;case\"textarea\":ve(\"invalid\",t),Bf(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!=\"string\"&&typeof n!=\"number\"&&typeof n!=\"bigint\"||t.textContent===\"\"+n||l.suppressHydrationWarning===!0||Yd(t.textContent,n)?(l.popover!=null&&(ve(\"beforetoggle\",t),ve(\"toggle\",t)),l.onScroll!=null&&ve(\"scroll\",t),l.onScrollEnd!=null&&ve(\"scrollend\",t),l.onClick!=null&&(t.onclick=kt),t=!0):t=!1,t||yn(e,!0)}function Tr(e){for(Ie=e.return;Ie;)switch(Ie.tag){case 5:case 31:case 13:wt=!1;return;case 27:case 3:wt=!0;return;default:Ie=Ie.return}}function jl(e){if(e!==Ie)return!1;if(!Ee)return Tr(e),Ee=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==\"form\"&&n!==\"button\")||vs(e.type,e.memoizedProps)),n=!n),n&&Be&&yn(e),Tr(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Be=Jd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Be=Jd(e)}else t===27?(t=Be,Mn(e.type)?(e=Ts,Ts=null,Be=e):Be=t):Be=Ie?Rt(e.stateNode.nextSibling):null;return!0}function Kn(){Be=Ie=null,Ee=!1}function ec(){var e=gn;return e!==null&&(dt===null?dt=e:dt.push.apply(dt,e),gn=null),e}function ma(e){gn===null?gn=[e]:gn.push(e)}var tc=b(null),Zn=null,Wt=null;function vn(e,t,n){Q(tc,t._currentValue),t._currentValue=n}function It(e){e._currentValue=tc.current,U(tc)}function nc(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function lc(e,t,n,l){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var u=a.dependencies;if(u!==null){var f=a.child;u=u.firstContext;e:for(;u!==null;){var o=u;u=a;for(var y=0;y<t.length;y++)if(o.context===t[y]){u.lanes|=n,o=u.alternate,o!==null&&(o.lanes|=n),nc(u.return,n,e),l||(f=null);break e}u=o.next}}else if(a.tag===18){if(f=a.return,f===null)throw Error(s(341));f.lanes|=n,u=f.alternate,u!==null&&(u.lanes|=n),nc(f,n,e),f=null}else f=a.child;if(f!==null)f.return=a;else for(f=a;f!==null;){if(f===e){f=null;break}if(a=f.sibling,a!==null){a.return=f.return,f=a;break}f=f.return}a=f}}function xl(e,t,n,l){e=null;for(var a=t,u=!1;a!==null;){if(!u){if((a.flags&524288)!==0)u=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var f=a.alternate;if(f===null)throw Error(s(387));if(f=f.memoizedProps,f!==null){var o=a.type;yt(a.pendingProps.value,f.value)||(e!==null?e.push(o):e=[o])}}else if(a===de.current){if(f=a.alternate,f===null)throw Error(s(387));f.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Ga):e=[Ga])}a=a.return}e!==null&&lc(t,e,n,l),t.flags|=262144}function Su(e){for(e=e.firstContext;e!==null;){if(!yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Vn(e){Zn=e,Wt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pe(e){return Ar(Zn,e)}function pu(e,t){return Zn===null&&Vn(e),Ar(e,t)}function Ar(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Wt===null){if(e===null)throw Error(s(308));Wt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wt=Wt.next=t;return n}var zm=typeof AbortController<\"u\"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Cm=i.unstable_scheduleCallback,Nm=i.unstable_NormalPriority,Ke={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ac(){return{controller:new zm,data:new Map,refCount:0}}function ga(e){e.refCount--,e.refCount===0&&Cm(Nm,function(){e.controller.abort()})}var ya=null,uc=0,_l=0,Ml=null;function jm(e,t){if(ya===null){var n=ya=[];uc=0,_l=ss(),Ml={status:\"pending\",value:void 0,then:function(l){n.push(l)}}}return uc++,t.then(zr,zr),t}function zr(){if(--uc===0&&ya!==null){Ml!==null&&(Ml.status=\"fulfilled\");var e=ya;ya=null,_l=0,Ml=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function xm(e,t){var n=[],l={status:\"pending\",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){l.status=\"fulfilled\",l.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(l.status=\"rejected\",l.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),l}var Cr=M.S;M.S=function(e,t){fd=ut(),typeof t==\"object\"&&t!==null&&typeof t.then==\"function\"&&jm(e,t),Cr!==null&&Cr(e,t)};var kn=b(null);function ic(){var e=kn.current;return e!==null?e:Oe.pooledCache}function Eu(e,t){t===null?Q(kn,kn.current):Q(kn,t.pool)}function Nr(){var e=ic();return e===null?null:{parent:Ke._currentValue,pool:e}}var wl=Error(s(460)),cc=Error(s(474)),Tu=Error(s(542)),Au={then:function(){}};function jr(e){return e=e.status,e===\"fulfilled\"||e===\"rejected\"}function xr(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(kt,kt),t=n),t.status){case\"fulfilled\":return t.value;case\"rejected\":throw e=t.reason,Mr(e),e;default:if(typeof t.status==\"string\")t.then(kt,kt);else{if(e=Oe,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status=\"pending\",e.then(function(l){if(t.status===\"pending\"){var a=t;a.status=\"fulfilled\",a.value=l}},function(l){if(t.status===\"pending\"){var a=t;a.status=\"rejected\",a.reason=l}})}switch(t.status){case\"fulfilled\":return t.value;case\"rejected\":throw e=t.reason,Mr(e),e}throw $n=t,wl}}function Jn(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n==\"object\"&&typeof n.then==\"function\"?($n=n,wl):n}}var $n=null;function _r(){if($n===null)throw Error(s(459));var e=$n;return $n=null,e}function Mr(e){if(e===wl||e===Tu)throw Error(s(483))}var Ul=null,va=0;function zu(e){var t=va;return va+=1,Ul===null&&(Ul=[]),xr(Ul,e,t)}function ba(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Cu(e,t){throw t.$$typeof===j?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e===\"[object Object]\"?\"object with keys {\"+Object.keys(t).join(\", \")+\"}\":e)))}function wr(e){function t(T,S){if(e){var z=T.deletions;z===null?(T.deletions=[S],T.flags|=16):z.push(S)}}function n(T,S){if(!e)return null;for(;S!==null;)t(T,S),S=S.sibling;return null}function l(T){for(var S=new Map;T!==null;)T.key!==null?S.set(T.key,T):S.set(T.index,T),T=T.sibling;return S}function a(T,S){return T=$t(T,S),T.index=0,T.sibling=null,T}function u(T,S,z){return T.index=z,e?(z=T.alternate,z!==null?(z=z.index,z<S?(T.flags|=67108866,S):z):(T.flags|=67108866,S)):(T.flags|=1048576,S)}function f(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function o(T,S,z,R){return S===null||S.tag!==6?(S=$i(z,T.mode,R),S.return=T,S):(S=a(S,z),S.return=T,S)}function y(T,S,z,R){var le=z.type;return le===D?w(T,S,z.props.children,R,z.key):S!==null&&(S.elementType===le||typeof le==\"object\"&&le!==null&&le.$$typeof===K&&Jn(le)===S.type)?(S=a(S,z.props),ba(S,z),S.return=T,S):(S=vu(z.type,z.key,z.props,null,T.mode,R),ba(S,z),S.return=T,S)}function C(T,S,z,R){return S===null||S.tag!==4||S.stateNode.containerInfo!==z.containerInfo||S.stateNode.implementation!==z.implementation?(S=Fi(z,T.mode,R),S.return=T,S):(S=a(S,z.children||[]),S.return=T,S)}function w(T,S,z,R,le){return S===null||S.tag!==7?(S=Xn(z,T.mode,R,le),S.return=T,S):(S=a(S,z),S.return=T,S)}function O(T,S,z){if(typeof S==\"string\"&&S!==\"\"||typeof S==\"number\"||typeof S==\"bigint\")return S=$i(\"\"+S,T.mode,z),S.return=T,S;if(typeof S==\"object\"&&S!==null){switch(S.$$typeof){case B:return z=vu(S.type,S.key,S.props,null,T.mode,z),ba(z,S),z.return=T,z;case X:return S=Fi(S,T.mode,z),S.return=T,S;case K:return S=Jn(S),O(T,S,z)}if(Ye(S)||F(S))return S=Xn(S,T.mode,z,null),S.return=T,S;if(typeof S.then==\"function\")return O(T,zu(S),z);if(S.$$typeof===I)return O(T,pu(T,S),z);Cu(T,S)}return null}function x(T,S,z,R){var le=S!==null?S.key:null;if(typeof z==\"string\"&&z!==\"\"||typeof z==\"number\"||typeof z==\"bigint\")return le!==null?null:o(T,S,\"\"+z,R);if(typeof z==\"object\"&&z!==null){switch(z.$$typeof){case B:return z.key===le?y(T,S,z,R):null;case X:return z.key===le?C(T,S,z,R):null;case K:return z=Jn(z),x(T,S,z,R)}if(Ye(z)||F(z))return le!==null?null:w(T,S,z,R,null);if(typeof z.then==\"function\")return x(T,S,zu(z),R);if(z.$$typeof===I)return x(T,S,pu(T,z),R);Cu(T,z)}return null}function _(T,S,z,R,le){if(typeof R==\"string\"&&R!==\"\"||typeof R==\"number\"||typeof R==\"bigint\")return T=T.get(z)||null,o(S,T,\"\"+R,le);if(typeof R==\"object\"&&R!==null){switch(R.$$typeof){case B:return T=T.get(R.key===null?z:R.key)||null,y(S,T,R,le);case X:return T=T.get(R.key===null?z:R.key)||null,C(S,T,R,le);case K:return R=Jn(R),_(T,S,z,R,le)}if(Ye(R)||F(R))return T=T.get(z)||null,w(S,T,R,le,null);if(typeof R.then==\"function\")return _(T,S,z,zu(R),le);if(R.$$typeof===I)return _(T,S,z,pu(S,R),le);Cu(S,R)}return null}function P(T,S,z,R){for(var le=null,ze=null,te=S,ge=S=0,pe=null;te!==null&&ge<z.length;ge++){te.index>ge?(pe=te,te=null):pe=te.sibling;var Ce=x(T,te,z[ge],R);if(Ce===null){te===null&&(te=pe);break}e&&te&&Ce.alternate===null&&t(T,te),S=u(Ce,S,ge),ze===null?le=Ce:ze.sibling=Ce,ze=Ce,te=pe}if(ge===z.length)return n(T,te),Ee&&Ft(T,ge),le;if(te===null){for(;ge<z.length;ge++)te=O(T,z[ge],R),te!==null&&(S=u(te,S,ge),ze===null?le=te:ze.sibling=te,ze=te);return Ee&&Ft(T,ge),le}for(te=l(te);ge<z.length;ge++)pe=_(te,T,ge,z[ge],R),pe!==null&&(e&&pe.alternate!==null&&te.delete(pe.key===null?ge:pe.key),S=u(pe,S,ge),ze===null?le=pe:ze.sibling=pe,ze=pe);return e&&te.forEach(function(Dn){return t(T,Dn)}),Ee&&Ft(T,ge),le}function ie(T,S,z,R){if(z==null)throw Error(s(151));for(var le=null,ze=null,te=S,ge=S=0,pe=null,Ce=z.next();te!==null&&!Ce.done;ge++,Ce=z.next()){te.index>ge?(pe=te,te=null):pe=te.sibling;var Dn=x(T,te,Ce.value,R);if(Dn===null){te===null&&(te=pe);break}e&&te&&Dn.alternate===null&&t(T,te),S=u(Dn,S,ge),ze===null?le=Dn:ze.sibling=Dn,ze=Dn,te=pe}if(Ce.done)return n(T,te),Ee&&Ft(T,ge),le;if(te===null){for(;!Ce.done;ge++,Ce=z.next())Ce=O(T,Ce.value,R),Ce!==null&&(S=u(Ce,S,ge),ze===null?le=Ce:ze.sibling=Ce,ze=Ce);return Ee&&Ft(T,ge),le}for(te=l(te);!Ce.done;ge++,Ce=z.next())Ce=_(te,T,ge,Ce.value,R),Ce!==null&&(e&&Ce.alternate!==null&&te.delete(Ce.key===null?ge:Ce.key),S=u(Ce,S,ge),ze===null?le=Ce:ze.sibling=Ce,ze=Ce);return e&&te.forEach(function(Yg){return t(T,Yg)}),Ee&&Ft(T,ge),le}function Re(T,S,z,R){if(typeof z==\"object\"&&z!==null&&z.type===D&&z.key===null&&(z=z.props.children),typeof z==\"object\"&&z!==null){switch(z.$$typeof){case B:e:{for(var le=z.key;S!==null;){if(S.key===le){if(le=z.type,le===D){if(S.tag===7){n(T,S.sibling),R=a(S,z.props.children),R.return=T,T=R;break e}}else if(S.elementType===le||typeof le==\"object\"&&le!==null&&le.$$typeof===K&&Jn(le)===S.type){n(T,S.sibling),R=a(S,z.props),ba(R,z),R.return=T,T=R;break e}n(T,S);break}else t(T,S);S=S.sibling}z.type===D?(R=Xn(z.props.children,T.mode,R,z.key),R.return=T,T=R):(R=vu(z.type,z.key,z.props,null,T.mode,R),ba(R,z),R.return=T,T=R)}return f(T);case X:e:{for(le=z.key;S!==null;){if(S.key===le)if(S.tag===4&&S.stateNode.containerInfo===z.containerInfo&&S.stateNode.implementation===z.implementation){n(T,S.sibling),R=a(S,z.children||[]),R.return=T,T=R;break e}else{n(T,S);break}else t(T,S);S=S.sibling}R=Fi(z,T.mode,R),R.return=T,T=R}return f(T);case K:return z=Jn(z),Re(T,S,z,R)}if(Ye(z))return P(T,S,z,R);if(F(z)){if(le=F(z),typeof le!=\"function\")throw Error(s(150));return z=le.call(z),ie(T,S,z,R)}if(typeof z.then==\"function\")return Re(T,S,zu(z),R);if(z.$$typeof===I)return Re(T,S,pu(T,z),R);Cu(T,z)}return typeof z==\"string\"&&z!==\"\"||typeof z==\"number\"||typeof z==\"bigint\"?(z=\"\"+z,S!==null&&S.tag===6?(n(T,S.sibling),R=a(S,z),R.return=T,T=R):(n(T,S),R=$i(z,T.mode,R),R.return=T,T=R),f(T)):n(T,S)}return function(T,S,z,R){try{va=0;var le=Re(T,S,z,R);return Ul=null,le}catch(te){if(te===wl||te===Tu)throw te;var ze=vt(29,te,null,T.mode);return ze.lanes=R,ze.return=T,ze}finally{}}}var Fn=wr(!0),Ur=wr(!1),bn=!1;function sc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Sn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function pn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(je&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=yu(e),gr(e,null,n),t}return gu(e,l,t,n),yu(e)}function Sa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Af(e,n)}}function rc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var f={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?a=u=f:u=u.next=f,n=n.next}while(n!==null);u===null?a=u=t:u=u.next=t}else a=u=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var oc=!1;function pa(){if(oc){var e=Ml;if(e!==null)throw e}}function Ea(e,t,n,l){oc=!1;var a=e.updateQueue;bn=!1;var u=a.firstBaseUpdate,f=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var y=o,C=y.next;y.next=null,f===null?u=C:f.next=C,f=y;var w=e.alternate;w!==null&&(w=w.updateQueue,o=w.lastBaseUpdate,o!==f&&(o===null?w.firstBaseUpdate=C:o.next=C,w.lastBaseUpdate=y))}if(u!==null){var O=a.baseState;f=0,w=C=y=null,o=u;do{var x=o.lane&-536870913,_=x!==o.lane;if(_?(Se&x)===x:(l&x)===x){x!==0&&x===_l&&(oc=!0),w!==null&&(w=w.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var P=e,ie=o;x=t;var Re=n;switch(ie.tag){case 1:if(P=ie.payload,typeof P==\"function\"){O=P.call(Re,O,x);break e}O=P;break e;case 3:P.flags=P.flags&-65537|128;case 0:if(P=ie.payload,x=typeof P==\"function\"?P.call(Re,O,x):P,x==null)break e;O=E({},O,x);break e;case 2:bn=!0}}x=o.callback,x!==null&&(e.flags|=64,_&&(e.flags|=8192),_=a.callbacks,_===null?a.callbacks=[x]:_.push(x))}else _={lane:x,tag:o.tag,payload:o.payload,callback:o.callback,next:null},w===null?(C=w=_,y=O):w=w.next=_,f|=x;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;_=o,o=_.next,_.next=null,a.lastBaseUpdate=_,a.shared.pending=null}}while(!0);w===null&&(y=O),a.baseState=y,a.firstBaseUpdate=C,a.lastBaseUpdate=w,u===null&&(a.shared.lanes=0),Cn|=f,e.lanes=f,e.memoizedState=O}}function Rr(e,t){if(typeof e!=\"function\")throw Error(s(191,e));e.call(t)}function Or(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Rr(n[e],t)}var Rl=b(null),Nu=b(0);function Dr(e,t){e=sn,Q(Nu,e),Q(Rl,t),sn=e|t.baseLanes}function dc(){Q(Nu,sn),Q(Rl,Rl.current)}function hc(){sn=Nu.current,U(Rl),U(Nu)}var bt=b(null),Ut=null;function En(e){var t=e.alternate;Q(Qe,Qe.current&1),Q(bt,e),Ut===null&&(t===null||Rl.current!==null||t.memoizedState!==null)&&(Ut=e)}function mc(e){Q(Qe,Qe.current),Q(bt,e),Ut===null&&(Ut=e)}function Br(e){e.tag===22?(Q(Qe,Qe.current),Q(bt,e),Ut===null&&(Ut=e)):Tn()}function Tn(){Q(Qe,Qe.current),Q(bt,bt.current)}function St(e){U(bt),Ut===e&&(Ut=null),U(Qe)}var Qe=b(0);function ju(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ps(n)||Es(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===\"forwards\"||t.memoizedProps.revealOrder===\"backwards\"||t.memoizedProps.revealOrder===\"unstable_legacy-backwards\"||t.memoizedProps.revealOrder===\"together\")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pt=0,me=null,we=null,Ze=null,xu=!1,Ol=!1,Wn=!1,_u=0,Ta=0,Dl=null,_m=0;function Le(){throw Error(s(321))}function gc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yt(e[n],t[n]))return!1;return!0}function yc(e,t,n,l,a,u){return Pt=u,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?po:wc,Wn=!1,u=n(l,a),Wn=!1,Ol&&(u=qr(t,n,l,a)),Hr(e),u}function Hr(e){M.H=Ca;var t=we!==null&&we.next!==null;if(Pt=0,Ze=we=me=null,xu=!1,Ta=0,Dl=null,t)throw Error(s(300));e===null||Ve||(e=e.dependencies,e!==null&&Su(e)&&(Ve=!0))}function qr(e,t,n,l){me=e;var a=0;do{if(Ol&&(Dl=null),Ta=0,Ol=!1,25<=a)throw Error(s(301));if(a+=1,Ze=we=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}M.H=Eo,u=t(n,l)}while(Ol);return u}function Mm(){var e=M.H,t=e.useState()[0];return t=typeof t.then==\"function\"?Aa(t):t,e=e.useState()[0],(we!==null?we.memoizedState:null)!==e&&(me.flags|=1024),t}function vc(){var e=_u!==0;return _u=0,e}function bc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Sc(e){if(xu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}xu=!1}Pt=0,Ze=we=me=null,Ol=!1,Ta=_u=0,Dl=null}function it(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?me.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function Xe(){if(we===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=we.next;var t=Ze===null?me.memoizedState:Ze.next;if(t!==null)Ze=t,we=e;else{if(e===null)throw me.alternate===null?Error(s(467)):Error(s(310));we=e,e={memoizedState:we.memoizedState,baseState:we.baseState,baseQueue:we.baseQueue,queue:we.queue,next:null},Ze===null?me.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function Mu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Aa(e){var t=Ta;return Ta+=1,Dl===null&&(Dl=[]),e=xr(Dl,e,t),t=me,(Ze===null?t.memoizedState:Ze.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?po:wc),e}function wu(e){if(e!==null&&typeof e==\"object\"){if(typeof e.then==\"function\")return Aa(e);if(e.$$typeof===I)return Pe(e)}throw Error(s(438,String(e)))}function pc(e){var t=null,n=me.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=me.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Mu(),me.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=ne;return t.index++,n}function en(e,t){return typeof t==\"function\"?t(e):t}function Uu(e){var t=Xe();return Ec(t,we,e)}function Ec(e,t,n){var l=e.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=n;var a=e.baseQueue,u=l.pending;if(u!==null){if(a!==null){var f=a.next;a.next=u.next,u.next=f}t.baseQueue=a=u,l.pending=null}if(u=e.baseState,a===null)e.memoizedState=u;else{t=a.next;var o=f=null,y=null,C=t,w=!1;do{var O=C.lane&-536870913;if(O!==C.lane?(Se&O)===O:(Pt&O)===O){var x=C.revertLane;if(x===0)y!==null&&(y=y.next={lane:0,revertLane:0,gesture:null,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null}),O===_l&&(w=!0);else if((Pt&x)===x){C=C.next,x===_l&&(w=!0);continue}else O={lane:0,revertLane:C.revertLane,gesture:null,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null},y===null?(o=y=O,f=u):y=y.next=O,me.lanes|=x,Cn|=x;O=C.action,Wn&&n(u,O),u=C.hasEagerState?C.eagerState:n(u,O)}else x={lane:O,revertLane:C.revertLane,gesture:C.gesture,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null},y===null?(o=y=x,f=u):y=y.next=x,me.lanes|=O,Cn|=O;C=C.next}while(C!==null&&C!==t);if(y===null?f=u:y.next=o,!yt(u,e.memoizedState)&&(Ve=!0,w&&(n=Ml,n!==null)))throw n;e.memoizedState=u,e.baseState=f,e.baseQueue=y,l.lastRenderedState=u}return a===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Tc(e){var t=Xe(),n=t.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=e;var l=n.dispatch,a=n.pending,u=t.memoizedState;if(a!==null){n.pending=null;var f=a=a.next;do u=e(u,f.action),f=f.next;while(f!==a);yt(u,t.memoizedState)||(Ve=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,l]}function Yr(e,t,n){var l=me,a=Xe(),u=Ee;if(u){if(n===void 0)throw Error(s(407));n=n()}else n=t();var f=!yt((we||a).memoizedState,n);if(f&&(a.memoizedState=n,Ve=!0),a=a.queue,Cc(Qr.bind(null,l,a,e),[e]),a.getSnapshot!==t||f||Ze!==null&&Ze.memoizedState.tag&1){if(l.flags|=2048,Bl(9,{destroy:void 0},Gr.bind(null,l,a,n,t),null),Oe===null)throw Error(s(349));u||(Pt&127)!==0||Lr(l,t,n)}return n}function Lr(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=me.updateQueue,t===null?(t=Mu(),me.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Gr(e,t,n,l){t.value=n,t.getSnapshot=l,Xr(t)&&Kr(e)}function Qr(e,t,n){return n(function(){Xr(t)&&Kr(e)})}function Xr(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yt(e,n)}catch{return!0}}function Kr(e){var t=Qn(e,2);t!==null&&ht(t,e,2)}function Ac(e){var t=it();if(typeof e==\"function\"){var n=e;if(e=n(),Wn){on(!0);try{n()}finally{on(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:en,lastRenderedState:e},t}function Zr(e,t,n,l){return e.baseState=n,Ec(e,we,typeof l==\"function\"?l:en)}function wm(e,t,n,l,a){if(Du(e))throw Error(s(485));if(e=t.action,e!==null){var u={payload:a,action:e,next:null,isTransition:!0,status:\"pending\",value:null,reason:null,listeners:[],then:function(f){u.listeners.push(f)}};M.T!==null?n(!0):u.isTransition=!1,l(u),n=t.pending,n===null?(u.next=t.pending=u,Vr(t,u)):(u.next=n.next,t.pending=n.next=u)}}function Vr(e,t){var n=t.action,l=t.payload,a=e.state;if(t.isTransition){var u=M.T,f={};M.T=f;try{var o=n(a,l),y=M.S;y!==null&&y(f,o),kr(e,t,o)}catch(C){zc(e,t,C)}finally{u!==null&&f.types!==null&&(u.types=f.types),M.T=u}}else try{u=n(a,l),kr(e,t,u)}catch(C){zc(e,t,C)}}function kr(e,t,n){n!==null&&typeof n==\"object\"&&typeof n.then==\"function\"?n.then(function(l){Jr(e,t,l)},function(l){return zc(e,t,l)}):Jr(e,t,n)}function Jr(e,t,n){t.status=\"fulfilled\",t.value=n,$r(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Vr(e,n)))}function zc(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status=\"rejected\",t.reason=n,$r(t),t=t.next;while(t!==l)}e.action=null}function $r(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Fr(e,t){return t}function Wr(e,t){if(Ee){var n=Oe.formState;if(n!==null){e:{var l=me;if(Ee){if(Be){t:{for(var a=Be,u=wt;a.nodeType!==8;){if(!u){a=null;break t}if(a=Rt(a.nextSibling),a===null){a=null;break t}}u=a.data,a=u===\"F!\"||u===\"F\"?a:null}if(a){Be=Rt(a.nextSibling),l=a.data===\"F!\";break e}}yn(l)}l=!1}l&&(t=n[0])}}return n=it(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:t},n.queue=l,n=vo.bind(null,me,l),l.dispatch=n,l=Ac(!1),u=Mc.bind(null,me,!1,l.queue),l=it(),a={state:t,dispatch:null,action:e,pending:null},l.queue=a,n=wm.bind(null,me,a,u,n),a.dispatch=n,l.memoizedState=e,[t,n,!1]}function Ir(e){var t=Xe();return Pr(t,we,e)}function Pr(e,t,n){if(t=Ec(e,t,Fr)[0],e=Uu(en)[0],typeof t==\"object\"&&t!==null&&typeof t.then==\"function\")try{var l=Aa(t)}catch(f){throw f===wl?Tu:f}else l=t;t=Xe();var a=t.queue,u=a.dispatch;return n!==t.memoizedState&&(me.flags|=2048,Bl(9,{destroy:void 0},Um.bind(null,a,n),null)),[l,u,e]}function Um(e,t){e.action=t}function eo(e){var t=Xe(),n=we;if(n!==null)return Pr(t,n,e);Xe(),t=t.memoizedState,n=Xe();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Bl(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=me.updateQueue,t===null&&(t=Mu(),me.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function to(){return Xe().memoizedState}function Ru(e,t,n,l){var a=it();me.flags|=e,a.memoizedState=Bl(1|t,{destroy:void 0},n,l===void 0?null:l)}function Ou(e,t,n,l){var a=Xe();l=l===void 0?null:l;var u=a.memoizedState.inst;we!==null&&l!==null&&gc(l,we.memoizedState.deps)?a.memoizedState=Bl(t,u,n,l):(me.flags|=e,a.memoizedState=Bl(1|t,u,n,l))}function no(e,t){Ru(8390656,8,e,t)}function Cc(e,t){Ou(2048,8,e,t)}function Rm(e){me.flags|=4;var t=me.updateQueue;if(t===null)t=Mu(),me.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function lo(e){var t=Xe().memoizedState;return Rm({ref:t,nextImpl:e}),function(){if((je&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function ao(e,t){return Ou(4,2,e,t)}function uo(e,t){return Ou(4,4,e,t)}function io(e,t){if(typeof t==\"function\"){e=e();var n=t(e);return function(){typeof n==\"function\"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function co(e,t,n){n=n!=null?n.concat([e]):null,Ou(4,4,io.bind(null,t,e),n)}function Nc(){}function so(e,t){var n=Xe();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&gc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function fo(e,t){var n=Xe();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&gc(t,l[1]))return l[0];if(l=e(),Wn){on(!0);try{e()}finally{on(!1)}}return n.memoizedState=[l,t],l}function jc(e,t,n){return n===void 0||(Pt&1073741824)!==0&&(Se&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=od(),me.lanes|=e,Cn|=e,n)}function ro(e,t,n,l){return yt(n,t)?n:Rl.current!==null?(e=jc(e,n,l),yt(e,t)||(Ve=!0),e):(Pt&42)===0||(Pt&1073741824)!==0&&(Se&261930)===0?(Ve=!0,e.memoizedState=n):(e=od(),me.lanes|=e,Cn|=e,t)}function oo(e,t,n,l,a){var u=G.p;G.p=u!==0&&8>u?u:8;var f=M.T,o={};M.T=o,Mc(e,!1,t,n);try{var y=a(),C=M.S;if(C!==null&&C(o,y),y!==null&&typeof y==\"object\"&&typeof y.then==\"function\"){var w=xm(y,l);za(e,t,w,Tt(e))}else za(e,t,l,Tt(e))}catch(O){za(e,t,{then:function(){},status:\"rejected\",reason:O},Tt())}finally{G.p=u,f!==null&&o.types!==null&&(f.types=o.types),M.T=f}}function Om(){}function xc(e,t,n,l){if(e.tag!==5)throw Error(s(476));var a=ho(e).queue;oo(e,a,t,ae,n===null?Om:function(){return mo(e),n(l)})}function ho(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:en,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:en,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function mo(e){var t=ho(e);t.next===null&&(t=e.alternate.memoizedState),za(e,t.next.queue,{},Tt())}function _c(){return Pe(Ga)}function go(){return Xe().memoizedState}function yo(){return Xe().memoizedState}function Dm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tt();e=Sn(n);var l=pn(t,e,n);l!==null&&(ht(l,t,n),Sa(l,t,n)),t={cache:ac()},e.payload=t;return}t=t.return}}function Bm(e,t,n){var l=Tt();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Du(e)?bo(t,n):(n=ki(e,t,n,l),n!==null&&(ht(n,e,l),So(n,t,l)))}function vo(e,t,n){var l=Tt();za(e,t,n,l)}function za(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Du(e))bo(t,a);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var f=t.lastRenderedState,o=u(f,n);if(a.hasEagerState=!0,a.eagerState=o,yt(o,f))return gu(e,t,a,0),Oe===null&&mu(),!1}catch{}finally{}if(n=ki(e,t,a,l),n!==null)return ht(n,e,l),So(n,t,l),!0}return!1}function Mc(e,t,n,l){if(l={lane:2,revertLane:ss(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Du(e)){if(t)throw Error(s(479))}else t=ki(e,n,l,2),t!==null&&ht(t,e,2)}function Du(e){var t=e.alternate;return e===me||t!==null&&t===me}function bo(e,t){Ol=xu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function So(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Af(e,n)}}var Ca={readContext:Pe,use:wu,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useLayoutEffect:Le,useInsertionEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useSyncExternalStore:Le,useId:Le,useHostTransitionStatus:Le,useFormState:Le,useActionState:Le,useOptimistic:Le,useMemoCache:Le,useCacheRefresh:Le};Ca.useEffectEvent=Le;var po={readContext:Pe,use:wu,useCallback:function(e,t){return it().memoizedState=[e,t===void 0?null:t],e},useContext:Pe,useEffect:no,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ru(4194308,4,io.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ru(4194308,4,e,t)},useInsertionEffect:function(e,t){Ru(4,2,e,t)},useMemo:function(e,t){var n=it();t=t===void 0?null:t;var l=e();if(Wn){on(!0);try{e()}finally{on(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=it();if(n!==void 0){var a=n(t);if(Wn){on(!0);try{n(t)}finally{on(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=Bm.bind(null,me,e),[l.memoizedState,e]},useRef:function(e){var t=it();return e={current:e},t.memoizedState=e},useState:function(e){e=Ac(e);var t=e.queue,n=vo.bind(null,me,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Nc,useDeferredValue:function(e,t){var n=it();return jc(n,e,t)},useTransition:function(){var e=Ac(!1);return e=oo.bind(null,me,e.queue,!0,!1),it().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=me,a=it();if(Ee){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),Oe===null)throw Error(s(349));(Se&127)!==0||Lr(l,t,n)}a.memoizedState=n;var u={value:n,getSnapshot:t};return a.queue=u,no(Qr.bind(null,l,u,e),[e]),l.flags|=2048,Bl(9,{destroy:void 0},Gr.bind(null,l,u,n,t),null),n},useId:function(){var e=it(),t=Oe.identifierPrefix;if(Ee){var n=Lt,l=Yt;n=(l&~(1<<32-gt(l)-1)).toString(32)+n,t=\"_\"+t+\"R_\"+n,n=_u++,0<n&&(t+=\"H\"+n.toString(32)),t+=\"_\"}else n=_m++,t=\"_\"+t+\"r_\"+n.toString(32)+\"_\";return e.memoizedState=t},useHostTransitionStatus:_c,useFormState:Wr,useActionState:Wr,useOptimistic:function(e){var t=it();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Mc.bind(null,me,!0,n),n.dispatch=t,[e,t]},useMemoCache:pc,useCacheRefresh:function(){return it().memoizedState=Dm.bind(null,me)},useEffectEvent:function(e){var t=it(),n={impl:e};return t.memoizedState=n,function(){if((je&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}},wc={readContext:Pe,use:wu,useCallback:so,useContext:Pe,useEffect:Cc,useImperativeHandle:co,useInsertionEffect:ao,useLayoutEffect:uo,useMemo:fo,useReducer:Uu,useRef:to,useState:function(){return Uu(en)},useDebugValue:Nc,useDeferredValue:function(e,t){var n=Xe();return ro(n,we.memoizedState,e,t)},useTransition:function(){var e=Uu(en)[0],t=Xe().memoizedState;return[typeof e==\"boolean\"?e:Aa(e),t]},useSyncExternalStore:Yr,useId:go,useHostTransitionStatus:_c,useFormState:Ir,useActionState:Ir,useOptimistic:function(e,t){var n=Xe();return Zr(n,we,e,t)},useMemoCache:pc,useCacheRefresh:yo};wc.useEffectEvent=lo;var Eo={readContext:Pe,use:wu,useCallback:so,useContext:Pe,useEffect:Cc,useImperativeHandle:co,useInsertionEffect:ao,useLayoutEffect:uo,useMemo:fo,useReducer:Tc,useRef:to,useState:function(){return Tc(en)},useDebugValue:Nc,useDeferredValue:function(e,t){var n=Xe();return we===null?jc(n,e,t):ro(n,we.memoizedState,e,t)},useTransition:function(){var e=Tc(en)[0],t=Xe().memoizedState;return[typeof e==\"boolean\"?e:Aa(e),t]},useSyncExternalStore:Yr,useId:go,useHostTransitionStatus:_c,useFormState:eo,useActionState:eo,useOptimistic:function(e,t){var n=Xe();return we!==null?Zr(n,we,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:pc,useCacheRefresh:yo};Eo.useEffectEvent=lo;function Uc(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:E({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Rc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=Tt(),a=Sn(l);a.payload=t,n!=null&&(a.callback=n),t=pn(e,a,l),t!==null&&(ht(t,e,l),Sa(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=Tt(),a=Sn(l);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=pn(e,a,l),t!==null&&(ht(t,e,l),Sa(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tt(),l=Sn(n);l.tag=2,t!=null&&(l.callback=t),t=pn(e,l,n),t!==null&&(ht(t,e,n),Sa(t,e,n))}};function To(e,t,n,l,a,u,f){return e=e.stateNode,typeof e.shouldComponentUpdate==\"function\"?e.shouldComponentUpdate(l,u,f):t.prototype&&t.prototype.isPureReactComponent?!oa(n,l)||!oa(a,u):!0}function Ao(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps==\"function\"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps==\"function\"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Rc.enqueueReplaceState(t,t.state,null)}function In(e,t){var n=t;if(\"ref\"in t){n={};for(var l in t)l!==\"ref\"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=E({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function zo(e){hu(e)}function Co(e){console.error(e)}function No(e){hu(e)}function Bu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function jo(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Oc(e,t,n){return n=Sn(n),n.tag=3,n.payload={element:null},n.callback=function(){Bu(e,t)},n}function xo(e){return e=Sn(e),e.tag=3,e}function _o(e,t,n,l){var a=n.type.getDerivedStateFromError;if(typeof a==\"function\"){var u=l.value;e.payload=function(){return a(u)},e.callback=function(){jo(t,n,l)}}var f=n.stateNode;f!==null&&typeof f.componentDidCatch==\"function\"&&(e.callback=function(){jo(t,n,l),typeof a!=\"function\"&&(Nn===null?Nn=new Set([this]):Nn.add(this));var o=l.stack;this.componentDidCatch(l.value,{componentStack:o!==null?o:\"\"})})}function Hm(e,t,n,l,a){if(n.flags|=32768,l!==null&&typeof l==\"object\"&&typeof l.then==\"function\"){if(t=n.alternate,t!==null&&xl(t,n,a,!0),n=bt.current,n!==null){switch(n.tag){case 31:case 13:return Ut===null?Ju():n.alternate===null&&Ge===0&&(Ge=3),n.flags&=-257,n.flags|=65536,n.lanes=a,l===Au?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),us(e,l,a)),!1;case 22:return n.flags|=65536,l===Au?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),us(e,l,a)),!1}throw Error(s(435,n.tag))}return us(e,l,a),Ju(),!1}if(Ee)return t=bt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,l!==Pi&&(e=Error(s(422),{cause:l}),ma(xt(e,n)))):(l!==Pi&&(t=Error(s(423),{cause:l}),ma(xt(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,l=xt(l,n),a=Oc(e.stateNode,l,a),rc(e,a),Ge!==4&&(Ge=2)),!1;var u=Error(s(520),{cause:l});if(u=xt(u,n),Ra===null?Ra=[u]:Ra.push(u),Ge!==4&&(Ge=2),t===null)return!0;l=xt(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Oc(n.stateNode,l,e),rc(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError==\"function\"||u!==null&&typeof u.componentDidCatch==\"function\"&&(Nn===null||!Nn.has(u))))return n.flags|=65536,a&=-a,n.lanes|=a,a=xo(a),_o(a,e,n,l),rc(n,a),!1}n=n.return}while(n!==null);return!1}var Dc=Error(s(461)),Ve=!1;function et(e,t,n,l){t.child=e===null?Ur(t,null,n,l):Fn(t,e.child,n,l)}function Mo(e,t,n,l,a){n=n.render;var u=t.ref;if(\"ref\"in l){var f={};for(var o in l)o!==\"ref\"&&(f[o]=l[o])}else f=l;return Vn(t),l=yc(e,t,n,f,u,a),o=vc(),e!==null&&!Ve?(bc(e,t,a),tn(e,t,a)):(Ee&&o&&Wi(t),t.flags|=1,et(e,t,l,a),t.child)}function wo(e,t,n,l,a){if(e===null){var u=n.type;return typeof u==\"function\"&&!Ji(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,Uo(e,t,u,l,a)):(e=vu(n.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Xc(e,a)){var f=u.memoizedProps;if(n=n.compare,n=n!==null?n:oa,n(f,l)&&e.ref===t.ref)return tn(e,t,a)}return t.flags|=1,e=$t(u,l),e.ref=t.ref,e.return=t,t.child=e}function Uo(e,t,n,l,a){if(e!==null){var u=e.memoizedProps;if(oa(u,l)&&e.ref===t.ref)if(Ve=!1,t.pendingProps=l=u,Xc(e,a))(e.flags&131072)!==0&&(Ve=!0);else return t.lanes=e.lanes,tn(e,t,a)}return Bc(e,t,n,l,a)}function Ro(e,t,n,l){var a=l.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode===\"hidden\"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|n:n,e!==null){for(l=t.child=e.child,a=0;l!==null;)a=a|l.lanes|l.childLanes,l=l.sibling;l=a&~u}else l=0,t.child=null;return Oo(e,t,u,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Eu(t,u!==null?u.cachePool:null),u!==null?Dr(t,u):dc(),Br(t);else return l=t.lanes=536870912,Oo(e,t,u!==null?u.baseLanes|n:n,n,l)}else u!==null?(Eu(t,u.cachePool),Dr(t,u),Tn(),t.memoizedState=null):(e!==null&&Eu(t,null),dc(),Tn());return et(e,t,a,n),t.child}function Na(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Oo(e,t,n,l,a){var u=ic();return u=u===null?null:{parent:Ke._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&Eu(t,null),dc(),Br(t),e!==null&&xl(e,t,l,!0),t.childLanes=a,null}function Hu(e,t){return t=Yu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Do(e,t,n){return Fn(t,e.child,null,n),e=Hu(t,t.pendingProps),e.flags|=2,St(t),t.memoizedState=null,e}function qm(e,t,n){var l=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ee){if(l.mode===\"hidden\")return e=Hu(t,l),t.lanes=536870912,Na(null,e);if(mc(t),(e=Be)?(e=kd(e,wt),e=e!==null&&e.data===\"&\"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:mn!==null?{id:Yt,overflow:Lt}:null,retryLane:536870912,hydrationErrors:null},n=vr(e),n.return=t,t.child=n,Ie=t,Be=null)):e=null,e===null)throw yn(t);return t.lanes=536870912,null}return Hu(t,l)}var u=e.memoizedState;if(u!==null){var f=u.dehydrated;if(mc(t),a)if(t.flags&256)t.flags&=-257,t=Do(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(Ve||xl(e,t,n,!1),a=(n&e.childLanes)!==0,Ve||a){if(l=Oe,l!==null&&(f=zf(l,n),f!==0&&f!==u.retryLane))throw u.retryLane=f,Qn(e,f),ht(l,e,f),Dc;Ju(),t=Do(e,t,n)}else e=u.treeContext,Be=Rt(f.nextSibling),Ie=t,Ee=!0,gn=null,wt=!1,e!==null&&pr(t,e),t=Hu(t,l),t.flags|=4096;return t}return e=$t(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qu(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=\"function\"&&typeof n!=\"object\")throw Error(s(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Bc(e,t,n,l,a){return Vn(t),n=yc(e,t,n,l,void 0,a),l=vc(),e!==null&&!Ve?(bc(e,t,a),tn(e,t,a)):(Ee&&l&&Wi(t),t.flags|=1,et(e,t,n,a),t.child)}function Bo(e,t,n,l,a,u){return Vn(t),t.updateQueue=null,n=qr(t,l,n,a),Hr(e),l=vc(),e!==null&&!Ve?(bc(e,t,u),tn(e,t,u)):(Ee&&l&&Wi(t),t.flags|=1,et(e,t,n,u),t.child)}function Ho(e,t,n,l,a){if(Vn(t),t.stateNode===null){var u=zl,f=n.contextType;typeof f==\"object\"&&f!==null&&(u=Pe(f)),u=new n(l,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Rc,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=l,u.state=t.memoizedState,u.refs={},sc(t),f=n.contextType,u.context=typeof f==\"object\"&&f!==null?Pe(f):zl,u.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f==\"function\"&&(Uc(t,n,f,l),u.state=t.memoizedState),typeof n.getDerivedStateFromProps==\"function\"||typeof u.getSnapshotBeforeUpdate==\"function\"||typeof u.UNSAFE_componentWillMount!=\"function\"&&typeof u.componentWillMount!=\"function\"||(f=u.state,typeof u.componentWillMount==\"function\"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount==\"function\"&&u.UNSAFE_componentWillMount(),f!==u.state&&Rc.enqueueReplaceState(u,u.state,null),Ea(t,l,u,a),pa(),u.state=t.memoizedState),typeof u.componentDidMount==\"function\"&&(t.flags|=4194308),l=!0}else if(e===null){u=t.stateNode;var o=t.memoizedProps,y=In(n,o);u.props=y;var C=u.context,w=n.contextType;f=zl,typeof w==\"object\"&&w!==null&&(f=Pe(w));var O=n.getDerivedStateFromProps;w=typeof O==\"function\"||typeof u.getSnapshotBeforeUpdate==\"function\",o=t.pendingProps!==o,w||typeof u.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof u.componentWillReceiveProps!=\"function\"||(o||C!==f)&&Ao(t,u,l,f),bn=!1;var x=t.memoizedState;u.state=x,Ea(t,l,u,a),pa(),C=t.memoizedState,o||x!==C||bn?(typeof O==\"function\"&&(Uc(t,n,O,l),C=t.memoizedState),(y=bn||To(t,n,y,l,x,C,f))?(w||typeof u.UNSAFE_componentWillMount!=\"function\"&&typeof u.componentWillMount!=\"function\"||(typeof u.componentWillMount==\"function\"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount==\"function\"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount==\"function\"&&(t.flags|=4194308)):(typeof u.componentDidMount==\"function\"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=C),u.props=l,u.state=C,u.context=f,l=y):(typeof u.componentDidMount==\"function\"&&(t.flags|=4194308),l=!1)}else{u=t.stateNode,fc(e,t),f=t.memoizedProps,w=In(n,f),u.props=w,O=t.pendingProps,x=u.context,C=n.contextType,y=zl,typeof C==\"object\"&&C!==null&&(y=Pe(C)),o=n.getDerivedStateFromProps,(C=typeof o==\"function\"||typeof u.getSnapshotBeforeUpdate==\"function\")||typeof u.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof u.componentWillReceiveProps!=\"function\"||(f!==O||x!==y)&&Ao(t,u,l,y),bn=!1,x=t.memoizedState,u.state=x,Ea(t,l,u,a),pa();var _=t.memoizedState;f!==O||x!==_||bn||e!==null&&e.dependencies!==null&&Su(e.dependencies)?(typeof o==\"function\"&&(Uc(t,n,o,l),_=t.memoizedState),(w=bn||To(t,n,w,l,x,_,y)||e!==null&&e.dependencies!==null&&Su(e.dependencies))?(C||typeof u.UNSAFE_componentWillUpdate!=\"function\"&&typeof u.componentWillUpdate!=\"function\"||(typeof u.componentWillUpdate==\"function\"&&u.componentWillUpdate(l,_,y),typeof u.UNSAFE_componentWillUpdate==\"function\"&&u.UNSAFE_componentWillUpdate(l,_,y)),typeof u.componentDidUpdate==\"function\"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate==\"function\"&&(t.flags|=1024)):(typeof u.componentDidUpdate!=\"function\"||f===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!=\"function\"||f===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=_),u.props=l,u.state=_,u.context=y,l=w):(typeof u.componentDidUpdate!=\"function\"||f===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!=\"function\"||f===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),l=!1)}return u=l,qu(e,t),l=(t.flags&128)!==0,u||l?(u=t.stateNode,n=l&&typeof n.getDerivedStateFromError!=\"function\"?null:u.render(),t.flags|=1,e!==null&&l?(t.child=Fn(t,e.child,null,a),t.child=Fn(t,null,n,a)):et(e,t,n,a),t.memoizedState=u.state,e=t.child):e=tn(e,t,a),e}function qo(e,t,n,l){return Kn(),t.flags|=256,et(e,t,n,l),t.child}var Hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:Nr()}}function Yc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Et),e}function Yo(e,t,n){var l=t.pendingProps,a=!1,u=(t.flags&128)!==0,f;if((f=u)||(f=e!==null&&e.memoizedState===null?!1:(Qe.current&2)!==0),f&&(a=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ee){if(a?En(t):Tn(),(e=Be)?(e=kd(e,wt),e=e!==null&&e.data!==\"&\"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:mn!==null?{id:Yt,overflow:Lt}:null,retryLane:536870912,hydrationErrors:null},n=vr(e),n.return=t,t.child=n,Ie=t,Be=null)):e=null,e===null)throw yn(t);return Es(e)?t.lanes=32:t.lanes=536870912,null}var o=l.children;return l=l.fallback,a?(Tn(),a=t.mode,o=Yu({mode:\"hidden\",children:o},a),l=Xn(l,a,n,null),o.return=t,l.return=t,o.sibling=l,t.child=o,l=t.child,l.memoizedState=qc(n),l.childLanes=Yc(e,f,n),t.memoizedState=Hc,Na(null,l)):(En(t),Lc(t,o))}var y=e.memoizedState;if(y!==null&&(o=y.dehydrated,o!==null)){if(u)t.flags&256?(En(t),t.flags&=-257,t=Gc(e,t,n)):t.memoizedState!==null?(Tn(),t.child=e.child,t.flags|=128,t=null):(Tn(),o=l.fallback,a=t.mode,l=Yu({mode:\"visible\",children:l.children},a),o=Xn(o,a,n,null),o.flags|=2,l.return=t,o.return=t,l.sibling=o,t.child=l,Fn(t,e.child,null,n),l=t.child,l.memoizedState=qc(n),l.childLanes=Yc(e,f,n),t.memoizedState=Hc,t=Na(null,l));else if(En(t),Es(o)){if(f=o.nextSibling&&o.nextSibling.dataset,f)var C=f.dgst;f=C,l=Error(s(419)),l.stack=\"\",l.digest=f,ma({value:l,source:null,stack:null}),t=Gc(e,t,n)}else if(Ve||xl(e,t,n,!1),f=(n&e.childLanes)!==0,Ve||f){if(f=Oe,f!==null&&(l=zf(f,n),l!==0&&l!==y.retryLane))throw y.retryLane=l,Qn(e,l),ht(f,e,l),Dc;ps(o)||Ju(),t=Gc(e,t,n)}else ps(o)?(t.flags|=192,t.child=e.child,t=null):(e=y.treeContext,Be=Rt(o.nextSibling),Ie=t,Ee=!0,gn=null,wt=!1,e!==null&&pr(t,e),t=Lc(t,l.children),t.flags|=4096);return t}return a?(Tn(),o=l.fallback,a=t.mode,y=e.child,C=y.sibling,l=$t(y,{mode:\"hidden\",children:l.children}),l.subtreeFlags=y.subtreeFlags&65011712,C!==null?o=$t(C,o):(o=Xn(o,a,n,null),o.flags|=2),o.return=t,l.return=t,l.sibling=o,t.child=l,Na(null,l),l=t.child,o=e.child.memoizedState,o===null?o=qc(n):(a=o.cachePool,a!==null?(y=Ke._currentValue,a=a.parent!==y?{parent:y,pool:y}:a):a=Nr(),o={baseLanes:o.baseLanes|n,cachePool:a}),l.memoizedState=o,l.childLanes=Yc(e,f,n),t.memoizedState=Hc,Na(e.child,l)):(En(t),n=e.child,e=n.sibling,n=$t(n,{mode:\"visible\",children:l.children}),n.return=t,n.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=n,t.memoizedState=null,n)}function Lc(e,t){return t=Yu({mode:\"visible\",children:t},e.mode),t.return=e,e.child=t}function Yu(e,t){return e=vt(22,e,null,t),e.lanes=0,e}function Gc(e,t,n){return Fn(t,e.child,null,n),e=Lc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Lo(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),nc(e.return,t,n)}function Qc(e,t,n,l,a,u){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:a,treeForkCount:u}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=l,f.tail=n,f.tailMode=a,f.treeForkCount=u)}function Go(e,t,n){var l=t.pendingProps,a=l.revealOrder,u=l.tail;l=l.children;var f=Qe.current,o=(f&2)!==0;if(o?(f=f&1|2,t.flags|=128):f&=1,Q(Qe,f),et(e,t,l,n),l=Ee?ha:0,!o&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Lo(e,n,t);else if(e.tag===19)Lo(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case\"forwards\":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&ju(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Qc(t,!1,a,n,u,l);break;case\"backwards\":case\"unstable_legacy-backwards\":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&ju(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Qc(t,!0,n,null,u,l);break;case\"together\":Qc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function tn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Cn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(xl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,n=$t(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$t(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Xc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Su(e)))}function Ym(e,t,n){switch(t.tag){case 3:Me(t,t.stateNode.containerInfo),vn(t,Ke,e.memoizedState.cache),Kn();break;case 27:case 5:nt(t);break;case 4:Me(t,t.stateNode.containerInfo);break;case 10:vn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(En(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Yo(e,t,n):(En(t),e=tn(e,t,n),e!==null?e.sibling:null);En(t);break;case 19:var a=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(xl(e,t,n,!1),l=(n&t.childLanes)!==0),a){if(l)return Go(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Q(Qe,Qe.current),l)break;return null;case 22:return t.lanes=0,Ro(e,t,n,t.pendingProps);case 24:vn(t,Ke,e.memoizedState.cache)}return tn(e,t,n)}function Qo(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ve=!0;else{if(!Xc(e,n)&&(t.flags&128)===0)return Ve=!1,Ym(e,t,n);Ve=(e.flags&131072)!==0}else Ve=!1,Ee&&(t.flags&1048576)!==0&&Sr(t,ha,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Jn(t.elementType),t.type=e,typeof e==\"function\")Ji(e)?(l=In(e,l),t.tag=1,t=Ho(null,t,e,l,n)):(t.tag=0,t=Bc(null,t,e,l,n));else{if(e!=null){var a=e.$$typeof;if(a===$){t.tag=11,t=Mo(null,t,e,l,n);break e}else if(a===Y){t.tag=14,t=wo(null,t,e,l,n);break e}}throw t=ue(e)||e,Error(s(306,t,\"\"))}}return t;case 0:return Bc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,a=In(l,t.pendingProps),Ho(e,t,l,a,n);case 3:e:{if(Me(t,t.stateNode.containerInfo),e===null)throw Error(s(387));l=t.pendingProps;var u=t.memoizedState;a=u.element,fc(e,t),Ea(t,l,null,n);var f=t.memoizedState;if(l=f.cache,vn(t,Ke,l),l!==u.cache&&lc(t,[Ke],n,!0),pa(),l=f.element,u.isDehydrated)if(u={element:l,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=qo(e,t,l,n);break e}else if(l!==a){a=xt(Error(s(424)),t),ma(a),t=qo(e,t,l,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===\"HTML\"?e.ownerDocument.body:e}for(Be=Rt(e.firstChild),Ie=t,Ee=!0,gn=null,wt=!0,n=Ur(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Kn(),l===a){t=tn(e,t,n);break e}et(e,t,l,n)}t=t.child}return t;case 26:return qu(e,t),e===null?(n=Pd(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ee||(n=t.type,e=t.pendingProps,l=ti(re.current).createElement(n),l[We]=t,l[ct]=e,tt(l,n,e),$e(l),t.stateNode=l):t.memoizedState=Pd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return nt(t),e===null&&Ee&&(l=t.stateNode=Fd(t.type,t.pendingProps,re.current),Ie=t,wt=!0,a=Be,Mn(t.type)?(Ts=a,Be=Rt(l.firstChild)):Be=a),et(e,t,t.pendingProps.children,n),qu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ee&&((a=l=Be)&&(l=gg(l,t.type,t.pendingProps,wt),l!==null?(t.stateNode=l,Ie=t,Be=Rt(l.firstChild),wt=!1,a=!0):a=!1),a||yn(t)),nt(t),a=t.type,u=t.pendingProps,f=e!==null?e.memoizedProps:null,l=u.children,vs(a,u)?l=null:f!==null&&vs(a,f)&&(t.flags|=32),t.memoizedState!==null&&(a=yc(e,t,Mm,null,null,n),Ga._currentValue=a),qu(e,t),et(e,t,l,n),t.child;case 6:return e===null&&Ee&&((e=n=Be)&&(n=yg(n,t.pendingProps,wt),n!==null?(t.stateNode=n,Ie=t,Be=null,e=!0):e=!1),e||yn(t)),null;case 13:return Yo(e,t,n);case 4:return Me(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Fn(t,null,l,n):et(e,t,l,n),t.child;case 11:return Mo(e,t,t.type,t.pendingProps,n);case 7:return et(e,t,t.pendingProps,n),t.child;case 8:return et(e,t,t.pendingProps.children,n),t.child;case 12:return et(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,vn(t,t.type,l.value),et(e,t,l.children,n),t.child;case 9:return a=t.type._context,l=t.pendingProps.children,Vn(t),a=Pe(a),l=l(a),t.flags|=1,et(e,t,l,n),t.child;case 14:return wo(e,t,t.type,t.pendingProps,n);case 15:return Uo(e,t,t.type,t.pendingProps,n);case 19:return Go(e,t,n);case 31:return qm(e,t,n);case 22:return Ro(e,t,n,t.pendingProps);case 24:return Vn(t),l=Pe(Ke),e===null?(a=ic(),a===null&&(a=Oe,u=ac(),a.pooledCache=u,u.refCount++,u!==null&&(a.pooledCacheLanes|=n),a=u),t.memoizedState={parent:l,cache:a},sc(t),vn(t,Ke,a)):((e.lanes&n)!==0&&(fc(e,t),Ea(t,null,null,n),pa()),a=e.memoizedState,u=t.memoizedState,a.parent!==l?(a={parent:l,cache:l},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),vn(t,Ke,l)):(l=u.cache,vn(t,Ke,l),l!==a.cache&&lc(t,[Ke],n,!0))),et(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function nn(e){e.flags|=4}function Kc(e,t,n,l,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(gd())e.flags|=8192;else throw $n=Au,cc}else e.flags&=-16777217}function Xo(e,t){if(t.type!==\"stylesheet\"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ah(t))if(gd())e.flags|=8192;else throw $n=Au,cc}function Lu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ef():536870912,e.lanes|=t,Ll|=t)}function ja(e,t){if(!Ee)switch(e.tailMode){case\"hidden\":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case\"collapsed\":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags&65011712,l|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Lm(e,t,n){var l=t.pendingProps;switch(Ii(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return He(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),It(Ke),Ne(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(jl(t)?nn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ec())),He(t),null;case 26:var a=t.type,u=t.memoizedState;return e===null?(nn(t),u!==null?(He(t),Xo(t,u)):(He(t),Kc(t,a,null,l,n))):u?u!==e.memoizedState?(nn(t),He(t),Xo(t,u)):(He(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&nn(t),He(t),Kc(t,a,e,l,n)),null;case 27:if(al(t),n=re.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&nn(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return He(t),null}e=W.current,jl(t)?Er(t):(e=Fd(a,l,n),t.stateNode=e,nn(t))}return He(t),null;case 5:if(al(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&nn(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return He(t),null}if(u=W.current,jl(t))Er(t);else{var f=ti(re.current);switch(u){case 1:u=f.createElementNS(\"http://www.w3.org/2000/svg\",a);break;case 2:u=f.createElementNS(\"http://www.w3.org/1998/Math/MathML\",a);break;default:switch(a){case\"svg\":u=f.createElementNS(\"http://www.w3.org/2000/svg\",a);break;case\"math\":u=f.createElementNS(\"http://www.w3.org/1998/Math/MathML\",a);break;case\"script\":u=f.createElement(\"div\"),u.innerHTML=\"<script><\\\\/script>\",u=u.removeChild(u.firstChild);break;case\"select\":u=typeof l.is==\"string\"?f.createElement(\"select\",{is:l.is}):f.createElement(\"select\"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is==\"string\"?f.createElement(a,{is:l.is}):f.createElement(a)}}u[We]=t,u[ct]=l;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)u.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=u;e:switch(tt(u,a,l),a){case\"button\":case\"input\":case\"select\":case\"textarea\":l=!!l.autoFocus;break e;case\"img\":l=!0;break e;default:l=!1}l&&nn(t)}}return He(t),Kc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&nn(t);else{if(typeof l!=\"string\"&&t.stateNode===null)throw Error(s(166));if(e=re.current,jl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=Ie,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[We]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||Yd(e.nodeValue,n)),e||yn(t,!0)}else e=ti(e).createTextNode(l),e[We]=t,t.stateNode=e}return He(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=jl(t),n!==null){if(e===null){if(!l)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[We]=t}else Kn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),e=!1}else n=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(St(t),t):(St(t),null);if((t.flags&128)!==0)throw Error(s(558))}return He(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=jl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(s(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));a[We]=t}else Kn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),a=!1}else a=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(St(t),t):(St(t),null)}return St(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Lu(t,t.updateQueue),He(t),null);case 4:return Ne(),e===null&&ds(t.stateNode.containerInfo),He(t),null;case 10:return It(t.type),He(t),null;case 19:if(U(Qe),l=t.memoizedState,l===null)return He(t),null;if(a=(t.flags&128)!==0,u=l.rendering,u===null)if(a)ja(l,!1);else{if(Ge!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=ju(e),u!==null){for(t.flags|=128,ja(l,!1),e=u.updateQueue,t.updateQueue=e,Lu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)yr(n,e),n=n.sibling;return Q(Qe,Qe.current&1|2),Ee&&Ft(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&ut()>Zu&&(t.flags|=128,a=!0,ja(l,!1),t.lanes=4194304)}else{if(!a)if(e=ju(u),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Lu(t,e),ja(l,!0),l.tail===null&&l.tailMode===\"hidden\"&&!u.alternate&&!Ee)return He(t),null}else 2*ut()-l.renderingStartTime>Zu&&n!==536870912&&(t.flags|=128,a=!0,ja(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=ut(),e.sibling=null,n=Qe.current,Q(Qe,a?n&1|2:n&1),Ee&&Ft(t,l.treeForkCount),e):(He(t),null);case 22:case 23:return St(t),hc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),n=t.updateQueue,n!==null&&Lu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&U(kn),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),It(Ke),He(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function Gm(e,t){switch(Ii(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return It(Ke),Ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return al(t),null;case 31:if(t.memoizedState!==null){if(St(t),t.alternate===null)throw Error(s(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(St(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(Qe),null;case 4:return Ne(),null;case 10:return It(t.type),null;case 22:case 23:return St(t),hc(),e!==null&&U(kn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return It(Ke),null;case 25:return null;default:return null}}function Ko(e,t){switch(Ii(t),t.tag){case 3:It(Ke),Ne();break;case 26:case 27:case 5:al(t);break;case 4:Ne();break;case 31:t.memoizedState!==null&&St(t);break;case 13:St(t);break;case 19:U(Qe);break;case 10:It(t.type);break;case 22:case 23:St(t),hc(),e!==null&&U(kn);break;case 24:It(Ke)}}function xa(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var u=n.create,f=n.inst;l=u(),f.destroy=l}n=n.next}while(n!==a)}}catch(o){_e(t,t.return,o)}}function An(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var u=a.next;l=u;do{if((l.tag&e)===e){var f=l.inst,o=f.destroy;if(o!==void 0){f.destroy=void 0,a=t;var y=n,C=o;try{C()}catch(w){_e(a,y,w)}}}l=l.next}while(l!==u)}}catch(w){_e(t,t.return,w)}}function Zo(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Or(t,n)}catch(l){_e(e,e.return,l)}}}function Vo(e,t,n){n.props=In(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){_e(e,t,l)}}function _a(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n==\"function\"?e.refCleanup=n(l):n.current=l}}catch(a){_e(e,t,a)}}function Gt(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l==\"function\")try{l()}catch(a){_e(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==\"function\")try{n(null)}catch(a){_e(e,t,a)}else n.current=null}function ko(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case\"button\":case\"input\":case\"select\":case\"textarea\":n.autoFocus&&l.focus();break e;case\"img\":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(a){_e(e,e.return,a)}}function Zc(e,t,n){try{var l=e.stateNode;fg(l,e.type,n,t),l[ct]=t}catch(a){_e(e,e.return,a)}}function Jo(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Mn(e.type)||e.tag===4}function Vc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jo(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Mn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function kc(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===\"HTML\"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===\"HTML\"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=kt));else if(l!==4&&(l===27&&Mn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(kc(e,t,n),e=e.sibling;e!==null;)kc(e,t,n),e=e.sibling}function Gu(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&Mn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Gu(e,t,n),e=e.sibling;e!==null;)Gu(e,t,n),e=e.sibling}function $o(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);tt(t,l,n),t[We]=e,t[ct]=n}catch(u){_e(e,e.return,u)}}var ln=!1,ke=!1,Jc=!1,Fo=typeof WeakSet==\"function\"?WeakSet:Set,Fe=null;function Qm(e,t){if(e=e.containerInfo,gs=si,e=cr(e),Gi(e)){if(\"selectionStart\"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var a=l.anchorOffset,u=l.focusNode;l=l.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var f=0,o=-1,y=-1,C=0,w=0,O=e,x=null;t:for(;;){for(var _;O!==n||a!==0&&O.nodeType!==3||(o=f+a),O!==u||l!==0&&O.nodeType!==3||(y=f+l),O.nodeType===3&&(f+=O.nodeValue.length),(_=O.firstChild)!==null;)x=O,O=_;for(;;){if(O===e)break t;if(x===n&&++C===a&&(o=f),x===u&&++w===l&&(y=f),(_=O.nextSibling)!==null)break;O=x,x=O.parentNode}O=_}n=o===-1||y===-1?null:{start:o,end:y}}else n=null}n=n||{start:0,end:0}}else n=null;for(ys={focusedElem:e,selectionRange:n},si=!1,Fe=t;Fe!==null;)if(t=Fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Fe=e;else for(;Fe!==null;){switch(t=Fe,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,n=t,a=u.memoizedProps,u=u.memoizedState,l=n.stateNode;try{var P=In(n.type,a);e=l.getSnapshotBeforeUpdate(P,u),l.__reactInternalSnapshotBeforeUpdate=e}catch(ie){_e(n,n.return,ie)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Ss(e);else if(n===1)switch(e.nodeName){case\"HEAD\":case\"HTML\":case\"BODY\":Ss(e);break;default:e.textContent=\"\"}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=t.sibling,e!==null){e.return=t.return,Fe=e;break}Fe=t.return}}function Wo(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:un(e,n),l&4&&xa(5,n);break;case 1:if(un(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(f){_e(n,n.return,f)}else{var a=In(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){_e(n,n.return,f)}}l&64&&Zo(n),l&512&&_a(n,n.return);break;case 3:if(un(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Or(e,t)}catch(f){_e(n,n.return,f)}}break;case 27:t===null&&l&4&&$o(n);case 26:case 5:un(e,n),t===null&&l&4&&ko(n),l&512&&_a(n,n.return);break;case 12:un(e,n);break;case 31:un(e,n),l&4&&ed(e,n);break;case 13:un(e,n),l&4&&td(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Wm.bind(null,n),vg(e,n))));break;case 22:if(l=n.memoizedState!==null||ln,!l){t=t!==null&&t.memoizedState!==null||ke,a=ln;var u=ke;ln=l,(ke=t)&&!u?cn(e,n,(n.subtreeFlags&8772)!==0):un(e,n),ln=a,ke=u}break;case 30:break;default:un(e,n)}}function Io(e){var t=e.alternate;t!==null&&(e.alternate=null,Io(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&zi(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var qe=null,ft=!1;function an(e,t,n){for(n=n.child;n!==null;)Po(e,t,n),n=n.sibling}function Po(e,t,n){if(mt&&typeof mt.onCommitFiberUnmount==\"function\")try{mt.onCommitFiberUnmount(Pl,n)}catch{}switch(n.tag){case 26:ke||Gt(n,t),an(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ke||Gt(n,t);var l=qe,a=ft;Mn(n.type)&&(qe=n.stateNode,ft=!1),an(e,t,n),qa(n.stateNode),qe=l,ft=a;break;case 5:ke||Gt(n,t);case 6:if(l=qe,a=ft,qe=null,an(e,t,n),qe=l,ft=a,qe!==null)if(ft)try{(qe.nodeType===9?qe.body:qe.nodeName===\"HTML\"?qe.ownerDocument.body:qe).removeChild(n.stateNode)}catch(u){_e(n,t,u)}else try{qe.removeChild(n.stateNode)}catch(u){_e(n,t,u)}break;case 18:qe!==null&&(ft?(e=qe,Zd(e.nodeType===9?e.body:e.nodeName===\"HTML\"?e.ownerDocument.body:e,n.stateNode),Jl(e)):Zd(qe,n.stateNode));break;case 4:l=qe,a=ft,qe=n.stateNode.containerInfo,ft=!0,an(e,t,n),qe=l,ft=a;break;case 0:case 11:case 14:case 15:An(2,n,t),ke||An(4,n,t),an(e,t,n);break;case 1:ke||(Gt(n,t),l=n.stateNode,typeof l.componentWillUnmount==\"function\"&&Vo(n,t,l)),an(e,t,n);break;case 21:an(e,t,n);break;case 22:ke=(l=ke)||n.memoizedState!==null,an(e,t,n),ke=l;break;default:an(e,t,n)}}function ed(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jl(e)}catch(n){_e(t,t.return,n)}}}function td(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jl(e)}catch(n){_e(t,t.return,n)}}function Xm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Fo),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Fo),t;default:throw Error(s(435,e.tag))}}function Qu(e,t){var n=Xm(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var a=Im.bind(null,e,l);l.then(a,a)}})}function rt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var a=n[l],u=e,f=t,o=f;e:for(;o!==null;){switch(o.tag){case 27:if(Mn(o.type)){qe=o.stateNode,ft=!1;break e}break;case 5:qe=o.stateNode,ft=!1;break e;case 3:case 4:qe=o.stateNode.containerInfo,ft=!0;break e}o=o.return}if(qe===null)throw Error(s(160));Po(u,f,a),qe=null,ft=!1,u=a.alternate,u!==null&&(u.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)nd(t,e),t=t.sibling}var Bt=null;function nd(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:rt(t,e),ot(e),l&4&&(An(3,e,e.return),xa(3,e),An(5,e,e.return));break;case 1:rt(t,e),ot(e),l&512&&(ke||n===null||Gt(n,n.return)),l&64&&ln&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var a=Bt;if(rt(t,e),ot(e),l&512&&(ke||n===null||Gt(n,n.return)),l&4){var u=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(l){case\"title\":u=a.getElementsByTagName(\"title\")[0],(!u||u[na]||u[We]||u.namespaceURI===\"http://www.w3.org/2000/svg\"||u.hasAttribute(\"itemprop\"))&&(u=a.createElement(l),a.head.insertBefore(u,a.querySelector(\"head > title\"))),tt(u,l,n),u[We]=e,$e(u),l=u;break e;case\"link\":var f=nh(\"link\",\"href\",a).get(l+(n.href||\"\"));if(f){for(var o=0;o<f.length;o++)if(u=f[o],u.getAttribute(\"href\")===(n.href==null||n.href===\"\"?null:n.href)&&u.getAttribute(\"rel\")===(n.rel==null?null:n.rel)&&u.getAttribute(\"title\")===(n.title==null?null:n.title)&&u.getAttribute(\"crossorigin\")===(n.crossOrigin==null?null:n.crossOrigin)){f.splice(o,1);break t}}u=a.createElement(l),tt(u,l,n),a.head.appendChild(u);break;case\"meta\":if(f=nh(\"meta\",\"content\",a).get(l+(n.content||\"\"))){for(o=0;o<f.length;o++)if(u=f[o],u.getAttribute(\"content\")===(n.content==null?null:\"\"+n.content)&&u.getAttribute(\"name\")===(n.name==null?null:n.name)&&u.getAttribute(\"property\")===(n.property==null?null:n.property)&&u.getAttribute(\"http-equiv\")===(n.httpEquiv==null?null:n.httpEquiv)&&u.getAttribute(\"charset\")===(n.charSet==null?null:n.charSet)){f.splice(o,1);break t}}u=a.createElement(l),tt(u,l,n),a.head.appendChild(u);break;default:throw Error(s(468,l))}u[We]=e,$e(u),l=u}e.stateNode=l}else lh(a,e.type,e.stateNode);else e.stateNode=th(a,l,e.memoizedProps);else u!==l?(u===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):u.count--,l===null?lh(a,e.type,e.stateNode):th(a,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Zc(e,e.memoizedProps,n.memoizedProps)}break;case 27:rt(t,e),ot(e),l&512&&(ke||n===null||Gt(n,n.return)),n!==null&&l&4&&Zc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(rt(t,e),ot(e),l&512&&(ke||n===null||Gt(n,n.return)),e.flags&32){a=e.stateNode;try{vl(a,\"\")}catch(P){_e(e,e.return,P)}}l&4&&e.stateNode!=null&&(a=e.memoizedProps,Zc(e,a,n!==null?n.memoizedProps:a)),l&1024&&(Jc=!0);break;case 6:if(rt(t,e),ot(e),l&4){if(e.stateNode===null)throw Error(s(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(P){_e(e,e.return,P)}}break;case 3:if(ai=null,a=Bt,Bt=ni(t.containerInfo),rt(t,e),Bt=a,ot(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Jl(t.containerInfo)}catch(P){_e(e,e.return,P)}Jc&&(Jc=!1,ld(e));break;case 4:l=Bt,Bt=ni(e.stateNode.containerInfo),rt(t,e),ot(e),Bt=l;break;case 12:rt(t,e),ot(e);break;case 31:rt(t,e),ot(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Qu(e,l)));break;case 13:rt(t,e),ot(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ku=ut()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Qu(e,l)));break;case 22:a=e.memoizedState!==null;var y=n!==null&&n.memoizedState!==null,C=ln,w=ke;if(ln=C||a,ke=w||y,rt(t,e),ke=w,ln=C,ot(e),l&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||y||ln||ke||Pn(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){y=n=t;try{if(u=y.stateNode,a)f=u.style,typeof f.setProperty==\"function\"?f.setProperty(\"display\",\"none\",\"important\"):f.display=\"none\";else{o=y.stateNode;var O=y.memoizedProps.style,x=O!=null&&O.hasOwnProperty(\"display\")?O.display:null;o.style.display=x==null||typeof x==\"boolean\"?\"\":(\"\"+x).trim()}}catch(P){_e(y,y.return,P)}}}else if(t.tag===6){if(n===null){y=t;try{y.stateNode.nodeValue=a?\"\":y.memoizedProps}catch(P){_e(y,y.return,P)}}}else if(t.tag===18){if(n===null){y=t;try{var _=y.stateNode;a?Vd(_,!0):Vd(y.stateNode,!1)}catch(P){_e(y,y.return,P)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,Qu(e,n))));break;case 19:rt(t,e),ot(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Qu(e,l)));break;case 30:break;case 21:break;default:rt(t,e),ot(e)}}function ot(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Jo(l)){n=l;break}l=l.return}if(n==null)throw Error(s(160));switch(n.tag){case 27:var a=n.stateNode,u=Vc(e);Gu(e,u,a);break;case 5:var f=n.stateNode;n.flags&32&&(vl(f,\"\"),n.flags&=-33);var o=Vc(e);Gu(e,o,f);break;case 3:case 4:var y=n.stateNode.containerInfo,C=Vc(e);kc(e,C,y);break;default:throw Error(s(161))}}catch(w){_e(e,e.return,w)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ld(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ld(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function un(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Wo(e,t.alternate,t),t=t.sibling}function Pn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:An(4,t,t.return),Pn(t);break;case 1:Gt(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==\"function\"&&Vo(t,t.return,n),Pn(t);break;case 27:qa(t.stateNode);case 26:case 5:Gt(t,t.return),Pn(t);break;case 22:t.memoizedState===null&&Pn(t);break;case 30:Pn(t);break;default:Pn(t)}e=e.sibling}}function cn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,a=e,u=t,f=u.flags;switch(u.tag){case 0:case 11:case 15:cn(a,u,n),xa(4,u);break;case 1:if(cn(a,u,n),l=u,a=l.stateNode,typeof a.componentDidMount==\"function\")try{a.componentDidMount()}catch(C){_e(l,l.return,C)}if(l=u,a=l.updateQueue,a!==null){var o=l.stateNode;try{var y=a.shared.hiddenCallbacks;if(y!==null)for(a.shared.hiddenCallbacks=null,a=0;a<y.length;a++)Rr(y[a],o)}catch(C){_e(l,l.return,C)}}n&&f&64&&Zo(u),_a(u,u.return);break;case 27:$o(u);case 26:case 5:cn(a,u,n),n&&l===null&&f&4&&ko(u),_a(u,u.return);break;case 12:cn(a,u,n);break;case 31:cn(a,u,n),n&&f&4&&ed(a,u);break;case 13:cn(a,u,n),n&&f&4&&td(a,u);break;case 22:u.memoizedState===null&&cn(a,u,n),_a(u,u.return);break;case 30:break;default:cn(a,u,n)}t=t.sibling}}function $c(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ga(n))}function Fc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ga(e))}function Ht(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ad(e,t,n,l),t=t.sibling}function ad(e,t,n,l){var a=t.flags;switch(t.tag){case 0:case 11:case 15:Ht(e,t,n,l),a&2048&&xa(9,t);break;case 1:Ht(e,t,n,l);break;case 3:Ht(e,t,n,l),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ga(e)));break;case 12:if(a&2048){Ht(e,t,n,l),e=t.stateNode;try{var u=t.memoizedProps,f=u.id,o=u.onPostCommit;typeof o==\"function\"&&o(f,t.alternate===null?\"mount\":\"update\",e.passiveEffectDuration,-0)}catch(y){_e(t,t.return,y)}}else Ht(e,t,n,l);break;case 31:Ht(e,t,n,l);break;case 13:Ht(e,t,n,l);break;case 23:break;case 22:u=t.stateNode,f=t.alternate,t.memoizedState!==null?u._visibility&2?Ht(e,t,n,l):Ma(e,t):u._visibility&2?Ht(e,t,n,l):(u._visibility|=2,Hl(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),a&2048&&$c(f,t);break;case 24:Ht(e,t,n,l),a&2048&&Fc(t.alternate,t);break;default:Ht(e,t,n,l)}}function Hl(e,t,n,l,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,f=t,o=n,y=l,C=f.flags;switch(f.tag){case 0:case 11:case 15:Hl(u,f,o,y,a),xa(8,f);break;case 23:break;case 22:var w=f.stateNode;f.memoizedState!==null?w._visibility&2?Hl(u,f,o,y,a):Ma(u,f):(w._visibility|=2,Hl(u,f,o,y,a)),a&&C&2048&&$c(f.alternate,f);break;case 24:Hl(u,f,o,y,a),a&&C&2048&&Fc(f.alternate,f);break;default:Hl(u,f,o,y,a)}t=t.sibling}}function Ma(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,a=l.flags;switch(l.tag){case 22:Ma(n,l),a&2048&&$c(l.alternate,l);break;case 24:Ma(n,l),a&2048&&Fc(l.alternate,l);break;default:Ma(n,l)}t=t.sibling}}var wa=8192;function ql(e,t,n){if(e.subtreeFlags&wa)for(e=e.child;e!==null;)ud(e,t,n),e=e.sibling}function ud(e,t,n){switch(e.tag){case 26:ql(e,t,n),e.flags&wa&&e.memoizedState!==null&&_g(n,Bt,e.memoizedState,e.memoizedProps);break;case 5:ql(e,t,n);break;case 3:case 4:var l=Bt;Bt=ni(e.stateNode.containerInfo),ql(e,t,n),Bt=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=wa,wa=16777216,ql(e,t,n),wa=l):ql(e,t,n));break;default:ql(e,t,n)}}function id(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ua(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Fe=l,sd(l,e)}id(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)cd(e),e=e.sibling}function cd(e){switch(e.tag){case 0:case 11:case 15:Ua(e),e.flags&2048&&An(9,e,e.return);break;case 3:Ua(e);break;case 12:Ua(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xu(e)):Ua(e);break;default:Ua(e)}}function Xu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Fe=l,sd(l,e)}id(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:An(8,t,t.return),Xu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Xu(t));break;default:Xu(t)}e=e.sibling}}function sd(e,t){for(;Fe!==null;){var n=Fe;switch(n.tag){case 0:case 11:case 15:An(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ga(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Fe=l;else e:for(n=e;Fe!==null;){l=Fe;var a=l.sibling,u=l.return;if(Io(l),l===n){Fe=null;break e}if(a!==null){a.return=u,Fe=a;break e}Fe=u}}}var Km={getCacheForType:function(e){var t=Pe(Ke),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Pe(Ke).controller.signal}},Zm=typeof WeakMap==\"function\"?WeakMap:Map,je=0,Oe=null,ye=null,Se=0,xe=0,pt=null,zn=!1,Yl=!1,Wc=!1,sn=0,Ge=0,Cn=0,el=0,Ic=0,Et=0,Ll=0,Ra=null,dt=null,Pc=!1,Ku=0,fd=0,Zu=1/0,Vu=null,Nn=null,Je=0,jn=null,Gl=null,fn=0,es=0,ts=null,rd=null,Oa=0,ns=null;function Tt(){return(je&2)!==0&&Se!==0?Se&-Se:M.T!==null?ss():Cf()}function od(){if(Et===0)if((Se&536870912)===0||Ee){var e=eu;eu<<=1,(eu&3932160)===0&&(eu=262144),Et=e}else Et=536870912;return e=bt.current,e!==null&&(e.flags|=32),Et}function ht(e,t,n){(e===Oe&&(xe===2||xe===9)||e.cancelPendingCommit!==null)&&(Ql(e,0),xn(e,Se,Et,!1)),ta(e,n),((je&2)===0||e!==Oe)&&(e===Oe&&((je&2)===0&&(el|=n),Ge===4&&xn(e,Se,Et,!1)),Qt(e))}function dd(e,t,n){if((je&6)!==0)throw Error(s(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ea(e,t),a=l?Jm(e,t):as(e,t,!0),u=l;do{if(a===0){Yl&&!l&&xn(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!Vm(n)){a=as(e,t,!1),u=!1;continue}if(a===2){if(u=t,e.errorRecoveryDisabledLanes&u)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var o=e;a=Ra;var y=o.current.memoizedState.isDehydrated;if(y&&(Ql(o,f).flags|=256),f=as(o,f,!1),f!==2){if(Wc&&!y){o.errorRecoveryDisabledLanes|=u,el|=u,a=4;break e}u=dt,dt=a,u!==null&&(dt===null?dt=u:dt.push.apply(dt,u))}a=f}if(u=!1,a!==2)continue}}if(a===1){Ql(e,0),xn(e,t,0,!0);break}e:{switch(l=e,u=a,u){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:xn(l,t,Et,!zn);break e;case 2:dt=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(a=Ku+300-ut(),10<a)){if(xn(l,t,Et,!zn),nu(l,0,!0)!==0)break e;fn=t,l.timeoutHandle=Xd(hd.bind(null,l,n,dt,Vu,Pc,t,Et,el,Ll,zn,u,\"Throttled\",-0,0),a);break e}hd(l,n,dt,Vu,Pc,t,Et,el,Ll,zn,u,null,-0,0)}}break}while(!0);Qt(e)}function hd(e,t,n,l,a,u,f,o,y,C,w,O,x,_){if(e.timeoutHandle=-1,O=t.subtreeFlags,O&8192||(O&16785408)===16785408){O={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:kt},ud(t,u,O);var P=(u&62914560)===u?Ku-ut():(u&4194048)===u?fd-ut():0;if(P=Mg(O,P),P!==null){fn=u,e.cancelPendingCommit=P(Ed.bind(null,e,t,u,n,l,a,f,o,y,w,O,null,x,_)),xn(e,u,f,!C);return}}Ed(e,t,u,n,l,a,f,o,y)}function Vm(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var a=n[l],u=a.getSnapshot;a=a.value;try{if(!yt(u(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xn(e,t,n,l){t&=~Ic,t&=~el,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var a=t;0<a;){var u=31-gt(a),f=1<<u;l[u]=-1,a&=~f}n!==0&&Tf(e,n,t)}function ku(){return(je&6)===0?(Da(0),!1):!0}function ls(){if(ye!==null){if(xe===0)var e=ye.return;else e=ye,Wt=Zn=null,Sc(e),Ul=null,va=0,e=ye;for(;e!==null;)Ko(e.alternate,e),e=e.return;ye=null}}function Ql(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,dg(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),fn=0,ls(),Oe=e,ye=n=$t(e.current,null),Se=t,xe=0,pt=null,zn=!1,Yl=ea(e,t),Wc=!1,Ll=Et=Ic=el=Cn=Ge=0,dt=Ra=null,Pc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var a=31-gt(l),u=1<<a;t|=e[a],l&=~u}return sn=t,mu(),n}function md(e,t){me=null,M.H=Ca,t===wl||t===Tu?(t=_r(),xe=3):t===cc?(t=_r(),xe=4):xe=t===Dc?8:t!==null&&typeof t==\"object\"&&typeof t.then==\"function\"?6:1,pt=t,ye===null&&(Ge=1,Bu(e,xt(t,e.current)))}function gd(){var e=bt.current;return e===null?!0:(Se&4194048)===Se?Ut===null:(Se&62914560)===Se||(Se&536870912)!==0?e===Ut:!1}function yd(){var e=M.H;return M.H=Ca,e===null?Ca:e}function vd(){var e=M.A;return M.A=Km,e}function Ju(){Ge=4,zn||(Se&4194048)!==Se&&bt.current!==null||(Yl=!0),(Cn&134217727)===0&&(el&134217727)===0||Oe===null||xn(Oe,Se,Et,!1)}function as(e,t,n){var l=je;je|=2;var a=yd(),u=vd();(Oe!==e||Se!==t)&&(Vu=null,Ql(e,t)),t=!1;var f=Ge;e:do try{if(xe!==0&&ye!==null){var o=ye,y=pt;switch(xe){case 8:ls(),f=6;break e;case 3:case 2:case 9:case 6:bt.current===null&&(t=!0);var C=xe;if(xe=0,pt=null,Xl(e,o,y,C),n&&Yl){f=0;break e}break;default:C=xe,xe=0,pt=null,Xl(e,o,y,C)}}km(),f=Ge;break}catch(w){md(e,w)}while(!0);return t&&e.shellSuspendCounter++,Wt=Zn=null,je=l,M.H=a,M.A=u,ye===null&&(Oe=null,Se=0,mu()),f}function km(){for(;ye!==null;)bd(ye)}function Jm(e,t){var n=je;je|=2;var l=yd(),a=vd();Oe!==e||Se!==t?(Vu=null,Zu=ut()+500,Ql(e,t)):Yl=ea(e,t);e:do try{if(xe!==0&&ye!==null){t=ye;var u=pt;t:switch(xe){case 1:xe=0,pt=null,Xl(e,t,u,1);break;case 2:case 9:if(jr(u)){xe=0,pt=null,Sd(t);break}t=function(){xe!==2&&xe!==9||Oe!==e||(xe=7),Qt(e)},u.then(t,t);break e;case 3:xe=7;break e;case 4:xe=5;break e;case 7:jr(u)?(xe=0,pt=null,Sd(t)):(xe=0,pt=null,Xl(e,t,u,7));break;case 5:var f=null;switch(ye.tag){case 26:f=ye.memoizedState;case 5:case 27:var o=ye;if(f?ah(f):o.stateNode.complete){xe=0,pt=null;var y=o.sibling;if(y!==null)ye=y;else{var C=o.return;C!==null?(ye=C,$u(C)):ye=null}break t}}xe=0,pt=null,Xl(e,t,u,5);break;case 6:xe=0,pt=null,Xl(e,t,u,6);break;case 8:ls(),Ge=6;break e;default:throw Error(s(462))}}$m();break}catch(w){md(e,w)}while(!0);return Wt=Zn=null,M.H=l,M.A=a,je=n,ye!==null?0:(Oe=null,Se=0,mu(),Ge)}function $m(){for(;ye!==null&&!Si();)bd(ye)}function bd(e){var t=Qo(e.alternate,e,sn);e.memoizedProps=e.pendingProps,t===null?$u(e):ye=t}function Sd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bo(n,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=Bo(n,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:Sc(t);default:Ko(n,t),t=ye=yr(t,sn),t=Qo(n,t,sn)}e.memoizedProps=e.pendingProps,t===null?$u(e):ye=t}function Xl(e,t,n,l){Wt=Zn=null,Sc(t),Ul=null,va=0;var a=t.return;try{if(Hm(e,a,t,n,Se)){Ge=1,Bu(e,xt(n,e.current)),ye=null;return}}catch(u){if(a!==null)throw ye=a,u;Ge=1,Bu(e,xt(n,e.current)),ye=null;return}t.flags&32768?(Ee||l===1?e=!0:Yl||(Se&536870912)!==0?e=!1:(zn=e=!0,(l===2||l===9||l===3||l===6)&&(l=bt.current,l!==null&&l.tag===13&&(l.flags|=16384))),pd(t,e)):$u(t)}function $u(e){var t=e;do{if((t.flags&32768)!==0){pd(t,zn);return}e=t.return;var n=Lm(t.alternate,t,sn);if(n!==null){ye=n;return}if(t=t.sibling,t!==null){ye=t;return}ye=t=e}while(t!==null);Ge===0&&(Ge=5)}function pd(e,t){do{var n=Gm(e.alternate,e);if(n!==null){n.flags&=32767,ye=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ye=e;return}ye=e=n}while(e!==null);Ge=6,ye=null}function Ed(e,t,n,l,a,u,f,o,y){e.cancelPendingCommit=null;do Fu();while(Je!==0);if((je&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(u=t.lanes|t.childLanes,u|=Vi,x0(e,n,u,f,o,y),e===Oe&&(ye=Oe=null,Se=0),Gl=t,jn=e,fn=n,es=u,ts=a,rd=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Pm(De,function(){return Nd(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=M.T,M.T=null,a=G.p,G.p=2,f=je,je|=4;try{Qm(e,t,n)}finally{je=f,G.p=a,M.T=l}}Je=1,Td(),Ad(),zd()}}function Td(){if(Je===1){Je=0;var e=jn,t=Gl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=M.T,M.T=null;var l=G.p;G.p=2;var a=je;je|=4;try{nd(t,e);var u=ys,f=cr(e.containerInfo),o=u.focusedElem,y=u.selectionRange;if(f!==o&&o&&o.ownerDocument&&ir(o.ownerDocument.documentElement,o)){if(y!==null&&Gi(o)){var C=y.start,w=y.end;if(w===void 0&&(w=C),\"selectionStart\"in o)o.selectionStart=C,o.selectionEnd=Math.min(w,o.value.length);else{var O=o.ownerDocument||document,x=O&&O.defaultView||window;if(x.getSelection){var _=x.getSelection(),P=o.textContent.length,ie=Math.min(y.start,P),Re=y.end===void 0?ie:Math.min(y.end,P);!_.extend&&ie>Re&&(f=Re,Re=ie,ie=f);var T=ur(o,ie),S=ur(o,Re);if(T&&S&&(_.rangeCount!==1||_.anchorNode!==T.node||_.anchorOffset!==T.offset||_.focusNode!==S.node||_.focusOffset!==S.offset)){var z=O.createRange();z.setStart(T.node,T.offset),_.removeAllRanges(),ie>Re?(_.addRange(z),_.extend(S.node,S.offset)):(z.setEnd(S.node,S.offset),_.addRange(z))}}}}for(O=[],_=o;_=_.parentNode;)_.nodeType===1&&O.push({element:_,left:_.scrollLeft,top:_.scrollTop});for(typeof o.focus==\"function\"&&o.focus(),o=0;o<O.length;o++){var R=O[o];R.element.scrollLeft=R.left,R.element.scrollTop=R.top}}si=!!gs,ys=gs=null}finally{je=a,G.p=l,M.T=n}}e.current=t,Je=2}}function Ad(){if(Je===2){Je=0;var e=jn,t=Gl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=M.T,M.T=null;var l=G.p;G.p=2;var a=je;je|=4;try{Wo(e,t.alternate,t)}finally{je=a,G.p=l,M.T=n}}Je=3}}function zd(){if(Je===4||Je===3){Je=0,fl();var e=jn,t=Gl,n=fn,l=rd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Je=5:(Je=0,Gl=jn=null,Cd(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(Nn=null),Ti(n),t=t.stateNode,mt&&typeof mt.onCommitFiberRoot==\"function\")try{mt.onCommitFiberRoot(Pl,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=M.T,a=G.p,G.p=2,M.T=null;try{for(var u=e.onRecoverableError,f=0;f<l.length;f++){var o=l[f];u(o.value,{componentStack:o.stack})}}finally{M.T=t,G.p=a}}(fn&3)!==0&&Fu(),Qt(e),a=e.pendingLanes,(n&261930)!==0&&(a&42)!==0?e===ns?Oa++:(Oa=0,ns=e):Oa=0,Da(0)}}function Cd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ga(t)))}function Fu(){return Td(),Ad(),zd(),Nd()}function Nd(){if(Je!==5)return!1;var e=jn,t=es;es=0;var n=Ti(fn),l=M.T,a=G.p;try{G.p=32>n?32:n,M.T=null,n=ts,ts=null;var u=jn,f=fn;if(Je=0,Gl=jn=null,fn=0,(je&6)!==0)throw Error(s(331));var o=je;if(je|=4,cd(u.current),ad(u,u.current,f,n),je=o,Da(0,!1),mt&&typeof mt.onPostCommitFiberRoot==\"function\")try{mt.onPostCommitFiberRoot(Pl,u)}catch{}return!0}finally{G.p=a,M.T=l,Cd(e,t)}}function jd(e,t,n){t=xt(n,t),t=Oc(e.stateNode,t,2),e=pn(e,t,2),e!==null&&(ta(e,2),Qt(e))}function _e(e,t,n){if(e.tag===3)jd(e,e,n);else for(;t!==null;){if(t.tag===3){jd(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError==\"function\"||typeof l.componentDidCatch==\"function\"&&(Nn===null||!Nn.has(l))){e=xt(n,e),n=xo(2),l=pn(t,n,2),l!==null&&(_o(n,l,t,e),ta(l,2),Qt(l));break}}t=t.return}}function us(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Zm;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(Wc=!0,a.add(n),e=Fm.bind(null,e,t,n),t.then(e,e))}function Fm(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Oe===e&&(Se&n)===n&&(Ge===4||Ge===3&&(Se&62914560)===Se&&300>ut()-Ku?(je&2)===0&&Ql(e,0):Ic|=n,Ll===Se&&(Ll=0)),Qt(e)}function xd(e,t){t===0&&(t=Ef()),e=Qn(e,t),e!==null&&(ta(e,t),Qt(e))}function Wm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xd(e,n)}function Im(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(t),xd(e,n)}function Pm(e,t){return cl(e,t)}var Wu=null,Kl=null,is=!1,Iu=!1,cs=!1,_n=0;function Qt(e){e!==Kl&&e.next===null&&(Kl===null?Wu=Kl=e:Kl=Kl.next=e),Iu=!0,is||(is=!0,tg())}function Da(e,t){if(!cs&&Iu){cs=!0;do for(var n=!1,l=Wu;l!==null;){if(e!==0){var a=l.pendingLanes;if(a===0)var u=0;else{var f=l.suspendedLanes,o=l.pingedLanes;u=(1<<31-gt(42|e)+1)-1,u&=a&~(f&~o),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,Ud(l,u))}else u=Se,u=nu(l,l===Oe?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||ea(l,u)||(n=!0,Ud(l,u));l=l.next}while(n);cs=!1}}function eg(){_d()}function _d(){Iu=is=!1;var e=0;_n!==0&&og()&&(e=_n);for(var t=ut(),n=null,l=Wu;l!==null;){var a=l.next,u=Md(l,t);u===0?(l.next=null,n===null?Wu=a:n.next=a,a===null&&(Kl=n)):(n=l,(e!==0||(u&3)!==0)&&(Iu=!0)),l=a}Je!==0&&Je!==5||Da(e),_n!==0&&(_n=0)}function Md(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var f=31-gt(u),o=1<<f,y=a[f];y===-1?((o&n)===0||(o&l)!==0)&&(a[f]=j0(o,t)):y<=t&&(e.expiredLanes|=o),u&=~o}if(t=Oe,n=Se,n=nu(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(xe===2||xe===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&sl(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ea(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&sl(l),Ti(n)){case 2:case 8:n=he;break;case 32:n=De;break;case 268435456:n=rl;break;default:n=De}return l=wd.bind(null,e),n=cl(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&sl(l),e.callbackPriority=2,e.callbackNode=null,2}function wd(e,t){if(Je!==0&&Je!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Fu()&&e.callbackNode!==n)return null;var l=Se;return l=nu(e,e===Oe?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(dd(e,l,t),Md(e,ut()),e.callbackNode!=null&&e.callbackNode===n?wd.bind(null,e):null)}function Ud(e,t){if(Fu())return null;dd(e,t,!0)}function tg(){hg(function(){(je&6)!==0?cl(J,eg):_d()})}function ss(){if(_n===0){var e=_l;e===0&&(e=Pa,Pa<<=1,(Pa&261888)===0&&(Pa=256)),_n=e}return _n}function Rd(e){return e==null||typeof e==\"symbol\"||typeof e==\"boolean\"?null:typeof e==\"function\"?e:iu(\"\"+e)}function Od(e,t){var n=t.ownerDocument.createElement(\"input\");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(\"form\",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function ng(e,t,n,l,a){if(t===\"submit\"&&n&&n.stateNode===a){var u=Rd((a[ct]||null).action),f=l.submitter;f&&(t=(t=f[ct]||null)?Rd(t.formAction):f.getAttribute(\"formAction\"),t!==null&&(u=t,f=null));var o=new ru(\"action\",\"action\",null,l,a);e.push({event:o,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(_n!==0){var y=f?Od(a,f):new FormData(a);xc(n,{pending:!0,data:y,method:a.method,action:u},null,y)}}else typeof u==\"function\"&&(o.preventDefault(),y=f?Od(a,f):new FormData(a),xc(n,{pending:!0,data:y,method:a.method,action:u},u,y))},currentTarget:a}]})}}for(var fs=0;fs<Zi.length;fs++){var rs=Zi[fs],lg=rs.toLowerCase(),ag=rs[0].toUpperCase()+rs.slice(1);Dt(lg,\"on\"+ag)}Dt(rr,\"onAnimationEnd\"),Dt(or,\"onAnimationIteration\"),Dt(dr,\"onAnimationStart\"),Dt(\"dblclick\",\"onDoubleClick\"),Dt(\"focusin\",\"onFocus\"),Dt(\"focusout\",\"onBlur\"),Dt(pm,\"onTransitionRun\"),Dt(Em,\"onTransitionStart\"),Dt(Tm,\"onTransitionCancel\"),Dt(hr,\"onTransitionEnd\"),gl(\"onMouseEnter\",[\"mouseout\",\"mouseover\"]),gl(\"onMouseLeave\",[\"mouseout\",\"mouseover\"]),gl(\"onPointerEnter\",[\"pointerout\",\"pointerover\"]),gl(\"onPointerLeave\",[\"pointerout\",\"pointerover\"]),qn(\"onChange\",\"change click focusin focusout input keydown keyup selectionchange\".split(\" \")),qn(\"onSelect\",\"focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange\".split(\" \")),qn(\"onBeforeInput\",[\"compositionend\",\"keypress\",\"textInput\",\"paste\"]),qn(\"onCompositionEnd\",\"compositionend focusout keydown keypress keyup mousedown\".split(\" \")),qn(\"onCompositionStart\",\"compositionstart focusout keydown keypress keyup mousedown\".split(\" \")),qn(\"onCompositionUpdate\",\"compositionupdate focusout keydown keypress keyup mousedown\".split(\" \"));var Ba=\"abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting\".split(\" \"),ug=new Set(\"beforetoggle cancel close invalid load scroll scrollend toggle\".split(\" \").concat(Ba));function Dd(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],a=l.event;l=l.listeners;e:{var u=void 0;if(t)for(var f=l.length-1;0<=f;f--){var o=l[f],y=o.instance,C=o.currentTarget;if(o=o.listener,y!==u&&a.isPropagationStopped())break e;u=o,a.currentTarget=C;try{u(a)}catch(w){hu(w)}a.currentTarget=null,u=y}else for(f=0;f<l.length;f++){if(o=l[f],y=o.instance,C=o.currentTarget,o=o.listener,y!==u&&a.isPropagationStopped())break e;u=o,a.currentTarget=C;try{u(a)}catch(w){hu(w)}a.currentTarget=null,u=y}}}}function ve(e,t){var n=t[Ai];n===void 0&&(n=t[Ai]=new Set);var l=e+\"__bubble\";n.has(l)||(Bd(t,e,2,!1),n.add(l))}function os(e,t,n){var l=0;t&&(l|=4),Bd(n,e,l,t)}var Pu=\"_reactListening\"+Math.random().toString(36).slice(2);function ds(e){if(!e[Pu]){e[Pu]=!0,xf.forEach(function(n){n!==\"selectionchange\"&&(ug.has(n)||os(n,!1,e),os(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pu]||(t[Pu]=!0,os(\"selectionchange\",!1,t))}}function Bd(e,t,n,l){switch(oh(t)){case 2:var a=Rg;break;case 8:a=Og;break;default:a=js}n=a.bind(null,t,n,e),a=void 0,!Ui||t!==\"touchstart\"&&t!==\"touchmove\"&&t!==\"wheel\"||(a=!0),l?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function hs(e,t,n,l,a){var u=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var f=l.tag;if(f===3||f===4){var o=l.stateNode.containerInfo;if(o===a)break;if(f===4)for(f=l.return;f!==null;){var y=f.tag;if((y===3||y===4)&&f.stateNode.containerInfo===a)return;f=f.return}for(;o!==null;){if(f=dl(o),f===null)return;if(y=f.tag,y===5||y===6||y===26||y===27){l=u=f;continue e}o=o.parentNode}}l=l.return}Lf(function(){var C=u,w=Mi(n),O=[];e:{var x=mr.get(e);if(x!==void 0){var _=ru,P=e;switch(e){case\"keypress\":if(su(n)===0)break e;case\"keydown\":case\"keyup\":_=I0;break;case\"focusin\":P=\"focus\",_=Bi;break;case\"focusout\":P=\"blur\",_=Bi;break;case\"beforeblur\":case\"afterblur\":_=Bi;break;case\"click\":if(n.button===2)break e;case\"auxclick\":case\"dblclick\":case\"mousedown\":case\"mousemove\":case\"mouseup\":case\"mouseout\":case\"mouseover\":case\"contextmenu\":_=Xf;break;case\"drag\":case\"dragend\":case\"dragenter\":case\"dragexit\":case\"dragleave\":case\"dragover\":case\"dragstart\":case\"drop\":_=L0;break;case\"touchcancel\":case\"touchend\":case\"touchmove\":case\"touchstart\":_=tm;break;case rr:case or:case dr:_=X0;break;case hr:_=lm;break;case\"scroll\":case\"scrollend\":_=q0;break;case\"wheel\":_=um;break;case\"copy\":case\"cut\":case\"paste\":_=Z0;break;case\"gotpointercapture\":case\"lostpointercapture\":case\"pointercancel\":case\"pointerdown\":case\"pointermove\":case\"pointerout\":case\"pointerover\":case\"pointerup\":_=Zf;break;case\"toggle\":case\"beforetoggle\":_=cm}var ie=(t&4)!==0,Re=!ie&&(e===\"scroll\"||e===\"scrollend\"),T=ie?x!==null?x+\"Capture\":null:x;ie=[];for(var S=C,z;S!==null;){var R=S;if(z=R.stateNode,R=R.tag,R!==5&&R!==26&&R!==27||z===null||T===null||(R=aa(S,T),R!=null&&ie.push(Ha(S,R,z))),Re)break;S=S.return}0<ie.length&&(x=new _(x,P,null,n,w),O.push({event:x,listeners:ie}))}}if((t&7)===0){e:{if(x=e===\"mouseover\"||e===\"pointerover\",_=e===\"mouseout\"||e===\"pointerout\",x&&n!==_i&&(P=n.relatedTarget||n.fromElement)&&(dl(P)||P[ol]))break e;if((_||x)&&(x=w.window===w?w:(x=w.ownerDocument)?x.defaultView||x.parentWindow:window,_?(P=n.relatedTarget||n.toElement,_=C,P=P?dl(P):null,P!==null&&(Re=h(P),ie=P.tag,P!==Re||ie!==5&&ie!==27&&ie!==6)&&(P=null)):(_=null,P=C),_!==P)){if(ie=Xf,R=\"onMouseLeave\",T=\"onMouseEnter\",S=\"mouse\",(e===\"pointerout\"||e===\"pointerover\")&&(ie=Zf,R=\"onPointerLeave\",T=\"onPointerEnter\",S=\"pointer\"),Re=_==null?x:la(_),z=P==null?x:la(P),x=new ie(R,S+\"leave\",_,n,w),x.target=Re,x.relatedTarget=z,R=null,dl(w)===C&&(ie=new ie(T,S+\"enter\",P,n,w),ie.target=z,ie.relatedTarget=Re,R=ie),Re=R,_&&P)t:{for(ie=ig,T=_,S=P,z=0,R=T;R;R=ie(R))z++;R=0;for(var le=S;le;le=ie(le))R++;for(;0<z-R;)T=ie(T),z--;for(;0<R-z;)S=ie(S),R--;for(;z--;){if(T===S||S!==null&&T===S.alternate){ie=T;break t}T=ie(T),S=ie(S)}ie=null}else ie=null;_!==null&&Hd(O,x,_,ie,!1),P!==null&&Re!==null&&Hd(O,Re,P,ie,!0)}}e:{if(x=C?la(C):window,_=x.nodeName&&x.nodeName.toLowerCase(),_===\"select\"||_===\"input\"&&x.type===\"file\")var ze=Pf;else if(Wf(x))if(er)ze=vm;else{ze=gm;var te=mm}else _=x.nodeName,!_||_.toLowerCase()!==\"input\"||x.type!==\"checkbox\"&&x.type!==\"radio\"?C&&xi(C.elementType)&&(ze=Pf):ze=ym;if(ze&&(ze=ze(e,C))){If(O,ze,n,w);break e}te&&te(e,x,C),e===\"focusout\"&&C&&x.type===\"number\"&&C.memoizedProps.value!=null&&ji(x,\"number\",x.value)}switch(te=C?la(C):window,e){case\"focusin\":(Wf(te)||te.contentEditable===\"true\")&&(El=te,Qi=C,da=null);break;case\"focusout\":da=Qi=El=null;break;case\"mousedown\":Xi=!0;break;case\"contextmenu\":case\"mouseup\":case\"dragend\":Xi=!1,sr(O,n,w);break;case\"selectionchange\":if(Sm)break;case\"keydown\":case\"keyup\":sr(O,n,w)}var ge;if(qi)e:{switch(e){case\"compositionstart\":var pe=\"onCompositionStart\";break e;case\"compositionend\":pe=\"onCompositionEnd\";break e;case\"compositionupdate\":pe=\"onCompositionUpdate\";break e}pe=void 0}else pl?$f(e,n)&&(pe=\"onCompositionEnd\"):e===\"keydown\"&&n.keyCode===229&&(pe=\"onCompositionStart\");pe&&(Vf&&n.locale!==\"ko\"&&(pl||pe!==\"onCompositionStart\"?pe===\"onCompositionEnd\"&&pl&&(ge=Gf()):(hn=w,Ri=\"value\"in hn?hn.value:hn.textContent,pl=!0)),te=ei(C,pe),0<te.length&&(pe=new Kf(pe,e,null,n,w),O.push({event:pe,listeners:te}),ge?pe.data=ge:(ge=Ff(n),ge!==null&&(pe.data=ge)))),(ge=fm?rm(e,n):om(e,n))&&(pe=ei(C,\"onBeforeInput\"),0<pe.length&&(te=new Kf(\"onBeforeInput\",\"beforeinput\",null,n,w),O.push({event:te,listeners:pe}),te.data=ge)),ng(O,e,C,n,w)}Dd(O,t)})}function Ha(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ei(e,t){for(var n=t+\"Capture\",l=[];e!==null;){var a=e,u=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||u===null||(a=aa(e,n),a!=null&&l.unshift(Ha(e,a,u)),a=aa(e,t),a!=null&&l.push(Ha(e,a,u))),e.tag===3)return l;e=e.return}return[]}function ig(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Hd(e,t,n,l,a){for(var u=t._reactName,f=[];n!==null&&n!==l;){var o=n,y=o.alternate,C=o.stateNode;if(o=o.tag,y!==null&&y===l)break;o!==5&&o!==26&&o!==27||C===null||(y=C,a?(C=aa(n,u),C!=null&&f.unshift(Ha(n,C,y))):a||(C=aa(n,u),C!=null&&f.push(Ha(n,C,y)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var cg=/\\\\r\\\\n?/g,sg=/\\\\u0000|\\\\uFFFD/g;function qd(e){return(typeof e==\"string\"?e:\"\"+e).replace(cg,\\`\n\\`).replace(sg,\"\")}function Yd(e,t){return t=qd(t),qd(e)===t}function Ue(e,t,n,l,a,u){switch(n){case\"children\":typeof l==\"string\"?t===\"body\"||t===\"textarea\"&&l===\"\"||vl(e,l):(typeof l==\"number\"||typeof l==\"bigint\")&&t!==\"body\"&&vl(e,\"\"+l);break;case\"className\":au(e,\"class\",l);break;case\"tabIndex\":au(e,\"tabindex\",l);break;case\"dir\":case\"role\":case\"viewBox\":case\"width\":case\"height\":au(e,n,l);break;case\"style\":qf(e,l,u);break;case\"data\":if(t!==\"object\"){au(e,\"data\",l);break}case\"src\":case\"href\":if(l===\"\"&&(t!==\"a\"||n!==\"href\")){e.removeAttribute(n);break}if(l==null||typeof l==\"function\"||typeof l==\"symbol\"||typeof l==\"boolean\"){e.removeAttribute(n);break}l=iu(\"\"+l),e.setAttribute(n,l);break;case\"action\":case\"formAction\":if(typeof l==\"function\"){e.setAttribute(n,\"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\\\\\\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')\");break}else typeof u==\"function\"&&(n===\"formAction\"?(t!==\"input\"&&Ue(e,t,\"name\",a.name,a,null),Ue(e,t,\"formEncType\",a.formEncType,a,null),Ue(e,t,\"formMethod\",a.formMethod,a,null),Ue(e,t,\"formTarget\",a.formTarget,a,null)):(Ue(e,t,\"encType\",a.encType,a,null),Ue(e,t,\"method\",a.method,a,null),Ue(e,t,\"target\",a.target,a,null)));if(l==null||typeof l==\"symbol\"||typeof l==\"boolean\"){e.removeAttribute(n);break}l=iu(\"\"+l),e.setAttribute(n,l);break;case\"onClick\":l!=null&&(e.onclick=kt);break;case\"onScroll\":l!=null&&ve(\"scroll\",e);break;case\"onScrollEnd\":l!=null&&ve(\"scrollend\",e);break;case\"dangerouslySetInnerHTML\":if(l!=null){if(typeof l!=\"object\"||!(\"__html\"in l))throw Error(s(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(s(60));e.innerHTML=n}}break;case\"multiple\":e.multiple=l&&typeof l!=\"function\"&&typeof l!=\"symbol\";break;case\"muted\":e.muted=l&&typeof l!=\"function\"&&typeof l!=\"symbol\";break;case\"suppressContentEditableWarning\":case\"suppressHydrationWarning\":case\"defaultValue\":case\"defaultChecked\":case\"innerHTML\":case\"ref\":break;case\"autoFocus\":break;case\"xlinkHref\":if(l==null||typeof l==\"function\"||typeof l==\"boolean\"||typeof l==\"symbol\"){e.removeAttribute(\"xlink:href\");break}n=iu(\"\"+l),e.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",n);break;case\"contentEditable\":case\"spellCheck\":case\"draggable\":case\"value\":case\"autoReverse\":case\"externalResourcesRequired\":case\"focusable\":case\"preserveAlpha\":l!=null&&typeof l!=\"function\"&&typeof l!=\"symbol\"?e.setAttribute(n,\"\"+l):e.removeAttribute(n);break;case\"inert\":case\"allowFullScreen\":case\"async\":case\"autoPlay\":case\"controls\":case\"default\":case\"defer\":case\"disabled\":case\"disablePictureInPicture\":case\"disableRemotePlayback\":case\"formNoValidate\":case\"hidden\":case\"loop\":case\"noModule\":case\"noValidate\":case\"open\":case\"playsInline\":case\"readOnly\":case\"required\":case\"reversed\":case\"scoped\":case\"seamless\":case\"itemScope\":l&&typeof l!=\"function\"&&typeof l!=\"symbol\"?e.setAttribute(n,\"\"):e.removeAttribute(n);break;case\"capture\":case\"download\":l===!0?e.setAttribute(n,\"\"):l!==!1&&l!=null&&typeof l!=\"function\"&&typeof l!=\"symbol\"?e.setAttribute(n,l):e.removeAttribute(n);break;case\"cols\":case\"rows\":case\"size\":case\"span\":l!=null&&typeof l!=\"function\"&&typeof l!=\"symbol\"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case\"rowSpan\":case\"start\":l==null||typeof l==\"function\"||typeof l==\"symbol\"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case\"popover\":ve(\"beforetoggle\",e),ve(\"toggle\",e),lu(e,\"popover\",l);break;case\"xlinkActuate\":Vt(e,\"http://www.w3.org/1999/xlink\",\"xlink:actuate\",l);break;case\"xlinkArcrole\":Vt(e,\"http://www.w3.org/1999/xlink\",\"xlink:arcrole\",l);break;case\"xlinkRole\":Vt(e,\"http://www.w3.org/1999/xlink\",\"xlink:role\",l);break;case\"xlinkShow\":Vt(e,\"http://www.w3.org/1999/xlink\",\"xlink:show\",l);break;case\"xlinkTitle\":Vt(e,\"http://www.w3.org/1999/xlink\",\"xlink:title\",l);break;case\"xlinkType\":Vt(e,\"http://www.w3.org/1999/xlink\",\"xlink:type\",l);break;case\"xmlBase\":Vt(e,\"http://www.w3.org/XML/1998/namespace\",\"xml:base\",l);break;case\"xmlLang\":Vt(e,\"http://www.w3.org/XML/1998/namespace\",\"xml:lang\",l);break;case\"xmlSpace\":Vt(e,\"http://www.w3.org/XML/1998/namespace\",\"xml:space\",l);break;case\"is\":lu(e,\"is\",l);break;case\"innerText\":case\"textContent\":break;default:(!(2<n.length)||n[0]!==\"o\"&&n[0]!==\"O\"||n[1]!==\"n\"&&n[1]!==\"N\")&&(n=B0.get(n)||n,lu(e,n,l))}}function ms(e,t,n,l,a,u){switch(n){case\"style\":qf(e,l,u);break;case\"dangerouslySetInnerHTML\":if(l!=null){if(typeof l!=\"object\"||!(\"__html\"in l))throw Error(s(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(s(60));e.innerHTML=n}}break;case\"children\":typeof l==\"string\"?vl(e,l):(typeof l==\"number\"||typeof l==\"bigint\")&&vl(e,\"\"+l);break;case\"onScroll\":l!=null&&ve(\"scroll\",e);break;case\"onScrollEnd\":l!=null&&ve(\"scrollend\",e);break;case\"onClick\":l!=null&&(e.onclick=kt);break;case\"suppressContentEditableWarning\":case\"suppressHydrationWarning\":case\"innerHTML\":case\"ref\":break;case\"innerText\":case\"textContent\":break;default:if(!_f.hasOwnProperty(n))e:{if(n[0]===\"o\"&&n[1]===\"n\"&&(a=n.endsWith(\"Capture\"),t=n.slice(2,a?n.length-7:void 0),u=e[ct]||null,u=u!=null?u[n]:null,typeof u==\"function\"&&e.removeEventListener(t,u,a),typeof l==\"function\")){typeof u!=\"function\"&&u!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,a);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,\"\"):lu(e,n,l)}}}function tt(e,t,n){switch(t){case\"div\":case\"span\":case\"svg\":case\"path\":case\"a\":case\"g\":case\"p\":case\"li\":break;case\"img\":ve(\"error\",e),ve(\"load\",e);var l=!1,a=!1,u;for(u in n)if(n.hasOwnProperty(u)){var f=n[u];if(f!=null)switch(u){case\"src\":l=!0;break;case\"srcSet\":a=!0;break;case\"children\":case\"dangerouslySetInnerHTML\":throw Error(s(137,t));default:Ue(e,t,u,f,n,null)}}a&&Ue(e,t,\"srcSet\",n.srcSet,n,null),l&&Ue(e,t,\"src\",n.src,n,null);return;case\"input\":ve(\"invalid\",e);var o=u=f=a=null,y=null,C=null;for(l in n)if(n.hasOwnProperty(l)){var w=n[l];if(w!=null)switch(l){case\"name\":a=w;break;case\"type\":f=w;break;case\"checked\":y=w;break;case\"defaultChecked\":C=w;break;case\"value\":u=w;break;case\"defaultValue\":o=w;break;case\"children\":case\"dangerouslySetInnerHTML\":if(w!=null)throw Error(s(137,t));break;default:Ue(e,t,l,w,n,null)}}Of(e,u,o,y,C,f,a,!1);return;case\"select\":ve(\"invalid\",e),l=f=u=null;for(a in n)if(n.hasOwnProperty(a)&&(o=n[a],o!=null))switch(a){case\"value\":u=o;break;case\"defaultValue\":f=o;break;case\"multiple\":l=o;default:Ue(e,t,a,o,n,null)}t=u,n=f,e.multiple=!!l,t!=null?yl(e,!!l,t,!1):n!=null&&yl(e,!!l,n,!0);return;case\"textarea\":ve(\"invalid\",e),u=a=l=null;for(f in n)if(n.hasOwnProperty(f)&&(o=n[f],o!=null))switch(f){case\"value\":l=o;break;case\"defaultValue\":a=o;break;case\"children\":u=o;break;case\"dangerouslySetInnerHTML\":if(o!=null)throw Error(s(91));break;default:Ue(e,t,f,o,n,null)}Bf(e,l,a,u);return;case\"option\":for(y in n)if(n.hasOwnProperty(y)&&(l=n[y],l!=null))switch(y){case\"selected\":e.selected=l&&typeof l!=\"function\"&&typeof l!=\"symbol\";break;default:Ue(e,t,y,l,n,null)}return;case\"dialog\":ve(\"beforetoggle\",e),ve(\"toggle\",e),ve(\"cancel\",e),ve(\"close\",e);break;case\"iframe\":case\"object\":ve(\"load\",e);break;case\"video\":case\"audio\":for(l=0;l<Ba.length;l++)ve(Ba[l],e);break;case\"image\":ve(\"error\",e),ve(\"load\",e);break;case\"details\":ve(\"toggle\",e);break;case\"embed\":case\"source\":case\"link\":ve(\"error\",e),ve(\"load\",e);case\"area\":case\"base\":case\"br\":case\"col\":case\"hr\":case\"keygen\":case\"meta\":case\"param\":case\"track\":case\"wbr\":case\"menuitem\":for(C in n)if(n.hasOwnProperty(C)&&(l=n[C],l!=null))switch(C){case\"children\":case\"dangerouslySetInnerHTML\":throw Error(s(137,t));default:Ue(e,t,C,l,n,null)}return;default:if(xi(t)){for(w in n)n.hasOwnProperty(w)&&(l=n[w],l!==void 0&&ms(e,t,w,l,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(l=n[o],l!=null&&Ue(e,t,o,l,n,null))}function fg(e,t,n,l){switch(t){case\"div\":case\"span\":case\"svg\":case\"path\":case\"a\":case\"g\":case\"p\":case\"li\":break;case\"input\":var a=null,u=null,f=null,o=null,y=null,C=null,w=null;for(_ in n){var O=n[_];if(n.hasOwnProperty(_)&&O!=null)switch(_){case\"checked\":break;case\"value\":break;case\"defaultValue\":y=O;default:l.hasOwnProperty(_)||Ue(e,t,_,null,l,O)}}for(var x in l){var _=l[x];if(O=n[x],l.hasOwnProperty(x)&&(_!=null||O!=null))switch(x){case\"type\":u=_;break;case\"name\":a=_;break;case\"checked\":C=_;break;case\"defaultChecked\":w=_;break;case\"value\":f=_;break;case\"defaultValue\":o=_;break;case\"children\":case\"dangerouslySetInnerHTML\":if(_!=null)throw Error(s(137,t));break;default:_!==O&&Ue(e,t,x,_,l,O)}}Ni(e,f,o,y,C,w,u,a);return;case\"select\":_=f=o=x=null;for(u in n)if(y=n[u],n.hasOwnProperty(u)&&y!=null)switch(u){case\"value\":break;case\"multiple\":_=y;default:l.hasOwnProperty(u)||Ue(e,t,u,null,l,y)}for(a in l)if(u=l[a],y=n[a],l.hasOwnProperty(a)&&(u!=null||y!=null))switch(a){case\"value\":x=u;break;case\"defaultValue\":o=u;break;case\"multiple\":f=u;default:u!==y&&Ue(e,t,a,u,l,y)}t=o,n=f,l=_,x!=null?yl(e,!!n,x,!1):!!l!=!!n&&(t!=null?yl(e,!!n,t,!0):yl(e,!!n,n?[]:\"\",!1));return;case\"textarea\":_=x=null;for(o in n)if(a=n[o],n.hasOwnProperty(o)&&a!=null&&!l.hasOwnProperty(o))switch(o){case\"value\":break;case\"children\":break;default:Ue(e,t,o,null,l,a)}for(f in l)if(a=l[f],u=n[f],l.hasOwnProperty(f)&&(a!=null||u!=null))switch(f){case\"value\":x=a;break;case\"defaultValue\":_=a;break;case\"children\":break;case\"dangerouslySetInnerHTML\":if(a!=null)throw Error(s(91));break;default:a!==u&&Ue(e,t,f,a,l,u)}Df(e,x,_);return;case\"option\":for(var P in n)if(x=n[P],n.hasOwnProperty(P)&&x!=null&&!l.hasOwnProperty(P))switch(P){case\"selected\":e.selected=!1;break;default:Ue(e,t,P,null,l,x)}for(y in l)if(x=l[y],_=n[y],l.hasOwnProperty(y)&&x!==_&&(x!=null||_!=null))switch(y){case\"selected\":e.selected=x&&typeof x!=\"function\"&&typeof x!=\"symbol\";break;default:Ue(e,t,y,x,l,_)}return;case\"img\":case\"link\":case\"area\":case\"base\":case\"br\":case\"col\":case\"embed\":case\"hr\":case\"keygen\":case\"meta\":case\"param\":case\"source\":case\"track\":case\"wbr\":case\"menuitem\":for(var ie in n)x=n[ie],n.hasOwnProperty(ie)&&x!=null&&!l.hasOwnProperty(ie)&&Ue(e,t,ie,null,l,x);for(C in l)if(x=l[C],_=n[C],l.hasOwnProperty(C)&&x!==_&&(x!=null||_!=null))switch(C){case\"children\":case\"dangerouslySetInnerHTML\":if(x!=null)throw Error(s(137,t));break;default:Ue(e,t,C,x,l,_)}return;default:if(xi(t)){for(var Re in n)x=n[Re],n.hasOwnProperty(Re)&&x!==void 0&&!l.hasOwnProperty(Re)&&ms(e,t,Re,void 0,l,x);for(w in l)x=l[w],_=n[w],!l.hasOwnProperty(w)||x===_||x===void 0&&_===void 0||ms(e,t,w,x,l,_);return}}for(var T in n)x=n[T],n.hasOwnProperty(T)&&x!=null&&!l.hasOwnProperty(T)&&Ue(e,t,T,null,l,x);for(O in l)x=l[O],_=n[O],!l.hasOwnProperty(O)||x===_||x==null&&_==null||Ue(e,t,O,x,l,_)}function Ld(e){switch(e){case\"css\":case\"script\":case\"font\":case\"img\":case\"image\":case\"input\":case\"link\":return!0;default:return!1}}function rg(){if(typeof performance.getEntriesByType==\"function\"){for(var e=0,t=0,n=performance.getEntriesByType(\"resource\"),l=0;l<n.length;l++){var a=n[l],u=a.transferSize,f=a.initiatorType,o=a.duration;if(u&&o&&Ld(f)){for(f=0,o=a.responseEnd,l+=1;l<n.length;l++){var y=n[l],C=y.startTime;if(C>o)break;var w=y.transferSize,O=y.initiatorType;w&&Ld(O)&&(y=y.responseEnd,f+=w*(y<o?1:(o-C)/(y-C)))}if(--l,t+=8*(u+f)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==\"number\")?e:5}var gs=null,ys=null;function ti(e){return e.nodeType===9?e:e.ownerDocument}function Gd(e){switch(e){case\"http://www.w3.org/2000/svg\":return 1;case\"http://www.w3.org/1998/Math/MathML\":return 2;default:return 0}}function Qd(e,t){if(e===0)switch(t){case\"svg\":return 1;case\"math\":return 2;default:return 0}return e===1&&t===\"foreignObject\"?0:e}function vs(e,t){return e===\"textarea\"||e===\"noscript\"||typeof t.children==\"string\"||typeof t.children==\"number\"||typeof t.children==\"bigint\"||typeof t.dangerouslySetInnerHTML==\"object\"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bs=null;function og(){var e=window.event;return e&&e.type===\"popstate\"?e===bs?!1:(bs=e,!0):(bs=null,!1)}var Xd=typeof setTimeout==\"function\"?setTimeout:void 0,dg=typeof clearTimeout==\"function\"?clearTimeout:void 0,Kd=typeof Promise==\"function\"?Promise:void 0,hg=typeof queueMicrotask==\"function\"?queueMicrotask:typeof Kd<\"u\"?function(e){return Kd.resolve(null).then(e).catch(mg)}:Xd;function mg(e){setTimeout(function(){throw e})}function Mn(e){return e===\"head\"}function Zd(e,t){var n=t,l=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n===\"/$\"||n===\"/&\"){if(l===0){e.removeChild(a),Jl(t);return}l--}else if(n===\"$\"||n===\"$?\"||n===\"$~\"||n===\"$!\"||n===\"&\")l++;else if(n===\"html\")qa(e.ownerDocument.documentElement);else if(n===\"head\"){n=e.ownerDocument.head,qa(n);for(var u=n.firstChild;u;){var f=u.nextSibling,o=u.nodeName;u[na]||o===\"SCRIPT\"||o===\"STYLE\"||o===\"LINK\"&&u.rel.toLowerCase()===\"stylesheet\"||n.removeChild(u),u=f}}else n===\"body\"&&qa(e.ownerDocument.body);n=a}while(n);Jl(t)}function Vd(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=\"none\"):(n.style.display=n._stashedDisplay||\"\",n.getAttribute(\"style\")===\"\"&&n.removeAttribute(\"style\")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=\"\"):n.nodeValue=n._stashedText||\"\"),l&&l.nodeType===8)if(n=l.data,n===\"/$\"){if(e===0)break;e--}else n!==\"$\"&&n!==\"$?\"&&n!==\"$~\"&&n!==\"$!\"||e++;n=l}while(n)}function Ss(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case\"HTML\":case\"HEAD\":case\"BODY\":Ss(n),zi(n);continue;case\"SCRIPT\":case\"STYLE\":continue;case\"LINK\":if(n.rel.toLowerCase()===\"stylesheet\")continue}e.removeChild(n)}}function gg(e,t,n,l){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!==\"INPUT\"||e.type!==\"hidden\"))break}else if(l){if(!e[na])switch(t){case\"meta\":if(!e.hasAttribute(\"itemprop\"))break;return e;case\"link\":if(u=e.getAttribute(\"rel\"),u===\"stylesheet\"&&e.hasAttribute(\"data-precedence\"))break;if(u!==a.rel||e.getAttribute(\"href\")!==(a.href==null||a.href===\"\"?null:a.href)||e.getAttribute(\"crossorigin\")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute(\"title\")!==(a.title==null?null:a.title))break;return e;case\"style\":if(e.hasAttribute(\"data-precedence\"))break;return e;case\"script\":if(u=e.getAttribute(\"src\"),(u!==(a.src==null?null:a.src)||e.getAttribute(\"type\")!==(a.type==null?null:a.type)||e.getAttribute(\"crossorigin\")!==(a.crossOrigin==null?null:a.crossOrigin))&&u&&e.hasAttribute(\"async\")&&!e.hasAttribute(\"itemprop\"))break;return e;default:return e}}else if(t===\"input\"&&e.type===\"hidden\"){var u=a.name==null?null:\"\"+a.name;if(a.type===\"hidden\"&&e.getAttribute(\"name\")===u)return e}else return e;if(e=Rt(e.nextSibling),e===null)break}return null}function yg(e,t,n){if(t===\"\")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==\"INPUT\"||e.type!==\"hidden\")&&!n||(e=Rt(e.nextSibling),e===null))return null;return e}function kd(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==\"INPUT\"||e.type!==\"hidden\")&&!t||(e=Rt(e.nextSibling),e===null))return null;return e}function ps(e){return e.data===\"$?\"||e.data===\"$~\"}function Es(e){return e.data===\"$!\"||e.data===\"$?\"&&e.ownerDocument.readyState!==\"loading\"}function vg(e,t){var n=e.ownerDocument;if(e.data===\"$~\")e._reactRetry=t;else if(e.data!==\"$?\"||n.readyState!==\"loading\")t();else{var l=function(){t(),n.removeEventListener(\"DOMContentLoaded\",l)};n.addEventListener(\"DOMContentLoaded\",l),e._reactRetry=l}}function Rt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===\"$\"||t===\"$!\"||t===\"$?\"||t===\"$~\"||t===\"&\"||t===\"F!\"||t===\"F\")break;if(t===\"/$\"||t===\"/&\")return null}}return e}var Ts=null;function Jd(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===\"/$\"||n===\"/&\"){if(t===0)return Rt(e.nextSibling);t--}else n!==\"$\"&&n!==\"$!\"&&n!==\"$?\"&&n!==\"$~\"&&n!==\"&\"||t++}e=e.nextSibling}return null}function $d(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===\"$\"||n===\"$!\"||n===\"$?\"||n===\"$~\"||n===\"&\"){if(t===0)return e;t--}else n!==\"/$\"&&n!==\"/&\"||t++}e=e.previousSibling}return null}function Fd(e,t,n){switch(t=ti(n),e){case\"html\":if(e=t.documentElement,!e)throw Error(s(452));return e;case\"head\":if(e=t.head,!e)throw Error(s(453));return e;case\"body\":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function qa(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);zi(e)}var Ot=new Map,Wd=new Set;function ni(e){return typeof e.getRootNode==\"function\"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var rn=G.d;G.d={f:bg,r:Sg,D:pg,C:Eg,L:Tg,m:Ag,X:Cg,S:zg,M:Ng};function bg(){var e=rn.f(),t=ku();return e||t}function Sg(e){var t=hl(e);t!==null&&t.tag===5&&t.type===\"form\"?mo(t):rn.r(e)}var Zl=typeof document>\"u\"?null:document;function Id(e,t,n){var l=Zl;if(l&&typeof t==\"string\"&&t){var a=Nt(t);a='link[rel=\"'+e+'\"][href=\"'+a+'\"]',typeof n==\"string\"&&(a+='[crossorigin=\"'+n+'\"]'),Wd.has(a)||(Wd.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement(\"link\"),tt(t,\"link\",e),$e(t),l.head.appendChild(t)))}}function pg(e){rn.D(e),Id(\"dns-prefetch\",e,null)}function Eg(e,t){rn.C(e,t),Id(\"preconnect\",e,t)}function Tg(e,t,n){rn.L(e,t,n);var l=Zl;if(l&&e&&t){var a='link[rel=\"preload\"][as=\"'+Nt(t)+'\"]';t===\"image\"&&n&&n.imageSrcSet?(a+='[imagesrcset=\"'+Nt(n.imageSrcSet)+'\"]',typeof n.imageSizes==\"string\"&&(a+='[imagesizes=\"'+Nt(n.imageSizes)+'\"]')):a+='[href=\"'+Nt(e)+'\"]';var u=a;switch(t){case\"style\":u=Vl(e);break;case\"script\":u=kl(e)}Ot.has(u)||(e=E({rel:\"preload\",href:t===\"image\"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ot.set(u,e),l.querySelector(a)!==null||t===\"style\"&&l.querySelector(Ya(u))||t===\"script\"&&l.querySelector(La(u))||(t=l.createElement(\"link\"),tt(t,\"link\",e),$e(t),l.head.appendChild(t)))}}function Ag(e,t){rn.m(e,t);var n=Zl;if(n&&e){var l=t&&typeof t.as==\"string\"?t.as:\"script\",a='link[rel=\"modulepreload\"][as=\"'+Nt(l)+'\"][href=\"'+Nt(e)+'\"]',u=a;switch(l){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":u=kl(e)}if(!Ot.has(u)&&(e=E({rel:\"modulepreload\",href:e},t),Ot.set(u,e),n.querySelector(a)===null)){switch(l){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":if(n.querySelector(La(u)))return}l=n.createElement(\"link\"),tt(l,\"link\",e),$e(l),n.head.appendChild(l)}}}function zg(e,t,n){rn.S(e,t,n);var l=Zl;if(l&&e){var a=ml(l).hoistableStyles,u=Vl(e);t=t||\"default\";var f=a.get(u);if(!f){var o={loading:0,preload:null};if(f=l.querySelector(Ya(u)))o.loading=5;else{e=E({rel:\"stylesheet\",href:e,\"data-precedence\":t},n),(n=Ot.get(u))&&As(e,n);var y=f=l.createElement(\"link\");$e(y),tt(y,\"link\",e),y._p=new Promise(function(C,w){y.onload=C,y.onerror=w}),y.addEventListener(\"load\",function(){o.loading|=1}),y.addEventListener(\"error\",function(){o.loading|=2}),o.loading|=4,li(f,t,l)}f={type:\"stylesheet\",instance:f,count:1,state:o},a.set(u,f)}}}function Cg(e,t){rn.X(e,t);var n=Zl;if(n&&e){var l=ml(n).hoistableScripts,a=kl(e),u=l.get(a);u||(u=n.querySelector(La(a)),u||(e=E({src:e,async:!0},t),(t=Ot.get(a))&&zs(e,t),u=n.createElement(\"script\"),$e(u),tt(u,\"link\",e),n.head.appendChild(u)),u={type:\"script\",instance:u,count:1,state:null},l.set(a,u))}}function Ng(e,t){rn.M(e,t);var n=Zl;if(n&&e){var l=ml(n).hoistableScripts,a=kl(e),u=l.get(a);u||(u=n.querySelector(La(a)),u||(e=E({src:e,async:!0,type:\"module\"},t),(t=Ot.get(a))&&zs(e,t),u=n.createElement(\"script\"),$e(u),tt(u,\"link\",e),n.head.appendChild(u)),u={type:\"script\",instance:u,count:1,state:null},l.set(a,u))}}function Pd(e,t,n,l){var a=(a=re.current)?ni(a):null;if(!a)throw Error(s(446));switch(e){case\"meta\":case\"title\":return null;case\"style\":return typeof n.precedence==\"string\"&&typeof n.href==\"string\"?(t=Vl(n.href),n=ml(a).hoistableStyles,l=n.get(t),l||(l={type:\"style\",instance:null,count:0,state:null},n.set(t,l)),l):{type:\"void\",instance:null,count:0,state:null};case\"link\":if(n.rel===\"stylesheet\"&&typeof n.href==\"string\"&&typeof n.precedence==\"string\"){e=Vl(n.href);var u=ml(a).hoistableStyles,f=u.get(e);if(f||(a=a.ownerDocument||a,f={type:\"stylesheet\",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,f),(u=a.querySelector(Ya(e)))&&!u._p&&(f.instance=u,f.state.loading=5),Ot.has(e)||(n={rel:\"preload\",as:\"style\",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ot.set(e,n),u||jg(a,e,n,f.state))),t&&l===null)throw Error(s(528,\"\"));return f}if(t&&l!==null)throw Error(s(529,\"\"));return null;case\"script\":return t=n.async,n=n.src,typeof n==\"string\"&&t&&typeof t!=\"function\"&&typeof t!=\"symbol\"?(t=kl(n),n=ml(a).hoistableScripts,l=n.get(t),l||(l={type:\"script\",instance:null,count:0,state:null},n.set(t,l)),l):{type:\"void\",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Vl(e){return'href=\"'+Nt(e)+'\"'}function Ya(e){return'link[rel=\"stylesheet\"]['+e+\"]\"}function eh(e){return E({},e,{\"data-precedence\":e.precedence,precedence:null})}function jg(e,t,n,l){e.querySelector('link[rel=\"preload\"][as=\"style\"]['+t+\"]\")?l.loading=1:(t=e.createElement(\"link\"),l.preload=t,t.addEventListener(\"load\",function(){return l.loading|=1}),t.addEventListener(\"error\",function(){return l.loading|=2}),tt(t,\"link\",n),$e(t),e.head.appendChild(t))}function kl(e){return'[src=\"'+Nt(e)+'\"]'}function La(e){return\"script[async]\"+e}function th(e,t,n){if(t.count++,t.instance===null)switch(t.type){case\"style\":var l=e.querySelector('style[data-href~=\"'+Nt(n.href)+'\"]');if(l)return t.instance=l,$e(l),l;var a=E({},n,{\"data-href\":n.href,\"data-precedence\":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement(\"style\"),$e(l),tt(l,\"style\",a),li(l,n.precedence,e),t.instance=l;case\"stylesheet\":a=Vl(n.href);var u=e.querySelector(Ya(a));if(u)return t.state.loading|=4,t.instance=u,$e(u),u;l=eh(n),(a=Ot.get(a))&&As(l,a),u=(e.ownerDocument||e).createElement(\"link\"),$e(u);var f=u;return f._p=new Promise(function(o,y){f.onload=o,f.onerror=y}),tt(u,\"link\",l),t.state.loading|=4,li(u,n.precedence,e),t.instance=u;case\"script\":return u=kl(n.src),(a=e.querySelector(La(u)))?(t.instance=a,$e(a),a):(l=n,(a=Ot.get(u))&&(l=E({},n),zs(l,a)),e=e.ownerDocument||e,a=e.createElement(\"script\"),$e(a),tt(a,\"link\",l),e.head.appendChild(a),t.instance=a);case\"void\":return null;default:throw Error(s(443,t.type))}else t.type===\"stylesheet\"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,li(l,n.precedence,e));return t.instance}function li(e,t,n){for(var l=n.querySelectorAll('link[rel=\"stylesheet\"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,u=a,f=0;f<l.length;f++){var o=l[f];if(o.dataset.precedence===t)u=o;else if(u!==a)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function As(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function zs(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ai=null;function nh(e,t,n){if(ai===null){var l=new Map,a=ai=new Map;a.set(n,l)}else a=ai,l=a.get(n),l||(l=new Map,a.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var u=n[a];if(!(u[na]||u[We]||e===\"link\"&&u.getAttribute(\"rel\")===\"stylesheet\")&&u.namespaceURI!==\"http://www.w3.org/2000/svg\"){var f=u.getAttribute(t)||\"\";f=e+f;var o=l.get(f);o?o.push(u):l.set(f,[u])}}return l}function lh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===\"title\"?e.querySelector(\"head > title\"):null)}function xg(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case\"meta\":case\"title\":return!0;case\"style\":if(typeof t.precedence!=\"string\"||typeof t.href!=\"string\"||t.href===\"\")break;return!0;case\"link\":if(typeof t.rel!=\"string\"||typeof t.href!=\"string\"||t.href===\"\"||t.onLoad||t.onError)break;switch(t.rel){case\"stylesheet\":return e=t.disabled,typeof t.precedence==\"string\"&&e==null;default:return!0}case\"script\":if(t.async&&typeof t.async!=\"function\"&&typeof t.async!=\"symbol\"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==\"string\")return!0}return!1}function ah(e){return!(e.type===\"stylesheet\"&&(e.state.loading&3)===0)}function _g(e,t,n,l){if(n.type===\"stylesheet\"&&(typeof l.media!=\"string\"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=Vl(l.href),u=t.querySelector(Ya(a));if(u){t=u._p,t!==null&&typeof t==\"object\"&&typeof t.then==\"function\"&&(e.count++,e=ui.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,$e(u);return}u=t.ownerDocument||t,l=eh(l),(a=Ot.get(a))&&As(l,a),u=u.createElement(\"link\"),$e(u);var f=u;f._p=new Promise(function(o,y){f.onload=o,f.onerror=y}),tt(u,\"link\",l),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=ui.bind(e),t.addEventListener(\"load\",n),t.addEventListener(\"error\",n))}}var Cs=0;function Mg(e,t){return e.stylesheets&&e.count===0&&ci(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&ci(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Cs===0&&(Cs=62500*rg());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ci(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Cs?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function ui(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ci(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ii=null;function ci(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ii=new Map,t.forEach(wg,e),ii=null,ui.call(e))}function wg(e,t){if(!(t.state.loading&4)){var n=ii.get(e);if(n)var l=n.get(null);else{n=new Map,ii.set(e,n);for(var a=e.querySelectorAll(\"link[data-precedence],style[data-precedence]\"),u=0;u<a.length;u++){var f=a[u];(f.nodeName===\"LINK\"||f.getAttribute(\"media\")!==\"not all\")&&(n.set(f.dataset.precedence,f),l=f)}l&&n.set(null,l)}a=t.instance,f=a.getAttribute(\"data-precedence\"),u=n.get(f)||l,u===l&&n.set(null,a),n.set(f,a),this.count++,l=ui.bind(this),a.addEventListener(\"load\",l),a.addEventListener(\"error\",l),u?u.parentNode.insertBefore(a,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Ga={$$typeof:I,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function Ug(e,t,n,l,a,u,f,o,y){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=pi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pi(0),this.hiddenUpdates=pi(null),this.identifierPrefix=l,this.onUncaughtError=a,this.onCaughtError=u,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=y,this.incompleteTransitions=new Map}function uh(e,t,n,l,a,u,f,o,y,C,w,O){return e=new Ug(e,t,n,f,y,C,w,O,o),t=1,u===!0&&(t|=24),u=vt(3,null,null,t),e.current=u,u.stateNode=e,t=ac(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:l,isDehydrated:n,cache:t},sc(u),e}function ih(e){return e?(e=zl,e):zl}function ch(e,t,n,l,a,u){a=ih(a),l.context===null?l.context=a:l.pendingContext=a,l=Sn(t),l.payload={element:n},u=u===void 0?null:u,u!==null&&(l.callback=u),n=pn(e,l,t),n!==null&&(ht(n,e,t),Sa(n,e,t))}function sh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ns(e,t){sh(e,t),(e=e.alternate)&&sh(e,t)}function fh(e){if(e.tag===13||e.tag===31){var t=Qn(e,67108864);t!==null&&ht(t,e,67108864),Ns(e,67108864)}}function rh(e){if(e.tag===13||e.tag===31){var t=Tt();t=Ei(t);var n=Qn(e,t);n!==null&&ht(n,e,t),Ns(e,t)}}var si=!0;function Rg(e,t,n,l){var a=M.T;M.T=null;var u=G.p;try{G.p=2,js(e,t,n,l)}finally{G.p=u,M.T=a}}function Og(e,t,n,l){var a=M.T;M.T=null;var u=G.p;try{G.p=8,js(e,t,n,l)}finally{G.p=u,M.T=a}}function js(e,t,n,l){if(si){var a=xs(l);if(a===null)hs(e,t,l,fi,n),dh(e,l);else if(Bg(a,e,t,n,l))l.stopPropagation();else if(dh(e,l),t&4&&-1<Dg.indexOf(e)){for(;a!==null;){var u=hl(a);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var f=Hn(u.pendingLanes);if(f!==0){var o=u;for(o.pendingLanes|=2,o.entangledLanes|=2;f;){var y=1<<31-gt(f);o.entanglements[1]|=y,f&=~y}Qt(u),(je&6)===0&&(Zu=ut()+500,Da(0))}}break;case 31:case 13:o=Qn(u,2),o!==null&&ht(o,u,2),ku(),Ns(u,2)}if(u=xs(l),u===null&&hs(e,t,l,fi,n),u===a)break;a=u}a!==null&&l.stopPropagation()}else hs(e,t,l,null,n)}}function xs(e){return e=Mi(e),_s(e)}var fi=null;function _s(e){if(fi=null,e=dl(e),e!==null){var t=h(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=v(t),e!==null)return e;e=null}else if(n===31){if(e=A(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fi=e,null}function oh(e){switch(e){case\"beforetoggle\":case\"cancel\":case\"click\":case\"close\":case\"contextmenu\":case\"copy\":case\"cut\":case\"auxclick\":case\"dblclick\":case\"dragend\":case\"dragstart\":case\"drop\":case\"focusin\":case\"focusout\":case\"input\":case\"invalid\":case\"keydown\":case\"keypress\":case\"keyup\":case\"mousedown\":case\"mouseup\":case\"paste\":case\"pause\":case\"play\":case\"pointercancel\":case\"pointerdown\":case\"pointerup\":case\"ratechange\":case\"reset\":case\"resize\":case\"seeked\":case\"submit\":case\"toggle\":case\"touchcancel\":case\"touchend\":case\"touchstart\":case\"volumechange\":case\"change\":case\"selectionchange\":case\"textInput\":case\"compositionstart\":case\"compositionend\":case\"compositionupdate\":case\"beforeblur\":case\"afterblur\":case\"beforeinput\":case\"blur\":case\"fullscreenchange\":case\"focus\":case\"hashchange\":case\"popstate\":case\"select\":case\"selectstart\":return 2;case\"drag\":case\"dragenter\":case\"dragexit\":case\"dragleave\":case\"dragover\":case\"mousemove\":case\"mouseout\":case\"mouseover\":case\"pointermove\":case\"pointerout\":case\"pointerover\":case\"scroll\":case\"touchmove\":case\"wheel\":case\"mouseenter\":case\"mouseleave\":case\"pointerenter\":case\"pointerleave\":return 8;case\"message\":switch(H()){case J:return 2;case he:return 8;case De:case lt:return 32;case rl:return 268435456;default:return 32}default:return 32}}var Ms=!1,wn=null,Un=null,Rn=null,Qa=new Map,Xa=new Map,On=[],Dg=\"mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset\".split(\" \");function dh(e,t){switch(e){case\"focusin\":case\"focusout\":wn=null;break;case\"dragenter\":case\"dragleave\":Un=null;break;case\"mouseover\":case\"mouseout\":Rn=null;break;case\"pointerover\":case\"pointerout\":Qa.delete(t.pointerId);break;case\"gotpointercapture\":case\"lostpointercapture\":Xa.delete(t.pointerId)}}function Ka(e,t,n,l,a,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:u,targetContainers:[a]},t!==null&&(t=hl(t),t!==null&&fh(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Bg(e,t,n,l,a){switch(t){case\"focusin\":return wn=Ka(wn,e,t,n,l,a),!0;case\"dragenter\":return Un=Ka(Un,e,t,n,l,a),!0;case\"mouseover\":return Rn=Ka(Rn,e,t,n,l,a),!0;case\"pointerover\":var u=a.pointerId;return Qa.set(u,Ka(Qa.get(u)||null,e,t,n,l,a)),!0;case\"gotpointercapture\":return u=a.pointerId,Xa.set(u,Ka(Xa.get(u)||null,e,t,n,l,a)),!0}return!1}function hh(e){var t=dl(e.target);if(t!==null){var n=h(t);if(n!==null){if(t=n.tag,t===13){if(t=v(n),t!==null){e.blockedOn=t,Nf(e.priority,function(){rh(n)});return}}else if(t===31){if(t=A(n),t!==null){e.blockedOn=t,Nf(e.priority,function(){rh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ri(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xs(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);_i=l,n.target.dispatchEvent(l),_i=null}else return t=hl(n),t!==null&&fh(t),e.blockedOn=n,!1;t.shift()}return!0}function mh(e,t,n){ri(e)&&n.delete(t)}function Hg(){Ms=!1,wn!==null&&ri(wn)&&(wn=null),Un!==null&&ri(Un)&&(Un=null),Rn!==null&&ri(Rn)&&(Rn=null),Qa.forEach(mh),Xa.forEach(mh)}function oi(e,t){e.blockedOn===t&&(e.blockedOn=null,Ms||(Ms=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Hg)))}var di=null;function gh(e){di!==e&&(di=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){di===e&&(di=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],a=e[t+2];if(typeof l!=\"function\"){if(_s(l||n)===null)continue;break}var u=hl(n);u!==null&&(e.splice(t,3),t-=3,xc(u,{pending:!0,data:a,method:n.method,action:l},l,a))}}))}function Jl(e){function t(y){return oi(y,e)}wn!==null&&oi(wn,e),Un!==null&&oi(Un,e),Rn!==null&&oi(Rn,e),Qa.forEach(t),Xa.forEach(t);for(var n=0;n<On.length;n++){var l=On[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<On.length&&(n=On[0],n.blockedOn===null);)hh(n),n.blockedOn===null&&On.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var a=n[l],u=n[l+1],f=a[ct]||null;if(typeof u==\"function\")f||gh(n);else if(f){var o=null;if(u&&u.hasAttribute(\"formAction\")){if(a=u,f=u[ct]||null)o=f.formAction;else if(_s(a)!==null)continue}else o=f.action;typeof o==\"function\"?n[l+1]=o:(n.splice(l,3),l-=3),gh(n)}}}function yh(){function e(u){u.canIntercept&&u.info===\"react-transition\"&&u.intercept({handler:function(){return new Promise(function(f){return a=f})},focusReset:\"manual\",scroll:\"manual\"})}function t(){a!==null&&(a(),a=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:\"react-transition\",history:\"replace\"})}}if(typeof navigation==\"object\"){var l=!1,a=null;return navigation.addEventListener(\"navigate\",e),navigation.addEventListener(\"navigatesuccess\",t),navigation.addEventListener(\"navigateerror\",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener(\"navigate\",e),navigation.removeEventListener(\"navigatesuccess\",t),navigation.removeEventListener(\"navigateerror\",t),a!==null&&(a(),a=null)}}}function ws(e){this._internalRoot=e}hi.prototype.render=ws.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var n=t.current,l=Tt();ch(n,l,e,t,null,null)},hi.prototype.unmount=ws.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ch(e.current,2,null,e,null,null),ku(),t[ol]=null}};function hi(e){this._internalRoot=e}hi.prototype.unstable_scheduleHydration=function(e){if(e){var t=Cf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<On.length&&t!==0&&t<On[n].priority;n++);On.splice(n,0,e),n===0&&hh(e)}};var vh=c.version;if(vh!==\"19.2.8\")throw Error(s(527,vh,\"19.2.8\"));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==\"function\"?Error(s(188)):(e=Object.keys(e).join(\",\"),Error(s(268,e)));return e=g(t),e=e!==null?N(e):null,e=e===null?null:e.stateNode,e};var qg={bundleType:0,version:\"19.2.8\",rendererPackageName:\"react-dom\",currentDispatcherRef:M,reconcilerVersion:\"19.2.8\"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<\"u\"){var mi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mi.isDisabled&&mi.supportsFiber)try{Pl=mi.inject(qg),mt=mi}catch{}}return Va.createRoot=function(e,t){if(!d(e))throw Error(s(299));var n=!1,l=\"\",a=zo,u=Co,f=No;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=uh(e,1,!1,null,null,n,l,null,a,u,f,yh),e[ol]=t.current,ds(e),new ws(t)},Va.hydrateRoot=function(e,t,n){if(!d(e))throw Error(s(299));var l=!1,a=\"\",u=zo,f=Co,o=No,y=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.formState!==void 0&&(y=n.formState)),t=uh(e,1,!0,t,n??null,l,a,y,u,f,o,yh),t.context=ih(null),n=t.current,l=Tt(),l=Ei(l),a=Sn(l),a.callback=null,pn(n,a,l),n=l,t.current.lanes=n,ta(t,n),Qt(t),e[ol]=t.current,ds(e),new hi(t)},Va.version=\"19.2.8\",Va}var jh;function $g(){if(jh)return Os.exports;jh=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Os.exports=Jg(),Os.exports}var Fg=$g(),Wg=[\"runtime.ready\",\"store.ready\",\"runtime.stopping\",\"agent.loaded\",\"agent.disposed\",\"agent.warning\",\"plugin.loaded\",\"plugin.slow\",\"approval.requested\",\"approval.resolved\",\"handoff.start\",\"handoff.result\",\"turn.start\",\"context.assembled\",\"context.dropped\",\"context.pressure\",\"compaction.stage\",\"context.reset\",\"phase.changed\",\"model.call\",\"model.chunk\",\"model.retry\",\"model.result\",\"tool.call\",\"tool.result\",\"tool.gated\",\"tool.repair\",\"tools.refreshed\",\"agent.channel.status\",\"agent.channel.error\",\"agent.channel.rejected\",\"delivery.sent\",\"delivery.retry\",\"delivery.failed\",\"delivery.uncertain\",\"runtime.released\",\"schedules.reconciled\",\"schedule.fired\",\"schedule.skipped\",\"schedule.deferred\",\"schedule.error\",\"turn.end\",\"error\"],Ig=/\\\\r\\\\n\\\\r\\\\n|\\\\n\\\\n|\\\\r\\\\r/;function xh(i){const c=[];let r,s,d;for(const h of i.split(/\\\\r\\\\n|\\\\n|\\\\r/)){if(h===\"\"||h.startsWith(\":\"))continue;const v=h.indexOf(\":\"),A=v===-1?h:h.slice(0,v);let p=v===-1?\"\":h.slice(v+1);switch(p.startsWith(\" \")&&(p=p.slice(1)),A){case\"data\":c.push(p);break;case\"event\":r=p;break;case\"id\":s=p;break;case\"retry\":{const g=Number.parseInt(p,10);Number.isFinite(g)&&(d=g);break}}}if(!(c.length===0&&r===void 0))return{...r===void 0?{}:{event:r},data:c.join(\\`\n\\`),...s===void 0?{}:{id:s},...d===void 0?{}:{retry:d}}}async function*Pg(i){const c=new TextDecoder;let r=\"\";for await(const s of i)for(r+=typeof s==\"string\"?s:c.decode(s,{stream:!0});;){const d=Ig.exec(r);if(d===null)break;const h=r.slice(0,d.index);r=r.slice(d.index+d[0].length);const v=xh(h);v!==void 0&&(yield v)}if(r+=c.decode(),r.trim()!==\"\"){const s=xh(r);s!==void 0&&(yield s)}}function s0(){return{push:i=>i,endStep:()=>\"\",end:()=>\"\"}}function ey(i){return i!==\"final\"&&i!==\"stopped\"}function ty(i,c={}){switch(i){case\"final\":return;case\"max_steps\":return\\`stopped\\${c.steps===void 0?\"\":\\` after \\${c.steps} steps\\`} without finishing — say \"continue\" to carry on, or raise limits.maxSteps\\`;case\"no_progress\":return'stopped: the same tool call was repeated with no change — say \"continue\" with more to go on, or check whether that tool is telling it anything useful';case\"truncated\":return\"the reply was cut off at the output limit — raise model.<role>.maxTokens, or ask for less\";case\"timeout\":return\\`timed out\\${c.durationMs===void 0?\"\":\\` after \\${c.durationMs} ms\\`} — raise limits.turnTimeoutMs\\`;case\"stopped\":return c.cancelledAfterMs===void 0?\"cancelled\":\\`cancelled after \\${c.cancelledAfterMs.toFixed(0)} ms\\`;case\"error\":return}}var ny=\"<<<\",ly=\">>>\",$a=/^\\\\s*(?:[-*+]\\\\s+|\\\\d+[.)]\\\\s+)?<?\\\\s*action\\\\s*:\\\\s*(.+?)\\\\s*>?\\\\s*$/i,ay=/^\\\\s*(?:[-*+]\\\\s+|\\\\d+[.)]\\\\s+)?([A-Za-z_][\\\\w.-]*?)\\\\s*:\\\\s*(.*)$/,hf=/^\\\\s*\\`{3,}\\\\s*[\\\\w+-]*\\\\s*$/,qs=/^\\\\s*end\\\\s*$/i,uy=/^\\\\s*<\\\\s*action\\\\s*>\\\\s*$/i,_h=/^\\\\s*<\\\\s*\\\\/\\\\s*action\\\\s*>\\\\s*$/i,iy=/^\\\\s*<\\\\/?\\\\s*[A-Za-z_][\\\\w.:-]*\\\\s*\\\\/?\\\\s*>\\\\s*$/;function Ys(i){return i.replace(/^[\\`'\"*<]+/,\"\").replace(/[\\`'\"*>]+$/,\"\").replace(/[.,;:]+$/,\"\").trim()}function f0(i,c,r){const s=i.fields.get(c);s===void 0?i.fields.set(c,[r]):s.push(r)}function r0(i){if(i.block===void 0||i.heredocKey===void 0)return;const c=[...i.heredocLines];c[c.length-1]===\"\"&&c.pop(),f0(i.block,i.heredocKey,c.join(\\`\n\\`)),i.block.wrapped.add(i.heredocKey),i.heredocKey=void 0,i.heredocLines=[]}function tl(i){r0(i),i.block!==void 0&&i.blocks.push(i.block),i.block=void 0,i.openKey=void 0,i.awaitingSlug=!1}function Mh(){return{block:void 0,openKey:void 0,severedKey:void 0,severedPending:void 0,heredocKey:void 0,heredocLines:[],justClosed:!1,awaitingSlug:!1,text:[],blocks:[]}}function cy(i,c,r){const s=c.trim();if(i.heredocKey!==void 0){if(s===ly){r0(i);return}if(qs.test(s)){tl(i),i.justClosed=!0;return}if($a.test(c)){tl(i);const v=$a.exec(c),A=Ys(v?.[1]??\"\");A!==\"\"&&(i.block={slug:A,fields:new Map,wrapped:new Set,severed:new Set});return}i.heredocLines.push(c);return}const d=$a.exec(c);if(d!==null){const v=Ys(d[1]??\"\");if(tl(i),v===\"\")return;i.block={slug:v,fields:new Map,wrapped:new Set,severed:new Set};return}if(uy.test(c)){tl(i),i.awaitingSlug=!0;return}if(i.awaitingSlug){if(s===\"\")return;if(_h.test(c)){i.awaitingSlug=!1;return}const v=Ys(s);i.awaitingSlug=!1,v!==\"\"&&(i.block={slug:v,fields:new Map,wrapped:new Set,severed:new Set});return}if(_h.test(c)){i.block!==void 0&&(tl(i),i.justClosed=!0);return}if(iy.test(c))return;if(i.block===void 0){if(hf.test(c)&&(i.justClosed||r())){i.justClosed=!1;return}if(qs.test(s)&&i.severedPending!==void 0){i.severedPending.block.severed.add(i.severedPending.key),i.severedPending=void 0;return}$a.test(c)&&(i.severedPending=void 0),i.text.push(c),s!==\"\"&&(i.justClosed=!1);return}if(s===\"\"){i.openKey!==void 0&&(i.severedKey=i.openKey),i.openKey=void 0;return}if(qs.test(s)){i.severedKey=void 0,tl(i),i.justClosed=!0;return}if(hf.test(c))return;const h=ay.exec(c);if(h!==null){const v=(h[1]??\"\").trim(),A=(h[2]??\"\").trim();i.severedKey=void 0,A===ny?(i.heredocKey=v,i.heredocLines=[],i.openKey=void 0):(f0(i.block,v,A),i.openKey=v);return}if(i.openKey!==void 0){const v=i.block.fields.get(i.openKey),A=v?.[v.length-1];v!==void 0&&A!==void 0&&(v[v.length-1]=A===\"\"?s:\\`\\${A}\n\\${s}\\`);return}i.severedKey!==void 0&&(i.severedPending={block:i.block,key:i.severedKey},i.severedKey=void 0),tl(i),i.text.push(c)}function sy(i){if(/^\\\\s*(?:[-*+]|\\\\d+[.)]?)?\\\\s*$/.test(i))return!0;const c=i.replace(/^\\\\s*(?:[-*+]\\\\s+|\\\\d+[.)]\\\\s+)?/,\"\").toLowerCase(),r=c.startsWith(\"<\")?c.slice(1):c;return\"action:\".startsWith(r)||r.startsWith(\"action:\")||/^<\\\\/?$/.test(c)||/^<\\\\/?[a-z_][\\\\w.:-]*>?$/.test(c)?!0:/^\\`{1,3}[\\\\w+-]*$/.test(c)}function Ls(i){return i.endsWith(\"\\\\r\")?i.slice(0,-1):i}function fy(){let i=Mh(),c=\"\",r=0,s,d=\"\",h=!1;const v=E=>{if(E===\"\")return\"\";if(E.trim()===\"\")return d+=E,\"\";const j=d+E;return d=\"\",h?j:(h=!0,j.replace(/^\\\\s+/,\"\"))},A=(E,j)=>{const B=i.text.length;return cy(i,E,()=>j!==void 0&&$a.test(j)),i.text.length>B?E:void 0},p=(E,j,B)=>{const X=A(E,j);return X===void 0?\"\":v(X.slice(B))+v(\\`\n\\`)},g=E=>{if(s===void 0)return\"\";const j=s;return s=void 0,p(j,E,0)};return{push(E){let j=\"\";c+=E;let B=c.indexOf(\\`\n\\`);for(;B!==-1;){const D=Ls(c.slice(0,B));c=c.slice(B+1),j+=g(D),i.block===void 0&&hf.test(D)&&!i.justClosed?s=D:j+=p(D,void 0,r),r=0,B=c.indexOf(\\`\n\\`)}const X=Ls(c);return i.block===void 0&&!i.awaitingSlug&&s===void 0&&!sy(X)&&(j+=v(X.slice(r)),r=X.length),j},endStep(){const E=N();return d=\\`\n\n\\`,i=Mh(),E},end:N};function N(){let E=g(void 0);const j=Ls(c);if(j!==\"\"){const B=A(j,void 0);B!==void 0&&(E+=v(B.slice(r)))}return c=\"\",r=0,s=void 0,E}}class Zt extends Error{code;hint;field;status;request;constructor(c,r={}){super(c.hint===void 0?c.message:\\`\\${c.message}\n hint: \\${c.hint}\\`),this.name=\"DispachError\",this.code=c.code,this.hint=c.hint??\"\",this.field=c.field,this.status=r.status,this.request=r.method===void 0||r.path===void 0?void 0:{method:r.method,path:r.path},r.cause!==void 0&&(this.cause=r.cause)}}function ry(i,c){const r=i instanceof Error?i.message:String(i);return new Zt({code:\"transport_failed\",message:\\`\\${c.method} \\${c.path} did not reach \\${c.baseUrl}: \\${r}\\`,hint:\"Check the base URL, that the server is running, and that nothing between you and it is refusing the connection. \\`GET /v1/health\\` needs no token and is the cheapest probe.\"},{...c,cause:i})}async function oy(i,c){let r;try{const s=await i.json();typeof s.error?.code==\"string\"&&typeof s.error.message==\"string\"&&(r={code:s.error.code,message:s.error.message,...s.error.hint===void 0?{}:{hint:s.error.hint},...s.error.field===void 0?{}:{field:s.error.field}})}catch{}return new Zt(r??{code:\\`http_\\${i.status}\\`,message:\\`\\${c.method} \\${c.path} returned \\${i.status} with no error body.\\`,hint:\"This is not a response this server produces, so something between you and it answered — a proxy, a gateway, or a load balancer. Check the URL and what is in front of it.\"},{status:i.status,...c})}var o0=new Set(Wg);async function*d0(i){for await(const c of Pg(dy(i))){if(c.event===void 0||c.data===\"\")continue;let r;try{r=JSON.parse(c.data)}catch{continue}yield{name:c.event,data:r}}}async function*dy(i){const c=i.getReader();try{for(;;){const{done:r,value:s}=await c.read();if(r)return;s!==void 0&&(yield s)}}finally{c.releaseLock()}}async function*hy(i){for await(const{name:c,data:r}of d0(i)){if(o0.has(c)){yield{kind:\"event\",event:r};continue}const s=r??{};switch(c){case\"turn.accepted\":yield{kind:\"accepted\",turnId:String(s.turnId??\"\"),sessionKey:String(s.sessionKey??\"\")};break;case\"stream.replay\":yield{kind:\"replay\",report:{state:s.state===\"ended\"?\"ended\":\"running\",events:Number(s.events??0),truncated:s.truncated===!0,dropped:Number(s.dropped??0),chunks:s.chunks===\"start\"||s.chunks===\"partial\"?s.chunks:\"none\"}};break;case\"stream.ended\":yield{kind:\"ended\",turnId:String(s.turnId??\"\"),status:String(s.status??\"unknown\"),steps:typeof s.steps==\"number\"?s.steps:void 0,errorCode:typeof s.errorCode==\"string\"?s.errorCode:void 0};break;case\"stream.unavailable\":yield{kind:\"unavailable\",turnId:String(s.turnId??\"\"),reason:String(s.reason??\"not observable from this process\")};break}}}async function*my(i){for await(const{name:c,data:r}of d0(i)){if(o0.has(c)){yield{kind:\"event\",event:r};continue}if(c===\"stream.subscribed\"){const s=r??{};yield{kind:\"subscribed\",report:{agentId:typeof s.agentId==\"string\"?s.agentId:null,types:Array.isArray(s.types)?s.types:null,chunks:s.chunks===!0,implied:typeof s.implied==\"string\"?s.implied:void 0}}}}}async function*gy(i,c={}){for await(const r of i){if(r.kind===\"replay\"&&r.report.truncated&&c.allowTruncated!==!0)throw new Zt({code:\"replay_truncated\",message:\\`This turn's replay is missing its oldest \\${r.report.dropped} event(s), so the text reconstructed from it would be incomplete.\\`,hint:\"Read the finished text from GET /v1/agents/:id/turns/:turnId, or pass { allowTruncated: true } to accept a fragment. Streaming from the start of a turn is never truncated — this only happens when reattaching to one that has already produced more events than the buffer holds.\"});if(r.kind===\"unavailable\")throw new Zt({code:\"turn_not_observable\",message:\\`Turn \\${r.turnId} is recorded as running but is not observable here: \\${r.reason}.\\`,hint:\"Its events are buffered in whichever process is executing it. Poll GET /v1/agents/:id/turns/:turnId for the outcome.\"});if(r.kind!==\"event\"||r.event.type!==\"model.chunk\")continue;const s=r.event.data;s.kind!==\"reasoning\"&&typeof s.delta==\"string\"&&(yield s.delta)}}function yy(i){const c=i.baseUrl.replace(/\\\\/+$/,\"\"),r=i.fetch??fetch,s=(g={})=>({...i.token===void 0?{}:{authorization:\\`Bearer \\${i.token}\\`},...g});async function d(g,N,E={}){let j;try{j=await r(\\`\\${c}\\${N}\\`,{method:g,headers:s({...E.body===void 0?{}:{\"content-type\":\"application/json\"},...E.accept===void 0?{}:{accept:E.accept},...E.headers}),...E.body===void 0?{}:{body:JSON.stringify(E.body)},...E.signal===void 0?{}:{signal:E.signal}})}catch(B){throw ry(B,{method:g,path:N,baseUrl:c})}if(!j.ok)throw await oy(j,{method:g,path:N});return j}async function h(g,N,E){return await(await d(g,N,E??{})).json()}async function v(g,N){const E=await d(\"GET\",g,{accept:\"text/event-stream\",...N===void 0?{}:{signal:N}});if(E.body===null)throw new Zt({code:\"no_response_body\",message:\\`GET \\${g} returned \\${E.status} with no body to read.\\`,hint:\"An SSE route always has a body. A missing one means something between you and the server buffered the response — commonly a proxy without streaming enabled.\"},{status:E.status,method:\"GET\",path:g});return E.body}function A(g,N,E,j={}){const B=D=>D?.chunks===!0?\"?chunks=true\":\"\",X={turnId:N,sessionKey:E,replayed:j.replayed===!0,async*stream(D){const fe=await v(\\`/v1/agents/\\${encodeURIComponent(g)}/turns/\\${encodeURIComponent(N)}/stream\\${B(D)}\\`,D?.signal);yield*hy(fe)},async*tokens(D){yield*gy(X.stream({chunks:!0,...D}),{...D?.allowTruncated===void 0?{}:{allowTruncated:D.allowTruncated}})},async text(){for await(const D of X.stream())if(D.kind===\"ended\"||D.kind===\"unavailable\"||D.kind===\"event\"&&D.event.type===\"turn.end\")break;return(await X.get()).text},get:()=>h(\"GET\",\\`/v1/agents/\\${encodeURIComponent(g)}/turns/\\${encodeURIComponent(N)}\\`),async stop(){await d(\"POST\",\\`/v1/agents/\\${encodeURIComponent(g)}/turns/\\${encodeURIComponent(N)}/stop\\`)}};return X}function p(g){const N=E=>\\`/v1/agents/\\${encodeURIComponent(g)}\\${E}\\`;return{id:g,async send(E,j){const B=await h(\"POST\",N(\"/messages\"),{body:{text:E,...j?.sessionKey===void 0?{}:{sessionKey:j.sessionKey},...j?.deliver===void 0?{}:{deliver:j.deliver},...j?.from===void 0?{}:{from:j.from}},...j?.idempotencyKey===void 0?{}:{headers:{\"idempotency-key\":j.idempotencyKey}},...j?.signal===void 0?{}:{signal:j.signal}});return A(g,B.turnId,B.sessionKey,{replayed:B.replayed===!0})},turn:E=>A(g,E,\"\"),describe:()=>h(\"GET\",N(\"\")),tools:()=>h(\"GET\",N(\"/tools\")),skills:()=>h(\"GET\",N(\"/skills\")),sessions:()=>h(\"GET\",N(\"/sessions\")),messages:(E,j)=>{const B=new URLSearchParams;j?.before!==void 0&&B.set(\"before\",String(j.before)),j?.limit!==void 0&&B.set(\"limit\",String(j.limit));const X=B.size===0?\"\":\\`?\\${B.toString()}\\`;return h(\"GET\",N(\\`/sessions/\\${encodeURIComponent(E)}/messages\\${X}\\`))},clearSession:E=>h(\"DELETE\",N(\\`/sessions/\\${encodeURIComponent(E)}\\`)),reload:()=>h(\"POST\",N(\"/reload\"),{body:{}}),usage:E=>h(\"GET\",N(\\`/usage\\${wh(E)}\\`)),turns:E=>{const j=new URLSearchParams;E?.limit!==void 0&&j.set(\"limit\",String(E.limit)),E?.before!==void 0&&j.set(\"before\",String(E.before));const B=j.size===0?\"\":\\`?\\${j.toString()}\\`;return h(\"GET\",N(\\`/turns\\${B}\\`))},secrets:async()=>(await h(\"GET\",N(\"/secrets\"))).secrets,setSecrets:E=>h(\"PUT\",N(\"/secrets\"),{body:{values:E}}),schedules:async()=>(await h(\"GET\",N(\"/schedules\"))).schedules,approvals:async()=>(await h(\"GET\",N(\"/approvals\"))).approvals,createSchedule:E=>h(\"POST\",N(\"/schedules\"),{body:E}),updateSchedule:(E,j)=>h(\"PATCH\",N(\\`/schedules/\\${encodeURIComponent(E)}\\`),{body:j}),deleteSchedule:async E=>{await h(\"DELETE\",N(\\`/schedules/\\${encodeURIComponent(E)}\\`))},runSchedule:E=>h(\"POST\",N(\\`/schedules/\\${encodeURIComponent(E)}/run\\`),{body:{}}),config:()=>h(\"GET\",N(\"/config\")),setConfig:(E,j,B)=>h(\"PATCH\",N(\"/config\"),{body:{path:E,value:j,...B?.confirm===void 0?{}:{confirm:B.confirm}}}),setChannel:(E,j)=>h(\"PATCH\",N(\\`/channels/\\${encodeURIComponent(E)}\\`),{body:{...j}}),unpairChannel:E=>h(\"POST\",N(\\`/channels/\\${encodeURIComponent(E)}/unpair\\`)),session:E=>h(\"GET\",N(\\`/sessions/\\${encodeURIComponent(E)}\\`)),setPhase:(E,j)=>h(\"POST\",N(\\`/sessions/\\${encodeURIComponent(E)}/phase\\`),{body:{phase:j}}),approve:async(E,j)=>{await h(\"POST\",N(\\`/approvals/\\${encodeURIComponent(E)}\\`),{body:{granted:j}})},stop:E=>h(\"POST\",N(\"/stop\"),{body:E===void 0?{}:{reason:E}}),start:()=>h(\"POST\",N(\"/start\"),{body:{}}),context:E=>{const j=new URLSearchParams;E?.sessionKey!==void 0&&j.set(\"sessionKey\",E.sessionKey),E?.input!==void 0&&j.set(\"input\",E.input);const B=j.size===0?\"\":\\`?\\${j.toString()}\\`;return h(\"GET\",N(\\`/context\\${B}\\`))}}}return{agent:p,agents:()=>h(\"GET\",\"/v1/agents\"),health:()=>h(\"GET\",\"/v1/health\"),async ready(){try{return await d(\"GET\",\"/v1/ready\"),!0}catch(g){if(g instanceof Zt&&g.status===503)return!1;throw g}},provision:()=>h(\"GET\",\"/v1/provision\"),keys:()=>h(\"GET\",\"/v1/keys\"),createKey:g=>h(\"POST\",\"/v1/keys\",{body:g}),revokeKey:g=>h(\"DELETE\",\\`/v1/keys/\\${encodeURIComponent(g)}\\`),createAgent:g=>h(\"POST\",\"/v1/agents\",{body:{answers:g}}),usage:g=>h(\"GET\",\\`/v1/usage\\${wh(g)}\\`),activity:()=>h(\"GET\",\"/v1/activity\"),webhooks:async()=>(await h(\"GET\",\"/v1/webhooks\")).webhooks,createWebhook:g=>h(\"POST\",\"/v1/webhooks\",{body:g}),deleteWebhook:g=>h(\"DELETE\",\\`/v1/webhooks/\\${encodeURIComponent(g)}\\`),templates:async()=>(await h(\"GET\",\"/v1/templates\")).templates,createAgentFromTemplate:g=>h(\"POST\",\"/v1/agents\",{body:g}),async*events(g){const N=new URLSearchParams;g?.agentId!==void 0&&N.set(\"agentId\",g.agentId),g?.types!==void 0&&g.types.length>0&&N.set(\"types\",g.types.join(\",\")),g?.chunks===!0&&N.set(\"chunks\",\"true\");const E=N.size===0?\"\":\\`?\\${N.toString()}\\`,j=await v(\\`/v1/events\\${E}\\`,g?.signal);yield*my(j)}}}function wh(i){const c=new URLSearchParams;return i?.by!==void 0&&c.set(\"by\",i.by.join(\",\")),i?.from!==void 0&&c.set(\"from\",i.from),i?.to!==void 0&&c.set(\"to\",i.to),c.size===0?\"\":\\`?\\${c.toString()}\\`}function vy(i){return m.jsxs(m.Fragment,{children:[i.state.truncated?m.jsx(\"p\",{className:\"row note bad\",children:\"This turn produced more than the server keeps for a reattach, so the beginning of the reply is missing. The stored turn has all of it.\"}):null,i.state.rows.map(c=>m.jsx(by,{row:c,onAnswer:i.onAnswer},c.id)),i.state.liveReasoning===\"\"?null:m.jsx(h0,{label:\"thinking\",text:i.state.liveReasoning,open:!0}),i.state.live===\"\"?null:m.jsx(\"p\",{className:\"row\",children:i.state.live})]})}function by(i){const c=i.row;switch(c.kind){case\"user\":return m.jsx(\"p\",{className:\"row user\",children:c.text});case\"reply\":return m.jsx(\"p\",{className:\"row\",children:c.text});case\"reasoning\":return m.jsx(h0,{label:\"thinking\",text:c.text});case\"tool\":return m.jsxs(\"div\",{className:\\`row tool\\${c.ok===!1?\" failed\":\"\"}\\`,children:[m.jsx(\"span\",{className:\"slug\",children:c.slug}),c.mutating?m.jsx(\"span\",{className:\"mut\",children:\" changes things\"}):null,m.jsx(\"span\",{className:\"out\",children:Sy(c)}),c.untrusted===!0?m.jsx(\"div\",{className:\"fence\",children:m.jsx(\"div\",{className:\"why\",children:\"this result came from outside the agent — treated as data, and mutating tools are blocked for the rest of the turn\"})}):null]});case\"approval\":return m.jsxs(\"div\",{className:\"row ask\",children:[m.jsxs(\"div\",{children:[m.jsx(\"strong\",{children:c.slug}),\" needs permission — \",c.reason]}),c.match===void 0?null:m.jsx(\"div\",{className:\"what\",children:c.match}),c.settled===void 0?m.jsxs(\"div\",{className:\"buttons\",children:[m.jsx(\"button\",{type:\"button\",className:\"primary\",onClick:()=>i.onAnswer(c.approvalId,!0),children:\"Allow once\"}),m.jsx(\"button\",{type:\"button\",onClick:()=>i.onAnswer(c.approvalId,!1),children:\"Refuse\"})]}):m.jsx(\"div\",{className:\"settled\",children:py(c.settled)})]});case\"note\":return m.jsx(\"p\",{className:\\`row note\\${c.bad?\" bad\":\"\"}\\`,children:c.text})}}function Sy(i){if(i.ok===void 0)return\" running…\";const c=i.bytes===void 0?\"\":\\` · \\${i.bytes} bytes\\`,r=i.truncated===!0?\" · truncated to fit the observation budget\":\"\",s=i.latencyMs===void 0?\"\":\\` · \\${i.latencyMs} ms\\`;return\\`\\${i.ok?\" ok\":\" failed\"}\\${c}\\${s}\\${r}\\`}function py(i){switch(i){case\"granted\":return\"Allowed — the call ran.\";case\"denied\":return\"Refused. The model was told a person declined it.\";case\"abandoned\":return\"The turn ended while this was waiting, so the call did not run. Nobody declined it.\";case\"error\":return\"The approver itself failed, so the call was refused. That says nothing about what anybody wanted.\"}}function h0(i){return m.jsxs(\"details\",{className:\"row fold\",open:i.open===!0,children:[m.jsxs(\"summary\",{children:[i.label,\" · \",i.text.length,\" chars\"]}),m.jsx(\"div\",{className:\"body\",children:i.text})]})}function Ey(i){const c=k.useRef(null);return k.useEffect(()=>{const r=c.current;r!==null&&(r.style.height=\"auto\",r.style.height=\\`\\${Math.min(r.scrollHeight,190)}px\\`)},[i.value]),m.jsxs(\"div\",{className:\"composer\",children:[m.jsxs(\"div\",{className:\"inner\",children:[m.jsx(\"textarea\",{ref:c,value:i.value,placeholder:\"Ask the agent something\",onChange:r=>i.onChange(r.target.value),onKeyDown:r=>{r.key===\"Enter\"&&!r.shiftKey&&(r.preventDefault(),i.onSend())}}),i.busy?m.jsx(\"button\",{type:\"button\",onClick:i.onStop,children:\"Stop\"}):m.jsx(\"button\",{type:\"button\",className:\"primary\",disabled:i.value.trim()===\"\",onClick:i.onSend,children:\"Send\"})]}),m.jsx(\"p\",{className:\"hint\",children:i.busy?\"Running. Closing this page does not stop it — the turn is detached, and reopening reattaches.\":\"Enter sends · shift-enter for a new line\"})]})}const vf=\"dispach.key\";function Ty(){const i=new URL(window.location.href),c=i.searchParams.get(\"claim\");if(!(c===null||c===\"\"))return i.searchParams.delete(\"claim\"),window.history.replaceState({},\"\",i.pathname+i.search+i.hash),c}function mf(){try{return window.localStorage.getItem(vf)??void 0}catch{return}}function bf(i){try{window.localStorage.setItem(vf,i)}catch{}}function Sf(){try{window.localStorage.removeItem(vf)}catch{}}async function m0(i,c){const r=await fetch(\\`\\${i}/v1/keys\\`,{method:\"POST\",headers:{\"content-type\":\"application/json\",authorization:\\`Bearer \\${c}\\`},body:JSON.stringify({label:Ay()})}),s=await r.json();if(!r.ok||typeof s.secret!=\"string\")throw new Error(s.error?.message??\\`The claim was refused (\\${r.status}).\\`);return s.secret}function Ay(){const i=navigator.userAgent;return\\`\\${/Firefox\\\\//.test(i)?\"Firefox\":/Edg\\\\//.test(i)?\"Edge\":/Chrome\\\\//.test(i)?\"Chrome\":/Safari\\\\//.test(i)?\"Safari\":\"browser\"} · \\${new Date().toISOString().slice(0,10)}\\`}async function zy(i){const c=Ty();if(c!==void 0)try{const s=await m0(i,c);return bf(s),{kind:\"key\",secret:s}}catch(s){const d=s instanceof Error?s.message:String(s);if(mf()===void 0)return{kind:\"needed\",because:d}}const r=mf();return r!==void 0&&await Uh(i,r)?{kind:\"key\",secret:r}:(r!==void 0&&Sf(),await Uh(i,void 0)?{kind:\"open\"}:{kind:\"needed\",because:r===void 0?\"This server needs a credential.\":\"The key this browser held no longer works — it was revoked, or this is a different server.\"})}async function Uh(i,c){try{return await g0(i,c).agents(),!0}catch(r){if(r instanceof Zt&&r.code===\"unauthorized\")return!1;throw r}}function g0(i,c){return yy({baseUrl:i,...c===void 0?{}:{token:c}})}function Cy(i,c){const r=[i.scope?.agents===void 0?\"every agent\":i.scope.agents.join(\", \"),...i.scope?.sessions===void 0?[]:[\\`sessions \\${i.scope.sessions}\\`],i.scope?.can===void 0?\"all capabilities\":i.scope.can.join(\"+\")];return i.expiresAt!==void 0&&r.push(Date.parse(i.expiresAt)<=c?\"expired\":\\`until \\${vi(i.expiresAt)}\\`),r.join(\" · \")}function Ny(i){const[c,r]=k.useState([]),[s,d]=k.useState(),[h,v]=k.useState(\"\"),[A,p]=k.useState(),[g,N]=k.useState(),E=k.useCallback((D={})=>({...D,...i.token===void 0?{}:{authorization:\\`Bearer \\${i.token}\\`}}),[i.token]),j=k.useCallback(async()=>{try{const D=await fetch(\\`\\${i.baseUrl}/v1/keys\\`,{headers:E()}),fe=await D.json();if(!D.ok)throw new Error(fe.error?.message??\\`HTTP \\${D.status}\\`);r(fe.keys??[]),d(fe.scope)}catch(D){N(D instanceof Error?D.message:String(D))}},[i.baseUrl,E]);k.useEffect(()=>{j()},[j]);const B=async()=>{N(void 0);try{const D=await fetch(\\`\\${i.baseUrl}/v1/keys\\`,{method:\"POST\",headers:E({\"content-type\":\"application/json\"}),body:JSON.stringify({label:h.trim()})}),fe=await D.json();if(!D.ok||fe.secret===void 0)throw new Error(fe.error?.message??\\`HTTP \\${D.status}\\`);p(fe.secret),v(\"\"),await j()}catch(D){N(D instanceof Error?D.message:String(D))}},X=async D=>{if(N(void 0),!window.confirm(\\`Revoke \"\\${D.label}\"? If it is the key this browser is using, you will be signed out of this page. There is no way to tell from here — the listing carries no secrets.\\`))return;const fe=mf();try{const L=await fetch(\\`\\${i.baseUrl}/v1/keys/\\${D.keyId}\\`,{method:\"DELETE\",headers:E()});if(!L.ok){const ce=await L.json();throw new Error(ce.error?.message??\\`HTTP \\${L.status}\\`)}if(fe!==void 0&&!await jy(i.baseUrl,fe)){Sf(),window.location.reload();return}await j()}catch(L){N(L instanceof Error?L.message:String(L))}};return m.jsxs(m.Fragment,{children:[m.jsxs(\"div\",{className:\"card\",children:[m.jsx(\"h2\",{children:\"Issue a key\"}),m.jsx(\"p\",{children:\"A key is shown once and never again — the server stores a hash of it, so there is no way to recover one. Label it for the browser or machine that will hold it.\"}),A===void 0?null:m.jsxs(m.Fragment,{children:[m.jsx(\"div\",{className:\"secret\",children:A}),m.jsxs(\"p\",{className:\"hint\",style:{margin:\"0 0 12px\"},children:[\"Copy it now. This is the only time it is readable.\",\" \",m.jsx(\"button\",{type:\"button\",style:{padding:\"2px 8px\",fontSize:11},onClick:()=>{bf(A),window.location.reload()},children:\"use it in this browser\"})]})]}),m.jsxs(\"div\",{style:{display:\"flex\",gap:8},children:[m.jsx(\"input\",{value:h,placeholder:\"my laptop\",onChange:D=>v(D.target.value)}),m.jsx(\"button\",{type:\"button\",className:\"primary\",disabled:h.trim()===\"\",onClick:()=>void B(),children:\"Issue\"})]})]}),m.jsxs(\"div\",{className:\"card\",children:[m.jsx(\"h2\",{children:\"Keys\"}),m.jsx(\"p\",{children:s??\"…\"}),g===void 0?null:m.jsx(\"p\",{className:\"note bad\",children:g}),m.jsxs(\"table\",{children:[m.jsx(\"thead\",{children:m.jsxs(\"tr\",{children:[m.jsx(\"th\",{children:\"Label\"}),m.jsx(\"th\",{children:\"Created\"}),m.jsx(\"th\",{children:\"Reaches\"}),m.jsx(\"th\",{children:\"Last used\"}),m.jsx(\"th\",{})]})}),m.jsx(\"tbody\",{children:c.map(D=>m.jsxs(\"tr\",{children:[m.jsx(\"td\",{className:D.revokedAt===void 0?\"\":\"revoked\",children:D.label}),m.jsx(\"td\",{children:vi(D.createdAt)}),m.jsx(\"td\",{className:\"sub\",children:Cy(D,Date.now())}),m.jsx(\"td\",{children:D.revokedAt!==void 0?\\`revoked \\${vi(D.revokedAt)}\\`:D.lastUsedAt===void 0?\"never\":vi(D.lastUsedAt)}),m.jsx(\"td\",{children:D.revokedAt===void 0?m.jsx(\"button\",{type:\"button\",className:\"bad\",style:{padding:\"2px 9px\",fontSize:11},onClick:()=>void X(D),children:\"revoke\"}):null})]},D.keyId))})]}),c.length===0?m.jsx(\"p\",{className:\"hint\",style:{marginTop:10},children:\"No keys. This server is open to anyone who can reach the port — issuing the first key is what closes it.\"}):null]})]})}async function jy(i,c){try{return(await fetch(\\`\\${i}/v1/agents\\`,{headers:{authorization:\\`Bearer \\${c}\\`}})).ok}catch{return!0}}function vi(i){const c=new Date(i);return Number.isNaN(c.getTime())?i:c.toISOString().slice(0,10)}const xy=[\"chat\",\"new\",\"tools\",\"schedules\",\"channels\",\"config\",\"keys\"];function _y(i){return i!==null&&xy.includes(i)}function My(i){const c=new URL(i).searchParams,r=c.get(\"agent\"),s=c.get(\"panel\");return{...r===null||r===\"\"?{}:{agentId:r},panel:_y(s)?s:\"chat\"}}function wy(i,c){const r=new URL(i);return c.agentId===void 0||c.agentId===\"\"?r.searchParams.delete(\"agent\"):r.searchParams.set(\"agent\",c.agentId),c.panel===\"chat\"?r.searchParams.delete(\"panel\"):r.searchParams.set(\"panel\",c.panel),\\`\\${r.pathname}\\${r.search}\\`}function Uy(){let i,c;return{begin(r){if(i!==r)return c?.abort(),i=r,c=new AbortController,c.signal},finish(r){i===r&&(i=void 0,c=void 0)},abort(){c?.abort()},following:()=>i,aborted:()=>c?.signal.aborted??!1}}function Ry(i){const c={};for(const r of i)c[r.step]=r.fallback;return c}const Oy=8;function Dy(i,c,r){let s=c;for(let d=0;d<Oy;d+=1){if(s===void 0)return!1;const h=s.requires;if(h===void 0)return!0;if(r[h.step]!==h.value)return!1;s=i.find(v=>v.step===h.step)}return!1}function bi(i,c){return i.filter(r=>Dy(i,r,c))}function y0(i,c){return bi(i,c).filter(r=>r.optional!==!0&&(c[r.step]??\"\").trim()===\"\")}function By(i,c){const r={};for(const s of bi(i,c)){const d=(c[s.step]??\"\").trim();d!==\"\"&&(r[s.step]=d)}return r}function Hy(i,c){return bi(i,c).filter(r=>r.secret&&(c[r.step]??\"\").trim()===\"\")}function qy(i){return{...Fa,filter:i===\"nlt\"?fy():s0()}}const Fa={filter:s0(),rows:[],live:\"\",liveReasoning:\"\",running:!1,truncated:!1};let Rh=0;function Kt(){return Rh+=1,\\`r\\${Rh}\\`}function Yy(i,c){return{...i,rows:[...i.rows,{kind:\"user\",id:Kt(),text:c}],running:!0}}function Ly(i,c){switch(c.kind){case\"accepted\":return i;case\"replay\":return c.report.truncated?{...i,truncated:!0}:i;case\"ended\":return{...i,running:!1,rows:[...i.rows,{kind:\"note\",id:Kt(),text:\\`This turn finished before the page attached — \\${c.status}. Its reply is stored.\\`,bad:c.status!==\"final\"}]};case\"unavailable\":return{...i,running:!1,rows:[...i.rows,{kind:\"note\",id:Kt(),text:c.reason,bad:!0}]};case\"event\":return Gy(i,c.event)}}function Gy(i,c){switch(c.type){case\"turn.start\":return{...i,running:!0};case\"model.chunk\":{const r=c.data;if(r.kind===\"reasoning\")return{...i,liveReasoning:i.liveReasoning+r.delta};const s=i.filter.push(r.delta);return s===\"\"?i:{...i,live:i.live+s}}case\"model.result\":return ka({...i,live:i.live+i.filter.endStep()});case\"tool.call\":{const r=c.data,s=ka(i);return{...s,rows:[...s.rows,{kind:\"tool\",id:Kt(),callId:r.callId,slug:r.slug,mutating:r.mutating}]}}case\"tool.result\":{const r=c.data,s=i.rows.findIndex(v=>v.kind===\"tool\"&&v.callId===r.callId);if(s===-1)return i;const d=i.rows[s];if(d===void 0||d.kind!==\"tool\")return i;const h=[...i.rows];return h[s]={...d,ok:r.ok,bytes:r.bytes,truncated:r.truncated,latencyMs:r.latencyMs,...r.trust===\"untrusted\"?{untrusted:!0}:{}},{...i,rows:h}}case\"approval.requested\":{const r=c.data,s=ka(i);return{...s,rows:[...s.rows,{kind:\"approval\",id:Kt(),approvalId:r.approvalId,slug:r.slug,...r.match===void 0?{}:{match:r.match},reason:r.reason}]}}case\"approval.resolved\":{const r=c.data,s=i.rows.findIndex(v=>v.kind===\"approval\"&&v.approvalId===r.approvalId);if(s===-1)return i;const d=i.rows[s];if(d===void 0||d.kind!==\"approval\")return i;const h=[...i.rows];return h[s]={...d,settled:r.by===\"abandoned\"?\"abandoned\":r.by===\"error\"?\"error\":r.granted?\"granted\":\"denied\"},{...i,rows:h}}case\"error\":{const r=c.data,s=ka({...i,live:i.live+i.filter.end()});return{...s,running:!1,rows:[...s.rows,{kind:\"note\",id:Kt(),text:\\`\\${r.code}: \\${r.message}\nhint: \\${r.hint}\\`,bad:!0}]}}case\"agent.warning\":{const r=c.data;return{...i,rows:[...i.rows,{kind:\"note\",id:Kt(),text:r.message??\"\",bad:!1}]}}case\"turn.end\":{const r=c.data,s=ka({...i,live:i.live+i.filter.end()}),d=ty(r.reason,{steps:r.steps});return{...s,running:!1,rows:d===void 0?s.rows:[...s.rows,{kind:\"note\",id:Kt(),text:d,bad:ey(r.reason)}]}}default:return i}}function ka(i){if(i.live===\"\"&&i.liveReasoning===\"\")return i;const c=[...i.rows],r=i.liveReasoning.trim();r!==\"\"&&c.push({kind:\"reasoning\",id:Kt(),text:r});const s=i.live.trim();return s!==\"\"&&c.push({kind:\"reply\",id:Kt(),text:s}),{...i,rows:c,live:\"\",liveReasoning:\"\"}}function Qy(i){if(!i.available)return m.jsxs(\"p\",{className:\"empty\",children:[\"This server has no provisioner, so it cannot create an agent — the case for an embedder mounting the API over its own agent store. Run \",m.jsx(\"code\",{children:\"dispach init\"}),\" \",\"where the sandbox is, or mount an agent directory.\"]});if(!i.allowed)return m.jsxs(\"p\",{className:\"empty\",children:[\"Creating an agent needs a loopback bind or a credential with the \",m.jsx(\"code\",{children:\"admin\"}),\" \",\"capability, and this request has neither. On a server reachable from elsewhere, set\",\" \",m.jsx(\"code\",{children:\"server.tokenEnv\"}),\" or present an operator key minted with\",\" \",m.jsx(\"code\",{children:\"can: [admin]\"}),\" — or mount a written agent at \",m.jsx(\"code\",{children:\"/agent\"}),\".\"]})}function Xy(i){const{step:c,value:r}=i,s=\\`provision-\\${c.step}\\`;return m.jsxs(\"div\",{className:i.invalid?\"field invalid\":\"field\",children:[m.jsxs(\"label\",{htmlFor:s,children:[c.prompt,c.optional?m.jsx(\"span\",{className:\"sub\",children:\" optional\"}):null,c.secret?m.jsx(\"span\",{className:\"sub\",children:\" · written to .env, never read back\"}):null]}),c.choices===void 0?m.jsx(\"input\",{id:s,name:c.step,type:c.secret?\"password\":\"text\",value:r,disabled:i.disabled,autoComplete:c.secret?\"new-password\":\"off\",spellCheck:!1,onChange:d=>i.onChange(d.target.value)}):m.jsx(\"select\",{id:s,name:c.step,value:r,disabled:i.disabled,onChange:d=>i.onChange(d.target.value),children:c.choices.map(d=>m.jsx(\"option\",{value:d.value,children:d.hint===void 0?d.label:\\`\\${d.label} — \\${d.hint}\\`},d.value))}),i.invalid?m.jsx(\"div\",{className:\"sub error\",children:\"needs an answer\"}):null]})}function Ky(i){const c=i.result.adopted.includes(i.result.id);return m.jsxs(\"div\",{className:\"created\",children:[m.jsxs(\"h3\",{children:[\"Created \",m.jsx(\"code\",{children:i.result.id})]}),m.jsxs(\"p\",{children:[m.jsx(\"code\",{children:i.result.dir}),m.jsxs(\"span\",{className:\"sub\",children:[\" · \",i.result.files.length,\" files\"]})]}),c?m.jsx(\"p\",{className:\"ok\",children:\"adopted · live on this host, with its channels and schedules\"}):m.jsxs(\"p\",{className:\"error\",children:[\"written, and \",m.jsx(\"strong\",{children:\"not running\"}),i.result.error===void 0?null:m.jsxs(m.Fragment,{children:[\": \",i.result.error.message,i.result.error.hint===void 0?null:m.jsxs(\"span\",{className:\"sub\",children:[\" \",i.result.error.hint]})]})]}),i.blank.length===0?null:m.jsxs(\"div\",{className:\"blank-secrets\",children:[m.jsxs(\"p\",{children:[\"Left empty, and needed before this works:\",\" \",i.blank.map(r=>r.prompt).join(\", \"),\".\"]}),m.jsxs(\"p\",{className:\"sub\",children:[\"Fill them in \",m.jsxs(\"code\",{children:[i.result.dir,\"/.env\"]}),\" at a terminal —\",\" \",m.jsx(\"code\",{children:\".env\"}),\" is a protected path, so neither the agent nor this API can write it. The file names each variable in its own comments.\"]})]}),c?m.jsxs(\"button\",{type:\"button\",onClick:()=>i.onOpen(i.result.id),children:[\"open \",i.result.id]}):null]})}function Zy(i){if(i.result!==void 0)return m.jsx(Ky,{result:i.result,blank:Hy(i.offer.steps,i.answers),onOpen:i.onOpen});const c=Qy(i.offer);if(c!==void 0)return c;const r=bi(i.offer.steps,i.answers),s=y0(i.offer.steps,i.answers),d=new Set(s.map(h=>h.step));return m.jsxs(\"form\",{className:\"provision\",onSubmit:h=>{h.preventDefault(),i.onSubmit()},children:[m.jsxs(\"p\",{className:\"sub\",children:[\"The same questions \",m.jsx(\"code\",{children:\"dispach init\"}),\" asks, served from the same walk. What you leave alone takes its default. The agent is adopted into this server as it is created — there is no second command.\"]}),r.map(h=>m.jsx(Xy,{step:h,value:i.answers[h.step]??\"\",invalid:i.touched&&d.has(h.step),disabled:i.busy,onChange:v=>i.onAnswer(h.step,v)},h.step)),i.error===void 0?null:m.jsx(\"p\",{className:\"error\",children:i.error}),m.jsx(\"button\",{type:\"submit\",disabled:i.busy,children:i.busy?\"creating…\":\"create agent\"}),i.touched&&s.length>0?m.jsxs(\"p\",{className:\"sub error\",children:[s.map(h=>h.prompt).join(\", \"),\" — still needed.\"]}):null]})}var $l={},Gs,Oh;function Vy(){return Oh||(Oh=1,Gs=function(){return typeof Promise==\"function\"&&Promise.prototype&&Promise.prototype.then}),Gs}var Qs={},Bn={},Dh;function nl(){if(Dh)return Bn;Dh=1;let i;const c=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Bn.getSymbolSize=function(s){if(!s)throw new Error('\"version\" cannot be null or undefined');if(s<1||s>40)throw new Error('\"version\" should be in range from 1 to 40');return s*4+17},Bn.getSymbolTotalCodewords=function(s){return c[s]},Bn.getBCHDigit=function(r){let s=0;for(;r!==0;)s++,r>>>=1;return s},Bn.setToSJISFunction=function(s){if(typeof s!=\"function\")throw new Error('\"toSJISFunc\" is not a valid function.');i=s},Bn.isKanjiModeEnabled=function(){return typeof i<\"u\"},Bn.toSJIS=function(s){return i(s)},Bn}var Xs={},Bh;function pf(){return Bh||(Bh=1,(function(i){i.L={bit:1},i.M={bit:0},i.Q={bit:3},i.H={bit:2};function c(r){if(typeof r!=\"string\")throw new Error(\"Param is not a string\");switch(r.toLowerCase()){case\"l\":case\"low\":return i.L;case\"m\":case\"medium\":return i.M;case\"q\":case\"quartile\":return i.Q;case\"h\":case\"high\":return i.H;default:throw new Error(\"Unknown EC Level: \"+r)}}i.isValid=function(s){return s&&typeof s.bit<\"u\"&&s.bit>=0&&s.bit<4},i.from=function(s,d){if(i.isValid(s))return s;try{return c(s)}catch{return d}}})(Xs)),Xs}var Ks,Hh;function ky(){if(Hh)return Ks;Hh=1;function i(){this.buffer=[],this.length=0}return i.prototype={get:function(c){const r=Math.floor(c/8);return(this.buffer[r]>>>7-c%8&1)===1},put:function(c,r){for(let s=0;s<r;s++)this.putBit((c>>>r-s-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(c){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),c&&(this.buffer[r]|=128>>>this.length%8),this.length++}},Ks=i,Ks}var Zs,qh;function Jy(){if(qh)return Zs;qh=1;function i(c){if(!c||c<1)throw new Error(\"BitMatrix size must be defined and greater than 0\");this.size=c,this.data=new Uint8Array(c*c),this.reservedBit=new Uint8Array(c*c)}return i.prototype.set=function(c,r,s,d){const h=c*this.size+r;this.data[h]=s,d&&(this.reservedBit[h]=!0)},i.prototype.get=function(c,r){return this.data[c*this.size+r]},i.prototype.xor=function(c,r,s){this.data[c*this.size+r]^=s},i.prototype.isReserved=function(c,r){return this.reservedBit[c*this.size+r]},Zs=i,Zs}var Vs={},Yh;function $y(){return Yh||(Yh=1,(function(i){const c=nl().getSymbolSize;i.getRowColCoords=function(s){if(s===1)return[];const d=Math.floor(s/7)+2,h=c(s),v=h===145?26:Math.ceil((h-13)/(2*d-2))*2,A=[h-7];for(let p=1;p<d-1;p++)A[p]=A[p-1]-v;return A.push(6),A.reverse()},i.getPositions=function(s){const d=[],h=i.getRowColCoords(s),v=h.length;for(let A=0;A<v;A++)for(let p=0;p<v;p++)A===0&&p===0||A===0&&p===v-1||A===v-1&&p===0||d.push([h[A],h[p]]);return d}})(Vs)),Vs}var ks={},Lh;function Fy(){if(Lh)return ks;Lh=1;const i=nl().getSymbolSize,c=7;return ks.getPositions=function(s){const d=i(s);return[[0,0],[d-c,0],[0,d-c]]},ks}var Js={},Gh;function Wy(){return Gh||(Gh=1,(function(i){i.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const c={N1:3,N2:3,N3:40,N4:10};i.isValid=function(d){return d!=null&&d!==\"\"&&!isNaN(d)&&d>=0&&d<=7},i.from=function(d){return i.isValid(d)?parseInt(d,10):void 0},i.getPenaltyN1=function(d){const h=d.size;let v=0,A=0,p=0,g=null,N=null;for(let E=0;E<h;E++){A=p=0,g=N=null;for(let j=0;j<h;j++){let B=d.get(E,j);B===g?A++:(A>=5&&(v+=c.N1+(A-5)),g=B,A=1),B=d.get(j,E),B===N?p++:(p>=5&&(v+=c.N1+(p-5)),N=B,p=1)}A>=5&&(v+=c.N1+(A-5)),p>=5&&(v+=c.N1+(p-5))}return v},i.getPenaltyN2=function(d){const h=d.size;let v=0;for(let A=0;A<h-1;A++)for(let p=0;p<h-1;p++){const g=d.get(A,p)+d.get(A,p+1)+d.get(A+1,p)+d.get(A+1,p+1);(g===4||g===0)&&v++}return v*c.N2},i.getPenaltyN3=function(d){const h=d.size;let v=0,A=0,p=0;for(let g=0;g<h;g++){A=p=0;for(let N=0;N<h;N++)A=A<<1&2047|d.get(g,N),N>=10&&(A===1488||A===93)&&v++,p=p<<1&2047|d.get(N,g),N>=10&&(p===1488||p===93)&&v++}return v*c.N3},i.getPenaltyN4=function(d){let h=0;const v=d.data.length;for(let p=0;p<v;p++)h+=d.data[p];return Math.abs(Math.ceil(h*100/v/5)-10)*c.N4};function r(s,d,h){switch(s){case i.Patterns.PATTERN000:return(d+h)%2===0;case i.Patterns.PATTERN001:return d%2===0;case i.Patterns.PATTERN010:return h%3===0;case i.Patterns.PATTERN011:return(d+h)%3===0;case i.Patterns.PATTERN100:return(Math.floor(d/2)+Math.floor(h/3))%2===0;case i.Patterns.PATTERN101:return d*h%2+d*h%3===0;case i.Patterns.PATTERN110:return(d*h%2+d*h%3)%2===0;case i.Patterns.PATTERN111:return(d*h%3+(d+h)%2)%2===0;default:throw new Error(\"bad maskPattern:\"+s)}}i.applyMask=function(d,h){const v=h.size;for(let A=0;A<v;A++)for(let p=0;p<v;p++)h.isReserved(p,A)||h.xor(p,A,r(d,p,A))},i.getBestMask=function(d,h){const v=Object.keys(i.Patterns).length;let A=0,p=1/0;for(let g=0;g<v;g++){h(g),i.applyMask(g,d);const N=i.getPenaltyN1(d)+i.getPenaltyN2(d)+i.getPenaltyN3(d)+i.getPenaltyN4(d);i.applyMask(g,d),N<p&&(p=N,A=g)}return A}})(Js)),Js}var gi={},Qh;function v0(){if(Qh)return gi;Qh=1;const i=pf(),c=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return gi.getBlocksCount=function(d,h){switch(h){case i.L:return c[(d-1)*4+0];case i.M:return c[(d-1)*4+1];case i.Q:return c[(d-1)*4+2];case i.H:return c[(d-1)*4+3];default:return}},gi.getTotalCodewordsCount=function(d,h){switch(h){case i.L:return r[(d-1)*4+0];case i.M:return r[(d-1)*4+1];case i.Q:return r[(d-1)*4+2];case i.H:return r[(d-1)*4+3];default:return}},gi}var $s={},Ja={},Xh;function Iy(){if(Xh)return Ja;Xh=1;const i=new Uint8Array(512),c=new Uint8Array(256);return(function(){let s=1;for(let d=0;d<255;d++)i[d]=s,c[s]=d,s<<=1,s&256&&(s^=285);for(let d=255;d<512;d++)i[d]=i[d-255]})(),Ja.log=function(s){if(s<1)throw new Error(\"log(\"+s+\")\");return c[s]},Ja.exp=function(s){return i[s]},Ja.mul=function(s,d){return s===0||d===0?0:i[c[s]+c[d]]},Ja}var Kh;function Py(){return Kh||(Kh=1,(function(i){const c=Iy();i.mul=function(s,d){const h=new Uint8Array(s.length+d.length-1);for(let v=0;v<s.length;v++)for(let A=0;A<d.length;A++)h[v+A]^=c.mul(s[v],d[A]);return h},i.mod=function(s,d){let h=new Uint8Array(s);for(;h.length-d.length>=0;){const v=h[0];for(let p=0;p<d.length;p++)h[p]^=c.mul(d[p],v);let A=0;for(;A<h.length&&h[A]===0;)A++;h=h.slice(A)}return h},i.generateECPolynomial=function(s){let d=new Uint8Array([1]);for(let h=0;h<s;h++)d=i.mul(d,new Uint8Array([1,c.exp(h)]));return d}})($s)),$s}var Fs,Zh;function ev(){if(Zh)return Fs;Zh=1;const i=Py();function c(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return c.prototype.initialize=function(s){this.degree=s,this.genPoly=i.generateECPolynomial(this.degree)},c.prototype.encode=function(s){if(!this.genPoly)throw new Error(\"Encoder not initialized\");const d=new Uint8Array(s.length+this.degree);d.set(s);const h=i.mod(d,this.genPoly),v=this.degree-h.length;if(v>0){const A=new Uint8Array(this.degree);return A.set(h,v),A}return h},Fs=c,Fs}var Ws={},Is={},Ps={},Vh;function b0(){return Vh||(Vh=1,Ps.isValid=function(c){return!isNaN(c)&&c>=1&&c<=40}),Ps}var Xt={},kh;function S0(){if(kh)return Xt;kh=1;const i=\"[0-9]+\",c=\"[A-Z $%*+\\\\\\\\-./:]+\";let r=\"(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+\";r=r.replace(/u/g,\"\\\\\\\\u\");const s=\"(?:(?![A-Z0-9 $%*+\\\\\\\\-./:]|\"+r+\\`)(?:.|[\\\\r\n]))+\\`;Xt.KANJI=new RegExp(r,\"g\"),Xt.BYTE_KANJI=new RegExp(\"[^A-Z0-9 $%*+\\\\\\\\-./:]+\",\"g\"),Xt.BYTE=new RegExp(s,\"g\"),Xt.NUMERIC=new RegExp(i,\"g\"),Xt.ALPHANUMERIC=new RegExp(c,\"g\");const d=new RegExp(\"^\"+r+\"$\"),h=new RegExp(\"^\"+i+\"$\"),v=new RegExp(\"^[A-Z0-9 $%*+\\\\\\\\-./:]+$\");return Xt.testKanji=function(p){return d.test(p)},Xt.testNumeric=function(p){return h.test(p)},Xt.testAlphanumeric=function(p){return v.test(p)},Xt}var Jh;function ll(){return Jh||(Jh=1,(function(i){const c=b0(),r=S0();i.NUMERIC={id:\"Numeric\",bit:1,ccBits:[10,12,14]},i.ALPHANUMERIC={id:\"Alphanumeric\",bit:2,ccBits:[9,11,13]},i.BYTE={id:\"Byte\",bit:4,ccBits:[8,16,16]},i.KANJI={id:\"Kanji\",bit:8,ccBits:[8,10,12]},i.MIXED={bit:-1},i.getCharCountIndicator=function(h,v){if(!h.ccBits)throw new Error(\"Invalid mode: \"+h);if(!c.isValid(v))throw new Error(\"Invalid version: \"+v);return v>=1&&v<10?h.ccBits[0]:v<27?h.ccBits[1]:h.ccBits[2]},i.getBestModeForData=function(h){return r.testNumeric(h)?i.NUMERIC:r.testAlphanumeric(h)?i.ALPHANUMERIC:r.testKanji(h)?i.KANJI:i.BYTE},i.toString=function(h){if(h&&h.id)return h.id;throw new Error(\"Invalid mode\")},i.isValid=function(h){return h&&h.bit&&h.ccBits};function s(d){if(typeof d!=\"string\")throw new Error(\"Param is not a string\");switch(d.toLowerCase()){case\"numeric\":return i.NUMERIC;case\"alphanumeric\":return i.ALPHANUMERIC;case\"kanji\":return i.KANJI;case\"byte\":return i.BYTE;default:throw new Error(\"Unknown mode: \"+d)}}i.from=function(h,v){if(i.isValid(h))return h;try{return s(h)}catch{return v}}})(Is)),Is}var $h;function tv(){return $h||($h=1,(function(i){const c=nl(),r=v0(),s=pf(),d=ll(),h=b0(),v=7973,A=c.getBCHDigit(v);function p(j,B,X){for(let D=1;D<=40;D++)if(B<=i.getCapacity(D,X,j))return D}function g(j,B){return d.getCharCountIndicator(j,B)+4}function N(j,B){let X=0;return j.forEach(function(D){const fe=g(D.mode,B);X+=fe+D.getBitsLength()}),X}function E(j,B){for(let X=1;X<=40;X++)if(N(j,X)<=i.getCapacity(X,B,d.MIXED))return X}i.from=function(B,X){return h.isValid(B)?parseInt(B,10):X},i.getCapacity=function(B,X,D){if(!h.isValid(B))throw new Error(\"Invalid QR Code version\");typeof D>\"u\"&&(D=d.BYTE);const fe=c.getSymbolTotalCodewords(B),L=r.getTotalCodewordsCount(B,X),ce=(fe-L)*8;if(D===d.MIXED)return ce;const I=ce-g(D,B);switch(D){case d.NUMERIC:return Math.floor(I/10*3);case d.ALPHANUMERIC:return Math.floor(I/11*2);case d.KANJI:return Math.floor(I/13);case d.BYTE:default:return Math.floor(I/8)}},i.getBestVersionForData=function(B,X){let D;const fe=s.from(X,s.M);if(Array.isArray(B)){if(B.length>1)return E(B,fe);if(B.length===0)return 1;D=B[0]}else D=B;return p(D.mode,D.getLength(),fe)},i.getEncodedBits=function(B){if(!h.isValid(B)||B<7)throw new Error(\"Invalid QR Code version\");let X=B<<12;for(;c.getBCHDigit(X)-A>=0;)X^=v<<c.getBCHDigit(X)-A;return B<<12|X}})(Ws)),Ws}var ef={},Fh;function nv(){if(Fh)return ef;Fh=1;const i=nl(),c=1335,r=21522,s=i.getBCHDigit(c);return ef.getEncodedBits=function(h,v){const A=h.bit<<3|v;let p=A<<10;for(;i.getBCHDigit(p)-s>=0;)p^=c<<i.getBCHDigit(p)-s;return(A<<10|p)^r},ef}var tf={},nf,Wh;function lv(){if(Wh)return nf;Wh=1;const i=ll();function c(r){this.mode=i.NUMERIC,this.data=r.toString()}return c.getBitsLength=function(s){return 10*Math.floor(s/3)+(s%3?s%3*3+1:0)},c.prototype.getLength=function(){return this.data.length},c.prototype.getBitsLength=function(){return c.getBitsLength(this.data.length)},c.prototype.write=function(s){let d,h,v;for(d=0;d+3<=this.data.length;d+=3)h=this.data.substr(d,3),v=parseInt(h,10),s.put(v,10);const A=this.data.length-d;A>0&&(h=this.data.substr(d),v=parseInt(h,10),s.put(v,A*3+1))},nf=c,nf}var lf,Ih;function av(){if(Ih)return lf;Ih=1;const i=ll(),c=[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\" \",\"$\",\"%\",\"*\",\"+\",\"-\",\".\",\"/\",\":\"];function r(s){this.mode=i.ALPHANUMERIC,this.data=s}return r.getBitsLength=function(d){return 11*Math.floor(d/2)+6*(d%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(d){let h;for(h=0;h+2<=this.data.length;h+=2){let v=c.indexOf(this.data[h])*45;v+=c.indexOf(this.data[h+1]),d.put(v,11)}this.data.length%2&&d.put(c.indexOf(this.data[h]),6)},lf=r,lf}var af,Ph;function uv(){if(Ph)return af;Ph=1;const i=ll();function c(r){this.mode=i.BYTE,typeof r==\"string\"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return c.getBitsLength=function(s){return s*8},c.prototype.getLength=function(){return this.data.length},c.prototype.getBitsLength=function(){return c.getBitsLength(this.data.length)},c.prototype.write=function(r){for(let s=0,d=this.data.length;s<d;s++)r.put(this.data[s],8)},af=c,af}var uf,e0;function iv(){if(e0)return uf;e0=1;const i=ll(),c=nl();function r(s){this.mode=i.KANJI,this.data=s}return r.getBitsLength=function(d){return d*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(s){let d;for(d=0;d<this.data.length;d++){let h=c.toSJIS(this.data[d]);if(h>=33088&&h<=40956)h-=33088;else if(h>=57408&&h<=60351)h-=49472;else throw new Error(\"Invalid SJIS character: \"+this.data[d]+\\`\nMake sure your charset is UTF-8\\`);h=(h>>>8&255)*192+(h&255),s.put(h,13)}},uf=r,uf}var cf={exports:{}},t0;function cv(){return t0||(t0=1,(function(i){var c={single_source_shortest_paths:function(r,s,d){var h={},v={};v[s]=0;var A=c.PriorityQueue.make();A.push(s,0);for(var p,g,N,E,j,B,X,D,fe;!A.empty();){p=A.pop(),g=p.value,E=p.cost,j=r[g]||{};for(N in j)j.hasOwnProperty(N)&&(B=j[N],X=E+B,D=v[N],fe=typeof v[N]>\"u\",(fe||D>X)&&(v[N]=X,A.push(N,X),h[N]=g))}if(typeof d<\"u\"&&typeof v[d]>\"u\"){var L=[\"Could not find a path from \",s,\" to \",d,\".\"].join(\"\");throw new Error(L)}return h},extract_shortest_path_from_predecessor_list:function(r,s){for(var d=[],h=s;h;)d.push(h),r[h],h=r[h];return d.reverse(),d},find_path:function(r,s,d){var h=c.single_source_shortest_paths(r,s,d);return c.extract_shortest_path_from_predecessor_list(h,d)},PriorityQueue:{make:function(r){var s=c.PriorityQueue,d={},h;r=r||{};for(h in s)s.hasOwnProperty(h)&&(d[h]=s[h]);return d.queue=[],d.sorter=r.sorter||s.default_sorter,d},default_sorter:function(r,s){return r.cost-s.cost},push:function(r,s){var d={value:r,cost:s};this.queue.push(d),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};i.exports=c})(cf)),cf.exports}var n0;function sv(){return n0||(n0=1,(function(i){const c=ll(),r=lv(),s=av(),d=uv(),h=iv(),v=S0(),A=nl(),p=cv();function g(L){return unescape(encodeURIComponent(L)).length}function N(L,ce,I){const $=[];let Ae;for(;(Ae=L.exec(I))!==null;)$.push({data:Ae[0],index:Ae.index,mode:ce,length:Ae[0].length});return $}function E(L){const ce=N(v.NUMERIC,c.NUMERIC,L),I=N(v.ALPHANUMERIC,c.ALPHANUMERIC,L);let $,Ae;return A.isKanjiModeEnabled()?($=N(v.BYTE,c.BYTE,L),Ae=N(v.KANJI,c.KANJI,L)):($=N(v.BYTE_KANJI,c.BYTE,L),Ae=[]),ce.concat(I,$,Ae).sort(function(Y,K){return Y.index-K.index}).map(function(Y){return{data:Y.data,mode:Y.mode,length:Y.length}})}function j(L,ce){switch(ce){case c.NUMERIC:return r.getBitsLength(L);case c.ALPHANUMERIC:return s.getBitsLength(L);case c.KANJI:return h.getBitsLength(L);case c.BYTE:return d.getBitsLength(L)}}function B(L){return L.reduce(function(ce,I){const $=ce.length-1>=0?ce[ce.length-1]:null;return $&&$.mode===I.mode?(ce[ce.length-1].data+=I.data,ce):(ce.push(I),ce)},[])}function X(L){const ce=[];for(let I=0;I<L.length;I++){const $=L[I];switch($.mode){case c.NUMERIC:ce.push([$,{data:$.data,mode:c.ALPHANUMERIC,length:$.length},{data:$.data,mode:c.BYTE,length:$.length}]);break;case c.ALPHANUMERIC:ce.push([$,{data:$.data,mode:c.BYTE,length:$.length}]);break;case c.KANJI:ce.push([$,{data:$.data,mode:c.BYTE,length:g($.data)}]);break;case c.BYTE:ce.push([{data:$.data,mode:c.BYTE,length:g($.data)}])}}return ce}function D(L,ce){const I={},$={start:{}};let Ae=[\"start\"];for(let Z=0;Z<L.length;Z++){const Y=L[Z],K=[];for(let V=0;V<Y.length;V++){const ne=Y[V],q=\"\"+Z+V;K.push(q),I[q]={node:ne,lastCount:0},$[q]={};for(let F=0;F<Ae.length;F++){const ee=Ae[F];I[ee]&&I[ee].node.mode===ne.mode?($[ee][q]=j(I[ee].lastCount+ne.length,ne.mode)-j(I[ee].lastCount,ne.mode),I[ee].lastCount+=ne.length):(I[ee]&&(I[ee].lastCount=ne.length),$[ee][q]=j(ne.length,ne.mode)+4+c.getCharCountIndicator(ne.mode,ce))}}Ae=K}for(let Z=0;Z<Ae.length;Z++)$[Ae[Z]].end=0;return{map:$,table:I}}function fe(L,ce){let I;const $=c.getBestModeForData(L);if(I=c.from(ce,$),I!==c.BYTE&&I.bit<$.bit)throw new Error('\"'+L+'\" cannot be encoded with mode '+c.toString(I)+\\`.\n Suggested mode is: \\`+c.toString($));switch(I===c.KANJI&&!A.isKanjiModeEnabled()&&(I=c.BYTE),I){case c.NUMERIC:return new r(L);case c.ALPHANUMERIC:return new s(L);case c.KANJI:return new h(L);case c.BYTE:return new d(L)}}i.fromArray=function(ce){return ce.reduce(function(I,$){return typeof $==\"string\"?I.push(fe($,null)):$.data&&I.push(fe($.data,$.mode)),I},[])},i.fromString=function(ce,I){const $=E(ce,A.isKanjiModeEnabled()),Ae=X($),Z=D(Ae,I),Y=p.find_path(Z.map,\"start\",\"end\"),K=[];for(let V=1;V<Y.length-1;V++)K.push(Z.table[Y[V]].node);return i.fromArray(B(K))},i.rawSplit=function(ce){return i.fromArray(E(ce,A.isKanjiModeEnabled()))}})(tf)),tf}var l0;function fv(){if(l0)return Qs;l0=1;const i=nl(),c=pf(),r=ky(),s=Jy(),d=$y(),h=Fy(),v=Wy(),A=v0(),p=ev(),g=tv(),N=nv(),E=ll(),j=sv();function B(Z,Y){const K=Z.size,V=h.getPositions(Y);for(let ne=0;ne<V.length;ne++){const q=V[ne][0],F=V[ne][1];for(let ee=-1;ee<=7;ee++)if(!(q+ee<=-1||K<=q+ee))for(let ue=-1;ue<=7;ue++)F+ue<=-1||K<=F+ue||(ee>=0&&ee<=6&&(ue===0||ue===6)||ue>=0&&ue<=6&&(ee===0||ee===6)||ee>=2&&ee<=4&&ue>=2&&ue<=4?Z.set(q+ee,F+ue,!0,!0):Z.set(q+ee,F+ue,!1,!0))}}function X(Z){const Y=Z.size;for(let K=8;K<Y-8;K++){const V=K%2===0;Z.set(K,6,V,!0),Z.set(6,K,V,!0)}}function D(Z,Y){const K=d.getPositions(Y);for(let V=0;V<K.length;V++){const ne=K[V][0],q=K[V][1];for(let F=-2;F<=2;F++)for(let ee=-2;ee<=2;ee++)F===-2||F===2||ee===-2||ee===2||F===0&&ee===0?Z.set(ne+F,q+ee,!0,!0):Z.set(ne+F,q+ee,!1,!0)}}function fe(Z,Y){const K=Z.size,V=g.getEncodedBits(Y);let ne,q,F;for(let ee=0;ee<18;ee++)ne=Math.floor(ee/3),q=ee%3+K-8-3,F=(V>>ee&1)===1,Z.set(ne,q,F,!0),Z.set(q,ne,F,!0)}function L(Z,Y,K){const V=Z.size,ne=N.getEncodedBits(Y,K);let q,F;for(q=0;q<15;q++)F=(ne>>q&1)===1,q<6?Z.set(q,8,F,!0):q<8?Z.set(q+1,8,F,!0):Z.set(V-15+q,8,F,!0),q<8?Z.set(8,V-q-1,F,!0):q<9?Z.set(8,15-q-1+1,F,!0):Z.set(8,15-q-1,F,!0);Z.set(V-8,8,1,!0)}function ce(Z,Y){const K=Z.size;let V=-1,ne=K-1,q=7,F=0;for(let ee=K-1;ee>0;ee-=2)for(ee===6&&ee--;;){for(let ue=0;ue<2;ue++)if(!Z.isReserved(ne,ee-ue)){let Ye=!1;F<Y.length&&(Ye=(Y[F]>>>q&1)===1),Z.set(ne,ee-ue,Ye),q--,q===-1&&(F++,q=7)}if(ne+=V,ne<0||K<=ne){ne-=V,V=-V;break}}}function I(Z,Y,K){const V=new r;K.forEach(function(ue){V.put(ue.mode.bit,4),V.put(ue.getLength(),E.getCharCountIndicator(ue.mode,Z)),ue.write(V)});const ne=i.getSymbolTotalCodewords(Z),q=A.getTotalCodewordsCount(Z,Y),F=(ne-q)*8;for(V.getLengthInBits()+4<=F&&V.put(0,4);V.getLengthInBits()%8!==0;)V.putBit(0);const ee=(F-V.getLengthInBits())/8;for(let ue=0;ue<ee;ue++)V.put(ue%2?17:236,8);return $(V,Z,Y)}function $(Z,Y,K){const V=i.getSymbolTotalCodewords(Y),ne=A.getTotalCodewordsCount(Y,K),q=V-ne,F=A.getBlocksCount(Y,K),ee=V%F,ue=F-ee,Ye=Math.floor(V/F),M=Math.floor(q/F),G=M+1,ae=Ye-M,Te=new p(ae);let be=0;const b=new Array(F),U=new Array(F);let Q=0;const W=new Uint8Array(Z.buffer);for(let Ne=0;Ne<F;Ne++){const nt=Ne<ue?M:G;b[Ne]=W.slice(be,be+nt),U[Ne]=Te.encode(b[Ne]),be+=nt,Q=Math.max(Q,nt)}const se=new Uint8Array(V);let re=0,de,Me;for(de=0;de<Q;de++)for(Me=0;Me<F;Me++)de<b[Me].length&&(se[re++]=b[Me][de]);for(de=0;de<ae;de++)for(Me=0;Me<F;Me++)se[re++]=U[Me][de];return se}function Ae(Z,Y,K,V){let ne;if(Array.isArray(Z))ne=j.fromArray(Z);else if(typeof Z==\"string\"){let Ye=Y;if(!Ye){const M=j.rawSplit(Z);Ye=g.getBestVersionForData(M,K)}ne=j.fromString(Z,Ye||40)}else throw new Error(\"Invalid data\");const q=g.getBestVersionForData(ne,K);if(!q)throw new Error(\"The amount of data is too big to be stored in a QR Code\");if(!Y)Y=q;else if(Y<q)throw new Error(\\`\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: \\`+q+\\`.\n\\`);const F=I(Y,K,ne),ee=i.getSymbolSize(Y),ue=new s(ee);return B(ue,Y),X(ue),D(ue,Y),L(ue,K,0),Y>=7&&fe(ue,Y),ce(ue,F),isNaN(V)&&(V=v.getBestMask(ue,L.bind(null,ue,K))),v.applyMask(V,ue),L(ue,K,V),{modules:ue,version:Y,errorCorrectionLevel:K,maskPattern:V,segments:ne}}return Qs.create=function(Y,K){if(typeof Y>\"u\"||Y===\"\")throw new Error(\"No input text\");let V=c.M,ne,q;return typeof K<\"u\"&&(V=c.from(K.errorCorrectionLevel,c.M),ne=g.from(K.version),q=v.from(K.maskPattern),K.toSJISFunc&&i.setToSJISFunction(K.toSJISFunc)),Ae(Y,ne,V,q)},Qs}var sf={},ff={},a0;function p0(){return a0||(a0=1,(function(i){function c(r){if(typeof r==\"number\"&&(r=r.toString()),typeof r!=\"string\")throw new Error(\"Color should be defined as hex string\");let s=r.slice().replace(\"#\",\"\").split(\"\");if(s.length<3||s.length===5||s.length>8)throw new Error(\"Invalid hex color: \"+r);(s.length===3||s.length===4)&&(s=Array.prototype.concat.apply([],s.map(function(h){return[h,h]}))),s.length===6&&s.push(\"F\",\"F\");const d=parseInt(s.join(\"\"),16);return{r:d>>24&255,g:d>>16&255,b:d>>8&255,a:d&255,hex:\"#\"+s.slice(0,6).join(\"\")}}i.getOptions=function(s){s||(s={}),s.color||(s.color={});const d=typeof s.margin>\"u\"||s.margin===null||s.margin<0?4:s.margin,h=s.width&&s.width>=21?s.width:void 0,v=s.scale||4;return{width:h,scale:h?4:v,margin:d,color:{dark:c(s.color.dark||\"#000000ff\"),light:c(s.color.light||\"#ffffffff\")},type:s.type,rendererOpts:s.rendererOpts||{}}},i.getScale=function(s,d){return d.width&&d.width>=s+d.margin*2?d.width/(s+d.margin*2):d.scale},i.getImageWidth=function(s,d){const h=i.getScale(s,d);return Math.floor((s+d.margin*2)*h)},i.qrToImageData=function(s,d,h){const v=d.modules.size,A=d.modules.data,p=i.getScale(v,h),g=Math.floor((v+h.margin*2)*p),N=h.margin*p,E=[h.color.light,h.color.dark];for(let j=0;j<g;j++)for(let B=0;B<g;B++){let X=(j*g+B)*4,D=h.color.light;if(j>=N&&B>=N&&j<g-N&&B<g-N){const fe=Math.floor((j-N)/p),L=Math.floor((B-N)/p);D=E[A[fe*v+L]?1:0]}s[X++]=D.r,s[X++]=D.g,s[X++]=D.b,s[X]=D.a}}})(ff)),ff}var u0;function rv(){return u0||(u0=1,(function(i){const c=p0();function r(d,h,v){d.clearRect(0,0,h.width,h.height),h.style||(h.style={}),h.height=v,h.width=v,h.style.height=v+\"px\",h.style.width=v+\"px\"}function s(){try{return document.createElement(\"canvas\")}catch{throw new Error(\"You need to specify a canvas element\")}}i.render=function(h,v,A){let p=A,g=v;typeof p>\"u\"&&(!v||!v.getContext)&&(p=v,v=void 0),v||(g=s()),p=c.getOptions(p);const N=c.getImageWidth(h.modules.size,p),E=g.getContext(\"2d\"),j=E.createImageData(N,N);return c.qrToImageData(j.data,h,p),r(E,g,N),E.putImageData(j,0,0),g},i.renderToDataURL=function(h,v,A){let p=A;typeof p>\"u\"&&(!v||!v.getContext)&&(p=v,v=void 0),p||(p={});const g=i.render(h,v,p),N=p.type||\"image/png\",E=p.rendererOpts||{};return g.toDataURL(N,E.quality)}})(sf)),sf}var rf={},i0;function ov(){if(i0)return rf;i0=1;const i=p0();function c(d,h){const v=d.a/255,A=h+'=\"'+d.hex+'\"';return v<1?A+\" \"+h+'-opacity=\"'+v.toFixed(2).slice(1)+'\"':A}function r(d,h,v){let A=d+h;return typeof v<\"u\"&&(A+=\" \"+v),A}function s(d,h,v){let A=\"\",p=0,g=!1,N=0;for(let E=0;E<d.length;E++){const j=Math.floor(E%h),B=Math.floor(E/h);!j&&!g&&(g=!0),d[E]?(N++,E>0&&j>0&&d[E-1]||(A+=g?r(\"M\",j+v,.5+B+v):r(\"m\",p,0),p=0,g=!1),j+1<h&&d[E+1]||(A+=r(\"h\",N),N=0)):p++}return A}return rf.render=function(h,v,A){const p=i.getOptions(v),g=h.modules.size,N=h.modules.data,E=g+p.margin*2,j=p.color.light.a?\"<path \"+c(p.color.light,\"fill\")+' d=\"M0 0h'+E+\"v\"+E+'H0z\"/>':\"\",B=\"<path \"+c(p.color.dark,\"stroke\")+' d=\"'+s(N,g,p.margin)+'\"/>',X='viewBox=\"0 0 '+E+\" \"+E+'\"',fe='<svg xmlns=\"http://www.w3.org/2000/svg\" '+(p.width?'width=\"'+p.width+'\" height=\"'+p.width+'\" ':\"\")+X+' shape-rendering=\"crispEdges\">'+j+B+\\`</svg>\n\\`;return typeof A==\"function\"&&A(null,fe),fe},rf}var c0;function dv(){if(c0)return $l;c0=1;const i=Vy(),c=fv(),r=rv(),s=ov();function d(h,v,A,p,g){const N=[].slice.call(arguments,1),E=N.length,j=typeof N[E-1]==\"function\";if(!j&&!i())throw new Error(\"Callback required as last argument\");if(j){if(E<2)throw new Error(\"Too few arguments provided\");E===2?(g=A,A=v,v=p=void 0):E===3&&(v.getContext&&typeof g>\"u\"?(g=p,p=void 0):(g=p,p=A,A=v,v=void 0))}else{if(E<1)throw new Error(\"Too few arguments provided\");return E===1?(A=v,v=p=void 0):E===2&&!v.getContext&&(p=A,A=v,v=void 0),new Promise(function(B,X){try{const D=c.create(A,p);B(h(D,v,p))}catch(D){X(D)}})}try{const B=c.create(A,p);g(null,h(B,v,p))}catch(B){g(B)}}return $l.create=c.create,$l.toCanvas=d.bind(null,r.render),$l.toDataURL=d.bind(null,r.renderToDataURL),$l.toString=d.bind(null,function(h,v,A){return s.render(h,A)}),$l}var hv=dv();const mv=Lg(hv);function E0(i){return i==null?\"\":typeof i==\"string\"?i:typeof i==\"number\"||typeof i==\"boolean\"?String(i):JSON.stringify(i)}function gv(i){return!(i.text.trim()===\"\"||i.text===E0(i.setting.value)||i.setting.confirm!==void 0&&!i.confirmed)}function yv(i){return i.agents.length===0?m.jsx(\"div\",{className:\"empty\",style:{fontSize:12,padding:\"4px 8px\"},children:\"no agents on this server\"}):m.jsx(m.Fragment,{children:i.agents.map(c=>{const r=c.status===\"disabled\";return m.jsxs(\"div\",{className:\"agent-row\",children:[m.jsxs(\"button\",{type:\"button\",className:\"row-button\",\"aria-current\":c.id===i.current,disabled:r,onClick:()=>i.onSelect(c.id),children:[c.name,r?m.jsx(\"span\",{className:\"agent-off\",children:\" · stopped\"}):null]}),r?m.jsxs(\"div\",{className:\"agent-note\",children:[c.reason??\"switched off\",m.jsx(\"button\",{type:\"button\",className:\"link\",disabled:i.starting===c.id,onClick:()=>i.onStart(c.id),children:i.starting===c.id?\"starting…\":\"start\"})]}):null]},c.id)})})}function vv(i){return i.tools.length===0?m.jsxs(\"p\",{className:\"empty\",children:[\"No tools are pinned. An agent with none can still hold a conversation; a manifest's\",\" \",m.jsx(\"code\",{children:\"tools.pinned\"}),\" is what grants the rest.\"]}):m.jsxs(\"table\",{className:\"panel-table\",children:[m.jsx(\"thead\",{children:m.jsxs(\"tr\",{children:[m.jsx(\"th\",{children:\"tool\"}),m.jsx(\"th\",{children:\"provider\"}),m.jsx(\"th\",{children:\"writes\"}),m.jsx(\"th\",{children:\"trust\"})]})}),m.jsx(\"tbody\",{children:i.tools.map(c=>m.jsxs(\"tr\",{children:[m.jsxs(\"td\",{children:[m.jsx(\"code\",{children:c.slug}),m.jsx(\"div\",{className:\"sub\",children:c.summary})]}),m.jsx(\"td\",{children:c.provider}),m.jsx(\"td\",{children:c.mutating?\"yes\":\"no\"}),m.jsxs(\"td\",{children:[c.trust,c.trustReason===void 0?null:m.jsx(\"div\",{className:\"sub\",children:c.trustReason})]})]},c.slug))})]})}function bv(i){return m.jsxs(m.Fragment,{children:[i.schedules.length===0?m.jsxs(\"p\",{className:\"empty\",children:[\"No schedules. Add one below, or declare it in the manifest's\",\" \",m.jsx(\"code\",{children:\"schedules:\"}),\" block — a declared one survives a rebuild and shows up in a diff.\"]}):m.jsxs(\"table\",{className:\"panel-table\",children:[m.jsx(\"thead\",{children:m.jsxs(\"tr\",{children:[m.jsx(\"th\",{children:\"schedule\"}),m.jsx(\"th\",{children:\"when\"}),m.jsx(\"th\",{children:\"next\"}),m.jsx(\"th\",{children:\"delivers to\"}),m.jsx(\"th\",{children:\"declared in\"}),m.jsx(\"th\",{})]})}),m.jsx(\"tbody\",{children:i.schedules.map(c=>{const r=c.origin===\"manifest\",s=i.busy===c.id;return m.jsxs(\"tr\",{className:c.enabled?\"\":\"off\",children:[m.jsxs(\"td\",{children:[m.jsx(\"code\",{children:c.id}),m.jsx(\"div\",{className:\"sub\",children:c.task})]}),m.jsxs(\"td\",{children:[c.kind,\" \",c.expr,c.timezone===void 0?null:m.jsx(\"div\",{className:\"sub\",children:c.timezone})]}),m.jsx(\"td\",{children:c.enabled?c.nextRunAt??\"never again — a spent one-shot\":\"disabled\"}),m.jsx(\"td\",{children:c.deliverChannel===void 0?\"this session only\":\\`\\${c.deliverChannel}\\${c.deliverTo===void 0?\"\":\\` → \\${c.deliverTo}\\`}\\`}),m.jsxs(\"td\",{children:[r?\"agent.yaml\":\"the API\",r?m.jsxs(\"div\",{className:\"sub\",children:[\"the manifest decides it — edit the file, or the\",\" \",m.jsx(\"code\",{children:\"schedules\"}),\" field under config\"]}):null]}),m.jsxs(\"td\",{style:{whiteSpace:\"nowrap\"},children:[i.onRun===void 0?null:m.jsx(\"button\",{type:\"button\",disabled:s,onClick:()=>i.onRun?.(c.id),children:\"run now\"}),i.onToggle===void 0||r?null:m.jsx(\"button\",{type:\"button\",disabled:s,onClick:()=>i.onToggle?.(c.id,!c.enabled),children:c.enabled?\"disable\":\"enable\"}),i.onDelete===void 0||r?null:m.jsx(\"button\",{type:\"button\",disabled:s,onClick:()=>i.onDelete?.(c.id),children:\"delete\"})]})]},c.id)})})]}),i.onCreate===void 0?null:m.jsx(Sv,{onCreate:i.onCreate})]})}function Sv(i){const[c,r]=k.useState(\"\"),[s,d]=k.useState(\"cron\"),[h,v]=k.useState(\"\"),[A,p]=k.useState(\"\"),[g,N]=k.useState(\"\"),[E,j]=k.useState(\"\"),B=c.trim()!==\"\"&&h.trim()!==\"\"&&A.trim()!==\"\";return m.jsxs(\"section\",{style:{marginTop:24},children:[m.jsx(\"h3\",{style:{fontSize:13,margin:\"0 0 8px\"},children:\"Add a schedule\"}),m.jsxs(\"div\",{className:\"form-grid\",children:[m.jsx(\"label\",{htmlFor:\"sched-id\",children:\"id\"}),m.jsx(\"input\",{id:\"sched-id\",value:c,placeholder:\"morning-brief\",onChange:X=>r(X.target.value)}),m.jsx(\"label\",{htmlFor:\"sched-kind\",children:\"kind\"}),m.jsxs(\"select\",{id:\"sched-kind\",value:s,onChange:X=>d(X.target.value),children:[m.jsx(\"option\",{value:\"cron\",children:\"cron — a 5- or 6-field expression\"}),m.jsx(\"option\",{value:\"every\",children:\"every — a duration like 15m\"}),m.jsx(\"option\",{value:\"at\",children:\"at — one ISO instant, once\"})]}),m.jsx(\"label\",{htmlFor:\"sched-expr\",children:\"expr\"}),m.jsx(\"input\",{id:\"sched-expr\",value:h,placeholder:s===\"cron\"?\"0 8 * * *\":s===\"every\"?\"15m\":\"\",onChange:X=>v(X.target.value)}),m.jsx(\"label\",{htmlFor:\"sched-task\",children:\"task\"}),m.jsx(\"input\",{id:\"sched-task\",value:A,placeholder:\"Summarise today's calendar.\",onChange:X=>p(X.target.value)}),m.jsx(\"label\",{htmlFor:\"sched-channel\",children:\"deliver\"}),m.jsxs(\"div\",{children:[m.jsx(\"input\",{id:\"sched-channel\",value:g,placeholder:\"channel id — blank for this session only\",onChange:X=>N(X.target.value)}),g.trim()===\"\"?null:m.jsxs(m.Fragment,{children:[m.jsx(\"input\",{value:E,placeholder:\"address\",onChange:X=>j(X.target.value)}),m.jsxs(\"p\",{className:\"sub\",children:[\"The address a reply is \",m.jsx(\"em\",{children:\"sent\"}),\" to — on Telegram the numeric chat id, never an \",m.jsx(\"code\",{children:\"@handle\"}),\", which addresses a channel and not a person. It is the id inbound messages arrive on.\"]})]})]})]}),m.jsx(\"button\",{type:\"button\",disabled:!B,style:{marginTop:10},onClick:()=>i.onCreate({id:c.trim(),kind:s,expr:h.trim(),task:A.trim(),deliver:g.trim()===\"\"?\"none\":{channel:g.trim(),to:E.trim()}}),children:\"add\"})]})}function pv(i){return i.editable?m.jsxs(m.Fragment,{children:[m.jsxs(\"p\",{className:\"sub\",style:{marginTop:0},children:[i.file===void 0?null:m.jsxs(m.Fragment,{children:[m.jsx(\"code\",{children:i.file}),\".\",\" \"]}),\"An agent's settings are fixed for its instance's lifetime, so saving one replaces the agent — the conversation history is in the store and survives it.\"]}),i.note===void 0?null:m.jsx(\"p\",{className:\"row note\",children:i.note}),i.settings.map(c=>m.jsx(Ev,{setting:c,busy:i.busy===c.path,onSet:i.onSet},c.path))]}):m.jsx(\"p\",{className:\"empty\",children:\"This agent was loaded from an object rather than a file, so there is no manifest to change. An embedder holding new settings passes the new object to its runtime.\"})}function Ev(i){const c=E0(i.setting.value),[r,s]=k.useState(c),[d,h]=k.useState(!1),[v,A]=k.useState(c);v!==c&&(A(c),s(c),h(!1));const p=gv({setting:i.setting,text:r,confirmed:d}),g=c.length>48||c.includes(\"{\")||c.includes(\"[\");return m.jsxs(\"section\",{className:\"config-row\",children:[m.jsxs(\"div\",{className:\"config-head\",children:[m.jsx(\"code\",{children:i.setting.path}),i.setting.value===void 0?m.jsx(\"span\",{className:\"sub\",children:\" not set\"}):null]}),m.jsx(\"p\",{className:\"sub\",children:i.setting.means}),g?m.jsx(\"textarea\",{rows:2,value:r,\"aria-label\":i.setting.path,onChange:N=>s(N.target.value)}):m.jsx(\"input\",{value:r,\"aria-label\":i.setting.path,onChange:N=>s(N.target.value)}),i.setting.confirm===void 0?null:m.jsxs(\"label\",{className:\"row note bad\",style:{display:\"block\"},children:[m.jsx(\"input\",{type:\"checkbox\",checked:d,onChange:N=>h(N.target.checked)}),\" \",i.setting.confirm]}),m.jsx(\"button\",{type:\"button\",disabled:!p||i.busy,onClick:()=>i.onSet(i.setting.path,r,{confirm:d}),children:i.busy?\"saving…\":\"save\"})]})}function Tv(i){return i.warnings.length===0?null:m.jsxs(\"section\",{className:\"warnings\",children:[m.jsxs(\"h3\",{children:[i.warnings.length,\" thing\",i.warnings.length===1?\"\":\"s\",\" this agent could not set up\"]}),m.jsx(\"p\",{className:\"sub\",children:\"It is running. Each of these is a capability it does not have — fix the cause and restart the agent.\"}),i.warnings.map(c=>m.jsxs(\"div\",{className:\"warning\",children:[m.jsxs(\"p\",{className:\"warning-message\",children:[c.field===void 0?null:m.jsx(\"code\",{children:c.field}),\" \",c.message]}),c.hint===void 0?null:m.jsx(\"p\",{className:\"hint\",children:c.hint})]},\\`\\${c.code}:\\${c.message}\\`))]})}function Av(i){return i.channels.length===0?m.jsx(\"p\",{className:\"empty\",children:\"No channels. This agent is reached through this page and the HTTP API only.\"}):m.jsxs(\"div\",{className:\"channels\",children:[i.channels.map(c=>{const r=c.input,s=r?.expiresAt!==void 0&&Date.parse(r.expiresAt)<=i.now;return m.jsxs(\"section\",{className:\"channel\",children:[m.jsxs(\"h3\",{children:[m.jsx(\"code\",{children:c.id}),\" \",m.jsx(\"span\",{className:\"sub\",children:c.type})]}),m.jsxs(\"p\",{className:\\`status status-\\${c.status??\"off\"}\\`,children:[c.enabled===!1?\"disconnected\":c.status??\"not started here\",c.detail===void 0?null:\\` — \\${c.detail}\\`]}),c.credentialEnv===void 0?null:m.jsxs(\"p\",{className:c.credentialSet===!0?\"sub\":\"warn\",children:[m.jsx(\"code\",{children:c.credentialEnv}),\" \",c.credentialSet===!0?\"is set\":\"is NOT set\"]}),r===void 0?null:m.jsxs(\"div\",{className:\\`channel-input \\${s?\"stale\":\"fresh\"}\\`,children:[s?m.jsx(\"p\",{className:\"warn\",children:\"this expired — the channel will issue another\"}):null,m.jsx(Nv,{kind:r.kind,payload:r.payload}),m.jsxs(\"p\",{className:\"sub\",children:[r.kind,\" · issued \",r.issuedAt,r.expiresAt===void 0?\" · no expiry reported\":\\` · expires \\${r.expiresAt}\\`]})]}),i.actions===void 0?null:m.jsx(zv,{channel:c,actions:i.actions})]},c.id)}),i.actions?.note===void 0?null:m.jsx(\"p\",{className:\"row note\",children:i.actions.note})]})}function zv(i){const[c,r]=k.useState(\"\"),{channel:s,actions:d}=i,h=d.busy===s.id,v=s.enabled!==!1,A=s.input!==void 0||s.type===\"whatsapp\";return m.jsxs(\"div\",{className:\"channel-actions\",children:[m.jsx(\"button\",{type:\"button\",disabled:h,onClick:()=>d.onConnect(s.id,!v),children:v?\"disconnect\":\"connect\"}),A?m.jsx(\"button\",{type:\"button\",disabled:h,onClick:()=>d.onUnpair(s.id),children:\"unpair\"}):null,s.credentialEnv===void 0?null:m.jsxs(\"form\",{onSubmit:p=>{p.preventDefault(),c!==\"\"&&(d.onCredential(s.id,c),r(\"\"))},children:[m.jsx(\"input\",{type:\"password\",autoComplete:\"new-password\",placeholder:s.credentialEnv,value:c,disabled:h,onChange:p=>r(p.target.value)}),m.jsx(\"button\",{type:\"submit\",disabled:h||c===\"\",children:s.credentialSet===!0?\"replace\":\"set\"})]}),h?m.jsx(\"span\",{className:\"sub\",children:\"working…\"}):null]})}const Cv=[{panel:\"tools\",label:\"tools\"},{panel:\"schedules\",label:\"schedules\"},{panel:\"channels\",label:\"channels\"},{panel:\"config\",label:\"config\"},{panel:\"keys\",label:\"keys\"}];function Nv(i){if(i.kind===\"pairing_code\")return m.jsx(\"p\",{className:\"payload-code\",\"data-kind\":i.kind,children:i.payload.length===8?\\`\\${i.payload.slice(0,4)} \\${i.payload.slice(4)}\\`:i.payload});const c=i.kind===\"qr\"?jv(i.payload):void 0;return c===void 0?m.jsx(\"pre\",{className:\"payload\",\"data-kind\":i.kind,children:i.payload}):m.jsxs(\"svg\",{className:\"payload-qr\",viewBox:\\`0 0 \\${c.extent} \\${c.extent}\\`,\"data-kind\":i.kind,\"data-modules\":c.size,shapeRendering:\"crispEdges\",role:\"img\",\"aria-label\":\"Scan this code from WhatsApp, under Linked devices\",children:[m.jsx(\"rect\",{width:c.extent,height:c.extent,fill:\"#fff\"}),m.jsx(\"path\",{d:c.d,fill:\"#000\"})]})}const of=4;function jv(i){try{const{modules:c}=mv.create(i,{errorCorrectionLevel:\"L\"}),r=c.size;let s=\"\";for(let d=0;d<r;d+=1)for(let h=0;h<r;h+=1)c.data[d*r+h]===1&&(s+=\\`M\\${h+of},\\${d+of}h1v1h-1z\\`);return s===\"\"?void 0:{d:s,size:r,extent:r+of*2}}catch{return}}const df=\"dispach.turn\";function xv(i){const[c,r]=k.useState(),[s,d]=k.useState();return k.useEffect(()=>{zy(i.baseUrl).then(r).catch(h=>d(h instanceof Error?h.message:String(h)))},[i.baseUrl]),s!==void 0?m.jsxs(gf,{title:\"Cannot reach the server\",children:[m.jsx(\"p\",{children:s}),m.jsx(\"button\",{type:\"button\",onClick:()=>window.location.reload(),children:\"Try again\"})]}):c===void 0?m.jsx(gf,{title:\"Connecting…\"}):c.kind===\"needed\"?m.jsx(_v,{baseUrl:i.baseUrl,because:c.because}):m.jsx(wv,{baseUrl:i.baseUrl,token:c.kind===\"key\"?c.secret:void 0})}function gf(i){return m.jsx(\"div\",{className:\"gate\",children:m.jsxs(\"div\",{className:\"card\",children:[m.jsx(\"h2\",{children:i.title}),i.children]})})}function _v(i){const[c,r]=k.useState(\"\"),[s,d]=k.useState(),[h,v]=k.useState(!1),A=async p=>{v(!0),d(void 0);try{const g=p?await m0(i.baseUrl,c.trim()):c.trim();bf(g),window.location.reload()}catch(g){d(g instanceof Error?g.message:String(g)),v(!1)}};return m.jsxs(gf,{title:\"This server needs a credential\",children:[m.jsx(\"p\",{children:i.because}),m.jsx(\"input\",{value:c,placeholder:\"paste a claim or an operator key\",onChange:p=>r(p.target.value)}),m.jsxs(\"p\",{className:\"hint\",style:{margin:\"8px 0 12px\"},children:[m.jsx(\"code\",{children:\"dispach serve\"}),\" prints a one-time claim at boot while no key exists. A claim is exchanged for a key this browser keeps; a key is used directly.\"]}),m.jsx(\"div\",{className:\"ask\",children:m.jsxs(\"div\",{className:\"buttons\",children:[m.jsx(\"button\",{type:\"button\",className:\"primary\",disabled:h||c.trim()===\"\",onClick:()=>A(!0),children:\"Exchange a claim\"}),m.jsx(\"button\",{type:\"button\",disabled:h||c.trim()===\"\",onClick:()=>A(!1),children:\"Use as a key\"})]})}),s===void 0?null:m.jsx(\"p\",{className:\"note bad\",style:{marginTop:12},children:s})]})}const yi=i=>i instanceof Zt&&i.status===404,Mv={new:\"New agent\",tools:\"Tools\",schedules:\"Schedules\",channels:\"Channels\",config:\"Settings\",keys:\"Operator keys\"};function wv(i){const c=k.useRef(g0(i.baseUrl,i.token)),[r,s]=k.useState([]),[d,h]=k.useState(),[v,A]=k.useState(),[p,g]=k.useState(),[N,E]=k.useState([]),j=k.useCallback(async()=>{h(void 0),A(void 0),E([]),K(\"this agent is no longer running on this server — start it from the list\");try{s(await c.current.agents())}catch{}},[]),[B,X]=k.useState([]),[D,fe]=k.useState(),[L,ce]=k.useState(()=>My(window.location.href).panel),[I,$]=k.useState(Fa),[Ae,Z]=k.useState(\"\"),[Y,K]=k.useState(),V=k.useRef(void 0),ne=k.useRef(Uy());k.useEffect(()=>{const H=new URL(window.location.href).searchParams.get(\"agent\")??void 0;c.current.agents().then(J=>{s(J);const he=J.filter(lt=>lt.status!==\"disabled\"),De=he.find(lt=>lt.id===H)??he[0];if(De===void 0){new URL(window.location.href).searchParams.get(\"panel\")===null&&ce(\"new\");return}h(De.id),A(De.name),$(lt=>({...lt,filter:qy(De.dialect??\"nlt\").filter})),document.title=\\`\\${De.name} · Dispach\\`}).catch(J=>K(qt(J)))},[]);const q=k.useMemo(()=>d===void 0?void 0:c.current.agent(d),[d]),F=k.useCallback(async()=>{if(q!==void 0)try{X(await q.sessions()),K(void 0)}catch(H){yi(H)?j():K(qt(H))}},[q,j]);k.useEffect(()=>{F()},[F]);const ee=k.useCallback(async(H,J)=>{const he=ne.current,De=he.begin(H);if(De===void 0)return;const lt=J.turn(H);V.current=()=>lt.stop();try{sessionStorage.setItem(df,H);for await(const rl of lt.stream({chunks:!0,signal:De}))$(Il=>Ly(Il,rl))}catch(rl){De.aborted||(K(qt(rl)),$(Il=>({...Il,running:!1})))}finally{he.finish(H),sessionStorage.removeItem(df),V.current=void 0,De.aborted||F()}},[F]);k.useEffect(()=>{if(q===void 0)return;const H=sessionStorage.getItem(df);if(H!==null)return $(J=>({...J,running:!0})),ee(H,q),()=>ne.current.abort()},[q,ee]),k.useEffect(()=>{if(q===void 0)return;let H=!0;const J=()=>{q.approvals().then(De=>{H&&E(De)}).catch(De=>{H&&yi(De)&&j()})};J();const he=window.setInterval(J,5e3);return()=>{H=!1,window.clearInterval(he)}},[q,j]);const ue=async()=>{const H=Ae.trim();if(!(H===\"\"||q===void 0)){Z(\"\"),K(void 0),$(J=>Yy(J,H));try{const J=await q.send(H,{...D===void 0?{}:{sessionKey:D}});D===void 0&&fe(J.sessionKey),await ee(J.turnId,q)}catch(J){K(qt(J)),$(he=>({...he,running:!1}))}}},Ye=async(H,J)=>{if(q!==void 0)try{await q.approve(H,J)}catch(he){he instanceof Zt&&he.code===\"approval_not_found\"||K(qt(he))}},M=async H=>{if(ne.current.abort(),ce(\"chat\"),fe(H),$(Fa),Z(\"\"),!(H===void 0||q===void 0))try{const J=await Rv(i.baseUrl,i.token,d??\"\",H);$({...Fa,rows:J})}catch(J){K(qt(J))}},[G,ae]=k.useState({tools:[],schedules:[],channels:[],warnings:[]}),[Te,be]=k.useState(void 0),[b,U]=k.useState(void 0),Q=k.useCallback(async H=>{const[J,he,De,lt]=await Promise.all([H.tools(),H.schedules(),H.describe(),H.config()]);ae({tools:J,schedules:he,channels:De.channels??[],warnings:De.warnings??[],config:lt})},[]),W=k.useCallback(async(H,J)=>{if(q!==void 0){be(H),U(void 0);try{const he=await q.setChannel(H,J);U([...he.notes,...he.applied?[]:[\\`Not in force yet: \\${he.pending?.message??\"restart to apply\"}\\`]].join(\" \")),await Q(q)}catch(he){U(he instanceof Error?he.message:String(he))}finally{be(void 0)}}},[q,Q]),se=k.useCallback(async H=>{if(q!==void 0){be(H),U(void 0);try{U((await q.unpairChannel(H)).note),await Q(q)}catch(J){U(J instanceof Error?J.message:String(J))}finally{be(void 0)}}},[q,Q]);k.useEffect(()=>{if(q===void 0||L!==\"tools\"&&L!==\"schedules\"&&L!==\"channels\"&&L!==\"config\")return;let H=!1;return(async()=>{try{if(await Q(q),H)return}catch(J){if(H)return;yi(J)?j():K(qt(J))}})(),()=>{H=!0}},[q,L,j,Q]);const[re,de]=k.useState(),[Me,Ne]=k.useState(),nt=k.useCallback(async(H,J)=>{if(q!==void 0){de(H),K(void 0),Ne(void 0);try{const he=await J(q);Ne(he),await Q(q)}catch(he){yi(he)?j():K(qt(he))}finally{de(void 0)}}},[q,j,Q]),al=k.useCallback((H,J,he)=>void nt(H,async De=>{const lt=await De.setConfig(H,J,{...he.confirm?{confirm:!0}:{}});return lt.applied?lt.reflowed?\\`\\${H} saved. The manifest was re-serialised, so its comments have moved — worth a look at the diff.\\`:void 0:\\`\\${H} was written to the manifest and is not in force yet: \\${lt.pending?.message??\"the agent could not be replaced\"} It takes effect at the next start.\\`}),[nt]),[At,Fl]=k.useState(),[zt,ul]=k.useState({}),[Wl,Wa]=k.useState(!1),[Ia,il]=k.useState(!1),[cl,sl]=k.useState();k.useEffect(()=>{if(L!==\"new\"||At!==void 0)return;let H=!1;return(async()=>{try{const J=await c.current.provision();if(H)return;Fl(J),ul(Ry(J.steps))}catch(J){H||K(qt(J))}})(),()=>{H=!0}},[L,At]);const Si=k.useCallback(async()=>{if(At!==void 0&&(Wa(!0),!(y0(At.steps,zt).length>0))){il(!0),K(void 0);try{const H=await c.current.createAgent(By(At.steps,zt));sl(H),s(await c.current.agents())}catch(H){K(qt(H))}finally{il(!1)}}},[At,zt]),fl=k.useCallback(H=>{const J=H.panel??L,he=H.agentId??d;ce(J),H.agentId!==void 0&&H.agentId!==d&&(h(H.agentId),A(r.find(De=>De.id===H.agentId)?.name),fe(void 0),$(Fa),Z(\"\")),window.history.replaceState(null,\"\",wy(window.location.href,{...he===void 0?{}:{agentId:he},panel:J}))},[d,r,L]),ut=k.useCallback(async H=>{g(H);try{await c.current.agent(H).start(),s(await c.current.agents())}catch(J){K(qt(J))}finally{g(void 0)}},[]);return m.jsxs(\"div\",{className:\"shell\",children:[m.jsxs(\"aside\",{className:\"side\",children:[m.jsxs(\"header\",{children:[m.jsx(\"div\",{className:\"brand\",children:\"Dispach\"}),m.jsx(\"div\",{style:{fontSize:12,color:\"var(--dim)\"},children:v??\"…\"})]}),m.jsxs(\"nav\",{children:[r.length>1||r.some(H=>H.status===\"disabled\")?m.jsxs(m.Fragment,{children:[m.jsx(\"div\",{className:\"group\",children:\"Agents\"}),m.jsx(yv,{agents:r,current:d,onSelect:H=>fl({agentId:H}),onStart:H=>void ut(H),...p===void 0?{}:{starting:p}})]}):null,m.jsx(\"div\",{className:\"group\",children:\"Conversation\"}),m.jsx(\"button\",{type:\"button\",className:\"row-button\",\"aria-current\":L===\"chat\"&&D===void 0,onClick:()=>void M(void 0),children:\"+ new\"}),B.map(H=>m.jsx(\"button\",{type:\"button\",className:\"row-button\",\"aria-current\":L===\"chat\"&&D===H.sessionKey,onClick:()=>void M(H.sessionKey),children:H.sessionKey},H.sessionKey)),m.jsx(\"div\",{className:\"group\",children:\"Server\"}),m.jsx(\"button\",{type:\"button\",className:\"row-button\",\"aria-current\":L===\"new\",onClick:()=>fl({panel:\"new\"}),children:\"+ new agent\"}),Cv.map(H=>m.jsx(\"button\",{type:\"button\",className:\"row-button\",\"aria-current\":L===H.panel,onClick:()=>fl({panel:H.panel}),children:H.label},H.panel))]}),m.jsxs(\"footer\",{children:[m.jsx(\"span\",{className:\\`dot \\${I.running?\"busy\":\"live\"}\\`}),m.jsx(\"span\",{style:{fontSize:11,color:\"var(--dim)\"},children:I.running?\"working\":\"ready\"}),i.token===void 0?m.jsx(\"span\",{style:{fontSize:11,color:\"var(--warn)\",marginLeft:\"auto\"},children:\"unauthenticated\"}):m.jsx(\"button\",{type:\"button\",style:{marginLeft:\"auto\",padding:\"3px 8px\",fontSize:11},onClick:()=>{Sf(),window.location.reload()},children:\"forget key\"})]})]}),m.jsxs(\"main\",{className:\"main\",children:[m.jsxs(\"div\",{className:\"bar\",children:[m.jsx(\"strong\",{children:L===\"chat\"?v??\"\":Mv[L]}),L===\"chat\"?m.jsx(\"span\",{children:D??\"new conversation\"}):null,m.jsx(\"span\",{className:\"spacer\"}),N.length>0?m.jsxs(\"span\",{style:{color:\"var(--warn)\"},children:[N.length,\" waiting on you\"]}):null]}),L!==\"chat\"?m.jsx(\"div\",{className:\"scroll\",children:m.jsxs(\"div\",{className:\"pad\",children:[Y===void 0?null:m.jsx(\"p\",{className:\"row note bad\",children:Y}),m.jsx(Tv,{warnings:G.warnings}),L===\"new\"?At===void 0?m.jsx(\"p\",{className:\"empty\",children:\"reading this server's questions…\"}):m.jsx(Zy,{offer:At,answers:zt,busy:Ia,touched:Wl,...Y===void 0?{}:{error:Y},...cl===void 0?{}:{result:cl},onAnswer:(H,J)=>ul(he=>({...he,[H]:J})),onSubmit:()=>void Si(),onOpen:H=>{sl(void 0),Fl(void 0),Wa(!1),fl({agentId:H,panel:\"chat\"})}}):null,L===\"keys\"?m.jsx(Ny,{client:c.current,baseUrl:i.baseUrl,token:i.token}):null,L===\"tools\"?m.jsx(vv,{tools:G.tools}):null,L===\"schedules\"?m.jsx(bv,{schedules:G.schedules,...re===void 0?{}:{busy:re},onCreate:H=>void nt(String(H.id),J=>J.createSchedule(H).then(()=>{})),onDelete:H=>void nt(H,J=>J.deleteSchedule(H).then(()=>{})),onRun:H=>void nt(H,async J=>{const he=await J.runSchedule(H);return\\`\\${H} fired out of band as \\${he.turnId} — its next scheduled run has not moved.\\`}),onToggle:(H,J)=>void nt(H,he=>he.updateSchedule(H,{enabled:J}).then(()=>{}))}):null,L===\"config\"?G.config===void 0?m.jsx(\"p\",{className:\"empty\",children:\"reading this agent's settings…\"}):m.jsx(pv,{settings:G.config.settings,editable:G.config.editable,...G.config.file===void 0?{}:{file:G.config.file},...re===void 0?{}:{busy:re},...Me===void 0?{}:{note:Me},onSet:al}):null,L===\"channels\"?m.jsx(Av,{channels:G.channels,now:Date.now(),actions:{onConnect:(H,J)=>void W(H,{enabled:J}),onCredential:(H,J)=>void W(H,{credential:J}),onUnpair:H=>void se(H),...Te===void 0?{}:{busy:Te},...b===void 0?{}:{note:b}}}):null]})}):m.jsxs(m.Fragment,{children:[m.jsx(\"div\",{className:\"scroll\",children:m.jsxs(\"div\",{className:\"pad\",children:[Y===void 0?null:m.jsx(\"p\",{className:\"row note bad\",children:Y}),m.jsx(vy,{state:I,onAnswer:(H,J)=>void Ye(H,J)}),m.jsx(Uv,{state:I})]})}),m.jsx(Ey,{value:Ae,busy:I.running,onChange:Z,onSend:()=>void ue(),onStop:()=>void V.current?.()})]})]})]})}function Uv(i){const c=k.useRef(null),r=i.state.rows.length+i.state.live.length;return k.useEffect(()=>{const s=c.current,d=s?.closest(\".scroll\");if(s===null||d===null||d===void 0)return;d.scrollHeight-d.scrollTop-d.clientHeight<40&&s.scrollIntoView({block:\"end\"})},[r]),m.jsx(\"div\",{ref:c})}async function Rv(i,c,r,s){const d=await fetch(\\`\\${i}/v1/agents/\\${r}/sessions/\\${encodeURIComponent(s)}/messages?limit=200\\`,{headers:c===void 0?{}:{authorization:\\`Bearer \\${c}\\`}});return d.ok?[...(await d.json()).messages??[]].reverse().filter(v=>v.origin===void 0&&(v.role===\"user\"||v.role===\"assistant\")&&(v.content??\"\")!==\"\").map((v,A)=>({kind:v.role===\"user\"?\"user\":\"reply\",id:\\`h\\${A}\\`,text:v.content??\"\"})):[]}function qt(i){return i instanceof Zt||i instanceof Error?i.message:String(i)}const T0=document.getElementById(\"root\");if(T0===null)throw new Error(\"no #root in the document\");Fg.createRoot(T0).render(m.jsx(k.StrictMode,{children:m.jsx(xv,{baseUrl:window.location.origin})}));\n`;\n\n// ../web/dist/index.html\nvar dist_default = `<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <!--\n An inline SVG data URI rather than a file, and that is a constraint rather than a\n flourish: the server embeds these assets as *text* (decision 11.200), so a binary\n favicon would be the one thing in the build that could not ride inside the bundle.\n -->\n <link\n rel=\"icon\"\n href=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%230b0b0c'/%3E%3Cpath d='M9 8h7a8 8 0 0 1 0 16H9z' fill='none' stroke='%23e8e6e3' stroke-width='2.5'/%3E%3C/svg%3E\"\n />\n <title>Dispach</title>\n <!--\n No title text beyond the brand. The page sets \\`document.title\\` from the agent it is\n actually talking to once it knows, because a tab saying \"Dispach\" next to three others\n saying \"Dispach\" is a tab nobody can find.\n -->\n <script type=\"module\" crossorigin src=\"./assets/app.js\"></script>\n <link rel=\"stylesheet\" crossorigin href=\"./assets/app.css\">\n </head>\n <body>\n <div id=\"root\"></div>\n </body>\n</html>\n`;\n\n// src/web.ts\nfunction etagOf(body) {\n let hash = 2166136261;\n for (let i = 0;i < body.length; i += 1) {\n hash ^= body.charCodeAt(i);\n hash = Math.imul(hash, 16777619) >>> 0;\n }\n return `\"${hash.toString(36)}-${body.length.toString(36)}\"`;\n}\nfunction asset(body, contentType) {\n return { body, contentType, etag: etagOf(body) };\n}\nvar WEB_ASSETS = {\n \"/\": asset(dist_default, \"text/html; charset=utf-8\"),\n \"/assets/app.js\": asset(app_default2, \"text/javascript; charset=utf-8\"),\n \"/assets/app.css\": asset(app_default, \"text/css; charset=utf-8\")\n};\nvar WEB_PATHS = Object.keys(WEB_ASSETS);\nfunction serveAsset(path, request) {\n const found = WEB_ASSETS[path];\n if (found === undefined)\n return;\n const headers = {\n \"content-type\": found.contentType,\n etag: found.etag,\n \"cache-control\": \"no-cache\"\n };\n if (request.headers.get(\"if-none-match\") === found.etag) {\n return new Response(null, { status: 304, headers });\n }\n return new Response(found.body, { status: 200, headers });\n}\n\n// src/handler.ts\nvar MAX_BODY_BYTES = 1e6;\nvar MAX_SENDER_ID = 256;\nvar MAX_SENDER_NAME = 128;\nvar MAX_IDEMPOTENCY_KEY = 255;\nvar DOCS_PAGE = `<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>Dispach API</title>\n</head>\n<body style=\"margin:0\">\n<noscript style=\"display:block;font:14px/1.5 system-ui;padding:2rem;max-width:40rem\">\n <h1 style=\"font-size:1rem\">This page needs JavaScript and a network</h1>\n <p>It loads the reference viewer from a CDN. The document itself is served locally and needs\n neither: <a href=\"/v1/openapi.json\">/v1/openapi.json</a>.</p>\n</noscript>\n<div id=\"app\"></div>\n<script src=\"https://cdn.jsdelivr.net/npm/@scalar/api-reference\"></script>\n<script>\n Scalar.createApiReference('#app', { url: '/v1/openapi.json', theme: 'default' })\n</script>\n</body>\n</html>\n`;\nfunction createHandler(options) {\n const { runtime } = options;\n const token = options.token;\n const now = options.now ?? (() => Date.now());\n const startedAt = now();\n if (token === undefined && options.allowUnauthenticated !== true) {\n throw new HarnessError({\n code: \"server_token_missing\",\n message: \"createHandler was called with no token and no allowUnauthenticated.\",\n hint: \"Pass token, or pass allowUnauthenticated: true to state that this handler is mounted somewhere already protected. Defaulting to open would make the safe configuration the one you have to remember.\"\n });\n }\n const running = options.running ?? new Map;\n const approvals = options.approvals ?? createApprovalRegistry();\n const provisioningIsLocal = () => options.origin !== undefined && isLoopback(options.origin.host);\n const mayProvision = (who) => provisioningIsLocal() || who.kind !== \"open\" && can(who, \"admin\");\n const refuseOrigin = (request) => {\n if (options.origin === undefined)\n return;\n const problem = originProblem(request, options.origin);\n return problem === undefined ? undefined : fail(problem, 403);\n };\n const withCors = (request, response) => {\n if (options.origin === undefined)\n return response;\n const extra = corsHeaders(request, options.origin);\n if (Object.keys(extra).length === 0)\n return response;\n const headers = new Headers(response.headers);\n for (const [name, value] of Object.entries(extra))\n headers.set(name, value);\n return new Response(response.body, {\n status: response.status,\n statusText: response.statusText,\n headers\n });\n };\n let closed = false;\n const authRequired = async () => {\n if (token !== undefined || closed)\n return true;\n closed = await runtime.store.operatorKeys.liveCount() > 0;\n return closed;\n };\n const resolve = async (request, pathname, capability) => {\n if (isOpenPath(pathname) || !await authRequired())\n return { kind: \"open\" };\n const who = await authorise({\n request,\n expected: token,\n keys: runtime.store.operatorKeys,\n claim: options.claim,\n pathname,\n at: now()\n });\n if (who instanceof Response)\n return who;\n if (who.kind === \"claim\")\n return who;\n if (capability !== \"open\" && !can(who, capability)) {\n return forbidden(capability, `${request.method} ${pathname}`);\n }\n return who;\n };\n const router = new Router;\n router.add(\"GET\", \"/v1/health\", () => json({\n status: \"ok\",\n version: VERSION2,\n uptimeMs: now() - startedAt,\n agents: runtime.list().length\n }), { capability: \"open\" });\n router.add(\"GET\", \"/v1/ready\", () => {\n if (runtime.ready)\n return json({ status: \"ready\", agents: runtime.list().length });\n return json({ status: \"starting\", agents: runtime.list().length }, 503);\n }, { capability: \"open\" });\n router.add(\"GET\", \"/v1/activity\", async (context) => {\n const who = context.principal;\n if (who.kind === \"key\" && who.scope !== undefined && (who.scope.agents !== undefined || who.scope.sessions !== undefined)) {\n return fail({\n code: \"activity_needs_unscoped_key\",\n message: \"Activity covers every agent on this server, and this key is scoped.\",\n hint: \"Call this with the server token or an operator key minted with no agents or sessions scope — it is meant for whatever suspends and wakes the process, not for a tenant.\"\n }, 403);\n }\n return json(await runtime.activity(now()));\n }, { capability: \"admin\" });\n router.add(\"GET\", \"/v1/agents\", async (context) => {\n const hosted = runtime.list().map((agent) => summary(runtime, agent));\n const live = new Set(hosted.map((entry) => entry.id));\n const stopped = (await runtime.store.agentState.list()).filter((state) => !state.enabled && !live.has(state.agentId)).map((state) => ({\n id: state.agentId,\n name: state.agentId,\n status: \"disabled\",\n ...state.reason === undefined ? {} : { reason: state.reason },\n ...state.disabledAt === undefined ? {} : { disabledAt: state.disabledAt }\n }));\n return json(visibleAgents(context.principal, [...hosted, ...stopped]));\n }, { capability: \"read\" });\n router.add(\"GET\", \"/v1/agents/:id\", (context) => withAgent(runtime, context, async (agent) => {\n const schedules = await agent.store.schedules.list(agent.id);\n const team = runtime.team(agent.id);\n return json({\n ...summary(runtime, agent),\n dialect: agent.describe().dialect,\n window: agent.window,\n tools: agent.tools.size,\n catalogueTokens: agent.describe().catalogueTokens,\n skills: agent.skills?.skills.length ?? 0,\n schedules: schedules.length,\n ...team.length === 0 ? {} : {\n team: team.map((member) => ({\n id: member.id,\n task: member.task,\n artifact: Object.keys(member.artifact.properties)\n }))\n },\n warnings: [...agent.warnings, ...agent.tools.warnings]\n });\n }), { capability: \"read\" });\n router.add(\"POST\", \"/v1/agents/:id/reload\", (context) => withAgent(runtime, context, async (agent) => {\n try {\n const admitted = await runtime.replace(agent.id);\n return json({\n id: agent.id,\n status: \"loaded\",\n adopted: admitted.map((entry) => entry.id)\n });\n } catch (error) {\n if (isHarnessError(error)) {\n return fail({\n code: error.code,\n message: error.message,\n hint: error.hint,\n ...error.field === undefined ? {} : { field: error.field }\n }, error.code === \"agent_turn_in_flight\" ? 409 : 400);\n }\n throw error;\n }\n }), { capability: \"admin\" });\n router.add(\"GET\", \"/v1/openapi.json\", (context) => json(openapiDocument({\n routes: router.routes(),\n serverUrl: `${context.url.protocol}//${context.url.host}`\n })), { capability: \"open\" });\n router.add(\"GET\", \"/docs\", () => new Response(DOCS_PAGE, {\n status: 200,\n headers: { \"content-type\": \"text/html; charset=utf-8\" }\n }), { capability: \"open\" });\n router.add(\"GET\", \"/v1/provision\", (context) => json({\n available: options.provision !== undefined,\n local: provisioningIsLocal(),\n allowed: mayProvision(context.principal),\n steps: options.provision?.steps() ?? []\n }), { capability: \"read\" });\n router.add(\"POST\", \"/v1/agents\", async (context) => {\n const provision = options.provision;\n if (provision === undefined) {\n return fail({\n code: \"provisioning_not_supported\",\n message: \"This server cannot create agents.\",\n hint: \"Creating one writes a directory of files from a question set this process was not given — an embedder mounting this handler over its own agent store is the case that lands here. Run `init` where the sandbox is, or mount an agent directory.\"\n }, 501);\n }\n if (!mayProvision(context.principal)) {\n return fail({\n code: \"provisioning_not_local\",\n message: \"Creating an agent needs either a loopback bind or a credential with the admin capability.\",\n hint: \"This route writes files and starts an agent. A token-less loopback server is a supported configuration, so on a non-loopback bind it asks for a credential instead — set server.tokenEnv (the container's DISPACH_API_TOKEN does this) or present an operator key minted with `can: [admin]`. What is refused is provisioning on a server that required no credential at all and is reachable from the network.\"\n }, 403);\n }\n const body = await readJson(context.request);\n if (body.kind === \"error\")\n return fail(body.error, 400);\n const parsed = parseBody(ProvisionBody, body.value);\n if (!parsed.ok)\n return fail(parsed.error, 400);\n const { answers, template } = parsed.value;\n if (answers !== undefined && template !== undefined) {\n return fail({\n code: \"provision_body_ambiguous\",\n message: \"The body has both answers and a template.\",\n hint: \"Send answers to create an agent the way init does, or template with name and vars to create one from a template in this server's sandbox. Not both.\",\n field: \"template\"\n }, 400);\n }\n if (answers === undefined && template === undefined) {\n return fail({\n code: \"provision_answers_required\",\n message: \"The body has neither answers nor a template.\",\n hint: 'Send { \"answers\": { \"name\": \"milo\", … } } (GET /v1/provision lists the steps), or { \"template\": \"…\", \"name\": \"…\", \"vars\": {…} } (GET /v1/templates lists the templates).',\n field: \"answers\"\n }, 400);\n }\n let created;\n try {\n created = template === undefined ? provision.create(answers ?? {}) : provision.createFromTemplate({\n template,\n name: parsed.value.name ?? \"\",\n vars: parsed.value.vars ?? {}\n });\n } catch (error) {\n if (isHarnessError(error))\n return fail(error.toDetail(), 400);\n throw error;\n }\n try {\n const admitted = await runtime.adopt(created.manifestPath);\n return json({\n id: created.agentId,\n dir: created.dir,\n files: created.files,\n adopted: admitted.map((agent) => agent.id)\n }, 201);\n } catch (error) {\n return json({\n id: created.agentId,\n dir: created.dir,\n files: created.files,\n adopted: [],\n error: isHarnessError(error) ? error.toDetail() : {\n code: \"provision_adopt_failed\",\n message: error instanceof Error ? error.message : String(error),\n hint: \"The agent was written and is not running. Fix what the message names and `start` it, or restart the host.\"\n }\n }, 201);\n }\n }, { capability: \"admin\" });\n router.add(\"GET\", \"/v1/templates\", () => json({ templates: options.provision?.templates() ?? [] }), { capability: \"read\" });\n router.add(\"GET\", \"/v1/agents/:id/secrets\", async (context) => {\n const found = secretsTarget(runtime, options, context);\n if (found.kind === \"response\")\n return found.response;\n return json({ id: found.id, secrets: found.admin.status(found.manifestPath) });\n }, { capability: \"admin\" });\n router.add(\"PUT\", \"/v1/agents/:id/secrets\", async (context) => {\n const found = secretsTarget(runtime, options, context);\n if (found.kind === \"response\")\n return found.response;\n const body = await readJson(context.request);\n if (body.kind === \"error\")\n return fail(body.error, 400);\n const parsed = parseBody(SecretsBody, body.value);\n if (!parsed.ok)\n return fail(parsed.error, 400);\n let result;\n try {\n result = found.admin.write(found.manifestPath, parsed.value.values);\n } catch (error) {\n if (isHarnessError(error))\n return fail(error.toDetail(), 400);\n throw error;\n }\n const written = { id: found.id, written: result.written, shadowed: result.shadowed };\n const hosted = runtime.list().some((agent) => agent.id === found.id);\n const state = await runtime.store.agentState.get(found.id);\n if (!hosted && state?.enabled === false) {\n return json({ ...written, applied: \"none\", adopted: [], stopped: true });\n }\n try {\n const admitted = hosted ? await runtime.replace(found.id) : await runtime.adopt(found.manifestPath);\n return json({\n ...written,\n applied: hosted ? \"reloaded\" : \"adopted\",\n adopted: admitted.map((agent) => agent.id)\n });\n } catch (error) {\n return json({\n ...written,\n applied: \"none\",\n adopted: [],\n error: isHarnessError(error) ? error.toDetail() : {\n code: \"secrets_apply_failed\",\n message: error instanceof Error ? error.message : String(error),\n hint: \"The values were written and the agent is not running on them yet. Fix what the message names and reload or start it.\"\n }\n });\n }\n }, { capability: \"admin\" });\n router.add(\"POST\", \"/v1/agents/:id/stop\", async (context) => {\n const id = context.params.id ?? \"\";\n if (!reachesAgent(context.principal, id))\n return notFound(\"agent\", id);\n const hosted = runtime.list().some((agent) => agent.id === id);\n const known = await runtime.store.agentState.get(id);\n if (!hosted && known === undefined)\n return notFound(\"agent\", id);\n const body = await readJson(context.request);\n if (body.kind === \"error\")\n return fail(body.error, 400);\n const parsed = parseBody(StopBody, body.value);\n if (!parsed.ok)\n return fail(parsed.error, 400);\n const reason = parsed.value.reason?.trim();\n const state = await runtime.store.agentState.disable(id, new Date(options.now?.() ?? Date.now()).toISOString(), reason === undefined || reason === \"\" ? undefined : reason);\n if (hosted) {\n try {\n await runtime.dispose(id, \"stopped\");\n } catch (error) {\n if (isHarnessError(error) && error.code === \"agent_turn_in_flight\") {\n return fail(error.toDetail(), 409);\n }\n throw error;\n }\n }\n return json({ id, status: \"disabled\", ...stateFields(state) });\n }, { capability: \"admin\" });\n router.add(\"POST\", \"/v1/agents/:id/start\", async (context) => {\n const id = context.params.id ?? \"\";\n if (!reachesAgent(context.principal, id))\n return notFound(\"agent\", id);\n if (runtime.list().some((agent) => agent.id === id)) {\n const state = await runtime.store.agentState.enable(id);\n return json({ id, status: \"loaded\", ...stateFields(state) });\n }\n const resolve = options.resolveAgent;\n if (resolve === undefined) {\n return fail({\n code: \"start_not_supported\",\n message: \"This server cannot look up a manifest for an agent it is not hosting.\",\n hint: \"Starting a stopped agent needs its manifest, which lives wherever agents live — the sandbox for the CLI, a mounted path for a container. This process was built without that lookup, so pass the agent to `serve` and restart it instead.\"\n }, 501);\n }\n const source = resolve(id);\n if (source === undefined)\n return notFound(\"agent\", id);\n const state = await runtime.store.agentState.enable(id);\n try {\n const admitted = await runtime.adopt(source);\n return json({\n id,\n status: \"loaded\",\n ...stateFields(state),\n adopted: admitted.map((agent) => agent.id)\n });\n } catch (error) {\n await runtime.store.agentState.disable(id, new Date(options.now?.() ?? Date.now()).toISOString(), \"start failed\");\n if (isHarnessError(error))\n return fail(error.toDetail(), 400);\n throw error;\n }\n }, { capability: \"admin\" });\n router.add(\"POST\", \"/v1/agents/:id/messages\", async (context) => withAgent(runtime, context, async (agent) => {\n const body = await readJson(context.request);\n if (body.kind === \"error\")\n return fail(body.error, 400);\n const parsed = parseBody(MessageBody, body.value);\n if (!parsed.ok)\n return fail(parsed.error, 400);\n const input = parsed.value;\n const wantsChunks = input.chunks === true;\n const text = input.text;\n const sessionKey = input.sessionKey ?? \"api:default\";\n const outside = outsideSession(context, sessionKey);\n if (outside !== undefined)\n return outside;\n const deliver = parseDeliver(input.deliver);\n if (deliver.kind === \"error\")\n return fail(deliver.error, 400);\n const from = parseFrom(input.from);\n if (from.kind === \"error\")\n return fail(from.error, 400);\n const idempotency = parseIdempotencyKey(context.request);\n if (idempotency.kind === \"error\")\n return fail(idempotency.error, 400);\n const admission = await agent.admit();\n if (!admission.ok)\n return fail(admission.error.toDetail(), 429);\n const turnId = newTurnId();\n if (idempotency.key !== undefined) {\n const claim = await agent.store.turns.claimInboundKey({\n agentId: agent.id,\n key: idempotency.key,\n turnId,\n inputHash: await inputHash(sessionKey, text),\n now: new Date\n });\n if (claim.kind !== \"claimed\")\n admission.release();\n if (claim.kind === \"replay\") {\n return json({ turnId: claim.turnId, sessionKey, replayed: true }, 200);\n }\n if (claim.kind === \"mismatch\") {\n return fail({\n code: \"idempotency_key_reused\",\n message: `Idempotency-Key \"${idempotency.key}\" was already used for a different message.`,\n hint: `It belongs to turn ${claim.turnId}, whose text or session differed from this request's. Nothing was run. Use a fresh key for a new message, or resend the original text byte for byte to get that turn back. A key is remembered for 24 hours.`,\n field: \"Idempotency-Key\"\n }, 409);\n }\n }\n const controller = new AbortController;\n running.set(turnId, controller);\n runtime.streams.open(turnId, { chunks: wantsChunks });\n const work = agent.send(text, {\n admission,\n sessionKey,\n turnId,\n source: \"api\",\n ...from.from === undefined ? {} : { from: from.from },\n signal: controller.signal\n }).then(async (result) => {\n if (deliver.target === undefined || result.text.trim() === \"\")\n return;\n await runtime.channels.deliver({\n agentId: agent.id,\n sessionKey,\n channelId: deliver.target.channel,\n recipient: deliver.target.to,\n turnId,\n text: result.text\n });\n }).catch(() => {}).finally(() => {\n running.delete(turnId);\n });\n if (input.stream !== true)\n return json({ turnId, sessionKey }, 202);\n return streamTurn(runtime, turnId, {\n accepted: { turnId, sessionKey },\n status: 202,\n chunks: wantsChunks\n });\n }), { capability: \"chat\" });\n router.add(\"GET\", \"/v1/agents/:id/turns/:turnId/stream\", (context) => withAgent(runtime, context, async (agent) => {\n const turnId = context.params.turnId ?? \"\";\n if (runtime.streams.state(turnId) === undefined) {\n const record = await agent.store.turns.get(turnId);\n if (record === undefined)\n return notFound(\"turn\", turnId, \"No turn with this id has ever run on this agent. A turn id is the `turnId` from POST /v1/agents/:id/messages — check the agent in the path too, since a turn belongs to one.\");\n return finishedStream(record);\n }\n return streamTurn(runtime, turnId, {\n chunks: context.url.searchParams.get(\"chunks\") === \"true\"\n });\n }), { capability: \"read\", streaming: true });\n router.add(\"POST\", \"/v1/agents/:id/turns/:turnId/stop\", (context) => withAgent(runtime, context, () => {\n const turnId = context.params.turnId ?? \"\";\n const controller = running.get(turnId);\n if (controller === undefined) {\n return fail({\n code: \"turn_not_running\",\n message: `No cancel handle for turn ${turnId} on this API.`,\n hint: \"This surface can stop a turn it started. A turn that has already finished cannot be stopped at all — read its final state from GET /v1/agents/:id/turns/:turnId. A turn started by a channel, a schedule, or another process is running without a handle here.\"\n }, 409);\n }\n controller.abort();\n return json({ turnId, stopping: true }, 202);\n }), { capability: \"chat\" });\n router.add(\"GET\", \"/v1/agents/:id/approvals\", (context) => withAgent(runtime, context, async (agent) => json({ approvals: approvals.pending(agent.id) })), { capability: \"read\" });\n router.add(\"POST\", \"/v1/agents/:id/approvals/:approvalId\", (context) => withAgent(runtime, context, async () => {\n const body = await readJson(context.request);\n if (body.kind === \"error\")\n return fail(body.error, 400);\n const parsed = parseBody(ApprovalBody, body.value);\n if (!parsed.ok)\n return fail(parsed.error, 400);\n const input = parsed.value;\n const approvalId = context.params.approvalId ?? \"\";\n if (!approvals.resolve(approvalId, input.granted)) {\n return fail({\n code: \"approval_not_found\",\n message: `No approval with id ${approvalId} is waiting.`,\n hint: 'It was answered already, or its turn ended while it waited — a stopped or timed-out turn abandons its question, and `approval.resolved` reports that as `by: \"abandoned\"`. GET /v1/agents/:id/approvals lists what is actually waiting. Nothing about a settled approval is kept, so this is also the answer for an id that was never real.'\n }, 404);\n }\n return json({ approvalId, granted: input.granted });\n }), { capability: \"chat\" });\n router.add(\"GET\", \"/\", (context) => web(\"/\", context), { capability: \"open\" });\n router.add(\"GET\", \"/assets/app.js\", (context) => web(\"/assets/app.js\", context), {\n capability: \"open\"\n });\n router.add(\"GET\", \"/assets/app.css\", (context) => web(\"/assets/app.css\", context), {\n capability: \"open\"\n });\n router.add(\"POST\", \"/v1/keys\", async (context) => {\n const usedClaim = options.claim !== undefined && presentedClaim(context.request) === options.claim.token;\n const body = await readJson(context.request);\n if (body.kind === \"error\")\n return fail(body.error, 400);\n const parsed = parseBody(KeyBody, body.value);\n if (!parsed.ok)\n return fail(parsed.error, 400);\n const input = parsed.value;\n const problem = keyLabelProblem(input.label);\n if (problem !== undefined) {\n return fail({\n code: \"key_label_invalid\",\n message: problem,\n hint: `A label is shown in a listing and in the UI, so it is at most ${MAX_KEY_LABEL} printable characters on one line. It is a display name, not a description.`,\n field: \"label\"\n }, 400);\n }\n if (usedClaim && options.claim?.spend() !== true)\n return claimSpent();\n const scope = input.scope;\n if (scope?.agents !== undefined) {\n const hosted = new Set(runtime.list().map((agent) => agent.id));\n for (const state of await runtime.store.agentState.list())\n hosted.add(state.agentId);\n const unknown = scope.agents.filter((id) => !hosted.has(id));\n if (unknown.length > 0) {\n return fail({\n code: \"key_scope_agent_unknown\",\n message: `No agent ${unknown.map((id) => JSON.stringify(id)).join(\", \")} on this server.`,\n hint: \"A key scoped to an agent that does not exist authenticates and then reaches nothing, which looks exactly like a working credential until it is used. GET /v1/agents lists what this server holds, stopped agents included.\",\n field: \"scope.agents\"\n }, 400);\n }\n }\n const expiresAt = scope?.expiresIn === undefined ? undefined : new Date(now() + scope.expiresIn * 1000).toISOString();\n const stored = scope === undefined ? undefined : {\n ...scope.agents === undefined ? {} : { agents: scope.agents },\n ...scope.sessions === undefined ? {} : { sessions: scope.sessions },\n ...scope.can === undefined ? {} : { can: scope.can }\n };\n const secret = newKeySecret();\n const record = await runtime.store.operatorKeys.issue({\n keyId: newKeyId(now()),\n label: input.label.trim(),\n fingerprint: await keyFingerprint2(secret),\n createdAt: new Date(now()).toISOString(),\n ...stored === undefined || Object.keys(stored).length === 0 ? {} : { scope: stored },\n ...expiresAt === undefined ? {} : { expiresAt }\n });\n return json({ ...record, secret }, 201);\n }, { capability: \"admin\" });\n router.add(\"GET\", \"/v1/keys\", async () => {\n const keys = await runtime.store.operatorKeys.list();\n return json({\n keys,\n scope: \"A key with no scope authenticates every route for every agent this server holds. A scope narrows an already-authenticated caller — it names agents, a session prefix and capabilities, and it is not an identity: there are no users, teams or roles here.\"\n });\n }, { capability: \"admin\" });\n router.add(\"DELETE\", \"/v1/keys/:keyId\", async (context) => {\n const keyId = context.params.keyId ?? \"\";\n const record = await runtime.store.operatorKeys.revoke(keyId, new Date(now()).toISOString());\n if (record === undefined)\n return notFound(\"key\", keyId, \"The id is the `keyId` from POST /v1/keys, not the secret — GET /v1/keys lists them. An already-revoked key is a 200 carrying its original stamp, so this really does mean no such key exists.\");\n return json(record);\n }, { capability: \"admin\" });\n router.add(\"POST\", \"/v1/webhooks\", async (context) => {\n const body = await readJson(context.request);\n if (body.kind === \"error\")\n return fail(body.error, 400);\n const parsed = parseBody(WebhookBody, body.value);\n if (!parsed.ok)\n return fail(parsed.error, 400);\n const input = parsed.value;\n const unknown = input.types.filter((type) => !EVENT_TYPES.includes(type) || !webhookDeliverable(type));\n if (unknown.length > 0) {\n return fail({\n code: \"webhook_type_invalid\",\n message: `Cannot deliver ${unknown.join(\", \")}.`,\n hint: \"Any type from the event stream except model.chunk, which is one request per token. The wire spec's event table lists them.\",\n field: \"types\"\n }, 400);\n }\n const reach = scopeFilter(context.principal);\n if (input.agents !== undefined) {\n const known = new Set([\n ...runtime.list().map((agent) => agent.id),\n ...(await runtime.store.agentState.list()).map((state) => state.agentId)\n ]);\n const outside = input.agents.filter((id) => !reachesAgent(context.principal, id) || !known.has(id));\n if (outside.length > 0) {\n return fail({\n code: \"webhook_scope_invalid\",\n message: `This credential cannot subscribe to ${outside.join(\", \")}.`,\n hint: \"A subscription hears at most what the key creating it reaches, and only agents this server holds. GET /v1/agents lists them.\",\n field: \"agents\"\n }, 400);\n }\n }\n const agents = input.agents ?? reach.agentIds;\n const scope = {\n ...agents === undefined ? {} : { agents: [...agents] },\n ...reach.sessionPrefix === undefined ? {} : { sessionPrefix: reach.sessionPrefix }\n };\n try {\n await runtime.webhooks.check(input.url);\n } catch (error) {\n if (isHarnessError(error))\n return fail(error.toDetail(), 400);\n throw error;\n }\n const secret = newWebhookSecret();\n const created = await runtime.store.webhooks.create({\n subscriptionId: `wh_${crypto.randomUUID().replaceAll(\"-\", \"\").slice(0, 20)}`,\n url: input.url,\n secret,\n types: [...new Set(input.types)],\n ...Object.keys(scope).length === 0 ? {} : { scope },\n createdAt: new Date(options.now?.() ?? Date.now()).toISOString()\n });\n await runtime.webhooks.changed();\n return json({ ...webhookWire(created), secret }, 201);\n }, { capability: \"admin\" });\n router.add(\"GET\", \"/v1/webhooks\", async (context) => {\n const all = await runtime.store.webhooks.list();\n return json({\n webhooks: all.filter((sub) => webhookVisible(context.principal, sub)).map(webhookWire)\n });\n }, { capability: \"admin\" });\n router.add(\"DELETE\", \"/v1/webhooks/:webhookId\", async (context) => {\n const id = context.params.webhookId ?? \"\";\n const found = await runtime.store.webhooks.get(id);\n if (found === undefined || !webhookVisible(context.principal, found)) {\n return fail({\n code: \"webhook_not_found\",\n message: `No webhook with id \"${id}\".`,\n hint: \"GET /v1/webhooks lists the subscriptions this credential can see.\"\n }, 404);\n }\n await runtime.store.webhooks.delete(id);\n await runtime.webhooks.changed();\n return json({ id, deleted: true });\n }, { capability: \"admin\" });\n router.add(\"GET\", \"/v1/usage\", async (context) => {\n const query = usageQuery(context.url);\n if (query.kind === \"error\")\n return fail(query.error, 400);\n const scope = scopeFilter(context.principal);\n return json(await runtime.store.usage.report({ ...query.value, ...scope }));\n }, { capability: \"read\" });\n router.add(\"GET\", \"/v1/agents/:id/usage\", (context) => withAgent(runtime, context, async (agent) => {\n const query = usageQuery(context.url);\n if (query.kind === \"error\")\n return fail(query.error, 400);\n const prefix = scopeFilter(context.principal).sessionPrefix;\n return json({\n id: agent.id,\n ...await runtime.store.usage.report({\n ...query.value,\n agentIds: [agent.id],\n ...prefix === undefined ? {} : { sessionPrefix: prefix }\n })\n });\n }), { capability: \"read\" });\n router.add(\"GET\", \"/v1/agents/:id/turns\", (context) => withAgent(runtime, context, async (agent) => {\n const limit = pageNumber(context.url, \"limit\");\n const before = pageNumber(context.url, \"before\");\n if (limit === null || before === null) {\n return fail({\n code: \"turns_page_invalid\",\n message: \"`limit` and `before` must be positive whole numbers.\",\n hint: \"Pass `before` exactly as the previous page's `nextBefore` returned it, and a `limit` up to 200.\"\n }, 400);\n }\n const prefix = scopeFilter(context.principal).sessionPrefix;\n const page = await runtime.store.turns.listForAgent(agent.id, {\n limit: Math.min(limit ?? 50, 200),\n ...before === undefined ? {} : { before },\n ...prefix === undefined ? {} : { sessionPrefix: prefix }\n });\n return json({ id: agent.id, ...page });\n }), { capability: \"read\" });\n router.add(\"GET\", \"/v1/agents/:id/turns/:turnId\", (context) => withAgent(runtime, context, async (agent) => {\n const record = await agent.store.turns.get(context.params.turnId ?? \"\");\n if (record === undefined)\n return notFound(\"turn\", context.params.turnId ?? \"\");\n return json(record);\n }), { capability: \"read\" });\n router.add(\"GET\", \"/v1/agents/:id/sessions\", (context) => withAgent(runtime, context, async (agent) => json(visibleSessions(context.principal, await agent.store.sessions.list(agent.id)))), { capability: \"read\" });\n router.add(\"GET\", \"/v1/agents/:id/sessions/:key\", (context) => withAgent(runtime, context, async (agent) => {\n const key = context.params.key ?? \"\";\n const outside = outsideSession(context, key);\n if (outside !== undefined)\n return outside;\n const record = await agent.store.sessions.get(agent.id, key);\n if (record === undefined)\n return notFound(\"session\", key);\n return json(record);\n }), { capability: \"read\" });\n router.add(\"GET\", \"/v1/agents/:id/sessions/:key/messages\", (context) => withAgent(runtime, context, async (agent) => {\n const before = context.url.searchParams.get(\"before\");\n const limit = context.url.searchParams.get(\"limit\");\n const outside = outsideSession(context, context.params.key ?? \"\");\n if (outside !== undefined)\n return outside;\n const page = await agent.store.messages.page(agent.id, context.params.key ?? \"\", {\n ...before === null ? {} : { before: Number.parseInt(before, 10) },\n ...limit === null ? {} : { limit: Number.parseInt(limit, 10) }\n });\n return json(page);\n }), { capability: \"read\" });\n router.add(\"DELETE\", \"/v1/agents/:id/sessions/:key\", (context) => withAgent(runtime, context, async (agent) => {\n const outside = outsideSession(context, context.params.key ?? \"\");\n if (outside !== undefined)\n return outside;\n await agent.store.sessions.clear(agent.id, context.params.key ?? \"\");\n return json({ cleared: context.params.key ?? \"\", memoryFilesKept: true });\n }), { capability: \"write\" });\n router.add(\"POST\", \"/v1/agents/:id/sessions/:key/phase\", (context) => withAgent(runtime, context, async (agent) => {\n const body = await readJson(context.request);\n if (body.kind === \"error\")\n return fail(body.error, 400);\n const parsed = parseBody(PhaseBody, body.value);\n if (!parsed.ok)\n return fail(parsed.error, 400);\n const phase = parsed.value.phase;\n if (typeof phase !== \"string\" && phase !== null) {\n return fail({\n code: \"phase_invalid\",\n message: \"phase must be a string, or null to clear it.\",\n hint: 'Send { \"phase\": \"triage\" }. Phase-scoped tool visibility arrives in Phase 7; the column is written now so a session carries the value across a restart.',\n field: \"phase\"\n }, 400);\n }\n const outside = outsideSession(context, context.params.key ?? \"\");\n if (outside !== undefined)\n return outside;\n await agent.store.sessions.setPhase(agent.id, context.params.key ?? \"\", phase === null ? undefined : phase);\n return json({ phase });\n }), { capability: \"write\" });\n router.add(\"GET\", \"/v1/agents/:id/schedules\", (context) => withAgent(runtime, context, async (agent) => {\n const enabled = context.url.searchParams.get(\"enabled\");\n const rows = await agent.store.schedules.list(agent.id, enabled === null ? {} : { enabled: enabled === \"true\" });\n return json({ schedules: rows });\n }), { capability: \"read\" });\n router.add(\"POST\", \"/v1/agents/:id/schedules\", (context) => withAgent(runtime, context, async (agent) => {\n const body = await readJson(context.request);\n if (body.kind === \"error\")\n return fail(body.error, 400);\n return writeSchedule(runtime, agent, body.value, undefined);\n }), { capability: \"write\" });\n router.add(\"GET\", \"/v1/agents/:id/schedules/:sid\", (context) => withAgent(runtime, context, async (agent) => {\n const sid = context.params.sid ?? \"\";\n const row = await agent.store.schedules.get(agent.id, sid);\n return row === undefined ? notFound(\"schedule\", sid) : json(row);\n }), { capability: \"read\" });\n router.add(\"PATCH\", \"/v1/agents/:id/schedules/:sid\", (context) => withAgent(runtime, context, async (agent) => {\n const sid = context.params.sid ?? \"\";\n const existing = await agent.store.schedules.get(agent.id, sid);\n if (existing === undefined)\n return notFound(\"schedule\", sid);\n const owned = manifestOwned(existing);\n if (owned !== undefined)\n return owned;\n const body = await readJson(context.request);\n if (body.kind === \"error\")\n return fail(body.error, 400);\n const patch = body.value === null || typeof body.value !== \"object\" || Array.isArray(body.value) ? {} : body.value;\n const { id: _ignoredId, ...fields } = patch;\n const merged = {\n kind: existing.kind,\n expr: existing.expr,\n task: existing.task,\n deliver: existing.deliverChannel === undefined || existing.deliverTo === undefined ? \"none\" : { channel: existing.deliverChannel, to: existing.deliverTo },\n session: existing.sessionMode,\n enabled: existing.enabled,\n ...existing.timezone === undefined ? {} : { timezone: existing.timezone },\n ...existing.role === undefined ? {} : { role: existing.role },\n ...fields,\n id: existing.id\n };\n return writeSchedule(runtime, agent, merged, existing);\n }), { capability: \"write\" });\n router.add(\"DELETE\", \"/v1/agents/:id/schedules/:sid\", (context) => withAgent(runtime, context, async (agent) => {\n const sid = context.params.sid ?? \"\";\n const existing = await agent.store.schedules.get(agent.id, sid);\n if (existing === undefined)\n return notFound(\"schedule\", sid);\n const owned = manifestOwned(existing);\n if (owned !== undefined)\n return owned;\n const removed = await agent.store.schedules.remove(agent.id, sid);\n if (!removed)\n return notFound(\"schedule\", sid);\n runtime.scheduler.changed();\n return json({ removed: sid });\n }), { capability: \"write\" });\n router.add(\"POST\", \"/v1/agents/:id/schedules/:sid/run\", (context) => withAgent(runtime, context, async (agent) => {\n const sid = context.params.sid ?? \"\";\n const row = await agent.store.schedules.get(agent.id, sid);\n if (row === undefined)\n return notFound(\"schedule\", sid);\n const admission = await agent.admit();\n if (!admission.ok)\n return fail(admission.error.toDetail(), 429);\n const runId = newRunId();\n const sessionKey = scheduleSessionKey(row.sessionMode, row.id, runId);\n const turnId = newTurnId();\n runtime.streams.open(turnId);\n agent.send(row.task, {\n admission,\n sessionKey,\n turnId,\n source: `schedule:${row.id}:manual`,\n ...row.role === undefined ? {} : { role: row.role }\n }).catch(() => {});\n return json({ scheduleId: row.id, turnId, sessionKey, outOfBand: true }, 202);\n }), { capability: \"write\" });\n router.add(\"GET\", \"/v1/agents/:id/config\", (context) => withAgent(runtime, context, async (agent) => {\n const source = runtime.sourceOf(agent.id);\n const file = typeof source === \"string\" ? source : undefined;\n const text = file === undefined ? undefined : await readFile(file, \"utf8\");\n return json({\n ...file === undefined ? { editable: false } : { editable: true, file },\n settings: SETTINGS.filter((setting) => PERSON_SETTABLE_PATHS.includes(setting.path)).map((setting) => ({\n path: setting.path,\n means: setting.means,\n ...setting.confirm === undefined ? {} : { confirm: setting.confirm },\n ...text === undefined ? {} : { value: manifestValueAt(text, setting.path.split(\".\")) }\n }))\n });\n }), { capability: \"admin\" });\n router.add(\"PATCH\", \"/v1/agents/:id/config\", (context) => withAgent(runtime, context, async (agent) => {\n const body = await readJson(context.request);\n if (body.kind === \"error\")\n return fail(body.error, 400);\n const parsed = parseBody(ConfigBody, body.value);\n if (!parsed.ok)\n return fail(parsed.error, 400);\n const source = runtime.sourceOf(agent.id);\n if (typeof source !== \"string\") {\n return fail({\n code: \"config_not_editable\",\n message: `\"${agent.id}\" was loaded from an object, not from a file, so it has no manifest to change.`,\n hint: \"An embedder holding new settings passes the new object to dispose() and adopt(). This route edits a manifest on disk.\"\n }, 409);\n }\n const setting = settingByPath(parsed.value.path);\n if (setting === undefined || !PERSON_SETTABLE_PATHS.includes(setting.path)) {\n return fail({\n code: \"config_path_unknown\",\n message: setting?.via === undefined ? `\"${parsed.value.path}\" is not a field this surface sets.` : `\"${parsed.value.path}\" is set by \\`${setting.via}\\`, not by a dotted path.`,\n hint: setting?.via === undefined ? `GET /v1/agents/:id/config lists every one. Nearest: ${nearest2(parsed.value.path, PERSON_SETTABLE_PATHS) ?? PERSON_SETTABLE_PATHS.join(\", \")}.` : \"It is a key inside a list entry, and the source editor matches a key at an indent — it cannot index a sequence. That action also validates the handle against the service that issues it.\",\n field: \"path\"\n }, 400);\n }\n if (setting.confirm !== undefined && parsed.value.confirm !== true) {\n return fail({\n code: \"config_confirm_required\",\n message: setting.confirm,\n hint: 'Send { \"confirm\": true } beside the value to make this change anyway. Nothing has been written.',\n field: \"confirm\"\n }, 409);\n }\n let result;\n try {\n result = await editManifest({\n file: source,\n path: setting.path.split(\".\"),\n value: parseSettingValue(parsed.value.value)\n });\n } catch (error) {\n if (isHarnessError(error))\n return fail(error.toDetail(), 400);\n throw error;\n }\n let applied;\n try {\n await runtime.replace(agent.id);\n } catch (error) {\n if (!isHarnessError(error))\n throw error;\n applied = error.toDetail();\n }\n return json({\n path: setting.path,\n before: result.before,\n after: result.after,\n reflowed: result.reflowed,\n ...applied === undefined ? { applied: true } : { applied: false, pending: applied }\n });\n }), { capability: \"admin\" });\n router.add(\"PATCH\", \"/v1/agents/:id/channels/:channelId\", (context) => withAgent(runtime, context, async (agent) => {\n const admin = options.channels;\n if (admin === undefined) {\n return fail({\n code: \"channels_not_supported\",\n message: \"This server cannot change a channel.\",\n hint: \"The host did not supply the channel actions — a library caller embedding this handler has to pass them. `dispach serve` does.\"\n }, 501);\n }\n const source = runtime.sourceOf(agent.id);\n if (typeof source !== \"string\") {\n return fail({\n code: \"config_not_editable\",\n message: `Agent \"${agent.id}\" was loaded from an object, so it has no manifest to edit.`,\n hint: \"Only an agent loaded from a file can be changed here.\"\n }, 409);\n }\n const body = await readJson(context.request);\n if (body.kind === \"error\")\n return fail(body.error, 400);\n const parsed = parseBody(ChannelPatchBody, body.value);\n if (!parsed.ok)\n return fail(parsed.error, 400);\n const { enabled, credential } = parsed.value;\n if (enabled === undefined && credential === undefined) {\n return fail({\n code: \"channel_patch_empty\",\n message: \"Nothing to change.\",\n hint: 'Send { \"enabled\": true | false } to connect or disconnect it, { \"credential\": \"…\" } to set its token, or both.'\n }, 400);\n }\n const channelId = context.params.channelId ?? \"\";\n const notes = [];\n try {\n if (credential !== undefined) {\n notes.push(admin.setCredential(source, channelId, credential).note);\n }\n if (enabled !== undefined) {\n notes.push((await admin.setEnabled(source, channelId, enabled)).note);\n }\n } catch (error) {\n if (!isHarnessError(error))\n throw error;\n return fail(error.toDetail(), 400);\n }\n let applied;\n try {\n await runtime.replace(agent.id);\n } catch (error) {\n if (!isHarnessError(error))\n throw error;\n applied = error.toDetail();\n }\n return json({\n channelId,\n notes,\n ...applied === undefined ? { applied: true } : { applied: false, pending: applied }\n });\n }), { capability: \"admin\" });\n router.add(\"POST\", \"/v1/agents/:id/channels/:channelId/unpair\", (context) => withAgent(runtime, context, async (agent) => {\n const channelId = context.params.channelId ?? \"\";\n const live = await runtime.channels.reset(agent.id, channelId);\n if (live === \"reset\") {\n return json({\n channelId,\n note: \"Pairing forgotten. The channel offers a new code to scan; the old device may still be listed on the phone, which is the only place it can be removed.\",\n restarted: false\n });\n }\n const admin = options.channels;\n const source = runtime.sourceOf(agent.id);\n if (admin === undefined || typeof source !== \"string\") {\n return fail({\n code: live === \"unsupported\" ? \"channel_has_no_pairing\" : \"channel_unknown\",\n message: live === \"unsupported\" ? `Channel \"${channelId}\" stores no pairing.` : `Agent \"${agent.id}\" has no channel \"${channelId}\" registered.`,\n hint: \"Only a channel linked by scanning a code has one to forget. A credential somebody typed is changed with PATCH on this channel, and a channel is switched off with { enabled: false }.\",\n field: \"channelId\"\n }, live === \"unsupported\" ? 409 : 404);\n }\n try {\n return json({ channelId, ...admin.unpair(source, channelId), restarted: false });\n } catch (error) {\n if (!isHarnessError(error))\n throw error;\n return fail(error.toDetail(), error.code === \"channel_unknown\" ? 404 : 409);\n }\n }), { capability: \"admin\" });\n router.add(\"GET\", \"/v1/agents/:id/tools\", (context) => withAgent(runtime, context, (agent) => {\n const phases = agent.manifest.phases;\n const phased = isPhased(phases);\n return json(agent.tools.specs().map((spec) => ({\n slug: spec.slug,\n summary: spec.summary,\n mutating: spec.mutating,\n trust: spec.trust,\n ...spec.trustReason === undefined ? {} : { trustReason: spec.trustReason },\n provider: spec.provider ?? \"local\",\n tags: spec.tags,\n ...phased ? { phases: phasesFor(phases, spec) } : {}\n })));\n }), { capability: \"read\" });\n router.add(\"GET\", \"/v1/agents/:id/skills\", (context) => withAgent(runtime, context, (agent) => {\n const catalogue = agent.skills;\n if (catalogue === undefined)\n return json({ skills: [], configured: false });\n return json({\n configured: true,\n maxActive: catalogue.maxActive,\n threshold: catalogue.threshold,\n cached: catalogue.cached,\n skills: catalogue.skills.map((skill) => ({\n name: skill.name,\n description: skill.frontmatter.description,\n tokens: skill.tokens,\n ...skill.frontmatter.whenNotToUse === undefined ? {} : { whenNotToUse: skill.frontmatter.whenNotToUse },\n scripts: skill.scripts.map((plan) => plan.slug)\n }))\n });\n }), { capability: \"read\" });\n router.add(\"GET\", \"/v1/agents/:id/context\", (context) => withAgent(runtime, context, async (agent) => {\n const sessionKey = context.url.searchParams.get(\"sessionKey\");\n const input = context.url.searchParams.get(\"input\");\n return json(await agent.previewContext({\n ...sessionKey === null ? {} : { sessionKey },\n ...input === null ? {} : { input }\n }));\n }), { capability: \"read\" });\n router.add(\"POST\", \"/v1/channels/:channelId/webhook/:agentId\", async (context) => {\n const body = await readJson(context.request);\n if (body.kind === \"error\")\n return fail(body.error, 400);\n const headers = {};\n context.request.headers.forEach((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n const outcome = await runtime.channels.handleWebhook(context.params.agentId ?? \"\", context.params.channelId ?? \"\", { body: body.value, headers });\n return new Response(outcome.detail ?? \"\", {\n status: outcome.status,\n headers: { \"content-type\": \"text/plain; charset=utf-8\" }\n });\n }, { capability: \"open\" });\n router.add(\"GET\", \"/v1/events\", (context) => {\n const agentId = context.url.searchParams.get(\"agentId\");\n if (agentId !== null && !reachesAgent(context.principal, agentId)) {\n return notFound(\"agent\", agentId);\n }\n const types = context.url.searchParams.get(\"types\")?.split(\",\").filter(Boolean);\n const asked = context.url.searchParams.get(\"chunks\") === \"true\";\n const implied = types?.includes(\"model.chunk\") === true;\n const chunks = asked || implied;\n const unknown = types?.filter((type) => !EVENT_TYPES.includes(type));\n if (unknown !== undefined && unknown.length > 0) {\n const suggestion = nearest2(unknown[0] ?? \"\", EVENT_TYPES);\n return fail({\n code: \"unknown_event_type\",\n message: `No such event type: ${unknown.join(\", \")}.`,\n hint: suggestion === undefined ? \"The full catalogue is the event table in docs/04-SPEC-WIRE.md. Omit ?types= to receive every event.\" : `Did you mean \"${suggestion}\"? The full catalogue is the event table in docs/04-SPEC-WIRE.md.`,\n field: \"types\"\n }, 400);\n }\n return sseResponse({\n ...context.request.signal === undefined ? {} : { signal: context.request.signal },\n start: ({ send }) => {\n send({\n event: \"stream.subscribed\",\n data: {\n agentId: agentId ?? null,\n types: types ?? null,\n chunks,\n ...chunks && !asked ? { implied: \"types names model.chunk\" } : {}\n }\n });\n return runtime.bus.on(\"*\", (event) => {\n if (agentId !== null && event.agentId !== agentId)\n return;\n if (event.agentId !== undefined && !reachesAgent(context.principal, event.agentId))\n return;\n if (event.sessionKey !== undefined && !reachesSession(context.principal, event.sessionKey))\n return;\n if (types !== undefined && types.length > 0 && !types.includes(event.type))\n return;\n send({ event: event.type, data: event });\n }, { chunks });\n }\n });\n }, { capability: \"read\", streaming: true });\n const dispatch = async (request) => {\n let url;\n try {\n url = new URL(request.url);\n } catch {\n return fail({\n code: \"bad_request_url\",\n message: \"The request URL could not be parsed.\",\n hint: \"This usually means the server was handed a relative URL. A handler mounted inside another framework needs an absolute request.url.\"\n }, 400);\n }\n const method = request.method.toUpperCase();\n if (method === \"OPTIONS\") {\n const paths = router.match(\"OPTIONS\", url.pathname);\n if (paths.kind === \"method\") {\n const head = router.match(\"HEAD\", url.pathname);\n const streams = head.kind === \"method\" && streamingAt(router, url.pathname);\n const allow = [\n ...paths.allowed,\n ...paths.allowed.includes(\"GET\") && !streams ? [\"HEAD\"] : [],\n \"OPTIONS\"\n ];\n return withCors(request, new Response(null, {\n status: 204,\n headers: {\n allow: allow.join(\", \"),\n ...options.origin === undefined ? {} : preflightHeaders(request, allow)\n }\n }));\n }\n }\n if (method === \"HEAD\") {\n const get = router.match(\"GET\", url.pathname);\n if (get.kind === \"found\") {\n if (get.streaming) {\n return fail({\n code: \"method_not_allowed\",\n message: `HEAD is not allowed on ${url.pathname}.`,\n hint: \"This path answers with an open event stream. A HEAD would have to start one and then throw the body away, leaving a subscription nothing ever closes — so it is refused rather than leaked. Use GET, or GET /v1/health to check the server is up.\"\n }, 405, { allow: \"GET, OPTIONS\" });\n }\n const crossOrigin = refuseOrigin(request);\n if (crossOrigin !== undefined)\n return crossOrigin;\n const who = await resolve(request, url.pathname, get.capability);\n if (who instanceof Response)\n return who;\n const response = await runHandler(get.handler, {\n request,\n url,\n params: get.params,\n principal: who\n });\n return withCors(request, new Response(null, { status: response.status, headers: response.headers }));\n }\n }\n const match = router.match(method, url.pathname);\n if (match.kind === \"method\") {\n return fail({\n code: \"method_not_allowed\",\n message: `${method} is not allowed on ${url.pathname}.`,\n hint: `This path accepts ${match.allowed.join(\", \")}.`\n }, 405, { allow: match.allowed.join(\", \") });\n }\n if (match.kind === \"none\") {\n return fail({\n code: \"not_found\",\n message: `No route for ${request.method} ${url.pathname}.`,\n hint: \"Every path is under /v1. See docs/04-SPEC-WIRE.md for the surface.\"\n }, 404);\n }\n const crossOrigin = refuseOrigin(request);\n if (crossOrigin !== undefined)\n return crossOrigin;\n const who = await resolve(request, url.pathname, match.capability);\n if (who instanceof Response)\n return who;\n return withCors(request, await runHandler(match.handler, {\n request,\n url,\n params: match.params,\n principal: who\n }));\n };\n return Object.assign(dispatch, {\n authenticate: (request) => resolve(request, \"/v1/ws\", \"read\")\n });\n}\nfunction manifestOwned(existing) {\n if (existing.origin !== \"manifest\")\n return;\n return fail({\n code: \"schedule_manifest_owned\",\n message: `Schedule \"${existing.id}\" is declared in this agent's manifest, so the manifest decides it.`,\n hint: \"Writing it here would last until the next start — reconciliation restores every field from the file, enabled included. Change the `schedules:` entry instead, with PATCH /v1/agents/:id/config, or create a separate schedule through this route.\"\n }, 409);\n}\nasync function writeSchedule(runtime, agent, body, existing) {\n if (body === null || typeof body !== \"object\" || Array.isArray(body)) {\n return fail({\n code: \"schedule_invalid\",\n message: \"A schedule must be a JSON object.\",\n hint: \"Send { id, kind, expr, task, deliver } — see docs/02-SPEC-MANIFEST.md.\"\n }, 400);\n }\n try {\n const row = prepareScheduleWrite({\n agentId: agent.id,\n body,\n channelIds: agent.manifest.channels.map((channel) => channel.id),\n roleNames: Object.keys(agent.manifest.model),\n now: Date.now(),\n origin: \"api\",\n ...existing === undefined ? {} : { existing }\n });\n const saved = await agent.store.schedules.upsert(row);\n runtime.scheduler.changed();\n return json(saved, existing === undefined ? 201 : 200);\n } catch (error) {\n const detail = isHarnessError(error) ? error.toDetail() : {\n code: \"schedule_invalid\",\n message: error instanceof Error ? error.message : String(error),\n hint: \"See docs/02-SPEC-MANIFEST.md for the schedule fields.\"\n };\n return fail(detail, 400);\n }\n}\nfunction web(path, context) {\n const response = serveAsset(path, context.request);\n if (response === undefined)\n throw new HarnessError({\n code: \"web_asset_missing\",\n message: `No web asset for ${path}.`,\n hint: \"The routes in handler.ts and the table in web.ts have diverged, which spec.test.ts asserts cannot happen — so this build is inconsistent. Rebuild with `bun run build`.\"\n });\n return response;\n}\nfunction json(body, status = 200) {\n return new Response(JSON.stringify(body), {\n status,\n headers: { \"content-type\": \"application/json; charset=utf-8\" }\n });\n}\nfunction isOpenPath(pathname) {\n return pathname === \"/v1/health\" || pathname === \"/v1/ready\" || pathname.startsWith(\"/v1/channels/\") || WEB_PATHS.includes(pathname) || pathname === \"/docs\" || pathname === \"/v1/openapi.json\";\n}\nfunction streamingAt(router, pathname) {\n const get = router.match(\"GET\", pathname);\n return get.kind === \"found\" && get.streaming;\n}\nasync function runHandler(handler, context) {\n try {\n return await handler(context);\n } catch (error) {\n if (isHarnessError(error))\n return fail(error.toDetail(), 400);\n return fail({\n code: \"internal_error\",\n message: error instanceof Error ? error.message : String(error),\n hint: \"An unexpected failure in the server. The runtime's event stream carries what happened around it.\"\n }, 500);\n }\n}\nfunction notFound(kind, id, hint) {\n return fail({\n code: `${kind}_not_found`,\n message: `No ${kind} \"${id}\".`,\n hint: hint ?? `Check the id — it is case-sensitive, and a session key includes its channel segment.`\n }, 404);\n}\nfunction presentedClaim(request) {\n const header = request.headers.get(\"authorization\") ?? \"\";\n if (!header.startsWith(\"Bearer \"))\n return;\n const value = header.slice(7);\n return value === \"\" ? undefined : value;\n}\nfunction secretsTarget(runtime, options, context) {\n const id = context.params.id ?? \"\";\n if (!reachesAgent(context.principal, id)) {\n return { kind: \"response\", response: notFound(\"agent\", id) };\n }\n const admin = options.secrets;\n if (admin === undefined) {\n return {\n kind: \"response\",\n response: fail({\n code: \"secrets_not_supported\",\n message: \"This server cannot write an agent's credentials.\",\n hint: \"Credentials go into the .env beside an agent's manifest, and this process was built without a writer for it. Set them where the agent lives, with `config env`, and reload it.\"\n }, 501)\n };\n }\n const source = runtime.sourceOf(id);\n const manifestPath = typeof source === \"string\" ? source : options.resolveAgent?.(id);\n if (manifestPath === undefined)\n return { kind: \"response\", response: notFound(\"agent\", id) };\n return { kind: \"found\", id, manifestPath, admin };\n}\nfunction webhookWire(sub) {\n return { ...sub, failing: sub.consecutiveFailures > 0 };\n}\nfunction webhookVisible(principal, sub) {\n const reach = scopeFilter(principal);\n if (reach.agentIds !== undefined) {\n const agents = sub.scope?.agents;\n if (agents === undefined || !agents.every((id) => reach.agentIds?.includes(id)))\n return false;\n }\n if (reach.sessionPrefix !== undefined) {\n const prefix = sub.scope?.sessionPrefix;\n if (prefix === undefined || !prefix.startsWith(reach.sessionPrefix))\n return false;\n }\n return true;\n}\nfunction pageNumber(url, name) {\n const raw = url.searchParams.get(name);\n if (raw === null)\n return;\n const value = Number(raw);\n return Number.isSafeInteger(value) && value > 0 ? value : null;\n}\nfunction usageQuery(url) {\n const rawBy = url.searchParams.get(\"by\");\n const by = rawBy === null ? [\"agent\", \"model\"] : rawBy.split(\",\").filter((part) => part !== \"\");\n const unknown = by.filter((part) => !USAGE_GROUPS.includes(part));\n if (unknown.length > 0) {\n return {\n kind: \"error\",\n error: {\n code: \"usage_group_invalid\",\n message: `Cannot group usage by ${unknown.join(\", \")}.`,\n hint: `Group by any of ${USAGE_GROUPS.join(\", \")}, comma-separated, or pass by= for one total.`,\n field: \"by\"\n }\n };\n }\n const range = {};\n for (const name of [\"from\", \"to\"]) {\n const raw = url.searchParams.get(name);\n if (raw === null)\n continue;\n const time = Date.parse(raw);\n if (Number.isNaN(time)) {\n return {\n kind: \"error\",\n error: {\n code: \"usage_range_invalid\",\n message: `${name} is ${JSON.stringify(raw)}, which is not a date.`,\n hint: \"Send ISO-8601, like 2026-09-01 or 2026-09-01T00:00:00Z. `from` is inclusive and `to` exclusive, so a month is from=2026-09-01&to=2026-10-01.\",\n field: name\n }\n };\n }\n range[name] = new Date(time).toISOString();\n }\n return { kind: \"ok\", value: { by, ...range } };\n}\nfunction withAgent(runtime, context, work) {\n const id = context.params.id ?? \"\";\n const agent = runtime.list().find((candidate) => candidate.id === id);\n if (agent === undefined)\n return notFound(\"agent\", id);\n if (!reachesAgent(context.principal, id))\n return notFound(\"agent\", id);\n return work(agent);\n}\nfunction visibleAgents(principal, agents) {\n if (!isScoped(principal))\n return agents;\n return agents.filter((agent) => reachesAgent(principal, agent.id));\n}\nfunction visibleSessions(principal, sessions) {\n if (!isScoped(principal))\n return sessions;\n return sessions.filter((session) => reachesSession(principal, session.sessionKey));\n}\nfunction outsideSession(context, sessionKey) {\n return reachesSession(context.principal, sessionKey) ? undefined : notFound(\"session\", sessionKey);\n}\nfunction summary(runtime, agent) {\n const phases = agent.manifest.phases;\n const phased = isPhased(phases);\n return {\n id: agent.id,\n name: agent.manifest.name ?? agent.id,\n status: \"loaded\",\n model: agent.manifest.model.main.id,\n channels: agent.manifest.channels.map((channel) => {\n const running = runtime.channels.statusOf(agent.id).find((entry) => entry.id === channel.id);\n const variable = typeof channel.tokenEnv === \"string\" ? channel.tokenEnv : undefined;\n return {\n ...running ?? {},\n id: channel.id,\n type: channel.type,\n enabled: channel.enabled,\n ...variable === undefined ? {} : {\n credentialEnv: variable,\n credentialSet: agent.hasEnv(variable)\n }\n };\n }),\n entryPhase: phased ? entryPhase(phases) ?? null : null,\n ...phased ? { phases: Object.keys(phases) } : {}\n };\n}\nfunction stateFields(state) {\n return {\n ...state.disabledAt === undefined ? {} : { disabledAt: state.disabledAt },\n ...state.reason === undefined ? {} : { reason: state.reason }\n };\n}\nasync function readJson(request) {\n const declared = Number.parseInt(request.headers.get(\"content-length\") ?? \"0\", 10);\n if (Number.isFinite(declared) && declared > MAX_BODY_BYTES) {\n return {\n kind: \"error\",\n error: {\n code: \"body_too_large\",\n message: `The request body declares ${declared} bytes; the limit is ${MAX_BODY_BYTES}.`,\n hint: \"This cap is enforced before a channel plugin sees anything, so a plugin never has to defend against a large POST.\"\n }\n };\n }\n const raw = await request.text();\n if (raw.length > MAX_BODY_BYTES) {\n return {\n kind: \"error\",\n error: {\n code: \"body_too_large\",\n message: `The request body is ${raw.length} bytes; the limit is ${MAX_BODY_BYTES}.`,\n hint: \"Send less. A message longer than this is not a message.\"\n }\n };\n }\n if (raw === \"\")\n return { kind: \"ok\", value: {} };\n try {\n return { kind: \"ok\", value: JSON.parse(raw) };\n } catch (cause) {\n return {\n kind: \"error\",\n error: {\n code: \"body_not_json\",\n message: `The request body is not valid JSON: ${cause instanceof Error ? cause.message : String(cause)}`,\n hint: \"Send application/json. A shell quoting mistake is the usual cause — check for unescaped quotes inside the payload.\"\n }\n };\n }\n}\nfunction parseFrom(value) {\n if (value === undefined || value === null)\n return { kind: \"ok\", from: undefined };\n const invalid = (message, hint, field = \"from\") => ({\n kind: \"error\",\n error: { code: \"sender_invalid\", message, hint, field }\n });\n if (typeof value !== \"object\") {\n return invalid(\"from must be an object.\", 'Send { \"from\": { \"id\": \"agent:ops-bot\", \"kind\": \"agent\" } }, or omit it entirely for a turn the token-holder is sending itself.');\n }\n const raw = value;\n if (typeof raw.id !== \"string\" || raw.id.trim() === \"\") {\n return invalid(\"from.id is required and must be a non-empty string.\", \"Use a stable identity in your own namespace — `agent:ops-bot`, `user:018f…`, an email address. It is opaque to this runtime and is recorded on the turn so an audit can answer who asked.\", \"from.id\");\n }\n if (raw.id.length > MAX_SENDER_ID) {\n return invalid(`from.id is ${raw.id.length} characters, over the ${MAX_SENDER_ID} limit.`, \"A sender id is an identifier, not a payload. It is rendered into the prompt's fence label, so an unbounded one spends the context window the message needs.\", \"from.id\");\n }\n if (typeof raw.kind !== \"string\" || !SENDER_KINDS2.includes(raw.kind)) {\n const suggestion = typeof raw.kind === \"string\" ? nearest2(raw.kind, SENDER_KINDS2) : undefined;\n return invalid(`from.kind must be one of: ${SENDER_KINDS2.join(\", \")}.`, `${suggestion === undefined ? \"\" : `Did you mean \"${suggestion}\"? `}This field decides the trust boundary — \"agent\" fences the message and blocks mutating tools for the turn, \"user\" does not — so there is no default and an unknown value is refused rather than guessed at. A turn the token-holder is sending itself omits \"from\".`, \"from.kind\");\n }\n if (raw.name !== undefined && typeof raw.name !== \"string\") {\n return invalid(\"from.name must be a string when present.\", \"It is a display name only and is rendered inside the fence, never above it. Omit it if you have none.\", \"from.name\");\n }\n return {\n kind: \"ok\",\n from: {\n id: raw.id,\n kind: raw.kind,\n ...raw.name === undefined ? {} : { name: raw.name.slice(0, MAX_SENDER_NAME) }\n }\n };\n}\nfunction parseIdempotencyKey(request) {\n const raw = request.headers.get(\"idempotency-key\");\n if (raw === null)\n return { kind: \"ok\", key: undefined };\n const key = raw.trim();\n const bad = (message) => ({\n kind: \"error\",\n error: {\n code: \"idempotency_key_invalid\",\n message,\n hint: `Send 1-${MAX_IDEMPOTENCY_KEY} printable ASCII characters that are unique per logical request — a UUID is the usual choice. Omit the header entirely to accept that a retry runs the turn again. Printable ASCII because the key is a database key, and node:sqlite truncates a bound string at a NUL byte where bun:sqlite stores it whole.`,\n field: \"Idempotency-Key\"\n }\n });\n if (key === \"\")\n return bad(\"Idempotency-Key is present but empty.\");\n if (key.length > MAX_IDEMPOTENCY_KEY) {\n return bad(`Idempotency-Key is ${key.length} characters, over the ${MAX_IDEMPOTENCY_KEY} limit.`);\n }\n if (!/^[\\x20-\\x7e]+$/.test(key)) {\n return bad(\"Idempotency-Key contains characters that are not printable ASCII.\");\n }\n return { kind: \"ok\", key };\n}\nasync function inputHash(sessionKey, text) {\n const bytes = new TextEncoder().encode(`${sessionKey}\\x00${text}`);\n const digest = await crypto.subtle.digest(\"SHA-256\", bytes);\n return Array.from(new Uint8Array(digest)).map((b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n}\nfunction parseDeliver(value) {\n if (value === undefined || value === null || value === \"none\") {\n return { kind: \"ok\", target: undefined };\n }\n if (typeof value === \"object\") {\n const target = value;\n if (typeof target.channel === \"string\" && typeof target.to === \"string\") {\n return { kind: \"ok\", target: { channel: target.channel, to: target.to } };\n }\n }\n return {\n kind: \"error\",\n error: {\n code: \"deliver_invalid\",\n message: 'deliver must be \"none\" or { channel, to }.',\n hint: 'A bare channel id is not enough on an API turn: the request has no originating conversation, so there is no recipient to infer. Send { \"channel\": \"tg\", \"to\": \"12345\" }, or \"none\" to read the reply from the event stream.',\n field: \"deliver\"\n }\n };\n}\nfunction finishedStream(record) {\n const running = record.status === \"running\";\n return sseResponse({\n start: ({ send, close }) => {\n send({\n event: running ? \"stream.unavailable\" : \"stream.ended\",\n data: {\n turnId: record.turnId,\n status: record.status,\n sessionKey: record.sessionKey,\n ...running ? {\n reason: \"no buffer for this turn in this process\",\n hint: \"The turn is recorded as running but is not observable here — its events are buffered in whichever process is executing it, and buffers are in-memory and per-process. Poll GET /v1/agents/:id/turns/:turnId for the outcome.\"\n } : {\n steps: record.steps,\n ...record.errorCode === undefined ? {} : { errorCode: record.errorCode },\n hint: \"This turn finished before you attached and its buffer has been evicted. Its full text is in GET /v1/agents/:id/turns/:turnId.\"\n }\n }\n });\n close();\n return;\n }\n });\n}\nfunction streamTurn(runtime, turnId, extra) {\n return sseResponse({\n ...extra?.status === undefined ? {} : { status: extra.status },\n start: ({ send, close }) => {\n if (extra?.accepted !== undefined)\n send({ event: \"turn.accepted\", data: extra.accepted });\n const attachment = runtime.streams.attach(turnId, (event) => {\n send({ event: event.type, data: event });\n if (event.type === \"turn.end\")\n close();\n }, { chunks: extra?.chunks === true });\n if (attachment === undefined) {\n send({\n event: \"stream.unavailable\",\n data: {\n turnId,\n reason: \"no buffer for this turn in this process\",\n hint: \"Read the final state from GET /v1/agents/:id/turns/:turnId. Buffers are in-memory and are evicted after a turn ends.\"\n }\n });\n close();\n return;\n }\n send({\n event: \"stream.replay\",\n data: {\n turnId,\n state: attachment.state,\n events: attachment.replay.length,\n truncated: attachment.truncated,\n dropped: attachment.dropped,\n chunks: attachment.chunks,\n ...attachment.truncated ? {\n hint: `The oldest ${attachment.dropped} event(s) of this turn were discarded to stay under the buffer cap, so this replay starts mid-turn. The turn's final text is complete in GET /v1/agents/:id/turns/:turnId.`\n } : {}\n }\n });\n for (const event of attachment.replay) {\n send({ event: event.type, data: event });\n }\n if (attachment.state === \"ended\")\n close();\n return () => attachment.unsubscribe();\n }\n });\n}\n// src/keys.ts\nimport { newKeySecret as newKeySecret2 } from \"@dispach/core\";\nfunction createClaimTicket() {\n const token = newKeySecret2();\n let spent = false;\n return {\n token,\n live: () => !spent,\n spend: () => {\n if (spent)\n return false;\n spent = true;\n return true;\n }\n };\n}\nfunction browsableHost(host) {\n const bare = host.startsWith(\"[\") && host.endsWith(\"]\") ? host.slice(1, -1) : host;\n const shown = bare === \"0.0.0.0\" || bare === \"::\" || bare === \"\" ? \"127.0.0.1\" : bare;\n return shown.includes(\":\") ? `[${shown}]` : shown;\n}\nfunction claimUrl(host, port, token) {\n return `http://${browsableHost(host)}:${port}/?claim=${token}`;\n}\nfunction claimCommand(host, port, token) {\n const bracketed = browsableHost(host);\n return `curl -sX POST http://${bracketed}:${port}/v1/keys -H 'Authorization: Bearer ${token}' -H 'content-type: application/json' -d '{\"label\":\"my browser\"}'`;\n}\n// src/serve.ts\nimport { HarnessError as HarnessError2 } from \"@dispach/core\";\n\n// src/ws.ts\nimport { newTurnId as newTurnId2 } from \"@dispach/core\";\nfunction attachWebSocket(runtime, authenticate, running = new Map) {\n const sockets = new Set;\n let unsubscribe;\n let chunkSockets = 0;\n let unsubscribeChunks;\n const broadcast = (event) => {\n const chunk = event.type === \"model.chunk\";\n for (const ws of sockets) {\n if (ws.data.agentId !== undefined && event.agentId !== ws.data.agentId)\n continue;\n if (event.agentId !== undefined && !reachesAgent(ws.data.principal, event.agentId))\n continue;\n if (event.sessionKey !== undefined && !reachesSession(ws.data.principal, event.sessionKey))\n continue;\n if (chunk && !ws.data.chunks)\n continue;\n try {\n ws.send(JSON.stringify(event));\n } catch {}\n }\n };\n const takeChunkInterest = () => {\n chunkSockets += 1;\n if (unsubscribeChunks === undefined) {\n unsubscribeChunks = runtime.bus.on(\"model.chunk\", broadcast);\n }\n };\n const releaseChunkInterest = () => {\n if (chunkSockets === 0)\n return;\n chunkSockets -= 1;\n if (chunkSockets === 0) {\n unsubscribeChunks?.();\n unsubscribeChunks = undefined;\n }\n };\n return {\n async accept(request) {\n const url = new URL(request.url);\n const fromProtocol = bearerFromProtocols(request);\n const fromQuery = url.searchParams.get(\"token\");\n const bearer = fromProtocol ?? fromQuery ?? \"\";\n const who = await authenticate(withBearerHeader(request, bearer));\n if (who instanceof Response)\n return { kind: \"reject\", response: who };\n const agentId = url.searchParams.get(\"agentId\");\n if (agentId !== null && !reachesAgent(who, agentId)) {\n return {\n kind: \"reject\",\n response: new Response(JSON.stringify({\n error: {\n code: \"agent_not_found\",\n message: `No agent \"${agentId}\".`,\n hint: \"Check the id — it is case-sensitive. A key scoped away from an agent sees exactly what a caller asking for one that does not exist sees.\"\n }\n }), { status: 404, headers: { \"content-type\": \"application/json\" } })\n };\n }\n return {\n kind: \"accept\",\n session: {\n agentId: agentId ?? undefined,\n chunks: url.searchParams.get(\"chunks\") === \"true\",\n principal: who\n },\n ...fromProtocol === undefined ? {} : { protocol: PROTOCOL }\n };\n },\n handlers: {\n open(ws) {\n sockets.add(ws);\n if (unsubscribe === undefined)\n unsubscribe = runtime.bus.on(\"*\", broadcast);\n if (ws.data.chunks)\n takeChunkInterest();\n ws.send(JSON.stringify({\n type: \"ws.open\",\n agentId: ws.data.agentId ?? null,\n chunks: ws.data.chunks\n }));\n },\n message(ws, raw) {\n let frame;\n try {\n frame = JSON.parse(typeof raw === \"string\" ? raw : new TextDecoder().decode(raw));\n } catch {\n ws.send(JSON.stringify({ type: \"ws.error\", code: \"frame_not_json\" }));\n return;\n }\n if (frame.type === \"ping\") {\n ws.send(JSON.stringify({ type: \"pong\" }));\n return;\n }\n if (frame.type === \"subscribe\") {\n if (frame.agentId === undefined && frame.sessionKey !== undefined) {\n ws.send(JSON.stringify({\n type: \"ws.error\",\n code: \"subscribe_needs_agent_id\",\n hint: \"Send { type: 'subscribe', agentId: '<agent>' }. A socket filters on the agent an event carries; sessionKey names a conversation and can never match one, so a socket pointed with it receives nothing.\"\n }));\n return;\n }\n const wantsChunks = typeof frame.chunks === \"boolean\" ? frame.chunks : ws.data.chunks;\n if (wantsChunks && !ws.data.chunks)\n takeChunkInterest();\n else if (!wantsChunks && ws.data.chunks)\n releaseChunkInterest();\n const nextAgent = frame.agentId ?? ws.data.agentId;\n if (nextAgent !== undefined && !reachesAgent(ws.data.principal, nextAgent)) {\n ws.send(JSON.stringify({\n type: \"ws.error\",\n error: {\n code: \"agent_not_found\",\n message: `No agent \"${nextAgent}\".`,\n hint: \"Check the id — it is case-sensitive. A key scoped away from an agent sees exactly what a caller asking for one that does not exist sees.\"\n }\n }));\n return;\n }\n ws.data = {\n agentId: nextAgent,\n chunks: wantsChunks,\n principal: ws.data.principal\n };\n ws.send(JSON.stringify({\n type: \"ws.subscribed\",\n agentId: ws.data.agentId ?? null,\n chunks: ws.data.chunks\n }));\n return;\n }\n if (frame.type === \"stop\") {\n const controller = frame.turnId === undefined ? undefined : running.get(frame.turnId);\n controller?.abort();\n ws.send(JSON.stringify({\n type: \"ws.stopping\",\n turnId: frame.turnId ?? null,\n found: controller !== undefined\n }));\n return;\n }\n if (frame.type !== \"message\") {\n ws.send(JSON.stringify({ type: \"ws.error\", code: \"unknown_frame_type\" }));\n return;\n }\n const agentId = ws.data.agentId;\n const agent = runtime.list().find((candidate) => candidate.id === agentId);\n if (agent === undefined) {\n ws.send(JSON.stringify({ type: \"ws.error\", code: \"agent_not_found\" }));\n return;\n }\n const text = frame.text ?? \"\";\n if (text.trim() === \"\") {\n ws.send(JSON.stringify({ type: \"ws.error\", code: \"message_text_required\" }));\n return;\n }\n const proceed = (admission) => {\n if (!admission.ok) {\n ws.send(JSON.stringify({ type: \"ws.error\", ...admission.error.toDetail() }));\n return;\n }\n const turnId = newTurnId2();\n const controller = new AbortController;\n running.set(turnId, controller);\n ws.send(JSON.stringify({ type: \"ws.accepted\", turnId }));\n agent.send(text, {\n admission,\n sessionKey: frame.sessionKey ?? \"api:default\",\n turnId,\n source: \"ws\",\n signal: controller.signal\n }).catch(() => {}).finally(() => running.delete(turnId));\n };\n const now = agent.admitNow();\n if (now !== undefined) {\n proceed(now);\n return;\n }\n agent.admit().then(proceed, (error) => {\n ws.send(JSON.stringify({\n type: \"ws.error\",\n code: \"internal_error\",\n message: error instanceof Error ? error.message : String(error)\n }));\n });\n },\n close(ws) {\n const had = sockets.delete(ws);\n if (had && ws.data.chunks)\n releaseChunkInterest();\n if (sockets.size === 0) {\n unsubscribe?.();\n unsubscribe = undefined;\n }\n }\n },\n closeAll() {\n for (const ws of sockets) {\n try {\n ws.close(1001, \"server stopping\");\n } catch {}\n }\n sockets.clear();\n unsubscribe?.();\n unsubscribe = undefined;\n unsubscribeChunks?.();\n unsubscribeChunks = undefined;\n chunkSockets = 0;\n }\n };\n}\n\n// src/serve.ts\nasync function serve(options) {\n const { host, port, runtime } = options;\n if (!isLoopback(host) && options.token === undefined) {\n throw new HarnessError2({\n code: \"server_public_without_token\",\n message: `Refusing to bind ${host}:${port} with no API token.`,\n hint: \"Set the variable named by server.tokenEnv, or bind 127.0.0.1. A public bind with no token exposes every endpoint — including the ones that start a turn — to anyone who can reach the port, and behaves identically to a safe one until someone finds it.\",\n field: \"server.host\"\n });\n }\n const running = new Map;\n const handler = createHandler({\n runtime,\n ...options.token === undefined ? {} : { token: options.token },\n ...options.token === undefined ? { allowUnauthenticated: true } : {},\n ...options.now === undefined ? {} : { now: options.now },\n running,\n ...options.approvals === undefined ? {} : { approvals: options.approvals },\n ...options.claim === undefined ? {} : { claim: options.claim },\n ...options.resolveAgent === undefined ? {} : { resolveAgent: options.resolveAgent },\n ...options.provision === undefined ? {} : { provision: options.provision },\n ...options.channels === undefined ? {} : { channels: options.channels },\n ...options.secrets === undefined ? {} : { secrets: options.secrets },\n origin: {\n host: options.host,\n ...options.allowedOrigins === undefined ? {} : { allowedOrigins: options.allowedOrigins },\n ...options.allowedHosts === undefined ? {} : { allowedHosts: options.allowedHosts }\n }\n });\n const underBun = options.engine === \"bun\" || options.engine === undefined && typeof Bun !== \"undefined\" && typeof Bun.serve === \"function\";\n if (underBun)\n return serveWithBun(handler, options, running);\n return serveWithNode(handler, options, running);\n}\nfunction serveWithBun(handler, options, running) {\n const bridge = attachWebSocket(options.runtime, handler.authenticate, running);\n const server = Bun.serve({\n port: options.port,\n hostname: options.host,\n idleTimeout: Math.min(255, Math.ceil(HEARTBEAT_MS / 1000 * 3)),\n fetch: async (request, self) => {\n const url = new URL(request.url);\n if (url.pathname !== \"/v1/ws\")\n return handler(request);\n const problem = originProblem(request, {\n host: options.host,\n ...options.allowedOrigins === undefined ? {} : { allowedOrigins: options.allowedOrigins },\n ...options.allowedHosts === undefined ? {} : { allowedHosts: options.allowedHosts }\n });\n if (problem !== undefined) {\n return new Response(JSON.stringify({ error: problem }), {\n status: 403,\n headers: { \"content-type\": \"application/json; charset=utf-8\" }\n });\n }\n const attempt = await bridge.accept(request);\n if (attempt.kind === \"reject\")\n return attempt.response;\n const upgraded = self.upgrade(request, {\n data: attempt.session,\n ...attempt.protocol === undefined ? {} : { headers: { \"sec-websocket-protocol\": attempt.protocol } }\n });\n if (upgraded)\n return;\n return new Response(\"upgrade failed\", { status: 400 });\n },\n websocket: {\n open: (ws) => bridge.handlers.open(ws),\n message: (ws, message) => bridge.handlers.message(ws, message),\n close: (ws) => bridge.handlers.close(ws)\n }\n });\n return {\n url: `http://${options.host}:${server.port}`,\n port: server.port ?? options.port,\n host: options.host,\n websocket: true,\n stop: async () => {\n bridge.closeAll();\n await server.stop(true);\n }\n };\n}\nasync function serveWithNode(handler, options, running) {\n const { createServer } = await import(\"node:http\");\n const { WebSocketServer } = await import(\"ws\");\n const bridge = attachWebSocket(options.runtime, handler.authenticate, running);\n const toRequest = (req, body) => {\n const url = `http://${req.headers.host ?? `${options.host}:${options.port}`}${req.url ?? \"/\"}`;\n const headers = new Headers;\n for (const [key, value] of Object.entries(req.headers)) {\n if (typeof value === \"string\")\n headers.set(key, value);\n else if (Array.isArray(value))\n headers.set(key, value.join(\", \"));\n }\n const method = req.method ?? \"GET\";\n return new Request(url, {\n method,\n headers,\n ...method === \"GET\" || method === \"HEAD\" || body === undefined ? {} : { body }\n });\n };\n const server = createServer((req, res) => {\n (async () => {\n const chunks = [];\n for await (const chunk of req)\n chunks.push(chunk);\n const response = await handler(toRequest(req, Buffer.concat(chunks)));\n const out = {};\n response.headers.forEach((value, key) => {\n out[key] = value;\n });\n res.writeHead(response.status, out);\n if (response.body === null) {\n res.end();\n return;\n }\n const reader = response.body.getReader();\n res.on(\"close\", () => void reader.cancel().catch(() => {}));\n for (;; ) {\n const { done, value } = await reader.read();\n if (done)\n break;\n res.write(Buffer.from(value));\n }\n res.end();\n })().catch(() => {\n if (!res.headersSent)\n res.writeHead(500);\n res.end();\n });\n });\n const chosenProtocol = new WeakMap;\n const wss = new WebSocketServer({\n noServer: true,\n handleProtocols: (_protocols, request) => chosenProtocol.get(request) ?? false\n });\n const refuse = (socket, status, body) => {\n socket.end(`HTTP/1.1 ${status} Refused\\r\ncontent-type: application/json; charset=utf-8\\r\ncontent-length: ${Buffer.byteLength(body)}\\r\nconnection: close\\r\n\\r\n${body}`);\n };\n server.on(\"upgrade\", (req, socket, head) => {\n (async () => {\n const request = toRequest(req);\n if (new URL(request.url).pathname !== \"/v1/ws\") {\n socket.destroy();\n return;\n }\n const problem = originProblem(request, {\n host: options.host,\n ...options.allowedOrigins === undefined ? {} : { allowedOrigins: options.allowedOrigins },\n ...options.allowedHosts === undefined ? {} : { allowedHosts: options.allowedHosts }\n });\n if (problem !== undefined) {\n refuse(socket, 403, JSON.stringify({ error: problem }));\n return;\n }\n const attempt = await bridge.accept(request);\n if (attempt.kind === \"reject\") {\n refuse(socket, attempt.response.status, await attempt.response.text());\n return;\n }\n if (attempt.protocol !== undefined)\n chosenProtocol.set(req, attempt.protocol);\n wss.handleUpgrade(req, socket, head, (ws) => {\n const adapted = {\n data: attempt.session,\n send: (message) => ws.send(message),\n close: (code, reason) => ws.close(code, reason)\n };\n ws.on(\"message\", (raw, isBinary) => {\n const bytes = Array.isArray(raw) ? Buffer.concat(raw) : raw instanceof ArrayBuffer ? Buffer.from(raw) : raw;\n bridge.handlers.message(adapted, isBinary ? new Uint8Array(bytes) : bytes.toString(\"utf8\"));\n });\n ws.on(\"close\", () => bridge.handlers.close(adapted));\n bridge.handlers.open(adapted);\n });\n })().catch(() => socket.destroy());\n });\n await new Promise((resolve, reject) => {\n server.once(\"error\", reject);\n server.listen(options.port, options.host, () => {\n server.removeListener(\"error\", reject);\n resolve();\n });\n });\n const address = server.address();\n const port = typeof address === \"object\" && address !== null ? address.port : options.port;\n return {\n url: `http://${options.host}:${port}`,\n port,\n host: options.host,\n websocket: true,\n stop: () => new Promise((resolve) => {\n bridge.closeAll();\n wss.close();\n server.closeAllConnections?.();\n server.close(() => resolve());\n })\n };\n}\nexport {\n HEARTBEAT_MS,\n Router,\n WEB_ASSETS,\n WEB_PATHS,\n attachWebSocket,\n browsableHost,\n claimCommand,\n claimUrl,\n createApprovalRegistry,\n createClaimTicket,\n createHandler,\n encodeFrame,\n isLoopback,\n serve,\n serveAsset,\n sseResponse\n};\n\n//# debugId=93CF8305A0ADF99D64756E2164756E21\n//# sourceMappingURL=index.js.map\n",
|
|
6
|
+
"import * as util from \"../core/util.js\";\nconst error = () => {\n const Sizable = {\n string: { unit: \"characters\", verb: \"to have\" },\n file: { unit: \"bytes\", verb: \"to have\" },\n array: { unit: \"items\", verb: \"to have\" },\n set: { unit: \"items\", verb: \"to have\" },\n map: { unit: \"entries\", verb: \"to have\" },\n };\n function getSizing(origin) {\n return Sizable[origin] ?? null;\n }\n const FormatDictionary = {\n regex: \"input\",\n email: \"email address\",\n url: \"URL\",\n emoji: \"emoji\",\n uuid: \"UUID\",\n uuidv4: \"UUIDv4\",\n uuidv6: \"UUIDv6\",\n nanoid: \"nanoid\",\n guid: \"GUID\",\n cuid: \"cuid\",\n cuid2: \"cuid2\",\n ulid: \"ULID\",\n xid: \"XID\",\n ksuid: \"KSUID\",\n datetime: \"ISO datetime\",\n date: \"ISO date\",\n time: \"ISO time\",\n duration: \"ISO duration\",\n ipv4: \"IPv4 address\",\n ipv6: \"IPv6 address\",\n mac: \"MAC address\",\n cidrv4: \"IPv4 range\",\n cidrv6: \"IPv6 range\",\n base64: \"base64-encoded string\",\n base64url: \"base64url-encoded string\",\n json_string: \"JSON string\",\n e164: \"E.164 number\",\n jwt: \"JWT\",\n template_literal: \"input\",\n };\n // type names: missing keys = do not translate (use raw value via ?? fallback)\n const TypeDictionary = {\n // Compatibility: \"nan\" -> \"NaN\" for display\n nan: \"NaN\",\n // All other type names omitted - they fall back to raw values via ?? operator\n };\n return (issue) => {\n switch (issue.code) {\n case \"invalid_type\": {\n const expected = TypeDictionary[issue.expected] ?? issue.expected;\n const receivedType = util.parsedType(issue.input);\n const received = TypeDictionary[receivedType] ?? receivedType;\n return `Invalid input: expected ${expected}, received ${received}`;\n }\n case \"invalid_value\":\n if (issue.values.length === 1)\n return `Invalid input: expected ${util.stringifyPrimitive(issue.values[0])}`;\n return `Invalid option: expected one of ${util.joinValues(issue.values, \"|\")}`;\n case \"too_big\": {\n const adj = issue.inclusive ? \"<=\" : \"<\";\n const sizing = getSizing(issue.origin);\n if (sizing)\n return `Too big: expected ${issue.origin ?? \"value\"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? \"elements\"}`;\n return `Too big: expected ${issue.origin ?? \"value\"} to be ${adj}${issue.maximum.toString()}`;\n }\n case \"too_small\": {\n const adj = issue.inclusive ? \">=\" : \">\";\n const sizing = getSizing(issue.origin);\n if (sizing) {\n return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;\n }\n return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;\n }\n case \"invalid_format\": {\n const _issue = issue;\n if (_issue.format === \"starts_with\") {\n return `Invalid string: must start with \"${_issue.prefix}\"`;\n }\n if (_issue.format === \"ends_with\")\n return `Invalid string: must end with \"${_issue.suffix}\"`;\n if (_issue.format === \"includes\")\n return `Invalid string: must include \"${_issue.includes}\"`;\n if (_issue.format === \"regex\")\n return `Invalid string: must match pattern ${_issue.pattern}`;\n return `Invalid ${FormatDictionary[_issue.format] ?? issue.format}`;\n }\n case \"not_multiple_of\":\n return `Invalid number: must be a multiple of ${issue.divisor}`;\n case \"unrecognized_keys\":\n return `Unrecognized key${issue.keys.length > 1 ? \"s\" : \"\"}: ${util.joinValues(issue.keys, \", \")}`;\n case \"invalid_key\":\n return `Invalid key in ${issue.origin}`;\n case \"invalid_union\":\n if (issue.options && Array.isArray(issue.options) && issue.options.length > 0) {\n const opts = issue.options.map((o) => `'${o}'`).join(\" | \");\n return `Invalid discriminator value. Expected ${opts}`;\n }\n return \"Invalid input\";\n case \"invalid_element\":\n return `Invalid value in ${issue.origin}`;\n default:\n return `Invalid input`;\n }\n };\n};\nexport default function () {\n return {\n localeError: error(),\n };\n}\n",
|
|
7
|
+
"export * as core from \"../core/index.js\";\nexport * from \"./schemas.js\";\nexport * from \"./checks.js\";\nexport * from \"./errors.js\";\nexport * from \"./parse.js\";\nexport * from \"./compat.js\";\n// zod-specified\nimport { config } from \"../core/index.js\";\nimport en from \"../locales/en.js\";\nconfig(en());\nexport { globalRegistry, registry, config, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, } from \"../core/index.js\";\nexport { toJSONSchema } from \"../core/json-schema-processors.js\";\nexport { fromJSONSchema } from \"./from-json-schema.js\";\nexport * as locales from \"../locales/index.js\";\n// iso\n// must be exported from top-level\n// https://github.com/colinhacks/zod/issues/4491\nexport { ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration } from \"./iso.js\";\nexport * as iso from \"./iso.js\";\nexport * as coerce from \"./coerce.js\";\n",
|
|
8
|
+
"/**\n * The address a person opens for an agent's browser view.\n *\n * In `lib/` rather than in `web.ts` because three commands print it — `web`, `init` and\n * `channels pair` — and `web.ts` is imported lazily by the entry point, so a static import of it\n * from another command would make one module both static and dynamic, which the bundler splits\n * into a duplicate export (`boundaries.test.ts` refuses the mix for that reason).\n */\n\nimport { browsableHost } from \"@dispach/server\"\n\n/**\n * No credential is attached. A claim is minted at boot and printed by `serve`, deliberately once —\n * a fresh one per invocation would leave a standing credential in a log — and a durable key in an\n * address bar lands in history, a bookmark and whatever syncs them. The page asks when it has to.\n */\nexport function webUrl(baseUrl: string, agentId?: string): string {\n const url = new URL(baseUrl)\n url.pathname = \"/\"\n /**\n * A bind is not an address, and the container is where that stops being theoretical.\n *\n * The lease publishes what was actually bound, which inside the image is `0.0.0.0` — every\n * interface, and a link no browser can open. `browsableHost` is the same substitution\n * `claimUrl` has always made, shared rather than copied a third time. Found by running this\n * *in the container*: on a laptop `serve` binds `127.0.0.1` and the substitution never fires,\n * so the defect is invisible everywhere except where it is deployed.\n */\n url.hostname = browsableHost(url.hostname)\n if (agentId !== undefined && agentId !== \"\") url.searchParams.set(\"agent\", agentId)\n return url.toString()\n}\n"
|
|
9
|
+
],
|
|
10
|
+
"mappings": ";uLAwCA,mBAAS,0BCvCT,IAAM,GAAQ,IAAM,CAChB,IAAM,EAAU,CACZ,OAAQ,CAAE,KAAM,aAAc,KAAM,SAAU,EAC9C,KAAM,CAAE,KAAM,QAAS,KAAM,SAAU,EACvC,MAAO,CAAE,KAAM,QAAS,KAAM,SAAU,EACxC,IAAK,CAAE,KAAM,QAAS,KAAM,SAAU,EACtC,IAAK,CAAE,KAAM,UAAW,KAAM,SAAU,CAC5C,EACA,SAAS,CAAS,CAAC,EAAQ,CACvB,OAAO,EAAQ,IAAW,KAE9B,IAAM,EAAmB,CACrB,MAAO,QACP,MAAO,gBACP,IAAK,MACL,MAAO,QACP,KAAM,OACN,OAAQ,SACR,OAAQ,SACR,OAAQ,SACR,KAAM,OACN,KAAM,OACN,MAAO,QACP,KAAM,OACN,IAAK,MACL,MAAO,QACP,SAAU,eACV,KAAM,WACN,KAAM,WACN,SAAU,eACV,KAAM,eACN,KAAM,eACN,IA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