@nervekit/orchestrator 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{server.d.ts → app/orchestrator-state.d.ts} +11 -17
- package/dist/app/orchestrator-state.d.ts.map +1 -0
- package/dist/app/orchestrator-state.js +105 -0
- package/dist/app/orchestrator-state.js.map +1 -0
- package/dist/app/server.d.ts +5 -0
- package/dist/app/server.d.ts.map +1 -0
- package/dist/{server.js → app/server.js} +6 -112
- package/dist/app/server.js.map +1 -0
- package/dist/app/version.d.ts.map +1 -0
- package/dist/app/version.js.map +1 -0
- package/dist/domains/agents/agent-lifecycle.service.d.ts +1 -1
- package/dist/domains/agents/agent-lifecycle.service.d.ts.map +1 -1
- package/dist/domains/agents/prompting/index.d.ts +4 -0
- package/dist/domains/agents/prompting/index.d.ts.map +1 -0
- package/dist/domains/agents/prompting/index.js +4 -0
- package/dist/domains/agents/prompting/index.js.map +1 -0
- package/dist/domains/agents/prompting/nerve-system-prompt.d.ts.map +1 -0
- package/dist/{nerve-system-prompt.js → domains/agents/prompting/nerve-system-prompt.js} +4 -2
- package/dist/domains/agents/prompting/nerve-system-prompt.js.map +1 -0
- package/dist/domains/agents/prompting/prompt-text.d.ts.map +1 -0
- package/dist/domains/agents/prompting/prompt-text.js.map +1 -0
- package/dist/domains/agents/prompting/resource-loader.d.ts.map +1 -0
- package/dist/{resource-loader.js → domains/agents/prompting/resource-loader.js} +1 -1
- package/dist/domains/agents/prompting/resource-loader.js.map +1 -0
- package/dist/domains/agents/run/agent-run-session.d.ts.map +1 -1
- package/dist/domains/agents/run/agent-run-session.js +4 -2
- package/dist/domains/agents/run/agent-run-session.js.map +1 -1
- package/dist/domains/agents/run/agent-runner.d.ts +7 -7
- package/dist/domains/agents/run/agent-runner.d.ts.map +1 -1
- package/dist/domains/agents/run/agent-runner.js +16 -234
- package/dist/domains/agents/run/agent-runner.js.map +1 -1
- package/dist/domains/agents/run/auto-compaction-runner.d.ts +19 -0
- package/dist/domains/agents/run/auto-compaction-runner.d.ts.map +1 -0
- package/dist/domains/agents/run/auto-compaction-runner.js +105 -0
- package/dist/domains/agents/run/auto-compaction-runner.js.map +1 -0
- package/dist/domains/agents/run/explore-helpers.d.ts.map +1 -1
- package/dist/domains/agents/run/explore-helpers.js +73 -16
- package/dist/domains/agents/run/explore-helpers.js.map +1 -1
- package/dist/domains/agents/run/inline-command-results.d.ts.map +1 -1
- package/dist/domains/agents/run/inline-command-results.js +1 -2
- package/dist/domains/agents/run/inline-command-results.js.map +1 -1
- package/dist/domains/agents/run/inline-command-runner.d.ts +19 -0
- package/dist/domains/agents/run/inline-command-runner.d.ts.map +1 -0
- package/dist/domains/agents/run/inline-command-runner.js +168 -0
- package/dist/domains/agents/run/inline-command-runner.js.map +1 -0
- package/dist/domains/agents/run/interrupted-run-recovery.d.ts +1 -1
- package/dist/domains/agents/run/interrupted-run-recovery.d.ts.map +1 -1
- package/dist/domains/agents/run/subagent-runner.d.ts +4 -2
- package/dist/domains/agents/run/subagent-runner.d.ts.map +1 -1
- package/dist/domains/agents/run/subagent-runner.js +13 -7
- package/dist/domains/agents/run/subagent-runner.js.map +1 -1
- package/dist/domains/agents/run/system-prompt-builder.d.ts +1 -1
- package/dist/domains/agents/run/system-prompt-builder.d.ts.map +1 -1
- package/dist/domains/agents/run/system-prompt-builder.js +2 -2
- package/dist/domains/agents/run/system-prompt-builder.js.map +1 -1
- package/dist/domains/agents/run/tool-draft-progress.d.ts +4 -0
- package/dist/domains/agents/run/tool-draft-progress.d.ts.map +1 -1
- package/dist/domains/agents/run/tool-draft-progress.js +114 -2
- package/dist/domains/agents/run/tool-draft-progress.js.map +1 -1
- package/dist/{auth.d.ts → domains/auth/auth-manager.d.ts} +2 -2
- package/dist/domains/auth/auth-manager.d.ts.map +1 -0
- package/dist/{auth.js → domains/auth/auth-manager.js} +1 -1
- package/dist/domains/auth/auth-manager.js.map +1 -0
- package/dist/{credential-crypto.d.ts → domains/auth/credential-key.service.d.ts} +1 -1
- package/dist/domains/auth/credential-key.service.d.ts.map +1 -0
- package/dist/{credential-crypto.js → domains/auth/credential-key.service.js} +2 -2
- package/dist/domains/auth/credential-key.service.js.map +1 -0
- package/dist/domains/auth/index.d.ts +4 -0
- package/dist/domains/auth/index.d.ts.map +1 -0
- package/dist/domains/auth/index.js +4 -0
- package/dist/domains/auth/index.js.map +1 -0
- package/dist/{oauth-flow.d.ts → domains/auth/oauth-flow-manager.d.ts} +3 -3
- package/dist/domains/auth/oauth-flow-manager.d.ts.map +1 -0
- package/dist/{oauth-flow.js → domains/auth/oauth-flow-manager.js} +2 -2
- package/dist/domains/auth/oauth-flow-manager.js.map +1 -0
- package/dist/domains/conversations/conversation-lifecycle.service.d.ts +1 -1
- package/dist/domains/conversations/conversation-lifecycle.service.d.ts.map +1 -1
- package/dist/domains/conversations/conversation-lifecycle.service.js +21 -4
- package/dist/domains/conversations/conversation-lifecycle.service.js.map +1 -1
- package/dist/domains/conversations/conversation-query.service.d.ts +2 -2
- package/dist/domains/conversations/conversation-query.service.d.ts.map +1 -1
- package/dist/domains/conversations/conversation-query.service.js +6 -2
- package/dist/domains/conversations/conversation-query.service.js.map +1 -1
- package/dist/domains/conversations/conversation-runtime.d.ts +2 -0
- package/dist/domains/conversations/conversation-runtime.d.ts.map +1 -1
- package/dist/domains/conversations/conversation-runtime.js +36 -2
- package/dist/domains/conversations/conversation-runtime.js.map +1 -1
- package/dist/domains/conversations/operations/import-service.d.ts.map +1 -1
- package/dist/domains/conversations/operations/import-service.js +1 -0
- package/dist/domains/conversations/operations/import-service.js.map +1 -1
- package/dist/domains/git/git-service.d.ts +1 -0
- package/dist/domains/git/git-service.d.ts.map +1 -1
- package/dist/domains/git/git-service.js +53 -0
- package/dist/domains/git/git-service.js.map +1 -1
- package/dist/domains/human-input/human-input-resolution.service.d.ts +1 -1
- package/dist/domains/human-input/human-input-resolution.service.d.ts.map +1 -1
- package/dist/domains/pinned-commands/pinned-command.service.d.ts +3 -1
- package/dist/domains/pinned-commands/pinned-command.service.d.ts.map +1 -1
- package/dist/domains/pinned-commands/pinned-command.service.js +26 -3
- package/dist/domains/pinned-commands/pinned-command.service.js.map +1 -1
- package/dist/domains/plans/plan-service.d.ts +2 -0
- package/dist/domains/plans/plan-service.d.ts.map +1 -1
- package/dist/domains/plans/plan-service.js +31 -6
- package/dist/domains/plans/plan-service.js.map +1 -1
- package/dist/domains/projects/prune-conversations.service.d.ts +1 -1
- package/dist/domains/projects/prune-conversations.service.d.ts.map +1 -1
- package/dist/domains/tasks/index.d.ts +1 -0
- package/dist/domains/tasks/index.d.ts.map +1 -1
- package/dist/domains/tasks/index.js +1 -0
- package/dist/domains/tasks/index.js.map +1 -1
- package/dist/domains/tasks/task-launch-config.store.d.ts +1 -1
- package/dist/domains/tasks/task-launch-config.store.d.ts.map +1 -1
- package/dist/domains/tasks/task-manager-orphan.d.ts +4 -1
- package/dist/domains/tasks/task-manager-orphan.d.ts.map +1 -1
- package/dist/domains/tasks/task-manager-orphan.js +100 -1
- package/dist/domains/tasks/task-manager-orphan.js.map +1 -1
- package/dist/domains/tasks/task-manager-start.d.ts.map +1 -1
- package/dist/domains/tasks/task-manager-start.js +46 -0
- package/dist/domains/tasks/task-manager-start.js.map +1 -1
- package/dist/domains/tasks/task-manager.d.ts +24 -3
- package/dist/domains/tasks/task-manager.d.ts.map +1 -1
- package/dist/domains/tasks/task-manager.js +10 -1
- package/dist/domains/tasks/task-manager.js.map +1 -1
- package/dist/domains/tasks/task-notification.service.d.ts +2 -2
- package/dist/domains/tasks/task-notification.service.d.ts.map +1 -1
- package/dist/domains/tasks/task-port-inspector.d.ts +7 -0
- package/dist/domains/tasks/task-port-inspector.d.ts.map +1 -0
- package/dist/domains/tasks/task-port-inspector.js +286 -0
- package/dist/domains/tasks/task-port-inspector.js.map +1 -0
- package/dist/domains/tasks/task-summary-format.d.ts +1 -0
- package/dist/domains/tasks/task-summary-format.d.ts.map +1 -1
- package/dist/domains/tasks/task-summary-format.js +14 -0
- package/dist/domains/tasks/task-summary-format.js.map +1 -1
- package/dist/domains/tasks/task-supervisor.d.ts +3 -1
- package/dist/domains/tasks/task-supervisor.d.ts.map +1 -1
- package/dist/domains/tasks/task-supervisor.js +3 -0
- package/dist/domains/tasks/task-supervisor.js.map +1 -1
- package/dist/domains/tools/agent-tool-adapter.d.ts.map +1 -1
- package/dist/domains/tools/agent-tool-adapter.js +1 -2
- package/dist/domains/tools/agent-tool-adapter.js.map +1 -1
- package/dist/domains/tools/orchestration-tool-dispatcher-handlers.d.ts.map +1 -1
- package/dist/domains/tools/orchestration-tool-dispatcher-handlers.js +24 -4
- package/dist/domains/tools/orchestration-tool-dispatcher-handlers.js.map +1 -1
- package/dist/domains/tools/orchestration-tool-dispatcher.d.ts.map +1 -1
- package/dist/domains/tools/orchestration-tool-dispatcher.js +2 -1
- package/dist/domains/tools/orchestration-tool-dispatcher.js.map +1 -1
- package/dist/domains/tools/tool-call-transcript-preview.d.ts +3 -0
- package/dist/domains/tools/tool-call-transcript-preview.d.ts.map +1 -0
- package/dist/domains/tools/tool-call-transcript-preview.js +442 -0
- package/dist/domains/tools/tool-call-transcript-preview.js.map +1 -0
- package/dist/domains/tools/tool-call.repository.d.ts.map +1 -1
- package/dist/domains/tools/tool-call.repository.js +6 -9
- package/dist/domains/tools/tool-call.repository.js.map +1 -1
- package/dist/domains/tools/tool-executor.service.d.ts +1 -1
- package/dist/domains/tools/tool-executor.service.d.ts.map +1 -1
- package/dist/domains/tools/tool-executor.service.js +3 -2
- package/dist/domains/tools/tool-executor.service.js.map +1 -1
- package/dist/domains/tools/tool-result-bounds.d.ts.map +1 -1
- package/dist/domains/tools/tool-result-bounds.js +23 -9
- package/dist/domains/tools/tool-result-bounds.js.map +1 -1
- package/dist/domains/tools/tool-result-model-limits.d.ts +2 -0
- package/dist/domains/tools/tool-result-model-limits.d.ts.map +1 -0
- package/dist/domains/tools/tool-result-model-limits.js +84 -0
- package/dist/domains/tools/tool-result-model-limits.js.map +1 -0
- package/dist/domains/tools/tool-service.d.ts +4 -2
- package/dist/domains/tools/tool-service.d.ts.map +1 -1
- package/dist/domains/tools/tool-service.js +2 -1
- package/dist/domains/tools/tool-service.js.map +1 -1
- package/dist/domains/transcription/transcription.service.d.ts +1 -1
- package/dist/domains/transcription/transcription.service.d.ts.map +1 -1
- package/dist/domains/transcription/transcription.service.js.map +1 -1
- package/dist/domains/usage/subscription-usage-service.d.ts +1 -1
- package/dist/domains/usage/subscription-usage-service.d.ts.map +1 -1
- package/dist/http/request-context.d.ts +1 -1
- package/dist/http/request-context.d.ts.map +1 -1
- package/dist/http/static-files.d.ts +1 -1
- package/dist/http/static-files.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/diagnostics/crash-reports.d.ts +14 -0
- package/dist/infrastructure/diagnostics/crash-reports.d.ts.map +1 -0
- package/dist/infrastructure/diagnostics/crash-reports.js +199 -0
- package/dist/infrastructure/diagnostics/crash-reports.js.map +1 -0
- package/dist/infrastructure/diagnostics/index.d.ts +3 -0
- package/dist/infrastructure/diagnostics/index.d.ts.map +1 -0
- package/dist/infrastructure/diagnostics/index.js +3 -0
- package/dist/infrastructure/diagnostics/index.js.map +1 -0
- package/dist/infrastructure/diagnostics/logging.d.ts.map +1 -0
- package/dist/{logging.js → infrastructure/diagnostics/logging.js} +1 -1
- package/dist/infrastructure/diagnostics/logging.js.map +1 -0
- package/dist/{secrets.d.ts → infrastructure/secrets/index.d.ts} +1 -1
- package/dist/infrastructure/secrets/index.d.ts.map +1 -0
- package/dist/{secrets.js → infrastructure/secrets/index.js} +2 -2
- package/dist/infrastructure/secrets/index.js.map +1 -0
- package/dist/main.js +43 -7
- package/dist/main.js.map +1 -1
- package/dist/routes/agent-routes.d.ts +1 -1
- package/dist/routes/agent-routes.d.ts.map +1 -1
- package/dist/routes/agent-routes.js.map +1 -1
- package/dist/routes/auth-routes.d.ts +1 -1
- package/dist/routes/auth-routes.d.ts.map +1 -1
- package/dist/routes/auth-routes.js.map +1 -1
- package/dist/routes/completion-routes.d.ts +1 -1
- package/dist/routes/completion-routes.d.ts.map +1 -1
- package/dist/routes/completion-routes.js.map +1 -1
- package/dist/routes/conversation-routes.d.ts +1 -1
- package/dist/routes/conversation-routes.d.ts.map +1 -1
- package/dist/routes/conversation-routes.js.map +1 -1
- package/dist/routes/filesystem-routes.d.ts +1 -1
- package/dist/routes/filesystem-routes.d.ts.map +1 -1
- package/dist/routes/filesystem-routes.js.map +1 -1
- package/dist/routes/git-routes.d.ts +1 -1
- package/dist/routes/git-routes.d.ts.map +1 -1
- package/dist/routes/git-routes.js +4 -0
- package/dist/routes/git-routes.js.map +1 -1
- package/dist/routes/index.d.ts +1 -1
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/log-routes.d.ts +1 -1
- package/dist/routes/log-routes.d.ts.map +1 -1
- package/dist/routes/log-routes.js.map +1 -1
- package/dist/routes/model-routes.d.ts +1 -1
- package/dist/routes/model-routes.d.ts.map +1 -1
- package/dist/routes/project-routes.d.ts +1 -1
- package/dist/routes/project-routes.d.ts.map +1 -1
- package/dist/routes/project-routes.js +7 -1
- package/dist/routes/project-routes.js.map +1 -1
- package/dist/routes/provider-catalog-routes.d.ts +1 -1
- package/dist/routes/provider-catalog-routes.d.ts.map +1 -1
- package/dist/routes/provider-catalog-routes.js +1 -1
- package/dist/routes/provider-catalog-routes.js.map +1 -1
- package/dist/routes/settings-routes.d.ts +1 -1
- package/dist/routes/settings-routes.d.ts.map +1 -1
- package/dist/routes/settings-routes.js.map +1 -1
- package/dist/routes/status-routes.d.ts +1 -1
- package/dist/routes/status-routes.d.ts.map +1 -1
- package/dist/routes/status-routes.js +1 -1
- package/dist/routes/status-routes.js.map +1 -1
- package/dist/routes/storage-routes.d.ts +1 -1
- package/dist/routes/storage-routes.d.ts.map +1 -1
- package/dist/routes/storage-routes.js.map +1 -1
- package/dist/routes/task-routes.d.ts +1 -1
- package/dist/routes/task-routes.d.ts.map +1 -1
- package/dist/routes/task-routes.js.map +1 -1
- package/dist/routes/tool-routes.d.ts +1 -1
- package/dist/routes/tool-routes.d.ts.map +1 -1
- package/dist/routes/tool-routes.js +47 -19
- package/dist/routes/tool-routes.js.map +1 -1
- package/dist/routes/transcription-routes.d.ts +1 -1
- package/dist/routes/transcription-routes.d.ts.map +1 -1
- package/dist/routes/transcription-routes.js.map +1 -1
- package/dist/routes/worker-routes.d.ts +1 -1
- package/dist/routes/worker-routes.d.ts.map +1 -1
- package/dist/routes/worker-routes.js.map +1 -1
- package/dist/runtime/runtime-composition.d.ts +3 -3
- package/dist/runtime/runtime-composition.d.ts.map +1 -1
- package/dist/runtime/runtime-composition.js.map +1 -1
- package/dist/{registry.d.ts → runtime/runtime-registry.d.ts} +148 -33
- package/dist/runtime/runtime-registry.d.ts.map +1 -0
- package/dist/{registry.js → runtime/runtime-registry.js} +7 -12
- package/dist/runtime/runtime-registry.js.map +1 -0
- package/dist/runtime/runtime-state.d.ts +1 -0
- package/dist/runtime/runtime-state.d.ts.map +1 -1
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/{registry → runtime}/types.js.map +1 -1
- package/dist/web/assets/{dist-BaA_eB0I.js → dist-DuVh-9Yy.js} +1 -1
- package/dist/web/assets/index-bmeeVJYV.css +2 -0
- package/dist/web/assets/index-hdM6dgBG.js +192 -0
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +4 -4
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js.map +0 -1
- package/dist/credential-crypto.d.ts.map +0 -1
- package/dist/credential-crypto.js.map +0 -1
- package/dist/logging.d.ts.map +0 -1
- package/dist/logging.js.map +0 -1
- package/dist/nerve-system-prompt.d.ts.map +0 -1
- package/dist/nerve-system-prompt.js.map +0 -1
- package/dist/oauth-flow.d.ts.map +0 -1
- package/dist/oauth-flow.js.map +0 -1
- package/dist/prompt-text.d.ts.map +0 -1
- package/dist/prompt-text.js.map +0 -1
- package/dist/registry/types.d.ts.map +0 -1
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js.map +0 -1
- package/dist/resource-loader.d.ts.map +0 -1
- package/dist/resource-loader.js.map +0 -1
- package/dist/secrets.d.ts.map +0 -1
- package/dist/secrets.js.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/web/assets/index-C45Kmr75.css +0 -2
- package/dist/web/assets/index-DHfIkEia.js +0 -167
- /package/dist/{version.d.ts → app/version.d.ts} +0 -0
- /package/dist/{version.js → app/version.js} +0 -0
- /package/dist/{nerve-system-prompt.d.ts → domains/agents/prompting/nerve-system-prompt.d.ts} +0 -0
- /package/dist/{prompt-text.d.ts → domains/agents/prompting/prompt-text.d.ts} +0 -0
- /package/dist/{prompt-text.js → domains/agents/prompting/prompt-text.js} +0 -0
- /package/dist/{resource-loader.d.ts → domains/agents/prompting/resource-loader.d.ts} +0 -0
- /package/dist/{logging.d.ts → infrastructure/diagnostics/logging.d.ts} +0 -0
- /package/dist/{registry → runtime}/types.d.ts +0 -0
- /package/dist/{registry → runtime}/types.js +0 -0
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/bash-B7CDPTg5.js","assets/shellscript-CLZ0U2zV.js","assets/html-BY76lXLH.js","assets/css-BsVw1vtW.js","assets/javascript-BgS3c2Ky.js","assets/svelte-Uaf2W_lJ.js","assets/typescript-bsJCZSQ-.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=`modulepreload`,d=function(e){return`/`+e},f={},p=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=d(t,n),t in f)return;f[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:u,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},m=`true`,h=`false`,g=m===`true`,_=h===`true`;function v(e={}){let{immediate:t=!1,onNeedReload:n,onNeedRefresh:r,onOfflineReady:i,onRegistered:a,onRegisteredSW:o,onRegisterError:s}=e,c,l,u,d=async(e=!0)=>{await l,g||u?.()};async function f(){if(`serviceWorker`in navigator){if(c=await p(async()=>{let{Workbox:e}=await import(`./workbox-window.prod.es5-Bd17z0YL.js`);return{Workbox:e}},[]).then(({Workbox:e})=>new e(`/sw.js`,{scope:`/`,type:`classic`})).catch(e=>{s?.(e)}),!c)return;if(u=()=>{c?.messageSkipWaiting()},!_)if(g)c.addEventListener(`activated`,e=>{(e.isUpdate||e.isExternal)&&(n?n():window.location.reload())}),c.addEventListener(`installed`,e=>{e.isUpdate||i?.()});else{let e=!1,t=()=>{e=!0,c?.addEventListener(`controlling`,e=>{e.isUpdate&&(n?n():window.location.reload())}),r?.()};c.addEventListener(`installed`,n=>{n.isUpdate===void 0?n.isExternal===void 0?!e&&i?.():n.isExternal?t():!e&&i?.():n.isUpdate||i?.()}),c.addEventListener(`waiting`,t)}c.register({immediate:t}).then(e=>{o?o(`/sw.js`,e):a?.(e)}).catch(e=>{s?.(e)})}}return l=f(),d}var y=Array.isArray,b=Array.prototype.indexOf,x=Array.prototype.includes,S=Array.from,ee=Object.defineProperty,C=Object.getOwnPropertyDescriptor,te=Object.getOwnPropertyDescriptors,ne=Object.prototype,re=Array.prototype,ie=Object.getPrototypeOf,ae=Object.isExtensible;function oe(e){return typeof e==`function`}var w=()=>{};function se(e){return e()}function ce(e){for(var t=0;t<e.length;t++)e[t]()}function le(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function ue(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var de=1<<24,fe=1024,pe=2048,me=4096,he=8192,ge=16384,_e=32768,ve=1<<25,ye=65536,be=1<<18,xe=1<<19,Se=1<<20,Ce=1<<25,we=65536,Te=1<<21,Ee=1<<22,De=1<<23,Oe=Symbol(`$state`),ke=Symbol(`legacy props`),Ae=Symbol(``),je=Symbol(`attributes`),Me=Symbol(`class`),Ne=Symbol(`style`),Pe=Symbol(`text`),Fe=Symbol(`form reset`),Ie=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Le=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function Re(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function ze(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Be(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Ve(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function He(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Ue(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function We(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ge(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Ke(){throw Error(`https://svelte.dev/e/set_context_after_init`)}function qe(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Je(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Ye(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Xe(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Ze={},Qe=Symbol(`uninitialized`),$e=`http://www.w3.org/1999/xhtml`,et=`http://www.w3.org/2000/svg`,tt=`http://www.w3.org/1998/Math/MathML`,nt=`@attach`;function rt(){console.warn(`https://svelte.dev/e/derived_inert`)}function it(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function at(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function eee(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var ot=!1;function st(e){ot=e}var ct;function lt(e){if(e===null)throw it(),Ze;return ct=e}function ut(){return lt(Kn(ct))}function T(e){if(ot){if(Kn(ct)!==null)throw it(),Ze;ct=e}}function E(e=1){if(ot){for(var t=e,n=ct;t--;)n=Kn(n);ct=n}}function dt(e=!0){for(var t=0,n=ct;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Kn(n);e&&n.remove(),n=i}}function ft(e){if(!e||e.nodeType!==8)throw it(),Ze;return e.data}function pt(e){return e===this.v}function mt(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function ht(e){return!mt(e,this.v)}var gt=!1,_t=!1;function vt(){_t=!0}var yt=[];function bt(e,t=!1,n=!1){return xt(e,new Map,``,yt,null,n)}function xt(e,t,n,r,i=null,a=!1){if(typeof e==`object`&&e){var o=t.get(e);if(o!==void 0)return o;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(y(e)){var s=Array(e.length);t.set(e,s),i!==null&&t.set(i,s);for(var c=0;c<e.length;c+=1){var l=e[c];c in e&&(s[c]=xt(l,t,n,r,null,a))}return s}if(ie(e)===ne){s={},t.set(e,s),i!==null&&t.set(i,s);for(var u of Object.keys(e))s[u]=xt(e[u],t,n,r,null,a);return s}if(e instanceof Date)return structuredClone(e);if(typeof e.toJSON==`function`&&!a)return xt(e.toJSON(),t,n,r,e)}if(e instanceof EventTarget)return e;try{return structuredClone(e)}catch{return e}}var St=null;function Ct(e){St=e}function wt(e){return Ot(`getContext`).get(e)}function Tt(e,t){let n=Ot(`setContext`);if(gt){var r=Pr.f;!jr&&r&32&&!St.i||Ke()}return n.set(e,t),t}function Et(e){return Ot(`hasContext`).has(e)}function tee(){return Ot(`getAllContexts`)}function D(e,t=!1,n){St={p:St,i:!1,c:null,e:null,s:e,x:null,r:Pr,l:_t&&!t?{s:null,u:null,$:[]}:null}}function O(e){var t=St,n=t.e;if(n!==null){t.e=null;for(var r of n)cr(r)}return e!==void 0&&(t.x=e),t.i=!0,St=t.p,e??{}}function Dt(){return!_t||St!==null&&St.l===null}function Ot(e){return St===null&&Re(e),St.c??=new Map(kt(St)||void 0)}function kt(e){let t=e.p;for(;t!==null;){let e=t.c;if(e!==null)return e;t=t.p}return null}var At=[];function jt(){var e=At;At=[],ce(e)}function Mt(e){if(At.length===0&&!pn){var t=At;queueMicrotask(()=>{t===At&&jt()})}At.push(e)}function nee(){for(;At.length>0;)jt()}function Nt(e){var t=Pr;if(t===null)return jr.f|=De,e;if(!(t.f&32768)&&!(t.f&4))throw e;Pt(e,t)}function Pt(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}var Ft=~(pe|me|fe);function It(e,t){e.f=e.f&Ft|t}function Lt(e){e.f&512||e.deps===null?It(e,fe):It(e,me)}function Rt(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=we,Rt(t.deps))}function zt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),Rt(e.deps),It(e,fe)}function Bt(e,t,n){if(e==null)return t(void 0),n&&n(void 0),w;let r=ei(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}var Vt=[];function Ht(e,t){return{subscribe:Ut(e,t).subscribe}}function Ut(e,t=w){let n=null,r=new Set;function i(t){if(mt(e,t)&&(e=t,n)){let t=!Vt.length;for(let t of r)t[1](),Vt.push(t,e);if(t){for(let e=0;e<Vt.length;e+=2)Vt[e][0](Vt[e+1]);Vt.length=0}}}function a(t){i(t(e))}function o(o,s=w){let c=[o,s];return r.add(c),r.size===1&&(n=t(i,a)||w),o(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:i,update:a,subscribe:o}}function Wt(e,t,n){let r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw Error(`derived() expects stores as input, got a falsy value`);let a=t.length<2;return Ht(n,(e,n)=>{let o=!1,s=[],c=0,l=w,u=()=>{if(c)return;l();let i=t(r?s[0]:s,e,n);a?e(i):l=typeof i==`function`?i:w},d=i.map((e,t)=>Bt(e,e=>{s[t]=e,c&=~(1<<t),o&&u()},()=>{c|=1<<t}));return o=!0,u(),function(){ce(d),l(),o=!1}})}function ree(e){let t;return Bt(e,e=>t=e)(),t}var iee=!1,Gt=!1;function aee(e){var t=Gt;try{return Gt=!1,[e(),Gt]}finally{Gt=t}}function Kt(e){let t=0,n=Mn(0),r;return()=>{ar()&&(I(n),fr(()=>(t===0&&(r=ei(()=>e(()=>Pn(n)))),t+=1,()=>{Mt(()=>{--t,t===0&&(r?.(),r=void 0,Pn(n))})})))}}var oee=ye|xe;function see(e,t,n,r){new cee(e,t,n,r)}var cee=class{parent;is_pending=!1;transform_error;#e;#t=ot?ct:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Kt(()=>(this.#m=Mn(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=Pr;t.b=this,t.f|=128,n(e)},this.parent=Pr.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=pr(()=>{if(ot){let e=this.#t;ut();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},oee),ot&&(this.#e=ct)}#g(){try{this.#a=hr(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=hr(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=hr(()=>e(this.#e)),Mt(()=>{var e=this.#c=document.createDocumentFragment(),t=Wn();e.append(t),this.#a=this.#x(()=>hr(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,Sr(this.#o,()=>{this.#o=null}),this.#b(ln))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=hr(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Er(this.#a,e);let t=this.#n.pending;this.#o=hr(()=>t(this.#e))}else this.#b(ln)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){zt(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=Pr,n=jr,r=St;Fr(this.#i),Nr(this.#i),Ct(this.#i.ctx);try{return yn.ensure(),e()}catch(e){return Nt(e),null}finally{Fr(t),Nr(n),Ct(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&Sr(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,Mt(()=>{this.#d=!1,this.#m&&Nn(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),I(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;ln?.is_fork?(this.#a&&ln.skip_effect(this.#a),this.#o&&ln.skip_effect(this.#o),this.#s&&ln.skip_effect(this.#s),ln.oncommit(()=>{this.#C(e)})):this.#C(e)}#C(e){this.#a&&=(yr(this.#a),null),this.#o&&=(yr(this.#o),null),this.#s&&=(yr(this.#s),null),ot&&(lt(this.#t),E(),lt(dt()));var t=this.#n.onerror;let n=this.#n.failed;var r=!1,i=!1;let a=()=>{if(r){eee();return}r=!0,i&&Xe(),this.#s!==null&&Sr(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){Pt(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return hr(()=>{var t=Pr;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return Pt(e,this.#i.parent),null}}))};Mt(()=>{var t;try{t=this.transform_error(e)}catch(e){Pt(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>Pt(e,this.#i&&this.#i.parent)):o(t)})}};function qt(e,t,n,r){let i=Dt()?Zt:en;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=Pr,c=Jt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){Pt(e,s)}Yt()}}var d=Xt();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>$t(e))).then(u).catch(e=>Pt(e,s)).finally(d)}l?l.then(()=>{c(),f(),Yt()}):f()}function Jt(){var e=Pr,t=jr,n=St,r=ln;return function(i=!0){Fr(e),Nr(t),Ct(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Yt(e=!0){Fr(null),Nr(null),Ct(null),e&&ln?.deactivate()}function Xt(){var e=Pr,t=e.b,n=ln,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function Zt(e){var t=2|pe;return Pr!==null&&(Pr.f|=xe),{ctx:St,deps:null,effects:null,equals:pt,f:t,fn:e,reactions:null,rv:0,v:Qe,wv:0,parent:Pr,ac:null}}var Qt=Symbol(`obsolete`);function $t(e,t,n){let r=Pr;r===null&&ze();var i=void 0,a=Mn(Qe),o=!jr,s=new Set;return mee(()=>{var t=Pr,n=le();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==Ie&&n.reject(e)}).finally(Yt)}catch(e){n.reject(e),Yt()}var c=ln;if(o){if(t.f&32768)var l=Xt();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(Qt);else for(let e of s.values())e.reject(Qt);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==Qt&&(c.activate(),t?(a.f|=De,Nn(a,t)):(a.f&8388608&&(a.f^=De),Nn(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),or(()=>{for(let e of s)e.reject(Qt)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function k(e){let t=Zt(e);return gt||Lr(t),t}function en(e){let t=Zt(e);return t.equals=ht,t}function tn(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)yr(t[n])}}function nn(e){var t,n=Pr,r=e.parent;if(!kr&&r!==null&&e.v!==Qe&&r.f&24576)return rt(),e.v;Fr(r);try{e.f&=~we,tn(e),t=Jr(e)}finally{Fr(n)}return t}function rn(e){var t=nn(e);if(!e.equals(t)&&(e.wv=Gr(),(!ln?.is_fork||e.deps===null)&&(ln===null?e.v=t:(ln.capture(e,t,!0),un?.capture(e,t,!0)),e.deps===null))){It(e,fe);return}kr||(dn===null?Lt(e):(ar()||ln?.is_fork)&&dn.set(e,t))}function an(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(Ie),t.fn!==null&&(t.teardown=w),t.ac=null,Yr(t,0),_r(t))}function on(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&Xr(t)}var sn=null,cn=null,ln=null,un=null,dn=null,fn=null,pn=!1,mn=!1,hn=null,gn=null,_n=0,vn=1,yn=class e{id=vn++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){cn===null?sn=cn=this:(cn.#n=this,this.#t=cn),cn=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)It(r,pe),t(r);for(r of n.m)It(r,me),t(r)}this.#p.add(e)}#g(){this.#e=!0,_n++>1e3&&(this.#S(),xn());for(let e of this.#u)this.#d.delete(e),It(e,pe),this.schedule(e);for(let e of this.#d)It(e,me),this.schedule(e);let t=this.#c;this.#c=[],this.apply();var n=hn=[],r=[],i=gn=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw On(e),this.#h()||this.discard(),t}if(ln=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(hn=null,gn=null,this.#h()){this.#b(r),this.#b(n);for(let[e,t]of this.#f)Dn(e,t);i.length>0&&ln.#g();return}let o=this.#v();if(o){this.#b(r),this.#b(n),o.#y(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),un=this,Cn(r),Cn(n),un=null,this.#s?.resolve();var s=ln;if(this.#a===0&&(this.#c.length===0||s!==null)&&(this.#S(),gt&&(this.#x(),ln=s)),this.#c.length>0)if(s!==null){let e=s;e.#c.push(...this.#c.filter(t=>!e.#c.includes(t)))}else s=this;s!==null&&s.#g()}#_(e,t,n){e.f^=fe;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=fe:i&4?t.push(r):gt&&i&16777224?n.push(r):Kr(r)&&(i&16&&this.#d.add(r),Xr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#v(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#y(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null)for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),It(i,pe),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),ln=this,this.#g()}#b(e){for(var t=0;t<e.length;t+=1)zt(e[t],this.#u,this.#d)}capture(e,t,n=!1){e.v!==Qe&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),dn?.set(e,t)),this.is_fork||(e.v=t)}activate(){ln=this}deactivate(){ln=null,dn=null}flush(){try{mn=!0,ln=this,this.#g()}finally{_n=0,fn=null,hn=null,gn=null,mn=!1,ln=null,dn=null,An.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(Qt);this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}#x(){for(let u=sn;u!==null;u=u.#n){var e=u.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(u.current.has(r)){var n=u.current.get(r)[0];if(e&&i!==n)u.current.set(r,[i,a]);else continue}t.push(r)}if(e)for(let[e,t]of this.async_deriveds){let n=u.async_deriveds.get(e);n&&t.promise.then(n.resolve).catch(n.reject)}var r=[...u.current.keys()].filter(e=>!u.current.get(e)[1]);if(!(!u.#e||r.length===0)){var i=r.filter(e=>!this.current.has(e));if(i.length===0)e&&u.discard();else if(t.length>0){if(e)for(let e of this.#p)u.unskip_effect(e,e=>{e.f&4194320?u.schedule(e):u.#b([e])});u.activate();var a=new Set,o=new Map;for(var s of t)wn(s,i,a,o);o=new Map;var c=[...u.current].filter(([e,t])=>{let n=this.current.get(e);return n?n[0]!==t[0]||n[1]!==t[1]:!0}).map(([e])=>e);if(c.length>0)for(let e of this.#l)!(e.f&155648)&&Tn(e,c,o)&&(e.f&4194320?(It(e,pe),u.schedule(e)):u.#u.add(e));if(u.#c.length>0&&!u.#m){u.apply();for(var l of u.#c)u.#_(l,[],[]);u.#c=[]}u.deactivate()}}}}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,Mt(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=le()).promise}static ensure(){if(ln===null){let t=ln=new e;!mn&&!pn&&Mt(()=>{t.#e||t.flush()})}return ln}apply(){if(!gt||!this.is_fork&&this.#t===null&&this.#n===null){dn=null;return}dn=new Map;for(let[e,[t]]of this.current)dn.set(e,t);for(let t=sn;t!==null;t=t.#n)if(!(t===this||t.is_fork)){var e=!1;if(t.id<this.id){for(let[n,[,r]]of t.current)if(!r&&this.current.has(n)){e=!0;break}}if(!e)for(let[e,n]of t.previous)dn.has(e)||dn.set(e,n)}}schedule(e){if(fn=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(hn!==null&&t===Pr&&(gt||(jr===null||!(jr.f&2))&&!iee))return;if(n&96){if(!(n&1024))return;t.f^=fe}}this.#c.push(t)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null?sn=t:e.#n=t,t===null?cn=e:t.#t=e,this.linked=!1}}};function bn(e){var t=pn;pn=!0;try{var n;for(e&&(ln!==null&&!ln.is_fork&&ln.flush(),n=e());;){if(nee(),ln===null)return n;ln.flush()}}finally{pn=t}}function xn(){try{We()}catch(e){Pt(e,fn)}}var Sn=null;function Cn(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Kr(r)&&(Sn=new Set,Xr(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&xr(r),Sn?.size>0)){An.clear();for(let e of Sn){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Sn.has(n)&&(Sn.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Xr(n)}}Sn.clear()}}Sn=null}}function wn(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?wn(i,t,n,r):e&4194320&&!(e&2048)&&Tn(i,t,r)&&(It(i,pe),En(i))}}function Tn(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(x.call(t,r))return!0;if(r.f&2&&Tn(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function En(e){ln.schedule(e)}function Dn(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),It(e,fe);for(var n=e.first;n!==null;)Dn(n,t),n=n.next}}function On(e){It(e,fe);for(var t=e.first;t!==null;)On(t),t=t.next}var kn=new Set,An=new Map,jn=!1;function Mn(e,t){return{f:0,v:e,reactions:null,equals:pt,rv:0,wv:0}}function A(e,t){let n=Mn(e,t);return Lr(n),n}function lee(e,t=!1,n=!0){let r=Mn(e);return t||(r.equals=ht),_t&&n&&St!==null&&St.l!==null&&(St.l.s??=[]).push(r),r}function j(e,t,n=!1){return jr!==null&&(!Mr||jr.f&131072)&&Dt()&&jr.f&4325394&&(Ir===null||!Ir.has(e))&&Ye(),Nn(e,n?In(t):t,gn)}function Nn(e,t,n=null){if(!e.equals(t)){An.set(e,kr?t:e.v);var r=yn.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&nn(t),dn===null&&Lt(t)}e.wv=Gr(),Fn(e,pe,n),Dt()&&Pr!==null&&Pr.f&1024&&!(Pr.f&96)&&(Br===null?hee([e]):Br.push(e)),!r.is_fork&&kn.size>0&&!jn&&uee()}return t}function uee(){jn=!1;for(let e of kn){e.f&1024&&It(e,me);let t;try{t=Kr(e)}catch{t=!0}t&&Xr(e)}kn.clear()}function Pn(e){j(e,e.v+1)}function Fn(e,t,n){var r=e.reactions;if(r!==null)for(var i=Dt(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===Pr)){var l=(c&pe)===0;if(l&&It(s,t),c&131072)kn.add(s);else if(c&2){var u=s;dn?.delete(u),c&65536||(c&512&&(Pr===null||!(Pr.f&2097152))&&(s.f|=we),Fn(u,me,n))}else if(l){var d=s;c&16&&Sn!==null&&Sn.add(d),n===null?En(d):n.push(d)}}}}function In(e){if(typeof e!=`object`||!e||Oe in e)return e;let t=ie(e);if(t!==ne&&t!==re)return e;var n=new Map,r=y(e),i=A(0),a=null,o=Ur,s=e=>{if(Ur===o)return e();var t=jr,n=Ur;Nr(null),Wr(o);var r=e();return Nr(t),Wr(n),r};return r&&n.set(`length`,A(e.length,a)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&qe();var i=n.get(t);return i===void 0?s(()=>{var e=A(r.value,a);return n.set(t,e),e}):j(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>A(Qe,a));n.set(t,e),Pn(i)}}else j(r,Qe),Pn(i);return!0},get(t,r,i){if(r===Oe)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||C(t,r)?.writable)&&(o=s(()=>A(In(c?t[r]:Qe),a)),n.set(r,o)),o!==void 0){var l=I(o);return l===Qe?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var i=n.get(t);i&&(r.value=I(i))}else if(r===void 0){var a=n.get(t),o=a?.v;if(a!==void 0&&o!==Qe)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,t){if(t===Oe)return!0;var r=n.get(t),i=r!==void 0&&r.v!==Qe||Reflect.has(e,t);return(r!==void 0||Pr!==null&&(!i||C(e,t)?.writable))&&(r===void 0&&(r=s(()=>A(i?In(e[t]):Qe,a)),n.set(t,r)),I(r)===Qe)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=o;d<l.v;d+=1){var f=n.get(d+``);f===void 0?d in e&&(f=s(()=>A(Qe,a)),n.set(d+``,f)):j(f,Qe)}if(l===void 0)(!u||C(e,t)?.writable)&&(l=s(()=>A(void 0,a)),j(l,In(o)),n.set(t,l));else{u=l.v!==Qe;var p=s(()=>In(o));j(l,p)}var m=Reflect.getOwnPropertyDescriptor(e,t);if(m?.set&&m.set.call(c,o),!u){if(r&&typeof t==`string`){var h=n.get(`length`),g=Number(t);Number.isInteger(g)&&g>=h.v&&j(h,g+1)}Pn(i)}return!0},ownKeys(e){I(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==Qe});for(var[r,a]of n)a.v!==Qe&&!(r in e)&&t.push(r);return t},setPrototypeOf(){Je()}})}function Ln(e){try{if(typeof e==`object`&&e&&Oe in e)return e[Oe]}catch{}return e}function dee(e,t){return Object.is(Ln(e),Ln(t))}new Set([`copyWithin`,`fill`,`pop`,`push`,`reverse`,`shift`,`sort`,`splice`,`unshift`]);var Rn,zn,Bn,Vn,Hn;function Un(){if(Rn===void 0){Rn=window,zn=document,Bn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Vn=C(t,`firstChild`).get,Hn=C(t,`nextSibling`).get,ae(e)&&(e[Me]=void 0,e[je]=null,e[Ne]=void 0,e.__e=void 0),ae(n)&&(n[Pe]=void 0)}}function Wn(e=``){return document.createTextNode(e)}function Gn(e){return Vn.call(e)}function Kn(e){return Hn.call(e)}function M(e,t){if(!ot)return Gn(e);var n=Gn(ct);if(n===null)n=ct.appendChild(Wn());else if(t&&n.nodeType!==3){var r=Wn();return n?.before(r),lt(r),r}return t&&Xn(n),lt(n),n}function N(e,t=!1){if(!ot){var n=Gn(e);return n instanceof Comment&&n.data===``?Kn(n):n}if(t){if(ct?.nodeType!==3){var r=Wn();return ct?.before(r),lt(r),r}Xn(ct)}return ct}function P(e,t=1,n=!1){let r=ot?ct:e;for(var i;t--;)i=r,r=Kn(r);if(!ot)return r;if(n){if(r?.nodeType!==3){var a=Wn();return r===null?i?.after(a):r.before(a),lt(a),a}Xn(r)}return lt(r),r}function qn(e){e.textContent=``}function Jn(){return!gt||Sn!==null?!1:(Pr.f&_e)!==0}function Yn(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function Xn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Zn(e,t){if(t){let t=document.body;e.autofocus=!0,Mt(()=>{document.activeElement===t&&e.focus()})}}function Qn(e){ot&&Gn(e)!==null&&qn(e)}var $n=!1;function er(){$n||($n=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[Fe]?.()})},{capture:!0}))}function tr(e){var t=jr,n=Pr;Nr(null),Fr(null);try{return e()}finally{Nr(t),Fr(n)}}function nr(e,t,n,r=n){e.addEventListener(t,()=>tr(n));let i=e[Fe];i?e[Fe]=()=>{i(),r(!0)}:e[Fe]=()=>r(!0),er()}function rr(e){Pr===null&&(jr===null&&Ue(e),He()),kr&&Ve(e)}function fee(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function ir(e,t){var n=Pr;n!==null&&n.f&8192&&(e|=he);var r={ctx:St,deps:null,nodes:null,f:e|pe|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};ln?.register_created_effect(r);var i=r;if(e&4)hn===null?yn.ensure().schedule(r):hn.push(r);else if(t!==null){try{Xr(r)}catch(e){throw yr(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ye))}if(i!==null&&(i.parent=n,n!==null&&fee(i,n),jr!==null&&jr.f&2&&!(e&64))){var a=jr;(a.effects??=[]).push(i)}return r}function ar(){return jr!==null&&!Mr}function or(e){let t=ir(8,null);return It(t,fe),t.teardown=e,t}function sr(e){rr(`$effect`);var t=Pr.f;if(!jr&&t&32&&St!==null&&!St.i){var n=St;(n.e??=[]).push(e)}else return cr(e)}function cr(e){return ir(4|Se,e)}function lr(e){return rr(`$effect.pre`),ir(8|Se,e)}function ur(e){yn.ensure();let t=ir(64|xe,e);return()=>{yr(t)}}function pee(e){yn.ensure();let t=ir(64|xe,e);return(e={})=>new Promise(n=>{e.outro?Sr(t,()=>{yr(t),n(void 0)}):(yr(t),n(void 0))})}function dr(e){return ir(4,e)}function mee(e){return ir(Ee|xe,e)}function fr(e,t=0){return ir(8|t,e)}function F(e,t=[],n=[],r=[]){qt(r,t,n,t=>{ir(8,()=>{e(...t.map(I))})})}function pr(e,t=0){return ir(16|t,e)}function mr(e,t=0){return ir(de|t,e)}function hr(e){return ir(32|xe,e)}function gr(e){var t=e.teardown;if(t!==null){let e=kr,n=jr;Ar(!0),Nr(null);try{t.call(null)}finally{Ar(e),Nr(n)}}}function _r(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&tr(()=>{e.abort(Ie)});var r=n.next;n.f&64?n.parent=null:yr(n,t),n=r}}function vr(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||yr(t),t=n}}function yr(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(br(e.nodes.start,e.nodes.end),n=!0),e.f|=ve,_r(e,t&&!n),Yr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();gr(e),e.f^=ve,e.f|=ge;var i=e.parent;i!==null&&i.first!==null&&xr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function br(e,t){for(;e!==null;){var n=e===t?null:Kn(e);e.remove(),e=n}}function xr(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Sr(e,t,n=!0){var r=[];Cr(e,r,!0);var i=()=>{n&&yr(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Cr(e,t,n){if(!(e.f&8192)){e.f^=he;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;Cr(i,t,o?n:!1)}i=a}}}function wr(e){Tr(e,!0)}function Tr(e,t){if(e.f&8192){e.f^=he,e.f&1024||(It(e,pe),yn.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;Tr(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Er(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Kn(n);t.append(n),n=i}}var Dr=null,Or=!1,kr=!1;function Ar(e){kr=e}var jr=null,Mr=!1;function Nr(e){jr=e}var Pr=null;function Fr(e){Pr=e}var Ir=null;function Lr(e){jr!==null&&(!gt||jr.f&2)&&(Ir??=new Set).add(e)}var Rr=null,zr=0,Br=null;function hee(e){Br=e}var Vr=1,Hr=0,Ur=Hr;function Wr(e){Ur=e}function Gr(){return++Vr}function Kr(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~we),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Kr(a)&&rn(a),a.wv>e.wv)return!0}t&512&&dn===null&&It(e,fe)}return!1}function qr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!gt&&Ir!==null&&Ir.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?qr(a,t,!1):t===a&&(n?It(a,pe):a.f&1024&&It(a,me),En(a))}}function Jr(e){var t=Rr,n=zr,r=Br,i=jr,a=Ir,o=St,s=Mr,c=Ur,l=e.f;Rr=null,zr=0,Br=null,jr=l&96?null:e,Ir=null,Ct(e.ctx),Mr=!1,Ur=++Hr,e.ac!==null&&(tr(()=>{e.ac.abort(Ie)}),e.ac=null);try{e.f|=Te;var u=e.fn,d=u();e.f|=_e;var f=e.deps,p=ln?.is_fork;if(Rr!==null){var m;if(p||Yr(e,zr),f!==null&&zr>0)for(f.length=zr+Rr.length,m=0;m<Rr.length;m++)f[zr+m]=Rr[m];else e.deps=f=Rr;if(ar()&&e.f&512)for(m=zr;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&zr<f.length&&(Yr(e,zr),f.length=zr);if(Dt()&&Br!==null&&!Mr&&f!==null&&!(e.f&6146))for(m=0;m<Br.length;m++)qr(Br[m],e);if(i!==null&&i!==e){if(Hr++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Hr;if(t!==null)for(let e of t)e.rv=Hr;Br!==null&&(r===null?r=Br:r.push(...Br))}return e.f&8388608&&(e.f^=De),d}catch(e){return Nt(e)}finally{e.f^=Te,Rr=t,zr=n,Br=r,jr=i,Ir=a,Ct(o),Mr=s,Ur=c}}function gee(e,t){let n=t.reactions;if(n!==null){var r=b.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(Rr===null||!x.call(Rr,t))){var a=t;a.f&512&&(a.f^=512,a.f&=~we),a.v!==Qe&&Lt(a),an(a),Yr(a,0)}}function Yr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)gee(e,n[r])}function Xr(e){var t=e.f;if(!(t&16384)){It(e,fe);var n=Pr,r=Or;Pr=e,Or=!0;try{t&16777232?vr(e):_r(e),gr(e);var i=Jr(e);e.teardown=typeof i==`function`?i:null,e.wv=Vr}finally{Or=r,Pr=n}}}async function Zr(){if(gt)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),bn()}function I(e){var t=(e.f&2)!=0;if(Dr?.add(e),jr!==null&&!Mr&&!(Pr!==null&&Pr.f&16384)&&(Ir===null||!Ir.has(e))){var n=jr.deps;if(jr.f&2097152)e.rv<Hr&&(e.rv=Hr,Rr===null&&n!==null&&n[zr]===e?zr++:Rr===null?Rr=[e]:Rr.push(e));else{jr.deps??=[],x.call(jr.deps,e)||jr.deps.push(e);var r=e.reactions;r===null?e.reactions=[jr]:x.call(r,jr)||r.push(jr)}}if(kr&&An.has(e))return An.get(e);if(t){var i=e;if(kr){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||$r(i))&&(a=nn(i)),An.set(i,a),a}var o=(i.f&512)==0&&!Mr&&jr!==null&&(Or||(jr.f&512)!=0),s=(i.f&_e)===0;Kr(i)&&(o&&(i.f|=512),rn(i)),o&&!s&&(on(i),Qr(i))}if(dn?.has(e))return dn.get(e);if(e.f&8388608)throw e.v;return e.v}function Qr(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(on(t),Qr(t))}function $r(e){if(e.v===Qe)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(An.has(t)||t.f&2&&$r(t))return!0;return!1}function ei(e){var t=Mr;try{return Mr=!0,e()}finally{Mr=t}}function ti(e){if(!(typeof e!=`object`||!e||e instanceof EventTarget)){if(Oe in e)ni(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n==`object`&&n&&Oe in n&&ni(n)}}}function ni(e,t=new Set){if(typeof e==`object`&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{ni(e[n],t)}catch{}let n=ie(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let t=te(n);for(let n in t){let r=t[n].get;if(r)try{r.call(e)}catch{}}}}}function ri(){return Symbol(nt)}function ii(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var ai=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function oi(e){return ai.includes(e)}var si=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),ci={formnovalidate:`formNoValidate`,ismap:`isMap`,nomodule:`noModule`,playsinline:`playsInline`,readonly:`readOnly`,defaultvalue:`defaultValue`,defaultchecked:`defaultChecked`,srcobject:`srcObject`,novalidate:`noValidate`,allowfullscreen:`allowFullscreen`,disablepictureinpicture:`disablePictureInPicture`,disableremoteplayback:`disableRemotePlayback`};function li(e){return e=e.toLowerCase(),ci[e]??e}[...si];var ui=[`touchstart`,`touchmove`];function di(e){return ui.includes(e)}var fi=[`textarea`,`script`,`style`,`title`];function pi(e){return fi.includes(e)}var mi=Symbol(`events`),hi=new Set,gi=new Set;function _i(e,t,n,r={}){function i(e){if(r.capture||Ci.call(t,e),!e.cancelBubble)return tr(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?Mt(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function vi(e,t,n,r={}){var i=_i(t,e,n,r);return()=>{e.removeEventListener(t,i,r)}}function yi(e,t,n,r,i){var a={capture:r,passive:i},o=_i(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&or(()=>{t.removeEventListener(e,o,a)})}function bi(e,t,n){(t[mi]??={})[e]=n}function xi(e){for(var t=0;t<e.length;t++)hi.add(e[t]);for(var n of gi)n(e)}var Si=null;function Ci(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;Si=e;var o=0,s=Si===e&&e[mi];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[mi]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){ee(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=jr,d=Pr;Nr(null),Fr(null);try{for(var f,p=[];a!==null&&a!==t;){try{var m=a[mi]?.[r];m!=null&&(!a.disabled||e.target===a)&&m.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble)break;o++,a=o<i.length?i[o]:null}if(f){for(let e of p)queueMicrotask(()=>{throw e});throw f}}finally{e[mi]=t,delete e.currentTarget,Nr(u),Fr(d)}}}var wi=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Ti(e){return wi?.createHTML(e)??e}function Ei(e){var t=Yn(`template`);return t.innerHTML=Ti(e.replaceAll(`<!>`,`<!---->`)),t.content}function Di(e,t){var n=Pr;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function L(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(ot)return Di(ct,null),ct;i===void 0&&(i=Ei(a?e:`<!>`+e),n||(i=Gn(i)));var t=r||Bn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Gn(t),s=t.lastChild;Di(o,s)}else Di(t,t);return t}}function _ee(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(ot)return Di(ct,null),ct;if(!o){var e=Gn(Ei(a));if(i)for(o=document.createDocumentFragment();Gn(e);)o.appendChild(Gn(e));else o=Gn(e)}var t=o.cloneNode(!0);if(i){var n=Gn(t),r=t.lastChild;Di(n,r)}else Di(t,t);return t}}function Oi(e,t){return _ee(e,t,`svg`)}function ki(e=``){if(!ot){var t=Wn(e+``);return Di(t,t),t}var n=ct;return n.nodeType===3?Xn(n):(n.before(n=Wn()),lt(n)),Di(n,n),n}function R(){if(ot)return Di(ct,null),ct;var e=document.createDocumentFragment(),t=document.createComment(``),n=Wn();return e.append(t,n),Di(t,n),e}function z(e,t){if(ot){var n=Pr;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=ct),ut();return}e!==null&&e.before(t)}function Ai(){if(ot&&ct&&ct.nodeType===8&&ct.textContent?.startsWith(`$`)){let e=ct.textContent.substring(1);return ut(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function B(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[Pe]??=e.nodeValue)&&(e[Pe]=n,e.nodeValue=`${n}`)}function ji(e,t){return vee(e,t)}var Mi=new Map;function vee(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){Un();var c=void 0,l=pee(()=>{var o=n??t.appendChild(Wn());see(o,{pending:()=>{}},t=>{D({});var n=St;if(a&&(n.c=a),i&&(r.$$events=i),ot&&Di(t,null),c=e(t,r)||{},ot&&(Pr.nodes.end=ct,ct===null||ct.nodeType!==8||ct.data!==`]`))throw it(),Ze;O()},s);var l=new Set,u=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!l.has(r)){l.add(r);var i=di(r);for(let e of[t,document]){var a=Mi.get(e);a===void 0&&(a=new Map,Mi.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Ci,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return u(S(hi)),gi.add(u),()=>{for(var e of l)for(let n of[t,document]){var r=Mi.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Ci),r.delete(e),r.size===0&&Mi.delete(n)):r.set(e,i)}gi.delete(u),o!==n&&o.parentNode?.removeChild(o)}});return Ni.set(c,l),c}var Ni=new WeakMap;function yee(e,t){let n=Ni.get(e);return n?(Ni.delete(e),n(t)):Promise.resolve()}var Pi=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)wr(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(wr(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(yr(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Er(r,t),t.append(Wn()),this.#n.set(e,{effect:r,fragment:t})}else yr(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Sr(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(yr(n.effect),this.#n.delete(e))};ensure(e,t){var n=ln,r=Jn();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=Wn();i.append(a),this.#n.set(e,{effect:hr(()=>t(a)),fragment:i})}else this.#t.set(e,hr(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else ot&&(this.anchor=ct),this.#a(n)}};function V(e,t,n=!1){var r;ot&&(r=ct,ut());var i=new Pi(e),a=n?ye:0;function o(e,t){if(ot){var n=ft(r);if(e!==parseInt(n.substring(1))){var a=dt();lt(a),i.anchor=a,st(!1),i.ensure(e,t),st(!0);return}}i.ensure(e,t)}pr(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var bee=Symbol(`NaN`);function xee(e,t,n){ot&&ut();var r=new Pi(e),i=!Dt();pr(()=>{var e=t();e!==e&&(e=bee),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function Fi(e,t){return t}function See(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];Sr(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Ii(e,S(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else --o},!1)}if(o===0){var c=r.length===0&&n!==null;if(c){var l=n,u=l.parentNode;qn(u),u.append(l),e.items.clear()}Ii(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Ii(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=Ce,Er(a,document.createDocumentFragment())):yr(t[i],n)}}var Li;function Ri(e,t,n,r,i,a=null){var o=e,s=new Map;if(t&4){var c=e;o=ot?lt(Gn(c)):c.appendChild(Wn())}ot&&ut();var l=null,u=en(()=>{var e=n();return y(e)?e:e==null?[]:S(e)}),d,f=new Map,p=!0;function m(e){g.effect.f&16384||(g.pending.delete(e),g.fallback=l,Bi(g,d,o,t,r),l!==null&&(d.length===0?l.f&33554432?(l.f^=Ce,Hi(l,null,o)):wr(l):Sr(l,()=>{l=null})))}function h(e){g.pending.delete(e)}var g={effect:pr(()=>{d=I(u);var e=d.length;let c=!1;ot&&ft(o)===`[!`!=(e===0)&&(o=dt(),lt(o),st(!1),c=!0);for(var g=new Set,_=ln,v=Jn(),y=0;y<e;y+=1){ot&&ct.nodeType===8&&ct.data===`]`&&(o=ct,c=!0,st(!1));var b=d[y],x=r(b,y),S=p?null:s.get(x);S?(S.v&&Nn(S.v,b),S.i&&Nn(S.i,y),v&&_.unskip_effect(S.e)):(S=Vi(s,p?o:Li??=Wn(),b,x,y,i,t,n),p||(S.e.f|=Ce),s.set(x,S)),g.add(x)}if(e===0&&a&&!l&&(p?l=hr(()=>a(o)):(l=hr(()=>a(Li??=Wn())),l.f|=Ce)),e>g.size&&Be(``,``,``),ot&&e>0&<(dt()),!p)if(f.set(_,g),v){for(let[e,t]of s)g.has(e)||_.skip_effect(t.e);_.oncommit(m),_.ondiscard(h)}else m(_);c&&st(!0),I(u)}),flags:t,items:s,pending:f,outrogroups:null,fallback:l};p=!1,ot&&(o=ct)}function zi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Bi(e,t,n,r,i){var a=(r&8)!=0,o=t.length,s=e.items,c=zi(e.effect.first),l,u=null,d,f=[],p=[],m,h,g,_;if(a)for(_=0;_<o;_+=1)m=t[_],h=i(m,_),g=s.get(h).e,g.f&33554432||(g.nodes?.a?.measure(),(d??=new Set).add(g));for(_=0;_<o;_+=1){if(m=t[_],h=i(m,_),g=s.get(h).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(g),t.done.delete(g);if(g.f&8192&&(wr(g),a&&(g.nodes?.a?.unfix(),(d??=new Set).delete(g))),g.f&33554432)if(g.f^=Ce,g===c)Hi(g,null,n);else{var v=u?u.next:c;g===e.effect.last&&(e.effect.last=g.prev),g.prev&&(g.prev.next=g.next),g.next&&(g.next.prev=g.prev),Ui(e,u,g),Ui(e,g,v),Hi(g,v,n),u=g,f=[],p=[],c=zi(u.next);continue}if(g!==c){if(l!==void 0&&l.has(g)){if(f.length<p.length){var y=p[0],b;u=y.prev;var x=f[0],ee=f[f.length-1];for(b=0;b<f.length;b+=1)Hi(f[b],y,n);for(b=0;b<p.length;b+=1)l.delete(p[b]);Ui(e,x.prev,ee.next),Ui(e,u,x),Ui(e,ee,y),c=y,u=ee,--_,f=[],p=[]}else l.delete(g),Hi(g,c,n),Ui(e,g.prev,g.next),Ui(e,g,u===null?e.effect.first:u.next),Ui(e,u,g),u=g;continue}for(f=[],p=[];c!==null&&c!==g;)(l??=new Set).add(c),p.push(c),c=zi(c.next);if(c===null)continue}g.f&33554432||f.push(g),u=g,c=zi(g.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Ii(e,S(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||l!==void 0){var C=[];if(l!==void 0)for(g of l)g.f&8192||C.push(g);for(;c!==null;)!(c.f&8192)&&c!==e.fallback&&C.push(c),c=zi(c.next);var te=C.length;if(te>0){var ne=r&4&&o===0?n:null;if(a){for(_=0;_<te;_+=1)C[_].nodes?.a?.measure();for(_=0;_<te;_+=1)C[_].nodes?.a?.fix()}See(e,C,ne)}}a&&Mt(()=>{if(d!==void 0)for(g of d)g.nodes?.a?.apply()})}function Vi(e,t,n,r,i,a,o,s){var c=o&1?o&16?Mn(n):lee(n,!1,!1):null,l=o&2?Mn(i):null;return{v:c,i:l,e:hr(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Hi(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=Kn(r);if(a.before(r),r===i)return;r=o}}function Ui(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Wi(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;ot&&(o=lt(Gn(c)))}F(()=>{var e=Pr;if(s===(s=t()??``)){ot&&ut();return}if(n&&!ot){e.nodes=null,c.innerHTML=s,s!==``&&Di(Gn(c),c.lastChild);return}if(e.nodes!==null&&(br(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(ot){for(var a=ct.data,l=ut(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=Kn(l);if(l===null)throw it(),Ze;Di(ct,u),o=lt(l);return}var d=Yn(r?`svg`:i?`math`:`template`,r?et:i?tt:void 0);d.innerHTML=s;var f=r||i?d:d.content;if(Di(Gn(f),f.lastChild),r||i)for(;Gn(f);)o.before(Gn(f));else o.before(f)}})}function H(e,t,...n){var r=new Pi(e);pr(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},ye)}function U(e,t,n){var r;ot&&(r=ct,ut());var i=new Pi(e);pr(()=>{var e=t()??null;if(ot&&ft(r)===`[`!=(e!==null)){var a=dt();lt(a),i.anchor=a,st(!1),i.ensure(e,e&&(t=>n(t,e))),st(!0);return}i.ensure(e,e&&(t=>n(t,e)))},ye)}function Gi(e,t,n,r,i,a){let o=ot;ot&&ut();var s=null;ot&&ct.nodeType===1&&(s=ct,ut());var c=ot?ct:e,l=new Pi(c,!1);pr(()=>{let e=t()||null;var a=i?i():n||e===`svg`?et:void 0;if(e===null){l.ensure(null,null);return}return l.ensure(e,t=>{if(e){if(s=ot?s:Yn(e,a),Di(s,s),r){var n=null;ot&&pi(e)&&s.append(n=document.createComment(``));var i=ot?Gn(s):s.appendChild(Wn());ot&&(i===null?st(!1):lt(i)),r(s,i),n?.remove()}Pr.nodes.end=s,t.before(s)}ot&<(t)}),()=>{}},ye),or(()=>{}),o&&(st(!0),lt(c))}function Ki(e,t){let n=null,r=ot;var i;if(ot){n=ct;for(var a=Gn(document.head);a!==null&&(a.nodeType!==8||a.data!==e);)a=Kn(a);if(a===null)st(!1);else{var o=Kn(a);a.remove(),lt(o)}}ot||(i=document.head.appendChild(Wn()));try{pr(()=>{var e=hr(()=>t(i));e.f|=be})}finally{r&&(st(!0),lt(n))}}function qi(e,t,n){dr(()=>{var r=ei(()=>t(e,n?.())||{});if(n&&r?.update){var i=!1,a={};fr(()=>{var e=n();ti(e),i&&mt(a,e)&&(a=e,r.update(e))}),i=!0}if(r?.destroy)return()=>r.destroy()})}function Ji(e,t){var n=void 0,r;mr(()=>{n!==(n=t())&&(r&&=(yr(r),null),n&&(r=hr(()=>{dr(()=>n(e))})))})}function Yi(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Yi(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Xi(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Yi(e))&&(r&&(r+=` `),r+=t);return r}function Zi(e){return typeof e==`object`?Xi(e):e??``}var Qi=[...`
|
|
3
|
-
\r\f\xA0\v`];function $i(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Qi.includes(r[o-1]))&&(s===r.length||Qi.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function ea(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function ta(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function na(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(ta)),i&&c.push(...Object.keys(i).map(ta));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=ta(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=ea(r)),i&&(n+=ea(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function ra(e,t,n,r,i,a){var o=e[Me];if(ot||o!==n||o===void 0){var s=$i(n,r,a);(!ot||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[Me]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function ia(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function aa(e,t,n,r){var i=e[Ne];if(ot||i!==t){var a=na(t,r);(!ot||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[Ne]=t}else r&&(Array.isArray(r)?(ia(e,n?.[0],r[0]),ia(e,n?.[1],r[1],`important`)):ia(e,n,r));return r}function oa(e,t,n=!1){if(e.multiple){if(t==null)return;if(!y(t))return at();for(var r of e.options)r.selected=t.includes(ca(r));return}for(r of e.options)if(dee(ca(r),t)){r.selected=!0;return}(!n||t!==void 0)&&(e.selectedIndex=-1)}function sa(e){var t=new MutationObserver(()=>{oa(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),or(()=>{t.disconnect()})}function ca(e){return`__value`in e?e.__value:e.value}var la=Symbol(`class`),ua=Symbol(`style`),da=Symbol(`is custom element`),fa=Symbol(`is html`),pa=Le?`link`:`LINK`,ma=Le?`input`:`INPUT`,ha=Le?`option`:`OPTION`,ga=Le?`select`:`SELECT`,_a=Le?`progress`:`PROGRESS`;function va(e){if(ot){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;W(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;W(e,`checked`,null),e.checked=r}}};e[Fe]=n,Mt(n),er()}}function ya(e,t){var n=Ca(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==_a)||(e.value=t??``)}function ba(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function W(e,t,n,r){var i=Ca(e);ot&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===pa)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[Ae]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&Ta(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function xa(e,t,n,r,i=!1,a=!1){if(ot&&i&&e.nodeName===ma){var o=e;(o.type===`checkbox`?`defaultChecked`:`defaultValue`)in n||va(o)}var s=Ca(e),c=s[da],l=!s[fa];let u=ot&&c;u&&st(!1);var d=t||{},f=e.nodeName===ha;for(var p in t)p in n||(n[p]=null);n.class?n.class=Zi(n.class):(r||n[la])&&(n.class=null),n[ua]&&(n.style??=null);var m=Ta(e);if(e.nodeName===ma&&`type`in n&&(`value`in n||`__value`in n)){var h=n.type;(h!==d.type||h===void 0&&e.hasAttribute(`type`))&&(d.type=h,W(e,`type`,h,a))}for(let i in n){let o=n[i];if(f&&i===`value`&&o==null){e.value=e.__value=``,d[i]=o;continue}if(i===`class`){ra(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,o,r,t?.[la],n[la]),d[i]=o,d[la]=n[la];continue}if(i===`style`){aa(e,o,t?.[ua],n[ua]),d[i]=o,d[ua]=n[ua];continue}var g=d[i];if(!(o===g&&!(o===void 0&&e.hasAttribute(i)))){d[i]=o;var _=i[0]+i[1];if(_!==`$$`)if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var v=oi(r);if(ii(r)&&(r=r.slice(0,-7),t.capture=!0),!v&&g){if(o!=null)continue;e.removeEventListener(r,d[n],t),d[n]=null}if(v)bi(r,e,o),xi([r]);else if(o!=null){function a(e){d[i].call(this,e)}d[n]=_i(r,e,a,t)}}else if(i===`style`)W(e,i,o);else if(i===`autofocus`)Zn(e,!!o);else if(!c&&(i===`__value`||i===`value`&&o!=null))e.value=e.__value=o;else if(i===`selected`&&f)ba(e,o);else{var y=i;l||(y=li(y));var b=y===`defaultValue`||y===`defaultChecked`;if(o==null&&!c&&!b)if(s[i]=null,y===`value`||y===`checked`){let n=e,r=t===void 0;if(y===`value`){let e=n.defaultValue;n.removeAttribute(y),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(y),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i);else b||m.includes(y)&&(c||typeof o!=`string`)?(e[y]=o,y in s&&(s[y]=Qe)):typeof o!=`function`&&W(e,y,o,a)}}}return u&&st(!0),d}function Sa(e,t,n=[],r=[],i=[],a,o=!1,s=!1){qt(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===ga,l=!1;if(mr(()=>{var u=t(...n.map(I)),d=xa(e,r,u,a,o,s);l&&c&&`value`in u&&oa(e,u.value);for(let e of Object.getOwnPropertySymbols(i))u[e]||yr(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var f=u[t];t.description===`@attach`&&(!r||f!==r[t])&&(i[t]&&yr(i[t]),i[t]=hr(()=>Ji(e,()=>f))),d[t]=f}r=d}),c){var u=e;dr(()=>{oa(u,r.value,!0),sa(u)})}l=!0})}function Ca(e){return e[je]??={[da]:e.nodeName.includes(`-`),[fa]:e.namespaceURI===$e}}var wa=new Map;function Ta(e){var t=e.getAttribute(`is`)||e.nodeName,n=wa.get(t);if(n)return n;wa.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=te(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.push(o);i=ie(i)}return n}function Ea(e,t,n=t){var r=new WeakSet;nr(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=Da(e)?Oa(a):a,n(a),ln!==null&&r.add(ln),await Zr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(ot&&e.defaultValue!==e.value||ei(t)==null&&e.value)&&(n(Da(e)?Oa(e.value):e.value),ln!==null&&r.add(ln)),fr(()=>{var n=t();if(e===document.activeElement){var i=gt?un:ln;if(r.has(i))return}Da(e)&&n===Oa(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function Da(e){var t=e.type;return t===`number`||t===`range`}function Oa(e){return e===``?null:+e}function Cee(e,t,n=t){nr(e,`change`,()=>{n(e.files)}),ot&&e.files&&n(e.files),fr(()=>{e.files=t()})}function ka(e,t){return e===t||e?.[Oe]===t}function Aa(e={},t,n,r){var i=St.r,a=Pr;return dr(()=>{var o,s;return fr(()=>{o=s,s=r?.()||[],ei(()=>{ka(n(...s),e)||(t(e,...s),o&&ka(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&ka(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function ja(e=!1){let t=St,n=t.l.u;if(!n)return;let r=()=>ti(t.s);if(e){let e=0,n={},i=Zt(()=>{let r=!1,i=t.s;for(let e in i)i[e]!==n[e]&&(n[e]=i[e],r=!0);return r&&e++,e});r=()=>I(i)}n.b.length&&lr(()=>{Ma(t,r),ce(n.b)}),sr(()=>{let e=ei(()=>n.m.map(se));return()=>{for(let t of e)typeof t==`function`&&t()}}),n.a.length&&sr(()=>{Ma(t,r),ce(n.a)})}function Ma(e,t){if(e.l.s)for(let t of e.l.s)I(t);t()}var wee={get(e,t){if(!e.exclude.has(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.has(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))}};function G(e,t,n){return new Proxy({props:e,exclude:t},wee)}var Tee={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(oe(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];oe(i)&&(i=i());let a=C(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(oe(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=C(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===Oe||t===ke)return!1;for(let n of e.props)if(oe(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(oe(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function K(...e){return new Proxy({props:e},Tee)}function q(e,t,n,r){var i=!_t||(n&2)!=0,a=(n&8)!=0,o=(n&16)!=0,s=r,c=!0,l=void 0,u=()=>o&&i?(l??=Zt(r),I(l)):(c&&(c=!1,s=o?ei(r):r),s);let d;if(a){var f=Oe in e||ke in e;d=C(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=aee(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&Ge(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?Zt:en)(()=>(_=!1,h()));a&&I(v);var y=Pr;return(function(e,t){if(arguments.length>0){let n=t?I(v):i&&a?In(e):e;return j(v,n),_=!0,s!==void 0&&(s=n),e}return kr&&_||y.f&16384?v.v:I(v)})}function Na(e){St===null&&Re(`onMount`),_t&&St.l!==null?Eee(St).m.push(e):sr(()=>{let t=ei(e);if(typeof t==`function`)return t})}function Pa(e){St===null&&Re(`onDestroy`),Na(()=>()=>ei(e))}function Eee(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`),vt();var Fa=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Dee={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ia=new class{#e=Dee;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Oee(e){setTimeout(e,0)}var La=typeof window>`u`||`Deno`in globalThis;function Ra(){}function kee(e,t){return typeof e==`function`?e(t):e}function Aee(e){return typeof e==`number`&&e>=0&&e!==1/0}function jee(e,t){return Math.max(e+(t||0)-Date.now(),0)}function za(e,t){return typeof e==`function`?e(t):e}function Mee(e,t){return typeof e==`function`?e(t):e}function Ba(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Ha(o,t.options))return!1}else if(!Wa(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Va(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Ua(t.options.mutationKey)!==Ua(a))return!1}else if(!Wa(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ha(e,t){return(t?.queryKeyHashFn||Ua)(e)}function Ua(e){return JSON.stringify(e,(e,t)=>qa(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Wa(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Wa(e[n],t[n])):!1}var Nee=Object.prototype.hasOwnProperty;function Ga(e,t){if(e===t)return e;let n=Ka(e)&&Ka(t);if(!n&&!(qa(e)&&qa(t)))return t;let r=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),a=i.length,o=n?Array(a):{},s=0;for(let c=0;c<a;c++){let a=n?c:i[c],l=e[a],u=t[a];if(l===u){o[a]=l,(n?c<r:Nee.call(e,a))&&s++;continue}if(l===null||u===null||typeof l!=`object`||typeof u!=`object`){o[a]=u;continue}let d=Ga(l,u);o[a]=d,d===l&&s++}return r===a&&s===r?e:o}function Ka(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qa(e){if(!Ja(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ja(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Ja(e){return Object.prototype.toString.call(e)===`[object Object]`}function Pee(e){return new Promise(t=>{Ia.setTimeout(t,e)})}function Ya(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Ga(e,t)}function Xa(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Za(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Qa=Symbol();function $a(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Qa?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var eo=new class extends Fa{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!La&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function to(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var no=Oee;function ro(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=no,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var io=ro(),ao=new class extends Fa{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!La&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function oo(e){return Math.min(1e3*2**e,3e4)}function so(e){return(e??`online`)===`online`?ao.isOnline():!0}var co=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function lo(e){let t=!1,n=0,r,i=to(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new co(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>eo.isFocused()&&(e.networkMode===`always`||ao.isOnline())&&e.canRun(),u=()=>so(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(La?0:3),o=e.retryDelay??oo,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Pee(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var uo=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Aee(this.gcTime)&&(this.#e=Ia.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(La?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(Ia.clearTimeout(this.#e),void 0)}},fo=class extends uo{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=mo(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=mo(this.options);e.data!==void 0&&(this.setData(e.data,{updatedAt:e.dataUpdatedAt,manual:!0}),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=Ya(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(Ra).catch(Ra):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Mee(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Qa||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>za(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!jee(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=$a(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=lo({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof co&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof co){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#s({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...po(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:`success`,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),io.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function po(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:so(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function mo(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}function ho(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener(`abort`,()=>{n=!0}),t.signal)})},u=$a(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Za:Xa;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?_o:go,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:go(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function go(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function _o(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var vo=class extends uo{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||yo(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=lo({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),await this.#n.config.onMutate?.(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{throw await this.#n.config.onError?.(t,e,this.state.context,this,n),await this.options.onError?.(t,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,t,e,this.state.context,n),t}finally{this.#i({type:`error`,error:t})}}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),io.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function yo(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var bo=class extends Fa{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new vo({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=xo(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=xo(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=xo(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=xo(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){io.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Va(t,e))}findAll(e={}){return this.getAll().filter(t=>Va(e,t))}notify(e){io.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return io.batch(()=>Promise.all(e.map(e=>e.continue().catch(Ra))))}};function xo(e){return e.options.scope?.id}var So=class extends Fa{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Ha(r,t),a=this.get(i);return a||(a=new fo({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){io.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ba(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Ba(e,t)):t}notify(e){io.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){io.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){io.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Co=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new So,this.#t=e.mutationCache||new bo,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=eo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ao.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(za(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=kee(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return io.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;io.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return io.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=io.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Ra).catch(Ra)}invalidateQueries(e,t={}){return io.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=io.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Ra)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Ra)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(za(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ra).catch(Ra)}fetchInfiniteQuery(e){return e.behavior=ho(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ra).catch(Ra)}ensureInfiniteQueryData(e){return e.behavior=ho(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ao.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Ua(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Wa(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Ua(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Wa(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Ha(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Qa&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},wo=Symbol(`QueryClient`),To=e=>{Tt(wo,e)},Eo=[`forEach`,`isDisjointFrom`,`isSubsetOf`,`isSupersetOf`],Do=[`difference`,`intersection`,`symmetricDifference`,`union`],Oo=!1,ko=class e extends Set{#e=new Map;#t=A(0);#n=A(0);#r=Ur||-1;constructor(e){if(super(),e){for(var t of e)super.add(t);this.#n.v=super.size}Oo||this.#a()}#i(e){return Ur===this.#r?A(e):Mn(e)}#a(){Oo=!0;var t=e.prototype,n=Set.prototype;for(let e of Eo)t[e]=function(...t){return I(this.#t),n[e].apply(this,t)};for(let r of Do)t[r]=function(...t){return I(this.#t),new e(n[r].apply(this,t))}}has(e){var t=super.has(e),n=this.#e,r=n.get(e);if(r===void 0){if(!t)return I(this.#t),!1;r=this.#i(!0),n.set(e,r)}return I(r),t}add(e){return super.has(e)||(super.add(e),j(this.#n,super.size),Pn(this.#t)),this}delete(e){var t=super.delete(e),n=this.#e,r=n.get(e);return r!==void 0&&(n.delete(e),j(r,!1)),t&&(j(this.#n,super.size),Pn(this.#t)),t}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var t of e.values())j(t,!1);e.clear(),j(this.#n,0),Pn(this.#t)}}keys(){return this.values()}values(){return I(this.#t),super.values()}entries(){return I(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return I(this.#n)}},Ao=class extends Map{#e=new Map;#t=A(0);#n=A(0);#r=Ur||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return Ur===this.#r?A(e):Mn(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else return I(this.#t),!1;return I(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0)if(super.has(e))n=this.#i(0),t.set(e,n);else{I(this.#t);return}return I(n),super.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),j(this.#n,super.size),Pn(o);else if(i!==t){Pn(r);var s=o.reactions===null?null:new Set(o.reactions);(s===null||!r.reactions?.every(e=>s.has(e)))&&Pn(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),j(n,-1)),r&&(j(this.#n,super.size),Pn(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;j(this.#n,0);for(var t of e.values())j(t,-1);Pn(this.#t),e.clear()}}#a(){I(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)I(n)}keys(){return I(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return I(this.#n),super.size}},jo=class{#e;#t;constructor(e,t){this.#e=e,this.#t=Kt(t)}get current(){return this.#t(),this.#e()}},Mo=/\(.+\)/,No=new Set([`all`,`print`,`screen`,`and`,`or`,`not`,`only`]),Po=class extends jo{constructor(e,t){let n=Mo.test(e)||e.split(/[\s,]+/).some(e=>No.has(e.trim()))?e:`(${e})`,r=window.matchMedia(n);super(()=>r.matches,e=>vi(r,`change`,e))}};function Fo(e,t){D(t,!0);let n=q(t,`client`,19,()=>new Co);Na(()=>{n().mount()}),To(n()),Pa(()=>{n().unmount()});var r=R();H(N(r),()=>t.children),z(e,r),O()}var Io=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function Lo(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}new class{#e;#t;constructor(e={}){let{window:t=Io,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Kt(e=>{let n=vi(t,`focusin`,e),r=vi(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?Lo(this.#e):null}};function Ro(e,t){switch(e){case`post`:sr(t);break;case`pre`:lr(t);break}}function zo(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;Ro(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=ei(()=>n(t,o));return o=t,r})}function Bo(e,t,n){let r=ur(()=>{let i=!1;zo(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});sr(()=>r)}function Vo(e,t,n){zo(e,`post`,t,n)}function Ho(e,t,n){zo(e,`pre`,t,n)}Vo.pre=Ho;function Uo(e,t){Bo(e,`post`,t)}function Wo(e,t){Bo(e,`pre`,t)}Uo.pre=Wo;function Go(e,t){switch(e){case`local`:return t.localStorage;case`session`:return t.sessionStorage}}var Ko=class{#e;#t;#n;#r;#i;#a=A(0);constructor(e,t,n={}){let{storage:r=`local`,serializer:i={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:a=!0,window:o=Io}=n;if(this.#e=t,this.#t=e,this.#n=i,o===void 0)return;let s=Go(r,o);this.#r=s;let c=s.getItem(e);c===null?this.#c(t):this.#e=this.#s(c),a&&r===`local`&&(this.#i=Kt(()=>vi(o,`storage`,this.#o)))}get current(){this.#i?.(),I(this.#a);let e=this.#s(this.#r?.getItem(this.#t))??this.#e,t=new WeakMap,n=r=>{if(r===null||r?.constructor.name===`Date`||typeof r!=`object`)return r;let i=t.get(r);return i||(i=new Proxy(r,{get:(e,t)=>(I(this.#a),n(Reflect.get(e,t))),set:(t,n,r)=>(j(this.#a,I(this.#a)+1),Reflect.set(t,n,r),this.#c(e),!0)}),t.set(r,i)),i};return n(e)}set current(e){this.#c(e),j(this.#a,I(this.#a)+1)}#o=e=>{e.key!==this.#t||e.newValue===null||(this.#e=this.#s(e.newValue),j(this.#a,I(this.#a)+1))};#s(e){try{return this.#n.deserialize(e)}catch(t){console.error(`Error when parsing "${e}" from persisted store "${this.#t}"`,t);return}}#c(e){try{e!=null&&this.#r?.setItem(this.#t,this.#n.serialize(e))}catch(e){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#r}`,e)}}};function qo(e,t){let n,r=null;return(...i)=>new Promise(a=>{r&&r(void 0),r=a,clearTimeout(n),n=setTimeout(async()=>{let t=await e(...i);r&&=(r(t),null)},t)})}function Jo(e,t){let n=0,r=null;return(...i)=>{let a=Date.now();return n&&a-n<t?r??Promise.resolve(void 0):(n=a,r=e(...i),r)}}function Yo(e,t,n={},r){let{lazy:i=!1,once:a=!1,initialValue:o,debounce:s,throttle:c}=n,l=A(In(o)),u=A(!1),d=A(void 0),f=A(In([])),p=()=>{I(f).forEach(e=>e()),j(f,[],!0)},m=e=>{j(f,[...I(f),e],!0)},h=async(e,n,r=!1)=>{try{j(u,!0),j(d,void 0),p();let i=new AbortController;m(()=>i.abort());let a=await t(e,n,{data:I(l),refetching:r,onCleanup:m,signal:i.signal});return j(l,a,!0),a}catch(e){e instanceof DOMException&&e.name===`AbortError`||j(d,e,!0);return}finally{j(u,!1)}},g=s?qo(h,s):c?Jo(h,c):h,_=Array.isArray(e)?e:[e],v;return r((t,n)=>{a&&v||v&&JSON.stringify(t)===JSON.stringify(v)||(v=t,g(Array.isArray(e)?t:t[0],Array.isArray(e)?n:n?.[0]))},{lazy:i}),{get current(){return I(l)},get loading(){return I(u)},get error(){return I(d)},mutate:e=>{j(l,e,!0)},refetch:t=>{let n=_.map(e=>e());return g(Array.isArray(e)?n:n[0],Array.isArray(e)?n:n[0],t??!0)}}}function Xo(e,t,n){return Yo(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Vo(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}function Zo(e,t,n){return Yo(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Vo.pre(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}Xo.pre=Zo;function Qo(e){return e.filter(e=>e.length>0)}var $o={getItem:e=>null,setItem:(e,t)=>{}},es=typeof document<`u`;function ts(e){return typeof e==`function`}function ns(e){return typeof e==`object`&&!!e}var rs=Symbol(`box`),is=Symbol(`is-writable`);function as(e){return ns(e)&&rs in e}function os(e){return ss.isBox(e)&&is in e}function ss(e){let t=A(In(e));return{[rs]:!0,[is]:!0,get current(){return I(t)},set current(e){j(t,e,!0)}}}function cs(e,t){let n=k(e);return t?{[rs]:!0,[is]:!0,get current(){return I(n)},set current(e){t(e)}}:{[rs]:!0,get current(){return e()}}}function ls(e){return ss.isBox(e)?e:ts(e)?ss.with(e):ss(e)}function us(e){return Object.entries(e).reduce((e,[t,n])=>ss.isBox(n)?(ss.isWritableBox(n)?Object.defineProperty(e,t,{get(){return n.current},set(e){n.current=e}}):Object.defineProperty(e,t,{get(){return n.current}}),e):Object.assign(e,{[t]:n}),{})}function ds(e){return ss.isWritableBox(e)?{[rs]:!0,get current(){return e.current}}:e}ss.from=ls,ss.with=cs,ss.flatten=us,ss.readonly=ds,ss.isBox=as,ss.isWritableBox=os;var fs=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ps=/\n/g,ms=/^\s*/,hs=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,gs=/^:\s*/,_s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,vs=/^[;\s]*/,ys=/^\s+|\s+$/g,bs=`
|
|
4
|
-
`,xs=`/`,Ss=`*`,Cs=``,ws=`comment`,Ts=`declaration`;function Es(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(ps);t&&(n+=t.length);var i=e.lastIndexOf(bs);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(ms)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(!(xs!=e.charAt(0)||Ss!=e.charAt(1))){for(var n=2;Cs!=e.charAt(n)&&(Ss!=e.charAt(n)||xs!=e.charAt(n+1));)++n;if(n+=2,Cs===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:ws,comment:o})}}function f(){var e=a(),t=c(hs);if(t){if(d(),!c(gs))return s(`property missing ':'`);var n=c(_s),r=e({type:Ts,property:Ds(t[0].replace(fs,Cs)),value:n?Ds(n[0].replace(fs,Cs)):Cs});return c(vs),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function Ds(e){return e?e.replace(ys,Cs):Cs}function Os(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Es(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}function ks(e,t){let n=RegExp(e,`g`);return e=>{if(typeof e!=`string`)throw TypeError(`expected an argument of type string, but got ${typeof e}`);return e.match(n)?e.replace(n,t):e}}var As=ks(/[A-Z]/,e=>`-${e.toLowerCase()}`);function js(e){if(!e||typeof e!=`object`||Array.isArray(e))throw TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${As(t)}: ${e[t]};`).join(`
|
|
5
|
-
`)}function Ms(e={}){return js(e).replace(`
|
|
6
|
-
`,` `)}Ms({position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,transform:`translateX(-100%)`});var Ns=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function Ps(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}new class{#e;#t;constructor(e={}){let{window:t=Ns,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Kt(e=>{let n=vi(t,`focusin`,e),r=vi(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?Ps(this.#e):null}};function Fs(e,t){switch(e){case`post`:sr(t);break;case`pre`:lr(t);break}}function Is(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;Fs(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=ei(()=>n(t,o));return o=t,r})}function Ls(e,t,n){let r=ur(()=>{let i=!1;Is(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});sr(()=>r)}function Rs(e,t,n){Is(e,`post`,t,n)}function zs(e,t,n){Is(e,`pre`,t,n)}Rs.pre=zs;function Bs(e,t){Ls(e,`post`,t)}function Vs(e,t){Ls(e,`pre`,t)}Bs.pre=Vs;var Hs=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return Et(this.#t)}get(){let e=wt(this.#t);if(e===void 0)throw Error(`Context "${this.#e}" not found`);return e}getOr(e){let t=wt(this.#t);return t===void 0?e:t}set(e){return Tt(this.#t,e)}},Us=ss(`mode-watcher-mode`),Ws=ss(`mode-watcher-theme`),Gs=[`dark`,`light`,`system`];function Ks(e){return typeof e==`string`?Gs.includes(e):!1}var qs=class{#e=`system`;#t=es?localStorage:$o;#n=this.#t.getItem(Us.current);#r=Ks(this.#n)?this.#n:this.#e;#i=A(In(this.#a()));#a(e=this.#r){return new Ko(Us.current,e,{serializer:{serialize:e=>e,deserialize:e=>Ks(e)?e:this.#e}})}constructor(){ur(()=>Vo.pre(()=>Us.current,(e,t)=>{let n=I(this.#i).current;j(this.#i,this.#a(n),!0),t&&localStorage.removeItem(t)}))}get current(){return I(this.#i).current}set current(e){I(this.#i).current=e}},Js=class{#e=void 0;#t=!0;#n=A(In(this.#e));#r=typeof window<`u`&&typeof window.matchMedia==`function`?new Po(`prefers-color-scheme: light`):{current:!1};query(){es&&j(this.#n,this.#r.current?`light`:`dark`,!0)}tracking(e){this.#t=e}constructor(){ur(()=>{lr(()=>{this.#t&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return I(this.#n)}},Ys=new qs,Xs=new Js,Zs=new class{#e=es?localStorage:$o;#t=this.#e.getItem(Ws.current);#n=this.#t===null||this.#t===void 0?``:this.#t;#r=A(In(this.#i()));#i(e=this.#n){return new Ko(Ws.current,e,{serializer:{serialize:e=>typeof e==`string`?e:``,deserialize:e=>e}})}constructor(){ur(()=>Vo.pre(()=>Ws.current,(e,t)=>{let n=I(this.#r).current;j(this.#r,this.#i(n),!0),t&&localStorage.removeItem(t)}))}get current(){return I(this.#r).current}set current(e){I(this.#r).current=e}},Qs,$s,ec=!1,tc=null;function Fee(){return tc||(tc=document.createElement(`style`),tc.appendChild(document.createTextNode(`* {
|
|
7
|
-
-webkit-transition: none !important;
|
|
8
|
-
-moz-transition: none !important;
|
|
9
|
-
-o-transition: none !important;
|
|
10
|
-
-ms-transition: none !important;
|
|
11
|
-
transition: none !important;
|
|
12
|
-
}`)),tc)}function nc(e,t=!1){if(typeof document>`u`)return;if(!ec){ec=!0,e();return}if(typeof window<`u`&&window.__vitest_worker__){e();return}clearTimeout(Qs),clearTimeout($s);let n=Fee(),r=()=>document.head.appendChild(n),i=()=>{n.parentNode&&document.head.removeChild(n)};function a(){e(),window.requestAnimationFrame(i)}if(window.requestAnimationFrame!==void 0){r(),t?a():window.requestAnimationFrame(()=>{a()});return}r(),Qs=window.setTimeout(()=>{e(),$s=window.setTimeout(i,16)},16)}var rc=ss(void 0),ic=ss(!0),ac=ss(!1),oc=ss([]),sc=ss([]);function Iee(){let e=k(()=>{if(!es)return;let e=Ys.current===`system`?Xs.current:Ys.current,t=Qo(oc.current),n=Qo(sc.current);function r(){let r=document.documentElement,i=document.querySelector(`meta[name="theme-color"]`);e===`light`?(t.length&&r.classList.remove(...t),n.length&&r.classList.add(...n),r.style.colorScheme=`light`,i&&rc.current&&i.setAttribute(`content`,rc.current.light)):(n.length&&r.classList.remove(...n),t.length&&r.classList.add(...t),r.style.colorScheme=`dark`,i&&rc.current&&i.setAttribute(`content`,rc.current.dark))}return ic.current?nc(r,ac.current):r(),e});return{get current(){return I(e)}}}function Lee(){let e=k(()=>{if(Zs.current,!es)return;function e(){document.documentElement.setAttribute(`data-theme`,Zs.current)}return ic.current?nc(e,ei(()=>ac.current)):e(),Zs.current});return{get current(){return I(e)}}}var cc=Iee(),Ree=Lee();function lc(e){Ys.current=e}function zee(e){Zs.current=e}function Bee(e){return e}function Vee({defaultMode:e=`system`,themeColors:t,darkClassNames:n=[`dark`],lightClassNames:r=[],defaultTheme:i=``,modeStorageKey:a=`mode-watcher-mode`,themeStorageKey:o=`mode-watcher-theme`}){let s=document.documentElement,c=localStorage.getItem(a)??e,l=localStorage.getItem(o)??i,u=c===`light`||c===`system`&&window.matchMedia(`(prefers-color-scheme: light)`).matches;if(u?(n.length&&s.classList.remove(...n.filter(Boolean)),r.length&&s.classList.add(...r.filter(Boolean))):(r.length&&s.classList.remove(...r.filter(Boolean)),n.length&&s.classList.add(...n.filter(Boolean))),s.style.colorScheme=u?`light`:`dark`,t){let e=document.querySelector(`meta[name="theme-color"]`);e&&e.setAttribute(`content`,c===`light`?t.light:t.dark)}l&&(s.setAttribute(`data-theme`,l),localStorage.setItem(o,l)),localStorage.setItem(a,c)}var Hee=L(`<meta name="theme-color"/>`);function Uee(e,t){D(t,!0);var n=R(),r=N(n),i=e=>{var n=Hee();F(()=>W(n,`content`,t.themeColors.dark)),z(e,n)};V(r,e=>{t.themeColors&&e(i)}),z(e,n),O()}var Wee=L(`<meta name="theme-color"/>`),Gee=L(`<!> <!>`,1);function Kee(e,t){D(t,!0);let n=q(t,`trueNonce`,3,``);Ki(`1c99ujd`,e=>{var r=Gee(),i=N(r),a=e=>{var n=Wee();F(()=>W(n,`content`,t.themeColors.dark)),z(e,n)};V(i,e=>{t.themeColors&&e(a)}),Wi(P(i,2),()=>`<script${n()?` nonce=${n()}`:``}>(`+Vee.toString()+`)(`+JSON.stringify(t.initConfig)+`);<\/script>`),z(e,r)}),O()}function qee(e,t){D(t,!0);let n=q(t,`track`,3,!0),r=q(t,`defaultMode`,3,`system`),i=q(t,`disableTransitions`,3,!0),a=q(t,`darkClassNames`,19,()=>[`dark`]),o=q(t,`lightClassNames`,19,()=>[]),s=q(t,`defaultTheme`,3,``),c=q(t,`nonce`,3,``),l=q(t,`themeStorageKey`,3,`mode-watcher-theme`),u=q(t,`modeStorageKey`,3,`mode-watcher-mode`),d=q(t,`disableHeadScriptInjection`,3,!1),f=q(t,`synchronousModeChanges`,3,!1);Us.current=u(),Ws.current=l(),oc.current=a(),sc.current=o(),ic.current=i(),rc.current=t.themeColors,ac.current=f(),lr(()=>{ac.current=f()}),lr(()=>{ic.current=i()}),lr(()=>{rc.current=t.themeColors}),lr(()=>{oc.current=a()}),lr(()=>{sc.current=o()}),lr(()=>{Us.current=u()}),lr(()=>{Ws.current=l()}),lr(()=>{cc.current,Us.current,Ws.current,Ree.current}),Na(()=>{Xs.tracking(n()),Xs.query();let e=localStorage.getItem(Us.current);lc(Ks(e)?e:r()),zee(localStorage.getItem(Ws.current)||s())});let p=Bee({defaultMode:r(),themeColors:t.themeColors,darkClassNames:a(),lightClassNames:o(),defaultTheme:s(),modeStorageKey:u(),themeStorageKey:l()}),m=k(()=>typeof window>`u`?c():``);var h=R(),g=N(h),_=e=>{Uee(e,{get themeColors(){return rc.current}})},v=e=>{Kee(e,{get trueNonce(){return I(m)},get initConfig(){return p},get themeColors(){return rc.current}})};V(g,e=>{d()?e(_):e(v,-1)}),z(e,h),O()}var Jee={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},Yee=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Xee=Symbol(`lucide-context`),Zee=()=>wt(Xee),Qee=new Set([`$$slots`,`$$events`,`$$legacy`,`name`,`color`,`size`,`strokeWidth`,`absoluteStrokeWidth`,`iconNode`,`children`]),$ee=Oi(`<svg><!><!></svg>`);function uc(e,t){D(t,!0);let n=Zee()??{},r=q(t,`color`,19,()=>n.color??`currentColor`),i=q(t,`size`,19,()=>n.size??24),a=q(t,`strokeWidth`,19,()=>n.strokeWidth??2),o=q(t,`absoluteStrokeWidth`,19,()=>n.absoluteStrokeWidth??!1),s=q(t,`iconNode`,19,()=>[]),c=G(t,Qee),l=k(()=>o()?Number(a())*24/Number(i()):a());var u=$ee();Sa(u,e=>({...Jee,...e,...c,width:i(),height:i(),stroke:r(),"stroke-width":I(l),class:[`lucide-icon lucide`,n.class,t.name&&`lucide-${t.name}`,t.class]}),[()=>!t.children&&!Yee(c)&&{"aria-hidden":`true`}]);var d=M(u);Ri(d,17,s,Fi,(e,t)=>{var n=k(()=>ue(I(t),2));let r=()=>I(n)[0],i=()=>I(n)[1];var a=R();Gi(N(a),r,!0,(e,t)=>{Sa(e,()=>({...i()}))}),z(e,a)}),H(P(d),()=>t.children??w),T(u),z(e,u),O()}var ete=new Set([`$$slots`,`$$events`,`$$legacy`]);function tte(e,t){let n=G(t,ete),r=[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`}]];uc(e,K({name:`bell`},()=>n,{get iconNode(){return r}}))}var nte=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},rte=(e,t)=>({classGroupId:e,validator:t}),dc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),fc=`-`,pc=[],ite=`arbitrary..`,ate=e=>{let t=ste(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ote(e);let n=e.split(fc);return mc(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?nte(i,t):t:i||pc}return n[e]||pc}}},mc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=mc(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(fc):e.slice(t).join(fc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},ote=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ite+r:void 0})(),ste=e=>{let{theme:t,classGroups:n}=e;return cte(n,t)},cte=(e,t)=>{let n=dc();for(let r in e){let i=e[r];hc(i,n,r,t)}return n},hc=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];lte(i,t,n,r)}},lte=(e,t,n,r)=>{if(typeof e==`string`){ute(e,t,n);return}if(typeof e==`function`){dte(e,t,n,r);return}fte(e,t,n,r)},ute=(e,t,n)=>{let r=e===``?t:gc(t,e);r.classGroupId=n},dte=(e,t,n,r)=>{if(pte(e)){hc(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(rte(n,e))},fte=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];hc(o,gc(t,a),n,r)}},gc=(e,t)=>{let n=e,r=t.split(fc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=dc(),n.nextPart.set(t,i)),n=i}return n},pte=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,mte=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},_c=`!`,vc=`:`,hte=[],yc=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),gte=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===vc){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(_c)?(c=s.slice(0,-1),l=!0):s.startsWith(_c)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return yc(t,l,c,u)};if(t){let e=t+vc,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):yc(hte,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},_te=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},vte=e=>({cache:mte(e.cacheSize),parseClassName:gte(e),sortModifiers:_te(e),postfixLookupClassGroupIds:yte(e),...ate(e)}),yte=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},bte=/\s+/,xte=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(bte),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+_c:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Ste=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=bc(n))&&(i&&(i+=` `),i+=r);return i},bc=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=bc(e[r]))&&(n&&(n+=` `),n+=t);return n},xc=(e,...t)=>{let n,r,i,a,o=o=>(n=vte(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=xte(e,n);return i(e,a),a};return a=o,(...e)=>a(Ste(...e))},Cte=[],Sc=e=>{let t=t=>t[e]||Cte;return t.isThemeGetter=!0,t},Cc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,wc=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wte=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Tte=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ete=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Dte=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ote=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kte=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Tc=e=>wte.test(e),Ec=e=>!!e&&!Number.isNaN(Number(e)),Dc=e=>!!e&&Number.isInteger(Number(e)),Oc=e=>e.endsWith(`%`)&&Ec(e.slice(0,-1)),kc=e=>Tte.test(e),Ac=()=>!0,Ate=e=>Ete.test(e)&&!Dte.test(e),jc=()=>!1,jte=e=>Ote.test(e),Mte=e=>kte.test(e),Nte=e=>!Mc(e)&&!Rc(e),Pte=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Fte=e=>Kc(e,Xc,jc),Mc=e=>Cc.test(e),Nc=e=>Kc(e,Zc,Ate),Pc=e=>Kc(e,Qc,Ec),Ite=e=>Kc(e,el,Ac),Lte=e=>Kc(e,$c,jc),Fc=e=>Kc(e,Jc,jc),Ic=e=>Kc(e,Yc,Mte),Lc=e=>Kc(e,tl,jte),Rc=e=>wc.test(e),zc=e=>qc(e,Zc),Bc=e=>qc(e,$c),Vc=e=>qc(e,Jc),Hc=e=>qc(e,Xc),Uc=e=>qc(e,Yc),Wc=e=>qc(e,tl,!0),Gc=e=>qc(e,el,!0),Kc=(e,t,n)=>{let r=Cc.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},qc=(e,t,n=!1)=>{let r=wc.exec(e);return r?r[1]?t(r[1]):n:!1},Jc=e=>e===`position`||e===`percentage`,Yc=e=>e===`image`||e===`url`,Xc=e=>e===`length`||e===`size`||e===`bg-size`,Zc=e=>e===`length`,Qc=e=>e===`number`,$c=e=>e===`family-name`,el=e=>e===`number`||e===`weight`,tl=e=>e===`shadow`,nl=()=>{let e=Sc(`color`),t=Sc(`font`),n=Sc(`text`),r=Sc(`font-weight`),i=Sc(`tracking`),a=Sc(`leading`),o=Sc(`breakpoint`),s=Sc(`container`),c=Sc(`spacing`),l=Sc(`radius`),u=Sc(`shadow`),d=Sc(`inset-shadow`),f=Sc(`text-shadow`),p=Sc(`drop-shadow`),m=Sc(`blur`),h=Sc(`perspective`),g=Sc(`aspect`),_=Sc(`ease`),v=Sc(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Rc,Mc],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],ee=()=>[`auto`,`contain`,`none`],C=()=>[Rc,Mc,c],te=()=>[Tc,`full`,`auto`,...C()],ne=()=>[Dc,`none`,`subgrid`,Rc,Mc],re=()=>[`auto`,{span:[`full`,Dc,Rc,Mc]},Dc,Rc,Mc],ie=()=>[Dc,`auto`,Rc,Mc],ae=()=>[`auto`,`min`,`max`,`fr`,Rc,Mc],oe=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],w=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],se=()=>[`auto`,...C()],ce=()=>[Tc,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],le=()=>[Tc,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],ue=()=>[Tc,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],de=()=>[e,Rc,Mc],fe=()=>[...b(),Vc,Fc,{position:[Rc,Mc]}],pe=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],me=()=>[`auto`,`cover`,`contain`,Hc,Fte,{size:[Rc,Mc]}],he=()=>[Oc,zc,Nc],ge=()=>[``,`none`,`full`,l,Rc,Mc],_e=()=>[``,Ec,zc,Nc],ve=()=>[`solid`,`dashed`,`dotted`,`double`],ye=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],be=()=>[Ec,Oc,Vc,Fc],xe=()=>[``,`none`,m,Rc,Mc],Se=()=>[`none`,Ec,Rc,Mc],Ce=()=>[`none`,Ec,Rc,Mc],we=()=>[Ec,Rc,Mc],Te=()=>[Tc,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[kc],breakpoint:[kc],color:[Ac],container:[kc],"drop-shadow":[kc],ease:[`in`,`out`,`in-out`],font:[Nte],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[kc],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[kc],shadow:[kc],spacing:[`px`,Ec],text:[kc],"text-shadow":[kc],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Tc,Mc,Rc,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Rc,Mc]}],"container-named":[Pte],columns:[{columns:[Ec,Mc,Rc,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:ee()}],"overscroll-x":[{"overscroll-x":ee()}],"overscroll-y":[{"overscroll-y":ee()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:te()}],"inset-x":[{"inset-x":te()}],"inset-y":[{"inset-y":te()}],start:[{"inset-s":te(),start:te()}],end:[{"inset-e":te(),end:te()}],"inset-bs":[{"inset-bs":te()}],"inset-be":[{"inset-be":te()}],top:[{top:te()}],right:[{right:te()}],bottom:[{bottom:te()}],left:[{left:te()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Dc,`auto`,Rc,Mc]}],basis:[{basis:[Tc,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Ec,Tc,`auto`,`initial`,`none`,Mc]}],grow:[{grow:[``,Ec,Rc,Mc]}],shrink:[{shrink:[``,Ec,Rc,Mc]}],order:[{order:[Dc,`first`,`last`,`none`,Rc,Mc]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:re()}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...oe(),`normal`]}],"justify-items":[{"justify-items":[...w(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...w()]}],"align-content":[{content:[`normal`,...oe()]}],"align-items":[{items:[...w(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...w(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...w(),`baseline`]}],"place-self":[{"place-self":[`auto`,...w()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:se()}],mx:[{mx:se()}],my:[{my:se()}],ms:[{ms:se()}],me:[{me:se()}],mbs:[{mbs:se()}],mbe:[{mbe:se()}],mt:[{mt:se()}],mr:[{mr:se()}],mb:[{mb:se()}],ml:[{ml:se()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ce()}],"inline-size":[{inline:[`auto`,...le()]}],"min-inline-size":[{"min-inline":[`auto`,...le()]}],"max-inline-size":[{"max-inline":[`none`,...le()]}],"block-size":[{block:[`auto`,...ue()]}],"min-block-size":[{"min-block":[`auto`,...ue()]}],"max-block-size":[{"max-block":[`none`,...ue()]}],w:[{w:[s,`screen`,...ce()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ce()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ce()]}],h:[{h:[`screen`,`lh`,...ce()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ce()]}],"max-h":[{"max-h":[`screen`,`lh`,...ce()]}],"font-size":[{text:[`base`,n,zc,Nc]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Gc,Ite]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Oc,Mc]}],"font-family":[{font:[Bc,Lte,t]}],"font-features":[{"font-features":[Mc]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Rc,Mc]}],"line-clamp":[{"line-clamp":[Ec,`none`,Rc,Pc]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":[`none`,Rc,Mc]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Rc,Mc]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:de()}],"text-color":[{text:de()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ve(),`wavy`]}],"text-decoration-thickness":[{decoration:[Ec,`from-font`,`auto`,Rc,Nc]}],"text-decoration-color":[{decoration:de()}],"underline-offset":[{"underline-offset":[Ec,`auto`,Rc,Mc]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"tab-size":[{tab:[Dc,Rc,Mc]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Rc,Mc]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Rc,Mc]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:fe()}],"bg-repeat":[{bg:pe()}],"bg-size":[{bg:me()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Dc,Rc,Mc],radial:[``,Rc,Mc],conic:[Dc,Rc,Mc]},Uc,Ic]}],"bg-color":[{bg:de()}],"gradient-from-pos":[{from:he()}],"gradient-via-pos":[{via:he()}],"gradient-to-pos":[{to:he()}],"gradient-from":[{from:de()}],"gradient-via":[{via:de()}],"gradient-to":[{to:de()}],rounded:[{rounded:ge()}],"rounded-s":[{"rounded-s":ge()}],"rounded-e":[{"rounded-e":ge()}],"rounded-t":[{"rounded-t":ge()}],"rounded-r":[{"rounded-r":ge()}],"rounded-b":[{"rounded-b":ge()}],"rounded-l":[{"rounded-l":ge()}],"rounded-ss":[{"rounded-ss":ge()}],"rounded-se":[{"rounded-se":ge()}],"rounded-ee":[{"rounded-ee":ge()}],"rounded-es":[{"rounded-es":ge()}],"rounded-tl":[{"rounded-tl":ge()}],"rounded-tr":[{"rounded-tr":ge()}],"rounded-br":[{"rounded-br":ge()}],"rounded-bl":[{"rounded-bl":ge()}],"border-w":[{border:_e()}],"border-w-x":[{"border-x":_e()}],"border-w-y":[{"border-y":_e()}],"border-w-s":[{"border-s":_e()}],"border-w-e":[{"border-e":_e()}],"border-w-bs":[{"border-bs":_e()}],"border-w-be":[{"border-be":_e()}],"border-w-t":[{"border-t":_e()}],"border-w-r":[{"border-r":_e()}],"border-w-b":[{"border-b":_e()}],"border-w-l":[{"border-l":_e()}],"divide-x":[{"divide-x":_e()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":_e()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ve(),`hidden`,`none`]}],"divide-style":[{divide:[...ve(),`hidden`,`none`]}],"border-color":[{border:de()}],"border-color-x":[{"border-x":de()}],"border-color-y":[{"border-y":de()}],"border-color-s":[{"border-s":de()}],"border-color-e":[{"border-e":de()}],"border-color-bs":[{"border-bs":de()}],"border-color-be":[{"border-be":de()}],"border-color-t":[{"border-t":de()}],"border-color-r":[{"border-r":de()}],"border-color-b":[{"border-b":de()}],"border-color-l":[{"border-l":de()}],"divide-color":[{divide:de()}],"outline-style":[{outline:[...ve(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Ec,Rc,Mc]}],"outline-w":[{outline:[``,Ec,zc,Nc]}],"outline-color":[{outline:de()}],shadow:[{shadow:[``,`none`,u,Wc,Lc]}],"shadow-color":[{shadow:de()}],"inset-shadow":[{"inset-shadow":[`none`,d,Wc,Lc]}],"inset-shadow-color":[{"inset-shadow":de()}],"ring-w":[{ring:_e()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:de()}],"ring-offset-w":[{"ring-offset":[Ec,Nc]}],"ring-offset-color":[{"ring-offset":de()}],"inset-ring-w":[{"inset-ring":_e()}],"inset-ring-color":[{"inset-ring":de()}],"text-shadow":[{"text-shadow":[`none`,f,Wc,Lc]}],"text-shadow-color":[{"text-shadow":de()}],opacity:[{opacity:[Ec,Rc,Mc]}],"mix-blend":[{"mix-blend":[...ye(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ye()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Ec]}],"mask-image-linear-from-pos":[{"mask-linear-from":be()}],"mask-image-linear-to-pos":[{"mask-linear-to":be()}],"mask-image-linear-from-color":[{"mask-linear-from":de()}],"mask-image-linear-to-color":[{"mask-linear-to":de()}],"mask-image-t-from-pos":[{"mask-t-from":be()}],"mask-image-t-to-pos":[{"mask-t-to":be()}],"mask-image-t-from-color":[{"mask-t-from":de()}],"mask-image-t-to-color":[{"mask-t-to":de()}],"mask-image-r-from-pos":[{"mask-r-from":be()}],"mask-image-r-to-pos":[{"mask-r-to":be()}],"mask-image-r-from-color":[{"mask-r-from":de()}],"mask-image-r-to-color":[{"mask-r-to":de()}],"mask-image-b-from-pos":[{"mask-b-from":be()}],"mask-image-b-to-pos":[{"mask-b-to":be()}],"mask-image-b-from-color":[{"mask-b-from":de()}],"mask-image-b-to-color":[{"mask-b-to":de()}],"mask-image-l-from-pos":[{"mask-l-from":be()}],"mask-image-l-to-pos":[{"mask-l-to":be()}],"mask-image-l-from-color":[{"mask-l-from":de()}],"mask-image-l-to-color":[{"mask-l-to":de()}],"mask-image-x-from-pos":[{"mask-x-from":be()}],"mask-image-x-to-pos":[{"mask-x-to":be()}],"mask-image-x-from-color":[{"mask-x-from":de()}],"mask-image-x-to-color":[{"mask-x-to":de()}],"mask-image-y-from-pos":[{"mask-y-from":be()}],"mask-image-y-to-pos":[{"mask-y-to":be()}],"mask-image-y-from-color":[{"mask-y-from":de()}],"mask-image-y-to-color":[{"mask-y-to":de()}],"mask-image-radial":[{"mask-radial":[Rc,Mc]}],"mask-image-radial-from-pos":[{"mask-radial-from":be()}],"mask-image-radial-to-pos":[{"mask-radial-to":be()}],"mask-image-radial-from-color":[{"mask-radial-from":de()}],"mask-image-radial-to-color":[{"mask-radial-to":de()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Ec]}],"mask-image-conic-from-pos":[{"mask-conic-from":be()}],"mask-image-conic-to-pos":[{"mask-conic-to":be()}],"mask-image-conic-from-color":[{"mask-conic-from":de()}],"mask-image-conic-to-color":[{"mask-conic-to":de()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:fe()}],"mask-repeat":[{mask:pe()}],"mask-size":[{mask:me()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Rc,Mc]}],filter:[{filter:[``,`none`,Rc,Mc]}],blur:[{blur:xe()}],brightness:[{brightness:[Ec,Rc,Mc]}],contrast:[{contrast:[Ec,Rc,Mc]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Wc,Lc]}],"drop-shadow-color":[{"drop-shadow":de()}],grayscale:[{grayscale:[``,Ec,Rc,Mc]}],"hue-rotate":[{"hue-rotate":[Ec,Rc,Mc]}],invert:[{invert:[``,Ec,Rc,Mc]}],saturate:[{saturate:[Ec,Rc,Mc]}],sepia:[{sepia:[``,Ec,Rc,Mc]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Rc,Mc]}],"backdrop-blur":[{"backdrop-blur":xe()}],"backdrop-brightness":[{"backdrop-brightness":[Ec,Rc,Mc]}],"backdrop-contrast":[{"backdrop-contrast":[Ec,Rc,Mc]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Ec,Rc,Mc]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ec,Rc,Mc]}],"backdrop-invert":[{"backdrop-invert":[``,Ec,Rc,Mc]}],"backdrop-opacity":[{"backdrop-opacity":[Ec,Rc,Mc]}],"backdrop-saturate":[{"backdrop-saturate":[Ec,Rc,Mc]}],"backdrop-sepia":[{"backdrop-sepia":[``,Ec,Rc,Mc]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Rc,Mc]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Ec,`initial`,Rc,Mc]}],ease:[{ease:[`linear`,`initial`,_,Rc,Mc]}],delay:[{delay:[Ec,Rc,Mc]}],animate:[{animate:[`none`,v,Rc,Mc]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Rc,Mc]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:Ce()}],"scale-x":[{"scale-x":Ce()}],"scale-y":[{"scale-y":Ce()}],"scale-z":[{"scale-z":Ce()}],"scale-3d":[`scale-3d`],skew:[{skew:we()}],"skew-x":[{"skew-x":we()}],"skew-y":[{"skew-y":we()}],transform:[{transform:[Rc,Mc,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"translate-none":[`translate-none`],zoom:[{zoom:[Dc,Rc,Mc]}],accent:[{accent:de()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:de()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Rc,Mc]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":de()}],"scrollbar-track-color":[{"scrollbar-track":de()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Rc,Mc]}],fill:[{fill:[`none`,...de()]}],"stroke-w":[{stroke:[Ec,zc,Nc,Pc]}],stroke:[{stroke:[`none`,...de()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},rl=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>(il(e,`cacheSize`,t),il(e,`prefix`,n),il(e,`experimentalParseClassName`,r),al(e.theme,a.theme),al(e.classGroups,a.classGroups),al(e.conflictingClassGroups,a.conflictingClassGroups),al(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),il(e,`postfixLookupClassGroups`,a.postfixLookupClassGroups),il(e,`orderSensitiveModifiers`,a.orderSensitiveModifiers),ol(e.theme,i.theme),ol(e.classGroups,i.classGroups),ol(e.conflictingClassGroups,i.conflictingClassGroups),ol(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),sl(e,i,`postfixLookupClassGroups`),sl(e,i,`orderSensitiveModifiers`),e),il=(e,t,n)=>{n!==void 0&&(e[t]=n)},al=(e,t)=>{if(t)for(let n in t)il(e,n,t[n])},ol=(e,t)=>{if(t)for(let n in t)sl(e,t,n)},sl=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},cl=(e,...t)=>typeof e==`function`?xc(nl,e,...t):xc(()=>rl(nl(),e),...t),ll=xc(nl);function ul(...e){return ll(Xi(e))}var dl=/\s+/g,fl=e=>typeof e!=`string`||!e?e:e.replace(dl,` `).trim(),pl=(...e)=>{let t=[],n=e=>{if(!e&&e!==0&&e!==0n)return;if(Array.isArray(e)){for(let t=0,r=e.length;t<r;t++)n(e[t]);return}let r=typeof e;if(r===`string`||r===`number`||r===`bigint`){if(r===`number`&&e!==e)return;t.push(String(e))}else if(r===`object`){let n=Object.keys(e);for(let r=0,i=n.length;r<i;r++){let i=n[r];e[i]&&t.push(i)}}};for(let t=0,r=e.length;t<r;t++){let r=e[t];r!=null&&n(r)}return t.length>0?fl(t.join(` `)):void 0},ml=e=>e===!1?`false`:e===!0?`true`:e===0?`0`:e,hl=e=>{if(!e||typeof e!=`object`)return!0;for(let t in e)return!1;return!0},gl=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++){let a=n[i];if(!r.includes(a)||e[a]!==t[a])return!1}return!0},_l=(e,t)=>{for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n];n in e?e[n]=pl(e[n],r):e[n]=r}return e},vl=(e,t)=>{for(let n=0;n<e.length;n++){let r=e[n];Array.isArray(r)?vl(r,t):r&&t.push(r)}},yl=(...e)=>{let t=[];vl(e,t);let n=[];for(let e=0;e<t.length;e++)t[e]&&n.push(t[e]);return n},bl=(e,t)=>{let n={};for(let r in e){let i=e[r];if(r in t){let e=t[r];Array.isArray(i)||Array.isArray(e)?n[r]=yl(e,i):typeof i==`object`&&typeof e==`object`&&i&&e?n[r]=bl(i,e):n[r]=e+` `+i}else n[r]=i}for(let r in t)r in e||(n[r]=t[r]);return n},xl={twMerge:!0,twMergeConfig:{}};function Sl(){let e=null,t={},n=!1;return{get cachedTwMerge(){return e},set cachedTwMerge(t){e=t},get cachedTwMergeConfig(){return t},set cachedTwMergeConfig(e){t=e},get didTwMergeConfigChange(){return n},set didTwMergeConfigChange(e){n=e},reset(){e=null,t={},n=!1}}}var Cl=Sl(),wl=e=>{let t=(t,n)=>{let{extend:r=null,slots:i={},variants:a={},compoundVariants:o=[],compoundSlots:s=[],defaultVariants:c={}}=t,l={...xl,...n},u=r?.base?pl(r.base,t?.base):t?.base,d=r?.variants&&!hl(r.variants)?bl(a,r.variants):a,f=r?.defaultVariants&&!hl(r.defaultVariants)?{...r.defaultVariants,...c}:c;!hl(l.twMergeConfig)&&!gl(l.twMergeConfig,Cl.cachedTwMergeConfig)&&(Cl.didTwMergeConfigChange=!0,Cl.cachedTwMergeConfig=l.twMergeConfig);let p=hl(r?.slots),m=hl(i)?{}:{base:pl(t?.base,p&&r?.base),...i},h=p?m:_l({...r?.slots},hl(m)?{base:t?.base}:m),g=hl(r?.compoundVariants)?o:yl(r?.compoundVariants,o),_=t=>{if(hl(d)&&hl(i)&&p)return e(u,t?.class,t?.className)(l);if(g&&!Array.isArray(g))throw TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof g}`);if(s&&!Array.isArray(s))throw TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof s}`);let n=(e,n=d,r=null,i=null)=>{let a=n[e];if(!a||hl(a))return null;let o=i?.[e]??t?.[e];if(o===null)return null;let s=ml(o);if(typeof s==`object`)return null;let c=f?.[e];return a[(s??ml(c))||`false`]},r=()=>{if(!d)return null;let e=Object.keys(d),t=[];for(let r=0;r<e.length;r++){let i=n(e[r],d);i&&t.push(i)}return t},a=(e,t)=>{if(!d||typeof d!=`object`)return null;let r=[];for(let i in d){let a=n(i,d,e,t),o=e===`base`&&typeof a==`string`?a:a&&a[e];o&&r.push(o)}return r},o={};for(let e in t){let n=t[e];n!==void 0&&(o[e]=n)}let c=(e,n)=>{let r=typeof t?.[e]==`object`?{[e]:t[e]?.initial}:{};return{...f,...o,...r,...n}},m=(e=[],t)=>{let n=[],r=e.length;for(let i=0;i<r;i++){let{class:r,className:a,...o}=e[i],s=!0,l=c(null,t);for(let e in o){let t=o[e],n=l[e];if(Array.isArray(t)){if(!t.includes(n)){s=!1;break}}else{if((t==null||t===!1)&&(n==null||n===!1))continue;if(n!==t){s=!1;break}}}s&&(r&&n.push(r),a&&n.push(a))}return n},_=t=>{let n=m(g,t);if(!Array.isArray(n))return n;let r={},i=e;for(let e=0;e<n.length;e++){let t=n[e];if(typeof t==`string`)r.base=i(r.base,t)(l);else if(typeof t==`object`)for(let e in t)r[e]=i(r[e],t[e])(l)}return r},v=e=>{if(s.length<1)return null;let t={},n=c(null,e);for(let e=0;e<s.length;e++){let{slots:r=[],class:i,className:a,...o}=s[e];if(!hl(o)){let e=!0;for(let t in o){let r=n[t],i=o[t];if(r===void 0||(Array.isArray(i)?!i.includes(r):i!==r)){e=!1;break}}if(!e)continue}for(let e=0;e<r.length;e++){let n=r[e];t[n]||(t[n]=[]),t[n].push([i,a])}}return t};if(!hl(i)||!p){let t={};if(typeof h==`object`&&!hl(h)){let n=e;for(let e in h)t[e]=t=>{let r=_(t),i=v(t);return n(h[e],a(e,t),r?r[e]:void 0,i?i[e]:void 0,t?.class,t?.className)(l)}}return t}return e(u,r(),m(g),t?.class,t?.className)(l)};return _.variantKeys=(()=>{if(!(!d||typeof d!=`object`))return Object.keys(d)})(),_.extend=r,_.base=u,_.slots=h,_.variants=d,_.defaultVariants=f,_.compoundSlots=s,_.compoundVariants=g,_};return{tv:t,createTV:e=>(n,r)=>t(n,r?bl(e,r):e)}},Tl=e=>hl(e)?ll:cl({...e,extend:{theme:e.theme,classGroups:e.classGroups,conflictingClassGroupModifiers:e.conflictingClassGroupModifiers,conflictingClassGroups:e.conflictingClassGroups,...e.extend}}),El=(e,t)=>{let n=pl(e);return!n||!(t?.twMerge??!0)?n:((!Cl.cachedTwMerge||Cl.didTwMergeConfigChange)&&(Cl.didTwMergeConfigChange=!1,Cl.cachedTwMerge=Tl(Cl.cachedTwMergeConfig)),Cl.cachedTwMerge(n)||void 0)},{createTV:Rte,tv:Dl}=wl((...e)=>t=>El(e,t)),Ol=Dl({base:`focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px aria-invalid:ring-3 data-[active]:bg-muted data-[active]:text-foreground [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground shadow-xs`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,success:`bg-success text-success-foreground hover:bg-success/80 focus-visible:ring-success/30 focus-visible:border-success/40`,ghost:`hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground`,destructive:`bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-9`,"icon-xs":`size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}}),kl=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`variant`,`size`,`ref`,`href`,`type`,`disabled`,`active`,`pressed`,`ariaLabel`,`children`]),Al=L(`<a><!></a>`),jl=L(`<button><!></button>`);function Ml(e,t){D(t,!0);let n=q(t,`variant`,3,`default`),r=q(t,`size`,3,`default`),i=q(t,`ref`,15,null),a=q(t,`href`,3,void 0),o=q(t,`type`,3,`button`),s=q(t,`active`,3,!1),c=G(t,kl);var l=R(),u=N(l),d=e=>{var o=Al();Sa(o,e=>({"data-slot":`button`,class:e,href:t.disabled?void 0:a(),"aria-disabled":t.disabled,"aria-label":t.ariaLabel,"aria-pressed":t.pressed,"data-active":s()?``:void 0,role:t.disabled?`link`:void 0,tabindex:t.disabled?-1:void 0,...c}),[()=>ul(Ol({variant:n(),size:r()}),t.class)]),H(M(o),()=>t.children??w),T(o),Aa(o,e=>i(e),()=>i()),z(e,o)},f=e=>{var a=jl();Sa(a,e=>({"data-slot":`button`,class:e,type:o(),disabled:t.disabled,"aria-label":t.ariaLabel,"aria-pressed":t.pressed,"data-active":s()?``:void 0,...c}),[()=>ul(Ol({variant:n(),size:r()}),t.class)]),H(M(a),()=>t.children??w),T(a),Aa(a,e=>i(e),()=>i()),z(e,a)};V(u,e=>{a()?e(d):e(f,-1)}),z(e,l),O()}var Nl=Array(12).fill(0),Pl=L(`<div class="sonner-loading-bar"></div>`),Fl=L(`<div><div class="sonner-spinner"></div></div>`);function Il(e,t){D(t,!0);var n=Fl(),r=M(n);Ri(r,23,()=>Nl,(e,t)=>`spinner-bar-${t}`,(e,t)=>{z(e,Pl())}),T(r),T(n),F(e=>{ra(n,1,e),W(n,`data-visible`,t.visible)},[()=>Zi([`sonner-loading-wrapper`,t.class].filter(Boolean).join(` `))]),z(e,n),O()}function Ll(...e){return e.filter(Boolean).join(` `)}var Rl=typeof document<`u`,zl=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function Bl(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}new class{#e;#t;constructor(e={}){let{window:t=zl,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Kt(e=>{let n=vi(t,`focusin`,e),r=vi(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?Bl(this.#e):null}};var Vl=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return Et(this.#t)}get(){let e=wt(this.#t);if(e===void 0)throw Error(`Context "${this.#e}" not found`);return e}getOr(e){let t=wt(this.#t);return t===void 0?e:t}set(e){return Tt(this.#t,e)}};function Hl(e,t){switch(e){case`post`:sr(t);break;case`pre`:lr(t);break}}function Ul(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;Hl(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=ei(()=>n(t,o));return o=t,r})}function Wl(e,t,n){let r=ur(()=>{let i=!1;Ul(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});sr(()=>r)}function Gl(e,t,n){Ul(e,`post`,t,n)}function Kl(e,t,n){Ul(e,`pre`,t,n)}Gl.pre=Kl;function ql(e,t){Wl(e,`post`,t)}function Jl(e,t){Wl(e,`pre`,t)}ql.pre=Jl;function Yl(e,t){let n,r=null;return(...i)=>new Promise(a=>{r&&r(void 0),r=a,clearTimeout(n),n=setTimeout(async()=>{let t=await e(...i);r&&=(r(t),null)},t)})}function Xl(e,t){let n=0,r=null;return(...i)=>{let a=Date.now();return n&&a-n<t?r??Promise.resolve(void 0):(n=a,r=e(...i),r)}}function Zl(e,t,n={},r){let{lazy:i=!1,once:a=!1,initialValue:o,debounce:s,throttle:c}=n,l=A(In(o)),u=A(!1),d=A(void 0),f=A(In([])),p=()=>{I(f).forEach(e=>e()),j(f,[],!0)},m=e=>{j(f,[...I(f),e],!0)},h=async(e,n,r=!1)=>{try{j(u,!0),j(d,void 0),p();let i=new AbortController;m(()=>i.abort());let a=await t(e,n,{data:I(l),refetching:r,onCleanup:m,signal:i.signal});return j(l,a,!0),a}catch(e){e instanceof DOMException&&e.name===`AbortError`||j(d,e,!0);return}finally{j(u,!1)}},g=s?Yl(h,s):c?Xl(h,c):h,_=Array.isArray(e)?e:[e],v;return r((t,n)=>{a&&v||(v=t,g(Array.isArray(e)?t:t[0],Array.isArray(e)?n:n?.[0]))},{lazy:i}),{get current(){return I(l)},get loading(){return I(u)},get error(){return I(d)},mutate:e=>{j(l,e,!0)},refetch:t=>{let n=_.map(e=>e());return g(Array.isArray(e)?n:n[0],Array.isArray(e)?n:n[0],t??!0)}}}function Ql(e,t,n){return Zl(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Gl(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}function $l(e,t,n){return Zl(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Gl.pre(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}Ql.pre=$l,new Vl(`richColorsContext`);var eu=new Vl(`<Toaster/>`),tu=0,nu=class{#e=A(In([]));get toasts(){return I(this.#e)}set toasts(e){j(this.#e,e,!0)}#t=A(In([]));get heights(){return I(this.#t)}set heights(e){j(this.#t,e,!0)}#n=e=>{let t=this.toasts.findIndex(t=>t.id===e);return t===-1?null:t};addToast=e=>{Rl&&this.toasts.unshift(e)};updateToast=({id:e,data:t,type:n,message:r})=>{let i=this.toasts.findIndex(t=>t.id===e),a=this.toasts[i];this.toasts[i]={...a,...t,id:e,title:r,type:n,updated:!0}};create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id&&e.id?.length>0?e.id:tu++,i=e.dismissible===void 0?e.dismissable===void 0?!0:e.dismissable:e.dismissible,a=e.type===void 0?`default`:e.type;return ei(()=>{this.toasts.find(e=>e.id===r)?this.updateToast({id:r,data:e,type:a,message:t,dismissible:i}):this.addToast({...n,id:r,title:t,dismissible:i,type:a})}),r};dismiss=e=>(ei(()=>{if(e===void 0){this.toasts=this.toasts.map(e=>({...e,dismiss:!0}));return}let t=this.toasts.findIndex(t=>t.id===e);this.toasts[t]&&(this.toasts[t]={...this.toasts[t],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}let t=this.#n(e);if(t!==null)return this.toasts.splice(t,1),e};message=(e,t)=>this.create({...t,type:`default`,message:e});error=(e,t)=>this.create({...t,type:`error`,message:e});success=(e,t)=>this.create({...t,type:`success`,message:e});info=(e,t)=>this.create({...t,type:`info`,message:e});warning=(e,t)=>this.create({...t,type:`warning`,message:e});loading=(e,t)=>this.create({...t,type:`loading`,message:e});promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:typeof t.loading==`string`?t.loading:t.loading()}));let r=e instanceof Promise?e:e(),i=n!==void 0;return r.then(e=>{if(typeof e==`object`&&e&&`ok`in e&&typeof e.ok==`boolean`&&!e.ok){i=!1;let t=ru(e);this.create({id:n,type:`error`,message:t})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?t.success(e):t.success;this.create({id:n,type:`success`,message:r})}}).catch(e=>{if(t.error!==void 0){i=!1;let r=typeof t.error==`function`?t.error(e):t.error;this.create({id:n,type:`error`,message:r})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally?.()}),n};custom=(e,t)=>{let n=t?.id||tu++;return this.create({component:e,id:n,...t}),n};removeHeight=e=>{this.heights=this.heights.filter(t=>t.toastId!==e)};setHeight=e=>{let t=this.#n(e.toastId);if(t===null){this.heights.push(e);return}this.heights[t]=e};reset=()=>{this.toasts=[],this.heights=[]}};function ru(e){return e&&typeof e==`object`&&`status`in e?`HTTP error! Status: ${e.status}`:`Error! ${e}`}var iu=new nu;function au(e,t){return iu.create({message:e,...t})}var ou=class{#e=k(()=>iu.toasts.filter(e=>!e.dismiss));get toasts(){return I(this.#e)}},su=Object.assign(au,{success:iu.success,info:iu.info,warning:iu.warning,error:iu.error,custom:iu.custom,message:iu.message,promise:iu.promise,dismiss:iu.dismiss,loading:iu.loading,getActiveToasts:()=>iu.toasts.filter(e=>!e.dismiss)});function cu(e){return e.label!==void 0}function lu(){let e=A(In(typeof document<`u`?document.hidden:!1));return sr(()=>vi(document,`visibilitychange`,()=>{j(e,document.hidden,!0)})),{get current(){return I(e)}}}var uu=4e3,du=14,fu=45,pu=200,mu=.05,hu={toast:``,title:``,description:``,loader:``,closeButton:``,cancelButton:``,actionButton:``,action:``,warning:``,error:``,success:``,default:``,info:``,loading:``};function gu(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}function _u(e){return 1/(1.5+Math.abs(e)/20)}new Set(`$$slots.$$events.$$legacy.toast.index.expanded.invert.position.visibleToasts.expandByDefault.closeButton.interacting.cancelButtonStyle.actionButtonStyle.duration.descriptionClass.classes.unstyled.loadingIcon.successIcon.errorIcon.warningIcon.closeIcon.infoIcon.defaultRichColors.swipeDirections.closeButtonAriaLabel.pauseWhenPageIsHidden`.split(`.`));var vu=L(`<div><!></div>`),yu=L(`<button data-close-button=""><!></button>`),bu=L(`<div data-icon=""><!> <!></div>`),xu=L(`<div data-description=""><!></div>`),Su=L(`<button data-button="" data-cancel=""> </button>`),Cu=L(`<button data-button=""> </button>`),wu=L(`<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>`,1),Tu=L(`<li aria-atomic="true" data-sonner-toast=""><!> <!></li>`);function Eu(e,t){D(t,!0);let n=e=>{var n=R(),r=N(n),i=e=>{var n=vu();H(M(n),()=>t.loadingIcon),T(n),F(e=>{ra(n,1,e),W(n,`data-visible`,I(S)===`loading`)},[()=>Zi(Ll(I(de)?.loader,t.toast?.classes?.loader,`sonner-loader`))]),z(e,n)},a=e=>{{let n=k(()=>Ll(I(de)?.loader,t.toast.classes?.loader)),r=k(()=>I(S)===`loading`);Il(e,{get class(){return I(n)},get visible(){return I(r)}})}};V(r,e=>{t.loadingIcon?e(i):e(a,-1)}),z(e,n)},r=q(t,`cancelButtonStyle`,3,``),i=q(t,`actionButtonStyle`,3,``),a=q(t,`descriptionClass`,3,``),o=q(t,`unstyled`,3,!1),s=q(t,`defaultRichColors`,3,!1),c={...hu},l=A(!1),u=A(!1),d=A(!1),f=A(!1),p=A(!1),m=A(0),h=A(0),g=t.toast.duration||t.duration||uu,_=A(void 0),v=A(null),y=A(null),b=k(()=>t.index===0),x=k(()=>t.index+1<=t.visibleToasts),S=k(()=>t.toast.type),ee=k(()=>t.toast.dismissible===void 0?t.toast.dismissable!==!1:t.toast.dismissible!==!1),C=k(()=>t.toast.class||``),te=k(()=>t.toast.descriptionClass||``),ne=k(()=>iu.heights.findIndex(e=>e.toastId===t.toast.id)||0),re=k(()=>t.toast.closeButton??t.closeButton),ie=k(()=>t.toast.duration??t.duration??uu),ae=null,oe=k(()=>t.position.split(`-`)),se=k(()=>iu.heights.reduce((e,t,n)=>n>=I(ne)?e:e+t.height,0)),ce=lu(),le=k(()=>t.toast.invert||t.invert),ue=k(()=>I(S)===`loading`),de=k(()=>({...c,...t.classes})),fe=k(()=>t.toast.title),pe=k(()=>t.toast.description),me=A(0),he=A(0),ge=k(()=>Math.round(I(ne)*du+I(se)));sr(()=>{I(fe),I(pe);let e;e=t.expanded||t.expandByDefault?1:1-t.index*mu;let n=ei(()=>I(_));if(n===void 0)return;n.style.setProperty(`height`,`auto`);let r=n.offsetHeight,i=n.getBoundingClientRect().height,a=Math.round(i/e+2**-52&100)/100;n.style.removeProperty(`height`);let o;o=Math.abs(a-r)<1?a:r,j(h,o,!0),iu.setHeight({toastId:t.toast.id,height:o})});function _e(){j(u,!0),j(m,I(ge),!0),iu.removeHeight(t.toast.id),setTimeout(()=>{iu.remove(t.toast.id)},pu)}let ve,ye=k(()=>t.toast.promise&&I(S)===`loading`||t.toast.duration===1/0);function be(){j(me,new Date().getTime(),!0),ve=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),_e()},g)}function xe(){if(I(he)<I(me)){let e=new Date().getTime()-I(me);g-=e}j(he,new Date().getTime(),!0)}sr(()=>{t.toast.updated&&(clearTimeout(ve),g=I(ie),I(ye)||be())}),sr(()=>(I(ye)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&ce.current?xe():be()),()=>clearTimeout(ve))),Na(()=>{j(l,!0);let e=I(_)?.getBoundingClientRect().height;return j(h,e,!0),iu.setHeight({toastId:t.toast.id,height:e}),()=>{iu.removeHeight(t.toast.id)}}),sr(()=>{t.toast.delete&&ei(()=>{_e(),t.toast.onDismiss?.(t.toast)})});let Se=e=>{if(I(ue))return;j(m,I(ge),!0);let t=e.target;t.setPointerCapture(e.pointerId),t.tagName!==`BUTTON`&&(j(d,!0),ae={x:e.clientX,y:e.clientY})},Ce=()=>{if(I(f)||!I(ee))return;ae=null;let e=Number(I(_)?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),n=Number(I(_)?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-0,i=I(v)===`x`?e:n,a=Math.abs(i)/r;if(Math.abs(i)>=fu||a>.11){j(m,I(ge),!0),t.toast.onDismiss?.(t.toast),I(v)===`x`?j(y,e>0?`right`:`left`,!0):j(y,n>0?`down`:`up`,!0),_e(),j(f,!0);return}else I(_)?.style.setProperty(`--swipe-amount-x`,`0px`),I(_)?.style.setProperty(`--swipe-amount-y`,`0px`);j(p,!1),j(d,!1),j(v,null)},we=e=>{if(!ae||!I(ee)||(window.getSelection()?.toString().length??-1)>0)return;let n=e.clientY-ae.y,r=e.clientX-ae.x,i=t.swipeDirections??gu(t.position);!I(v)&&(Math.abs(r)>1||Math.abs(n)>1)&&j(v,Math.abs(r)>Math.abs(n)?`x`:`y`,!0);let a={x:0,y:0};if(I(v)===`y`){if(i.includes(`top`)||i.includes(`bottom`))if(i.includes(`top`)&&n<0||i.includes(`bottom`)&&n>0)a.y=n;else{let e=n*_u(n);a.y=Math.abs(e)<Math.abs(n)?e:n}}else if(I(v)===`x`&&(i.includes(`left`)||i.includes(`right`)))if(i.includes(`left`)&&r<0||i.includes(`right`)&&r>0)a.x=r;else{let e=r*_u(r);a.x=Math.abs(e)<Math.abs(r)?e:r}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&j(p,!0),I(_)?.style.setProperty(`--swipe-amount-x`,`${a.x}px`),I(_)?.style.setProperty(`--swipe-amount-y`,`${a.y}px`)},Te=()=>{j(d,!1),j(v,null),ae=null},Ee=k(()=>t.toast.icon?t.toast.icon:I(S)===`success`?t.successIcon:I(S)===`error`?t.errorIcon:I(S)===`warning`?t.warningIcon:I(S)===`info`?t.infoIcon:I(S)===`loading`?t.loadingIcon:null);var De=Tu();W(De,`tabindex`,0);let Oe;var ke=M(De),Ae=e=>{var n=yu();H(M(n),()=>t.closeIcon??w),T(n),F(e=>{W(n,`aria-label`,t.closeButtonAriaLabel),W(n,`data-disabled`,I(ue)),ra(n,1,e)},[()=>Zi(Ll(I(de)?.closeButton,t.toast?.classes?.closeButton))]),bi(`click`,n,()=>{I(ue)||!I(ee)||(_e(),t.toast.onDismiss?.(t.toast))}),z(e,n)};V(ke,e=>{I(re)&&!t.toast.component&&I(S)!==`loading`&&t.closeIcon!==null&&e(Ae)});var je=P(ke,2),Me=e=>{let n=k(()=>t.toast.component);var r=R();U(N(r),()=>I(n),(e,n)=>{n(e,K(()=>t.toast.componentProps,{closeToast:_e}))}),z(e,r)},Ne=e=>{var o=wu(),s=N(o),c=e=>{var r=bu(),i=M(r),a=e=>{var r=R(),i=N(r),a=e=>{var n=R();U(N(n),()=>t.toast.icon,(e,t)=>{t(e,{})}),z(e,n)},o=e=>{n(e)};V(i,e=>{t.toast.icon?e(a):e(o,-1)}),z(e,r)};V(i,e=>{(t.toast.promise||I(S)===`loading`)&&e(a)});var o=P(i,2),s=e=>{var n=R(),r=N(n),i=e=>{var n=R();U(N(n),()=>t.toast.icon,(e,t)=>{t(e,{})}),z(e,n)},a=e=>{var n=R();H(N(n),()=>t.successIcon??w),z(e,n)},o=e=>{var n=R();H(N(n),()=>t.errorIcon??w),z(e,n)},s=e=>{var n=R();H(N(n),()=>t.warningIcon??w),z(e,n)},c=e=>{var n=R();H(N(n),()=>t.infoIcon??w),z(e,n)};V(r,e=>{t.toast.icon?e(i):I(S)===`success`?e(a,1):I(S)===`error`?e(o,2):I(S)===`warning`?e(s,3):I(S)===`info`&&e(c,4)}),z(e,n)};V(o,e=>{t.toast.type!==`loading`&&e(s)}),T(r),F(e=>ra(r,1,e),[()=>Zi(Ll(I(de)?.icon,t.toast?.classes?.icon))]),z(e,r)};V(s,e=>{(I(S)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(I(Ee)!==null||t.toast.icon)&&e(c)});var l=P(s,2),u=M(l),d=M(u),f=e=>{var n=R(),r=N(n),i=e=>{let n=k(()=>t.toast.title);var r=R();U(N(r),()=>I(n),(e,n)=>{n(e,K(()=>t.toast.componentProps))}),z(e,r)},a=e=>{var n=ki();F(()=>B(n,t.toast.title)),z(e,n)};V(r,e=>{typeof t.toast.title==`string`?e(a,-1):e(i)}),z(e,n)};V(d,e=>{t.toast.title&&e(f)}),T(u);var p=P(u,2),m=e=>{var n=xu(),r=M(n),i=e=>{let n=k(()=>t.toast.description);var r=R();U(N(r),()=>I(n),(e,n)=>{n(e,K(()=>t.toast.componentProps))}),z(e,r)},o=e=>{var n=ki();F(()=>B(n,t.toast.description)),z(e,n)};V(r,e=>{typeof t.toast.description==`string`?e(o,-1):e(i)}),T(n),F(e=>ra(n,1,e),[()=>Zi(Ll(a(),I(te),I(de)?.description,t.toast.classes?.description))]),z(e,n)};V(p,e=>{t.toast.description&&e(m)}),T(l);var h=P(l,2),g=e=>{var n=R(),i=N(n),a=e=>{var n=R();U(N(n),()=>t.toast.cancel,(e,t)=>{t(e,{})}),z(e,n)},o=e=>{var n=Su(),i=M(n,!0);T(n),F(e=>{aa(n,t.toast.cancelButtonStyle??r()),ra(n,1,e),B(i,t.toast.cancel.label)},[()=>Zi(Ll(I(de)?.cancelButton,t.toast?.classes?.cancelButton))]),bi(`click`,n,e=>{cu(t.toast.cancel)&&I(ee)&&(t.toast.cancel?.onClick?.(e),_e())}),z(e,n)},s=k(()=>cu(t.toast.cancel));V(i,e=>{typeof t.toast.cancel==`function`?e(a):I(s)&&e(o,1)}),z(e,n)};V(h,e=>{t.toast.cancel&&e(g)});var _=P(h,2),v=e=>{var n=R(),r=N(n),a=e=>{var n=R();U(N(n),()=>t.toast.action,(e,t)=>{t(e,{})}),z(e,n)},o=e=>{var n=Cu(),r=M(n,!0);T(n),F(e=>{aa(n,t.toast.actionButtonStyle??i()),ra(n,1,e),B(r,t.toast.action.label)},[()=>Zi(Ll(I(de)?.actionButton,t.toast?.classes?.actionButton))]),bi(`click`,n,e=>{cu(t.toast.action)&&(t.toast.action?.onClick(e),!e.defaultPrevented&&_e())}),z(e,n)},s=k(()=>cu(t.toast.action));V(r,e=>{typeof t.toast.action==`function`?e(a):I(s)&&e(o,1)}),z(e,n)};V(_,e=>{t.toast.action&&e(v)}),F((e,t)=>{ra(l,1,e),ra(u,1,t)},[()=>Zi(Ll(I(de)?.content,t.toast?.classes?.content)),()=>Zi(Ll(I(de)?.title,t.toast?.classes?.title))]),z(e,o)};V(je,e=>{t.toast.component?e(Me):e(Ne,-1)}),T(De),Aa(De,e=>j(_,e),()=>I(_)),F((e,n,r)=>{ra(De,1,e),W(De,`aria-live`,t.toast.important?`assertive`:`polite`),W(De,`data-rich-colors`,t.toast.richColors??s()),W(De,`data-styled`,!(t.toast.component||t.toast.unstyled||o())),W(De,`data-mounted`,I(l)),W(De,`data-promise`,n),W(De,`data-swiped`,I(p)),W(De,`data-removed`,I(u)),W(De,`data-visible`,I(x)),W(De,`data-y-position`,I(oe)[0]),W(De,`data-x-position`,I(oe)[1]),W(De,`data-index`,t.index),W(De,`data-front`,I(b)),W(De,`data-swiping`,I(d)),W(De,`data-dismissible`,I(ee)),W(De,`data-type`,I(S)),W(De,`data-invert`,I(le)),W(De,`data-swipe-out`,I(f)),W(De,`data-swipe-direction`,I(y)),W(De,`data-expanded`,r),Oe=aa(De,`${t.style} ${t.toast.style}`,Oe,{"--index":t.index,"--toasts-before":t.index,"--z-index":iu.toasts.length-t.index,"--offset":`${I(u)?I(m):I(ge)}px`,"--initial-height":t.expandByDefault?`auto`:`${I(h)}px`})},[()=>Zi(Ll(t.class,I(C),I(de)?.toast,t.toast?.classes?.toast,I(de)?.[I(S)],t.toast?.classes?.[I(S)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&I(l))]),bi(`pointermove`,De,we),bi(`pointerup`,De,Ce),bi(`pointerdown`,De,Se),yi(`dragend`,De,Te),z(e,De),O()}xi([`pointermove`,`pointerup`,`pointerdown`,`click`]);var Du=Oi(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>`);function Ou(e){z(e,Du())}var ku=Oi(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`);function Au(e){z(e,ku())}var ju=Oi(`<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>`);function Mu(e){z(e,ju())}var Nu=Oi(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>`);function Pu(e){z(e,Nu())}var Fu=Oi(`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>`);function Iu(e){z(e,Fu())}var Lu=3,Ru=`24px`,zu=`16px`,Bu=4e3,Vu=356,Hu=14,Uu=`dark`,Wu=`light`;function Gu(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?zu:Ru;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{let r=e[t];r===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof r==`number`?`${r}px`:r}):o(a)}),n}var Ku=new Set(`$$slots.$$events.$$legacy.invert.position.hotkey.expand.closeButton.offset.mobileOffset.theme.richColors.duration.visibleToasts.toastOptions.dir.gap.pauseWhenPageIsHidden.loadingIcon.successIcon.errorIcon.warningIcon.closeIcon.infoIcon.containerAriaLabel.class.closeButtonAriaLabel.onblur.onfocus.onmouseenter.onmousemove.onmouseleave.ondragend.onpointerdown.onpointerup`.split(`.`)),qu=L(`<ol></ol>`),Ju=L(`<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-1vj9f37"><!></section>`);function Yu(e,t){D(t,!0);function n(e){return e===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?Uu:Wu:e}let r=q(t,`invert`,3,!1),i=q(t,`position`,3,`bottom-right`),a=q(t,`hotkey`,19,()=>[`altKey`,`KeyT`]),o=q(t,`expand`,3,!1),s=q(t,`closeButton`,3,!1),c=q(t,`offset`,3,Ru),l=q(t,`mobileOffset`,3,zu),u=q(t,`theme`,3,`light`),d=q(t,`richColors`,3,!1),f=q(t,`duration`,3,Bu),p=q(t,`visibleToasts`,3,Lu),m=q(t,`toastOptions`,19,()=>({})),h=q(t,`dir`,7,`auto`),g=q(t,`gap`,3,Hu),_=q(t,`pauseWhenPageIsHidden`,3,!1),v=q(t,`containerAriaLabel`,3,`Notifications`),y=q(t,`closeButtonAriaLabel`,3,`Close toast`),b=G(t,Ku);function x(){if(h()!==`auto`)return h();if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?(ei(()=>h(window.getComputedStyle(document.documentElement).direction??`ltr`)),h()):(ei(()=>h(e)),e)}let S=k(()=>Array.from(new Set([i(),...iu.toasts.filter(e=>e.position).map(e=>e.position)].filter(Boolean)))),ee=A(!1),C=A(!1),te=A(In(n(u()))),ne=A(void 0),re=A(null),ie=A(!1),ae=k(()=>a().join(`+`).replace(/Key/g,``).replace(/Digit/g,``));sr(()=>{iu.toasts.length<=1&&j(ee,!1)}),sr(()=>{let e=iu.toasts.filter(e=>e.dismiss&&!e.delete);e.length>0&&(iu.toasts=iu.toasts.map(t=>e.find(e=>e.id===t.id)?{...t,delete:!0}:t))}),sr(()=>()=>{I(ne)&&I(re)&&(I(re).focus({preventScroll:!0}),j(re,null),j(ie,!1))}),Na(()=>(iu.reset(),vi(document,`keydown`,e=>{a().every(t=>e[t]||e.code===t)&&(j(ee,!0),I(ne)?.focus()),e.code===`Escape`&&(document.activeElement===I(ne)||I(ne)?.contains(document.activeElement))&&j(ee,!1)}))),sr(()=>{if(u()!==`system`&&j(te,u()),typeof window<`u`){u()===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?j(te,Uu):j(te,Wu));let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=({matches:e})=>{u()===`system`&&j(te,e?Uu:Wu,!0)};`addEventListener`in e?e.addEventListener(`change`,t):e.addListener(t)}});let oe=e=>{t.onblur?.(e),I(ie)&&!e.currentTarget.contains(e.relatedTarget)&&(j(ie,!1),I(re)&&(I(re).focus({preventScroll:!0}),j(re,null)))},se=e=>{t.onfocus?.(e),!(e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`)&&(I(ie)||(j(ie,!0),j(re,e.relatedTarget,!0)))},ce=e=>{t.onpointerdown?.(e),!(e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`)&&j(C,!0)},le=e=>{t.onmouseenter?.(e),j(ee,!0)},ue=e=>{t.onmouseleave?.(e),I(C)||j(ee,!1)},de=e=>{t.onmousemove?.(e),j(ee,!0)},fe=e=>{t.ondragend?.(e),j(ee,!1)},pe=e=>{t.onpointerup?.(e),j(C,!1)};eu.set(new ou);var me=Ju();W(me,`tabindex`,-1);var he=M(me),ge=e=>{var n=R();Ri(N(n),18,()=>I(S),e=>e,(e,n,i,a)=>{let u=k(()=>{let[e,t]=n.split(`-`);return{y:e,x:t}}),h=k(()=>Gu(c(),l()));var v=qu();Sa(v,e=>({tabindex:-1,dir:e,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":I(te),"data-y-position":I(u).y,"data-x-position":I(u).x,style:t.style,onblur:oe,onfocus:se,onmouseenter:le,onmousemove:de,onmouseleave:ue,ondragend:fe,onpointerdown:ce,onpointerup:pe,...b,[ua]:{"--front-toast-height":`${iu.heights[0]?.height}px`,"--width":`${Vu}px`,"--gap":`${g()}px`,"--offset-top":I(h)[`--offset-top`],"--offset-right":I(h)[`--offset-right`],"--offset-bottom":I(h)[`--offset-bottom`],"--offset-left":I(h)[`--offset-left`],"--mobile-offset-top":I(h)[`--mobile-offset-top`],"--mobile-offset-right":I(h)[`--mobile-offset-right`],"--mobile-offset-bottom":I(h)[`--mobile-offset-bottom`],"--mobile-offset-left":I(h)[`--mobile-offset-left`]}}),[()=>x()],void 0,void 0,`svelte-1vj9f37`),Ri(v,23,()=>iu.toasts.filter(e=>!e.position&&I(i)===0||e.position===n),e=>e.id,(e,i,a,c)=>{{let c=e=>{var n=R(),r=N(n),i=e=>{var n=R();H(N(n),()=>t.successIcon??w),z(e,n)},a=e=>{Ou(e,{})};V(r,e=>{t.successIcon?e(i):t.successIcon!==null&&e(a,1)}),z(e,n)},l=e=>{var n=R(),r=N(n),i=e=>{var n=R();H(N(n),()=>t.errorIcon??w),z(e,n)},a=e=>{Au(e,{})};V(r,e=>{t.errorIcon?e(i):t.errorIcon!==null&&e(a,1)}),z(e,n)},u=e=>{var n=R(),r=N(n),i=e=>{var n=R();H(N(n),()=>t.warningIcon??w),z(e,n)},a=e=>{Mu(e,{})};V(r,e=>{t.warningIcon?e(i):t.warningIcon!==null&&e(a,1)}),z(e,n)},h=e=>{var n=R(),r=N(n),i=e=>{var n=R();H(N(n),()=>t.infoIcon??w),z(e,n)},a=e=>{Pu(e,{})};V(r,e=>{t.infoIcon?e(i):t.infoIcon!==null&&e(a,1)}),z(e,n)},g=e=>{var n=R(),r=N(n),i=e=>{var n=R();H(N(n),()=>t.closeIcon??w),z(e,n)},a=e=>{Iu(e,{})};V(r,e=>{t.closeIcon?e(i):t.closeIcon!==null&&e(a,1)}),z(e,n)},v=k(()=>m()?.duration??f()),b=k(()=>m()?.class??``),x=k(()=>m()?.descriptionClass||``),S=k(()=>m()?.style??``),te=k(()=>m().classes||{}),ne=k(()=>m().unstyled??!1),re=k(()=>m()?.cancelButtonStyle??``),ie=k(()=>m()?.actionButtonStyle??``),ae=k(()=>m()?.closeButtonAriaLabel??y());Eu(e,{get index(){return I(a)},get toast(){return I(i)},get defaultRichColors(){return d()},get duration(){return I(v)},get class(){return I(b)},get descriptionClass(){return I(x)},get invert(){return r()},get visibleToasts(){return p()},get closeButton(){return s()},get interacting(){return I(C)},get position(){return n},get style(){return I(S)},get classes(){return I(te)},get unstyled(){return I(ne)},get cancelButtonStyle(){return I(re)},get actionButtonStyle(){return I(ie)},get closeButtonAriaLabel(){return I(ae)},get expandByDefault(){return o()},get expanded(){return I(ee)},get pauseWhenPageIsHidden(){return _()},get loadingIcon(){return t.loadingIcon},successIcon:c,errorIcon:l,warningIcon:u,infoIcon:h,closeIcon:g,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),T(v),Aa(v,e=>j(ne,e),()=>I(ne)),F(()=>v.dir=v.dir),z(e,v)}),z(e,n)};V(he,e=>{iu.toasts.length>0&&e(ge)}),T(me),F(()=>W(me,`aria-label`,`${v()??``} ${I(ae)??``}`)),z(e,me),O()}var Xu=Qu(),Zu=In({isDesktop:Xu!==void 0,platform:Xu?.platform,quitting:!1,windowState:{maximized:!1,focused:!0}});function Qu(){if(!(typeof window>`u`))return window.nerveDesktop?.kind===`electron`?window.nerveDesktop:void 0}function $u(){return Qu()!==void 0}function ed(){let e=Qu();if(Zu.isDesktop=e!==void 0,Zu.platform=e?.platform,!e)return()=>void 0;let t=()=>void 0,n=()=>void 0;return e.window.getState().then(e=>{Zu.windowState=e}).catch(()=>void 0),t=e.window.onStateChange(e=>{Zu.windowState=e}),n=e.app.onQuitStarted(()=>{Zu.quitting=!0}),()=>{t(),n()}}async function td(){await Qu()?.window.minimize()}async function nd(){await Qu()?.window.toggleMaximize()}async function rd(e){await Qu()?.window.close(e)}async function id(e){await Qu()?.settings.setCloseToTray(e)}async function ad(e){let t=Qu();return t?t.notifications.show(e).catch(()=>({shown:!1})):{shown:!1}}var od=In({initialized:!1,browserSupported:!1,permission:`unsupported`,promptVisible:!1,promptDismissed:!1,lastRequestResult:void 0}),sd=!1,cd={success(e,t={}){hd(`success`,e,t.description)},error(e,t={}){hd(`error`,e,t.description)},message(e,t={}){hd(`message`,e,t.description)}};function ld(e,t=`code block`){e?cd.success(`Copied ${t}`):cd.error(`Could not copy ${t}`)}function ud(){_d(),od.initialized=!0,!(sd||typeof window>`u`)&&(sd=!0,window.addEventListener(`focus`,_d),document.addEventListener(`visibilitychange`,_d))}async function dd(){if(!($u()||!yd()))try{od.lastRequestResult=await Notification.requestPermission(),od.promptDismissed=!0}finally{_d()}}function fd(){od.promptDismissed=!0,_d()}function pd(e,t={}){md(e,t.kind??(e.urgency===`attention`?`error`:`message`),t)}function md(e,t,n){if(!(n.backgroundOnly&&Sd())){if(_d(),$u()){ad(e);return}if(bd()){gd(e,n);return}hd(t,e.title,e.body)}}function hd(e,t,n){let r=n?{description:n}:void 0;e===`success`?su.success(t,r):e===`error`?su.error(t,r):su.message(t,r)}function gd(e,t){try{let n=new Notification(e.title,{body:e.body,tag:t.tag});n.onclick=()=>{window.focus(),n.close()}}catch{}}function _d(){od.browserSupported=yd(),od.permission=xd(),od.promptVisible=vd()}function vd(){return!$u()&&od.browserSupported&&od.permission==="default"&&!od.promptDismissed}function yd(){return typeof window<`u`&&`Notification`in window}function bd(){return yd()&&Notification.permission===`granted`}function xd(){return yd()?Notification.permission:`unsupported`}function Sd(){return typeof document>`u`?!1:document.visibilityState===`visible`&&document.hasFocus()}var Cd=L(`<aside class="fixed right-4 bottom-4 z-50 w-[min(24rem,calc(100vw-2rem))] rounded-lg border border-border bg-card p-4 text-card-foreground shadow-lg" aria-live="polite" aria-label="Notification permission"><div class="flex gap-3"><div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground"><!></div> <div class="min-w-0 flex-1 space-y-3"><div class="space-y-1"><h2 class="text-sm font-medium">Enable desktop notifications</h2> <p class="text-sm text-muted-foreground">Let Nerve alert you when an agent needs approval, asks a question, or finishes in the background.</p></div> <div class="flex flex-wrap justify-end gap-2"><!> <!></div></div></div></aside>`);function wd(e,t){D(t,!1),ja();var n=R(),r=N(n),i=e=>{var t=Cd(),n=M(t),r=M(n);tte(M(r),{class:`size-4`,strokeWidth:2}),T(r);var i=P(r,2),a=P(M(i),2),o=M(a);Ml(o,{variant:`ghost`,size:`sm`,get onclick(){return fd},children:(e,t)=>{E(),z(e,ki(`Not now`))},$$slots:{default:!0}}),Ml(P(o,2),{size:`sm`,onclick:()=>void dd(),children:(e,t)=>{E(),z(e,ki(`Enable notifications`))},$$slots:{default:!0}}),T(a),T(i),T(n),T(t),z(e,t)};V(r,e=>{od.promptVisible&&e(i)}),z(e,n),O()}var Td=In({quitRequested:!1}),Ed=L(`<div class="shutdown-overlay" role="status" aria-live="polite"><div class="shutdown-card"><div class="shutdown-spinner" aria-hidden="true"></div> <strong>Closing Nerve…</strong> <span>Stopping the local daemon safely.</span></div></div>`);function Dd(e,t){D(t,!0);let n=k(()=>Zu.quitting||Td.quitRequested);var r=R(),i=N(r),a=e=>{z(e,Ed())};V(i,e=>{Zu.isDesktop&&I(n)&&e(a)}),z(e,r),O()}var Od=new Set([`$$slots`,`$$events`,`$$legacy`]);function kd(e,t){let n=G(t,Od),r=[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`}],[`circle`,{cx:`6`,cy:`18`,r:`3`}]];uc(e,K({name:`git-branch`},()=>n,{get iconNode(){return r}}))}var Ad=new Set([`$$slots`,`$$events`,`$$legacy`]);function jd(e,t){let n=G(t,Ad),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}]];uc(e,K({name:`panel-left`},()=>n,{get iconNode(){return r}}))}var Md=new Set([`$$slots`,`$$events`,`$$legacy`]);function Nd(e,t){let n=G(t,Md),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}],[`path`,{d:`m16 15-3-3 3-3`}]];uc(e,K({name:`panel-left-close`},()=>n,{get iconNode(){return r}}))}var Pd=new Set([`$$slots`,`$$events`,`$$legacy`]);function Fd(e,t){let n=G(t,Pd),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M15 3v18`}]];uc(e,K({name:`panel-right`},()=>n,{get iconNode(){return r}}))}var Id=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ld(e,t){let n=G(t,Id),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M15 3v18`}],[`path`,{d:`m8 9 3 3-3 3`}]];uc(e,K({name:`panel-right-close`},()=>n,{get iconNode(){return r}}))}var Rd=new Set([`$$slots`,`$$events`,`$$legacy`]);function zd(e,t){let n=G(t,Rd),r=[[`path`,{d:`M12 19h8`}],[`path`,{d:`m4 17 6-6-6-6`}]];uc(e,K({name:`terminal`},()=>n,{get iconNode(){return r}}))}var Bd=new Set([`$$slots`,`$$events`,`$$legacy`]);function Vd(e,t){let n=G(t,Bd),r=[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}],[`path`,{d:`M12 9v4`}],[`path`,{d:`M12 17h.01`}]];uc(e,K({name:`triangle-alert`},()=>n,{get iconNode(){return r}}))}function Hd(e,t){if(!e)return``;let n=Ud(e),r=``,i=t?Ud(t):void 0;i&&(Gd(n,i)||Kd(n,i))?(n=n.slice(i.length),r=`~`):n.startsWith(`/`)&&(r=``);let a=n.split(`/`).filter(Boolean);if(a.length===0)return r||n||`/`;let o=a[a.length-1],s=a.slice(0,-1).map(e=>{let[t]=Array.from(e);return t??``});return[...r?[r,...s]:s,o].join(`/`)}function Ud(e){return e.replace(/\\/g,`/`).replace(/\/+$/,``)||e}function Wd(e){let t=Ud(e);return/^[A-Za-z]:\//.test(t)?t.toLowerCase():t}function Gd(e,t){return Wd(e)===Wd(t)}function Kd(e,t){return Wd(e).startsWith(`${Wd(t)}/`)}function qd(e,t){if(!e||!t)return!1;let n=Ud(e),r=Ud(t);return Gd(n,r)||Kd(n,r)}function Jd(e,t){if(!e)return``;let n=Ud(e),r=t?Ud(t):void 0;return r&&Gd(n,r)?`~`:r&&Kd(n,r)?`~${n.slice(r.length)}`:n||e||`/`}function Yd(e){return Wd(e)}function Xd(e){let t=e.trim();return t?t.startsWith(`/`)||t.startsWith(`~`)||t.startsWith(`\\\\`)||/^[A-Za-z]:[\\/]?/.test(t)||t.includes(`/`)||t.includes(`\\`)||t.toLowerCase().startsWith(`file://`):!1}function Zd(e){return(/^[A-Za-z]:[\\/]/.test(e)||e.startsWith(`\\\\`))&&e.includes(`\\`)?`\\`:`/`}function Qd(e,t,n){return e.endsWith(n)?`${e}${t}`:`${e}${n}${t}`}function $d(e,t){let n=e.match(/^([A-Za-z]:)[\\/]/);if(n){let e=n[1]??``;return{label:e,path:`${e}${t}`}}let r=e.match(/^[\\/]{2}([^\\/]+)[\\/]+([^\\/]+)/);if(r){let e=`${t}${t}${r[1]}${t}${r[2]}`;return{label:e,path:e}}if(e.startsWith(`/`))return{label:`/`,path:`/`}}function ef(e,t){if(!e)return[];let n=e.trim();if(!n)return[];let r=Zd(n),i=Ud(n),a=[],o,s,c=t?Ud(t):void 0;if(c&&(Gd(i,c)||Kd(i,c)))o=t?.replace(/[\\/]+$/,``)||(t??`~`),a.push({label:`~`,path:o}),s=i.slice(c.length);else{let e=$d(n,r);e?(o=e.path,a.push({label:e.label,path:e.path}),s=i.slice(Ud(e.path).length)):(o=``,s=i)}for(let e of s.split(`/`).filter(Boolean))o=o?Qd(o,e,r):e,a.push({label:e,path:o});return a}function tf(e){return e<1e3?e.toString():e<1e4?`${(e/1e3).toFixed(1)}k`:e<1e6?`${Math.round(e/1e3)}k`:e<1e7?`${(e/1e6).toFixed(1)}M`:`${Math.round(e/1e6)}M`}function nf(e){return e==null?`neutral`:e>90?`error`:e>70?`warning`:`neutral`}function rf(e){if(e==null||!Number.isFinite(e)||e<0)return null;let t=Math.floor(e);if(t===0)return`0m`;let n=Math.floor(t/1440),r=Math.floor(t%1440/60),i=t%60,a=[];return n>0&&a.push(`${n}d`),r>0&&a.push(`${r}h`),i>0&&a.push(`${i}m`),a.join(` `)}function af(e){if(!e)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:sf(t-Date.now())}function of(e){return e==null||e<=0?null:sf(e*1e3)}function sf(e){return e<=0?null:rf(Math.floor(e/6e4))}var cf=Dl({base:`h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap transition-colors focus-visible:ring-[3px] [&>svg]:pointer-events-none`,variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`},tone:{neutral:`border-border bg-secondary text-muted-foreground`,accent:`border-border bg-accent text-foreground`,running:`border-info/40 bg-info/15 text-info`,good:`border-success/40 bg-success/15 text-success`,warn:`border-warning/40 bg-warning/15 text-warning`,danger:`border-destructive/40 bg-destructive/15 text-destructive`},size:{xs:`px-1.5 py-px text-xs`,sm:`px-2 py-0.5 text-xs`}}}),lf=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`href`,`class`,`variant`,`tone`,`size`,`children`]);function uf(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,lf);var i=R();Gi(N(i),()=>t.href?`a`:`span`,!1,(e,i)=>{Aa(e,e=>n(e),()=>n()),Sa(e,e=>({"data-slot":`badge`,href:t.href,class:e,...r}),[()=>ul(cf({variant:t.variant,tone:t.tone,size:t.size}),t.class)]);var a=R();H(N(a),()=>t.children??w),z(i,a)}),z(e,i),O()}function df(e){return typeof e==`function`}function ff(e){return typeof e==`object`&&!!e}var pf=[`string`,`number`,`bigint`,`boolean`];function mf(e){return e==null||pf.includes(typeof e)?!0:Array.isArray(e)?e.every(e=>mf(e)):typeof e==`object`?Object.getPrototypeOf(e)===Object.prototype:!1}var hf=Symbol(`box`),gf=Symbol(`is-writable`);function J(e,t){let n=k(e);return t?{[hf]:!0,[gf]:!0,get current(){return I(n)},set current(e){t(e)}}:{[hf]:!0,get current(){return e()}}}function _f(e){return ff(e)&&hf in e}function vf(e){return _f(e)&&gf in e}function yf(e){return _f(e)?e:df(e)?J(e):Sf(e)}function bf(e){return Object.entries(e).reduce((e,[t,n])=>_f(n)?(vf(n)?Object.defineProperty(e,t,{get(){return n.current},set(e){n.current=e}}):Object.defineProperty(e,t,{get(){return n.current}}),e):Object.assign(e,{[t]:n}),{})}function xf(e){return vf(e)?{[hf]:!0,get current(){return e.current}}:e}function Sf(e){let t=A(In(e));return{[hf]:!0,[gf]:!0,get current(){return I(t)},set current(e){j(t,e,!0)}}}function Cf(e){let t=A(In(e));return{[hf]:!0,[gf]:!0,get current(){return I(t)},set current(e){j(t,e,!0)}}}Cf.from=yf,Cf.with=J,Cf.flatten=bf,Cf.readonly=xf,Cf.isBox=_f,Cf.isWritableBox=vf;function wf(...e){return function(t){for(let n of e)if(n){if(t.defaultPrevented)return;typeof n==`function`?n.call(this,t):n.current?.call(this,t)}}}var Tf=/\d/,Ef=[`-`,`_`,`/`,`.`];function Df(e=``){if(!Tf.test(e))return e!==e.toLowerCase()}function Of(e){let t=[],n=``,r,i;for(let a of e){let e=Ef.includes(a);if(e===!0){t.push(n),n=``,r=void 0;continue}let o=Df(a);if(i===!1){if(r===!1&&o===!0){t.push(n),n=a,r=o;continue}if(r===!0&&o===!1&&n.length>1){let e=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=e+a,r=o;continue}}n+=a,r=o,i=e}return t.push(n),t}function kf(e){return e?Of(e).map(e=>jf(e)).join(``):``}function Af(e){return Mf(kf(e||``))}function jf(e){return e?e[0].toUpperCase()+e.slice(1):``}function Mf(e){return e?e[0].toLowerCase()+e.slice(1):``}function Nf(e){if(!e)return{};let t={};function n(e,n){if(e.startsWith(`-moz-`)||e.startsWith(`-webkit-`)||e.startsWith(`-ms-`)||e.startsWith(`-o-`)){t[kf(e)]=n;return}if(e.startsWith(`--`)){t[e]=n;return}t[Af(e)]=n}return Os(e,n),t}function Pf(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function Ff(e,t){let n=RegExp(e,`g`);return e=>{if(typeof e!=`string`)throw TypeError(`expected an argument of type string, but got ${typeof e}`);return e.match(n)?e.replace(n,t):e}}var If=Ff(/[A-Z]/,e=>`-${e.toLowerCase()}`);function Lf(e){if(!e||typeof e!=`object`||Array.isArray(e))throw TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${If(t)}: ${e[t]};`).join(`
|
|
13
|
-
`)}function Rf(e={}){return Lf(e).replace(`
|
|
14
|
-
`,` `)}var zf=new Set(`onabort.onanimationcancel.onanimationend.onanimationiteration.onanimationstart.onauxclick.onbeforeinput.onbeforetoggle.onblur.oncancel.oncanplay.oncanplaythrough.onchange.onclick.onclose.oncompositionend.oncompositionstart.oncompositionupdate.oncontextlost.oncontextmenu.oncontextrestored.oncopy.oncuechange.oncut.ondblclick.ondrag.ondragend.ondragenter.ondragleave.ondragover.ondragstart.ondrop.ondurationchange.onemptied.onended.onerror.onfocus.onfocusin.onfocusout.onformdata.ongotpointercapture.oninput.oninvalid.onkeydown.onkeypress.onkeyup.onload.onloadeddata.onloadedmetadata.onloadstart.onlostpointercapture.onmousedown.onmouseenter.onmouseleave.onmousemove.onmouseout.onmouseover.onmouseup.onpaste.onpause.onplay.onplaying.onpointercancel.onpointerdown.onpointerenter.onpointerleave.onpointermove.onpointerout.onpointerover.onpointerup.onprogress.onratechange.onreset.onresize.onscroll.onscrollend.onsecuritypolicyviolation.onseeked.onseeking.onselect.onselectionchange.onselectstart.onslotchange.onstalled.onsubmit.onsuspend.ontimeupdate.ontoggle.ontouchcancel.ontouchend.ontouchmove.ontouchstart.ontransitioncancel.ontransitionend.ontransitionrun.ontransitionstart.onvolumechange.onwaiting.onwebkitanimationend.onwebkitanimationiteration.onwebkitanimationstart.onwebkittransitionend.onwheel`.split(`.`));function Bf(e){return zf.has(e)}function Vf(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];if(r){for(let e of Object.keys(r)){let n=t[e],i=r[e],a=typeof n==`function`,o=typeof i==`function`;if(a&&typeof o&&Bf(e))t[e]=wf(n,i);else if(a&&o)t[e]=Pf(n,i);else if(e===`class`){let r=mf(n),a=mf(i);r&&a?t[e]=Xi(n,i):r?t[e]=Xi(n):a&&(t[e]=Xi(i))}else if(e===`style`){let r=typeof n==`object`,a=typeof i==`object`,o=typeof n==`string`,s=typeof i==`string`;if(r&&a)t[e]={...n,...i};else if(r&&s){let r=Nf(i);t[e]={...n,...r}}else if(o&&a)t[e]={...Nf(n),...i};else if(o&&s){let r=Nf(n),a=Nf(i);t[e]={...r,...a}}else r?t[e]=n:a?t[e]=i:o?t[e]=n:s&&(t[e]=i)}else t[e]=i===void 0?n:i}for(let e of Object.getOwnPropertySymbols(r)){let n=t[e],i=r[e];t[e]=i===void 0?n:i}}}return typeof t.style==`object`&&(t.style=Rf(t.style).replaceAll(`
|
|
15
|
-
`,` `)),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}var Hf={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,transform:`translateX(-100%)`};Rf(Hf);var Uf=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function Wf(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}new class{#e;#t;constructor(e={}){let{window:t=Uf,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Kt(e=>{let n=vi(t,`focusin`,e),r=vi(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?Wf(this.#e):null}};function Gf(e){return typeof e==`function`}function Kf(e,t){if(Gf(e)){let n=e();return n===void 0?t:n}return e===void 0?t:e}var qf=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return Et(this.#t)}get(){let e=wt(this.#t);if(e===void 0)throw Error(`Context "${this.#e}" not found`);return e}getOr(e){let t=wt(this.#t);return t===void 0?e:t}set(e){return Tt(this.#t,e)}};function Jf(e,t){let n=A(null),r=k(()=>Kf(t,250));function i(...t){if(I(n))I(n).timeout&&clearTimeout(I(n).timeout);else{let e,t;j(n,{timeout:null,runner:null,promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t},!0)}return I(n).runner=async()=>{if(!I(n))return;let r=I(n);j(n,null);try{r.resolve(await e.apply(this,t))}catch(e){r.reject(e)}},I(n).timeout=setTimeout(I(n).runner,I(r)),I(n).promise}return i.cancel=async()=>{(!I(n)||I(n).timeout===null)&&(await new Promise(e=>setTimeout(e,0)),!I(n)||I(n).timeout===null)||(clearTimeout(I(n).timeout),I(n).reject(`Cancelled`),j(n,null))},i.runScheduledNow=async()=>{(!I(n)||!I(n).timeout)&&(await new Promise(e=>setTimeout(e,0)),!I(n)||!I(n).timeout)||(clearTimeout(I(n).timeout),I(n).timeout=null,await I(n).runner?.())},Object.defineProperty(i,"pending",{enumerable:!0,get(){return!!I(n)?.timeout}}),i}function Yf(e,t){switch(e){case`post`:sr(t);break;case`pre`:lr(t);break}}function Xf(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;Yf(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=ei(()=>n(t,o));return o=t,r})}function Zf(e,t,n){let r=ur(()=>{let i=!1;Xf(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});sr(()=>r)}function Qf(e,t,n){Xf(e,`post`,t,n)}function $f(e,t,n){Xf(e,`pre`,t,n)}Qf.pre=$f;function ep(e,t){Zf(e,`post`,t)}function tp(e,t){Zf(e,`pre`,t)}ep.pre=tp;function np(e){return Gf(e)?e():e}var rp=class{#e={width:0,height:0};#t=!1;#n;#r;#i;#a=k(()=>(I(this.#s)?.(),this.getSize().width));#o=k(()=>(I(this.#s)?.(),this.getSize().height));#s=k(()=>{let e=np(this.#r);if(e)return Kt(t=>{if(!this.#i)return;let n=new this.#i.ResizeObserver(e=>{this.#t=!0;for(let t of e){let e=this.#n.box===`content-box`?t.contentBoxSize:t.borderBoxSize,n=Array.isArray(e)?e:[e];this.#e.width=n.reduce((e,t)=>Math.max(e,t.inlineSize),0),this.#e.height=n.reduce((e,t)=>Math.max(e,t.blockSize),0)}t()});return n.observe(e),()=>{this.#t=!1,n.disconnect()}})});constructor(e,t={box:`border-box`}){this.#i=t.window??Uf,this.#n=t,this.#r=e,this.#e={width:0,height:0}}calculateSize(){let e=np(this.#r);if(!e||!this.#i)return;let t=e.offsetWidth,n=e.offsetHeight;if(this.#n.box===`border-box`)return{width:t,height:n};let r=this.#i.getComputedStyle(e),i=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),a=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom),o=parseFloat(r.borderLeftWidth)+parseFloat(r.borderRightWidth),s=parseFloat(r.borderTopWidth)+parseFloat(r.borderBottomWidth);return{width:t-i-o,height:n-a-s}}getSize(){return this.#t?this.#e:this.calculateSize()??this.#e}get current(){return I(this.#s)?.(),this.getSize()}get width(){return I(this.#a)}get height(){return I(this.#o)}},ip=class{#e=A(!1);constructor(){sr(()=>(ei(()=>j(this.#e,!0)),()=>{j(this.#e,!1)}))}get current(){return I(this.#e)}},ap=class{#e=()=>void 0;#t=k(()=>this.#e());constructor(e,t){let n;t!==void 0&&(n=t),this.#e=()=>{try{return n}finally{n=e()}}}get current(){return I(this.#t)}};function op(e,t){let n,r=null;return(...i)=>new Promise(a=>{r&&r(void 0),r=a,clearTimeout(n),n=setTimeout(async()=>{let t=await e(...i);r&&=(r(t),null)},t)})}function sp(e,t){let n=0,r=null;return(...i)=>{let a=Date.now();return n&&a-n<t?r??Promise.resolve(void 0):(n=a,r=e(...i),r)}}function cp(e,t,n={},r){let{lazy:i=!1,once:a=!1,initialValue:o,debounce:s,throttle:c}=n,l=A(In(o)),u=A(!1),d=A(void 0),f=A(In([])),p=()=>{I(f).forEach(e=>e()),j(f,[],!0)},m=e=>{j(f,[...I(f),e],!0)},h=async(e,n,r=!1)=>{try{j(u,!0),j(d,void 0),p();let i=new AbortController;m(()=>i.abort());let a=await t(e,n,{data:I(l),refetching:r,onCleanup:m,signal:i.signal});return j(l,a,!0),a}catch(e){e instanceof DOMException&&e.name===`AbortError`||j(d,e,!0);return}finally{j(u,!1)}},g=s?op(h,s):c?sp(h,c):h,_=Array.isArray(e)?e:[e],v;return r((t,n)=>{a&&v||(v=t,g(Array.isArray(e)?t:t[0],Array.isArray(e)?n:n?.[0]))},{lazy:i}),{get current(){return I(l)},get loading(){return I(u)},get error(){return I(d)},mutate:e=>{j(l,e,!0)},refetch:t=>{let n=_.map(e=>e());return g(Array.isArray(e)?n:n[0],Array.isArray(e)?n:n[0],t??!0)}}}function lp(e,t,n){return cp(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Qf(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}function up(e,t,n){return cp(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Qf.pre(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}lp.pre=up;function dp(e){sr(()=>()=>{e()})}function fp(e){sr(()=>ei(()=>e()))}function pp(e,t){return setTimeout(t,e)}function mp(e){Zr().then(e)}var hp=1,gp=9,_p=11;function vp(e){return ff(e)&&e.nodeType===hp&&typeof e.nodeName==`string`}function yp(e){return ff(e)&&e.nodeType===gp}function bp(e){return ff(e)&&e.constructor?.name===`VisualViewport`}function xp(e){return ff(e)&&e.nodeType!==void 0}function Sp(e){return xp(e)&&e.nodeType===_p&&`host`in e}function Cp(e,t){if(!e||!t||!vp(e)||!vp(t))return!1;let n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&Sp(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function wp(e){return yp(e)?e:bp(e)?e.document:e?.ownerDocument??document}function Tp(e){return Sp(e)?Tp(e.host):yp(e)?e.defaultView??window:vp(e)?e.ownerDocument?.defaultView??window:window}function Ep(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var Dp=class{element;#e=k(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return I(this.#e)}set root(e){j(this.#e,e)}constructor(e){typeof e==`function`?this.element=J(e):this.element=e}getDocument=()=>wp(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>Ep(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)};function Op(e,t){return{[ri()]:n=>_f(e)?(e.current=n,ei(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e.current=null,t?.(null))}):(e(n),ei(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e(null),t?.(null))})}}function kp(e){return e?`true`:`false`}function zte(e){return e?`true`:void 0}function Ap(e){return e?``:void 0}function jp(e){return e?!0:void 0}function Mp(e){return e?`open`:`closed`}function Bte(e){return e?`checked`:`unchecked`}function Np(e){return e===`starting`?{"data-starting-style":``}:e===`ending`?{"data-ending-style":``}:{}}function Pp(e,t){return t?`mixed`:e?`true`:`false`}var Vte=class{#e;#t;attrs;constructor(e){this.#e=e.getVariant?e.getVariant():null,this.#t=this.#e?`data-${this.#e}-`:`data-${e.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(e.parts.map(e=>[e,this.getAttr(e)]))}getAttr(e,t){return t?`data-${t}-${e}`:`${this.#t}${e}`}selector(e,t){return`[${this.getAttr(e,t)}]`}};function Fp(e){let t=new Vte(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}var Ip=`ArrowDown`,Lp=`ArrowLeft`,Rp=`ArrowRight`,zp=`ArrowUp`,Hte=`Enter`,Bp=`Home`,Vp=`PageDown`,Hp=`PageUp`;function Ute(e){return window.getComputedStyle(e).getPropertyValue(`direction`)}var Wte=[Ip,Hp,Bp],Gte=[zp,Vp,`End`];[...Wte,...Gte];function Kte(e=`ltr`,t=`horizontal`){return{horizontal:e===`rtl`?Lp:Rp,vertical:Ip}[t]}function qte(e=`ltr`,t=`horizontal`){return{horizontal:e===`rtl`?Rp:Lp,vertical:zp}[t]}function Jte(e=`ltr`,t=`horizontal`){return[`ltr`,`rtl`].includes(e)||(e=`ltr`),[`horizontal`,`vertical`].includes(t)||(t=`horizontal`),{nextKey:Kte(e,t),prevKey:qte(e,t)}}var Up=typeof document<`u`,Wp=Yte();function Yte(){return Up&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Gp(e){return e instanceof HTMLElement}function Kp(e){return e instanceof Element}function qp(e){return e instanceof Element||e instanceof SVGElement}function Jp(e){return e.pointerType===`touch`}function Xte(e){return e.matches(`:focus-visible`)}function Zte(e){return e!==null}function Qte(e){return e instanceof HTMLInputElement&&`select`in e}var Yp=class{#e;#t=Cf(null);constructor(e){this.#e=e}getCandidateNodes(){return this.#e.rootNode.current?this.#e.candidateSelector?Array.from(this.#e.rootNode.current.querySelectorAll(this.#e.candidateSelector)):this.#e.candidateAttr?Array.from(this.#e.rootNode.current.querySelectorAll(`[${this.#e.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){let e=this.getCandidateNodes();e.length&&e[0]?.focus()}handleKeydown(e,t,n=!1){let r=this.#e.rootNode.current;if(!r||!e)return;let i=this.getCandidateNodes();if(!i.length)return;let a=i.indexOf(e),{nextKey:o,prevKey:s}=Jte(Ute(r),this.#e.orientation.current),c=this.#e.loop.current,l={[o]:a+1,[s]:a-1,[Bp]:0,End:i.length-1};if(n){let e=o===`ArrowDown`?Rp:Ip,t=s===`ArrowUp`?Lp:zp;l[e]=a+1,l[t]=a-1}let u=l[t.key];if(u===void 0)return;t.preventDefault(),u<0&&c?u=i.length-1:u===i.length&&c&&(u=0);let d=i[u];if(d)return d.focus(),this.#t.current=d.id,this.#e.onCandidateFocus?.(d),d}getTabIndex(e){let t=this.getCandidateNodes(),n=this.#t.current!==null;return e&&!n&&t[0]===e?(this.#t.current=e.id,0):e?.id===this.#t.current?0:-1}setCurrentTabStopId(e){this.#t.current=e}focusCurrentTabStop(){let e=this.#t.current;if(!e)return;let t=this.#e.rootNode.current?.querySelector(`#${e}`);!t||!Gp(t)||t.focus()}},Xp=class{#e;#t=null;#n=null;#r=0;constructor(e){this.#e=e,dp(()=>this.#i())}#i(){this.#t!==null&&(window.cancelAnimationFrame(this.#t),this.#t=null),this.#n?.disconnect(),this.#n=null,this.#r++}run(e){this.#i();let t=this.#e.ref.current;if(!t)return;if(typeof t.getAnimations!=`function`){this.#a(e);return}let n=this.#r,r=()=>{n===this.#r&&this.#a(e)},i=()=>{if(n!==this.#r)return;let e=t.getAnimations();if(e.length===0){r();return}Promise.all(e.map(e=>e.finished)).then(()=>{r()}).catch(()=>{if(n===this.#r){if(t.getAnimations().some(e=>e.pending||e.playState!==`finished`)){i();return}r()}})},a=()=>{this.#t=window.requestAnimationFrame(()=>{this.#t=null,i()})};if(!this.#e.afterTick.current){a();return}this.#t=window.requestAnimationFrame(()=>{this.#t=null;let e=`data-starting-style`;if(!t.hasAttribute(e)){a();return}this.#n=new MutationObserver(()=>{n===this.#r&&(t.hasAttribute(e)||(this.#n?.disconnect(),this.#n=null,a()))}),this.#n.observe(t,{attributes:!0,attributeFilter:[e]})})}#a(e){let t=()=>{e()};this.#e.afterTick?mp(t):t()}},Zp=class{#e;#t;#n;#r=A(!1);#i=A(void 0);#a=!1;#o=null;constructor(e){this.#e=e,j(this.#r,e.open.current,!0),this.#t=e.enabled??!0,this.#n=new Xp({ref:this.#e.ref,afterTick:this.#e.open}),dp(()=>this.#s()),Qf(()=>this.#e.open.current,e=>{if(!this.#a){this.#a=!0;return}if(this.#s(),!e&&this.#e.shouldSkipExitAnimation?.()){j(this.#r,!1),j(this.#i,void 0),this.#e.onComplete?.();return}if(e&&j(this.#r,!0),j(this.#i,e?`starting`:`ending`,!0),e&&(this.#o=window.requestAnimationFrame(()=>{this.#o=null,this.#e.open.current&&j(this.#i,void 0)})),!this.#t){e||j(this.#r,!1),j(this.#i,void 0),this.#e.onComplete?.();return}this.#n.run(()=>{e===this.#e.open.current&&(this.#e.open.current||j(this.#r,!1),j(this.#i,void 0),this.#e.onComplete?.())})})}get shouldRender(){return I(this.#r)}get transitionStatus(){return I(this.#i)}#s(){this.#o!==null&&(window.cancelAnimationFrame(this.#o),this.#o=null)}};function Qp(){}function $p(e,t){return t===void 0?`bits-${e}`:`bits-${e}-${t}`}var $te=Fp({component:`dialog`,parts:[`content`,`trigger`,`overlay`,`title`,`description`,`close`,`cancel`,`action`]}),em=new qf(`Dialog.Root | AlertDialog.Root`),tm=class e{static create(t){let n=em.getOr(null);return em.set(new e(t,n))}opts;#e=A(null);get triggerNode(){return I(this.#e)}set triggerNode(e){j(this.#e,e,!0)}#t=A(null);get contentNode(){return I(this.#t)}set contentNode(e){j(this.#t,e,!0)}#n=A(null);get overlayNode(){return I(this.#n)}set overlayNode(e){j(this.#n,e,!0)}#r=A(null);get descriptionNode(){return I(this.#r)}set descriptionNode(e){j(this.#r,e,!0)}#i=A(void 0);get contentId(){return I(this.#i)}set contentId(e){j(this.#i,e,!0)}#a=A(void 0);get titleId(){return I(this.#a)}set titleId(e){j(this.#a,e,!0)}#o=A(void 0);get triggerId(){return I(this.#o)}set triggerId(e){j(this.#o,e,!0)}#s=A(void 0);get descriptionId(){return I(this.#s)}set descriptionId(e){j(this.#s,e,!0)}#c=A(null);get cancelNode(){return I(this.#c)}set cancelNode(e){j(this.#c,e,!0)}#l=A(0);get nestedOpenCount(){return I(this.#l)}set nestedOpenCount(e){j(this.#l,e,!0)}depth;parent;contentPresence;overlayPresence;constructor(e,t){this.opts=e,this.parent=t,this.depth=t?t.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new Zp({ref:J(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new Zp({ref:J(()=>this.overlayNode),open:this.opts.open,enabled:!0}),Qf(()=>this.opts.open.current,e=>{this.parent&&(e?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),dp(()=>{this.opts.open.current&&this.parent?.decrementNested()})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=e=>$te.getAttr(e,this.opts.variant.current);incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}#u=k(()=>({"data-state":Mp(this.opts.open.current)}));get sharedProps(){return I(this.#u)}set sharedProps(e){j(this.#u,e)}},ene=class e{static create(t){return new e(t,em.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),this.root.handleClose())}#e=k(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:``,onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},tne=class e{static create(t){return new e(t,em.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(this.opts.ref)}#e=k(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`action`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},nne=class e{static create(t){return new e(t,em.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.titleId=this.opts.id.current,this.attachment=Op(this.opts.ref),Qf.pre(()=>this.opts.id.current,e=>{this.root.titleId=e})}#e=k(()=>({id:this.opts.id.current,role:`heading`,"aria-level":this.opts.level.current,[this.root.getBitsAttr(`title`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},rne=class e{static create(t){return new e(t,em.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.descriptionId=this.opts.id.current,this.attachment=Op(this.opts.ref,e=>{this.root.descriptionNode=e}),Qf.pre(()=>this.opts.id.current,e=>{this.root.descriptionId=e})}#e=k(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`description`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},nm=class e{static create(t){return new e(t,em.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(this.opts.ref,e=>{this.root.contentNode=e,this.root.contentId=e?.id})}#e=k(()=>({open:this.root.opts.open.current}));get snippetProps(){return I(this.#e)}set snippetProps(e){j(this.#e,e)}#t=k(()=>({id:this.opts.id.current,role:this.root.opts.variant.current===`alert-dialog`?`alertdialog`:`dialog`,"aria-modal":`true`,"aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr(`content`)]:``,style:{pointerEvents:`auto`,outline:this.root.opts.variant.current===`alert-dialog`?`none`:void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:`layout style`},tabindex:this.root.opts.variant.current===`alert-dialog`?-1:void 0,"data-nested-open":Ap(this.root.nestedOpenCount>0),"data-nested":Ap(this.root.parent!==null),...Np(this.root.contentPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}get shouldRender(){return this.root.contentPresence.shouldRender}},ine=class e{static create(t){return new e(t,em.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(this.opts.ref,e=>this.root.overlayNode=e)}#e=k(()=>({open:this.root.opts.open.current}));get snippetProps(){return I(this.#e)}set snippetProps(e){j(this.#e,e)}#t=k(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`overlay`)]:``,style:{pointerEvents:`auto`,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":Ap(this.root.nestedOpenCount>0),"data-nested":Ap(this.root.parent!==null),...Np(this.root.overlayPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}get shouldRender(){return this.root.overlayPresence.shouldRender}},ane=class e{static create(t){return new e(t,em.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(this.opts.ref,e=>this.root.cancelNode=e),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),this.root.handleClose())}#e=k(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`cancel`)]:``,onclick:this.onclick,onkeydown:this.onkeydown,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}};function one(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`onOpenChange`,3,Qp),i=q(t,`onOpenChangeComplete`,3,Qp);tm.create({variant:J(()=>`alert-dialog`),open:J(()=>n(),e=>{n(e),r()(e)}),onOpenChangeComplete:J(()=>i())});var a=R();H(N(a),()=>t.children??w),z(e,a),O()}var sne=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`level`]),cne=L(`<div><!></div>`);function rm(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`level`,3,2),o=G(t,sne),s=nne.create({id:J(()=>r()),level:J(()=>a()),ref:J(()=>i(),e=>i(e))}),c=k(()=>Vf(o,s.props));var l=R(),u=N(l),d=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(c)})),z(e,n)},f=e=>{var n=cne();Sa(n,()=>({...I(c)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(u,e=>{t.child?e(d):e(f,-1)}),z(e,l),O()}var lne=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`]),une=L(`<button><!></button>`);function dne(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=G(t,lne),o=tne.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),s=k(()=>Vf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=une();Sa(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var fne=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`children`,`child`,`disabled`]),pne=L(`<button><!></button>`);function mne(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`disabled`,3,!1),o=G(t,fne),s=ane.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e)),disabled:J(()=>!!a())}),c=k(()=>Vf(o,s.props));var l=R(),u=N(l),d=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(c)})),z(e,n)},f=e=>{var n=pne();Sa(n,()=>({...I(c)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(u,e=>{t.child?e(d):e(f,-1)}),z(e,l),O()}function hne(e,t){var n=R();xee(N(n),()=>t.children,e=>{var n=R();H(N(n),()=>t.children??w),z(e,n)}),z(e,n)}var gne=new qf(`BitsConfig`);function _ne(){let e=new vne(null,{});return gne.getOr(e).opts}var vne=class{opts;constructor(e,t){let n=yne(e,t);this.opts={defaultPortalTo:n(e=>e.defaultPortalTo),defaultLocale:n(e=>e.defaultLocale)}}};function yne(e,t){return n=>J(()=>{let r=n(t)?.current;if(r!==void 0)return r;if(e!==null)return n(e.opts)?.current})}function bne(e,t){return n=>{let r=_ne();return J(()=>{let i=n();if(i!==void 0)return i;let a=e(r).current;return a===void 0?t:a})}}var xne=bne(e=>e.defaultPortalTo,`body`);function im(e,t){D(t,!0);let n=xne(()=>t.to),r=tee(),i=k(a);function a(){if(!Up||t.disabled)return null;let e=null;return e=typeof n.current==`string`?document.querySelector(n.current):n.current,e}let o;function s(){o&&=(yee(o),null)}Qf([()=>I(i),()=>t.disabled],([e,n])=>{if(!e||n){s();return}return o=ji(hne,{target:e,props:{children:t.children},context:r}),()=>{s()}});var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.children??w),z(e,n)};V(l,e=>{t.disabled&&e(u)}),z(e,c),O()}var Sne=class{eventName;options;constructor(e,t={bubbles:!0,cancelable:!0}){this.eventName=e,this.options=t}createEvent(e){return new CustomEvent(this.eventName,{...this.options,detail:e})}dispatch(e,t){let n=this.createEvent(t);return e.dispatchEvent(n),n}listen(e,t,n){return vi(e,this.eventName,e=>{t(e)},n)}};function am(e,t=500){let n=null,r=(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function om(e,t){return e===t||e.contains(t)}function sm(e){return e?.ownerDocument??document}function Cne(e,t){let{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return n<i.left||n>i.right||r<i.top||r>i.bottom}var cm=[Hte,` `],wne=[Ip,Hp,Bp],lm=[zp,Vp,`End`],Tne=[...wne,...lm],Ene={ltr:[...cm,Rp],rtl:[...cm,Lp]},Dne={ltr:[Lp],rtl:[Rp]};function um(e){return e.pointerType===`mouse`}function One(e,{select:t=!1}={}){if(!e||!e.focus)return;let n=wp(e);if(n.activeElement===e)return;let r=n.activeElement;e.focus({preventScroll:!0}),e!==r&&Qte(e)&&t&&e.select()}function kne(e,{select:t=!1}={},n){let r=n();for(let i of e)if(One(i,{select:t}),n()!==r)return!0}var dm=A(!1),Ane=class e{static _refs=0;static _cleanup;constructor(){sr(()=>(e._refs===0&&(e._cleanup=ur(()=>{let e=[],t=e=>{j(dm,!1)};return e.push(vi(document,`pointerdown`,t,{capture:!0}),vi(document,`pointermove`,t,{capture:!0}),vi(document,`keydown`,e=>{j(dm,!0)},{capture:!0})),Pf(...e)})),e._refs++,()=>{e._refs--,e._refs===0&&(j(dm,!1),e._cleanup?.())}))}get current(){return I(dm)}set current(e){j(dm,e,!0)}},fm=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],pm=fm.join(`,`),mm=typeof Element>`u`,hm=mm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,gm=!mm&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},_m=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):_m(e.parentNode))},jne=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},vm=function(e,t,n){if(_m(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(pm));return t&&hm.call(e,pm)&&r.unshift(e),r=r.filter(n),r},ym=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!_m(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=ym(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{hm.call(a,pm)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!_m(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=ym(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},bm=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},xm=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||jne(e))&&!bm(e)?0:e.tabIndex},Mne=function(e,t){var n=xm(e);return n<0&&t&&!bm(e)?0:n},Nne=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Sm=function(e){return e.tagName===`INPUT`},Pne=function(e){return Sm(e)&&e.type===`hidden`},Fne=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Ine=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Lne=function(e){if(!e.name)return!0;var t=e.form||gm(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Ine(r,e.form);return!i||i===e},Rne=function(e){return Sm(e)&&e.type===`radio`},zne=function(e){return Rne(e)&&!Lne(e)},Bne=function(e){var t=e&&gm(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=gm(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Cm=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Vne=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=hm.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(hm.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=gm(e);if(o&&!o.shadowRoot&&r(o)===!0)return Cm(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Bne(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Cm(e);return!1},Hne=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return hm.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},wm=function(e,t){return!(t.disabled||Pne(t)||Vne(t,e)||Fne(t)||Hne(t))},Tm=function(e,t){return!(zne(t)||xm(t)<0||!wm(e,t))},Une=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Em=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Mne(a,i),s=i?Em(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Nne).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Dm=function(e,t){return t||={},Em(t.getShadowRoot?ym([e],t.includeContainer,{filter:Tm.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Une}):vm(e,t.includeContainer,Tm.bind(null,t)))},Om=function(e,t){return t||={},t.getShadowRoot?ym([e],t.includeContainer,{filter:wm.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):vm(e,t.includeContainer,wm.bind(null,t))},km=function(e,t){if(t||={},!e)throw Error(`No node provided`);return hm.call(e,pm)===!1?!1:Tm(t,e)},Wne=fm.concat(`iframe:not([inert]):not([inert] *)`).join(`,`),Am=function(e,t){if(t||={},!e)throw Error(`No node provided`);return hm.call(e,Wne)===!1?!1:wm(t,e)};function jm(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`}}function Gne(e,t){if(!km(e,jm()))return Kne(e,t);let n=wp(e),r=Dm(n.body,jm());t===`prev`&&r.reverse();let i=r.indexOf(e);return i===-1?n.body:r.slice(i+1)[0]}function Kne(e,t){let n=wp(e);if(!Am(e,jm()))return n.body;let r=Om(n.body,jm());t===`prev`&&r.reverse();let i=r.indexOf(e);return i===-1?n.body:r.slice(i+1).find(e=>km(e,jm()))??n.body}function qne(e,t,n=!0){if(!(e.length===0||t<0||t>=e.length))return e.length===1&&t===0?e[0]:t===e.length-1?n?e[0]:void 0:e[t+1]}function Jne(e,t,n=!0){if(!(e.length===0||t<0||t>=e.length))return e.length===1&&t===0?e[0]:t===0?n?e[e.length-1]:void 0:e[t-1]}function Yne(e,t,n,r=!0){if(e.length===0||t<0||t>=e.length)return;let i=t+n;return i=r?(i%e.length+e.length)%e.length:Math.max(0,Math.min(i,e.length-1)),e[i]}function Xne(e,t,n,r=!0){if(e.length===0||t<0||t>=e.length)return;let i=t-n;return i=r?(i%e.length+e.length)%e.length:Math.max(0,Math.min(i,e.length-1)),e[i]}function Mm(e,t,n){let r=t.toLowerCase();if(r.endsWith(` `)){let i=r.slice(0,-1);if(e.filter(e=>e.toLowerCase().startsWith(i)).length<=1)return Mm(e,i,n);let a=n?.toLowerCase();if(a&&a.startsWith(i)&&a.charAt(i.length)===` `&&t.trim()===i)return n;let o=e.filter(e=>e.toLowerCase().startsWith(r));if(o.length>0){let t=n?e.indexOf(n):-1;return Nm(o,Math.max(t,0)).find(e=>e!==n)||n}}let i=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=i.toLowerCase(),o=n?e.indexOf(n):-1,s=Nm(e,Math.max(o,0));i.length===1&&(s=s.filter(e=>e!==n));let c=s.find(e=>e?.toLowerCase().startsWith(a));return c===n?void 0:c}function Nm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Zne={afterMs:1e4,onChange:Qp};function Pm(e,t){let{afterMs:n,onChange:r,getWindow:i}={...Zne,...t},a=null,o=A(In(e));function s(){return i().setTimeout(()=>{j(o,e,!0),r?.(e)},n)}return sr(()=>()=>{a&&i().clearTimeout(a)}),J(()=>I(o),e=>{j(o,e,!0),r?.(e),a&&i().clearTimeout(a),a=s()})}var Fm=class{#e;#t;#n=k(()=>this.#e.onMatch?this.#e.onMatch:e=>e.focus());#r=k(()=>this.#e.getCurrentItem?this.#e.getCurrentItem:this.#e.getActiveElement);constructor(e){this.#e=e,this.#t=Pm(``,{afterMs:1e3,getWindow:e.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(e,t){if(!t.length)return;this.#t.current=this.#t.current+e;let n=I(this.#r)(),r=t.find(e=>e===n)?.textContent?.trim()??``,i=Mm(t.map(e=>e.textContent?.trim()??``),this.#t.current,r),a=t.find(e=>e.textContent?.trim()===i);return a&&I(this.#n)(a),a}resetTypeahead(){this.#t.current=``}get search(){return this.#t.current}},Im=`data-context-menu-trigger`,Qne=`data-context-menu-content`,Lm=new qf(`Menu.Root`),Rm=new qf(`Menu.Root | Menu.Sub`),zm=new qf(`Menu.Content`),Bm=new qf(`Menu.Group | Menu.RadioGroup`),$ne=new qf(`Menu.RadioGroup`),ere=new qf(`Menu.CheckboxGroup`),Vm=new Sne(`bitsmenuopen`,{bubbles:!1,cancelable:!0}),tre=Fp({component:`menu`,parts:[`trigger`,`content`,`sub-trigger`,`item`,`group`,`group-heading`,`checkbox-group`,`checkbox-item`,`radio-group`,`radio-item`,`separator`,`sub-content`,`arrow`]}),nre=class{#e;#t=null;#n=null;#r=!1;#i=null;#a=null;#o=null;#s=null;constructor(e){this.#e=e,Qf([e.triggerNode,e.contentNode,e.enabled],([e,t,n])=>{if(this.#_(),!e||!t||!n)return;let r=e=>{um(e)&&(this.#s={x:e.clientX,y:e.clientY},this.#r||this.#d(e,`content`))},i=e=>{um(e)&&this.#f(e,`content`)},a=e=>{um(e)&&(this.#r||this.#d(e,`trigger`))},o=e=>{if(um(e)){if(Kp(e.relatedTarget)){let n=this.#e.subContentSelector(),r=e.relatedTarget.closest(n);if(r&&r!==t&&r.id&&t.querySelector(`[aria-controls="${r.id}"]`))return}this.#f(e,`trigger`)}},s=e=>{um(e)&&this.#m()},c=e=>{um(e)&&this.#m()};return e.addEventListener(`pointermove`,r),e.addEventListener(`pointerleave`,i),e.addEventListener(`pointerenter`,s),t.addEventListener(`pointermove`,a),t.addEventListener(`pointerleave`,o),t.addEventListener(`pointerenter`,c),()=>{e.removeEventListener(`pointermove`,r),e.removeEventListener(`pointerleave`,i),e.removeEventListener(`pointerenter`,s),t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerleave`,o),t.removeEventListener(`pointerenter`,c),this.#_()}}),dp(()=>{this.#_()})}#c(){let e=this.#e.parentContentNode();return e?e.getBoundingClientRect():this.#e.triggerNode()?.getBoundingClientRect()??null}#l(e,t){let n=this.#e.triggerNode(),r=this.#e.contentNode();if(!n||!r)return null;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=ire(i,a),s,c,l;return t===`content`?(s=this.#r?this.#a??e:e,c=a):(s=this.#s??e,c=this.#c()??i,l=a),this.#a=s,{corridor:are(i,a,o),intent:ore(s,c,o,t,l),targetRect:c,side:o}}#u(e,t,n){return Hm(e,t)||Hm(e,n)}#d(e,t){let n={x:e.clientX,y:e.clientY};this.#l(n,t)&&(this.#i=t,this.#o=n)}#f(e,t){if(!this.#e.enabled())return;let n=this.#e.triggerNode(),r=this.#e.contentNode();if(!n||!r)return;let i=e.relatedTarget;if(Kp(i)&&(t===`content`&&r.contains(i)||t===`trigger`&&n.contains(i)))return;let a={x:e.clientX,y:e.clientY},o=this.#l(a,t);if(o){if(!Um(a,o.targetRect)&&!this.#u(a,o.corridor,o.intent)){this.#w();return}this.#r=!0,this.#i=t,this.#o=a,this.#e.setIsPointerInTransit(!0),this.#b(),this.#S()}}#p=null;#m(){if(!this.#r)return;let e=this.#i===`trigger`;this.#x(),this.#C(),this.#r=!1,this.#w(),e?(this.#h(),this.#p=setTimeout(()=>{this.#p=null,this.#e.setIsPointerInTransit(!1)},100)):this.#e.setIsPointerInTransit(!1)}#h(){this.#p!==null&&(clearTimeout(this.#p),this.#p=null)}#g(){let e=this.#o;this.#x(),this.#C(),this.#h(),this.#r=!1,this.#e.setIsPointerInTransit(!1),this.#w(),this.#e.onIntentExit(e)}#_(){this.#x(),this.#C(),this.#h(),this.#r&&this.#e.setIsPointerInTransit(!1),this.#r=!1,this.#i=null,this.#a=null,this.#o=null,this.#s=null}#v(e){let t=this.#e.contentNode();if(!t)return!1;let n=t.ownerDocument.elementFromPoint(e.x,e.y);if(!n)return!1;let r=this.#e.subContentSelector(),i=n.closest(r);return!i||i===t?!1:i.id?!!t.querySelector(`[aria-controls="${i.id}"]`):!1}#y=e=>{if(!this.#r||!this.#i||!um(e))return;let t=this.#e.triggerNode(),n=this.#e.contentNode();if(!t||!n){this.#g();return}this.#C();let r={x:e.clientX,y:e.clientY};this.#o=r;let i=t.getBoundingClientRect(),a=n.getBoundingClientRect();if(this.#i===`content`&&Um(r,a)){this.#m();return}if(this.#i===`trigger`&&rre(r,i,4)){this.#m();return}if(this.#v(r)){this.#S();return}let o=this.#l(r,this.#i);if(!o){this.#g();return}if(this.#u(r,o.corridor,o.intent)){this.#S();return}this.#g()};#b(){if(this.#t)return;let e=wp(this.#e.triggerNode()??this.#e.contentNode());e&&(e.addEventListener(`pointermove`,this.#y,!0),this.#t=()=>{e.removeEventListener(`pointermove`,this.#y,!0),this.#t=null})}#x(){this.#t?.()}#S(){this.#C(),this.#n=setTimeout(()=>{this.#n=null,this.#r&&this.#g()},500)}#C(){this.#n!==null&&(clearTimeout(this.#n),this.#n=null)}#w(){this.#i=null,this.#a=null,this.#o=null}};function Hm(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function Um(e,t){return e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom}function rre(e,t,n){return e.x>=t.left+n&&e.x<=t.right-n&&e.y>=t.top+n&&e.y<=t.bottom-n}function ire(e,t){let n=e.left+e.width/2,r=e.top+e.height/2,i=t.left+t.width/2,a=t.top+t.height/2,o=i-n,s=a-r;return Math.abs(o)>Math.abs(s)?o>0?`right`:`left`:s>0?`bottom`:`top`}function are(e,t,n){switch(n){case`top`:return[{x:Math.min(e.left,t.left)-2,y:e.top},{x:Math.min(e.left,t.left)-2,y:t.bottom},{x:Math.max(e.right,t.right)+2,y:t.bottom},{x:Math.max(e.right,t.right)+2,y:e.top}];case`bottom`:return[{x:Math.min(e.left,t.left)-2,y:e.bottom},{x:Math.min(e.left,t.left)-2,y:t.top},{x:Math.max(e.right,t.right)+2,y:t.top},{x:Math.max(e.right,t.right)+2,y:e.bottom}];case`left`:return[{x:e.left,y:Math.min(e.top,t.top)-2},{x:t.right,y:Math.min(e.top,t.top)-2},{x:t.right,y:Math.max(e.bottom,t.bottom)+2},{x:e.left,y:Math.max(e.bottom,t.bottom)+2}];case`right`:return[{x:e.right,y:Math.min(e.top,t.top)-2},{x:t.left,y:Math.min(e.top,t.top)-2},{x:t.left,y:Math.max(e.bottom,t.bottom)+2},{x:e.right,y:Math.max(e.bottom,t.bottom)+2}]}}function ore(e,t,n,r,i){let a=r===`trigger`?sre(n):n,o=i?Math.min(t.top,i.top)-8:t.top-8,s=i?Math.max(t.bottom,i.bottom)+8:t.bottom+8,c=i?Math.min(t.left,i.left)-8:t.left-8,l=i?Math.max(t.right,i.right)+8:t.right+8;switch(a){case`right`:return[e,{x:t.left,y:o},{x:t.left,y:s}];case`left`:return[e,{x:t.right,y:o},{x:t.right,y:s}];case`bottom`:return[e,{x:c,y:t.top},{x:l,y:t.top}];case`top`:return[e,{x:c,y:t.bottom},{x:l,y:t.bottom}]}}function sre(e){switch(e){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`}}var Wm=class e{static create(t){let n=new e(t);return Lm.set(n)}opts;isUsingKeyboard=new Ane;#e=A(!1);get ignoreCloseAutoFocus(){return I(this.#e)}set ignoreCloseAutoFocus(e){j(this.#e,e,!0)}#t=A(!1);get isPointerInTransit(){return I(this.#t)}set isPointerInTransit(e){j(this.#t,e,!0)}constructor(e){this.opts=e}getBitsAttr=e=>tre.getAttr(e,this.opts.variant.current)},Gm=class e{static create(t,n){return Rm.set(new e(t,n,null))}opts;root;parentMenu;contentId=J(()=>``);#e=A(null);get contentNode(){return I(this.#e)}set contentNode(e){j(this.#e,e,!0)}contentPresence;#t=A(null);get triggerNode(){return I(this.#t)}set triggerNode(e){j(this.#t,e,!0)}constructor(e,t,n){this.opts=e,this.root=t,this.parentMenu=n,this.contentPresence=new Zp({ref:J(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)},shouldSkipExitAnimation:()=>this.root.opts.variant.current!==`menubar`||this.parentMenu!==null?!1:this.root.opts.shouldSkipExitAnimation?.()??!1}),n&&Qf(()=>n.opts.open.current,()=>{n.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}},Km=class e{static create(t){return zm.set(new e(t,Rm.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#e=A(``);get search(){return I(this.#e)}set search(e){j(this.#e,e,!0)}#t=0;#n;#r=A(!1);get mounted(){return I(this.#r)}set mounted(e){j(this.#r,e,!0)}#i;constructor(e,t){this.opts=e,this.parentMenu=t,this.domContext=new Dp(e.ref),this.attachment=Op(this.opts.ref,e=>{this.parentMenu.contentNode!==e&&(this.parentMenu.contentNode=e)}),t.contentId=e.id,this.#i=e.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new nre({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,parentContentNode:()=>this.parentMenu.parentMenu?.contentNode??null,subContentSelector:()=>`[${this.parentMenu.root.getBitsAttr(`sub-content`)}]`,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr(`sub-trigger`)),onIntentExit:e=>{this.parentMenu.opts.open.current=!1,this.#s(e)},setIsPointerInTransit:e=>{this.parentMenu.root.isPointerInTransit=e}}),this.#n=new Fm({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new Yp({rootNode:J(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr(`item`),loop:this.opts.loop,orientation:J(()=>`vertical`)}),Qf(()=>this.parentMenu.contentNode,e=>e?Vm.listen(e,()=>{mp(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})}):void 0),sr(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#t)})}#a(){let e=this.parentMenu.contentNode;return e?Array.from(e.querySelectorAll(`[${this.parentMenu.root.getBitsAttr(`item`)}]:not([data-disabled])`)):[]}#o(){return this.parentMenu.root.isPointerInTransit}#s(e){if(!e)return;let t=this.parentMenu.parentMenu?.contentNode;if(!t)return;let n=this.domContext.getDocument().elementFromPoint(e.x,e.y);if(!Kp(n))return;let r=n.closest(`[${this.parentMenu.root.getBitsAttr(`sub-trigger`)}]`);!r||!t.contains(r)||r!==this.parentMenu.triggerNode&&r.dispatchEvent(new PointerEvent(`pointermove`,{bubbles:!0,cancelable:!0,pointerType:`mouse`,clientX:e.x,clientY:e.y}))}onCloseAutoFocus=e=>{if(this.opts.onCloseAutoFocus.current?.(e),!(e.defaultPrevented||this.#i)){if(this.parentMenu.root.ignoreCloseAutoFocus){e.preventDefault();return}this.parentMenu.triggerNode&&km(this.parentMenu.triggerNode)&&(e.preventDefault(),this.parentMenu.triggerNode.focus())}};handleTabKeyDown(e){let t=this.parentMenu;for(;t.parentMenu!==null;)t=t.parentMenu;if(!t.triggerNode)return;e.preventDefault();let n=Gne(t.triggerNode,e.shiftKey?`prev`:`next`);n?(this.parentMenu.root.ignoreCloseAutoFocus=!0,t.onClose(),mp(()=>{n.focus(),mp(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(e){if(e.defaultPrevented)return;if(e.key===`Tab`){this.handleTabKeyDown(e);return}let t=e.target,n=e.currentTarget;if(!Gp(t)||!Gp(n))return;let r=t.closest(`[${this.parentMenu.root.getBitsAttr(`content`)}]`)?.id===this.parentMenu.contentId.current,i=e.ctrlKey||e.altKey||e.metaKey,a=e.key.length===1;if(this.rovingFocusGroup.handleKeydown(t,e)||e.code===`Space`)return;let o=this.#a();r&&!i&&a&&this.#n(e.key,o),e.target?.id===this.parentMenu.contentId.current&&Tne.includes(e.key)&&(e.preventDefault(),lm.includes(e.key)&&o.reverse(),kne(o,{select:!1},()=>this.domContext.getActiveElement()))}onblur(e){Kp(e.currentTarget)&&Kp(e.target)&&(e.currentTarget.contains?.(e.target)||(this.domContext.getWindow().clearTimeout(this.#t),this.search=``))}onfocus(e){this.parentMenu.root.isUsingKeyboard.current&&mp(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#o()}onItemLeave(e){e.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr(`sub-trigger`))||this.#o()||this.parentMenu.root.isUsingKeyboard.current||(this.parentMenu.contentNode?.focus({preventScroll:!0}),this.rovingFocusGroup.setCurrentTabStopId(``))}onTriggerLeave(){return!!this.#o()}handleInteractOutside(e){if(!qp(e.target))return;let t=this.parentMenu.triggerNode?.id;if(e.target.id===t){e.preventDefault();return}if(e.target.closest(`#${t}`)){e.preventDefault();return}this.parentMenu.root.ignoreCloseAutoFocus=!0,mp(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#c=k(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return I(this.#c)}set snippetProps(e){j(this.#c,e)}#l=k(()=>({id:this.opts.id.current,role:`menu`,"aria-orientation":`vertical`,[this.parentMenu.root.getBitsAttr(`content`)]:``,"data-state":Mp(this.parentMenu.opts.open.current),...Np(this.parentMenu.contentPresence.transitionStatus),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:`auto`,contain:`layout style`},...this.attachment}));get props(){return I(this.#l)}set props(e){j(this.#l,e)}popperProps={onCloseAutoFocus:e=>this.onCloseAutoFocus(e)}},qm=class{opts;content;attachment;#e=A(!1);constructor(e,t){this.opts=e,this.content=t,this.attachment=Op(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(e){if(!e.defaultPrevented&&um(e))if(this.opts.disabled.current)this.content.onItemLeave(e);else{if(this.content.onItemEnter())return;let t=e.currentTarget;if(!Gp(t))return;t.focus({preventScroll:!0})}}onpointerleave(e){e.defaultPrevented||um(e)&&this.content.onItemLeave(e)}onfocus(e){mp(()=>{e.defaultPrevented||this.opts.disabled.current||j(this.#e,!0)})}onblur(e){mp(()=>{e.defaultPrevented||j(this.#e,!1)})}#t=k(()=>({id:this.opts.id.current,tabindex:-1,role:`menuitem`,"aria-disabled":kp(this.opts.disabled.current),"data-disabled":Ap(this.opts.disabled.current),"data-highlighted":I(this.#e)?``:void 0,[this.content.parentMenu.root.getBitsAttr(`item`)]:``,onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},cre=class e{static create(t){return new e(t,new qm(t,zm.get()))}opts;item;root;#e=!1;constructor(e,t){this.opts=e,this.item=t,this.root=t.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#t(){if(this.item.opts.disabled.current)return;let e=new CustomEvent(`menuitemselect`,{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(e),e.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(e){let t=this.item.content.search!==``;if(!(this.item.opts.disabled.current||t&&e.key===` `)&&cm.includes(e.key)){if(!Gp(e.currentTarget))return;e.currentTarget.click(),e.preventDefault()}}onclick(e){this.item.opts.disabled.current||this.#t()}onpointerup(e){if(!e.defaultPrevented&&!this.#e){if(!Gp(e.currentTarget))return;e.currentTarget?.click()}}onpointerdown(e){this.#e=!0}#n=k(()=>Vf(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return I(this.#n)}set props(e){j(this.#n,e)}},lre=class e{static create(t){let n=zm.get();return new e(t,new qm(t,n),n,Rm.get())}opts;item;content;submenu;attachment;#e=null;constructor(e,t,n,r){this.opts=e,this.item=t,this.content=n,this.submenu=r,this.attachment=Op(this.opts.ref,e=>this.submenu.triggerNode=e),this.onpointerleave=this.onpointerleave.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),dp(()=>{this.#t()})}#t(){this.#e!==null&&(this.content.domContext.getWindow().clearTimeout(this.#e),this.#e=null)}onpointermove(e){if(um(e)){if(this.submenu.root.isPointerInTransit){this.#e!==null&&this.#t();return}if(!this.item.opts.disabled.current&&!this.submenu.opts.open.current&&!this.#e){let e=this.opts.openDelay.current;if(e<=0){this.submenu.onOpen();return}this.#e=this.content.domContext.setTimeout(()=>{if(this.submenu.root.isPointerInTransit){this.#t();return}this.submenu.onOpen(),this.#t()},e)}}}onpointerleave(e){um(e)&&this.#t()}onkeydown(e){let t=this.content.search!==``;this.item.opts.disabled.current||t&&e.key===` `||Ene[this.submenu.root.opts.dir.current].includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}onclick(e){if(this.item.opts.disabled.current||!Gp(e.currentTarget))return;e.currentTarget.focus();let t=new CustomEvent(`menusubtriggerselect`,{bubbles:!0,cancelable:!0});this.opts.onSelect.current(t),this.submenu.opts.open.current||(this.submenu.onOpen(),mp(()=>{let e=this.submenu.contentNode;e&&Vm.dispatch(e)}))}#n=k(()=>Vf({"aria-haspopup":`menu`,"aria-expanded":kp(this.submenu.opts.open.current),"data-state":Mp(this.submenu.opts.open.current),"aria-controls":this.submenu.opts.open.current?this.submenu.contentId.current:void 0,[this.submenu.root.getBitsAttr(`sub-trigger`)]:``,onclick:this.onclick,onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onkeydown:this.onkeydown,...this.attachment},this.item.props));get props(){return I(this.#n)}set props(e){j(this.#n,e)}},ure=class e{static create(t){return Bm.set(new e(t,Lm.get()))}opts;root;attachment;#e=A(void 0);get groupHeadingId(){return I(this.#e)}set groupHeadingId(e){j(this.#e,e,!0)}constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(this.opts.ref)}#t=k(()=>({id:this.opts.id.current,role:`group`,"aria-labelledby":this.groupHeadingId,[this.root.getBitsAttr(`group`)]:``,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},dre=class e{static create(t){let n=ere.getOr(null);if(n)return new e(t,n);let r=$ne.getOr(null);return r?new e(t,r):new e(t,Bm.get())}opts;group;attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=Op(this.opts.ref,e=>this.group.groupHeadingId=e?.id)}#e=k(()=>({id:this.opts.id.current,role:`group`,[this.group.root.getBitsAttr(`group-heading`)]:``,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},fre=class e{static create(t){return new e(t,Lm.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(this.opts.ref)}#e=k(()=>({id:this.opts.id.current,role:`group`,[this.root.getBitsAttr(`separator`)]:``,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},pre=class e{static create(t){return new e(t,Rm.get())}opts;parentMenu;attachment;constructor(e,t){this.opts=e,this.parentMenu=t,this.attachment=Op(this.opts.ref,e=>this.parentMenu.triggerNode=e)}onclick=e=>{this.opts.disabled.current||e.detail!==0||(this.parentMenu.toggleOpen(),e.preventDefault())};onpointerdown=e=>{if(!this.opts.disabled.current){if(e.pointerType===`touch`)return e.preventDefault();e.button===0&&e.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||e.preventDefault())}};onpointerup=e=>{this.opts.disabled.current||e.pointerType===`touch`&&(e.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=e=>{if(!this.opts.disabled.current){if(e.key===` `||e.key===`Enter`){this.parentMenu.toggleOpen(),e.preventDefault();return}e.key===`ArrowDown`&&(this.parentMenu.onOpen(),e.preventDefault())}};#e=k(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#t=k(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":`menu`,"aria-expanded":kp(this.parentMenu.opts.open.current),"aria-controls":I(this.#e),"data-disabled":Ap(this.opts.disabled.current),"data-state":Mp(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr(`trigger`)]:``,onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},mre=class e{static create(t){return new e(t,Rm.get())}opts;parentMenu;attachment;#e=A(In({x:0,y:0}));virtualElement=Sf({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...I(this.#e)})});#t=null;constructor(e,t){this.opts=e,this.parentMenu=t,this.attachment=Op(this.opts.ref,e=>this.parentMenu.triggerNode=e),this.oncontextmenu=this.oncontextmenu.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointercancel=this.onpointercancel.bind(this),this.onpointerup=this.onpointerup.bind(this),Qf(()=>I(this.#e),e=>{this.virtualElement.current={getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...e})}}),Qf(()=>this.opts.disabled.current,e=>{e&&this.#n()}),dp(()=>this.#n())}#n(){this.#t!==null&&Tp(this.opts.ref.current).clearTimeout(this.#t)}#r(e){j(this.#e,{x:e.clientX,y:e.clientY},!0),this.parentMenu.onOpen()}oncontextmenu(e){e.defaultPrevented||this.opts.disabled.current||(this.#n(),this.#r(e),e.preventDefault(),this.parentMenu.contentNode?.focus())}onpointerdown(e){this.opts.disabled.current||um(e)||(this.#n(),this.#t=Tp(this.opts.ref.current).setTimeout(()=>this.#r(e),700))}onpointermove(e){this.opts.disabled.current||um(e)||this.#n()}onpointercancel(e){this.opts.disabled.current||um(e)||this.#n()}onpointerup(e){this.opts.disabled.current||um(e)||this.#n()}#i=k(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"data-disabled":Ap(this.opts.disabled.current),"data-state":Mp(this.parentMenu.opts.open.current),[Im]:``,tabindex:-1,onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointercancel:this.onpointercancel,onpointerup:this.onpointerup,oncontextmenu:this.oncontextmenu,...this.attachment}));get props(){return I(this.#i)}set props(e){j(this.#i,e)}},hre=class{static create(e){let t=Rm.get();return Rm.set(new Gm(e,t.root,t))}};globalThis.bitsDismissableLayers??=new Map;var gre=class e{static create(t){return new e(t)}opts;#e;#t;#n={pointerdown:!1};#r=!1;#i=!1;#a=void 0;#o;#s=Qp;constructor(e){this.opts=e,this.#t=e.interactOutsideBehavior,this.#e=e.onInteractOutside,this.#o=e.onFocusOutside,sr(()=>{this.#a=sm(this.opts.ref.current)});let t=Qp,n=()=>{this.#g(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),t()};Qf([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return pp(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#t),t(),t=this.#l())}),n}),dp(()=>{this.#g.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#s(),t()})}#c=e=>{e.defaultPrevented||this.opts.ref.current&&mp(()=>{!this.opts.ref.current||this.#h(e.target)||e.target&&!this.#i&&this.#o.current?.(e)})};#l(){return Pf(vi(this.#a,`pointerdown`,Pf(this.#f,this.#m),{capture:!0}),vi(this.#a,`pointerdown`,Pf(this.#p,this.#d)),vi(this.#a,`focusin`,this.#c))}#u=e=>{let t=e;t.defaultPrevented&&(t=Jm(e)),this.#e.current(e)};#d=am(e=>{if(!this.opts.ref.current){this.#s();return}let t=this.opts.isValidEvent.current(e,this.opts.ref.current)||yre(e,this.opts.ref.current);if(!this.#r||this.#_()||!t){this.#s();return}let n=e;if(n.defaultPrevented&&(n=Jm(n)),this.#t.current!==`close`&&this.#t.current!==`defer-otherwise-close`){this.#s();return}e.pointerType===`touch`?(this.#s(),this.#s=vi(this.#a,`click`,this.#u,{once:!0})):this.#e.current(n)},10);#f=e=>{this.#n[e.type]=!0};#p=e=>{this.#n[e.type]=!1};#m=()=>{this.opts.ref.current&&(this.#r=vre(this.opts.ref.current))};#h=e=>this.opts.ref.current?om(this.opts.ref.current,e):!1;#g=am(()=>{for(let e in this.#n)this.#n[e]=!1;this.#r=!1},20);#_(){return Object.values(this.#n).some(Boolean)}#v=()=>{this.#i=!0};#y=()=>{this.#i=!1};props={onfocuscapture:this.#v,onblurcapture:this.#y}};function _re(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([e,{current:t}])=>t===`close`||t===`ignore`)}function vre(e){let t=[...globalThis.bitsDismissableLayers],n=_re(t);if(n)return n[0].opts.ref.current===e;let[r]=t[0];return r.opts.ref.current===e}function yre(e,t){let n=e.target;if(!qp(n))return!1;let r=!!n.closest(`[${Im}]`),i=!!t.closest(`[${Qne}]`);return`button`in e&&e.button>0&&!r?!1:`button`in e&&e.button===0&&r&&i?!0:r&&i?!1:sm(n).documentElement.contains(n)&&!om(t,n)&&Cne(e,t)}function Jm(e){let t=e.currentTarget,n=e.target,r;r=e instanceof PointerEvent?new PointerEvent(e.type,e):new PointerEvent(`pointerdown`,e);let i=!1;return new Proxy(r,{get:(r,a)=>a===`currentTarget`?t:a===`target`?n:a===`preventDefault`?()=>{i=!0,typeof r.preventDefault==`function`&&r.preventDefault()}:a===`defaultPrevented`?i:a in r?r[a]:e[a]})}function Ym(e,t){D(t,!0);let n=q(t,`interactOutsideBehavior`,3,`close`),r=q(t,`onInteractOutside`,3,Qp),i=q(t,`onFocusOutside`,3,Qp),a=q(t,`isValidEvent`,3,()=>!1),o=gre.create({id:J(()=>t.id),interactOutsideBehavior:J(()=>n()),onInteractOutside:J(()=>r()),enabled:J(()=>t.enabled),onFocusOutside:J(()=>i()),isValidEvent:J(()=>a()),ref:t.ref});var s=R();H(N(s),()=>t.children??w,()=>({props:o.props})),z(e,s),O()}globalThis.bitsEscapeLayers??=new Map;var bre=class e{static create(t){return new e(t)}opts;domContext;constructor(e){this.opts=e,this.domContext=new Dp(this.opts.ref);let t=Qp;Qf(()=>e.enabled.current,n=>(n&&(globalThis.bitsEscapeLayers.set(this,e.escapeKeydownBehavior),t=this.#e()),()=>{t(),globalThis.bitsEscapeLayers.delete(this)}))}#e=()=>vi(this.domContext.getDocument(),`keydown`,this.#t,{passive:!1});#t=e=>{if(e.key!==`Escape`||!xre(this))return;let t=new KeyboardEvent(e.type,e);e.preventDefault();let n=this.opts.escapeKeydownBehavior.current;n!==`close`&&n!==`defer-otherwise-close`||this.opts.onEscapeKeydown.current(t)}};function xre(e){let t=[...globalThis.bitsEscapeLayers],n=t.findLast(([e,{current:t}])=>t===`close`||t===`ignore`);if(n)return n[0]===e;let[r]=t[0];return r===e}function Xm(e,t){D(t,!0);let n=q(t,`escapeKeydownBehavior`,3,`close`),r=q(t,`onEscapeKeydown`,3,Qp);bre.create({escapeKeydownBehavior:J(()=>n()),onEscapeKeydown:J(()=>r()),enabled:J(()=>t.enabled),ref:t.ref});var i=R();H(N(i),()=>t.children??w),z(e,i),O()}var Sre=class e{static instance;#e=Sf([]);#t=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||=new e,this.instance}register(e){let t=this.getActive();t&&t!==e&&t.pause();let n=document.activeElement;n&&n!==document.body&&this.#n.set(e,n),this.#e.current=this.#e.current.filter(t=>t!==e),this.#e.current.unshift(e)}unregister(e){this.#e.current=this.#e.current.filter(t=>t!==e);let t=this.getActive();t&&t.resume()}getActive(){return this.#e.current[0]}setFocusMemory(e,t){this.#t.set(e,t)}getFocusMemory(e){return this.#t.get(e)}isActiveScope(e){return this.getActive()===e}setPreFocusMemory(e,t){this.#n.set(e,t)}getPreFocusMemory(e){return this.#n.get(e)}clearPreFocusMemory(e){this.#n.delete(e)}},Cre=class e{#e=!1;#t=null;#n=Sre.getInstance();#r=[];#i;constructor(e){this.#i=e}get paused(){return this.#e}pause(){this.#e=!0}resume(){this.#e=!1}#a(){for(let e of this.#r)e();this.#r=[]}mount(e){this.#t&&this.unmount(),this.#t=e,this.#n.register(this),this.#c(),this.#o()}unmount(){this.#t&&=(this.#a(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),null)}#o(){if(!this.#t)return;let e=new CustomEvent(`focusScope.onOpenAutoFocus`,{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(e),e.defaultPrevented||requestAnimationFrame(()=>{if(!this.#t)return;let e=this.#u();e?(e.focus(),this.#n.setFocusMemory(this,e)):this.#t.focus()})}#s(){let e=new CustomEvent(`focusScope.onCloseAutoFocus`,{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(e),!e.defaultPrevented){let e=this.#n.getPreFocusMemory(this);if(e&&document.contains(e))try{e.focus()}catch{document.body.focus()}}}#c(){if(!this.#t||!this.#i.trap.current)return;let e=this.#t,t=e.ownerDocument;this.#r.push(vi(t,`focusin`,t=>{if(this.#e||!this.#n.isActiveScope(this))return;let n=t.target;if(n)if(e.contains(n))this.#n.setFocusMemory(this,n);else{let n=this.#n.getFocusMemory(this);if(n&&e.contains(n)&&Am(n))t.preventDefault(),n.focus();else{let t=this.#u(),n=this.#d()[0];(t||n||e).focus()}}},{capture:!0}),vi(e,`keydown`,e=>{if(!this.#i.loop||this.#e||e.key!==`Tab`||!this.#n.isActiveScope(this))return;let n=this.#l();if(n.length===0)return;let r=n[0],i=n[n.length-1];!e.shiftKey&&t.activeElement===i?(e.preventDefault(),r.focus()):e.shiftKey&&t.activeElement===r&&(e.preventDefault(),i.focus())}));let n=new MutationObserver(()=>{let t=this.#n.getFocusMemory(this);if(t&&!e.contains(t)){let t=this.#u(),n=this.#d()[0],r=t||n;r?(r.focus(),this.#n.setFocusMemory(this,r)):e.focus()}});n.observe(e,{childList:!0,subtree:!0}),this.#r.push(()=>n.disconnect())}#l(){return this.#t?Dm(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#l()[0]||null}#d(){return this.#t?Om(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return Qf([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(n||=new e(t),n.mount(r)):n&&=(n.unmount(),null)}),dp(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}};function Zm(e,t){D(t,!0);let n=q(t,`enabled`,3,!1),r=q(t,`trapFocus`,3,!1),i=q(t,`loop`,3,!1),a=q(t,`onCloseAutoFocus`,3,Qp),o=q(t,`onOpenAutoFocus`,3,Qp),s=Cre.use({enabled:J(()=>n()),trap:J(()=>r()),loop:i(),onCloseAutoFocus:J(()=>a()),onOpenAutoFocus:J(()=>o()),ref:t.ref});var c=R();H(N(c),()=>t.focusScope??w,()=>({props:s.props})),z(e,c),O()}var Qm=()=>{};globalThis.bitsTextSelectionLayers??=new Map;var wre=class e{static create(t){return new e(t)}opts;domContext;#e=Qp;#t=!1;#n=Qm;#r=Qm;constructor(e){this.opts=e,this.domContext=new Dp(e.ref);let t=Qp;Qf(()=>[this.opts.enabled.current,this.opts.onPointerDown.current,this.opts.onPointerUp.current],([e,n,r])=>(this.#t=e,this.#n=n,this.#r=r,e&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),t(),t=this.#i()),()=>{this.#t=!1,t(),this.#s(),globalThis.bitsTextSelectionLayers.delete(this)}))}#i(){return Pf(vi(this.domContext.getDocument(),`pointerdown`,this.#o),vi(this.domContext.getDocument(),`pointerup`,wf(this.#s,this.#a)))}#a=e=>{this.#r(e)};#o=e=>{let t=this.opts.ref.current,n=e.target;!Gp(t)||!Gp(n)||!this.#t||!Ere(this)||!Cp(t,n)||(this.#n(e),!e.defaultPrevented&&(this.#e=Tre(t,this.domContext.getDocument().body)))};#s=()=>{this.#e(),this.#e=Qp}},$m=e=>e.style.userSelect||e.style.webkitUserSelect;function Tre(e,t){let n=$m(t),r=$m(e);return eh(t,`none`),eh(e,`text`),()=>{eh(t,n),eh(e,r)}}function eh(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function Ere(e){let t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;let n=t.at(-1);return n?n[0]===e:!1}function th(e,t){D(t,!0);let n=q(t,`preventOverflowTextSelection`,3,!0),r=q(t,`onPointerDown`,3,Qp),i=q(t,`onPointerUp`,3,Qp);wre.create({id:J(()=>t.id),onPointerDown:J(()=>r()),onPointerUp:J(()=>i()),enabled:J(()=>t.enabled&&n()),ref:t.ref});var a=R();H(N(a),()=>t.children??w),z(e,a),O()}globalThis.bitsIdCounter??={current:0};function nh(e=`bits`){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}var Dre=class{#e;#t=0;#n=A();#r;constructor(e){this.#e=e}#i(){--this.#t,this.#r&&this.#t<=0&&(this.#r(),j(this.#n,void 0),this.#r=void 0)}get(...e){return this.#t+=1,I(this.#n)===void 0&&(this.#r=ur(()=>{j(this.#n,this.#e(...e),!0)})),sr(()=>()=>{this.#i()}),I(this.#n)}},rh=new Ao,ih=A(null),ah=null,oh=null,sh=!1,ch=J(()=>{for(let e of rh.values())if(e)return!0;return!1}),lh=null,Ore=new Dre(()=>{function e(){document.body.setAttribute(`style`,I(ih)??``),document.body.style.removeProperty(`--scrollbar-width`),Wp&&ah?.(),j(ih,null)}function t(){oh!==null&&(window.clearTimeout(oh),oh=null)}function n(e,n){t(),sh=!0,lh=Date.now();let r=lh,i=()=>{oh=null,lh===r&&(uh(rh)?sh=!1:(sh=!1,n()))},a=e===null?24:e;oh=window.setTimeout(i,a)}function r(){I(ih)===null&&rh.size===0&&!sh&&j(ih,document.body.getAttribute(`style`),!0)}return Qf(()=>ch.current,()=>{if(!ch.current)return;r(),sh=!1;let e=getComputedStyle(document.documentElement),t=getComputedStyle(document.body),n=e.scrollbarGutter?.includes(`stable`)||t.scrollbarGutter?.includes(`stable`),i=window.innerWidth-document.documentElement.clientWidth,a={padding:Number.parseInt(t.paddingRight??`0`,10)+i,margin:Number.parseInt(t.marginRight??`0`,10)};i>0&&!n&&(document.body.style.paddingRight=`${a.padding}px`,document.body.style.marginRight=`${a.margin}px`,document.body.style.setProperty(`--scrollbar-width`,`${i}px`)),document.body.style.overflow=`hidden`,Wp&&(ah=vi(document,`touchmove`,e=>{e.target===document.documentElement&&(e.touches.length>1||e.preventDefault())},{passive:!1})),mp(()=>{document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`})}),dp(()=>()=>{ah?.()}),{get lockMap(){return rh},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}}),kre=class{#e=nh();#t;#n=()=>null;#r;locked;constructor(e,t=()=>null){this.#t=e,this.#n=t,this.#r=Ore.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#e,this.#t??!1),this.locked=J(()=>this.#r.lockMap.get(this.#e)??!1,e=>this.#r.lockMap.set(this.#e,e)),dp(()=>{if(this.#r.lockMap.delete(this.#e),uh(this.#r.lockMap))return;let e=this.#n();this.#r.scheduleCleanupIfNoNewLocks(e,()=>{this.#r.resetBodyStyle()})}))}};function uh(e){for(let[t,n]of e)if(n)return!0;return!1}function dh(e,t){D(t,!0);let n=q(t,`preventScroll`,3,!0),r=q(t,`restoreScrollDelay`,3,null);n()&&new kre(n(),()=>r()),O()}var fh=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`,`forceMount`,`interactOutsideBehavior`,`onCloseAutoFocus`,`onEscapeKeydown`,`onOpenAutoFocus`,`onInteractOutside`,`preventScroll`,`trapFocus`,`restoreScrollDelay`]),ph=L(`<!> <!>`,1),mh=L(`<!> <div><!></div>`,1);function hh(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`forceMount`,3,!1),o=q(t,`interactOutsideBehavior`,3,`ignore`),s=q(t,`onCloseAutoFocus`,3,Qp),c=q(t,`onEscapeKeydown`,3,Qp),l=q(t,`onOpenAutoFocus`,3,Qp),u=q(t,`onInteractOutside`,3,Qp),d=q(t,`preventScroll`,3,!0),f=q(t,`trapFocus`,3,!0),p=q(t,`restoreScrollDelay`,3,null),m=G(t,fh),h=nm.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),g=k(()=>Vf(m,h.props));var _=R(),v=N(_),y=e=>{Zm(e,{get ref(){return h.opts.ref},loop:!0,get trapFocus(){return f()},get enabled(){return h.root.opts.open.current},get onCloseAutoFocus(){return s()},onOpenAutoFocus:e=>{l()(e),!e.defaultPrevented&&(e.preventDefault(),pp(0,()=>h.opts.ref.current?.focus()))},focusScope:(e,n)=>{let r=()=>n?.().props;Xm(e,K(()=>I(g),{get enabled(){return h.root.opts.open.current},get ref(){return h.opts.ref},onEscapeKeydown:e=>{c()(e),!e.defaultPrevented&&h.root.handleClose()},children:(e,n)=>{Ym(e,K(()=>I(g),{get ref(){return h.opts.ref},get enabled(){return h.root.opts.open.current},get interactOutsideBehavior(){return o()},onInteractOutside:e=>{u()(e),!e.defaultPrevented&&h.root.handleClose()},children:(e,n)=>{th(e,K(()=>I(g),{get ref(){return h.opts.ref},get enabled(){return h.root.opts.open.current},children:(e,n)=>{var i=R(),a=N(i),o=e=>{var n=ph(),i=N(n),a=e=>{dh(e,{get preventScroll(){return d()},get restoreScrollDelay(){return p()}})};V(i,e=>{h.root.opts.open.current&&e(a)});var o=P(i,2);{let e=k(()=>({props:Vf(I(g),r()),...h.snippetProps}));H(o,()=>t.child,()=>I(e))}z(e,n)},s=e=>{var n=mh(),i=N(n);dh(i,{get preventScroll(){return d()}});var a=P(i,2);Sa(a,e=>({...e}),[()=>Vf(I(g),r())]),H(M(a),()=>t.children??w),T(a),z(e,n)};V(a,e=>{t.child?e(o):e(s,-1)}),z(e,i)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};V(v,e=>{(h.shouldRender||a())&&e(y)}),z(e,_),O()}var gh=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`forceMount`,`child`,`children`,`ref`]),_h=L(`<div><!></div>`);function vh(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`forceMount`,3,!1),a=q(t,`ref`,15,null),o=G(t,gh),s=ine.create({id:J(()=>r()),ref:J(()=>a(),e=>a(e))}),c=k(()=>Vf(o,s.props));var l=R(),u=N(l),d=e=>{var n=R(),r=N(n),i=e=>{var n=R(),r=N(n);{let e=k(()=>({props:Vf(I(c)),...s.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},a=e=>{var n=_h();Sa(n,e=>({...e}),[()=>Vf(I(c))]),H(M(n),()=>t.children??w,()=>s.snippetProps),T(n),z(e,n)};V(r,e=>{t.child?e(i):e(a,-1)}),z(e,n)};V(u,e=>{(s.shouldRender||i())&&e(d)}),z(e,l),O()}var yh=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`]),bh=L(`<div><!></div>`);function xh(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=G(t,yh),o=rne.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),s=k(()=>Vf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=bh();Sa(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var Sh=Fp({component:`checkbox`,parts:[`root`,`group`,`group-label`,`input`]}),Ch=new qf(`Checkbox.Group`),wh=new qf(`Checkbox.Root`),Th=class e{static create(t,n=null){return wh.set(new e(t,n))}opts;group;#e=k(()=>this.group&&this.group.opts.name.current?this.group.opts.name.current:this.opts.name.current);get trueName(){return I(this.#e)}set trueName(e){j(this.#e,e)}#t=k(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return I(this.#t)}set trueRequired(e){j(this.#t,e)}#n=k(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return I(this.#n)}set trueDisabled(e){j(this.#n,e)}#r=k(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return I(this.#r)}set trueReadonly(e){j(this.#r,e)}attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=Op(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),Qf.pre([()=>bt(this.group?.opts.value.current),()=>this.opts.value.current],([e,t])=>{!e||!t||(this.opts.checked.current=e.includes(t))}),Qf.pre(()=>this.opts.checked.current,e=>{this.group&&(e?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){if(!(this.trueDisabled||this.trueReadonly)){if(e.key===`Enter`){e.preventDefault(),this.opts.type.current===`submit`&&e.currentTarget.closest(`form`)?.requestSubmit();return}e.key===` `&&(e.preventDefault(),this.#i())}}#i(){this.opts.indeterminate.current?(this.opts.indeterminate.current=!1,this.opts.checked.current=!0):this.opts.checked.current=!this.opts.checked.current}onclick(e){if(!(this.trueDisabled||this.trueReadonly)){if(this.opts.type.current===`submit`){this.#i();return}e.preventDefault(),this.#i()}}#a=k(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return I(this.#a)}set snippetProps(e){j(this.#a,e)}#o=k(()=>({id:this.opts.id.current,role:`checkbox`,type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":Pp(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":kp(this.trueRequired),"aria-readonly":kp(this.trueReadonly),"data-disabled":Ap(this.trueDisabled),"data-readonly":Ap(this.trueReadonly),"data-state":Dh(this.opts.checked.current,this.opts.indeterminate.current),[Sh.root]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return I(this.#o)}set props(e){j(this.#o,e)}},Eh=class e{static create(){return new e(wh.get())}root;#e=k(()=>this.root.group?!!(this.root.opts.value.current!==void 0&&this.root.group.opts.value.current.includes(this.root.opts.value.current)):this.root.opts.checked.current);get trueChecked(){return I(this.#e)}set trueChecked(e){j(this.#e,e)}#t=k(()=>!!this.root.trueName);get shouldRender(){return I(this.#t)}set shouldRender(e){j(this.#t,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){Gp(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#n=k(()=>({type:`checkbox`,checked:this.root.opts.checked.current===!0,disabled:this.root.trueDisabled,required:this.root.trueRequired,name:this.root.trueName,value:this.root.opts.value.current,readonly:this.root.trueReadonly,onfocus:this.onfocus}));get props(){return I(this.#n)}set props(e){j(this.#n,e)}};function Dh(e,t){return t?`indeterminate`:e?`checked`:`unchecked`}var Oh=new Set([`$$slots`,`$$events`,`$$legacy`,`value`]),kh=L(`<input/>`);function Ah(e,t){D(t,!0);let n=q(t,`value`,15),r=G(t,Oh),i=k(()=>Vf(r,{"aria-hidden":`true`,tabindex:-1,style:{...Hf,position:`absolute`,top:`0`,left:`0`}}));var a=R(),o=N(a),s=e=>{var t=kh();Sa(t,()=>({...I(i),value:n()}),void 0,void 0,void 0,void 0,!0),z(e,t)},c=e=>{var t=kh();Sa(t,()=>({...I(i)}),void 0,void 0,void 0,void 0,!0),Ea(t,n),z(e,t)};V(o,e=>{I(i).type===`checkbox`?e(s):e(c,-1)}),z(e,a),O()}function jh(e,t){D(t,!1);let n=Eh.create();ja();var r=R(),i=N(r),a=e=>{Ah(e,K(()=>n.props))};V(i,e=>{n.shouldRender&&e(a)}),z(e,r),O()}var Mh=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`ref`,`onCheckedChange`,`children`,`disabled`,`required`,`name`,`value`,`id`,`indeterminate`,`onIndeterminateChange`,`child`,`type`,`readonly`]),Nh=L(`<button><!></button>`),Ph=L(`<!> <!>`,1);function Fh(e,t){let n=Ai();D(t,!0);let r=q(t,`checked`,15,!1),i=q(t,`ref`,15,null),a=q(t,`disabled`,3,!1),o=q(t,`required`,3,!1),s=q(t,`name`,3,void 0),c=q(t,`value`,3,`on`),l=q(t,`id`,19,()=>$p(n)),u=q(t,`indeterminate`,15,!1),d=q(t,`type`,3,`button`),f=G(t,Mh),p=Ch.getOr(null);p&&c()&&(p.opts.value.current.includes(c())?r(!0):r(!1)),Qf.pre(()=>c(),()=>{p&&c()&&(p.opts.value.current.includes(c())?r(!0):r(!1))});let m=Th.create({checked:J(()=>r(),e=>{r(e),t.onCheckedChange?.(e)}),disabled:J(()=>a()??!1),required:J(()=>o()),name:J(()=>s()),value:J(()=>c()),id:J(()=>l()),ref:J(()=>i(),e=>i(e)),indeterminate:J(()=>u(),e=>{u(e),t.onIndeterminateChange?.(e)}),type:J(()=>d()),readonly:J(()=>!!t.readonly)},p),h=k(()=>Vf({...f},m.props));var g=Ph(),_=N(g),v=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(h),...m.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},y=e=>{var n=Nh();Sa(n,()=>({...I(h)})),H(M(n),()=>t.children??w,()=>m.snippetProps),T(n),z(e,n)};V(_,e=>{t.child?e(v):e(y,-1)}),jh(P(_,2),{}),z(e,g),O()}var Ih=[`top`,`right`,`bottom`,`left`],Lh=Math.min,Rh=Math.max,zh=Math.round,Bh=Math.floor,Vh=e=>({x:e,y:e}),Hh={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Uh(e,t,n){return Rh(e,Lh(t,n))}function Wh(e,t){return typeof e==`function`?e(t):e}function Gh(e){return e.split(`-`)[0]}function Kh(e){return e.split(`-`)[1]}function qh(e){return e===`x`?`y`:`x`}function Jh(e){return e===`y`?`height`:`width`}function Yh(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Xh(e){return qh(Yh(e))}function Zh(e,t,n){n===void 0&&(n=!1);let r=Kh(e),i=Xh(e),a=Jh(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=og(o)),[o,og(o)]}function Qh(e){let t=og(e);return[$h(e),t,$h(t)]}function $h(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var eg=[`left`,`right`],tg=[`right`,`left`],ng=[`top`,`bottom`],rg=[`bottom`,`top`];function ig(e,t,n){switch(e){case`top`:case`bottom`:return n?t?tg:eg:t?eg:tg;case`left`:case`right`:return t?ng:rg;default:return[]}}function ag(e,t,n,r){let i=Kh(e),a=ig(Gh(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map($h)))),a}function og(e){let t=Gh(e);return Hh[t]+e.slice(t.length)}function sg(e){return{top:0,right:0,bottom:0,left:0,...e}}function cg(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:sg(e)}function lg(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ug(e,t,n){let{reference:r,floating:i}=e,a=Yh(t),o=Xh(t),s=Jh(o),c=Gh(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Kh(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function dg(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Wh(t,e),p=cg(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=lg(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=lg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var fg=50,pg=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:dg},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ug(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<fg&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=ug(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},mg=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Wh(e,t)||{};if(l==null)return{};let d=cg(u),f={x:n,y:r},p=Xh(i),m=Jh(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),ee=S?S[y]:0;(!ee||!await(o.isElement==null?void 0:o.isElement(S)))&&(ee=s.floating[y]||a.floating[m]);let C=b/2-x/2,te=ee/2-h[m]/2-1,ne=Lh(d[_],te),re=Lh(d[v],te),ie=ne,ae=ee-h[m]-re,oe=ee/2-h[m]/2+C,w=Uh(ie,oe,ae),se=!c.arrow&&Kh(i)!=null&&oe!==w&&a.reference[m]/2-(oe<ie?ne:re)-h[m]/2<0,ce=se?oe<ie?oe-ie:oe-ae:0;return{[p]:f[p]+ce,data:{[p]:w,centerOffset:oe-w-ce,...se&&{alignmentOffset:ce}},reset:se}}}),hg=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Wh(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Gh(r),_=Yh(o),v=Gh(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[og(o)]:Qh(o)),x=p!==`none`;!d&&x&&b.push(...ag(o,m,p,y));let S=[o,...b],ee=await s.detectOverflow(t,h),C=[],te=i.flip?.overflows||[];if(l&&C.push(ee[g]),u){let e=Zh(r,a,y);C.push(ee[e[0]],ee[e[1]])}if(te=[...te,{placement:r,overflows:C}],!C.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Yh(t))||te.every(e=>Yh(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:te},reset:{placement:t}};let n=te.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=te.filter(e=>{if(x){let t=Yh(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function gg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _g(e){return Ih.some(t=>e[t]>=0)}var vg=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Wh(e,t);switch(i){case`referenceHidden`:{let e=gg(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:_g(e)}}}case`escaped`:{let e=gg(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:_g(e)}}}default:return{}}}}},yg=new Set([`left`,`top`]);async function bg(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Gh(n),s=Kh(n),c=Yh(n)===`y`,l=yg.has(o)?-1:1,u=a&&c?-1:1,d=Wh(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var xg=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await bg(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Sg=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Wh(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Yh(Gh(i)),p=qh(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Uh(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Uh(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Cg=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Wh(e,t),u={x:n,y:r},d=Yh(i),f=qh(d),p=u[f],m=u[d],h=Wh(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=yg.has(Gh(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},wg=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Wh(e,t),u=await o.detectOverflow(t,l),d=Gh(i),f=Kh(i),p=Yh(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Lh(h-u[g],v),x=Lh(m-u[_],y),S=!t.middlewareData.shift,ee=b,C=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(ee=v),S&&!f){let e=Rh(u.left,0),t=Rh(u.right,0),n=Rh(u.top,0),r=Rh(u.bottom,0);p?C=m-2*(e!==0||t!==0?e+t:Rh(u.left,u.right)):ee=h-2*(n!==0||r!==0?n+r:Rh(u.top,u.bottom))}await c({...t,availableWidth:C,availableHeight:ee});let te=await o.getDimensions(s.floating);return m!==te.width||h!==te.height?{reset:{rects:!0}}:{}}}};function Tg(){return typeof window<`u`}function Eg(e){return kg(e)?(e.nodeName||``).toLowerCase():`#document`}function Dg(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Og(e){return((kg(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function kg(e){return Tg()?e instanceof Node||e instanceof Dg(e).Node:!1}function Ag(e){return Tg()?e instanceof Element||e instanceof Dg(e).Element:!1}function jg(e){return Tg()?e instanceof HTMLElement||e instanceof Dg(e).HTMLElement:!1}function Mg(e){return!Tg()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Dg(e).ShadowRoot}function Ng(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Wg(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Pg(e){return/^(table|td|th)$/.test(Eg(e))}function Fg(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ig=/transform|translate|scale|rotate|perspective|filter/,Lg=/paint|layout|strict|content/,Rg=e=>!!e&&e!==`none`,zg;function Bg(e){let t=Ag(e)?Wg(e):e;return Rg(t.transform)||Rg(t.translate)||Rg(t.scale)||Rg(t.rotate)||Rg(t.perspective)||!Hg()&&(Rg(t.backdropFilter)||Rg(t.filter))||Ig.test(t.willChange||``)||Lg.test(t.contain||``)}function Vg(e){let t=Kg(e);for(;jg(t)&&!Ug(t);){if(Bg(t))return t;if(Fg(t))return null;t=Kg(t)}return null}function Hg(){return zg??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),zg}function Ug(e){return/^(html|body|#document)$/.test(Eg(e))}function Wg(e){return Dg(e).getComputedStyle(e)}function Gg(e){return Ag(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Kg(e){if(Eg(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Mg(e)&&e.host||Og(e);return Mg(t)?t.host:t}function qg(e){let t=Kg(e);return Ug(t)?e.ownerDocument?e.ownerDocument.body:e.body:jg(t)&&Ng(t)?t:qg(t)}function Jg(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qg(e),i=r===e.ownerDocument?.body,a=Dg(r);if(i){let e=Yg(a);return t.concat(a,a.visualViewport||[],Ng(r)?r:[],e&&n?Jg(e):[])}else return t.concat(r,Jg(r,[],n))}function Yg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xg(e){let t=Wg(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=jg(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=zh(n)!==a||zh(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Zg(e){return Ag(e)?e:e.contextElement}function Qg(e){let t=Zg(e);if(!jg(t))return Vh(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Xg(t),o=(a?zh(n.width):n.width)/r,s=(a?zh(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var $g=Vh(0);function e_(e){let t=Dg(e);return!Hg()||!t.visualViewport?$g:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function t_(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Dg(e)?!1:t}function n_(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Zg(e),o=Vh(1);t&&(r?Ag(r)&&(o=Qg(r)):o=Qg(e));let s=t_(a,n,r)?e_(a):Vh(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Dg(a),t=r&&Ag(r)?Dg(r):r,n=e,i=Yg(n);for(;i&&r&&t!==n;){let e=Qg(i),t=i.getBoundingClientRect(),r=Wg(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Dg(i),i=Yg(n)}}return lg({width:u,height:d,x:c,y:l})}function r_(e,t){let n=Gg(e).scrollLeft;return t?t.left+n:n_(Og(e)).left+n}function i_(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-r_(e,n),y:n.top+t.scrollTop}}function a_(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Og(r),s=t?Fg(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Vh(1),u=Vh(0),d=jg(r);if((d||!d&&!a)&&((Eg(r)!==`body`||Ng(o))&&(c=Gg(r)),d)){let e=n_(r);l=Qg(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?i_(o,c):Vh(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function o_(e){return Array.from(e.getClientRects())}function s_(e){let t=Og(e),n=Gg(e),r=e.ownerDocument.body,i=Rh(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Rh(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+r_(e),s=-n.scrollTop;return Wg(r).direction===`rtl`&&(o+=Rh(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var c_=25;function l_(e,t){let n=Dg(e),r=Og(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Hg();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=r_(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=c_&&(a-=o)}else l<=c_&&(a+=l);return{width:a,height:o,x:s,y:c}}function u_(e,t){let n=n_(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=jg(e)?Qg(e):Vh(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function d_(e,t,n){let r;if(t===`viewport`)r=l_(e,n);else if(t===`document`)r=s_(Og(e));else if(Ag(t))r=u_(t,n);else{let n=e_(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return lg(r)}function f_(e,t){let n=Kg(e);return n===t||!Ag(n)||Ug(n)?!1:Wg(n).position===`fixed`||f_(n,t)}function p_(e,t){let n=t.get(e);if(n)return n;let r=Jg(e,[],!1).filter(e=>Ag(e)&&Eg(e)!==`body`),i=null,a=Wg(e).position===`fixed`,o=a?Kg(e):e;for(;Ag(o)&&!Ug(o);){let t=Wg(o),n=Bg(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Ng(o)&&!n&&f_(e,o))?r=r.filter(e=>e!==o):i=t,o=Kg(o)}return t.set(e,r),r}function m_(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Fg(t)?[]:p_(t,this._c):[].concat(n),r],o=d_(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=d_(t,a[e],i);s=Rh(n.top,s),c=Lh(n.right,c),l=Lh(n.bottom,l),u=Rh(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function h_(e){let{width:t,height:n}=Xg(e);return{width:t,height:n}}function g_(e,t,n){let r=jg(t),i=Og(t),a=n===`fixed`,o=n_(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Vh(0);function l(){c.x=r_(i)}if(r||!r&&!a)if((Eg(t)!==`body`||Ng(i))&&(s=Gg(t)),r){let e=n_(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?i_(i,s):Vh(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function __(e){return Wg(e).position===`static`}function v_(e,t){if(!jg(e)||Wg(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Og(e)===n&&(n=n.ownerDocument.body),n}function y_(e,t){let n=Dg(e);if(Fg(e))return n;if(!jg(e)){let t=Kg(e);for(;t&&!Ug(t);){if(Ag(t)&&!__(t))return t;t=Kg(t)}return n}let r=v_(e,t);for(;r&&Pg(r)&&__(r);)r=v_(r,t);return r&&Ug(r)&&__(r)&&!Bg(r)?n:r||Vg(e)||n}var b_=async function(e){let t=this.getOffsetParent||y_,n=this.getDimensions,r=await n(e.floating);return{reference:g_(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function x_(e){return Wg(e).direction===`rtl`}var S_={convertOffsetParentRelativeRectToViewportRelativeRect:a_,getDocumentElement:Og,getClippingRect:m_,getOffsetParent:y_,getElementRects:b_,getClientRects:o_,getDimensions:h_,getScale:Qg,isElement:Ag,isRTL:x_};function C_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function w_(e,t){let n=null,r,i=Og(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Bh(d),h=Bh(i.clientWidth-(u+f)),g=Bh(i.clientHeight-(d+p)),_=Bh(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Rh(0,Lh(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!C_(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function T_(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Zg(e),u=i||a?[...l?Jg(l):[],...t?Jg(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?w_(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?n_(e):null;c&&g();function g(){let t=n_(e);h&&!C_(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var E_=xg,D_=Sg,O_=hg,k_=wg,A_=vg,j_=mg,M_=Cg,N_=(e,t,n)=>{let r=new Map,i={platform:S_,...n},a={...i.platform,_c:r};return pg(e,t,{...i,platform:a})};function P_(e){return typeof e==`function`?e():e}function F_(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function I_(e,t){let n=F_(e);return Math.round(t*n)/n}function L_(e){return{[`--bits-${e}-content-transform-origin`]:`var(--bits-floating-transform-origin)`,[`--bits-${e}-content-available-width`]:`var(--bits-floating-available-width)`,[`--bits-${e}-content-available-height`]:`var(--bits-floating-available-height)`,[`--bits-${e}-anchor-width`]:`var(--bits-floating-anchor-width)`,[`--bits-${e}-anchor-height`]:`var(--bits-floating-anchor-height)`}}function R_(e){let t=e.whileElementsMounted,n=k(()=>P_(e.open)??!0),r=k(()=>P_(e.middleware)),i=k(()=>P_(e.transform)??!0),a=k(()=>P_(e.placement)??`bottom`),o=k(()=>P_(e.strategy)??`absolute`),s=k(()=>P_(e.sideOffset)??0),c=k(()=>P_(e.alignOffset)??0),l=e.reference,u=A(0),d=A(0),f=Sf(null),p=A(In(I(o))),m=A(In(I(a))),h=A(In({})),g=A(!1),_=!1,v=0,y=k(()=>{let e=f.current?I_(f.current,I(u)):I(u),t=f.current?I_(f.current,I(d)):I(d);return I(i)?{position:I(p),left:`0`,top:`0`,transform:`translate(${e}px, ${t}px)`,...f.current&&F_(f.current)>=1.5&&{willChange:`transform`}}:{position:I(p),left:`${e}px`,top:`${t}px`}}),b;function x(){if(l.current===null||f.current===null)return;let e=l.current,t=f.current,i=++v;N_(e,t,{middleware:I(r),placement:I(a),strategy:I(o)}).then(r=>{if(i===v&&!(l.current!==e||f.current!==t)){if(z_(e)){j(h,{...I(h),hide:{...I(h).hide,referenceHidden:!0}},!0);return}if(!I(n)&&I(u)!==0&&I(d)!==0){let e=Math.max(Math.abs(I(s)),Math.abs(I(c)),15);if(r.x<=e&&r.y<=e)return}j(u,r.x,!0),j(d,r.y,!0),j(p,r.strategy,!0),j(m,r.placement,!0),j(h,r.middlewareData,!0),j(g,!0)}})}function S(){typeof b==`function`&&(b(),b=void 0),v++}function ee(){if(S(),t===void 0){x();return}I(n)&&(l.current===null||f.current===null||(b=t(l.current,f.current,x)))}function C(){!I(n)&&f.current===null&&j(g,!1)}function te(){return[I(r),I(a),I(o),I(s),I(c),I(n)]}return sr(()=>{t===void 0&&I(n)&&x()}),sr(ee),sr(()=>{if(t!==void 0){if(te(),!I(n)){_=!1;return}if(!I(g)){_=!1;return}if(!_){_=!0;return}x()}}),sr(C),sr(()=>S),{floating:f,reference:l,get strategy(){return I(p)},get placement(){return I(m)},get middlewareData(){return I(h)},get isPositioned(){return I(g)},get floatingStyles(){return I(y)},get update(){return x}}}function z_(e){return e instanceof Element?!e.isConnected||e instanceof HTMLElement&&e.hidden?!0:e.getClientRects().length===0:!1}var B_={top:`bottom`,right:`left`,bottom:`top`,left:`right`},V_=new qf(`Floating.Root`),H_=new qf(`Floating.Content`),U_=new qf(`Floating.Root`),W_=class e{static create(t=!1){return t?U_.set(new e):V_.set(new e)}anchorNode=Sf(null);customAnchorNode=Sf(null);triggerNode=Sf(null);constructor(){sr(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current==`string`?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}},G_=class e{static create(t,n=!1){return n?H_.set(new e(t,U_.get())):H_.set(new e(t,V_.get()))}opts;root;contentRef=Sf(null);wrapperRef=Sf(null);arrowRef=Sf(null);contentAttachment=Op(this.contentRef);wrapperAttachment=Op(this.wrapperRef);arrowAttachment=Op(this.arrowRef);arrowId=Sf(nh());#e=k(()=>{if(typeof this.opts.style==`string`)return Nf(this.opts.style);if(!this.opts.style)return{}});#t=void 0;#n=new rp(()=>this.arrowRef.current??void 0);#r=k(()=>this.#n?.width??0);#i=k(()=>this.#n?.height??0);#a=k(()=>this.opts.side?.current+(this.opts.align.current===`center`?``:`-${this.opts.align.current}`));#o=k(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]);#s=k(()=>I(this.#o).length>0);get hasExplicitBoundaries(){return I(this.#s)}set hasExplicitBoundaries(e){j(this.#s,e)}#c=k(()=>({padding:this.opts.collisionPadding.current,boundary:I(this.#o).filter(Zte),altBoundary:this.hasExplicitBoundaries}));get detectOverflowOptions(){return I(this.#c)}set detectOverflowOptions(e){j(this.#c,e)}#l=A(void 0);#u=A(void 0);#d=A(void 0);#f=A(void 0);#p=k(()=>[E_({mainAxis:this.opts.sideOffset.current+I(this.#i),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&D_({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current===`partial`?M_():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&O_({...this.detectOverflowOptions}),k_({...this.detectOverflowOptions,apply:({rects:e,availableWidth:t,availableHeight:n})=>{let{width:r,height:i}=e.reference;j(this.#l,t,!0),j(this.#u,n,!0),j(this.#d,r,!0),j(this.#f,i,!0)}}),this.arrowRef.current&&j_({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),J_({arrowWidth:I(this.#r),arrowHeight:I(this.#i)}),this.opts.hideWhenDetached.current&&A_({strategy:`referenceHidden`,...this.detectOverflowOptions})].filter(Boolean));get middleware(){return I(this.#p)}set middleware(e){j(this.#p,e)}floating;#m=k(()=>X_(this.floating.placement));get placedSide(){return I(this.#m)}set placedSide(e){j(this.#m,e)}#h=k(()=>Z_(this.floating.placement));get placedAlign(){return I(this.#h)}set placedAlign(e){j(this.#h,e)}#g=k(()=>this.floating.middlewareData.arrow?.x??0);get arrowX(){return I(this.#g)}set arrowX(e){j(this.#g,e)}#_=k(()=>this.floating.middlewareData.arrow?.y??0);get arrowY(){return I(this.#_)}set arrowY(e){j(this.#_,e)}#v=k(()=>this.floating.middlewareData.arrow?.centerOffset!==0);get cannotCenterArrow(){return I(this.#v)}set cannotCenterArrow(e){j(this.#v,e)}#y=A();get contentZIndex(){return I(this.#y)}set contentZIndex(e){j(this.#y,e,!0)}#b=k(()=>B_[this.placedSide]);get arrowBaseSide(){return I(this.#b)}set arrowBaseSide(e){j(this.#b,e)}#x=k(()=>({id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":``,style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,"--bits-floating-available-width":`${I(this.#l)}px`,"--bits-floating-available-height":`${I(this.#u)}px`,"--bits-floating-anchor-width":`${I(this.#d)}px`,"--bits-floating-anchor-height":`${I(this.#f)}px`,...this.floating.middlewareData.hide?.referenceHidden&&{visibility:`hidden`,"pointer-events":`none`},...I(this.#e)},dir:this.opts.dir.current,...this.wrapperAttachment}));get wrapperProps(){return I(this.#x)}set wrapperProps(e){j(this.#x,e)}#S=k(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:Rf({...I(this.#e)}),...this.contentAttachment}));get props(){return I(this.#S)}set props(e){j(this.#S,e)}#C=k(()=>({position:`absolute`,left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[this.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[this.placedSide],visibility:this.cannotCenterArrow?`hidden`:void 0}));get arrowStyle(){return I(this.#C)}set arrowStyle(e){j(this.#C,e)}constructor(e,t){this.opts=e,this.root=t,this.#t=e.updatePositionStrategy,e.customAnchor&&(this.root.customAnchorNode.current=e.customAnchor.current),Qf(()=>e.customAnchor.current,e=>{this.root.customAnchorNode.current=e}),this.floating=R_({strategy:()=>this.opts.strategy.current,placement:()=>I(this.#a),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...e)=>T_(...e,{animationFrame:this.#t?.current===`always`}),open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),sr(()=>{this.floating.isPositioned&&this.opts.onPlaced?.current()}),Qf(()=>this.contentRef.current,e=>{if(!e||!this.opts.enabled.current)return;let t=Tp(e),n=t.requestAnimationFrame(()=>{if(this.contentRef.current!==e||!this.opts.enabled.current)return;let n=t.getComputedStyle(e).zIndex;n!==this.contentZIndex&&(this.contentZIndex=n)});return()=>{t.cancelAnimationFrame(n)}}),sr(()=>{this.floating.floating.current=this.wrapperRef.current})}},K_=class e{static create(t){return new e(t,H_.get())}opts;content;constructor(e,t){this.opts=e,this.content=t}#e=k(()=>({id:this.opts.id.current,style:this.content.arrowStyle,"data-side":this.content.placedSide,...this.content.arrowAttachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},q_=class e{static create(t,n=!1){return n?new e(t,U_.get()):new e(t,V_.get())}opts;root;constructor(e,t){this.opts=e,this.root=t,e.virtualEl&&e.virtualEl.current?t.triggerNode=yf(e.virtualEl.current):t.triggerNode=e.ref}};function J_(e){return{name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Y_(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}}function Y_(e){let[t,n=`center`]=e.split(`-`);return[t,n]}function X_(e){return Y_(e)[0]}function Z_(e){return Y_(e)[1]}function Q_(e,t){D(t,!0);let n=q(t,`tooltip`,3,!1);W_.create(n());var r=R();H(N(r),()=>t.children??w),z(e,r),O()}var $_=class{#e;#t=k(()=>this.#e.candidateValues());#n;constructor(e){this.#e=e,this.#n=Pm(``,{afterMs:1e3,getWindow:this.#e.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(e){if(!this.#e.enabled()||!I(this.#t).length)return;this.#n.current=this.#n.current+e;let t=this.#e.getCurrentItem(),n=I(this.#t).find(e=>e===t)??``,r=Mm(I(this.#t).map(e=>e??``),this.#n.current,n),i=I(this.#t).find(e=>e===r);return i&&this.#e.onMatch(i),i}resetTypeahead(){this.#n.current=``}},ev=[Ip,Hp,Bp],tv=[zp,Vp,`End`],nv=[...ev,...tv],rv=Fp({component:`select`,parts:[`trigger`,`content`,`item`,`viewport`,`scroll-up-button`,`scroll-down-button`,`group`,`group-label`,`separator`,`arrow`,`input`,`content-wrapper`,`item-text`,`value`]}),iv=new qf(`Select.Root | Combobox.Root`);new qf(`Select.Group | Combobox.Group`);var av=new qf(`Select.Content | Combobox.Content`),ov=class{opts;#e=A(!1);get touchedInput(){return I(this.#e)}set touchedInput(e){j(this.#e,e,!0)}#t=A(null);get inputNode(){return I(this.#t)}set inputNode(e){j(this.#t,e,!0)}#n=A(null);get contentNode(){return I(this.#n)}set contentNode(e){j(this.#n,e,!0)}contentPresence;#r=A(null);get viewportNode(){return I(this.#r)}set viewportNode(e){j(this.#r,e,!0)}#i=A(null);get triggerNode(){return I(this.#i)}set triggerNode(e){j(this.#i,e,!0)}#a=A(null);get valueNode(){return I(this.#a)}set valueNode(e){j(this.#a,e,!0)}#o=A(``);get valueId(){return I(this.#o)}set valueId(e){j(this.#o,e,!0)}#s=A(null);get highlightedNode(){return I(this.#s)}set highlightedNode(e){j(this.#s,e,!0)}#c=k(()=>this.highlightedNode?this.highlightedNode.getAttribute(`data-value`):null);get highlightedValue(){return I(this.#c)}set highlightedValue(e){j(this.#c,e)}#l=k(()=>{if(this.highlightedNode)return this.highlightedNode.id});get highlightedId(){return I(this.#l)}set highlightedId(e){j(this.#l,e)}#u=k(()=>this.highlightedNode?this.highlightedNode.getAttribute(`data-label`):null);get highlightedLabel(){return I(this.#u)}set highlightedLabel(e){j(this.#u,e)}#d=A(!1);get contentIsPositioned(){return I(this.#d)}set contentIsPositioned(e){j(this.#d,e,!0)}isUsingKeyboard=!1;isCombobox=!1;domContext=new Dp(()=>null);constructor(e){this.opts=e,this.isCombobox=e.isCombobox,this.contentPresence=new Zp({ref:J(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),lr(()=>{this.opts.open.current||this.setHighlightedNode(null)})}setHighlightedNode(e,t=!1){this.highlightedNode=e,e&&(this.isUsingKeyboard||t)&&this.scrollHighlightedNodeIntoView(e)}scrollHighlightedNodeIntoView(e){!this.viewportNode||!this.contentIsPositioned||e.scrollIntoView({block:this.opts.scrollAlignment.current})}getCandidateNodes(){let e=this.contentNode;return e?Array.from(e.querySelectorAll(`[${this.getBitsAttr(`item`)}]:not([data-disabled])`)):[]}setHighlightedToFirstCandidate(e=!1){this.setHighlightedNode(null);let t=this.getCandidateNodes();if(t.length){if(this.viewportNode){let e=this.viewportNode.getBoundingClientRect();t=t.filter(t=>{if(!this.viewportNode)return!1;let n=t.getBoundingClientRect();return n.right<=e.right&&n.left>=e.left&&n.bottom<=e.bottom&&n.top>=e.top})}this.setHighlightedNode(t[0],e)}}getNodeByValue(e){return this.getCandidateNodes().find(t=>t.dataset.value===e)??null}getLabelForValue(e){if(e===``)return``;let t=this.opts.items.current.find(t=>t.value===e)?.label;if(t!==void 0)return t;let n=this.getNodeByValue(e);if(n){let t=n.getAttribute(`data-label`);return t!==null&&t!==``?t:n.textContent?.trim()??e}return e}setOpen(e){this.opts.open.current=e}toggleOpen(){this.opts.open.current=!this.opts.open.current}handleOpen(){this.setOpen(!0)}handleClose(){this.setHighlightedNode(null),this.setOpen(!1)}toggleMenu(){this.toggleOpen()}getBitsAttr=e=>rv.getAttr(e,this.isCombobox?`combobox`:void 0)},sv=class extends ov{opts;isMulti=!1;#e=k(()=>this.opts.value.current!==``);get hasValue(){return I(this.#e)}set hasValue(e){j(this.#e,e)}#t=k(()=>this.opts.items.current.length?this.opts.items.current.find(e=>e.value===this.opts.value.current)?.label??``:``);get currentLabel(){return I(this.#t)}set currentLabel(e){j(this.#t,e)}#n=k(()=>this.opts.items.current.length?this.opts.items.current.filter(e=>!e.disabled).map(e=>e.label):[]);get candidateLabels(){return I(this.#n)}set candidateLabels(e){j(this.#n,e)}#r=k(()=>!(this.isMulti||this.opts.items.current.length===0));get dataTypeaheadEnabled(){return I(this.#r)}set dataTypeaheadEnabled(e){j(this.#r,e)}constructor(e){super(e),this.opts=e,sr(()=>{!this.opts.open.current&&this.highlightedNode&&this.setHighlightedNode(null)}),Qf(()=>this.opts.open.current,()=>{this.opts.open.current&&this.setInitialHighlightedNode()})}includesItem(e){return this.opts.value.current===e}toggleItem(e,t=e){let n=this.includesItem(e)?``:e;this.opts.value.current=n,n!==``&&(this.opts.inputValue.current=t)}setInitialHighlightedNode(){mp(()=>{if(!(this.highlightedNode&&this.domContext.getDocument().contains(this.highlightedNode))){if(this.opts.value.current!==``){let e=this.getNodeByValue(this.opts.value.current);if(e){this.setHighlightedNode(e,!0);return}}this.setHighlightedToFirstCandidate(!0)}})}},cv=class extends ov{opts;isMulti=!0;#e=k(()=>this.opts.value.current.length>0);get hasValue(){return I(this.#e)}set hasValue(e){j(this.#e,e)}constructor(e){super(e),this.opts=e,sr(()=>{!this.opts.open.current&&this.highlightedNode&&this.setHighlightedNode(null)}),Qf(()=>this.opts.open.current,()=>{this.opts.open.current&&this.setInitialHighlightedNode()})}includesItem(e){return this.opts.value.current.includes(e)}toggleItem(e,t=e){this.includesItem(e)?this.opts.value.current=this.opts.value.current.filter(t=>t!==e):this.opts.value.current=[...this.opts.value.current,e],this.opts.inputValue.current=t}setInitialHighlightedNode(){mp(()=>{if(this.domContext&&!(this.highlightedNode&&this.domContext.getDocument().contains(this.highlightedNode))){if(this.opts.value.current.length&&this.opts.value.current[0]!==``){let e=this.getNodeByValue(this.opts.value.current[0]);if(e){this.setHighlightedNode(e,!0);return}}this.setHighlightedToFirstCandidate(!0)}})}},lv=class{static create(e){let{type:t,...n}=e,r=t===`single`?new sv(n):new cv(n);return iv.set(r)}},uv=class e{static create(t){return new e(t,iv.get())}opts;root;attachment;#e;#t;constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(e.ref,e=>this.root.triggerNode=e),this.root.domContext=new Dp(e.ref),this.#e=new Fm({getCurrentItem:()=>this.root.highlightedNode,onMatch:e=>{this.root.setHighlightedNode(e)},getActiveElement:()=>this.root.domContext.getActiveElement(),getWindow:()=>this.root.domContext.getWindow()}),this.#t=new $_({getCurrentItem:()=>this.root.isMulti?``:this.root.currentLabel,onMatch:e=>{if(this.root.isMulti||!this.root.opts.items.current)return;let t=this.root.opts.items.current.find(t=>t.label===e);t&&(this.root.opts.value.current=t.value)},enabled:()=>!this.root.isMulti&&this.root.dataTypeaheadEnabled,candidateValues:()=>this.root.isMulti?[]:this.root.candidateLabels,getWindow:()=>this.root.domContext.getWindow()}),this.onkeydown=this.onkeydown.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onclick=this.onclick.bind(this)}#n(){this.root.opts.open.current=!0,this.#t.resetTypeahead(),this.#e.resetTypeahead()}#r(e){this.#n()}#i(){let e=this.root.highlightedValue===this.root.opts.value.current;return!this.root.opts.allowDeselect.current&&e&&!this.root.isMulti||(this.root.highlightedValue!==null&&this.root.toggleItem(this.root.highlightedValue,this.root.highlightedLabel??void 0),!this.root.isMulti&&!e)?(this.root.handleClose(),!0):!1}onkeydown(e){if(this.root.isUsingKeyboard=!0,(e.key===`ArrowUp`||e.key===`ArrowDown`)&&e.preventDefault(),!this.root.opts.open.current){if(e.key===`Enter`||e.key===` `||e.key===`ArrowDown`||e.key===`ArrowUp`)e.preventDefault(),this.root.handleOpen();else if(!this.root.isMulti&&this.root.dataTypeaheadEnabled){this.#t.handleTypeaheadSearch(e.key);return}if(this.root.hasValue)return;let t=this.root.getCandidateNodes();if(!t.length)return;if(e.key===`ArrowDown`){let e=t[0];this.root.setHighlightedNode(e)}else if(e.key===`ArrowUp`){let e=t[t.length-1];this.root.setHighlightedNode(e)}return}if(e.key===`Tab`){this.root.handleClose();return}if((e.key===`Enter`||e.key===` `&&this.#e.search===``)&&!e.isComposing&&(e.preventDefault(),this.#i()))return;if(e.key===`ArrowUp`&&e.altKey&&this.root.handleClose(),nv.includes(e.key)){e.preventDefault();let t=this.root.getCandidateNodes(),n=this.root.highlightedNode,r=n?t.indexOf(n):-1,i=this.root.opts.loop.current,a;if(e.key===`ArrowDown`?a=qne(t,r,i):e.key===`ArrowUp`?a=Jne(t,r,i):e.key===`PageDown`?a=Yne(t,r,10,i):e.key===`PageUp`?a=Xne(t,r,10,i):e.key===`Home`?a=t[0]:e.key===`End`&&(a=t[t.length-1]),!a)return;this.root.setHighlightedNode(a);return}let t=e.ctrlKey||e.altKey||e.metaKey,n=e.key.length===1,r=e.key===` `,i=this.root.getCandidateNodes();if(e.key!==`Tab`){if(!t&&(n||r)){!this.#e.handleTypeaheadSearch(e.key,i)&&r&&(e.preventDefault(),this.#i());return}this.root.highlightedNode||this.root.setHighlightedToFirstCandidate()}}onclick(e){e.currentTarget.focus()}onpointerdown(e){if(this.root.opts.disabled.current)return;if(e.pointerType===`touch`)return e.preventDefault();let t=e.target;t?.hasPointerCapture(e.pointerId)&&t?.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&(this.root.opts.open.current===!1?this.#r(e):this.root.handleClose())}onpointerup(e){this.root.opts.disabled.current||(e.preventDefault(),e.pointerType===`touch`&&(this.root.opts.open.current===!1?this.#r(e):this.root.handleClose()))}#a=k(()=>({id:this.opts.id.current,disabled:this.root.opts.disabled.current?!0:void 0,"aria-haspopup":`listbox`,"aria-expanded":kp(this.root.opts.open.current),"aria-activedescendant":this.root.highlightedId,"data-state":Mp(this.root.opts.open.current),"data-disabled":Ap(this.root.opts.disabled.current),"data-placeholder":this.root.hasValue?void 0:``,[this.root.getBitsAttr(`trigger`)]:``,onpointerdown:this.onpointerdown,onkeydown:this.onkeydown,onclick:this.onclick,onpointerup:this.onpointerup,...this.attachment}));get props(){return I(this.#a)}set props(e){j(this.#a,e)}},dv=class e{static create(t){return av.set(new e(t,iv.get()))}opts;root;attachment;#e=A(!1);get isPositioned(){return I(this.#e)}set isPositioned(e){j(this.#e,e,!0)}domContext;constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(e.ref,e=>this.root.contentNode=e),this.domContext=new Dp(this.opts.ref),this.root.domContext===null&&(this.root.domContext=this.domContext),dp(()=>{this.root.contentNode=null,this.root.contentIsPositioned=!1,this.isPositioned=!1}),Qf(()=>this.root.opts.open.current,()=>{this.root.opts.open.current||(this.root.contentIsPositioned=!1,this.isPositioned=!1)}),Qf([()=>this.isPositioned,()=>this.root.highlightedNode],()=>{!this.isPositioned||!this.root.highlightedNode||this.root.scrollHighlightedNodeIntoView(this.root.highlightedNode)}),this.onpointermove=this.onpointermove.bind(this)}onpointermove(e){this.root.isUsingKeyboard=!1}#t=k(()=>L_(this.root.isCombobox?`combobox`:`select`));onInteractOutside=e=>{if(e.target===this.root.triggerNode||e.target===this.root.inputNode){e.preventDefault();return}this.opts.onInteractOutside.current(e),!e.defaultPrevented&&this.root.handleClose()};onEscapeKeydown=e=>{this.opts.onEscapeKeydown.current(e),!e.defaultPrevented&&this.root.handleClose()};onOpenAutoFocus=e=>{e.preventDefault()};onCloseAutoFocus=e=>{e.preventDefault()};get shouldRender(){return this.root.contentPresence.shouldRender}#n=k(()=>({open:this.root.opts.open.current}));get snippetProps(){return I(this.#n)}set snippetProps(e){j(this.#n,e)}#r=k(()=>({id:this.opts.id.current,role:`listbox`,"aria-multiselectable":this.root.isMulti?`true`:void 0,"data-state":Mp(this.root.opts.open.current),...Np(this.root.contentPresence.transitionStatus),[this.root.getBitsAttr(`content`)]:``,style:{display:`flex`,flexDirection:`column`,outline:`none`,boxSizing:`border-box`,pointerEvents:`auto`,...I(this.#t)},onpointermove:this.onpointermove,...this.attachment}));get props(){return I(this.#r)}set props(e){j(this.#r,e)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown,onOpenAutoFocus:this.onOpenAutoFocus,onCloseAutoFocus:this.onCloseAutoFocus,trapFocus:!1,loop:!1,onPlaced:()=>{this.root.opts.open.current&&(this.root.contentIsPositioned=!0,this.isPositioned=!0)}}},fv=class e{static create(t){return new e(t,iv.get())}opts;root;attachment;#e=k(()=>this.root.includesItem(this.opts.value.current));get isSelected(){return I(this.#e)}set isSelected(e){j(this.#e,e)}#t=k(()=>this.root.highlightedValue===this.opts.value.current);get isHighlighted(){return I(this.#t)}set isHighlighted(e){j(this.#t,e)}prevHighlighted=new ap(()=>this.isHighlighted);#n=A(!1);get mounted(){return I(this.#n)}set mounted(e){j(this.#n,e,!0)}constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(e.ref),Qf([()=>this.isHighlighted,()=>this.prevHighlighted.current],()=>{this.isHighlighted?this.opts.onHighlight.current():this.prevHighlighted.current&&this.opts.onUnhighlight.current()}),Qf(()=>this.mounted,()=>{this.mounted&&this.root.setInitialHighlightedNode()}),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onpointermove=this.onpointermove.bind(this)}handleSelect(){if(this.opts.disabled.current)return;let e=this.opts.value.current===this.root.opts.value.current;if(!this.root.opts.allowDeselect.current&&e&&!this.root.isMulti){this.root.handleClose();return}this.root.toggleItem(this.opts.value.current,this.opts.label.current),!this.root.isMulti&&!e&&this.root.handleClose()}#r=k(()=>({selected:this.isSelected,highlighted:this.isHighlighted}));get snippetProps(){return I(this.#r)}set snippetProps(e){j(this.#r,e)}onpointerdown(e){e.preventDefault()}onpointerup(e){if(!(e.defaultPrevented||!this.opts.ref.current)){if(e.pointerType===`touch`&&!Wp){vi(this.opts.ref.current,`click`,()=>{this.handleSelect(),this.root.setHighlightedNode(this.opts.ref.current)},{once:!0});return}e.preventDefault(),this.handleSelect(),e.pointerType===`touch`&&this.root.setHighlightedNode(this.opts.ref.current)}}onpointermove(e){e.pointerType!==`touch`&&this.root.highlightedNode!==this.opts.ref.current&&this.root.setHighlightedNode(this.opts.ref.current)}#i=k(()=>({id:this.opts.id.current,role:`option`,"aria-selected":this.root.includesItem(this.opts.value.current)?`true`:void 0,"data-value":this.opts.value.current,"data-disabled":Ap(this.opts.disabled.current),"data-highlighted":this.root.highlightedValue===this.opts.value.current&&!this.opts.disabled.current?``:void 0,"data-selected":this.root.includesItem(this.opts.value.current)?``:void 0,"data-label":this.opts.label.current,[this.root.getBitsAttr(`item`)]:``,onpointermove:this.onpointermove,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,...this.attachment}));get props(){return I(this.#i)}set props(e){j(this.#i,e)}},pv=class e{static create(t){return new e(t,iv.get())}opts;root;#e=k(()=>this.root.opts.name.current!==``);get shouldRender(){return I(this.#e)}set shouldRender(e){j(this.#e,e)}constructor(e,t){this.opts=e,this.root=t,this.onfocus=this.onfocus.bind(this)}onfocus(e){e.preventDefault(),this.root.isCombobox?this.root.inputNode?.focus():this.root.triggerNode?.focus()}#t=k(()=>({disabled:jp(this.root.opts.disabled.current),required:jp(this.root.opts.required.current),name:this.root.opts.name.current,value:this.opts.value.current,onfocus:this.onfocus}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},mv=class e{static create(t){return new e(t,av.get())}opts;content;root;attachment;#e=A(0);get prevScrollTop(){return I(this.#e)}set prevScrollTop(e){j(this.#e,e,!0)}constructor(e,t){this.opts=e,this.content=t,this.root=t.root,this.attachment=Op(e.ref,e=>{this.root.viewportNode=e})}#t=k(()=>({id:this.opts.id.current,role:`presentation`,[this.root.getBitsAttr(`viewport`)]:``,style:{position:`relative`,flex:1,overflow:`auto`},...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},hv=class{opts;content;root;attachment;autoScrollTimer=null;userScrollTimer=-1;isUserScrolling=!1;onAutoScroll=Qp;#e=A(!1);get mounted(){return I(this.#e)}set mounted(e){j(this.#e,e,!0)}constructor(e,t){this.opts=e,this.content=t,this.root=t.root,this.attachment=Op(e.ref),Qf([()=>this.mounted],()=>{if(!this.mounted){this.isUserScrolling=!1;return}this.isUserScrolling}),sr(()=>{this.mounted||this.clearAutoScrollInterval()}),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this)}handleUserScroll(){this.content.domContext.clearTimeout(this.userScrollTimer),this.isUserScrolling=!0,this.userScrollTimer=this.content.domContext.setTimeout(()=>{this.isUserScrolling=!1},200)}clearAutoScrollInterval(){this.autoScrollTimer!==null&&(this.content.domContext.clearTimeout(this.autoScrollTimer),this.autoScrollTimer=null)}onpointerdown(e){if(this.autoScrollTimer!==null)return;let t=e=>{this.onAutoScroll(),this.autoScrollTimer=this.content.domContext.setTimeout(()=>t(e+1),this.opts.delay.current(e))};this.autoScrollTimer=this.content.domContext.setTimeout(()=>t(1),this.opts.delay.current(0))}onpointermove(e){this.onpointerdown(e)}onpointerleave(e){this.clearAutoScrollInterval()}#t=k(()=>({id:this.opts.id.current,"aria-hidden":zte(!0),style:{flexShrink:0},onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},gv=class e{static create(t){return new e(new hv(t,av.get()))}scrollButtonState;content;root;#e=A(!1);get canScrollDown(){return I(this.#e)}set canScrollDown(e){j(this.#e,e,!0)}scrollIntoViewTimer=null;constructor(e){this.scrollButtonState=e,this.content=e.content,this.root=e.root,this.scrollButtonState.onAutoScroll=this.handleAutoScroll,Qf([()=>this.root.viewportNode,()=>this.content.isPositioned],()=>{if(!(!this.root.viewportNode||!this.content.isPositioned))return this.handleScroll(!0),vi(this.root.viewportNode,`scroll`,()=>this.handleScroll())}),Qf([()=>this.root.opts.inputValue.current,()=>this.root.viewportNode,()=>this.content.isPositioned],()=>{!this.root.viewportNode||!this.content.isPositioned||this.handleScroll(!0)}),Qf(()=>this.scrollButtonState.mounted,()=>{this.scrollButtonState.mounted&&(this.scrollIntoViewTimer&&clearTimeout(this.scrollIntoViewTimer),this.scrollIntoViewTimer=pp(5,()=>{let e=this.root.highlightedNode;e&&this.root.scrollHighlightedNodeIntoView(e)}))})}handleScroll=(e=!1)=>{if(e||this.scrollButtonState.handleUserScroll(),!this.root.viewportNode)return;let t=this.root.viewportNode.scrollHeight-this.root.viewportNode.clientHeight,n=Number.parseInt(getComputedStyle(this.root.viewportNode).paddingTop,10);this.canScrollDown=Math.ceil(this.root.viewportNode.scrollTop)<t-n};handleAutoScroll=()=>{let e=this.root.viewportNode,t=this.root.highlightedNode;!e||!t||(e.scrollTop+=t.offsetHeight)};#t=k(()=>({...this.scrollButtonState.props,[this.root.getBitsAttr(`scroll-down-button`)]:``}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},_v=class e{static create(t){return new e(new hv(t,av.get()))}scrollButtonState;content;root;#e=A(!1);get canScrollUp(){return I(this.#e)}set canScrollUp(e){j(this.#e,e,!0)}constructor(e){this.scrollButtonState=e,this.content=e.content,this.root=e.root,this.scrollButtonState.onAutoScroll=this.handleAutoScroll,Qf([()=>this.root.viewportNode,()=>this.content.isPositioned],()=>{if(!(!this.root.viewportNode||!this.content.isPositioned))return this.handleScroll(!0),vi(this.root.viewportNode,`scroll`,()=>this.handleScroll())})}handleScroll=(e=!1)=>{if(e||this.scrollButtonState.handleUserScroll(),!this.root.viewportNode)return;let t=Number.parseInt(getComputedStyle(this.root.viewportNode).paddingTop,10);this.canScrollUp=this.root.viewportNode.scrollTop-t>.1};handleAutoScroll=()=>{!this.root.viewportNode||!this.root.highlightedNode||(this.root.viewportNode.scrollTop=this.root.viewportNode.scrollTop-this.root.highlightedNode.offsetHeight)};#t=k(()=>({...this.scrollButtonState.props,[this.root.getBitsAttr(`scroll-up-button`)]:``}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}};function vv(e,t){D(t,!0);let n=q(t,`value`,15),r=pv.create({value:J(()=>n())});var i=R(),a=N(i),o=e=>{Ah(e,K(()=>r.props,{get autocomplete(){return t.autocomplete},get value(){return n()},set value(e){n(e)}}))};V(a,e=>{r.shouldRender&&e(o)}),z(e,i),O()}function yv(e,t){D(t,!0);let n=q(t,`tooltip`,3,!1);q_.create({id:J(()=>t.id),virtualEl:J(()=>t.virtualEl),ref:t.ref},n());var r=R();H(N(r),()=>t.children??w),z(e,r),O()}var bv=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`width`,`height`]),xv=Oi(`<svg viewBox="0 0 30 10" preserveAspectRatio="none" data-arrow=""><polygon points="0,0 30,0 15,10" fill="currentColor"></polygon></svg>`),Sv=L(`<span><!></span>`);function Cv(e,t){D(t,!0);let n=q(t,`id`,19,nh),r=q(t,`width`,3,10),i=q(t,`height`,3,5),a=G(t,bv),o=k(()=>Vf(a,{id:n()}));var s=R(),c=N(s),l=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(o)})),z(e,n)},u=e=>{var n=Sv();Sa(n,()=>({...I(o)}));var a=M(n),s=e=>{var n=R();H(N(n),()=>t.children??w),z(e,n)},c=e=>{var t=xv();F(()=>{W(t,`width`,r()),W(t,`height`,i())}),z(e,t)};V(a,e=>{t.children?e(s):e(c,-1)}),T(n),z(e,n)};V(c,e=>{t.child?e(l):e(u,-1)}),z(e,s),O()}var wv=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`]);function Tv(e,t){D(t,!0);let n=q(t,`id`,19,nh),r=q(t,`ref`,15,null),i=G(t,wv),a=K_.create({id:J(()=>n()),ref:J(()=>r(),e=>r(e))}),o=k(()=>Vf(i,a.props));Cv(e,K(()=>I(o))),O()}function Ev(e,t){D(t,!0);let n=q(t,`side`,3,`bottom`),r=q(t,`sideOffset`,3,0),i=q(t,`align`,3,`center`),a=q(t,`alignOffset`,3,0),o=q(t,`arrowPadding`,3,0),s=q(t,`avoidCollisions`,3,!0),c=q(t,`collisionBoundary`,19,()=>[]),l=q(t,`collisionPadding`,3,0),u=q(t,`hideWhenDetached`,3,!1),d=q(t,`onPlaced`,3,()=>{}),f=q(t,`sticky`,3,`partial`),p=q(t,`updatePositionStrategy`,3,`optimized`),m=q(t,`strategy`,3,`fixed`),h=q(t,`dir`,3,`ltr`),g=q(t,`style`,19,()=>({})),_=q(t,`wrapperId`,19,nh),v=q(t,`customAnchor`,3,null),y=q(t,`tooltip`,3,!1),b=G_.create({side:J(()=>n()),sideOffset:J(()=>r()),align:J(()=>i()),alignOffset:J(()=>a()),id:J(()=>t.id),arrowPadding:J(()=>o()),avoidCollisions:J(()=>s()),collisionBoundary:J(()=>c()),collisionPadding:J(()=>l()),hideWhenDetached:J(()=>u()),onPlaced:J(()=>d()),sticky:J(()=>f()),updatePositionStrategy:J(()=>p()),strategy:J(()=>m()),dir:J(()=>h()),style:J(()=>g()),enabled:J(()=>t.enabled),wrapperId:J(()=>_()),customAnchor:J(()=>v())},y()),x=k(()=>Vf(b.wrapperProps,{style:{pointerEvents:`auto`}}));var S=R();H(N(S),()=>t.content??w,()=>({props:b.props,wrapperProps:I(x)})),z(e,S),O()}function Dv(e,t){D(t,!0),Na(()=>{t.onPlaced?.()});var n=R();H(N(n),()=>t.content??w,()=>({props:{},wrapperProps:{}})),z(e,n),O()}var Ov=new Set([`$$slots`,`$$events`,`$$legacy`,`content`,`isStatic`,`onPlaced`]);function kv(e,t){let n=q(t,`isStatic`,3,!1),r=G(t,Ov);var i=R(),a=N(i),o=e=>{Dv(e,{get content(){return t.content},get onPlaced(){return t.onPlaced}})},s=e=>{Ev(e,K({get content(){return t.content},get onPlaced(){return t.onPlaced}},()=>r))};V(a,e=>{n()?e(o):e(s,-1)}),z(e,i)}var Av=new Set(`$$slots.$$events.$$legacy.popper.onEscapeKeydown.escapeKeydownBehavior.preventOverflowTextSelection.id.onPointerDown.onPointerUp.side.sideOffset.align.alignOffset.arrowPadding.avoidCollisions.collisionBoundary.collisionPadding.sticky.hideWhenDetached.updatePositionStrategy.strategy.dir.preventScroll.wrapperId.style.onPlaced.onInteractOutside.onCloseAutoFocus.onOpenAutoFocus.onFocusOutside.interactOutsideBehavior.loop.trapFocus.isValidEvent.customAnchor.isStatic.enabled.ref.tooltip.contentPointerEvents`.split(`.`)),jv=L(`<!> <!>`,1);function Mv(e,t){D(t,!0);let n=q(t,`interactOutsideBehavior`,3,`close`),r=q(t,`trapFocus`,3,!0),i=q(t,`isValidEvent`,3,()=>!1),a=q(t,`customAnchor`,3,null),o=q(t,`isStatic`,3,!1),s=q(t,`tooltip`,3,!1),c=q(t,`contentPointerEvents`,3,`auto`),l=G(t,Av),u=k(()=>t.preventScroll??!0),d=k(()=>t.strategy??(I(u)?`fixed`:`absolute`));kv(e,{get isStatic(){return o()},get id(){return t.id},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return I(d)},get dir(){return t.dir},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return a()},get enabled(){return t.enabled},get tooltip(){return s()},content:(e,a)=>{let o=()=>a?.().props,s=()=>a?.().wrapperProps;var d=jv(),f=N(d),p=e=>{dh(e,{get preventScroll(){return I(u)}})},m=e=>{dh(e,{get preventScroll(){return I(u)}})};V(f,e=>{t.forceMount&&t.enabled?e(p):t.forceMount||e(m,1)}),Zm(P(f,2),{get onOpenAutoFocus(){return t.onOpenAutoFocus},get onCloseAutoFocus(){return t.onCloseAutoFocus},get loop(){return t.loop},get enabled(){return t.enabled},get trapFocus(){return r()},get forceMount(){return t.forceMount},get ref(){return t.ref},focusScope:(e,r)=>{let a=()=>r?.().props;Xm(e,{get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get enabled(){return t.enabled},get ref(){return t.ref},children:(e,r)=>{Ym(e,{get id(){return t.id},get onInteractOutside(){return t.onInteractOutside},get onFocusOutside(){return t.onFocusOutside},get interactOutsideBehavior(){return n()},get isValidEvent(){return i()},get enabled(){return t.enabled},get ref(){return t.ref},children:(e,n)=>{let r=()=>n?.().props;th(e,{get id(){return t.id},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get enabled(){return t.enabled},get ref(){return t.ref},children:(e,n)=>{var i=R(),u=N(i);{let e=k(()=>({props:Vf(l,o(),r(),a(),{style:{pointerEvents:c()}}),wrapperProps:s()}));H(u,()=>t.popper??w,()=>I(e))}z(e,i)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),z(e,d)},$$slots:{content:!0}}),O()}var Nv=new Set(`$$slots.$$events.$$legacy.popper.open.onEscapeKeydown.escapeKeydownBehavior.preventOverflowTextSelection.id.onPointerDown.onPointerUp.side.sideOffset.align.alignOffset.arrowPadding.avoidCollisions.collisionBoundary.collisionPadding.sticky.hideWhenDetached.updatePositionStrategy.strategy.dir.preventScroll.wrapperId.style.onPlaced.onInteractOutside.onCloseAutoFocus.onOpenAutoFocus.onFocusOutside.interactOutsideBehavior.loop.trapFocus.isValidEvent.customAnchor.isStatic.ref.shouldRender`.split(`.`));function Pv(e,t){let n=q(t,`interactOutsideBehavior`,3,`close`),r=q(t,`trapFocus`,3,!0),i=q(t,`isValidEvent`,3,()=>!1),a=q(t,`customAnchor`,3,null),o=q(t,`isStatic`,3,!1),s=G(t,Nv);var c=R(),l=N(c),u=e=>{Mv(e,K({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return a()},get isStatic(){return o()},get enabled(){return t.open},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return t.onFocusOutside},forceMount:!1,get ref(){return t.ref}},()=>s))};V(l,e=>{t.shouldRender&&e(u)}),z(e,c)}var Fv=new Set(`$$slots.$$events.$$legacy.popper.onEscapeKeydown.escapeKeydownBehavior.preventOverflowTextSelection.id.onPointerDown.onPointerUp.side.sideOffset.align.alignOffset.arrowPadding.avoidCollisions.collisionBoundary.collisionPadding.sticky.hideWhenDetached.updatePositionStrategy.strategy.dir.preventScroll.wrapperId.style.onPlaced.onInteractOutside.onCloseAutoFocus.onOpenAutoFocus.onFocusOutside.interactOutsideBehavior.loop.trapFocus.isValidEvent.customAnchor.isStatic.enabled`.split(`.`));function Iv(e,t){let n=q(t,`interactOutsideBehavior`,3,`close`),r=q(t,`trapFocus`,3,!0),i=q(t,`isValidEvent`,3,()=>!1),a=q(t,`customAnchor`,3,null),o=q(t,`isStatic`,3,!1),s=G(t,Fv);Mv(e,K({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return a()},get isStatic(){return o()},get enabled(){return t.enabled},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return t.onFocusOutside}},()=>s,{forceMount:!0}))}var Lv=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`forceMount`,`side`,`onInteractOutside`,`onEscapeKeydown`,`children`,`child`,`preventScroll`,`style`]),Rv=L(`<div><div><!></div></div>`);function zv(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`forceMount`,3,!1),o=q(t,`side`,3,`bottom`),s=q(t,`onInteractOutside`,3,Qp),c=q(t,`onEscapeKeydown`,3,Qp),l=q(t,`preventScroll`,3,!1),u=G(t,Lv),d=dv.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e)),onInteractOutside:J(()=>s()),onEscapeKeydown:J(()=>c())}),f=k(()=>Vf(u,d.props));var p=R(),m=N(p),h=e=>{Iv(e,K(()=>I(f),()=>d.popperProps,{get ref(){return d.opts.ref},get side(){return o()},get enabled(){return d.root.opts.open.current},get id(){return r()},get preventScroll(){return l()},forceMount:!0,get shouldRender(){return d.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Vf(r(),{style:d.props.style},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...d.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=Rv();Sa(n,()=>({...i()}));var r=M(n);Sa(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))},g=e=>{Pv(e,K(()=>I(f),()=>d.popperProps,{get ref(){return d.opts.ref},get side(){return o()},get open(){return d.root.opts.open.current},get id(){return r()},get preventScroll(){return l()},forceMount:!1,get shouldRender(){return d.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Vf(r(),{style:d.props.style},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...d.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=Rv();Sa(n,()=>({...i()}));var r=M(n);Sa(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))};V(m,e=>{a()?e(h):a()||e(g,1)}),z(e,p),O()}function Bv(e,t){D(t,!0);let n=q(t,`mounted`,15,!1),r=q(t,`onMountedChange`,3,Qp);fp(()=>(n(!0),r()(!0),()=>{n(!1),r()(!1)})),O()}var Vv=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`value`,`label`,`disabled`,`children`,`child`,`onHighlight`,`onUnhighlight`]),Hv=L(`<div><!></div>`),Uv=L(`<!> <!>`,1);function Wv(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`label`,19,()=>t.value),o=q(t,`disabled`,3,!1),s=q(t,`onHighlight`,3,Qp),c=q(t,`onUnhighlight`,3,Qp),l=G(t,Vv),u=fv.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e)),value:J(()=>t.value),disabled:J(()=>o()),label:J(()=>a()),onHighlight:J(()=>s()),onUnhighlight:J(()=>c())}),d=k(()=>Vf(l,u.props));var f=Uv(),p=N(f),m=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(d),...u.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},h=e=>{var n=Hv();Sa(n,()=>({...I(d)})),H(M(n),()=>t.children??w,()=>u.snippetProps),T(n),z(e,n)};V(p,e=>{t.child?e(m):e(h,-1)}),Bv(P(p,2),{get mounted(){return u.mounted},set mounted(e){u.mounted=e}}),z(e,f),O()}var Gv=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`children`,`child`]),Kv=L(`<div><!></div>`);function qv(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=G(t,Gv),o=mv.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),s=k(()=>Vf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=Kv();Sa(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var Jv=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`delay`,`child`,`children`]),Yv=L(`<div><!></div>`),Xv=L(`<!> <!>`,1);function Zv(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`delay`,3,()=>50),o=G(t,Jv),s=gv.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e)),delay:J(()=>a())}),c=k(()=>Vf(o,s.props));var l=R(),u=N(l),d=e=>{var n=Xv(),r=N(n);Bv(r,{get mounted(){return s.scrollButtonState.mounted},set mounted(e){s.scrollButtonState.mounted=e}});var i=P(r,2),a=e=>{var n=R();H(N(n),()=>t.child,()=>({props:o})),z(e,n)},l=e=>{var n=Yv();Sa(n,()=>({...I(c)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(i,e=>{t.child?e(a):e(l,-1)}),z(e,n)};V(u,e=>{s.canScrollDown&&e(d)}),z(e,l),O()}var Qv=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`delay`,`child`,`children`]),$v=L(`<div><!></div>`),ey=L(`<!> <!>`,1);function ty(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`delay`,3,()=>50),o=G(t,Qv),s=_v.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e)),delay:J(()=>a())}),c=k(()=>Vf(o,s.props));var l=R(),u=N(l),d=e=>{var n=ey(),r=N(n);Bv(r,{get mounted(){return s.scrollButtonState.mounted},set mounted(e){s.scrollButtonState.mounted=e}});var i=P(r,2),a=e=>{var n=R();H(N(n),()=>t.child,()=>({props:o})),z(e,n)},l=e=>{var n=$v();Sa(n,()=>({...I(c)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(i,e=>{t.child?e(a):e(l,-1)}),z(e,n)};V(u,e=>{s.canScrollUp&&e(d)}),z(e,l),O()}function ny(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`dir`,3,`ltr`),i=q(t,`onOpenChange`,3,Qp),a=q(t,`onOpenChangeComplete`,3,Qp),o=Wm.create({variant:J(()=>`context-menu`),dir:J(()=>r()),onClose:()=>{n(!1),i()?.(!1)}});Gm.create({open:J(()=>n(),e=>{n(e),i()(e)}),onOpenChangeComplete:J(()=>a())},o),Q_(e,{children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}}),O()}function ry(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`onOpenChange`,3,Qp),i=q(t,`onOpenChangeComplete`,3,Qp);hre.create({open:J(()=>n(),e=>{n(e),r()?.(e)}),onOpenChangeComplete:J(()=>i())}),Q_(e,{children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}}),O()}var iy=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`disabled`,`onSelect`,`closeOnSelect`]),ay=L(`<div><!></div>`);function oy(e,t){let n=Ai();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>$p(n)),a=q(t,`disabled`,3,!1),o=q(t,`onSelect`,3,Qp),s=q(t,`closeOnSelect`,3,!0),c=G(t,iy),l=cre.create({id:J(()=>i()),disabled:J(()=>a()),onSelect:J(()=>o()),ref:J(()=>r(),e=>r(e)),closeOnSelect:J(()=>s())}),u=k(()=>Vf(c,l.props));var d=R(),f=N(d),p=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(u)})),z(e,n)},m=e=>{var n=ay();Sa(n,()=>({...I(u)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(f,e=>{t.child?e(p):e(m,-1)}),z(e,d),O()}var sy=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),cy=L(`<div><!></div>`);function ly(e,t){let n=Ai();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>$p(n)),a=G(t,sy),o=ure.create({id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),s=k(()=>Vf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=cy();Sa(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var uy=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),dy=L(`<div><!></div>`);function fy(e,t){let n=Ai();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>$p(n)),a=G(t,uy),o=dre.create({id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),s=k(()=>Vf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=dy();Sa(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var py=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`child`,`children`,`ref`,`loop`,`onInteractOutside`,`onCloseAutoFocus`,`onOpenAutoFocus`,`preventScroll`,`side`,`sideOffset`,`align`,`onEscapeKeydown`,`forceMount`,`trapFocus`,`style`]),my=L(`<div><div><!></div></div>`);function hy(e,t){D(t,!0);let n=q(t,`id`,19,nh),r=q(t,`ref`,15,null),i=q(t,`loop`,3,!0),a=q(t,`onInteractOutside`,3,Qp),o=q(t,`onCloseAutoFocus`,3,Qp),s=q(t,`onOpenAutoFocus`,3,Qp),c=q(t,`preventScroll`,3,!0),l=q(t,`side`,3,`right`),u=q(t,`sideOffset`,3,2),d=q(t,`align`,3,`start`),f=q(t,`onEscapeKeydown`,3,Qp),p=q(t,`forceMount`,3,!1),m=q(t,`trapFocus`,3,!1),h=G(t,py),g=Km.create({id:J(()=>n()),loop:J(()=>i()),ref:J(()=>r(),e=>r(e)),onCloseAutoFocus:J(()=>o())}),_=k(()=>Vf(h,g.props,{side:l(),sideOffset:u(),align:d(),onOpenAutoFocus:s(),isValidEvent:b,trapFocus:m(),loop:i(),id:n(),ref:g.opts.ref,preventScroll:c(),onInteractOutside:v,onEscapeKeydown:y,shouldRender:g.shouldRender}));function v(e){if(a()(e),!e.defaultPrevented){if(e.target&&e.target instanceof Element){let t=`[${g.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t))return}g.parentMenu.onClose()}}function y(e){f()(e),!e.defaultPrevented&&g.parentMenu.onClose()}function b(e){if(`button`in e&&e.button===2){let t=e.target;return t?t.closest(`[${Im}]`)!==g.parentMenu.triggerNode:!1}return!1}var x=R(),S=N(x),ee=e=>{Iv(e,K(()=>I(_),()=>g.popperProps,{get enabled(){return g.parentMenu.opts.open.current},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Vf(r(),{style:L_(`context-menu`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...g.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=my();Sa(n,()=>({...i()}));var r=M(n);Sa(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))},C=e=>{Pv(e,K(()=>I(_),()=>g.popperProps,{get open(){return g.parentMenu.opts.open.current},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Vf(r(),{style:L_(`context-menu`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...g.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=my();Sa(n,()=>({...i()}));var r=M(n);Sa(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))};V(S,e=>{p()?e(ee):p()||e(C,1)}),z(e,x),O()}var gy=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`disabled`]),_y=L(`<div><!></div>`);function vy(e,t){D(t,!0);let n=q(t,`id`,19,nh),r=q(t,`ref`,15,null),i=q(t,`disabled`,3,!1),a=G(t,gy),o=mre.create({id:J(()=>n()),disabled:J(()=>i()),ref:J(()=>r(),e=>r(e))}),s=k(()=>Vf(a,o.props,{style:{pointerEvents:`auto`}},{style:t.style,tabindex:t.tabindex}));var c=R();U(N(c),()=>yv,(e,r)=>{r(e,{get id(){return n()},get virtualEl(){return o.virtualElement},get ref(){return o.opts.ref},children:(e,n)=>{var r=R(),i=N(r),a=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},o=e=>{var n=_y();Sa(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(i,e=>{t.child?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}})}),z(e,c),O()}var yy=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`child`,`children`]),by=L(`<div><!></div>`);function xy(e,t){let n=Ai();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>$p(n)),a=G(t,yy),o=fre.create({id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),s=k(()=>Vf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=by();Sa(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var Sy=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`children`,`child`,`loop`,`onInteractOutside`,`forceMount`,`onEscapeKeydown`,`interactOutsideBehavior`,`escapeKeydownBehavior`,`onOpenAutoFocus`,`onCloseAutoFocus`,`onFocusOutside`,`side`,`trapFocus`,`style`]),Cy=L(`<div><div><!></div></div>`);function wy(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`loop`,3,!0),o=q(t,`onInteractOutside`,3,Qp),s=q(t,`forceMount`,3,!1),c=q(t,`onEscapeKeydown`,3,Qp),l=q(t,`interactOutsideBehavior`,3,`defer-otherwise-close`),u=q(t,`escapeKeydownBehavior`,3,`defer-otherwise-close`),d=q(t,`onOpenAutoFocus`,3,Qp),f=q(t,`onCloseAutoFocus`,3,Qp),p=q(t,`onFocusOutside`,3,Qp),m=q(t,`side`,3,`right`),h=q(t,`trapFocus`,3,!1),g=G(t,Sy),_=Km.create({id:J(()=>r()),loop:J(()=>a()),ref:J(()=>i(),e=>i(e)),isSub:!0,onCloseAutoFocus:J(()=>S)});function v(e){let t=e.currentTarget.contains(e.target),n=Dne[_.parentMenu.root.opts.dir.current].includes(e.key);t&&n&&(_.parentMenu.onClose(),_.parentMenu.triggerNode?.focus(),e.preventDefault())}let y=k(()=>_.parentMenu.root.getBitsAttr(`sub-content`)),b=k(()=>Vf(g,_.props,{side:m(),onkeydown:v,[I(y)]:``}));function x(e){d()(e),!e.defaultPrevented&&(e.preventDefault(),_.parentMenu.root.isUsingKeyboard&&_.parentMenu.contentNode&&Vm.dispatch(_.parentMenu.contentNode))}function S(e){f()(e),!e.defaultPrevented&&e.preventDefault()}function ee(e){o()(e),!e.defaultPrevented&&_.parentMenu.onClose()}function C(e){c()(e),!e.defaultPrevented&&_.parentMenu.onClose()}function te(e){if(p()(e),e.defaultPrevented||!Gp(e.target)||e.target.id===_.parentMenu.triggerNode?.id)return;if((_.parentMenu.parentMenu?.contentNode)?.contains(e.target)){_.parentMenu.onClose(),e.preventDefault();return}let t=`[${_.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t)){e.preventDefault();return}_.parentMenu.onClose()}var ne=R(),re=N(ne),ie=e=>{Iv(e,K(()=>I(b),{get ref(){return _.opts.ref},get interactOutsideBehavior(){return l()},get escapeKeydownBehavior(){return u()},onOpenAutoFocus:x,get enabled(){return _.parentMenu.opts.open.current},onInteractOutside:ee,onEscapeKeydown:C,onFocusOutside:te,preventScroll:!1,get loop(){return a()},get trapFocus(){return h()},get shouldRender(){return _.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Vf(r(),I(b),{style:L_(`menu`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),..._.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=Cy();Sa(n,()=>({...i()}));var r=M(n);Sa(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))},ae=e=>{Pv(e,K(()=>I(b),{get ref(){return _.opts.ref},get interactOutsideBehavior(){return l()},get escapeKeydownBehavior(){return u()},onCloseAutoFocus:S,onOpenAutoFocus:x,get open(){return _.parentMenu.opts.open.current},onInteractOutside:ee,onEscapeKeydown:C,onFocusOutside:te,preventScroll:!1,get loop(){return a()},get trapFocus(){return h()},get shouldRender(){return _.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Vf(r(),I(b),{style:L_(`menu`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),..._.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=Cy();Sa(n,()=>({...i()}));var r=M(n);Sa(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))};V(re,e=>{s()?e(ie):s()||e(ae,1)}),z(e,ne),O()}var Ty=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`disabled`,`ref`,`children`,`child`,`onSelect`,`openDelay`]),Ey=L(`<div><!></div>`);function Dy(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`disabled`,3,!1),a=q(t,`ref`,15,null),o=q(t,`onSelect`,3,Qp),s=q(t,`openDelay`,3,0),c=G(t,Ty),l=lre.create({disabled:J(()=>i()),onSelect:J(()=>o()),id:J(()=>r()),ref:J(()=>a(),e=>a(e)),openDelay:J(()=>s())}),u=k(()=>Vf(c,l.props));yv(e,{get id(){return r()},get ref(){return l.opts.ref},children:(e,n)=>{var r=R(),i=N(r),a=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(u)})),z(e,n)},o=e=>{var n=Ey();Sa(n,()=>({...I(u)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(i,e=>{t.child?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}}),O()}function Oy(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]??[0,0],[c,l]=t[o]??[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function ky(e,t){return e[0]>=t.left&&e[0]<=t.right&&e[1]>=t.top&&e[1]<=t.bottom}function Ay(e,t){let n=e.left+e.width/2,r=e.top+e.height/2,i=t.left+t.width/2,a=t.top+t.height/2,o=i-n,s=a-r;return Math.abs(o)>Math.abs(s)?o>0?`right`:`left`:s>0?`bottom`:`top`}var jy=class{#e;#t;#n;#r=null;#i=null;#a=[];#o=null;#s=null;#c=null;#l(){this.#s!==null&&(cancelAnimationFrame(this.#s),this.#s=null)}#u(){this.#l(),this.#s=requestAnimationFrame(()=>{this.#s=null,!(!this.#r||!this.#i)&&(this.#m(),this.#e.onPointerExit())})}#d(){this.#c!==null&&(clearTimeout(this.#c),this.#c=null)}#f(){this.#n!==null&&(this.#d(),this.#c=window.setTimeout(()=>{this.#c=null,!(!this.#r||!this.#i)&&(this.#m(),this.#e.onPointerExit())},this.#n))}constructor(e){this.#e=e,this.#t=e.buffer??1;let t=e.transitIntentTimeout;this.#n=typeof t==`number`&&t>0?t:null,Qf([e.triggerNode,e.contentNode,e.enabled],([e,t,n])=>{if(!e||!t||!n){this.#o=null,this.#m();return}return this.#o&&this.#o!==e&&this.#m(),this.#o=e,[vi(wp(e),`pointermove`,n=>{this.#p([n.clientX,n.clientY],e,t)}),vi(e,`pointerleave`,e=>{let n=e.relatedTarget;if(Kp(n)&&t.contains(n))return;let r=this.#e.ignoredTargets?.()??[];Kp(n)&&r.some(e=>e===n||e.contains(n))||(this.#a=Kp(n)&&r.length>0?r.filter(e=>n.contains(e)):[],this.#r=[e.clientX,e.clientY],this.#i=`content`,this.#u())}),vi(e,`pointerenter`,()=>{this.#m()}),vi(t,`pointerenter`,()=>{this.#m()}),vi(t,`pointerleave`,t=>{let n=t.relatedTarget;Kp(n)&&e.contains(n)||(this.#r=[t.clientX,t.clientY],this.#i=`trigger`,this.#u())})].reduce((e,t)=>()=>{e(),t()},()=>{})})}#p(e,t,n){if(!this.#r||!this.#i)return;this.#l(),this.#f();let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();if(this.#i===`content`&&ky(e,i)){this.#m();return}if(this.#i===`trigger`&&ky(e,r)){this.#m();return}if(this.#i===`content`&&this.#a.length>0)for(let t of this.#a){let n=t.getBoundingClientRect();if(ky(e,n))return;let i=Ay(r,n),a=this.#h(r,n,i);if(a&&Oy(e,a))return}let a=Ay(r,i),o=this.#h(r,i,a);if(o&&Oy(e,o))return;let s=this.#i===`content`?i:r;Oy(e,this.#g(this.#r,s,a,this.#i))||(this.#m(),this.#e.onPointerExit())}#m(){this.#r=null,this.#i=null,this.#a=[],this.#l(),this.#d()}#h(e,t,n){let r=this.#t;switch(n){case`top`:return[[Math.min(e.left,t.left)-r,e.top],[Math.min(e.left,t.left)-r,t.bottom],[Math.max(e.right,t.right)+r,t.bottom],[Math.max(e.right,t.right)+r,e.top]];case`bottom`:return[[Math.min(e.left,t.left)-r,e.bottom],[Math.min(e.left,t.left)-r,t.top],[Math.max(e.right,t.right)+r,t.top],[Math.max(e.right,t.right)+r,e.bottom]];case`left`:return[[e.left,Math.min(e.top,t.top)-r],[t.right,Math.min(e.top,t.top)-r],[t.right,Math.max(e.bottom,t.bottom)+r],[e.left,Math.max(e.bottom,t.bottom)+r]];case`right`:return[[e.right,Math.min(e.top,t.top)-r],[t.left,Math.min(e.top,t.top)-r],[t.left,Math.max(e.bottom,t.bottom)+r],[e.right,Math.max(e.bottom,t.bottom)+r]]}}#g(e,t,n,r){let i=this.#t*4,[a,o]=e;switch(r===`trigger`?this.#_(n):n){case`top`:return[[a-i,o+i],[a+i,o+i],[t.right+i,t.bottom],[t.right+i,t.top],[t.left-i,t.top],[t.left-i,t.bottom]];case`bottom`:return[[a-i,o-i],[a+i,o-i],[t.right+i,t.top],[t.right+i,t.bottom],[t.left-i,t.bottom],[t.left-i,t.top]];case`left`:return[[a+i,o-i],[a+i,o+i],[t.right,t.bottom+i],[t.left,t.bottom+i],[t.left,t.top-i],[t.right,t.top-i]];case`right`:return[[a-i,o-i],[a-i,o+i],[t.left,t.bottom+i],[t.right,t.bottom+i],[t.right,t.top-i],[t.left,t.top-i]]}}#_(e){switch(e){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`}}},My=Fp({component:`popover`,parts:[`root`,`trigger`,`content`,`close`,`overlay`]}),Ny=new qf(`Popover.Root`),Py=class e{static create(t){return Ny.set(new e(t))}opts;#e=A(null);get contentNode(){return I(this.#e)}set contentNode(e){j(this.#e,e,!0)}contentPresence;#t=A(null);get triggerNode(){return I(this.#t)}set triggerNode(e){j(this.#t,e,!0)}#n=A(null);get overlayNode(){return I(this.#n)}set overlayNode(e){j(this.#n,e,!0)}overlayPresence;#r=A(!1);get openedViaHover(){return I(this.#r)}set openedViaHover(e){j(this.#r,e,!0)}#i=A(!1);get hasInteractedWithContent(){return I(this.#i)}set hasInteractedWithContent(e){j(this.#i,e,!0)}#a=A(!1);get hoverCooldown(){return I(this.#a)}set hoverCooldown(e){j(this.#a,e,!0)}#o=A(0);get closeDelay(){return I(this.#o)}set closeDelay(e){j(this.#o,e,!0)}#s=null;#c=null;constructor(e){this.opts=e,this.contentPresence=new Zp({ref:J(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new Zp({ref:J(()=>this.overlayNode),open:this.opts.open}),Qf(()=>this.opts.open.current,e=>{e||(this.openedViaHover=!1,this.hasInteractedWithContent=!1,this.#l())})}setDomContext(e){this.#c=e}#l(){this.#s!==null&&this.#c&&(this.#c.clearTimeout(this.#s),this.#s=null)}toggleOpen(){this.#l(),this.opts.open.current=!this.opts.open.current}handleClose(){this.#l(),this.opts.open.current&&(this.opts.open.current=!1)}handleHoverOpen(){this.#l(),!this.opts.open.current&&(this.openedViaHover=!0,this.opts.open.current=!0)}handleHoverClose(){this.opts.open.current&&this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1)}handleDelayedHoverClose(){this.opts.open.current&&(!this.openedViaHover||this.hasInteractedWithContent||(this.#l(),this.closeDelay<=0?this.opts.open.current=!1:this.#c&&(this.#s=this.#c.setTimeout(()=>{this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1),this.#s=null},this.closeDelay))))}cancelDelayedClose(){this.#l()}markInteraction(){this.hasInteractedWithContent=!0,this.#l()}},Fy=class e{static create(t){return new e(t,Ny.get())}opts;root;attachment;domContext;#e=null;#t=null;#n=A(!1);constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(this.opts.ref,e=>this.root.triggerNode=e),this.domContext=new Dp(e.ref),this.root.setDomContext(this.domContext),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),Qf(()=>this.opts.closeDelay.current,e=>{this.root.closeDelay=e})}#r(){this.#e!==null&&(this.domContext.clearTimeout(this.#e),this.#e=null)}#i(){this.#t!==null&&(this.domContext.clearTimeout(this.#t),this.#t=null)}#a(){this.#r(),this.#i()}onpointerenter(e){if(this.opts.disabled.current||!this.opts.openOnHover.current||Jp(e)||(j(this.#n,!0),this.#i(),this.root.cancelDelayedClose(),this.root.opts.open.current||this.root.hoverCooldown))return;let t=this.opts.openDelay.current;t<=0?this.root.handleHoverOpen():this.#e=this.domContext.setTimeout(()=>{this.root.handleHoverOpen(),this.#e=null},t)}onpointerleave(e){this.opts.disabled.current||this.opts.openOnHover.current&&(Jp(e)||(j(this.#n,!1),this.#r(),this.root.hoverCooldown=!1))}onclick(e){if(!this.opts.disabled.current&&e.button===0){if(this.#a(),I(this.#n)&&this.root.opts.open.current&&this.root.openedViaHover){this.root.openedViaHover=!1,this.root.hasInteractedWithContent=!0;return}I(this.#n)&&this.opts.openOnHover.current&&this.root.opts.open.current&&(this.root.hoverCooldown=!0),this.root.hoverCooldown&&!this.root.opts.open.current&&(this.root.hoverCooldown=!1),this.root.toggleOpen()}}onkeydown(e){this.opts.disabled.current||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.#a(),this.root.toggleOpen())}#o(){if(this.root.opts.open.current&&this.root.contentNode?.id)return this.root.contentNode?.id}#s=k(()=>({id:this.opts.id.current,"aria-haspopup":`dialog`,"aria-expanded":kp(this.root.opts.open.current),"data-state":Mp(this.root.opts.open.current),"aria-controls":this.#o(),[My.trigger]:``,disabled:this.opts.disabled.current,onkeydown:this.onkeydown,onclick:this.onclick,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return I(this.#s)}set props(e){j(this.#s,e)}},Iy=class e{static create(t){return new e(t,Ny.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(this.opts.ref,e=>this.root.contentNode=e),this.onpointerdown=this.onpointerdown.bind(this),this.onfocusin=this.onfocusin.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),new jy({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&this.root.openedViaHover&&!this.root.hasInteractedWithContent,onPointerExit:()=>{this.root.handleDelayedHoverClose()}})}onpointerdown(e){this.root.markInteraction()}onfocusin(e){let t=e.target;Kp(t)&&km(t)&&this.root.markInteraction()}onpointerenter(e){Jp(e)||this.root.cancelDelayedClose()}onpointerleave(e){Jp(e)}onInteractOutside=e=>{if(this.opts.onInteractOutside.current(e),e.defaultPrevented||!Kp(e.target))return;let t=e.target.closest(My.selector(`trigger`));if(!(t&&t===this.root.triggerNode)){if(this.opts.customAnchor.current){if(Kp(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(e.target))return}else if(typeof this.opts.customAnchor.current==`string`){let t=document.querySelector(this.opts.customAnchor.current);if(t&&t.contains(e.target))return}}this.root.handleClose()}};onEscapeKeydown=e=>{this.opts.onEscapeKeydown.current(e),!e.defaultPrevented&&this.root.handleClose()};get shouldRender(){return this.root.contentPresence.shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}#e=k(()=>({open:this.root.opts.open.current}));get snippetProps(){return I(this.#e)}set snippetProps(e){j(this.#e,e)}#t=k(()=>({id:this.opts.id.current,tabindex:-1,"data-state":Mp(this.root.opts.open.current),...Np(this.root.contentPresence.transitionStatus),[My.content]:``,style:{pointerEvents:`auto`,contain:`layout style`},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown}},Ly=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`forceMount`,`onOpenAutoFocus`,`onCloseAutoFocus`,`onEscapeKeydown`,`onInteractOutside`,`trapFocus`,`preventScroll`,`customAnchor`,`style`]),Ry=L(`<div><div><!></div></div>`);function zy(e,t){let n=Ai();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>$p(n)),a=q(t,`forceMount`,3,!1),o=q(t,`onOpenAutoFocus`,3,Qp),s=q(t,`onCloseAutoFocus`,3,Qp),c=q(t,`onEscapeKeydown`,3,Qp),l=q(t,`onInteractOutside`,3,Qp),u=q(t,`trapFocus`,3,!0),d=q(t,`preventScroll`,3,!1),f=q(t,`customAnchor`,3,null),p=G(t,Ly),m=Iy.create({id:J(()=>i()),ref:J(()=>r(),e=>r(e)),onInteractOutside:J(()=>l()),onEscapeKeydown:J(()=>c()),customAnchor:J(()=>f())}),h=k(()=>Vf(p,m.props)),g=k(()=>u()&&m.shouldTrapFocus);function _(e){m.shouldTrapFocus||e.preventDefault(),o()(e)}var v=R(),y=N(v),b=e=>{Iv(e,K(()=>I(h),()=>m.popperProps,{get ref(){return m.opts.ref},get enabled(){return m.root.opts.open.current},get id(){return i()},get trapFocus(){return I(g)},get preventScroll(){return d()},loop:!0,forceMount:!0,get customAnchor(){return f()},onOpenAutoFocus:_,get onCloseAutoFocus(){return s()},get shouldRender(){return m.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Vf(r(),{style:L_(`popover`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...m.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=Ry();Sa(n,()=>({...i()}));var r=M(n);Sa(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))},x=e=>{Pv(e,K(()=>I(h),()=>m.popperProps,{get ref(){return m.opts.ref},get open(){return m.root.opts.open.current},get id(){return i()},get trapFocus(){return I(g)},get preventScroll(){return d()},loop:!0,forceMount:!1,get customAnchor(){return f()},onOpenAutoFocus:_,get onCloseAutoFocus(){return s()},get shouldRender(){return m.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Vf(r(),{style:L_(`popover`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...m.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=Ry();Sa(n,()=>({...i()}));var r=M(n);Sa(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))};V(y,e=>{a()?e(b):a()||e(x,1)}),z(e,v),O()}var By=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`type`,`disabled`,`openOnHover`,`openDelay`,`closeDelay`]),Vy=L(`<button><!></button>`);function Hy(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`type`,3,`button`),o=q(t,`disabled`,3,!1),s=q(t,`openOnHover`,3,!1),c=q(t,`openDelay`,3,700),l=q(t,`closeDelay`,3,300),u=G(t,By),d=Fy.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e)),disabled:J(()=>!!o()),openOnHover:J(()=>s()),openDelay:J(()=>c()),closeDelay:J(()=>l())}),f=k(()=>Vf(u,d.props,{type:a()}));yv(e,{get id(){return r()},get ref(){return d.opts.ref},children:(e,n)=>{var r=R(),i=N(r),a=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(f)})),z(e,n)},o=e=>{var n=Vy();Sa(n,()=>({...I(f)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(i,e=>{t.child?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}}),O()}var Uy=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function Wy(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Uy);Tv(e,K(()=>r,{"data-popover-arrow":``,get ref(){return n()},set ref(e){n(e)}})),O()}function Gy(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`onOpenChange`,3,Qp),i=q(t,`onOpenChangeComplete`,3,Qp);tm.create({variant:J(()=>`dialog`),open:J(()=>n(),e=>{n(e),r()(e)}),onOpenChangeComplete:J(()=>i())});var a=R();H(N(a),()=>t.children??w),z(e,a),O()}var Ky=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`disabled`]),qy=L(`<button><!></button>`);function Jy(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`disabled`,3,!1),o=G(t,Ky),s=ene.create({variant:J(()=>`close`),id:J(()=>r()),ref:J(()=>i(),e=>i(e)),disabled:J(()=>!!a())}),c=k(()=>Vf(o,s.props));var l=R(),u=N(l),d=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(c)})),z(e,n)},f=e=>{var n=qy();Sa(n,()=>({...I(c)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(u,e=>{t.child?e(d):e(f,-1)}),z(e,l),O()}var Yy=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`,`forceMount`,`onCloseAutoFocus`,`onOpenAutoFocus`,`onEscapeKeydown`,`onInteractOutside`,`trapFocus`,`preventScroll`,`restoreScrollDelay`]),Xy=L(`<!> <!>`,1),Zy=L(`<!> <div><!></div>`,1);function Qy(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`forceMount`,3,!1),o=q(t,`onCloseAutoFocus`,3,Qp),s=q(t,`onOpenAutoFocus`,3,Qp),c=q(t,`onEscapeKeydown`,3,Qp),l=q(t,`onInteractOutside`,3,Qp),u=q(t,`trapFocus`,3,!0),d=q(t,`preventScroll`,3,!0),f=q(t,`restoreScrollDelay`,3,null),p=G(t,Yy),m=nm.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),h=k(()=>Vf(p,m.props));var g=R(),_=N(g),v=e=>{Zm(e,{get ref(){return m.opts.ref},loop:!0,get trapFocus(){return u()},get enabled(){return m.root.opts.open.current},get onOpenAutoFocus(){return s()},get onCloseAutoFocus(){return o()},focusScope:(e,n)=>{let r=()=>n?.().props;Xm(e,K(()=>I(h),{get enabled(){return m.root.opts.open.current},get ref(){return m.opts.ref},onEscapeKeydown:e=>{c()(e),!e.defaultPrevented&&m.root.handleClose()},children:(e,n)=>{Ym(e,K(()=>I(h),{get ref(){return m.opts.ref},get enabled(){return m.root.opts.open.current},onInteractOutside:e=>{l()(e),!e.defaultPrevented&&m.root.handleClose()},children:(e,n)=>{th(e,K(()=>I(h),{get ref(){return m.opts.ref},get enabled(){return m.root.opts.open.current},children:(e,n)=>{var i=R(),a=N(i),o=e=>{var n=Xy(),i=N(n),a=e=>{dh(e,{get preventScroll(){return d()},get restoreScrollDelay(){return f()}})};V(i,e=>{m.root.opts.open.current&&e(a)});var o=P(i,2);{let e=k(()=>({props:Vf(I(h),r()),...m.snippetProps}));H(o,()=>t.child,()=>I(e))}z(e,n)},s=e=>{var n=Zy(),i=N(n);dh(i,{get preventScroll(){return d()}});var a=P(i,2);Sa(a,e=>({...e}),[()=>Vf(I(h),r())]),H(M(a),()=>t.children??w),T(a),z(e,n)};V(a,e=>{t.child?e(o):e(s,-1)}),z(e,i)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};V(_,e=>{(m.shouldRender||a())&&e(v)}),z(e,g),O()}function $y(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`dir`,3,`ltr`),i=q(t,`onOpenChange`,3,Qp),a=q(t,`onOpenChangeComplete`,3,Qp),o=q(t,`_internal_variant`,3,`dropdown-menu`),s=q(t,`_internal_should_skip_exit_animation`,3,void 0),c=Wm.create({variant:J(()=>o()),dir:J(()=>r()),onClose:()=>{n(!1),i()(!1)},shouldSkipExitAnimation:()=>s()?.()??!1});Gm.create({open:J(()=>n(),e=>{n(e),i()(e)}),onOpenChangeComplete:J(()=>a())},c),Q_(e,{children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}}),O()}var eb=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`child`,`children`,`ref`,`loop`,`onInteractOutside`,`onEscapeKeydown`,`onCloseAutoFocus`,`forceMount`,`trapFocus`,`style`]),tb=L(`<div><div><!></div></div>`);function nb(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`loop`,3,!0),o=q(t,`onInteractOutside`,3,Qp),s=q(t,`onEscapeKeydown`,3,Qp),c=q(t,`onCloseAutoFocus`,3,Qp),l=q(t,`forceMount`,3,!1),u=q(t,`trapFocus`,3,!1),d=G(t,eb),f=Km.create({id:J(()=>r()),loop:J(()=>a()),ref:J(()=>i(),e=>i(e)),onCloseAutoFocus:J(()=>c())}),p=k(()=>Vf(d,f.props));function m(e){if(f.handleInteractOutside(e),!e.defaultPrevented&&(o()(e),!e.defaultPrevented)){if(e.target&&e.target instanceof Element){let t=`[${f.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t))return}f.parentMenu.onClose()}}function h(e){s()(e),!e.defaultPrevented&&f.parentMenu.onClose()}var g=R(),_=N(g),v=e=>{Iv(e,K(()=>I(p),()=>f.popperProps,{get ref(){return f.opts.ref},get enabled(){return f.parentMenu.opts.open.current},onInteractOutside:m,onEscapeKeydown:h,get trapFocus(){return u()},get loop(){return a()},forceMount:!0,get id(){return r()},get shouldRender(){return f.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Vf(r(),{style:L_(`dropdown-menu`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...f.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=tb();Sa(n,()=>({...i()}));var r=M(n);Sa(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))},y=e=>{Pv(e,K(()=>I(p),()=>f.popperProps,{get ref(){return f.opts.ref},get open(){return f.parentMenu.opts.open.current},onInteractOutside:m,onEscapeKeydown:h,get trapFocus(){return u()},get loop(){return a()},forceMount:!1,get id(){return r()},get shouldRender(){return f.shouldRender},popper:(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Vf(r(),{style:L_(`dropdown-menu`)},{style:t.style}));var o=R(),s=N(o),c=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(a),wrapperProps:i(),...f.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},l=e=>{var n=tb();Sa(n,()=>({...i()}));var r=M(n);Sa(r,()=>({...I(a)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o)},$$slots:{popper:!0}}))};V(_,e=>{l()?e(v):l()||e(y,1)}),z(e,g),O()}var rb=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`disabled`,`type`]),ib=L(`<button><!></button>`);function ab(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`disabled`,3,!1),o=q(t,`type`,3,`button`),s=G(t,rb),c=pre.create({id:J(()=>r()),disabled:J(()=>a()??!1),ref:J(()=>i(),e=>i(e))}),l=k(()=>Vf(s,c.props,{type:o()}));yv(e,{get id(){return r()},get ref(){return c.opts.ref},children:(e,n)=>{var r=R(),i=N(r),a=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(l)})),z(e,n)},o=e=>{var n=ib();Sa(n,()=>({...I(l)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(i,e=>{t.child?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}}),O()}var ob=Fp({component:`label`,parts:[`root`]}),sb=class e{static create(t){return new e(t)}opts;attachment;constructor(e){this.opts=e,this.attachment=Op(this.opts.ref),this.onmousedown=this.onmousedown.bind(this)}onmousedown(e){e.detail>1&&e.preventDefault()}#e=k(()=>({id:this.opts.id.current,[ob.root]:``,onmousedown:this.onmousedown,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},cb=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`for`]),lb=L(`<label><!></label>`);function ub(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=G(t,cb),o=sb.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),s=k(()=>Vf(a,o.props,{for:t.for}));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=lb();Sa(n,()=>({...I(s),for:t.for})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var db=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t,this.handler=this.handler.bind(this),sr(this.handler)}handler(){let e=0,t=this.#e();if(!t)return;let n=new ResizeObserver(()=>{cancelAnimationFrame(e),e=window.requestAnimationFrame(this.#t)});return n.observe(t),()=>{window.cancelAnimationFrame(e),n.unobserve(t)}}},fb=class{opts;present;#e;#t=A(!1);#n=!1;#r=A(void 0);#i=null;constructor(e){this.opts=e,this.present=this.opts.open,j(this.#t,e.open.current,!0),this.#e=new Xp({ref:this.opts.ref,afterTick:this.opts.open}),dp(()=>this.#o()),Qf(()=>this.present.current,e=>{if(!this.#n){this.#n=!0;return}this.#o(),e&&j(this.#t,!0),j(this.#r,e?`starting`:`ending`,!0),e&&(this.#i=window.requestAnimationFrame(()=>{this.#i=null,this.present.current&&j(this.#r,void 0)})),this.#e.run(()=>{e===this.present.current&&(e||j(this.#t,!1),j(this.#r,void 0))})})}#a=k(()=>I(this.#t));get isPresent(){return I(this.#a)}set isPresent(e){j(this.#a,e)}get transitionStatus(){return I(this.#r)}#o(){this.#i!==null&&(window.cancelAnimationFrame(this.#i),this.#i=null)}};function pb(e,t){D(t,!0);let n=new fb({open:J(()=>t.open),ref:t.ref});var r=R(),i=N(r),a=e=>{var r=R();H(N(r),()=>t.presence??w,()=>({present:n.isPresent,transitionStatus:n.transitionStatus})),z(e,r)};V(i,e=>{(t.forceMount||t.open||n.isPresent)&&e(a)}),z(e,r),O()}function mb(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`onOpenChange`,3,Qp),i=q(t,`onOpenChangeComplete`,3,Qp);Py.create({open:J(()=>n(),e=>{n(e),r()(e)}),onOpenChangeComplete:J(()=>i())}),Q_(e,{children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}}),O()}var hb=Fp({component:`progress`,parts:[`root`]}),gb=class e{static create(t){return new e(t)}opts;attachment;constructor(e){this.opts=e,this.attachment=Op(this.opts.ref)}#e=k(()=>({role:`progressbar`,value:this.opts.value.current,"aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":this.opts.value.current===null?void 0:this.opts.value.current,"data-value":this.opts.value.current===null?void 0:this.opts.value.current,"data-state":_b(this.opts.value.current,this.opts.max.current),"data-max":this.opts.max.current,"data-min":this.opts.min.current,"data-indeterminate":this.opts.value.current===null?``:void 0,[hb.root]:``,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}};function _b(e,t){return e===null?`indeterminate`:e===t?`loaded`:`loading`}var vb=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`value`,`max`,`min`,`id`,`ref`]),yb=L(`<div><!></div>`);function bb(e,t){let n=Ai();D(t,!0);let r=q(t,`value`,3,0),i=q(t,`max`,3,100),a=q(t,`min`,3,0),o=q(t,`id`,19,()=>$p(n)),s=q(t,`ref`,15,null),c=G(t,vb),l=gb.create({value:J(()=>r()),max:J(()=>i()),min:J(()=>a()),id:J(()=>o()),ref:J(()=>s(),e=>s(e))}),u=k(()=>Vf(c,l.props));var d=R(),f=N(d),p=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(u)})),z(e,n)},m=e=>{var n=yb();Sa(n,()=>({...I(u)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(f,e=>{t.child?e(p):e(m,-1)}),z(e,d),O()}var xb=Fp({component:`radio-group`,parts:[`root`,`item`]}),Sb=new qf(`RadioGroup.Root`),Cb=class e{static create(t){return Sb.set(new e(t))}opts;#e=k(()=>this.opts.value.current!==``);get hasValue(){return I(this.#e)}set hasValue(e){j(this.#e,e)}rovingFocusGroup;attachment;constructor(e){this.opts=e,this.attachment=Op(this.opts.ref),this.rovingFocusGroup=new Yp({rootNode:this.opts.ref,candidateAttr:xb.item,loop:this.opts.loop,orientation:this.opts.orientation})}isChecked(e){return this.opts.value.current===e}setValue(e){this.opts.value.current=e}#t=k(()=>({id:this.opts.id.current,role:`radiogroup`,"aria-required":kp(this.opts.required.current),"aria-disabled":kp(this.opts.disabled.current),"aria-readonly":this.opts.readonly.current?`true`:void 0,"data-disabled":Ap(this.opts.disabled.current),"data-readonly":Ap(this.opts.readonly.current),"data-orientation":this.opts.orientation.current,[xb.root]:``,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},wb=class e{static create(t){return new e(t,Sb.get())}opts;root;attachment;#e=k(()=>this.root.opts.value.current===this.opts.value.current);get checked(){return I(this.#e)}set checked(e){j(this.#e,e)}#t=k(()=>this.opts.disabled.current||this.root.opts.disabled.current);#n=k(()=>this.root.opts.readonly.current);#r=k(()=>this.root.isChecked(this.opts.value.current));#i=A(-1);constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(this.opts.ref),this.opts.value.current===this.root.opts.value.current?(this.root.rovingFocusGroup.setCurrentTabStopId(this.opts.id.current),j(this.#i,0)):this.root.opts.value.current||j(this.#i,0),sr(()=>{j(this.#i,this.root.rovingFocusGroup.getTabIndex(this.opts.ref.current),!0)}),Qf([()=>this.opts.value.current,()=>this.root.opts.value.current],()=>{this.opts.value.current===this.root.opts.value.current&&(this.root.rovingFocusGroup.setCurrentTabStopId(this.opts.id.current),j(this.#i,0))}),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onfocus=this.onfocus.bind(this)}onclick(e){this.opts.disabled.current||I(this.#n)||this.root.setValue(this.opts.value.current)}onfocus(e){!this.root.hasValue||I(this.#n)||this.root.setValue(this.opts.value.current)}onkeydown(e){if(!I(this.#t)){if(e.key===` `){e.preventDefault(),I(this.#n)||this.root.setValue(this.opts.value.current);return}this.root.rovingFocusGroup.handleKeydown(this.opts.ref.current,e,!0)}}#a=k(()=>({checked:I(this.#r)}));get snippetProps(){return I(this.#a)}set snippetProps(e){j(this.#a,e)}#o=k(()=>({id:this.opts.id.current,disabled:I(this.#t)?!0:void 0,"data-value":this.opts.value.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":Ap(I(this.#t)),"data-readonly":Ap(I(this.#n)),"data-state":I(this.#r)?`checked`:`unchecked`,"aria-checked":Pp(I(this.#r),!1),[xb.item]:``,type:`button`,role:`radio`,tabindex:I(this.#i),onkeydown:this.onkeydown,onfocus:this.onfocus,onclick:this.onclick,...this.attachment}));get props(){return I(this.#o)}set props(e){j(this.#o,e)}},Tb=class e{static create(){return new e(Sb.get())}root;#e=k(()=>this.root.opts.name.current!==void 0);get shouldRender(){return I(this.#e)}set shouldRender(e){j(this.#e,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){this.root.rovingFocusGroup.focusCurrentTabStop()}#t=k(()=>({name:this.root.opts.name.current,value:this.root.opts.value.current,required:this.root.opts.required.current,disabled:this.root.opts.disabled.current,onfocus:this.onfocus}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}};function Eb(e,t){D(t,!1);let n=Tb.create();ja();var r=R(),i=N(r),a=e=>{Ah(e,K(()=>n.props))};V(i,e=>{n.shouldRender&&e(a)}),z(e,r),O()}var Db=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`children`,`child`,`value`,`ref`,`orientation`,`loop`,`name`,`required`,`readonly`,`id`,`onValueChange`]),Ob=L(`<div><!></div>`),kb=L(`<!> <!>`,1);function Ab(e,t){let n=Ai();D(t,!0);let r=q(t,`disabled`,3,!1),i=q(t,`value`,15,``),a=q(t,`ref`,15,null),o=q(t,`orientation`,3,`vertical`),s=q(t,`loop`,3,!0),c=q(t,`name`,3,void 0),l=q(t,`required`,3,!1),u=q(t,`readonly`,3,!1),d=q(t,`id`,19,()=>$p(n)),f=q(t,`onValueChange`,3,Qp),p=G(t,Db),m=Cb.create({orientation:J(()=>o()),disabled:J(()=>r()),loop:J(()=>s()),name:J(()=>c()),required:J(()=>l()),readonly:J(()=>u()),id:J(()=>d()),value:J(()=>i(),e=>{e!==i()&&(i(e),f()?.(e))}),ref:J(()=>a(),e=>a(e))}),h=k(()=>Vf(p,m.props));var g=kb(),_=N(g),v=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(h)})),z(e,n)},y=e=>{var n=Ob();Sa(n,()=>({...I(h)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(_,e=>{t.child?e(v):e(y,-1)}),Eb(P(_,2),{}),z(e,g),O()}var jb=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`value`,`disabled`,`ref`]),Mb=L(`<button><!></button>`);function Nb(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`disabled`,3,!1),a=q(t,`ref`,15,null),o=G(t,jb),s=wb.create({value:J(()=>t.value),disabled:J(()=>i()??!1),id:J(()=>r()),ref:J(()=>a(),e=>a(e))}),c=k(()=>Vf(o,s.props));var l=R(),u=N(l),d=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(c),...s.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},f=e=>{var n=Mb();Sa(n,()=>({...I(c)})),H(M(n),()=>t.children??w,()=>s.snippetProps),T(n),z(e,n)};V(u,e=>{t.child?e(d):e(f,-1)}),z(e,l),O()}function Pb(e,t,n){return Math.min(n,Math.max(t,e))}var Fb=class{state;#e;constructor(e,t){this.state=Sf(e),this.#e=t,this.dispatch=this.dispatch.bind(this)}#t(e){return this.#e[this.state.current][e]??this.state.current}dispatch(e){this.state.current=this.#t(e)}},Ib=Fp({component:`scroll-area`,parts:[`root`,`viewport`,`corner`,`thumb`,`scrollbar`]}),Lb=new qf(`ScrollArea.Root`),Rb=new qf(`ScrollArea.Scrollbar`),zb=new qf(`ScrollArea.ScrollbarVisible`),Bb=new qf(`ScrollArea.ScrollbarAxis`),Vb=new qf(`ScrollArea.ScrollbarShared`),Hb=class e{static create(t){return Lb.set(new e(t))}opts;attachment;#e=A(null);get scrollAreaNode(){return I(this.#e)}set scrollAreaNode(e){j(this.#e,e,!0)}#t=A(null);get viewportNode(){return I(this.#t)}set viewportNode(e){j(this.#t,e,!0)}#n=A(null);get contentNode(){return I(this.#n)}set contentNode(e){j(this.#n,e,!0)}#r=A(null);get scrollbarXNode(){return I(this.#r)}set scrollbarXNode(e){j(this.#r,e,!0)}#i=A(null);get scrollbarYNode(){return I(this.#i)}set scrollbarYNode(e){j(this.#i,e,!0)}#a=A(0);get cornerWidth(){return I(this.#a)}set cornerWidth(e){j(this.#a,e,!0)}#o=A(0);get cornerHeight(){return I(this.#o)}set cornerHeight(e){j(this.#o,e,!0)}#s=A(!1);get scrollbarXEnabled(){return I(this.#s)}set scrollbarXEnabled(e){j(this.#s,e,!0)}#c=A(!1);get scrollbarYEnabled(){return I(this.#c)}set scrollbarYEnabled(e){j(this.#c,e,!0)}domContext;constructor(e){this.opts=e,this.attachment=Op(e.ref,e=>this.scrollAreaNode=e),this.domContext=new Dp(e.ref)}#l=k(()=>({id:this.opts.id.current,dir:this.opts.dir.current,style:{position:`relative`,"--bits-scroll-area-corner-height":`${this.cornerHeight}px`,"--bits-scroll-area-corner-width":`${this.cornerWidth}px`},[Ib.root]:``,...this.attachment}));get props(){return I(this.#l)}set props(e){j(this.#l,e)}},Ub=class e{static create(t){return new e(t,Lb.get())}opts;root;attachment;#e=Sf(nh());#t=Sf(null);contentAttachment=Op(this.#t,e=>this.root.contentNode=e);constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(e.ref,e=>this.root.viewportNode=e)}#n=k(()=>({id:this.opts.id.current,style:{overflowX:this.root.scrollbarXEnabled?`scroll`:`hidden`,overflowY:this.root.scrollbarYEnabled?`scroll`:`hidden`},[Ib.viewport]:``,...this.attachment}));get props(){return I(this.#n)}set props(e){j(this.#n,e)}#r=k(()=>({id:this.#e.current,"data-scroll-area-content":``,style:{minWidth:this.root.scrollbarXEnabled?`fit-content`:void 0},...this.contentAttachment}));get contentProps(){return I(this.#r)}set contentProps(e){j(this.#r,e)}},Wb=class e{static create(t){return Rb.set(new e(t,Lb.get()))}opts;root;#e=k(()=>this.opts.orientation.current===`horizontal`);get isHorizontal(){return I(this.#e)}set isHorizontal(e){j(this.#e,e)}#t=A(!1);get hasThumb(){return I(this.#t)}set hasThumb(e){j(this.#t,e,!0)}constructor(e,t){this.opts=e,this.root=t,Qf(()=>this.isHorizontal,e=>e?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}},Gb=class e{static create(){return new e(Rb.get())}scrollbar;root;#e=A(!1);get isVisible(){return I(this.#e)}set isVisible(e){j(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,sr(()=>{let e=this.root.scrollAreaNode,t=this.root.opts.scrollHideDelay.current,n=0;if(!e)return;let r=Pf(vi(e,`pointerenter`,()=>{this.root.domContext.clearTimeout(n),ei(()=>this.isVisible=!0)}),vi(e,`pointerleave`,()=>{n&&this.root.domContext.clearTimeout(n),n=this.root.domContext.setTimeout(()=>{ei(()=>{this.scrollbar.hasThumb=!1,this.isVisible=!1})},t)}));return()=>{this.root.domContext.getWindow().clearTimeout(n),r()}})}#t=k(()=>({"data-state":this.isVisible?`visible`:`hidden`}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},Kb=class e{static create(){return new e(Rb.get())}scrollbar;root;machine=new Fb(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});#e=k(()=>this.machine.state.current===`hidden`);get isHidden(){return I(this.#e)}set isHidden(e){j(this.#e,e)}constructor(e){this.scrollbar=e,this.root=e.root;let t=Jf(()=>this.machine.dispatch(`SCROLL_END`),100);sr(()=>{let e=this.machine.state.current,t=this.root.opts.scrollHideDelay.current;if(e===`idle`){let e=this.root.domContext.setTimeout(()=>this.machine.dispatch(`HIDE`),t);return()=>this.root.domContext.clearTimeout(e)}}),sr(()=>{let e=this.root.viewportNode;if(!e)return;let n=this.scrollbar.isHorizontal?`scrollLeft`:`scrollTop`,r=e[n];return vi(e,`scroll`,()=>{let i=e[n];r!==i&&(this.machine.dispatch(`SCROLL`),t()),r=i})}),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this)}onpointerenter(e){this.machine.dispatch(`POINTER_ENTER`)}onpointerleave(e){this.machine.dispatch(`POINTER_LEAVE`)}#t=k(()=>({"data-state":this.machine.state.current===`hidden`?`hidden`:`visible`,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},qb=class e{static create(){return new e(Rb.get())}scrollbar;root;#e=A(!1);get isVisible(){return I(this.#e)}set isVisible(e){j(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root;let t=Jf(()=>{let e=this.root.viewportNode;if(!e)return;let t=e.offsetWidth<e.scrollWidth,n=e.offsetHeight<e.scrollHeight;this.isVisible=this.scrollbar.isHorizontal?t:n},10);new db(()=>this.root.viewportNode,t),new db(()=>this.root.contentNode,t)}#t=k(()=>({"data-state":this.isVisible?`visible`:`hidden`}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},Jb=class e{static create(){return zb.set(new e(Rb.get()))}scrollbar;root;#e=A(null);get thumbNode(){return I(this.#e)}set thumbNode(e){j(this.#e,e,!0)}#t=A(0);get pointerOffset(){return I(this.#t)}set pointerOffset(e){j(this.#t,e,!0)}#n=A({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}});get sizes(){return I(this.#n)}set sizes(e){j(this.#n,e)}#r=k(()=>tx(this.sizes.viewport,this.sizes.content));get thumbRatio(){return I(this.#r)}set thumbRatio(e){j(this.#r,e)}#i=k(()=>this.thumbRatio>0&&this.thumbRatio<1);get hasThumb(){return I(this.#i)}set hasThumb(e){j(this.#i,e)}#a=A(``);get prevTransformStyle(){return I(this.#a)}set prevTransformStyle(e){j(this.#a,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,sr(()=>{this.scrollbar.hasThumb=this.hasThumb}),sr(()=>{!this.scrollbar.hasThumb&&this.thumbNode&&(this.prevTransformStyle=this.thumbNode.style.transform)})}setSizes(e){this.sizes=e}getScrollPosition(e,t){return rx({pointerPos:e,pointerOffset:this.pointerOffset,sizes:this.sizes,dir:t})}onThumbPointerUp(){this.pointerOffset=0}onThumbPointerDown(e){this.pointerOffset=e}xOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;let e=this.root.viewportNode.scrollLeft,t=`translate3d(${ix({scrollPos:e,sizes:this.sizes,dir:this.root.opts.dir.current})}px, 0, 0)`;this.thumbNode.style.transform=t,this.prevTransformStyle=t}xOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=e)}xOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=this.getScrollPosition(e,this.root.opts.dir.current))}yOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;let e=this.root.viewportNode.scrollTop,t=`translate3d(0, ${ix({scrollPos:e,sizes:this.sizes})}px, 0)`;this.thumbNode.style.transform=t,this.prevTransformStyle=t}yOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=e)}yOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=this.getScrollPosition(e,this.root.opts.dir.current))}},Yb=class e{static create(t){return Bb.set(new e(t,zb.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=A();get computedStyle(){return I(this.#e)}set computedStyle(e){j(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=Op(this.scrollbar.opts.ref,e=>this.root.scrollbarXNode=e),sr(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),sr(()=>{this.onResize()})}onThumbPointerDown=e=>{this.scrollbarVis.onThumbPointerDown(e.x)};onDragScroll=e=>{this.scrollbarVis.xOnDragScroll(e.x)};onThumbPointerUp=()=>{this.scrollbarVis.onThumbPointerUp()};onThumbPositionChange=()=>{this.scrollbarVis.xOnThumbPositionChange()};onWheelScroll=(e,t)=>{if(!this.root.viewportNode)return;let n=this.root.viewportNode.scrollLeft+e.deltaX;this.scrollbarVis.xOnWheelScroll(n),ox(n,t)&&e.preventDefault()};onResize=()=>{this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollWidth,viewport:this.root.viewportNode.offsetWidth,scrollbar:{size:this.scrollbar.opts.ref.current.clientWidth,paddingStart:ex(this.computedStyle.paddingLeft),paddingEnd:ex(this.computedStyle.paddingRight)}})};#t=k(()=>nx(this.scrollbarVis.sizes));get thumbSize(){return I(this.#t)}set thumbSize(e){j(this.#t,e)}#n=k(()=>({id:this.scrollbar.opts.id.current,"data-orientation":`horizontal`,style:{bottom:0,left:this.root.opts.dir.current===`rtl`?`var(--bits-scroll-area-corner-width)`:0,right:this.root.opts.dir.current===`ltr`?`var(--bits-scroll-area-corner-width)`:0,"--bits-scroll-area-thumb-width":`${this.thumbSize}px`},...this.attachment}));get props(){return I(this.#n)}set props(e){j(this.#n,e)}},Xb=class e{static create(t){return Bb.set(new e(t,zb.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=A();get computedStyle(){return I(this.#e)}set computedStyle(e){j(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=Op(this.scrollbar.opts.ref,e=>this.root.scrollbarYNode=e),sr(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),sr(()=>{this.onResize()}),this.onThumbPointerDown=this.onThumbPointerDown.bind(this),this.onDragScroll=this.onDragScroll.bind(this),this.onThumbPointerUp=this.onThumbPointerUp.bind(this),this.onThumbPositionChange=this.onThumbPositionChange.bind(this),this.onWheelScroll=this.onWheelScroll.bind(this),this.onResize=this.onResize.bind(this)}onThumbPointerDown(e){this.scrollbarVis.onThumbPointerDown(e.y)}onDragScroll(e){this.scrollbarVis.yOnDragScroll(e.y)}onThumbPointerUp(){this.scrollbarVis.onThumbPointerUp()}onThumbPositionChange(){this.scrollbarVis.yOnThumbPositionChange()}onWheelScroll(e,t){if(!this.root.viewportNode)return;let n=this.root.viewportNode.scrollTop+e.deltaY;this.scrollbarVis.yOnWheelScroll(n),ox(n,t)&&e.preventDefault()}onResize(){this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollHeight,viewport:this.root.viewportNode.offsetHeight,scrollbar:{size:this.scrollbar.opts.ref.current.clientHeight,paddingStart:ex(this.computedStyle.paddingTop),paddingEnd:ex(this.computedStyle.paddingBottom)}})}#t=k(()=>nx(this.scrollbarVis.sizes));get thumbSize(){return I(this.#t)}set thumbSize(e){j(this.#t,e)}#n=k(()=>({id:this.scrollbar.opts.id.current,"data-orientation":`vertical`,style:{top:0,right:this.root.opts.dir.current===`ltr`?0:void 0,left:this.root.opts.dir.current===`rtl`?0:void 0,bottom:`var(--bits-scroll-area-corner-height)`,"--bits-scroll-area-thumb-height":`${this.thumbSize}px`},...this.attachment}));get props(){return I(this.#n)}set props(e){j(this.#n,e)}},Zb=class e{static create(){return Vb.set(new e(Bb.get()))}scrollbarState;root;scrollbarVis;scrollbar;#e=A(null);get rect(){return I(this.#e)}set rect(e){j(this.#e,e)}#t=A(``);get prevWebkitUserSelect(){return I(this.#t)}set prevWebkitUserSelect(e){j(this.#t,e,!0)}handleResize;handleThumbPositionChange;handleWheelScroll;handleThumbPointerDown;handleThumbPointerUp;#n=k(()=>this.scrollbarVis.sizes.content-this.scrollbarVis.sizes.viewport);get maxScrollPos(){return I(this.#n)}set maxScrollPos(e){j(this.#n,e)}constructor(e){this.scrollbarState=e,this.root=e.root,this.scrollbarVis=e.scrollbarVis,this.scrollbar=e.scrollbarVis.scrollbar,this.handleResize=Jf(()=>this.scrollbarState.onResize(),10),this.handleThumbPositionChange=this.scrollbarState.onThumbPositionChange,this.handleWheelScroll=this.scrollbarState.onWheelScroll,this.handleThumbPointerDown=this.scrollbarState.onThumbPointerDown,this.handleThumbPointerUp=this.scrollbarState.onThumbPointerUp,sr(()=>{let e=this.maxScrollPos,t=this.scrollbar.opts.ref.current;return this.root.viewportNode,vi(this.root.domContext.getDocument(),`wheel`,n=>{let r=n.target;t?.contains(r)&&this.handleWheelScroll(n,e)},{passive:!1})}),lr(()=>{this.scrollbarVis.sizes,ei(()=>this.handleThumbPositionChange())}),new db(()=>this.scrollbar.opts.ref.current,this.handleResize),new db(()=>this.root.contentNode,this.handleResize),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onlostpointercapture=this.onlostpointercapture.bind(this)}handleDragScroll(e){if(!this.rect)return;let t=e.clientX-this.rect.left,n=e.clientY-this.rect.top;this.scrollbarState.onDragScroll({x:t,y:n})}#r(){this.rect!==null&&(this.root.domContext.getDocument().body.style.webkitUserSelect=this.prevWebkitUserSelect,this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior=``),this.rect=null)}onpointerdown(e){e.button===0&&(e.target.setPointerCapture(e.pointerId),this.rect=this.scrollbar.opts.ref.current?.getBoundingClientRect()??null,this.prevWebkitUserSelect=this.root.domContext.getDocument().body.style.webkitUserSelect,this.root.domContext.getDocument().body.style.webkitUserSelect=`none`,this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior=`auto`),this.handleDragScroll(e))}onpointermove(e){this.handleDragScroll(e)}onpointerup(e){let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),this.#r()}onlostpointercapture(e){this.#r()}#i=k(()=>Vf({...this.scrollbarState.props,style:{position:`absolute`,...this.scrollbarState.props.style},[Ib.scrollbar]:``,onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerup:this.onpointerup,onlostpointercapture:this.onlostpointercapture}));get props(){return I(this.#i)}set props(e){j(this.#i,e)}},Qb=class e{static create(t){return new e(t,Vb.get())}opts;scrollbarState;attachment;#e;#t=A();#n=Jf(()=>{I(this.#t)&&(I(this.#t)(),j(this.#t,void 0))},100);constructor(e,t){this.opts=e,this.scrollbarState=t,this.#e=t.root,this.attachment=Op(this.opts.ref,e=>this.scrollbarState.scrollbarVis.thumbNode=e),sr(()=>{let e=this.#e.viewportNode;return e?(ei(()=>this.scrollbarState.handleThumbPositionChange()),vi(e,`scroll`,()=>{if(this.#n(),!I(this.#t)){let t=sx(e,this.scrollbarState.handleThumbPositionChange);j(this.#t,t,!0),this.scrollbarState.handleThumbPositionChange()}})):void 0}),this.onpointerdowncapture=this.onpointerdowncapture.bind(this),this.onpointerup=this.onpointerup.bind(this)}onpointerdowncapture(e){let t=e.target;if(!t)return;let n=t.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top;this.scrollbarState.handleThumbPointerDown({x:r,y:i})}onpointerup(e){this.scrollbarState.handleThumbPointerUp()}#r=k(()=>({id:this.opts.id.current,"data-state":this.scrollbarState.scrollbarVis.hasThumb?`visible`:`hidden`,style:{width:`var(--bits-scroll-area-thumb-width)`,height:`var(--bits-scroll-area-thumb-height)`,transform:this.scrollbarState.scrollbarVis.prevTransformStyle},onpointerdowncapture:this.onpointerdowncapture,onpointerup:this.onpointerup,[Ib.thumb]:``,...this.attachment}));get props(){return I(this.#r)}set props(e){j(this.#r,e)}},$b=class e{static create(t){return new e(t,Lb.get())}opts;root;attachment;#e=A(0);#t=A(0);#n=k(()=>!!(I(this.#e)&&I(this.#t)));get hasSize(){return I(this.#n)}set hasSize(e){j(this.#n,e)}constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(this.opts.ref),new db(()=>this.root.scrollbarXNode,()=>{let e=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=e,j(this.#t,e,!0)}),new db(()=>this.root.scrollbarYNode,()=>{let e=this.root.scrollbarYNode?.offsetWidth||0;this.root.cornerWidth=e,j(this.#e,e,!0)})}#r=k(()=>({id:this.opts.id.current,style:{width:I(this.#e),height:I(this.#t),position:`absolute`,right:this.root.opts.dir.current===`ltr`?0:void 0,left:this.root.opts.dir.current===`rtl`?0:void 0,bottom:0},[Ib.corner]:``,...this.attachment}));get props(){return I(this.#r)}set props(e){j(this.#r,e)}};function ex(e){return e?Number.parseInt(e,10):0}function tx(e,t){let n=e/t;return Number.isNaN(n)?0:n}function nx(e){let t=tx(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function rx({pointerPos:e,pointerOffset:t,sizes:n,dir:r=`ltr`}){let i=nx(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return ax([c,l],d)(e)}function ix({scrollPos:e,sizes:t,dir:n=`ltr`}){let r=nx(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=n===`ltr`?[0,o]:[o*-1,0],l=Pb(e,c[0],c[1]);return ax([0,o],[0,s])(l)}function ax(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function ox(e,t){return e>0&&e<t}function sx(e,t){let n={left:e.scrollLeft,top:e.scrollTop},r=0,i=Tp(e);return(function a(){let o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,c=n.top!==o.top;(s||c)&&t(),n=o,r=i.requestAnimationFrame(a)})(),()=>i.cancelAnimationFrame(r)}var cx=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`type`,`dir`,`scrollHideDelay`,`children`,`child`]),lx=L(`<div><!></div>`);function ux(e,t){let n=Ai();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>$p(n)),a=q(t,`type`,3,`hover`),o=q(t,`dir`,3,`ltr`),s=q(t,`scrollHideDelay`,3,600),c=G(t,cx),l=Hb.create({type:J(()=>a()),dir:J(()=>o()),scrollHideDelay:J(()=>s()),id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),u=k(()=>Vf(c,l.props));var d=R(),f=N(d),p=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(u)})),z(e,n)},m=e=>{var n=lx();Sa(n,()=>({...I(u)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(f,e=>{t.child?e(p):e(m,-1)}),z(e,d),O()}var dx=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`children`]),fx=L(`<div><div><!></div></div>`);function px(e,t){let n=Ai();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>$p(n)),a=G(t,dx),o=Ub.create({id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),s=k(()=>Vf(a,o.props)),c=k(()=>Vf({},o.contentProps));var l=fx();Sa(l,()=>({...I(s)}));var u=M(l);Sa(u,()=>({...I(c)})),H(M(u),()=>t.children??w),T(u),T(l),z(e,l),O()}var mx=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`]),hx=L(`<div><!></div>`);function gx(e,t){D(t,!0);let n=G(t,mx),r=Zb.create(),i=k(()=>Vf(n,r.props));var a=R(),o=N(a),s=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(i)})),z(e,n)},c=e=>{var n=hx();Sa(n,()=>({...I(i)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(o,e=>{t.child?e(s):e(c,-1)}),z(e,a),O()}var _x=new Set([`$$slots`,`$$events`,`$$legacy`]);function vx(e,t){D(t,!0);let n=G(t,_x),r=new ip,i=Yb.create({mounted:J(()=>r.current)}),a=k(()=>Vf(n,i.props));gx(e,K(()=>I(a))),O()}var yx=new Set([`$$slots`,`$$events`,`$$legacy`]);function bx(e,t){D(t,!0);let n=G(t,yx),r=new ip,i=Xb.create({mounted:J(()=>r.current)}),a=k(()=>Vf(n,i.props));gx(e,K(()=>I(a))),O()}var xx=new Set([`$$slots`,`$$events`,`$$legacy`]);function Sx(e,t){D(t,!0);let n=G(t,xx),r=Jb.create();var i=R(),a=N(i),o=e=>{vx(e,K(()=>n))},s=e=>{bx(e,K(()=>n))};V(a,e=>{r.scrollbar.opts.orientation.current===`horizontal`?e(o):e(s,-1)}),z(e,i),O()}var Cx=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function wx(e,t){D(t,!0);let n=q(t,`forceMount`,3,!1),r=G(t,Cx),i=qb.create(),a=k(()=>Vf(r,i.props));{let t=e=>{Sx(e,K(()=>I(a)))},r=k(()=>n()||i.isVisible);pb(e,{get open(){return I(r)},get ref(){return i.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}})}O()}var Tx=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function Ex(e,t){D(t,!0);let n=q(t,`forceMount`,3,!1),r=G(t,Tx),i=Kb.create(),a=k(()=>Vf(r,i.props));{let t=e=>{Sx(e,K(()=>I(a)))},r=k(()=>n()||!i.isHidden);pb(e,K(()=>I(a),{get open(){return I(r)},get ref(){return i.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}}))}O()}var Dx=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function Ox(e,t){D(t,!0);let n=q(t,`forceMount`,3,!1),r=G(t,Dx),i=Gb.create(),a=qb.create(),o=k(()=>Vf(r,i.props,a.props,{"data-state":i.isVisible?`visible`:`hidden`})),s=k(()=>n()||i.isVisible&&a.isVisible);pb(e,{get open(){return I(s)},get ref(){return a.scrollbar.opts.ref},presence:e=>{Sx(e,K(()=>I(o)))},$$slots:{presence:!0}}),O()}var kx=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`orientation`]);function Ax(e,t){let n=Ai();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>$p(n)),a=G(t,kx),o=Wb.create({orientation:J(()=>t.orientation),id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),s=k(()=>o.root.opts.type.current);var c=R(),l=N(c),u=e=>{Ox(e,K(()=>a,{get id(){return i()}}))},d=e=>{Ex(e,K(()=>a,{get id(){return i()}}))},f=e=>{wx(e,K(()=>a,{get id(){return i()}}))},p=e=>{Sx(e,K(()=>a,{get id(){return i()}}))};V(l,e=>{I(s)===`hover`?e(u):I(s)===`scroll`?e(d,1):I(s)===`auto`?e(f,2):I(s)===`always`&&e(p,3)}),z(e,c),O()}var jx=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`child`,`children`,`present`]),Mx=L(`<div><!></div>`);function Nx(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,jx),i=new ip,a=Qb.create({id:J(()=>t.id),ref:J(()=>n(),e=>n(e)),mounted:J(()=>i.current)}),o=k(()=>Vf(r,a.props,{style:{hidden:!t.present}}));var s=R(),c=N(s),l=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(o)})),z(e,n)},u=e=>{var n=Mx();Sa(n,()=>({...I(o)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(c,e=>{t.child?e(l):e(u,-1)}),z(e,s),O()}var Px=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`forceMount`]);function Fx(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`forceMount`,3,!1),o=G(t,Px),s=zb.get();{let t=(e,t)=>{let n=()=>t?.().present;Nx(e,K(()=>o,{get id(){return r()},get present(){return n()},get ref(){return i()},set ref(e){i(e)}}))},n=k(()=>a()||s.hasThumb);pb(e,{get open(){return I(n)},get ref(){return s.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}})}O()}var Ix=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`children`,`child`]),Lx=L(`<div><!></div>`);function Rx(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Ix),i=$b.create({id:J(()=>t.id),ref:J(()=>n(),e=>n(e))}),a=k(()=>Vf(r,i.props));var o=R(),s=N(o),c=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(a)})),z(e,n)},l=e=>{var n=Lx();Sa(n,()=>({...I(a)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(s,e=>{t.child?e(c):e(l,-1)}),z(e,o),O()}var zx=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`]);function Bx(e,t){let n=Ai();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>$p(n)),a=G(t,zx),o=Lb.get(),s=k(()=>!!(o.scrollbarXNode&&o.scrollbarYNode)),c=k(()=>o.opts.type.current!==`scroll`&&I(s));var l=R(),u=N(l),d=e=>{Rx(e,K(()=>a,{get id(){return i()},get ref(){return r()},set ref(e){r(e)}}))};V(u,e=>{I(c)&&e(d)}),z(e,l),O()}var Vx=L(`<!> <!>`,1);function Hx(e,t){D(t,!0);let n=q(t,`value`,15),r=q(t,`onValueChange`,3,Qp),i=q(t,`name`,3,``),a=q(t,`disabled`,3,!1),o=q(t,`open`,15,!1),s=q(t,`onOpenChange`,3,Qp),c=q(t,`onOpenChangeComplete`,3,Qp),l=q(t,`loop`,3,!1),u=q(t,`scrollAlignment`,3,`nearest`),d=q(t,`required`,3,!1),f=q(t,`items`,19,()=>[]),p=q(t,`allowDeselect`,3,!1);function m(){n()===void 0&&n(t.type===`single`?``:[])}m(),Qf.pre(()=>n(),()=>{m()});let h=A(``),g=lv.create({type:t.type,value:J(()=>n(),e=>{n(e),r()(e)}),disabled:J(()=>a()),required:J(()=>d()),open:J(()=>o(),e=>{o(e),s()(e)}),loop:J(()=>l()),scrollAlignment:J(()=>u()),name:J(()=>i()),isCombobox:!1,items:J(()=>f()),allowDeselect:J(()=>p()),inputValue:J(()=>I(h),e=>j(h,e,!0)),onOpenChangeComplete:J(()=>c())});var _=Vx(),v=N(_);Q_(v,{children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}});var y=P(v,2),b=e=>{var n=R(),r=N(n),i=e=>{vv(e,{get autocomplete(){return t.autocomplete}})},a=e=>{var n=R();Ri(N(n),16,()=>g.opts.value.current,e=>e,(e,n)=>{vv(e,{get value(){return n},get autocomplete(){return t.autocomplete}})}),z(e,n)};V(r,e=>{g.opts.value.current.length===0?e(i):e(a,-1)}),z(e,n)},x=k(()=>Array.isArray(g.opts.value.current)),S=e=>{vv(e,{get autocomplete(){return t.autocomplete},get value(){return g.opts.value.current},set value(e){g.opts.value.current=e}})};V(y,e=>{I(x)?e(b):e(S,-1)}),z(e,_),O()}var Ux=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`type`]),Wx=L(`<button><!></button>`);function Gx(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`type`,3,`button`),o=G(t,Ux),s=uv.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),c=k(()=>Vf(o,s.props,{type:a()}));var l=R();U(N(l),()=>yv,(e,n)=>{n(e,{get id(){return r()},get ref(){return s.opts.ref},children:(e,n)=>{var r=R(),i=N(r),a=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(c)})),z(e,n)},o=e=>{var n=Wx();Sa(n,()=>({...I(c)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(i,e=>{t.child?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}})}),z(e,l),O()}var Kx=Fp({component:`switch`,parts:[`root`,`thumb`]}),qx=new qf(`Switch.Root`),Jx=class e{static create(t){return qx.set(new e(t))}opts;attachment;constructor(e){this.opts=e,this.attachment=Op(e.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this)}#e(){this.opts.checked.current=!this.opts.checked.current}onkeydown(e){!(e.key===`Enter`||e.key===` `)||this.opts.disabled.current||(e.preventDefault(),this.#e())}onclick(e){this.opts.disabled.current||this.#e()}#t=k(()=>({"data-disabled":Ap(this.opts.disabled.current),"data-state":Bte(this.opts.checked.current),"data-required":Ap(this.opts.required.current)}));get sharedProps(){return I(this.#t)}set sharedProps(e){j(this.#t,e)}#n=k(()=>({checked:this.opts.checked.current}));get snippetProps(){return I(this.#n)}set snippetProps(e){j(this.#n,e)}#r=k(()=>({...this.sharedProps,id:this.opts.id.current,role:`switch`,disabled:jp(this.opts.disabled.current),"aria-checked":Pp(this.opts.checked.current,!1),"aria-required":kp(this.opts.required.current),[Kx.root]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return I(this.#r)}set props(e){j(this.#r,e)}},Yx=class e{static create(){return new e(qx.get())}root;#e=k(()=>this.root.opts.name.current!==void 0);get shouldRender(){return I(this.#e)}set shouldRender(e){j(this.#e,e)}constructor(e){this.root=e}#t=k(()=>({type:`checkbox`,name:this.root.opts.name.current,value:this.root.opts.value.current,checked:this.root.opts.checked.current,disabled:this.root.opts.disabled.current,required:this.root.opts.required.current}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},Xx=class e{static create(t){return new e(t,qx.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(e.ref)}#e=k(()=>({checked:this.root.opts.checked.current}));get snippetProps(){return I(this.#e)}set snippetProps(e){j(this.#e,e)}#t=k(()=>({...this.root.sharedProps,id:this.opts.id.current,[Kx.thumb]:``,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}};function Zx(e,t){D(t,!1);let n=Yx.create();ja();var r=R(),i=N(r),a=e=>{Ah(e,K(()=>n.props))};V(i,e=>{n.shouldRender&&e(a)}),z(e,r),O()}var Qx=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`disabled`,`required`,`checked`,`value`,`name`,`type`,`onCheckedChange`]),$x=L(`<button><!></button>`),eS=L(`<!> <!>`,1);function tS(e,t){let n=Ai();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>$p(n)),a=q(t,`disabled`,3,!1),o=q(t,`required`,3,!1),s=q(t,`checked`,15,!1),c=q(t,`value`,3,`on`),l=q(t,`name`,3,void 0),u=q(t,`type`,3,`button`),d=q(t,`onCheckedChange`,3,Qp),f=G(t,Qx),p=Jx.create({checked:J(()=>s(),e=>{s(e),d()?.(e)}),disabled:J(()=>a()??!1),required:J(()=>o()),value:J(()=>c()),name:J(()=>l()),id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),m=k(()=>Vf(f,p.props,{type:u()}));var h=eS(),g=N(h),_=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(m),...p.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},v=e=>{var n=$x();Sa(n,()=>({...I(m)})),H(M(n),()=>t.children??w,()=>p.snippetProps),T(n),z(e,n)};V(g,e=>{t.child?e(_):e(v,-1)}),Zx(P(g,2),{}),z(e,h),O()}var nS=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`]),rS=L(`<span><!></span>`);function iS(e,t){let n=Ai();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>$p(n)),a=G(t,nS),o=Xx.create({id:J(()=>i()),ref:J(()=>r(),e=>r(e))}),s=k(()=>Vf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(s),...o.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},d=e=>{var n=rS();Sa(n,()=>({...I(s)})),H(M(n),()=>t.children??w,()=>o.snippetProps),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var aS=Fp({component:`tabs`,parts:[`root`,`list`,`trigger`,`content`]}),oS=new qf(`Tabs.Root`),sS=class e{static create(t){return oS.set(new e(t))}opts;attachment;rovingFocusGroup;#e=A(In([]));get triggerIds(){return I(this.#e)}set triggerIds(e){j(this.#e,e,!0)}valueToTriggerId=new Ao;valueToContentId=new Ao;constructor(e){this.opts=e,this.attachment=Op(e.ref),this.rovingFocusGroup=new Yp({candidateAttr:aS.trigger,rootNode:this.opts.ref,loop:this.opts.loop,orientation:this.opts.orientation})}registerTrigger(e,t){return this.triggerIds.push(e),this.valueToTriggerId.set(t,e),()=>{this.triggerIds=this.triggerIds.filter(t=>t!==e),this.valueToTriggerId.delete(t)}}registerContent(e,t){return this.valueToContentId.set(t,e),()=>{this.valueToContentId.delete(t)}}setValue(e){this.opts.value.current=e}#t=k(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,[aS.root]:``,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},cS=class e{static create(t){return new e(t,oS.get())}opts;root;attachment;#e=k(()=>this.root.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(e.ref)}#t=k(()=>({id:this.opts.id.current,role:`tablist`,"aria-orientation":this.root.opts.orientation.current,"data-orientation":this.root.opts.orientation.current,[aS.list]:``,"data-disabled":Ap(I(this.#e)),...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}},lS=class e{static create(t){return new e(t,oS.get())}opts;root;attachment;#e=A(0);#t=k(()=>this.root.opts.value.current===this.opts.value.current);#n=k(()=>this.opts.disabled.current||this.root.opts.disabled.current);#r=k(()=>this.root.valueToContentId.get(this.opts.value.current));constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(e.ref),Qf([()=>this.opts.id.current,()=>this.opts.value.current],([e,t])=>this.root.registerTrigger(e,t)),sr(()=>{this.root.triggerIds.length,I(this.#t)||!this.root.opts.value.current?j(this.#e,0):j(this.#e,-1)}),this.onfocus=this.onfocus.bind(this),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}#i(){this.root.opts.value.current!==this.opts.value.current&&this.root.setValue(this.opts.value.current)}onfocus(e){this.root.opts.activationMode.current!==`automatic`||I(this.#n)||this.#i()}onclick(e){I(this.#n)||this.#i()}onkeydown(e){if(!I(this.#n)){if(e.key===` `||e.key===`Enter`){e.preventDefault(),this.#i();return}this.root.rovingFocusGroup.handleKeydown(this.opts.ref.current,e)}}#a=k(()=>({id:this.opts.id.current,role:`tab`,"data-state":uS(I(this.#t)),"data-value":this.opts.value.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":Ap(I(this.#n)),"aria-selected":kp(I(this.#t)),"aria-controls":I(this.#r),[aS.trigger]:``,disabled:jp(I(this.#n)),tabindex:I(this.#e),onclick:this.onclick,onfocus:this.onfocus,onkeydown:this.onkeydown,...this.attachment}));get props(){return I(this.#a)}set props(e){j(this.#a,e)}};function uS(e){return e?`active`:`inactive`}var dS=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`value`,`onValueChange`,`orientation`,`loop`,`activationMode`,`disabled`,`children`,`child`]),fS=L(`<div><!></div>`);function pS(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`value`,15,``),o=q(t,`onValueChange`,3,Qp),s=q(t,`orientation`,3,`horizontal`),c=q(t,`loop`,3,!0),l=q(t,`activationMode`,3,`automatic`),u=q(t,`disabled`,3,!1),d=G(t,dS),f=sS.create({id:J(()=>r()),value:J(()=>a(),e=>{a(e),o()(e)}),orientation:J(()=>s()),loop:J(()=>c()),activationMode:J(()=>l()),disabled:J(()=>u()),ref:J(()=>i(),e=>i(e))}),p=k(()=>Vf(d,f.props));var m=R(),h=N(m),g=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(p)})),z(e,n)},_=e=>{var n=fS();Sa(n,()=>({...I(p)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(h,e=>{t.child?e(g):e(_,-1)}),z(e,m),O()}var mS=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`id`,`ref`]),hS=L(`<div><!></div>`);function gS(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=G(t,mS),o=cS.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e))}),s=k(()=>Vf(a,o.props));var c=R(),l=N(c),u=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(s)})),z(e,n)},d=e=>{var n=hS();Sa(n,()=>({...I(s)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(l,e=>{t.child?e(u):e(d,-1)}),z(e,c),O()}var _S=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`disabled`,`id`,`type`,`value`,`ref`]),vS=L(`<button><!></button>`);function yS(e,t){let n=Ai();D(t,!0);let r=q(t,`disabled`,3,!1),i=q(t,`id`,19,()=>$p(n)),a=q(t,`type`,3,`button`),o=q(t,`ref`,15,null),s=G(t,_S),c=lS.create({id:J(()=>i()),disabled:J(()=>r()??!1),value:J(()=>t.value),ref:J(()=>o(),e=>o(e))}),l=k(()=>Vf(s,c.props,{type:a()}));var u=R(),d=N(u),f=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(l)})),z(e,n)},p=e=>{var n=vS();Sa(n,()=>({...I(l)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(d,e=>{t.child?e(f):e(p,-1)}),z(e,u),O()}var bS=Fp({component:`toggle-group`,parts:[`root`,`item`]}),xS=new qf(`ToggleGroup.Root`),SS=class{opts;rovingFocusGroup;attachment;constructor(e){this.opts=e,this.attachment=Op(this.opts.ref),this.rovingFocusGroup=new Yp({candidateAttr:bS.item,rootNode:e.ref,loop:e.loop,orientation:e.orientation})}#e=k(()=>({id:this.opts.id.current,[bS.root]:``,role:`group`,"data-orientation":this.opts.orientation.current,"data-disabled":Ap(this.opts.disabled.current),...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},CS=class extends SS{opts;isMulti=!1;#e=k(()=>this.opts.value.current!==``);get anyPressed(){return I(this.#e)}set anyPressed(e){j(this.#e,e)}constructor(e){super(e),this.opts=e}includesItem(e){return this.opts.value.current===e}toggleItem(e,t){this.includesItem(e)?this.opts.value.current=``:(this.opts.value.current=e,this.rovingFocusGroup.setCurrentTabStopId(t))}},wS=class extends SS{opts;isMulti=!0;#e=k(()=>this.opts.value.current.length>0);get anyPressed(){return I(this.#e)}set anyPressed(e){j(this.#e,e)}constructor(e){super(e),this.opts=e}includesItem(e){return this.opts.value.current.includes(e)}toggleItem(e,t){this.includesItem(e)?this.opts.value.current=this.opts.value.current.filter(t=>t!==e):(this.opts.value.current=[...this.opts.value.current,e],this.rovingFocusGroup.setCurrentTabStopId(t))}},TS=class{static create(e){let{type:t,...n}=e,r=t===`single`?new CS(n):new wS(n);return xS.set(r)}},ES=class e{static create(t){return new e(t,xS.get())}opts;root;attachment;#e=k(()=>this.opts.disabled.current||this.root.opts.disabled.current);#t=k(()=>this.root.includesItem(this.opts.value.current));get isPressed(){return I(this.#t)}set isPressed(e){j(this.#t,e)}#n=k(()=>this.root.isMulti?void 0:Pp(this.isPressed,!1));#r=k(()=>this.root.isMulti?kp(this.isPressed):void 0);constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(this.opts.ref),sr(()=>{this.root.opts.rovingFocus.current?j(this.#a,this.root.rovingFocusGroup.getTabIndex(this.opts.ref.current),!0):j(this.#a,0)}),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}#i(){I(this.#e)||this.root.toggleItem(this.opts.value.current,this.opts.id.current)}onclick(e){I(this.#e)||this.root.toggleItem(this.opts.value.current,this.opts.id.current)}onkeydown(e){if(!I(this.#e)){if(e.key===`Enter`||e.key===` `){e.preventDefault(),this.#i();return}this.root.opts.rovingFocus.current&&this.root.rovingFocusGroup.handleKeydown(this.opts.ref.current,e)}}#a=A(0);#o=k(()=>({pressed:this.isPressed}));get snippetProps(){return I(this.#o)}set snippetProps(e){j(this.#o,e)}#s=k(()=>({id:this.opts.id.current,role:this.root.isMulti?void 0:`radio`,tabindex:I(this.#a),"data-orientation":this.root.opts.orientation.current,"data-disabled":Ap(I(this.#e)),"data-state":DS(this.isPressed),"data-value":this.opts.value.current,"aria-pressed":I(this.#r),"aria-checked":I(this.#n),disabled:jp(I(this.#e)),[bS.item]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return I(this.#s)}set props(e){j(this.#s,e)}};function DS(e){return e?`on`:`off`}var OS=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`value`,`onValueChange`,`type`,`disabled`,`loop`,`orientation`,`rovingFocus`,`child`,`children`]),kS=L(`<div><!></div>`);function AS(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`value`,15),o=q(t,`onValueChange`,3,Qp),s=q(t,`disabled`,3,!1),c=q(t,`loop`,3,!0),l=q(t,`orientation`,3,`horizontal`),u=q(t,`rovingFocus`,3,!0),d=G(t,OS);function f(){a()===void 0&&a(t.type===`single`?``:[])}f(),Qf.pre(()=>a(),()=>{f()});let p=TS.create({id:J(()=>r()),value:J(()=>a(),e=>{a(e),o()(e)}),disabled:J(()=>s()),loop:J(()=>c()),orientation:J(()=>l()),rovingFocus:J(()=>u()),type:t.type,ref:J(()=>i(),e=>i(e))}),m=k(()=>Vf(d,p.props));var h=R(),g=N(h),_=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(m)})),z(e,n)},v=e=>{var n=kS();Sa(n,()=>({...I(m)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(g,e=>{t.child?e(_):e(v,-1)}),z(e,h),O()}var jS=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`value`,`disabled`,`id`,`type`]),MS=L(`<button><!></button>`);function NS(e,t){let n=Ai();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`disabled`,3,!1),a=q(t,`id`,19,()=>$p(n)),o=q(t,`type`,3,`button`),s=G(t,jS),c=ES.create({id:J(()=>a()),value:J(()=>t.value),disabled:J(()=>i()??!1),ref:J(()=>r(),e=>r(e))}),l=k(()=>Vf(s,c.props,{type:o()}));var u=R(),d=N(u),f=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(l),...c.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},p=e=>{var n=MS();Sa(n,()=>({...I(l)})),H(M(n),()=>t.children??w,()=>c.snippetProps),T(n),z(e,n)};V(d,e=>{t.child?e(f):e(p,-1)}),z(e,u),O()}var PS=Fp({component:`toolbar`,parts:[`root`,`item`,`group`,`group-item`,`link`,`button`]}),FS=new qf(`Toolbar.Root`);new qf(`Toolbar.Group`);var IS=class e{static create(t){return FS.set(new e(t))}opts;rovingFocusGroup;attachment;constructor(e){this.opts=e,this.attachment=Op(this.opts.ref),this.rovingFocusGroup=new Yp({orientation:this.opts.orientation,loop:this.opts.loop,rootNode:this.opts.ref,candidateAttr:PS.item})}#e=k(()=>({id:this.opts.id.current,role:`toolbar`,"data-orientation":this.opts.orientation.current,[PS.root]:``,...this.attachment}));get props(){return I(this.#e)}set props(e){j(this.#e,e)}},LS=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`orientation`,`loop`,`child`,`children`]),RS=L(`<div><!></div>`);function zS(e,t){let n=Ai();D(t,!0);let r=q(t,`ref`,15,null),i=q(t,`id`,19,()=>$p(n)),a=q(t,`orientation`,3,`horizontal`),o=q(t,`loop`,3,!0),s=G(t,LS),c=IS.create({id:J(()=>i()),orientation:J(()=>a()),loop:J(()=>o()),ref:J(()=>r(),e=>r(e))}),l=k(()=>Vf(s,c.props));var u=R(),d=N(u),f=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(l)})),z(e,n)},p=e=>{var n=RS();Sa(n,()=>({...I(l)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(d,e=>{t.child?e(f):e(p,-1)}),z(e,u),O()}var BS=class{#e;#t;#n=null;constructor(e,t){this.#t=e,this.#e=t,this.stop=this.stop.bind(this),this.start=this.start.bind(this),dp(this.stop)}#r(){this.#n!==null&&(window.clearTimeout(this.#n),this.#n=null)}stop(){this.#r()}start(...e){this.#r(),this.#n=window.setTimeout(()=>{this.#n=null,this.#t(...e)},this.#e)}},VS=Fp({component:`tooltip`,parts:[`content`,`trigger`]}),HS=new qf(`Tooltip.Provider`),US=new qf(`Tooltip.Root`),WS=class{#e=A(In(new Map));get triggers(){return I(this.#e)}set triggers(e){j(this.#e,e,!0)}#t=A(null);get activeTriggerId(){return I(this.#t)}set activeTriggerId(e){j(this.#t,e,!0)}#n=k(()=>{let e=this.activeTriggerId;return e===null?null:this.triggers.get(e)?.node??null});get activeTriggerNode(){return I(this.#n)}set activeTriggerNode(e){j(this.#n,e)}#r=k(()=>{let e=this.activeTriggerId;return e===null?null:this.triggers.get(e)?.payload??null});get activePayload(){return I(this.#r)}set activePayload(e){j(this.#r,e)}register=e=>{let t=new Map(this.triggers);t.set(e.id,e),this.triggers=t,this.#i()};update=e=>{let t=new Map(this.triggers);t.set(e.id,e),this.triggers=t,this.#i()};unregister=e=>{if(!this.triggers.has(e))return;let t=new Map(this.triggers);t.delete(e),this.triggers=t,this.activeTriggerId===e&&(this.activeTriggerId=null)};setActiveTrigger=e=>{if(e===null){this.activeTriggerId=null;return}if(!this.triggers.has(e)){this.activeTriggerId=null;return}this.activeTriggerId=e};get=e=>this.triggers.get(e);has=e=>this.triggers.has(e);getFirstTriggerId=()=>{let e=this.triggers.entries().next();return e.done?null:e.value[0]};#i=()=>{let e=this.activeTriggerId;e!==null&&(this.triggers.has(e)||(this.activeTriggerId=null))}},GS=class e{static create(t){return HS.set(new e(t))}opts;#e=A(!0);get isOpenDelayed(){return I(this.#e)}set isOpenDelayed(e){j(this.#e,e,!0)}isPointerInTransit=Sf(!1);#t;#n=A(null);constructor(e){this.opts=e,this.#t=new BS(()=>{this.isOpenDelayed=!0},this.opts.skipDelayDuration.current),fp(()=>vi(window,`scroll`,e=>{let t=I(this.#n);if(!t)return;let n=t.triggerNode;if(!n)return;let r=e.target;(r instanceof Element||r instanceof Document)&&r.contains(n)&&t.handleClose()}))}#r=()=>{if(this.opts.skipDelayDuration.current===0){this.isOpenDelayed=!0;return}else this.#t.start()};#i=()=>{this.#t.stop()};onOpen=e=>{I(this.#n)&&I(this.#n)!==e&&I(this.#n).handleClose(),this.#i(),this.isOpenDelayed=!1,j(this.#n,e,!0)};onClose=e=>{I(this.#n)===e&&(j(this.#n,null),this.#r())};isTooltipOpen=e=>I(this.#n)===e},KS=class e{static create(t){return US.set(new e(t,HS.get()))}opts;provider;#e=k(()=>this.opts.delayDuration.current??this.provider.opts.delayDuration.current);get delayDuration(){return I(this.#e)}set delayDuration(e){j(this.#e,e)}#t=k(()=>this.opts.disableHoverableContent.current??this.provider.opts.disableHoverableContent.current);get disableHoverableContent(){return I(this.#t)}set disableHoverableContent(e){j(this.#t,e)}#n=k(()=>this.opts.disableCloseOnTriggerClick.current??this.provider.opts.disableCloseOnTriggerClick.current);get disableCloseOnTriggerClick(){return I(this.#n)}set disableCloseOnTriggerClick(e){j(this.#n,e)}#r=k(()=>this.opts.disabled.current??this.provider.opts.disabled.current);get disabled(){return I(this.#r)}set disabled(e){j(this.#r,e)}#i=k(()=>this.opts.ignoreNonKeyboardFocus.current??this.provider.opts.ignoreNonKeyboardFocus.current);get ignoreNonKeyboardFocus(){return I(this.#i)}set ignoreNonKeyboardFocus(e){j(this.#i,e)}registry;tether;#a=A(null);get contentNode(){return I(this.#a)}set contentNode(e){j(this.#a,e,!0)}contentPresence;#o=A(!1);#s;#c=k(()=>this.opts.open.current?I(this.#o)?`delayed-open`:`instant-open`:`closed`);get stateAttr(){return I(this.#c)}set stateAttr(e){j(this.#c,e)}constructor(e,t){this.opts=e,this.provider=t,this.tether=e.tether.current?.state??null,this.registry=this.tether?.registry??new WS,this.#s=new BS(()=>{j(this.#o,!0),this.opts.open.current=!0},this.delayDuration??0),this.tether&&(this.tether.root=this,fp(()=>()=>{this.tether?.root===this&&(this.tether.root=null)})),this.contentPresence=new Zp({open:this.opts.open,ref:J(()=>this.contentNode),onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),Qf(()=>this.delayDuration,()=>{this.delayDuration!==void 0&&(this.#s=new BS(()=>{j(this.#o,!0),this.opts.open.current=!0},this.delayDuration))}),Qf(()=>this.opts.open.current,e=>{e?(this.ensureActiveTrigger(),this.provider.onOpen(this)):this.provider.onClose(this)},{lazy:!0}),Qf(()=>this.opts.triggerId.current,e=>{e!==this.registry.activeTriggerId&&this.registry.setActiveTrigger(e)}),Qf(()=>this.registry.activeTriggerId,e=>{this.opts.triggerId.current!==e&&(this.opts.triggerId.current=e)})}handleOpen=()=>{this.#s.stop(),j(this.#o,!1),this.ensureActiveTrigger(),this.opts.open.current=!0};handleClose=()=>{this.#s.stop(),this.opts.open.current=!1};#l=()=>{this.#s.stop();let e=!this.provider.isOpenDelayed,t=this.delayDuration??0;e||t===0?(j(this.#o,!1),this.opts.open.current=!0):this.#s.start()};onTriggerEnter=e=>{this.setActiveTrigger(e),this.#l()};onTriggerLeave=()=>{this.disableHoverableContent?this.handleClose():this.#s.stop()};ensureActiveTrigger=()=>{if(this.registry.activeTriggerId!==null&&this.registry.has(this.registry.activeTriggerId))return;if(this.opts.triggerId.current!==null&&this.registry.has(this.opts.triggerId.current)){this.registry.setActiveTrigger(this.opts.triggerId.current);return}let e=this.registry.getFirstTriggerId();this.registry.setActiveTrigger(e)};setActiveTrigger=e=>{this.registry.setActiveTrigger(e)};registerTrigger=e=>{this.registry.register(e),e.disabled&&this.registry.activeTriggerId===e.id&&this.opts.open.current&&this.handleClose()};updateTrigger=e=>{this.registry.update(e),e.disabled&&this.registry.activeTriggerId===e.id&&this.opts.open.current&&this.handleClose()};unregisterTrigger=e=>{let t=this.registry.activeTriggerId===e;this.registry.unregister(e),t&&this.opts.open.current&&this.handleClose()};isActiveTrigger=e=>this.registry.activeTriggerId===e;get triggerNode(){return this.registry.activeTriggerNode}get activePayload(){return this.registry.activePayload}get activeTriggerId(){return this.registry.activeTriggerId}},qS=class e{static create(t){return t.tether.current?new e(t,null,t.tether.current.state):new e(t,US.get(),null)}opts;root;tether;attachment;#e=Sf(!1);#t=A(!1);domContext;#n=null;#r=!1;#i=null;constructor(e,t,n){this.opts=e,this.root=t,this.tether=n,this.domContext=new Dp(e.ref),this.attachment=Op(this.opts.ref,e=>this.#s(e)),Qf(()=>this.opts.id.current,()=>{this.#s(this.opts.ref.current)}),Qf(()=>this.opts.payload.current,()=>{this.#s(this.opts.ref.current)}),Qf(()=>this.opts.disabled.current,()=>{this.#s(this.opts.ref.current)}),fp(()=>(this.#r=!0,this.#s(this.opts.ref.current),()=>{let e=this.#a(),t=this.#i;t&&(this.tether?this.tether.registry.unregister(t):e?.unregisterTrigger(t)),this.#i=null,this.#r=!1}))}#a=()=>this.tether?.root??this.root;#o=()=>{let e=this.#a();return this.opts.disabled.current||!!e?.disabled};#s=e=>{if(!this.#r)return;let t=this.opts.id.current,n=this.opts.payload.current,r=this.opts.disabled.current;if(this.#i&&this.#i!==t){let e=this.#a();this.tether?this.tether.registry.unregister(this.#i):e?.unregisterTrigger(this.#i)}let i={id:t,node:e,payload:n,disabled:r},a=this.#a();this.tether?(this.tether.registry.has(t)?this.tether.registry.update(i):this.tether.registry.register(i),r&&this.tether.registry.activeTriggerId===t&&a?.opts.open.current&&a.handleClose()):a?.registry.has(t)?a.updateTrigger(i):a?.registerTrigger(i),this.#i=t};#c=()=>{this.#n!==null&&(clearTimeout(this.#n),this.#n=null)};handlePointerUp=()=>{this.#e.current=!1};#l=()=>{this.#o()||(this.#e.current=!1)};#u=()=>{this.#o()||(this.#e.current=!0,this.domContext.getDocument().addEventListener(`pointerup`,()=>{this.handlePointerUp()},{once:!0}))};#d=e=>{let t=this.#a();if(t){if(this.#o()){t.opts.open.current&&t.handleClose();return}if(e.pointerType!==`touch`){if(t.provider.isPointerInTransit.current){this.#c(),this.#n=window.setTimeout(()=>{t.provider.isPointerInTransit.current&&(t.provider.isPointerInTransit.current=!1,t.onTriggerEnter(this.opts.id.current),j(this.#t,!0))},250);return}t.onTriggerEnter(this.opts.id.current),j(this.#t,!0)}}};#f=e=>{let t=this.#a();if(t){if(this.#o()){t.opts.open.current&&t.handleClose();return}e.pointerType!==`touch`&&(I(this.#t)||(this.#c(),t.provider.isPointerInTransit.current=!1,t.onTriggerEnter(this.opts.id.current),j(this.#t,!0)))}};#p=e=>{let t=this.#a();if(!t||this.#o())return;if(this.#c(),!t.isActiveTrigger(this.opts.id.current)){j(this.#t,!1);return}let n=e.relatedTarget;if(Kp(n)){for(let e of t.registry.triggers.values())if(e.node===n){if(t.provider.opts.skipDelayDuration.current>0){j(this.#t,!1);return}t.handleClose(),j(this.#t,!1);return}}t.onTriggerLeave(),j(this.#t,!1)};#m=e=>{let t=this.#a();if(t&&!this.#e.current){if(this.#o()){t.opts.open.current&&t.handleClose();return}t.ignoreNonKeyboardFocus&&!Xte(e.currentTarget)||(t.setActiveTrigger(this.opts.id.current),t.handleOpen())}};#h=()=>{let e=this.#a();!e||this.#o()||e.handleClose()};#g=()=>{let e=this.#a();!e||e.disableCloseOnTriggerClick||this.#o()||e.handleClose()};#_=k(()=>{let e=this.#a(),t=!!(e?.opts.open.current&&e.isActiveTrigger(this.opts.id.current)),n=this.#o();return{id:this.opts.id.current,"aria-describedby":t?e?.contentNode?.id:void 0,"data-state":t?e?.stateAttr:`closed`,"data-disabled":Ap(n),"data-delay-duration":`${e?.delayDuration??0}`,[VS.trigger]:``,tabindex:n?void 0:this.opts.tabindex.current,disabled:this.opts.disabled.current,onpointerup:this.#l,onpointerdown:this.#u,onpointerenter:this.#d,onpointermove:this.#f,onpointerleave:this.#p,onfocus:this.#m,onblur:this.#h,onclick:this.#g,...this.attachment}});get props(){return I(this.#_)}set props(e){j(this.#_,e)}},JS=class e{static create(t){return new e(t,US.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Op(this.opts.ref,e=>this.root.contentNode=e),new jy({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&!this.root.disableHoverableContent,transitIntentTimeout:180,ignoredTargets:()=>{if(this.root.provider.opts.skipDelayDuration.current===0)return[];let e=[],t=this.root.triggerNode;for(let n of this.root.registry.triggers.values())n.node&&n.node!==t&&e.push(n.node);return e},onPointerExit:()=>{this.root.provider.isTooltipOpen(this.root)&&this.root.handleClose()}})}onInteractOutside=e=>{if(Kp(e.target)&&this.root.triggerNode?.contains(e.target)&&this.root.disableCloseOnTriggerClick){e.preventDefault();return}this.opts.onInteractOutside.current(e),!e.defaultPrevented&&this.root.handleClose()};onEscapeKeydown=e=>{this.opts.onEscapeKeydown.current?.(e),!e.defaultPrevented&&this.root.handleClose()};onOpenAutoFocus=e=>{e.preventDefault()};onCloseAutoFocus=e=>{e.preventDefault()};get shouldRender(){return this.root.contentPresence.shouldRender}#e=k(()=>({open:this.root.opts.open.current}));get snippetProps(){return I(this.#e)}set snippetProps(e){j(this.#e,e)}#t=k(()=>({id:this.opts.id.current,"data-state":this.root.stateAttr,"data-disabled":Ap(this.root.disabled),...Np(this.root.contentPresence.transitionStatus),style:{outline:`none`},[VS.content]:``,...this.attachment}));get props(){return I(this.#t)}set props(e){j(this.#t,e)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown,onOpenAutoFocus:this.onOpenAutoFocus,onCloseAutoFocus:this.onCloseAutoFocus}};function YS(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`triggerId`,15,null),i=q(t,`onOpenChange`,3,Qp),a=q(t,`onOpenChangeComplete`,3,Qp),o=KS.create({open:J(()=>n(),e=>{n(e),i()(e)}),triggerId:J(()=>r(),e=>{r(e)}),delayDuration:J(()=>t.delayDuration),disableCloseOnTriggerClick:J(()=>t.disableCloseOnTriggerClick),disableHoverableContent:J(()=>t.disableHoverableContent),ignoreNonKeyboardFocus:J(()=>t.ignoreNonKeyboardFocus),disabled:J(()=>t.disabled),onOpenChangeComplete:J(()=>a()),tether:J(()=>t.tether)});Q_(e,{tooltip:!0,children:(e,n)=>{var r=R();H(N(r),()=>t.children??w,()=>({open:o.opts.open.current,triggerId:o.activeTriggerId,payload:o.activePayload})),z(e,r)},$$slots:{default:!0}}),O()}var XS=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`side`,`sideOffset`,`align`,`avoidCollisions`,`arrowPadding`,`sticky`,`strategy`,`hideWhenDetached`,`customAnchor`,`collisionPadding`,`onInteractOutside`,`onEscapeKeydown`,`forceMount`,`style`]),ZS=L(`<div><div><!></div></div>`);function QS(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`ref`,15,null),a=q(t,`side`,3,`top`),o=q(t,`sideOffset`,3,0),s=q(t,`align`,3,`center`),c=q(t,`avoidCollisions`,3,!0),l=q(t,`arrowPadding`,3,0),u=q(t,`sticky`,3,`partial`),d=q(t,`hideWhenDetached`,3,!1),f=q(t,`collisionPadding`,3,0),p=q(t,`onInteractOutside`,3,Qp),m=q(t,`onEscapeKeydown`,3,Qp),h=q(t,`forceMount`,3,!1),g=G(t,XS),_=JS.create({id:J(()=>r()),ref:J(()=>i(),e=>i(e)),onInteractOutside:J(()=>p()),onEscapeKeydown:J(()=>m())}),v=k(()=>({side:a(),sideOffset:o(),align:s(),avoidCollisions:c(),arrowPadding:l(),sticky:u(),hideWhenDetached:d(),collisionPadding:f(),strategy:t.strategy,customAnchor:t.customAnchor??_.root.triggerNode})),y=k(()=>Vf(g,I(v),_.props));var b=R(),x=N(b),S=e=>{{let n=(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Vf(i(),{style:{pointerEvents:_.root.disableHoverableContent?`none`:void 0}})),o=k(()=>Vf(r(),{style:L_(`tooltip`)},{style:t.style}));var s=R(),c=N(s),l=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(o),wrapperProps:I(a),..._.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},u=e=>{var n=ZS();Sa(n,()=>({...I(a)}));var r=M(n);Sa(r,()=>({...I(o)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(c,e=>{t.child?e(l):e(u,-1)}),z(e,s)},i=k(()=>_.root.disableHoverableContent?`none`:`auto`);Iv(e,K(()=>I(y),()=>_.popperProps,{get enabled(){return _.root.opts.open.current},get id(){return r()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!0,get ref(){return _.opts.ref},tooltip:!0,get shouldRender(){return _.shouldRender},get contentPointerEvents(){return I(i)},popper:n,$$slots:{popper:!0}}))}},ee=e=>{{let n=(e,n)=>{let r=()=>n?.().props,i=()=>n?.().wrapperProps,a=k(()=>Vf(i(),{style:{pointerEvents:_.root.disableHoverableContent?`none`:void 0}})),o=k(()=>Vf(r(),{style:L_(`tooltip`)},{style:t.style}));var s=R(),c=N(s),l=e=>{var n=R(),r=N(n);{let e=k(()=>({props:I(o),wrapperProps:I(a),..._.snippetProps}));H(r,()=>t.child,()=>I(e))}z(e,n)},u=e=>{var n=ZS();Sa(n,()=>({...I(a)}));var r=M(n);Sa(r,()=>({...I(o)})),H(M(r),()=>t.children??w),T(r),T(n),z(e,n)};V(c,e=>{t.child?e(l):e(u,-1)}),z(e,s)},i=k(()=>_.root.disableHoverableContent?`none`:`auto`);Pv(e,K(()=>I(y),()=>_.popperProps,{get open(){return _.root.opts.open.current},get id(){return r()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!1,get ref(){return _.opts.ref},tooltip:!0,get shouldRender(){return _.shouldRender},get contentPointerEvents(){return I(i)},popper:n,$$slots:{popper:!0}}))}};V(x,e=>{h()?e(S):h()||e(ee,1)}),z(e,b),O()}var $S=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`disabled`,`payload`,`tether`,`type`,`tabindex`,`ref`]),eC=L(`<button><!></button>`);function tC(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,19,()=>$p(n)),i=q(t,`disabled`,3,!1),a=q(t,`type`,3,`button`),o=q(t,`tabindex`,3,0),s=q(t,`ref`,15,null),c=G(t,$S),l=qS.create({id:J(()=>r()),disabled:J(()=>i()??!1),tabindex:J(()=>o()??0),payload:J(()=>t.payload),tether:J(()=>t.tether),ref:J(()=>s(),e=>s(e))}),u=k(()=>Vf(c,l.props,{type:a()}));var d=R(),f=N(d),p=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(u)})),z(e,n)},m=e=>{var n=eC();Sa(n,()=>({...I(u)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(f,e=>{t.child?e(p):e(m,-1)}),z(e,d),O()}var nC=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function rC(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,nC);Tv(e,K(()=>r,{get ref(){return n()},set ref(e){n(e)}})),O()}function iC(e,t){D(t,!0);let n=q(t,`delayDuration`,3,700),r=q(t,`disableCloseOnTriggerClick`,3,!1),i=q(t,`disableHoverableContent`,3,!1),a=q(t,`disabled`,3,!1),o=q(t,`ignoreNonKeyboardFocus`,3,!1),s=q(t,`skipDelayDuration`,3,300);GS.create({delayDuration:J(()=>n()),disableCloseOnTriggerClick:J(()=>r()),disableHoverableContent:J(()=>i()),disabled:J(()=>a()),ignoreNonKeyboardFocus:J(()=>o()),skipDelayDuration:J(()=>s())});var c=R();H(N(c),()=>t.children??w),z(e,c),O()}var aC=L(`<!> <!>`,1);function oC(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`class`,3,``),i=q(t,`triggerClass`,3,``),a=q(t,`side`,3,`bottom`),o=q(t,`align`,3,`end`),s=q(t,`sideOffset`,3,7),c=q(t,`collisionPadding`,3,8),l=q(t,`trapFocus`,3,!0);function u(e){n(e),t.onOpenChange?.(e)}var d=R();U(N(d),()=>mb,(e,d)=>{d(e,{onOpenChange:u,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var u=aC(),d=N(u);{let e=k(()=>ul(`popover-trigger`,i()));U(d,()=>Hy,(n,r)=>{r(n,{get class(){return I(e)},get"aria-label"(){return t.ariaLabel},get title(){return t.triggerTitle},get"aria-keyshortcuts"(){return t.triggerAriaKeyShortcuts},children:(e,n)=>{var r=R();H(N(r),()=>t.trigger??w),z(e,r)},$$slots:{default:!0}})})}U(P(d,2),()=>im,(e,n)=>{n(e,{children:(e,n)=>{var i=R(),u=N(i);{let e=k(()=>ul(`popover-content`,r()));U(u,()=>zy,(n,r)=>{r(n,{get class(){return I(e)},get side(){return a()},get align(){return o()},get sideOffset(){return s()},get collisionPadding(){return c()},get trapFocus(){return l()},children:(e,n)=>{var r=aC(),i=N(r);H(i,()=>t.children??w),U(P(i,2),()=>Wy,(e,t)=>{t(e,{class:`popover-arrow`,width:9,height:5})}),z(e,r)},$$slots:{default:!0}})})}z(e,i)},$$slots:{default:!0}})}),z(e,u)},$$slots:{default:!0}})}),z(e,d),O()}var sC=Dl({base:`inline-block flex-none rounded-full`,variants:{tone:{neutral:`bg-muted-foreground border-muted-foreground`,accent:`bg-foreground border-foreground`,running:`bg-info border-info`,good:`bg-success border-success`,warn:`bg-warning border-warning`,danger:`bg-destructive border-destructive`},size:{xs:`size-[0.42rem]`,sm:`size-2`,md:`size-2.5`},variant:{solid:``,outline:`border-[1.5px] bg-transparent!`}},defaultVariants:{tone:`neutral`,size:`sm`,variant:`solid`}}),cC=L(`<span></span>`);function lC(e,t){D(t,!0);let n=q(t,`tone`,3,`neutral`),r=q(t,`size`,3,`sm`),i=q(t,`variant`,3,`solid`),a=q(t,`pulse`,3,!1);var o=cC();F(e=>{ra(o,1,e),W(o,`aria-label`,t.label),W(o,`aria-hidden`,t.label?void 0:`true`)},[()=>Zi(ul(sC({tone:n(),size:r(),variant:i()}),a()&&`status-pulse`,t.class))]),z(e,o),O()}var uC=L(`<span class="status-trigger svelte-19t05xp" title="Open daemon status"><!> <span> </span></span>`),dC=L(`<div class="flex flex-col gap-3 p-3"><header class="flex items-center justify-between gap-2 border-b border-border/60 pb-2.5"><strong class="text-sm font-semibold">Nerve daemon</strong> <!></header> <dl class="flex flex-col gap-2 text-xs"><div class="flex items-center justify-between gap-3"><dt class="text-muted-foreground">Connection</dt> <dd class="flex items-center gap-1.5 font-medium"><!> </dd></div> <div class="flex items-center justify-between gap-3"><dt class="text-muted-foreground">Version</dt> <dd class="font-mono"> </dd></div> <div class="flex items-center justify-between gap-3"><dt class="text-muted-foreground">Uptime</dt> <dd class="font-medium"> </dd></div> <div class="flex items-center justify-between gap-3"><dt class="text-muted-foreground">Index</dt> <dd> </dd></div> <div class="flex items-center justify-between gap-3"><dt class="text-muted-foreground">Home</dt> <dd class="min-w-0 truncate font-mono"> </dd></div></dl></div>`);function fC(e,t){D(t,!0);let n=q(t,`connection`,3,`connecting`),r=q(t,`live`,3,!1),i=q(t,`side`,3,`top`),a=k(()=>r()?`good`:n()===`error`?`danger`:n()===`closed`?`warn`:`running`),o=k(()=>r()?`Connected`:n()),s=k(()=>{if(!t.status?.startedAt)return null;let e=new Date(t.status.startedAt).getTime();return Number.isNaN(e)?null:rf((Date.now()-e)/6e4)});oC(e,{class:`status-popover`,triggerClass:`status-trigger-wrap`,ariaLabel:`Open daemon status`,get side(){return i()},align:`end`,trigger:e=>{var t=uC(),n=M(t);lC(n,{get tone(){return I(a)},get pulse(){return r()}});var i=P(n,2),s=M(i,!0);T(i),T(t),F(()=>B(s,I(o))),z(e,t)},children:(e,r)=>{var i=dC(),c=M(i);uf(P(M(c),2),{size:`xs`,get tone(){return I(a)},children:(e,t)=>{E();var n=ki();F(()=>B(n,I(o))),z(e,n)},$$slots:{default:!0}}),T(c);var l=P(c,2),u=M(l),d=P(M(u),2),f=M(d);lC(f,{get tone(){return I(a)},size:`xs`});var p=P(f,1,!0);T(d),T(u);var m=P(u,2),h=P(M(m),2),g=M(h,!0);T(h),T(m);var _=P(m,2),v=P(M(_),2),y=M(v,!0);T(v),T(_);var b=P(_,2),x=P(M(b),2),S=M(x,!0);T(x),T(b);var ee=P(b,2),C=P(M(ee),2),te=M(C,!0);T(C),T(ee),T(l),T(i),F(()=>{B(p,n()),B(g,t.status?.version??`—`),B(y,I(s)??`—`),ra(x,1,Zi(t.status?.storage.indexHealthy?`text-success`:`text-warning`)),B(S,t.status==null?`—`:t.status.storage.indexHealthy?`healthy`:`rebuilding`),W(C,`title`,t.status?.storage.home),B(te,t.status?.storage.home??`—`)}),z(e,i)},$$slots:{trigger:!0,default:!0}}),O()}var pC=L(`<span class="text-xs text-muted-foreground"> </span>`),mC=L(`<div class="flex flex-col gap-1"><div class="flex items-center justify-between gap-2 text-xs"><span class="text-muted-foreground"> </span> <span> </span></div> <div class="h-1 overflow-hidden rounded-full bg-muted"><div></div></div> <!></div>`),hC=L(`<span class="trigger-muted svelte-fvy830"> </span>`),gC=L(`<span class="trigger-muted svelte-fvy830">/</span> <span> </span>`,1),_C=L(`<span class="subscription-trigger svelte-fvy830"><!> <span> <!></span> <!></span>`),vC=L(`<span class="font-normal text-muted-foreground"> </span>`),yC=L(`<!> <!>`,1),bC=L(`<span class="text-xs text-muted-foreground">No data</span>`),xC=L(`<section><div class="flex items-center justify-between gap-2"><span class="flex items-baseline gap-1.5 text-xs font-semibold"> <!></span> <!></div> <!></section>`),SC=L(`<div class="flex flex-col gap-3 p-3"><header class="flex items-center justify-between gap-2 border-b border-border/60 pb-2.5"><strong class="text-sm font-semibold">Subscription usage</strong> <!></header> <div class="flex flex-col gap-2.5"></div></div>`);function CC(e,t){D(t,!0);let n=(e,t=w,n=w)=>{let r=k(()=>n()?.usedPercent??null),s=k(()=>i(n()));var u=mC(),d=M(u),f=M(d),p=M(f,!0);T(f);var m=P(f,2),h=M(m,!0);T(m),T(d);var g=P(d,2),_=M(g);T(g);var v=P(g,2),y=e=>{var t=pC(),n=M(t);T(t),F(()=>B(n,`resets in ${I(s)??``}`)),z(e,t)};V(v,e=>{I(s)&&e(y)}),T(u),F((e,n,r,i)=>{B(p,t()),ra(m,1,e,`svelte-fvy830`),B(h,n),ra(_,1,r,`svelte-fvy830`),aa(_,`width: ${i??``}%`)},[()=>Zi(ul(`font-medium tabular-nums`,c(I(r)))),()=>a(I(r)),()=>Zi(ul(`h-full rounded-full`,l(I(r)))),()=>o(I(r))]),z(e,u)},r=q(t,`usages`,19,()=>[]);function i(e){return e?af(e.resetsAt)??of(e.resetAfterSeconds):null}function a(e){return e==null?`—`:`${Math.round(e)}%`}function o(e){return e==null?0:Math.min(100,Math.max(0,e))}function s(e){return e===`openai-codex`?`Codex`:e===`anthropic`?`Anthropic`:e}function c(e){let t=nf(e);return t===`error`?`text-destructive`:t===`warning`?`text-warning`:``}function l(e){let t=nf(e);return t===`error`?`bg-destructive`:t===`warning`?`bg-warning`:`bg-success`}function u(e){let t=nf(e);return t===`error`?`danger`:t===`warning`?`warn`:`good`}function d(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}let f=k(r),p=k(()=>I(f).some(e=>e.usage)),m=k(()=>I(f).find(e=>e.active&&e.usage)??I(f).find(e=>e.usage)),h=k(()=>I(m)?.usage?.session?.usedPercent??null),g=k(()=>i(I(m)?.usage?.session)),_=k(()=>I(m)?.usage?.weekly?.usedPercent??null),v=k(()=>u(Math.max(I(h)??0,I(_)??0))),y=k(()=>d(I(f).map(e=>e.usage?.updatedAt).filter(e=>!!e).sort().at(-1))),b=k(()=>{let e=[];for(let t of I(f)){if(!t.usage)continue;let n=a(t.usage.session?.usedPercent),r=a(t.usage.weekly?.usedPercent);e.push(`${s(t.provider)} — session ${n} / weekly ${r}`)}return e.join(`
|
|
16
|
-
`)});var x=R(),S=N(x),ee=e=>{oC(e,{class:`subscription-popover`,triggerClass:`subscription-trigger-wrap`,ariaLabel:`Open subscription usage details`,side:`top`,align:`end`,trigger:e=>{var t=_C(),n=M(t);{let e=k(()=>I(v)!==`good`);lC(n,{get tone(){return I(v)},get pulse(){return I(e)},size:`xs`})}var r=P(n,2),i=M(r),o=P(i),s=e=>{var t=hC(),n=M(t);T(t),F(()=>B(n,`(${I(g)??``})`)),z(e,t)};V(o,e=>{I(g)!=null&&e(s)}),T(r);var l=P(r,2),u=e=>{var t=gC(),n=P(N(t),2),r=M(n);T(n),F((e,t)=>{ra(n,1,e,`svelte-fvy830`),B(r,`W:${t??``}`)},[()=>Zi(ul(`trigger-part`,c(I(_)))),()=>a(I(_))]),z(e,t)};V(l,e=>{I(_)!=null&&e(u)}),T(t),F((e,n)=>{W(t,`title`,I(b)),ra(r,1,e,`svelte-fvy830`),B(i,`S:${n??``}`)},[()=>Zi(ul(`trigger-part`,c(I(h)))),()=>a(I(h))]),z(e,t)},children:(e,t)=>{var r=SC(),i=M(r),a=P(M(i),2),o=e=>{var t=pC(),n=M(t);T(t),F(()=>B(n,`Updated ${I(y)??``}`)),z(e,t)};V(a,e=>{I(y)&&e(o)}),T(i);var c=P(i,2);Ri(c,21,()=>I(f),e=>e.provider,(e,t)=>{var r=xC(),i=M(r),a=M(i),o=M(a),c=P(o),l=e=>{var n=vC(),r=M(n);T(n),F(()=>B(r,`· ${I(t).usage.planType??``}`)),z(e,n)};V(c,e=>{I(t).usage?.planType&&e(l)}),T(a);var u=P(a,2),d=e=>{uf(e,{size:`xs`,tone:`neutral`,children:(e,t)=>{E(),z(e,ki(`Active`))},$$slots:{default:!0}})};V(u,e=>{I(t).active&&e(d)}),T(i);var f=P(i,2),p=e=>{var r=yC(),i=N(r);n(i,()=>`Session`,()=>I(t).usage.session),n(P(i,2),()=>`Weekly`,()=>I(t).usage.weekly),z(e,r)},m=e=>{z(e,bC())};V(f,e=>{I(t).usage?e(p):e(m,-1)}),T(r),F((e,t)=>{ra(r,1,e,`svelte-fvy830`),B(o,`${t??``} `)},[()=>Zi(ul(`flex flex-col gap-2 rounded-md border border-border/60 p-2.5`,I(t).active&&`bg-muted/40`)),()=>s(I(t).provider)]),z(e,r)}),T(c),T(r),z(e,r)},$$slots:{trigger:!0,default:!0}})};V(S,e=>{I(p)&&e(ee)}),z(e,x),O()}var wC=new Set([`$$slots`,`$$events`,`$$legacy`]);function TC(e,t){let n=G(t,wC),r=[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}],[`path`,{d:`M3 3v5h5`}]];uc(e,K({name:`rotate-ccw`},()=>n,{get iconNode(){return r}}))}var EC=new Set([`$$slots`,`$$events`,`$$legacy`]);function DC(e,t){let n=G(t,EC),r=[[`circle`,{cx:`11`,cy:`11`,r:`8`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`}]];uc(e,K({name:`zoom-in`},()=>n,{get iconNode(){return r}}))}var OC=new Set([`$$slots`,`$$events`,`$$legacy`]);function kC(e,t){let n=G(t,OC),r=[[`circle`,{cx:`11`,cy:`11`,r:`8`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`}]];uc(e,K({name:`zoom-out`},()=>n,{get iconNode(){return r}}))}var AC=In({utilityTab:`git`,sidebarCollapsed:!1,utilityCollapsed:!1,navDrawerOpen:!1,utilityDrawerOpen:!1}),jC=1.1,MC=In({preference:`system`}),NC=In({level:0});function PC(e=MC.preference){MC.preference=e,lc(e)}function FC(e){return Number.isFinite(e)?Math.min(8,Math.max(-8,Math.round(e))):0}function IC(e){return jC**FC(e)}function LC(e){return Math.round(IC(e)*100)}function RC(e){let t=FC(e);NC.level=t,!(typeof document>`u`)&&document.documentElement.style.setProperty(`--nerve-zoom-scale`,IC(t).toFixed(4))}function zC(){return typeof localStorage>`u`?!1:localStorage.getItem(`nerve.sidebarCollapsed`)===`1`}function BC(e){AC.sidebarCollapsed=e,typeof localStorage<`u`&&localStorage.setItem(`nerve.sidebarCollapsed`,e?`1`:`0`)}function VC(){return typeof localStorage>`u`?!1:localStorage.getItem(`nerve.utilityCollapsed`)===`1`}function HC(e){AC.utilityCollapsed=e,typeof localStorage<`u`&&localStorage.setItem(`nerve.utilityCollapsed`,e?`1`:`0`)}function UC(e){AC.navDrawerOpen=e}function WC(e){AC.utilityDrawerOpen=e}function GC(){AC.navDrawerOpen=!0,AC.utilityDrawerOpen=!1}function KC(){AC.utilityDrawerOpen=!0,AC.navDrawerOpen=!1}function qC(){AC.navDrawerOpen=!1,AC.utilityDrawerOpen=!1}function JC(){return Ys.current??`system`}var YC=L(`<span class="zoom-trigger svelte-ru0gry"><span> </span></span>`),XC=L(`<div class="zoom-card svelte-ru0gry"><header class="svelte-ru0gry"><div class="svelte-ru0gry"><strong class="svelte-ru0gry">Zoom</strong> <span class="svelte-ru0gry"> </span></div> <span class="zoom-percent svelte-ru0gry"> </span></header> <div class="zoom-actions svelte-ru0gry" aria-label="Zoom controls"><!> <!> <!></div> <label class="zoom-slider svelte-ru0gry"><span class="svelte-ru0gry">Level</span> <input type="range" step="1" aria-label="Zoom level" class="svelte-ru0gry"/> <span class="zoom-range-labels svelte-ru0gry" aria-hidden="true"><span> </span> <span>0</span> <span> </span></span></label></div>`);function ZC(e,t){D(t,!0);let n=q(t,`zoomLevel`,3,0),r=k(()=>FC(n())),i=k(()=>LC(I(r))),a=k(()=>I(r)>0?`+${I(r)}`:String(I(r)));function o(e){t.onZoomLevelChange?.(FC(e))}function s(e){o(I(r)+e)}function c(e){let t=e.currentTarget;o(Number(t.value))}oC(e,{class:`zoom-popover`,triggerClass:`zoom-trigger-wrap`,ariaLabel:`Open zoom controls`,side:`top`,align:`end`,trigger:e=>{var t=YC(),n=M(t),r=M(n);T(n),T(t),F(()=>{W(t,`title`,`Zoom: ${I(i)}%`),B(r,`${I(i)??``}%`)}),z(e,t)},children:(e,t)=>{var n=XC(),l=M(n),u=M(l),d=P(M(u),2),f=M(d);T(d),T(u);var p=P(u,2),m=M(p);T(p),T(l);var h=P(l,2),g=M(h);{let e=k(()=>I(r)<=-8);Ml(g,{variant:`outline`,size:`icon-sm`,ariaLabel:`Zoom out`,title:`Zoom out`,get disabled(){return I(e)},onclick:()=>s(-1),children:(e,t)=>{kC(e,{size:14,strokeWidth:2.1,"aria-hidden":`true`})},$$slots:{default:!0}})}var _=P(g,2);{let e=k(()=>I(r)===0);Ml(_,{variant:`outline`,size:`icon-sm`,ariaLabel:`Reset zoom`,title:`Reset zoom`,get disabled(){return I(e)},onclick:()=>o(0),children:(e,t)=>{TC(e,{size:14,strokeWidth:2.1,"aria-hidden":`true`})},$$slots:{default:!0}})}var v=P(_,2);{let e=k(()=>I(r)>=8);Ml(v,{variant:`outline`,size:`icon-sm`,ariaLabel:`Zoom in`,title:`Zoom in`,get disabled(){return I(e)},onclick:()=>s(1),children:(e,t)=>{DC(e,{size:14,strokeWidth:2.1,"aria-hidden":`true`})},$$slots:{default:!0}})}T(h);var y=P(h,2),b=P(M(y),2);va(b);var x=P(b,2),S=M(x),ee=M(S,!0);T(S);var C=P(S,4),te=M(C);T(C),T(x),T(y),T(n),F(()=>{B(f,`Zoom level ${I(a)??``}`),B(m,`${I(i)??``}%`),W(b,`min`,-8),W(b,`max`,8),ya(b,I(r)),B(ee,-8),B(te,`+8`)}),bi(`input`,b,c),z(e,n)},$$slots:{trigger:!0,default:!0}}),O()}xi([`input`]);var QC=L(`<span class="footer-chip svelte-1lcv47q" title="Git branch"><!> <span> </span></span>`),$C=L(`<span class="footer-chip svelte-1lcv47q" title="Running tasks"><!> <span> </span></span>`),ew=L(`<span class="footer-chip warn svelte-1lcv47q" title="Pending approvals"><!> <span> </span></span>`),tw=L(`<!> <!> <!> <!> <!>`,1),nw=L(`<footer class="footerbar svelte-1lcv47q"><div class="footer-group svelte-1lcv47q"><!> <span class="footer-path svelte-1lcv47q"> </span></div> <div class="footer-group footer-right svelte-1lcv47q"><!> <!> <!></div></footer>`);function rw(e,t){D(t,!0);let n=q(t,`connection`,3,`connecting`),r=q(t,`live`,3,!1),i=q(t,`pendingApprovals`,3,0),a=q(t,`tasks`,19,()=>[]),o=q(t,`subscriptionUsages`,19,()=>[]),s=q(t,`zoomLevel`,3,0),c=q(t,`sidebarCollapsed`,3,!1),l=q(t,`utilityCollapsed`,3,!1),u=q(t,`phone`,3,!1),d=k(()=>a().filter(e=>[`starting`,`running`,`ready`,`stopping`].includes(e.status)).length),f=k(()=>t.activeProject?Hd(t.activeProject.dir,t.homeDir):`No project`);var p=nw(),m=M(p),h=M(m);{let e=k(()=>c()?`Show agents panel`:`Hide agents panel`),n=k(()=>!c());Ml(h,{variant:`ghost`,size:`icon-sm`,class:`footer-toggle`,ariaLabel:`Toggle agents panel`,get title(){return I(e)},get pressed(){return I(n)},onclick:()=>t.onToggleSidebar?.(),children:(e,t)=>{var n=R(),r=N(n),i=e=>{jd(e,{size:13,strokeWidth:2.1,"aria-hidden":`true`})},a=e=>{Nd(e,{size:13,strokeWidth:2.1,"aria-hidden":`true`})};V(r,e=>{c()?e(i):e(a,-1)}),z(e,n)},$$slots:{default:!0}})}var g=P(h,2),_=M(g,!0);T(g),T(m);var v=P(m,2),y=M(v),b=e=>{var n=tw(),r=N(n),a=e=>{var n=QC(),r=M(n);kd(r,{size:12,strokeWidth:2.1,"aria-hidden":`true`});var i=P(r,2),a=M(i);T(i),T(n),F(()=>B(a,`${t.gitStatus.branch??``}${t.gitStatus.dirty?`*`:``}`)),z(e,n)};V(r,e=>{t.gitStatus&&e(a)});var c=P(r,2),l=e=>{var t=$C(),n=M(t);zd(n,{size:12,strokeWidth:2.1,"aria-hidden":`true`});var r=P(n,2),i=M(r,!0);T(r),T(t),F(()=>B(i,I(d))),z(e,t)};V(c,e=>{I(d)>0&&e(l)});var u=P(c,2),f=e=>{var t=ew(),n=M(t);Vd(n,{size:12,strokeWidth:2.1,"aria-hidden":`true`});var r=P(n,2),a=M(r,!0);T(r),T(t),F(()=>B(a,i())),z(e,t)};V(u,e=>{i()>0&&e(f)});var p=P(u,2);CC(p,{get usages(){return o()}}),ZC(P(p,2),{get zoomLevel(){return s()},get onZoomLevelChange(){return t.onZoomLevelChange}}),z(e,n)};V(y,e=>{u()||e(b)});var x=P(y,2);fC(x,{get connection(){return n()},get live(){return r()},get status(){return t.status},side:`top`});var S=P(x,2);{let e=k(()=>l()?`Show utility panel`:`Hide utility panel`),n=k(()=>!l());Ml(S,{variant:`ghost`,size:`icon-sm`,class:`footer-toggle`,ariaLabel:`Toggle utility panel`,get title(){return I(e)},get pressed(){return I(n)},onclick:()=>t.onToggleUtility?.(),children:(e,t)=>{var n=R(),r=N(n),i=e=>{Fd(e,{size:13,strokeWidth:2.1,"aria-hidden":`true`})},a=e=>{Ld(e,{size:13,strokeWidth:2.1,"aria-hidden":`true`})};V(r,e=>{l()?e(i):e(a,-1)}),z(e,n)},$$slots:{default:!0}})}T(v),T(p),F(()=>{W(g,`title`,t.activeProject?.dir),B(_,I(f))}),z(e,p),O()}var iw=`max-width: 1023px`,aw=`max-width: 639px`,ow,sw;typeof window<`u`&&typeof window.matchMedia==`function`&&(ow=new Po(iw),sw=new Po(aw));var cw={get isCompact(){return ow?.current??!1},get isPhone(){return sw?.current??!1}},lw=[],uw,dw=!1,fw=!1,pw=1e3,mw=500,hw=1e4,gw=[/ResizeObserver loop completed with undelivered notifications\./i,/ResizeObserver loop limit exceeded/i];function _w(e){return typeof e==`string`&&gw.some(t=>t.test(e))}function vw(){dw||typeof window>`u`||(dw=!0,window.addEventListener(`error`,e=>{_w((e.error instanceof Error?e.error.message:void 0)??e.message)||yw(`error`,`web-runtime`,`Unhandled browser error`,{context:{filename:e.filename,lineno:e.lineno,colno:e.colno},error:e.error??e.message})}),window.addEventListener(`unhandledrejection`,e=>{yw(`error`,`web-runtime`,`Unhandled promise rejection`,{error:e.reason})}))}function yw(e,t,n,r={}){lw.push({level:e,component:t,message:n,ts:new Date().toISOString(),durationMs:r.durationMs,context:r.context,error:r.error?Cw(r.error):void 0}),lw.length>200&&lw.splice(0,lw.length-200),xw()}function bw(e,t,n,r,i){yw(n&&n<500?`warn`:`error`,`api`,`API request failed`,{durationMs:r,context:{method:e,path:t,status:n},error:i})}function xw(e=mw){uw===void 0&&(uw=setTimeout(()=>{uw=void 0,Sw()},e))}async function Sw(){if(fw||lw.length===0)return;fw=!0;let e=lw.splice(0,50),t=mw;try{let t=await fetch(`/api/logs/client`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({logs:e})});if(!t.ok)throw Error(`${t.status} ${t.statusText}`);pw=1e3}catch(n){lw.unshift(...e),lw.length>200&&lw.splice(0,lw.length-200),t=pw,pw=Math.min(pw*2,hw),console.warn(`Failed to submit Nerve client logs`,n)}finally{fw=!1,lw.length>0&&xw(t)}}function Cw(e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(typeof e==`string`)return{message:e};if(e&&typeof e==`object`){let t=ww(e);return{message:typeof e.message==`string`?e.message:t.split(`
|
|
17
|
-
`,1)[0],stack:t}}return{message:String(e)}}function ww(e){try{let t=new WeakSet;return JSON.stringify(e,(e,n)=>{if(n&&typeof n==`object`){if(t.has(n))return`[Circular]`;t.add(n)}return n},2)}catch{return String(e)}}var Tw=class extends Error{status;code;constructor(e,t,n){super(n),this.status=e,this.code=t,this.name=`ApiRequestError`}};function Ew(){return typeof window<`u`?window.location.origin:`http://localhost`}function Dw(e){if(typeof e==`number`&&!Number.isFinite(e))throw Error(`API path segment must be a finite number.`);return encodeURIComponent(String(e))}function Ow(e){if(!(e===`/api`||e.startsWith(`/api/`)||e.startsWith(`/api?`))||e.startsWith(`//`))throw Error(`API requests must use a same-origin /api path.`);let t=new URL(e,Ew());if(t.origin!==Ew())throw Error(`API requests must stay on the current origin.`);if(!(t.pathname===`/api`||t.pathname.startsWith(`/api/`)))throw Error(`API requests must stay under /api.`);return`${t.pathname}${t.search}`}async function kw(e){let t=e.headers.get(`content-type`)??``;if(!e.ok)throw Error(await e.text());if(!t.includes(`application/json`)){let n=await e.text();throw Error(`Expected JSON response from ${e.url||`API`}, received ${t||`unknown content type`}. ${n.slice(0,80)}`)}return await e.json()}async function Aw(e,t={}){let n=performance.now(),r=t.method??`GET`,i=Ow(e),a;try{return a=await fetch(i,{credentials:`same-origin`,...t}),await kw(a)}catch(e){throw bw(r,i,a?.status,Math.round(performance.now()-n),e),e}}async function jw(e){return Aw(e)}async function Mw(e,t){return Aw(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}async function Nw(e,t){return Aw(e,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}async function Pw(e,t){return Aw(e,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}async function Fw(e){return Aw(e,{method:`DELETE`})}async function Iw(e){let t=Ow(e),n=await fetch(t,{method:`DELETE`,credentials:`same-origin`});if(!n.ok)throw Error(await n.text())}function Lw(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`Failed to read file.`)),r.onload=()=>{let e=String(r.result??``);t(e.includes(`,`)?e.slice(e.indexOf(`,`)+1):e)},r.readAsDataURL(e)})}function Rw(e){try{let t=JSON.parse(e);return{code:typeof t.error?.code==`string`?t.error.code:void 0,message:typeof t.error?.message==`string`?t.error.message:void 0}}catch{return{}}}async function zw(e){return(await jw(`/api/conversations/${Dw(e)}/snapshot`)).snapshot}async function Bw(e){return(await jw(`/api/conversations/${Dw(e)}/context-usage`)).contextUsage}async function Vw(e){return Mw(`/api/conversations/${Dw(e)}/compact`,{})}async function Hw(e){await Iw(`/api/conversations/${Dw(e)}`)}var Uw=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ww(e,t){let n=G(t,Uw),r=[[`path`,{d:`M12 8V4H8`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`}],[`path`,{d:`M2 14h2`}],[`path`,{d:`M20 14h2`}],[`path`,{d:`M15 13v2`}],[`path`,{d:`M9 13v2`}]];uc(e,K({name:`bot`},()=>n,{get iconNode(){return r}}))}var Gw=new Set([`$$slots`,`$$events`,`$$legacy`]);function Kw(e,t){let n=G(t,Gw),r=[[`path`,{d:`m6 9 6 6 6-6`}]];uc(e,K({name:`chevron-down`},()=>n,{get iconNode(){return r}}))}var qw=new Set([`$$slots`,`$$events`,`$$legacy`]);function Jw(e,t){let n=G(t,qw),r=[[`path`,{d:`m9 18 6-6-6-6`}]];uc(e,K({name:`chevron-right`},()=>n,{get iconNode(){return r}}))}var Yw=new Set([`$$slots`,`$$events`,`$$legacy`]);function Xw(e,t){let n=G(t,Yw),r=[[`path`,{d:`M12 15V3`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}],[`path`,{d:`m7 10 5 5 5-5`}]];uc(e,K({name:`download`},()=>n,{get iconNode(){return r}}))}var Zw=new Set([`$$slots`,`$$events`,`$$legacy`]);function Qw(e,t){let n=G(t,Zw),r=[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`}]];uc(e,K({name:`layers`},()=>n,{get iconNode(){return r}}))}var $w=new Set([`$$slots`,`$$events`,`$$legacy`]);function eT(e,t){let n=G(t,$w),r=[[`path`,{d:`M15 12h-5`}],[`path`,{d:`M15 8h-5`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`}]];uc(e,K({name:`scroll-text`},()=>n,{get iconNode(){return r}}))}function tT(e){return e===`planning`?`good`:`running`}function nT(e,t=!1,n){return e===`awaiting_user`?`warn`:e===`running`||t?tT(n):`neutral`}function rT(e,t=!1){return e===`awaiting_user`?!1:e===`running`||t}function iT(e){return e===`running`||e===`ready`?`good`:e===`starting`||e===`stopping`?`warn`:e===`failed`||e===`timed_out`||e===`orphaned`?`danger`:`neutral`}function aT(e){return e===`running`||e===`ready`||e===`starting`||e===`stopping`}function oT(e){return e===`error`?`danger`:e===`warn`?`warn`:`neutral`}var sT=L(`<div class="flex shrink-0 items-center gap-1 text-xs text-muted-foreground"><!></div>`),cT=L(`<div class="flex shrink-0 items-center gap-0.5"><!></div>`),lT=L(`<div><!></div>`),uT=L(`<section class="overflow-hidden rounded-lg border bg-card"><div><button type="button" class="flex min-w-0 flex-1 items-center gap-1.5 rounded-sm px-1 py-0.5 text-left text-xs font-semibold text-foreground transition-colors hover:text-foreground/90 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50"><!> <!> <span class="truncate"> </span></button> <!> <!></div> <!></section>`);function dT(e,t){D(t,!0);let n=q(t,`open`,15,!0);function r(){n(!n()),t.onOpenChange?.(n())}var i=uT(),a=M(i),o=M(a),s=M(o),c=e=>{Kw(e,{size:13,strokeWidth:2.2,class:`shrink-0 text-muted-foreground`})},l=e=>{Jw(e,{size:13,strokeWidth:2.2,class:`shrink-0 text-muted-foreground`})};V(s,e=>{n()?e(c):e(l,-1)});var u=P(s,2),d=e=>{var n=R();U(N(n),()=>t.icon,(e,t)=>{t(e,{size:13,strokeWidth:2.2,class:`shrink-0 text-muted-foreground`})}),z(e,n)};V(u,e=>{t.icon&&e(d)});var f=P(u,2),p=M(f,!0);T(f),T(o);var m=P(o,2),h=e=>{var n=sT();H(M(n),()=>t.meta),T(n),z(e,n)};V(m,e=>{t.meta&&e(h)});var g=P(m,2),_=e=>{var n=cT();H(M(n),()=>t.actions),T(n),z(e,n)};V(g,e=>{t.actions&&e(_)}),T(a);var v=P(a,2),y=e=>{var n=lT();H(M(n),()=>t.children),T(n),F(e=>ra(n,1,e),[()=>Zi(ul(`px-3 py-2.5`,t.contentClass))]),z(e,n)};V(v,e=>{n()&&e(y)}),T(i),F(e=>{ra(a,1,e),W(o,`aria-expanded`,n()),B(p,t.title)},[()=>Zi(ul(`flex items-center gap-1 px-2 py-1.5`,n()&&`border-b`))]),bi(`click`,o,r),z(e,i),O()}xi([`click`]);var fT=L(`<dt class="font-mono text-xs text-muted-foreground"> </dt> <dd class="truncate font-mono text-xs text-foreground"> </dd>`,1),pT=L(`<dl class="grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1.5"></dl>`),mT=L(`<p class="px-3 py-2.5 text-xs text-muted-foreground">No agents in the active conversation.</p>`),hT=L(`<button type="button"><!> <div class="min-w-0 flex-1"><div class="flex items-center gap-1.5 truncate text-xs text-foreground"><span>Main agent</span> <span class="font-mono text-xs text-muted-foreground"> </span></div> <div class="truncate text-xs text-muted-foreground"> </div></div></button>`),gT=L(`<div class="px-3 pt-2.5 pb-1"><h4 class="text-xs font-semibold uppercase tracking-wide text-muted-foreground">Main agent</h4></div> <!>`,1),_T=L(`<button type="button"><!> <div class="min-w-0 flex-1"><div class="flex items-center gap-1.5 truncate text-xs text-foreground"><span>Subagent</span> <span class="font-mono text-xs text-muted-foreground"> </span></div> <div class="truncate text-xs text-muted-foreground"> </div></div></button>`),vT=L(`<button class="flex w-full items-center gap-1 px-3 pt-2.5 pb-1 text-left" type="button"><!> <h4 class="text-xs font-semibold uppercase tracking-wide text-muted-foreground">Subagents</h4> <span class="text-xs text-muted-foreground"> </span></button> <!>`,1),yT=L(`<div class="-mx-3 -my-2.5 flex flex-col"><!> <!> <!></div>`),bT=L(`<a class="inline-flex w-fit items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs font-medium text-foreground transition-colors hover:bg-muted/60" download=""><!>Export system prompt</a>`),xT=L(`<span class="text-xs text-muted-foreground">No active agent.</span>`),ST=L(`<div class="flex flex-col gap-3"><div class="flex flex-col gap-1.5"><span class="text-xs font-semibold uppercase tracking-wide text-muted-foreground">Conversation</span> <div class="flex flex-wrap gap-1.5"><!> <!> <!></div></div> <div class="flex flex-col gap-1.5"><span class="text-xs font-semibold uppercase tracking-wide text-muted-foreground">System prompt</span> <!></div></div>`),CT=L(`<div class="flex flex-col gap-2 p-2"><!> <!> <!></div>`);function wT(e,t){D(t,!0);let n=q(t,`conversationAgents`,19,()=>[]),r=k(()=>t.systemPromptUrl?.()),i=A(!0),a=A(!0),o=A(!0),s=k(()=>[{label:`Project`,value:t.activeProject?.name},{label:`Directory`,value:t.activeProject?.dir},{label:`Conversation`,value:t.activeConversation?.id},{label:`Agent`,value:t.activeAgent?.id},{label:`Daemon`,value:t.status?.daemonId},{label:`Data`,value:t.status?.dataDir}]),c=k(()=>n().filter(e=>!e.parentAgentId)),l=k(()=>n().filter(e=>e.parentAgentId));function u(e){let t=e.split(`_`);return t.length>1?t.at(-1)??e:e.slice(-6)}function d(e){return e.status===`running`||e.status===`awaiting_user`}function f(e){return[...e].sort((e,n)=>{let r=+(e.id===t.activeAgent?.id),i=+(n.id===t.activeAgent?.id);if(r!==i)return i-r;let a=+!!d(e),o=+!!d(n);if(a!==o)return o-a;let s=new Date(e.updatedAt).getTime(),c=new Date(n.updatedAt).getTime();if(s!==c)return c-s;let l=new Date(e.createdAt).getTime();return new Date(n.createdAt).getTime()-l})}let p=A(!1);sr(()=>{I(l).some(d)&&j(p,!0)});var m=CT(),h=M(m);dT(h,{title:`Active Context`,get icon(){return Qw},get open(){return I(i)},set open(e){j(i,e,!0)},children:(e,t)=>{var n=pT();Ri(n,21,()=>I(s),Fi,(e,t)=>{var n=fT(),r=N(n),i=M(r,!0);T(r);var a=P(r,2),o=M(a,!0);T(a),F(()=>{B(i,I(t).label),W(a,`title`,I(t).value),B(o,I(t).value??`—`)}),z(e,n)}),T(n),z(e,n)},$$slots:{default:!0}});var g=P(h,2);dT(g,{title:`Agents`,get icon(){return Ww},get open(){return I(a)},set open(e){j(a,e,!0)},children:(e,r)=>{var i=yT(),a=M(i),o=e=>{z(e,mT())};V(a,e=>{n().length===0&&e(o)});var s=P(a,2),d=e=>{var n=gT();Ri(P(N(n),2),17,()=>f(I(c)),e=>e.id,(e,n)=>{var r=hT(),i=M(r);{let e=k(()=>nT(I(n).status,!1,I(n).mode)),t=k(()=>rT(I(n).status));lC(i,{get tone(){return I(e)},get pulse(){return I(t)}})}var a=P(i,2),o=M(a),s=P(M(o),2),c=M(s,!0);T(s),T(o);var l=P(o,2),d=M(l);T(l),T(a),T(r),F(e=>{ra(r,1,`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-muted/60 ${I(n).id===t.activeAgent?.id?`bg-muted/60`:``}`),W(r,`title`,I(n).id),B(c,e),B(d,`${I(n).status??``} · ${I(n).mode??``} · ${I(n).permissionLevel??``}`)},[()=>u(I(n).id)]),bi(`click`,r,()=>t.onSelectAgent?.(I(n))),z(e,r)}),z(e,n)};V(s,e=>{I(c).length>0&&e(d)});var m=P(s,2),h=e=>{var n=vT(),r=N(n),i=M(r),a=e=>{Kw(e,{size:13,strokeWidth:2.2,class:`shrink-0 text-muted-foreground`})},o=e=>{Jw(e,{size:13,strokeWidth:2.2,class:`shrink-0 text-muted-foreground`})};V(i,e=>{I(p)?e(a):e(o,-1)});var s=P(i,4),c=M(s);T(s),T(r);var d=P(r,2),m=e=>{var n=R();Ri(N(n),17,()=>f(I(l)),e=>e.id,(e,n)=>{var r=_T(),i=M(r);{let e=k(()=>nT(I(n).status,!1,I(n).mode)),t=k(()=>rT(I(n).status));lC(i,{get tone(){return I(e)},get pulse(){return I(t)}})}var a=P(i,2),o=M(a),s=P(M(o),2),c=M(s,!0);T(s),T(o);var l=P(o,2),d=M(l);T(l),T(a),T(r),F(e=>{ra(r,1,`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-muted/60 ${I(n).id===t.activeAgent?.id?`bg-muted/60`:``}`),W(r,`title`,I(n).id),B(c,e),B(d,`${I(n).status??``} · ${I(n).mode??``} · ${I(n).permissionLevel??``}`)},[()=>u(I(n).id)]),bi(`click`,r,()=>t.onSelectAgent?.(I(n))),z(e,r)}),z(e,n)};V(d,e=>{I(p)&&e(m)}),F(()=>B(c,`· ${I(l).length??``}`)),bi(`click`,r,()=>j(p,!I(p))),z(e,n)};V(m,e=>{I(l).length>0&&e(h)}),T(i),z(e,i)},$$slots:{default:!0}});var _=P(g,2),v=e=>{dT(e,{title:`Export`,get icon(){return Xw},get open(){return I(o)},set open(e){j(o,e,!0)},children:(e,n)=>{var i=ST(),a=M(i),o=P(M(a),2),s=M(o);{let e=k(()=>t.exportUrl?.(`json`)),n=k(()=>`conversation-${t.activeConversation.id}.json`);uf(s,{get href(){return I(e)},get download(){return I(n)},variant:`outline`,size:`sm`,children:(e,t)=>{E(),z(e,ki(`JSON`))},$$slots:{default:!0}})}var c=P(s,2);{let e=k(()=>t.exportUrl?.(`md`)),n=k(()=>`conversation-${t.activeConversation.id}.md`);uf(c,{get href(){return I(e)},get download(){return I(n)},variant:`outline`,size:`sm`,children:(e,t)=>{E(),z(e,ki(`Markdown`))},$$slots:{default:!0}})}var l=P(c,2);{let e=k(()=>t.exportUrl?.(`html`)),n=k(()=>`conversation-${t.activeConversation.id}.html`);uf(l,{get href(){return I(e)},get download(){return I(n)},variant:`outline`,size:`sm`,children:(e,t)=>{E(),z(e,ki(`HTML`))},$$slots:{default:!0}})}T(o),T(a);var u=P(a,2),d=P(M(u),2),f=e=>{var t=bT();eT(M(t),{size:13,strokeWidth:2.2}),E(),T(t),F(()=>W(t,`href`,I(r))),z(e,t)},p=e=>{z(e,xT())};V(d,e=>{I(r)?e(f):e(p,-1)}),T(u),T(i),z(e,i)},$$slots:{default:!0}})};V(_,e=>{t.activeConversation&&e(v)}),T(m),z(e,m),O()}xi([`click`]);var Y=In({status:void 0,config:void 0,connection:`connecting`,lastEventSeq:0,error:void 0,projects:[],conversations:[],agents:[],approvals:[],userQuestions:[],planReviews:[],openCenterTabs:[],activeCenterTab:void 0,projectPickerOpen:!1}),TT=In({projectId:void 0,conversationId:void 0,agentId:void 0,entryId:void 0});In({items:[]});var ET=In({text:``,projectDir:``});function DT(){TT.projectId=void 0,TT.conversationId=void 0,TT.agentId=void 0,TT.entryId=void 0}var OT=In({authTabOpen:!1,catalogLoaded:!1,customProviders:[],modelDefinitions:[]}),kT=In({conversationViews:{},pendingConversations:{},openConversationTabIds:[],activeConversationTabId:void 0,slashCompletions:[],selectedModelKey:`nerve-faux:faux-fast`,selectedThinkingLevel:`off`,selectedMode:`coding`,selectedPermissionLevel:`autonomous`}),AT=In({fileViews:{},openFileTabIds:[]}),jT=In({gitContext:void 0,gitRefreshToken:0,prViews:{},openPrTabIds:[]}),MT=In({logsTabOpen:!1}),NT=In({models:[],authProviders:[],settingsDraft:void 0,settingsSaveStatus:`idle`,settingsMessage:void 0,settingsTabOpen:!1}),PT=In({tasks:[],selectedTaskId:void 0,taskLogs:void 0,openTaskTabIds:[]});function FT(e){return`${e.kind}:${e.id}`}function IT(e,t){return!!(e&&t&&e.kind===t.kind&&e.id===t.id)}var LT,RT;function zT(e){LT=e.select,RT=e.close}function BT(e,t){return e?.[t.kind]}function VT(e,t){let n=t instanceof Error?t.message:String(t);Y.error=n,cd.error(`Could not ${e} pane`,{description:n})}function HT(){kT.openConversationTabIds=Y.openCenterTabs.filter(e=>e.kind===`conversation`).map(e=>e.id),PT.openTaskTabIds=Y.openCenterTabs.filter(e=>e.kind===`task`).map(e=>e.id),AT.openFileTabIds=Y.openCenterTabs.filter(e=>e.kind===`file`).map(e=>e.id),jT.openPrTabIds=Y.openCenterTabs.filter(e=>e.kind===`pr`).map(e=>e.id),NT.settingsTabOpen=Y.openCenterTabs.some(e=>e.kind===`settings`),OT.authTabOpen=Y.openCenterTabs.some(e=>e.kind===`auth`),MT.logsTabOpen=Y.openCenterTabs.some(e=>e.kind===`logs`)}function UT(e){let t=new Set;Y.openCenterTabs=e.filter(e=>{let n=FT(e);return t.has(n)?!1:(t.add(n),!0)}),HT()}function WT(e){Y.openCenterTabs.some(t=>IT(t,e))||(Y.openCenterTabs=[...Y.openCenterTabs,e],HT())}function GT(e,t){UT(Y.openCenterTabs.map(n=>IT(n,e)?t:n)),IT(Y.activeCenterTab,e)&&(Y.activeCenterTab=t)}function KT(e){let t=Y.openCenterTabs,n=t.findIndex(t=>IT(t,e));if(n===-1)return YT(e);let r=t.filter(t=>!IT(t,e));return r[n]??r[n-1]??r[0]}function qT(e){UT(Y.openCenterTabs.filter(t=>!IT(t,e)))}function JT(e){e&&WT(e),Y.activeCenterTab=e,e?.kind===`task`&&(PT.selectedTaskId=e.id)}function YT(e){return Y.openCenterTabs.find(t=>!e||!IT(t,e))}async function XT(e){if(!e){JT(void 0);return}try{let t=BT(LT,e);if(!t)throw Error(`No select handler for ${e.kind} panes`);await t(e)}catch(e){VT(`switch`,e)}}async function ZT(e){try{let t=BT(RT,e);if(!t)throw Error(`No close handler for ${e.kind} panes`);await t(e)}catch(e){VT(`close`,e)}}function QT(){JT(YT())}function $T(e){return`conversation-view:${e}`}function eE(e){return`pending-conversation:${e}`}function tE(e){return`file-view:${e}`}function nE(e){return`pr-view:${e}`}function rE(e){return`git-project:${e}`}function iE(e){return`git-repo:${e}`}function aE(e){return`${e.provider}:${e.modelId}`}function oE(e){let[t,...n]=e.split(`:`),r=n.join(`:`);return t&&r?{provider:t,modelId:r}:void 0}function sE(e){return e.replace(/^claude-/,`claude `).replace(/^gpt-/,`gpt `)}var cE={"nerve-faux":`Nerve Faux`,anthropic:`Anthropic`,google:`Google`,"google-vertex":`Google Vertex`,openai:`OpenAI`,"openai-codex":`OpenAI Codex`,openrouter:`OpenRouter`,xai:`xAI`};function lE(e){let t={ai:`AI`,api:`API`,aws:`AWS`,cn:`CN`,gpt:`GPT`,oauth:`OAuth`,ui:`UI`},n=e.toLowerCase();return t[n]??n[0].toUpperCase()+n.slice(1)}function uE(e){return cE[e]??e.split(/[-_\s/]+/).filter(Boolean).map(lE).join(` `)}function dE(e){return e.name||e.label||e.modelId}function fE(e){let t=new Map;for(let n of e){let e=dE(n);t.set(e,(t.get(e)??0)+1)}return t}function pE(e,t){return(fE(t).get(dE(e))??0)>1}function mE(e,t){let n=dE(e);return pE(e,t)?`${uE(e.provider)} / ${n}`:n}function hE(e,t){let n=new Set(t.filter(e=>e.configured).map(e=>e.provider));return e.filter(e=>e.faux||n.has(e.provider))}function gE(e,t,n){let r=hE(e,t);if(!n?.length)return r;let i=new Set(n.map(aE));return r.filter(e=>i.has(aE(e)))}function _E(e,t){return hE(e,t).filter(e=>!e.faux)}var vE=new Set([`$$slots`,`$$events`,`$$legacy`]);function yE(e,t){let n=G(t,vE),r=[[`path`,{d:`M12 5v14`}],[`path`,{d:`m19 12-7 7-7-7`}]];uc(e,K({name:`arrow-down`},()=>n,{get iconNode(){return r}}))}async function bE(e){let t=Qu();if(t){await t.clipboard.writeText(e);return}let n=globalThis.navigator?.clipboard;if(n?.writeText){await n.writeText(e);return}throw Error(`Clipboard API is not available.`)}function xE(e){return e.dir.replace(/[\\/]+$/,``)||e.dir}function SE(e){let t=e.replace(/[\\/]+$/,``),n=t.split(/[\\/]/);return n[n.length-1]||t}function CE(e,t){let n=e.replace(/\\/g,`/`).replace(/\/+$/,``),r=t?.replace(/\\/g,`/`).replace(/\/+$/,``),i=/^[A-Za-z]:\//.test(n)?n.toLowerCase():n,a=r&&/^[A-Za-z]:\//.test(r)?r.toLowerCase():r;r&&a&&(i===a||i.startsWith(`${a}/`))&&(n=`~${n.slice(r.length)}`);let o=n.split(`/`);return o.map((e,t)=>t===o.length-1||e===``||e===`~`?e:e.startsWith(`.`)?e.slice(0,2):e.charAt(0)).join(`/`)}function wE(e){return e?.model?sE(e.model.modelId):`model pending`}function TE(e,t){if(!t)return!0;let n=t.toLowerCase();return e.project.name.toLowerCase().includes(n)||e.project.dir.toLowerCase().includes(n)||e.projects.some(e=>e.name.toLowerCase().includes(n)||e.dir.toLowerCase().includes(n))||e.rows.some(e=>e.conversation.title.toLowerCase().includes(n)||e.conversation.id.toLowerCase().includes(n))}function EE(e,t){return t.find(t=>t.id===e.activeAgentId)??t.find(t=>t.conversationId===e.id)}function DE(e){let{conversations:t,agents:n}=e,r=new Set(e.projectIds),i=e.filter?.trim().toLowerCase()??``;return t.filter(e=>r.has(e.projectId)).filter(e=>!i||e.title.toLowerCase().includes(i)||e.id.toLowerCase().includes(i)).map(e=>({conversation:e,agent:EE(e,n)})).sort((e,t)=>t.conversation.updatedAt.localeCompare(e.conversation.updatedAt))}function OE(e){let{projects:t,conversations:n,agents:r,homeDir:i}=e,a=e.filter?.trim()??``,o=e.maxProjects??5,s=e.maxRowsPerProject??5,c=new Map(t.map(e=>[e.id,e])),l=new Map;for(let e of t){let t=xE(e),n=l.get(t);n?(n.projects.push(e),e.updatedAt>n.updatedAt&&(n.updatedAt=e.updatedAt),e.updatedAt>n.project.updatedAt&&(n.project=e)):l.set(t,{key:t,project:e,projects:[e],rows:[],hiddenRows:0,totalRows:0,label:SE(e.dir),updatedAt:e.updatedAt})}for(let e of n){let t=c.get(e.projectId);if(!t)continue;let n=xE(t),i=l.get(n)??{key:n,project:t,projects:[t],rows:[],hiddenRows:0,totalRows:0,label:SE(t.dir),updatedAt:t.updatedAt};i.rows.push({conversation:e,agent:EE(e,r)}),e.updatedAt>i.updatedAt&&(i.updatedAt=e.updatedAt),l.set(n,i)}let u=[...l.values()].filter(e=>TE(e,a)).sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)),d=Math.max(0,u.length-o),f=new Map;for(let e of u){let t=SE(e.project.dir);f.set(t,(f.get(t)??0)+1)}return{groups:u.slice(0,o).map(e=>{let t=e.rows.sort((e,t)=>t.conversation.updatedAt.localeCompare(e.conversation.updatedAt)),n=SE(e.project.dir),r=(f.get(n)??0)>1?CE(e.project.dir,i):n;return{...e,label:r,totalRows:t.length,hiddenRows:Math.max(0,t.length-s),rows:t.slice(0,s)}}),hiddenProjects:d}}var kE=/^\[Tool call:[\s\S]*\]$/;function AE(e){return e.role===`assistant`&&e.displayKind!==`thinking`&&kE.test(e.text.trim())}function jE(e,t){let n=e.createdAt.localeCompare(t.createdAt);return n===0?e.id.localeCompare(t.id):n}function ME(e){return e.status===`requested`||e.status===`pending_approval`||e.status===`waiting_for_user`||e.status===`running`}function NE(e){return Array.from(new Set([e.sourceToolCallId,e.providerToolCallId].filter(e=>!!e)))}function PE(e,t){return!!(t?.runId&&e.runId===t.runId&&typeof e.contentIndex==`number`)}function FE(e,t,n){return t?!0:n?.runId?e.runId===n.runId:ME(e)}function IE(e,t){return e?.toolOutputByToolCallId[t]}function LE(e){return typeof e.contentIndex==`number`?e.contentIndex:2**53-1}function RE(e){return e?.match(/^live:([^:]+):/)?.[1]}function zE(e){return e.type===`message`?RE(e.item.id):e.type===`draft`?RE(e.draft.key):e.toolCall.liveMessageId}function BE(e){return e.type===`message`?LE(e.item):e.type===`draft`?LE(e.draft):LE(e.toolCall)}function VE(e){return e.type===`message`?e.item.createdAt??``:e.type===`draft`?e.draft.createdAt:e.toolCall.createdAt}function HE(e){return e.type===`message`?e.item.id??``:e.type===`draft`?e.draft.key:e.toolCall.id}function UE(e){return e.type===`message`?0:e.type===`draft`?1:2}function WE(e){let t=new Map;for(let[n,r]of e.entries()){let e=zE(r);if(!e)continue;let i=VE(r),a=t.get(e);a&&(a.createdAt||`9999`)<=(i||`9999`)||t.set(e,{createdAt:i,sequence:n})}return new Map([...t.entries()].sort(([,e],[,t])=>{let n=(e.createdAt||`9999`).localeCompare(t.createdAt||`9999`);return n===0?e.sequence-t.sequence:n}).map(([e],t)=>[e,t]))}function GE(e,t,n){let r=e.get(zE(t)??``)??e.size,i=e.get(zE(n)??``)??e.size;if(r!==i)return r-i;let a=BE(t),o=BE(n);if(a!==o)return a-o;let s=UE(t),c=UE(n);if(s!==c)return s-c;let l=VE(t).localeCompare(VE(n));return l===0?HE(t).localeCompare(HE(n)):l}function KE(e,t){return e.runId?`run-status:${e.runId}`:t}function qE(e,t){return e===t||e.startsWith(`${t}:`)}function JE(e,t){return!!(e.id&&[...t].some(t=>qE(e.id,t)))}function YE(e,t){return e.role===`assistant`&&e.stopReason===`error`&&!!(e.runId&&t.has(e.runId))}function XE(e,t){let n=[],r=t.filter(e=>!e.hidden).sort(jE),i=new Map(r.map(e=>[e.id,e])),a=new Map,o=new Map,s=[];for(let e of r){for(let t of NE(e))a.has(t)||a.set(t,e);if(e.runId){let t=o.get(e.runId)??[];t.push(e),o.set(e.runId,t)}ME(e)&&s.push(e)}let c=new Set,l=new Set,u=new Set;for(let t of e)t.runStatus?.failedEntryId&&l.add(t.runStatus.failedEntryId),t.runStatus?.runId&&u.add(t.runStatus.runId);let d=e=>JE(e,l)||YE(e,u);return e.forEach((e,t)=>{if(AE(e))return;if(e.compaction){n.push({kind:`compaction`,key:e.compaction.entryId??e.id??`compaction-${t}`,notice:e.compaction});return}if(e.runStatus){n.push({kind:`run_status`,key:KE(e.runStatus,e.id??`run-status-${t}`),notice:e.runStatus});return}if(e.taskEvent){n.push({kind:`task_event`,key:e.taskEvent.entryId??e.id??`task-event-${t}`,notice:e.taskEvent});return}if(d(e))return;let r=e.toolRecordId?i.get(e.toolRecordId):e.toolCallId?a.get(e.toolCallId):void 0;if(r){n.push({kind:`tool`,key:r.id,toolCall:r,anchorEntryId:e.id}),c.add(r.id);return}if(e.role===`system`&&e.isToolError&&e.toolName){n.push({kind:`tool_result_error`,key:e.id??`tool-result-error-${t}`,toolName:e.toolName,error:e.text});return}n.push({kind:`message`,key:e.id??`msg-${t}`,item:e})}),{items:n,context:{orderedToolCalls:r,toolCallsById:i,toolCallsByProviderId:a,toolCallsByRunId:o,liveCandidateToolCalls:s,consumedToolCallIds:c,statusRunIds:new Set(n.flatMap(e=>e.kind===`run_status`&&e.notice.runId?[e.notice.runId]:[])),completedCompactionKeys:new Set(n.flatMap(e=>{if(e.kind!==`compaction`)return[];let t=[e.notice.id,e.notice.entryId].filter(e=>!!e);return e.notice.runId&&t.push(`run:${e.notice.runId}`),t}))}}}function ZE(e){if(e.kind===`message`)return e.item.id;if(e.kind===`tool`)return e.anchorEntryId;if(e.kind===`tool_result_error`)return e.key}function QE(e,t){let n=new Set(t?.hiddenEntryIds??[]);t?.runStatus?.failedEntryId&&n.add(t.runStatus.failedEntryId),t?.compaction?.failedEntryId&&n.add(t.compaction.failedEntryId);let r=t?.runStatus?.runId;if(n.size===0&&!r)return e;let i=[...n];return e.filter(e=>{let t=ZE(e);return!(t&&i.some(e=>qE(t,e))||r&&e.kind===`message`&&e.item.role===`assistant`&&e.item.stopReason===`error`&&e.item.runId===r)})}function $E(e,t){let n=[],{toolCallsById:r,toolCallsByProviderId:i,toolCallsByRunId:a,liveCandidateToolCalls:o,statusRunIds:s,completedCompactionKeys:c}=t,l=new Set,u=e?.runId?a.get(e.runId)??[]:[],d=e=>t.consumedToolCallIds.has(e)||l.has(e),f=e=>{l.add(e)},p=[...(e?.messages??[]).map(e=>({type:`message`,item:e})),...(e?.toolDrafts??[]).map(e=>({type:`draft`,draft:e})),...u.filter(t=>PE(t,e)).map(e=>({type:`tool`,toolCall:e}))],m=WE(p);p.sort((e,t)=>GE(m,e,t));for(let t of p){if(t.type===`message`){if(!t.item.text&&t.item.displayKind!==`thinking`)continue;n.push({kind:`message`,key:t.item.id??`live-msg-${t.item.contentIndex??n.length}`,item:t.item});continue}if(t.type===`tool`){d(t.toolCall.id)||(n.push({kind:`tool`,key:t.toolCall.id,toolCall:t.toolCall,liveOutput:IE(e,t.toolCall.id)}),f(t.toolCall.id));continue}let r=t.draft.providerToolCallId?i.get(t.draft.providerToolCallId):void 0;if(r){d(r.id)||(n.push({kind:`tool`,key:r.id,toolCall:r,liveOutput:IE(e,r.id)}),f(r.id));continue}n.push({kind:`tool_draft`,key:t.draft.key,draft:t.draft})}e?.runStatus&&!s.has(e.runStatus.runId??``)&&n.push({kind:`run_status`,key:KE(e.runStatus,`live:run-status:${e.runStatus.runId??e.runId??`active`}`),notice:e.runStatus}),e?.compaction&&([e.compaction.id,e.compaction.entryId,e.compaction.runId?`run:${e.compaction.runId}`:void 0].filter(e=>!!e).some(e=>c.has(e))||n.push({kind:`compaction`,key:e.compaction.id,notice:e.compaction}));let h=new Map,g=e=>{e&&!h.has(e.id)&&h.set(e.id,e)};for(let e of o)g(e);for(let e of u)g(e);for(let t of Object.keys(e?.toolOutputByToolCallId??{}))g(r.get(t));for(let t of[...h.values()].sort(jE)){let r=IE(e,t.id);d(t.id)||!FE(t,r,e)||n.push({kind:`tool`,key:t.id,toolCall:t,liveOutput:r})}return n}var eD=new Set([`$$slots`,`$$events`,`$$legacy`]);function tD(e,t){let n=G(t,eD),r=[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`}]];uc(e,K({name:`loader-circle`},()=>n,{get iconNode(){return r}}))}var nD=new Set([`$$slots`,`$$events`,`$$legacy`]);function rD(e,t){let n=G(t,nD),r=[[`path`,{d:`M12 19v3`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`}]];uc(e,K({name:`mic`},()=>n,{get iconNode(){return r}}))}var iD=new Set([`$$slots`,`$$events`,`$$legacy`]);function aD(e,t){let n=G(t,iD),r=[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`}],[`path`,{d:`m21.854 2.147-10.94 10.939`}]];uc(e,K({name:`send`},()=>n,{get iconNode(){return r}}))}var oD=new Set([`$$slots`,`$$events`,`$$legacy`]);function sD(e,t){let n=G(t,oD),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}]];uc(e,K({name:`square`},()=>n,{get iconNode(){return r}}))}Object.freeze({status:`aborted`});function cD(e,t,n){function r(n,r){var i;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(let e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var lD=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},uD=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},dD={};function fD(e){return e&&Object.assign(dD,e),dD}function pD(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function mD(e,t){return typeof t==`bigint`?t.toString():t}function hD(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function gD(e){return e==null}function _D(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function vD(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var yD=Symbol(`evaluating`);function bD(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==yD)return r===void 0&&(r=yD,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function xD(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function SD(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function CD(e){return JSON.stringify(e)}var wD=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function TD(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ED=hD(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function DD(e){if(TD(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(TD(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function OD(e){return DD(e)?{...e}:Array.isArray(e)?[...e]:e}var kD=new Set([`string`,`number`,`symbol`]);function AD(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function jD(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function MD(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Are(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var jre={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Mre(e,t){let n=e._zod.def;return jD(e,SD(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return xD(this,`shape`,e),e},checks:[]}))}function Nre(e,t){let n=e._zod.def;return jD(e,SD(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return xD(this,`shape`,r),r},checks:[]}))}function Pre(e,t){if(!DD(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");return jD(e,SD(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return xD(this,`shape`,n),n},checks:[]}))}function Fre(e,t){if(!DD(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return jD(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return xD(this,`shape`,n),n},checks:e._zod.def.checks})}function Ire(e,t){return jD(e,SD(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return xD(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Lre(e,t,n){return jD(t,SD(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return xD(this,`shape`,i),i},checks:[]}))}function Rre(e,t,n){return jD(t,SD(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return xD(this,`shape`,i),i},checks:[]}))}function ND(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function PD(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function FD(e){return typeof e==`string`?e:e?.message}function ID(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=FD(e.inst?._zod.def?.error?.(e))??FD(t?.error?.(e))??FD(n.customError?.(e))??FD(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function LD(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function RD(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var zD=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,mD,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},BD=cD(`$ZodError`,zD),VD=cD(`$ZodError`,zD,{Parent:Error});function zre(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Bre(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var HD=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new lD;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>ID(e,a,fD())));throw wD(t,i?.callee),t}return o.value},UD=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>ID(e,a,fD())));throw wD(t,i?.callee),t}return o.value},WD=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new lD;return a.issues.length?{success:!1,error:new(e??BD)(a.issues.map(e=>ID(e,i,fD())))}:{success:!0,data:a.value}},Vre=WD(VD),GD=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>ID(e,i,fD())))}:{success:!0,data:a.value}},Hre=GD(VD),Ure=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return HD(e)(t,n,i)},Wre=e=>(t,n,r)=>HD(e)(t,n,r),Gre=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return UD(e)(t,n,i)},Kre=e=>async(t,n,r)=>UD(e)(t,n,r),qre=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return WD(e)(t,n,i)},Jre=e=>(t,n,r)=>WD(e)(t,n,r),Yre=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return GD(e)(t,n,i)},Xre=e=>async(t,n,r)=>GD(e)(t,n,r),Zre=/^[cC][^\s-]{8,}$/,Qre=/^[0-9a-z]+$/,$re=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,eie=/^[0-9a-vA-V]{20}$/,tie=/^[A-Za-z0-9]{27}$/,nie=/^[a-zA-Z0-9_-]{21}$/,rie=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,iie=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,KD=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,aie=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,oie=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function sie(){return new RegExp(oie,`u`)}var cie=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,lie=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,uie=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,die=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fie=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,qD=/^[A-Za-z0-9_-]*$/,pie=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,mie=/^\+(?:[0-9]){6,14}[0-9]$/,JD=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,hie=RegExp(`^${JD}$`);function YD(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function gie(e){return RegExp(`^${YD(e)}$`)}function _ie(e){let t=YD({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${JD}T(?:${r})$`)}var vie=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},yie=/^-?\d+$/,bie=/^-?\d+(?:\.\d+)?/,xie=/^(?:true|false)$/i,Sie=/^[^A-Z]*$/,Cie=/^[^a-z]*$/,XD=cD(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ZD={number:`number`,bigint:`bigint`,object:`date`},QD=cD(`$ZodCheckLessThan`,(e,t)=>{XD.init(e,t);let n=ZD[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$D=cD(`$ZodCheckGreaterThan`,(e,t)=>{XD.init(e,t);let n=ZD[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wie=cD(`$ZodCheckMultipleOf`,(e,t)=>{XD.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):vD(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Tie=cD(`$ZodCheckNumberFormat`,(e,t)=>{XD.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=jre[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=yie)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inst:e})}}),Eie=cD(`$ZodCheckMaxLength`,(e,t)=>{var n;XD.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!gD(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=LD(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Die=cD(`$ZodCheckMinLength`,(e,t)=>{var n;XD.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!gD(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=LD(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Oie=cD(`$ZodCheckLengthEquals`,(e,t)=>{var n;XD.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!gD(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=LD(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),eO=cD(`$ZodCheckStringFormat`,(e,t)=>{var n,r;XD.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),kie=cD(`$ZodCheckRegex`,(e,t)=>{eO.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Aie=cD(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Sie,eO.init(e,t)}),jie=cD(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Cie,eO.init(e,t)}),Mie=cD(`$ZodCheckIncludes`,(e,t)=>{XD.init(e,t);let n=AD(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Nie=cD(`$ZodCheckStartsWith`,(e,t)=>{XD.init(e,t);let n=RegExp(`^${AD(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Pie=cD(`$ZodCheckEndsWith`,(e,t)=>{XD.init(e,t);let n=RegExp(`.*${AD(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Fie=cD(`$ZodCheckOverwrite`,(e,t)=>{XD.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Iie=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
18
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
19
|
-
`))}},Lie={major:4,minor:1,patch:12},tO=cD(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Lie;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=ND(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new lD;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=ND(e,t))});else{if(e.issues.length===t)continue;r||=ND(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(ND(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new lD;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new lD;return o.then(e=>t(e,r,a))}return t(o,r,a)}}e[`~standard`]={validate:t=>{try{let n=Vre(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Hre(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),nO=cD(`$ZodString`,(e,t)=>{tO.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??vie(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),rO=cD(`$ZodStringFormat`,(e,t)=>{eO.init(e,t),nO.init(e,t)}),Rie=cD(`$ZodGUID`,(e,t)=>{t.pattern??=iie,rO.init(e,t)}),zie=cD(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=KD(e)}else t.pattern??=KD();rO.init(e,t)}),Bie=cD(`$ZodEmail`,(e,t)=>{t.pattern??=aie,rO.init(e,t)}),Vie=cD(`$ZodURL`,(e,t)=>{rO.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:pie.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Hie=cD(`$ZodEmoji`,(e,t)=>{t.pattern??=sie(),rO.init(e,t)}),Uie=cD(`$ZodNanoID`,(e,t)=>{t.pattern??=nie,rO.init(e,t)}),Wie=cD(`$ZodCUID`,(e,t)=>{t.pattern??=Zre,rO.init(e,t)}),Gie=cD(`$ZodCUID2`,(e,t)=>{t.pattern??=Qre,rO.init(e,t)}),Kie=cD(`$ZodULID`,(e,t)=>{t.pattern??=$re,rO.init(e,t)}),qie=cD(`$ZodXID`,(e,t)=>{t.pattern??=eie,rO.init(e,t)}),Jie=cD(`$ZodKSUID`,(e,t)=>{t.pattern??=tie,rO.init(e,t)}),Yie=cD(`$ZodISODateTime`,(e,t)=>{t.pattern??=_ie(t),rO.init(e,t)}),Xie=cD(`$ZodISODate`,(e,t)=>{t.pattern??=hie,rO.init(e,t)}),Zie=cD(`$ZodISOTime`,(e,t)=>{t.pattern??=gie(t),rO.init(e,t)}),Qie=cD(`$ZodISODuration`,(e,t)=>{t.pattern??=rie,rO.init(e,t)}),$ie=cD(`$ZodIPv4`,(e,t)=>{t.pattern??=cie,rO.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv4`})}),eae=cD(`$ZodIPv6`,(e,t)=>{t.pattern??=lie,rO.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv6`}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),tae=cD(`$ZodCIDRv4`,(e,t)=>{t.pattern??=uie,rO.init(e,t)}),nae=cD(`$ZodCIDRv6`,(e,t)=>{t.pattern??=die,rO.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function iO(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var rae=cD(`$ZodBase64`,(e,t)=>{t.pattern??=fie,rO.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64`}),e._zod.check=n=>{iO(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function iae(e){if(!qD.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return iO(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var aae=cD(`$ZodBase64URL`,(e,t)=>{t.pattern??=qD,rO.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64url`}),e._zod.check=n=>{iae(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),oae=cD(`$ZodE164`,(e,t)=>{t.pattern??=mie,rO.init(e,t)});function sae(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var cae=cD(`$ZodJWT`,(e,t)=>{rO.init(e,t),e._zod.check=n=>{sae(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),aO=cD(`$ZodNumber`,(e,t)=>{tO.init(e,t),e._zod.pattern=e._zod.bag.pattern??bie,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),lae=cD(`$ZodNumber`,(e,t)=>{Tie.init(e,t),aO.init(e,t)}),uae=cD(`$ZodBoolean`,(e,t)=>{tO.init(e,t),e._zod.pattern=xie,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),dae=cD(`$ZodUnknown`,(e,t)=>{tO.init(e,t),e._zod.parse=e=>e}),fae=cD(`$ZodNever`,(e,t)=>{tO.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function oO(e,t,n){e.issues.length&&t.issues.push(...PD(n,e.issues)),t.value[n]=e.value}var pae=cD(`$ZodArray`,(e,t)=>{tO.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>oO(t,n,e))):oO(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function sO(e,t,n,r){e.issues.length&&t.issues.push(...PD(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function cO(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Are(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function lO(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type;for(let i of Object.keys(t)){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>sO(e,n,i,t))):sO(a,n,i,t)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var mae=cD(`$ZodObject`,(e,t)=>{if(tO.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=hD(()=>cO(t));bD(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=TD,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e]._zod.run({value:s[e],issues:[]},o);n instanceof Promise?c.push(n.then(n=>sO(n,t,e,s))):sO(n,t,e,s)}return i?lO(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),hae=cD(`$ZodObjectJIT`,(e,t)=>{mae.init(e,t);let n=e._zod.parse,r=hD(()=>cO(t)),i=e=>{let t=new Iie([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=CD(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let e of n.keys){let n=a[e],r=CD(e);t.write(`const ${n} = ${i(e)};`),t.write(`
|
|
20
|
-
if (${n}.issues.length) {
|
|
21
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
22
|
-
...iss,
|
|
23
|
-
path: iss.path ? [${r}, ...iss.path] : [${r}]
|
|
24
|
-
})));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (${n}.value === undefined) {
|
|
29
|
-
if (${r} in input) {
|
|
30
|
-
newResult[${r}] = undefined;
|
|
31
|
-
}
|
|
32
|
-
} else {
|
|
33
|
-
newResult[${r}] = ${n}.value;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=TD,s=!dD.jitless,c=s&&ED.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?lO([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function uO(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!ND(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ID(e,r,fD())))}),t)}var dO=cD(`$ZodUnion`,(e,t)=>{tO.init(e,t),bD(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),bD(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),bD(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),bD(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>_D(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>uO(t,i,e,a)):uO(s,i,e,a)}}),gae=cD(`$ZodDiscriminatedUnion`,(e,t)=>{dO.init(e,t);let n=e._zod.parse;bD(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=hD(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!TD(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),_ae=cD(`$ZodIntersection`,(e,t)=>{tO.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>pO(e,t,n)):pO(e,i,a)}});function fO(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(DD(e)&&DD(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=fO(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=fO(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function pO(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),ND(e))return e;let r=fO(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}var vae=cD(`$ZodTuple`,(e,t)=>{tO.init(e,t);let n=t.items,r=n.length-[...n].reverse().findIndex(e=>e._zod.optin!==`optional`);e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=[];let s=[];if(!t.rest){let t=o.length>n.length,a=o.length<r-1;if(t||a)return i.issues.push({...t?{code:`too_big`,maximum:n.length}:{code:`too_small`,minimum:n.length},input:o,inst:e,origin:`array`}),i}let c=-1;for(let e of n){if(c++,c>=o.length&&c>=r)continue;let t=e._zod.run({value:o[c],issues:[]},a);t instanceof Promise?s.push(t.then(e=>mO(e,i,c))):mO(t,i,c)}if(t.rest){let e=o.slice(n.length);for(let n of e){c++;let e=t.rest._zod.run({value:n,issues:[]},a);e instanceof Promise?s.push(e.then(e=>mO(e,i,c))):mO(e,i,c)}}return s.length?Promise.all(s).then(()=>i):i}});function mO(e,t,n){e.issues.length&&t.issues.push(...PD(n,e.issues)),t.value[n]=e.value}var yae=cD(`$ZodRecord`,(e,t)=>{tO.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!DD(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...PD(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...PD(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ID(e,r,fD())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...PD(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...PD(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),bae=cD(`$ZodEnum`,(e,t)=>{tO.init(e,t);let n=pD(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>kD.has(typeof e)).map(e=>typeof e==`string`?AD(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),xae=cD(`$ZodLiteral`,(e,t)=>{if(tO.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?AD(e):e?AD(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),Sae=cD(`$ZodTransform`,(e,t)=>{tO.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new uD(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new lD;return n.value=i,n}});function hO(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Cae=cD(`$ZodOptional`,(e,t)=>{tO.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,bD(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),bD(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${_D(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>hO(t,e.value)):hO(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),wae=cD(`$ZodNullable`,(e,t)=>{tO.init(e,t),bD(e._zod,`optin`,()=>t.innerType._zod.optin),bD(e._zod,`optout`,()=>t.innerType._zod.optout),bD(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${_D(e.source)}|null)$`):void 0}),bD(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Tae=cD(`$ZodDefault`,(e,t)=>{tO.init(e,t),e._zod.optin=`optional`,bD(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>gO(e,t)):gO(r,t)}});function gO(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Eae=cD(`$ZodPrefault`,(e,t)=>{tO.init(e,t),e._zod.optin=`optional`,bD(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Dae=cD(`$ZodNonOptional`,(e,t)=>{tO.init(e,t),bD(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>_O(t,e)):_O(i,e)}});function _O(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Oae=cD(`$ZodCatch`,(e,t)=>{tO.init(e,t),bD(e._zod,`optin`,()=>t.innerType._zod.optin),bD(e._zod,`optout`,()=>t.innerType._zod.optout),bD(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ID(e,n,fD()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ID(e,n,fD()))},input:e.value}),e.issues=[]),e)}}),kae=cD(`$ZodPipe`,(e,t)=>{tO.init(e,t),bD(e._zod,`values`,()=>t.in._zod.values),bD(e._zod,`optin`,()=>t.in._zod.optin),bD(e._zod,`optout`,()=>t.out._zod.optout),bD(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>vO(e,t.in,n)):vO(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>vO(e,t.out,n)):vO(r,t.out,n)}});function vO(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Aae=cD(`$ZodReadonly`,(e,t)=>{tO.init(e,t),bD(e._zod,`propValues`,()=>t.innerType._zod.propValues),bD(e._zod,`values`,()=>t.innerType._zod.values),bD(e._zod,`optin`,()=>t.innerType._zod.optin),bD(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(yO):yO(r)}});function yO(e){return e.value=Object.freeze(e.value),e}var jae=cD(`$ZodCustom`,(e,t)=>{XD.init(e,t),tO.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>bO(t,n,r,e));bO(i,n,r,e)}});function bO(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(RD(e))}}var Mae=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Nae(){return new Mae}var xO=Nae();function Pae(e,t){return new e({type:`string`,...MD(t)})}function Fae(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...MD(t)})}function SO(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...MD(t)})}function Iae(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...MD(t)})}function Lae(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...MD(t)})}function Rae(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...MD(t)})}function zae(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...MD(t)})}function Bae(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...MD(t)})}function Vae(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...MD(t)})}function Hae(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...MD(t)})}function Uae(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...MD(t)})}function Wae(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...MD(t)})}function Gae(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...MD(t)})}function Kae(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...MD(t)})}function qae(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...MD(t)})}function Jae(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...MD(t)})}function Yae(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...MD(t)})}function Xae(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...MD(t)})}function Zae(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...MD(t)})}function Qae(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...MD(t)})}function $ae(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...MD(t)})}function eoe(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...MD(t)})}function toe(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...MD(t)})}function noe(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...MD(t)})}function roe(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...MD(t)})}function ioe(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...MD(t)})}function aoe(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...MD(t)})}function ooe(e,t){return new e({type:`number`,checks:[],...MD(t)})}function soe(e,t){return new e({type:`number`,coerce:!0,checks:[],...MD(t)})}function coe(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...MD(t)})}function loe(e,t){return new e({type:`boolean`,...MD(t)})}function uoe(e,t){return new e({type:`boolean`,coerce:!0,...MD(t)})}function doe(e){return new e({type:`unknown`})}function foe(e,t){return new e({type:`never`,...MD(t)})}function CO(e,t){return new QD({check:`less_than`,...MD(t),value:e,inclusive:!1})}function wO(e,t){return new QD({check:`less_than`,...MD(t),value:e,inclusive:!0})}function TO(e,t){return new $D({check:`greater_than`,...MD(t),value:e,inclusive:!1})}function EO(e,t){return new $D({check:`greater_than`,...MD(t),value:e,inclusive:!0})}function DO(e,t){return new wie({check:`multiple_of`,...MD(t),value:e})}function OO(e,t){return new Eie({check:`max_length`,...MD(t),maximum:e})}function kO(e,t){return new Die({check:`min_length`,...MD(t),minimum:e})}function AO(e,t){return new Oie({check:`length_equals`,...MD(t),length:e})}function poe(e,t){return new kie({check:`string_format`,format:`regex`,...MD(t),pattern:e})}function moe(e){return new Aie({check:`string_format`,format:`lowercase`,...MD(e)})}function hoe(e){return new jie({check:`string_format`,format:`uppercase`,...MD(e)})}function goe(e,t){return new Mie({check:`string_format`,format:`includes`,...MD(t),includes:e})}function _oe(e,t){return new Nie({check:`string_format`,format:`starts_with`,...MD(t),prefix:e})}function voe(e,t){return new Pie({check:`string_format`,format:`ends_with`,...MD(t),suffix:e})}function jO(e){return new Fie({check:`overwrite`,tx:e})}function yoe(e){return jO(t=>t.normalize(e))}function boe(){return jO(e=>e.trim())}function xoe(){return jO(e=>e.toLowerCase())}function Soe(){return jO(e=>e.toUpperCase())}function Coe(e,t,n){return new e({type:`array`,element:t,...MD(n)})}function woe(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...MD(n)})}function Toe(e){let t=Eoe(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(RD(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(RD(r))}},e(n.value,n)));return t}function Eoe(e,t){let n=new XD({check:`custom`,...MD(t)});return n._zod.check=e,n}var Doe=cD(`ZodISODateTime`,(e,t)=>{Yie.init(e,t),IO.init(e,t)});function Ooe(e){return noe(Doe,e)}var koe=cD(`ZodISODate`,(e,t)=>{Xie.init(e,t),IO.init(e,t)});function Aoe(e){return roe(koe,e)}var joe=cD(`ZodISOTime`,(e,t)=>{Zie.init(e,t),IO.init(e,t)});function Moe(e){return ioe(joe,e)}var Noe=cD(`ZodISODuration`,(e,t)=>{Qie.init(e,t),IO.init(e,t)});function Poe(e){return aoe(Noe,e)}var MO=(e,t)=>{BD.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Bre(e,t)},flatten:{value:t=>zre(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,mD,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,mD,2)}},isEmpty:{get(){return e.issues.length===0}}})};cD(`ZodError`,MO);var NO=cD(`ZodError`,MO,{Parent:Error}),Foe=HD(NO),Ioe=UD(NO),Loe=WD(NO),Roe=GD(NO),zoe=Ure(NO),Boe=Wre(NO),Voe=Gre(NO),Hoe=Kre(NO),Uoe=qre(NO),Woe=Jre(NO),Goe=Yre(NO),Koe=Xre(NO),PO=cD(`ZodType`,(e,t)=>(tO.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(SD(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]})),e.clone=(t,n)=>jD(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Foe(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Loe(e,t,n),e.parseAsync=async(t,n)=>Ioe(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Roe(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>zoe(e,t,n),e.decode=(t,n)=>Boe(e,t,n),e.encodeAsync=async(t,n)=>Voe(e,t,n),e.decodeAsync=async(t,n)=>Hoe(e,t,n),e.safeEncode=(t,n)=>Uoe(e,t,n),e.safeDecode=(t,n)=>Woe(e,t,n),e.safeEncodeAsync=async(t,n)=>Goe(e,t,n),e.safeDecodeAsync=async(t,n)=>Koe(e,t,n),e.refine=(t,n)=>e.check(Lse(t,n)),e.superRefine=t=>e.check(Rse(t)),e.overwrite=t=>e.check(jO(t)),e.optional=()=>ek(e),e.nullable=()=>tk(e),e.nullish=()=>ek(tk(e)),e.nonoptional=t=>Ase(e,t),e.array=()=>WO(e),e.or=t=>KO([e,t]),e.and=t=>yse(e,t),e.transform=t=>rk(e,QO(t)),e.default=t=>Dse(e,t),e.prefault=t=>kse(e,t),e.catch=t=>Mse(e,t),e.pipe=t=>rk(e,t),e.readonly=()=>Fse(e),e.describe=t=>{let n=e.clone();return xO.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return xO.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return xO.get(e);let n=e.clone();return xO.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),FO=cD(`_ZodString`,(e,t)=>{nO.init(e,t),PO.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(poe(...t)),e.includes=(...t)=>e.check(goe(...t)),e.startsWith=(...t)=>e.check(_oe(...t)),e.endsWith=(...t)=>e.check(voe(...t)),e.min=(...t)=>e.check(kO(...t)),e.max=(...t)=>e.check(OO(...t)),e.length=(...t)=>e.check(AO(...t)),e.nonempty=(...t)=>e.check(kO(1,...t)),e.lowercase=t=>e.check(moe(t)),e.uppercase=t=>e.check(hoe(t)),e.trim=()=>e.check(boe()),e.normalize=(...t)=>e.check(yoe(...t)),e.toLowerCase=()=>e.check(xoe()),e.toUpperCase=()=>e.check(Soe())}),qoe=cD(`ZodString`,(e,t)=>{nO.init(e,t),FO.init(e,t),e.email=t=>e.check(Fae(Joe,t)),e.url=t=>e.check(Bae(Yoe,t)),e.jwt=t=>e.check(toe(use,t)),e.emoji=t=>e.check(Vae(Xoe,t)),e.guid=t=>e.check(SO(LO,t)),e.uuid=t=>e.check(Iae(RO,t)),e.uuidv4=t=>e.check(Lae(RO,t)),e.uuidv6=t=>e.check(Rae(RO,t)),e.uuidv7=t=>e.check(zae(RO,t)),e.nanoid=t=>e.check(Hae(Zoe,t)),e.guid=t=>e.check(SO(LO,t)),e.cuid=t=>e.check(Uae(Qoe,t)),e.cuid2=t=>e.check(Wae($oe,t)),e.ulid=t=>e.check(Gae(ese,t)),e.base64=t=>e.check(Qae(sse,t)),e.base64url=t=>e.check($ae(cse,t)),e.xid=t=>e.check(Kae(tse,t)),e.ksuid=t=>e.check(qae(nse,t)),e.ipv4=t=>e.check(Jae(rse,t)),e.ipv6=t=>e.check(Yae(ise,t)),e.cidrv4=t=>e.check(Xae(ase,t)),e.cidrv6=t=>e.check(Zae(ose,t)),e.e164=t=>e.check(eoe(lse,t)),e.datetime=t=>e.check(Ooe(t)),e.date=t=>e.check(Aoe(t)),e.time=t=>e.check(Moe(t)),e.duration=t=>e.check(Poe(t))});function X(e){return Pae(qoe,e)}var IO=cD(`ZodStringFormat`,(e,t)=>{rO.init(e,t),FO.init(e,t)}),Joe=cD(`ZodEmail`,(e,t)=>{Bie.init(e,t),IO.init(e,t)}),LO=cD(`ZodGUID`,(e,t)=>{Rie.init(e,t),IO.init(e,t)}),RO=cD(`ZodUUID`,(e,t)=>{zie.init(e,t),IO.init(e,t)}),Yoe=cD(`ZodURL`,(e,t)=>{Vie.init(e,t),IO.init(e,t)}),Xoe=cD(`ZodEmoji`,(e,t)=>{Hie.init(e,t),IO.init(e,t)}),Zoe=cD(`ZodNanoID`,(e,t)=>{Uie.init(e,t),IO.init(e,t)}),Qoe=cD(`ZodCUID`,(e,t)=>{Wie.init(e,t),IO.init(e,t)}),$oe=cD(`ZodCUID2`,(e,t)=>{Gie.init(e,t),IO.init(e,t)}),ese=cD(`ZodULID`,(e,t)=>{Kie.init(e,t),IO.init(e,t)}),tse=cD(`ZodXID`,(e,t)=>{qie.init(e,t),IO.init(e,t)}),nse=cD(`ZodKSUID`,(e,t)=>{Jie.init(e,t),IO.init(e,t)}),rse=cD(`ZodIPv4`,(e,t)=>{$ie.init(e,t),IO.init(e,t)}),ise=cD(`ZodIPv6`,(e,t)=>{eae.init(e,t),IO.init(e,t)}),ase=cD(`ZodCIDRv4`,(e,t)=>{tae.init(e,t),IO.init(e,t)}),ose=cD(`ZodCIDRv6`,(e,t)=>{nae.init(e,t),IO.init(e,t)}),sse=cD(`ZodBase64`,(e,t)=>{rae.init(e,t),IO.init(e,t)}),cse=cD(`ZodBase64URL`,(e,t)=>{aae.init(e,t),IO.init(e,t)}),lse=cD(`ZodE164`,(e,t)=>{oae.init(e,t),IO.init(e,t)}),use=cD(`ZodJWT`,(e,t)=>{cae.init(e,t),IO.init(e,t)}),zO=cD(`ZodNumber`,(e,t)=>{aO.init(e,t),PO.init(e,t),e.gt=(t,n)=>e.check(TO(t,n)),e.gte=(t,n)=>e.check(EO(t,n)),e.min=(t,n)=>e.check(EO(t,n)),e.lt=(t,n)=>e.check(CO(t,n)),e.lte=(t,n)=>e.check(wO(t,n)),e.max=(t,n)=>e.check(wO(t,n)),e.int=t=>e.check(BO(t)),e.safe=t=>e.check(BO(t)),e.positive=t=>e.check(TO(0,t)),e.nonnegative=t=>e.check(EO(0,t)),e.negative=t=>e.check(CO(0,t)),e.nonpositive=t=>e.check(wO(0,t)),e.multipleOf=(t,n)=>e.check(DO(t,n)),e.step=(t,n)=>e.check(DO(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Z(e){return ooe(zO,e)}var dse=cD(`ZodNumberFormat`,(e,t)=>{lae.init(e,t),zO.init(e,t)});function BO(e){return coe(dse,e)}var VO=cD(`ZodBoolean`,(e,t)=>{uae.init(e,t),PO.init(e,t)});function HO(e){return loe(VO,e)}var fse=cD(`ZodUnknown`,(e,t)=>{dae.init(e,t),PO.init(e,t)});function UO(){return doe(fse)}var pse=cD(`ZodNever`,(e,t)=>{fae.init(e,t),PO.init(e,t)});function mse(e){return foe(pse,e)}var hse=cD(`ZodArray`,(e,t)=>{pae.init(e,t),PO.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(kO(t,n)),e.nonempty=t=>e.check(kO(1,t)),e.max=(t,n)=>e.check(OO(t,n)),e.length=(t,n)=>e.check(AO(t,n)),e.unwrap=()=>e.element});function WO(e,t){return Coe(hse,e,t)}var gse=cD(`ZodObject`,(e,t)=>{hae.init(e,t),PO.init(e,t),bD(e,`shape`,()=>t.shape),e.keyof=()=>XO(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:UO()}),e.loose=()=>e.clone({...e._zod.def,catchall:UO()}),e.strict=()=>e.clone({...e._zod.def,catchall:mse()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Pre(e,t),e.safeExtend=t=>Fre(e,t),e.merge=t=>Ire(e,t),e.pick=t=>Mre(e,t),e.omit=t=>Nre(e,t),e.partial=(...t)=>Lre($O,e,t[0]),e.required=(...t)=>Rre(nk,e,t[0])});function Q(e,t){return new gse({type:`object`,shape:e??{},...MD(t)})}var GO=cD(`ZodUnion`,(e,t)=>{dO.init(e,t),PO.init(e,t),e.options=t.options});function KO(e,t){return new GO({type:`union`,options:e,...MD(t)})}var _se=cD(`ZodDiscriminatedUnion`,(e,t)=>{GO.init(e,t),gae.init(e,t)});function qO(e,t,n){return new _se({type:`union`,options:t,discriminator:e,...MD(n)})}var vse=cD(`ZodIntersection`,(e,t)=>{_ae.init(e,t),PO.init(e,t)});function yse(e,t){return new vse({type:`intersection`,left:e,right:t})}var bse=cD(`ZodTuple`,(e,t)=>{vae.init(e,t),PO.init(e,t),e.rest=t=>e.clone({...e._zod.def,rest:t})});function xse(e,t,n){let r=t instanceof tO;return new bse({type:`tuple`,items:e,rest:r?t:null,...MD(r?n:t)})}var Sse=cD(`ZodRecord`,(e,t)=>{yae.init(e,t),PO.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function JO(e,t,n){return new Sse({type:`record`,keyType:e,valueType:t,...MD(n)})}var YO=cD(`ZodEnum`,(e,t)=>{bae.init(e,t),PO.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new YO({...t,checks:[],...MD(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new YO({...t,checks:[],...MD(r),entries:i})}});function XO(e,t){return new YO({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...MD(t)})}var Cse=cD(`ZodLiteral`,(e,t)=>{xae.init(e,t),PO.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ZO(e,t){return new Cse({type:`literal`,values:Array.isArray(e)?e:[e],...MD(t)})}var wse=cD(`ZodTransform`,(e,t)=>{Sae.init(e,t),PO.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new uD(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(RD(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(RD(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function QO(e){return new wse({type:`transform`,transform:e})}var $O=cD(`ZodOptional`,(e,t)=>{Cae.init(e,t),PO.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ek(e){return new $O({type:`optional`,innerType:e})}var Tse=cD(`ZodNullable`,(e,t)=>{wae.init(e,t),PO.init(e,t),e.unwrap=()=>e._zod.def.innerType});function tk(e){return new Tse({type:`nullable`,innerType:e})}var Ese=cD(`ZodDefault`,(e,t)=>{Tae.init(e,t),PO.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Dse(e,t){return new Ese({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():OD(t)}})}var Ose=cD(`ZodPrefault`,(e,t)=>{Eae.init(e,t),PO.init(e,t),e.unwrap=()=>e._zod.def.innerType});function kse(e,t){return new Ose({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():OD(t)}})}var nk=cD(`ZodNonOptional`,(e,t)=>{Dae.init(e,t),PO.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ase(e,t){return new nk({type:`nonoptional`,innerType:e,...MD(t)})}var jse=cD(`ZodCatch`,(e,t)=>{Oae.init(e,t),PO.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Mse(e,t){return new jse({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Nse=cD(`ZodPipe`,(e,t)=>{kae.init(e,t),PO.init(e,t),e.in=t.in,e.out=t.out});function rk(e,t){return new Nse({type:`pipe`,in:e,out:t})}var Pse=cD(`ZodReadonly`,(e,t)=>{Aae.init(e,t),PO.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Fse(e){return new Pse({type:`readonly`,innerType:e})}var Ise=cD(`ZodCustom`,(e,t)=>{jae.init(e,t),PO.init(e,t)});function Lse(e,t={}){return woe(Ise,e,t)}function Rse(e){return Toe(e)}function zse(e,t){return rk(QO(e),t)}function ik(e){return soe(zO,e)}function Bse(e){return uoe(VO,e)}Q({error:Q({code:X(),message:X(),details:UO().optional()})});function Vse(e){let t=e.search(/\S/);if(t===-1||e[t]!==`!`)return;let n=e.slice(t+1).trim();if(n)return{command:n,bangOffset:t}}function ak(e){return Vse(e)!==void 0}function Hse(e){return ok(e).length>0}function ok(e){let t=[],n=Use(e);for(let r=0;r<n.length;r+=1){let i=n[r],a=Wse(i.text);if(!a)continue;let o=i.offset+i.text.length;for(let s=r+1;s<n.length;s+=1){let c=n[s];if(!Gse(c.text,a.fenceChar,a.fenceLength))continue;let l=c.offset;t.push({start:i.offset,end:c.offset+c.text.length,commandStart:o,commandEnd:l,fenceChar:a.fenceChar,fenceLength:a.fenceLength,command:e.slice(o,l).trim()}),r=s;break}}return t.filter(e=>e.command.length>0)}function Use(e){let t=[],n=0;for(;n<e.length;){let r=e.indexOf(`
|
|
37
|
-
`,n),i=r===-1?e.length:r+1;t.push({text:e.slice(n,i),offset:n}),n=i}return e.length===0&&t.push({text:``,offset:0}),t}function sk(e){return e.replace(/\r?\n$/,``)}function Wse(e){let t=sk(e),n=t.match(/^ {0,3}/)?.[0].length??0,r=t.slice(n).match(/^(`{3,}|~{3,})(.*)$/);if(!r)return;let i=r[1];if(r[2].trim()===`!!!`)return{fenceChar:i[0],fenceLength:i.length}}function Gse(e,t,n){let r=sk(e);return RegExp(`^ {0,3}${Kse(t)}{${n},}\\s*$`).test(r)}function Kse(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var ck=XO([`off`,`minimal`,`low`,`medium`,`high`,`xhigh`]),lk=Q({provider:X().min(1),modelId:X().min(1)});Q({provider:X(),modelId:X(),name:X(),label:X(),reasoning:HO().default(!1),supportedThinkingLevels:WO(ck).default([`off`]),faux:HO().optional(),contextWindow:Z().int().nonnegative().default(0),maxOutputTokens:Z().int().nonnegative().default(0)}),Q({tokens:Z().int().nonnegative().nullable(),contextWindow:Z().int().nonnegative(),percent:Z().nullable()});var uk=XO([`debug`,`info`,`warn`,`error`]),dk=XO([`orchestrator`,`desktop`,`web`,`cli`]),qse=Q({name:X().optional(),message:X(),stack:X().optional(),cause:X().optional()}),fk=Q({seq:Z().int().positive(),id:X().startsWith(`log_`),ts:X().datetime(),level:uk,source:dk,component:X().min(1),message:X().min(1),requestId:X().optional(),projectId:X().startsWith(`proj_`).optional(),conversationId:X().startsWith(`conv_`).optional(),agentId:X().startsWith(`agent_`).optional(),runId:X().startsWith(`run_`).optional(),toolCallId:X().startsWith(`tool_`).optional(),taskId:X().startsWith(`task_`).optional(),workerId:X().startsWith(`worker_`).optional(),durationMs:Z().nonnegative().optional(),context:JO(X(),UO()).optional(),error:qse.optional()}),Jse=Q({level:uk.optional(),source:dk.optional(),component:X().min(1).optional(),contains:X().optional(),sinceSeq:Z().int().nonnegative().optional(),limit:Z().int().positive().max(500).optional(),requestId:X().optional(),projectId:X().startsWith(`proj_`).optional(),conversationId:X().startsWith(`conv_`).optional(),agentId:X().startsWith(`agent_`).optional(),runId:X().startsWith(`run_`).optional(),toolCallId:X().startsWith(`tool_`).optional(),taskId:X().startsWith(`task_`).optional(),workerId:X().startsWith(`worker_`).optional()});Q({logs:WO(fk),nextCursor:Z().int().nonnegative()}),Jse.omit({limit:!0,sinceSeq:!0}),Q({pruned:Z().int().nonnegative(),remaining:Z().int().nonnegative()}),Q({logs:WO(fk.omit({seq:!0,id:!0,ts:!0,source:!0}).extend({ts:X().datetime().optional(),source:ZO(`web`).optional()})).min(1).max(50)});var pk=XO([`planning`,`coding`]),mk=XO([`autonomous`,`supervised`,`read_only`]),Yse=Q({mode:pk.default(`coding`),permissionLevel:mk.default(`autonomous`),model:lk.optional(),thinkingLevel:ck.default(`off`)}),Xse=Q({pythonExecutablePath:X().trim().min(1).optional()});Q({defaultMode:pk,defaultPermissionLevel:mk,defaultModel:lk.optional(),defaultThinkingLevel:ck.default(`off`),rememberLastAgentSelection:HO().default(!1),lastAgentSelection:Yse.default({mode:`coding`,permissionLevel:`autonomous`,thinkingLevel:`off`}),exploreAgent:Q({model:lk.optional(),thinkingLevel:ck.default(`off`)}),server:Q({host:X().default(`127.0.0.1`),port:Z().int().positive().default(3747),allowRemote:HO().default(!1)}),ui:Q({theme:XO([`system`,`light`,`dark`]),zoomLevel:Z().int().min(-8).max(8).default(0)}),desktop:Q({closeToTray:HO().default(!0)}),compaction:Q({auto:HO().default(!0)}),logging:Q({level:uk.default(`info`),retentionDays:Z().int().positive().default(14),maxBufferedLogs:Z().int().positive().default(2e3)}),retry:Q({enabled:HO().default(!0),maxRetries:Z().int().nonnegative().default(3),baseDelayMs:Z().int().positive().default(2e3)}),runtime:Xse.default({}),scopedModels:WO(lk).default([])}),Q({defaultMode:pk.optional(),defaultPermissionLevel:mk.optional(),defaultModel:lk.nullable().optional(),defaultThinkingLevel:ck.optional(),rememberLastAgentSelection:HO().optional(),lastAgentSelection:Q({mode:pk.optional(),permissionLevel:mk.optional(),model:lk.nullable().optional(),thinkingLevel:ck.optional()}).optional(),exploreAgent:Q({model:lk.nullable().optional(),thinkingLevel:ck.optional()}).optional(),server:Q({host:X().optional(),port:Z().int().positive().optional(),allowRemote:HO().optional()}).optional(),ui:Q({theme:XO([`system`,`light`,`dark`]).optional(),zoomLevel:Z().int().min(-8).max(8).optional()}).optional(),desktop:Q({closeToTray:HO().optional()}).optional(),compaction:Q({auto:HO().optional()}).optional(),logging:Q({level:uk.optional(),retentionDays:Z().int().positive().optional(),maxBufferedLogs:Z().int().positive().optional()}).optional(),retry:Q({enabled:HO().optional(),maxRetries:Z().int().nonnegative().optional(),baseDelayMs:Z().int().positive().optional()}).optional(),runtime:Q({pythonExecutablePath:X().trim().min(1).nullable().optional()}).optional(),scopedModels:WO(lk).optional()});var hk=Q({roots:WO(X()).min(1),readonly:HO().optional()});Q({mode:pk.optional(),permissionLevel:mk.optional(),model:lk.nullable().optional(),thinkingLevel:ck.optional()});var Zse=XO([`idle`,`running`,`awaiting_user`,`aborted`,`error`]),gk=Q({depth:Z().int().nonnegative().default(0),maxDepth:Z().int().positive().max(8).default(3),maxRuns:Z().int().positive().max(64).default(8),usedRuns:Z().int().nonnegative().default(0)}),Qse=gk.partial();Q({id:X().startsWith(`agent_`),conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),projectDir:X().min(1),workerId:X().startsWith(`worker_`).optional(),parentAgentId:X().startsWith(`agent_`).optional(),rootAgentId:X().startsWith(`agent_`),mode:pk,permissionLevel:mk,workspaceScope:hk,systemPrompt:X().min(1).optional(),budget:gk.default({depth:0,maxDepth:3,maxRuns:8,usedRuns:0}),model:lk.optional(),thinkingLevel:ck.default(`off`),status:Zse,createdAt:X().datetime(),updatedAt:X().datetime()}),Q({conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),projectDir:X().min(1).optional(),workerId:X().startsWith(`worker_`).optional(),parentAgentId:X().startsWith(`agent_`).optional(),task:X().optional(),mode:pk.optional(),permissionLevel:mk.optional(),workspaceScope:hk.optional(),systemPrompt:X().min(1).optional(),budget:Qse.optional(),model:lk.optional(),thinkingLevel:ck.optional()});var _k=Q({type:ZO(`image`),data:X(),mimeType:X()}),$se=XO([`reject-if-busy`,`steer`,`follow-up`]);Q({text:X().min(1),images:WO(_k).optional(),behavior:$se.optional()}),Q({statusEntryId:X().startsWith(`entry_`)});var ece=XO([`queued`,`accepted`,`delivered`,`cancelled`,`failed`]);Q({id:X().startsWith(`promptq_`),agentId:X().startsWith(`agent_`),conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),runId:X().startsWith(`run_`).optional(),behavior:XO([`steer`,`follow-up`]),text:X().min(1),images:WO(_k).optional(),status:ece,createdAt:X().datetime(),updatedAt:X().datetime(),deliveredEntryId:X().startsWith(`entry_`).optional(),error:X().optional()});var tce=XO([`api_key`,`oauth`]);Q({provider:X().min(1),envVar:X().min(1),configured:HO()}),Q({provider:X().min(1),displayName:X().min(1),supportsApiKey:HO(),supportsOAuth:HO(),oauthName:X().optional(),configured:HO(),credentialType:tce.optional(),envVar:X().optional(),warning:X().optional()});var nce=Q({keyId:X().min(1),encryptedKey:X().min(1),iv:X().min(1),ciphertext:X().min(1)});Q({keyId:X().min(1),algorithm:ZO(`RSA-OAEP-256+A256GCM`),publicKey:X().min(1)}),Q({provider:X().min(1),apiKey:X().min(1).optional(),encryptedApiKey:nce.optional()}).refine(e=>!!e.apiKey!=!!e.encryptedApiKey,{message:`Provide exactly one of apiKey or encryptedApiKey.`}),Q({provider:X().min(1)});var rce=XO([`starting`,`select`,`auth_url`,`device_code`,`prompt`,`progress`,`succeeded`,`failed`,`cancelled`]);Q({flowId:X().startsWith(`authflow_`),provider:X().min(1),providerName:X().min(1),status:rce,promptId:X().optional(),message:X().optional(),authUrl:X().optional(),instructions:X().optional(),options:WO(Q({id:X(),label:X()})).optional(),deviceCode:Q({userCode:X(),verificationUri:X(),intervalSeconds:Z().optional(),expiresInSeconds:Z().optional()}).optional(),placeholder:X().optional(),allowEmpty:HO().optional(),error:X().optional(),createdAt:X().datetime(),updatedAt:X().datetime()}),Q({promptId:X().min(1),value:X().optional(),selectedId:X().optional()});var ice=XO([`slash`,`file`,`directory`]),ace=xse([Z().int().nonnegative(),Z().int().nonnegative()]);Q({items:WO(Q({label:X().min(1),detail:X().optional(),info:X().optional(),kind:ice,apply:X().optional(),displayLabel:X().optional(),sortScore:Z().optional(),matchRanges:WO(ace).optional()}))}),Q({projectId:X().min(1).optional(),q:X().optional().default(``),limit:ik().int().positive().max(200).optional()}),X().startsWith(`run_`),X().startsWith(`turn_`),X().startsWith(`msg_`),X().startsWith(`block_`);var oce=`New Conversation`,sce=`Image Review`,cce=`File Review`,lce=`Link Review`,vk=3,yk=`astro.bash.c.cc.conf.cpp.cs.css.csv.go.h.hpp.html.java.jpeg.jpg.js.json.jsx.kt.lock.log.lua.md.mdx.php.png.py.rb.rs.scss.sh.sql.svg.svelte.swift.toml.ts.tsx.txt.vue.webp.xml.yaml.yml`.split(`.`).join(`|`),bk=[`avif`,`bmp`,`gif`,`jpeg`,`jpg`,`png`,`svg`,`tiff`,`webp`].join(`|`);function uce(e=yk){return new RegExp(String.raw`(?:\b[A-Za-z]:[\\/][^\s),;]+|(?:^|\s)(?:~|\.{1,2}|/)?(?:[\w.-]+[\\/])+[\w.-]+(?::\d+(?::\d+)?)?|\b[\w.-]+\.(?:${e})(?::\d+(?::\d+)?)?)`,`i`)}function dce(e){return e.replace(/```[\s\S]*?```/g,` `).replace(/~~~[\s\S]*?~~~/g,` `)}function fce(e){return e.replace(/https?:\/\/\S+|www\.\S+/gi,` `)}function pce(e){return e.replace(/\b[A-Za-z]:[\\/][^\s),;]+/g,` `).replace(/(?:^|\s)(?:~|\.{1,2}|\/)?(?:[\w.-]+[\\/])+[\w.-]+(?::\d+(?::\d+)?)?/g,` `).replace(RegExp(`\\b[\\w.-]+\\.(?:${yk})(?::\\d+(?::\\d+)?)?`,`gi`),` `)}function mce(e){return e.replace(/!\[[^\]]*\]\([^)]*\)/g,` `).replace(/\[([^\]]+)\]\([^)]*\)/g,`$1`).replace(/`([^`]+)`/g,`$1`).replace(/[*_~]/g,``).replace(/^\s{0,3}#{1,6}\s+/gm,``).replace(/^\s*[-*+]\s+/gm,``).replace(/^\s*\d+[.)]\s+/gm,``)}function xk(e){return(e.match(/[\p{L}\p{N}]/gu)??[]).length}function Sk(e){return(e.match(/[\p{L}\p{N}]+/gu)??[]).length}function hce(e){let t=e.trim();if(!t||/^(>|\$|>>>|\.\.\.|at\s+|\+{3}|-{3}|@@|\[[\w:-]+\])/.test(t))return!0;let n=t.replace(/[\p{L}\p{N}\s]/gu,``);return t.length>=8&&n.length/t.length>.45}function Ck(e){return pce(fce(mce(e))).replace(/[“”]/g,`"`).replace(/[‘’]/g,`'`).replace(/\btoolcall\b/giu,`tool call`).replace(/\bthe similar UI to the write and edit tool calls?\b/giu,`similar UI for write and edit tool calls`).replace(/[\r\n\t]+/g,` `).replace(/\s+/g,` `).replace(/\s+([,.;:!?])/g,`$1`).replace(/^(?:i\s+think\s+)?(?:we\s+)?should\s+(?=[\p{L}\p{N}])/iu,``).replace(/^please\s+(?=[\p{L}\p{N}])/iu,``).replace(/^(?:fix|update|change|edit|review|check|open|look at)\s+(?:and\s+)?(?=[\p{Lu}\p{N}])/iu,``).replace(/\b(?:in|at|from|for|and|or)\s+([,.;:!?])/giu,`$1`).replace(/\b(?:in|at|from|for|and|or)$/iu,``).replace(/[([\]{}<>]/g,` `).replace(/\s+/g,` `).trim()}function gce(e){return(e.match(/[^.!?]+[.!?]?/gu)??[e]).map(e=>e.trim()).filter(Boolean)}function _ce(e){let t=dce(e),n=[];for(let e of t.split(/\r?\n+/)){let t=e.trim();if(hce(t))continue;let r=Ck(t);for(let e of gce(r))n.push(Ck(e))}return n}function vce(e){let t=e.toLocaleLowerCase().replace(/[^\p{L}\p{N}\s]/gu,` `).replace(/\s+/g,` `).trim();return!!(!t||xk(t)<vk||/^(?:what do you think|thoughts|wdyt)$/u.test(t)||/^(?:(?:please|can you|could you|would you)\s+)?(?:see|look|look at|check|review|open|inspect|read|fix|update|edit|change|help)$/u.test(t)||Sk(t)<=2&&/^(?:please\s+)?(?:see|look|check|review|open|inspect|read)\b/u.test(t))}function yce(e,t){if(vce(e))return-1/0;let n=Sk(e);if(n<3)return-1/0;let r=Math.min(n,12)*2;return n>16&&(r-=(n-16)*.5),/\b(?:improve|fix|update|change|edit|review|redesign|test|build|add|remove|show|generate|write|create|make|debug|investigate|explain|compare|refactor|implement)\b/iu.test(e)&&(r+=20),/^(?:improve|fix|update|change|edit|review|redesign|test|build|add|remove|show|generate|write|create|make|debug|investigate|explain|compare|refactor|implement)\b/iu.test(e)&&(r+=16),/\b(?:ui|tool|call|title|conversation|settings|error|issue|bug|status|display|page|component|api|name)\b/iu.test(e)&&(r+=8),/\b(?:broken|hard|slow|fail|fails|error|issue|problem|confusing|unclear)\b/iu.test(e)&&(r+=8),/^(?:because|sometime|sometimes|here is|this is)\b/iu.test(e)&&(r-=12),r-t*.1}function bce(e){return(e.match(/^(.{12,}?[.!?])(?:\s|$)/u)?.[1]??e).trim()}function xce(e){let t=e.replace(/^[\s:;,.!?\-–—]+/u,``).replace(/[\s:;,\-–—]+$/u,``).replace(/\s+/g,` `).trim();return t?t.replace(/^\p{Ll}/u,e=>e.toLocaleUpperCase()):``}function Sce(e){return new RegExp(String.raw`(?:!\[[^\]]*\]\([^)]*\.(?:${bk})(?:[?#][^)]*)?\)|\b[A-Za-z]:[\\/][^\s),;]+\.(?:${bk})(?::\d+(?::\d+)?)?|(?:^|\s)(?:~|\.{1,2}|/)?(?:[\w.-]+[\\/])+[\w.-]+\.(?:${bk})(?::\d+(?::\d+)?)?|\b[\w.-]+\.(?:${bk})(?::\d+(?::\d+)?)?)`,`i`).test(e)}function Cce(e){return uce().test(e)}function wce(e){return/https?:\/\/\S+|www\.\S+/i.test(e)}function Tce(e){return Sce(e)?sce:Cce(e)?cce:wce(e)?lce:oce}function Ece(e){let t=_ce(e).map(e=>xce(bce(e))).filter(e=>xk(e)>=vk),n=``,r=-1/0;return t.forEach((e,t)=>{let i=yce(e,t);i>r&&(n=e,r=i)}),n||Tce(e)}Q({id:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),title:X().min(1),mode:pk,permissionLevel:mk,activeAgentId:X().startsWith(`agent_`).optional(),activeEntryId:X().startsWith(`entry_`).optional(),createdAt:X().datetime(),updatedAt:X().datetime()}),Q({projectId:X().startsWith(`proj_`),title:X().min(1).optional(),mode:pk.optional(),permissionLevel:mk.optional()}),Q({project:Q({name:X().min(1).optional(),dir:X().min(1)}).optional(),conversation:Q({title:X().min(1).optional(),mode:pk.optional(),permissionLevel:mk.optional()}),agents:WO(UO()).default([]),entries:WO(UO()).default([])});var Dce=Q({input:Z().int().nonnegative(),output:Z().int().nonnegative(),cacheRead:Z().int().nonnegative(),cacheWrite:Z().int().nonnegative(),totalTokens:Z().int().nonnegative(),cost:Z().nonnegative()}),Oce=XO([`message`,`compaction`,`branch_summary`,`explore_report`,`run_status`,`task_event`]),kce=Q({entry:Q({id:X().startsWith(`entry_`),conversationId:X().startsWith(`conv_`),agentId:X().startsWith(`agent_`).optional(),runId:X().startsWith(`run_`).optional(),turnId:X().startsWith(`turn_`).optional(),liveMessageId:X().startsWith(`msg_`).optional(),parentEntryId:X().startsWith(`entry_`).optional(),role:XO([`user`,`assistant`,`system`]),kind:Oce.default(`message`),text:X(),summary:X().optional(),tokensBefore:Z().int().nonnegative().optional(),usage:Dce.optional(),firstKeptEntryId:X().startsWith(`entry_`).optional(),fromEntryId:X().startsWith(`entry_`).optional(),details:UO().optional(),createdAt:X().datetime()}),childEntryIds:WO(X().startsWith(`entry_`))});Q({conversationId:X().startsWith(`conv_`),activeEntryId:X().startsWith(`entry_`).optional(),rootEntryIds:WO(X().startsWith(`entry_`)),nodes:WO(kce)}),Q({activeEntryId:X().startsWith(`entry_`).nullable(),summarize:HO().optional(),summaryInstructions:X().optional()}),Q({instructions:X().optional(),keepRecentTokens:Z().int().positive().optional()}),Q({seq:Z().int().nonnegative(),id:X().startsWith(`evt_`),ts:X().datetime(),type:X().min(1),durability:XO([`durable`,`transient`]).default(`durable`),data:UO()});var wk=XO([`git`,`package`,`workspace`,`python`,`rust`,`go`]),Ace=Q({name:X().min(1),path:X().min(1),kind:ZO(`directory`),hidden:HO(),signals:WO(wk)});Q({path:X().min(1),parent:X().min(1).optional(),signals:WO(wk),entries:WO(Ace)}),Q({path:X().optional(),showHidden:Bse().optional()}),Q({projectId:X().min(1),path:X().min(1),line:ik().int().positive().optional()}),Q({projectId:X().min(1),path:X().min(1),relativePath:X(),name:X().min(1),size:Z().nonnegative(),mtimeMs:Z().nonnegative(),type:XO([`text`,`image`,`binary`]),binary:HO(),text:X().optional(),dataBase64:X().optional(),mimeType:X().optional(),lineStart:Z().int().positive().optional(),targetLine:Z().int().positive().optional(),truncated:HO()}),Q({name:X().optional(),type:X().min(1),dataBase64:X().min(1)}),Q({path:X().min(1)});var Tk=XO([`M`,`A`,`D`,`R`,`C`,`U`,`?`,`!`,` `]),Ek=Q({relativePath:X(),absDir:X(),name:X(),isRepo:ZO(!0),currentBranch:X().nullable(),detached:HO(),ahead:Z().int().nullable(),behind:Z().int().nullable(),hasUpstream:HO(),hasRemote:HO(),hasGithubRemote:HO(),baseBranch:X(),onBaseBranch:HO(),mergedToBase:HO(),dirty:HO(),changeCount:Z().int().nonnegative()});Q({projectIsRepo:HO(),repos:WO(Ek)});var jce=Q({path:X(),renamedFrom:X().optional(),index:Tk,worktree:Tk,staged:HO(),untracked:HO()}),Mce=Q({hash:X(),subject:X(),relativeDate:X()});Q({repo:Ek,baseBranch:X(),onBaseBranch:HO(),files:WO(jce),stagedCount:Z().int().nonnegative(),unstagedCount:Z().int().nonnegative(),untrackedCount:Z().int().nonnegative(),insertions:Z().int().nonnegative(),deletions:Z().int().nonnegative(),recentCommits:WO(Mce)}),Q({branches:WO(Q({name:X(),current:HO(),remote:HO(),upstream:X().nullable()}))}),Q({repo:X().default(`.`),name:X().min(1)}),Q({repo:X().default(`.`),name:X().min(1)}),Q({repo:X().default(`.`)}),Q({repo:X().default(`.`),path:X().min(1)}),Q({repo:Ek}),Q({available:HO(),authenticated:HO(),login:X().nullable(),reason:X().optional()});var Nce=Q({name:X(),status:X(),conclusion:X().nullable(),url:X().optional()}),Pce=Q({status:XO([`pending`,`passing`,`failing`,`none`]),total:Z().int().nonnegative(),passed:Z().int().nonnegative(),failed:Z().int().nonnegative(),pending:Z().int().nonnegative(),runs:WO(Nce)}),Dk=Q({number:Z().int(),title:X(),url:X(),state:X(),isDraft:HO(),headRefName:X(),baseRefName:X(),updatedAt:X(),checks:Pce});Q({prs:WO(Dk)});var Fce=Q({path:X(),additions:Z().int().nonnegative(),deletions:Z().int().nonnegative()}),Ice=Q({oid:X(),abbrev:X(),messageHeadline:X(),authoredDate:X().optional(),authorName:X().optional()});Dk.extend({body:X(),author:X().nullable(),createdAt:X(),additions:Z().int().nonnegative(),deletions:Z().int().nonnegative(),changedFiles:Z().int().nonnegative(),mergeable:X().nullable(),reviewDecision:X().nullable(),files:WO(Fce),commits:WO(Ice)}),Q({repo:Ek,number:Z().int()});var Lce=Q({id:X().startsWith(`pin_`),projectId:X().startsWith(`proj_`),label:X().min(1).optional(),command:X().min(1),cwd:X().min(1).optional(),createdAt:X().datetime(),updatedAt:X().datetime()});Q({command:X().min(1),label:X().min(1).optional(),cwd:X().min(1).optional()}),Q({commands:WO(Lce)});var Rce=X().min(1).max(80).regex(/^[a-z0-9][a-z0-9._-]{0,79}$/),zce=XO([`pending`,`accepted`,`accepted_in_new_chat`,`changes_requested`,`discarded`,`force_exited`]);Q({id:X().startsWith(`plan_review_`),toolCallId:X().startsWith(`tool_`),agentId:X().startsWith(`agent_`),conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),slug:Rce,title:X().min(1).optional(),summary:X().min(1).optional(),planPath:X().min(1),content:X().optional(),status:zce,feedback:X().optional(),requestedAt:X().datetime(),resolvedAt:X().datetime().optional(),updatedAt:X().datetime()}),Q({feedback:X().optional(),implementationModel:lk.optional(),implementationThinkingLevel:ck.optional()}),Q({id:X().startsWith(`proj_`),name:X().min(1),dir:X().min(1),createdAt:X().datetime(),updatedAt:X().datetime()});var Ok=XO([`vscode`,`zed`]);Q({editor:Ok}),Q({projectId:X().startsWith(`proj_`),editor:Ok,dir:X().min(1)}),Q({dir:X().min(1),name:X().min(1).optional()});var Bce=XO([`olderThanDays`,`keepLatest`]);qO(`strategy`,[Q({strategy:ZO(`olderThanDays`),olderThanDays:Z().int().positive().max(3650)}),Q({strategy:ZO(`keepLatest`),keepLatest:Z().int().nonnegative().max(1e4)})]);var Vce=XO([`active_agent`,`active_task`]);Q({projectId:X().startsWith(`proj_`),strategy:Bce,prunedConversationIds:WO(X().startsWith(`conv_`)),prunedTaskIds:WO(X().startsWith(`task_`)),skipped:WO(Q({conversationId:X().startsWith(`conv_`),reason:Vce}))});var kk=XO([`openai-completions`,`openai-responses`,`azure-openai-responses`,`openai-codex-responses`,`anthropic-messages`,`bedrock-converse-stream`,`google-generative-ai`,`google-vertex`,`mistral-conversations`]),Hce=XO([`text`,`image`]),Uce=Q({input:Z().nonnegative().default(0),output:Z().nonnegative().default(0),cacheRead:Z().nonnegative().default(0),cacheWrite:Z().nonnegative().default(0)}),Wce=X().min(1).max(64).regex(/^[a-z0-9][a-z0-9-]*$/,`Use lowercase letters, numbers, and dashes (must start with a letter or number).`),Ak=JO(X(),UO()),Gce=Q({id:Wce,displayName:X().min(1),api:kk,baseUrl:X().url(),headers:JO(X(),X()).default({}),compat:Ak.optional()}),Kce=Q({provider:X().min(1),modelId:X().min(1),name:X().min(1),api:kk.optional(),baseUrl:X().url().optional(),headers:JO(X(),X()).optional(),compat:Ak.optional(),reasoning:HO().default(!1),supportedThinkingLevels:WO(ck).default([`off`]),thinkingLevelMap:JO(X(),X().nullable()).optional(),input:WO(Hce).default([`text`]),cost:Uce.default({input:0,output:0,cacheRead:0,cacheWrite:0}),contextWindow:Z().int().nonnegative().default(0),maxTokens:Z().int().nonnegative().default(0)});Q({version:ZO(1).default(1),providers:WO(Gce).default([]),models:WO(Kce).default([])});var qce=Q({available:HO(),source:XO([`manual`,`project_venv`,`path`,`windows_launcher`,`uv`,`unavailable`]),executable:X().optional(),version:X().optional(),error:X().optional()}),jk=Q({available:HO(),source:XO([`path`,`app`,`known_path`]).optional(),executable:X().optional(),error:X().optional()}),Jce=Q({vscode:jk,zed:jk}),Mk=Q({port:Z().int().positive(),url:X().url(),caCertUrl:X().url()});Q({daemonId:X().startsWith(`daemon_`),version:X(),startedAt:X().datetime(),dataDir:X(),mobileHttps:Mk.optional(),storage:Q({home:X(),sqlitePath:X(),indexHealthy:HO()}),runtime:Q({python:qce,editors:Jce})}),Q({daemonId:X().startsWith(`daemon_`),pid:Z().int().positive(),host:X(),port:Z().int().positive(),url:X().url(),mobileHttps:Mk.optional(),startedAt:X().datetime(),dataDir:X(),version:X()}),Q({dataDir:X(),sqlitePath:X(),configPath:X(),counts:Q({projects:Z().int().nonnegative(),conversations:Z().int().nonnegative(),agents:Z().int().nonnegative(),events:Z().int().nonnegative(),tasks:Z().int().nonnegative(),workers:Z().int().nonnegative()}).optional()});var Yce=Q({key:XO([`conversations`,`logs`,`sqliteIndex`,`exploreReports`,`plans`,`agents`,`tasks`,`workflowState`,`projects`,`workers`,`cache`,`tmp`,`protected`,`other`]),label:X(),description:X(),bytes:Z().int().nonnegative(),fileCount:Z().int().nonnegative(),cleanable:HO(),protected:HO()}),Xce=Q({conversationId:X(),title:X().nullable(),bytes:Z().int().nonnegative()}),Zce=Q({dataDir:X(),generatedAt:X().datetime(),totalBytes:Z().int().nonnegative(),categories:WO(Yce),sqlite:Q({dbBytes:Z().int().nonnegative(),walBytes:Z().int().nonnegative(),shmBytes:Z().int().nonnegative()}),conversations:Q({total:Z().int().nonnegative(),largest:WO(Xce)})});Q({conversationsOlderThanDays:Z().int().positive().max(3650).optional(),logsOlderThanDays:Z().int().positive().max(3650).optional(),truncateEventLog:HO().optional(),clearToolCallLog:HO().optional(),clearExploreReports:HO().optional(),clearCache:HO().optional(),clearTmp:HO().optional(),vacuumSqlite:HO().optional()}).refine(e=>Object.values(e).some(e=>e!==void 0&&e!==!1),{message:`Select at least one cleanup target.`});var Qce=Q({target:X(),freedBytes:Z().int().nonnegative(),removedItems:Z().int().nonnegative(),skipped:Z().int().nonnegative(),note:X().optional()});Q({freedBytes:Z().int().nonnegative(),results:WO(Qce),usage:Zce});var $ce=XO([`pending`,`resuming`,`resumed`,`cancelled`,`error`]),ele=XO([`ask_user`,`plan_mode_present`]),tle=Q({id:X().min(1),name:X().min(1),arguments:JO(X(),UO())});Q({id:X().startsWith(`susp_`),agentId:X().startsWith(`agent_`),conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),runId:X().startsWith(`run_`),turnId:X().startsWith(`turn_`).optional(),liveMessageId:X().startsWith(`msg_`).optional(),assistantEntryId:X().startsWith(`entry_`).optional(),toolCallId:X().startsWith(`tool_`),providerToolCallId:X().min(1),toolName:ele,remainingToolCalls:WO(tle).default([]),status:$ce,reason:X(),createdAt:X().datetime(),updatedAt:X().datetime(),resolvedAt:X().datetime().optional(),error:X().optional()});var Nk=XO([`starting`,`running`,`ready`,`stopping`,`completed`,`failed`,`timed_out`,`cancelled`,`orphaned`]),nle=XO([`foreground`,`background`]),rle=Q({readyUrl:X().url().optional(),readyOnUrl:HO().optional(),readyPattern:X().optional(),timeoutMs:Z().int().nonnegative().optional(),outcome:XO([`pending`,`ready`,`timeout`,`exited`,`none`]),matched:X().optional(),readyAt:X().datetime().optional()}),ile=Q({platform:X().min(1),childPid:Z().int().positive().optional(),processGroupId:Z().int().positive().optional(),detached:HO(),shell:HO(),spawnedAt:X().datetime()}),ale=Q({keys:WO(X().min(1)).default([]),persisted:HO(),redacted:ZO(!0).default(!0)});Q({version:ZO(1),env:JO(X(),X()).optional(),createdAt:X().datetime(),updatedAt:X().datetime()});var ole=qO(`kind`,[Q({kind:ZO(`api`)}),Q({kind:ZO(`utility_panel`)}),Q({kind:ZO(`agent_tool`),toolCallId:X().startsWith(`tool_`),providerToolCallId:X().min(1).optional(),runId:X().startsWith(`run_`).optional(),turnId:X().startsWith(`turn_`).optional(),liveMessageId:X().startsWith(`msg_`).optional(),contentIndex:Z().int().nonnegative().optional()})]),sle=Q({inject:HO().default(!1),entryId:X().startsWith(`entry_`).optional(),injectedAt:X().datetime().optional(),outputTailLineCount:Z().int().positive().max(200).default(80)}),cle=Q({enabled:HO().default(!1),ready:HO().default(!1),terminal:HO().default(!1),readyEntryId:X().startsWith(`entry_`).optional(),terminalEntryId:X().startsWith(`entry_`).optional(),readyDeliveredAt:X().datetime().optional(),terminalDeliveredAt:X().datetime().optional(),outputTailLineCount:Z().int().positive().max(200).default(80)}),Pk=Q({id:X().startsWith(`task_`),name:X().min(1).optional(),groupId:X().startsWith(`taskgrp_`).optional(),groupName:X().min(1).optional(),workerId:X().startsWith(`worker_`).optional(),projectId:X().startsWith(`proj_`).optional(),conversationId:X().startsWith(`conv_`).optional(),agentId:X().startsWith(`agent_`).optional(),cwd:X().min(1),command:X().min(1),envInfo:ale.optional(),status:Nk,readiness:rle,stdoutPath:X().min(1),stderrPath:X().min(1),combinedPath:X().min(1).optional(),logsPath:X().min(1),startedAt:X().datetime(),updatedAt:X().datetime(),finishedAt:X().datetime().optional(),exitCode:Z().int().nullable().optional(),signal:X().nullable().optional(),error:X().optional(),timeoutMs:Z().int().positive().optional(),restartedFromTaskId:X().startsWith(`task_`).optional(),restartRootTaskId:X().startsWith(`task_`).optional(),restartGeneration:Z().int().nonnegative().optional(),legacyProcessId:X().startsWith(`proc_`).optional(),runtime:ile.optional(),origin:ole.default({kind:`api`}),completion:sle.optional(),notifications:cle.optional(),visibility:nle.default(`background`)});Q({name:X().min(1).optional(),groupId:X().startsWith(`taskgrp_`).optional(),groupName:X().min(1).optional(),workerId:X().startsWith(`worker_`).optional(),projectId:X().startsWith(`proj_`).optional(),conversationId:X().startsWith(`conv_`).optional(),agentId:X().startsWith(`agent_`).optional(),cwd:X().min(1),command:X().min(1),env:JO(X(),X()).optional(),readyUrl:X().url().optional(),readyOnUrl:HO().optional(),readyPattern:X().min(1).optional(),readyTimeoutMs:Z().int().nonnegative().max(6e4).optional(),timeoutMs:Z().int().positive().max(864e5).optional(),notify:HO().optional(),injectCompletion:HO().optional()}),Q({signal:XO([`SIGTERM`,`SIGINT`,`SIGKILL`]).optional(),timeoutMs:Z().int().positive().max(3e4).optional(),reason:X().min(1).optional()}),Q({removed:WO(X().startsWith(`task_`))});var lle=Q({seq:Z().int().positive(),ts:X().datetime(),stream:XO([`stdout`,`stderr`]),level:XO([`info`,`warn`,`error`]),line:X()});Q({mode:XO([`recent`,`errors`,`warnings`,`since_cursor`,`first_failure`]).optional(),sinceSeq:Z().int().nonnegative().optional(),contains:X().optional(),regex:X().optional(),contextLines:Z().int().nonnegative().max(20).optional(),limit:Z().int().positive().max(500).optional()});var ule=Q({task:Pk,events:WO(lle),nextCursor:Z().int().nonnegative(),mode:X(),previewPath:X().min(1).optional(),truncated:HO().optional()}),Fk=XO([`read`,`workspace_write`,`command`,`network`,`secret`,`destructive`,`agent_spawn`,`deployment`,`interaction`]),dle=XO([`read`,`bash`,`python`,`edit`,`write`,`grep`,`find`,`ls`,`ask_user`,`todos_set`,`todos_get`,`web_search`,`web_fetch`]),fle=XO([`task_start`,`task_status`,`task_logs`,`task_cancel`,`task_restart`,`task_list`,`explore`,`plan_mode_enter`,`plan_mode_present`,`plan_mode_force_exit`]),Ik=XO([...dle.options,...fle.options]);Q({name:Ik,risk:Fk,description:X()});var ple=XO([`requested`,`pending_approval`,`waiting_for_user`,`running`,`completed`,`denied`,`error`]),mle=Q({code:X().min(1),message:X().min(1),retryable:HO().optional(),details:JO(X(),UO()).optional()}),hle=Q({id:X().startsWith(`tool_`),agentId:X().startsWith(`agent_`),conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),toolName:Ik,sourceToolCallId:X().min(1).optional(),providerToolCallId:X().min(1).optional(),runId:X().startsWith(`run_`).optional(),turnId:X().startsWith(`turn_`).optional(),liveMessageId:X().startsWith(`msg_`).optional(),contentIndex:Z().int().nonnegative().optional(),risk:Fk,args:UO(),cwd:X().min(1),status:ple,hidden:HO().optional(),approvalId:X().startsWith(`approval_`).optional(),suspensionId:X().startsWith(`susp_`).optional(),result:UO().optional(),error:X().optional(),errorDetails:mle.optional(),createdAt:X().datetime(),updatedAt:X().datetime()}),gle=XO([`pending`,`granted`,`denied`]);Q({id:X().startsWith(`approval_`),toolCallId:X().startsWith(`tool_`),agentId:X().startsWith(`agent_`),conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),risk:Fk,reason:X(),status:gle,requestedAt:X().datetime(),resolvedAt:X().datetime().optional()});var _le=XO([`pending`,`answered`,`dismissed`]);Q({id:X().startsWith(`question_`),toolCallId:X().startsWith(`tool_`),agentId:X().startsWith(`agent_`),conversationId:X().startsWith(`conv_`),projectId:X().startsWith(`proj_`),question:X().min(1),context:X().optional(),recommendation:X().optional(),placeholder:X().optional(),status:_le,answer:X().optional(),dismissedReason:X().optional(),requestedAt:X().datetime(),resolvedAt:X().datetime().optional(),updatedAt:X().datetime()}),Q({answer:X().min(1)}),Q({reason:X().optional()}),Q({toolName:Ik,args:JO(X(),UO()).default({})}),Q({note:X().optional()});var Lk=KO([Q({type:ZO(`text`),text:X()}),Q({type:ZO(`image`),data:X(),mimeType:X()})]),Rk=Q({truncated:HO().optional(),omittedLines:Z().optional(),omittedBytes:Z().optional(),truncatedLines:Z().optional(),direction:XO([`head`,`tail`,`line`,`head_tail`]).optional(),partialLine:HO().optional(),nextOffset:Z().optional(),nextByteOffset:Z().optional(),maxLines:Z().optional(),maxBytes:Z().optional(),maxLineChars:Z().optional(),byteOffset:Z().optional(),byteLimit:Z().optional(),rawResultPath:X().optional()}).passthrough(),zk=Q({bytes:Z().optional(),lines:Z().optional(),displayedBytes:Z().optional(),displayedLines:Z().optional(),truncated:HO().optional(),omittedLines:Z().optional(),omittedBytes:Z().optional(),truncatedLines:Z().optional(),direction:XO([`head`,`tail`,`line`,`head_tail`]).optional(),maxLineChars:Z().optional(),savedTo:X().optional()}).passthrough(),vle=Q({stdout:zk.optional(),stderr:zk.optional(),combined:zk.optional()}).passthrough(),yle=Q({diff:X(),firstChangedLine:Z().optional(),lineEnding:KO([ZO(`
|
|
38
|
-
`),ZO(`\r
|
|
39
|
-
`)]),bom:HO()}).passthrough(),ble=Q({index:Z().int().nonnegative(),type:XO([`replace_text`,`insert_text`,`replace_lines`,`insert_lines`,`apply_patch`]),source:XO([`replacements`,`insertions`,`lineReplacements`,`lineInsertions`,`patch`]).optional(),sourceIndex:Z().int().nonnegative().optional(),matchMode:XO([`exact`,`trimmed`,`whitespace`]).optional(),occurrence:Z().int().positive().optional(),matchCount:Z().int().nonnegative().optional(),startLine:Z().int().positive().optional(),endLine:Z().int().positive().optional(),matchedBy:XO([`unique`,`occurrence`,`line_range`,`line_insert`,`patch`])}).passthrough(),xle=yle.extend({dryRun:HO(),operationCount:Z().int().nonnegative(),operations:WO(ble)}),Sle=Q({truncation:Rk.optional(),fullOutputPath:X().optional(),rawResultPath:X().optional(),signal:X().nullable().optional()}).passthrough(),Cle=Q({path:X(),size:Z().nonnegative().optional()}).passthrough(),wle=Q({truncation:Rk.optional(),fullOutputPath:X().optional(),rawResultPath:X().optional(),signal:X().nullable().optional(),executable:X().optional(),version:X().optional(),timeoutSeconds:Z().optional(),durationMs:Z().optional(),timedOut:HO().optional(),timeoutKilled:HO().optional(),allowNetwork:HO().optional(),allowFileWrite:HO().optional(),inputMode:XO([`inline`,`file`]).optional(),scriptPath:X().optional(),streams:vle.optional(),artifactDir:X().optional(),artifacts:WO(Cle).optional(),envKeys:WO(X()).optional()}).passthrough(),Tle=Q({path:X(),kind:XO([`file`,`directory`,`other`])}),Ele=Q({path:X(),line:Z(),text:X()}),Dle=Q({query:X(),answer:X().optional(),results:WO(Q({title:X(),url:X()}))}),Ole=Q({url:X(),status:Z(),contentType:X(),size:Z(),savedTo:X().optional(),converted:HO()}),Bk=Q({content:X().optional(),contentBlocks:WO(Lk).optional(),details:UO().optional(),path:X().optional(),entries:WO(Tle).optional(),matches:WO(Ele).optional(),stdout:X().optional(),stderr:X().optional(),exitCode:Z().optional()}),kle=XO([`cancelled`,`force_cancelled`,`already_terminal`,`became_terminal_before_cancel`,`no_matching_active_task`]),Ale=Q({taskId:X().startsWith(`task_`).optional(),taskName:X().optional(),requestedSignal:XO([`SIGTERM`,`SIGINT`,`SIGKILL`]).optional(),outcome:kle,status:Nk.optional(),message:X()}),jle=Q({task:Pk.optional(),tasks:WO(Pk).optional(),groupId:X().startsWith(`taskgrp_`).optional(),groupName:X().optional(),restartedFromTaskId:X().startsWith(`task_`).optional(),newTaskId:X().startsWith(`task_`).optional(),restartRootTaskId:X().startsWith(`task_`).optional(),cancelResults:WO(Ale).optional(),contentBlocks:WO(Lk).optional()}),Mle=Q({tasks:WO(Pk),groupId:X().startsWith(`taskgrp_`).optional(),contentBlocks:WO(Lk).optional()}),Nle=ule.extend({contentBlocks:WO(Lk).optional()}),Ple=Q({input:Z().nonnegative().default(0),output:Z().nonnegative().default(0),cacheRead:Z().nonnegative().default(0),cacheWrite:Z().nonnegative().default(0),totalTokens:Z().nonnegative().default(0),cost:Z().nonnegative().default(0),turns:Z().int().nonnegative().default(0)}),Fle=Q({type:XO([`tool_call`,`tool_result`,`assistant`]),toolName:X().optional(),message:X(),timestamp:X().datetime().optional()}),Ile=Q({reports:WO(Q({agentId:X().startsWith(`agent_`),task:X(),label:X().optional(),status:XO([`completed`,`failed`,`aborted`]).default(`completed`),report:X(),reportPath:X().min(1).optional(),summaryPreview:X().optional(),usage:Ple.optional(),model:X().optional(),stopReason:X().optional(),errorMessage:X().optional(),steps:WO(Fle).optional()})),contentBlocks:WO(Lk).optional()}),Lle=Q({question:X(),context:X().optional(),recommendation:X().optional(),response:X().optional(),dismissed:HO().optional(),dismissedReason:X().optional()}),Rle=Q({todo:X(),done:HO()}),zle=Q({contentBlocks:WO(Lk).optional(),details:Q({todos:WO(Rle)}).optional()}),Ble=480*1e3;Q({text:X()});var Vle=XO([`anthropic`,`openai-codex`]),Vk=Q({usedPercent:Z().nullable(),resetsAt:X().datetime().nullable(),resetAfterSeconds:Z().nullable(),windowMinutes:Z().nullable()});WO(Q({provider:Vle,session:Vk.nullable(),weekly:Vk.nullable(),planType:X().nullable().optional(),updatedAt:X().datetime()}));var Hle=Q({apiKey:X().optional(),headers:JO(X(),X()).optional()});qO(`type`,[Q({type:ZO(`prompt`),id:X().startsWith(`run_`),systemPrompt:X().optional(),messages:WO(UO()),model:lk.optional(),auth:Hle.optional()}),Q({type:ZO(`abort`),id:X().startsWith(`run_`)})]),qO(`type`,[Q({type:ZO(`ready`)}),Q({type:ZO(`started`),id:X().startsWith(`run_`)}),Q({type:ZO(`text_delta`),id:X().startsWith(`run_`),delta:X()}),Q({type:ZO(`done`),id:X().startsWith(`run_`),text:X(),message:UO().optional()}),Q({type:ZO(`error`),id:X().startsWith(`run_`).optional(),message:X(),aborted:HO().optional(),fatal:HO().optional()})]);var Ule=XO([`local`]),Wle=XO([`online`,`offline`,`error`]);Q({id:X().startsWith(`worker_`),kind:Ule,name:X().min(1),status:Wle,capabilities:zse(e=>Array.isArray(e)?e.map(e=>e===`process`?`task`:e):e,WO(XO([`agent`,`task`]))).default([`agent`,`task`]),endpoint:Q({pid:Z().int().positive().optional(),host:X().optional(),port:Z().int().positive().optional()}).optional(),createdAt:X().datetime(),updatedAt:X().datetime()});async function Hk(e,t){return(await Pw(`/api/agents/${Dw(e)}`,t)).agent}function Gle(e){switch(e.split(`;`)[0]?.trim().toLowerCase()){case`audio/wav`:case`audio/wave`:case`audio/x-wav`:return`wav`;case`audio/mp4`:case`audio/m4a`:case`audio/x-m4a`:return`mp4`;case`audio/mpeg`:case`audio/mp3`:case`audio/x-mpeg`:return`mp3`;case`audio/mpga`:return`mpga`;case`audio/flac`:case`audio/x-flac`:return`flac`;case`audio/ogg`:case`audio/oga`:return`ogg`;default:return`webm`}}async function Kle(e){if(!e.ok){let t=await e.text().catch(()=>``),n=Rw(t);throw new Tw(e.status,n.code,n.message||t||e.statusText||`Transcription failed.`)}let t=e.headers.get(`content-type`)??``;if(!t.includes(`application/json`)){let n=await e.text();throw new Tw(e.status,void 0,`Expected JSON response from transcription API, received ${t||`unknown content type`}. ${n.slice(0,80)}`)}return await e.json()}async function qle(e,t,n={}){let r=new FormData;return r.append(`file`,e,`composer-recording.${Gle(e.type)}`),r.append(`durationMs`,String(Math.max(1,Math.round(t)))),(await Kle(await fetch(`/api/transcription/audio`,{method:`POST`,credentials:`same-origin`,body:r,signal:n.signal}))).text}async function Jle(){return(await jw(`/api/auth/providers`)).providers}async function Uk(){return jw(`/api/auth/credential-key`)}async function Wk(e,t){await Nw(`/api/provider-keys`,{provider:e,encryptedApiKey:t})}async function Gk(e){await Fw(`/api/auth/providers/${Dw(e)}`)}async function Yle(e){return(await Mw(`/api/auth/oauth/flows`,{provider:e})).flow}async function Xle(e){return(await jw(`/api/auth/oauth/flows/${Dw(e)}`)).flow}async function Kk(e,t){return(await Mw(`/api/auth/oauth/flows/${Dw(e)}/respond`,t)).flow}async function Zle(e){return(await Mw(`/api/auth/oauth/flows/${Dw(e)}/cancel`,{})).flow}async function qk(){return jw(`/api/providers/catalog`)}async function Qle(e){return Nw(`/api/providers/custom`,e)}async function $le(e){return Fw(`/api/providers/custom/${Dw(e)}`)}async function eue(e){return Nw(`/api/providers/models`,e)}async function tue(e,t){return Fw(`/api/providers/models/${Dw(e)}/${Dw(t)}`)}async function Jk(){return jw(`/api/client-config`)}async function nue(){return(await jw(`/api/models`)).models}async function rue(){return(await jw(`/api/completions/slash`)).items}async function iue(e,t){return e?(await jw(`/api/completions/files?${new URLSearchParams({projectId:e,q:t}).toString()}`)).items:[]}async function aue(e){return(await Mw(`/api/filesystem/clipboard-image`,{name:e.name,type:e.type,dataBase64:await Lw(e)})).path}async function oue(e,t=!1){let n=new URLSearchParams;e&&n.set(`path`,e),t&&n.set(`showHidden`,`true`);let r=n.toString();return jw(`/api/filesystem/directories${r?`?${r}`:``}`)}async function sue(e,t,n){let r=new URLSearchParams({projectId:e,path:t});return n!==void 0&&r.set(`line`,String(n)),jw(`/api/filesystem/file?${r.toString()}`)}async function cue(e){return jw(`/api/projects/${Dw(e)}/git/repos`)}async function lue(e,t){let n=new URLSearchParams({repo:t});return jw(`/api/projects/${Dw(e)}/git/overview?${n.toString()}`)}async function uue(e,t){let n=new URLSearchParams({repo:t});return jw(`/api/projects/${Dw(e)}/git/branches?${n.toString()}`)}async function due(e,t,n){return Mw(`/api/projects/${Dw(e)}/git/branch`,{repo:t,name:n})}async function fue(e,t,n){return Mw(`/api/projects/${Dw(e)}/git/switch-branch`,{repo:t,name:n})}async function pue(e,t){return Mw(`/api/projects/${Dw(e)}/git/sync`,{repo:t})}async function mue(e,t){return Mw(`/api/projects/${Dw(e)}/git/fetch`,{repo:t})}async function Yk(e,t,n){return Mw(`/api/projects/${Dw(e)}/git/stage-file`,{repo:t,path:n})}async function Xk(e,t,n){return Mw(`/api/projects/${Dw(e)}/git/unstage-file`,{repo:t,path:n})}async function hue(e,t,n){return Mw(`/api/projects/${Dw(e)}/git/discard-file`,{repo:t,path:n})}async function gue(e,t){let n=new URLSearchParams({repo:t});return jw(`/api/projects/${Dw(e)}/github/status?${n.toString()}`)}async function _ue(e,t){let n=new URLSearchParams({repo:t});return jw(`/api/projects/${Dw(e)}/github/prs?${n.toString()}`)}async function vue(e,t,n){let r=new URLSearchParams({repo:t});return jw(`/api/projects/${Dw(e)}/github/pr/${Dw(n)}?${r.toString()}`)}async function yue(e,t,n){return Mw(`/api/projects/${Dw(e)}/github/pr/${Dw(n)}/checkout`,{repo:t})}async function bue(e={}){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&String(r).length>0&&t.set(n,String(r));return jw(`/api/logs${t.size?`?${t.toString()}`:``}`)}async function xue(e){return Mw(`/api/logs/prune`,e)}async function Sue(e){await Iw(`/api/projects/${Dw(e)}`)}async function Cue(e,t){return Mw(`/api/projects/${Dw(e)}/conversations/prune`,t)}async function wue(e,t){return Mw(`/api/projects/${Dw(e)}/open-editor`,{editor:t})}async function Tue(e){return(await jw(`/api/projects/${Dw(e)}/pinned-commands`)).commands}async function Zk(e,t){return(await Mw(`/api/projects/${Dw(e)}/pinned-commands`,t)).command}async function Eue(e,t){await Iw(`/api/projects/${Dw(e)}/pinned-commands/${Dw(t)}`)}async function Due(){return jw(`/api/settings`)}async function Oue(e){return(await Nw(`/api/settings`,e)).settings}async function Qk(e,t=`recent`){let n=new URLSearchParams({mode:t,limit:`120`});return jw(`/api/tasks/${Dw(e)}/logs?${n.toString()}`)}async function kue(e){return(await Mw(`/api/tasks`,e)).task}async function Aue(e){return(await Mw(`/api/tasks/${Dw(e)}/cancel`,{})).task}async function jue(e){return(await Mw(`/api/tasks/${Dw(e)}/restart`,{})).task}async function Mue(e){await Fw(`/api/tasks/${Dw(e)}`)}async function Nue(){return Mw(`/api/tasks/prune`,{})}async function $k(){let[{approvals:e},{toolCalls:t}]=await Promise.all([jw(`/api/approvals?status=pending`),jw(`/api/tool-calls`)]),n=new Map(t.map(e=>[e.id,e]));return e.map(e=>({...e,toolCall:n.get(e.toolCallId)}))}async function eA(){return(await jw(`/api/user-questions?status=pending`)).questions}async function tA(){return(await jw(`/api/plan-reviews?status=pending`)).planReviews}async function Pue(e,t={}){return(await Mw(`/api/plan-reviews/${Dw(e)}/accept`,t)).planReview}async function Fue(e,t={}){return Mw(`/api/plan-reviews/${Dw(e)}/accept-in-new-chat`,t)}async function Iue(e,t){return(await Mw(`/api/plan-reviews/${Dw(e)}/reject`,{feedback:t})).planReview}async function Lue(e,t){return(await Mw(`/api/user-questions/${Dw(e)}/answer`,{answer:t})).question}async function Rue(e,t){return(await Mw(`/api/user-questions/${Dw(e)}/dismiss`,{reason:t})).question}async function nA(){return(await jw(`/api/usage/subscription`)).usage}async function zue(){let[e,t,n,r]=await Promise.all([jw(`/api/projects`),jw(`/api/conversations`),jw(`/api/agents`),jw(`/api/tasks`)]);return{projects:e.projects,conversations:[...t.conversations].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)),agents:n.agents,tasks:r.tasks}}var Bue=L(`<div aria-live="polite"><span class="activity-sr svelte-9ds0r"> </span> <span aria-hidden="true"> </span></div>`);function rA(e,t){D(t,!0);let n=q(t,`recording`,3,!1),r=q(t,`transcribing`,3,!1),i=q(t,`elapsedMs`,3,0),a=q(t,`maxDurationMs`,3,1),o=q(t,`retryAttempt`,3,0),s=q(t,`maxRetries`,3,0),c=q(t,`class`,3,``),l=k(()=>n()||r()),u=k(()=>g(i())),d=k(()=>g(a())),f=k(()=>Math.max(0,Math.min(1,a()>0?i()/a():0))),p=k(()=>I(f)>=.85),m=k(()=>n()?`${I(u)} / ${I(d)}`:o()>0?`Retry ${o()}/${s()}`:`Transcribing…`),h=k(()=>n()?`Recording ${I(u)} of ${I(d)}`:o()>0?`Retrying transcription ${o()} of ${s()}`:`Transcribing audio`);function g(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}var _=R(),v=N(_),y=e=>{var t=Bue(),r=M(t),i=M(r,!0);T(r);var a=P(r,2),o=M(a,!0);T(a),T(t),F(()=>{ra(t,1,`transcription-activity ${c()}`,`svelte-9ds0r`),W(t,`data-state`,n()?`recording`:`transcribing`),W(t,`data-near-limit`,I(p)?`true`:void 0),B(i,I(h)),B(o,I(m))}),z(e,t)};V(v,e=>{I(l)&&e(y)}),z(e,_),O()}var iA=`nerve.conversationTabs.v1`,Vue=12;function Hue(e){if(!e)return{tabIds:[]};try{let t=JSON.parse(e);return{tabIds:Array.isArray(t.tabIds)?t.tabIds.filter(e=>typeof e==`string`):[],activeId:typeof t.activeId==`string`?t.activeId:void 0}}catch{return{tabIds:[]}}}function aA(e){return[...new Set(e.filter(e=>e.startsWith(`conv_`)))].slice(0,Vue)}function Uue(){if(typeof localStorage>`u`)return{tabIds:[]};let e=Hue(localStorage.getItem(iA));return{tabIds:aA(e.tabIds),activeId:e.activeId?.startsWith(`conv_`)?e.activeId:void 0}}function oA(e,t){if(typeof localStorage>`u`)return;let n=aA(e),r={tabIds:n,activeId:t&&n.includes(t)?t:void 0};localStorage.setItem(iA,JSON.stringify(r))}function Wue(e,t){let n=new Set(t.map(e=>e.id));return aA(e).filter(e=>n.has(e))}function sA(e){let t=$T(e);return kT.conversationViews[t]??={conversationId:e,activeEntryId:void 0,activeEntryIds:[],transcript:[],toolCalls:[],treeNodes:[],streamingText:``,live:{messages:[],toolDrafts:[],toolOutputByToolCallId:{}},queuedPrompts:[],cursorSeq:0,sending:!1,composerText:``,loading:!1},kT.conversationViews[t]}function cA(){oA(kT.openConversationTabIds,kT.activeConversationTabId)}function Gue(e){WT({kind:`conversation`,id:e}),sA(e)}var lA=0;function Kue(){return lA+=1,`pending_${Date.now().toString(36)}_${lA.toString(36)}`}function uA(){let e=Y.activeCenterTab;if(e?.kind===`pending-conversation`)return kT.pendingConversations[eE(e.id)]}function dA(){Y.error=void 0}function fA(){DT(),kT.activeConversationTabId=void 0,dA(),ET.text=``}var pA=16e3,mA=`audio/wav`,que=4096;function Jue(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Float32Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Yue(e,t,n=pA){if(e.length===0)return new Float32Array;if(t===n)return new Float32Array(e);if(t<=0||n<=0)throw Error(`Sample rates must be positive.`);let r=Math.max(1,Math.round(e.length*n/t)),i=new Float32Array(r),a=t/n;for(let t=0;t<r;t+=1){let n=t*a,r=Math.floor(n),o=Math.min(r+1,e.length-1),s=n-r;i[t]=e[r]*(1-s)+e[o]*s}return i}function Xue(e){let t=Math.max(-1,Math.min(1,e));return Math.round(t<0?t*32768:t*32767)}function Zue(e,t,n){if(!n)return e;let r=Math.max(1,Math.round(t*n/1e3));return e.length<=r?e:e.slice(0,r)}function Que(e,t=pA){let n=t*2,r=e.length*2,i=new ArrayBuffer(44+r),a=new DataView(i);hA(a,0,`RIFF`),a.setUint32(4,36+r,!0),hA(a,8,`WAVE`),hA(a,12,`fmt `),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,1,!0),a.setUint32(24,t,!0),a.setUint32(28,n,!0),a.setUint16(32,2,!0),a.setUint16(34,16,!0),hA(a,36,`data`),a.setUint32(40,r,!0);let o=44;for(let t of e)a.setInt16(o,Xue(t),!0),o+=2;return new Uint8Array(i)}function hA(e,t,n){for(let r=0;r<n.length;r+=1)e.setUint8(t+r,n.charCodeAt(r))}function $ue(e){let t=e.numberOfChannels,n=e.length;if(t===1)return new Float32Array(e.getChannelData(0));let r=new Float32Array(n);for(let i=0;i<t;i+=1){let a=e.getChannelData(i);for(let e=0;e<n;e+=1)r[e]+=a[e]/t}return r}function gA(){if(!(typeof window>`u`))return window.AudioContext??window.webkitAudioContext}function ede(e){try{return new e({sampleRate:pA})}catch{return new e}}var _A=class e{audioContext;processor;source;stream;chunks=[];startedAt=0;stopped=!0;static isSupported(){return!!(typeof navigator<`u`&&navigator.mediaDevices?.getUserMedia&&gA())}async start(){if(!e.isSupported())throw Error(`Audio recording is not supported in this browser.`);if(!this.stopped)throw Error(`Recording is already in progress.`);let t=gA();if(!t)throw Error(`Web Audio is not supported in this browser.`);this.chunks=[],this.stopped=!1,this.startedAt=Date.now();try{this.stream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:{ideal:1},sampleRate:{ideal:pA},sampleSize:{ideal:16},echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1}}),this.audioContext=ede(t),this.audioContext.state===`suspended`&&await this.audioContext.resume(),this.source=this.audioContext.createMediaStreamSource(this.stream),this.processor=this.audioContext.createScriptProcessor(que,1,1),this.processor.onaudioprocess=e=>{if(!this.stopped){this.chunks.push($ue(e.inputBuffer));for(let t=0;t<e.outputBuffer.numberOfChannels;t+=1)e.outputBuffer.getChannelData(t).fill(0)}},this.source.connect(this.processor),this.processor.connect(this.audioContext.destination)}catch(e){throw await this.cleanup(),e}}async stop(e={}){if(this.stopped)throw Error(`No recording is in progress.`);this.stopped=!0;let t=Math.max(1,Date.now()-this.startedAt),n=e.maxDurationMs?Math.min(t,e.maxDurationMs):t,r=this.audioContext?.sampleRate??16e3,i=this.chunks;this.chunks=[],await this.cleanup();let a=Jue(i);if(a.length===0)throw Error(`No audio was captured.`);let o=Que(Zue(Yue(a,r,pA),pA,e.maxDurationMs),pA),s=new ArrayBuffer(o.byteLength);return new Uint8Array(s).set(o),{blob:new Blob([s],{type:mA}),durationMs:n,mimeType:mA}}async cancel(){this.stopped=!0,this.chunks=[],await this.cleanup()}async cleanup(){this.processor?.disconnect(),this.processor=void 0,this.source?.disconnect(),this.source=void 0,this.stream?.getTracks().forEach(e=>{e.stop()}),this.stream=void 0;let e=this.audioContext;this.audioContext=void 0,e&&e.state!==`closed`&&await e.close().catch(()=>void 0)}},vA=[500,1e3,2e3];function yA(e){return e instanceof DOMException&&e.name===`AbortError`}function tde(e){return vA[e-1]??vA.at(-1)??2e3}function nde(e,t){return new Promise((n,r)=>{if(t.aborted){r(new DOMException(`Transcription was cancelled.`,`AbortError`));return}let i=window.setTimeout(n,e);t.addEventListener(`abort`,()=>{window.clearTimeout(i),r(new DOMException(`Transcription was cancelled.`,`AbortError`))},{once:!0})})}function rde(e){return yA(e)?!1:e instanceof Tw&&e.status?e.status===408||e.status===429||e.status>=500:!0}function bA(e){return e instanceof Error?e.message:String(e)}var xA=class e{#e=A(!1);get recording(){return I(this.#e)}set recording(e){j(this.#e,e,!0)}#t=A(!1);get transcribing(){return I(this.#t)}set transcribing(e){j(this.#t,e,!0)}#n=A(void 0);get error(){return I(this.#n)}set error(e){j(this.#n,e,!0)}#r=A(0);get elapsedMs(){return I(this.#r)}set elapsedMs(e){j(this.#r,e,!0)}#i=A(0);get retryAttempt(){return I(this.#i)}set retryAttempt(e){j(this.#i,e,!0)}maxDurationMs=Ble;maxRetries=3;#a=A(!1);#o;#s=0;#c;#l;#u;#d;#f;constructor(e){this.#d=e.onTranscript,this.#f=e.onError}static isSupported(){return _A.isSupported()}get pending(){return this.transcribing||I(this.#a)}#p(e){this.error=e,this.#f?.(e)}toggle(){this.recording?this.stop():this.start()}async start(){if(!(this.recording||this.pending)){if(!e.isSupported()){this.#p(`Audio recording is not supported in this browser.`);return}this.error=void 0,this.retryAttempt=0,this.elapsedMs=0;try{let e=new _A;await e.start(),this.#o=e,this.recording=!0,this.#m()}catch(e){await this.#o?.cancel(),this.#o=void 0,this.#h(),this.recording=!1,this.#p(bA(e))}}}async stop(){if(!this.#o||I(this.#a))return!1;let e=this.#o;j(this.#a,!0),this.#o=void 0,this.#h();try{let t=await e.stop({maxDurationMs:this.maxDurationMs});return this.recording=!1,this.elapsedMs=t.durationMs,await this.#_(t)}catch(e){return this.recording=!1,this.#p(bA(e)),!1}finally{j(this.#a,!1)}}async cancel(){this.#u?.abort();let e=this.#o;this.#o=void 0,this.#h(),this.recording=!1,this.transcribing=!1,this.retryAttempt=0,this.elapsedMs=0,await e?.cancel()}#m(){this.#h(),this.#s=Date.now(),this.#g(),this.#c=window.setInterval(()=>this.#g(),250),this.#l=window.setTimeout(()=>{this.recording&&this.stop()},this.maxDurationMs)}#h(){this.#c&&window.clearInterval(this.#c),this.#l&&window.clearTimeout(this.#l),this.#c=void 0,this.#l=void 0}#g(){this.#s&&(this.elapsedMs=Math.min(Math.max(0,Date.now()-this.#s),this.maxDurationMs))}async#_(e){let t=new AbortController;this.#u=t,this.transcribing=!0,this.error=void 0,this.retryAttempt=0;let n=!1;try{for(let r=0;r<=this.maxRetries;r+=1){r>0&&(this.retryAttempt=r,await nde(tde(r),t.signal));try{let n=await qle(e.blob,e.durationMs,{signal:t.signal});return t.signal.aborted||!n.trim()?!1:(this.#d(n),!0)}catch(e){if(t.signal.aborted||yA(e))return!1;if(r>=this.maxRetries||!rde(e))throw n=r>=this.maxRetries,e}}}catch(e){if(t.signal.aborted||yA(e))return!1;let r=bA(e);this.#p(n?`Transcription failed after ${this.maxRetries} retries: ${r}`:r)}finally{this.#u===t&&(this.#u=void 0),this.transcribing=!1,this.retryAttempt=0}return!1}};function SA(e){return`${e.kind}:${e.id}`}function CA(e,t){return!!(e&&t&&e.kind===t.kind&&e.id===t.id)}function wA(e,t){let n=t.trim();return n?`${e}${e.trim()?/\s$/.test(e)?``:`
|
|
40
|
-
|
|
41
|
-
`:``}${n} `:e}function ide(e){cd.error(`Voice input failed`,{description:e})}var TA=new class{#e=A(void 0);#t=A(!1);#n=new Map;#r=new xA({onTranscript:e=>this.#o(e),onError:e=>this.#a(e)});get activeTarget(){return I(this.#e)}get recording(){return this.#r.recording}get transcribing(){return this.#r.transcribing}get pending(){return I(this.#t)||this.#r.pending}get elapsedMs(){return this.#r.elapsedMs}get retryAttempt(){return this.#r.retryAttempt}get maxDurationMs(){return this.#r.maxDurationMs}get maxRetries(){return this.#r.maxRetries}isSupported(){return xA.isSupported()}isTargetActive(e){return CA(I(this.#e),e)}isBusyForOtherTarget(e){return!!(I(this.#e)&&!CA(I(this.#e),e))}registerTargetHandlers(e,t){let n=SA(e);return this.#n.set(n,t),()=>{this.#n.get(n)===t&&this.#n.delete(n)}}async toggle(e){if(this.isTargetActive(e)&&this.recording){await this.stop(e);return}await this.start(e)}async start(e){if(I(this.#e))return!1;if(!this.isSupported())return this.#a(`Audio recording is not supported in this browser.`,e),!1;j(this.#e,e,!0),j(this.#t,!0);try{await this.#r.start()}finally{j(this.#t,!1)}return!this.#r.recording&&!this.#r.pending?(CA(I(this.#e),e)&&j(this.#e,void 0),!1):!0}async stop(e){let t=I(this.#e);if(!t||e&&!CA(t,e))return!1;let n=await this.#r.stop();return CA(I(this.#e),t)&&j(this.#e,void 0),n}async cancel(e){let t=I(this.#e);e&&!CA(t,e)||(j(this.#e,void 0),j(this.#t,!1),await this.#r.cancel())}async cancelIfTarget(e){this.isTargetActive(e)&&await this.cancel(e)}async cancelIfTargets(e){let t=I(this.#e);t&&e.some(e=>CA(t,e))&&await this.cancel(t)}#i(e=I(this.#e)){return e?this.#n.get(SA(e)):void 0}#a(e,t=I(this.#e)){let n=this.#i(t)?.onError;n?n(e):ide(e)}#o(e){let t=I(this.#e);if(!t)return;let n=this.#i(t);if(n?.appendTranscript){n.appendTranscript(e);return}if(t.kind===`conversation`){let n=sA(t.id);n.composerText=wA(n.composerText,e);return}if(t.kind===`pending-conversation`){let n=kT.pendingConversations[eE(t.id)];n&&(n.composerText=wA(n.composerText,e))}}},EA=[],DA=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?DA:EA).push(n+=e[t])})();function ade(e){if(e<768)return!1;for(let t=0,n=EA.length;;){let r=t+n>>1;if(e<EA[r])n=r;else if(e>=DA[r])t=r+1;else return!0;if(t==n)return!1}}function OA(e){return e>=127462&&e<=127487}var kA=8205;function ode(e,t,n=!0,r=!0){return(n?AA:sde)(e,t,r)}function AA(e,t,n){if(t==e.length)return t;t&&MA(e.charCodeAt(t))&&NA(e.charCodeAt(t-1))&&t--;let r=jA(e,t);for(t+=PA(r);t<e.length;){let i=jA(e,t);if(r==kA||i==kA||n&&ade(i))t+=PA(i),r=i;else if(OA(i)){let n=0,r=t-2;for(;r>=0&&OA(jA(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function sde(e,t,n){for(;t>0;){let r=AA(e,t-2,n);if(r<t)return r;t--}return 0}function jA(e,t){let n=e.charCodeAt(t);if(!NA(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return MA(r)?(n-55296<<10)+(r-56320)+65536:n}function MA(e){return e>=56320&&e<57344}function NA(e){return e>=55296&&e<56320}function PA(e){return e<65536?1:2}var FA=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=UA(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),LA.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=UA(this,e,t);let n=[];return this.decompose(e,t,n,0),LA.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new BA(this),i=new BA(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new BA(this,e)}iterRange(e,t=this.length){return new VA(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new HA(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new IA(t):LA.from(IA.split(t,[]))}},IA=class e extends FA{constructor(e,t=cde(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new lde(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(zA(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=RA(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=UA(this,t,n);let i=RA(this.text,RA(r.text,zA(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):LA.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
|
|
42
|
-
`){[e,t]=UA(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},LA=class e extends FA{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=UA(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
|
|
43
|
-
`){[e,t]=UA(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new IA(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof IA&&c&&(n=u[u.length-1])instanceof IA&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new IA(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};FA.empty=new IA([``],0);function cde(e){let t=-1;for(let n of e)t+=n.length+1;return t}function RA(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function zA(e,t,n){return RA(e,[``],t,n)}var BA=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof IA?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof IA?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
44
|
-
`,this;e--}else if(r instanceof IA){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof IA?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},VA=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new BA(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},HA=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(FA.prototype[Symbol.iterator]=function(){return this.iter()},BA.prototype[Symbol.iterator]=VA.prototype[Symbol.iterator]=HA.prototype[Symbol.iterator]=function(){return this});var lde=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function UA(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function WA(e,t,n=!0,r=!0){return ode(e,t,n,r)}function ude(e){return e>=56320&&e<57344}function dde(e){return e>=55296&&e<56320}function GA(e,t){let n=e.charCodeAt(t);if(!dde(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return ude(r)?(n-55296<<10)+(r-56320)+65536:n}function fde(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function KA(e){return e<65536?1:2}var qA=/\r\n?|\n/,JA=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(JA||={}),YA=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){$A(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:tj(this,e)}mapDesc(e,t=!1){return e.empty?this:ej(this,e,t)}mapPos(e,t=-1,n=JA.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=JA.Simple&&c>=e&&(n==JA.TrackDel&&r<e&&c>e||n==JA.TrackBefore&&r<e||n==JA.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},XA=class e extends YA{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return $A(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return ej(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(FA.empty);r.push(a?t.slice(i,i+a):FA.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:tj(this,e,!0)}map(e,t=!1){return e.empty?this:ej(this,e,t,!0)}iterChanges(e,t=!1){$A(this,e,t)}get desc(){return YA.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new nj(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);ZA(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;ZA(n,e,t),t>0&&QA(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);ZA(n,e,-1),ZA(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:YA.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&ZA(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?FA.of(l.split(r||qA)):l:FA.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&ZA(i,e-o,-1),ZA(i,s-e,d),QA(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(FA.empty);r[e]=FA.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function ZA(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function QA(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(FA.empty);e.push(n)}}function $A(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=FA.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function ej(e,t,n,r=!1){let i=[],a=r?[]:null,o=new nj(e),s=new nj(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);ZA(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(ZA(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(ZA(i,0,o.ins),a&&QA(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;ZA(i,t,e<o.i?o.ins:0),a&&e<o.i&&QA(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?XA.createSet(i,a):YA.create(i);else throw Error(`Mismatched change set lengths`)}function tj(e,t,n=!1){let r=[],i=n?[]:null,a=new nj(e),o=new nj(t);for(let e=!1;;)if(a.done&&o.done)return i?XA.createSet(r,i):YA.create(r);else if(a.ins==0)ZA(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)ZA(r,0,o.ins,e),i&&QA(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;ZA(r,t,n,e),i&&n&&QA(i,r,o.text)}else o.ins==-1?(ZA(r,a.off?0:a.len,t,e),i&&QA(i,r,a.textBit(t))):(ZA(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&QA(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var nj=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?FA.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?FA.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},rj=class e{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return ij.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return ij.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return ij.range(e.anchor,e.head)}static create(t,n,r){return new e(t,n,r)}},ij=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>rj.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return rj.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,t,n,r,i){let a=(n??16777215)<<6|(r==null?7:Math.min(6,r));return!i&&e!=t&&(i=t<e?1:-1),t<e?rj.create(t,e,48|a):rj.create(e,t,(i?i<0?8:16:0)|a)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function aj(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var oj=0,sj=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=oj++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:cj),!!t.static,t.enables)}of(e){return new lj([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new lj(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new lj(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function cj(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var lj=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=oj++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||dj(e,c)){let r=t(e);if(a?!uj(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=wj(o,c);if(this.dependencies.every(t=>t instanceof sj?o.facet(t)===e.facet(t):t instanceof mj?o.field(t,!1)==e.field(t,!1):!0)||(a?uj(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}};function uj(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function dj(e,t){let n=!1;for(let r of t)Cj(e,r)&1&&(n=!0);return n}function fj(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=wj(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)Cj(e,t);return e.values[o]=s(e),1},update(e,n){if(!dj(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=dj(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&cj(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var pj=sj.define({static:!0}),mj=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(oj++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(pj).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(pj),i=n.facet(pj),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,pj.of({field:this,create:e})]}get extension(){return this}},hj={lowest:4,low:3,default:2,high:1,highest:0};function gj(e){return t=>new vj(t,e)}var _j={highest:gj(hj.highest),high:gj(hj.high),default:gj(hj.default),low:gj(hj.low),lowest:gj(hj.lowest)},vj=class{constructor(e,t){this.inner=e,this.prec=t}},yj=class e{of(e){return new bj(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},bj=class{constructor(e,t){this.compartment=e,this.inner=t}},xj=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of Sj(t,n,o))e instanceof mj?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0))if(s[n.id]=c.length<<1|1,cj(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>fj(e,n,t))}}return new e(t,o,l.map(e=>e(s)),s,c,a)}};function Sj(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof bj&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof bj){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof vj)a(e.inner,e.prec);else if(e instanceof mj)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof lj)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,hj.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,hj.default),r.reduce((e,t)=>e.concat(t))}function Cj(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function wj(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var Tj=sj.define(),Ej=sj.define({combine:e=>e.some(e=>e),static:!0}),Dj=sj.define({combine:e=>e.length?e[0]:void 0,static:!0}),Oj=sj.define(),kj=sj.define(),Aj=sj.define(),jj=sj.define({combine:e=>e.length?e[0]:!1}),Mj=class{constructor(e,t){this.type=e,this.value=t}static define(){return new Nj}},Nj=class{of(e){return new Mj(this,e)}},Pj=class{constructor(e){this.map=e}of(e){return new Fj(this,e)}},Fj=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new Pj(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};Fj.reconfigure=Fj.define(),Fj.appendConfig=Fj.define();var Ij=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&aj(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};Ij.time=Mj.define(),Ij.userEvent=Mj.define(),Ij.addToHistory=Mj.define(),Ij.remote=Mj.define();function Lj(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function Rj(e,t,n){let r,i,a;return n?(r=t.changes,i=XA.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:Fj.mapEffects(e.effects,r).concat(Fj.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function zj(e,t,n){let r=t.selection,i=Wj(t.annotations);return t.userEvent&&(i=i.concat(Ij.userEvent.of(t.userEvent))),{changes:t.changes instanceof XA?t.changes:XA.of(t.changes||[],n,e.facet(Dj)),selection:r&&(r instanceof ij?r:ij.single(r.anchor,r.head)),effects:Wj(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function Bj(e,t,n){let r=zj(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=Rj(r,zj(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=Ij.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return Hj(n?Vj(i):i)}function Vj(e){let t=e.startState,n=!0;for(let r of t.facet(Oj)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:Lj(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=XA.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=Ij.create(t,r,e.selection&&e.selection.map(i),Fj.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(kj);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof Ij?i:Array.isArray(i)&&i.length==1&&i[0]instanceof Ij?i[0]:Bj(t,Wj(i),!1)}return e}function Hj(e){let t=e.startState,n=t.facet(Aj),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=Rj(r,zj(t,a,e.changes.newLength),!0))}return r==e?e:Ij.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var Uj=[];function Wj(e){return e==null?Uj:Array.isArray(e)?e:[e]}var Gj=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(Gj||={}),Kj=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,qj;try{qj=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function Jj(e){if(qj)return qj.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>``&&(n.toUpperCase()!=n.toLowerCase()||Kj.test(n)))return!0}return!1}function Yj(e){return t=>{if(!/\S/.test(t))return Gj.Space;if(Jj(t))return Gj.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return Gj.Word;return Gj.Other}}var Xj=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)Cj(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return Cj(this,n),wj(this,n)}update(...e){return Bj(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(yj.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(Fj.reconfigure)?(n=null,r=e.value):e.is(Fj.appendConfig)&&(n=null,r=Wj(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=xj.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(Ej)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:ij.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=Wj(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=Fj.mapEffects(a,c).concat(Fj.mapEffects(Wj(o.effects),l))}return{changes:r,selection:ij.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof XA?t:XA.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return FA.of(t.split(this.facet(e.lineSeparator)||qA))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Cj(this,t),wj(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof mj&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:ij.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=xj.resolve(t.extensions||[],new Map),r=t.doc instanceof FA?t.doc:FA.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||qA)),i=t.selection?t.selection instanceof ij?t.selection:ij.single(t.selection.anchor,t.selection.head):ij.single(0);return aj(i,r.length),n.staticFacet(Ej)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`
|
|
45
|
-
`}get readOnly(){return this.facet(jj)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(Tj))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt(`wordChars`,e);return Yj(t.length?t[0]:``)}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=WA(t,a,!1);if(i(t.slice(e,a))!=Gj.Word)break;a=e}for(;o<r;){let e=WA(t,o);if(i(t.slice(o,e))!=Gj.Word)break;o=e}return a==o?null:ij.range(a+n,o+n)}};Xj.allowMultipleSelections=Ej,Xj.tabSize=sj.define({combine:e=>e.length?e[0]:4}),Xj.lineSeparator=Dj,Xj.readOnly=jj,Xj.phrases=sj.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),Xj.languageData=Tj,Xj.changeFilter=Oj,Xj.transactionFilter=kj,Xj.transactionExtender=Aj,yj.reconfigure=Fj.define();function Zj(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(!(a===i||i===void 0))if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}var Qj=class{eq(e){return this==e}range(e,t=e){return eM.create(e,t,this)}};Qj.prototype.startSide=Qj.prototype.endSide=0,Qj.prototype.point=!1,Qj.prototype.mapMode=JA.TrackDel;function $j(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}var eM=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}};function tM(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var nM=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},rM=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(tM)),this.isEmpty)return n.length?e.of(n):this;let s=new sM(this,null,-1).goto(0),c=0,l=[],u=new aM;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(eM.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return cM.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return cM.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=oM(a,o,n),c=new uM(a,s,i),l=new uM(o,s,i);n.iterGaps((e,t,n)=>dM(c,e,l,t,n,r)),n.empty&&n.length==0&&dM(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=999999999;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=oM(i,a),s=new uM(i,o,0).goto(n),c=new uM(a,o,0).goto(n);for(;;){if(s.to!=c.to||!fM(s.active,c.active)||s.point&&(!c.point||!$j(s.point,c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new uM(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new aM;for(let r of e instanceof eM?[e]:t?iM(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}};rM.empty=new rM([],[],null,-1);function iM(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(tM(t,r)>0)return e.slice().sort(tM);t=r}return e}rM.empty.nextLayer=rM.empty;var aM=class e{finishChunk(e){this.chunks.push(new nM(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||=new e).add(t,n,r)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(rM.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=rM.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function oM(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}var sM=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},cM=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new sM(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)lM(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)lM(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),lM(this.heap,0)}}};function lM(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var uM=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=cM.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){pM(this.active,e),pM(this.activeTo,e),pM(this.activeRank,e),this.minActive=hM(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;mM(this.active,t,n),mM(this.activeTo,t,r),mM(this.activeRank,t,i),e&&mM(e,t,this.cursor.from),this.minActive=hM(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&pM(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function dM(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t,l=!!a.boundChange;for(let t=!1;;){let r=e.to+c-n.to,i=r||e.endSide-n.endSide,u=i<0?e.to+c:n.to,d=Math.min(u,o);if(e.point||n.point?(e.point&&n.point&&$j(e.point,n.point)&&fM(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,d,e.point,n.point),t=!1):(t&&a.boundChange(s),d>s&&!fM(e.active,n.active)&&a.compareRange(s,d,e.active,n.active),l&&d<o&&(r||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>o)break;s=u,i<=0&&e.next(),i>=0&&n.next()}}function fM(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!$j(e[n],t[n]))return!1;return!0}function pM(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function mM(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function hM(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function gM(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=WA(e,i));return r}function _M(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=WA(e,r)}return r===!0?-1:e.length}for(var vM=`ͼ`,yM=typeof Symbol>`u`?`__ͼ`:Symbol.for(vM),bM=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),xM=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},SM=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`
|
|
46
|
-
`)}static newName(){let e=xM[yM]||1;return xM[yM]=e+1,vM+e.toString(36)}static mount(e,t,n){let r=e[bM],i=n&&n.nonce;r?i&&r.setNonce(i):r=new wM(e,i),r.mount(Array.isArray(t)?t:[t],e)}},CM=new Map,wM=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=CM.get(n);if(t)return e[bM]=t;this.sheet=new r.CSSStyleSheet,CM.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[bM]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t],o=this.modules.indexOf(a);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,a),n)for(let e=0;e<a.rules.length;e++)n.insertRule(a.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
|
|
47
|
-
`;this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}},TM={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},EM={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},DM=typeof navigator<`u`&&/Mac/.test(navigator.platform),OM=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),kM=0;kM<10;kM++)TM[48+kM]=TM[96+kM]=String(kM);for(var kM=1;kM<=24;kM++)TM[kM+111]=`F`+kM;for(var kM=65;kM<=90;kM++)TM[kM]=String.fromCharCode(kM+32),EM[kM]=String.fromCharCode(kM);for(var AM in TM)EM.hasOwnProperty(AM)||(EM[AM]=TM[AM]);function jM(e){var t=!(DM&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||OM&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?EM:TM)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var MM=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},NM=typeof document<`u`?document:{documentElement:{style:{}}},PM=/Edge\/(\d+)/.exec(MM.userAgent),FM=/MSIE \d/.test(MM.userAgent),IM=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(MM.userAgent),LM=!!(FM||IM||PM),RM=!LM&&/gecko\/(\d+)/i.test(MM.userAgent),zM=!LM&&/Chrome\/(\d+)/.exec(MM.userAgent),BM=`webkitFontSmoothing`in NM.documentElement.style,VM=!LM&&/Apple Computer/.test(MM.vendor),HM=VM&&(/Mobile\/\w+/.test(MM.userAgent)||MM.maxTouchPoints>2),UM={mac:HM||/Mac/.test(MM.platform),windows:/Win/.test(MM.platform),linux:/Linux|X11/.test(MM.platform),ie:LM,ie_version:FM?NM.documentMode||6:IM?+IM[1]:PM?+PM[1]:0,gecko:RM,gecko_version:RM?+(/Firefox\/(\d+)/.exec(MM.userAgent)||[0,0])[1]:0,chrome:!!zM,chrome_version:zM?+zM[1]:0,ios:HM,android:/Android\b/.test(MM.userAgent),webkit:BM,webkit_version:BM?+(/\bAppleWebKit\/(\d+)/.exec(MM.userAgent)||[0,0])[1]:0,safari:VM,safari_version:VM?+(/\bVersion\/(\d+(\.\d+)?)/.exec(MM.userAgent)||[0,0])[1]:0,tabSize:NM.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function WM(e,t){for(let n in e)n==`class`&&t.class?t.class+=` `+e.class:n==`style`&&t.style?t.style+=`;`+e.style:t[n]=e[n];return t}var GM=Object.create(null);function KM(e,t,n){if(e==t)return!0;e||=GM,t||=GM;let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function qM(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??e.removeAttribute(r)}for(let n in t){let r=t[n];n==`style`?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function JM(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i==`style`?e.style.cssText=``:e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i==`style`?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function YM(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}var XM=class{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},ZM=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(ZM||={}),QM=class extends Qj{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new $M(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new tN(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=nN(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new tN(e,n,r,t,e.widget||null,!0)}static line(e){return new eN(e)}static set(e,t=!1){return rM.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};QM.none=rM.empty;var $M=class e extends QM{constructor(e){let{start:t,end:n}=nN(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?WM(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||GM}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&KM(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}};$M.prototype.point=!1;var eN=class e extends QM{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&KM(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}};eN.prototype.mapMode=JA.TrackBefore,eN.prototype.point=!0;var tN=class e extends QM{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?JA.TrackBefore:JA.TrackAfter:JA.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?ZM.WidgetBefore:ZM.WidgetAfter:ZM.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&rN(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}};tN.prototype.point=!0;function nN(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function rN(e,t){return e==t||!!(e&&t&&e.compare(t))}function iN(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}var aN=class e extends Qj{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&KM(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||GM,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(e,t=!1){return rM.of(e,t)}};aN.prototype.startSide=aN.prototype.endSide=-1;function oN(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function sN(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function cN(e,t){if(!t.anchorNode)return!1;try{return sN(e,t.anchorNode)}catch{return!1}}function lN(e){return e.nodeType==3?wN(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function uN(e,t,n,r){return n?pN(e,t,n,r,-1)||pN(e,t,n,r,1):!1}function dN(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function fN(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function pN(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:mN(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=dN(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?mN(e):0}else return!1}}function mN(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function hN(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function gN(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function _N(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function vN(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=gN(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=_N(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top+o?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom-o&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left+a?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right-a&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g)if(f)l.scrollBy(h,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/m,n=(u.scrollTop-e)*m}if(h){let t=u.scrollLeft;u.scrollLeft+=h/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-h)<1&&(r=`nearest`),n&&Math.abs(n-g)<1&&(i=`nearest`)}if(f)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function yN(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}var bN=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?mN(t):0),n,Math.min(e.focusOffset,n?mN(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},xN=null;UM.safari&&UM.safari_version>=26&&(xN=!1);function SN(e){if(e.setActive)return e.setActive();if(xN)return e.focus(xN);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(xN==null?{get preventScroll(){return xN={preventScroll:!0},!0}}:void 0),!xN){xN=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],i=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}}}var CN;function wN(e,t,n=t){let r=CN||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function TN(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function EN(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function DN(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,mN(n));;)if(r){if(n.nodeType!=1)return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=mN(n))}else if(n==e)return!0;else r=dN(n),n=n.parentNode}function ON(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function kN(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r>0)return{node:n,offset:r};else if(n.nodeType==1&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=mN(n)}else if(n.parentNode&&!fN(n))r=dN(n),n=n.parentNode;else return null}function AN(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};else if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!fN(n))r=dN(n)+1,n=n.parentNode;else return null}var jN=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,dN(t),n)}static after(t,n){return new e(t.parentNode,dN(t)+1,n)}},MN=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(MN||={}),NN=MN.LTR,PN=MN.RTL;function FN(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}var IN=FN(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),LN=FN(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),RN=Object.create(null),zN=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);RN[t]=n,RN[n]=-t}function BN(e){return e<=247?IN[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?LN[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}var VN=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,HN=class{get dir(){return this.level%2?PN:NN}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}};function UN(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!UN(r.inner,i.inner))return!1}return!0}var WN=[];function GN(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=BN(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),WN[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=WN[e];if(i==128)e<s-1&&t==WN[e+1]&&t&24?i=WN[e]=t:WN[e]=256;else if(i==64){let i=e+1;for(;i<s&&WN[i]==64;)i++;let a=e&&t==8||i<n&&WN[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)WN[t]=a;e=i-1}else i==8&&r==1&&(WN[e]=1);t=i,i&7&&(r=i)}}}function KN(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=RN[n=e.charCodeAt(t)])if(r<0){for(let e=s-3;e>=0;e-=3)if(zN[e+1]==-r){let n=zN[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(WN[t]=WN[zN[e]]=r),s=e;break}}else if(zN.length==189)break;else zN[s++]=t,zN[s++]=n,zN[s++]=c;else if((o=WN[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=zN[t+2];if(n&2)break;if(e)zN[t+2]|=2;else{if(n&4)break;zN[t+2]|=4}}}}}function qN(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=WN[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(WN[o]==256)o++;else break;let l=a==1,u=l==((o<t?WN[o]:r)==1)?l?1:2:r;for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),WN[--t]=u;c=o}else a=o,c++}}}function JN(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=WN[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(WN[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new HN(c,m.from,f)),YN(e,m.direction==NN==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?WN[p]!=s:WN[p]==s))break;else p++;d?JN(e,c,p,r+1,i,d,o):c<p&&o.push(new HN(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=WN[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(WN[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new HN(m.to,c,f)),YN(e,m.direction==NN==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?WN[p-1]!=s:WN[p-1]==s))break;else p--;d?JN(e,p,c,r+1,i,d,o):p<c&&o.push(new HN(p,c,f)),c=p}}function YN(e,t,n,r,i,a,o){let s=t%2?2:1;GN(e,i,a,r,s),KN(e,i,a,r,s),qN(i,a,r,s),JN(e,i,a,t,n,r,o)}function XN(e,t,n){if(!e)return[new HN(0,0,+(t==PN))];if(t==NN&&!n.length&&!VN.test(e))return ZN(e.length);if(n.length)for(;e.length>WN.length;)WN[WN.length]=256;let r=[],i=t==NN?0:1;return YN(e,i,i,n,0,e.length,r),r}function ZN(e){return[new HN(0,e,0)]}var QN=``;function $N(e,t,n,r,i){let a=r.head-e.from,o=HN.find(t,a,r.bidiLevel??-1,r.assoc),s=t[o],c=s.side(i,n);if(a==c){let e=o+=i?1:-1;if(e<0||e>=t.length)return null;s=t[o=e],a=s.side(!i,n),c=s.side(i,n)}let l=WA(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),QN=e.text.slice(Math.min(a,l),Math.max(a,l));let u=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];return u&&l==c&&u.level+ +!i<s.level?ij.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level):ij.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function eP(e,t,n){for(let r=t;r<n;r++){let t=BN(e.charCodeAt(r));if(t==1)return NN;if(t==2||t==4)return PN}return NN}var tP=sj.define(),nP=sj.define(),rP=sj.define(),iP=sj.define(),aP=sj.define(),oP=sj.define(),sP=sj.define(),cP=sj.define(),lP=sj.define(),uP=sj.define({combine:e=>e.some(e=>e)}),dP=sj.define({combine:e=>e.some(e=>e)}),fP=sj.define(),pP=class e{constructor(e,t,n,r,i,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new e(ij.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},mP=Fj.define({map:(e,t)=>e.map(t)}),hP=Fj.define();function gP(e,t,n){let r=e.facet(iP);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+`:`,t):console.error(t))}var _P=sj.define({combine:e=>e.length?e[0]:!0}),vP=0,yP=sj.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),bP=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(yP.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(yP.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(vP++,t,r,i,e=>{let t=[];return o&&t.push(wP.of(t=>{let n=t.plugin(e);return n?o(n):QM.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},xP=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){gP(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(gP(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){gP(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},SP=sj.define(),CP=sj.define(),wP=sj.define(),TP=sj.define(),EP=sj.define(),DP=sj.define(),OP=sj.define();function kP(e,t){let n=e.state.facet(OP);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return rM.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let n=r[e].spec.bidiIsolate,i;if(n??=eP(t.text,o,s),a>0&&c.length&&(i=c[c.length-1]).to==o&&i.direction==n)i.to=s,c=i.inner;else{let e={from:o,to:s,direction:n,inner:[]};c.push(e),c=e.inner}}}}),i}var AP=sj.define();function jP(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(AP)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}var MP=sj.define(),NP=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},PP=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=XA.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new NP(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},FP=[],IP=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return FP}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&qM(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:``)+(this.breakAfter?`#`:``)}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=dN(this.dom),r=this.length?e>0:t>0;return new jN(this.parent.dom,n+ +!!r,e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof zP)return e;return null}static get(e){return e.cmTile}},LP=class extends IP{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=RP(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=RP(r);this.length=a}};function RP(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var zP=class extends LP{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=IP.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof BP)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},BP=class e extends LP{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},VP=class e extends LP{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||a.isHidden&&(t>0||n&&UP(a,d)))&&(f>c||d.flags&32)?(a=d,o=c-u):(u<c||d.flags&16&&!d.isHidden)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):HP(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new jN(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new jN(e.dom,0);e==n.tile&&(a=!0)}}return new jN(this.dom,0)}};function HP(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=lN(t);return n[n.length-1]||null}function UP(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}var WP=class e extends LP{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},GP=class e extends IP{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,i=e,a=0;e==0&&t<0||e==n&&t>=0?UM.chrome||UM.gecko||(e?(r--,a=1):i<n&&(i++,a=-1)):t<0?r--:i<n&&i++;let o=wN(this.dom,r,i).getClientRects();if(!o.length)return null;let s=o[(a?a<0:t>=0)?0:o.length-1];return UM.safari&&!a&&s.width==0&&(s=Array.prototype.find.call(o,e=>e.width)||s),a?hN(s,a<0):s||null}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},KP=class e extends IP{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return hN(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return hN(n,!r)}}get overrideDOMText(){if(!this.length)return FA.empty;let{root:e}=this;if(!e)return FA.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},qP=class extends IP{constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return FA.empty}coordsIn(e){return this.dom.getBoundingClientRect()}},JP=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite())if(i==r.length)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(e){let t=Math.min(e,r.length-i);n&&n.skip(r,i,i+t),e-=t,i+=t}else break;else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},YP=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},XP=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new GP(a.dom,a.text+e);t.parent=i}else i.append(r||GP.of(e,this.cache.find(GP)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?oF(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof WP&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(oF(n.dom)),r=i;else{if(this.cache.reused.get(n)){let e=IP.get(n.dom);e&&e.setDOM(oF(n.dom))}let e=WP.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let i=IP.get(e.text);i&&this.cache.reused.set(i,2);let a=new GP(e.text,e.text.nodeValue);a.flags|=8,this.pos=e.range.toB,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=rF;let n=VP.start(e,t||this.cache.find(VP)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof WP&&a.mark.eq(i))n=a,t--;else{let e=WP.of(i,this.cache.find(WP,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!tF(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(UM.ios&&tF(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(cF,0,32)||new KP(cF.toDOM(),0,cF,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,n=new YP(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof BP&&n.wrapper.eq(t.wrapper))e=n;else{let n=BP.of(t.wrapper,this.cache.find(BP,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(qP,void 0,1);return n&&(n.flags=t),n||new qP(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},ZP=class{constructor(e){this.skipCount=0,this.text=``,this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=``,this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},QP=[KP,VP,GP,WP,qP,BP,zP];for(let e=0;e<QP.length;e++)QP[e].bucket=e;var $P=class{constructor(e){this.view=e,this.buckets=QP.map(()=>[]),this.index=QP.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=i.length-1;e>=0;e--){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new KP(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},eF=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new $P(e),this.text=new ZP(e.state.doc),this.builder=new XP(this.cache,new zP(e,e.contentDOM),rM.iter(n)),this.cache.reused.set(t,2),this.old=new JP(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=aF(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?KP.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length&&!this.cache.reused.has(e)?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof qP)this.cache.add(e);else if(e instanceof WP)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof WP&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof WP&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=0,a=rM.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof tN){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?sF.block:sF.inline),c=nF(a),l=this.cache.findWidget(i,t-e,c)||KP.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=iF(n,a);t>e&&this.text.skip(t-e)},span:(e,t,i,a)=>{for(let o=e;o<t;){let s=this.text.next(Math.min(512,t-o));s==null?(r.addLineStartIfNotCovered(n),r.addBreak(),o++):(r.ensureLine(n),r.addText(s,i,o==e?a:i.length),o+=s.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=a>i,this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=IP.get(r);if(r==this.view.contentDOM)break;e instanceof WP?t.push(e):e?.isLine()?n=e:e instanceof BP||(r.nodeName==`DIV`&&!n&&r!=this.view.contentDOM?n=new VP(r,rF):n||t.push(WP.of(new $M({tagName:r.nodeName.toLowerCase(),attributes:YM(r)}),r)))}return{line:n,marks:t}}};function tF(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function nF(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}var rF={class:`cm-line`};function iF(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r?e:(e||={class:`cm-line`},n&&WM(n,e),r&&(e.class+=` `+r),e)}function aF(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof WP&&t.push(r.mark)}return t}function oF(e){let t=IP.get(e);return t&&t.setDOM(e.cloneNode()),e}var sF=class extends XM{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};sF.inline=new sF(`span`),sF.block=new sF(`div`);var cF=new class extends XM{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},lF=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=QM.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new zP(e,e.contentDOM),this.updateInner([new NP(0,0,0,e.state.doc.length)],null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!bF(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?pF(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new NP(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(UM.ie||UM.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=gF(i,this.decorations,e.changes);o.length&&(t=NP.extendWithRanges(t,o));let s=vF(a,this.blockWrappers,e.changes);return s.length&&(t=NP.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new eF(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&IP.get(t.text)&&r.cache.reused.set(IP.get(t.text),2),this.tile=r.run(e,t),uF(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+`px`,this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+`px`:``;let r=UM.chrome||UM.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof xF&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(hP)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(_P)||n.tabIndex>-1)&&cN(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),UM.gecko&&s.empty&&!this.hasComposition&&dF(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new jN(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!uN(c.node,c.offset,u.anchorNode,u.anchorOffset)||!uN(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{UM.android&&UM.chrome&&n.contains(u.focusNode)&&yF(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=oN(this.view.root);if(e)if(s.empty){if(UM.gecko){let e=mF(c.node,c.offset);if(e&&e!=3){let t=(e==1?kN:AN)(c.node,c.offset);t&&(c=new jN(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new jN(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new jN(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&uN(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=oN(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(l.node,l.offset),n.modify(`move`,t.assoc<0?`forward`:`backward`,`lineboundary`),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=mN(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!IP.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof xF?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=r(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let n=WA(e.text,t);if(n==t)return null;let r=wN(e.dom,t,n).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==MN.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof BP)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?lN(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?MN.RTL:MN.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=lN(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement(`div`),n,r,i;return t.className=`cm-line`,t.style.width=`99999px`,t.style.position=`absolute`,t.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=lN(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(QM.replace({widget:new xF(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return QM.set(e)}updateDeco(){let e=1,t=this.view.state.facet(wP).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(EP).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(rM.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(TP).map(e=>typeof e==`function`?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(fP))try{if(t(this.view,e.range,e))return!0}catch(e){gP(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.assoc??(t.empty?0:t.head>t.anchor?-1:1)),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=jP(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;if(vN(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==MN.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(t.head,1);e&&e.dom.scrollIntoView({block:`nearest`})}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){uF(this.tile)}};function uF(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)uF(n,t)}}function dF(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable==`false`)&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable==`false`)}function fF(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=kN(n.focusNode,n.focusOffset),i=AN(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=IP.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=IP.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function pF(e,t,n){let r=fF(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new NP(c.mapPos(a),c.mapPos(o),a,o),text:i}}function mF(e,t){return e.nodeType==1?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}var hF=class{constructor(){this.changes=[]}compareRange(e,t){iN(e,t,this.changes)}comparePoint(e,t){iN(e,t,this.changes)}boundChange(e){iN(e,e,this.changes)}};function gF(e,t,n){let r=new hF;return rM.compare(e,t,n,r),r.changes}var _F=class{constructor(){this.changes=[]}compareRange(e,t){iN(e,t,this.changes)}comparePoint(){}boundChange(e){iN(e,e,this.changes)}};function vF(e,t,n){let r=new _F;return rM.compare(e,t,n,r),r.changes}function yF(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable==`false`)return!0;return!1}function bF(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}var xF=class extends XM{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(`div`);return e.className=`cm-gap`,this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+`px`,!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function SF(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return ij.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=WA(i.text,a,!1):s=WA(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;){let e=WA(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=WA(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return ij.range(o+i.from,s+i.from)}function CF(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,r=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t);a+=r*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+_M(o,a,e.state.tabSize)}function wF(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==ZM.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function TF(e,t,n,r){let i=wF(e,t.head,t.assoc||-1),a=!r||i.type!=ZM.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),o=e.posAtCoords({x:n==(r==MN.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return ij.cursor(o,n?-1:1)}return ij.cursor(n?i.to:i.from,n?-1:1)}function EF(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=e.textDirectionAt(i.from);for(let s=t,c=null;;){let t=$N(i,a,o,s,n),l=QN;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=`
|
|
48
|
-
`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function DF(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==Gj.Space&&(i=t),i==t}}function OF(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return ij.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(l)o??=l.left-c.left,s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from)),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=e.viewState.heightOracle.textHeight>>1,p=r??f;for(let t=0;;t+=f){let r=s+(p+t)*a,i=NF(e,{x:d,y:r},!1,a);if(n?r>c.bottom:r<c.top)return ij.cursor(i.pos,i.assoc);let l=e.coordsAtPos(i.pos,i.assoc),u=l?(l.top+l.bottom)/2:0;if(!l||(n?u>s:u<s))return ij.cursor(i.pos,i.assoc,void 0,o)}}function kF(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function AF(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=kF(e,i.from,0);t!=i.from&&(a=ij.cursor(t,-1))}else{let t=kF(e,i.from,-1),n=kF(e,i.to,1);(t!=i.from||n!=i.to)&&(a=ij.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?ij.create(n,t.mainIndex):t}function jF(e,t,n){let r=kF(e.state.facet(DP).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:ij.cursor(r,r<n.from?1:-1)}var MF=class{constructor(e,t){this.pos=e,this.assoc=t}};function NF(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new MF(0,1);if(c>e.viewState.docHeight)return new MF(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==ZM.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==ZM.Text){let t=CF(e,i,l,o,s);return new MF(t,t==l.from?1:-1)}}if(l.type!=ZM.Text)return c<(l.top+l.bottom)/2?new MF(l.from,1):new MF(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new PF(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}var PF=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[HN.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[HN.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t,n=!1){let r=0,i=e.length-1,a=new Set,o=this.bidiIn(e[0],e[i]),s,c,l=-1,u=1e9,d;search:for(;r<i;){let n=i-r,f=r+i>>1;adjust:if(a.has(f)){let e=r+Math.floor(Math.random()*n);for(let t=0;t<n;t++){if(!a.has(e)){f=e;break adjust}e++,e==i&&(e=r)}break search}a.add(f);let p=t(f);if(p)for(let t=0;t<p.length;t++){let n=p[t],a=0;if(!(n.width==0&&p.length>1)){if(n.bottom<this.y)(!s||s.bottom<n.bottom)&&(s=n),a=1;else if(n.top>this.y)(!c||c.top>n.top)&&(c=n),a=-1;else{let e=n.left>this.x?this.x-n.left:n.right<this.x?this.x-n.right:0,t=Math.abs(e);t<u&&(l=f,u=t,d=n),e&&(a=e<0==(this.baseDir==MN.LTR)?-1:1)}a==-1&&(!o||this.baseDirAt(e[f],1))?i=f:a==1&&(!o||this.baseDirAt(e[f+1],-1))&&(r=f+1)}}}if(!d){let n=s&&(!c||this.y-s.bottom<c.top-this.y)?s:c;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(u&&!n){let{top:n,bottom:r}=d;if(s&&s.bottom>(n+n+r)/3)return this.y=s.bottom-1,this.scan(e,t,!0);if(c&&c.top<(n+r+r)/3)return this.y=c.top+1,this.scan(e,t,!0)}let f=(o?this.dirAt(e[l],1):this.baseDir)==MN.LTR;return{i:l,after:this.x>(d.left+d.right)/2==f}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=WA(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return wN(e.dom,i,a).getClientRects()});return r.after?new MF(n[r.i+1],-1):new MF(n[r.i],1)}scanTile(e,t){if(!e.length)return new MF(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(n.dom.nodeType==1?n.dom:wN(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new MF(n[r.i+1],-1):new MF(a,1)}},FF=``,IF=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet(Xj.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=FF}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=IP.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=IP.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:fN(r))||fN(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!RF(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=IP.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==`BR`?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(LF(e,n.node,n.offset)?t:0))}};function LF(e,t,n){for(;;){if(!t||n<mN(t))return!1;if(t==e)return!0;n=dN(t)+1,t=t.parentNode}}function RF(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let t=IP.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}var zF=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},BF=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=VF(e.docView.tile,t,n,0))){let t=i||a?[]:KF(e),n=new IF(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=qF(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!sN(e.contentDOM,t.focusNode)?o.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!sN(e.contentDOM,t.anchorNode)?o.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((UM.ios||UM.chrome)&&o.main.empty&&n!=r&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=s.from-t,o=s.to-i;(a==0||a==1||t==0)&&(o==0||o==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(ij.range(r,n));else if(e.lineWrapping&&r==n&&!(o.main.empty&&o.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=ij.create([ij.cursor(n,r)])}else this.newSel=ij.single(r,n)}}};function VF(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return VF(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}else if(e.isText())return{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling};else return null}function HF(e,t){let n,{newSel:r}=t,{state:i}=e,a=i.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,s=a.from,c=null;(o===8||UM.android&&t.text.length<r-e)&&(s=a.to,c=`end`);let l=i.doc.sliceString(e,r,FF),u,d;!a.empty&&a.from>=e&&a.to<=r&&(t.typeOver||l!=t.text)&&l.slice(0,a.from-e)==t.text.slice(0,a.from-e)&&l.slice(a.to-e)==t.text.slice(u=t.text.length-(l.length-(a.to-e)))?n={from:a.from,to:a.to,insert:FA.of(t.text.slice(a.from-e,u).split(FF))}:(d=GF(l,t.text,s-e,c))&&(UM.chrome&&o==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==``&&d.toB--,n={from:e+d.from,to:e+d.toA,insert:FA.of(t.text.slice(d.from,d.toB).split(FF))})}else r&&(!e.hasFocus&&i.facet(_P)||JF(r,a))&&(r=null);if(!n&&!r)return!1;if((UM.mac||UM.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=ij.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:FA.of([n.insert.toString().replace(`.`,` `)])}):i.doc.lineAt(a.from).to<a.to&&e.docView.lineHasWidget(a.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(e.inputState.insertingText)}:UM.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`
|
|
49
|
-
`&&e.lineWrapping&&(r&&=ij.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:FA.of([` `])}),n)return UF(e,n,r,o);if(r&&!JF(r,a)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=AF(i.facet(DP).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function UF(e,t,n,r=-1){if(UM.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(UM.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&TN(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&TN(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&TN(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=WF(e,t,n);return e.state.facet(oP).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function WF(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=kF(i.facet(DP).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:ij.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&fF(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?ij.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function GF(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function KF(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new zF(n,r)),(i!=n||a!=r)&&t.push(new zF(i,a))),t}function qF(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?ij.single(n+t,r+t):null}function JF(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var YF=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=``,this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,UM.safari&&e.contentDOM.addEventListener(`input`,()=>null),UM.gecko&&jI(e.contentDOM.ownerDocument)}handleEvent(e){!cI(this.view,e)||this.ignoreDuringComposition(e)||e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=ZF(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&eI.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),UM.android&&UM.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return UM.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=QF.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||$F.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,TN(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:UM.safari&&!UM.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function XF(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){gP(n.state,e)}}}function ZF(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(XF(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(XF(t.value,r))}}for(let e in lI)n(e).handlers.push(lI[e]);for(let e in uI)n(e).observers.push(uI[e]);return t}var QF=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],$F=`dthko`,eI=[16,17,18,20,91,92,224,225],tI=6;function nI(e){return Math.max(0,e)*.7+8}function rI(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var iI=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=yN(e.contentDOM),this.atoms=e.state.facet(DP).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Xj.allowMultipleSelections)&&aI(e,t),this.dragging=sI(e,t)&&bI(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&rI(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=jP(this.view);e.clientX-s.left<=r+tI?t=-nI(r-e.clientX):e.clientX+s.right>=a-tI&&(t=nI(e.clientX-a)),e.clientY-s.top<=i+tI?n=-nI(i-e.clientY):e.clientY+s.bottom>=o-tI&&(n=nI(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){this.dragging??this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(`mousemove`,this.move),e.removeEventListener(`mouseup`,this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=AF(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function aI(e,t){let n=e.state.facet(tP);return n.length?n[0](t):UM.mac?t.metaKey:t.ctrlKey}function oI(e,t){let n=e.state.facet(nP);return n.length?n[0](t):UM.mac?!t.altKey:!t.ctrlKey}function sI(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=oN(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function cI(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=IP.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}var lI=Object.create(null),uI=Object.create(null),dI=UM.ie&&UM.ie_version<15||UM.ios&&UM.webkit_version<604;function fI(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textarea`));n.style.cssText=`position: fixed; left: -10000px; top: 10px`,n.focus(),setTimeout(()=>{e.focus(),n.remove(),mI(e,n.value)},50)}function pI(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function mI(e,t){t=pI(e.state,cP,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(EI!=null&&n.selection.ranges.every(e=>e.empty)&&EI==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:ij.cursor(r.from+c.length)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:ij.cursor(e.from+t.length)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}uI.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},uI.wheel=uI.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},lI.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),uI.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin(`select.pointer`)},uI.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},lI.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(rP))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=xI(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new iI(e,t,n,r)),r&&e.observer.ignore(()=>{SN(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin(`select.pointer`);return!1};function hI(e,t,n,r){if(r==1)return ij.cursor(t,n);if(r==2)return SF(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,ij.range(a,o)}}var gI=UM.ie&&UM.ie_version<=11,_I=null,vI=0,yI=0;function bI(e){if(!gI)return e.detail;let t=_I,n=yI;return _I=e,yI=Date.now(),vI=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(vI+1)%3:1}function xI(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=bI(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=hI(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=hI(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?ij.range(i,a,l.assoc):ij.range(a,i,l.assoc)}return a?i.replaceRange(i.main.extend(l.from,l.to,l.assoc)):o&&r==1&&i.ranges.length>1&&(c=SI(i,s.pos))?c:o?i.addRange(l):ij.create([l])}}}function SI(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return ij.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}lI.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=ij.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,pI(e.state,lP,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},lI.dragend=e=>(e.inputState.draggedContent=null,!1);function CI(e,t,n,r){if(n=pI(e.state,cP,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&oI(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}lI.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&CI(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}else{let n=t.dataTransfer.getData(`Text`);if(n)return CI(e,t,n,!0),!0}return!1},lI.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=dI?null:t.clipboardData;return n?(mI(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(fI(e),!1)};function wI(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function TI(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:pI(e,lP,t.join(e.lineBreak)),ranges:n,linewise:r}}var EI=null;lI.copy=lI.cut=(e,t)=>{if(!cN(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=TI(e.state);if(!n&&!i)return!1;EI=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=dI?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(wI(e,n),!1)};var DI=Mj.define();function OI(e,t){let n=[];for(let r of e.facet(sP)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:DI.of(!0)}):null}function kI(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=OI(e.state,t);n?e.dispatch(n):e.update([])}},10)}uI.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),kI(e)},uI.blur=e=>{e.observer.clearSelectionRange(),kI(e)},uI.compositionstart=uI.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},uI.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,UM.chrome&&UM.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},uI.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},lI.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return UF(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(UM.chrome&&UM.android&&(n=QF.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return UM.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),UM.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>uI.compositionend(e,t),20),!1};var AI=new Set;function jI(e){AI.has(e)||(AI.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var MI=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],NI=!1;function PI(){NI=!1}var FI=class{constructor(e){this.lineWrapping=e,this.doc=FA.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return MI.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=MI.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},II=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},LI=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?ZM.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof tN?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},RI=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(RI||={}),zI=.001,BI=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>zI&&(NI=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,RI.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,RI.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,RI.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=YI.build(n.setDoc(a),e,l,u);i=VI(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new WI(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r)if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break;else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=0;return t[n-1]==null?(o=1,n--):t[n]??(o=1,r++),new KI(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function VI(e,t){return e==t?e:(e.constructor!=t.constructor&&(NI=!0),t)}BI.prototype.size=1;var HI=QM.replace({}),UI=class extends BI{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new LI(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new LI(r,0,n,this.spaceAbove,HI):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,RI.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},WI=class e extends UI{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new LI(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof GI&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof GI?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):BI.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},GI=class e extends BI{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new LI(a.from,a.length,l,c,0)}else{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new LI(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==RI.ByHeight)return this.blockAt(e,n,r,i);if(t==RI.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new LI(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new LI(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new LI(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return BI.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=zI&&(s=-2);let c=new WI(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=BI.of(r);return(s<0||Math.abs(c.height-this.height)>=zI||Math.abs(s-this.heightMetrics(t,n).perLine)>=zI)&&(NI=!0),VI(this,c)}else (r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},KI=class extends BI{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==RI.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==RI.ByPosNoHeight?RI.ByPosNoHeight:RI.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,RI.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&qI(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),qI(i,e)}return BI.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?BI.of(this.break?[e,null,t]:[e,t]):(this.left=VI(this.left,e),this.right=VI(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}};function qI(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof GI&&(r=e[t+1])instanceof GI&&e.splice(t-1,3,new GI(n.length+1+r.length))}var JI=5,YI=class e{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof WI?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new WI(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new UI(a,r,n)):(a||i||r>=JI)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new WI(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new GI(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof WI)return e;let t=new WI(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof WI)&&!this.isCovered?this.nodes.push(new WI(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof WI&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return rM.spans(n,r,i,a,0),a.finish(r)}};function XI(e,t,n){let r=new ZI;return rM.compare(e,t,n,r,0),r.changes}var ZI=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&iN(e,t,this.changes,5)}};function QI(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function $I(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function eL(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var tL=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return QM.replace({widget:new nL(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},nL=class extends XM{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},rL=class{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=lL,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=MN.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(CP).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new FI(n),this.stateDeco=uL(t),this.heightMap=BI.empty().applyChanges(this.stateDeco,FA.empty,this.heightOracle.setDoc(t.doc),[new NP(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=QM.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new iL(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?lL:new dL(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(fL(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=uL(this.state);let r=e.changedRanges,i=NP.extendWithRanges(r,XI(n,this.stateDeco,e?e.changes:XA.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);PI(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||NI)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(dP)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?MN.RTL:MN.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent===`refresh`,o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=_N(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=yN(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=ON(this.scrollParent||e.win);let m=(this.printing?eL:QI)(t,this.paddingTop),h=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let _=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(_!=this.inView&&(this.inView=_,_&&(s=!0)),!this.inView&&!this.scrollTarget&&!$I(e.dom))return 0;let v=o.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,v/o),t),a&&(e.docView.minWidth=0,c|=16)}h>0&&g>0?l=Math.max(h,g):h<0&&g<0&&(l=Math.min(h,g)),PI();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?BI.empty().applyChanges(this.stateDeco,FA.empty,this.heightOracle,[new NP(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new II(n.from,i))}NI&&(c|=2)}let y=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new iL(r.lineAt(a-n*1e3,RI.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,RI.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,RI.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new iL(r.lineAt(o-1e3/2,RI.ByHeight,i,0,0).from,r.lineAt(o+n+1e3/2,RI.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new iL(this.heightMap.lineAt(n,RI.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,RI.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,RI.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,RI.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2*1e3&&i<o+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new tL(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=MN.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=cL(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(ij.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new tL(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=ZM.Text)return;let i=aL(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=sL(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=oL(i,n),l=oL(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=sL(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=oL(i,f),l=oL(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=sL(r,n)-sL(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){tL.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=QM.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];rM.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||fL(this.heightMap.lineAt(e,RI.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||fL(this.heightMap.lineAt(this.scaler.fromDOM(e),RI.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return fL(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},iL=class{constructor(e,t){this.from=e,this.to=t}};function aL(e,t,n){let r=[],i=e,a=0;return rM.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function oL({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function sL(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function cL(e,t){for(let n of e)if(t(n))return n}var lL={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function uL(e){let t=e.facet(wP).filter(e=>typeof e!=`function`),n=e.facet(EP).filter(e=>typeof e!=`function`);return n.length&&t.push(rM.join(n)),t}var dL=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,RI.ByPos,e,0,0).top,o=t.lineAt(i,RI.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to):!1}};function fL(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new LI(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>fL(e,t)):e._content)}var pL=sj.define({combine:e=>e.join(` `)}),mL=sj.define({combine:e=>e.indexOf(!0)>-1}),hL=SM.newName(),gL=SM.newName(),_L=SM.newName(),vL={"&light":`.`+gL,"&dark":`.`+_L};function yL(e,t,n){return new SM(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}var bL=yL(`.`+hL,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-selectionHandle":{backgroundColor:`currentColor`,width:`1.5px`},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:`""`,backgroundColor:`inherit`,borderRadius:`50%`,width:`8px`,height:`8px`,position:`absolute`,left:`-3.25px`},".cm-selectionHandle-start::before":{top:`-8px`},".cm-selectionHandle-end::before":{bottom:`-8px`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:`#f5f5f5`,color:`#6c6c6c`,border:`0px solid #ddd`,"&.cm-gutters-before":{borderRightWidth:`1px`},"&.cm-gutters-after":{borderLeftWidth:`1px`}},"&dark .cm-gutters":{backgroundColor:`#333338`,color:`#ccc`},".cm-gutter":{display:`flex !important`,flexDirection:`column`,flexShrink:0,boxSizing:`border-box`,minHeight:`100%`,overflow:`hidden`},".cm-gutterElement":{boxSizing:`border-box`},".cm-lineNumbers .cm-gutterElement":{padding:`0 3px 0 5px`,minWidth:`20px`,textAlign:`right`,whiteSpace:`nowrap`},"&light .cm-activeLineGutter":{backgroundColor:`#e2f2ff`},"&dark .cm-activeLineGutter":{backgroundColor:`#222227`},".cm-panels":{boxSizing:`border-box`,position:`sticky`,left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-dialog":{padding:`2px 19px 4px 6px`,position:`relative`,"& label":{fontSize:`80%`}},".cm-dialog-close":{position:`absolute`,top:`3px`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,fontSize:`14px`,padding:`0`},".cm-tab":{display:`inline-block`,overflow:`hidden`,verticalAlign:`bottom`},".cm-widgetBuffer":{verticalAlign:`text-top`,height:`1em`,width:0,display:`inline`},".cm-placeholder":{color:`#888`,display:`inline-block`,verticalAlign:`top`,userSelect:`none`},".cm-highlightSpace":{backgroundImage:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)`,backgroundPosition:`center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},vL),xL={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},SL=UM.ie&&UM.ie_version<=11,CL=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new bN,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(UM.ie&&UM.ie_version<=11||UM.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&UM.android&&e.constructor.EDIT_CONTEXT!==!1&&!(UM.chrome&&UM.chrome_version<126)&&(this.editContext=new DL(e),e.state.facet(_P)&&(e.contentDOM.editContext=this.editContext.editContext)),SL&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(`Event`)))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(`Event`))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(`scroll`,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==`change`||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(_P)?n.root.activeElement!=this.dom:!cN(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(UM.ie&&UM.ie_version<=11||UM.android&&UM.chrome)&&!n.state.selection.main.empty&&r.focusNode&&uN(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=oN(e.root);if(!t)return!1;let n=UM.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&EL(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=cN(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&DN(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,xL),SL&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),SL&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&TN(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&cN(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new BF(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=HF(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!JF(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=wL(t,e.previousSibling||e.target.previousSibling,-1),r=wL(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else if(e.type==`characterData`)return{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue};else return null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(_P)!=e.state.facet(_P)&&(e.view.contentDOM.editContext=e.state.facet(_P)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function wL(e,t,n){for(;t;){let r=IP.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function TL(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return uN(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function EL(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return TL(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?TL(e,n):null}var DL=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=GF(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=ij.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));JF(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:FA.of(n.text.slice(l.from,l.toB).split(`
|
|
50
|
-
`))};if((UM.mac||UM.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:FA.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);UF(e,u,ij.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(QM.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:hP.of(QM.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=oN(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to)if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}else r=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},OL=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement(`div`),this.scrollDOM=document.createElement(`div`),this.scrollDOM.tabIndex=-1,this.scrollDOM.className=`cm-scroller`,this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement(`div`),this.announceDOM.className=`cm-announced`,this.announceDOM.setAttribute(`aria-live`,`polite`),this.dom=document.createElement(`div`),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||EN(e.parent)||document,this.viewState=new rL(this,e.state||Xj.create(e)),e.scrollTo&&e.scrollTo.is(mP)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(yP).map(e=>new xP(e));for(let e of this.plugins)e.update(this);this.observer=new CL(this),this.inputState=new YF(this),this.inputState.ensureHandlers(this.plugins),this.docView=new lF(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=`refresh`,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Ij?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(t){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let n=!1,r=!1,i,a=this.state;for(let e of t){if(e.startState!=a)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);a=e.state}if(this.destroyed){this.viewState.state=a;return}let o=this.hasFocus,s=0,c=null;t.some(e=>e.annotation(DI))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=OI(a,o),c||(s=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(u=null)):this.observer.clear(),a.facet(Xj.phrases)!=this.state.facet(Xj.phrases))return this.setState(a);i=PP.create(this,a,t),i.flags|=s;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let n of t){if(d&&=d.map(n.changes),n.scrollIntoView){let{main:t}=n.state.selection,{x:r,y:i}=this.state.facet(e.cursorScrollMargin);d=new pP(t.empty?t:ij.cursor(t.head,t.head>t.anchor?-1:1),`nearest`,`nearest`,i,r)}for(let e of n.effects)e.is(mP)&&(d=e.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=jL.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(MP)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(i.startState.facet(pL)!=i.state.facet(pL)&&(this.viewState.mustMeasureContent=!0),(n||r||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let e of this.state.facet(aP))try{e(i)}catch(e){gP(this.state,e,`update listener`)}(c||u)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),u&&!HF(this,u)&&l.force&&TN(this.contentDOM,l.key,l.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new rL(this,e),this.plugins=e.facet(yP).map(e=>new xP(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new lF(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(yP),n=e.state.facet(yP);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new xP(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){gP(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0)if(ON(n||this.win))i=-1,a=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}this.updateState=1;let o=this.viewState.measure();if(!o&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let s=[];o&4||([this.measureRequests,s]=[s,this.measureRequests]);let c=s.map(e=>{try{return e.read(this)}catch(e){return gP(this.state,e),AL}}),l=PP.create(this,this.state,[]),u=!1;l.flags|=o,t?t.flags|=o:t=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),u=this.docView.update(l),u&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(c[e]!=AL)try{let t=s[e];t.write&&t.write(c[e],this)}catch(e){gP(this.state,e)}if(u&&this.docView.updateSelection(!0),!l.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let e=((i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-a)/this.scaleY;if((e>1||e<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?n.scrollTop+=e:this.win.scrollBy(0,e),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(aP))e(t)}get themeClasses(){return hL+` `+(this.state.facet(mL)?_L:gL)+` `+this.state.facet(pL)}updateAttrs(){let e=ML(this,SP,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(_P)?`true`:`false`,class:`cm-content`,style:`${UM.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),ML(this,CP,t);let n=this.observer.ignore(()=>{let n=JM(this.contentDOM,this.contentAttrs,t),r=JM(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&(this.announceDOM.textContent=``),n=!1;let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(MP);let t=this.state.facet(e.cspNonce);SM.mount(this.root,this.styleModules.concat(bL).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return jF(this,e,EF(this,e,t,n))}moveByGroup(e,t){return jF(this,e,EF(this,e,t,t=>DF(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return ij.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return TF(this,e,t,n)}moveVertically(e,t,n){return jF(this,e,OF(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=NF(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),NF(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),a=i[HN.find(i,e-r.from,-1,t)];return hN(n,a.dir==MN.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(uP)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>kL)return ZN(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||UN(r.isolates,n=kP(this,e))))return r.order;n||=kP(this,e);let r=XN(e.text,t,n);return this.bidiCache.push(new jL(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||UM.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{SN(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return mP.of(new pP(typeof e==`number`?ij.cursor(e):e,t.y??`nearest`,t.x??`nearest`,t.yMargin??5,t.xMargin??5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return mP.of(new pP(ij.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return bP.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return bP.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=SM.newName(),r=[pL.of(n),MP.of(yL(`.${n}`,e))];return t&&t.dark&&r.push(mL.of(!0)),r}static baseTheme(e){return _j.lowest(MP.of(yL(`.`+hL,e,vL)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&IP.get(t)||IP.get(e))?.root?.view||null}};OL.styleModule=MP,OL.inputHandler=oP,OL.clipboardInputFilter=cP,OL.clipboardOutputFilter=lP,OL.scrollHandler=fP,OL.focusChangeEffect=sP,OL.perLineTextDirection=uP,OL.exceptionSink=iP,OL.updateListener=aP,OL.editable=_P,OL.mouseSelectionStyle=rP,OL.dragMovesSelection=nP,OL.clickAddsSelectionRange=tP,OL.decorations=wP,OL.blockWrappers=TP,OL.outerDecorations=EP,OL.atomicRanges=DP,OL.bidiIsolatedRanges=OP,OL.cursorScrollMargin=sj.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r==`number`?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}}),OL.scrollMargins=AP,OL.darkTheme=mL,OL.cspNonce=sj.define({combine:e=>e.length?e[0]:``}),OL.contentAttributes=CP,OL.editorAttributes=SP,OL.lineWrapping=OL.contentAttributes.of({class:`cm-lineWrapping`}),OL.announce=Fj.define();var kL=4096,AL={},jL=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:MN.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}};function ML(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&WM(a,n)}return n}var NL=UM.mac?`mac`:UM.windows?`win`:UM.linux?`linux`:`key`;function PL(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function FL(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}var IL=_j.default(OL.domEventHandlers({keydown(e,t){return WL(zL(t.state),e,t,`editor`)}})),LL=sj.define({enables:IL}),RL=new WeakMap;function zL(e){let t=e.facet(LL),n=RL.get(t);return n||RL.set(t,n=HL(t.reduce((e,t)=>e.concat(t),[]))),n}var BL=null,VL=4e3;function HL(e,t=NL){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>PL(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=BL={view:t,prefix:n,scope:e};return setTimeout(()=>{BL==r&&(BL=null)},VL),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,UL))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}var UL=null;function WL(e,t,n,r){UL=t;let i=jM(t),a=KA(GA(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;BL&&BL.view==n&&BL.scope==r&&(o=BL.prefix+` `,eI.indexOf(t.keyCode)<0&&(c=!0,BL=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+FL(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(UM.windows&&t.ctrlKey&&t.altKey)&&!(UM.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=TM[t.keyCode])&&p!=i?(d(f[o+FL(p,t,!0)])||t.shiftKey&&(m=EM[t.keyCode])!=i&&m!=p&&d(f[o+FL(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+FL(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),UL=null,s}/x/.unicode;var GL=class extends XM{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement(`span`);return t.className=`cm-placeholder`,t.style.pointerEvents=`none`,t.appendChild(typeof this.content==`string`?document.createTextNode(this.content):typeof this.content==`function`?this.content(e):this.content.cloneNode(!0)),t.setAttribute(`aria-hidden`,`true`),t}coordsAt(e){let t=e.firstChild?lN(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=hN(t[0],n.direction!=`rtl`),i=parseInt(n.lineHeight);return r.bottom-r.top>i*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}};function KL(e){let t=bP.fromClass(class{constructor(t){this.view=t,this.placeholder=e?QM.set([QM.widget({widget:new GL(e),side:1}).range(0)]):QM.none}get decorations(){return this.view.state.doc.length?QM.none:this.placeholder}},{decorations:e=>e.decorations});return typeof e==`string`?[t,OL.contentAttributes.of({"aria-placeholder":e})]:t}var qL=`-10000px`,JL=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}};function YL(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}var XL=sj.define({combine:e=>({position:UM.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||YL})}),ZL=new WeakMap,QL=bP.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(XL);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new JL(e,nR,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(XL);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add(`cm-tooltip`),e.arrow&&!n.dom.querySelector(`.cm-tooltip > .cm-tooltip-arrow`)){let e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=qL,n.dom.style.left=`0px`,this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener(`resize`,this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(UM.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||this.position==`absolute`)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else ({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=jP(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(XL).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=qL;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=ZL.get(c)??d.bottom-d.top,g=c.offset||tR,_=this.view.textDirection==MN.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let b=(y?u.top-n.top:n.bottom-u.bottom)-p;if(b<h&&c.resize!==!1){if(b<this.view.defaultLineHeight){l.style.top=qL;continue}ZL.set(c,h),l.style.height=(h=b)/i+`px`}else l.style.height&&(l.style.height=``);let x=y?u.top-h-p-g.y:u.bottom+p+g.y,S=v+m;if(c.overlap!==!0)for(let e of a)e.left<S&&e.right>v&&e.top<x+h&&e.bottom>x&&(x=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(x-e.parent.top)/i+`px`,$L(l,(v-e.parent.left)/r)):(l.style.top=x/i+`px`,$L(l,v/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:x,right:S,bottom:x+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=qL}},{eventObservers:{scroll(){this.maybeMeasure()}}});function $L(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}var eR=OL.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:`border-box`},"&light .cm-tooltip":{border:`1px solid #bbb`,backgroundColor:`#f5f5f5`},"&light .cm-tooltip-section:not(:first-child)":{borderTop:`1px solid #bbb`},"&dark .cm-tooltip":{backgroundColor:`#333338`,color:`white`},".cm-tooltip-arrow":{height:`7px`,width:`14px`,position:`absolute`,zIndex:-1,overflow:`hidden`,"&:before, &:after":{content:`''`,position:`absolute`,width:0,height:0,borderLeft:`7px solid transparent`,borderRight:`7px solid transparent`},".cm-tooltip-above &":{bottom:`-7px`,"&:before":{borderTop:`7px solid #bbb`},"&:after":{borderTop:`7px solid #f5f5f5`,bottom:`1px`}},".cm-tooltip-below &":{top:`-7px`,"&:before":{borderBottom:`7px solid #bbb`},"&:after":{borderBottom:`7px solid #f5f5f5`,top:`1px`}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:`#333338`,borderBottomColor:`#333338`},"&:after":{borderTopColor:`transparent`,borderBottomColor:`transparent`}}}),tR={x:0,y:0},nR=sj.define({enables:[QL,eR]});function rR(e,t){let n=e.plugin(QL);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}var iR=class extends Qj{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};iR.prototype.elementClass=``,iR.prototype.toDOM=void 0,iR.prototype.mapMode=JA.TrackBefore,iR.prototype.startSide=iR.prototype.endSide=-1,iR.prototype.point=!0;var aR=1024,oR=0,sR=class{constructor(e,t){this.from=e,this.to=t}},cR=class{constructor(e={}){this.id=oR++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=dR.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};cR.closedBy=new cR({deserialize:e=>e.split(` `)}),cR.openedBy=new cR({deserialize:e=>e.split(` `)}),cR.group=new cR({deserialize:e=>e.split(` `)}),cR.isolate=new cR({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),cR.contextHash=new cR({perNode:!0}),cR.lookAhead=new cR({perNode:!0}),cR.mounted=new cR({perNode:!0});var lR=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[cR.mounted.id]}},uR=Object.create(null),dR=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):uR,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(cR.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(cR.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};dR.none=new dR(``,Object.create(null),0,8);var fR=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new dR(e.name,r,e.id,e.flags):e)}return new e(n)}},pR=new WeakMap,mR=new WeakMap,hR;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(hR||={});var gR=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=lR.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new AR(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new AR(pR.get(this)||this.topNode);return r.moveTo(e,t),pR.set(this,r._tree),r}get topNode(){return new SR(this,0,0,null)}resolve(e,t=0){let n=bR(pR.get(this)||this.topNode,e,t,!1);return pR.set(this,n),n}resolveInner(e,t=0){let n=bR(mR.get(this)||this.topNode,e,t,!0);return mR.set(this,n),n}resolveStack(e,t=0){return kR(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&hR.IncludeAnonymous)>0;for(let e=this.cursor(a|hR.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:FR(dR.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(dR.none,t,n,r)))}static build(e){return MR(e)}};gR.empty=new gR(dR.none,[],[],0);var _R=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},vR=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return dR.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(yR(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function yR(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function bR(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof SR&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:hR.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof SR&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var xR=class{cursor(e=0){return new AR(this,e)}getChild(e,t=null,n=null){let r=CR(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return CR(this,e,t,n)}resolve(e,t=0){return bR(this,e,t,!1)}resolveInner(e,t=0){return bR(this,e,t,!0)}matchContext(e){return wR(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},SR=class e extends xR{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(!(!(a&hR.EnterBracketed&&l instanceof gR&&(d=lR.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length)&&!yR(i,r,u,u+l.length))){if(l instanceof vR){if(a&hR.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new ER(new TR(o,l,t,u),null,e)}else if(a&hR.IncludeAnonymous||!l.type.isAnonymous||jR(l)){let s;if(!(a&hR.IgnoreMounts)&&(s=lR.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&hR.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&hR.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&hR.IgnoreOverlays)&&(i=lR.get(this._tree))&&i.overlay){let a=t-this.from,o=r&hR.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function CR(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function wR(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var TR=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},ER=class e extends xR{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&hR.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new gR(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function DR(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof SR&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new OR(i,n)}var OR=class{constructor(e,t){this.heads=e,this.node=t}get next(){return DR(this.heads)}};function kR(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof SR?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=lR.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new SR(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(bR(o,t,n,!1))}}return i?DR(i):r}var AR=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~hR.EnterBracketed,e instanceof SR)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof SR?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&hR.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&hR.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&hR.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else ({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&hR.IncludeAnonymous||e instanceof vR||!e.type.isAnonymous||jR(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new ER(this.buffer,t,this.stack[e]);return this.bufferNode=new ER(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return wR(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return wR(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function jR(e){return e.children.some(e=>e instanceof vR||!e.type.isAnonymous||jR(e))}function MR(e){let{buffer:t,nodeSet:n,maxBufferLength:r=aR,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new _R(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:ee,size:C}=o,te=l,ne=c;if(C<0)if(o.next(),C==-1){let t=i[x];_.push(t),v.push(S-e);return}else if(C==-3){c=x;return}else if(C==-4){l=x;return}else throw RangeError(`Unrecognized record size: ${C}`);let re=s[x],ie,ae,oe=S-e;if(ee-S<=r&&(ae=h(o.pos-t,y))){let t=new Uint16Array(ae.size-ae.skip),r=o.pos-ae.size,i=t.length;for(;o.pos>r;)i=g(ae.start,t,i);ie=new vR(t,ee-ae.start,n),oe=ae.start-e}else{let e=o.pos-C;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=ee;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,te,ne),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,te,ne),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(re,ne);ie=FR(re,t,n,0,t.length,0,ee-S,e,e)}else ie=m(re,t,n,ee-S,te-ee,ne)}_.push(ie),v.push(oe)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new vR(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof gR){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(cR.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[cR.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[cR.lookAhead,i];o=o?[e].concat(o):[e]}return new gR(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0)if(n.size==-3||n.size==-4)d+=4;else break scan;else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new gR(s[e.topID],_.reverse(),v.reverse(),y)}var NR=new WeakMap;function PR(e,t){if(!e.isAnonymous||t instanceof vR||t.type!=e)return 1;let n=NR.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof gR)){n=1;break}n+=PR(e,r)}NR.set(t,n)}return n}function FR(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=PR(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=PR(e,t[s]);for(s++;s<i;s++){let n=PR(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(FR(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var IR=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof ER?this.setBuffer(e.context.buffer,e.index,t):e instanceof SR&&this.map.set(e.tree,t)}get(e){return e instanceof ER?this.getBuffer(e.context.buffer,e.index):e instanceof SR?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},LR=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},RR=class{startParse(e,t,n){return typeof e==`string`&&(e=new zR(e)),n=n?n.length?n.map(e=>new sR(e.from,e.to)):[new sR(0,0)]:[new sR(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},zR=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};function BR(e){return(t,n,r,i)=>new GR(t,e,n,r,i)}var VR=class{constructor(e,t,n,r,i,a){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=i,this.from=a}};function HR(e){if(!e.length||e.some(e=>e.from>=e.to))throw RangeError(`Invalid inner parse ranges given: `+JSON.stringify(e))}var UR=class{constructor(e,t,n,r,i,a,o,s){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=i,this.bracketed=a,this.target=o,this.prev=s,this.depth=0,this.ranges=[]}},WR=new cR({perNode:!0}),GR=class{constructor(e,t,n,r,i){this.nest=t,this.input=n,this.fragments=r,this.ranges=i,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let e=this.baseParse.advance();if(!e)return null;if(this.baseParse=null,this.baseTree=e,this.startInner(),this.stoppedAt!=null)for(let e of this.inner)e.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let e=this.baseTree;return this.stoppedAt!=null&&(e=new gR(e.type,e.children,e.positions,e.length,e.propValues.concat([[WR,this.stoppedAt]]))),e}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[cR.mounted.id]=new lR(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new XR(this.fragments),t=null,n=null,r=new AR(new SR(this.baseTree,this.ranges[0].from,0,null),hR.IncludeAnonymous|hR.IgnoreMounts);scan:for(let i,a;;){let o=!0,s;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)o=!1;else if(e.hasNode(r)){if(t){let e=t.mounts.find(e=>e.frag.from<=r.from&&e.frag.to>=r.to&&e.mount.overlay);if(e)for(let n of e.mount.overlay){let i=n.from+e.pos,a=n.to+e.pos;i>=r.from&&a<=r.to&&!t.ranges.some(e=>e.from<a&&e.to>i)&&t.ranges.push({from:i,to:a})}}o=!1}else if(n&&(a=KR(n.ranges,r.from,r.to)))o=a!=2;else if(!r.type.isAnonymous&&(i=this.nest(r,this.input))&&(r.from<r.to||!i.overlay)){r.tree||(JR(r),t&&t.depth++,n&&n.depth++);let a=e.findMounts(r.from,i.parser);if(typeof i.overlay==`function`)t=new UR(i.parser,i.overlay,a,this.inner.length,r.from,!!i.bracketed,r.tree,t);else{let e=ZR(this.ranges,i.overlay||(r.from<r.to?[new sR(r.from,r.to)]:[]));e.length&&HR(e),(e.length||!i.overlay)&&this.inner.push(new VR(i.parser,e.length?i.parser.startParse(this.input,$R(a,e),e):i.parser.startParse(``),i.overlay?i.overlay.map(e=>new sR(e.from-r.from,e.to-r.from)):null,!!i.bracketed,r.tree,e.length?e[0].from:r.from)),i.overlay?e.length&&(n={ranges:e,depth:0,prev:n}):o=!1}}else if(t&&(s=t.predicate(r))&&(s===!0&&(s=new sR(r.from,r.to)),s.from<s.to)){let e=t.ranges.length-1;e>=0&&t.ranges[e].to==s.from?t.ranges[e]={from:t.ranges[e].from,to:s.to}:t.ranges.push(s)}if(o&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break scan;if(t&&!--t.depth){let e=ZR(this.ranges,t.ranges);e.length&&(HR(e),this.inner.splice(t.index,0,new VR(t.parser,t.parser.startParse(this.input,$R(t.mounts,e),e),t.ranges.map(e=>new sR(e.from-t.start,e.to-t.start)),t.bracketed,t.target,e[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}};function KR(e,t,n){for(let r of e){if(r.from>=n)break;if(r.to>t)return r.from<=t&&r.to>=n?2:1}return 0}function qR(e,t,n,r,i,a){if(t<n){let o=e.buffer[t+1];r.push(e.slice(t,n,o)),i.push(o-a)}}function JR(e){let{node:t}=e,n=[],r=t.context.buffer;do n.push(e.index),e.parent();while(!e.tree);let i=e.tree,a=i.children.indexOf(r),o=i.children[a],s=o.buffer,c=[a];function l(e,r,i,a,u,d){let f=n[d],p=[],m=[];qR(o,e,f,p,m,a);let h=s[f+1],g=s[f+2];c.push(p.length);let _=d?l(f+4,s[f+3],o.set.types[s[f]],h,g-h,d-1):t.toTree();return p.push(_),m.push(h-a),qR(o,s[f+3],r,p,m,a),new gR(i,p,m,u)}i.children[a]=l(0,s.length,dR.none,0,o.length,n.length-1);for(let t of c){let n=e.tree.children[t],r=e.tree.positions[t];e.yield(new SR(n,r+e.from,t,e._tree))}}var YR=class{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(hR.IncludeAnonymous|hR.IgnoreMounts)}moveTo(e){let{cursor:t}=this,n=e-this.offset;for(;!this.done&&t.from<n;)if(!(t.to>=e&&t.enter(n,1,hR.IgnoreOverlays|hR.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof gR)t=t.children[0];else break}return!1}},XR=class{constructor(e){if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let t=this.curFrag=e[0];this.curTo=t.tree.prop(WR)??t.to,this.inner=new YR(t.tree,-t.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=e.tree.prop(WR)??e.to,this.inner=new YR(e.tree,-e.offset)}}findMounts(e,t){let n=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let e=this.inner.cursor.node;e;e=e.parent){let r=e.tree?.prop(cR.mounted);if(r&&r.parser==t)for(let t=this.fragI;t<this.fragments.length;t++){let i=this.fragments[t];if(i.from>=e.to)break;i.tree==this.curFrag.tree&&n.push({frag:i,pos:e.from-i.offset,mount:r})}}}return n}};function ZR(e,t){let n=null,r=t;for(let i=1,a=0;i<e.length;i++){let o=e[i-1].to,s=e[i].from;for(;a<r.length;a++){let e=r[a];if(e.from>=s)break;e.to<=o||(n||(r=n=t.slice()),e.from<o?(n[a]=new sR(e.from,o),e.to>s&&n.splice(a+1,0,new sR(s,e.to))):e.to>s?n[a--]=new sR(s,e.to):n.splice(a--,1))}}return r}function QR(e,t,n,r){let i=0,a=0,o=!1,s=!1,c=-1e9,l=[];for(;;){let u=i==e.length?1e9:o?e[i].to:e[i].from,d=a==t.length?1e9:s?t[a].to:t[a].from;if(o!=s){let e=Math.max(c,n),t=Math.min(u,d,r);e<t&&l.push(new sR(e,t))}if(c=Math.min(u,d),c==1e9)break;u==c&&(o?(o=!1,i++):o=!0),d==c&&(s?(s=!1,a++):s=!0)}return l}function $R(e,t){let n=[];for(let{pos:r,mount:i,frag:a}of e){let e=r+(i.overlay?i.overlay[0].from:0),o=e+i.tree.length,s=Math.max(a.from,e),c=Math.min(a.to,o);if(i.overlay){let o=QR(t,i.overlay.map(e=>new sR(e.from+r,e.to+r)),s,c);for(let t=0,r=s;;t++){let s=t==o.length,l=s?c:o[t].from;if(l>r&&n.push(new LR(r,l,i.tree,-e,a.from>=r||a.openStart,a.to<=l||a.openEnd)),s)break;r=o[t].to}}else n.push(new LR(s,c,i.tree,-e,a.from>=e||a.openStart,a.to<=o||a.openEnd))}return n}var ez=0,tz=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=ez++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new rz(e);return e=>e.modified.indexOf(t)>-1?e:rz.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},nz=0,rz=class e{constructor(e){this.name=e,this.instances=[],this.id=nz++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&iz(n,e.modified));if(r)return r;let i=[],a=new tz(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=az(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function iz(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function az(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function oz(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new cz(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return sz.add(t)}var sz=new cR({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new cz(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),cz=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};cz.empty=new cz([],2,null);function lz(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}var uz=tz.define,dz=uz(),fz=uz(),pz=uz(fz),mz=uz(fz),hz=uz(),gz=uz(hz),_z=uz(hz),vz=uz(),yz=uz(vz),bz=uz(),xz=uz(),Sz=uz(),Cz=uz(Sz),wz=uz(),$={comment:dz,lineComment:uz(dz),blockComment:uz(dz),docComment:uz(dz),name:fz,variableName:uz(fz),typeName:pz,tagName:uz(pz),propertyName:mz,attributeName:uz(mz),className:uz(fz),labelName:uz(fz),namespace:uz(fz),macroName:uz(fz),literal:hz,string:gz,docString:uz(gz),character:uz(gz),attributeValue:uz(gz),number:_z,integer:uz(_z),float:uz(_z),bool:uz(hz),regexp:uz(hz),escape:uz(hz),color:uz(hz),url:uz(hz),keyword:bz,self:uz(bz),null:uz(bz),atom:uz(bz),unit:uz(bz),modifier:uz(bz),operatorKeyword:uz(bz),controlKeyword:uz(bz),definitionKeyword:uz(bz),moduleKeyword:uz(bz),operator:xz,derefOperator:uz(xz),arithmeticOperator:uz(xz),logicOperator:uz(xz),bitwiseOperator:uz(xz),compareOperator:uz(xz),updateOperator:uz(xz),definitionOperator:uz(xz),typeOperator:uz(xz),controlOperator:uz(xz),punctuation:Sz,separator:uz(Sz),bracket:Cz,angleBracket:uz(Cz),squareBracket:uz(Cz),paren:uz(Cz),brace:uz(Cz),content:vz,heading:yz,heading1:uz(yz),heading2:uz(yz),heading3:uz(yz),heading4:uz(yz),heading5:uz(yz),heading6:uz(yz),contentSeparator:uz(vz),list:uz(vz),quote:uz(vz),emphasis:uz(vz),strong:uz(vz),link:uz(vz),monospace:uz(vz),strikethrough:uz(vz),inserted:uz(),deleted:uz(),changed:uz(),invalid:uz(),meta:wz,documentMeta:uz(wz),annotation:uz(wz),processingInstruction:uz(wz),definition:tz.defineModifier(`definition`),constant:tz.defineModifier(`constant`),function:tz.defineModifier(`function`),standard:tz.defineModifier(`standard`),local:tz.defineModifier(`local`),special:tz.defineModifier(`special`)};for(let e in $){let t=$[e];t instanceof tz&&(t.name=e)}lz([{tag:$.link,class:`tok-link`},{tag:$.heading,class:`tok-heading`},{tag:$.emphasis,class:`tok-emphasis`},{tag:$.strong,class:`tok-strong`},{tag:$.keyword,class:`tok-keyword`},{tag:$.atom,class:`tok-atom`},{tag:$.bool,class:`tok-bool`},{tag:$.url,class:`tok-url`},{tag:$.labelName,class:`tok-labelName`},{tag:$.inserted,class:`tok-inserted`},{tag:$.deleted,class:`tok-deleted`},{tag:$.literal,class:`tok-literal`},{tag:$.string,class:`tok-string`},{tag:$.number,class:`tok-number`},{tag:[$.regexp,$.escape,$.special($.string)],class:`tok-string2`},{tag:$.variableName,class:`tok-variableName`},{tag:$.local($.variableName),class:`tok-variableName tok-local`},{tag:$.definition($.variableName),class:`tok-variableName tok-definition`},{tag:$.special($.variableName),class:`tok-variableName2`},{tag:$.definition($.propertyName),class:`tok-propertyName tok-definition`},{tag:$.typeName,class:`tok-typeName`},{tag:$.namespace,class:`tok-namespace`},{tag:$.className,class:`tok-className`},{tag:$.macroName,class:`tok-macroName`},{tag:$.propertyName,class:`tok-propertyName`},{tag:$.operator,class:`tok-operator`},{tag:$.comment,class:`tok-comment`},{tag:$.meta,class:`tok-meta`},{tag:$.invalid,class:`tok-invalid`},{tag:$.punctuation,class:`tok-punctuation`}]);var Tz=new cR;function Ez(e){return sj.define({combine:e?t=>t.concat(e):void 0})}var Dz=new cR,Oz=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,Xj.prototype.hasOwnProperty(`tree`)||Object.defineProperty(Xj.prototype,"tree",{get(){return jz(this)}}),this.parser=t,this.extension=[Bz.of(this),Xj.languageData.of((e,t,n)=>{let r=kz(e,t,n),i=r.type.prop(Tz);if(!i)return[];let a=e.facet(i),o=r.type.prop(Dz);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return kz(e,t,n).type.prop(Tz)==this.data}findRegions(e){let t=e.facet(Bz);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(Tz)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(cR.mounted);if(i){if(i.tree.prop(Tz)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof gR&&r(i,e.positions[n]+t)}};return r(jz(e),0),n}get allowsNesting(){return!0}};Oz.setState=Fj.define();function kz(e,t,n){let r=e.facet(Bz),i=jz(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,hR.ExcludeBuffers|hR.EnterBracketed))e.type.isTop&&(i=e);return i}var Az=class e extends Oz{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=Ez(t.languageData);return new e(n,t.parser.configure({props:[Tz.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function jz(e){let t=e.field(Oz.state,!1);return t?t.tree:gR.empty}var Mz=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},Nz=null,Pz=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],gR.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Mz(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=gR.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(LR.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(LR.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Nz;Nz=this;try{return e()}finally{Nz=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Fz(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=LR.applyChanges(r,e),i=gR.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=Fz(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends RR{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=Nz;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new gR(dR.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Nz}};function Fz(e,t,n){return LR.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var Iz=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=Pz.create(t.facet(Bz).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};Oz.state=mj.define({create:Iz.init,update(e,t){for(let e of t.effects)if(e.is(Oz.setState))return e.value;return t.startState.facet(Bz)==t.state.facet(Bz)?e.apply(t):Iz.init(t.state)}});var Lz=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(Lz=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var Rz=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,zz=bP.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Oz.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Oz.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Lz(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(Oz.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!Rz?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>Rz&&Rz()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Oz.setState.of(new Iz(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>gP(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Bz=sj.define({combine(e){return e.length?e[0]:null},enables:e=>[Oz.state,zz,OL.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),Vz=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},Hz=class e{constructor(e,t,n,r,i,a=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=r,this.loadFunc=i,this.support=a,this.loading=null}load(){return this.loading||=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e})}static of(t){let{load:n,support:r}=t;if(!n){if(!r)throw RangeError(`Must pass either 'load' or 'support' to LanguageDescription.of`);n=()=>Promise.resolve(r)}return new e(t.name,(t.alias||[]).concat(t.name).map(e=>e.toLowerCase()),t.extensions||[],t.filename,n,r)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let n=/\.([^.]+)$/.exec(t);if(n){for(let t of e)if(t.extensions.indexOf(n[1])>-1)return t}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some(e=>e==t))return n;if(n)for(let n of e)for(let e of n.alias){let r=t.indexOf(e);if(r>-1&&(e.length>2||!/\w/.test(t[r-1])&&!/\w/.test(t[r+e.length])))return n}return null}},Uz=sj.define(),Wz=sj.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function Gz(e){let t=e.facet(Wz);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function Kz(e,t){let n=``,r=e.tabSize,i=e.facet(Wz)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function qz(e,t){e instanceof Xj&&(e=new Jz(e));for(let n of e.state.facet(Uz)){let r=n(e,t);if(r!==void 0)return r}let n=jz(e.state);return n.length>=t?Xz(e,n,t):null}var Jz=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=Gz(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return gM(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},Yz=new cR;function Xz(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return Zz(r,e,n)}function Zz(e,t,n){for(let r=e;r;r=r.next){let e=$z(r.node);if(e)return e(tB.create(t,n,r))}return 0}function Qz(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function $z(e){let t=e.type.prop(Yz);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(cR.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>aB(e,!0,1,void 0,n&&!Qz(e)?t.from:void 0)}return e.parent==null?eB:null}function eB(){return 0}var tB=class e extends Jz{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(nB(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Zz(this.context.next,this.base,this.pos)}};function nB(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function rB(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function iB({closing:e,align:t=!0,units:n=1}){return r=>aB(r,t,n,e)}function aB(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?rB(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}var oB=e=>e.baseIndent;function sB({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var cB=sj.define(),lB=new cR;function uB(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}$.meta,$.link,$.heading,$.emphasis,$.strong,$.strikethrough,$.keyword,$.atom,$.bool,$.url,$.contentSeparator,$.labelName,$.literal,$.inserted,$.string,$.deleted,$.regexp,$.escape,$.string,$.variableName,$.variableName,$.typeName,$.namespace,$.className,$.variableName,$.macroName,$.propertyName,$.comment,$.invalid;var dB=1e4,fB=`()[]{}`,pB=new cR;function mB(e,t,n){let r=e.prop(t<0?cR.openedBy:cR.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function hB(e){let t=e.type.prop(pB);return t?t(e.node):e}function gB(e,t,n,r={}){let i=r.maxScanDistance||dB,a=r.brackets||fB,o=jz(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=mB(r.type,n,a);if(i&&r.from<r.to){let o=hB(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return _B(e,t,n,r,o,i,a)}}return vB(e,t,n,o,s.type,i,a)}function _B(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=hB(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(mB(u.type,n,o))l++;else if(mB(u.type,-n,o)){if(l==0){let e=hB(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function vB(e,t,n,r,i,a,o){if(n<0?!t:t==e.doc.length)return null;let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i))if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}var yB=Object.create(null),bB=[dR.none],xB=[],SB=Object.create(null),CB=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])CB[e]=TB(yB,t);function wB(e,t){xB.indexOf(e)>-1||(xB.push(e),console.warn(t))}function TB(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||$[n];r?typeof r==`function`?t.length?t=t.map(r):wB(n,`Modifier ${n} used at start of tag`):t.length?wB(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:wB(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=SB[i];if(a)return a.id;let o=SB[i]=dR.define({id:bB.length,name:r,props:[oz({[r]:n})]});return bB.push(o),o.id}MN.RTL,MN.LTR;var EB=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=jz(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(NB(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function DB(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function OB(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=DB(t)+DB(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function kB(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:OB(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function AB(e,t){return n=>{for(let t=jz(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}var jB=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function MB(e){return e.selection.main.from}function NB(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var PB=Mj.define();function FB(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:ij.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var IB=new WeakMap;function LB(e){if(!Array.isArray(e))return e;let t=IB.get(e);return t||IB.set(e,t=kB(e)),t}var RB=Fj.define(),zB=Fj.define(),BB=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=GA(e,t),r=KA(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(GA(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=GA(e,0),i=KA(r),a=i==e.length?0:-100;if(r!=t[0])if(r==n[0])a+=-200;else return null;return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=GA(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=KA(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=GA(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let v,y=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(v=fde(c))==v.toLowerCase()?v==v.toUpperCase()?0:2:1;(!r||y==1&&h||_==0&&y!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=y,r+=KA(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?KA(GA(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},VB=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},HB=sj.define({combine(e){return Zj(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:WB,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>UB(e(n),t(n)),optionClass:(e,t)=>n=>UB(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function UB(e,t){return e?t?e+` `+t:e:t}function WB(e,t,n,r,i,a){let o=e.textDirection==MN.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var GB=Fj.define();function KB(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function qB(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.ceil((e-t)/n);return{from:e-r*n,to:e-(r-1)*n}}var JB=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(HB);this.optionContent=KB(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=qB(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:GB.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(HB).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:zB.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=qB(r.length,i,e.state.facet(HB).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=qB(t.options.length,t.selected,this.view.state.facet(HB).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>gP(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&XB(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(HB).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0))if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function YB(e,t){return n=>new JB(n,e,t)}function XB(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function ZB(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function QB(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(HB);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new jB(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new VB(n):new BB(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new jB(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):ZB(e.completion)>ZB(c)&&(s[s.length-1]=e),c=e.completion}return s}var $B=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,iV(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=QB(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(HB).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,iV(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:pV,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},eV=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(aV,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(HB),i=(r.override||n.languageDataAt(`autocomplete`,MB(n)).map(LB)).map(e=>(this.active.find(t=>t.source==e)||new sV(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(uV));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!tV(i,this.active)||o?a=$B.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new sV(e.source,0):e));for(let e of t.effects)e.is(GB)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?nV:rV}};function tV(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var nV={"aria-autocomplete":`list`},rV={};function iV(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var aV=[];function oV(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(PB);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var sV=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=oV(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(RB))i=new e(i.source,1,n.value);else if(n.is(zB))i=new e(i.source,0);else if(n.is(uV))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(MB(e.state))}},cV=class e extends sV{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=MB(t.state);if(o>a||!r||n&2&&(MB(t.startState)==this.from||o<this.limit))return new sV(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return lV(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new EB(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??MB(t.state)):new sV(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new e(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new sV(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function lV(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):NB(e,!0).test(i)}var uV=Fj.define({map(e,t){return e.map(e=>e.map(t))}}),dV=mj.define({create(){return eV.start()},update(e,t){return e.update(t)},provide:e=>[nR.from(e,e=>e.tooltip),OL.contentAttributes.from(e,e=>e.attrs)]});function fV(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(dV).active.find(e=>e.source==t.source);return r instanceof cV?(typeof n==`string`?e.dispatch({...FB(e.state,n,r.from,r.to),annotations:PB.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}var pV=YB(dV,fV);function mV(e,t=`option`){return n=>{let r=n.state.field(dV,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(HB).interactionDelay)return!1;let i=1,a;t==`page`&&(a=rR(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:GB.of(s)}),!0}}var hV=e=>{let t=e.state.field(dV,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(HB).interactionDelay?!1:fV(e,t.open.options[t.open.selected])},gV=e=>e.state.field(dV,!1)?(e.dispatch({effects:RB.of(!0)}),!0):!1,_V=e=>{let t=e.state.field(dV,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:zB.of(null)}),!0)},vV=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},yV=50,bV=1e3,xV=bP.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(dV).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(dV),n=e.state.facet(HB);if(!e.selectionSet&&!e.docChanged&&e.startState.field(dV)==t)return;let r=e.transactions.some(e=>{let t=oV(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>yV&&Date.now()-n.time>bV){for(let e of n.context.abortListeners)try{e()}catch(e){gP(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(RB)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(dV);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(HB).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new EB(t,MB(t),e.explicit,this.view),r=new vV(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:zB.of(null)}),gP(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(HB).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(HB),n=this.view.state.field(dV);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=MB(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new cV(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(i.done==null){let n=new sV(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:uV.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(dV,!1);if(t&&t.tooltip&&this.view.state.facet(HB).closeOnBlur){let n=t.open&&rR(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:zB.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:RB.of(!1)}),20),this.composing=0}}}),SV=typeof navigator==`object`&&/Win/.test(navigator.platform),CV=_j.highest(OL.domEventHandlers({keydown(e,t){let n=t.state.field(dV,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(SV&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&fV(t,r),!1}})),wV=OL.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`,cursor:`pointer`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),TV=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},EV=class e{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(t){let n=t.mapPos(this.from,-1,JA.TrackDel),r=t.mapPos(this.to,1,JA.TrackDel);return n==null||r==null?null:new e(this.field,n,r)}},DV=class e{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],i=e.doc.lineAt(t),a=/^\s*/.exec(i.text)[0];for(let i of this.lines){if(n.length){let n=a,o=/^\t*/.exec(i)[0].length;for(let t=0;t<o;t++)n+=e.facet(Wz);r.push(t+n.length-o),i=n+i.slice(o)}n.push(i),t+=i.length+1}return{text:n,ranges:this.fieldPositions.map(e=>new EV(e.field,r[e.line]+e.from,r[e.line]+e.to))}}static parse(t){let n=[],r=[],i=[],a;for(let e of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);){let t=a[1]?+a[1]:null,o=a[2]||a[3]||``,s=-1,c=o.replace(/\\[{}]/g,e=>e[1]);for(let e=0;e<n.length;e++)(t==null?c&&n[e].name==c:n[e].seq==t)&&(s=e);if(s<0){let e=0;for(;e<n.length&&(t==null||n[e].seq!=null&&n[e].seq<t);)e++;n.splice(e,0,{seq:t,name:c}),s=e;for(let e of i)e.field>=s&&e.field++}for(let e of i)if(e.line==r.length&&e.from>a.index){let t=a[2]?3+(a[1]||``).length:2;e.from-=t,e.to-=t}i.push(new TV(s,r.length,a.index,a.index+c.length)),e=e.slice(0,a.index)+o+e.slice(a.index+a[0].length)}e=e.replace(/\\([{}])/g,(e,t,n)=>{for(let e of i)e.line==r.length&&e.from>n&&(e.from--,e.to--);return t}),r.push(e)}return new e(r,i)}},OV=QM.widget({widget:new class extends XM{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),kV=QM.mark({class:`cm-snippetField`}),AV=class e{constructor(e,t){this.ranges=e,this.active=t,this.deco=QM.set(e.map(e=>(e.from==e.to?OV:kV).range(e.from,e.to)),!0)}map(t){let n=[];for(let e of this.ranges){let r=e.map(t);if(!r)return null;n.push(r)}return new e(n,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}},jV=Fj.define({map(e,t){return e&&e.map(t)}}),MV=Fj.define(),NV=mj.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(jV))return n.value;if(n.is(MV)&&e)return new AV(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>OL.decorations.from(e,e=>e?e.deco:QM.none)});function PV(e,t){return ij.create(e.filter(e=>e.field==t).map(e=>ij.range(e.from,e.to)))}function FV(e){let t=DV.parse(e);return(e,n,r,i)=>{let{text:a,ranges:o}=t.instantiate(e.state,r),{main:s}=e.state.selection,c={changes:{from:r,to:i==s.from?s.to:i,insert:FA.of(a)},scrollIntoView:!0,annotations:n?[PB.of(n),Ij.userEvent.of(`input.complete`)]:void 0};if(o.length&&(c.selection=PV(o,0)),o.some(e=>e.field>0)){let t=new AV(o,0),n=c.effects=[jV.of(t)];e.state.field(NV,!1)===void 0&&n.push(Fj.appendConfig.of([NV,zV,VV,wV]))}e.dispatch(e.state.update(c))}}function IV(e){return({state:t,dispatch:n})=>{let r=t.field(NV,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:PV(r.ranges,i),effects:jV.of(a?null:new AV(r.ranges,i)),scrollIntoView:!0})),!0}}var LV=[{key:`Tab`,run:IV(1),shift:IV(-1)},{key:`Escape`,run:({state:e,dispatch:t})=>e.field(NV,!1)?(t(e.update({effects:jV.of(null)})),!0):!1}],RV=sj.define({combine(e){return e.length?e[0]:LV}}),zV=_j.highest(LL.compute([RV],e=>e.facet(RV)));function BV(e,t){return{...t,apply:FV(e)}}var VV=OL.domEventHandlers({mousedown(e,t){let n=t.state.field(NV,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:PV(n.ranges,i.field),effects:jV.of(n.ranges.some(e=>e.field>i.field)?new AV(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),HV=new class extends Qj{};HV.startSide=1,HV.endSide=-1,typeof navigator==`object`&&navigator.userAgent;function UV(e={}){return[CV,dV,HB.of(e),xV,GV,wV]}var WV=[{key:`Ctrl-Space`,run:gV},{mac:"Alt-`",run:gV},{mac:`Alt-i`,run:gV},{key:`Escape`,run:_V},{key:`ArrowDown`,run:mV(!0)},{key:`ArrowUp`,run:mV(!1)},{key:`PageDown`,run:mV(!0,`page`)},{key:`PageUp`,run:mV(!1,`page`)},{key:`Enter`,run:hV}],GV=_j.highest(LL.computeN([HB],e=>e.facet(HB).defaultKeymap?[WV]:[]));function KV(e){let t=e.field(dV,!1);return t&&t.active.some(e=>e.isPending)?`pending`:t&&t.active.some(e=>e.state!=0)?`active`:null}var qV=class e{static create(t,n,r,i,a){return new e(t,n,r,i+(i<<8)+t+(n<<4)|0,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[cR.contextHash,r]]}addChild(e,t){e.prop(cR.contextHash)!=this.hash&&(e=new gR(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new gR(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new gR(dR.none,e,t,n,this.hashProp)})}},JV;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(JV||={});var YV=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},XV=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return eH(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function ZV(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==JV.OrderedList?sH:oH)(n,t,!1);return r>0&&(e.type!=JV.BulletList||iH(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var QV={[JV.Blockquote](e,t,n){return n.next==62?(n.markers.push(FH(JV.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+($V(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[JV.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[JV.OrderedList]:ZV,[JV.BulletList]:ZV,[JV.Document](){return!0}};function $V(e){return e==32||e==9||e==10||e==13}function eH(e,t=0){for(;t<e.length&&$V(e.charCodeAt(t));)t++;return t}function tH(e,t,n){for(;t>n&&$V(e.charCodeAt(t-1));)t--;return t}function nH(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function rH(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function iH(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!$V(n))return-1}return n&&e.next==45&&lH(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(xH.SetextHeading)>-1||r<3?-1:1}function aH(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function oH(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||$V(e.text.charCodeAt(e.pos+1)))&&(!n||aH(t,JV.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function sH(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!$V(e.text.charCodeAt(r+1))||n&&!aH(t,JV.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function cH(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function lH(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&$V(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var uH=/^[ \t]*$/,dH=/-->/,fH=/\?>/,pH=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,dH],[/^\s*<\?/,fH],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,uH],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,uH]];function mH(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=pH.length-+!!n;e<t;e++)if(pH[e][0].test(r))return e;return-1}function hH(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function gH(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==JV.CodeText?e[r].to=n:e.push(FH(JV.CodeText,t,n))}var _H={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(gH(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){gH(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==JV.CodeText?gH(o,e.from,e.to):o.push(e);s=[]}gH(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&gH(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=JV.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(JV.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=nH(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=tH(t.text,t.text.length,o),c=[FH(JV.CodeMark,r,r+a)];o<s&&c.push(FH(JV.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&gH(c,e.lineStart-1,e.lineStart),c.push(FH(JV.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(gH(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(gH(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(JV.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=rH(t);return n<0?!1:(e.startContext(JV.Blockquote,t.pos),e.addNode(JV.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(iH(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(JV.HorizontalRule,n),!0},BulletList(e,t){let n=oH(t,e,!1);if(n<0)return!1;e.block.type!=JV.BulletList&&e.startContext(JV.BulletList,t.basePos,t.next);let r=hH(t,t.pos+1);return e.startContext(JV.ListItem,t.basePos,r-t.baseIndent),e.addNode(JV.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=sH(t,e,!1);if(n<0)return!1;e.block.type!=JV.OrderedList&&e.startContext(JV.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=hH(t,t.pos+n);return e.startContext(JV.ListItem,t.basePos,r-t.baseIndent),e.addNode(JV.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=cH(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=tH(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!$V(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(JV.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(JV.HeaderMark,o-r,a-r);let c=s.finish(JV.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=mH(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=pH[n][1],a=[],o=i!=uH;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==dH?JV.CommentBlock:i==fH?JV.ProcessingInstructionBlock:JV.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},vH=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
|
|
51
|
-
`+t.scrub(),i=this.advance(r);return i>-1&&i<r.length?this.complete(e,n,i):!1}finish(e,t){return(this.stage==2||this.stage==3)&&eH(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,FH(JV.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(qH(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(FH(JV.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(GH(e,eH(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=eH(e,this.pos),n=0;if(t>this.pos){let r=KH(e,t,this.start);if(r){let t=yH(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=yH(e,this.pos),n>0&&n<e.length?n:-1}else return yH(e,this.pos)}};function yH(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!$V(n))return-1}return t}var bH=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:lH(t),i=t.next;if(r<0)return!1;let a=FH(JV.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,FH(i==61?JV.SetextHeading1:JV.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},xH={LinkReference(e,t){return t.content.charCodeAt(0)==91?new vH(t):null},SetextHeading(){return new bH}},SH=[(e,t)=>cH(t)>=0,(e,t)=>nH(t)>=0,(e,t)=>rH(t)>=0,(e,t)=>oH(t,e,!0)>=0,(e,t)=>sH(t,e,!0)>=0,(e,t)=>iH(t,e,!0)>=0,(e,t)=>mH(t,e,!0)>=0],CH={text:``,end:0},wH=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new XV,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=qV.create(JV.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new ZH(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}let t=new YV(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
|
|
52
|
-
`+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=QH(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=CH;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+JV[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
|
|
53
|
-
`?``:t;else{let e=t.indexOf(`
|
|
54
|
-
`);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=qV.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new gR(this.parser.nodeSet.types[e],jH,jH,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(YH(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?TH(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=YH(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(JV.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?FH(this.parser.getNodeType(e),t,n,r):new PH(e,t)}get buffer(){return new MH(this.parser.nodeSet)}};function TH(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=TH(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new gR(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var EH=class e extends RR{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new wH(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let n=OH(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,a=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),c=this.inlineParsers.slice(),l=this.inlineNames.slice(),u=this.endLeafBlock.slice(),d=this.wrappers;if(DH(n.defineNodes)){i=Object.assign({},i);let e=r.types.slice(),t;for(let r of n.defineNodes){let{name:n,block:a,composite:o,style:s}=typeof r==`string`?{name:r}:r;if(e.some(e=>e.name==n))continue;o&&(i[e.length]=(e,t,n)=>o(t,n,e.value));let c=e.length,l=o?[`Block`,`BlockContext`]:a?c>=JV.ATXHeading1&&c<=JV.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(dR.define({id:c,name:n,props:l&&[[cR.group,l]]})),s&&(t||={},Array.isArray(s)||s instanceof tz?t[n]=s:Object.assign(t,s))}r=new fR(e),t&&(r=r.extend(oz(t)))}if(DH(n.props)&&(r=r.extend(...n.props)),DH(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(a[t]=o[t]=void 0),n>-1&&(c[n]=void 0)}if(DH(n.parseBlock))for(let e of n.parseBlock){let t=s.indexOf(e.name);if(t>-1)a[t]=e.parse,o[t]=e.leaf;else{let t=e.before?kH(s,e.before):e.after?kH(s,e.after)+1:s.length-1;a.splice(t,0,e.parse),o.splice(t,0,e.leaf),s.splice(t,0,e.name)}e.endLeaf&&u.push(e.endLeaf)}if(DH(n.parseInline))for(let e of n.parseInline){let t=l.indexOf(e.name);if(t>-1)c[t]=e.parse;else{let t=e.before?kH(l,e.before):e.after?kH(l,e.after)+1:l.length-1;c.splice(t,0,e.parse),l.splice(t,0,e.name)}}return n.wrap&&(d=d.concat(n.wrap)),new e(r,a,o,s,u,i,c,l,d)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new JH(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function DH(e){return e!=null&&e.length>0}function OH(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=OH(e[0]);if(e.length==1)return t;let n=OH(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||jH).concat(t||jH),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function kH(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var AH=[dR.none];for(let e=1,t;t=JV[e];e++)AH[e]=dR.define({id:e,name:t,props:e>=JV.Escape?[]:[[cR.group,e in QV?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var jH=[],MH=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return gR.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},NH=class{constructor(e,t,n,r=jH){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new MH(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},PH=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return jH}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function FH(e,t,n,r){return new NH(e,t,n,r)}var IH={resolve:`Emphasis`,mark:`EmphasisMark`},LH={resolve:`Emphasis`,mark:`EmphasisMark`},RH={},zH={},BH=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},VH=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,HH=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{HH=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var UH={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(VH.charCodeAt(t)==r)return e.append(FH(JV.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(FH(JV.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(FH(JV.InlineCode,n,r+1,[FH(JV.CodeMark,n,n+i),FH(JV.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(FH(JV.Autolink,n,n+1+i[0].length,[FH(JV.LinkMark,n,n+1),FH(JV.URL,n+1,n+i[0].length),FH(JV.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(FH(JV.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(FH(JV.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(FH(JV.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=HH.test(i),s=HH.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new BH(t==95?IH:LH,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(FH(JV.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(FH(JV.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new BH(RH,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new BH(zH,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof BH&&(r.type==RH||r.type==zH)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=WH(e,i,r.type==RH?JV.Link:JV.Image,r.from,n+1);if(r.type==RH)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof BH&&t.type==RH&&(t.side=0)}return a.to}}return-1}};function WH(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(FH(JV.LinkMark,r,r+(n==JV.Image?2:1))),t.push(FH(JV.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=GH(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=KH(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(FH(JV.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(FH(JV.LinkMark,n,s)))}else if(o==91){let n=qH(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return FH(n,r,s,t)}function GH(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return FH(JV.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}else{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if($V(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?FH(JV.URL,t+n,i+n):i==e.length?null:!1}}function KH(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return FH(JV.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function qH(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return r?!1:FH(JV.LinkLabel,t+n,a+1+n);else{if(r&&!$V(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var JH=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new BH(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof BH&&(t.type==RH||t.type==zH))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof BH&&n.type.resolve&&n.side&2))continue;let r=n.type==IH||n.type==LH,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof BH&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof NH&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new BH(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new BH(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof NH&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof BH&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof BH?t:null}skipSpace(e){return eH(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?FH(this.parser.getNodeType(e),t,n,r):new PH(e,t)}};JH.linkStart=RH,JH.imageStart=zH;function YH(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof NH&&(n[r]=new NH(t.type,t.from,t.to,YH(t.children,[e])))}else n.splice(r++,0,e)}return n}var XH=[JV.CodeBlock,JV.ListItem,JV.OrderedList,JV.BulletList],ZH=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
|
|
55
|
-
`;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(cR.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=QH(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new gR(e.parser.nodeSet.types[JV.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(XH.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function QH(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var $H=oz({"Blockquote/...":$.quote,HorizontalRule:$.contentSeparator,"ATXHeading1/... SetextHeading1/...":$.heading1,"ATXHeading2/... SetextHeading2/...":$.heading2,"ATXHeading3/...":$.heading3,"ATXHeading4/...":$.heading4,"ATXHeading5/...":$.heading5,"ATXHeading6/...":$.heading6,"Comment CommentBlock":$.comment,Escape:$.escape,Entity:$.character,"Emphasis/...":$.emphasis,"StrongEmphasis/...":$.strong,"Link/... Image/...":$.link,"OrderedList/... BulletList/...":$.list,"BlockQuote/...":$.quote,"InlineCode CodeText":$.monospace,"URL Autolink":$.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":$.processingInstruction,"CodeInfo LinkLabel":$.labelName,LinkTitle:$.string,Paragraph:$.content}),eU=new EH(new fR(AH).extend($H),Object.keys(_H).map(e=>_H[e]),Object.keys(_H).map(e=>xH[e]),Object.keys(_H),SH,QV,Object.keys(UH).map(e=>UH[e]),Object.keys(UH),[]);function tU(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function nU(e){let{codeParser:t,htmlParser:n}=e;return{wrap:BR((e,r)=>{let i=e.type.id;if(t&&(i==JV.CodeBlock||i==JV.FencedCode)){let n=``;if(i==JV.FencedCode){let t=e.node.getChild(JV.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==JV.CodeText,bracketed:i==JV.FencedCode}}else if(n&&(i==JV.HTMLBlock||i==JV.HTMLTag||i==JV.CommentBlock))return{parser:n,overlay:tU(e.node,e.from,e.to)};return null})}}var rU={resolve:`Strikethrough`,mark:`StrikethroughMark`},iU={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":$.strikethrough}},{name:`StrikethroughMark`,style:$.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=HH.test(r),c=HH.test(i);return e.addDelimiter(rU,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function aU(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function oU(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var sU=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,cU=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&sU.test(r=t.text.slice(t.pos))){let i=[];aU(e,n.content,0,i,n.start)==aU(e,r,0)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];aU(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},lU={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":$.heading}},`TableRow`,{name:`TableCell`,style:$.content},{name:`TableDelimiter`,style:$.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return oU(t.content,0)?new cU:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof cU)||!oU(t.text,t.basePos))return!1;let r=e.peekLine();return sU.test(r)&&aU(e,t.text,t.basePos)==aU(e,r,t.basePos)},before:`SetextHeading`}]},uU=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},dU={defineNodes:[{name:`Task`,block:!0,style:$.list},{name:`TaskMarker`,style:$.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new uU:null},after:`SetextHeading`}]},fU=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,pU=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,mU=/[\w-]+\.[\w-]+($|[/:])/,hU=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,gU=/\/[a-zA-Z\d@.]+/gy;function _U(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function vU(e,t){pU.lastIndex=t;let n=pU.exec(e);if(!n||mU.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&_U(e,t,r,`)`)>_U(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function yU(e,t){hU.lastIndex=t;let n=hU.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var bU=[lU,dU,iU,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;fU.lastIndex=r;let i=fU.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=vU(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=yU(e.text,r):(a=yU(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(gU.lastIndex=a,i=gU.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function xU(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),$V(s))break}return-1}}var SU={defineNodes:[{name:`Superscript`,style:$.special($.content)},{name:`SuperscriptMark`,style:$.processingInstruction}],parseInline:[{name:`Superscript`,parse:xU(94,`Superscript`,`SuperscriptMark`)}]},CU={defineNodes:[{name:`Subscript`,style:$.special($.content)},{name:`SubscriptMark`,style:$.processingInstruction}],parseInline:[{name:`Subscript`,parse:xU(126,`Subscript`,`SubscriptMark`)}]},wU={defineNodes:[{name:`Emoji`,style:$.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},TU=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new EU(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new DU(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216))if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new EU(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},EU=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},DU=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},OU=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function kU(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var AU=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},jU=new AU,MU=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=jU,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=jU,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},NU=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;IU(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};NU.prototype.contextual=NU.prototype.fallback=NU.prototype.extend=!1;var PU=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?kU(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(IU(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};PU.prototype.contextual=NU.prototype.fallback=NU.prototype.extend=!1;var FU=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function IU(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||RU(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function LU(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function RU(e,t,n,r){let i=LU(n,r,t);return i<0||LU(n,r,e)<i}var zU=typeof process<`u`&&/\bparse\b/.test({}.LOG),BU=null;function VU(e,t,n){let r=e.cursor(hR.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var HU=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?VU(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?VU(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof gR){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(cR.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},UU=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new AU)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if(!(n&&!c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new AU,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new AU,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535)if(o[s+1]==1)s=XU(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(XU(o,s+2),t,n,r));break}o[s]==t&&(r=this.putAction(XU(o,s+1),t,n,r))}return r}},WU=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new MU(t,r),this.tokens=new UU(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[TU.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new HU(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&ZU(r);if(e)return zU&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw zU&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return zU&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500)if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=zU?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(cR.contextHash)||0)==n))return e.useNode(o,r),zU&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof gR)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof gR&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),zU&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),zU&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return GU(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=zU?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),zU&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(zU&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)zU&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))zU&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),zU&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),GU(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),gR.build({buffer:OU.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(BU||=new WeakMap).get(e);return t||BU.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function GU(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var KU=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},qU=e=>e,JU=class{constructor(e){this.start=e.start,this.shift=e.shift||qU,this.reduce=e.reduce||qU,this.reuse=e.reuse||qU,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},YU=class e extends RR{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=cR[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new fR(t.map((t,i)=>dR.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=aR;let a=kU(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(QU),this.states=kU(e.states,Uint32Array),this.data=kU(e.stateData),this.goto=kU(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new NU(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new WU(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535)if(n[i+1]==1)a=n[i=XU(n,i+2)];else if(n[i+1]==2)return XU(n,i+2);else break;if(a==t||a==0)return XU(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=XU(this.data,n+2);else break;r=t(XU(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=XU(this.data,n+2);else break;if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=QU(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new KU(e,n,r)}static deserialize(t){return new e(t)}};function XU(e,t){return e[t]|e[t+1]<<16}function ZU(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function QU(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var $U=55,eW=1,tW=56,nW=2,rW=57,iW=3,aW=4,oW=5,sW=6,cW=7,lW=8,uW=9,dW=10,fW=11,pW=12,mW=13,hW=58,gW=14,_W=15,vW=59,yW=21,bW=23,xW=24,SW=25,CW=27,wW=28,TW=29,EW=32,DW=35,OW=37,kW=38,AW=0,jW=1,MW={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},NW={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},PW={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function FW(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}var IW=null,LW=null,RW=0;function zW(e,t){let n=e.pos+t;if(RW==n&&LW==e)return IW;let r=e.peek(t),i=``;for(;FW(r);)i+=String.fromCharCode(r),r=e.peek(++t);return LW=e,RW=n,IW=i?i.toLowerCase():r==UW||r==WW?void 0:null}var BW=60,VW=62,HW=47,UW=63,WW=33,GW=45;function KW(e,t){this.name=e,this.parent=t}var qW=[sW,dW,cW,lW,uW],JW=new JU({start:null,shift(e,t,n,r){return qW.indexOf(t)>-1?new KW(zW(r,1)||``,e):e},reduce(e,t){return t==yW&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==sW||i==OW?new KW(zW(r,1)||``,e):e},strict:!1}),YW=new FU((e,t)=>{if(e.next!=BW){e.next<0&&t.context&&e.acceptToken(hW);return}e.advance();let n=e.next==HW;n&&e.advance();let r=zW(e,0);if(r===void 0)return;if(!r)return e.acceptToken(n?_W:gW);let i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(fW);if(i&&NW[i])return e.acceptToken(hW,-2);if(t.dialectEnabled(AW))return e.acceptToken(pW);for(let e=t.context;e;e=e.parent)if(e.name==r)return;e.acceptToken(mW)}else{if(r==`script`)return e.acceptToken(cW);if(r==`style`)return e.acceptToken(lW);if(r==`textarea`)return e.acceptToken(uW);if(MW.hasOwnProperty(r))return e.acceptToken(dW);i&&PW[i]&&PW[i][r]?e.acceptToken(hW,-1):e.acceptToken(sW)}},{contextual:!0}),XW=new FU(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(vW);break}if(e.next==GW)t++;else if(e.next==VW&&t>=2){n>=3&&e.acceptToken(vW,-2);break}else t=0;e.advance()}});function ZW(e){for(;e;e=e.parent)if(e.name==`svg`||e.name==`math`)return!0;return!1}var QW=new FU((e,t)=>{if(e.next==HW&&e.peek(1)==VW){let n=t.dialectEnabled(jW)||ZW(t.context);e.acceptToken(n?oW:aW,2)}else e.next==VW&&e.acceptToken(aW,1)});function $W(e,t,n){let r=2+e.length;return new FU(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(t);break}if(a==0&&i.next==BW||a==1&&i.next==HW||a>=2&&a<r&&i.next==e.charCodeAt(a-2))a++,o++;else if(a==r&&i.next==VW){s>o?i.acceptToken(t,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(t,1);break}else a=o=0;i.advance()}})}var eG=$W(`script`,$U,eW),tG=$W(`style`,tW,nW),nG=$W(`textarea`,rW,iW),rG=oz({"Text RawText IncompleteTag IncompleteCloseTag":$.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":$.angleBracket,TagName:$.tagName,"MismatchedCloseTag/TagName":[$.tagName,$.invalid],AttributeName:$.attributeName,"AttributeValue UnquotedAttributeValue":$.attributeValue,Is:$.definitionOperator,"EntityReference CharacterReference":$.character,Comment:$.blockComment,ProcessingInst:$.processingInstruction,DoctypeDecl:$.documentMeta}),iG=YU.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:`,c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~`,goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:`⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl`,maxTerm:68,context:JW,nodeProps:[[`closedBy`,-10,1,2,3,7,8,9,10,11,12,13,`EndTag`,6,`EndTag SelfClosingEndTag`,-4,22,31,34,37,`CloseTag`],[`openedBy`,4,`StartTag StartCloseTag`,5,`StartTag`,-4,30,33,36,38,`OpenTag`],[`group`,-10,14,15,18,19,20,21,40,41,42,43,`Entity`,17,`Entity TextContent`,-3,29,32,35,`TextContent Entity`],[`isolate`,-11,22,30,31,33,34,36,37,38,39,42,43,`ltr`,-3,27,28,40,``]],propSources:[rG],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[eG,tG,nG,QW,YW,XW,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function aG(e,t){let n=Object.create(null);for(let r of e.getChildren(xW)){let e=r.getChild(SW),i=r.getChild(CW)||r.getChild(wW);e&&(n[t.read(e.from,e.to)]=i?i.type.id==CW?t.read(i.from+1,i.to-1):t.read(i.from,i.to):``)}return n}function oG(e,t){let n=e.getChild(bW);return n?t.read(n.from,n.to):` `}function sG(e,t,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||=aG(e.node.parent.firstChild,t)))return{parser:i.parser,bracketed:!0};return null}function cG(e=[],t=[]){let n=[],r=[],i=[],a=[];for(let t of e)(t.tag==`script`?n:t.tag==`style`?r:t.tag==`textarea`?i:a).push(t);let o=t.length?Object.create(null):null;for(let e of t)(o[e.name]||(o[e.name]=[])).push(e);return BR((e,t)=>{let s=e.type.id;if(s==TW)return sG(e,t,n);if(s==EW)return sG(e,t,r);if(s==DW)return sG(e,t,i);if(s==yW&&a.length){let n=e.node,r=n.firstChild,i=r&&oG(r,t),o;if(i){for(let e of a)if(e.tag==i&&(!e.attrs||e.attrs(o||=aG(r,t)))){let t=n.lastChild,i=t.type.id==kW?t.from:n.to;if(i>r.to)return{parser:e.parser,overlay:[{from:r.to,to:i}]}}}}if(o&&s==xW){let n=e.node,r;if(r=n.firstChild){let e=o[t.read(r.from,r.to)];if(e)for(let r of e){if(r.tagName&&r.tagName!=oG(n.parent,t))continue;let e=n.lastChild;if(e.type.id==CW){let t=e.from+1,n=e.lastChild,i=e.to-(n&&n.isError?0:1);if(i>t)return{parser:r.parser,overlay:[{from:t,to:i}],bracketed:!0}}else if(e.type.id==wW)return{parser:r.parser,overlay:[{from:e.from,to:e.to}]}}}}return null})}var lG=135,uG=1,dG=136,fG=137,pG=2,mG=138,hG=3,gG=4,_G=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],vG=58,yG=40,bG=95,xG=91,SG=45,CG=46,wG=35,TG=37,EG=38,DG=92,OG=10,kG=42;function AG(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function jG(e){return e>=48&&e<=57}function MG(e){return jG(e)||e>=97&&e<=102||e>=65&&e<=70}var NG=(e,t,n)=>(r,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:c}=r;if(AG(c)||c==SG||c==bG||a&&jG(c))!a&&(c!=SG||s>0)&&(a=!0),o===s&&c==SG&&o++,r.advance();else if(c==DG&&r.peek(1)!=OG){if(r.advance(),MG(r.next)){do r.advance();while(MG(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();a=!0}else{a&&r.acceptToken(o==2&&i.canShift(pG)?t:c==yG?n:e);break}}},PG=new FU(NG(dG,pG,fG),{contextual:!0}),FG=new FU(NG(mG,hG,gG),{contextual:!0}),IG=new FU(e=>{if(_G.includes(e.peek(-1))){let{next:t}=e;(AG(t)||t==bG||t==wG||t==CG||t==kG||t==xG||t==vG&&AG(e.peek(1))||t==SG||t==EG)&&e.acceptToken(lG)}}),LG=new FU(e=>{if(!_G.includes(e.peek(-1))){let{next:t}=e;if(t==TG&&(e.advance(),e.acceptToken(uG)),AG(t)){do e.advance();while(AG(e.next)||jG(e.next));e.acceptToken(uG)}}}),RG=oz({"AtKeyword import charset namespace keyframes media supports font-feature-values":$.definitionKeyword,"from to selector scope MatchFlag":$.keyword,NamespaceName:$.namespace,KeyframeName:$.labelName,KeyframeRangeName:$.operatorKeyword,TagName:$.tagName,ClassName:$.className,PseudoClassName:$.constant($.className),IdName:$.labelName,"FeatureName PropertyName":$.propertyName,AttributeName:$.attributeName,NumberLiteral:$.number,KeywordQuery:$.keyword,UnaryQueryOp:$.operatorKeyword,"CallTag ValueName FontName":$.atom,VariableName:$.variableName,Callee:$.operatorKeyword,Unit:$.unit,"UniversalSelector NestingSelector":$.definitionOperator,"MatchOp CompareOp":$.compareOperator,"ChildOp SiblingOp, LogicOp":$.logicOperator,BinOp:$.arithmeticOperator,Important:$.modifier,Comment:$.blockComment,ColorLiteral:$.color,"ParenthesizedContent StringLiteral":$.string,":":$.punctuation,"PseudoOp #":$.derefOperator,"; , |":$.separator,"( )":$.paren,"[ ]":$.squareBracket,"{ }":$.brace}),zG={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},BG={__proto__:null,or:104,and:104,not:112,only:112,layer:186},VG={__proto__:null,selector:118,layer:182},HG={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},UG={__proto__:null,to:223},WG=YU.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,]QdO,59YO'_QdO,5:`O'dQdO,5:bO'oQdO,5:iO'oQdO,5:kO'oQdO,5:lO'oQdO'#E}O,hQ`O,58}O,pQdO'#ESOOQS,58},58}OOQP'#Cq'#CqOOQO'#Dr'#DrOOQP,59Y,59YO,wQ`O,59YO,|Q`O,59YOOQP'#Du'#DuOOQP,5:`,5:`O-RQpO'#DwO-^QdO'#DxO-cQ`O'#DxO-hQpO,5:bO.RQaO,5:iO.iQaO,5:lOOQW'#D^'#D^O/eQhO'#DgO/xQhO,5;_O)zQhO'#DeO0VQ`O'#DkO0[QhO'#DnOOQW'#Fj'#FjOOQS,5;_,5;_O0aQ`O'#DhOOQS-E8t-E8tOOQ['#Cv'#CvO0fQdO'#CwO0|QdO'#C}O1dQdO'#DQO1zQ!pO'#DSO4TQ!jO,5:rOOQO'#DX'#DXO,|Q`O'#DWO4eQ!nO'#FgO6hQ`O'#DYO6mQ`O'#DoOOQ['#Fg'#FgO6rQhO'#FqO7QQ`O,5:xO7VQ!bO,5:zOOQS'#Ed'#EdO7_Q`O,5:|O7dQdO,5:|OOQO'#Eg'#EgO7lQ`O,5;PO7qQhO,5;VO'oQdO'#DjOOQS,5;X,5;XO0aQ`O,5;XO7yQdO,5;XOOQS'#FU'#FUO8RQdO'#ErO7QQ`O,5;[O8ZQdO,5:oO8kQdO'#FPO8xQ`O,5<YO8xQ`O,5<YPOOO'#Eu'#EuP9TO&jO,58{POOO,58{,58{OOQP1G.m1G.mOOQP1G.q1G.qOOQP1G.t1G.tO,wQ`O1G.tO,|Q`O1G.tOOQP1G/z1G/zO9`QpO1G/|O9hQaO1G0TO:OQaO1G0VO:fQaO1G0WO:|QaO,5;iOOQO-E8{-E8{OOQS1G.i1G.iO;WQ`O,5:nO;]QdO'#DsO;dQdO'#CuOOQO'#Dz'#DzOOQO,5:d,5:dO-^QdO,5:dOOQP1G/|1G/|O)VQdO1G/|O;kQ!jO'#D^O;yQ!bO,59yO<RQhO,5:ROOQO'#Fk'#FkO;|Q!bO,59}O<ZQhO'#FVO)zQhO,59{O)zQhO'#FVO=OQhO1G0yOOQS1G0y1G0yO=YQhO,5:PO>QQhO'#DlOOQW,5:V,5:VOOQW,5:Y,5:YOOQW,5:S,5:SO>[Q!fO'#FhOOQS'#Fh'#FhOOQS'#Ex'#ExO?lQdO,59cOOQ[,59c,59cO@SQdO,59iOOQ[,59i,59iO@jQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)VQdO,59pOAQQhO'#EYOOQW'#EY'#EYOAlQ`O1G0^O4^QhO1G0^OOQ[,59r,59rO)zQhO'#D[OOQ[,59t,59tOAqQ#tO,5:ZOA|QhO'#FROBZQ`O,5<]OOQS1G0d1G0dOOQS1G0f1G0fOOQS1G0h1G0hOBfQ`O1G0hOBkQdO'#EhOOQS1G0k1G0kOOQS1G0q1G0qOBvQaO,5:UO7QQ`O1G0sOOQS1G0s1G0sO0aQ`O1G0sOOQS-E9S-E9SOOQS1G0v1G0vOB}Q!fO1G0ZOCeQ`O'#EVOOQO1G0Z1G0ZOOQO,5;k,5;kOCjQdO,5;kOOQO-E8}-E8}OCwQ`O1G1tPOOO-E8s-E8sPOOO1G.g1G.gOOQP7+$`7+$`OOQP7+%h7+%hO)VQdO7+%hOOQS1G0Y1G0YODSQaO'#FmOD^Q`O,5:_ODcQ!fO'#EwOEaQdO'#FfOEkQ`O,59aOOQO1G0O1G0OOEpQ!bO7+%hO)VQdO1G/eOE{QhO1G/iOOQW1G/m1G/mOOQW1G/g1G/gOF^QhO,5;qOOQW-E9T-E9TOOQS7+&e7+&eOGRQhO'#D^OGaQhO'#FlOGlQ`O'#FlOGqQ`O,5:WOOQS-E8v-E8vOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OGvQdO,5:tOOQS7+%x7+%xOG{Q`O7+%xOHQQhO'#D]OHYQ`O,59vO)zQhO,59vOOQ[1G/u1G/uOHbQ`O1G/uOHgQhO,5;mOOQO-E9P-E9POOQS7+&S7+&SOHuQbO'#DSOOQO'#Ej'#EjOITQ`O'#EiOOQO'#Ei'#EiOI`Q`O'#FSOIhQdO,5;SOOQS,5;S,5;SOOQ[1G/p1G/pOOQS7+&_7+&_O7QQ`O7+&_OIsQ!fO'#FOO)VQdO'#FOOJzQdO7+%uOOQO7+%u7+%uOOQO,5:q,5:qOOQO1G1V1G1VOK_Q!bO<<ISOKjQdO'#E|OKtQ`O,5<XOOQP1G/y1G/yOOQS-E8u-E8uOK|QdO'#E{OLWQ`O,5<QOOQ]1G.{1G.{OOQP<<IS<<ISOL`Q`O<<ISOLeQdO7+%POOQO'#D`'#D`OLlQ!bO7+%TOLtQhO'#EzOMRQ`O,5<WO)VQdO,5<WOOQW1G/r1G/rOOQO'#E['#E[OMZQ`O1G0`OOQS<<Id<<IdO)VQdO,59wOMzQhO1G/bOOQ[1G/b1G/bONRQ`O1G/bOOQW-E8w-E8wOOQ[7+%a7+%aOOQO,5;T,5;TOBnQdO'#FTOI`Q`O,5;nOOQS,5;n,5;nOOQS-E9Q-E9QOOQS1G0n1G0nOOQS<<Iy<<IyONZQ!fO,5;jOOQS-E8|-E8|OOQO<<Ia<<IaOOQPAN>nAN>nO! bQ`OAN>nO! gQaO,5;hOOQO-E8z-E8zO! qQdO,5;gOOQO-E8y-E8yOOQW<<Hk<<HkOOQW<<Ho<<HoO! {QhO<<HoO!!^QhO,5;fO!!iQ`O,5;fOOQO-E8x-E8xO!!nQdO1G1rOGvQdO'#FQO!!xQ`O7+%zOOQW7+%z7+%zO!#QQ!bO1G/cOOQ[7+$|7+$|O!#]QhO7+$|P!#dQ`O'#EyOOQO,5;o,5;oOOQO-E9R-E9ROOQS1G1Y1G1YOOQPG24YG24YO!#iQ`OAN>ZO)VQdO1G1QO!#nQ`O7+'^OOQO,5;l,5;lOOQO-E9O-E9OOOQW<<If<<IfOOQ[<<Hh<<HhPOQW,5;e,5;eOOQWG23uG23uO!#vQdO7+&l",stateData:"!$Z~O$QOS$RQQ~OWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|RO$XTO~OQmOWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|lO$XTO~O#z$bP~P!jO$RqO~O`YXcYXdYXmYXpYXsYX!aYX!rYX!uYX#{YX$X[X~OgYX~P$ZO#|sO~O$XuO~O$XuO`$WXc$WXd$WXm$WXp$WXs$WX!a$WX!r$WX!u$WX#{$WXg$WX~O#|vO~O`xOcyOdyOmzOp{O!r|O!u!OO#{}O~Os!RO!a!PO~P&^Of!XO#|!TO#}!UO~O#|!YO~OW!^O#|![O$X!]O~OWVO^_O`WOcYOdYOmZOp[O!r]O!u^O#|RO$XTO~OS!fOc!gOd!gOh!cOs!RO!Y!eO!]!jO$O!bO~On!iO~P(dOQ!tOh!mOp!nOs!oOu!wOw!wO}!uO!d!vO#|!lO#}!rO$]!pO~OS!fOc!gOd!gOh!cO!Y!eO!]!jO$O!bO~Os$eP~P)zOw!|O!d!vO#|!{O~Ow#OO#|#OO~Oh#ROs!RO#c#TO~O#|#VO~Oc!xX~P$ZOc#YO~On#ZO#z$bXr$bX~O#z$bXr$bX~P!jO$S#^O$T#^O$U#`O~Of#eO#|!TO#}!UO~Os!RO!a!PO~Or$bP~P!jOh#oO~Oh#pO~Oo!kX!o!kX$X!mX~O#|#qO~O$X#sO~Oo#tO!o#uO~O`xOcyOdyOmzOp{O~Os!qa!a!qa!r!qa!u!qa#{!qag!qa~P-pOs!ta!a!ta!r!ta!u!ta#{!tag!ta~P-pOS!fOc!gOd!gOh!cO!Y!eO!]!jO~OR#yOu#yOw#yO$O#vO$]!pO~P/POn$PO!U#|O!a#}O~P(dOh$RO~O$O$TO~Oh#RO~O`$WOc$WOg$ZOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo$]O~P)VO`$WOc$WOl$WOm$WOn$WOr$_O~P)VOP$`OSvXcvXdvXhvXnvXyvX!YvX!]vX!}vX#PvX$OvX!WvXQvX`vXgvXlvXmvXpvXsvXuvXwvX}vX!dvX#|vX#}vX$]vXovXrvX!avX#zvX$dvX!pvX~Oy$aO!}$bO#P$cOn$eP~P)zOh#pOS$ZXc$ZXd$ZXn$ZXy$ZX!Y$ZX!]$ZX!}$ZX#P$ZX$O$ZXQ$ZX`$ZXg$ZXl$ZXm$ZXp$ZXs$ZXu$ZXw$ZX}$ZX!d$ZX#|$ZX#}$ZX$]$ZXo$ZXr$ZX!a$ZX#z$ZX$d$ZX!p$ZX~Oh$gO~Oh$iO~O!U#|O!a$jOs$eXn$eX~Os!RO~On$mOy$aO~On$nO~Ow$oO!d!vO~Os$pO~Os!RO!U#|O~Os!RO#c$vO~O#|#VOs#fX~O$d$zOn!wa#z!war!wa~P)VOn#sX#z#sXr#sX~P!jOn#ZO#z$bar$ba~O$S#^O$T#^O$U%RO~Oo%TO!o%UO~Os!qi!a!qi!r!qi!u!qi#{!qig!qi~P-pOs!si!a!si!r!si!u!si#{!sig!si~P-pOs!ti!a!ti!r!ti!u!ti#{!tig!ti~P-pOs#qa!a#qa~P&^Or%VO~Og$aP~P'oOg$YP~P)VOc!SXg!QX!U!QX!W!SX~Oc%_O!W%`O~Og%aO!U#|O~O!U#|OS#yXc#yXd#yXh#yXn#yXs#yX!Y#yX!]#yX!a#yX$O#yX~On%eO!a#}O~P(dO!U#|OS!Xac!Xad!Xah!Xan!Xas!Xa!Y!Xa!]!Xa!a!Xa$O!Xag!Xa~O$O%fOg$`P~P/POy$aOQ$[X`$[Xc$[Xg$[Xh$[Xl$[Xm$[Xn$[Xp$[Xs$[Xu$[Xw$[X}$[X!d$[X#|$[X#}$[X$]$[Xo$[Xr$[X~O`$WOc$WOg%kOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo%lO~P)VO`$WOc$WOl$WOm$WOn$WOr%mO~P)VOh%oOS!|Xc!|Xd!|Xn!|X!Y!|X!]!|X$O!|X~On%pO~Og%uOw%vO!e%vO~Os#uX!a#uXn#uX~P)zO!a$jOs$ean$ea~On%yO~Or&QO#|%{O$]%zO~Og&RO~P&^Oy$aO!a&VO$d$zOn!wi#z!wir!wi~P)VO$c&YO~On#sa#z#sar#sa~P!jOn#ZO#z$bir$bi~O!a&]Og$aX~P&^Og&_O~Oy$aOQ#kXg#kXh#kXp#kXs#kXu#kXw#kX}#kX!a#kX!d#kX#|#kX#}#kX$]#kX~O!a&aOg$YX~P)VOg&cO~Oo&dOy$aO!p&eO~OR#yOu#yOw#yO$O&gO$]!pO~O!U#|OS#yac#yad#yah#yan#yas#ya!Y#ya!]#ya!a#ya$O#ya~Oc!SXg!QX!U!QX!a!QX~O!U#|O!a&iOg$`X~Oc&kO~Og&lO~O#|&mO~On&oO~Oc&pO!U#|O~Og&rOn&qO~Og&uO~O!U#|Os#ua!a#uan#ua~OP$`OsvX!avXgvX~O$]%zOs#]X!a#]X~Os!RO!a&wO~Or&{O#|%{O$]%zO~Oy$aOQ#rXh#rXn#rXp#rXs#rXu#rXw#rX}#rX!a#rX!d#rX#z#rX#|#rX#}#rX$]#rX$d#rXr#rX~O!a&VO$d$zOn!wq#z!wqr!wq~P)VOo'QOy$aO!p'RO~Og#pX!a#pX~P'oO!a&]Og$aa~Og#oX!a#oX~P)VO!a&aOg$Ya~Oo'QO~Og'WO~P)VOg'XO!W'YO~O$O%fOg#nX!a#nX~P/PO!a&iOg$`a~O`'_Og'aO~OS#mac#mad#mah#ma!Y#ma!]#ma$O#ma~Og'cO~PMcOg'cOn'dO~Oy$aOQ#rah#ran#rap#ras#rau#raw#ra}#ra!a#ra!d#ra#z#ra#|#ra#}#ra$]#ra$d#rar#ra~Oo'iO~Og#pa!a#pa~P&^Og#oa!a#oa~P)VOR#yOu#yOw#yO$O&gO$]%zO~O!U#|Og#na!a#na~Oc'kO~O!a&iOg$`i~P)VO`'_Og'oO~Oy$aOg!Pin!Pi~Og'pO~PMcOn'qO~Og'rO~O!a&iOg$`q~Og#nq!a#nq~P)VO$Q!e$R$]`$]y!u~",goto:"4h$fPPPPP$gP$jP$s%V$s%i%{P$sP&R$sPP&XPPP&_&i&iPPPPP&iPP&iP'VP&iP&i(Q&iP(n(q(w(w)Z(wP(wP(wP(w(wP)j(w)vP(w)yPP*m*s$s*y$s+P+P+V+ZPP$sP$s$sP+a,],j,q$jP,zP,}P$jP$jP$jP-T$jP-W-Z-^-e$jP$jPP$jP-j$jP-m-s.S.j.x/O/Y/`/f/l/r/|0S0Y0`0f0lPPPPPPPPPPP0r0{P1q1t2vP3O3x4R4U4XPP4_RrQ_aOPco!R#Z$}q_OP]^co|}!O!P!R#R#Z#o$}&]qSOP]^co|}!O!P!R#R#Z#o$}&]qUOP]^co|}!O!P!R#R#Z#o$}&]QtTR#auQwWR#bxQ!VYR#cyQ#c!XS$f!s!tR%S#e!V!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k's!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sU#y!c%`'YU%}$p&P&wR&v%|!V!sdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sR$h!uQ%s$gR&s%tq!h`ei!c!d!e!q#|#}$O$R$e$g$j%t&iQ#w!cQ%h$RQ&h%`Q'[&iR'j'YQ#UjQ$U!jQ$t#TR&T$vR$S!f!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sQ!|gR$o!}Q!WYR#dyQ#c!WR%S#dQ!ZZR#fzQ!_[R#g{T!^[{Q#r!]R%]#sQ!SXQ!i`Q#SjQ#m!QQ$P!dQ$l!yQ$r#QQ$u#UQ$x#XQ%e$OQ&S$tQ&y&OQ&|&TR'h&xSnP!RQ#]oQ$|#ZR&Z$}ZmPo!R#Z$}Q${#YQ&X$yR'P&WR$e!qQ&n%oR'm'_R!}gR#PhR$q#PS&O$p&PR'f&wV%|$p&P&wR#XkQ#_qR%Q#_QcOSoP!RU!kco$}R$}#ZQ%Z#pY&`%Z&f'U'^'sQ&f%_Q'U&aQ'^&kR's'kQ$Y!mQ$[!nQ$^!oV%j$Y$[$^Q%t$gR&t%tQ&j%gS']&j'lR'l'^Q&b%ZR'V&bQ&^%WR'T&^Q!QXR#l!QQ&W$yR'O&WQ#[nS%O#[%PR%P#]Q'`&nR'n'`Q$k!xR%x$kQ&P$pR&z&PQ&x&OR'g&xQ#WkR$w#WQ$O!dR%d$O_bOPco!R#Z$}^XOPco!R#Z$}Q!`]Q!a^Q#h|Q#i}Q#j!OQ#k!PQ$s#RQ%W#oR'S&]R%[#pQ!qdQ!zf[$V!m!n!o$Y$[$^Q$y#Yd%Y#p%Z%_&a&f&k'U'^'k'sQ%^#uQ%n$aS&U$y&WQ&[%UQ&}&VR'b&p]$X!m!n!o$Y$[$^Q!d`U!xe!q$eQ#QiQ#x!cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:`⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles`,maxTerm:159,nodeProps:[[`isolate`,-2,5,39,``],[`openedBy`,23,`(`,31,`[`,34,`{`],[`closedBy`,24,`)`,32,`]`,35,`}`]],propSources:[RG],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!e`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$Q~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$Q~!e`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$dYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!e`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!e`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!e`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!e`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!e`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!e`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!e`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!e`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!oS!e`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW!uQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!e`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!e`$]YOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!e`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!e`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!e`$]YOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!e`$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!aYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~<cTyWOy%jz{<r{;'S%j;'S;=`%{<%lO%j~<yS!e`$R~Oy%jz;'S%j;'S;=`%{<%lO%jj=[[$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj>VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!e`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!e`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!oSOy%jz;'S%j;'S;=`%{<%lO%jj@uV!rQ!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!rQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!e`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!e`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!pWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!pWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!e`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!e`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!e`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[IG,LG,PG,FG,1,2,3,4,new PU(`m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~`,28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:e=>zG[e]||-1},{term:138,get:e=>BG[e]||-1},{term:4,get:e=>VG[e]||-1},{term:28,get:e=>HG[e]||-1},{term:136,get:e=>UG[e]||-1}],tokenPrec:2256}),GG=null;function KG(){if(!GG&&typeof document==`object`&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)r!=`cssText`&&r!=`cssFloat`&&typeof e[r]==`string`&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));GG=t.sort().map(e=>({type:`property`,label:e,apply:e+`: `}))}return GG||[]}var qG=`active.after.any-link.autofill.backdrop.before.checked.cue.default.defined.disabled.empty.enabled.file-selector-button.first.first-child.first-letter.first-line.first-of-type.focus.focus-visible.focus-within.fullscreen.has.host.host-context.hover.in-range.indeterminate.invalid.is.lang.last-child.last-of-type.left.link.marker.modal.not.nth-child.nth-last-child.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.part.placeholder.placeholder-shown.read-only.read-write.required.right.root.scope.selection.slotted.target.target-text.valid.visited.where`.split(`.`).map(e=>({type:`class`,label:e})),JG=`above.absolute.activeborder.additive.activecaption.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.antialiased.appworkspace.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.blink.block.block-axis.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.bullets.button.button-bevel.buttonface.buttonhighlight.buttonshadow.buttontext.calc.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.contain.content.contents.content-box.context-menu.continuous.copy.counter.counters.cover.crop.cross.crosshair.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic-abegede-gez.ethiopic-halehame-aa-er.ethiopic-halehame-gez.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.graytext.grid.groove.hand.hard-light.help.hidden.hide.higher.highlight.highlighttext.horizontal.hsl.hsla.hue.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.justify.keep-all.landscape.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-hexadecimal.lower-latin.lower-norwegian.lowercase.ltr.luminosity.manipulation.match.matrix.matrix3d.medium.menu.menutext.message-box.middle.min-intrinsic.mix.monospace.move.multiple.multiple_mask_images.multiply.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.opacity.open-quote.optimizeLegibility.optimizeSpeed.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.self-start.self-end.semi-condensed.semi-expanded.separate.serif.show.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.text.text-bottom.text-top.textarea.textfield.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.to.top.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-latin.uppercase.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`).map(e=>({type:`keyword`,label:e})).concat(`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`).map(e=>({type:`constant`,label:e}))),YG=`a.abbr.address.article.aside.b.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.dd.del.details.dfn.dialog.div.dl.dt.em.figcaption.figure.footer.form.header.hgroup.h1.h2.h3.h4.h5.h6.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.meter.nav.ol.output.p.pre.ruby.section.select.small.source.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.tr.u.ul`.split(`.`).map(e=>({type:`type`,label:e})),XG=[`@charset`,`@color-profile`,`@container`,`@counter-style`,`@font-face`,`@font-feature-values`,`@font-palette-values`,`@import`,`@keyframes`,`@layer`,`@media`,`@namespace`,`@page`,`@position-try`,`@property`,`@scope`,`@starting-style`,`@supports`,`@view-transition`].map(e=>({type:`keyword`,label:e})),ZG=/^(\w[\w-]*|-\w[\w-]*|)$/,QG=/^-(-[\w-]*)?$/;function $G(e,t){if((e.name==`(`||e.type.isError)&&(e=e.parent||e),e.name!=`ArgList`)return!1;let n=e.parent?.firstChild;return n?.name==`Callee`?t.sliceString(n.from,n.to)==`var`:!1}var eK=new IR,tK=[`Declaration`];function nK(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function rK(e,t,n){if(t.to-t.from>4096){let r=eK.get(t);if(r)return r;let i=[],a=new Set,o=t.cursor(hR.IncludeAnonymous);if(o.firstChild())do for(let t of rK(e,o.node,n))a.has(t.label)||(a.add(t.label),i.push(t));while(o.nextSibling());return eK.set(t,i),i}else{let r=[],i=new Set;return t.cursor().iterate(t=>{if(n(t)&&t.matchContext(tK)&&t.node.nextSibling?.name==`:`){let n=e.sliceString(t.from,t.to);i.has(n)||(i.add(n),r.push({label:n,type:`variable`}))}}),r}}var iK=(e=>t=>{let{state:n,pos:r}=t,i=jz(n).resolveInner(r,-1),a=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)==`-`;if(i.name==`PropertyName`||(a||i.name==`TagName`)&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:KG(),validFor:ZG};if(i.name==`ValueName`)return{from:i.from,options:JG,validFor:ZG};if(i.name==`PseudoClassName`)return{from:i.from,options:qG,validFor:ZG};if(e(i)||(t.explicit||a)&&$G(i,n.doc))return{from:e(i)||a?i.from:r,options:rK(n.doc,nK(i),e),validFor:QG};if(i.name==`TagName`){for(let{parent:e}=i;e;e=e.parent)if(e.name==`Block`)return{from:i.from,options:KG(),validFor:ZG};return{from:i.from,options:YG,validFor:ZG}}if(i.name==`AtKeyword`)return{from:i.from,options:XG,validFor:ZG};if(!t.explicit)return null;let o=i.resolve(r),s=o.childBefore(r);return s&&s.name==`:`&&o.name==`PseudoClassSelector`?{from:r,options:qG,validFor:ZG}:s&&s.name==`:`&&o.name==`Declaration`||o.name==`ArgList`?{from:r,options:JG,validFor:ZG}:o.name==`Block`||o.name==`Styles`?{from:r,options:KG(),validFor:ZG}:null})(e=>e.name==`VariableName`),aK=Az.define({name:`css`,parser:WG.configure({props:[Yz.add({Declaration:sB()}),lB.add({"Block KeyframeList":uB})]}),languageData:{commentTokens:{block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*\}$/,wordChars:`-`}});function oK(){return new Vz(aK,aK.data.of({autocomplete:iK}))}var sK=316,cK=317,lK=1,uK=2,dK=3,fK=4,pK=318,mK=320,hK=321,gK=5,_K=6,vK=0,yK=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],bK=125,xK=59,SK=47,CK=42,wK=43,TK=45,EK=60,DK=44,OK=63,kK=46,AK=91,jK=new JU({start:!1,shift(e,t){return t==gK||t==_K||t==mK?e:t==hK},strict:!1}),MK=new FU((e,t)=>{let{next:n}=e;(n==bK||n==-1||t.context)&&e.acceptToken(pK)},{contextual:!0,fallback:!0}),NK=new FU((e,t)=>{let{next:n}=e,r;yK.indexOf(n)>-1||n==SK&&((r=e.peek(1))==SK||r==CK)||n!=bK&&n!=xK&&n!=-1&&!t.context&&e.acceptToken(sK)},{contextual:!0}),PK=new FU((e,t)=>{e.next==AK&&!t.context&&e.acceptToken(cK)},{contextual:!0}),FK=new FU((e,t)=>{let{next:n}=e;if(n==wK||n==TK){if(e.advance(),n==e.next){e.advance();let n=!t.context&&t.canShift(lK);e.acceptToken(n?lK:uK)}}else n==OK&&e.peek(1)==kK&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(dK))},{contextual:!0});function IK(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}var LK=new FU((e,t)=>{if(e.next!=EK||!t.dialectEnabled(vK)||(e.advance(),e.next==SK))return;let n=0;for(;yK.indexOf(e.next)>-1;)e.advance(),n++;if(IK(e.next,!0)){for(e.advance(),n++;IK(e.next,!1);)e.advance(),n++;for(;yK.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==DK)return;for(let t=0;;t++){if(t==7){if(!IK(e.next,!0))return;break}if(e.next!=`extends`.charCodeAt(t))break;e.advance(),n++}}e.acceptToken(fK,-n)}),RK=oz({"get set async static":$.modifier,"for while do if else switch try catch finally return throw break continue default case defer":$.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":$.operatorKeyword,"let var const using function class extends":$.definitionKeyword,"import export from":$.moduleKeyword,"with debugger new":$.keyword,TemplateString:$.special($.string),super:$.atom,BooleanLiteral:$.bool,this:$.self,null:$.null,Star:$.modifier,VariableName:$.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":$.function($.variableName),VariableDefinition:$.definition($.variableName),Label:$.labelName,PropertyName:$.propertyName,PrivatePropertyName:$.special($.propertyName),"CallExpression/MemberExpression/PropertyName":$.function($.propertyName),"FunctionDeclaration/VariableDefinition":$.function($.definition($.variableName)),"ClassDeclaration/VariableDefinition":$.definition($.className),"NewExpression/VariableName":$.className,PropertyDefinition:$.definition($.propertyName),PrivatePropertyDefinition:$.definition($.special($.propertyName)),UpdateOp:$.updateOperator,"LineComment Hashbang":$.lineComment,BlockComment:$.blockComment,Number:$.number,String:$.string,Escape:$.escape,ArithOp:$.arithmeticOperator,LogicOp:$.logicOperator,BitOp:$.bitwiseOperator,CompareOp:$.compareOperator,RegExp:$.regexp,Equals:$.definitionOperator,Arrow:$.function($.punctuation),": Spread":$.punctuation,"( )":$.paren,"[ ]":$.squareBracket,"{ }":$.brace,"InterpolationStart InterpolationEnd":$.special($.brace),".":$.derefOperator,", ;":$.separator,"@":$.meta,TypeName:$.typeName,TypeDefinition:$.definition($.typeName),"type enum interface implements namespace module declare":$.definitionKeyword,"abstract global Privacy readonly override":$.modifier,"is keyof unique infer asserts":$.operatorKeyword,JSXAttributeValue:$.attributeValue,JSXText:$.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":$.angleBracket,"JSXIdentifier JSXNameSpacedName":$.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":$.attributeName,"JSXBuiltin/JSXIdentifier":$.standard($.tagName)}),zK={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},BK={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},VK={__proto__:null,"<":193},HK=YU.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-E<j-E<jO9kQ`O,5=_O!$rQ`O,5=_O!$wQlO,5;ZO!&zQMhO'#EkO!(eQ`O,5;ZO!(jQlO'#DyO!(tQpO,5;dO!(|QpO,5;dO%[QlO,5;dOOQ['#FT'#FTOOQ['#FV'#FVO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eOOQ['#FZ'#FZO!)[QlO,5;tOOQ!0Lf,5;y,5;yOOQ!0Lf,5;z,5;zOOQ!0Lf,5;|,5;|O%[QlO'#IpO!+_Q!0LrO,5<iO%[QlO,5;eO!&zQMhO,5;eO!+|QMhO,5;eO!-nQMhO'#E^O%[QlO,5;wOOQ!0Lf,5;{,5;{O!-uQ,UO'#FjO!.rQ,UO'#KXO!.^Q,UO'#KXO!.yQ,UO'#KXOOQO'#KX'#KXO!/_Q,UO,5<SOOOW,5<`,5<`O!/pQlO'#FvOOOW'#Io'#IoO7VO7dO,5<QO!/wQ,UO'#FxOOQ!0Lf,5<Q,5<QO!0hQ$IUO'#CyOOQ!0Lh'#C}'#C}O!0{O#@ItO'#DRO!1iQMjO,5<eO!1pQ`O,5<hO!3YQ(CWO'#GXO!3jQ`O'#GYO!3oQ`O'#GYO!5_Q(CWO'#G^O!6dQpO'#GbOOQO'#Gn'#GnO!,TQMhO'#GmOOQO'#Gp'#GpO!,TQMhO'#GoO!7VQ$IUO'#JlOOQ!0Lh'#Jl'#JlO!7aQ`O'#JkO!7oQ`O'#JjO!7wQ`O'#CuOOQ!0Lh'#C{'#C{O!8YQ`O'#C}OOQ!0Lh'#DV'#DVOOQ!0Lh'#DX'#DXO!8_Q`O,5<eO1SQ`O'#DZO!,TQMhO'#GPO!,TQMhO'#GRO!8gQ`O'#GTO!8lQ`O'#GUO!3oQ`O'#G[O!,TQMhO'#GaO<]Q`O'#JkO!8qQ`O'#EqO!9`Q`O,5<gOOQ!0Lb'#Cr'#CrO!9hQ`O'#ErO!:bQpO'#EsOOQ!0Lb'#KR'#KRO!:iQ!0LrO'#KaO9uQ!0LrO,5=cO`QlO,5>tOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!<hQ!0MxO,5:bO!:]QpO,5:`O!?RQ!0MxO,5:jO%[QlO,5:jO!AiQ!0MxO,5:lOOQO,5@z,5@zO!BYQMhO,5=_O!BhQ!0LrO'#JiO9`Q`O'#JiO!ByQ!0LrO,59ZO!CUQpO,59ZO!C^QMhO,59ZO:dQMhO,59ZO!CiQ`O,5;ZO!CqQ`O'#HbO!DVQ`O'#KdO%[QlO,5;}O!:]QpO,5<PO!D_Q`O,5=zO!DdQ`O,5=zO!DiQ`O,5=zO!DwQ`O,5=zO9uQ!0LrO,5=zO<]Q`O,5=jOOQO'#Cy'#CyO!EOQpO,5=gO!EWQMhO,5=hO!EcQ`O,5=jO!EhQ!bO,5=mO!EpQ`O'#K`O?YQ`O'#HWO9kQ`O'#HYO!EuQ`O'#HYO:dQMhO'#H[O!EzQ`O'#H[OOQ[,5=p,5=pO!FPQ`O'#H]O!FbQ`O'#CoO!FgQ`O,59PO!FqQ`O,59PO!HvQlO,59POOQ[,59P,59PO!IWQ!0LrO,59PO%[QlO,59PO!KcQlO'#HeOOQ['#Hf'#HfOOQ['#Hg'#HgO`QlO,5=}O!KyQ`O,5=}O`QlO,5>TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-E<f-E<fO#)kQ!0MSO,5;RODWQpO,5:rO#)uQpO,5:rODWQpO,5;RO!ByQ!0LrO,5:rOOQ!0Lb'#Ej'#EjOOQO,5;R,5;RO%[QlO,5;RO#*SQ!0LrO,5;RO#*_Q!0LrO,5;RO!CUQpO,5:rOOQO,5;X,5;XO#*mQ!0LrO,5;RPOOO'#I^'#I^P#+RO&2DjO,58|POOO,58|,58|OOOO-E<^-E<^OOQ!0Lh1G.p1G.pOOOO-E<_-E<_OOOO,59},59}O#+^Q!bO,59}OOOO-E<a-E<aOOQ!0Lf1G/g1G/gO#+cQ!fO,5?OO+}QlO,5?OOOQO,5?U,5?UO#+mQlO'#IdOOQO-E<b-E<bO#+zQ`O,5@`O#,SQ!fO,5@`O#,ZQ`O,5@nOOQ!0Lf1G/m1G/mO%[QlO,5@oO#,cQ`O'#IjOOQO-E<h-E<hO#,ZQ`O,5@nOOQ!0Lb1G0x1G0xOOQ!0Ln1G/x1G/xOOQ!0Ln1G0Y1G0YO%[QlO,5@lO#,wQ!0LrO,5@lO#-YQ!0LrO,5@lO#-aQ`O,5@kO9eQ`O,5@kO#-iQ`O,5@kO#-wQ`O'#ImO#-aQ`O,5@kOOQ!0Lb1G0w1G0wO!(tQpO,5:uO!)PQpO,5:uOOQS,5:w,5:wO#.iQdO,5:wO#.qQMhO1G2yO9kQ`O1G2yOOQ!0Lf1G0u1G0uO#/PQ!0MxO1G0uO#0UQ!0MvO,5;VOOQ!0Lh'#GW'#GWO#0rQ!0MzO'#JlO!$wQlO1G0uO#2}Q!fO'#JwO%[QlO'#JwO#3XQ`O,5:eOOQ!0Lh'#D_'#D_OOQ!0Lf1G1O1G1OO%[QlO1G1OOOQ!0Lf1G1f1G1fO#3^Q`O1G1OO#5rQ!0MxO1G1PO#5yQ!0MxO1G1PO#8aQ!0MxO1G1PO#8hQ!0MxO1G1PO#;OQ!0MxO1G1PO#=fQ!0MxO1G1PO#=mQ!0MxO1G1PO#=tQ!0MxO1G1PO#@[Q!0MxO1G1PO#@cQ!0MxO1G1PO#BpQ?MtO'#CiO#DkQ?MtO1G1`O#DrQ?MtO'#JsO#EVQ!0MxO,5?[OOQ!0Lb-E<n-E<nO#GdQ!0MxO1G1PO#HaQ!0MzO1G1POOQ!0Lf1G1P1G1PO#IdQMjO'#J|O#InQ`O,5:xO#IsQ!0MxO1G1cO#JgQ,UO,5<WO#JoQ,UO,5<XO#JwQ,UO'#FoO#K`Q`O'#FnOOQO'#KY'#KYOOQO'#In'#InO#KeQ,UO1G1nOOQ!0Lf1G1n1G1nOOOW1G1y1G1yO#KvQ?MtO'#JrO#LQQ`O,5<bO!)[QlO,5<bOOOW-E<m-E<mOOQ!0Lf1G1l1G1lO#LVQpO'#KXOOQ!0Lf,5<d,5<dO#L_QpO,5<dO#LdQMhO'#DTOOOO'#Ib'#IbO#LkO#@ItO,59mOOQ!0Lh,59m,59mO%[QlO1G2PO!8lQ`O'#IrO#LvQ`O,5<zOOQ!0Lh,5<w,5<wO!,TQMhO'#IuO#MdQMjO,5=XO!,TQMhO'#IwO#NVQMjO,5=ZO!&zQMhO,5=]OOQO1G2S1G2SO#NaQ!dO'#CrO#NtQ(CWO'#ErO$ |QpO'#GbO$!dQ!dO,5<sO$!kQ`O'#K[O9eQ`O'#K[O$!yQ`O,5<uO$#aQ!dO'#C{O!,TQMhO,5<tO$#kQ`O'#GZO$$PQ`O,5<tO$$UQ!dO'#GWO$$cQ!dO'#K]O$$mQ`O'#K]O!&zQMhO'#K]O$$rQ`O,5<xO$$wQlO'#JvO$%RQpO'#GcO#$`QpO'#GcO$%dQ`O'#GgO!3oQ`O'#GkO$%iQ!0LrO'#ItO$%tQpO,5<|OOQ!0Lp,5<|,5<|O$%{QpO'#GcO$&YQpO'#GdO$&kQpO'#GdO$&pQMjO,5=XO$'QQMjO,5=ZOOQ!0Lh,5=^,5=^O!,TQMhO,5@VO!,TQMhO,5@VO$'bQ`O'#IyO$'vQ`O,5@UO$(OQ`O,59aOOQ!0Lh,59i,59iO$(TQ`O,5@VO$)TQ$IYO,59uOOQ!0Lh'#Jp'#JpO$)vQMjO,5<kO$*iQMjO,5<mO@zQ`O,5<oOOQ!0Lh,5<p,5<pO$*sQ`O,5<vO$*xQMjO,5<{O$+YQ`O'#KPO!$wQlO1G2RO$+_Q`O1G2RO9eQ`O'#KSO9eQ`O'#EtO%[QlO'#EtO9eQ`O'#I{O$+dQ!0LrO,5@{OOQ[1G2}1G2}OOQ[1G4`1G4`OOQ!0Lf1G/|1G/|OOQ!0Lf1G/z1G/zO$-fQ!0MxO1G0UOOQ[1G2y1G2yO!&zQMhO1G2yO%[QlO1G2yO#.tQ`O1G2yO$/jQMhO'#EkOOQ!0Lb,5@T,5@TO$/wQ!0LrO,5@TOOQ[1G.u1G.uO!ByQ!0LrO1G.uO!CUQpO1G.uO!C^QMhO1G.uO$0YQ`O1G0uO$0_Q`O'#CiO$0jQ`O'#KeO$0rQ`O,5=|O$0wQ`O'#KeO$0|Q`O'#KeO$1[Q`O'#JRO$1jQ`O,5AOO$1rQ!fO1G1iOOQ!0Lf1G1k1G1kO9kQ`O1G3fO@zQ`O1G3fO$1yQ`O1G3fO$2OQ`O1G3fO!DiQ`O1G3fO9uQ!0LrO1G3fOOQ[1G3f1G3fO!EcQ`O1G3UO!&zQMhO1G3RO$2TQ`O1G3ROOQ[1G3S1G3SO!&zQMhO1G3SO$2YQ`O1G3SO$2bQpO'#HQOOQ[1G3U1G3UO!6_QpO'#I}O!EhQ!bO1G3XOOQ[1G3X1G3XOOQ[,5=r,5=rO$2jQMhO,5=tO9kQ`O,5=tO$%dQ`O,5=vO9`Q`O,5=vO!CUQpO,5=vO!C^QMhO,5=vO:dQMhO,5=vO$2xQ`O'#KcO$3TQ`O,5=wOOQ[1G.k1G.kO$3YQ!0LrO1G.kO@zQ`O1G.kO$3eQ`O1G.kO9uQ!0LrO1G.kO$5mQ!fO,5AQO$5zQ`O,5AQO9eQ`O,5AQO$6VQlO,5>PO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5<iO$BOQ!fO1G4jOOQO1G4p1G4pO%[QlO,5?OO$BYQ`O1G5zO$BbQ`O1G6YO$BjQ!fO1G6ZO9eQ`O,5?UO$BtQ!0MxO1G6WO%[QlO1G6WO$CUQ!0LrO1G6WO$CgQ`O1G6VO$CgQ`O1G6VO9eQ`O1G6VO$CoQ`O,5?XO9eQ`O,5?XOOQO,5?X,5?XO$DTQ`O,5?XO$+YQ`O,5?XOOQO-E<k-E<kOOQS1G0a1G0aOOQS1G0c1G0cO#.lQ`O1G0cOOQ[7+(e7+(eO!&zQMhO7+(eO%[QlO7+(eO$DcQ`O7+(eO$DnQMhO7+(eO$D|Q!0MzO,5=XO$GXQ!0MzO,5=ZO$IdQ!0MzO,5=XO$KuQ!0MzO,5=ZO$NWQ!0MzO,59uO%!]Q!0MzO,5<kO%$hQ!0MzO,5<mO%&sQ!0MzO,5<{OOQ!0Lf7+&a7+&aO%)UQ!0MxO7+&aO%)xQlO'#IfO%*VQ`O,5@cO%*_Q!fO,5@cOOQ!0Lf1G0P1G0PO%*iQ`O7+&jOOQ!0Lf7+&j7+&jO%*nQ?MtO,5:fO%[QlO7+&zO%*xQ?MtO,5:bO%+VQ?MtO,5:jO%+aQ?MtO,5:lO%+kQMhO'#IiO%+uQ`O,5@hOOQ!0Lh1G0d1G0dOOQO1G1r1G1rOOQO1G1s1G1sO%+}Q!jO,5<ZO!)[QlO,5<YOOQO-E<l-E<lOOQ!0Lf7+'Y7+'YOOOW7+'e7+'eOOOW1G1|1G1|O%,YQ`O1G1|OOQ!0Lf1G2O1G2OOOOO,59o,59oO%,_Q!dO,59oOOOO-E<`-E<`OOQ!0Lh1G/X1G/XO%,fQ!0MxO7+'kOOQ!0Lh,5?^,5?^O%-YQMhO1G2fP%-aQ`O'#IrPOQ!0Lh-E<p-E<pO%-}QMjO,5?aOOQ!0Lh-E<s-E<sO%.pQMjO,5?cOOQ!0Lh-E<u-E<uO%.zQ!dO1G2wO%/RQ!dO'#CrO%/iQMhO'#KSO$$wQlO'#JvOOQ!0Lh1G2_1G2_O%/sQ`O'#IqO%0[Q`O,5@vO%0[Q`O,5@vO%0dQ`O,5@vO%0oQ`O,5@vOOQO1G2a1G2aO%0}QMjO1G2`O$+YQ`O'#K[O!,TQMhO1G2`O%1_Q(CWO'#IsO%1lQ`O,5@wO!&zQMhO,5@wO%1tQ!dO,5@wOOQ!0Lh1G2d1G2dO%4UQ!fO'#CiO%4`Q`O,5=POOQ!0Lb,5<},5<}O%4hQpO,5<}OOQ!0Lb,5=O,5=OOCwQ`O,5<}O%4sQpO,5<}OOQ!0Lb,5=R,5=RO$+YQ`O,5=VOOQO,5?`,5?`OOQO-E<r-E<rOOQ!0Lp1G2h1G2hO#$`QpO,5<}O$$wQlO,5=PO%5RQ`O,5=OO%5^QpO,5=OO!,TQMhO'#IuO%6WQMjO1G2sO!,TQMhO'#IwO%6yQMjO1G2uO%7TQMjO1G5qO%7_QMjO1G5qOOQO,5?e,5?eOOQO-E<w-E<wOOQO1G.{1G.{O!,TQMhO1G5qO!,TQMhO1G5qO!:]QpO,59wO%[QlO,59wOOQ!0Lh,5<j,5<jO%7lQ`O1G2ZO!,TQMhO1G2bO%7qQ!0MxO7+'mOOQ!0Lf7+'m7+'mO!$wQlO7+'mO%8eQ`O,5;`OOQ!0Lb,5?g,5?gOOQ!0Lb-E<y-E<yO%8jQ!dO'#K^O#(ZQ`O7+(eO4UQ!fO7+(eO$DfQ`O7+(eO%8tQ!0MvO'#CiO%9XQ!0MvO,5=SO%9lQ`O,5=SO%9tQ`O,5=SOOQ!0Lb1G5o1G5oOOQ[7+$a7+$aO!ByQ!0LrO7+$aO!CUQpO7+$aO!$wQlO7+&aO%9yQ`O'#JQO%:bQ`O,5APOOQO1G3h1G3hO9kQ`O,5APO%:bQ`O,5APO%:jQ`O,5APOOQO,5?m,5?mOOQO-E=P-E=POOQ!0Lf7+'T7+'TO%:oQ`O7+)QO9uQ!0LrO7+)QO9kQ`O7+)QO@zQ`O7+)QO%:tQ`O7+)QOOQ[7+)Q7+)QOOQ[7+(p7+(pO%:yQ!0MvO7+(mO!&zQMhO7+(mO!E^Q`O7+(nOOQ[7+(n7+(nO!&zQMhO7+(nO%;TQ`O'#KbO%;`Q`O,5=lOOQO,5?i,5?iOOQO-E<{-E<{OOQ[7+(s7+(sO%<rQpO'#HZOOQ[1G3`1G3`O!&zQMhO1G3`O%[QlO1G3`O%<yQ`O1G3`O%=UQMhO1G3`O9uQ!0LrO1G3bO$%dQ`O1G3bO9`Q`O1G3bO!CUQpO1G3bO!C^QMhO1G3bO%=dQ`O'#JPO%=xQ`O,5@}O%>QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-E<c-E<cOOQO,5?V,5?VOOQO-E<i-E<iO!CUQpO1G/sOOQO-E<e-E<eOOQ!0Ln1G0]1G0]OOQ!0Lf7+%u7+%uO#(ZQ`O7+%uOOQ!0Lf7+&`7+&`O?YQ`O7+&`O!CUQpO7+&`OOQO7+%x7+%xO$AlQ!0MxO7+&XOOQO7+&X7+&XO%[QlO7+&XO%@nQ!0LrO7+&XO!ByQ!0LrO7+%xO!CUQpO7+%xO%@yQ!0LrO7+&XO%AXQ!0MxO7++rO%[QlO7++rO%AiQ`O7++qO%AiQ`O7++qOOQO1G4s1G4sO9eQ`O1G4sO%AqQ`O1G4sOOQS7+%}7+%}O#(ZQ`O<<LPO4UQ!fO<<LPO%BPQ`O<<LPOOQ[<<LP<<LPO!&zQMhO<<LPO%[QlO<<LPO%BXQ`O<<LPO%BdQ!0MzO,5?aO%DoQ!0MzO,5?cO%FzQ!0MzO1G2`O%I]Q!0MzO1G2sO%KhQ!0MzO1G2uO%MsQ!fO,5?QO%[QlO,5?QOOQO-E<d-E<dO%M}Q`O1G5}OOQ!0Lf<<JU<<JUO%NVQ?MtO1G0uO&!^Q?MtO1G1PO&!eQ?MtO1G1PO&$fQ?MtO1G1PO&$mQ?MtO1G1PO&&nQ?MtO1G1PO&(oQ?MtO1G1PO&(vQ?MtO1G1PO&(}Q?MtO1G1PO&+OQ?MtO1G1PO&+VQ?MtO1G1PO&+^Q!0MxO<<JfO&-UQ?MtO1G1PO&.RQ?MvO1G1PO&/UQ?MvO'#JlO&1[Q?MtO1G1cO&1iQ?MtO1G0UO&1sQMjO,5?TOOQO-E<g-E<gO!)[QlO'#FqOOQO'#KZ'#KZOOQO1G1u1G1uO&1}Q`O1G1tO&2SQ?MtO,5?[OOOW7+'h7+'hOOOO1G/Z1G/ZO&2^Q!dO1G4xOOQ!0Lh7+(Q7+(QP!&zQMhO,5?^O!,TQMhO7+(cO&2eQ`O,5?]O9eQ`O,5?]O$+YQ`O,5?]OOQO-E<o-E<oO&2sQ`O1G6bO&2sQ`O1G6bO&2{Q`O1G6bO&3WQMjO7+'zO&3hQ!dO,5?_O&3rQ`O,5?_O!&zQMhO,5?_OOQO-E<q-E<qO&3wQ!dO1G6cO&4RQ`O1G6cO&4ZQ`O1G2kO!&zQMhO1G2kOOQ!0Lb1G2i1G2iOOQ!0Lb1G2j1G2jO%4hQpO1G2iO!CUQpO1G2iOCwQ`O1G2iOOQ!0Lb1G2q1G2qO&4`QpO1G2iO&4nQ`O1G2kO$+YQ`O1G2jOCwQ`O1G2jO$$wQlO1G2kO&4vQ`O1G2jO&5jQMjO,5?aOOQ!0Lh-E<t-E<tO&6]QMjO,5?cOOQ!0Lh-E<v-E<vO!,TQMhO7++]O&6gQMjO7++]O&6qQMjO7++]OOQ!0Lh1G/c1G/cO&7OQ`O1G/cOOQ!0Lh7+'u7+'uO&7TQMjO7+'|O&7eQ!0MxO<<KXOOQ!0Lf<<KX<<KXO&8XQ`O1G0zO!&zQMhO'#IzO&8^Q`O,5@xO&:`Q!fO<<LPO!&zQMhO1G2nO&:gQ!0LrO1G2nOOQ[<<G{<<G{O!ByQ!0LrO<<G{O&:xQ!0MxO<<I{OOQ!0Lf<<I{<<I{OOQO,5?l,5?lO&;lQ`O,5?lO&;qQ`O,5?lOOQO-E=O-E=OO&<PQ`O1G6kO&<PQ`O1G6kO9kQ`O1G6kO@zQ`O<<LlOOQ[<<Ll<<LlO&<XQ`O<<LlO9uQ!0LrO<<LlO9kQ`O<<LlOOQ[<<LX<<LXO%:yQ!0MvO<<LXOOQ[<<LY<<LYO!E^Q`O<<LYO&<^QpO'#I|O&<iQ`O,5@|O!)[QlO,5@|OOQ[1G3W1G3WOOQO'#JO'#JOO9uQ!0LrO'#JOO&<qQpO,5=uOOQ[,5=u,5=uO&<xQpO'#EgO&=PQpO'#GeO&=UQ`O7+(zO&=ZQ`O7+(zOOQ[7+(z7+(zO!&zQMhO7+(zO%[QlO7+(zO&=cQ`O7+(zOOQ[7+(|7+(|O9uQ!0LrO7+(|O$%dQ`O7+(|O9`Q`O7+(|O!CUQpO7+(|O&=nQ`O,5?kOOQO-E<}-E<}OOQO'#H^'#H^O&=yQ`O1G6iO9uQ!0LrO<<GqOOQ[<<Gq<<GqO@zQ`O<<GqO&>RQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<<Ly<<LyOOQ[<<L{<<L{OOQ[-E=Q-E=QOOQ[1G3z1G3zO&>nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<<Ia<<IaOOQ!0Lf<<Iz<<IzO?YQ`O<<IzOOQO<<Is<<IsO$AlQ!0MxO<<IsO%[QlO<<IsOOQO<<Id<<IdO!ByQ!0LrO<<IdO&?SQ!0LrO<<IsO&?_Q!0MxO<= ^O&?oQ`O<= ]OOQO7+*_7+*_O9eQ`O7+*_OOQ[ANAkANAkO&?wQ!fOANAkO!&zQMhOANAkO#(ZQ`OANAkO4UQ!fOANAkO&@OQ`OANAkO%[QlOANAkO&@WQ!0MzO7+'zO&BiQ!0MzO,5?aO&DtQ!0MzO,5?cO&GPQ!0MzO7+'|O&IbQ!fO1G4lO&IlQ?MtO7+&aO&KpQ?MvO,5=XO&MwQ?MvO,5=ZO&NXQ?MvO,5=XO&NiQ?MvO,5=ZO&NyQ?MvO,59uO'#PQ?MvO,5<kO'%SQ?MvO,5<mO''hQ?MvO,5<{O')^Q?MtO7+'kO')kQ?MtO7+'mO')xQ`O,5<]OOQO7+'`7+'`OOQ!0Lh7+*d7+*dO')}QMjO<<K}OOQO1G4w1G4wO'*UQ`O1G4wO'*aQ`O1G4wO'*oQ`O7++|O'*oQ`O7++|O!&zQMhO1G4yO'*wQ!dO1G4yO'+RQ`O7++}O'+ZQ`O7+(VO'+fQ!dO7+(VOOQ!0Lb7+(T7+(TOOQ!0Lb7+(U7+(UO!CUQpO7+(TOCwQ`O7+(TO'+pQ`O7+(VO!&zQMhO7+(VO$+YQ`O7+(UO'+uQ`O7+(VOCwQ`O7+(UO'+}QMjO<<NwO!,TQMhO<<NwOOQ!0Lh7+$}7+$}O',XQ!dO,5?fOOQO-E<x-E<xO',cQ!0MvO7+(YO!&zQMhO7+(YOOQ[AN=gAN=gO9kQ`O1G5WOOQO1G5W1G5WO',sQ`O1G5WO',xQ`O7+,VO',xQ`O7+,VO9uQ!0LrOANBWO@zQ`OANBWOOQ[ANBWANBWO'-QQ`OANBWOOQ[ANAsANAsOOQ[ANAtANAtO'-VQ`O,5?hOOQO-E<z-E<zO'-bQ?MtO1G6hOOQO,5?j,5?jOOQO-E<|-E<|OOQ[1G3a1G3aO'-lQ`O,5=POOQ[<<Lf<<LfO!&zQMhO<<LfO&=UQ`O<<LfO'-qQ`O<<LfO%[QlO<<LfOOQ[<<Lh<<LhO9uQ!0LrO<<LhO$%dQ`O<<LhO9`Q`O<<LhO'-yQpO1G5VO'.UQ`O7+,TOOQ[AN=]AN=]O9uQ!0LrOAN=]OOQ[<= r<= rOOQ[<= s<= sO'.^Q`O<= rO'.cQ`O<= sOOQ[<<Lq<<LqO'.hQ`O<<LqO'.mQlO<<LqOOQ[1G3{1G3{O?YQ`O7+)lO'.tQ`O<<JQO'/PQ?MtO<<JQOOQO<<Hy<<HyOOQ!0LfAN?fAN?fOOQOAN?_AN?_O$AlQ!0MxOAN?_OOQOAN?OAN?OO%[QlOAN?_OOQO<<My<<MyOOQ[G27VG27VO!&zQMhOG27VO#(ZQ`OG27VO'/ZQ!fOG27VO4UQ!fOG27VO'/bQ`OG27VO'/jQ?MtO<<JfO'/wQ?MvO1G2`O'1mQ?MvO,5?aO'3pQ?MvO,5?cO'5sQ?MvO1G2sO'7vQ?MvO1G2uO'9yQ?MtO<<KXO':WQ?MtO<<I{OOQO1G1w1G1wO!,TQMhOANAiOOQO7+*c7+*cO':eQ`O7+*cO':pQ`O<= hO':xQ!dO7+*eOOQ!0Lb<<Kq<<KqO$+YQ`O<<KqOCwQ`O<<KqO';SQ`O<<KqO!&zQMhO<<KqOOQ!0Lb<<Ko<<KoO!CUQpO<<KoO';_Q!dO<<KqOOQ!0Lb<<Kp<<KpO';iQ`O<<KqO!&zQMhO<<KqO$+YQ`O<<KpO';nQMjOANDcO';xQ!0MvO<<KtOOQO7+*r7+*rO9kQ`O7+*rO'<YQ`O<= qOOQ[G27rG27rO9uQ!0LrOG27rO@zQ`OG27rO!)[QlO1G5SO'<bQ`O7+,SO'<jQ`O1G2kO&=UQ`OANBQOOQ[ANBQANBQO!&zQMhOANBQO'<oQ`OANBQOOQ[ANBSANBSO9uQ!0LrOANBSO$%dQ`OANBSOOQO'#H_'#H_OOQO7+*q7+*qOOQ[G22wG22wOOQ[ANE^ANE^OOQ[ANE_ANE_OOQ[ANB]ANB]O'<wQ`OANB]OOQ[<<MW<<MWO!)[QlOAN?lOOQOG24yG24yO$AlQ!0MxOG24yO#(ZQ`OLD,qOOQ[LD,qLD,qO!&zQMhOLD,qO'<|Q!fOLD,qO'=TQ?MvO7+'zO'>yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<<M}<<M}OOQ!0LbANA]ANA]O$+YQ`OANA]OCwQ`OANA]O'EVQ!dOANA]OOQ!0LbANAZANAZO'E^Q`OANA]O!&zQMhOANA]O'EiQ!dOANA]OOQ!0LbANA[ANA[OOQO<<N^<<N^OOQ[LD-^LD-^O9uQ!0LrOLD-^O'EsQ?MtO7+*nOOQO'#Gf'#GfOOQ[G27lG27lO&=UQ`OG27lO!&zQMhOG27lOOQ[G27nG27nO9uQ!0LrOG27nOOQ[G27wG27wO'E}Q?MtOG25WOOQOLD*eLD*eOOQ[!$(!]!$(!]O#(ZQ`O!$(!]O!&zQMhO!$(!]O'FXQ!0MzOG27TOOQ!0LbG26wG26wO$+YQ`OG26wO'HjQ`OG26wOCwQ`OG26wO'HuQ!dOG26wO!&zQMhOG26wOOQ[!$(!x!$(!xOOQ[LD-WLD-WO&=UQ`OLD-WOOQ[LD-YLD-YOOQ[!)9Ew!)9EwO#(ZQ`O!)9EwOOQ!0LbLD,cLD,cO$+YQ`OLD,cOCwQ`OLD,cO'H|Q`OLD,cO'IXQ!dOLD,cOOQ[!$(!r!$(!rOOQ[!.K;c!.K;cO'I`Q?MvOG27TOOQ!0Lb!$( }!$( }O$+YQ`O!$( }OCwQ`O!$( }O'KUQ`O!$( }OOQ!0Lb!)9Ei!)9EiO$+YQ`O!)9EiOCwQ`O!)9EiOOQ!0Lb!.K;T!.K;TO$+YQ`O!.K;TOOQ!0Lb!4/0o!4/0oO!)[QlO'#DzO1PQ`O'#EXO'KaQ!fO'#JrO'KhQ!L^O'#DvO'KoQlO'#EOO'KvQ!fO'#CiO'N^Q!fO'#CiO!)[QlO'#EQO'NnQlO,5;ZO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO'#IpO(!qQ`O,5<iO!)[QlO,5;eO(!yQMhO,5;eO($dQMhO,5;eO!)[QlO,5;wO!&zQMhO'#GmO(!yQMhO'#GmO!&zQMhO'#GoO(!yQMhO'#GoO1SQ`O'#DZO1SQ`O'#DZO!&zQMhO'#GPO(!yQMhO'#GPO!&zQMhO'#GRO(!yQMhO'#GRO!&zQMhO'#GaO(!yQMhO'#GaO!)[QlO,5:jO($kQpO'#D_O($uQpO'#JvO!)[QlO,5@oO'NnQlO1G0uO(%PQ?MtO'#CiO!)[QlO1G2PO!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO(%ZQ!dO'#CrO!&zQMhO,5<tO(!yQMhO,5<tO'NnQlO1G2RO!)[QlO7+&zO!&zQMhO1G2`O(!yQMhO1G2`O!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO!&zQMhO1G2bO(!yQMhO1G2bO'NnQlO7+'mO'NnQlO7+&aO!&zQMhOANAiO(!yQMhOANAiO(%nQ`O'#EoO(%sQ`O'#EoO(%{Q`O'#F]O(&QQ`O'#EyO(&VQ`O'#KTO(&bQ`O'#KRO(&mQ`O,5;ZO(&rQMjO,5<eO(&yQ`O'#GYO('OQ`O'#GYO('TQ`O,5<eO(']Q`O,5<gO('eQ`O,5;ZO('mQ?MtO1G1`O('tQ`O,5<tO('yQ`O,5<tO((OQ`O,5<vO((TQ`O,5<vO((YQ`O1G2RO((_Q`O1G0uO((dQMjO<<K}O((kQMjO<<K}O((rQMhO'#F|O9`Q`O'#F{OAuQ`O'#EnO!)[QlO,5;tO!3oQ`O'#GYO!3oQ`O'#GYO!3oQ`O'#G[O!3oQ`O'#G[O!,TQMhO7+(cO!,TQMhO7+(cO%.zQ!dO1G2wO%.zQ!dO1G2wO!&zQMhO,5=]O!&zQMhO,5=]",stateData:"()x~O'|OS'}OSTOS(ORQ~OPYOQYOSfOY!VOaqOdzOeyOl!POpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!uwO!xxO!|]O$W|O$niO%h}O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO&W!WO&^!XO&`!YO&b!ZO&d![O&g!]O&m!^O&s!_O&u!`O&w!aO&y!bO&{!cO(TSO(VTO(YUO(aVO(o[O~OWtO~P`OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa!wOs!nO!S!oO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!xO#W!pO#X!pO#[!zO#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O(O!{O~OP]XR]X[]Xa]Xj]Xr]X!Q]X!S]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X'z]X(a]X(r]X(y]X(z]X~O!g%RX~P(qO_!}O(V#PO(W!}O(X#PO~O_#QO(X#PO(Y#PO(Z#QO~Ox#SO!U#TO(b#TO(c#VO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T<ZO(VTO(YUO(aVO(o[O~O![#ZO!]#WO!Y(hP!Y(vP~P+}O!^#cO~P`OPYOQYOSfOd!jOe!iOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(VTO(YUO(aVO(o[O~Op#mO![#iO!|]O#i#lO#j#iO(T<[O!k(sP~P.iO!l#oO(T#nO~O!x#sO!|]O%h#tO~O#k#uO~O!g#vO#k#uO~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!]$_O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa(fX'z(fX'w(fX!k(fX!Y(fX!_(fX%i(fX!g(fX~P1qO#S$dO#`$eO$Q$eOP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX!_(gX%i(gX~Oa(gX'z(gX'w(gX!Y(gX!k(gXv(gX!g(gX~P4UO#`$eO~O$]$hO$_$gO$f$mO~OSfO!_$nO$i$oO$k$qO~Oh%VOj%dOk%dOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T$sO(VTO(YUO(a$uO(y$}O(z%POg(^P~Ol%[O~P7eO!l%eO~O!S%hO!_%iO(T%gO~O!g%mO~Oa%nO'z%nO~O!Q%rO~P%[O(U!lO~P%[O%n%vO~P%[Oh%VO!l%eO(T%gO(U!lO~Oe%}O!l%eO(T%gO~Oj$RO~O!_&PO(T%gO(U!lO(VTO(YUO`)WP~O!Q&SO!l&RO%j&VO&T&WO~P;SO!x#sO~O%s&YO!S)SX!_)SX(T)SX~O(T&ZO~Ol!PO!u&`O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO~Od&eOe&dO!x&bO%h&cO%{&aO~P<bOd&hOeyOl!PO!_&gO!u&`O!xxO!|]O%h}O%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO~Ob&kO#`&nO%j&iO(U!lO~P=gO!l&oO!u&sO~O!l#oO~O!_XO~Oa%nO'x&{O'z%nO~Oa%nO'x'OO'z%nO~Oa%nO'x'QO'z%nO~O'w]X!Y]Xv]X!k]X&[]X!_]X%i]X!g]X~P(qO!b'_O!c'WO!d'WO(U!lO(VTO(YUO~Os'UO!S'TO!['XO(e'SO!^(iP!^(xP~P@nOn'bO!_'`O(T%gO~Oe'gO!l%eO(T%gO~O!Q&SO!l&RO~Os!nO!S!oO!|<VO#T!pO#U!pO#W!pO#X!pO(U!lO(VTO(YUO(e!mO(o!sO~O!b'mO!c'lO!d'lO#V!pO#['nO#]'nO~PBYOa%nOh%VO!g#vO!l%eO'z%nO(r'pO~O!p'tO#`'rO~PChOs!nO!S!oO(VTO(YUO(e!mO(o!sO~O!_XOs(mX!S(mX!b(mX!c(mX!d(mX!|(mX#T(mX#U(mX#V(mX#W(mX#X(mX#[(mX#](mX(U(mX(V(mX(Y(mX(e(mX(o(mX~O!c'lO!d'lO(U!lO~PDWO(P'xO(Q'xO(R'zO~O_!}O(V'|O(W!}O(X'|O~O_#QO(X'|O(Y'|O(Z#QO~Ov(OO~P%[Ox#SO!U#TO(b#TO(c(RO~O![(TO!Y'WX!Y'^X!]'WX!]'^X~P+}O!](VO!Y(hX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!](VO!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~O!Y(hX~PHRO!Y([O~O!Y(uX!](uX!g(uX!k(uX(r(uX~O#`(uX#k#dX!^(uX~PJUO#`(]O!Y(wX!](wX~O!](^O!Y(vX~O!Y(aO~O#`$eO~PJUO!^(bO~P`OR#zO!Q#yO!S#{O!l#xO(aVOP!na[!naj!nar!na!]!na!p!na#R!na#n!na#o!na#p!na#q!na#r!na#s!na#t!na#u!na#v!na#x!na#z!na#{!na(r!na(y!na(z!na~Oa!na'z!na'w!na!Y!na!k!nav!na!_!na%i!na!g!na~PKlO!k(cO~O!g#vO#`(dO(r'pO!](tXa(tX'z(tX~O!k(tX~PNXO!S%hO!_%iO!|]O#i(iO#j(hO(T%gO~O!](jO!k(sX~O!k(lO~O!S%hO!_%iO#j(hO(T%gO~OP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~O!g#vO!k(gX~P! uOR(nO!Q(mO!l#xO#S$dO!|!{a!S!{a~O!x!{a%h!{a!_!{a#i!{a#j!{a(T!{a~P!#vO!x(rO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~O#k(xO~O![(zO!k(kP~P%[O(e(|O(o[O~O!S)OO!l#xO(e(|O(o[O~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S*YO!_*ZO!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op*`O}O(T&ZO~O!l+SO~O(T(vO~Op+WO!S%hO![#iO!_%iO!|]O#i#lO#j#iO(T%gO!k(sP~O!g#vO#k+XO~O!S%hOTX'z)TX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa!ja!]!ja'z!ja'w!ja!Y!ja!k!jav!ja!_!ja%i!ja!g!ja~P!:tOR#zO!Q#yO!S#{O!l#xO(aVOP!ra[!raj!rar!ra!]!ra!p!ra#R!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#v!ra#x!ra#z!ra#{!ra(r!ra(y!ra(z!ra~Oa!ra'z!ra'w!ra!Y!ra!k!rav!ra!_!ra%i!ra!g!ra~P!=[OR#zO!Q#yO!S#{O!l#xO(aVOP!ta[!taj!tar!ta!]!ta!p!ta#R!ta#n!ta#o!ta#p!ta#q!ta#r!ta#s!ta#t!ta#u!ta#v!ta#x!ta#z!ta#{!ta(r!ta(y!ta(z!ta~Oa!ta'z!ta'w!ta!Y!ta!k!tav!ta!_!ta%i!ta!g!ta~P!?rOh%VOn+gO!_'`O%i+fO~O!g+iOa(]X!_(]X'z(]X!](]X~Oa%nO!_XO'z%nO~Oh%VO!l%eO~Oh%VO!l%eO(T%gO~O!g#vO#k(xO~Ob+tO%j+uO(T+qO(VTO(YUO!^)XP~O!]+vO`)WX~O[+zO~O`+{O~O!_&PO(T%gO(U!lO`)WP~O%j,OO~P;SOh%VO#`,SO~Oh%VOn,VO!_$|O~O!_,XO~O!Q,ZO!_XO~O%n%vO~O!x,`O~Oe,eO~Ob,fO(T#nO(VTO(YUO!^)VP~Oe%}O~O%j!QO(T&ZO~P=gO[,kO`,jO~OPYOQYOSfOdzOeyOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!iuO!lZO!oYO!pYO!qYO!svO!xxO!|]O$niO%h}O(VTO(YUO(aVO(o[O~O!_!eO!u!gO$W!kO(T!dO~P!FyO`,jOa%nO'z%nO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa,pOl!OO!uwO%l!OO%m!OO%n!OO~P!IcO!l&oO~O&^,vO~O!_,xO~O&o,zO&q,{OP&laQ&laS&laY&laa&lad&lae&lal&lap&lar&las&lat&laz&la|&la!O&la!S&la!W&la!X&la!_&la!i&la!l&la!o&la!p&la!q&la!s&la!u&la!x&la!|&la$W&la$n&la%h&la%j&la%l&la%m&la%n&la%q&la%s&la%v&la%w&la%y&la&W&la&^&la&`&la&b&la&d&la&g&la&m&la&s&la&u&la&w&la&y&la&{&la'w&la(T&la(V&la(Y&la(a&la(o&la!^&la&e&lab&la&j&la~O(T-QO~Oh!eX!]!RX!^!RX!g!RX!g!eX!l!eX#`!RX~O!]!eX!^!eX~P#!iO!g-VO#`-UOh(jX!]#hX!^#hX!g(jX!l(jX~O!](jX!^(jX~P##[Oh%VO!g-XO!l%eO!]!aX!^!aX~Os!nO!S!oO(VTO(YUO(e!mO~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO#z<gO#{<hO(aVO(r$YO(y#|O(z#}O~O$O.{O~P#BwO#S$dO#`<nO$Q<nO$O(gX!^(gX~P! uOa'da!]'da'z'da'w'da!k'da!Y'dav'da!_'da%i'da!g'da~P!:tO[#mia#mij#mir#mi!]#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO(y#mi(z#mi~P#EyOn>]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]<iO!^(fX~P#BwO!^/ZO~O!g)hO$f({X~O$f/]O~Ov/^O~P!&zOx)yO(b)zO(c/aO~O!S/dO~O(y$}On%aa!Q%aa'y%aa(z%aa!]%aa#`%aa~Og%aa$O%aa~P#L{O(z%POn%ca!Q%ca'y%ca(y%ca!]%ca#`%ca~Og%ca$O%ca~P#MnO!]fX!gfX!kfX!k$zX(rfX~P!0SOp%WOPP~P!1uOr*sO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO~Os<}O!S/nO![+[O!^*pO(e<|O!^(xP~P$ [O!k/oO~P#/sO!]/pO!g#vO(r'pO!k)OX~O!k/uO~OnoX!QoX'yoX(yoX(zoX~O!g#vO!koX~P$#OOp/wO!S%hO![*^O!_%iO(T%gO!k)OP~O#k/xO~O!Y$zX!]$zX!g%RX~P!0SO!]/yO!Y)PX~P#/sO!g/{O~O!Y/}O~OpkO(T0OO~P.iOh%VOr0TO!g#vO!l%eO(r'pO~O!g+iO~Oa%nO!]0XO'z%nO~O!^0ZO~P!5iO!c0[O!d0[O(U!lO~P#$`Os!nO!S0]O(VTO(YUO(e!mO~O#[0_O~Og%aa!]%aa#`%aa$O%aa~P!1WOg%ca!]%ca#`%ca$O%ca~P!1WOj%dOk%dOl%dO(T&ZOg'mX!]'mX~O!]*yOg(^a~Og0hO~On0jO#`0iOg(_a!](_a~OR0kO!Q0kO!S0lO#S$dOn}a'y}a(y}a(z}a!]}a#`}a~Og}a$O}a~P$(cO!Q*OO'y*POn$sa(y$sa(z$sa!]$sa#`$sa~Og$sa$O$sa~P$)_O!Q*OO'y*POn$ua(y$ua(z$ua!]$ua#`$ua~Og$ua$O$ua~P$*QO#k0oO~Og%Ta!]%Ta#`%Ta$O%Ta~P!1WO!g#vO~O#k0rO~O!]+^Oa)Ta'z)Ta~OR#zO!Q#yO!S#{O!l#xO(aVOP!ri[!rij!rir!ri!]!ri!p!ri#R!ri#n!ri#o!ri#p!ri#q!ri#r!ri#s!ri#t!ri#u!ri#v!ri#x!ri#z!ri#{!ri(r!ri(y!ri(z!ri~Oa!ri'z!ri'w!ri!Y!ri!k!riv!ri!_!ri%i!ri!g!ri~P$+oOh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op0{O%]0|O(T0zO~P$.VO!g+iOa(]a!_(]a'z(]a!](]a~O#k1SO~O[]X!]fX!^fX~O!]1TO!^)XX~O!^1VO~O[1WO~Ob1YO(T+qO(VTO(YUO~O!_&PO(T%gO`'uX!]'uX~O!]+vO`)Wa~O!k1]O~P!:tO[1`O~O`1aO~O#`1fO~On1iO!_$|O~O(e(|O!^)UP~Oh%VOn1rO!_1oO%i1qO~O[1|O!]1zO!^)VX~O!^1}O~O`2POa%nO'z%nO~O(T#nO(VTO(YUO~O#S$dO#`$eO$Q$eOP(gXR(gX[(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~Oj2SO&[2TOa(gX~P$3pOj2SO#`$eO&[2TO~Oa2VO~P%[Oa2XO~O&e2[OP&ciQ&ciS&ciY&cia&cid&cie&cil&cip&cir&cis&cit&ciz&ci|&ci!O&ci!S&ci!W&ci!X&ci!_&ci!i&ci!l&ci!o&ci!p&ci!q&ci!s&ci!u&ci!x&ci!|&ci$W&ci$n&ci%h&ci%j&ci%l&ci%m&ci%n&ci%q&ci%s&ci%v&ci%w&ci%y&ci&W&ci&^&ci&`&ci&b&ci&d&ci&g&ci&m&ci&s&ci&u&ci&w&ci&y&ci&{&ci'w&ci(T&ci(V&ci(Y&ci(a&ci(o&ci!^&cib&ci&j&ci~Ob2bO!^2`O&j2aO~P`O!_XO!l2dO~O&q,{OP&liQ&liS&liY&lia&lid&lie&lil&lip&lir&lis&lit&liz&li|&li!O&li!S&li!W&li!X&li!_&li!i&li!l&li!o&li!p&li!q&li!s&li!u&li!x&li!|&li$W&li$n&li%h&li%j&li%l&li%m&li%n&li%q&li%s&li%v&li%w&li%y&li&W&li&^&li&`&li&b&li&d&li&g&li&m&li&s&li&u&li&w&li&y&li&{&li'w&li(T&li(V&li(Y&li(a&li(o&li!^&li&e&lib&li&j&li~O!Y2jO~O!]!aa!^!aa~P#BwOs!nO!S!oO![2pO(e!mO!]'XX!^'XX~P@nO!]-]O!^(ia~O!]'_X!^'_X~P!9|O!]-`O!^(xa~O!^2wO~P'_Oa%nO#`3QO'z%nO~Oa%nO!g#vO#`3QO'z%nO~Oa%nO!g#vO!p3UO#`3QO'z%nO(r'pO~Oa%nO'z%nO~P!:tO!]$_Ov$qa~O!Y'Wi!]'Wi~P!:tO!](VO!Y(hi~O!](^O!Y(vi~O!Y(wi!](wi~P!:tO!](ti!k(tia(ti'z(ti~P!:tO#`3WO!](ti!k(tia(ti'z(ti~O!](jO!k(si~O!S%hO!_%iO!|]O#i3]O#j3[O(T%gO~O!S%hO!_%iO#j3[O(T%gO~On3dO!_'`O%i3cO~Oh%VOn3dO!_'`O%i3cO~O#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aav%aa!_%aa%i%aa!g%aa~P#L{O#k%caP%caR%ca[%caa%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%cav%ca!_%ca%i%ca!g%ca~P#MnO#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!]%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aa#`%aav%aa!_%aa%i%aa!g%aa~P#/sO#k%caP%caR%ca[%caa%caj%car%ca!S%ca!]%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%ca#`%cav%ca!_%ca%i%ca!g%ca~P#/sO#k}aP}a[}aa}aj}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a'z}a(a}a(r}a!k}a!Y}a'w}av}a!_}a%i}a!g}a~P$(cO#k$saP$saR$sa[$saa$saj$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa'z$sa(a$sa(r$sa!k$sa!Y$sa'w$sav$sa!_$sa%i$sa!g$sa~P$)_O#k$uaP$uaR$ua[$uaa$uaj$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua'z$ua(a$ua(r$ua!k$ua!Y$ua'w$uav$ua!_$ua%i$ua!g$ua~P$*QO#k%TaP%TaR%Ta[%Taa%Taj%Tar%Ta!S%Ta!]%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta'z%Ta(a%Ta(r%Ta!k%Ta!Y%Ta'w%Ta#`%Tav%Ta!_%Ta%i%Ta!g%Ta~P#/sOa#cq!]#cq'z#cq'w#cq!Y#cq!k#cqv#cq!_#cq%i#cq!g#cq~P!:tO![3lO!]'YX!k'YX~P%[O!].tO!k(ka~O!].tO!k(ka~P!:tO!Y3oO~O$O!na!^!na~PKlO$O!ja!]!ja!^!ja~P#BwO$O!ra!^!ra~P!=[O$O!ta!^!ta~P!?rOg']X!]']X~P!,TO!]/POg(pa~OSfO!_4TO$d4UO~O!^4YO~Ov4ZO~P#/sOa$mq!]$mq'z$mq'w$mq!Y$mq!k$mqv$mq!_$mq%i$mq!g$mq~P!:tO!Y4]O~P!&zO!S4^O~O!Q*OO'y*PO(z%POn'ia(y'ia!]'ia#`'ia~Og'ia$O'ia~P%-fO!Q*OO'y*POn'ka(y'ka(z'ka!]'ka#`'ka~Og'ka$O'ka~P%.XO(r$YO~P#/sO!YfX!Y$zX!]fX!]$zX!g%RX#`fX~P!0SOp%WO(T=WO~P!1uOp4bO!S%hO![4aO!_%iO(T%gO!]'eX!k'eX~O!]/pO!k)Oa~O!]/pO!g#vO!k)Oa~O!]/pO!g#vO(r'pO!k)Oa~Og$|i!]$|i#`$|i$O$|i~P!1WO![4jO!Y'gX!]'gX~P!3tO!]/yO!Y)Pa~O!]/yO!Y)Pa~P#/sOP]XR]X[]Xj]Xr]X!Q]X!S]X!Y]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~Oj%YX!g%YX~P%2OOj4oO!g#vO~Oh%VO!g#vO!l%eO~Oh%VOr4tO!l%eO(r'pO~Or4yO!g#vO(r'pO~Os!nO!S4zO(VTO(YUO(e!mO~O(y$}On%ai!Q%ai'y%ai(z%ai!]%ai#`%ai~Og%ai$O%ai~P%5oO(z%POn%ci!Q%ci'y%ci(y%ci!]%ci#`%ci~Og%ci$O%ci~P%6bOg(_i!](_i~P!1WO#`5QOg(_i!](_i~P!1WO!k5VO~Oa$oq!]$oq'z$oq'w$oq!Y$oq!k$oqv$oq!_$oq%i$oq!g$oq~P!:tO!Y5ZO~O!]5[O!_)QX~P#/sOa$zX!_$zX%^]X'z$zX!]$zX~P!0SO%^5_OaoX!_oX'zoX!]oX~P$#OOp5`O(T#nO~O%^5_O~Ob5fO%j5gO(T+qO(VTO(YUO!]'tX!^'tX~O!]1TO!^)Xa~O[5kO~O`5lO~O[5pO~Oa%nO'z%nO~P#/sO!]5uO#`5wO!^)UX~O!^5xO~Or6OOs!nO!S*iO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!pO#W!pO#X!pO#[5}O#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O!^5|O~P%;eOn6TO!_1oO%i6SO~Oh%VOn6TO!_1oO%i6SO~Ob6[O(T#nO(VTO(YUO!]'sX!^'sX~O!]1zO!^)Va~O(VTO(YUO(e6^O~O`6bO~Oj6eO&[6fO~PNXO!k6gO~P%[Oa6iO~Oa6iO~P%[Ob2bO!^6nO&j2aO~P`O!g6pO~O!g6rOh(ji!](ji!^(ji!g(ji!l(jir(ji(r(ji~O!]#hi!^#hi~P#BwO#`6sO!]#hi!^#hi~O!]!ai!^!ai~P#BwOa%nO#`6|O'z%nO~Oa%nO!g#vO#`6|O'z%nO~O!](tq!k(tqa(tq'z(tq~P!:tO!](jO!k(sq~O!S%hO!_%iO#j7TO(T%gO~O!_'`O%i7WO~On7[O!_'`O%i7WO~O#k'iaP'iaR'ia['iaa'iaj'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia'z'ia(a'ia(r'ia!k'ia!Y'ia'w'iav'ia!_'ia%i'ia!g'ia~P%-fO#k'kaP'kaR'ka['kaa'kaj'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka'z'ka(a'ka(r'ka!k'ka!Y'ka'w'kav'ka!_'ka%i'ka!g'ka~P%.XO#k$|iP$|iR$|i[$|ia$|ij$|ir$|i!S$|i!]$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i'z$|i(a$|i(r$|i!k$|i!Y$|i'w$|i#`$|iv$|i!_$|i%i$|i!g$|i~P#/sO#k%aiP%aiR%ai[%aia%aij%air%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai'z%ai(a%ai(r%ai!k%ai!Y%ai'w%aiv%ai!_%ai%i%ai!g%ai~P%5oO#k%ciP%ciR%ci[%cia%cij%cir%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci'z%ci(a%ci(r%ci!k%ci!Y%ci'w%civ%ci!_%ci%i%ci!g%ci~P%6bO!]'Ya!k'Ya~P!:tO!].tO!k(ki~O$O#ci!]#ci!^#ci~P#BwOP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mij#mir#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#n#mi~P%NdO#n<_O~P%NdOP$[OR#zOr<kO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO[#mij#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#r#mi~P&!lO#r<aO~P&!lOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO(aVO#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#v#mi~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO(aVO(z#}O#z#mi#{#mi$O#mi(r#mi(y#mi!]#mi!^#mi~O#x<eO~P&&uO#x#mi~P&&uO#v<cO~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO(aVO(y#|O(z#}O#{#mi$O#mi(r#mi!]#mi!^#mi~O#z#mi~P&)UO#z<gO~P&)UOa#|y!]#|y'z#|y'w#|y!Y#|y!k#|yv#|y!_#|y%i#|y!g#|y~P!:tO[#mij#mir#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi!]#mi!^#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO(y#mi(z#mi~P&,QOn>^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOr<QO!g#vO(r'pO~Ov(fX~P1qO!Q%rO~P!)[O(U!lO~P!)[O!YfX!]fX#`fX~P%2OOP]XR]X[]Xj]Xr]X!Q]X!S]X!]]X!]fX!l]X!p]X#R]X#S]X#`]X#`fX#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~O!gfX!k]X!kfX(rfX~P'LTOP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_XO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]<iO!^$qa~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<tO!S${O!_$|O!i>WO!l$xO#j<zO$W%`O$t<vO$v<xO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Ol)dO~P(!yOr!eX(r!eX~P#!iOr(jX(r(jX~P##[O!^]X!^fX~P'LTO!YfX!Y$zX!]fX!]$zX#`fX~P!0SO#k<^O~O!g#vO#k<^O~O#`<nO~Oj<bO~O#`=OO!](wX!^(wX~O#`<nO!](uX!^(uX~O#k=PO~Og=RO~P!1WO#k=XO~O#k=YO~Og=RO(T&ZO~O!g#vO#k=ZO~O!g#vO#k=PO~O$O=[O~P#BwO#k=]O~O#k=^O~O#k=cO~O#k=dO~O#k=eO~O#k=fO~O$O=gO~P!1WO$O=hO~P!1WOl=sO~P7eOk#S#T#U#W#X#[#i#j#u$n$t$v$y%]%^%h%i%j%q%s%v%w%y%{~(OT#o!X'|(U#ps#n#qr!Q'}$]'}(T$_(e~",goto:"$9Y)]PPPPPP)^PP)aP)rP+W/]PPPP6mPP7TPP=QPPP@tPA^PA^PPPA^PCfPA^PA^PA^PCjPCoPD^PIWPPPI[PPPPI[L_PPPLeMVPI[PI[PP! eI[PPPI[PI[P!#lI[P!'S!(X!(bP!)U!)Y!)U!,gPPPPPPP!-W!(XPP!-h!/YP!2iI[I[!2n!5z!:h!:h!>gPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#<e#<k#<n)aP#<q)aP#<z#<z#<zP)aP)aP)aP)aPP)aP#=Q#=TP#=T)aP#=XP#=[P)aP)aP)aP)aP)aP)a)aPP#=b#=h#=s#=y#>P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{<Y%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_S#q]<V!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU+P%]<s<tQ+t&PQ,f&gQ,m&oQ0x+gQ0}+iQ1Y+uQ2R,kQ3`.gQ5`0|Q5f1TQ6[1zQ7Y3dQ8`5gR9e7['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>R>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o>U<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hW%Ti%V*y>PS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^T)z$u){V+P%]<s<tW'[!e%i*Z-`S(}#y#zQ+c%rQ+y&SS.b(m(nQ1j,XQ5T0kR8i5u'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vS(o#p'iQ)P#zS+b%q.|S.c(n(pR3^.d'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS#q]<VQ&t!XQ&u!YQ&w![Q&x!]R2Z,vQ'a!hQ+e%wQ-h'cS.e(q+hQ2x-gW3b.h.i0w0yQ6w2yW7U3_3a3e5^U9a7V7X7ZU:q9c9d9fS;b:p:sQ;p;cR;x;qU!wQ'`-eT5y1o5{!Q_OXZ`st!V!Z#d#h%e%m&i&k&r&t&u&w(j,s,x.[2[2_]!pQ!r'`-e1o5{T#q]<V%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S(}#y#zS.b(m(n!s=l$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uS<P;|;}R<S<QQ#wbQ's!uS(e#g2US(g#m+WQ+Y%fQ+j%xQ+p&OU-r'k't'wQ.W(fU/r*]*`/wQ0S*jQ0V*lQ1O+kQ1u,aS3R-s-vQ3Z.`S4e/s/tQ4n0PS4q0R0^Q4u0WQ6W1vQ7P3US7q4`4bQ7u4fU7|4r4x4{Q8P4wQ8v6XS9q7r7sQ9u7yQ9}8RQ:O8SQ:c8wQ:y9rS:z9v9xQ;S:QQ;^:dS;f:{;PS;r;g;hS;z;s;uS<O;{;}Q<R<PQ<T<SQ=o=jQ={=tR=|=uV!wQ'`-e%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S#wz!j!r=i$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!P<d)^)q-Z.|2k2n3p3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!f$Vc#Y%q(S(Y(t(y)W)X)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!T<f)^)q-Z.|2k2n3p3v3w3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!^$Zc#Y%q(S(Y(t(y)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<WQ4_/kz>S)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^Q+T%aQ/c*Oo4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!U$yi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n=r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hQ=w>TQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hnoOXst!Z#d%m&r&t&u&w,s,x2[2_S*f${*YQ-R'OQ-S'QR4i/y%[%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f<o#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<p<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!d=S(u)c*[*e.j.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f<q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!h=U(u)c*[*e.k.l.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|<jQ-|<WR<j)qQ/q*]W4c/q4d7t9sU4d/r/s/tS7t4e4fR9s7u$e*Q$v(u)c)e*[*e*t*u+Q+R+V.l.m.o.p.q/_/g/i/k/v/|0d0e0v1e3f3g3h3}4R4[4g4h4l4|5O5R5S5W5r7]7^7_7`7e7f7h7i7j7p7w7z8U8X8Z9h9i9j9t9|:R:S:t:u:v:w:x:};R;e;j;v;y=p=}>O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.l<oQ.m<qQ.o<uQ.p<wQ.q<yQ/_)yQ/g*RQ/i*TQ/k*VQ/v*aS/|*g/mQ0d*wQ0e*xl0v+f,V.f1i1q3c6S7W8q9b:`:r;[;dQ1e,SQ3f=SQ3g=UQ3h=XS3}<l<mQ4R/PS4[/d4^Q4g/xQ4h/yQ4l/{Q4|0`Q5O0bQ5R0iQ5S0jQ5W0oQ5r1fQ7]=]Q7^=_Q7_=aQ7`=cQ7e<pQ7f<rQ7h<vQ7i<xQ7j<zQ7p4_Q7w4jQ7z4oQ8U5QQ8X5[Q8Z5_Q9h=YQ9i=TQ9j=VQ9t7vQ9|8QQ:R8VQ:S8[Q:t=^Q:u=`Q:v=bQ:w=dQ:x9pQ:}9yQ;R:PQ;e=gQ;j;QQ;v;kQ;y=hQ=p>PQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.n<sR7g<tnpOXst!Z#d%m&r&t&u&w,s,x2[2_Q!fPS#fZ#oQ&|!`W'h!o*i0]4zQ(P#SQ)Q#{Q)r$nS,l&k&nQ,q&oQ-O&{S-T'T/nQ-g'bQ.x)OQ/[)sQ0s+]Q0y+gQ2W,pQ2y-iQ3a.gQ4W/VQ5U0lQ6Q1rQ6c2SQ6d2TQ6h2VQ6j2XQ6o2aQ7Z3dQ7m4TQ8s6TQ9P6eQ9Q6fQ9S6iQ9f7[Q:a8tR:k9T#[cOPXZst!Z!`!o#d#o#{%m&k&n&o&r&t&u&w&{'T'b)O*i+]+g,p,s,x-i.g/n0]0l1r2S2T2V2X2[2_2a3d4z6T6e6f6i7[8t9TQ#YWQ#eYQ%quQ%svS%uw!gS(S#W(VQ(Y#ZQ(t#uQ(y#xQ)R$OQ)S$PQ)T$QQ)U$RQ)V$SQ)W$TQ)X$UQ)Y$VQ)Z$WQ)[$XQ)^$ZQ)`$_Q)b$aQ)g$eW)q$n)s/V4TQ+d%tQ+x&RS-Z'X2pQ-x'rS-}(T.PQ.S(]Q.U(dQ.s(xQ.v(zQ.z<UQ.|<XQ.}<YQ/O<]Q/b)}Q0p+XQ2k-UQ2n-XQ3O-qQ3V.VQ3k.tQ3p<^Q3q<_Q3r<`Q3s<aQ3t<bQ3u<cQ3v<dQ3w<eQ3x<fQ3y<gQ3z<hQ3{.{Q3|<kQ4P<nQ4Q<{Q4X<iQ5X0rQ5c1SQ6u=OQ6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:`⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem`,maxTerm:380,context:jK,nodeProps:[[`isolate`,-8,5,6,14,37,39,51,53,55,``],[`group`,-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,`Statement`,-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,`Expression`,-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,`Type`,-3,88,103,109,`ClassItem`],[`openedBy`,23,`<`,38,`InterpolationStart`,56,`[`,60,`{`,73,`(`,160,`JSXStartCloseTag`],[`closedBy`,-2,24,168,`>`,40,`InterpolationEnd`,50,`]`,61,`}`,74,`)`,165,`JSXEndTag`]],propSources:[RK],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$i&j(Wp(Z!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$i&j(Z!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$i&j(o%1l(Wp(Z!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$i&j(Wp(Z!b$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$i&j(Wp(Z!b$]#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$i&j(Wp(Z!b#p(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$i&j$Q(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,#xLva(z+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$i&j#z(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(Y';W$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$i&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$d`$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(WpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$d`(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!l/.^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&U!)O_!k!Lf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z-!n!*[b$i&j(Wp(Z!b(U%&f#q(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$i&j(Wp(Z!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$i&j(Wp(Z!br+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!]+Jf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!/ec$i&j(Wp(Z!b!Q.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_![!L^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!3eg$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$i&j(Wp(Z!b#o(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$i&j(Z!b!X7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$i&j!X7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$i&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$i&j(Wp!X7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$i&j(Wp!X7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Wp!X7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Wp!X7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(WpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$i&j(WpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$i&j(Wp(Z!b!X7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Wp(Z!b!X7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Wp(Z!b!X7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Wp(Z!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$i&j(Wp(Z!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$i&j(Wp(Z!b(O0/l!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$i&j(Wp(Z!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$i&j(Z!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$i&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(Z!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$i&j(WpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(WpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Wp(Z!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$i&j$Q(Ch(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Z#t$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-<U(Wp(Z!b$n7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$k&j(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#r(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$Q(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#s(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#`*!Y$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#k(Cl$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x$%Vag!*r#s(Ch$f#|$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#s(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$'qa#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(r(Ct$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$i&j#{(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!|$Ip$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f$.X_!S0,v$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/]Z$i&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$i&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$i&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$i&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$i&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!Y#)l$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$6U`#x(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$i&j(Wp(Z!b(a+4QOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$8qk$i&j(Wp(Z!b(T,2j$_#t(e$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$i&j(Wp(Z!b$_#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!_#Hb(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(y+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[NK,PK,FK,LK,2,3,4,5,6,7,8,9,10,11,12,13,14,MK,new PU("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new PU(`j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~`,25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>zK[e]||-1},{term:343,get:e=>BK[e]||-1},{term:95,get:e=>VK[e]||-1}],tokenPrec:15201}),UK=[BV("function ${name}(${params}) {\n ${}\n}",{label:`function`,detail:`definition`,type:`keyword`}),BV("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:`for`,detail:`loop`,type:`keyword`}),BV("for (let ${name} of ${collection}) {\n ${}\n}",{label:`for`,detail:`of loop`,type:`keyword`}),BV(`do {
|
|
56
|
-
\${}
|
|
57
|
-
} while (\${})`,{label:`do`,detail:`loop`,type:`keyword`}),BV(`while (\${}) {
|
|
58
|
-
\${}
|
|
59
|
-
}`,{label:`while`,detail:`loop`,type:`keyword`}),BV(`try {
|
|
60
|
-
\${}
|
|
61
|
-
} catch (\${error}) {
|
|
62
|
-
\${}
|
|
63
|
-
}`,{label:`try`,detail:`/ catch block`,type:`keyword`}),BV(`if (\${}) {
|
|
64
|
-
\${}
|
|
65
|
-
}`,{label:`if`,detail:`block`,type:`keyword`}),BV(`if (\${}) {
|
|
66
|
-
\${}
|
|
67
|
-
} else {
|
|
68
|
-
\${}
|
|
69
|
-
}`,{label:`if`,detail:`/ else block`,type:`keyword`}),BV(`class \${name} {
|
|
70
|
-
constructor(\${params}) {
|
|
71
|
-
\${}
|
|
72
|
-
}
|
|
73
|
-
}`,{label:`class`,detail:`definition`,type:`keyword`}),BV('import {${names}} from "${module}"\n${}',{label:`import`,detail:`named`,type:`keyword`}),BV('import ${name} from "${module}"\n${}',{label:`import`,detail:`default`,type:`keyword`})],WK=UK.concat([BV(`interface \${name} {
|
|
74
|
-
\${}
|
|
75
|
-
}`,{label:`interface`,detail:`definition`,type:`keyword`}),BV("type ${name} = ${type}",{label:`type`,detail:`definition`,type:`keyword`}),BV(`enum \${name} {
|
|
76
|
-
\${}
|
|
77
|
-
}`,{label:`enum`,detail:`definition`,type:`keyword`})]),GK=new IR,KK=new Set([`Script`,`Block`,`FunctionExpression`,`FunctionDeclaration`,`ArrowFunction`,`MethodDeclaration`,`ForStatement`]);function qK(e){return(t,n)=>{let r=t.node.getChild(`VariableDefinition`);return r&&n(r,e),!0}}var JK=[`FunctionDeclaration`],YK={FunctionDeclaration:qK(`function`),ClassDeclaration:qK(`class`),ClassExpression:()=>!0,EnumDeclaration:qK(`constant`),TypeAliasDeclaration:qK(`type`),NamespaceDeclaration:qK(`namespace`),VariableDefinition(e,t){e.matchContext(JK)||t(e,`variable`)},TypeDefinition(e,t){t(e,`type`)},__proto__:null};function XK(e,t){let n=GK.get(t);if(n)return n;let r=[],i=!0;function a(t,n){let i=e.sliceString(t.from,t.to);r.push({label:i,type:n})}return t.cursor(hR.IncludeAnonymous).iterate(t=>{if(i)i=!1;else if(t.name){let e=YK[t.name];if(e&&e(t,a)||KK.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of XK(e,t.node))r.push(n);return!1}}),GK.set(t,r),r}var ZK=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,QK=[`TemplateString`,`String`,`RegExp`,`LineComment`,`BlockComment`,`VariableDefinition`,`TypeDefinition`,`Label`,`PropertyDefinition`,`PropertyName`,`PrivatePropertyDefinition`,`PrivatePropertyName`,`JSXText`,`JSXAttributeValue`,`JSXOpenTag`,`JSXCloseTag`,`JSXSelfClosingTag`,`.`,`?.`];function $K(e){let t=jz(e.state).resolveInner(e.pos,-1);if(QK.indexOf(t.name)>-1)return null;let n=t.name==`VariableName`||t.to-t.from<20&&ZK.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let n=t;n;n=n.parent)KK.has(n.name)&&(r=r.concat(XK(e.state.doc,n)));return{options:r,from:n?t.from:e.pos,validFor:ZK}}var eq=Az.define({name:`javascript`,parser:HK.configure({props:[Yz.add({IfStatement:sB({except:/^\s*({|else\b)/}),TryStatement:sB({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:oB,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:iB({closing:`}`}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":sB({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),lB.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":uB,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name==`JSXSelfClosingTag`)return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){let t=e.firstChild?.nextSibling,n=e.lastChild;return!t||t.type.isError?null:{from:t.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]},commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:`$`}}),tq={test:e=>/^JSX/.test(e.name),facet:Ez({commentTokens:{block:{open:`{/*`,close:`*/}`}}})},nq=eq.configure({dialect:`ts`},`typescript`),rq=eq.configure({dialect:`jsx`,props:[Dz.add(e=>e.isTop?[tq]:void 0)]}),iq=eq.configure({dialect:`jsx ts`,props:[Dz.add(e=>e.isTop?[tq]:void 0)]},`typescript`),aq=e=>({label:e,type:`keyword`}),oq=`break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield`.split(` `).map(aq),sq=oq.concat([`declare`,`implements`,`private`,`protected`,`public`].map(aq));function cq(e={}){let t=e.jsx?e.typescript?iq:rq:e.typescript?nq:eq,n=e.typescript?WK.concat(sq):UK.concat(oq);return new Vz(t,[eq.data.of({autocomplete:AB(QK,kB(n))}),eq.data.of({autocomplete:$K}),e.jsx?fq:[]])}function lq(e){for(;;){if(e.name==`JSXOpenTag`||e.name==`JSXSelfClosingTag`||e.name==`JSXFragmentTag`)return e;if(e.name==`JSXEscape`||!e.parent)return null;e=e.parent}}function uq(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name==`JSXIdentifier`||r.name==`JSXBuiltin`||r.name==`JSXNamespacedName`||r.name==`JSXMemberExpression`)return e.sliceString(r.from,Math.min(r.to,n));return``}var dq=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),fq=OL.inputHandler.of((e,t,n,r,i)=>{if((dq?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!eq.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let{head:t}=e,n=jz(o).resolveInner(t-1,-1),i;if(n.name==`JSXStartTag`&&(n=n.parent),!(o.doc.sliceString(t-1,t)!=r||n.name==`JSXAttributeValue`&&n.to>t)){if(r==`>`&&n.name==`JSXFragmentTag`)return{range:e,changes:{from:t,insert:`</>`}};if(r==`/`&&n.name==`JSXStartCloseTag`){let e=n.parent,r=e.parent;if(r&&e.from==t-2&&((i=uq(o.doc,r.firstChild,t))||r.firstChild?.name==`JSXFragmentTag`)){let e=`${i}>`;return{range:ij.cursor(t+e.length,-1),changes:{from:t,insert:e}}}}else if(r==`>`){let r=lq(n);if(r&&r.name==`JSXOpenTag`&&!/^\/?>|^<\//.test(o.doc.sliceString(t,t+2))&&(i=uq(o.doc,r,t)))return{range:e,changes:{from:t,insert:`</${i}>`}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),pq=[`_blank`,`_self`,`_top`,`_parent`],mq=[`ascii`,`utf-8`,`utf-16`,`latin1`,`latin1`],hq=[`get`,`post`,`put`,`delete`],gq=[`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`],_q=[`true`,`false`],vq={},yq={a:{attrs:{href:null,ping:null,type:null,media:null,target:pq,hreflang:null}},abbr:vq,address:vq,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[`default`,`rect`,`circle`,`poly`]}},article:vq,aside:vq,audio:{attrs:{src:null,mediagroup:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`none`,`metadata`,`auto`],autoplay:[`autoplay`],loop:[`loop`],controls:[`controls`]}},b:vq,base:{attrs:{href:null,target:pq}},bdi:vq,bdo:vq,blockquote:{attrs:{cite:null}},body:vq,br:vq,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[`autofocus`],disabled:[`autofocus`],formenctype:gq,formmethod:hq,formnovalidate:[`novalidate`],formtarget:pq,type:[`submit`,`reset`,`button`]}},canvas:{attrs:{width:null,height:null}},caption:vq,center:vq,cite:vq,code:vq,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[`command`,`checkbox`,`radio`],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[`disabled`],checked:[`checked`]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[`disabled`],multiple:[`multiple`]}},datalist:{attrs:{data:null}},dd:vq,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[`open`]}},dfn:vq,div:vq,dl:vq,dt:vq,em:vq,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[`disabled`],form:null,name:null}},figcaption:vq,figure:vq,footer:vq,form:{attrs:{action:null,name:null,"accept-charset":mq,autocomplete:[`on`,`off`],enctype:gq,method:hq,novalidate:[`novalidate`],target:pq}},h1:vq,h2:vq,h3:vq,h4:vq,h5:vq,h6:vq,head:{children:[`title`,`base`,`link`,`style`,`meta`,`script`,`noscript`,`command`]},header:vq,hgroup:vq,hr:vq,html:{attrs:{manifest:null}},i:vq,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[`allow-top-navigation`,`allow-same-origin`,`allow-forms`,`allow-scripts`],seamless:[`seamless`]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[`audio/*`,`video/*`,`image/*`],autocomplete:[`on`,`off`],autofocus:[`autofocus`],checked:[`checked`],disabled:[`disabled`],formenctype:gq,formmethod:hq,formnovalidate:[`novalidate`],formtarget:pq,multiple:[`multiple`],readonly:[`readonly`],required:[`required`],type:[`hidden`,`text`,`search`,`tel`,`url`,`email`,`password`,`datetime`,`date`,`month`,`week`,`time`,`datetime-local`,`number`,`range`,`color`,`checkbox`,`radio`,`file`,`submit`,`image`,`reset`,`button`]}},ins:{attrs:{cite:null,datetime:null}},kbd:vq,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[`autofocus`],disabled:[`disabled`],keytype:[`RSA`]}},label:{attrs:{for:null,form:null}},legend:vq,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:[`all`,`16x16`,`16x16 32x32`,`16x16 32x32 64x64`]}},map:{attrs:{name:null}},mark:vq,menu:{attrs:{label:null,type:[`list`,`context`,`toolbar`]}},meta:{attrs:{content:null,charset:mq,name:[`viewport`,`application-name`,`author`,`description`,`generator`,`keywords`],"http-equiv":[`content-language`,`content-type`,`default-style`,`refresh`]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:vq,noscript:vq,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[`typemustmatch`]}},ol:{attrs:{reversed:[`reversed`],start:null,type:[`1`,`a`,`A`,`i`,`I`]},children:[`li`,`script`,`template`,`ul`,`ol`]},optgroup:{attrs:{disabled:[`disabled`],label:null}},option:{attrs:{disabled:[`disabled`],label:null,selected:[`selected`],value:null}},output:{attrs:{for:null,form:null,name:null}},p:vq,param:{attrs:{name:null,value:null}},pre:vq,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:vq,rt:vq,ruby:vq,samp:vq,script:{attrs:{type:[`text/javascript`],src:null,async:[`async`],defer:[`defer`],charset:mq}},section:vq,select:{attrs:{form:null,name:null,size:null,autofocus:[`autofocus`],disabled:[`disabled`],multiple:[`multiple`]}},slot:{attrs:{name:null}},small:vq,source:{attrs:{src:null,type:null,media:null}},span:vq,strong:vq,style:{attrs:{type:[`text/css`],media:null,scoped:null}},sub:vq,summary:vq,sup:vq,table:vq,tbody:vq,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:vq,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[`autofocus`],disabled:[`disabled`],readonly:[`readonly`],required:[`required`],wrap:[`soft`,`hard`]}},tfoot:vq,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[`row`,`col`,`rowgroup`,`colgroup`]}},thead:vq,time:{attrs:{datetime:null}},title:vq,tr:vq,track:{attrs:{src:null,label:null,default:null,kind:[`subtitles`,`captions`,`descriptions`,`chapters`,`metadata`],srclang:null}},ul:{children:[`li`,`script`,`template`,`ul`,`ol`]},var:vq,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`auto`,`metadata`,`none`],autoplay:[`autoplay`],mediagroup:[`movie`],muted:[`muted`],controls:[`controls`]}},wbr:vq},bq={accesskey:null,class:null,contenteditable:_q,contextmenu:null,dir:[`ltr`,`rtl`,`auto`],draggable:[`true`,`false`,`auto`],dropzone:[`copy`,`move`,`link`,`string:`,`file:`],hidden:[`hidden`],id:null,inert:[`inert`],itemid:null,itemprop:null,itemref:null,itemscope:[`itemscope`],itemtype:null,lang:[`ar`,`bn`,`de`,`en-GB`,`en-US`,`es`,`fr`,`hi`,`id`,`ja`,`pa`,`pt`,`ru`,`tr`,`zh`],spellcheck:_q,autocorrect:_q,autocapitalize:_q,style:null,tabindex:null,title:null,translate:[`yes`,`no`],rel:[`stylesheet`,`alternate`,`author`,`bookmark`,`help`,`license`,`next`,`nofollow`,`noreferrer`,`prefetch`,`prev`,`search`,`tag`],role:`alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer`.split(` `),"aria-activedescendant":null,"aria-atomic":_q,"aria-autocomplete":[`inline`,`list`,`both`,`none`],"aria-busy":_q,"aria-checked":[`true`,`false`,`mixed`,`undefined`],"aria-controls":null,"aria-describedby":null,"aria-disabled":_q,"aria-dropeffect":null,"aria-expanded":[`true`,`false`,`undefined`],"aria-flowto":null,"aria-grabbed":[`true`,`false`,`undefined`],"aria-haspopup":_q,"aria-hidden":_q,"aria-invalid":[`true`,`false`,`grammar`,`spelling`],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":[`off`,`polite`,`assertive`],"aria-multiline":_q,"aria-multiselectable":_q,"aria-owns":null,"aria-posinset":null,"aria-pressed":[`true`,`false`,`mixed`,`undefined`],"aria-readonly":_q,"aria-relevant":null,"aria-required":_q,"aria-selected":[`true`,`false`,`undefined`],"aria-setsize":null,"aria-sort":[`ascending`,`descending`,`none`,`other`],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},xq=`beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload`.split(` `).map(e=>`on`+e);for(let e of xq)bq[e]=null;var Sq=class{constructor(e,t){this.tags={...yq,...e},this.globalAttrs={...bq,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};Sq.default=new Sq;function Cq(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}function wq(e,t=!1){for(;e;e=e.parent)if(e.name==`Element`)if(t)t=!1;else return e;return null}function Tq(e,t,n){return n.tags[Cq(e,wq(t))]?.children||n.allTags}function Eq(e,t){let n=[];for(let r=wq(t);r&&!r.type.isTop;r=wq(r.parent)){let i=Cq(e,r);if(i&&r.lastChild.name==`CloseTag`)break;i&&n.indexOf(i)<0&&(t.name==`EndTag`||t.from>=r.firstChild.to)&&n.push(i)}return n}var Dq=/^[:\-\.\w\u00b7-\uffff]*$/;function Oq(e,t,n,r,i){let a=/\s*>/.test(e.sliceDoc(i,i+5))?``:`>`,o=wq(n,n.name==`StartTag`||n.name==`TagName`);return{from:r,to:i,options:Tq(e.doc,o,t).map(e=>({label:e,type:`type`})).concat(Eq(e.doc,n).map((e,t)=>({label:`/`+e,apply:`/`+e+a,type:`type`,boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function kq(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?``:`>`;return{from:n,to:r,options:Eq(e.doc,t).map((e,t)=>({label:e,apply:e+i,type:`type`,boost:99-t})),validFor:Dq}}function Aq(e,t,n,r){let i=[],a=0;for(let r of Tq(e.doc,n,t))i.push({label:`<`+r,type:`type`});for(let t of Eq(e.doc,n))i.push({label:`</`+t+`>`,type:`type`,boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function jq(e,t,n,r,i){let a=wq(n),o=a?t.tags[Cq(e.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[];return{from:r,to:i,options:(o&&o.globalAttrs===!1?s:s.length?s.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:`property`})),validFor:Dq}}function Mq(e,t,n,r,i){let a=n.parent?.getChild(`AttributeName`),o=[],s;if(a){let c=e.sliceDoc(a.from,a.to),l=t.globalAttrs[c];if(!l){let r=wq(n),i=r?t.tags[Cq(e.doc,r)]:null;l=i?.attrs&&i.attrs[c]}if(l){let t=e.sliceDoc(r,i).toLowerCase(),n=`"`,a=`"`;/^['"]/.test(t)?(s=t[0]==`"`?/^[^"]*$/:/^[^']*$/,n=``,a=e.sliceDoc(i,i+1)==t[0]?``:t[0],t=t.slice(1),r++):s=/^[^\s<>='"]*$/;for(let e of l)o.push({label:e,apply:n+e+a,type:`constant`})}}return{from:r,to:i,options:o,validFor:s}}function Nq(e,t){let{state:n,pos:r}=t,i=jz(n).resolveInner(r,-1),a=i.resolve(r);for(let e=r,t;a==i&&(t=i.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from<n.to)break;a=i=t,e=n.from}return i.name==`TagName`?i.parent&&/CloseTag$/.test(i.parent.name)?kq(n,i,i.from,r):Oq(n,e,i,i.from,r):i.name==`StartTag`||i.name==`IncompleteTag`?Oq(n,e,i,r,r):i.name==`StartCloseTag`||i.name==`IncompleteCloseTag`?kq(n,i,r,r):i.name==`OpenTag`||i.name==`SelfClosingTag`||i.name==`AttributeName`?jq(n,e,i,i.name==`AttributeName`?i.from:r,r):i.name==`Is`||i.name==`AttributeValue`||i.name==`UnquotedAttributeValue`?Mq(n,e,i,i.name==`Is`?r:i.from,r):t.explicit&&(a.name==`Element`||a.name==`Text`||a.name==`Document`)?Aq(n,e,i,r):null}function Pq(e){return Nq(Sq.default,e)}function Fq(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new Sq(t,n):Sq.default;return e=>Nq(r,e)}var Iq=eq.parser.configure({top:`SingleExpression`}),Lq=[{tag:`script`,attrs:e=>e.type==`text/typescript`||e.lang==`ts`,parser:nq.parser},{tag:`script`,attrs:e=>e.type==`text/babel`||e.type==`text/jsx`,parser:rq.parser},{tag:`script`,attrs:e=>e.type==`text/typescript-jsx`,parser:iq.parser},{tag:`script`,attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Iq},{tag:`script`,attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:eq.parser},{tag:`style`,attrs(e){return(!e.lang||e.lang==`css`)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:aK.parser}],Rq=[{name:`style`,parser:aK.parser.configure({top:`Styles`})}].concat(xq.map(e=>({name:e,parser:eq.parser}))),zq=Az.define({name:`html`,parser:iG.configure({props:[Yz.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let n=e.node;;){let e=n.lastChild;if(!e||e.name!=`Element`||e.to!=n.to)break;t=n=e}return t&&!((n=t.lastChild)&&(n.name==`CloseTag`||n.name==`SelfClosingTag`))?e.lineIndent(t.from)+e.unit:null}}),lB.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),pB.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:`-_`}}),Bq=zq.configure({wrap:cG(Lq,Rq)});function Vq(e={}){let t=``,n;return e.matchClosingTags===!1&&(t=`noMatch`),e.selfClosingTags===!0&&(t=(t?t+` `:``)+`selfClosing`),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=cG((e.nestedLanguages||[]).concat(Lq),(e.nestedAttributes||[]).concat(Rq))),new Vz(n?zq.configure({wrap:n,dialect:t}):t?Bq.configure({dialect:t}):Bq,[Bq.data.of({autocomplete:Fq(e)}),e.autoCloseTags===!1?[]:Uq,cq().support,oK().support])}var Hq=new Set(`area base br col command embed frame hr img input keygen link meta param source track wbr menuitem`.split(` `)),Uq=OL.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!Bq.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let t=o.doc.sliceString(e.from-1,e.to)==r,{head:n}=e,i=jz(o).resolveInner(n,-1),a;if(t&&r==`>`&&i.name==`EndTag`){let t=i.parent;if(t.parent?.lastChild?.name!=`CloseTag`&&(a=Cq(o.doc,t.parent,n))&&!Hq.has(a))return{range:e,changes:{from:n,to:n+ +(o.doc.sliceString(n,n+1)===`>`),insert:`</${a}>`}}}else if(t&&r==`/`&&i.name==`IncompleteCloseTag`){let e=i.parent;if(i.from==n-2&&e.lastChild?.name!=`CloseTag`&&(a=Cq(o.doc,e,n))&&!Hq.has(a)){let e=n+ +(o.doc.sliceString(n,n+1)===`>`),t=`${a}>`;return{range:ij.cursor(n+t.length,-1),changes:{from:n,to:e,insert:t}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),Wq=Ez({commentTokens:{block:{open:`<!--`,close:`-->`}}}),Gq=new cR,Kq=eU.configure({props:[lB.add(e=>!e.is(`Block`)||e.is(`Document`)||qq(e)!=null||Jq(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Gq.add(qq),Yz.add({Document:()=>null}),Tz.add({Document:Wq})]});function qq(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Jq(e){return e.name==`OrderedList`||e.name==`BulletList`}function Yq(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=qq(e.type))!=null&&r<=t)break;n=e}return n.to}var Xq=cB.of((e,t,n)=>{for(let r=jz(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(Gq);if(e==null)continue;let t=Yq(r,e);if(t>n)return{from:n,to:t}}return null});function Zq(e){return new Oz(Wq,e,[],`markdown`)}var Qq=Zq(Kq),$q=Zq(Kq.configure([bU,CU,SU,wU,{props:[lB.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function eJ(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):Hz.matchLanguageName(e,n,!0),t instanceof Hz)return t.support?t.support.language.parser:Pz.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var tJ=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}else{for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}}marker(e,t){let n=this.node.name==`OrderedList`?String(+rJ(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function nJ(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new tJ(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new tJ(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new tJ(i.parent,s,s+t,a[1],e,n,i))}}return r}function rJ(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function iJ(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=rJ(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function aJ(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(Wz)!=` `)return e;let r=gM(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var oJ=((e={})=>({state:t,dispatch:n})=>{let r=jz(t),{doc:i}=t,a=null,o=t.changeByRange(n=>{if(!n.empty||!$q.isActiveAt(t,n.from,-1)&&!$q.isActiveAt(t,n.from,1))return a={range:n};let o=n.from,s=i.lineAt(o),c=nJ(r.resolveInner(o,-1),i);for(;c.length&&c[c.length-1].from>o-s.from;)c.pop();if(!c.length)return a={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>o-s.from)return a={range:n};let u=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&u){let n=l.node.firstChild,r=l.node.getChild(`ListItem`,`ListItem`);if(n.to>=o||r&&r.to<o||s.from>0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return l.node.name==`OrderedList`&&iJ(l.item,i,r,-2),e&&e.node.name==`OrderedList`&&iJ(e.item,i,r),{range:ij.cursor(t+n.length),changes:r}}else{let e=lJ(c,t,s);return{range:ij.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&u&&s.from){let e=i.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let d=[];l.node.name==`OrderedList`&&iJ(l.item,i,d);let f=l.item&&l.item.from<s.from,p=``;if(!f||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)p+=e==t&&!f?c[e].marker(i,1):c[e].blank(e<t?gM(s.text,4,c[e+1].from)-p.length:null);let m=o;for(;m>s.from&&/\s/.test(s.text.charAt(m-s.from-1));)m--;return p=aJ(p,t),cJ(l.node,t.doc)&&(p=lJ(c,t,s)+t.lineBreak+p),d.push({from:m,to:o,insert:t.lineBreak+p}),{range:ij.cursor(m+p.length+1),changes:d}});return a?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:`input`})),!0)})();function sJ(e){return e.name==`QuoteMark`||e.name==`ListMark`}function cJ(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function lJ(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?gM(n.text,4,e[t+1].from)-r.length:null,t<i);return aJ(r,t)}function uJ(e,t){let n=e.resolveInner(t,-1),r=t;sJ(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(sJ(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var dJ=[{key:`Enter`,run:oJ},{key:`Backspace`,run:({state:e,dispatch:t})=>{let n=jz(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&$q.isActiveAt(e,t.from)){let t=a.lineAt(i),r=nJ(uJ(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+ +!!n.spaceAfter;if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:ij.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(gM(t.text,4,n.to)-gM(t.text,4,n.from));return r==t.from&&(i=aJ(i,e)),{range:ij.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:ij.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return r?!1:(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)}}],fJ=Vq({matchClosingTags:!1});function pJ(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=Qq,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=fJ}=e;if(!(i instanceof EH))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[s.support,Xq],u;o&&l.push(vJ),n instanceof Vz?(l.push(n.support),u=n.language):n&&(u=n);let d=t||u?eJ(t,u):void 0;c.push(nU({codeParser:d,htmlParser:s.language.parser})),r&&l.push(_j.high(LL.of(dJ)));let f=Zq(i.configure(c));return a&&l.push(f.data.of({autocomplete:mJ})),new Vz(f,l)}function mJ(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=jz(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:gJ(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var hJ=null;function gJ(){if(hJ)return hJ;let e=Pq(new EB(Xj.create({extensions:fJ}),0,!0));return hJ=e?e.options:[]}var _J=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,vJ=OL.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!$q.isActiveAt(t.state,n.from,1)))return!1;let i=jz(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||_J.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),a?!1:(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}}),yJ=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=wJ(e.state,n.from);return r.line?xJ(e):r.block?CJ(e):!1};function bJ(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var xJ=bJ(kJ,0),SJ=bJ(OJ,0),CJ=bJ((e,t)=>OJ(e,t,DJ(t)),0);function wJ(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var TJ=50;function EJ(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-TJ,r),o=e.sliceDoc(i,i+TJ),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*TJ?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+TJ),d=e.sliceDoc(i-TJ,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function DJ(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function OJ(e,t,n=t.selection.ranges){let r=n.map(e=>wJ(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>EJ(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function kJ(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=wJ(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var AJ=Mj.define(),jJ=Mj.define(),MJ=sj.define(),NJ=sj.define({combine(e){return Zj(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),PJ=mj.define({create(){return $J.empty},update(e,t){let n=t.state.facet(NJ),r=t.annotation(AJ);if(r){let i=VJ.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?HJ(o,o.length,n.minDepth,i):JJ(o,t.startState.selection),new $J(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(jJ);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(Ij.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=VJ.fromTransaction(t),o=t.annotation(Ij.time),s=t.annotation(Ij.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new $J(e.done.map(VJ.fromJSON),e.undone.map(VJ.fromJSON))}});function FJ(e={}){return[PJ,NJ.of(e),OL.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?LJ:e.inputType==`historyRedo`?RJ:null;return n?(e.preventDefault(),n(t)):!1}})]}function IJ(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(PJ,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var LJ=IJ(0,!1),RJ=IJ(1,!1),zJ=IJ(0,!0),BJ=IJ(1,!0),VJ=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&XA.fromJSON(t.changes),[],t.mapped&&YA.fromJSON(t.mapped),t.startSelection&&ij.fromJSON(t.startSelection),t.selectionsAfter.map(ij.fromJSON))}static fromTransaction(t,n){let r=KJ;for(let e of t.startState.facet(MJ)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,KJ)}static selection(t){return new e(void 0,KJ,void 0,void 0,t)}};function HJ(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function UJ(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function WJ(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function GJ(e,t){return e.length?t.length?e.concat(t):e:t}var KJ=[],qJ=200;function JJ(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-qJ));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),HJ(e,e.length-1,1e9,n.setSelAfter(r)))}else return[VJ.selection([t])]}function YJ(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function XJ(e,t){if(!e.length)return e;let n=e.length,r=KJ;for(;n;){let i=ZJ(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[VJ.selection(r)]:KJ}function ZJ(e,t,n){let r=GJ(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):KJ,n);if(!e.changes)return VJ.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new VJ(i,Fj.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var QJ=/^(input\.type|delete)($|\.)/,$J=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||QJ.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,UJ(s.changes,t.changes))||r==`input.type.compose`)?HJ(o,o.length-1,i.minDepth,new VJ(t.changes.compose(s.changes),GJ(Fj.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,KJ)):HJ(o,o.length,i.minDepth,t),new e(o,KJ,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:KJ;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&WJ(a[a.length-1],t)?this:new e(JJ(this.done,t),this.undone,n,r)}addMapping(t){return new e(XJ(this.done,t),XJ(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:AJ.of({side:e,rest:YJ(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?KJ:r.slice(0,r.length-1);return i.mapped&&(n=XJ(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:AJ.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};$J.empty=new $J(KJ,KJ);var eY=[{key:`Mod-z`,run:LJ,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:RJ,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:RJ,preventDefault:!0},{key:`Mod-u`,run:zJ,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:BJ,preventDefault:!0}];function tY(e,t){return ij.create(e.ranges.map(t),e.mainIndex)}function nY(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function rY({state:e,dispatch:t},n){let r=tY(e.selection,n);return r.eq(e.selection,!0)?!1:(t(nY(e,r)),!0)}function iY(e,t){return ij.cursor(t?e.to:e.from)}function aY(e,t){return rY(e,n=>n.empty?e.moveByChar(n,t):iY(n,t))}function oY(e){return e.textDirectionAt(e.state.selection.main.head)==MN.LTR}var sY=e=>aY(e,!oY(e)),cY=e=>aY(e,oY(e));function lY(e,t){return rY(e,n=>n.empty?e.moveByGroup(n,t):iY(n,t))}var uY=e=>lY(e,!oY(e)),dY=e=>lY(e,oY(e));typeof Intl<`u`&&Intl.Segmenter;function fY(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function pY(e,t,n){let r=jz(e).resolveInner(t.head),i=n?cR.closedBy:cR.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;fY(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?gB(e,r.from,1):gB(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,ij.cursor(s,n?-1:1)}var mY=e=>rY(e,t=>pY(e.state,t,!oY(e))),hY=e=>rY(e,t=>pY(e.state,t,oY(e)));function gY(e,t){return rY(e,n=>{if(!n.empty)return iY(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var _Y=e=>gY(e,!1),vY=e=>gY(e,!0);function yY(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(OL.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function bY(e,t){let n=yY(e),{state:r}=e,i=tY(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):iY(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=OL.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(nY(r,i),{effects:a}),!0}var xY=e=>bY(e,!1),SY=e=>bY(e,!0);function CY(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=ij.cursor(r.from+n))}return i}var wY=e=>rY(e,t=>CY(e,t,!0)),TY=e=>rY(e,t=>CY(e,t,!1)),EY=e=>rY(e,t=>CY(e,t,!oY(e))),DY=e=>rY(e,t=>CY(e,t,oY(e))),OY=e=>rY(e,t=>ij.cursor(e.lineBlockAt(t.head).from,1)),kY=e=>rY(e,t=>ij.cursor(e.lineBlockAt(t.head).to,-1));function AY(e,t,n){let r=!1,i=tY(e.selection,t=>{let i=gB(e,t.head,-1)||gB(e,t.head,1)||t.head>0&&gB(e,t.head-1,1)||t.head<e.doc.length&&gB(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?ij.range(t.anchor,a):ij.cursor(a)});return r?(t(nY(e,i)),!0):!1}var jY=({state:e,dispatch:t})=>AY(e,t,!1);function MY(e,t){let n=tY(e.state.selection,e=>{let n=t(e);return ij.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(nY(e.state,n)),!0)}function NY(e,t){return MY(e,n=>e.moveByChar(n,t))}var PY=e=>NY(e,!oY(e)),FY=e=>NY(e,oY(e));function IY(e,t){return MY(e,n=>e.moveByGroup(n,t))}var LY=e=>IY(e,!oY(e)),RY=e=>IY(e,oY(e)),zY=e=>MY(e,t=>pY(e.state,t,!oY(e))),BY=e=>MY(e,t=>pY(e.state,t,oY(e)));function VY(e,t){return MY(e,n=>e.moveVertically(n,t))}var HY=e=>VY(e,!1),UY=e=>VY(e,!0);function WY(e,t){return MY(e,n=>e.moveVertically(n,t,yY(e).height))}var GY=e=>WY(e,!1),KY=e=>WY(e,!0),qY=e=>MY(e,t=>CY(e,t,!0)),JY=e=>MY(e,t=>CY(e,t,!1)),YY=e=>MY(e,t=>CY(e,t,!oY(e))),XY=e=>MY(e,t=>CY(e,t,oY(e))),ZY=e=>MY(e,t=>ij.cursor(e.lineBlockAt(t.head).from)),QY=e=>MY(e,t=>ij.cursor(e.lineBlockAt(t.head).to)),$Y=({state:e,dispatch:t})=>(t(nY(e,{anchor:0})),!0),eX=({state:e,dispatch:t})=>(t(nY(e,{anchor:e.doc.length})),!0),tX=({state:e,dispatch:t})=>(t(nY(e,{anchor:e.selection.main.anchor,head:0})),!0),nX=({state:e,dispatch:t})=>(t(nY(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),rX=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),iX=({state:e,dispatch:t})=>{let n=CX(e).map(({from:t,to:n})=>ij.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:ij.create(n),userEvent:`select`})),!0},aX=({state:e,dispatch:t})=>{let n=tY(e.selection,t=>{let n=jz(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return ij.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(nY(e,n)),!0)};function oX(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(nY(n,ij.create(i,i.length-1))),!0)}var sX=e=>oX(e,!1),cX=e=>oX(e,!0),lX=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=ij.create([n.main]):n.main.empty||(r=ij.create([ij.cursor(n.main.head)])),r?(t(nY(e,r)),!0):!1};function uX(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=dX(e,o,!1)):o>i&&(n=`delete.forward`,o=dX(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=dX(e,i,!1),a=dX(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:ij.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?OL.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function dX(e,t,n){if(e instanceof OL)for(let r of e.state.facet(OL.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var fX=(e,t,n)=>uX(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=gM(s,a.tabSize)%Gz(a)||Gz(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=WA(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=WA(o.text,c-o.from,!1,!1)+o.from);return c}),pX=e=>fX(e,!1,!0),mX=e=>fX(e,!0,!1),hX=(e,t)=>uX(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=WA(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),gX=e=>hX(e,!1),_X=e=>hX(e,!0),vX=e=>uX(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),yX=e=>uX(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),bX=e=>uX(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),xX=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:FA.of([``,``])},range:ij.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},SX=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:WA(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:WA(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:ij.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function CX(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function wX(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of CX(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(ij.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(ij.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:ij.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var TX=({state:e,dispatch:t})=>wX(e,t,!1),EX=({state:e,dispatch:t})=>wX(e,t,!0);function DX(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of CX(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var OX=({state:e,dispatch:t})=>DX(e,t,!1),kX=({state:e,dispatch:t})=>DX(e,t,!0),AX=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(CX(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=tY(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function jX(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=jz(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(cR.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var MX=PX(!1),NX=PX(!0);function PX(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&jX(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new Jz(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=qz(s,r);for(c??=gM(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,Kz(t,c)];return o&&l.push(Kz(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:FA.of(l)},range:ij.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function FX(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:ij.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var IX=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Jz(e,{overrideIndentation:e=>n[e]??-1}),i=FX(e,(t,i,a)=>{let o=qz(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=Kz(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},LX=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(FX(e,(t,n)=>{n.push({from:t.from,insert:e.facet(Wz)})}),{userEvent:`input.indent`})),!0),RX=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(FX(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=gM(r,e.tabSize),a=0,o=Kz(e,Math.max(0,i-Gz(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),zX=e=>(e.setTabFocusMode(),!0),BX=[{key:`Ctrl-b`,run:sY,shift:PY,preventDefault:!0},{key:`Ctrl-f`,run:cY,shift:FY},{key:`Ctrl-p`,run:_Y,shift:HY},{key:`Ctrl-n`,run:vY,shift:UY},{key:`Ctrl-a`,run:OY,shift:ZY},{key:`Ctrl-e`,run:kY,shift:QY},{key:`Ctrl-d`,run:mX},{key:`Ctrl-h`,run:pX},{key:`Ctrl-k`,run:vX},{key:`Ctrl-Alt-h`,run:gX},{key:`Ctrl-o`,run:xX},{key:`Ctrl-t`,run:SX},{key:`Ctrl-v`,run:SY}],VX=[{key:`ArrowLeft`,run:sY,shift:PY,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:uY,shift:LY,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:EY,shift:YY,preventDefault:!0},{key:`ArrowRight`,run:cY,shift:FY,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:dY,shift:RY,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:DY,shift:XY,preventDefault:!0},{key:`ArrowUp`,run:_Y,shift:HY,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:$Y,shift:tX},{mac:`Ctrl-ArrowUp`,run:xY,shift:GY},{key:`ArrowDown`,run:vY,shift:UY,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:eX,shift:nX},{mac:`Ctrl-ArrowDown`,run:SY,shift:KY},{key:`PageUp`,run:xY,shift:GY},{key:`PageDown`,run:SY,shift:KY},{key:`Home`,run:TY,shift:JY,preventDefault:!0},{key:`Mod-Home`,run:$Y,shift:tX},{key:`End`,run:wY,shift:qY,preventDefault:!0},{key:`Mod-End`,run:eX,shift:nX},{key:`Enter`,run:MX,shift:MX},{key:`Mod-a`,run:rX},{key:`Backspace`,run:pX,shift:pX,preventDefault:!0},{key:`Delete`,run:mX,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:gX,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:_X,preventDefault:!0},{mac:`Mod-Backspace`,run:yX,preventDefault:!0},{mac:`Mod-Delete`,run:bX,preventDefault:!0}].concat(BX.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),HX=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:mY,shift:zY},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:hY,shift:BY},{key:`Alt-ArrowUp`,run:TX},{key:`Shift-Alt-ArrowUp`,run:OX},{key:`Alt-ArrowDown`,run:EX},{key:`Shift-Alt-ArrowDown`,run:kX},{key:`Mod-Alt-ArrowUp`,run:sX},{key:`Mod-Alt-ArrowDown`,run:cX},{key:`Escape`,run:lX},{key:`Mod-Enter`,run:NX},{key:`Alt-l`,mac:`Ctrl-l`,run:iX},{key:`Mod-i`,run:aX,preventDefault:!0},{key:`Mod-[`,run:RX},{key:`Mod-]`,run:LX},{key:`Mod-Alt-\\`,run:IX},{key:`Shift-Mod-k`,run:AX},{key:`Shift-Mod-\\`,run:jY},{key:`Mod-/`,run:yJ},{key:`Alt-A`,run:SJ},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:zX}].concat(VX),UX={key:`Tab`,run:LX,shift:RX},WX=L(`<div></div>`);function GX(e,t){D(t,!0);let n={name:`Commands`,rank:0},r={name:`Project references`,rank:10},i=q(t,`placeholder`,3,`Ask the local Nerve agent`),a=q(t,`disabled`,3,!1),o=q(t,`focusToken`,3,0),s=q(t,`slashCompletions`,19,()=>[]),c,l,u=A(``),d=0,f=new yj,p=new yj,m=new yj;function h(e){return[Xj.readOnly.of(e),OL.editable.of(!e)]}function g(e){return e.kind===`directory`||e.kind===`file`?r:n}function _(e){if(e.sortScore!==void 0)return Math.max(-99,Math.min(99,Math.round(e.sortScore/160)))}function v(e){return{label:e.label,displayLabel:e.displayLabel,detail:e.detail,info:e.info,type:e.kind===`directory`?`folder`:e.kind===`file`?`file`:`keyword`,apply:e.apply??e.label,boost:_(e),section:g(e),matchRanges:e.matchRanges?.flatMap(([e,t])=>[e,t]),nerveKind:e.kind}}function y(e){return e.matchRanges??[]}function b(e){return`nerve-completion-option nerve-completion-${e.nerveKind??`slash`}`}let x=`http://www.w3.org/2000/svg`,S={file:[`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,`M14 2v5a1 1 0 0 0 1 1h5`],folder:[`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`]};function ee(e,t=14){let n=document.createElementNS(x,`svg`);n.setAttribute(`viewBox`,`0 0 24 24`),n.setAttribute(`fill`,`none`),n.setAttribute(`stroke`,`currentColor`),n.setAttribute(`stroke-width`,`2`),n.setAttribute(`stroke-linecap`,`round`),n.setAttribute(`stroke-linejoin`,`round`),n.setAttribute(`width`,String(t)),n.setAttribute(`height`,String(t)),n.setAttribute(`aria-hidden`,`true`);for(let t of S[e]){let e=document.createElementNS(x,`path`);e.setAttribute(`d`,t),n.appendChild(e)}return n}function C(e,t,n){let r=0;for(let[i,a]of n){i>r&&e.appendChild(document.createTextNode(t.slice(r,i)));let n=document.createElement(`span`);n.className=`cm-nerve-match`,n.textContent=t.slice(i,a),e.appendChild(n),r=a}r<t.length&&e.appendChild(document.createTextNode(t.slice(r)))}function te(e){let t=e.nerveKind,n=e.matchRanges??[],r=document.createElement(`span`);r.className=`cm-nerve-row`;let i=document.createElement(`span`);i.className=`cm-nerve-row-icon`,i.appendChild(ee(t===`directory`?`folder`:`file`)),r.appendChild(i);let a=document.createElement(`span`);if(a.className=`cm-nerve-row-main`,t===`file`||t===`directory`){let r=e.label??``,i=e.info,o=typeof i==`string`?i:r.replace(/^@/,``),s=t===`directory`,c=s?o.replace(/\/+$/,``):o,l=c.lastIndexOf(`/`)+1,u=c.slice(0,l),d=c.slice(l)+(s?`/`:``),f=[];for(let e=0;e+1<n.length;e+=2){let t=Math.max(0,n[e]-1),r=Math.min(c.length,n[e+1]-1);r>t&&f.push([t,r])}if(u){let e=document.createElement(`span`);e.className=`cm-nerve-row-dir`,e.textContent=``,C(e,u,f.filter(([e])=>e<l).map(([e,t])=>[e,Math.min(t,l)])),a.appendChild(e)}let p=document.createElement(`span`);p.className=`cm-nerve-row-name`,C(p,d,f.filter(([e,t])=>t>l).map(([e,t])=>[Math.max(e,l)-l,t-l])),a.appendChild(p)}else{let t=document.createElement(`span`);t.className=`cm-nerve-row-name`,t.textContent=e.label??``,a.appendChild(t)}return r.appendChild(a),r}async function ne(e){let n=e.matchBefore(/(?:^|\s)([/@][^\s]*)/);if(!n&&!e.explicit)return null;let r=n?.text.trimStart()??``,i=n?n.to-r.length:e.pos;if(r.startsWith(`/`))return{from:i,options:s().filter(e=>e.label.startsWith(r)||e.label.includes(r.slice(1))).map(v),validFor:/^\/[\w-]*$/};if(r.startsWith(`@`)){e.addEventListener(`abort`,()=>void 0,{onDocChange:!0});let n=r.slice(1),a=(await t.fileCompletions?.(n)??[]).map(v);return e.aborted?null:{from:i,options:a,filter:!1,getMatch:y}}return e.explicit?{from:e.pos,options:s().map(v)}:null}function re(e){let t=[],n=QM.line({class:`cm-executable-command-block-line`}),r=QM.mark({class:`cm-executable-command-block-command`});for(let i of ok(e.doc.toString())){let a=i.start;for(;a<i.end;){let r=e.doc.lineAt(a);if(t.push(n.range(r.from)),r.to>=i.end)break;a=r.to+1}i.commandEnd>i.commandStart&&t.push(r.range(i.commandStart,i.commandEnd))}return QM.set(t.sort((e,t)=>e.from-t.from||e.to-t.to),!0)}let ie=bP.fromClass(class{decorations;constructor(e){this.decorations=re(e.state)}update(e){e.docChanged&&(this.decorations=re(e.state))}},{decorations:e=>e.decorations});function ae(){return UV({override:[ne],icons:!1,maxRenderedOptions:80,tooltipClass:()=>`nerve-composer-completions`,optionClass:b,addToOptions:[{render:te,position:20}]})}function oe(){return a()?!1:(t.onSubmit?.(),!0)}function w(e){return KV(e.state)===`active`?!1:oe()}function se(e){if(!l)return;let t=l.state.selection.main;l.dispatch({changes:{from:t.from,to:t.to,insert:e},selection:{anchor:t.from+e.length},scrollIntoView:!0}),l.focus()}function ce(e){if(a()||!t.onPasteImage)return!1;let n=Array.from(e.clipboardData?.files??[]).filter(e=>e.type.startsWith(`image/`));return n.length?(e.preventDefault(),Promise.all(n.map(e=>t.onPasteImage(e))).then(e=>se(e.join(`
|
|
78
|
-
`))).catch(e=>{yw(`error`,`composer`,`Failed to paste clipboard image`,{error:e})}),!0):!1}Na(()=>{j(u,t.value,!0),l=new OL({parent:c,state:Xj.create({doc:t.value,extensions:[FJ(),pJ(),m.of(KL(i())),f.of(h(a())),p.of(ae()),ie,_j.highest(LL.of([{key:`Enter`,run:w},{key:`Mod-Enter`,run:oe},{key:`Ctrl-Enter`,run:oe},UX])),LL.of([...HX,...eY]),OL.lineWrapping,OL.domEventHandlers({paste:ce}),OL.updateListener.of(e=>{e.docChanged&&(j(u,e.state.doc.toString(),!0),t.onChange?.(I(u)))}),OL.theme({"&":{background:`transparent`,color:`var(--foreground)`,maxHeight:`min(40vh, 320px)`},".cm-content":{caretColor:`var(--primary)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,lineHeight:`1.5`,padding:`18px 46px 14px 11px`},".cm-line":{padding:`0 2px`},".cm-cursor":{borderLeftColor:`var(--primary)`},".cm-placeholder":{color:`color-mix(in oklab, var(--muted-foreground) 75%, transparent)`},".cm-executable-command-block-line":{backgroundColor:`color-mix(in oklab, var(--info) 9%, transparent)`},".cm-executable-command-block-command":{backgroundColor:`color-mix(in oklab, var(--info) 16%, transparent)`,color:`var(--foreground)`,borderRadius:`var(--radius-sm)`},".cm-scroller":{minHeight:`92px`,maxHeight:`min(40vh, 320px)`,overflow:`auto`},".cm-tooltip":{border:`1px solid var(--border)`,borderRadius:`var(--radius-md)`,background:`var(--popover)`,color:`var(--popover-foreground)`,boxShadow:`var(--shadow-lg)`,overflow:`hidden`},".cm-tooltip-autocomplete.nerve-composer-completions":{minWidth:`min(28rem, calc(100vw - 2rem))`,maxWidth:`min(38rem, calc(100vw - 2rem))`,padding:`0.25rem`},".cm-tooltip-autocomplete.nerve-composer-completions > ul":{maxHeight:`min(42vh, 22rem)`,padding:`0.15rem`,fontFamily:`var(--font-mono)`,scrollbarWidth:`thin`},".cm-tooltip-autocomplete.nerve-composer-completions > ul > completion-section":{borderBottom:`0`,color:`var(--muted-foreground)`,fontFamily:`var(--font-sans)`,fontSize:`var(--text-xs)`,fontWeight:`700`,letterSpacing:`0.02em`,padding:`0.35rem 0.5rem 0.2rem`,textTransform:`uppercase`},".cm-tooltip-autocomplete.nerve-composer-completions > ul > li":{display:`flex`,alignItems:`center`,minHeight:`1.85rem`,borderRadius:`var(--radius-sm)`,padding:`0.28rem 0.5rem`,color:`var(--popover-foreground)`},".cm-tooltip-autocomplete.nerve-composer-completions > ul > li[aria-selected]":{background:`var(--accent)`,color:`var(--accent-foreground)`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-completionLabel":{display:`none`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-completionDetail":{display:`none`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-row":{display:`flex`,alignItems:`center`,gap:`0.5rem`,minWidth:`0`,width:`100%`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-row-icon":{display:`inline-flex`,flexShrink:`0`,alignItems:`center`,color:`var(--muted-foreground)`},".cm-tooltip-autocomplete.nerve-composer-completions .nerve-completion-directory .cm-nerve-row-icon":{color:`var(--info)`},".cm-tooltip-autocomplete.nerve-composer-completions .nerve-completion-file .cm-nerve-row-icon":{color:`var(--success)`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-row-main":{display:`flex`,alignItems:`baseline`,gap:`0.4rem`,flex:`1`,minWidth:`0`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-row-dir":{flexShrink:`1`,minWidth:`0`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,direction:`rtl`,textAlign:`left`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-xs)`,color:`var(--muted-foreground)`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-row-name":{flexShrink:`0`,whiteSpace:`nowrap`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,fontWeight:`600`,color:`var(--popover-foreground)`},".cm-tooltip-autocomplete.nerve-composer-completions .cm-nerve-match":{color:`var(--primary)`,fontWeight:`700`},".cm-tooltip.cm-completionInfo":{maxWidth:`min(30rem, calc(100vw - 2rem))`,padding:`0.55rem 0.7rem`,color:`var(--popover-foreground)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-xs)`},"&.cm-focused":{outline:`none`},"&.cm-focused .cm-cursor":{borderLeftColor:`var(--primary)`},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, ::selection":{backgroundColor:`color-mix(in oklab, var(--primary) 22%, transparent)`}})]})})}),sr(()=>{l&&l.dispatch({effects:f.reconfigure(h(a()))})}),sr(()=>{l&&(s(),t.fileCompletions,l.dispatch({effects:p.reconfigure(ae())}))}),sr(()=>{l&&l.dispatch({effects:m.reconfigure(KL(i()))})}),sr(()=>{!l||a()||o()===d||(d=o(),l.focus())}),sr(()=>{!l||t.value===I(u)||(l.dispatch({changes:{from:0,to:l.state.doc.length,insert:t.value}}),j(u,t.value,!0))}),Pa(()=>l?.destroy());var le=WX();let ue;Aa(le,e=>c=e,()=>c),F(()=>ue=ra(le,1,`composer-editor svelte-glolxd`,null,ue,{disabled:a()})),z(e,le),O()}var KX=new Set([`$$slots`,`$$events`,`$$legacy`]);function qX(e,t){let n=G(t,KX),r=[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`}]];uc(e,K({name:`key-round`},()=>n,{get iconNode(){return r}}))}var JX=new Set([`$$slots`,`$$events`,`$$legacy`]);function YX(e,t){let n=G(t,JX),r=[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`}],[`path`,{d:`m9 12 2 2 4-4`}]];uc(e,K({name:`shield-check`},()=>n,{get iconNode(){return r}}))}var XX=new Set([`$$slots`,`$$events`,`$$legacy`]);function ZX(e,t){let n=G(t,XX),r=[[`path`,{d:`M18 6 6 18`}],[`path`,{d:`m6 6 12 12`}]];uc(e,K({name:`x`},()=>n,{get iconNode(){return r}}))}var QX=L(`<div class="dialog-header-actions svelte-16bs6s2"><!></div>`),$X=L(`<footer class="dialog-footer svelte-16bs6s2"><!></footer>`),eZ=L(`<header class="dialog-header svelte-16bs6s2"><div class="dialog-title-block svelte-16bs6s2"><!> <!></div> <!> <!></header> <div class="dialog-body svelte-16bs6s2"><!></div> <!>`,1),tZ=L(`<!> <!>`,1);function nZ(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`title`,3,`Dialog`),i=q(t,`class`,3,``),a=q(t,`closeLabel`,3,`Close dialog`);function o(e){n(e),t.onOpenChange?.(e)}var s=R();U(N(s),()=>Gy,(e,s)=>{s(e,{onOpenChange:o,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var o=R();U(N(o),()=>im,(e,n)=>{n(e,{children:(e,n)=>{var o=tZ(),s=N(o);U(s,()=>vh,(e,t)=>{t(e,{class:`dialog-overlay`})});var c=P(s,2);{let e=k(()=>ul(`dialog-content`,i()));U(c,()=>Qy,(n,i)=>{i(n,{get class(){return I(e)},children:(e,n)=>{var i=eZ(),o=N(i),s=M(o),c=M(s);U(c,()=>rm,(e,t)=>{t(e,{class:`dialog-title`,children:(e,t)=>{E();var n=ki();F(()=>B(n,r())),z(e,n)},$$slots:{default:!0}})});var l=P(c,2),u=e=>{var n=R();U(N(n),()=>xh,(e,n)=>{n(e,{class:`dialog-description`,children:(e,n)=>{E();var r=ki();F(()=>B(r,t.description)),z(e,r)},$$slots:{default:!0}})}),z(e,n)};V(l,e=>{t.description&&e(u)}),T(s);var d=P(s,2),f=e=>{var n=QX();H(M(n),()=>t.headerActions),T(n),z(e,n)};V(d,e=>{t.headerActions&&e(f)}),U(P(d,2),()=>Jy,(e,t)=>{t(e,{class:`dialog-close`,get"aria-label"(){return a()},children:(e,t)=>{ZX(e,{size:15,strokeWidth:2.25,"aria-hidden":`true`})},$$slots:{default:!0}})}),T(o);var p=P(o,2);H(M(p),()=>t.children??w),T(p);var m=P(p,2),h=e=>{var n=$X();H(M(n),()=>t.footer),T(n),z(e,n)};V(m,e=>{t.footer&&e(h)}),z(e,i)},$$slots:{default:!0}})})}z(e,o)},$$slots:{default:!0}})}),z(e,o)},$$slots:{default:!0}})}),z(e,s),O()}var rZ=new Set([`$$slots`,`$$events`,`$$legacy`]);function iZ(e,t){let n=G(t,rZ),r=[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}],[`path`,{d:`m7 16.5-4.74-2.85`}],[`path`,{d:`m7 16.5 5-3`}],[`path`,{d:`M7 16.5v5.17`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}],[`path`,{d:`m17 16.5-5-3`}],[`path`,{d:`m17 16.5 4.74-2.85`}],[`path`,{d:`M17 16.5v5.17`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}],[`path`,{d:`M12 8 7.26 5.15`}],[`path`,{d:`m12 8 4.74-2.85`}],[`path`,{d:`M12 13.5V8`}]];uc(e,K({name:`boxes`},()=>n,{get iconNode(){return r}}))}var aZ=new Set([`$$slots`,`$$events`,`$$legacy`]);function oZ(e,t){let n=G(t,aZ),r=[[`path`,{d:`M12 20v2`}],[`path`,{d:`M12 2v2`}],[`path`,{d:`M17 20v2`}],[`path`,{d:`M17 2v2`}],[`path`,{d:`M2 12h2`}],[`path`,{d:`M2 17h2`}],[`path`,{d:`M2 7h2`}],[`path`,{d:`M20 12h2`}],[`path`,{d:`M20 17h2`}],[`path`,{d:`M20 7h2`}],[`path`,{d:`M7 20v2`}],[`path`,{d:`M7 2v2`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`}]];uc(e,K({name:`cpu`},()=>n,{get iconNode(){return r}}))}var sZ=new Set([`$$slots`,`$$events`,`$$legacy`]);function cZ(e,t){let n=G(t,sZ),r=[[`path`,{d:`m21 21-4.34-4.34`}],[`circle`,{cx:`11`,cy:`11`,r:`8`}]];uc(e,K({name:`search`},()=>n,{get iconNode(){return r}}))}var lZ=new Set([`$$slots`,`$$events`,`$$legacy`]);function uZ(e,t){let n=G(t,lZ),r=[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`}],[`path`,{d:`M20 2v4`}],[`path`,{d:`M22 4h-4`}],[`circle`,{cx:`4`,cy:`20`,r:`2`}]];uc(e,K({name:`sparkles`},()=>n,{get iconNode(){return r}}))}var dZ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`viewportRef`,`class`,`orientation`,`scrollbarXClasses`,`scrollbarYClasses`,`viewportClass`,`children`]),fZ=L(`<!> <!> <!> <!>`,1);function pZ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`viewportRef`,15,null),i=q(t,`orientation`,3,`vertical`),a=q(t,`scrollbarXClasses`,3,``),o=q(t,`scrollbarYClasses`,3,``),s=q(t,`viewportClass`,3,``),c=G(t,dZ);var l=R(),u=N(l);{let e=k(()=>ul(`relative`,t.class));U(u,()=>ux,(l,u)=>{u(l,K({"data-slot":`scroll-area`,get class(){return I(e)}},()=>c,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var c=fZ(),l=N(c);{let e=k(()=>ul(`cn-scroll-area-viewport focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1`,s()));U(l,()=>px,(n,i)=>{i(n,{"data-slot":`scroll-area-viewport`,get class(){return I(e)},get ref(){return r()},set ref(e){r(e)},children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}})})}var u=P(l,2),d=e=>{gZ(e,{orientation:`vertical`,get class(){return o()}})};V(u,e=>{(i()===`vertical`||i()===`both`)&&e(d)});var f=P(u,2),p=e=>{gZ(e,{orientation:`horizontal`,get class(){return a()}})};V(f,e=>{(i()===`horizontal`||i()===`both`)&&e(p)}),U(P(f,2),()=>Bx,(e,t)=>{t(e,{})}),z(e,c)},$$slots:{default:!0}}))})}z(e,l),O()}var mZ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`orientation`,`children`]),hZ=L(`<!> <!>`,1);function gZ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`orientation`,3,`vertical`),i=G(t,mZ);var a=R(),o=N(a);{let e=k(()=>ul(`data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none`,t.class));U(o,()=>Ax,(a,o)=>{o(a,K({"data-slot":`scroll-area-scrollbar`,get"data-orientation"(){return r()},get orientation(){return r()},get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=hZ(),i=N(r);H(i,()=>t.children??w),U(P(i,2),()=>Fx,(e,t)=>{t(e,{"data-slot":`scroll-area-thumb`,class:`rounded-full bg-border relative flex-1`})}),z(e,r)},$$slots:{default:!0}}))})}z(e,a),O()}var _Z=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function vZ(e){return e?.supportedThinkingLevels?.length?e.supportedThinkingLevels:[`off`]}function yZ(e,t){let n=vZ(t);if(n.includes(e))return e;let r=_Z.indexOf(e);if(r===-1)return n[0]??`off`;for(let e=r;e<_Z.length;e++){let t=_Z[e];if(n.includes(t))return t}for(let e=r-1;e>=0;e--){let t=_Z[e];if(n.includes(t))return t}return n[0]??`off`}function bZ(e){return e.rememberLastAgentSelection?e.lastAgentSelection:{mode:e.defaultMode,permissionLevel:e.defaultPermissionLevel,model:e.defaultModel,thinkingLevel:e.defaultThinkingLevel}}function xZ(e,t,n){let r=bZ(e),i=gE(t,n,e.scopedModels),a=r.model,o=(a?i.find(e=>aE(e)===aE(a)):void 0)??i[0];return{selectedModelKey:o?aE(o):``,selectedThinkingLevel:yZ(r.thinkingLevel,o),selectedMode:r.mode,selectedPermissionLevel:r.permissionLevel}}var SZ=In({subscriptionUsage:{}}),CZ,wZ,TZ=!1,EZ=!1;function DZ(){return Y.agents.find(e=>e.id===TT.agentId)}function OZ(){return NT.models.find(e=>aE(e)===kT.selectedModelKey)}async function kZ(){WT({kind:`settings`,id:`settings`}),JT({kind:`settings`,id:`settings`}),await NZ()}async function AZ(){WT({kind:`settings`,id:`settings`}),JT({kind:`settings`,id:`settings`}),NT.settingsDraft||await NZ()}function jZ(){let e={kind:`settings`,id:`settings`},t=Y.activeCenterTab?.kind===`settings`,n=KT(e);qT(e),t&&XT(n)}async function MZ(){let e=await nA();return SZ.subscriptionUsage=Object.fromEntries(e.map(e=>[e.provider,e])),e}async function NZ(){let[e,t,n,r]=await Promise.all([Due(),nue(),Jle(),nA().catch(()=>[])]);NT.settingsDraft=e,RC(e.ui.zoomLevel),NT.models=t,NT.authProviders=n,SZ.subscriptionUsage=Object.fromEntries(r.map(e=>[e.provider,e]));let i=gE(t,n,e.scopedModels),a=xZ(e,t,n),o=DZ();if(o){kT.selectedMode=o.mode,kT.selectedPermissionLevel=o.permissionLevel;let e=o.model;e&&i.some(t=>aE(t)===aE(e))?(kT.selectedModelKey=aE(e),kT.selectedThinkingLevel=o.thinkingLevel):(kT.selectedModelKey=a.selectedModelKey,kT.selectedThinkingLevel=a.selectedThinkingLevel)}else kT.selectedMode=a.selectedMode,kT.selectedPermissionLevel=a.selectedPermissionLevel,kT.selectedModelKey=a.selectedModelKey,kT.selectedThinkingLevel=a.selectedThinkingLevel;kT.selectedThinkingLevel=yZ(kT.selectedThinkingLevel,OZ()),RZ()||(EZ=!1,NT.settingsSaveStatus=`idle`,NT.settingsMessage=void 0)}function PZ(e,t){let n={...e??{},...t};return(e?.server||t.server)&&(n.server={...e?.server??{},...t.server??{}}),(e?.ui||t.ui)&&(n.ui={...e?.ui??{},...t.ui??{}}),(e?.desktop||t.desktop)&&(n.desktop={...e?.desktop??{},...t.desktop??{}}),(e?.lastAgentSelection||t.lastAgentSelection)&&(n.lastAgentSelection={...e?.lastAgentSelection??{},...t.lastAgentSelection??{}}),(e?.exploreAgent||t.exploreAgent)&&(n.exploreAgent={...e?.exploreAgent??{},...t.exploreAgent??{}}),(e?.compaction||t.compaction)&&(n.compaction={...e?.compaction??{},...t.compaction??{}}),(e?.runtime||t.runtime)&&(n.runtime={...e?.runtime??{},...t.runtime??{}}),n}function FZ(e){return!!(e?.server&&Object.keys(e.server).length>0)}function IZ(e){return!!(e?.runtime&&Object.keys(e.runtime).length>0)}function LZ(){wZ&&=(clearTimeout(wZ),void 0)}function RZ(){return!!(CZ||wZ||TZ)}function zZ(e){let t=gE(NT.models,NT.authProviders,e);t.some(e=>aE(e)===kT.selectedModelKey)||(kT.selectedModelKey=t.length>0?aE(t[0]):``,kT.selectedThinkingLevel=yZ(kT.selectedThinkingLevel,OZ()))}function BZ(e,t={}){if(CZ=PZ(CZ,e),`scopedModels`in e&&zZ(e.scopedModels),NT.settingsSaveStatus=`dirty`,NT.settingsMessage=`Unsaved changes`,LZ(),t.immediate){VZ();return}wZ=setTimeout(()=>void VZ(),t.debounceMs??600)}async function VZ(){if(LZ(),TZ||!CZ)return;let e=CZ;CZ=void 0,TZ=!0,NT.settingsSaveStatus=`saving`,NT.settingsMessage=`Saving…`;try{let t=await Oue(e);if(EZ||=FZ(e),IZ(e)){let e=await Jk().catch(()=>void 0);e&&(Y.config=e,Y.status=e.status)}CZ||(NT.settingsDraft=t,NT.settingsSaveStatus=`saved`,NT.settingsMessage=EZ?`Saved — restart the daemon to apply server binding changes.`:`Saved`)}catch(t){let n=t instanceof Error?t.message:String(t);CZ=PZ(e,CZ??{}),NT.settingsSaveStatus=`error`,NT.settingsMessage=n,cd.error(`Could not save settings`,{description:n})}finally{TZ=!1,CZ&&NT.settingsSaveStatus!==`error`&&VZ()}}function HZ(e){PC(e)}function UZ(e){let t=FC(e);RC(t),NT.settingsDraft&&(NT.settingsDraft.ui.zoomLevel=t),BZ({ui:{zoomLevel:t}})}var WZ={kind:`auth`,id:`auth`};function GZ(){WT(WZ),JT(WZ),JZ()}function KZ(){WT(WZ),JT(WZ),OT.catalogLoaded||JZ()}function qZ(){let e=Y.activeCenterTab?.kind===`auth`,t=KT(WZ);qT(WZ),e&&XT(t)}async function JZ(){let[e]=await Promise.all([qk(),NZ()]);OT.customProviders=e.providers,OT.modelDefinitions=e.models,OT.catalogLoaded=!0}async function YZ(){let e=await qk();OT.customProviders=e.providers,OT.modelDefinitions=e.models,OT.catalogLoaded=!0,await NZ()}var XZ=new Set([`$$slots`,`$$events`,`$$legacy`]);function ZZ(e,t){let n=G(t,XZ),r=[[`path`,{d:`M5 12h14`}],[`path`,{d:`M12 5v14`}]];uc(e,K({name:`plus`},()=>n,{get iconNode(){return r}}))}var QZ=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function $Z(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=G(t,QZ);var i=R();U(N(i),()=>one,(e,t)=>{t(e,K(()=>r,{get open(){return n()},set open(e){n(e)}}))}),z(e,i),O()}var eQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`variant`,`size`]);function tQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`variant`,3,`default`),i=q(t,`size`,3,`default`),a=G(t,eQ);var o=R(),s=N(o);{let e=k(()=>ul(Ol({variant:r(),size:i()}),`cn-alert-dialog-action`,t.class));U(s,()=>dne,(t,r)=>{r(t,K({"data-slot":`alert-dialog-action`,get class(){return I(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,o),O()}var nQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`variant`,`size`]);function rQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`variant`,3,`outline`),i=q(t,`size`,3,`default`),a=G(t,nQ);var o=R(),s=N(o);{let e=k(()=>ul(Ol({variant:r(),size:i()}),`cn-alert-dialog-cancel`,t.class));U(s,()=>mne,(t,r)=>{r(t,K({"data-slot":`alert-dialog-cancel`,get class(){return I(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,o),O()}var iQ=new Set([`$$slots`,`$$events`,`$$legacy`]);function aQ(e,t){let n=G(t,iQ);var r=R();U(N(r),()=>im,(e,t)=>{t(e,K(()=>n))}),z(e,r)}var oQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function sQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,oQ);var i=R(),a=N(i);{let e=k(()=>ul(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-sidebar/70 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50`,t.class));U(a,()=>vh,(t,i)=>{i(t,K({"data-slot":`alert-dialog-overlay`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var cQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`size`,`portalProps`]),lQ=L(`<!> <!>`,1);function uQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`size`,3,`default`),i=G(t,cQ);aQ(e,K(()=>t.portalProps,{children:(e,a)=>{var o=lQ(),s=N(o);sQ(s,{});var c=P(s,2);{let e=k(()=>ul(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-popover text-popover-foreground ring-foreground/10 gap-6 rounded-xl p-6 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none`,t.class));U(c,()=>hh,(t,a)=>{a(t,K({"data-slot":`alert-dialog-content`,get"data-size"(){return r()},get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,o)},$$slots:{default:!0}})),O()}var dQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function fQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,dQ);var i=R(),a=N(i);{let e=k(()=>ul(`text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3`,t.class));U(a,()=>xh,(t,i)=>{i(t,K({"data-slot":`alert-dialog-description`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var pQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),mQ=L(`<div><!></div>`);function hQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,pQ);var i=mQ();Sa(i,e=>({"data-slot":`alert-dialog-footer`,class:e,...r}),[()=>ul(`cn-alert-dialog-footer flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,t.class)]),H(M(i),()=>t.children??w),T(i),Aa(i,e=>n(e),()=>n()),z(e,i),O()}var gQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),_Q=L(`<div><!></div>`);function vQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,gQ);var i=_Q();Sa(i,e=>({"data-slot":`alert-dialog-header`,class:e,...r}),[()=>ul(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,t.class)]),H(M(i),()=>t.children??w),T(i),Aa(i,e=>n(e),()=>n()),z(e,i),O()}var yQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function bQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,yQ);var i=R(),a=N(i);{let e=k(()=>ul(`text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,t.class));U(a,()=>rm,(t,i)=>{i(t,K({"data-slot":`alert-dialog-title`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var xQ=L(`<!> <!>`,1);function SQ(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`confirmLabel`,3,`Confirm`),i=q(t,`cancelLabel`,3,`Cancel`),a=q(t,`destructive`,3,!1);function o(){n(!1),t.onOpenChange?.(!1)}function s(){t.onConfirm?.(),o()}function c(){t.onCancel?.(),o()}var l=R();U(N(l),()=>$Z,(e,o)=>{o(e,{get onOpenChange(){return t.onOpenChange},get open(){return n()},set open(e){n(e)},children:(e,n)=>{var o=R();U(N(o),()=>uQ,(e,n)=>{n(e,{get class(){return t.class},children:(e,n)=>{var o=xQ(),l=N(o);U(l,()=>vQ,(e,n)=>{n(e,{children:(e,n)=>{var r=xQ(),i=N(r);U(i,()=>bQ,(e,n)=>{n(e,{children:(e,n)=>{E();var r=ki();F(()=>B(r,t.title)),z(e,r)},$$slots:{default:!0}})});var a=P(i,2),o=e=>{var n=R();U(N(n),()=>fQ,(e,n)=>{n(e,{children:(e,n)=>{E();var r=ki();F(()=>B(r,t.description)),z(e,r)},$$slots:{default:!0}})}),z(e,n)};V(a,e=>{t.description&&e(o)}),z(e,r)},$$slots:{default:!0}})}),U(P(l,2),()=>hQ,(e,t)=>{t(e,{children:(e,t)=>{var n=xQ(),o=N(n);U(o,()=>rQ,(e,t)=>{t(e,{onclick:c,children:(e,t)=>{E();var n=ki();F(()=>B(n,i())),z(e,n)},$$slots:{default:!0}})});var l=P(o,2);{let e=k(()=>a()?`destructive`:`default`);U(l,()=>tQ,(t,n)=>{n(t,{get variant(){return I(e)},onclick:s,children:(e,t)=>{E();var n=ki();F(()=>B(n,r())),z(e,n)},$$slots:{default:!0}})})}z(e,n)},$$slots:{default:!0}})}),z(e,o)},$$slots:{default:!0}})}),z(e,o)},$$slots:{default:!0}})}),z(e,l),O()}var CQ=new Set([`$$slots`,`$$events`,`$$legacy`]);function wQ(e,t){let n=G(t,CQ),r=[[`path`,{d:`M15 3h6v6`}],[`path`,{d:`M10 14 21 3`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}]];uc(e,K({name:`external-link`},()=>n,{get iconNode(){return r}}))}var TQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`type`,`files`,`class`,`size`,`ariaLabel`,`data-slot`]),EQ=L(`<input/>`);function DQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`value`,15),i=q(t,`files`,15),a=q(t,`size`,3,`default`),o=q(t,`data-slot`,3,`input`),s=G(t,TQ),c=k(()=>a()===`sm`?`h-8`:`h-9`);var l=R(),u=N(l),d=e=>{var a=EQ();Sa(a,e=>({"data-slot":o(),"aria-label":t.ariaLabel,class:e,type:`file`,...s}),[()=>ul(`dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] file:h-7 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,I(c),t.class)],void 0,void 0,void 0,!0),Aa(a,e=>n(e),()=>n()),Cee(a,i),Ea(a,r),z(e,a)},f=e=>{var i=EQ();Sa(i,e=>({"data-slot":o(),"aria-label":t.ariaLabel,class:e,type:t.type,...s}),[()=>ul(`dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] file:h-7 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,I(c),t.class)],void 0,void 0,void 0,!0),Aa(i,e=>n(e),()=>n()),Ea(i,r),z(e,i)};V(u,e=>{t.type===`file`?e(d):e(f,-1)}),z(e,l),O()}function OQ(e){let t=atob(e),n=new ArrayBuffer(t.length),r=new Uint8Array(n);for(let e=0;e<t.length;e+=1)r[e]=t.charCodeAt(e);return n}function kQ(e){let t=new TextEncoder().encode(e),n=new ArrayBuffer(t.length);return new Uint8Array(n).set(t),n}function AQ(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n)}async function jQ(e,t){let n=globalThis.crypto?.subtle;if(!n)throw Error(`Secure cryptography is unavailable. Open the app over HTTPS or on localhost to add credentials.`);let r=await n.importKey(`spki`,OQ(t.publicKey),{name:`RSA-OAEP`,hash:`SHA-256`},!1,[`encrypt`]),i=await n.generateKey({name:`AES-GCM`,length:256},!0,[`encrypt`]),a=new ArrayBuffer(12),o=new Uint8Array(a);globalThis.crypto.getRandomValues(o);let s=await n.encrypt({name:`AES-GCM`,iv:o},i,kQ(e)),c=await n.exportKey(`raw`,i),l=await n.encrypt({name:`RSA-OAEP`},r,c);return{keyId:t.keyId,encryptedKey:AQ(l),iv:AQ(a),ciphertext:AQ(s)}}var MQ=class{#e=A(`choose`);get step(){return I(this.#e)}set step(e){j(this.#e,e,!0)}#t=A(void 0);get selected(){return I(this.#t)}set selected(e){j(this.#t,e,!0)}#n=A(``);get apiKey(){return I(this.#n)}set apiKey(e){j(this.#n,e,!0)}#r=A(``);get promptValue(){return I(this.#r)}set promptValue(e){j(this.#r,e,!0)}#i=A(!1);get busy(){return I(this.#i)}set busy(e){j(this.#i,e,!0)}#a=A(void 0);get error(){return I(this.#a)}set error(e){j(this.#a,e,!0)}#o=A(void 0);get flow(){return I(this.#o)}set flow(e){j(this.#o,e,!0)}#s;#c;constructor(e){this.#c=e}get dialogTitle(){return this.step===`choose`?`Add provider`:this.selected?`Connect ${this.selected.displayName}`:`Add provider`}get dialogDescription(){return this.step===`api-key`?`Your API key is encrypted in your browser before it is sent to the orchestrator.`:this.step===`oauth`?`Complete the subscription login. Secrets are exchanged directly between the orchestrator and the provider.`:`Authenticate with a subscription or an API key.`}#l(){this.#s&&=(clearTimeout(this.#s),void 0)}#u(e){return e.status===`succeeded`||e.status===`failed`||e.status===`cancelled`}#d(){this.#l(),this.#s=setTimeout(async()=>{let e=this.flow;if(!(!e||this.#u(e))){try{this.flow=await Xle(e.flowId)}catch(e){this.error=e instanceof Error?e.message:String(e)}this.flow&&!this.#u(this.flow)&&this.#d()}},800)}reset(){this.#l(),this.step=`choose`,this.selected=void 0,this.apiKey=``,this.promptValue=``,this.busy=!1,this.error=void 0,this.flow=void 0}async close(){let e=this.flow;if(e&&!this.#u(e))try{await Zle(e.flowId)}catch{}this.reset(),this.#c()}chooseProvider(e){this.selected=e,this.error=void 0,e.supportsOAuth?this.beginOAuth(e):this.step=`api-key`}async submitApiKey(){if(!(!this.selected||this.apiKey.trim().length===0)){this.busy=!0,this.error=void 0;try{let e=await Uk(),t=await jQ(this.apiKey.trim(),e);await Wk(this.selected.provider,t),this.apiKey=``,await this.close()}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.busy=!1}}}async beginOAuth(e){this.step=`oauth`,this.busy=!0,this.error=void 0;try{this.flow=await Yle(e.provider),this.#d()}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.busy=!1}}async submitPrompt(){let e=this.flow;if(!e?.promptId)return;let t=this.promptValue;if(!(!e.allowEmpty&&t.trim().length===0)){this.busy=!0,this.error=void 0;try{this.flow=await Kk(e.flowId,{promptId:e.promptId,value:t}),this.promptValue=``,this.#d()}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.busy=!1}}}async selectOption(e){let t=this.flow;if(t?.promptId){this.busy=!0,this.error=void 0;try{this.flow=await Kk(t.flowId,{promptId:t.promptId,selectedId:e}),this.#d()}catch(e){this.error=e instanceof Error?e.message:String(e)}finally{this.busy=!1}}}openExternal(e){window.open(e,`_blank`,`noopener`)}},NQ=L(`<!> <!>`,1),PQ=L(`<p class="add-provider-empty svelte-120w2mx">All known providers are already connected.</p>`),FQ=L(`<li><button type="button" class="provider-choice svelte-120w2mx"><span class="provider-choice-icon svelte-120w2mx" aria-hidden="true"><!></span> <span class="provider-choice-text svelte-120w2mx"><strong class="svelte-120w2mx"> </strong> <span class="svelte-120w2mx"> </span></span> <span class="provider-choice-tags svelte-120w2mx"><!> <!></span></button></li>`),IQ=L(`<ul class="provider-choices svelte-120w2mx"></ul>`),LQ=L(`<span class="api-key-env svelte-120w2mx"> </span>`),RQ=L(`<form class="api-key-form svelte-120w2mx"><label class="api-key-label svelte-120w2mx" for="add-provider-api-key">API key <!></label> <!></form>`),zQ=L(`<p class="oauth-message svelte-120w2mx"> </p>`),BQ=L(`<!> Open login page`,1),VQ=L(`<p class="oauth-hint svelte-120w2mx"> </p>`),HQ=L(`<!> Open verification page`,1),pde=L(`<div class="device-code svelte-120w2mx"><!> <p class="oauth-hint svelte-120w2mx">Enter this code:</p> <code class="device-user-code svelte-120w2mx"> </code></div>`),mde=L(`<div class="oauth-options svelte-120w2mx"></div>`),hde=L(`<form class="oauth-prompt svelte-120w2mx"><!> <!> <!></form>`),gde=L(`<p class="oauth-success svelte-120w2mx"> </p>`),_de=L(`<p class="oauth-progress svelte-120w2mx"><!> Working…</p>`),vde=L(`<p class="oauth-progress svelte-120w2mx"><!> Starting login…</p>`),yde=L(`<div class="oauth-flow svelte-120w2mx" aria-live="polite"><!></div>`),bde=L(`<p class="add-provider-error svelte-120w2mx"><!> </p>`),xde=L(`<div class="add-provider-body svelte-120w2mx"><!> <!></div>`);function UQ(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`authProviders`,19,()=>[]),i=q(t,`kind`,3,`all`),a=q(t,`excludeProviders`,19,()=>[]),o=new MQ(()=>{n(!1),t.onClose?.()}),s=k(()=>new Set(a())),c=k(()=>[...r()].filter(e=>e.configured||I(s).has(e.provider)?!1:i()===`oauth`?e.supportsOAuth:i()===`api_key`?e.supportsApiKey&&!e.supportsOAuth:e.supportsOAuth||e.supportsApiKey).sort((e,t)=>e.displayName.localeCompare(t.displayName)));function l(e){e||o.close()}nZ(e,{get title(){return o.dialogTitle},get description(){return o.dialogDescription},class:`add-provider-dialog`,onOpenChange:l,get open(){return n()},set open(e){n(e)},footer:e=>{var t=NQ(),n=N(t);Ml(n,{variant:`ghost`,onclick:()=>void o.close(),children:(e,t)=>{E(),z(e,ki(`Cancel`))},$$slots:{default:!0}});var r=P(n,2),i=e=>{{let t=k(()=>o.busy||o.apiKey.trim().length===0);Ml(e,{onclick:()=>void o.submitApiKey(),get disabled(){return I(t)},children:(e,t)=>{E();var n=ki();F(()=>B(n,o.busy?`Saving…`:`Save API key`)),z(e,n)},$$slots:{default:!0}})}},a=e=>{{let t=k(()=>o.busy||!o.flow.allowEmpty&&o.promptValue.trim().length===0);Ml(e,{onclick:()=>void o.submitPrompt(),get disabled(){return I(t)},children:(e,t)=>{E(),z(e,ki(`Submit`))},$$slots:{default:!0}})}};V(r,e=>{o.step===`api-key`?e(i):o.step===`oauth`&&o.flow?.status===`prompt`&&e(a,1)}),z(e,t)},children:(e,t)=>{var n=xde(),r=M(n),i=e=>{var t=R(),n=N(t),r=e=>{z(e,PQ())},i=e=>{var t=IQ();Ri(t,21,()=>I(c),e=>e.provider,(e,t)=>{var n=FQ(),r=M(n),i=M(r),a=M(i),s=e=>{uZ(e,{size:16,strokeWidth:2})},c=e=>{qX(e,{size:16,strokeWidth:2})};V(a,e=>{I(t).supportsOAuth?e(s):e(c,-1)}),T(i);var l=P(i,2),u=M(l),d=M(u,!0);T(u);var f=P(u,2),p=M(f,!0);T(f),T(l);var m=P(l,2),h=M(m),g=e=>{uf(e,{tone:`accent`,size:`sm`,children:(e,t)=>{E(),z(e,ki(`Subscription`))},$$slots:{default:!0}})};V(h,e=>{I(t).supportsOAuth&&e(g)});var _=P(h,2),v=e=>{uf(e,{tone:`neutral`,size:`sm`,children:(e,t)=>{E(),z(e,ki(`API key`))},$$slots:{default:!0}})};V(_,e=>{I(t).supportsApiKey&&e(v)}),T(m),T(r),T(n),F(()=>{B(d,I(t).displayName),B(p,I(t).provider)}),bi(`click`,r,()=>o.chooseProvider(I(t))),z(e,n)}),T(t),z(e,t)};V(n,e=>{I(c).length===0?e(r):e(i,-1)}),z(e,t)},a=e=>{var t=RQ(),n=M(t),r=P(M(n)),i=e=>{var t=LQ(),n=M(t,!0);T(t),F(()=>B(n,o.selected.envVar)),z(e,t)};V(r,e=>{o.selected?.envVar&&e(i)}),T(n),DQ(P(n,2),{id:`add-provider-api-key`,type:`password`,autocomplete:`off`,placeholder:`Paste your API key`,get disabled(){return o.busy},get value(){return o.apiKey},set value(e){o.apiKey=e}}),T(t),yi(`submit`,t,e=>{e.preventDefault(),o.submitApiKey()}),z(e,t)},s=e=>{var t=yde(),n=M(t),r=e=>{var t=NQ(),n=N(t),r=e=>{var t=zQ(),n=M(t,!0);T(t),F(()=>B(n,o.flow.message)),z(e,t)};V(n,e=>{o.flow.message&&e(r)});var i=P(n,2),a=e=>{var t=NQ(),n=N(t);Ml(n,{variant:`outline`,onclick:()=>o.flow?.authUrl&&o.openExternal(o.flow.authUrl),children:(e,t)=>{var n=BQ();wQ(N(n),{size:15,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}});var r=P(n,2),i=e=>{var t=VQ(),n=M(t,!0);T(t),F(()=>B(n,o.flow.instructions)),z(e,t)};V(r,e=>{o.flow.instructions&&e(i)}),z(e,t)},s=e=>{var t=pde(),n=M(t);Ml(n,{variant:`outline`,onclick:()=>o.flow?.deviceCode&&o.openExternal(o.flow.deviceCode.verificationUri),children:(e,t)=>{var n=HQ();wQ(N(n),{size:15,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}});var r=P(n,4),i=M(r,!0);T(r),T(t),F(()=>B(i,o.flow.deviceCode.userCode)),z(e,t)},c=e=>{var t=mde();Ri(t,21,()=>o.flow.options,e=>e.id,(e,t)=>{Ml(e,{variant:`outline`,get disabled(){return o.busy},onclick:()=>void o.selectOption(I(t).id),children:(e,n)=>{E();var r=ki();F(()=>B(r,I(t).label)),z(e,r)},$$slots:{default:!0}})}),T(t),z(e,t)},l=e=>{var t=hde(),n=M(t),r=e=>{Ml(e,{variant:`outline`,onclick:()=>o.flow?.authUrl&&o.openExternal(o.flow.authUrl),children:(e,t)=>{var n=BQ();wQ(N(n),{size:15,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}})};V(n,e=>{o.flow.authUrl&&e(r)});var i=P(n,2),a=e=>{var t=VQ(),n=M(t,!0);T(t),F(()=>B(n,o.flow.instructions)),z(e,t)};V(i,e=>{o.flow.instructions&&e(a)});var s=P(i,2);{let e=k(()=>o.flow.placeholder??`Paste the code or redirect URL`);DQ(s,{type:`text`,autocomplete:`off`,get placeholder(){return I(e)},get disabled(){return o.busy},get value(){return o.promptValue},set value(e){o.promptValue=e}})}T(t),yi(`submit`,t,e=>{e.preventDefault(),o.submitPrompt()}),z(e,t)},u=e=>{var t=gde(),n=M(t);T(t),F(()=>B(n,`Connected to ${o.flow.providerName??``}.`)),z(e,t)},d=e=>{var t=_de();tD(M(t),{class:`spin`,size:16,strokeWidth:2}),E(),T(t),z(e,t)};V(i,e=>{o.flow.status===`auth_url`&&o.flow.authUrl?e(a):o.flow.status===`device_code`&&o.flow.deviceCode?e(s,1):o.flow.status===`select`&&o.flow.options?e(c,2):o.flow.status===`prompt`?e(l,3):o.flow.status===`succeeded`?e(u,4):e(d,-1)}),z(e,t)},i=e=>{var t=vde();tD(M(t),{class:`spin`,size:16,strokeWidth:2}),E(),T(t),z(e,t)};V(n,e=>{o.flow?e(r):e(i,-1)}),T(t),z(e,t)};V(r,e=>{o.step===`choose`?e(i):o.step===`api-key`?e(a,1):o.step===`oauth`&&e(s,2)});var l=P(r,2),u=e=>{var t=bde(),n=M(t);Vd(n,{size:14,strokeWidth:2});var r=P(n);T(t),F(()=>B(r,` ${o.error??``}`)),z(e,t)};V(l,e=>{o.error&&e(u)}),T(n),z(e,n)},$$slots:{footer:!0,default:!0}}),O()}xi([`click`]);var Sde=L(`<!> Add API key`,1),Cde=L(`<p class="settings-note">Add a provider API key to authenticate models.</p>`),wde=L(`<span class="svelte-26k56"> </span>`),Tde=L(`<li class="provider-item svelte-26k56"><div class="provider-item-text svelte-26k56"><strong class="svelte-26k56"> </strong> <!></div> <div class="provider-item-actions svelte-26k56"><!> <!></div></li>`),Ede=L(`<ul class="provider-list svelte-26k56"></ul>`),Dde=L(`<section id="auth-api-keys" class="settings-section" data-section="api-keys"><header class="settings-section-header"><div class="settings-section-kicker"><!> API keys</div> <h2>Provider API keys</h2> <p>Add API keys for model providers. Keys are encrypted in your browser before being sent to the orchestrator.</p></header> <div class="settings-section-body"><div class="settings-row providers-summary svelte-26k56"><div class="settings-copy"><strong> </strong> <span>Add a key for OpenAI, Anthropic, Google, Groq, OpenRouter, xAI, and more.</span></div> <!></div> <!></div></section> <!> <!>`,1);function Ode(e,t){D(t,!0);let n=q(t,`authProviders`,19,()=>[]),r=A(!1),i=A(void 0),a=k(()=>new Set(OT.customProviders.map(e=>e.id))),o=k(()=>new Set([`tavily`,...I(a)])),s=k(()=>n().filter(e=>e.configured&&e.credentialType===`api_key`&&!I(o).has(e.provider)).sort((e,t)=>e.displayName.localeCompare(t.displayName))),c=k(()=>[...I(o)]);async function l(){let e=I(i);if(e)try{await Gk(e.provider),await JZ()}catch{}finally{j(i,void 0)}}var u=Dde(),d=N(u),f=M(d),p=M(f);qX(M(p),{size:14,strokeWidth:2.1}),E(),T(p),E(4),T(f);var m=P(f,2),h=M(m),g=M(h),_=M(g),v=M(_,!0);T(_),E(2),T(g),Ml(P(g,2),{size:`sm`,onclick:()=>j(r,!0),children:(e,t)=>{var n=Sde();ZZ(N(n),{size:15,strokeWidth:2.2}),E(),z(e,n)},$$slots:{default:!0}}),T(h);var y=P(h,2),b=e=>{z(e,Cde())},x=e=>{var t=Ede();Ri(t,21,()=>I(s),e=>e.provider,(e,t)=>{var n=Tde(),r=M(n),a=M(r),o=M(a,!0);T(a);var s=P(a,2),c=e=>{var n=wde(),r=M(n,!0);T(n),F(()=>B(r,I(t).envVar)),z(e,n)};V(s,e=>{I(t).envVar&&e(c)}),T(r);var l=P(r,2),u=M(l);uf(u,{tone:`good`,size:`sm`,children:(e,t)=>{E(),z(e,ki(`Configured`))},$$slots:{default:!0}}),Ml(P(u,2),{variant:`ghost`,size:`sm`,onclick:()=>j(i,I(t),!0),children:(e,t)=>{E(),z(e,ki(`Remove`))},$$slots:{default:!0}}),T(l),T(n),F(()=>B(o,I(t).displayName)),z(e,n)}),T(t),z(e,t)};V(y,e=>{I(s).length===0?e(b):e(x,-1)}),T(m),T(d);var S=P(d,2);UQ(S,{get authProviders(){return n()},kind:`api_key`,get excludeProviders(){return I(c)},get open(){return I(r)},set open(e){j(r,e,!0)}});var ee=P(S,2);{let e=k(()=>!!I(i)),t=k(()=>I(i)?`This removes the stored API key for “${I(i).displayName}” from the orchestrator.`:``);SQ(ee,{get open(){return I(e)},title:`Remove API key?`,get description(){return I(t)},confirmLabel:`Remove`,destructive:!0,onConfirm:()=>void l(),onOpenChange:e=>{e||j(i,void 0)}})}F(()=>B(v,I(s).length===0?`No API keys configured`:`${I(s).length} configured`)),z(e,u),O()}var kde=new Set([`$$slots`,`$$events`,`$$legacy`]);function WQ(e,t){let n=G(t,kde),r=[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}],[`path`,{d:`m15 5 4 4`}]];uc(e,K({name:`pencil`},()=>n,{get iconNode(){return r}}))}var Ade=new Set([`$$slots`,`$$events`,`$$legacy`]);function GQ(e,t){let n=G(t,Ade),r=[[`path`,{d:`M10 11v6`}],[`path`,{d:`M14 11v6`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}],[`path`,{d:`M3 6h18`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}]];uc(e,K({name:`trash-2`},()=>n,{get iconNode(){return r}}))}var jde=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function KQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,jde);var i=R(),a=N(i);{let e=k(()=>ul(`gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed`,t.class));U(a,()=>ub,(t,i)=>{i(t,K({"data-slot":`label`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var Mde=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`value`]);function Nde(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`value`,15),i=G(t,Mde);var a=R();U(N(a),()=>Hx,(e,t)=>{t(e,K(()=>i,{get open(){return n()},set open(e){n(e)},get value(){return r()},set value(e){r(e)}}))}),z(e,a),O()}var Pde=new Set([`$$slots`,`$$events`,`$$legacy`]);function Fde(e,t){let n=G(t,Pde);var r=R();U(N(r),()=>im,(e,t)=>{t(e,K(()=>n))}),z(e,r)}var Ide=new Set([`$$slots`,`$$events`,`$$legacy`]);function Lde(e,t){let n=G(t,Ide),r=[[`path`,{d:`m18 15-6-6-6 6`}]];uc(e,K({name:`chevron-up`},()=>n,{get iconNode(){return r}}))}var qQ=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Rde(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,qQ);var i=R(),a=N(i);{let e=k(()=>ul(`bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full`,t.class));U(a,()=>ty,(t,i)=>{i(t,K({"data-slot":`select-scroll-up-button`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)},children:(e,t)=>{Lde(e,{})},$$slots:{default:!0}}))})}z(e,i),O()}var zde=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Bde(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,zde);var i=R(),a=N(i);{let e=k(()=>ul(`bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full`,t.class));U(a,()=>Zv,(t,i)=>{i(t,K({"data-slot":`select-scroll-down-button`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)},children:(e,t)=>{Kw(e,{})},$$slots:{default:!0}}))})}z(e,i),O()}var Vde=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`sideOffset`,`portalProps`,`children`,`preventScroll`]),Hde=L(`<!> <!> <!>`,1);function Ude(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`sideOffset`,3,4),i=q(t,`preventScroll`,3,!0),a=G(t,Vde);Fde(e,K(()=>t.portalProps,{children:(e,o)=>{var s=R(),c=N(s);{let e=k(()=>ul(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-md shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 relative isolate z-50 overflow-x-hidden overflow-y-auto`,t.class));U(c,()=>zv,(o,s)=>{s(o,K({get sideOffset(){return r()},get preventScroll(){return i()},"data-slot":`select-content`,get class(){return I(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=Hde(),i=N(r);Rde(i,{});var a=P(i,2);{let e=k(()=>ul(`max-h-[min(var(--bits-select-content-available-height),18rem)] w-full min-w-(--bits-select-anchor-width) scroll-my-1 p-1`));U(a,()=>qv,(n,r)=>{r(n,{get class(){return I(e)},children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}})})}Bde(P(a,2),{}),z(e,r)},$$slots:{default:!0}}))})}z(e,s)},$$slots:{default:!0}})),O()}var Wde=new Set([`$$slots`,`$$events`,`$$legacy`]);function JQ(e,t){let n=G(t,Wde),r=[[`path`,{d:`M20 6 9 17l-5-5`}]];uc(e,K({name:`check`},()=>n,{get iconNode(){return r}}))}var Gde=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`value`,`label`,`children`]),Kde=L(`<span class="absolute end-2 flex size-3.5 items-center justify-center"><!></span> <!>`,1);function qde(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Gde);var i=R(),a=N(i);{let e=(e,n)=>{let r=()=>n?.().selected,i=()=>n?.().highlighted;var a=Kde(),o=N(a),s=M(o),c=e=>{JQ(e,{class:`cn-select-item-indicator-icon`})};V(s,e=>{r()&&e(c)}),T(o);var l=P(o,2),u=e=>{var n=R();H(N(n),()=>t.children,()=>({selected:r(),highlighted:i()})),z(e,n)},d=e=>{var n=ki();F(()=>B(n,t.label||t.value)),z(e,n)};V(l,e=>{t.children?e(u):e(d,-1)}),z(e,a)},i=k(()=>ul(`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 focus:bg-accent data-highlighted:bg-accent data-highlighted:text-accent-foreground focus:text-accent-foreground relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,t.class));U(a,()=>Wv,(a,o)=>{o(a,K({get value(){return t.value},"data-slot":`select-item`,get class(){return I(i)}},()=>r,{get ref(){return n()},set ref(e){n(e)},children:e,$$slots:{default:!0}}))})}z(e,i),O()}var Jde=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`,`size`]),Yde=L(`<!> <!>`,1);function Xde(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`size`,3,`default`),i=G(t,Jde);var a=R(),o=N(a);{let e=k(()=>ul(`border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,t.class));U(o,()=>Gx,(a,o)=>{o(a,K({"data-slot":`select-trigger`,get"data-size"(){return r()},get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=Yde(),i=N(r);H(i,()=>t.children??w),Kw(P(i,2),{class:`text-muted-foreground size-4 pointer-events-none`}),z(e,r)},$$slots:{default:!0}}))})}z(e,a),O()}var Zde=L(`<span class="truncate"> </span>`),Qde=L(`<span class="truncate text-xs text-muted-foreground"> </span>`),$de=L(`<div class="flex min-w-0 flex-col items-start"><span class="truncate"> </span> <!></div>`),efe=L(`<!> <!>`,1);function YQ(e,t){D(t,!0);let n=q(t,`items`,19,()=>[]),r=q(t,`value`,15,``),i=q(t,`placeholder`,3,`Select`),a=q(t,`disabled`,3,!1),o=k(()=>n().find(e=>e.value===r())?.label);var s=R();U(N(s),()=>Nde,(e,s)=>{s(e,{type:`single`,get disabled(){return a()},get onValueChange(){return t.onValueChange},get value(){return r()},set value(e){r(e)},children:(e,r)=>{var a=efe(),s=N(a);{let e=k(()=>ul(`w-full min-w-0`,t.triggerClass,t.class));U(s,()=>Xde,(n,r)=>{r(n,{size:`sm`,get"aria-label"(){return t.ariaLabel},get class(){return I(e)},children:(e,t)=>{var n=Zde(),r=M(n,!0);T(n),F(()=>B(r,I(o)??i())),z(e,n)},$$slots:{default:!0}})})}U(P(s,2),()=>Ude,(e,r)=>{r(e,{get class(){return t.contentClass},children:(e,t)=>{var r=R();Ri(N(r),17,n,e=>e.value,(e,t)=>{var n=R();U(N(n),()=>qde,(e,n)=>{n(e,{get value(){return I(t).value},get label(){return I(t).label},get disabled(){return I(t).disabled},children:(e,n)=>{var r=$de(),i=M(r),a=M(i,!0);T(i);var o=P(i,2),s=e=>{var n=Qde(),r=M(n,!0);T(n),F(()=>B(r,I(t).detail)),z(e,n)};V(o,e=>{I(t).detail&&e(s)}),T(r),F(()=>B(a,I(t).label)),z(e,r)},$$slots:{default:!0}})}),z(e,n)}),z(e,r)},$$slots:{default:!0}})}),z(e,a)},$$slots:{default:!0}})}),z(e,s),O()}var tfe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`,`data-slot`]),nfe=L(`<textarea></textarea>`);function XQ(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`value`,15),i=q(t,`data-slot`,3,`textarea`),a=G(t,tfe);var o=nfe();Qn(o),Sa(o,e=>({"data-slot":i(),class:e,...a}),[()=>ul(`border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] focus-visible:ring-3 aria-invalid:ring-3 md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50`,t.class)]),Aa(o,e=>n(e),()=>n()),Ea(o,r),z(e,o),O()}var rfe=[{value:`openai-completions`,label:`OpenAI Chat Completions`,detail:`OpenAI-compatible (Ollama, vLLM, Together, Groq…)`},{value:`openai-responses`,label:`OpenAI Responses`,detail:`OpenAI Responses API`},{value:`azure-openai-responses`,label:`Azure OpenAI Responses`},{value:`anthropic-messages`,label:`Anthropic Messages`},{value:`google-generative-ai`,label:`Google Generative AI`},{value:`google-vertex`,label:`Google Vertex AI`},{value:`mistral-conversations`,label:`Mistral Conversations`},{value:`bedrock-converse-stream`,label:`Amazon Bedrock Converse`},{value:`openai-codex-responses`,label:`OpenAI Codex Responses`}],ife=L(`<!> <!>`,1),afe=L(`<p class="field-hint svelte-1rfwnr9" data-tone="error">Use lowercase letters, numbers, and dashes.</p>`),ofe=L(`<p class="field-hint svelte-1rfwnr9" data-tone="error"><!> </p>`),sfe=L(`<div class="provider-form svelte-1rfwnr9"><div class="field-grid svelte-1rfwnr9"><div class="field svelte-1rfwnr9"><!> <!></div> <div class="field svelte-1rfwnr9"><!> <!> <!></div></div> <div class="field svelte-1rfwnr9"><!> <!></div> <div class="field svelte-1rfwnr9"><!> <!></div> <div class="field svelte-1rfwnr9"><!> <!></div> <div class="field svelte-1rfwnr9"><!> <!> <p class="field-hint svelte-1rfwnr9">One <code class="svelte-1rfwnr9">Name: value</code> per line.</p></div> <div class="field svelte-1rfwnr9"><!> <!></div> <!></div>`);function cfe(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`hasKey`,3,!1),i=k(()=>!!t.provider),a=A(``),o=A(``),s=A(`openai-completions`),c=A(``),l=A(``),u=A(``),d=A(``),f=A(!1),p=A(!1),m=A(void 0);sr(()=>{n()&&(j(a,t.provider?.displayName??``,!0),j(o,t.provider?.id??``,!0),j(s,t.provider?.api??`openai-completions`,!0),j(c,t.provider?.baseUrl??``,!0),j(l,g(t.provider?.headers),!0),j(u,t.provider?.compat?JSON.stringify(t.provider.compat,null,2):``,!0),j(d,``),j(f,!1),j(m,void 0))});function h(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,64)}function g(e){return e?Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`
|
|
79
|
-
`):``}function _(e){let t={};for(let n of e.split(/\r?\n/)){let e=n.trim();if(!e)continue;let r=e.indexOf(`:`);if(r===-1)continue;let i=e.slice(0,r).trim(),a=e.slice(r+1).trim();i&&(t[i]=a)}return t}function v(e){j(a,e,!0),!I(i)&&!I(f)&&j(o,h(e),!0)}let y=k(()=>/^[a-z0-9][a-z0-9-]*$/.test(I(o))),b=k(()=>I(a).trim().length>0&&I(y)&&I(c).trim().length>0&&!I(p));async function x(){if(I(b)){j(p,!0),j(m,void 0);try{let e;if(I(u).trim())try{e=JSON.parse(I(u))}catch{throw Error(`Compatibility overrides must be valid JSON.`)}await Qle({id:I(o),displayName:I(a).trim(),api:I(s),baseUrl:I(c).trim(),headers:_(I(l)),...e?{compat:e}:{}});let t=I(d).trim();if(t){let e=await jQ(t,await Uk());await Wk(I(o),e)}await YZ(),n(!1)}catch(e){j(m,e instanceof Error?e.message:String(e),!0)}finally{j(p,!1)}}}{let h=e=>{var t=ife(),r=N(t);Ml(r,{variant:`ghost`,onclick:()=>n(!1),children:(e,t)=>{E(),z(e,ki(`Cancel`))},$$slots:{default:!0}});var a=P(r,2);{let e=k(()=>!I(b));Ml(a,{onclick:()=>void x(),get disabled(){return I(e)},children:(e,t)=>{E();var n=ki();F(()=>B(n,I(p)?`Saving…`:I(i)?`Save provider`:`Add provider`)),z(e,n)},$$slots:{default:!0}})}z(e,t)},g=k(()=>I(i)?`Edit ${t.provider?.displayName}`:`Add custom provider`);nZ(e,{get title(){return I(g)},description:`Connect an OpenAI-compatible or other pi-ai supported endpoint.`,get open(){return n()},set open(e){n(e)},footer:h,children:(e,t)=>{var n=sfe(),h=M(n),g=M(h),_=M(g);KQ(_,{for:`custom-provider-name`,children:(e,t)=>{E(),z(e,ki(`Display name`))},$$slots:{default:!0}}),DQ(P(_,2),{id:`custom-provider-name`,get value(){return I(a)},oninput:e=>v(e.currentTarget.value),placeholder:`My local server`,get disabled(){return I(p)}}),T(g);var b=P(g,2),x=M(b);KQ(x,{for:`custom-provider-id`,children:(e,t)=>{E(),z(e,ki(`Provider id`))},$$slots:{default:!0}});var S=P(x,2);{let e=k(()=>I(p)||I(i)),t=k(()=>!I(y)&&I(o).length>0);DQ(S,{id:`custom-provider-id`,oninput:()=>j(f,!0),placeholder:`ollama`,get disabled(){return I(e)},get"aria-invalid"(){return I(t)},get value(){return I(o)},set value(e){j(o,e,!0)}})}var ee=P(S,2),C=e=>{z(e,afe())};V(ee,e=>{I(o).length>0&&!I(y)&&e(C)}),T(b),T(h);var te=P(h,2),ne=M(te);KQ(ne,{children:(e,t)=>{E(),z(e,ki(`API type`))},$$slots:{default:!0}}),YQ(P(ne,2),{get items(){return rfe},get value(){return I(s)},onValueChange:e=>j(s,e,!0),ariaLabel:`API type`}),T(te);var re=P(te,2),ie=M(re);KQ(ie,{for:`custom-provider-base-url`,children:(e,t)=>{E(),z(e,ki(`Base URL`))},$$slots:{default:!0}}),DQ(P(ie,2),{id:`custom-provider-base-url`,placeholder:`http://localhost:11434/v1`,get disabled(){return I(p)},get value(){return I(c)},set value(e){j(c,e,!0)}}),T(re);var ae=P(re,2),oe=M(ae);KQ(oe,{for:`custom-provider-key`,children:(e,t)=>{E();var n=ki();F(()=>B(n,`API key ${r()?`(stored — leave blank to keep)`:`(optional)`}`)),z(e,n)},$$slots:{default:!0}});var w=P(oe,2);{let e=k(()=>r()?`Paste a replacement key`:`Paste an API key`);DQ(w,{id:`custom-provider-key`,type:`password`,autocomplete:`off`,get placeholder(){return I(e)},get disabled(){return I(p)},get value(){return I(d)},set value(e){j(d,e,!0)}})}T(ae);var se=P(ae,2),ce=M(se);KQ(ce,{for:`custom-provider-headers`,children:(e,t)=>{E(),z(e,ki(`Custom headers (optional)`))},$$slots:{default:!0}}),XQ(P(ce,2),{id:`custom-provider-headers`,rows:3,placeholder:`X-Header: value
|
|
80
|
-
Another-Header: value`,get disabled(){return I(p)},get value(){return I(l)},set value(e){j(l,e,!0)}}),E(2),T(se);var le=P(se,2),ue=M(le);KQ(ue,{for:`custom-provider-compat`,children:(e,t)=>{E(),z(e,ki(`Compatibility overrides (optional JSON)`))},$$slots:{default:!0}}),XQ(P(ue,2),{id:`custom-provider-compat`,rows:3,placeholder:`{ "supportsDeveloperRole": false }`,get disabled(){return I(p)},get value(){return I(u)},set value(e){j(u,e,!0)}}),T(le);var de=P(le,2),fe=e=>{var t=ofe(),n=M(t);Vd(n,{size:14,strokeWidth:2});var r=P(n);T(t),F(()=>B(r,` ${I(m)??``}`)),z(e,t)};V(de,e=>{I(m)&&e(fe)}),T(n),z(e,n)},$$slots:{footer:!0,default:!0}})}O()}var lfe=L(`<!> Add provider`,1),ufe=L(`<p class="settings-note">Add a custom provider to connect a local or self-hosted endpoint.</p>`),dfe=L(`<li class="provider-item svelte-12qrz9d"><div class="provider-item-text svelte-12qrz9d"><strong class="svelte-12qrz9d"> </strong> <span class="svelte-12qrz9d"> </span></div> <div class="provider-item-actions svelte-12qrz9d"><!> <!> <!> <!></div></li>`),ffe=L(`<ul class="provider-list svelte-12qrz9d"></ul>`),pfe=L(`<section id="auth-custom-providers" class="settings-section" data-section="custom-providers"><header class="settings-section-header"><div class="settings-section-kicker"><!> Custom providers</div> <h2>Custom providers</h2> <p>Add OpenAI-compatible and other pi-ai supported endpoints (Ollama, vLLM, LM Studio, proxies, …). Add models under a provider in Custom Models.</p></header> <div class="settings-section-body"><div class="settings-row providers-summary svelte-12qrz9d"><div class="settings-copy"><strong> </strong> <span>Custom providers expose their models to the composer once you add models.</span></div> <!></div> <!></div></section> <!> <!>`,1);function mfe(e,t){D(t,!0);let n=q(t,`authProviders`,19,()=>[]),r=A(!1),i=A(void 0),a=A(void 0),o=k(()=>[...OT.customProviders].sort((e,t)=>e.displayName.localeCompare(t.displayName))),s=k(()=>OT.modelDefinitions.reduce((e,t)=>(e.set(t.provider,(e.get(t.provider)??0)+1),e),new Map));function c(e){let t=n().find(t=>t.provider===e);return!!(t?.configured&&t.credentialType===`api_key`)}function l(){j(i,void 0),j(r,!0)}function u(e){j(i,e,!0),j(r,!0)}async function d(){let e=I(a);if(e)try{await $le(e.id),await YZ()}catch{}finally{j(a,void 0)}}var f=pfe(),p=N(f),m=M(p),h=M(m);iZ(M(h),{size:14,strokeWidth:2.1}),E(),T(h),E(4),T(m);var g=P(m,2),_=M(g),v=M(_),y=M(v),b=M(y,!0);T(y),E(2),T(v),Ml(P(v,2),{size:`sm`,onclick:l,children:(e,t)=>{var n=lfe();ZZ(N(n),{size:15,strokeWidth:2.2}),E(),z(e,n)},$$slots:{default:!0}}),T(_);var x=P(_,2),S=e=>{z(e,ufe())},ee=e=>{var t=ffe();Ri(t,21,()=>I(o),e=>e.id,(e,t)=>{var n=dfe(),r=M(n),i=M(r),o=M(i,!0);T(i);var l=P(i,2),d=M(l);T(l),T(r);var f=P(r,2),p=M(f);{let e=k(()=>c(I(t).id)?`good`:`neutral`);uf(p,{get tone(){return I(e)},size:`sm`,children:(e,n)=>{E();var r=ki();F(e=>B(r,e),[()=>c(I(t).id)?`Key set`:`No key`]),z(e,r)},$$slots:{default:!0}})}var m=P(p,2);uf(m,{tone:`neutral`,size:`sm`,children:(e,n)=>{E();var r=ki();F(e=>B(r,`${e??``} models`),[()=>I(s).get(I(t).id)??0]),z(e,r)},$$slots:{default:!0}});var h=P(m,2);Ml(h,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Edit provider`,onclick:()=>u(I(t)),children:(e,t)=>{WQ(e,{size:14,strokeWidth:2})},$$slots:{default:!0}}),Ml(P(h,2),{variant:`ghost`,size:`icon-sm`,ariaLabel:`Delete provider`,onclick:()=>j(a,I(t),!0),children:(e,t)=>{GQ(e,{size:14,strokeWidth:2})},$$slots:{default:!0}}),T(f),T(n),F(()=>{B(o,I(t).displayName),B(d,`${I(t).id??``} · ${I(t).api??``} · ${I(t).baseUrl??``}`)}),z(e,n)}),T(t),z(e,t)};V(x,e=>{I(o).length===0?e(S):e(ee,-1)}),T(g),T(p);var C=P(p,2);{let e=k(()=>I(i)?c(I(i).id):!1);cfe(C,{get provider(){return I(i)},get hasKey(){return I(e)},get open(){return I(r)},set open(e){j(r,e,!0)}})}var te=P(C,2);{let e=k(()=>!!I(a)),t=k(()=>I(a)?`This removes “${I(a).displayName}”, its stored API key, and its ${I(s).get(I(a).id)??0} model(s).`:``);SQ(te,{get open(){return I(e)},title:`Delete custom provider?`,get description(){return I(t)},confirmLabel:`Delete`,destructive:!0,onConfirm:()=>void d(),onOpenChange:e=>{e||j(a,void 0)}})}F(()=>B(b,I(o).length===0?`No custom providers`:`${I(o).length} configured`)),z(e,f),O()}var hfe=new Set([`$$slots`,`$$events`,`$$legacy`]);function ZQ(e,t){let n=G(t,hfe),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m9 12 2 2 4-4`}]];uc(e,K({name:`circle-check`},()=>n,{get iconNode(){return r}}))}var gfe=L(`<!> `,1),_fe=L(`<p class="integrations-message svelte-1921d9" data-tone="error"><!> </p>`),vfe=L(`<p class="integrations-message svelte-1921d9" data-tone="success"><!> </p>`),yfe=L(`<section id="auth-integrations" class="settings-section" data-section="integrations"><header class="settings-section-header"><div class="settings-section-kicker"><!> Integrations</div> <h2>Web search (Tavily)</h2> <p>Configure the Tavily API key used by the web_search tool. The key is encrypted in your browser before it is stored by the orchestrator.</p></header> <div class="settings-section-body"><div class="settings-row integrations-summary svelte-1921d9"><div class="settings-copy"><strong> </strong> <span> </span></div> <!></div> <form class="integrations-key-form svelte-1921d9"><label class="integrations-key-label svelte-1921d9" for="integrations-tavily-key"><span class="svelte-1921d9"><!> Tavily API key</span> <!></label> <div class="integrations-actions svelte-1921d9"><!> <!></div></form> <!></div></section> <!>`,1);function bfe(e,t){D(t,!0);let n=`tavily`,r=q(t,`authProviders`,19,()=>[]),i=A(``),a=A(!1),o=A(void 0),s=A(void 0),c=A(!1),l=k(()=>r().find(e=>e.provider===n)),u=k(()=>I(l)?.configured&&I(l).credentialType===`api_key`),d=k(()=>I(l)?.displayName??`Tavily`);async function f(){let e=I(i).trim();if(e){j(a,!0),j(o,void 0),j(s,void 0);try{await Wk(n,await jQ(e,await Uk())),j(i,``),j(s,`${I(d)} API key saved.`),await JZ()}catch(e){j(o,e instanceof Error?e.message:String(e),!0)}finally{j(a,!1)}}}async function p(){j(a,!0),j(o,void 0),j(s,void 0);try{await Gk(n),j(i,``),j(s,`${I(d)} API key removed.`),await JZ()}catch(e){j(o,e instanceof Error?e.message:String(e),!0)}finally{j(a,!1),j(c,!1)}}var m=yfe(),h=N(m),g=M(h),_=M(g);cZ(M(_),{size:14,strokeWidth:2.1}),E(),T(_),E(4),T(g);var v=P(g,2),y=M(v),b=M(y),x=M(b),S=M(x,!0);T(x);var ee=P(x,2),C=M(ee,!0);T(ee),T(b);var te=P(b,2);{let e=k(()=>I(u)?`good`:`neutral`);uf(te,{get tone(){return I(e)},size:`sm`,children:(e,t)=>{E();var n=ki();F(()=>B(n,I(u)?`Configured`:`Missing key`)),z(e,n)},$$slots:{default:!0}})}T(y);var ne=P(y,2),re=M(ne),ie=M(re);qX(M(ie),{size:13,strokeWidth:2}),E(),T(ie);var ae=P(ie,2);{let e=k(()=>I(u)?`Paste a replacement key`:`Paste your Tavily API key`);DQ(ae,{id:`integrations-tavily-key`,type:`password`,autocomplete:`off`,get placeholder(){return I(e)},get disabled(){return I(a)},get value(){return I(i)},set value(e){j(i,e,!0)}})}T(re);var oe=P(re,2),w=M(oe);{let e=k(()=>I(a)||I(i).trim().length===0);Ml(w,{type:`submit`,size:`sm`,get disabled(){return I(e)},children:(e,t)=>{var n=gfe(),r=N(n),i=e=>{tD(e,{size:14,strokeWidth:2,class:`animate-spin`})};V(r,e=>{I(a)&&e(i)});var o=P(r);F(()=>B(o,` ${I(u)?`Replace key`:`Save key`}`)),z(e,n)},$$slots:{default:!0}})}var se=P(w,2),ce=e=>{Ml(e,{type:`button`,variant:`ghost`,size:`sm`,get disabled(){return I(a)},onclick:()=>j(c,!0),children:(e,t)=>{E(),z(e,ki(`Remove`))},$$slots:{default:!0}})};V(se,e=>{I(u)&&e(ce)}),T(oe),T(ne);var le=P(ne,2),ue=e=>{var t=_fe(),n=M(t);Vd(n,{size:14,strokeWidth:2});var r=P(n);T(t),F(()=>B(r,` ${I(o)??``}`)),z(e,t)},de=e=>{var t=vfe(),n=M(t);ZQ(n,{size:14,strokeWidth:2});var r=P(n);T(t),F(()=>B(r,` ${I(s)??``}`)),z(e,t)};V(le,e=>{I(o)?e(ue):I(s)&&e(de,1)}),T(v),T(h),SQ(P(h,2),{get open(){return I(c)},title:`Remove Tavily API key?`,description:`This disables the web_search tool until another Tavily key is configured.`,confirmLabel:`Remove`,destructive:!0,onConfirm:()=>void p(),onOpenChange:e=>{j(c,e,!0)}}),F(()=>{B(S,I(u)?`${I(d)} key configured`:`Web search is not configured`),B(C,I(u)?`Agents can search current external information with Tavily.`:`Add a Tavily key to enable the web_search tool.`)}),yi(`submit`,ne,e=>{e.preventDefault(),f()}),z(e,m),O()}var xfe=L(`<span> </span>`),Sfe=L(`<small class="svelte-1dxsajm"> </small>`),Cfe=L(`<label><span class="switch-copy svelte-1dxsajm"><!> <!></span> <!></label>`);function QQ(e,t){D(t,!0);let n=q(t,`checked`,15,!1),r=q(t,`disabled`,3,!1),i=q(t,`class`,3,``);function a(e){n(e),t.onCheckedChange?.(e)}var o=Cfe(),s=M(o),c=M(s),l=e=>{var n=xfe(),r=M(n,!0);T(n),F(()=>B(r,t.label)),z(e,n)};V(c,e=>{t.label&&e(l)});var u=P(c,2),d=e=>{var n=Sfe(),r=M(n,!0);T(n),F(()=>B(r,t.description)),z(e,n)};V(u,e=>{t.description&&e(d)}),T(s),U(P(s,2),()=>tS,(e,i)=>{i(e,{class:`switch-root`,get disabled(){return r()},onCheckedChange:a,get"aria-label"(){return t.label},get checked(){return n()},set checked(e){n(e)},children:(e,t)=>{var n=R();U(N(n),()=>iS,(e,t)=>{t(e,{class:`switch-thumb`})}),z(e,n)},$$slots:{default:!0}})}),T(o),F(e=>ra(o,1,e,`svelte-1dxsajm`),[()=>Zi(ul(`ui-switch-row`,i()))]),z(e,o),O()}var wfe=L(`<!> <!>`,1),Tfe=L(`<p class="field-hint svelte-y7ltyj" data-tone="error"><!> This provider is not configured or authenticated.</p>`),Efe=L(`<button type="button"> </button>`),Dfe=L(`<div class="field svelte-y7ltyj"><!> <!> <p class="field-hint svelte-y7ltyj">Merged on top of the provider headers. One <code class="svelte-y7ltyj">Name: value</code> per line.</p></div>`),Ofe=L(`<p class="field-hint svelte-y7ltyj" data-tone="error"><!> </p>`),kfe=L(`<div class="model-form svelte-y7ltyj"><div class="field svelte-y7ltyj"><!> <!></div> <div class="field-grid svelte-y7ltyj"><div class="field svelte-y7ltyj"><!> <!></div> <div class="field svelte-y7ltyj"><!> <!></div></div> <!> <div class="field-grid svelte-y7ltyj"><div class="field svelte-y7ltyj"><!> <!></div> <div class="field svelte-y7ltyj"><!> <!></div></div> <!> <div class="field svelte-y7ltyj"><!> <div class="chip-row svelte-y7ltyj"></div></div> <!> <!> <!></div>`);function Afe(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`providerItems`,19,()=>[]),i=k(()=>!!t.model),a=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],o=A(``),s=A(``),c=A(``),l=A(!1),u=A(In([`off`])),d=A(!1),f=A(0),p=A(0),m=A(``),h=A(!1),g=A(void 0),_=k(()=>I(i)&&t.model?.provider&&!r().some(e=>e.value===t.model.provider)?[{value:t.model.provider,label:t.model.provider,detail:`Unavailable`},...r()]:r()),v=k(()=>OT.customProviders.some(e=>e.id===I(o))),y=k(()=>r().some(e=>e.value===I(o)));sr(()=>{n()&&(j(o,t.model?.provider??``,!0),j(s,t.model?.modelId??``,!0),j(c,t.model?.name??``,!0),j(l,t.model?.reasoning??!1,!0),j(u,t.model?.supportedThinkingLevels??[`off`],!0),j(d,t.model?.input?.includes(`image`)??!1,!0),j(f,t.model?.contextWindow??0,!0),j(p,t.model?.maxTokens??0,!0),j(m,b(t.model?.headers),!0),j(g,void 0))});function b(e){return e?Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`
|
|
81
|
-
`):``}function x(e){let t={};for(let n of e.split(/\r?\n/)){let e=n.trim();if(!e)continue;let r=e.indexOf(`:`);if(r===-1)continue;let i=e.slice(0,r).trim();i&&(t[i]=e.slice(r+1).trim())}return t}function S(e){j(u,I(u).includes(e)?I(u).filter(t=>t!==e):[...I(u),e],!0)}let ee=k(()=>I(o).trim().length>0&&I(y)&&I(s).trim().length>0&&I(c).trim().length>0&&!I(h));async function C(){if(I(ee)){j(h,!0),j(g,void 0);try{let e=x(I(m));await eue({provider:I(o),modelId:I(s).trim(),name:I(c).trim(),reasoning:I(l),supportedThinkingLevels:I(u).length>0?I(u):[`off`],input:I(d)?[`text`,`image`]:[`text`],contextWindow:Math.max(0,Math.trunc(I(f))),maxTokens:Math.max(0,Math.trunc(I(p))),cost:{input:0,output:0,cacheRead:0,cacheWrite:0},...Object.keys(e).length>0?{headers:e}:{}}),await YZ(),n(!1)}catch(e){j(g,e instanceof Error?e.message:String(e),!0)}finally{j(h,!1)}}}{let r=e=>{var t=wfe(),r=N(t);Ml(r,{variant:`ghost`,onclick:()=>n(!1),children:(e,t)=>{E(),z(e,ki(`Cancel`))},$$slots:{default:!0}});var a=P(r,2);{let e=k(()=>!I(ee));Ml(a,{onclick:()=>void C(),get disabled(){return I(e)},children:(e,t)=>{E();var n=ki();F(()=>B(n,I(h)?`Saving…`:I(i)?`Save model`:`Add model`)),z(e,n)},$$slots:{default:!0}})}z(e,t)},b=k(()=>I(i)?`Edit ${t.model?.name}`:`Add model`);nZ(e,{get title(){return I(b)},description:`Register a model under a configured or authenticated provider.`,get open(){return n()},set open(e){n(e)},footer:r,children:(e,t)=>{var n=kfe(),r=M(n),b=M(r);KQ(b,{children:(e,t)=>{E(),z(e,ki(`Provider`))},$$slots:{default:!0}}),YQ(P(b,2),{get items(){return I(_)},get value(){return I(o)},onValueChange:e=>j(o,e,!0),placeholder:`Select a provider`,ariaLabel:`Provider`,get disabled(){return I(i)}}),T(r);var x=P(r,2),ee=M(x),C=M(ee);KQ(C,{for:`model-id`,children:(e,t)=>{E(),z(e,ki(`Model id`))},$$slots:{default:!0}});var te=P(C,2);{let e=k(()=>I(h)||I(i));DQ(te,{id:`model-id`,placeholder:`llama-3.1-8b`,get disabled(){return I(e)},get value(){return I(s)},set value(e){j(s,e,!0)}})}T(ee);var ne=P(ee,2),re=M(ne);KQ(re,{for:`model-name`,children:(e,t)=>{E(),z(e,ki(`Display name`))},$$slots:{default:!0}}),DQ(P(re,2),{id:`model-name`,placeholder:`Llama 3.1 8B`,get disabled(){return I(h)},get value(){return I(c)},set value(e){j(c,e,!0)}}),T(ne),T(x);var ie=P(x,2),ae=e=>{var t=Tfe();Vd(M(t),{size:14,strokeWidth:2}),E(),T(t),z(e,t)};V(ie,e=>{I(o).length>0&&!I(y)&&e(ae)});var oe=P(ie,2),w=M(oe),se=M(w);KQ(se,{for:`model-context`,children:(e,t)=>{E(),z(e,ki(`Context window (tokens)`))},$$slots:{default:!0}}),DQ(P(se,2),{id:`model-context`,type:`number`,min:`0`,get disabled(){return I(h)},get value(){return I(f)},set value(e){j(f,e,!0)}}),T(w);var ce=P(w,2),le=M(ce);KQ(le,{for:`model-max-tokens`,children:(e,t)=>{E(),z(e,ki(`Max output tokens`))},$$slots:{default:!0}}),DQ(P(le,2),{id:`model-max-tokens`,type:`number`,min:`0`,get disabled(){return I(h)},get value(){return I(p)},set value(e){j(p,e,!0)}}),T(ce),T(oe);var ue=P(oe,2);QQ(ue,{class:`settings-full-switch`,get checked(){return I(l)},label:`Reasoning model`,description:`Enable thinking/reasoning controls for this model.`,onCheckedChange:e=>j(l,e,!0)});var de=P(ue,2),fe=M(de);KQ(fe,{children:(e,t)=>{E(),z(e,ki(`Supported thinking levels`))},$$slots:{default:!0}});var pe=P(fe,2);Ri(pe,20,()=>a,e=>e,(e,t)=>{var n=Efe();let r;var i=M(n,!0);T(n),F(e=>{r=ra(n,1,`chip svelte-y7ltyj`,null,r,e),B(i,t)},[()=>({active:I(u).includes(t)})]),bi(`click`,n,()=>S(t)),z(e,n)}),T(pe),T(de);var me=P(de,2);QQ(me,{class:`settings-full-switch`,get checked(){return I(d)},label:`Image input`,description:`The model accepts image content in addition to text.`,onCheckedChange:e=>j(d,e,!0)});var he=P(me,2),ge=e=>{var t=Dfe(),n=M(t);KQ(n,{for:`model-headers`,children:(e,t)=>{E(),z(e,ki(`Header overrides (optional)`))},$$slots:{default:!0}}),XQ(P(n,2),{id:`model-headers`,rows:2,placeholder:`X-Header: value`,get disabled(){return I(h)},get value(){return I(m)},set value(e){j(m,e,!0)}}),E(2),T(t),z(e,t)};V(he,e=>{I(v)&&e(ge)});var _e=P(he,2),ve=e=>{var t=Ofe(),n=M(t);Vd(n,{size:14,strokeWidth:2});var r=P(n);T(t),F(()=>B(r,` ${I(g)??``}`)),z(e,t)};V(_e,e=>{I(g)&&e(ve)}),T(n),z(e,n)},$$slots:{footer:!0,default:!0}})}O()}xi([`click`]);var jfe=L(`<!> Add model`,1),Mfe=L(`<p class="settings-note">Add a custom provider or authenticate a built-in model provider before adding custom models.</p>`),Nfe=L(`<p class="settings-note">Add a model to expose it in the composer picker.</p>`),Pfe=L(`<span class="orphan-tag svelte-5i6wcq"><!> Unavailable</span>`),Ffe=L(`<li><div class="provider-item-text svelte-5i6wcq"><strong class="svelte-5i6wcq"> </strong> <span class="svelte-5i6wcq"> </span></div> <div class="provider-item-actions svelte-5i6wcq"><!> <!> <!> <!></div></li>`),Ife=L(`<ul class="provider-list svelte-5i6wcq"></ul>`),Lfe=L(`<section id="auth-custom-models" class="settings-section" data-section="custom-models"><header class="settings-section-header"><div class="settings-section-kicker"><!> Custom models</div> <h2>Custom models</h2> <p>Register models under configured custom providers or authenticated built-in providers. Connection settings come from the selected provider.</p></header> <div class="settings-section-body"><div class="settings-row providers-summary svelte-5i6wcq"><div class="settings-copy"><strong> </strong> <span>Add a model with its id, context window, and thinking capability.</span></div> <!></div> <!></div></section> <!> <!>`,1);function Rfe(e,t){D(t,!0);let n=q(t,`models`,19,()=>[]),r=q(t,`authProviders`,19,()=>[]),i=A(!1),a=A(void 0),o=A(void 0),s=k(()=>new Set(OT.customProviders.map(e=>e.id))),c=k(()=>new Set(n().filter(e=>!e.faux).map(e=>e.provider))),l=k(()=>r().filter(e=>e.configured&&I(c).has(e.provider)&&!I(s).has(e.provider)).sort((e,t)=>e.displayName.localeCompare(t.displayName))),u=k(()=>[...OT.customProviders.map(e=>({value:e.id,label:e.displayName,detail:`Custom provider`})).sort((e,t)=>e.label.localeCompare(t.label)),...I(l).map(e=>({value:e.provider,label:e.displayName,detail:e.credentialType===`oauth`?`Subscription login`:`API key configured`}))]),d=k(()=>new Set(I(u).map(e=>e.value))),f=k(()=>[...OT.modelDefinitions].sort((e,t)=>e.provider.localeCompare(t.provider)||e.name.localeCompare(t.name)));function p(e){return OT.customProviders.find(t=>t.id===e)?.displayName??r().find(t=>t.provider===e)?.displayName??e}function m(e){return!I(d).has(e.provider)}function h(){I(u).length!==0&&(j(a,void 0),j(i,!0))}function g(e){j(a,e,!0),j(i,!0)}async function _(){let e=I(o);if(e)try{await tue(e.provider,e.modelId),await YZ()}catch{}finally{j(o,void 0)}}var v=Lfe(),y=N(v),b=M(y),x=M(b);oZ(M(x),{size:14,strokeWidth:2.1}),E(),T(x),E(4),T(b);var S=P(b,2),ee=M(S),C=M(ee),te=M(C),ne=M(te,!0);T(te),E(2),T(C);var re=P(C,2);{let e=k(()=>I(u).length===0);Ml(re,{size:`sm`,onclick:h,get disabled(){return I(e)},children:(e,t)=>{var n=jfe();ZZ(N(n),{size:15,strokeWidth:2.2}),E(),z(e,n)},$$slots:{default:!0}})}T(ee);var ie=P(ee,2),ae=e=>{var t=R(),n=N(t),r=e=>{z(e,Mfe())},i=e=>{z(e,Nfe())};V(n,e=>{I(u).length===0?e(r):e(i,-1)}),z(e,t)},oe=e=>{var t=Ife();Ri(t,21,()=>I(f),e=>`${e.provider}:${e.modelId}`,(e,t)=>{var n=Ffe();let r;var i=M(n),a=M(i),s=M(a,!0);T(a);var c=P(a,2),l=M(c);T(c),T(i);var u=P(i,2),d=M(u),f=e=>{var t=Pfe();Vd(M(t),{size:13,strokeWidth:2}),E(),T(t),z(e,t)},h=k(()=>m(I(t)));V(d,e=>{I(h)&&e(f)});var _=P(d,2),v=e=>{uf(e,{tone:`accent`,size:`sm`,children:(e,t)=>{E(),z(e,ki(`Reasoning`))},$$slots:{default:!0}})};V(_,e=>{I(t).reasoning&&e(v)});var y=P(_,2);Ml(y,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Edit model`,onclick:()=>g(I(t)),children:(e,t)=>{WQ(e,{size:14,strokeWidth:2})},$$slots:{default:!0}}),Ml(P(y,2),{variant:`ghost`,size:`icon-sm`,ariaLabel:`Delete model`,onclick:()=>j(o,I(t),!0),children:(e,t)=>{GQ(e,{size:14,strokeWidth:2})},$$slots:{default:!0}}),T(u),T(n),F((e,i)=>{r=ra(n,1,`provider-item svelte-5i6wcq`,null,r,e),B(s,I(t).name),B(l,`${i??``} · ${I(t).modelId??``}`)},[()=>({orphan:m(I(t))}),()=>p(I(t).provider)]),z(e,n)}),T(t),z(e,t)};V(ie,e=>{I(f).length===0?e(ae):e(oe,-1)}),T(S),T(y);var w=P(y,2);Afe(w,{get model(){return I(a)},get providerItems(){return I(u)},get open(){return I(i)},set open(e){j(i,e,!0)}});var se=P(w,2);{let e=k(()=>!!I(o)),t=k(()=>I(o)?`This removes “${I(o).name}” (${I(o).modelId}) from the catalog.`:``);SQ(se,{get open(){return I(e)},title:`Delete model?`,get description(){return I(t)},confirmLabel:`Delete`,destructive:!0,onConfirm:()=>void _(),onOpenChange:e=>{e||j(o,void 0)}})}F(()=>B(ne,I(f).length===0?`No custom models`:`${I(f).length} added`)),z(e,v),O()}var zfe=L(`<!> Connect subscription`,1),Bfe=L(`<p class="settings-note">Connect a subscription to start authenticating models.</p>`),Vfe=L(`<p class="provider-warning svelte-2gqlbs"><!> </p>`),Hfe=L(`<li class="provider-item svelte-2gqlbs"><div class="provider-item-text svelte-2gqlbs"><strong class="svelte-2gqlbs"> </strong> <span class="svelte-2gqlbs"> </span> <!></div> <div class="provider-item-actions svelte-2gqlbs"><!> <!></div></li>`),Ufe=L(`<ul class="provider-list svelte-2gqlbs"></ul>`),Wfe=L(`<section id="auth-subscriptions" class="settings-section" data-section="subscriptions"><header class="settings-section-header"><div class="settings-section-kicker"><!> Subscriptions</div> <h2>Subscription logins</h2> <p>Connect a ChatGPT or Anthropic subscription with an OAuth login. Secrets are exchanged directly between the orchestrator and the provider.</p></header> <div class="settings-section-body"><div class="settings-row providers-summary svelte-2gqlbs"><div class="settings-copy"><strong> </strong> <span>Use a subscription login to authenticate models without an API key.</span></div> <!></div> <!></div></section> <!> <!>`,1);function Gfe(e,t){D(t,!0);let n=q(t,`authProviders`,19,()=>[]),r=A(!1),i=A(void 0),a=k(()=>n().filter(e=>e.configured&&e.credentialType===`oauth`).sort((e,t)=>e.displayName.localeCompare(t.displayName)));async function o(){let e=I(i);if(e)try{await Gk(e.provider),await JZ()}catch{}finally{j(i,void 0)}}var s=Wfe(),c=N(s),l=M(c),u=M(l);uZ(M(u),{size:14,strokeWidth:2.1}),E(),T(u),E(4),T(l);var d=P(l,2),f=M(d),p=M(f),m=M(p),h=M(m,!0);T(m),E(2),T(p),Ml(P(p,2),{size:`sm`,onclick:()=>j(r,!0),children:(e,t)=>{var n=zfe();ZZ(N(n),{size:15,strokeWidth:2.2}),E(),z(e,n)},$$slots:{default:!0}}),T(f);var g=P(f,2),_=e=>{z(e,Bfe())},v=e=>{var t=Ufe();Ri(t,21,()=>I(a),e=>e.provider,(e,t)=>{var n=Hfe(),r=M(n),a=M(r),o=M(a,!0);T(a);var s=P(a,2),c=M(s,!0);T(s);var l=P(s,2),u=e=>{var n=Vfe(),r=M(n);Vd(r,{size:13,strokeWidth:2,class:`mt-0.5 flex-none`});var i=P(r);T(n),F(()=>B(i,` ${I(t).warning??``}`)),z(e,n)};V(l,e=>{I(t).warning&&e(u)}),T(r);var d=P(r,2),f=M(d);uf(f,{tone:`good`,size:`sm`,children:(e,t)=>{E(),z(e,ki(`Connected`))},$$slots:{default:!0}}),Ml(P(f,2),{variant:`ghost`,size:`sm`,onclick:()=>j(i,I(t),!0),children:(e,t)=>{E(),z(e,ki(`Log out`))},$$slots:{default:!0}}),T(d),T(n),F(()=>{B(o,I(t).displayName),B(c,I(t).oauthName??I(t).provider)}),z(e,n)}),T(t),z(e,t)};V(g,e=>{I(a).length===0?e(_):e(v,-1)}),T(d),T(c);var y=P(c,2);UQ(y,{get authProviders(){return n()},kind:`oauth`,get open(){return I(r)},set open(e){j(r,e,!0)}});var b=P(y,2);{let e=k(()=>!!I(i)),t=k(()=>I(i)?`This removes the stored subscription login for “${I(i).displayName}” from the orchestrator.`:``);SQ(b,{get open(){return I(e)},title:`Log out of provider?`,get description(){return I(t)},confirmLabel:`Log out`,destructive:!0,onConfirm:()=>void o(),onOpenChange:e=>{e||j(i,void 0)}})}F(()=>B(h,I(a).length===0?`No subscriptions connected`:`${I(a).length} connected`)),z(e,s),O()}var Kfe=L(`<button type="button"><!> <span> </span></button>`),qfe=L(`<button type="button" role="tab"> </button>`),Jfe=L(`<div class="settings-subnav" role="tablist"></div>`),Yfe=L(`<!> <!>`,1),Xfe=L(`<div class="settings-main"><header class="settings-panel-header"><h2> </h2> <p> </p> <!></header> <!></div>`),Zfe=L(`<section class="settings-page"><aside class="settings-sidebar" aria-label="Authentication sections"><div class="settings-sidebar-title"><strong>Authentication</strong> <span>Providers & keys</span></div> <nav class="settings-nav"></nav></aside> <!></section>`);function Qfe(e,t){D(t,!0);let n=[{id:`connections`,label:`Connections`,description:`Connect subscription logins and provider API keys.`,icon:uZ,sections:[{id:`subscriptions`,label:`Subscriptions`},{id:`api-keys`,label:`API keys`}]},{id:`custom-providers`,label:`Custom Providers`,description:`Manage custom and self-hosted provider endpoints.`,icon:iZ,sections:[{id:`custom-providers`,label:`Custom Providers`}]},{id:`custom-models`,label:`Custom Models`,description:`Register models under configured or authenticated providers.`,icon:oZ,sections:[{id:`custom-models`,label:`Custom Models`}]},{id:`integrations`,label:`Integrations`,description:`Configure external services used by tools.`,icon:cZ,sections:[{id:`integrations`,label:`Web search`}]}],r=k(()=>NT.authProviders),i=k(()=>NT.models),a=A(`connections`),o=A(`subscriptions`),s=k(()=>n.find(e=>e.id===I(a))??n[0]);OT.catalogLoaded||JZ();function c(e){if(e===I(a))return;j(a,e,!0);let t=n.find(t=>t.id===e)?.sections[0];t&&j(o,t.id,!0),l()}async function l(){await Zr(),document.querySelector(`.settings-viewport`)?.scrollTo({top:0})}function u(e){j(o,e,!0),document.getElementById(`auth-${e}`)?.scrollIntoView({behavior:`smooth`,block:`start`})}sr(()=>{let e=I(s),t,n=!1;return(async()=>{if(await Zr(),n)return;let r=document.querySelector(`.settings-viewport`),i=e.sections.map(e=>document.getElementById(`auth-${e.id}`)).filter(e=>e!==null);if(i.length!==0){t=new IntersectionObserver(e=>{let t=e.filter(e=>e.isIntersecting).sort((e,t)=>e.boundingClientRect.top-t.boundingClientRect.top)[0]?.target.getAttribute(`data-section`);t&&j(o,t,!0)},{root:r,rootMargin:`0px 0px -65% 0px`,threshold:0});for(let e of i)t.observe(e)}})(),()=>{n=!0,t?.disconnect()}});var d=Zfe(),f=M(d),p=P(M(f),2);Ri(p,21,()=>n,Fi,(e,t)=>{let n=k(()=>I(t).icon);var r=Kfe();let i;var o=M(r);U(o,()=>I(n),(e,t)=>{t(e,{size:16,strokeWidth:2})});var s=P(o,2),l=M(s,!0);T(s),T(r),F(()=>{W(r,`aria-current`,I(a)===I(t).id?`page`:void 0),i=ra(r,1,``,null,i,{active:I(a)===I(t).id}),B(l,I(t).label)}),bi(`click`,r,()=>c(I(t).id)),z(e,r)}),T(p),T(f),pZ(P(f,2),{class:`settings-scroll`,viewportClass:`settings-viewport`,type:`auto`,children:(e,t)=>{var n=Xfe(),c=M(n),l=M(c),d=M(l,!0);T(l);var f=P(l,2),p=M(f,!0);T(f);var m=P(f,2),h=e=>{var t=Jfe();Ri(t,21,()=>I(s).sections,Fi,(e,t)=>{var n=qfe();let r;var i=M(n,!0);T(n),F(()=>{W(n,`aria-selected`,I(o)===I(t).id),r=ra(n,1,``,null,r,{active:I(o)===I(t).id}),B(i,I(t).label)}),bi(`click`,n,()=>u(I(t).id)),z(e,n)}),T(t),F(()=>W(t,`aria-label`,`${I(s).label??``} sections`)),z(e,t)};V(m,e=>{I(s).sections.length>1&&e(h)}),T(c);var g=P(c,2),_=e=>{var t=Yfe(),n=N(t);Gfe(n,{get authProviders(){return I(r)}}),Ode(P(n,2),{get authProviders(){return I(r)}}),z(e,t)},v=e=>{mfe(e,{get authProviders(){return I(r)}})},y=e=>{Rfe(e,{get models(){return I(i)},get authProviders(){return I(r)}})},b=e=>{bfe(e,{get authProviders(){return I(r)}})};V(g,e=>{I(a)===`connections`?e(_):I(a)===`custom-providers`?e(v,1):I(a)===`custom-models`?e(y,2):I(a)===`integrations`&&e(b,3)}),T(n),F(()=>{B(d,I(s).label),B(p,I(s).description)}),z(e,n)},$$slots:{default:!0}}),T(d),z(e,d),O()}xi([`click`]);var $Q=new Map,e$=new Set;function t$(e,t){let n=$Q.get(e);return n||(n=new Set,$Q.set(e,n)),n.add(t),()=>{n?.delete(t),n?.size===0&&$Q.delete(e)}}function n$(e){return e$.add(e),()=>{e$.delete(e)}}function $fe(e){let t=[...$Q.get(e.type)??[],...e$];for(let n of t)try{let t=n(e);t instanceof Promise&&t.catch(t=>o$(e,t))}catch(t){o$(e,t)}}var r$=[],i$=!1;function epe(){if(i$)return;i$=!0;let e=()=>{i$=!1,a$()};typeof requestAnimationFrame==`function`?requestAnimationFrame(e):queueMicrotask(e)}function tpe(e){r$.push(e),epe()}function a$(){for(let e=0;e<r$.length;e+=1)$fe(r$[e]);r$.length=0}function o$(e,t){console.error(`Workbench event handler failed`,{type:e.type,seq:e.seq,error:t})}function npe(){return n$(rpe)}function rpe(e){OT.catalogLoaded&&e.type.startsWith(`providers.`)&&YZ()}var ipe=L(`<!> Open authentication`,1),ape=L(`<!> <!>`,1),ope=L(`<div class="audio-auth-body svelte-8zh17m"><div class="audio-auth-summary svelte-8zh17m"><span class="audio-auth-icon svelte-8zh17m" aria-hidden="true"><!></span> <div><h3 class="svelte-8zh17m">Audio input is not configured yet</h3> <p class="svelte-8zh17m">Nerve records from your microphone locally, then sends the captured audio to ChatGPT for transcription through the OpenAI Codex OAuth provider.</p></div></div> <div class="audio-auth-detail svelte-8zh17m"><!> <p class="svelte-8zh17m">A free or paid ChatGPT account can be used. It just needs to be connected so the orchestrator can request transcription securely.</p></div> <p class="audio-auth-path svelte-8zh17m">To enable it, open <strong class="svelte-8zh17m">Authentication</strong> → <strong class="svelte-8zh17m">Subscriptions</strong>, then connect <strong class="svelte-8zh17m">OpenAI Codex</strong>.</p></div>`);function s$(e,t){D(t,!0);let n=q(t,`open`,15,!1);function r(){n(!1)}function i(){r(),GZ()}nZ(e,{title:`Connect ChatGPT to use voice input`,description:`Voice input needs a ChatGPT OAuth connection before Nerve can transcribe recordings.`,class:`audio-auth-required-dialog`,get open(){return n()},set open(e){n(e)},footer:e=>{var t=ape(),n=N(t);Ml(n,{variant:`ghost`,onclick:r,children:(e,t)=>{E(),z(e,ki(`Close`))},$$slots:{default:!0}}),Ml(P(n,2),{onclick:i,children:(e,t)=>{var n=ipe();qX(N(n),{size:15,strokeWidth:2.1}),E(),z(e,n)},$$slots:{default:!0}}),z(e,t)},children:(e,t)=>{var n=ope(),r=M(n),i=M(r);rD(M(i),{size:18,strokeWidth:2.2}),T(i),E(2),T(r);var a=P(r,2);YX(M(a),{size:16,strokeWidth:2.1,"aria-hidden":`true`}),E(2),T(a),E(2),T(n),z(e,n)},$$slots:{footer:!0,default:!0}}),O()}function spe(e){return!!e?.some(e=>e.provider===`openai-codex`&&e.configured&&e.credentialType===`oauth`)}var c$={get configured(){return spe(NT.authProviders)}},cpe=new Set([`$$slots`,`$$events`,`$$legacy`]);function lpe(e,t){let n=G(t,cpe),r=[[`path`,{d:`m14 13-8.381 8.38a1 1 0 0 1-3.001-3l8.384-8.381`}],[`path`,{d:`m16 16 6-6`}],[`path`,{d:`m21.5 10.5-8-8`}],[`path`,{d:`m8 8 6-6`}],[`path`,{d:`m8.5 7.5 8 8`}]];uc(e,K({name:`gavel`},()=>n,{get iconNode(){return r}}))}var upe=L(`<!>Approve & Execute`,1),dpe=L(`<!>Deny`,1),fpe=L(`<article class="approval-card svelte-1v1vlek"><div class="approval-detail svelte-1v1vlek"><div class="detail-row svelte-1v1vlek"><span class="detail-label svelte-1v1vlek">Tool</span> <span class="detail-tool svelte-1v1vlek"> </span></div> <div class="detail-row svelte-1v1vlek"><span class="detail-label svelte-1v1vlek">Risk</span> <span class="detail-risk svelte-1v1vlek"><!> </span></div> <div class="detail-row align-start svelte-1v1vlek"><span class="detail-label svelte-1v1vlek">Reason</span> <span class="detail-reason svelte-1v1vlek"> </span></div> <details class="detail-args svelte-1v1vlek"><summary class="svelte-1v1vlek"> </summary> <pre class="svelte-1v1vlek"> </pre></details></div> <div class="approval-actions svelte-1v1vlek"><!> <!></div></article>`),ppe=L(`<section class="approval-strip svelte-1v1vlek" aria-label="Pending tool approvals"><header class="strip-head svelte-1v1vlek"><div class="head-copy svelte-1v1vlek"><span class="head-icon svelte-1v1vlek"><!></span> <div class="svelte-1v1vlek"><strong class="svelte-1v1vlek">Action Required: Approval Needed</strong> <span class="svelte-1v1vlek">The agent has requested permission to proceed.</span></div></div> <!></header> <div class="approval-list svelte-1v1vlek"></div></section>`);function mpe(e,t){D(t,!0);let n=q(t,`approvals`,19,()=>[]);function r(e){return e===`destructive`||e===`secret`||e===`deployment`?`danger`:e===`command`||e===`network`||e===`workspace_write`?`warn`:e===`agent_spawn`?`accent`:`neutral`}function i(e){let t=e.toolCall?.args;if(t===void 0)return`No arguments.`;try{return JSON.stringify(t,null,2)}catch{return String(t)}}var a=R(),o=N(a),s=e=>{var a=ppe(),o=M(a),s=M(o),c=M(s);lpe(M(c),{size:16,strokeWidth:2.1,"aria-hidden":`true`}),T(c),E(2),T(s),uf(P(s,2),{size:`xs`,tone:`warn`,children:(e,t)=>{E(),z(e,ki(`pending`))},$$slots:{default:!0}}),T(o);var l=P(o,2);Ri(l,21,n,Fi,(e,n)=>{var a=fpe(),o=M(a),s=M(o),c=P(M(s),2),l=M(c,!0);T(c),T(s);var u=P(s,2),d=P(M(u),2),f=M(d);{let e=k(()=>r(I(n).risk));lC(f,{get tone(){return I(e)},size:`sm`})}var p=P(f,1,!0);T(d),T(u);var m=P(u,2),h=P(M(m),2),g=M(h,!0);T(h),T(m);var _=P(m,2),v=M(_),y=M(v);T(v);var b=P(v,2),x=M(b,!0);T(b),T(_),T(o);var S=P(o,2),ee=M(S);Ml(ee,{size:`sm`,onclick:()=>t.onGrantApproval?.(I(n).id),children:(e,t)=>{var n=upe();JQ(N(n),{size:14,strokeWidth:2.4}),E(),z(e,n)},$$slots:{default:!0}}),Ml(P(ee,2),{size:`sm`,variant:`secondary`,onclick:()=>t.onDenyApproval?.(I(n).id),children:(e,t)=>{var n=dpe();ZX(N(n),{size:14,strokeWidth:2.4}),E(),z(e,n)},$$slots:{default:!0}}),T(S),T(a),F(e=>{B(l,I(n).toolCall?.toolName??`tool call`),B(p,I(n).risk),B(g,I(n).reason),B(y,`Arguments · ${I(n).toolCallId??``}`),B(x,e)},[()=>i(I(n))]),z(e,a)}),T(l),T(a),z(e,a)};V(o,e=>{n().length>0&&e(s)}),z(e,a),O()}var hpe=new Set([`$$slots`,`$$events`,`$$legacy`]);function gpe(e,t){let n=G(t,hpe),r=[[`path`,{d:`M6 3v12`}],[`path`,{d:`M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`}],[`path`,{d:`M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`}],[`path`,{d:`M15 6a9 9 0 0 0-9 9`}],[`path`,{d:`M18 15v6`}],[`path`,{d:`M21 18h-6`}]];uc(e,K({name:`git-branch-plus`},()=>n,{get iconNode(){return r}}))}var _pe=new Set([`$$slots`,`$$events`,`$$legacy`]);function l$(e,t){let n=G(t,_pe),r=[[`circle`,{cx:`12`,cy:`12`,r:`3`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`}]];uc(e,K({name:`git-commit-horizontal`},()=>n,{get iconNode(){return r}}))}var vpe=new Set([`$$slots`,`$$events`,`$$legacy`]);function u$(e,t){let n=G(t,vpe),r=[[`circle`,{cx:`18`,cy:`18`,r:`3`}],[`circle`,{cx:`6`,cy:`6`,r:`3`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`}]];uc(e,K({name:`git-pull-request`},()=>n,{get iconNode(){return r}}))}var ype=L(`<button type="button" class="git-suggestion-chip svelte-126jzn8"><!> <span> </span></button>`),bpe=L(`<div class="git-suggestions svelte-126jzn8" role="group" aria-label="Suggested git actions"></div>`);function xpe(e,t){D(t,!0);let n=q(t,`suggestions`,19,()=>[]),r=q(t,`disabled`,3,!1),i={commit:l$,"commit-branch":gpe,"open-pr":u$};var a=R(),o=N(a),s=e=>{var a=bpe();Ri(a,21,n,e=>e.id,(e,n)=>{let a=k(()=>i[I(n).id]);var o=ype(),s=M(o);U(s,()=>I(a),(e,t)=>{t(e,{size:13,strokeWidth:2.2,"aria-hidden":`true`,class:`text-primary`})});var c=P(s,2),l=M(c,!0);T(c),T(o),F(()=>{o.disabled=r(),W(o,`title`,`Click to send. Right-click to insert into composer.\n\n${I(n).prompt}`),W(o,`aria-label`,`${I(n).label}. Click to send. Right-click to insert into composer.`),B(l,I(n).label)}),bi(`click`,o,()=>t.onSend?.(I(n))),bi(`contextmenu`,o,e=>{e.preventDefault(),t.onDraft?.(I(n))}),z(e,o)}),T(a),z(e,a)};V(o,e=>{n().length>0&&e(s)}),z(e,a),O()}xi([`click`,`contextmenu`]);var Spe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Cpe(e,t){let n=G(t,Spe),r=[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`}]];uc(e,K({name:`lock`},()=>n,{get iconNode(){return r}}))}var wpe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Tpe(e,t){let n=G(t,wpe),r=[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`}]];uc(e,K({name:`shield`},()=>n,{get iconNode(){return r}}))}var Epe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Dpe(e,t){let n=G(t,Epe),r=[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`}]];uc(e,K({name:`zap`},()=>n,{get iconNode(){return r}}))}var Ope=L(`<span class="model-tab-suffix svelte-11u25ze"> </span>`),kpe=L(`<span><span class="model-tab-label svelte-11u25ze"> </span> <!> <!></span>`),Ape=L(`<p class="model-picker-empty svelte-11u25ze">No models available. Configure a provider or adjust Scoped Models in Settings.</p>`),jpe=L(`<li><button type="button"><span class="model-row-text svelte-11u25ze"><span class="model-row-label svelte-11u25ze"> </span></span> <!></button></li>`),Mpe=L(`<ul class="model-list svelte-11u25ze"></ul>`),Npe=L(`<button type="button"> </button>`),Ppe=L(`<div class="model-picker-section thinking-section svelte-11u25ze"><p class="model-picker-heading svelte-11u25ze">Thinking level</p> <div class="thinking-grid svelte-11u25ze" role="group" aria-label="Thinking level"></div></div>`),Fpe=L(`<div class="model-picker svelte-11u25ze"><div class="model-picker-section svelte-11u25ze"><p class="model-picker-heading svelte-11u25ze">Model</p> <!></div> <!></div>`);function Ipe(e,t){D(t,!0);let n=q(t,`models`,19,()=>[]),r=q(t,`selectedModelKey`,3,``),i=q(t,`thinkingLevel`,3,`off`),a=q(t,`disabled`,3,!1),o=A(!1),s=k(()=>n().find(e=>aE(e)===r())),c={off:`No reasoning`,minimal:`Very brief reasoning`,low:`Light reasoning`,medium:`Moderate reasoning`,high:`Deep reasoning`,xhigh:`Maximum reasoning`};function l(e){return e===`off`?`Off`:e[0].toUpperCase()+e.slice(1)}let u=k(()=>I(s)?.supportedThinkingLevels?.length?I(s).supportedThinkingLevels:[`off`]),d=k(()=>I(u).length>1),f=k(()=>I(s)?mE(I(s),n()):`Select model`),p=k(()=>I(d)&&i()!==`off`?l(i()):void 0),m=k(()=>`${I(p)?`${I(f)} (${I(p)})`:I(f)}${t.runtimeChangeHint?` · ${t.runtimeChangeHint}`:``}${t.shortcutLabel?` · Cycle thinking ${t.shortcutLabel}`:``}`);function h(e){j(o,a()?!1:e,!0)}function g(e){if(a())return;let n=aE(e);n!==r()&&t.onModelChange?.(n)}function _(e){a()||e!==i()&&t.onThinkingLevelChange?.(e)}sr(()=>{a()&&j(o,!1)}),oC(e,{get open(){return I(o)},onOpenChange:h,class:`model-picker-content`,triggerClass:`composer-tab model-tab`,ariaLabel:`Model and thinking level`,get triggerTitle(){return I(m)},side:`top`,align:`end`,sideOffset:9,trigger:e=>{var t=kpe();let n;var r=M(t),i=M(r,!0);T(r);var o=P(r,2),s=e=>{var t=Ope(),n=M(t);T(t),F(()=>B(n,`(${I(p)??``})`)),z(e,t)};V(o,e=>{I(p)&&e(s)}),Kw(P(o,2),{size:12,strokeWidth:2.2}),T(t),F(()=>{n=ra(t,1,`model-tab-inner svelte-11u25ze`,null,n,{disabled:a()}),W(t,`aria-disabled`,a()),B(i,I(f))}),z(e,t)},children:(e,t)=>{var o=Fpe(),s=M(o),f=P(M(s),2),p=e=>{z(e,Ape())},m=e=>{var t=Mpe();Ri(t,21,n,e=>aE(e),(e,t)=>{let i=k(()=>aE(I(t))===r()),o=k(()=>mE(I(t),n()));var s=jpe(),c=M(s);let l;var u=M(c),d=M(u),f=M(d,!0);T(d),T(u);var p=P(u,2),m=e=>{JQ(e,{size:14,strokeWidth:2.4})};V(p,e=>{I(i)&&e(m)}),T(c),T(s),F(()=>{l=ra(c,1,`model-row svelte-11u25ze`,null,l,{active:I(i)}),W(c,`aria-pressed`,I(i)),c.disabled=a(),B(f,I(o))}),bi(`click`,c,()=>g(I(t))),z(e,s)}),T(t),z(e,t)};V(f,e=>{n().length===0?e(p):e(m,-1)}),T(s);var h=P(s,2),v=e=>{var t=Ppe(),n=P(M(t),2);Ri(n,20,()=>I(u),e=>e,(e,t)=>{let n=k(()=>t===i());var r=Npe();let o;var s=M(r,!0);T(r),F(e=>{o=ra(r,1,`thinking-chip svelte-11u25ze`,null,o,{active:I(n)}),W(r,`aria-pressed`,I(n)),W(r,`title`,c[t]),r.disabled=a(),B(s,e)},[()=>l(t)]),bi(`click`,r,()=>_(t)),z(e,r)}),T(n),T(t),z(e,t)};V(h,e=>{I(d)&&e(v)}),T(o),z(e,o)},$$slots:{trigger:!0,default:!0}}),O()}xi([`click`]);var Lpe=L(`<span class="composer-tab context-usage-tab svelte-1gi3wp6"><span class="ctx-ring svelte-1gi3wp6" aria-hidden="true"><span class="ctx-ring-core svelte-1gi3wp6"></span></span> <span class="ctx-percent svelte-1gi3wp6"> </span> <span class="ctx-window svelte-1gi3wp6"> </span></span>`);function Rpe(e,t){D(t,!0);let n=q(t,`contextWindow`,3,0),r=k(()=>n()||t.contextUsage?.contextWindow||0),i=k(()=>t.contextUsage?.tokens??null),a=k(()=>I(i)!=null&&I(r)>0?I(i)/I(r)*100:t.contextUsage?.percent??null),o=k(()=>I(a)==null?0:Math.max(0,Math.min(100,I(a)))),s=k(()=>nf(I(a))),c=k(()=>I(a)==null?`?%`:`${Math.round(I(a))}%`),l=k(()=>I(i)!=null&&I(r)>0?`Context: ${I(i).toLocaleString()} / ${I(r).toLocaleString()} tokens`:I(r)>0?`Context usage unknown / ${I(r).toLocaleString()} tokens`:`Context window unknown`),u=k(()=>I(r)>0?tf(I(r)):`—`);var d=R(),f=N(d),p=e=>{var t=Lpe(),n=P(M(t),2),r=M(n,!0);T(n);var i=P(n,2),a=M(i);T(i),T(t),F(()=>{W(t,`data-tone`,I(s)),aa(t,`--ctx-fill: ${I(o)}%;`),W(t,`title`,I(l)),W(t,`aria-label`,`${I(l)}. ${I(c)} of context window.`),B(r,I(c)),B(a,`/${I(u)??``}`)}),z(e,t)};V(f,e=>{(I(r)>0||I(a)!=null)&&e(p)}),z(e,d),O()}var zpe=L(`<span><!></span>`),Bpe=L(`<li><button type="button"><!> <span class="permission-row-text svelte-18t7wl6"><span class="permission-row-label svelte-18t7wl6"> </span> <span class="permission-row-detail svelte-18t7wl6"> </span></span></button></li>`),Vpe=L(`<div class="permission-menu svelte-18t7wl6"><p class="permission-heading svelte-18t7wl6">Permission level</p> <ul class="permission-list svelte-18t7wl6"></ul></div>`),Hpe=L(`<div class="composer-tabs svelte-18t7wl6"><!> <button type="button" class="composer-tab mode-tab"> </button> <!> <!></div>`);function Upe(e,t){D(t,!0);let n=[{value:`read_only`,label:`Read only`,detail:`No writes or mutating commands`,icon:Cpe},{value:`supervised`,label:`Supervised`,detail:`Ask before non-read tool calls`,icon:Tpe},{value:`autonomous`,label:`Autonomous`,detail:`Allow tool calls without approval`,icon:Dpe}],r=k(()=>n.find(e=>e.value===t.permissionLevel)??n[2]),i=A(!1);function a(e){e!==t.permissionLevel&&t.onPermissionChange?.(e),j(i,!1)}function o(){t.onModeChange?.(t.mode===`coding`?`planning`:`coding`)}var s=Hpe(),c=M(s);{let e=e=>{let n=k(()=>I(r).icon);var i=zpe();let a;U(M(i),()=>I(n),(e,t)=>{t(e,{size:13,strokeWidth:2.2})}),T(i),F(()=>a=ra(i,1,`permission-tab-inner svelte-18t7wl6`,null,a,{disabled:t.controlsDisabled})),z(e,i)},o=k(()=>t.permissionShortcut?`Permission: ${I(r).label} (${t.permissionShortcut})`:`Permission: ${I(r).label}`);oC(c,{class:`permission-popover-content`,triggerClass:`composer-tab permission-tab`,ariaLabel:`Permission level`,get triggerTitle(){return I(o)},get triggerAriaKeyShortcuts(){return t.permissionShortcutAria},side:`top`,align:`start`,sideOffset:9,get open(){return I(i)},set open(e){j(i,e,!0)},trigger:e,children:(e,r)=>{var i=Vpe(),o=P(M(i),2);Ri(o,21,()=>n,e=>e.value,(e,n)=>{let r=k(()=>I(n).icon);var i=Bpe(),o=M(i);let s;var c=M(o);U(c,()=>I(r),(e,t)=>{t(e,{size:15,strokeWidth:2.1})});var l=P(c,2),u=M(l),d=M(u,!0);T(u);var f=P(u,2),p=M(f,!0);T(f),T(l),T(o),T(i),F(()=>{s=ra(o,1,`permission-row svelte-18t7wl6`,null,s,{active:I(n).value===t.permissionLevel}),W(o,`aria-pressed`,I(n).value===t.permissionLevel),B(d,I(n).label),B(p,I(n).detail)}),bi(`click`,o,()=>a(I(n).value)),z(e,i)}),T(o),T(i),z(e,i)},$$slots:{trigger:!0,default:!0}})}var l=P(c,2),u=M(l,!0);T(l);var d=P(l,2);Rpe(d,{get contextUsage(){return t.contextUsage},get contextWindow(){return t.contextWindow}}),Ipe(P(d,2),{get models(){return t.models},get selectedModelKey(){return t.selectedModelKey},get thinkingLevel(){return t.thinkingLevel},get disabled(){return t.modelDisabled},get onModelChange(){return t.onModelChange},get onThinkingLevelChange(){return t.onThinkingLevelChange},get runtimeChangeHint(){return t.runtimeChangeHint},get shortcutLabel(){return t.thinkingShortcut}}),T(s),F(()=>{l.disabled=t.modeDisabled,W(l,`title`,t.modeShortcut?`Mode: ${t.modeLabel} (${t.modeShortcut})`:`Mode: ${t.modeLabel} (click to switch)`),W(l,`aria-keyshortcuts`,t.modeShortcutAria),B(u,t.modeLabel)}),bi(`click`,l,o),z(e,s),O()}xi([`click`]);function d$(){return typeof navigator>`u`?!1:navigator.platform.toLowerCase().includes(`mac`)||navigator.userAgent.includes(`Mac OS X`)}function f$(e){return e===` `?`space`:e===`Esc`?`escape`:e.toLowerCase()}function Wpe(e){if(/^Key[A-Z]$/.test(e))return e.slice(3).toLowerCase();if(/^Digit[0-9]$/.test(e))return e.slice(5);switch(e){case`BracketLeft`:return`[`;case`BracketRight`:return`]`;case`Minus`:return`-`;case`Equal`:return`=`;case`Period`:return`.`;case`Enter`:case`NumpadEnter`:return`enter`;case`Escape`:return`escape`;default:return}}function Gpe(e){return e instanceof Element?!!e.closest(`input, textarea, select, [contenteditable="true"], .cm-editor`):!1}function Kpe(e,t){let n=d$(),r=!!(t.ctrl||t.mod&&!n),i=!!(t.meta||t.mod&&n),a=!!t.alt,o=!!t.shift;if(e.ctrlKey!==r||e.metaKey!==i||e.altKey!==a||e.shiftKey!==o)return!1;let s=f$(t.key);return f$(e.key)===s||f$(Wpe(e.code)??``)===s}function p$(e){let t=f$(e);return t===`escape`?`Esc`:t===`enter`?`Enter`:t===`space`?`Space`:t.length===1?t.toUpperCase():e}function qpe(e){let t=d$(),n=[];return e.mod&&n.push(t?`⌘`:`Ctrl`),e.ctrl&&n.push(t?`⌃`:`Ctrl`),e.alt&&n.push(t?`⌥`:`Alt`),e.shift&&n.push(t?`⇧`:`Shift`),n.push(p$(e.key)),t?n.join(``):n.join(`+`)}function Jpe(e){let t=d$(),n=[];return e.mod&&n.push(t?`Meta`:`Control`),e.ctrl&&n.push(`Control`),e.alt&&n.push(`Alt`),e.shift&&n.push(`Shift`),n.push(p$(e.key)),n.join(`+`)}var m$=[{id:`conversation.new`,label:`New chat`,category:`Conversation`,defaultBinding:{key:`n`,mod:!0}},{id:`conversation.newFromProject`,label:`New chat from project`,category:`Conversation`,defaultBinding:{key:`n`,mod:!0,shift:!0}},{id:`pane.close`,label:`Close pane`,category:`Panes`,defaultBinding:{key:`w`,mod:!0}},{id:`pane.closeOthers`,label:`Close other panes`,category:`Panes`,defaultBinding:{key:`w`,mod:!0,shift:!0}},{id:`pane.refresh`,label:`Refresh pane`,category:`Panes`,defaultBinding:{key:`r`,mod:!0}},{id:`pane.previous`,label:`Previous pane`,category:`Panes`,defaultBinding:{key:`[`,mod:!0}},{id:`pane.next`,label:`Next pane`,category:`Panes`,defaultBinding:{key:`]`,mod:!0}},...Array.from({length:9},(e,t)=>{let n=t+1;return{id:`pane.focusByIndex.${n}`,label:`Focus pane ${n}`,category:`Panes`,defaultBinding:{key:String(n),mod:!0}}}),{id:`projectSearch.focus`,label:`Focus project search`,category:`Conversation`,defaultBinding:{key:`k`,mod:!0}},{id:`composer.focus`,label:`Focus composer`,category:`Composer`,defaultBinding:{key:`escape`},allowInEditable:!0},{id:`composer.send`,label:`Send prompt`,category:`Composer`,defaultBinding:{key:`enter`,mod:!0},allowInEditable:!0},{id:`composer.stopRun`,label:`Stop active run`,category:`Composer`,defaultBinding:{key:`.`,mod:!0},allowInEditable:!0},{id:`composer.toggleMic`,label:`Toggle voice recording`,category:`Composer`,defaultBinding:{key:`v`,alt:!0},allowInEditable:!0},{id:`composer.cancelMic`,label:`Cancel voice recording`,category:`Composer`,defaultBinding:{key:`escape`},allowInEditable:!0},{id:`composer.toggleMode`,label:`Toggle coding/planning mode`,category:`Composer`,defaultBinding:{key:`m`,alt:!0},allowInEditable:!0},{id:`composer.cyclePermission`,label:`Cycle permission level`,category:`Composer`,defaultBinding:{key:`p`,alt:!0},allowInEditable:!0},{id:`composer.cycleThinking`,label:`Cycle thinking level`,category:`Composer`,defaultBinding:{key:`t`,alt:!0},allowInEditable:!0},{id:`zoom.in`,label:`Zoom in`,category:`View`,defaultBinding:{key:`=`,mod:!0}},{id:`zoom.out`,label:`Zoom out`,category:`View`,defaultBinding:{key:`-`,mod:!0}},{id:`zoom.reset`,label:`Reset zoom`,category:`View`,defaultBinding:{key:`0`,mod:!0}}];function Ype(e){return m$.find(t=>t.id===e)}function h$(e){return Ype(e)?.defaultBinding}function g$(e){let t=h$(e);return t?qpe(t):void 0}function _$(e){let t=h$(e);return t?Jpe(t):void 0}var Xpe=L(`<form class="composer svelte-h31act"><!> <!> <div class="composer-surface svelte-h31act"><div class="editor-shell svelte-h31act"><!> <!> <div class="composer-send svelte-h31act"><!> <!> <!> <!></div></div></div></form> <!>`,1);function Zpe(e,t){D(t,!0);let n=q(t,`text`,3,``),r=q(t,`pendingConversationActive`,3,!1),i=q(t,`approvals`,19,()=>[]),a=q(t,`interactive`,3,!0);q(t,`live`,3,!1);let o=q(t,`sending`,3,!1),s=q(t,`compacting`,3,!1),c=q(t,`models`,19,()=>[]),l=q(t,`selectedModelKey`,3,``),u=q(t,`contextWindow`,3,0),d=q(t,`focusToken`,3,0),f=q(t,`composerEscapeToken`,3,0),p=q(t,`micShortcutToken`,3,0),m=q(t,`thinkingLevel`,3,`off`),h=q(t,`mode`,3,`coding`),g=q(t,`permissionLevel`,3,`autonomous`),_=q(t,`slashCompletions`,19,()=>[]),v=q(t,`gitSuggestions`,19,()=>[]),y=A(0),b=A(!1),x=A(void 0),S=A(void 0),ee=A(void 0),C=A(!1),te=g$(`composer.toggleMic`),ne=_$(`composer.toggleMic`),re=g$(`composer.cancelMic`),ie=g$(`composer.toggleMode`),ae=_$(`composer.toggleMode`),oe=g$(`composer.cyclePermission`),w=_$(`composer.cyclePermission`),se=g$(`composer.cycleThinking`),ce=g$(`composer.stopRun`),le=_$(`composer.stopRun`),ue=k(()=>{if(t.activeConversation)return{kind:`conversation`,id:t.activeConversation.id};if(t.activePendingConversation)return{kind:`pending-conversation`,id:t.activePendingConversation.id}}),de=k(()=>!!(I(ue)&&TA.isTargetActive(I(ue))&&TA.recording)),fe=k(()=>!!(I(ue)&&TA.isTargetActive(I(ue))&&TA.transcribing)),pe=k(()=>!!(I(ue)&&TA.isBusyForOtherTarget(I(ue)))),me=k(()=>i().length>0),he=k(()=>!!t.pendingUserQuestion),ge=k(()=>!!t.pendingPlanReview),_e=k(()=>I(me)||I(he)||I(ge)),ve=k(()=>!!(t.activeProject&&(t.activeConversation||r())&&c().length>0&&!I(_e)&&!s())),ye=k(()=>!a()||!I(ve)),be=k(()=>ak(n())),xe=k(()=>Hse(n())),Se=k(()=>!a()||!I(ve)||I(b)||I(be)&&o()),Ce=k(()=>c$.configured),we=k(()=>TA.isSupported()),Te=k(()=>!a()||!I(ue)||TA.pending||!I(de)&&(!I(ve)||!I(we)||I(pe))),Ee=k(()=>I(de)?`Stop recording${te?` (${te})`:``} — ${re??`Esc`} to cancel; right-click to cancel (${ke(TA.elapsedMs)} / ${ke(TA.maxDurationMs)})`:I(pe)?`Voice recording is active in another conversation`:TA.retryAttempt>0&&I(ue)&&TA.isTargetActive(I(ue))?`Retrying transcription ${TA.retryAttempt}/${TA.maxRetries}…`:I(fe)?`Transcribing audio…`:I(Ce)?te?`Record voice prompt (${te})`:`Record voice prompt`:`Connect ChatGPT to use voice input`),De=k(()=>I(b)?`Transcribing and sending prompt`:I(de)?`Transcribe and send prompt`:s()?`Compacting context`:I(be)?`Run command`:o()?`Queue prompt`:`Send prompt`),Oe=k(()=>I(b)?`Transcribing audio, then sending prompt`:I(de)?`Stop recording, transcribe, and send prompt`:s()?`Compacting context`:I(be)?o()?`Wait for the current agent turn before running a command`:`Run command`:o()?`Queue prompt for the next agent turn`:`Send prompt`);function ke(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}async function Ae(){if(!(!a()||I(_e)||s()||I(b)||I(be)&&o())){if(I(de)&&I(ue)){j(b,!0);try{await TA.stop(I(ue))&&t.onSubmit?.()}finally{j(b,!1)}return}t.onSubmit?.()}}async function je(e){return aue(e)}let Me=k(()=>!a()||!(t.activeConversation||r())||o()||s()||I(_e)),Ne=k(()=>!a()||!(t.activeConversation||r())),Pe=k(()=>!a()||!(t.activeConversation||r())||c().length===0||s()),Fe=k(()=>o()?`Changes apply to the next model request`:void 0),Ie=k(()=>h()===`planning`?`Planning`:`Coding`);function Le(){if(!(!a()||I(Te)||s()||!I(ue))){if(!I(de)&&!I(Ce)){j(C,!0);return}TA.toggle(I(ue))}}function Re(){return!I(de)||!I(ue)?!1:(TA.cancel(I(ue)),!0)}sr(()=>{if(I(x)===void 0||!a()){j(x,d());return}d()!==I(x)&&(j(x,d()),j(y,I(y)+1))}),sr(()=>{if(I(S)===void 0||!a()){j(S,f());return}f()!==I(S)&&(j(S,f()),Re()||j(y,I(y)+1))}),sr(()=>{if(I(ee)===void 0||!a()){j(ee,p());return}p()!==I(ee)&&(j(ee,p()),Le())});function ze(e){!I(de)||!I(ue)||(e.preventDefault(),TA.cancel(I(ue)))}var Be=Xpe(),Ve=N(Be),He=M(Ve);mpe(He,{get approvals(){return i()},get onGrantApproval(){return t.onGrantApproval},get onDenyApproval(){return t.onDenyApproval}});var Ue=P(He,2),We=e=>{xpe(e,{get suggestions(){return v()},get onSend(){return t.onSendGitSuggestion},get onDraft(){return t.onDraftGitSuggestion}})};V(Ue,e=>{v().length>0&&!I(_e)&&!o()&&!s()&&I(ve)&&e(We)});var Ge=P(Ue,2),Ke=M(Ge),qe=M(Ke);Upe(qe,{get controlsDisabled(){return I(Me)},get modeDisabled(){return I(Ne)},get modelDisabled(){return I(Pe)},get mode(){return h()},get permissionLevel(){return g()},get modeLabel(){return I(Ie)},get permissionShortcut(){return oe},get permissionShortcutAria(){return w},get modeShortcut(){return ie},get modeShortcutAria(){return ae},get thinkingShortcut(){return se},get contextUsage(){return t.contextUsage},get contextWindow(){return u()},get models(){return c()},get selectedModelKey(){return l()},get thinkingLevel(){return m()},get onModeChange(){return t.onModeChange},get runtimeChangeHint(){return I(Fe)},get onModelChange(){return t.onModelChange},get onThinkingLevelChange(){return t.onThinkingLevelChange},get onPermissionChange(){return t.onPermissionChange}});var Je=P(qe,2);{let e=k(()=>I(me)?`Approval required before the agent can continue`:I(ge)?`Review the plan in the transcript before the agent can continue`:I(he)?`Reply in the transcript before the agent can continue`:s()?`Compacting context…`:o()?`Queue a prompt for the next agent turn`:`Ask the local Nerve agent`);GX(Je,{get value(){return n()},get disabled(){return I(ye)},get placeholder(){return I(e)},get slashCompletions(){return _()},get fileCompletions(){return t.fileCompletions},get focusToken(){return I(y)},get onChange(){return t.onChange},onSubmit:Ae,onPasteImage:je})}var Ye=P(Je,2),Xe=M(Ye);{let e=k(()=>I(ue)&&TA.isTargetActive(I(ue))?TA.retryAttempt:0);rA(Xe,{get recording(){return I(de)},get transcribing(){return I(fe)},get elapsedMs(){return TA.elapsedMs},get maxDurationMs(){return TA.maxDurationMs},get retryAttempt(){return I(e)},get maxRetries(){return TA.maxRetries},class:`composer-transcription-status`})}var Ze=P(Xe,2);{let e=k(()=>I(de)?`destructive`:`secondary`),t=k(()=>`mic-button${I(de)?` recording`:``}`),n=k(()=>I(de)?`Stop recording; right-click to cancel`:I(Ce)?`Record voice prompt`:`Connect ChatGPT to use voice input`);Ml(Ze,{get variant(){return I(e)},size:`icon-sm`,get class(){return I(t)},type:`button`,get disabled(){return I(Te)},onclick:Le,oncontextmenu:ze,get"aria-label"(){return I(n)},get"aria-keyshortcuts"(){return ne},get title(){return I(Ee)},children:(e,t)=>{var n=R(),r=N(n),i=e=>{tD(e,{size:14,strokeWidth:2.4,class:`spin`})},a=e=>{rD(e,{size:14,strokeWidth:2.4})};V(r,e=>{I(fe)?e(i):e(a,-1)}),z(e,n)},$$slots:{default:!0}})}var Qe=P(Ze,2),$e=e=>{{let n=k(()=>ce?`Stop generation (${ce})`:`Stop generation`);Ml(e,{variant:`destructive`,size:`icon-sm`,class:`stop-button`,get onclick(){return t.onAbort},"aria-label":`Stop generation`,get"aria-keyshortcuts"(){return le},get title(){return I(n)},children:(e,t)=>{sD(e,{size:13,strokeWidth:2.5})},$$slots:{default:!0}})}};V(Qe,e=>{o()&&!I(he)&&!s()&&e($e)}),Ml(P(Qe,2),{size:`icon-sm`,class:`send-button`,type:`submit`,get disabled(){return I(Se)},get"aria-label"(){return I(De)},get title(){return I(Oe)},children:(e,t)=>{aD(e,{size:14,strokeWidth:2.4})},$$slots:{default:!0}}),T(Ye),T(Ke),T(Ge),T(Ve),s$(P(Ve,2),{get open(){return I(C)},set open(e){j(C,e,!0)}}),F(()=>{W(Ve,`data-pending-approval`,I(me)?`true`:void 0),W(Ve,`data-pending-question`,I(he)?`true`:void 0),W(Ve,`data-pending-plan`,I(ge)?`true`:void 0),W(Ge,`data-mode`,h()),W(Ge,`data-command-mode`,I(be)?`true`:void 0),W(Ge,`data-executable-blocks`,I(xe)?`true`:void 0)}),yi(`submit`,Ve,e=>{e.preventDefault(),Ae()}),z(e,Be),O()}var Qpe=new Set([`$$slots`,`$$events`,`$$legacy`]);function v$(e,t){let n=G(t,Qpe),r=[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}]];uc(e,K({name:`folder`},()=>n,{get iconNode(){return r}}))}var $pe=new Set([`$$slots`,`$$events`,`$$legacy`]);function eme(e,t){let n=G(t,$pe),r=[[`path`,{d:`M16 5H3`}],[`path`,{d:`M11 12H3`}],[`path`,{d:`M16 19H3`}],[`path`,{d:`M18 9v6`}],[`path`,{d:`M21 12h-6`}]];uc(e,K({name:`list-plus`},()=>n,{get iconNode(){return r}}))}function tme(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function y$(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function b$(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var nme=(e,t)=>Math.abs(e-t)<1.01,rme=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},x$,S$=()=>{if(x$!==void 0)return x$;if(typeof navigator>`u`)return x$=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return x$=!0;let e=navigator.maxTouchPoints;return x$=navigator.platform===`MacIntel`&&e!==void 0&&e>0},C$=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},ime=e=>e,ame=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},ome=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(C$(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(C$(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},w$={passive:!0},sme=typeof window>`u`?!0:`onscrollend`in window,cme=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&sme,o=0,s=a?null:rme(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,w$),a&&r.addEventListener(`scrollend`,u,w$),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},lme=(e,t)=>cme(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),ume=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},dme=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},fme=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ime,rangeExtractor:ame,onChange:()=>{},measureElement:ume,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=e.start+t;n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=y$(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!S$()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,w$),e.addEventListener(`touchend`,n,w$),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(S$()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=y$(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=y$(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{let c=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=this.options.gap,a=e*2,o=this._flatMeasurements;if(!o||o.length<a){let e=new Float64Array(a);o&&l>0&&e.set(o.subarray(0,l*2)),o=e,this._flatMeasurements=o}let s;if(l===0)s=t+n;else{let e=l-1;s=o[e*2]+o[e*2+1]+i}for(let t=l;t<e;t++){let e=r(t),n=c.get(e),a=typeof n==`number`?n:this.options.estimateSize(t);o[t*2]=s,o[t*2+1]=a,s+=a+i}let u=tme(e,o,r);return this.measurementsCache=u,u}let u=this.measurementsCache.slice(0,l),d=Array(a).fill(void 0);for(let e=0;e<l;e++){let t=u[e];t&&(d[t.lane]=e)}for(let i=l;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,l,f=o===`estimate`||c.has(e);if(a!==void 0&&this.options.lanes>1){s=a;let e=d[s],r=e===void 0?void 0:u[e];l=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?u[i-1]:this.getFurthestMeasurement(u,i);l=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,s)}let p=c.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=l+m;u[i]={index:i,start:l,size:m,end:h,key:e,lane:s},d[s]=i}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=y$(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?pme({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:r===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=y$(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);if(o!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,s=a?this.getTotalSize():0,c=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(i)||this.scrollDirection!==`backward`):this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-s):c&&this.applyScrollAdjustment(o),this.notify(!1)}},this.getVirtualItems=y$(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return b$(t[T$(0,t.length-1,r?e=>n[e*2]:e=>b$(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(S$()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&nme(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},T$=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function pme({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:i}){let a=e.length-1,o=i?e=>i[e*2]:t=>e[t].start,s=i?e=>i[e*2]+i[e*2+1]:t=>e[t].end;if(e.length<=r)return{startIndex:0,endIndex:a};let c=T$(0,a,o,n),l=c;if(r===1)for(;l<a&&s(l)<n+t;)l++;else if(r>1){let i=Array(r).fill(0);for(;l<a&&i.some(e=>e<n+t);){let t=e[l];i[t.lane]=t.end,l++}let o=Array(r).fill(n+t);for(;c>=0&&o.some(e=>e>=n);){let t=e[c];o[t.lane]=t.start,c--}c=Math.max(0,c-c%r),l=Math.min(a,l+(r-1-l%r))}return{startIndex:c,endIndex:l}}function mme(e){let t=new fme(e),n=t.setOptions,r,i=e=>{let i={...t.options,...e,onChange:e.onChange};n({...i,onChange:(e,t)=>{r.set(e),i.onChange?.(e,t)}}),t._willUpdate(),r.set(t)};return r=Ut(t,()=>(i(e),t._didMount())),Wt(r,e=>Object.assign(e,{setOptions:i}))}function hme(e){return mme({observeElementRect:ome,observeElementOffset:lme,scrollToFn:dme,...e})}var E$=class{max;#e=new Map;constructor(e){if(this.max=e,e<=0)throw Error(`LruCache max must be a positive integer.`)}get(e){let t=this.#e.get(e);return t===void 0?this.#e.has(e)?t:void 0:(this.#e.delete(e),this.#e.set(e,t),t)}has(e){return this.#e.has(e)}set(e,t){if(this.#e.has(e)&&this.#e.delete(e),this.#e.set(e,t),this.#e.size>this.max){let e=this.#e.keys().next().value;this.#e.delete(e)}}delete(e){this.#e.delete(e)}clear(){this.#e.clear()}get size(){return this.#e.size}},D$=new E$(12);function gme(e){let t=D$.get(e);t||(t=new Map,D$.set(e,t));let n=t;return{get:e=>n.get(e),set:(e,t)=>{t>0&&n.set(e,t)},get size(){return n.size}}}var _me=L(`<div><!></div>`),vme=L(`<div><div></div></div>`);function O$(e,t){D(t,!0);let n=q(t,`contentVisibility`,3,!1),r=q(t,`overscan`,3,8),i=q(t,`anchor`,3,`start`),a=q(t,`followOutput`,3,!1),o=q(t,`paddingStart`,3,0),s=q(t,`paddingEnd`,3,0),c=q(t,`controller`,15),l=q(t,`atEnd`,15,!0),u=A(null),d=k(()=>t.heightCacheKey?gme(t.heightCacheKey):void 0);function f(e){let n=t.items[e];return n===void 0?`__missing__:${e}`:t.getKey(n,e)}function p(e){let n=I(d)?.get(f(e));return n===void 0?t.estimateSize?.(e)??64:n}let m=hme({count:0,getScrollElement:()=>I(u),estimateSize:e=>p(e),getItemKey:f}),h=ree(m),g=A(In(h.getVirtualItems())),_=A(In(h.getTotalSize())),v=k(()=>I(g).filter(e=>e.index>=0&&e.index<t.items.length)),y,b=0;function x(){return i()===`end`&&!!a()}function S(){return a()===`smooth`?`smooth`:`auto`}function ee(){y!==void 0&&(cancelAnimationFrame(y),y=void 0)}function C(e=8){x()&&(b=Math.max(b,e),y===void 0&&(y=requestAnimationFrame(()=>{if(y=void 0,!x()){b=0;return}h.scrollToEnd({behavior:S()}),te(),--b,b>0&&!h.isAtEnd(t.scrollEndThreshold)?C(b):b=0})))}function te(){j(g,h.getVirtualItems(),!0),j(_,h.getTotalSize(),!0),l(h.isAtEnd(t.scrollEndThreshold))}sr(()=>m.subscribe(te));let ne=``;sr(()=>{I(u);let e=t.items.length===0?`0`:`${t.items.length}\0${String(f(0))}\0${String(f(t.items.length-1))}`,n=e!==ne;ne=e,h.setOptions({count:t.items.length,overscan:r(),anchorTo:i(),followOnAppend:a(),paddingStart:o(),paddingEnd:s(),...t.scrollEndThreshold===void 0?{}:{scrollEndThreshold:t.scrollEndThreshold},...t.gap===void 0?{}:{gap:t.gap}}),te(),x()?n&&C():(ee(),b=0)});function re(){l(h.isAtEnd(t.scrollEndThreshold))}sr(()=>{I(u),c({scrollToEnd:e=>h.scrollToEnd(e),scrollToIndex:(e,t)=>h.scrollToIndex(e,t),isAtEnd:e=>h.isAtEnd(e??t.scrollEndThreshold),getDistanceFromEnd:()=>h.getDistanceFromEnd(),getViewportElement:()=>I(u),measureAll:()=>h.measure()})});let ie=new Map,ae;function oe(e){return e.getClientRects().length>0}function w(e){if(oe(e))return e.offsetHeight}function se(){if(ae=void 0,ie.size===0)return;let e=[];for(let[t,n]of ie){let r=w(n);r!==void 0&&e.push([t,r])}ie.clear();let t=I(d);for(let[n,r]of e)h.resizeItem(n,r),t?.set(f(n),r);C(3)}function ce(e){if(!oe(e))return;h.measureElement(e);let t=Number(e.dataset.index);Number.isNaN(t)||ie.set(t,e),ae===void 0&&(ae=requestAnimationFrame(se))}function le(){ae!==void 0&&(cancelAnimationFrame(ae),ae=void 0)}function ue(e){let t=w(e)??0,n;return ce(e),typeof ResizeObserver<`u`&&(n=new ResizeObserver(()=>{let n=w(e);n===void 0||n===t||(t=n,ce(e))}),n.observe(e)),{update(){ce(e)},destroy(){n?.disconnect();let t=Number(e.dataset.index);Number.isNaN(t)||ie.delete(t),ie.size===0&&le(),queueMicrotask(()=>h.measureElement(null))}}}sr(()=>()=>{ee(),le()});var de=vme(),fe=M(de);let pe;Ri(fe,21,()=>I(v),e=>e.key,(e,r)=>{let i=k(()=>t.items[I(r).index]);var a=R(),o=N(a),s=e=>{var a=_me();let o,s;H(M(a),()=>t.row,()=>({item:I(i),index:I(r).index})),T(a),qi(a,e=>ue?.(e)),F(e=>{o=ra(a,1,`virtual-scroller-row svelte-hoqfty`,null,o,{"cv-auto":n()}),W(a,`data-index`,I(r).index),s=aa(a,``,s,e)},[()=>({transform:`translateY(${I(r).start}px)`,"contain-intrinsic-size":n()?`auto ${Math.max(1,Math.round(I(r).size))}px`:void 0})]),z(e,a)};V(o,e=>{I(i)!==void 0&&e(s)}),z(e,a)}),T(fe),T(de),Aa(de,e=>j(u,e),()=>I(u)),F((e,t)=>{ra(de,1,e,`svelte-hoqfty`),ra(fe,1,t,`svelte-hoqfty`),pe=aa(fe,``,pe,{height:`${I(_)}px`})},[()=>Zi(ul(`virtual-scroller-viewport`,t.viewportClass)),()=>Zi(ul(`virtual-scroller-spacer`,t.class))]),yi(`scroll`,de,re),z(e,de),O()}var yme=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function bme(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=G(t,yme);var i=R();U(N(i),()=>ny,(e,t)=>{t(e,K(()=>r,{get open(){return n()},set open(e){n(e)}}))}),z(e,i),O()}var xme=new Set([`$$slots`,`$$events`,`$$legacy`]);function Sme(e,t){let n=G(t,xme);var r=R();U(N(r),()=>im,(e,t)=>{t(e,K(()=>n))}),z(e,r)}var Cme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`portalProps`,`class`]);function wme(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Cme);Sme(e,K(()=>t.portalProps,{children:(e,i)=>{var a=R(),o=N(a);{let e=k(()=>ul(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-36 rounded-md p-1 shadow-md ring-1 duration-100 z-50 overflow-x-hidden overflow-y-auto outline-none`,t.class));U(o,()=>hy,(t,i)=>{i(t,K({"data-slot":`context-menu-content`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,a)},$$slots:{default:!0}})),O()}var Tme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function Eme(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Tme);var i=R();U(N(i),()=>ly,(e,t)=>{t(e,K({"data-slot":`context-menu-group`},()=>r,{get ref(){return n()},set ref(e){n(e)}}))}),z(e,i),O()}var Dme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`inset`]);function Ome(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Dme);var i=R(),a=N(i);{let e=k(()=>ul(`text-foreground px-2 py-1.5 text-sm font-medium data-inset:ps-8`,t.class));U(a,()=>fy,(i,a)=>{a(i,K({"data-slot":`context-menu-group-heading`,get"data-inset"(){return t.inset},get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var kme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`inset`,`variant`]);function Ame(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`variant`,3,`default`),i=G(t,kme);var a=R(),o=N(a);{let e=k(()=>ul(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive focus:*:[svg]:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm data-inset:pl-8 [&_svg:not([class*='size-'])]:size-4 group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,t.class));U(o,()=>oy,(a,o)=>{o(a,K({"data-slot":`context-menu-item`,get"data-inset"(){return t.inset},get"data-variant"(){return r()},get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,a),O()}var jme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Mme(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,jme);var i=R(),a=N(i);{let e=k(()=>ul(`bg-border -mx-1 my-1 h-px`,t.class));U(a,()=>xy,(t,i)=>{i(t,K({"data-slot":`context-menu-separator`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var Nme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),Pme=L(`<span><!></span>`);function Fme(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Nme);var i=Pme();Sa(i,e=>({"data-slot":`context-menu-shortcut`,class:e,...r}),[()=>ul(`text-muted-foreground group-focus/context-menu-item:text-accent-foreground ml-auto text-xs tracking-widest`,t.class)]),H(M(i),()=>t.children??w),T(i),Aa(i,e=>n(e),()=>n()),z(e,i),O()}var Ime=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function Lme(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=G(t,Ime);var i=R();U(N(i),()=>ry,(e,t)=>{t(e,K(()=>r,{get open(){return n()},set open(e){n(e)}}))}),z(e,i),O()}var Rme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function zme(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Rme);var i=R(),a=N(i);{let e=k(()=>ul(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-popover text-popover-foreground min-w-32 rounded-md border p-1 shadow-lg duration-100`,t.class));U(a,()=>wy,(t,i)=>{i(t,K({"data-slot":`context-menu-sub-content`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var Bme=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`inset`,`children`]),Vme=L(`<!> <!>`,1);function Hme(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Bme);var i=R(),a=N(i);{let e=k(()=>ul(`focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground rounded-sm px-2 py-1.5 text-sm data-inset:pl-8 [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none data-inset:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0`,t.class));U(a,()=>Dy,(i,a)=>{a(i,K({"data-slot":`context-menu-sub-trigger`,get"data-inset"(){return t.inset},get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=Vme(),i=N(r);H(i,()=>t.children??w),Jw(P(i,2),{class:`ml-auto`}),z(e,r)},$$slots:{default:!0}}))})}z(e,i),O()}var Ume=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Wme(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Ume);var i=R(),a=N(i);{let e=k(()=>ul(`cn-context-menu-trigger select-none`,t.class));U(a,()=>vy,(t,i)=>{i(t,K({"data-slot":`context-menu-trigger`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var k$=(e,t=w)=>{var n=R();Ri(N(n),17,t,Fi,(e,t)=>{var n=R(),r=N(n),i=e=>{var t=R();U(N(t),()=>Mme,(e,t)=>{t(e,{})}),z(e,t)},a=e=>{var n=R();U(N(n),()=>Eme,(e,n)=>{n(e,{children:(e,n)=>{var r=R();U(N(r),()=>Ome,(e,n)=>{n(e,{children:(e,n)=>{E();var r=ki();F(()=>B(r,I(t).label)),z(e,r)},$$slots:{default:!0}})}),z(e,r)},$$slots:{default:!0}})}),z(e,n)},o=e=>{let n=k(()=>I(t).icon);var r=R();U(N(r),()=>Lme,(e,r)=>{r(e,{children:(e,r)=>{var i=A$(),a=N(i);U(a,()=>Hme,(e,r)=>{r(e,{get disabled(){return I(t).disabled},children:(e,r)=>{var i=Gme(),a=N(i),o=e=>{var t=R();U(N(t),()=>I(n),(e,t)=>{t(e,{})}),z(e,t)};V(a,e=>{I(n)&&e(o)});var s=P(a,2),c=M(s,!0);T(s),F(()=>B(c,I(t).label)),z(e,i)},$$slots:{default:!0}})}),U(P(a,2),()=>zme,(e,n)=>{n(e,{children:(e,n)=>{k$(e,()=>I(t).items)},$$slots:{default:!0}})}),z(e,i)},$$slots:{default:!0}})}),z(e,r)},s=e=>{let n=k(()=>I(t).icon);var r=R(),i=N(r);{let e=k(()=>I(t).destructive?`destructive`:`default`);U(i,()=>Ame,(r,i)=>{i(r,{get variant(){return I(e)},get disabled(){return I(t).disabled},get onSelect(){return I(t).onSelect},children:(e,r)=>{var i=Kme(),a=N(i),o=e=>{var t=R();U(N(t),()=>I(n),(e,t)=>{t(e,{})}),z(e,t)};V(a,e=>{I(n)&&e(o)});var s=P(a,2),c=M(s,!0);T(s);var l=P(s,2),u=e=>{var n=R();U(N(n),()=>Fme,(e,n)=>{n(e,{children:(e,n)=>{E();var r=ki();F(()=>B(r,I(t).shortcut)),z(e,r)},$$slots:{default:!0}})}),z(e,n)};V(l,e=>{I(t).shortcut&&e(u)}),F(()=>B(c,I(t).label)),z(e,i)},$$slots:{default:!0}})})}z(e,r)};V(r,e=>{I(t).type===`separator`?e(i):I(t).type===`label`?e(a,1):I(t).type===`submenu`?e(o,2):e(s,-1)}),z(e,n)}),z(e,n)},Gme=L(`<!> <span class="truncate"> </span>`,1),A$=L(`<!> <!>`,1),Kme=L(`<!> <span class="truncate"> </span> <!>`,1);function j$(e,t){var n=R();U(N(n),()=>bme,(e,n)=>{n(e,{get onOpenChange(){return t.onOpenChange},children:(e,n)=>{var r=A$(),i=N(r);U(i,()=>Wme,(e,n)=>{n(e,{get class(){return t.triggerClass},children:(e,n)=>{var r=R();H(N(r),()=>t.children),z(e,r)},$$slots:{default:!0}})}),U(P(i,2),()=>wme,(e,n)=>{n(e,{get class(){return t.class},children:(e,n)=>{k$(e,()=>t.items)},$$slots:{default:!0}})}),z(e,r)},$$slots:{default:!0}})}),z(e,n)}var M$=/^[A-Za-z]:[\\/]/,qme=/^[A-Za-z]:$/;function Jme(e){return M$.test(e)||e.startsWith(`\\\\`)||e.startsWith(`//`)}function Yme(e){return Jme(e)&&e.includes(`\\`)?`\\`:`/`}function Xme(e){return e===`/`||e===`\\`}function Zme(e){if(qme.test(e))return e;let t=e.length;for(;t>0&&Xme(e[t-1]);)--t;return e.slice(0,t)}function Qme(e){let t=e.length;for(;t>0&&e[t-1]===`/`;)--t;return e.slice(0,t)}function N$(e){let t=e.trim();return t.startsWith(`/`)||M$.test(t)||t.startsWith(`\\\\`)}function P$(e){let t=e.trim().replace(/\\/g,`/`),n=t.startsWith(`//`);return t=t.replace(/\/{2,}/g,`/`),n&&!t.startsWith(`//`)&&(t=`/${t}`),t=Qme(t),/^[A-Za-z]:($|\/)/.test(t)&&(t=`${t[0]?.toLowerCase()}${t.slice(1)}`),t}function $me(e,t){let n=t.trim();if(N$(n))return n;let r=Yme(e),i=n.replace(/[\\/]+/g,r),a=Zme(e.trim());return!a||a===`.`?i:`${a}${r}${i.replace(/^[\\/]+/,``)}`}function F$(e,t){if(!e)return;let n=P$(e),r=P$(t);if(n===r)return`.`;let i=r.endsWith(`/`)?r:`${r}/`;return n.startsWith(i)?n.slice(i.length):e.replace(/\\/g,`/`)}function I$(e,t){if(!e)return;let n=e.trim();if(n)return N$(n)?n:$me(t,n)}function L$(e){try{return decodeURIComponent(e)}catch{return}}function ehe(e){let t=e.trim();if(t&&!t.startsWith(`#`)){if(t.toLowerCase().startsWith(`file://`))try{let e=new URL(t),n=L$(e.pathname);return n?e.hostname?`//${e.hostname}${n}`:n.replace(/^\/([A-Za-z]:\/)/,`$1`):void 0}catch{return}if(!(/^[A-Za-z][A-Za-z0-9+.-]*:/.test(t)&&!M$.test(t)))return L$(t.split(/[?#]/,1)[0]??``)}}function the(e){let t=e.lastIndexOf(`:`);if(t<=0||t===1&&/^[A-Za-z]$/.test(e[0]??``))return{path:e};let n=e.slice(t+1);if(!/^\d+$/.test(n))return{path:e};let r=Number(n);return!Number.isSafeInteger(r)||r<=0?{path:e}:{path:e.slice(0,t),line:r}}var nhe=24,rhe=8,ihe=12e3;function ahe(e,t){return e>0&&t>0?`… ${e.toLocaleString()} lines / ${t.toLocaleString()} chars omitted …`:e>0?`… ${e.toLocaleString()} lines omitted …`:`… ${t.toLocaleString()} chars omitted …`}function R$(e,t={}){let n=Math.max(0,t.headLines??nhe),r=Math.max(0,t.tailLines??rhe),i=Math.max(0,t.maxChars??ihe),a=t.marker??ahe,o=e,s=0,c=0,l=e.split(`
|
|
82
|
-
`),u=n+r;if(u>0&&l.length>u){s=l.length-u,c=l.slice(n,l.length-r).join(`
|
|
83
|
-
`).length;let e=l.slice(0,n),t=r>0?l.slice(-r):[];o=[...e,a(s,c),...t].join(`
|
|
84
|
-
`)}if(i>0&&o.length>i){let e=o.length-i;c+=e;let t=a(s,c),n=Math.max(0,i-t.length-2),r=Math.ceil(n*.72),l=Math.max(0,n-r);o=[o.slice(0,r),t,l>0?o.slice(-l):``].filter(Boolean).join(`
|
|
85
|
-
`)}return{text:o,omittedLines:s,omittedChars:c,trimmed:o!==e}}var ohe=260;function z$(e){if(e&&typeof e==`object`&&!Array.isArray(e))return e;if(typeof e==`string`&&e.trim().startsWith(`{`))try{let t=JSON.parse(e);if(t&&typeof t==`object`&&!Array.isArray(t))return t}catch{}return{}}function B$(e){return typeof e==`string`?e:void 0}function she(e){let t=Bk.safeParse(e);if(t.success)return t.data;let n=z$(e);if(Object.keys(n).length===0)return;let r=Bk.safeParse(n);return r.success?r.data:void 0}function V$(e){let t=z$(e).contentBlocks;if(!Array.isArray(t))return;let n=t.flatMap(e=>{let t=z$(e);return t.type===`text`&&typeof t.text==`string`?[t.text]:[]});return n.length>0?n.join(`
|
|
86
|
-
`):void 0}function H$(e){let t=z$(e),n=B$(t.stdout),r=B$(t.stderr);if(!(n===void 0&&r===void 0))return n?r?n.endsWith(`
|
|
87
|
-
`)?`${n}${r}`:`${n}\n${r}`:n.length>0?n:void 0:r&&r.length>0?r:void 0}function U$(e,t,n){return e?.content??V$(e)??V$(t)??H$(e)??H$(t)??n?.text??``}function che(e){if(!Array.isArray(e))return;let t=[];for(let n of e){let e=z$(n);if(typeof e.todo!=`string`||typeof e.done!=`boolean`)return;t.push({todo:e.todo,done:e.done})}return t}function W$(e){let t=z$(e).contentBlocks;if(Array.isArray(t))return t.find(e=>e&&typeof e==`object`&&e.type===`text`&&typeof e.text==`string`)?.text}function G$(e,t){if(e)return e===t?`.`:F$(e,t)}function K$(e,t){return e.length>t?e.slice(e.length-t):e}function lhe(e,t){return`data:${e};base64,${t}`}function uhe(e){return{...e,text:R$(e.text,{headLines:2,tailLines:1,maxChars:ohe}).text}}function dhe(e){let t=[],n=new Map;for(let r of e){let e=n.get(r.path);e||(e=[],n.set(r.path,e),t.push({path:r.path,openPath:r.openPath,matches:e})),e.push(r)}return t}function q$(e,t){if(e)return I$(e,t)}function J$(e){let t=z$(e),n=Rk.safeParse(e);if(n.success&&n.data.truncated)return!0;let r=Rk.safeParse(t.truncation);return!!(r.success&&r.data.truncated)}function fhe(e){if(!e)return{additions:0,deletions:0};let t=0,n=0;for(let r of e.split(`
|
|
88
|
-
`))r.startsWith(`+`)&&!r.startsWith(`+++`)?t+=1:r.startsWith(`-`)&&!r.startsWith(`---`)&&(n+=1);return{additions:t,deletions:n}}function phe(e){if(!e)return{updates:[]};let t=[],n=[];for(let r of e.split(/\r?\n/)){let e=r.trim();if(e){try{let n=z$(JSON.parse(e));if(n.type===`explore_progress`&&typeof n.timestamp==`string`&&typeof n.phase==`string`&&typeof n.message==`string`){t.push({type:`explore_progress`,timestamp:n.timestamp,agentId:B$(n.agentId),taskIndex:typeof n.taskIndex==`number`?n.taskIndex:void 0,taskCount:typeof n.taskCount==`number`?n.taskCount:void 0,label:B$(n.label),model:B$(n.model),phase:n.phase,message:n.message});continue}}catch{}n.push(r)}}return{updates:t,fallback:n.length>0?n.join(`
|
|
89
|
-
`):void 0}}var mhe=new Set([`Assistant response started.`,`Final report received.`]);function hhe(e){switch(e.phase){case`queued`:return;case`started`:return{text:`Starting…`,mono:!1};case`assistant`:return{text:`Thinking…`,mono:!1};case`tool_call`:case`tool_result`:return{text:e.message,mono:!0};default:return{text:e.message,mono:!1}}}var Y$=new WeakMap;function X$(e){let t=Y$.get(e);if(t)return t;let n=ghe(e);return Y$.set(e,n),n}function ghe(e){let t=e.reports,n=new Map,r=-1,i=0;for(let t of e.liveUpdates){if(typeof t.taskCount==`number`&&(i=Math.max(i,t.taskCount)),typeof t.taskIndex!=`number`)continue;r=Math.max(r,t.taskIndex);let e=n.get(t.taskIndex)??[];e.push(t),n.set(t.taskIndex,e)}let a=Math.max(i,t.length,r+1,+(e.liveUpdates.length>0||t.length>0)),o=[];for(let r=0;r<a;r+=1){let i=t[r],s=n.get(r)??[],c=s[s.length-1],l=[...s].reverse().find(e=>(e.phase===`tool_call`||e.phase===`tool_result`)&&!mhe.has(e.message)),u=s.find(e=>e.phase===`failed`),d;d=i?.status===`failed`||i?.status===`aborted`?`failed`:i?.status===`completed`||i||s.some(e=>e.phase===`completed`)?`completed`:u?`failed`:s.some(e=>[`started`,`tool_call`,`tool_result`,`assistant`].includes(e.phase))?`running`:`queued`;let f=d===`running`?hhe(l??c??s[0]):void 0,p=i?.model??s.find(e=>e.model)?.model??c?.model;o.push({key:`task-${r}`,index:r,count:a||void 0,label:i?.label??c?.label,task:i?.task??e.task,agentId:i?.agentId??c?.agentId,model:p,status:d,currentAction:f?.text,currentActionMono:f?.mono??!1,actionCount:s.filter(e=>e.phase===`tool_call`).length,report:i,error:i?.errorMessage??i?.summaryPreview??u?.message})}let s=o.filter(e=>e.status===`completed`).length,c=o.filter(e=>e.status===`failed`).length;return{tasks:o,summary:{total:a,completed:s,failed:c,running:o.filter(e=>e.status===`running`||e.status===`queued`).length,done:a>0&&s+c===a}}}function Z$(e){return Array.isArray(e)?e:[]}function _he(e){return Z$(e.replacements).length+Z$(e.insertions).length+Z$(e.lineReplacements).length+Z$(e.lineInsertions).length+ +(typeof e.patch==`string`&&e.patch.length>0)}var Q$=new E$(300);function vhe(e,t){return[e.id,e.status,e.updatedAt,t?.updatedAt??``,t?.text.length??0].join(`\0`)}function yhe(e,t){let n=vhe(e,t),r=Q$.get(n);if(r!==void 0)return r;let i=bhe(e,t);return Q$.set(n,i),i}function bhe(e,t){let n=z$(e.args),r=e.cwd,i=she(e.result);switch(e.toolName){case`read`:{let e=q$(i?.path??B$(n.path),r),t=G$(e,r),a=i?.contentBlocks?.find(e=>e.type===`image`);if(a&&a.type===`image`)return{kind:`read`,path:e,relPath:t,image:{dataUrl:lhe(a.mimeType,a.data),mimeType:a.mimeType},truncated:!1};let o=i?.content,s=typeof n.offset==`number`||typeof n.limit==`number`,c;if(o!==void 0){let e=o.length===0?0:o.split(`
|
|
90
|
-
`).length;if(s&&typeof n.offset==`number`){let t=n.offset;c=`lines ${t}–${t+e-1}`}else c=`${e} line${e===1?``:`s`}`}return{kind:`read`,path:e,relPath:t,lineLabel:c,content:o,truncated:J$(i?.details)}}case`bash`:{let r=B$(n.command),a=Sle.safeParse(i?.details),o=U$(i,e.result,t);return{kind:`bash`,command:r,exitCode:i?.exitCode,signal:a.success?a.data.signal??void 0:void 0,output:o,savedTo:a.success?a.data.fullOutputPath:void 0,truncated:J$(i?.details),live:!i&&!!t?.text}}case`python`:{let a=B$(n.code),o=B$(n.path),s=wle.safeParse(i?.details),c=q$((s.success?s.data.scriptPath:void 0)??o,r),l=U$(i,e.result,t),u=a?a.split(/\r?\n/).length:0;return{kind:`python`,inputMode:s.success?s.data.inputMode??(c?`file`:`inline`):o?`file`:`inline`,code:a,codeLineCount:u,scriptPath:c,relScriptPath:G$(c,r),exitCode:i?.exitCode,signal:s.success?s.data.signal??void 0:void 0,output:l,savedTo:s.success?s.data.fullOutputPath:void 0,truncated:J$(i?.details),live:!i&&!!t?.text,allowNetwork:s.success?s.data.allowNetwork:void 0,allowFileWrite:s.success?s.data.allowFileWrite:void 0,durationMs:s.success?s.data.durationMs:void 0,timedOut:s.success?s.data.timedOut:void 0,timeoutKilled:s.success?s.data.timeoutKilled:void 0,envKeys:s.success?s.data.envKeys:void 0,artifactDir:s.success?s.data.artifactDir:void 0,artifacts:s.success?s.data.artifacts:void 0,streams:s.success?s.data.streams:void 0}}case`edit`:{let e=q$(i?.path??B$(n.path),r),t=G$(e,r),a=xle.safeParse(i?.details),o=a.success?a.data.operationCount:_he(n),s=a.success?a.data.diff:void 0,{additions:c,deletions:l}=fhe(s);return{kind:`edit`,path:e,relPath:t,operationCount:o,additions:c,deletions:l,diff:s,dryRun:a.success?a.data.dryRun:void 0}}case`write`:{let e=q$(i?.path??B$(n.path),r),t=G$(e,r),a=B$(n.content),o=i?.content?.match(/Wrote (\d+) bytes/);return{kind:`write`,path:e,relPath:t,bytes:o?Number(o[1]):void 0,content:a}}case`grep`:{let e=B$(n.pattern),t=q$(i?.path,r)??q$(B$(n.path)??`.`,r)??r,a=(i?.matches??[]).map(e=>uhe({...e,openPath:q$(e.path,t)??e.path})),o=dhe(a);return{kind:`grep`,pattern:e,matchCount:a.length,fileCount:o.length,allMatches:o}}case`find`:{let e=B$(n.pattern),t=i?.entries??[],a=q$(i?.path,r)??q$(B$(n.path)??`.`,r)??r,o=t.map(e=>e.path);return{kind:`find`,pattern:e,paths:o,openPaths:t.map(e=>q$(e.path,a)??e.path),count:o.length}}case`ls`:{let e=q$(i?.path??B$(n.path),r),t=G$(e,r)??`.`,a=(i?.entries??[]).map(t=>({...t,openPath:q$(t.path,e??r)??t.path}));return{kind:`ls`,path:e,relPath:t,entries:a,total:a.length}}case`ask_user`:{let t=Lle.safeParse(e.result),r=t.success?t.data:void 0;return{kind:`ask_user`,question:r?.question??B$(n.question),context:r?.context??B$(n.context),recommendation:r?.recommendation??B$(n.recommendation),answer:r?.response,dismissed:!!r?.dismissed,dismissedReason:r?.dismissedReason}}case`todos_set`:case`todos_get`:{let t=zle.safeParse(e.result),r=(t.success?t.data.details?.todos:void 0)??che(n.todos)??[];return{kind:`todos`,items:r,completed:r.filter(e=>e.done).length,total:r.length}}case`task_start`:case`task_cancel`:case`task_restart`:{let t=e.toolName.replace(`task_`,``),n=jle.safeParse(e.result);return{kind:`task_action`,action:t,task:n.success?n.data.task:void 0,tasks:n.success?n.data.tasks:void 0}}case`task_status`:{let t=z$(e.result);return{kind:`task_list`,tasks:(Array.isArray(t.tasks)?t.tasks:[]).map(e=>{let t=z$(e);return Pk.safeParse(t.task??t)}).filter(e=>e.success).map(e=>e.data)}}case`task_list`:{let t=Mle.safeParse(e.result);return{kind:`task_list`,tasks:t.success?t.data.tasks:[]}}case`task_logs`:{let t=Nle.safeParse(e.result),n=t.success?t.data:void 0,r=n?.events??[];return{kind:`task_logs`,task:n?.task,events:r,mode:n?.mode}}case`explore`:{let r=Ile.safeParse(e.result),i=r.success?r.data:void 0,a=B$(n.task),o=phe(t?.text);return{kind:`explore`,task:a,reports:i?.reports??[],liveUpdates:o.updates,liveLog:o.fallback}}case`plan_mode_enter`:{let t=B$(z$(e.result).planDir);return{kind:`plan_mode`,action:`enter`,summary:W$(e.result),planPath:t}}case`plan_mode_present`:{let t=z$(e.result),r=z$(t.review),i=B$(r.planPath)??B$(n.file_path),a=B$(t.outcome)??B$(r.status);return{kind:`plan_mode`,action:`present`,summary:B$(t.feedback)??W$(e.result),planPath:i,outcome:a}}case`plan_mode_force_exit`:return{kind:`plan_mode`,action:`force_exit`,summary:B$(z$(e.result).reason)};case`web_search`:{let e=Dle.safeParse(i?.details),t=e.success?e.data.query:B$(n.query),r=e.success?e.data.results:[];return{kind:`web_search`,query:t,answer:e.success?e.data.answer:void 0,results:r}}case`web_fetch`:{let e=Ole.safeParse(i?.details),t=e.success?e.data:void 0;return{kind:`web_fetch`,url:t?.url??B$(n.url),status:t?.status,contentType:t?.contentType,size:t?.size,savedTo:t?.savedTo,converted:t?.converted??!1,content:i?.content}}default:return{kind:`generic`}}}function $$(e){return e.split(/[\\/]/).pop()||e}function xhe(e){if(e===void 0)return;if(e<1024)return`${e} B`;let t=e/1024;return t<1024?`${t.toFixed(1)} KB`:`${(t/1024).toFixed(1)} MB`}function She(e){if(e!==void 0)return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function e1(e,t,n=`s`){return`${e} ${t}${e===1?``:n}`}function t1(e){return e?e.length===0?0:e.split(`
|
|
91
|
-
`).length:0}function n1(e,t,n=`head`){let r=e-10;if(!(r<=0))return{hidden:r,expandLabel:`Show ${r} ${n===`tail`?`earlier`:`more`} ${t}`,collapseLabel:`Show less`}}function Che(e,t){switch(e.status){case`error`:case`denied`:return{tone:`danger`,pulse:!1};case`running`:case`requested`:return{tone:`running`,pulse:!0};case`pending_approval`:case`waiting_for_user`:return{tone:`warn`,pulse:!0};default:break}if((t.kind===`bash`||t.kind===`python`)&&t.exitCode!==void 0&&t.exitCode!==0||t.kind===`explore`&&X$(t).summary.failed>0)return{tone:`danger`,pulse:!1};if(t.kind===`task_action`){let e=t.task??t.tasks?.[0];if(e)return{tone:iT(e.status),pulse:aT(e.status)}}return t.kind===`task_logs`&&t.task?{tone:iT(t.task.status),pulse:aT(t.task.status)}:{tone:`good`,pulse:!1}}var r1=new WeakMap;function whe(e,t){let n=r1.get(e);if(n)return n;let r=The(e,t);return r1.set(e,r),r}function The(e,t){let{tone:n,pulse:r}=Che(t,e),i={badge:t.toolName,meta:[],dotTone:n,dotPulse:r};switch(e.kind){case`read`:{let t=e.relPath?{text:e.relPath,openPath:e.path}:void 0;if(e.image)return{...i,primaryArg:t,meta:[{text:`image`}]};let n=[];return e.lineLabel&&n.push({text:e.lineLabel}),e.truncated&&n.push({text:`truncated`,tone:`warning`}),{...i,primaryArg:t,meta:n,collapse:n1(t1(e.content),`lines`)}}case`bash`:{let t=[],n=t1(e.output);return e.exitCode!==void 0&&e.exitCode!==0&&t.push({text:`exit ${e.exitCode}`,tone:`error`}),e.signal&&t.push({text:`signal ${e.signal}`,tone:`warning`}),n>0&&t.push({text:e1(n,`line`)}),e.truncated&&t.push({text:`truncated`,tone:`warning`}),e.savedTo&&t.push({text:`saved ${$$(e.savedTo)}`,mono:!0}),{...i,primaryArg:e.command?{text:e.command}:void 0,meta:t,collapse:n1(n,`lines`,`tail`)}}case`python`:{let t=[],n=t1(e.output);e.exitCode!==void 0&&e.exitCode!==0&&t.push({text:`exit ${e.exitCode}`,tone:`error`}),e.signal&&t.push({text:`signal ${e.signal}`,tone:`warning`}),e.timedOut&&t.push({text:`timed out`,tone:`error`});let r=She(e.durationMs);r&&t.push({text:r}),e.codeLineCount>0&&t.push({text:e1(e.codeLineCount,`code line`)}),n>0&&t.push({text:e1(n,`line`)}),e.allowFileWrite===!1&&t.push({text:`writes off`,tone:`warning`}),e.envKeys&&e.envKeys.length>0&&t.push({text:e1(e.envKeys.length,`env`)}),e.artifacts&&e.artifacts.length>0&&t.push({text:e1(e.artifacts.length,`artifact`),tone:`info`}),e.streams?.stdout?.truncated&&t.push({text:`stdout truncated`,tone:`warning`}),e.streams?.stderr?.truncated&&t.push({text:`stderr truncated`,tone:`warning`}),e.truncated&&t.push({text:`truncated`,tone:`warning`}),e.savedTo&&t.push({text:`saved ${$$(e.savedTo)}`,mono:!0});let a=Math.max(0,e.codeLineCount-10)+Math.max(0,n-10),o=a>0?{hidden:a,expandLabel:`Show ${a} more lines`,collapseLabel:`Show less`}:void 0,s=e.inputMode===`file`&&e.relScriptPath?{text:e.relScriptPath,openPath:e.scriptPath}:{text:`inline`};return{...i,primaryArg:s,meta:t,collapse:o}}case`edit`:{let t=[{text:e1(e.operationCount,`operation`)}];return e.dryRun&&t.push({text:`preview`,tone:`info`}),e.additions>0&&t.push({text:`+${e.additions}`,tone:`success`}),e.deletions>0&&t.push({text:`−${e.deletions}`,tone:`error`}),{...i,primaryArg:e.relPath?{text:e.relPath,openPath:e.path}:void 0,meta:t,collapse:n1(t1(e.diff),`lines`)}}case`write`:{let t=[];return e.bytes!==void 0&&t.push({text:`wrote ${e.bytes} bytes`}),{...i,primaryArg:e.relPath?{text:e.relPath,openPath:e.path}:void 0,meta:t,collapse:n1(t1(e.content),`lines`)}}case`grep`:return{...i,primaryArg:e.pattern?{text:e.pattern}:void 0,meta:[{text:e1(e.matchCount,`match`,`es`)},{text:e1(e.fileCount,`file`)}],collapse:n1(e.matchCount,`matches`)};case`find`:return{...i,primaryArg:e.pattern?{text:e.pattern}:void 0,meta:[{text:e1(e.count,`file`)}],collapse:n1(e.count,`files`)};case`ls`:return{...i,primaryArg:e.relPath?{text:e.relPath,openPath:e.path}:void 0,meta:[{text:`${e.total} ${e.total===1?`entry`:`entries`}`}],collapse:n1(e.total,`entries`)};case`task_logs`:{let t=[{text:e1(e.events.length,`event`)}];return e.mode&&t.push({text:e.mode}),{...i,primaryArg:e.task?.name?{text:e.task.name}:e.mode?{text:e.mode}:void 0,meta:t,collapse:n1(e.events.length,`events`,`tail`)}}case`web_fetch`:{let t=[];e.status!==void 0&&t.push({text:`${e.status}`,tone:e.status>=400?`error`:`success`}),e.contentType&&t.push({text:e.contentType});let n=xhe(e.size);return n&&t.push({text:n}),e.converted&&t.push({text:`markdown`,tone:`info`}),e.savedTo&&t.push({text:`saved ${$$(e.savedTo)}`,mono:!0}),{...i,primaryArg:e.url?{text:e.url,href:e.url}:void 0,meta:t,collapse:n1(t1(e.content),`lines`)}}case`web_search`:return{...i,primaryArg:e.query?{text:e.query}:void 0,meta:[{text:e1(e.results.length,`result`)}]};case`todos`:return{...i,badge:`todos`,meta:[{text:`${e.completed}/${e.total} done`}]};case`task_action`:{let t=e.task??e.tasks?.[0];return{...i,badge:`task_${e.action}`,primaryArg:t?.name?{text:t.name}:void 0}}case`task_list`:return{...i,meta:[{text:e1(e.tasks.length,`task`,`s`)}]};case`explore`:{let{summary:t}=X$(e),n=e.reports.length,r=e.reports.filter(e=>e.reportPath).length,a=[];t.done&&(n>0&&a.push({text:e1(n,`report`,`s`),tone:`success`}),r>0&&a.push({text:e1(r,`file`,`s`)})),t.failed>0&&a.push({text:`${t.failed} failed`,tone:`error`});let o=[...new Set(e.reports.map(e=>e.model).filter(Boolean))];o.length===1&&o[0]&&a.push({text:$$(o[0])});let s=e.reports.reduce((e,t)=>e+(t.usage?.turns??0),0);return s>0&&a.push({text:e1(s,`turn`)}),{...i,primaryArg:e.task?{text:e.task}:t.total>1?{text:`${t.total} explore agents`}:void 0,meta:a}}case`ask_user`:return{...i,meta:[]};case`plan_mode`:return{...i,badge:`plan_mode_${e.action}`,primaryArg:e.planPath?{text:e.planPath,openPath:e.planPath}:void 0,meta:[]};default:return i}}var Ehe=L(`<p class="question svelte-12xgv5f"> </p>`),Dhe=L(`<p class="meta svelte-12xgv5f"><span class="meta-label svelte-12xgv5f">context</span> </p>`),Ohe=L(`<p class="meta svelte-12xgv5f"><span class="meta-label svelte-12xgv5f">recommendation</span> </p>`),khe=L(`<button type="button" class="quick-reply svelte-12xgv5f"> </button>`),Ahe=L(`<div class="reply-voice-controls svelte-12xgv5f"><!> <!></div>`),jhe=L(`<!>Reply`,1),Mhe=L(`<!>Dismiss`,1),Nhe=L(`<div class="quick-replies svelte-12xgv5f"></div> <form class="reply svelte-12xgv5f"><div class="reply-field svelte-12xgv5f"><textarea class="reply-input svelte-12xgv5f" rows="3" aria-label="Reply to agent question"></textarea> <!></div> <div class="actions svelte-12xgv5f"><!> <!></div></form>`,1),Phe=L(`<p class="meta answer svelte-12xgv5f"><span class="meta-label svelte-12xgv5f">answer</span> </p>`),Fhe=L(`<p class="meta svelte-12xgv5f"><span class="meta-label svelte-12xgv5f">dismissed</span> </p>`),Ihe=L(`<div class="ask svelte-12xgv5f"><!> <!> <!> <!></div> <!>`,1);function Lhe(e,t){D(t,!0);let n=[`Yes, go ahead`,`I agree`,`Can you explain further?`,`No, hold on`],r=A(``),i=A(!1),a=k(()=>t.toolCall.status===`waiting_for_user`&&t.questionRecord?.status===`pending`),o=k(()=>t.questionRecord?.question??t.view.question),s=k(()=>t.questionRecord?.context??t.view.context),c=k(()=>t.questionRecord?.recommendation??t.view.recommendation),l=k(()=>t.questionRecord?.answer??t.view.answer),u=k(()=>t.questionRecord?.status===`dismissed`||t.view.dismissed),d=k(()=>t.questionRecord?.dismissedReason??t.view.dismissedReason),f=k(()=>I(r).trim()),p=k(()=>{let e=t.questionRecord?.id??t.toolCall.id;return e?{kind:`ask-user`,id:e}:void 0}),m=k(()=>!!(I(p)&&TA.isTargetActive(I(p))&&TA.recording)),h=k(()=>!!(I(p)&&TA.isTargetActive(I(p))&&TA.transcribing)),g=k(()=>!!(I(p)&&TA.isBusyForOtherTarget(I(p)))),_=k(()=>c$.configured),v=k(()=>TA.isSupported()),y=k(()=>!I(p)||TA.pending||!I(m)&&(!I(a)||I(g))),b=k(()=>I(m)?`Stop recording (${x(TA.elapsedMs)} / ${x(TA.maxDurationMs)}) — right-click to cancel`:I(g)?`Voice recording is active elsewhere`:TA.retryAttempt>0&&I(p)&&TA.isTargetActive(I(p))?`Retrying transcription ${TA.retryAttempt}/${TA.maxRetries}…`:I(h)?`Transcribing audio…`:I(_)?`Record voice reply`:`Connect ChatGPT to use voice input`);sr(()=>{let e=I(p);if(!e)return;let t=TA.registerTargetHandlers(e,{appendTranscript:e=>{j(r,wA(I(r),e),!0)},onError:e=>cd.error(`Voice input failed`,{description:e})});return()=>{t(),TA.cancelIfTarget(e)}});function x(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function S(){!I(a)||!t.questionRecord||!I(f)||t.onAnswerUserQuestion?.(t.questionRecord.id,I(f))}function ee(e){!I(a)||!t.questionRecord||t.onAnswerUserQuestion?.(t.questionRecord.id,e)}function C(){if(!(I(y)||!I(p))){if(!I(m)&&!I(_)){j(i,!0);return}TA.toggle(I(p))}}function te(e){!I(m)||!I(p)||(e.preventDefault(),TA.cancel(I(p)))}var ne=Ihe(),re=N(ne),ie=M(re),ae=e=>{var t=Ehe(),n=M(t,!0);T(t),F(()=>B(n,I(o))),z(e,t)};V(ie,e=>{I(o)&&e(ae)});var oe=P(ie,2),w=e=>{var t=Dhe(),n=P(M(t));T(t),F(()=>B(n,` ${I(s)??``}`)),z(e,t)};V(oe,e=>{I(s)&&e(w)});var se=P(oe,2),ce=e=>{var t=Ohe(),n=P(M(t));T(t),F(()=>B(n,` ${I(c)??``}`)),z(e,t)};V(se,e=>{I(c)&&e(ce)});var le=P(se,2),ue=e=>{var i=Nhe(),a=N(i);Ri(a,20,()=>n,e=>e,(e,t)=>{var n=khe(),r=M(n,!0);T(n),F(()=>B(r,t)),bi(`click`,n,()=>ee(t)),z(e,n)}),T(a);var o=P(a,2),s=M(o),c=M(s);Qn(c);var l=P(c,2),u=e=>{var t=Ahe(),n=M(t);{let e=k(()=>I(p)&&TA.isTargetActive(I(p))?TA.retryAttempt:0);rA(n,{get recording(){return I(m)},get transcribing(){return I(h)},get elapsedMs(){return TA.elapsedMs},get maxDurationMs(){return TA.maxDurationMs},get retryAttempt(){return I(e)},get maxRetries(){return TA.maxRetries},class:`ask-transcription-status`})}var r=P(n,2);{let e=k(()=>I(m)?`destructive`:`ghost`),t=k(()=>`reply-mic${I(m)?` recording`:``}`),n=k(()=>I(m)?`Stop recording; right-click to cancel`:I(_)?`Record voice reply`:`Connect ChatGPT to use voice input`);Ml(r,{get variant(){return I(e)},size:`icon-sm`,get class(){return I(t)},type:`button`,get disabled(){return I(y)},onclick:C,oncontextmenu:te,get"aria-label"(){return I(n)},get title(){return I(b)},children:(e,t)=>{var n=R(),r=N(n),i=e=>{tD(e,{size:14,strokeWidth:2.4,class:`spin`})},a=e=>{rD(e,{size:14,strokeWidth:2.4})};V(r,e=>{I(h)?e(i):e(a,-1)}),z(e,n)},$$slots:{default:!0}})}T(t),z(e,t)};V(l,e=>{I(v)&&e(u)}),T(s);var d=P(s,2),g=M(d);{let e=k(()=>!I(f));Ml(g,{size:`sm`,type:`submit`,get disabled(){return I(e)},children:(e,t)=>{var n=jhe();aD(N(n),{size:14,strokeWidth:2.4}),E(),z(e,n)},$$slots:{default:!0}})}Ml(P(g,2),{size:`sm`,variant:`secondary`,type:`button`,onclick:()=>t.onDismissUserQuestion?.(t.questionRecord.id),children:(e,t)=>{var n=Mhe();ZX(N(n),{size:14,strokeWidth:2.4}),E(),z(e,n)},$$slots:{default:!0}}),T(d),T(o),F(()=>W(c,`placeholder`,t.questionRecord.placeholder??`Reply to the agent's question`)),yi(`submit`,o,e=>{e.preventDefault(),S()}),Ea(c,()=>I(r),e=>j(r,e)),z(e,i)},de=e=>{var t=Phe(),n=P(M(t));T(t),F(()=>B(n,` ${I(l)??``}`)),z(e,t)},fe=e=>{var t=Fhe(),n=P(M(t));T(t),F(()=>B(n,` ${I(d)??`No answer provided`??``}`)),z(e,t)};V(le,e=>{I(a)&&t.questionRecord?e(ue):I(l)?e(de,1):I(u)&&e(fe,2)}),T(re),s$(P(re,2),{get open(){return I(i)},set open(e){j(i,e,!0)}}),z(e,ne),O()}xi([`click`]);var i1={bash:()=>p(()=>import(`./bash-B7CDPTg5.js`),__vite__mapDeps([0,1])),css:()=>p(()=>import(`./css-BsVw1vtW.js`),[]),diff:()=>p(()=>import(`./diff-woXpYk--.js`),[]),html:()=>p(()=>import(`./html-BY76lXLH.js`),__vite__mapDeps([2,3,4])),javascript:()=>p(()=>import(`./javascript-BgS3c2Ky.js`),[]),json:()=>p(()=>import(`./json-qhed-kSA.js`),[]),jsonc:()=>p(()=>import(`./jsonc-CYpm1nAK.js`),[]),jsx:()=>p(()=>import(`./jsx-Bz0zcwM4.js`),[]),markdown:()=>p(()=>import(`./markdown-BYOwaDjH.js`),[]),python:()=>p(()=>import(`./python-gzcpVVnB.js`),[]),shellscript:()=>p(()=>import(`./shellscript-CLZ0U2zV.js`),[]),svelte:()=>p(()=>import(`./svelte-Uaf2W_lJ.js`),__vite__mapDeps([5,3,4,6])),tsx:()=>p(()=>import(`./tsx-udAQXfEw.js`),[]),typescript:()=>p(()=>import(`./typescript-bsJCZSQ-.js`),[]),yaml:()=>p(()=>import(`./yaml-rwi0_p6S.js`),[])},Rhe={"github-light":()=>p(()=>import(`./github-light-EUqPIrTm.js`),[]),"github-dark-dimmed":()=>p(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[])},zhe=new Map([[``,`markdown`],[`text`,`markdown`],[`plain`,`markdown`],[`plaintext`,`markdown`],[`sh`,`bash`],[`shell`,`shellscript`],[`zsh`,`shellscript`],[`js`,`javascript`],[`ts`,`typescript`],[`md`,`markdown`],[`yml`,`yaml`]]),Bhe=new Set(Object.keys(i1)),a1,o1=new E$(500);function s1(e){let t=(e??``).toLowerCase().trim();return zhe.get(t)||(Bhe.has(t)?t:void 0)}function Vhe(e){return typeof window>`u`||typeof window.requestIdleCallback!=`function`?e():new Promise((t,n)=>{window.requestIdleCallback(()=>{e().then(t,n)},{timeout:750})})}async function Hhe(){return a1??=Promise.all([p(()=>import(`./dist-BaA_eB0I.js`),[]),p(()=>import(`./dist-FQvzRocB.js`),[])]).then(([e,t])=>{let n=e.createBundledHighlighter({langs:i1,themes:Rhe,engine:()=>t.createJavaScriptRegexEngine()});return e.createSingletonShorthands(n)}),a1}async function Uhe(e,t){let n=s1(t);if(n)return Vhe(async()=>(await Hhe()).codeToHtml(e,{lang:n,themes:{light:`github-light`,dark:`github-dark-dimmed`},defaultColor:!1}))}function Whe(e,t){return`${t}\0${e}`}function c1(e,t){let n=s1(t);if(!n)return;let r=Whe(e,n),i=o1.get(r);if(i!==void 0||o1.has(r))return i;let a=Uhe(e,n).then(e=>(o1.set(r,e),e)).catch(()=>{o1.delete(r)});return o1.set(r,a),a}var Ghe=L(`<div class="code-block svelte-tohjmn"></div>`),Khe=L(`<pre class="code-block plain svelte-tohjmn"> </pre>`);function l1(e,t){D(t,!0);let n=q(t,`maxHeight`,3,`18rem`),r=q(t,`trim`,3,!0),i=A(void 0),a=A(void 0),o=A(void 0),s=k(()=>r()?R$(t.code):{text:t.code}),c=k(()=>`${t.language??``}\0${I(s).text}`);sr(()=>{let e=I(c);if(I(a)===e||I(o)===e)return;let n=c1(I(s).text,t.language);if(typeof n==`string`){j(i,n,!0),j(a,e,!0),j(o,void 0);return}if(!n){j(o,e,!0);return}let r=!1;return n.then(t=>{r||I(c)!==e||(t?(j(i,t,!0),j(a,e,!0),j(o,void 0)):j(o,e,!0))}),()=>{r=!0}});var l=R(),u=N(l),d=e=>{var t=Ghe();let r;Wi(t,()=>I(i),!0),T(t),F(()=>r=aa(t,``,r,{"max-height":n()})),z(e,t)},f=e=>{var t=Khe();let r;var i=M(t,!0);T(t),F(()=>{r=aa(t,``,r,{"max-height":n()}),B(i,I(s).text)}),z(e,t)};V(u,e=>{I(i)&&I(a)===I(c)?e(d):e(f,-1)}),z(e,l),O()}function u1(e,t){D(t,!0);let n=q(t,`direction`,3,`head`),r=q(t,`collapsedLines`,3,10),i=q(t,`expanded`,3,!1),a=k(()=>{if(i())return t.text;let e=t.text.split(`
|
|
92
|
-
`);return e.length<=r()?t.text:n()===`tail`?K$(e,r()).join(`
|
|
93
|
-
`):e.slice(0,r()).join(`
|
|
94
|
-
`)});l1(e,{get code(){return I(a)},get language(){return t.language},trim:!1}),O()}var qhe=L(`<p class="m-0 text-xs text-muted-foreground">Waiting for command output…</p>`),Jhe=L(`<p class="m-0 text-xs text-muted-foreground">Streaming live output…</p>`),Yhe=L(`<!> <!>`,1);function Xhe(e,t){D(t,!0);let n=q(t,`expanded`,3,!1);var r=Yhe(),i=N(r),a=e=>{u1(e,{get text(){return t.view.output},direction:`tail`,get expanded(){return n()}})},o=e=>{z(e,qhe())};V(i,e=>{t.view.output.length>0?e(a):t.toolCall.status===`running`&&e(o,1)});var s=P(i,2),c=e=>{z(e,Jhe())};V(s,e=>{t.view.live&&e(c)}),z(e,r),O()}function Zhe(e,t){D(t,!0);let n=q(t,`expanded`,3,!1);var r=R(),i=N(r),a=e=>{u1(e,{get text(){return t.view.diff},language:`diff`,get expanded(){return n()}})};V(i,e=>{t.view.diff&&e(a)}),z(e,r),O()}var Qhe=new Set([`$$slots`,`$$events`,`$$legacy`]);function $he(e,t){let n=G(t,Qhe),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`}]];uc(e,K({name:`circle-alert`},()=>n,{get iconNode(){return r}}))}var ege=new Set([`$$slots`,`$$events`,`$$legacy`]);function tge(e,t){let n=G(t,ege),r=[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`}]];uc(e,K({name:`circle-dashed`},()=>n,{get iconNode(){return r}}))}var nge=new Set([`$$slots`,`$$events`,`$$legacy`]);function d1(e,t){let n=G(t,nge),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M10 9H8`}],[`path`,{d:`M16 13H8`}],[`path`,{d:`M16 17H8`}]];uc(e,K({name:`file-text`},()=>n,{get iconNode(){return r}}))}var rge=new Set([`$$slots`,`$$events`,`$$legacy`]);function f1(e,t){let n=G(t,rge),r=[[`path`,{d:`m13 13.5 2-2.5-2-2.5`}],[`path`,{d:`m21 21-4.3-4.3`}],[`path`,{d:`M9 8.5 7 11l2 2.5`}],[`circle`,{cx:`11`,cy:`11`,r:`8`}]];uc(e,K({name:`search-code`},()=>n,{get iconNode(){return r}}))}var ige=L(`<header class="grid gap-1.5"><div class="flex items-center justify-between gap-2 text-xs font-medium text-muted-foreground"><span class="flex min-w-0 items-center gap-2"><!> </span> <span class="tabular-nums"> </span></div> <div class="h-1 overflow-hidden rounded-full bg-muted" aria-hidden="true"><div></div></div></header>`),age=L(`<span class="shrink-0 rounded border border-border px-1.5 py-0.5 text-xs leading-none text-muted-foreground"> </span>`),oge=L(`<span class="ml-auto shrink-0 text-xs tabular-nums text-muted-foreground"> </span>`),sge=L(`<p class="m-0 truncate text-xs text-muted-foreground/80"> </p>`),cge=L(`<p class="m-0 line-clamp-2 text-sm leading-relaxed text-muted-foreground"> </p>`),lge=L(`<p class="m-0 text-xs text-muted-foreground"> </p>`),uge=L(`<button type="button" class="mt-0.5 inline-flex w-fit items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1 text-xs font-medium text-primary hover:bg-muted"><!> Open report <span class="font-mono text-muted-foreground"> </span></button>`),dge=L(`<!> <!> <!>`,1),fge=L(`<p class="m-0 truncate font-mono text-xs text-muted-foreground"> </p>`),pge=L(`<p class="m-0 break-words text-sm leading-relaxed text-destructive"> </p> <!>`,1),mge=L(`<span class="shrink-0 text-muted-foreground/70"> </span>`),hge=L(`<p class="m-0 flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground"><span> </span> <!></p>`),gge=L(`<p class="m-0 text-xs text-muted-foreground">Queued…</p>`),_ge=L(`<li class="grid grid-cols-[auto_minmax(0,1fr)] items-start gap-2.5 rounded-lg border border-border bg-card px-3 py-2.5"><span class="mt-0.5" aria-hidden="true"><!></span> <div class="grid min-w-0 gap-1"><div class="flex min-w-0 items-baseline gap-2"><strong class="truncate text-sm font-medium leading-tight"> </strong> <!> <!></div> <!> <!></div></li>`),vge=L(`<ol class="grid gap-1.5"></ol>`),yge=L(`<pre class="overflow-auto rounded-md border border-border bg-muted/40 p-3 font-mono text-xs text-muted-foreground"> </pre>`),bge=L(`<p class="flex items-center gap-2 text-sm leading-relaxed text-muted-foreground"><!> Explore agents are working…</p>`),xge=L(`<p class="text-sm leading-relaxed text-muted-foreground">Explore completed without report files.</p>`),Sge=L(`<div class="grid gap-2.5"><!> <!></div>`);function Cge(e,t){D(t,!0);let n=k(()=>X$(t.view)),r=k(()=>I(n).tasks),i=k(()=>I(n).summary),a=k(()=>I(i).total>1),o=k(()=>I(i).total>0?Math.round(I(i).completed/I(i).total*100):0);function s(e){return e.split(/[\\/]/).pop()||e}function c(e){return e.split(/[/:]/).pop()??e}function l(e){if(e.task)return e.task===u(e)?void 0:e.task}function u(e){return e.label??e.task??(e.index===void 0?`Explore`:`Explore ${e.index+1}`)}function d(e){let t=[];return e.usage?.turns&&t.push(`${e.usage.turns} turn${e.usage.turns===1?``:`s`}`),(e.usage?.input||e.usage?.output)&&t.push(`${e.usage.input+e.usage.output} tokens`),t.length>0?t.join(` · `):void 0}var f=Sge(),p=M(f),m=e=>{var t=ige(),n=M(t),r=M(n),a=M(r);f1(a,{size:14,strokeWidth:2.1});var s=P(a);T(r);var c=P(r,2),l=M(c);T(c),T(n);var u=P(n,2),d=M(u);T(u),T(t),F(()=>{B(s,` ${I(i).done?`Explored codebase`:`Exploring codebase`}`),B(l,`${I(i).completed??``}/${I(i).total??``} agents`),ra(d,1,`h-full rounded-full transition-[width] duration-500 ease-out ${I(i).failed>0&&I(i).done?`bg-warning`:I(i).done?`bg-success`:`bg-info`}`),aa(d,`width: ${I(o)}%`)}),z(e,t)};V(p,e=>{I(a)&&e(m)});var h=P(p,2),g=e=>{var n=vge();Ri(n,21,()=>I(r),e=>e.key,(e,n)=>{var r=_ge(),i=M(r),a=M(i),o=e=>{ZQ(e,{size:16,strokeWidth:2.1,class:`text-success`})},f=e=>{$he(e,{size:16,strokeWidth:2.1,class:`text-destructive`})},p=e=>{tD(e,{size:16,strokeWidth:2.1,class:`animate-spin text-info`})},m=e=>{tge(e,{size:16,strokeWidth:2.1,class:`text-muted-foreground`})};V(a,e=>{I(n).status===`completed`?e(o):I(n).status===`failed`?e(f,1):I(n).status===`running`?e(p,2):e(m,-1)}),T(i);var h=P(i,2),g=M(h),_=M(g),v=M(_,!0);T(_);var y=P(_,2),b=e=>{var t=age(),r=M(t,!0);T(t),F(e=>{W(t,`title`,I(n).model),B(r,e)},[()=>c(I(n).model)]),z(e,t)};V(y,e=>{I(n).model&&e(b)});var x=P(y,2),S=e=>{var t=oge(),r=M(t);T(t),F(()=>B(r,`${I(n).index+1}/${I(n).count??``}`)),z(e,t)};V(x,e=>{I(n).count&&I(n).count>1&&I(n).index!==void 0&&e(S)}),T(g);var ee=P(g,2),C=e=>{let t=k(()=>l(I(n)));var r=R(),i=N(r),a=e=>{var n=sge(),r=M(n,!0);T(n),F(()=>B(r,I(t))),z(e,n)};V(i,e=>{I(t)&&e(a)}),z(e,r)};V(ee,e=>{I(n).status!==`completed`&&e(C)});var te=P(ee,2),ne=e=>{let r=k(()=>d(I(n).report));var i=dge(),a=N(i),o=e=>{var t=cge(),r=M(t,!0);T(t),F(()=>B(r,I(n).report.summaryPreview)),z(e,t)};V(a,e=>{I(n).report.summaryPreview&&e(o)});var c=P(a,2),l=e=>{var t=lge(),n=M(t,!0);T(t),F(()=>B(n,I(r))),z(e,t)};V(c,e=>{I(r)&&e(l)});var u=P(c,2),f=e=>{var r=uge(),i=M(r);d1(i,{size:13,strokeWidth:2.1});var a=P(i,2),o=M(a,!0);T(a),T(r),F(e=>{W(r,`title`,I(n).report.reportPath),B(o,e)},[()=>s(I(n).report.reportPath)]),bi(`click`,r,()=>I(n).report?.reportPath&&t.onOpenFile?.(I(n).report.reportPath)),z(e,r)};V(u,e=>{I(n).report.reportPath&&e(f)}),z(e,i)},re=e=>{var t=pge(),r=N(t),i=M(r,!0);T(r);var a=P(r,2),o=e=>{var t=fge(),r=M(t,!0);T(t),F(()=>B(r,I(n).report.steps[I(n).report.steps.length-1]?.message)),z(e,t)};V(a,e=>{I(n).report?.steps?.length&&e(o)}),F(()=>B(i,I(n).error??`Explore agent failed.`)),z(e,t)},ie=e=>{var t=hge(),r=M(t),i=M(r,!0);T(r);var a=P(r,2),o=e=>{var t=mge(),r=M(t);T(t),F(()=>B(r,`· ${I(n).actionCount??``} actions`)),z(e,t)};V(a,e=>{I(n).actionCount>1&&e(o)}),T(t),F(()=>{ra(r,1,`truncate ${I(n).currentActionMono?`font-mono`:``}`),B(i,I(n).currentAction)}),z(e,t)},ae=e=>{z(e,gge())};V(te,e=>{I(n).status===`completed`&&I(n).report?e(ne):I(n).status===`failed`?e(re,1):I(n).currentAction?e(ie,2):e(ae,-1)}),T(h),T(r),F(e=>B(v,e),[()=>u(I(n))]),z(e,r)}),T(n),z(e,n)},_=e=>{var n=yge(),r=M(n,!0);T(n),F(()=>B(r,t.view.liveLog)),z(e,n)},v=e=>{var t=bge();tD(M(t),{size:14,strokeWidth:2.1,class:`animate-spin text-info`}),E(),T(t),z(e,t)},y=e=>{z(e,xge())};V(h,e=>{I(r).length>0?e(g):t.view.liveLog?e(_,1):t.toolCall.status===`running`||t.toolCall.status===`requested`?e(v,2):e(y,-1)}),T(f),z(e,f),O()}xi([`click`]);var wge=L(`<p class="m-0 text-xs text-muted-foreground">No files found.</p>`),Tge=L(`<li><button type="button" class="cursor-pointer border-0 bg-transparent p-0 text-left font-mono text-xs text-primary hover:underline"> </button></li>`),Ege=L(`<ul class="m-0 list-none rounded-sm border bg-sidebar px-2.5 py-2 font-mono text-xs leading-snug text-sidebar-foreground"></ul>`);function Dge(e,t){D(t,!0);let n=q(t,`expanded`,3,!1),r=k(()=>(n()?t.view.paths:t.view.paths.slice(0,10)).map((e,n)=>({path:e,openPath:t.view.openPaths[n]??e})));var i=R(),a=N(i),o=e=>{z(e,wge())},s=e=>{var n=Ege();Ri(n,21,()=>I(r),e=>e.path,(e,n)=>{var r=Tge(),i=M(r),a=M(i,!0);T(i),T(r),F(()=>B(a,I(n).path)),bi(`click`,i,()=>t.onOpenFile?.(I(n).openPath)),z(e,r)}),T(n),z(e,n)};V(a,e=>{t.view.count===0?e(o):e(s,-1)}),z(e,i),O()}xi([`click`]);function p1(e,t){}var Oge=L(`<button class="match svelte-1pkduer" type="button"><span class="line-no svelte-1pkduer"> </span><span class="line-text svelte-1pkduer"> </span></button>`),kge=L(`<div class="file"><button class="file-path svelte-1pkduer" type="button" title="Open file pane"> </button> <!></div>`),Age=L(`<div class="matches svelte-1pkduer"></div>`),jge=L(`<p class="note svelte-1pkduer">No matches.</p>`);function Mge(e,t){D(t,!0);let n=(e,n=w)=>{var r=Age();Ri(r,21,n,e=>e.path,(e,n)=>{var r=kge(),i=M(r),a=M(i,!0);T(i),Ri(P(i,2),19,()=>I(n).matches,(e,t)=>`${I(n).path}:${e.line}:${t}:${e.text}`,(e,r)=>{var i=Oge(),a=M(i),o=M(a,!0);T(a);var s=P(a),c=M(s,!0);T(s),T(i),F(()=>{W(i,`title`,`Open ${I(n).path}:${I(r).line}`),B(o,I(r).line),B(c,I(r).text)}),bi(`click`,i,()=>t.onOpenFile?.(I(r).openPath??I(n).openPath??I(n).path,I(r).line)),z(e,i)}),T(r),F(()=>B(a,I(n).path)),bi(`click`,i,()=>t.onOpenFile?.(I(n).openPath??I(n).path)),z(e,r)}),T(r),z(e,r)},r=q(t,`expanded`,3,!1),i=k(()=>{if(r())return t.view.allMatches;let e=[],n=0;for(let r of t.view.allMatches){if(n>=10)break;let t=r.matches.slice(0,10-n);e.push({path:r.path,openPath:r.openPath,matches:t}),n+=t.length}return e});var a=R(),o=N(a),s=e=>{z(e,jge())},c=e=>{n(e,()=>I(i))};V(o,e=>{t.view.matchCount===0?e(s):e(c,-1)}),z(e,a),O()}xi([`click`]);var Nge=new Set([`$$slots`,`$$events`,`$$legacy`]);function Pge(e,t){let n=G(t,Nge),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}]];uc(e,K({name:`file`},()=>n,{get iconNode(){return r}}))}var Fge=L(`<p class="m-0 text-xs text-muted-foreground">Empty directory.</p>`),Ige=L(`<button type="button" class="cursor-pointer border-0 bg-transparent p-0 text-left font-mono text-xs text-primary hover:underline"> </button>`),Lge=L(`<span> </span>`),Rge=L(`<li class="flex items-center gap-1.5"><!> <!></li>`),zge=L(`<ul class="m-0 list-none rounded-sm border bg-sidebar px-2.5 py-2 font-mono text-xs leading-normal text-sidebar-foreground"></ul>`);function Bge(e,t){D(t,!0);let n=q(t,`expanded`,3,!1);function r(e){return[...e].sort((e,t)=>e.kind===t.kind?e.path.localeCompare(t.path):e.kind===`directory`?-1:1)}let i=k(()=>r(t.view.entries)),a=k(()=>n()?I(i):I(i).slice(0,10));var o=R(),s=N(o),c=e=>{z(e,Fge())},l=e=>{var n=zge();Ri(n,21,()=>I(a),e=>e.path,(e,n)=>{var r=Rge(),i=M(r),a=e=>{v$(e,{size:12,strokeWidth:2,class:`flex-none text-muted-foreground`})},o=e=>{Pge(e,{size:12,strokeWidth:2,class:`flex-none text-muted-foreground`})};V(i,e=>{I(n).kind===`directory`?e(a):e(o,-1)});var s=P(i,2),c=e=>{var r=Ige(),i=M(r,!0);T(r),F(()=>B(i,I(n).path)),bi(`click`,r,()=>t.onOpenFile?.(I(n).openPath??I(n).path)),z(e,r)},l=e=>{var t=Lge(),r=M(t,!0);T(t),F(()=>B(r,I(n).path)),z(e,t)};V(s,e=>{I(n).kind===`file`?e(c):e(l,-1)}),T(r),z(e,r)}),T(n),z(e,n)};V(s,e=>{t.view.total===0?e(c):e(l,-1)}),z(e,o),O()}xi([`click`]);var Vge=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function m1(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=G(t,Vge);var i=R();U(N(i),()=>$y,(e,t)=>{t(e,K(()=>r,{get open(){return n()},set open(e){n(e)}}))}),z(e,i),O()}var Hge=new Set([`$$slots`,`$$events`,`$$legacy`]);function h1(e,t){let n=G(t,Hge),r=[[`path`,{d:`M5 12h14`}]];uc(e,K({name:`minus`},()=>n,{get iconNode(){return r}}))}var Uge=new Set([`$$slots`,`$$events`,`$$legacy`]);function Wge(e,t){let n=G(t,Uge);var r=R();U(N(r),()=>im,(e,t)=>{t(e,K(()=>n))}),z(e,r)}var Gge=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`sideOffset`,`align`,`portalProps`,`class`]);function g1(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`sideOffset`,3,4),i=q(t,`align`,3,`start`),a=G(t,Gge);Wge(e,K(()=>t.portalProps,{children:(e,o)=>{var s=R(),c=N(s);{let e=k(()=>ul(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-md p-1 shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 w-(--bits-dropdown-menu-anchor-width) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden`,t.class));U(c,()=>nb,(t,o)=>{o(t,K({"data-slot":`dropdown-menu-content`,get sideOffset(){return r()},get align(){return i()},get class(){return I(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,s)},$$slots:{default:!0}})),O()}var Kge=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`inset`,`variant`]);function _1(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`variant`,3,`default`),i=G(t,Kge);var a=R(),o=N(a);{let e=k(()=>ul(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm data-inset:pl-8 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0`,t.class));U(o,()=>oy,(a,o)=>{o(a,K({"data-slot":`dropdown-menu-item`,get"data-inset"(){return t.inset},get"data-variant"(){return r()},get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,a),O()}var qge=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function v1(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,qge);var i=R(),a=N(i);{let e=k(()=>ul(`bg-border -mx-1 my-1 h-px`,t.class));U(a,()=>xy,(t,i)=>{i(t,K({"data-slot":`dropdown-menu-separator`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var Jge=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function y1(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Jge);var i=R();U(N(i),()=>ab,(e,t)=>{t(e,K({"data-slot":`dropdown-menu-trigger`},()=>r,{get ref(){return n()},set ref(e){n(e)}}))}),z(e,i),O()}var Yge=L(`<!> <!>`,1),Xge=L(`<div class="inline-flex" role="group"><!> <!></div>`);function Zge(e,t){D(t,!0);let n=q(t,`variant`,3,`default`),r=q(t,`size`,3,`sm`),i=q(t,`disabled`,3,!1),a=q(t,`menuAlign`,3,`end`),o=k(()=>n()==="default"||n()===`success`?`border-l-primary-foreground/25`:`border-l-border/70`);var s=Xge(),c=M(s);Ml(c,{get variant(){return n()},get size(){return r()},get disabled(){return i()},get onclick(){return t.onclick},class:`rounded-r-none`,children:(e,n)=>{var r=R();H(N(r),()=>t.children),z(e,r)},$$slots:{default:!0}}),U(P(c,2),()=>m1,(e,s)=>{s(e,{children:(e,s)=>{var c=Yge(),l=N(c);{let e=k(()=>ul(Ol({variant:n(),size:r()}),`-ml-px rounded-l-none border-l px-1.5`,I(o)));U(l,()=>y1,(n,r)=>{r(n,{get class(){return I(e)},get disabled(){return i()},get"aria-label"(){return t.triggerLabel},children:(e,t)=>{Kw(e,{class:`size-3.5`,strokeWidth:2.3})},$$slots:{default:!0}})})}U(P(l,2),()=>g1,(e,n)=>{n(e,{get align(){return a()},get class(){return t.menuClass},children:(e,n)=>{var r=R();H(N(r),()=>t.menu),z(e,r)},$$slots:{default:!0}})}),z(e,c)},$$slots:{default:!0}})}),T(s),z(e,s),O()}var Qge=L(`<!> <!>`,1),$ge=L(`<p class="m-0 rounded-md border border-dashed border-border bg-muted p-3 text-sm text-muted-foreground">No models available. Configure a provider or adjust Scoped Models in Settings.</p>`),e_e=L(`<button type="button" role="option"><span class="min-w-0 truncate font-medium"> </span> <!></button>`),t_e=L(`<div class="grid gap-1" role="listbox" aria-label="Implementation model"></div>`),n_e=L(`<button type="button"> </button>`),r_e=L(`<section class="grid gap-2 border-t border-border pt-4"><p class="m-0 text-xs font-semibold uppercase tracking-wide text-muted-foreground">Thinking level</p> <div class="flex flex-wrap gap-2" role="group" aria-label="Implementation thinking level"></div></section>`),i_e=L(`<div class="grid gap-4 px-3.5 py-4"><section class="grid gap-2"><p class="m-0 text-xs font-semibold uppercase tracking-wide text-muted-foreground">Model</p> <!></section> <!></div>`);function b1(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=A(``),i=A(`off`),a=A(!1),o=k(()=>t.models.find(e=>aE(e)===I(r))),s=k(()=>vZ(I(o))),c=k(()=>!I(o)||I(a)),l={off:`No reasoning`,minimal:`Very brief reasoning`,low:`Light reasoning`,medium:`Moderate reasoning`,high:`Deep reasoning`,xhigh:`Maximum reasoning`};function u(e){return e===`off`?`Off`:e[0].toUpperCase()+e.slice(1)}function d(){let e=t.models.find(e=>aE(e)===t.initialModelKey)??t.models[0];j(r,e?aE(e):``,!0),j(i,yZ(t.initialThinkingLevel,e),!0)}function f(e){n(e),t.onOpenChange?.(e)}function p(e){j(r,aE(e),!0),j(i,yZ(I(i),e),!0)}function m(e){j(i,yZ(e,I(o)),!0)}async function h(){if(!I(o)||I(a))return;let e=oE(I(r));if(e){j(a,!0);try{await t.onConfirm?.({implementationModel:e,implementationThinkingLevel:I(i)}),f(!1)}finally{j(a,!1)}}}sr(()=>{n()&&d()}),nZ(e,{get open(){return n()},get title(){return t.title},get description(){return t.description},onOpenChange:f,class:`max-w-xl`,footer:e=>{var n=Qge(),r=N(n);Ml(r,{variant:`secondary`,onclick:()=>f(!1),get disabled(){return I(a)},children:(e,t)=>{E(),z(e,ki(`Cancel`))},$$slots:{default:!0}}),Ml(P(r,2),{onclick:h,get disabled(){return I(c)},children:(e,n)=>{E();var r=ki();F(()=>B(r,t.confirmLabel)),z(e,r)},$$slots:{default:!0}}),z(e,n)},children:(e,n)=>{var a=i_e(),c=M(a),d=P(M(c),2),f=e=>{z(e,$ge())},h=e=>{var n=t_e();Ri(n,21,()=>t.models,e=>aE(e),(e,n)=>{let i=k(()=>aE(I(n))),a=k(()=>I(i)===I(r));var o=e_e(),s=M(o),c=M(s,!0);T(s);var l=P(s,2),u=e=>{JQ(e,{class:`size-4`,strokeWidth:2.4})};V(l,e=>{I(a)&&e(u)}),T(o),F(e=>{ra(o,1,`flex w-full items-center justify-between gap-3 rounded-md border px-3 py-2 text-left text-sm transition-colors ${I(a)?`border-primary/40 bg-primary/10 text-primary`:`border-transparent text-foreground hover:bg-accent`}`),W(o,`aria-selected`,I(a)),B(c,e)},[()=>mE(I(n),t.models)]),bi(`click`,o,()=>p(I(n))),z(e,o)}),T(n),z(e,n)};V(d,e=>{t.models.length===0?e(f):e(h,-1)}),T(c);var g=P(c,2),_=e=>{var t=r_e(),n=P(M(t),2);Ri(n,20,()=>I(s),e=>e,(e,t)=>{let n=k(()=>t===I(i));var r=n_e(),a=M(r,!0);T(r),F(e=>{ra(r,1,`rounded-full border px-3 py-1 text-xs font-medium transition-colors ${I(n)?`border-primary bg-primary/10 text-primary`:`border-border bg-input text-muted-foreground hover:border-primary/40 hover:text-foreground`}`),W(r,`aria-pressed`,I(n)),W(r,`title`,l[t]),B(a,e)},[()=>u(t)]),bi(`click`,r,()=>m(t)),z(e,r)}),T(n),T(t),z(e,t)};V(g,e=>{I(o)&&e(_)}),T(a),z(e,a)},$$slots:{footer:!0,default:!0}}),O()}xi([`click`]);var a_e=L(`<pre class="m-0 whitespace-pre-wrap rounded-sm border bg-sidebar p-2.5 font-mono text-xs leading-normal text-foreground"> </pre>`),o_e=L(`<!> <!> <!> <!> <!>`,1),s_e=L(`<!> Accept & Implement`,1),c_e=L(`<!> Reject Plan`,1),l_e=L(`<div class="grid gap-2" aria-label="Plan review"><!> <div class="flex flex-wrap justify-end gap-2"><!> <!></div> <!> <!></div>`),u_e=L(`<p class="m-0 text-sm text-muted-foreground"> </p>`);function d_e(e,t){D(t,!0);let n=q(t,`planReviewModels`,19,()=>[]),r=q(t,`planReviewModelKey`,3,``),i=q(t,`planReviewThinkingLevel`,3,`off`),a=A(void 0),o=A(void 0);function s(e){return e&&typeof e==`object`?e:{}}function c(e){return typeof e==`string`?e:void 0}function l(e){let t=s(s(e).review);return typeof t.id==`string`||typeof t.content==`string`?t:void 0}let u=k(()=>l(t.toolCall.result)),d=k(()=>t.planReview??I(u)),f=k(()=>t.toolCall.toolName===`plan_mode_present`&&t.toolCall.status===`waiting_for_user`&&t.planReview?.status===`pending`),p=k(()=>I(d)?.status??c(s(t.toolCall.result).outcome)),m=k(()=>I(p)===`accepted`),h=k(()=>I(p)===`accepted_in_new_chat`),g=k(()=>I(p)===`changes_requested`||I(p)===`discarded`),_=k(()=>R$(I(d)?.content??``,{headLines:8,tailLines:0,maxChars:1800,marker:()=>`… open the plan file to read the rest …`}).text),v=k(()=>t.toolCall.toolName===`plan_mode_present`&&!!I(d)),y=k(()=>!I(f)||!!I(o)),b=k(()=>I(m)||I(h)?`success`:`default`);async function x(e){if(!(!t.planReview||!I(f)||I(o)||!t.onAcceptPlanReview)){j(o,`same`);try{await t.onAcceptPlanReview(t.planReview.id,e)}finally{j(o,void 0)}}}async function S(e){if(!(!t.planReview||!I(f)||I(o)||!t.onAcceptPlanReviewInNewChat)){j(o,`new-chat`);try{await t.onAcceptPlanReviewInNewChat(t.planReview.id,e)}finally{j(o,void 0)}}}function ee(){!I(f)||I(o)||j(a,`same`)}function C(){!I(f)||I(o)||j(a,`new-chat`)}function te(){!t.planReview||!I(f)||I(o)||t.onRejectPlanReview?.(t.planReview.id)}var ne=R(),re=N(ne),ie=e=>{var t=l_e(),o=M(t),s=e=>{var t=a_e(),n=M(t,!0);T(t),F(()=>B(n,I(_))),z(e,t)},c=k(()=>I(_).trim());V(o,e=>{I(c)&&e(s)});var l=P(o,2),u=M(l);Zge(u,{get variant(){return I(b)},size:`sm`,get disabled(){return I(y)},menuAlign:`end`,menuClass:`w-60`,triggerLabel:`Accept options`,onclick:()=>void x(),menu:e=>{var t=o_e(),n=N(t);U(n,()=>_1,(e,t)=>{t(e,{get disabled(){return I(y)},onSelect:()=>void x(),children:(e,t)=>{E(),z(e,ki(`Accept & implement`))},$$slots:{default:!0}})});var r=P(n,2);U(r,()=>_1,(e,t)=>{t(e,{get disabled(){return I(y)},onSelect:()=>void S(),children:(e,t)=>{E(),z(e,ki(`Accept in new chat`))},$$slots:{default:!0}})});var i=P(r,2);U(i,()=>v1,(e,t)=>{t(e,{})});var a=P(i,2);U(a,()=>_1,(e,t)=>{t(e,{get disabled(){return I(y)},onSelect:ee,children:(e,t)=>{E(),z(e,ki(`Choose model & implement`))},$$slots:{default:!0}})}),U(P(a,2),()=>_1,(e,t)=>{t(e,{get disabled(){return I(y)},onSelect:C,children:(e,t)=>{E(),z(e,ki(`Choose model & start new chat`))},$$slots:{default:!0}})}),z(e,t)},children:(e,t)=>{var n=s_e(),r=N(n),i=e=>{JQ(e,{class:`size-3.5`,strokeWidth:2.4})};V(r,e=>{(I(m)||I(h))&&e(i)}),E(),z(e,n)},$$slots:{menu:!0,default:!0}}),Ml(P(u,2),{size:`sm`,variant:`secondary`,get disabled(){return I(y)},onclick:te,children:(e,t)=>{var n=c_e(),r=N(n),i=e=>{JQ(e,{class:`size-3.5`,strokeWidth:2.4})};V(r,e=>{I(g)&&e(i)}),E(),z(e,n)},$$slots:{default:!0}}),T(l);var d=P(l,2);{let e=k(()=>I(a)===`same`);b1(d,{get open(){return I(e)},title:`Choose implementation model`,description:`The selected model will be used when implementation continues in this conversation.`,confirmLabel:`Accept and implement`,get models(){return n()},get initialModelKey(){return r()},get initialThinkingLevel(){return i()},onOpenChange:e=>{j(a,e?`same`:void 0,!0)},onConfirm:x})}var f=P(d,2);{let e=k(()=>I(a)===`new-chat`);b1(f,{get open(){return I(e)},title:`Choose implementation model`,description:`The selected model will be used by the new implementation chat.`,confirmLabel:`Accept in new chat`,get models(){return n()},get initialModelKey(){return r()},get initialThinkingLevel(){return i()},onOpenChange:e=>{j(a,e?`new-chat`:void 0,!0)},onConfirm:S})}T(t),z(e,t)},ae=e=>{var n=u_e(),r=M(n,!0);T(n),F(()=>B(r,t.view.summary)),z(e,n)};V(re,e=>{I(v)&&I(d)?e(ie):t.view.summary&&e(ae,1)}),z(e,ne),O()}var f_e=L(`<p class="m-0 text-xs text-muted-foreground">Python script file: <code class="font-mono text-foreground"> </code></p>`),p_e=L(`<section class="grid gap-1" aria-label="Python script"><!></section>`),m_e=L(`<section class="grid gap-1" aria-label="Python output"><!></section>`),h_e=L(`<p class="m-0 text-xs text-muted-foreground">Waiting for Python output…</p>`),g_e=L(`<section class="grid gap-1" aria-label="Python output"><p class="m-0 text-xs text-muted-foreground">No Python output.</p></section>`),__e=L(`<p class="m-0 text-xs text-muted-foreground">Streaming live output…</p>`),v_e=L(`<div class="grid gap-1.5"><!> <!> <!></div>`);function y_e(e,t){D(t,!0);let n=q(t,`expanded`,3,!1);var r=v_e(),i=M(r),a=e=>{var n=f_e(),r=P(M(n)),i=M(r,!0);T(r),T(n),F(()=>B(i,t.view.relScriptPath)),z(e,n)},o=e=>{var r=p_e();u1(M(r),{get text(){return t.view.code},language:`python`,get expanded(){return n()}}),T(r),z(e,r)};V(i,e=>{t.view.inputMode===`file`&&t.view.relScriptPath?e(a):t.view.code&&t.view.code.length>0&&e(o,1)});var s=P(i,2),c=e=>{var r=m_e();u1(M(r),{get text(){return t.view.output},direction:`tail`,get expanded(){return n()}}),T(r),z(e,r)},l=e=>{z(e,h_e())},u=e=>{z(e,g_e())};V(s,e=>{t.view.output.length>0?e(c):t.toolCall.status===`running`?e(l,1):t.toolCall.status===`completed`&&(t.view.inputMode===`file`||t.view.code&&t.view.code.length>0)&&e(u,2)});var d=P(s,2),f=e=>{z(e,__e())};V(d,e=>{t.view.live&&e(f)}),T(r),z(e,r),O()}var b_e={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`jsonc`,css:`css`,html:`html`,svelte:`svelte`,md:`markdown`,markdown:`markdown`,py:`python`,yml:`yaml`,yaml:`yaml`,sh:`bash`,bash:`bash`,zsh:`shellscript`};function x1(e){if(!e)return;let t=e.split(/[\\/]/).pop()??e,n=t.lastIndexOf(`.`);if(!(n<=0))return b_e[t.slice(n+1).toLowerCase()]}var x_e=L(`<button class="cursor-pointer border-0 bg-transparent p-0" type="button" title="Open image pane"><img class="max-h-60 max-w-80 rounded-sm border object-contain"/></button>`);function S_e(e,t){D(t,!0);let n=q(t,`expanded`,3,!1),r=k(()=>x1(t.view.relPath));var i=R(),a=N(i),o=e=>{var n=x_e(),r=M(n);T(n),F(()=>{W(r,`src`,t.view.image.dataUrl),W(r,`alt`,t.view.relPath??`image`)}),bi(`click`,n,()=>t.view.path&&t.onOpenFile?.(t.view.path)),z(e,n)},s=e=>{u1(e,{get text(){return t.view.content},get language(){return I(r)},get expanded(){return n()}})};V(a,e=>{t.view.image?e(o):t.view.content!==void 0&&t.view.content.length>0&&e(s,1)}),z(e,i),O()}xi([`click`]);var C_e=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function S1(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=G(t,C_e);var i=R();U(N(i),()=>YS,(e,t)=>{t(e,K(()=>r,{get open(){return n()},set open(e){n(e)}}))}),z(e,i),O()}var w_e=new Set([`$$slots`,`$$events`,`$$legacy`]);function T_e(e,t){let n=G(t,w_e);var r=R();U(N(r),()=>im,(e,t)=>{t(e,K(()=>n))}),z(e,r)}var E_e=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`sideOffset`,`side`,`children`,`arrowClasses`,`portalProps`]),D_e=L(`<div></div>`),O_e=L(`<!> <!>`,1);function C1(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`sideOffset`,3,0),i=q(t,`side`,3,`top`),a=G(t,E_e);T_e(e,K(()=>t.portalProps,{children:(e,o)=>{var s=R(),c=N(s);{let e=k(()=>ul(`data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm border bg-popover text-popover-foreground shadow-md z-50 w-fit max-w-xs origin-(--bits-tooltip-content-transform-origin)`,t.class));U(c,()=>QS,(o,s)=>{s(o,K({"data-slot":`tooltip-content`,get sideOffset(){return r()},get side(){return i()},get class(){return I(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=O_e(),i=N(r);H(i,()=>t.children??w);var a=P(i,2);{let e=(e,n)=>{let r=()=>n?.().props;var i=D_e();Sa(i,e=>({class:e,...r()}),[()=>ul(`size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] border-r border-b border-border bg-popover fill-popover z-50`,`data-[side=top]:translate-x-1/2 data-[side=top]:translate-y-[calc(-50%+2px)]`,`data-[side=bottom]:-translate-x-1/2 data-[side=bottom]:-translate-y-[calc(-50%+1px)]`,`data-[side=right]:translate-x-[calc(50%+2px)] data-[side=right]:translate-y-1/2`,`data-[side=left]:-translate-y-[calc(50%-3px)]`,t.arrowClasses)]),z(e,i)};U(a,()=>rC,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}z(e,r)},$$slots:{default:!0}}))})}z(e,s)},$$slots:{default:!0}})),O()}var k_e=new Set([`$$slots`,`$$events`,`$$legacy`,`delayDuration`]);function w1(e,t){let n=q(t,`delayDuration`,3,0),r=G(t,k_e);var i=R();U(N(i),()=>iC,(e,t)=>{t(e,K({get delayDuration(){return n()}},()=>r))}),z(e,i)}var A_e=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`]);function T1(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,A_e);var i=R();U(N(i),()=>tC,(e,t)=>{t(e,K({"data-slot":`tooltip-trigger`},()=>r,{get ref(){return n()},set ref(e){n(e)}}))}),z(e,i),O()}function E1(e){try{return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}catch{return e}}function D1(e){if(!e)return``;let t=new Date(e).getTime();if(Number.isNaN(t))return``;let n=Date.now()-t,r=Math.round(n/1e3);if(r<45)return`now`;let i=Math.round(r/60);if(i<60)return`${i}m`;let a=Math.round(i/60);if(a<24)return`${a}h`;let o=Math.round(a/24);if(o<7)return`${o}d`;let s=Math.round(o/7);if(s<5)return`${s}w`;let c=Math.round(o/30);return c<12?`${c}mo`:`${Math.round(o/365)}y`}function O1(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}var j_e=/https?:\/\/[^\s)'"]+/i;function M_e(e){if(e.readiness.readyUrl)return e.readiness.readyUrl;if(!e.readiness.readyOnUrl)return;let t=e.readiness.matched;return t&&j_e.test(t)?t:void 0}var N_e=L(`<a class="inline-flex min-w-0 items-center gap-1 truncate font-mono text-xs text-info hover:underline" target="_blank" rel="noreferrer noopener"><!> </a>`),P_e=L(`<div><div> </div> <!> <!> <!> <!></div>`),F_e=L(`<span class="tt-row"><span class="tt-key">env</span> </span> <span class="tt-row tt-env-keys"><span class="tt-key">keys</span> </span>`,1),I_e=L(`<span class="tt-row"><span class="tt-key">group</span> </span>`),L_e=L(`<span class="tt-row"><span class="tt-key">pid</span> </span>`),R_e=L(`<span class="tt-row"><span class="tt-key">pgid</span> </span>`),z_e=L(`<span class="tt-row"><span class="tt-key">platform</span> </span>`),B_e=L(`<span class="tt-row"><span class="tt-key">spawned</span> </span>`),V_e=L(`<span class="tt-row"><span class="tt-key">finished</span> </span>`),H_e=L(`<span class="tt-row"><span class="tt-key">exit</span> </span>`),U_e=L(`<span class="tt-row"><span class="tt-key">signal</span> </span>`),W_e=L(`<span class="tt-row"><span class="tt-key">error</span> </span>`),G_e=L(`<span class="tt-title"> </span> <span class="tt-row"><span class="tt-key">command</span> </span> <span class="tt-row"><span class="tt-key">cwd</span> </span> <span class="tt-row"><span class="tt-key">status</span> </span> <!> <span class="tt-row"><span class="tt-key">started</span> </span> <!> <!> <!> <!> <!> <!> <!> <!> <span class="tt-id"> </span>`,1),k1=L(`<!> <!>`,1),K_e=L(`<p class="m-0 break-words text-xs text-destructive"> </p>`);function A1(e,t){D(t,!0);let n=q(t,`dense`,3,!1),r=k(()=>M_e(t.task)),i=k(()=>iT(t.task.status)),a=k(()=>t.task.envInfo?.keys.length??0),o=k(()=>t.task.envInfo?.keys.join(`, `)),s=k(()=>I(a)===0?void 0:`${I(a)} redacted ${I(a)===1?`var`:`vars`}`),c=k(()=>t.task.exitCode!==void 0&&t.task.exitCode!==null);var l=k1(),u=N(l);U(u,()=>w1,(e,l)=>{l(e,{delayDuration:300,disableHoverableContent:!0,children:(e,l)=>{var u=R();U(N(u),()=>S1,(e,l)=>{l(e,{children:(e,l)=>{var u=k1(),d=N(u);{let e=(e,s)=>{let l=()=>s?.().props;var u=P_e();Sa(u,()=>({...l(),class:`flex min-w-0 items-center gap-2.5 rounded-md border bg-card px-2.5 py-2`}));var d=M(u),f=M(d,!0);T(d);var p=P(d,2),m=e=>{var t=N_e(),n=M(t);wQ(n,{size:12,strokeWidth:2});var i=P(n,1,!0);T(t),F(()=>{W(t,`href`,I(r)),B(i,I(r))}),z(e,t)};V(p,e=>{I(r)&&e(m)});var h=P(p,2),g=e=>{uf(e,{tone:`neutral`,size:`xs`,get title(){return I(o)},children:(e,t)=>{E(),z(e,ki(`env`))},$$slots:{default:!0}})};V(h,e=>{I(a)>0&&e(g)});var _=P(h,2),v=e=>{{let n=k(()=>t.task.exitCode===0?`neutral`:`danger`);uf(e,{get tone(){return I(n)},size:`xs`,children:(e,n)=>{E();var r=ki();F(()=>B(r,`exit ${t.task.exitCode??``}`)),z(e,r)},$$slots:{default:!0}})}},y=e=>{uf(e,{tone:`warn`,size:`xs`,children:(e,n)=>{E();var r=ki();F(()=>B(r,`signal ${t.task.signal??``}`)),z(e,r)},$$slots:{default:!0}})};V(_,e=>{I(c)?e(v):t.task.signal&&e(y,1)});var b=P(_,2);{let e=k(()=>I(i)===`neutral`?`border-border bg-muted text-muted-foreground`:``);uf(b,{get tone(){return I(i)},size:`xs`,get class(){return I(e)},children:(e,n)=>{E();var r=ki();F(()=>B(r,t.task.status)),z(e,r)},$$slots:{default:!0}})}T(u),F(()=>{ra(d,1,`min-w-0 flex-1 ${n()?`truncate`:`whitespace-pre-wrap break-words`} font-mono text-xs text-foreground`),B(f,t.task.command)}),z(e,u)};U(d,()=>T1,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}U(P(d,2),()=>C1,(e,n)=>{n(e,{side:`left`,sideOffset:6,class:`nav-tooltip task-tooltip`,children:(e,n)=>{var r=G_e(),i=N(r),l=M(i,!0);T(i);var u=P(i,2),d=P(M(u),1,!0);T(u);var f=P(u,2),p=P(M(f),1,!0);T(f);var m=P(f,2),h=P(M(m),1,!0);T(m);var g=P(m,2),_=e=>{var t=F_e(),n=N(t),r=P(M(n),1,!0);T(n);var i=P(n,2),a=P(M(i),1,!0);T(i),F(()=>{B(r,I(s)),B(a,I(o))}),z(e,t)};V(g,e=>{I(a)>0&&e(_)});var v=P(g,2),y=P(M(v),1,!0);T(v);var b=P(v,2),x=e=>{var n=I_e(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.groupId)),z(e,n)};V(b,e=>{t.task.groupId&&e(x)});var S=P(b,2),ee=e=>{var n=L_e(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.runtime.childPid)),z(e,n)};V(S,e=>{t.task.runtime?.childPid&&e(ee)});var C=P(S,2),te=e=>{var n=R_e(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.runtime.processGroupId)),z(e,n)};V(C,e=>{t.task.runtime?.processGroupId&&e(te)});var ne=P(C,2),re=e=>{var n=z_e(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.runtime.platform)),z(e,n)};V(ne,e=>{t.task.runtime?.platform&&e(re)});var ie=P(ne,2),ae=e=>{var n=B_e(),r=P(M(n),1,!0);T(n),F(e=>B(r,e),[()=>O1(t.task.runtime.spawnedAt)]),z(e,n)};V(ie,e=>{t.task.runtime?.spawnedAt&&e(ae)});var oe=P(ie,2),w=e=>{var n=V_e(),r=P(M(n),1,!0);T(n),F(e=>B(r,e),[()=>O1(t.task.finishedAt)]),z(e,n)};V(oe,e=>{t.task.finishedAt&&e(w)});var se=P(oe,2),ce=e=>{var n=H_e(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.exitCode)),z(e,n)},le=e=>{var n=U_e(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.signal)),z(e,n)};V(se,e=>{I(c)?e(ce):t.task.signal&&e(le,1)});var ue=P(se,2),de=e=>{var n=W_e(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.error)),z(e,n)};V(ue,e=>{t.task.error&&e(de)});var fe=P(ue,2),pe=M(fe,!0);T(fe),F(e=>{B(l,t.task.name??t.task.command),B(d,t.task.command),B(p,t.task.cwd),B(h,t.task.status),B(y,e),B(pe,t.task.id)},[()=>O1(t.task.startedAt)]),z(e,r)},$$slots:{default:!0}})}),z(e,u)},$$slots:{default:!0}})}),z(e,u)},$$slots:{default:!0}})});var d=P(u,2),f=e=>{var n=K_e(),r=M(n,!0);T(n),F(()=>B(r,t.task.error)),z(e,n)};V(d,e=>{t.task.error&&e(f)}),z(e,l),O()}var q_e=L(`<p class="m-0 text-xs text-muted-foreground">No tasks.</p>`),J_e=L(`<div class="grid gap-1"></div>`);function Y_e(e,t){D(t,!0);var n=R(),r=N(n),i=e=>{z(e,q_e())},a=e=>{var n=J_e();Ri(n,21,()=>t.view.tasks,e=>e.id,(e,t)=>{A1(e,{get task(){return I(t)},dense:!0})}),T(n),z(e,n)};V(r,e=>{t.view.tasks.length===0?e(i):e(a,-1)}),z(e,n),O()}var X_e=L(`<div> </div>`),Z_e=L(`<div class="log-list-wrap svelte-8cwn38"><!></div>`);function Q_e(e,t){D(t,!0);let n=q(t,`maxHeight`,3,`16rem`),r=q(t,`followOutput`,3,!1),i=k(()=>t.events?t.events.map(e=>({key:e.seq,text:e.line,level:e.level,stream:e.stream})):(t.lines??[]).map((e,t)=>({key:`line:${t}`,text:e})));var a=Z_e();let o;var s=M(a);{let e=(e,t)=>{let n=()=>t?.().item;var r=X_e(),i=M(r,!0);T(r),F(()=>{ra(r,1,`log-line${n().level?` level-${n().level}`:``}${n().stream===`stderr`?` stderr`:``}`,`svelte-8cwn38`),B(i,n().text||`\xA0`)}),z(e,r)},t=k(()=>r()?`end`:`start`);O$(s,{get items(){return I(i)},getKey:e=>e.key,estimateSize:()=>18,get anchor(){return I(t)},get followOutput(){return r()},viewportClass:`log-list`,row:e,$$slots:{row:!0}})}T(a),F(()=>o=aa(a,``,o,{"--log-max-height":n()})),z(e,a),O()}var $_e=L(`<p class="m-0 text-xs text-muted-foreground">No log events.</p>`);function eve(e,t){D(t,!0);let n=q(t,`expanded`,3,!1),r=k(()=>n()?t.view.events:K$(t.view.events,10));var i=R(),a=N(i),o=e=>{z(e,$_e())},s=e=>{Q_e(e,{get events(){return I(r)}})};V(a,e=>{t.view.events.length===0?e(o):e(s,-1)}),z(e,i),O()}var tve=L(`<div class="grid gap-1"></div>`);function nve(e,t){D(t,!0);let n=k(()=>t.view.tasks??(t.view.task?[t.view.task]:[]));var r=R(),i=N(r),a=e=>{var t=tve();Ri(t,21,()=>I(n),e=>e.id,(e,t)=>{A1(e,{get task(){return I(t)}})}),T(t),z(e,t)};V(i,e=>{I(n).length>0&&e(a)}),z(e,r),O()}var rve=new Set([`$$slots`,`$$events`,`$$legacy`]);function j1(e,t){let n=G(t,rve),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}]];uc(e,K({name:`circle`},()=>n,{get iconNode(){return r}}))}var ive=L(`<p class="m-0 text-sm text-muted-foreground">No todos set.</p>`),ave=L(`<li><!> <span> </span></li>`),ove=L(`<ul class="m-0 grid list-none gap-1.5 p-0" aria-label="Todo list"></ul>`);function sve(e,t){D(t,!0);var n=R(),r=N(n),i=e=>{z(e,ive())},a=e=>{var n=ove();Ri(n,21,()=>t.view.items,Fi,(e,t)=>{var n=ave(),r=M(n),i=e=>{ZQ(e,{size:15,strokeWidth:2.2,"aria-hidden":`true`,class:`mt-0.5 text-success`})},a=e=>{j1(e,{size:15,strokeWidth:2.2,"aria-hidden":`true`,class:`mt-0.5 text-muted-foreground`})};V(r,e=>{I(t).done?e(i):e(a,-1)});var o=P(r,2);let s;var c=M(o,!0);T(o),T(n),F(()=>{ra(n,1,`grid grid-cols-[auto_1fr] items-start gap-2 text-sm leading-normal ${I(t).done?`text-muted-foreground`:`text-foreground`}`),s=ra(o,1,``,null,s,{"line-through":I(t).done}),B(c,I(t).todo)}),z(e,n)}),T(n),z(e,n)};V(r,e=>{t.view.items.length===0?e(i):e(a,-1)}),z(e,n),O()}function cve(e,t){D(t,!0);let n=q(t,`expanded`,3,!1),r=k(()=>t.view.converted?`markdown`:void 0);var i=R(),a=N(i),o=e=>{u1(e,{get text(){return t.view.content},get language(){return I(r)},get expanded(){return n()}})};V(a,e=>{t.view.content!==void 0&&t.view.content.length>0&&e(o)}),z(e,i),O()}var lve=L(`<div class="rounded-sm border bg-sidebar px-2.5 py-2 text-xs leading-normal text-sidebar-foreground"> </div>`),uve=L(`<a class="group grid gap-0.5 rounded-sm border bg-sidebar px-2.5 py-2 text-inherit no-underline" target="_blank" rel="noreferrer"><span class="text-xs font-semibold leading-snug text-foreground group-hover:underline"> </span> <span class="break-words font-mono text-xs text-muted-foreground"> </span></a>`),dve=L(`<div class="grid gap-2"></div>`),fve=L(`<p class="m-0 text-xs text-muted-foreground">No results.</p>`),pve=L(`<!> <!>`,1);function mve(e,t){D(t,!0);var n=pve(),r=N(n),i=e=>{var n=lve(),r=M(n,!0);T(n),F(()=>B(r,t.view.answer)),z(e,n)};V(r,e=>{t.view.answer&&e(i)});var a=P(r,2),o=e=>{var n=dve();Ri(n,21,()=>t.view.results,e=>e.url,(e,t)=>{var n=uve(),r=M(n),i=M(r,!0);T(r);var a=P(r,2),o=M(a,!0);T(a),T(n),F(()=>{W(n,`href`,I(t).url),B(i,I(t).title),B(o,I(t).url)}),z(e,n)}),T(n),z(e,n)},s=e=>{z(e,fve())};V(a,e=>{t.view.results.length>0?e(o):t.view.answer||e(s,1)}),z(e,n),O()}function hve(e,t){D(t,!0);let n=q(t,`expanded`,3,!1),r=k(()=>x1(t.view.relPath));var i=R(),a=N(i),o=e=>{u1(e,{get text(){return t.view.content},get language(){return I(r)},get expanded(){return n()}})};V(a,e=>{t.view.content!==void 0&&t.view.content.length>0&&e(o)}),z(e,i),O()}var gve={read:S_e,bash:Xhe,python:y_e,edit:Zhe,write:hve,grep:Mge,find:Dge,ls:Bge,ask_user:Lhe,todos:sve,task_action:nve,task_list:Y_e,task_logs:eve,explore:Cge,plan_mode:d_e,web_search:mve,web_fetch:cve,generic:p1};function _ve(e){return gve[e]??p1}var vve=L(`<button class="arg link svelte-1ldx31s" type="button"> </button>`),yve=L(`<a class="arg link svelte-1ldx31s" target="_blank" rel="noreferrer noopener"> </a>`),bve=L(`<span class="arg svelte-1ldx31s"> </span>`),xve=L(`<pre class="tool-error svelte-1ldx31s"> </pre>`),Sve=L(`<div class="tool-body svelte-1ldx31s"><!></div>`),Cve=L(`<span> </span>`),wve=L(`<div class="chips svelte-1ldx31s"></div>`),Tve=L(`<button class="more svelte-1ldx31s" type="button"> </button>`),Eve=L(`<div class="tool-footer svelte-1ldx31s"><!> <!></div>`),Dve=L(`<article><div class="tool-header svelte-1ldx31s"><!> <span class="badge svelte-1ldx31s"> </span> <!></div> <!> <!> <!></article>`);function M1(e,t){D(t,!0);let n=q(t,`dotPulse`,3,!1),r=q(t,`meta`,19,()=>[]),i=q(t,`expanded`,15,!1),a=k(()=>r().length>0||!!t.collapse);var o=Dve(),s=M(o),c=M(s);lC(c,{get tone(){return t.dotTone},get pulse(){return n()},size:`xs`,class:`mr-1.5 align-middle`});var l=P(c,2),u=M(l,!0);T(l);var d=P(l,2),f=e=>{var n=R(),r=N(n),i=e=>{var n=vve(),r=M(n,!0);T(n),F(()=>{W(n,`title`,t.arg.text),B(r,t.arg.text)}),bi(`click`,n,()=>t.onOpenFile?.(t.arg.openPath,t.arg.line)),z(e,n)},a=e=>{var n=yve(),r=M(n,!0);T(n),F(()=>{W(n,`href`,t.arg.href),W(n,`title`,t.arg.text),B(r,t.arg.text)}),z(e,n)},o=e=>{var n=bve(),r=M(n,!0);T(n),F(()=>{W(n,`title`,t.arg.text),B(r,t.arg.text)}),z(e,n)};V(r,e=>{t.arg.openPath?e(i):t.arg.href?e(a,1):e(o,-1)}),z(e,n)};V(d,e=>{t.arg&&e(f)}),T(s);var p=P(s,2),m=e=>{var n=xve(),r=M(n,!0);T(n),F(()=>B(r,t.error)),z(e,n)};V(p,e=>{t.error&&e(m)});var h=P(p,2),g=e=>{var n=Sve();H(M(n),()=>t.children),T(n),z(e,n)};V(h,e=>{t.children&&e(g)});var _=P(h,2),v=e=>{var n=Eve(),a=M(n),o=e=>{var t=wve();Ri(t,21,r,Fi,(e,t)=>{var n=Cve();let r;var i=M(n,!0);T(n),F(()=>{r=ra(n,1,`chip tone-${I(t).tone??`default`}`,`svelte-1ldx31s`,r,{mono:I(t).mono}),B(i,I(t).text)}),z(e,n)}),T(t),z(e,t)};V(a,e=>{r().length>0&&e(o)});var s=P(a,2),c=e=>{var n=Tve(),r=M(n,!0);T(n),F(()=>B(r,i()?t.collapse.collapseLabel:t.collapse.expandLabel)),bi(`click`,n,()=>i(!i())),z(e,n)};V(s,e=>{t.collapse&&e(c)}),T(n),z(e,n)};V(_,e=>{I(a)&&e(v)}),T(o),F(()=>{ra(o,1,`tool-card${t.status?` status-${t.status}`:``}`,`svelte-1ldx31s`),B(u,t.badge)}),z(e,o),O()}xi([`click`]);function Ove(e,t){D(t,!0);let n=q(t,`bodyMode`,3,`output`),r=q(t,`expanded`,15,!1),i=k(()=>n()===`output`?t.presentation.collapse:void 0),a=k(()=>t.toolCall.error?R$(t.toolCall.error,{headLines:18,tailLines:6,maxChars:6e3}).text:void 0);{let n=k(()=>I(i)?{expandLabel:I(i).expandLabel,collapseLabel:I(i).collapseLabel}:void 0);M1(e,{get status(){return t.toolCall.status},get dotTone(){return t.presentation.dotTone},get dotPulse(){return t.presentation.dotPulse},get badge(){return t.presentation.badge},get arg(){return t.presentation.primaryArg},get error(){return I(a)},get meta(){return t.presentation.meta},get collapse(){return I(n)},get onOpenFile(){return t.onOpenFile},get expanded(){return r()},set expanded(e){r(e)},children:(e,n)=>{var r=R(),i=N(r),a=e=>{var n=R();H(N(n),()=>t.children),z(e,n)};V(i,e=>{t.children&&e(a)}),z(e,r)},$$slots:{default:!0}})}O()}function kve(e,t){D(t,!0);let n=q(t,`hydrateBody`,3,!0),r=q(t,`planReviewModels`,19,()=>[]),i=q(t,`planReviewModelKey`,3,``),a=q(t,`planReviewThinkingLevel`,3,`off`),o=A(!1),s=A(!1),c=k(()=>n()||I(s)),l=k(()=>yhe(t.toolCall,t.liveOutput)),u=k(()=>whe(I(l),t.toolCall)),d=k(()=>_ve(I(l).kind)),f=k(()=>I(l).kind===`ask_user`||I(l).kind===`plan_mode`&&I(l).action===`present`?`interactive`:`output`),p=k(()=>t.toolCall.status!==`error`&&t.toolCall.status!==`denied`),m=k(()=>t.pendingUserQuestion?.toolCallId===t.toolCall.id?t.pendingUserQuestion:void 0),h=k(()=>t.pendingPlanReview?.toolCallId===t.toolCall.id?t.pendingPlanReview:void 0);sr(()=>{n()&&j(s,!0)}),Ove(e,{get toolCall(){return t.toolCall},get presentation(){return I(u)},get bodyMode(){return I(f)},get onOpenFile(){return t.onOpenFile},get expanded(){return I(o)},set expanded(e){j(o,e,!0)},children:(e,n)=>{var s=R(),u=N(s),f=e=>{var n=R();U(N(n),()=>I(d),(e,n)=>{n(e,{get toolCall(){return t.toolCall},get view(){return I(l)},get expanded(){return I(o)},get onOpenFile(){return t.onOpenFile},get questionRecord(){return I(m)},get planReview(){return I(h)},get onAnswerUserQuestion(){return t.onAnswerUserQuestion},get planReviewModels(){return r()},get planReviewModelKey(){return i()},get planReviewThinkingLevel(){return a()},get onDismissUserQuestion(){return t.onDismissUserQuestion},get onAcceptPlanReview(){return t.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return t.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return t.onRejectPlanReview}})}),z(e,n)};V(u,e=>{I(p)&&I(c)&&e(f)}),z(e,s)},$$slots:{default:!0}}),O()}function N1(e){return e&&typeof e==`object`?e:{}}function P1(e){return typeof e==`string`?e:void 0}function F1(e,t,n=`s`){return`${e} ${t}${e===1?``:n}`}function I1(e){if(e!==void 0)return e.length===0?0:e.split(`
|
|
95
|
-
`).length}function Ave(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function L1(e){return RegExp(`"${Ave(e)}"\\s*:\\s*"`,`g`)}function R1(e,t,n={}){let r=[],i=L1(t),a=i.exec(e);for(;a;){let t=n.maxChars??1/0,o=``,s=a.index+a[0].length;for(;s<e.length;){let n=e[s];if(n===`\\`){if(s+1>=e.length)break;let n=e[s+1];o.length<t&&(n===`n`?o+=`
|
|
96
|
-
`:n===`r`?o+=`\r`:n===`t`?o+=` `:o+=n),s+=2;continue}if(n===`"`)break;o.length<t&&(o+=n),s+=1}r.push(o),a=i.exec(e)}return r}function z1(e,t){let n=[],r=L1(t),i=r.exec(e);for(;i;){let t=0,a=!1,o=i.index+i[0].length;for(;o<e.length;){let n=e[o];if(n===`\\`){if(o+1>=e.length)break;let n=e[o+1];n===`n`?(t=Math.max(t,1)+1,a=!0):n!==`r`&&(a=!0),o+=2;continue}if(n===`"`)break;n===`
|
|
97
|
-
`?t=Math.max(t,1)+1:n!==`\r`&&(a=!0),o+=1}n.push(Math.max(t,+!!a)),i=r.exec(e)}return n}function B1(e,t){let n=P1(N1(e.args).path)??e.progress?.path??R1(e.argsText,`path`,{maxChars:240})[0];return n&&t?F$(n,t)??n:n}function jve(e,t){let n=P1(N1(e.args).content),r=e.argsText?z1(e.argsText,`content`)[0]:void 0,i=e.progress?.lineCount??e.progress?.generatedLineCount,a=I1(n)??r??i,o=n===void 0&&!!e.progress?.estimated,s=[];return a!==void 0&&a>0&&s.push({text:`+${a}`,tone:`success`}),{kind:`write`,toolName:`write`,path:B1(e,t),statusText:e.done?`Submitting`:`Generating`,meta:s,lineCount:a,generatedLineCount:a,estimated:o,done:!!e.done}}function V1(e){let t=0,n=0;for(let r of e.split(/\r?\n/))r.startsWith(`+`)&&!r.startsWith(`+++`)?t+=1:r.startsWith(`-`)&&!r.startsWith(`---`)&&(n+=1);return{additions:t,deletions:n}}function H1(e){return Array.isArray(e)?e:[]}function Mve(e){if(!Array.isArray(e.replacements)&&!Array.isArray(e.insertions)&&!Array.isArray(e.lineReplacements)&&!Array.isArray(e.lineInsertions)&&typeof e.patch!=`string`)return;let t=0,n=0,r=0,i=H1(e.replacements);t+=i.length;for(let e of i){let t=N1(e);n+=I1(P1(t.newText))??0,r+=I1(P1(t.oldText))??0}let a=H1(e.insertions);t+=a.length;for(let e of a)n+=I1(P1(N1(e).text))??0;let o=H1(e.lineReplacements);t+=o.length;for(let e of o)n+=I1(P1(N1(e).newText))??0;let s=H1(e.lineInsertions);t+=s.length;for(let e of s)n+=I1(P1(N1(e).text))??0;let c=P1(e.patch);if(c){t+=1;let e=V1(c);n+=e.additions,r+=e.deletions}return{operations:t,generatedLines:n,estimatedAdditions:n,estimatedDeletions:r,estimated:!1}}function Nve(e){let t=e.progress;if(t)return{operations:t.operationCount??0,generatedLines:t.generatedLineCount??0,estimatedAdditions:t.estimatedAdditions,estimatedDeletions:t.estimatedDeletions,estimated:t.estimated}}function Pve(e){let t=z1(e,`oldText`),n=z1(e,`newText`),r=z1(e,`text`),i=R1(e,`patch`,{maxChars:24e3}),a=i.reduce((e,t)=>{let n=V1(t);return{additions:e.additions+n.additions,deletions:e.deletions+n.deletions}},{additions:0,deletions:0}),o=n.reduce((e,t)=>e+t,0)+r.reduce((e,t)=>e+t,0)+a.additions,s=t.reduce((e,t)=>e+t,0)+a.deletions;return{operations:Math.max(t.length,n.length)+r.length+i.length,generatedLines:o,estimatedAdditions:o,estimatedDeletions:s,estimated:!0}}function Fve(e,t){let n=Mve(N1(e.args)),r=e.argsText?Pve(e.argsText):void 0,i=Nve(e),a=n??r??i??{operations:0,generatedLines:0,estimated:!1},o=[];a.operations>0&&o.push({text:F1(a.operations,`operation`)});let s=a.estimatedAdditions??a.generatedLines;return s>0&&o.push({text:`+${s}`,tone:`success`}),a.estimatedDeletions!==void 0&&a.estimatedDeletions>0&&o.push({text:`-${a.estimatedDeletions}`,tone:`error`}),{kind:`edit`,toolName:`edit`,path:B1(e,t),statusText:e.done?`Submitting`:`Generating`,meta:o,operationCount:a.operations,generatedLineCount:a.generatedLines,estimatedAdditions:a.estimatedAdditions,estimatedDeletions:a.estimatedDeletions,estimated:a.estimated,done:!!e.done}}function Ive(e,t){let n=N1(e.args),r=B1(e,t),i=P1(n.code),a=R1(e.argsText,`code`,{maxChars:24e3})[0],o=i??a,s=I1(o),c=o!==void 0&&o.length>0,l=r!==void 0&&r.length>0,u=[];return s!==void 0&&s>0&&u.push({text:F1(s,`code line`),tone:`info`}),l&&u.push({text:`file`,tone:`info`}),e.done&&u.push({text:`submitted`,tone:`success`}),{kind:`python`,toolName:`python`,path:r,statusText:l?e.done?`Submitting Python file…`:`Preparing Python file…`:c?e.done?`Submitting Python code…`:`Generating Python code…`:`Waiting for Python code or path…`,meta:u,code:o,codeLineCount:s,language:`python`,done:!!e.done}}function Lve(e,t){if(e.toolName===`write`)return jve(e,t);if(e.toolName===`edit`)return Fve(e,t);if(e.toolName===`python`)return Ive(e,t);let n=e.toolName??`tool`;return{kind:`generic`,toolName:n,statusText:e.done?`${n} arguments prepared.`:`Preparing ${n} arguments…`,meta:e.done?[{text:`submitted`,tone:`success`}]:[],done:!!e.done}}var Rve=L(`<span class="arg svelte-17ve1ll"> </span>`),zve=L(`<span class="arg svelte-17ve1ll">inline</span>`),Bve=L(`<span class="arg svelte-17ve1ll">Preparing arguments…</span>`),Vve=L(`<div class="draft-progress svelte-17ve1ll" aria-live="polite"><span> </span> <span class="progress-spinner svelte-17ve1ll" aria-hidden="true"></span></div>`),Hve=L(`<span class="progress-caret svelte-17ve1ll" aria-hidden="true"></span>`),Uve=L(`<div class="draft-progress svelte-17ve1ll" aria-live="polite"><span> </span> <!></div>`),Wve=L(`<pre class="svelte-17ve1ll"> </pre>`),Gve=L(`<span> </span>`),Kve=L(`<div class="chips svelte-17ve1ll"></div>`),qve=L(`<article><div class="tool-header svelte-17ve1ll"><!> <span class="badge svelte-17ve1ll"> </span> <!></div> <!> <!></article>`);function Jve(e,t){D(t,!0);let n=k(()=>Lve(t.draft,t.cwd)),r=k(()=>R$(t.draft.args?JSON.stringify(t.draft.args,null,2):t.draft.argsText.trim()||`Waiting for arguments…`,{headLines:18,tailLines:6,maxChars:6e3}).text);var i=qve(),a=M(i),o=M(a);{let e=k(()=>I(n).done?`good`:`running`),t=k(()=>!I(n).done);lC(o,{get tone(){return I(e)},get pulse(){return I(t)},size:`xs`,class:`mr-1.5 align-middle`})}var s=P(o,2),c=M(s,!0);T(s);var l=P(s,2),u=e=>{var t=Rve(),r=M(t,!0);T(t),F(()=>{W(t,`title`,I(n).path),B(r,I(n).path)}),z(e,t)},d=e=>{z(e,zve())},f=e=>{z(e,Bve())};V(l,e=>{I(n).path?e(u):I(n).kind===`python`?e(d,1):I(n).kind===`generic`&&e(f,2)}),T(a);var p=P(a,2),m=e=>{var t=Vve(),r=M(t),i=M(r,!0);T(r),E(2),T(t),F(()=>B(i,I(n).statusText)),z(e,t)},h=e=>{var t=R(),r=N(t),i=e=>{{let t=k(()=>R$(I(n).code,{headLines:12,tailLines:0}).text);l1(e,{get code(){return I(t)},get language(){return I(n).language},trim:!1})}},a=e=>{var t=Uve(),r=M(t),i=M(r,!0);T(r);var a=P(r,2),o=e=>{z(e,Hve())};V(a,e=>{I(n).done||e(o)}),T(t),F(()=>B(i,I(n).statusText)),z(e,t)};V(r,e=>{I(n).code!==void 0&&I(n).code.length>0?e(i):e(a,-1)}),z(e,t)},g=e=>{var t=Wve(),n=M(t,!0);T(t),F(()=>B(n,I(r))),z(e,t)};V(p,e=>{I(n).kind===`write`||I(n).kind===`edit`?e(m):I(n).kind===`python`?e(h,1):e(g,-1)});var _=P(p,2),v=e=>{var t=Kve();Ri(t,21,()=>I(n).meta,Fi,(e,t)=>{var n=Gve();let r;var i=M(n,!0);T(n),F(()=>{r=ra(n,1,`chip tone-${I(t).tone??`default`}`,`svelte-17ve1ll`,r,{mono:I(t).mono}),B(i,I(t).text)}),z(e,n)}),T(t),z(e,t)};V(_,e=>{I(n).meta.length>0&&e(v)}),T(i),F(()=>{ra(i,1,`tool-draft-card draft-${I(n).kind}`,`svelte-17ve1ll`),B(c,I(n).toolName)}),z(e,i),O()}var Yve=L(`<article class="tool-result-error-card svelte-jrln7b"><div class="tool-header svelte-jrln7b"><!> <span class="badge svelte-jrln7b"> </span></div> <pre class="tool-error svelte-jrln7b"> </pre></article>`);function Xve(e,t){D(t,!0);let n=k(()=>R$(t.error,{headLines:18,tailLines:6,maxChars:6e3}).text);var r=Yve(),i=M(r),a=M(i);lC(a,{tone:`danger`,size:`xs`,class:`mr-1.5 align-middle`});var o=P(a,2),s=M(o,!0);T(o),T(i);var c=P(i,2),l=M(c,!0);T(c),T(r),F(()=>{B(s,t.toolName),B(l,I(n))}),z(e,r),O()}var Zve=typeof self==`object`?self:globalThis,U1=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Zve[e](t)},Qve=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(U1(e,t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(U1(a,o),i)};return r},W1=e=>Qve(new Map,e)(0),G1=``,{toString:$ve}={},{keys:eye}=Object,K1=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=$ve.call(e).slice(8,-1);switch(n){case`Array`:return[1,G1];case`Object`:return[2,G1];case`Date`:return[3,G1];case`RegExp`:return[4,G1];case`Map`:return[5,G1];case`Set`:return[6,G1];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},q1=([e,t])=>e===0&&(t===`function`||t===`symbol`),tye=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=K1(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of eye(r))(e||!q1(K1(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(q1(K1(n))||q1(K1(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!q1(K1(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},J1=(e,{json:t,lossy:n}={})=>{let r=[];return tye(!(t||n),!!t,new Map,r)(e),r},Y1=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?W1(J1(e,t)):structuredClone(e):(e,t)=>W1(J1(e,t)),X1=Q1(`end`),Z1=Q1(`start`);function Q1(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function $1(e){let t=Z1(e),n=X1(e);if(t&&n)return{start:t,end:n}}var e0=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],t0={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...e0,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...e0],h2:[[`className`,`sr-only`]],img:[...e0,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...e0,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...e0],table:[...e0],ul:[...e0,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},n0={}.hasOwnProperty;function nye(e,t){let n={type:`root`,children:[]},r=r0({schema:t?{...t0,...t}:t0,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function r0(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return rye(e,n);case`doctype`:return iye(e,n);case`element`:return aye(e,n);case`root`:return oye(e,n);case`text`:return sye(e,n);default:}}}function rye(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return s0(r,t),r}}function iye(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return s0(e,t),e}}function aye(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=i0(e,t.children),i=cye(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&n0.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return s0(o,t),o}function oye(e,t){let n={type:`root`,children:i0(e,t.children)};return s0(n,t),n}function sye(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return s0(n,t),n}function i0(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=r0(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function cye(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&n0.call(r,n)?r[n]:void 0,o=r&&n0.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(n0.call(s,l)){let t=s[l],n=a0(e,c0(a,l),l,t);n??=a0(e,c0(o,l),l,t),n!=null&&(c[l]=n)}if(i&&n0.call(i,n)){let e=i[n];for(l in e)n0.call(e,l)&&!n0.call(c,l)&&(c[l]=e[l])}return c}function a0(e,t,n,r){return t?Array.isArray(r)?lye(e,t,n,r):o0(e,t,n,r):void 0}function lye(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=o0(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function o0(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&uye(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function uye(e,t,n){let r=e.schema.protocols&&n0.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function s0(e,t){let n=$1(t);t.data&&(e.data=Y1(t.data)),n&&(e.position=n)}function c0(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function dye(e){return function(t){return nye(t,e)}}var fye=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],l0=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};l0.prototype.normal={},l0.prototype.property={},l0.prototype.space=void 0;function u0(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new l0(n,r,t)}function d0(e){return e.toLowerCase()}var f0=class{constructor(e,t){this.attribute=t,this.property=e}};f0.prototype.attribute=``,f0.prototype.booleanish=!1,f0.prototype.boolean=!1,f0.prototype.commaOrSpaceSeparated=!1,f0.prototype.commaSeparated=!1,f0.prototype.defined=!1,f0.prototype.mustUseProperty=!1,f0.prototype.number=!1,f0.prototype.overloadedBoolean=!1,f0.prototype.property=``,f0.prototype.spaceSeparated=!1,f0.prototype.space=void 0;var p0=s({boolean:()=>m0,booleanish:()=>h0,commaOrSpaceSeparated:()=>b0,commaSeparated:()=>y0,number:()=>_0,overloadedBoolean:()=>g0,spaceSeparated:()=>v0}),pye=0,m0=x0(),h0=x0(),g0=x0(),_0=x0(),v0=x0(),y0=x0(),b0=x0();function x0(){return 2**++pye}var S0=Object.keys(p0),C0=class extends f0{constructor(e,t,n,r){let i=-1;if(super(e,t),w0(this,`space`,r),typeof n==`number`)for(;++i<S0.length;){let e=S0[i];w0(this,S0[i],(n&p0[e])===p0[e])}}};C0.prototype.defined=!0;function w0(e,t,n){n&&(e[t]=n)}function T0(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new C0(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[d0(r)]=r,n[d0(a.attribute)]=r}return new l0(t,n,e.space)}var E0=T0({properties:{ariaActiveDescendant:null,ariaAtomic:h0,ariaAutoComplete:null,ariaBusy:h0,ariaChecked:h0,ariaColCount:_0,ariaColIndex:_0,ariaColSpan:_0,ariaControls:v0,ariaCurrent:null,ariaDescribedBy:v0,ariaDetails:null,ariaDisabled:h0,ariaDropEffect:v0,ariaErrorMessage:null,ariaExpanded:h0,ariaFlowTo:v0,ariaGrabbed:h0,ariaHasPopup:null,ariaHidden:h0,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:v0,ariaLevel:_0,ariaLive:null,ariaModal:h0,ariaMultiLine:h0,ariaMultiSelectable:h0,ariaOrientation:null,ariaOwns:v0,ariaPlaceholder:null,ariaPosInSet:_0,ariaPressed:h0,ariaReadOnly:h0,ariaRelevant:null,ariaRequired:h0,ariaRoleDescription:v0,ariaRowCount:_0,ariaRowIndex:_0,ariaRowSpan:_0,ariaSelected:h0,ariaSetSize:_0,ariaSort:null,ariaValueMax:_0,ariaValueMin:_0,ariaValueNow:_0,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function D0(e,t){return t in e?e[t]:t}function O0(e,t){return D0(e,t.toLowerCase())}var mye=T0({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:y0,acceptCharset:v0,accessKey:v0,action:null,allow:null,allowFullScreen:m0,allowPaymentRequest:m0,allowUserMedia:m0,alt:null,as:null,async:m0,autoCapitalize:null,autoComplete:v0,autoFocus:m0,autoPlay:m0,blocking:v0,capture:null,charSet:null,checked:m0,cite:null,className:v0,cols:_0,colSpan:null,content:null,contentEditable:h0,controls:m0,controlsList:v0,coords:_0|y0,crossOrigin:null,data:null,dateTime:null,decoding:null,default:m0,defer:m0,dir:null,dirName:null,disabled:m0,download:g0,draggable:h0,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:m0,formTarget:null,headers:v0,height:_0,hidden:g0,high:_0,href:null,hrefLang:null,htmlFor:v0,httpEquiv:v0,id:null,imageSizes:null,imageSrcSet:null,inert:m0,inputMode:null,integrity:null,is:null,isMap:m0,itemId:null,itemProp:v0,itemRef:v0,itemScope:m0,itemType:v0,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:m0,low:_0,manifest:null,max:null,maxLength:_0,media:null,method:null,min:null,minLength:_0,multiple:m0,muted:m0,name:null,nonce:null,noModule:m0,noValidate:m0,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:m0,optimum:_0,pattern:null,ping:v0,placeholder:null,playsInline:m0,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:m0,referrerPolicy:null,rel:v0,required:m0,reversed:m0,rows:_0,rowSpan:_0,sandbox:v0,scope:null,scoped:m0,seamless:m0,selected:m0,shadowRootClonable:m0,shadowRootDelegatesFocus:m0,shadowRootMode:null,shape:null,size:_0,sizes:null,slot:null,span:_0,spellCheck:h0,src:null,srcDoc:null,srcLang:null,srcSet:null,start:_0,step:null,style:null,tabIndex:_0,target:null,title:null,translate:null,type:null,typeMustMatch:m0,useMap:null,value:h0,width:_0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:v0,axis:null,background:null,bgColor:null,border:_0,borderColor:null,bottomMargin:_0,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:m0,declare:m0,event:null,face:null,frame:null,frameBorder:null,hSpace:_0,leftMargin:_0,link:null,longDesc:null,lowSrc:null,marginHeight:_0,marginWidth:_0,noResize:m0,noHref:m0,noShade:m0,noWrap:m0,object:null,profile:null,prompt:null,rev:null,rightMargin:_0,rules:null,scheme:null,scrolling:h0,standby:null,summary:null,text:null,topMargin:_0,valueType:null,version:null,vAlign:null,vLink:null,vSpace:_0,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:m0,disableRemotePlayback:m0,prefix:null,property:null,results:_0,security:null,unselectable:null},space:`html`,transform:O0}),hye=T0({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,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`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,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`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,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`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:b0,accentHeight:_0,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:_0,amplitude:_0,arabicForm:null,ascent:_0,attributeName:null,attributeType:null,azimuth:_0,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:_0,by:null,calcMode:null,capHeight:_0,className:v0,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:_0,diffuseConstant:_0,direction:null,display:null,dur:null,divisor:_0,dominantBaseline:null,download:m0,dx:null,dy:null,edgeMode:null,editable:null,elevation:_0,enableBackground:null,end:null,event:null,exponent:_0,externalResourcesRequired:null,fill:null,fillOpacity:_0,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:y0,g2:y0,glyphName:y0,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:_0,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:_0,horizOriginX:_0,horizOriginY:_0,id:null,ideographic:_0,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:_0,k:_0,k1:_0,k2:_0,k3:_0,k4:_0,kernelMatrix:b0,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:_0,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:_0,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:_0,overlineThickness:_0,paintOrder:null,panose1:null,path:null,pathLength:_0,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:v0,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_0,pointsAtY:_0,pointsAtZ:_0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:b0,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:b0,rev:b0,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:b0,requiredFeatures:b0,requiredFonts:b0,requiredFormats:b0,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:_0,specularExponent:_0,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:_0,strikethroughThickness:_0,string:null,stroke:null,strokeDashArray:b0,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:_0,strokeOpacity:_0,strokeWidth:null,style:null,surfaceScale:_0,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:b0,tabIndex:_0,tableValues:null,target:null,targetX:_0,targetY:_0,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:b0,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:_0,underlineThickness:_0,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:_0,values:null,vAlphabetic:_0,vMathematical:_0,vectorEffect:null,vHanging:_0,vIdeographic:_0,version:null,vertAdvY:_0,vertOriginX:_0,vertOriginY:_0,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:_0,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:D0}),k0=T0({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),A0=T0({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:O0}),j0=T0({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),gye=/[A-Z]/g,M0=/-[a-z]/g,_ye=/^data[-\w.:]+$/i;function vye(e,t){let n=d0(t),r=t,i=f0;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&_ye.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(M0,bye);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!M0.test(e)){let n=e.replace(gye,yye);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=C0}return new i(r,t)}function yye(e){return`-`+e.toLowerCase()}function bye(e){return e.charAt(1).toUpperCase()}var xye=u0([E0,mye,k0,A0,j0],`html`),N0=u0([E0,hye,k0,A0,j0],`svg`),P0={}.hasOwnProperty;function Sye(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&P0.call(t,e)){let n=String(t[e]);i=P0.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Cye=/["&'<>`]/g,wye=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Tye=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Eye=/[|\\{}()[\]^$+*?.]/g,F0=new WeakMap;function Dye(e,t){if(e=e.replace(t.subset?Oye(t.subset):Cye,r),t.subset||t.escapeOnly)return e;return e.replace(wye,n).replace(Tye,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Oye(e){let t=F0.get(e);return t||(t=kye(e),F0.set(e,t)),t}function kye(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Eye,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Aye=/[\dA-Fa-f]/;function jye(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Aye.test(String.fromCharCode(t))?r:r+`;`}var Mye=/\d/;function Nye(e,t,n){let r=`&#`+String(e);return n&&t&&!Mye.test(String.fromCharCode(t))?r:r+`;`}var Pye=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),I0={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},Fye=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],L0={}.hasOwnProperty,R0={},z0;for(z0 in I0)L0.call(I0,z0)&&(R0[I0[z0]]=z0);var Iye=/[^\dA-Za-z]/;function Lye(e,t,n,r){let i=String.fromCharCode(e);if(L0.call(R0,i)){let e=R0[i],a=`&`+e;return n&&Pye.includes(e)&&!Fye.includes(e)&&(!r||t&&t!==61&&Iye.test(String.fromCharCode(t)))?a:a+`;`}return``}function Rye(e,t,n){let r=jye(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Lye(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Nye(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function B0(e,t){return Dye(e,Object.assign({format:Rye},t))}var zye=/^>|^->|<!--|-->|--!>|<!-$/g,Bye=[`>`],Vye=[`<`,`>`];function Hye(e,t,n,r){return r.settings.bogusComments?`<?`+B0(e.value,Object.assign({},r.settings.characterReferences,{subset:Bye}))+`>`:`<!--`+e.value.replace(zye,i)+`-->`;function i(e){return B0(e,Object.assign({},r.settings.characterReferences,{subset:Vye}))}}function Uye(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function V0(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Wye(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function Gye(e){return e.join(` `).trim()}var Kye=/[ \t\n\f\r]/g;function H0(e){return typeof e==`object`?e.type===`text`?U0(e.value):!1:U0(e)}function U0(e){return e.replace(Kye,``)===``}var W0=K0(1),G0=K0(-1),qye=[];function K0(e){return t;function t(t,n,r){let i=t?t.children:qye,a=(n||0)+e,o=i[a];if(!r)for(;o&&H0(o);)a+=e,o=i[a];return o}}var Jye={}.hasOwnProperty;function q0(e){return t;function t(t,n,r){return Jye.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var J0=q0({body:Xye,caption:Y0,colgroup:Y0,dd:ebe,dt:$ye,head:Y0,html:Yye,li:Qye,optgroup:tbe,option:nbe,p:Zye,rp:X0,rt:X0,tbody:ibe,td:Z0,tfoot:abe,th:Z0,thead:rbe,tr:obe});function Y0(e,t,n){let r=W0(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&H0(r.value.charAt(0)))}function Yye(e,t,n){let r=W0(n,t);return!r||r.type!==`comment`}function Xye(e,t,n){let r=W0(n,t);return!r||r.type!==`comment`}function Zye(e,t,n){let r=W0(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function Qye(e,t,n){let r=W0(n,t);return!r||r.type===`element`&&r.tagName===`li`}function $ye(e,t,n){let r=W0(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function ebe(e,t,n){let r=W0(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function X0(e,t,n){let r=W0(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function tbe(e,t,n){let r=W0(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function nbe(e,t,n){let r=W0(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function rbe(e,t,n){let r=W0(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function ibe(e,t,n){let r=W0(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function abe(e,t,n){return!W0(n,t)}function obe(e,t,n){let r=W0(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Z0(e,t,n){let r=W0(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var sbe=q0({body:ube,colgroup:dbe,head:lbe,html:cbe,tbody:fbe});function cbe(e){let t=W0(e,-1);return!t||t.type!==`comment`}function lbe(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function ube(e){let t=W0(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&H0(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function dbe(e,t,n){let r=G0(n,t),i=W0(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&J0(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function fbe(e,t,n){let r=G0(n,t),i=W0(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&J0(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Q0={name:[[`
|
|
98
|
-
\f\r &/=>`.split(``),`
|
|
99
|
-
\f\r "&'/=>\``.split(``)],[`\0
|
|
100
|
-
\f\r "&'/<=>`.split(``),`\0
|
|
101
|
-
\f\r "&'/<=>\``.split(``)]],unquoted:[[`
|
|
102
|
-
\f\r &>`.split(``),`\0
|
|
103
|
-
\f\r "&'<=>\``.split(``)],[`\0
|
|
104
|
-
\f\r "&'<=>\``.split(``),`\0
|
|
105
|
-
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function pbe(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=N0);let l=mbe(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!sbe(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!J0(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function mbe(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=hbe(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function hbe(e,t,n){let r=vye(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=B0(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Q0.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Wye:Gye)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=B0(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Q0.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&V0(n,o)>V0(n,e.alternative)&&(o=e.alternative),s=o+B0(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Q0.single:Q0.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var gbe=[`<`,`&`];function $0(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:B0(e.value,Object.assign({},r.settings.characterReferences,{subset:gbe}))}function _be(e,t,n,r){return r.settings.allowDangerousHtml?e.value:$0(e,t,n,r)}function vbe(e,t,n,r){return r.all(e)}var ybe=Sye(`type`,{invalid:bbe,unknown:xbe,handlers:{comment:Hye,doctype:Uye,element:pbe,raw:_be,root:vbe,text:$0}});function bbe(e){throw Error("Expected node, not `"+e+"`")}function xbe(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Sbe={},Cbe={},wbe=[];function e2(e,t){let n=t||Sbe,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Tbe,all:Ebe,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||fye,characterReferences:n.characterReferences||Cbe,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?N0:xye,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Tbe(e,t,n){return ybe(e,t,n,this)}function Ebe(e){let t=[],n=e&&e.children||wbe,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function Dbe(e){let t=this,n={...t.data(`settings`),...e};t.compiler=r;function r(e){return e2(e,n)}}var t2=u2(/[A-Za-z]/),n2=u2(/[\dA-Za-z]/),Obe=u2(/[#-'*+\--9=?A-Z^-~]/);function r2(e){return e!==null&&(e<32||e===127)}var i2=u2(/\d/),kbe=u2(/[\dA-Fa-f]/),Abe=u2(/[!-/:-@[-`{-~]/);function a2(e){return e!==null&&e<-2}function o2(e){return e!==null&&(e<0||e===32)}function s2(e){return e===-2||e===-1||e===32}var c2=u2(/\p{P}|\p{S}/u),l2=u2(/\s/);function u2(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function jbe(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}var d2=(function(e){if(e==null)return Fbe;if(typeof e==`function`)return f2(e);if(typeof e==`object`)return Array.isArray(e)?Mbe(e):Nbe(e);if(typeof e==`string`)return Pbe(e);throw Error(`Expected function, string, or object as test`)});function Mbe(e){let t=[],n=-1;for(;++n<e.length;)t[n]=d2(e[n]);return f2(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Nbe(e){let t=e;return f2(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Pbe(e){return f2(t);function t(t){return t&&t.type===e}}function f2(e){return t;function t(t,n,r){return!!(Ibe(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Fbe(){return!0}function Ibe(e){return typeof e==`object`&&!!e&&`type`in e}function Lbe(e){return e}var p2=[];function m2(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=d2(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Lbe(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=p2,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Rbe(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Rbe(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?p2:[e]}function zbe(e,t,n){let r=d2((n||{}).ignore||[]),i=Bbe(t),a=-1;for(;++a<i.length;)m2(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Bbe(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Vbe(e[0]),Hbe(e[1])])}return t}function Vbe(e){return typeof e==`string`?new RegExp(jbe(e),`g`):e}function Hbe(e){return typeof e==`function`?e:function(){return e}}var h2=`phrasing`,g2=[`autolink`,`link`,`image`,`label`];function Ube(){return{transforms:[Xbe],enter:{literalAutolink:Gbe,literalAutolinkEmail:_2,literalAutolinkHttp:_2,literalAutolinkWww:_2},exit:{literalAutolink:Ybe,literalAutolinkEmail:Jbe,literalAutolinkHttp:Kbe,literalAutolinkWww:qbe}}}function Wbe(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:h2,notInConstruct:g2},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:h2,notInConstruct:g2},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:h2,notInConstruct:g2}]}}function Gbe(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function _2(e){this.config.enter.autolinkProtocol.call(this,e)}function Kbe(e){this.config.exit.autolinkProtocol.call(this,e)}function qbe(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Jbe(e){this.config.exit.autolinkEmail.call(this,e)}function Ybe(e){this.exit(e)}function Xbe(e){zbe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Zbe],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Qbe]],{ignore:[`link`,`linkReference`]})}function Zbe(e,t,n,r,i){let a=``;if(!v2(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!$be(n)))return!1;let o=exe(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Qbe(e,t,n,r){return!v2(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function $be(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function exe(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=V0(e,`(`),a=V0(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function v2(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||l2(n)||c2(n))&&(!t||n!==47)}function y2(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}b2.peek=lxe;function txe(){this.buffer()}function nxe(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function rxe(){this.buffer()}function ixe(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function axe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=y2(this.sliceSerialize(e)).toLowerCase(),n.label=t}function oxe(e){this.exit(e)}function sxe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=y2(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cxe(e){this.exit(e)}function lxe(){return`[`}function b2(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function uxe(){return{enter:{gfmFootnoteCallString:txe,gfmFootnoteCall:nxe,gfmFootnoteDefinitionLabelString:rxe,gfmFootnoteDefinition:ixe},exit:{gfmFootnoteCallString:axe,gfmFootnoteCall:oxe,gfmFootnoteDefinitionLabelString:sxe,gfmFootnoteDefinition:cxe}}}function dxe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:b2},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
106
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?x2:fxe))),s(),o}}function fxe(e,t,n){return t===0?e:x2(e,t,n)}function x2(e,t,n){return(n?``:` `)+e}var pxe=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];S2.peek=vxe;function mxe(){return{canContainEols:[`delete`],enter:{strikethrough:gxe},exit:{strikethrough:_xe}}}function hxe(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:pxe}],handlers:{delete:S2}}}function gxe(e){this.enter({type:`delete`,children:[]},e)}function _xe(e){this.exit(e)}function S2(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function vxe(){return`~`}function yxe(e){return e.length}function bxe(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||yxe,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=xxe(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=C2(r[d]);else{let e=C2(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
107
|
-
`)}function xxe(e){return e==null?``:String(e)}function C2(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Sxe(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Cxe);return i(),o}function Cxe(e,t,n){return`>`+(n?``:` `)+e}function wxe(e,t){return w2(e,t.inConstruct,!0)&&!w2(e,t.notInConstruct,!1)}function w2(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function T2(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
108
|
-
`&&wxe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
109
|
-
`}function Txe(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Exe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Dxe(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Oxe(e,t,n,r){let i=Dxe(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Exe(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,kxe);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Txe(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
110
|
-
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
111
|
-
`),a&&(u+=s.move(a+`
|
|
112
|
-
`)),u+=s.move(c),l(),u}function kxe(e,t,n){return(n?``:` `)+e}function E2(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Axe(e,t,n,r){let i=E2(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
113
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function jxe(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function D2(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function O2(e){if(e===null||o2(e)||l2(e))return 1;if(c2(e))return 2}function k2(e,t,n){let r=O2(e),i=O2(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}A2.peek=Mxe;function A2(e,t,n,r){let i=jxe(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=k2(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=D2(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=k2(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+D2(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Mxe(e,t,n){return n.options.emphasis||`*`}function j2(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),m2(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Nxe={};function M2(e,t){let n=t||Nxe;return N2(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function N2(e,t,n){if(Pxe(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return P2(e.children,t,n)}return Array.isArray(e)?P2(e,t,n):``}function P2(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=N2(e[i],t,n);return r.join(``)}function Pxe(e){return!!(e&&typeof e==`object`)}function Fxe(e,t){let n=!1;return j2(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&M2(e)&&(t.options.setext||n))}function Ixe(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Fxe(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
114
|
-
`,after:`
|
|
115
|
-
`});return r(),t(),o+`
|
|
116
|
-
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
117
|
-
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
118
|
-
`,...a.current()});return/^[\t ]/.test(l)&&(l=D2(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}F2.peek=Lxe;function F2(e){return e.value||``}function Lxe(){return`<`}I2.peek=Rxe;function I2(e,t,n,r){let i=E2(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Rxe(){return`!`}L2.peek=zxe;function L2(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function zxe(){return`!`}R2.peek=Bxe;function R2(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Bxe(){return"`"}function z2(e,t){let n=M2(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}B2.peek=Vxe;function B2(e,t,n,r){let i=E2(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(z2(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Vxe(e,t,n){return z2(e,n)?`<`:`[`}V2.peek=Hxe;function V2(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Hxe(){return`[`}function H2(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Uxe(e){let t=H2(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Wxe(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function U2(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Gxe(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Wxe(n):H2(n),s=e.ordered?o===`.`?`)`:`.`:Uxe(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),U2(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Kxe(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function qxe(e,t,n,r){let i=Kxe(n),a=n.bulletCurrent||H2(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Jxe(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Yxe=d2([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Xxe(e,t,n,r){return(e.children.some(function(e){return Yxe(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Zxe(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}W2.peek=Qxe;function W2(e,t,n,r){let i=Zxe(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=k2(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=D2(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=k2(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+D2(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Qxe(e,t,n){return n.options.strong||`*`}function $xe(e,t,n,r){return n.safe(e.value,r)}function eSe(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function tSe(e,t,n){let r=(U2(n)+(n.options.ruleSpaces?` `:``)).repeat(eSe(n));return n.options.ruleSpaces?r.slice(0,-1):r}var G2={blockquote:Sxe,break:T2,code:Oxe,definition:Axe,emphasis:A2,hardBreak:T2,heading:Ixe,html:F2,image:I2,imageReference:L2,inlineCode:R2,link:B2,linkReference:V2,list:Gxe,listItem:qxe,paragraph:Jxe,root:Xxe,strong:W2,text:$xe,thematicBreak:tSe},K2=document.createElement(`i`);function q2(e){let t=`&`+e+`;`;K2.innerHTML=t;let n=K2.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function J2(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var nSe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rSe(e){return e.replace(nSe,iSe)}function iSe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return J2(n.slice(t?2:1),t?16:10)}return q2(n)||e}function aSe(){return{enter:{table:oSe,tableData:X2,tableHeader:X2,tableRow:cSe},exit:{codeText:lSe,table:sSe,tableData:Y2,tableHeader:Y2,tableRow:Y2}}}function oSe(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function sSe(e){this.exit(e),this.data.inTable=void 0}function cSe(e){this.enter({type:`tableRow`,children:[]},e)}function Y2(e){this.exit(e)}function X2(e){this.enter({type:`tableCell`,children:[]},e)}function lSe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,uSe));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function uSe(e,t){return t===`|`?t:e}function dSe(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
119
|
-
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
120
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return bxe(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=G2.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function fSe(){return{exit:{taskListCheckValueChecked:Z2,taskListCheckValueUnchecked:Z2,paragraph:mSe}}}function pSe(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:hSe}}}function Z2(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function mSe(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function hSe(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=G2.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function gSe(){return[Ube(),uxe(),mxe(),aSe(),fSe()]}function _Se(e){return{extensions:[Wbe(),dxe(e),hxe(),dSe(e),pSe()]}}function Q2(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function $2(e,t){return e.length>0?(Q2(e,e.length,0,t),e):t}var e4={}.hasOwnProperty;function t4(e){let t={},n=-1;for(;++n<e.length;)vSe(t,e[n]);return t}function vSe(e,t){let n;for(n in t){let r=(e4.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){e4.call(r,a)||(r[a]=[]);let e=i[a];ySe(r[a],Array.isArray(e)?e:e?[e]:[])}}}function ySe(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Q2(e,0,0,r)}var bSe={tokenize:ESe,partial:!0},n4={tokenize:DSe,partial:!0},r4={tokenize:OSe,partial:!0},i4={tokenize:kSe,partial:!0},xSe={tokenize:ASe,partial:!0},a4={name:`wwwAutolink`,tokenize:wSe,previous:u4},o4={name:`protocolAutolink`,tokenize:TSe,previous:d4},s4={name:`emailAutolink`,tokenize:CSe,previous:f4},c4={};function SSe(){return{text:c4}}for(var l4=48;l4<123;)c4[l4]=s4,l4++,l4===58?l4=65:l4===91&&(l4=97);c4[43]=s4,c4[45]=s4,c4[46]=s4,c4[95]=s4,c4[72]=[s4,o4],c4[104]=[s4,o4],c4[87]=[s4,a4],c4[119]=[s4,a4];function CSe(e,t,n){let r=this,i,a;return o;function o(t){return!p4(t)||!f4.call(r,r.previous)||m4(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return p4(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(xSe,u,l)(t):t===45||t===95||n2(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&t2(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function wSe(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!u4.call(r,r.previous)||m4(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(bSe,e.attempt(n4,e.attempt(r4,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function TSe(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&d4.call(r,r.previous)&&!m4(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(t2(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||r2(t)||o2(t)||l2(t)||c2(t)?n(t):e.attempt(n4,e.attempt(r4,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function ESe(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function DSe(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(i4,c,s)(t):t===null||o2(t)||l2(t)||t!==45&&c2(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function OSe(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(i4,t,a)(o):o===null||o2(o)||l2(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function kSe(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||o2(o)||l2(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||o2(e)||l2(e)?t(e):r(e)}function a(e){return t2(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):t2(t)?(e.consume(t),o):n(t)}}function ASe(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return n2(e)?n(e):t(e)}}function u4(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||o2(e)}function d4(e){return!t2(e)}function f4(e){return!(e===47||p4(e))}function p4(e){return e===43||e===45||e===46||e===95||n2(e)}function m4(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function h4(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&n2(e.charCodeAt(n+1))&&n2(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function g4(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var _4={name:`attention`,resolveAll:jSe,tokenize:MSe};function jSe(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};v4(d,-c),v4(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=$2(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=$2(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=$2(l,g4(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=$2(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=$2(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Q2(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function MSe(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=O2(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=O2(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function v4(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var NSe={name:`autolink`,tokenize:PSe};function PSe(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return t2(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||n2(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||n2(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||r2(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Obe(t)?(e.consume(t),l):n(t)}function u(e){return n2(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||n2(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function y4(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return s2(r)?(e.enter(n),s(r)):t(r)}function s(r){return s2(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var b4={partial:!0,tokenize:FSe};function FSe(e,t,n){return r;function r(t){return s2(t)?y4(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||a2(e)?t(e):n(e)}}var x4={continuation:{tokenize:LSe},exit:RSe,name:`blockQuote`,tokenize:ISe};function ISe(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return s2(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function LSe(e,t,n){let r=this;return i;function i(t){return s2(t)?y4(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(x4,t,n)(r)}}function RSe(e){e.exit(`blockQuote`)}var S4={name:`characterEscape`,tokenize:zSe};function zSe(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Abe(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var C4={name:`characterReference`,tokenize:BSe};function BSe(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=n2,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=kbe,u):(e.enter(`characterReferenceValue`),a=7,o=i2,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===n2&&!q2(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var w4={partial:!0,tokenize:HSe},T4={concrete:!0,name:`codeFenced`,tokenize:VSe};function VSe(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),s2(t)?y4(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||a2(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(w4,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||a2(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):s2(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),y4(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||a2(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||a2(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&s2(t)?y4(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||a2(t)?e.check(w4,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||a2(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),s2(t)?y4(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),s2(t)?y4(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||a2(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function HSe(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var E4={name:`codeIndented`,tokenize:WSe},USe={partial:!0,tokenize:GSe};function WSe(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),y4(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):a2(t)?e.attempt(USe,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||a2(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function GSe(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):a2(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):y4(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):a2(e)?i(e):n(e)}}var KSe={name:`codeText`,previous:JSe,resolve:qSe,tokenize:YSe};function qSe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function JSe(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function YSe(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):a2(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||a2(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var XSe=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&D4(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),D4(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),D4(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);D4(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);D4(this.left,t.reverse())}}};function D4(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function O4(e){let t={},n=-1,r,i,a,o,s,c,l,u=new XSe(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,ZSe(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Q2(e,0,1/0,u.slice(0)),!l}function ZSe(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var QSe={resolve:eCe,tokenize:tCe},$Se={partial:!0,tokenize:nCe};function eCe(e){return O4(e),e}function tCe(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):a2(t)?e.check($Se,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function nCe(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),y4(e,a,`linePrefix`)}function a(i){if(i===null||a2(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function k4(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||r2(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||a2(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||o2(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||r2(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function A4(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):a2(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||a2(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!s2(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function j4(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):a2(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),y4(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||a2(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function M4(e,t){let n;return r;function r(i){return a2(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):s2(i)?y4(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var rCe={name:`definition`,tokenize:aCe},iCe={partial:!0,tokenize:oCe};function aCe(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return A4.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=y2(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return o2(t)?M4(e,l)(t):l(t)}function l(t){return k4(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(iCe,d,d)(t)}function d(t){return s2(t)?y4(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||a2(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function oCe(e,t,n){return r;function r(t){return o2(t)?M4(e,i)(t):n(t)}function i(t){return j4(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return s2(t)?y4(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||a2(e)?t(e):n(e)}}var sCe={name:`hardBreakEscape`,tokenize:cCe};function cCe(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return a2(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var lCe={name:`headingAtx`,resolve:uCe,tokenize:dCe};function uCe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Q2(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function dCe(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||o2(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||a2(n)?(e.exit(`atxHeading`),t(n)):s2(n)?y4(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||o2(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var fCe=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),N4=[`pre`,`script`,`style`,`textarea`],pCe={concrete:!0,name:`htmlFlow`,resolveTo:gCe,tokenize:_Ce},mCe={partial:!0,tokenize:yCe},hCe={partial:!0,tokenize:vCe};function gCe(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function _Ce(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:de):t2(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):t2(a)?(e.consume(a),i=4,r.interrupt?t:de):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:de):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:ie:m):n(i)}function h(t){return t2(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||o2(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&N4.includes(l)?(i=1,r.interrupt?t(s):ie(s)):fCe.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):ie(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||n2(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:ie):n(i)}function v(t){return s2(t)?(e.consume(t),v):ne(t)}function y(t){return t===47?(e.consume(t),ne):t===58||t===95||t2(t)?(e.consume(t),b):s2(t)?(e.consume(t),y):ne(t)}function b(t){return t===45||t===46||t===58||t===95||n2(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):s2(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,ee):s2(t)?(e.consume(t),S):C(t)}function ee(t){return t===c?(e.consume(t),c=null,te):t===null||a2(t)?n(t):(e.consume(t),ee)}function C(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||o2(t)?x(t):(e.consume(t),C)}function te(e){return e===47||e===62||s2(e)?y(e):n(e)}function ne(t){return t===62?(e.consume(t),re):n(t)}function re(t){return t===null||a2(t)?ie(t):s2(t)?(e.consume(t),re):n(t)}function ie(t){return t===45&&i===2?(e.consume(t),se):t===60&&i===1?(e.consume(t),ce):t===62&&i===4?(e.consume(t),fe):t===63&&i===3?(e.consume(t),de):t===93&&i===5?(e.consume(t),ue):a2(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(mCe,pe,ae)(t)):t===null||a2(t)?(e.exit(`htmlFlowData`),ae(t)):(e.consume(t),ie)}function ae(t){return e.check(hCe,oe,pe)(t)}function oe(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),w}function w(t){return t===null||a2(t)?ae(t):(e.enter(`htmlFlowData`),ie(t))}function se(t){return t===45?(e.consume(t),de):ie(t)}function ce(t){return t===47?(e.consume(t),o=``,le):ie(t)}function le(t){if(t===62){let n=o.toLowerCase();return N4.includes(n)?(e.consume(t),fe):ie(t)}return t2(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),le):ie(t)}function ue(t){return t===93?(e.consume(t),de):ie(t)}function de(t){return t===62?(e.consume(t),fe):t===45&&i===2?(e.consume(t),de):ie(t)}function fe(t){return t===null||a2(t)?(e.exit(`htmlFlowData`),pe(t)):(e.consume(t),fe)}function pe(n){return e.exit(`htmlFlow`),t(n)}}function vCe(e,t,n){let r=this;return i;function i(t){return a2(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function yCe(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(b4,t,n)}}var bCe={name:`htmlText`,tokenize:xCe};function xCe(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):t2(t)?(e.consume(t),C):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):t2(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):a2(t)?(o=d,ce(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?se(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):a2(t)?(o=h,ce(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?se(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?se(t):a2(t)?(o=v,ce(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):a2(t)?(o=y,ce(t)):(e.consume(t),y)}function b(e){return e===62?se(e):y(e)}function x(t){return t2(t)?(e.consume(t),S):n(t)}function S(t){return t===45||n2(t)?(e.consume(t),S):ee(t)}function ee(t){return a2(t)?(o=ee,ce(t)):s2(t)?(e.consume(t),ee):se(t)}function C(t){return t===45||n2(t)?(e.consume(t),C):t===47||t===62||o2(t)?te(t):n(t)}function te(t){return t===47?(e.consume(t),se):t===58||t===95||t2(t)?(e.consume(t),ne):a2(t)?(o=te,ce(t)):s2(t)?(e.consume(t),te):se(t)}function ne(t){return t===45||t===46||t===58||t===95||n2(t)?(e.consume(t),ne):re(t)}function re(t){return t===61?(e.consume(t),ie):a2(t)?(o=re,ce(t)):s2(t)?(e.consume(t),re):te(t)}function ie(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ae):a2(t)?(o=ie,ce(t)):s2(t)?(e.consume(t),ie):(e.consume(t),oe)}function ae(t){return t===i?(e.consume(t),i=void 0,w):t===null?n(t):a2(t)?(o=ae,ce(t)):(e.consume(t),ae)}function oe(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||o2(t)?te(t):(e.consume(t),oe)}function w(e){return e===47||e===62||o2(e)?te(e):n(e)}function se(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ce(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),le}function le(t){return s2(t)?y4(e,ue,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ue(t)}function ue(t){return e.enter(`htmlTextData`),o(t)}}var P4={name:`labelEnd`,resolveAll:TCe,resolveTo:ECe,tokenize:DCe},SCe={tokenize:OCe},CCe={tokenize:kCe},wCe={tokenize:ACe};function TCe(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Q2(e,0,e.length,n),e}function ECe(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=$2(s,e.slice(a+1,a+r+3)),s=$2(s,[[`enter`,u,t]]),s=$2(s,g4(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=$2(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=$2(s,e.slice(o+1)),s=$2(s,[[`exit`,c,t]]),Q2(e,a,e.length,s),e}function DCe(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(y2(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(SCe,u,o?u:d)(t):t===91?e.attempt(CCe,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(wCe,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function OCe(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return o2(t)?M4(e,a)(t):a(t)}function a(t){return t===41?u(t):k4(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return o2(t)?M4(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?j4(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return o2(t)?M4(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function kCe(e,t,n){let r=this;return i;function i(t){return A4.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(y2(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function ACe(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var jCe={name:`labelStartImage`,resolveAll:P4.resolveAll,tokenize:MCe};function MCe(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var NCe={name:`labelStartLink`,resolveAll:P4.resolveAll,tokenize:PCe};function PCe(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var F4={name:`lineEnding`,tokenize:FCe};function FCe(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),y4(e,t,`linePrefix`)}}var I4={name:`thematicBreak`,tokenize:ICe};function ICe(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||a2(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),s2(t)?y4(e,s,`whitespace`)(t):s(t))}}var L4={continuation:{tokenize:BCe},exit:HCe,name:`list`,tokenize:zCe},LCe={partial:!0,tokenize:UCe},RCe={partial:!0,tokenize:VCe};function zCe(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:i2(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(I4,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return i2(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(b4,r.interrupt?n:u,e.attempt(LCe,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return s2(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function BCe(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(b4,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,y4(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!s2(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(RCe,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,y4(e,e.attempt(L4,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function VCe(e,t,n){let r=this;return y4(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function HCe(e){e.exit(this.containerState.type)}function UCe(e,t,n){let r=this;return y4(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!s2(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var R4={name:`setextUnderline`,resolveTo:WCe,tokenize:GCe};function WCe(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function GCe(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),s2(t)?y4(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||a2(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var KCe={tokenize:ewe,partial:!0};function qCe(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:ZCe,continuation:{tokenize:QCe},exit:$Ce}},text:{91:{name:`gfmFootnoteCall`,tokenize:XCe},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:JCe,resolveTo:YCe}}}}function JCe(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=y2(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function YCe(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function XCe(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||o2(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(y2(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return o2(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function ZCe(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||o2(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=y2(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return o2(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),y4(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function QCe(e,t,n){return e.check(b4,t,e.attempt(KCe,t,n))}function $Ce(e){e.exit(`gfmFootnoteDefinition`)}function ewe(e,t,n){let r=this;return y4(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function twe(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Q2(o,o.length,0,g4(s,e.slice(r+1,n),t)),Q2(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Q2(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=O2(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=O2(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var nwe=class{constructor(){this.map=[]}add(e,t,n){rwe(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function rwe(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function iwe(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function awe(){return{flow:{null:{name:`table`,tokenize:owe,resolveAll:swe}}}}function owe(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):a2(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):s2(t)?y4(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||o2(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,s2(t)?y4(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return s2(t)?y4(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||a2(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return s2(t)?y4(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||a2(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),ee(t)}function ee(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),ee):n===null||a2(n)?(e.exit(`tableRow`),t(n)):s2(n)?y4(e,ee,`whitespace`)(n):(e.enter(`data`),C(n))}function C(t){return t===null||t===124||o2(t)?(e.exit(`data`),ee(t)):(e.consume(t),t===92?te:C)}function te(t){return t===92||t===124?(e.consume(t),C):C(t)}}function swe(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new nwe;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(B4(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=z4(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=z4(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=z4(f,t,o,i,n,d)):(o[0]=o[1],d=z4(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&B4(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=iwe(t.events,n))}return e}function z4(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},V4(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=V4(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=V4(t.events,n[2]),a=V4(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},V4(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function B4(e,t,n,r,i){let a=[],o=V4(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function V4(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var cwe={name:`tasklistCheck`,tokenize:uwe};function lwe(){return{text:{91:cwe}}}function uwe(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return o2(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return a2(r)?t(r):s2(r)?e.check({tokenize:dwe},t,n)(r):n(r)}}function dwe(e,t,n){return y4(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function fwe(e){return t4([SSe(),qCe(),twe(e),awe(),lwe()])}var pwe={};function mwe(e){let t=this,n=e||pwe,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(fwe(n)),a.push(gSe()),o.push(_Se(n))}var hwe={tokenize:gwe};function gwe(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),y4(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return a2(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var _we={tokenize:vwe},H4={tokenize:ywe};function vwe(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Q2(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(H4,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(H4,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return a2(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Q2(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ywe(e,t,n){return y4(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var bwe={tokenize:xwe};function xwe(e){let t=this,n=e.attempt(b4,r,e.attempt(this.parser.constructs.flowInitial,i,y4(e,e.attempt(this.parser.constructs.flow,i,e.attempt(QSe,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Swe={resolveAll:W4()},Cwe=U4(`string`),wwe=U4(`text`);function U4(e){return{resolveAll:W4(e===`text`?Twe:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function W4(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Twe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Ewe=s({attentionMarkers:()=>Pwe,contentInitial:()=>Owe,disable:()=>Fwe,document:()=>Dwe,flow:()=>Awe,flowInitial:()=>kwe,insideSpan:()=>Nwe,string:()=>jwe,text:()=>Mwe}),Dwe={42:L4,43:L4,45:L4,48:L4,49:L4,50:L4,51:L4,52:L4,53:L4,54:L4,55:L4,56:L4,57:L4,62:x4},Owe={91:rCe},kwe={[-2]:E4,[-1]:E4,32:E4},Awe={35:lCe,42:I4,45:[R4,I4],60:pCe,61:R4,95:I4,96:T4,126:T4},jwe={38:C4,92:S4},Mwe={[-5]:F4,[-4]:F4,[-3]:F4,33:jCe,38:C4,42:_4,60:[NSe,bCe],91:NCe,92:[sCe,S4],93:P4,95:_4,96:KSe},Nwe={null:[_4,Swe]},Pwe={null:[42,95]},Fwe={null:[]};function Iwe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:ee(x),check:ee(S),consume:v,enter:y,exit:b,interrupt:ee(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=$2(o,e),g(),o[o.length-1]===null?(C(t,0),l.events=g4(a,l.events,l),l.events):[]}function f(e,t){return Rwe(p(e),t)}function p(e){return Lwe(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,ne()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){a2(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,ne()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){C(e,t.from)}function S(e,t){t.restore()}function ee(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=te(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function C(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Q2(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function te(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,ne()}}function ne(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Lwe(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Rwe(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
121
|
-
`;break;case-3:o=`\r
|
|
122
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function zwe(e){let t={constructs:t4([Ewe,...(e||{}).extensions||[]]),content:n(hwe),defined:[],document:n(_we),flow:n(bwe),lazy:{},string:n(Cwe),text:n(wwe)};return t;function n(e){return n;function n(n){return Iwe(t,e,n)}}}function Bwe(e){for(;!O4(e););return e}var G4=/[\0\t\n\r]/g;function Vwe(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(G4.lastIndex=u,c=G4.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}function K4(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?J4(e.position):`start`in e||`end`in e?J4(e):`line`in e||`column`in e?q4(e):``}function q4(e){return Y4(e&&e.line)+`:`+Y4(e&&e.column)}function J4(e){return q4(e&&e.start)+`-`+q4(e&&e.end)}function Y4(e){return e&&typeof e==`number`?e:1}var X4={}.hasOwnProperty;function Hwe(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Uwe(n)(Bwe(zwe(n).document().write(Vwe()(e,t,!0))))}function Uwe(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ae),autolinkProtocol:te,autolinkEmail:te,atxHeading:a(Ee),blockQuote:a(xe),characterEscape:te,characterReference:te,codeFenced:a(Se),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(Se,o),codeText:a(Ce,o),codeTextData:te,data:te,codeFlowValue:te,definition:a(we),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Te),hardBreakEscape:a(De),hardBreakTrailing:a(De),htmlFlow:a(Oe,o),htmlFlowData:te,htmlText:a(Oe,o),htmlTextData:te,image:a(ke),label:o,link:a(Ae),listItem:a(Me),listItemValue:f,listOrdered:a(je,d),listUnordered:a(je),paragraph:a(Ne),reference:me,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Ee),strong:a(Pe),thematicBreak:a(Ie)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:be,autolinkProtocol:ye,blockQuote:c(),characterEscapeValue:ne,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:_e,characterReference:ve,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:ne,codeIndented:c(_),codeText:c(w),codeTextData:ne,data:ne,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(ie),hardBreakTrailing:c(ie),htmlFlow:c(ae),htmlFlowData:ne,htmlText:c(oe),htmlTextData:ne,image:c(ce),label:ue,labelText:le,lineEnding:re,link:c(se),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:he,resourceDestinationString:de,resourceTitleString:fe,resource:pe,setextHeading:c(C),setextHeadingLineSequence:ee,setextHeadingText:S,strong:c(),thematicBreak:c()}};Q4(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];X4.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||$4).call(a,void 0,e[0])}for(r.position={start:Z4(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Z4(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Z4(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||$4).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+K4({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Z4(e.end)}function u(){return M2(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=y2(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function ee(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function te(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Fe(),n.position={start:Z4(e.start),end:void 0},t.push(n)),this.stack.push(n)}function ne(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Z4(e.end)}function re(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Z4(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(te.call(this,e),ne.call(this,e))}function ie(){this.data.atHardBreak=!0}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function oe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function w(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function se(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ce(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function le(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=rSe(t),n.identifier=y2(t).toLowerCase()}function ue(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function de(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function fe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function pe(){this.data.inReference=void 0}function me(){this.data.referenceType=`collapsed`}function he(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=y2(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ge(e){this.data.characterReferenceType=e.type}function _e(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=J2(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=q2(t);let i=this.stack[this.stack.length-1];i.value+=r}function ve(e){let t=this.stack.pop();t.position.end=Z4(e.end)}function ye(e){ne.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function be(e){ne.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function xe(){return{type:`blockquote`,children:[]}}function Se(){return{type:`code`,lang:null,meta:null,value:``}}function Ce(){return{type:`inlineCode`,value:``}}function we(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function Te(){return{type:`emphasis`,children:[]}}function Ee(){return{type:`heading`,depth:0,children:[]}}function De(){return{type:`break`}}function Oe(){return{type:`html`,value:``}}function ke(){return{type:`image`,title:null,url:``,alt:null}}function Ae(){return{type:`link`,title:null,url:``,children:[]}}function je(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Me(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ne(){return{type:`paragraph`,children:[]}}function Pe(){return{type:`strong`,children:[]}}function Fe(){return{type:`text`,value:``}}function Ie(){return{type:`thematicBreak`}}}function Z4(e){return{line:e.line,column:e.column,offset:e.offset}}function Q4(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Q4(e,r):Wwe(e,r)}}function Wwe(e,t){let n;for(n in t)if(X4.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function $4(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+K4({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+K4({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+K4({start:t.start,end:t.end})+`) is still open`)}function Gwe(e){let t=this;t.parser=n;function n(n){return Hwe(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Kwe(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function qwe(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
123
|
-
`}]}function Jwe(e,t){let n=t.value?t.value+`
|
|
124
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Ywe(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Xwe(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Zwe(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=h4(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Qwe(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $we(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function e3(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function eTe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return e3(e,t);let i={src:h4(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function tTe(e,t){let n={src:h4(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function nTe(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function rTe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return e3(e,t);let i={href:h4(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function iTe(e,t){let n={href:h4(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function aTe(e,t,n){let r=e.all(t),i=n?oTe(n):t3(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
125
|
-
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
126
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function oTe(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=t3(n[r])}return t}function t3(e){return e.spread??e.children.length>1}function sTe(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function cTe(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lTe(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function uTe(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dTe(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Z1(t.children[1]),o=X1(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function fTe(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function pTe(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var n3=9,r3=32;function mTe(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(i3(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(i3(t.slice(i),i>0,!1)),a.join(``)}function i3(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===n3||t===r3;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===n3||t===r3;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function hTe(e,t){let n={type:`text`,value:mTe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function gTe(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var _Te={blockquote:Kwe,break:qwe,code:Jwe,delete:Ywe,emphasis:Xwe,footnoteReference:Zwe,heading:Qwe,html:$we,imageReference:eTe,image:tTe,inlineCode:nTe,linkReference:rTe,link:iTe,listItem:aTe,list:sTe,paragraph:cTe,root:lTe,strong:uTe,table:dTe,tableCell:pTe,tableRow:fTe,text:hTe,thematicBreak:gTe,toml:a3,yaml:a3,definition:a3,footnoteDefinition:a3};function a3(){}function vTe(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function yTe(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function bTe(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||vTe,r=e.options.footnoteBackLabel||yTe,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=h4(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Y1(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
127
|
-
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
128
|
-
`}]}}var o3={}.hasOwnProperty,xTe={};function STe(e,t){let n=t||xTe,r=new Map,i=new Map,a={all:s,applyData:wTe,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{..._Te,...n.handlers},one:o,options:n,patch:CTe,wrap:ETe};return j2(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(o3.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Y1(n);return r.children=a.all(e),r}return Y1(e)}return(a.options.unknownHandler||TTe)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=s3(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=s3(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function CTe(e,t){e.position&&(t.position=$1(e))}function wTe(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Y1(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function TTe(e,t){let n=t.data||{},r=`value`in t&&!(o3.call(n,`hProperties`)||o3.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ETe(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
129
|
-
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
130
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
131
|
-
`}),n}function s3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function c3(e,t){let n=STe(e,t),r=n.one(e,void 0),i=bTe(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
132
|
-
`},i)),a}function DTe(e,t){return e&&`run`in e?async function(n,r){let i=c3(n,{file:r,...t});await e.run(i,r)}:function(n,r){return c3(n,{file:r,...e||t})}}function l3(e){if(e)throw e}var OTe=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function u3(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function kTe(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?ATe(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function ATe(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var d3=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=K4(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};d3.prototype.file=``,d3.prototype.name=``,d3.prototype.reason=``,d3.prototype.message=``,d3.prototype.stack=``,d3.prototype.column=void 0,d3.prototype.line=void 0,d3.prototype.ancestors=void 0,d3.prototype.cause=void 0,d3.prototype.fatal=void 0,d3.prototype.place=void 0,d3.prototype.ruleId=void 0,d3.prototype.source=void 0;var f3={basename:jTe,dirname:MTe,extname:NTe,join:PTe,sep:`/`};function jTe(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);p3(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function MTe(e){if(p3(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function NTe(e){p3(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function PTe(...e){let t=-1,n;for(;++t<e.length;)p3(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:FTe(n)}function FTe(e){p3(e);let t=e.codePointAt(0)===47,n=ITe(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function ITe(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function p3(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var LTe={cwd:RTe};function RTe(){return`/`}function m3(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function zTe(e){if(typeof e==`string`)e=new URL(e);else if(!m3(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return BTe(e)}function BTe(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var h3=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],VTe=class{constructor(e){let t;t=e?m3(e)?{path:e}:typeof e==`string`||HTe(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:LTe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<h3.length;){let e=h3[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)h3.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?f3.basename(this.path):void 0}set basename(e){_3(e,`basename`),g3(e,`basename`),this.path=f3.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?f3.dirname(this.path):void 0}set dirname(e){v3(this.basename,`dirname`),this.path=f3.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?f3.extname(this.path):void 0}set extname(e){if(g3(e,`extname`),v3(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=f3.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){m3(e)&&(e=zTe(e)),_3(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?f3.basename(this.path,this.extname):void 0}set stem(e){_3(e,`stem`),g3(e,`stem`),this.path=f3.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new d3(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function g3(e,t){if(e&&e.includes(f3.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+f3.sep+"`")}function _3(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function v3(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function HTe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var UTe=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),y3=l(OTe(),1),WTe={}.hasOwnProperty,GTe=new class e extends UTe{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=kTe()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,y3.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(S3(`data`,this.frozen),this.namespace[e]=t,this):WTe.call(this.namespace,e)&&this.namespace[e]||void 0:e?(S3(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=T3(e),n=this.parser||this.Parser;return b3(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),b3(`process`,this.parser||this.Parser),x3(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=T3(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);qTe(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),b3(`processSync`,this.parser||this.Parser),x3(`processSync`,this.compiler||this.Compiler),this.process(e,r),w3(`processSync`,`process`,t),n;function r(e,r){t=!0,l3(e),n=r}}run(e,t,n){C3(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=T3(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),w3(`runSync`,`run`,n),r;function i(e,t){l3(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=T3(t),r=this.compiler||this.Compiler;return x3(`stringify`,r),C3(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(S3(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,y3.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];u3(o)&&u3(r)&&(r=(0,y3.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function b3(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function x3(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function S3(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function C3(e){if(!u3(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function w3(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function T3(e){return KTe(e)?e:new VTe(e)}function KTe(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function qTe(e){return typeof e==`string`||JTe(e)}function JTe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var YTe=GTe().use(Gwe).use(mwe).use(DTe).use(dye).use(Dbe),E3=400,D3=new E$(E3),O3=new E$(E3),k3=new E$(E3),A3=new Map;function j3(e,t){return`${t?`t`:`f`}\0${e}`}function XTe(e){return e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`)}function M3(e,t={}){let n=t.cache??!0;if(n){let t=D3.get(e);if(t!==void 0)return t}let r;try{r=String(YTe.processSync(e))}catch{r=XTe(e)}return n&&D3.set(e,r),r}function ZTe(e){return e.match(/language-([\w-]+)/)?.[1]??`text`}function N3(e,t){let n=e.textContent??``;return t?R$(n).text:n}function P3(e,t){let n=e.cloneNode(!0),r=n.querySelector(`code`);return r?r.textContent=t:n.textContent=t,n}function F3(e){let t=document.createElement(`div`);t.className=`code-block`;let n=document.createElement(`button`);return n.type=`button`,n.className=`code-copy`,n.dataset.copyCode=``,n.textContent=`Copy`,t.append(n,e),t}function QTe(e,t){if(typeof document>`u`||!e.includes(`<pre`))return e;let n=document.createElement(`div`);n.innerHTML=e;for(let e of Array.from(n.querySelectorAll(`pre > code`))){let n=e.parentElement;n&&n.replaceWith(F3(P3(n,N3(e,t))))}return n.innerHTML}function I3(e){if(typeof document>`u`||!e.includes(`<table`))return e;let t=document.createElement(`div`);t.innerHTML=e;for(let e of Array.from(t.querySelectorAll(`table`))){if(e.parentElement?.classList.contains(`table-scroll`))continue;let t=document.createElement(`div`);t.className=`table-scroll`,e.replaceWith(t),t.append(e)}return t.innerHTML}async function $Te(e,t){if(typeof document>`u`||!e.includes(`<pre`))return e;let n=document.createElement(`div`);n.innerHTML=e;let r=Array.from(n.querySelectorAll(`pre > code`));return await Promise.all(r.map(async e=>{let n=ZTe(e.getAttribute(`class`)??``);try{let r=await c1(N3(e,t),n);if(r){let t=document.createElement(`div`);t.innerHTML=r;let n=t.firstElementChild;n&&e.parentElement?.replaceWith(F3(n));return}}catch{}let r=e.parentElement;r&&r.replaceWith(F3(P3(r,N3(e,t))))})),n.innerHTML}function L3(e,t){return I3(QTe(e,t))}async function eEe(e,t){return I3(await $Te(e,t))}function R3(e,t){let n=j3(e,t),r=O3.get(n);if(r!==void 0)return r;let i=L3(M3(e),t);return O3.set(n,i),i}function tEe(e,t){return k3.get(j3(e,t))}function nEe(e,t){let n=j3(e,t),r=k3.get(n);if(r!==void 0)return Promise.resolve(r);let i=A3.get(n);if(i)return i;let a=eEe(M3(e),t).then(e=>(k3.set(n,e),A3.delete(n),e)).catch(e=>{throw A3.delete(n),e});return A3.set(n,a),a}var rEe=L(`<div class="markdown svelte-1mr3h8f"></div>`);function z3(e,t){D(t,!0);let n=q(t,`trimCodeBlocks`,3,!0),r=q(t,`streaming`,3,!1),i=A(``);async function a(e){let n=e.target;if(!(n instanceof Element))return;let r=n.closest(`button[data-copy-code]`);if(r){let e=r.closest(`.code-block`)?.querySelector(`pre code`)?.textContent??``;if(!e)return;try{await bE(e),t.onCopy?.(!0)}catch{t.onCopy?.(!1)}return}if(!t.onOpenFile)return;let i=n.closest(`a[href]`)?.getAttribute(`href`);if(!i)return;let a=ehe(i);if(!a)return;let o=the(a),s=t.linkBasePath?I$(o.path,t.linkBasePath)??o.path:o.path;e.preventDefault(),t.onOpenFile(s,o.line)}function o(e){return e.addEventListener(`click`,a),{destroy(){e.removeEventListener(`click`,a)}}}let s,c,l=0;function u(e,t){return`${t?`trim`:`full`}\0${e}`}function d(){c!==void 0&&(cancelAnimationFrame(c),c=void 0)}function f(e,t){let n=u(e,t);s!==n&&(j(i,L3(M3(e,{cache:!1}),t),!0),s=n,l+=1)}function p(e,t){let n=u(e,t),r=tEe(e,t);if(r!==void 0){j(i,r,!0),s=n,l+=1;return}j(i,R3(e,t),!0),s=n;let a=l+=1;nEe(e,t).then(e=>{a===l&&(j(i,e,!0),s=n)}).catch(()=>{a===l&&(j(i,R3(e,t),!0),s=n)})}sr(()=>{let e=t.text,i=n();if(!r()){d(),p(e,i);return}c===void 0&&(c=requestAnimationFrame(()=>{c=void 0,f(t.text,n())}))}),sr(()=>()=>d());var m=rEe();Wi(m,()=>I(i),!0),T(m),qi(m,e=>o?.(e)),z(e,m),O()}var iEe=L(`<p class="lead svelte-dzmv4a">Summarizing recent work…</p>`),aEe=L(`<p class="lead svelte-dzmv4a"> </p>`),oEe=L(`<div class="compaction-block svelte-dzmv4a"><!></div>`);function sEe(e,t){D(t,!0);function n(e){return e&&typeof e==`object`?e:void 0}let r=k(()=>n(t.notice.details)),i=k(()=>typeof I(r)?.compactedMessages==`number`?I(r).compactedMessages:void 0),a=k(()=>t.notice.reason===`threshold`?`auto compact`:t.notice.reason===`overflow`?`overflow recovery`:`manual`),o=k(()=>t.notice.state===`failed`?`danger`:t.notice.state===`running`?`running`:`good`),s=k(()=>{let e=t.notice.contextTokens??t.notice.tokensBefore;if(!(!e||!t.notice.contextWindow))return Math.round(e/t.notice.contextWindow*100)}),c=k(()=>{let e=(t.notice.summary??t.notice.text??``).trim();if(!e)return``;let n=[];for(let t of e.split(`
|
|
133
|
-
`)){let e=t.trim();if(!e||e.startsWith(`#`)||e.startsWith(`---`)||/^generated locally/i.test(e)||/^treat this as a context checkpoint/i.test(e))continue;let r=e.replace(/^[-*]\s+/,``).replace(/^\d+\.\s+/,``).replace(/^\[[ xX]\]\s+/,``).replace(/\*\*/g,``).trim();if(r&&(n.push(r),n.length>=2))break}let r=n.join(` `);return r.length>180?`${r.slice(0,180).trim()}…`:r}),l=k(()=>{let e=[];return typeof t.notice.tokensBefore==`number`&&e.push({text:`${tf(t.notice.tokensBefore)} before`}),typeof t.notice.tokensAfter==`number`&&e.push({text:`≈${tf(t.notice.tokensAfter)} after`}),typeof t.notice.freedTokens==`number`&&t.notice.freedTokens>0&&e.push({text:`${tf(t.notice.freedTokens)} freed`,tone:`success`}),typeof I(i)==`number`&&e.push({text:`${I(i)} messages`}),typeof I(s)==`number`&&e.push({text:`${I(s)}% context`}),e}),u=k(()=>t.notice.errorMessage?.trim()||`Could not compact this conversation.`);var d=oEe(),f=M(d);{let e=k(()=>t.notice.state===`completed`?void 0:t.notice.state),n=k(()=>t.notice.state===`running`),r=k(()=>({text:I(a)})),i=k(()=>t.notice.state===`failed`?I(u):void 0),s=k(()=>t.notice.state===`completed`?I(l):[]);M1(f,{get status(){return I(e)},get dotTone(){return I(o)},get dotPulse(){return I(n)},badge:`compact`,get arg(){return I(r)},get error(){return I(i)},get meta(){return I(s)},children:(e,n)=>{var r=R(),i=N(r),a=e=>{z(e,iEe())},o=e=>{var t=aEe(),n=M(t,!0);T(t),F(()=>B(n,I(c))),z(e,t)};V(i,e=>{t.notice.state===`running`?e(a):t.notice.state===`completed`&&I(c)&&e(o,1)}),z(e,r)},$$slots:{default:!0}})}T(d),z(e,d),O()}var cEe=L(`<span class="arg svelte-1fs3xlu"> </span>`),lEe=L(`<div class="flex min-w-0 items-center gap-2.5 rounded-md border bg-card px-2.5 py-2"><div class="min-w-0 flex-1 truncate font-mono text-xs text-foreground"> </div> <!> <!></div>`),uEe=L(`<article class="task-event svelte-1fs3xlu"><div class="task-event-header svelte-1fs3xlu"><!> <span class="badge svelte-1fs3xlu"> </span> <!></div> <!></article>`);function dEe(e,t){D(t,!0);let n=k(()=>iT(t.notice.status)),r=k(()=>t.notice.exitCode!==void 0&&t.notice.exitCode!==null),i=k(()=>t.notice.event?`task ${t.notice.event}`:`task update`);var a=uEe(),o=M(a),s=M(o);{let e=k(()=>aT(t.notice.status));lC(s,{get tone(){return I(n)},get pulse(){return I(e)},size:`xs`,class:`mr-1.5 align-middle`})}var c=P(s,2),l=M(c,!0);T(c);var u=P(c,2),d=e=>{var n=cEe(),r=M(n,!0);T(n),F(()=>B(r,t.notice.taskName)),z(e,n)};V(u,e=>{t.notice.taskName&&e(d)}),T(o);var f=P(o,2),p=e=>{var i=lEe(),a=M(i),o=M(a,!0);T(a);var s=P(a,2),c=e=>{{let n=k(()=>t.notice.exitCode===0?`neutral`:`danger`);uf(e,{get tone(){return I(n)},size:`xs`,children:(e,n)=>{E();var r=ki();F(()=>B(r,`exit ${t.notice.exitCode??``}`)),z(e,r)},$$slots:{default:!0}})}},l=e=>{uf(e,{tone:`warn`,size:`xs`,children:(e,n)=>{E();var r=ki();F(()=>B(r,`signal ${t.notice.signal??``}`)),z(e,r)},$$slots:{default:!0}})};V(s,e=>{I(r)?e(c):t.notice.signal&&e(l,1)});var u=P(s,2),d=e=>{{let r=k(()=>I(n)===`neutral`?`border-border bg-muted text-muted-foreground`:``);uf(e,{get tone(){return I(n)},size:`xs`,get class(){return I(r)},children:(e,n)=>{E();var r=ki();F(()=>B(r,t.notice.status)),z(e,r)},$$slots:{default:!0}})}};V(u,e=>{t.notice.status&&e(d)}),T(i),F(()=>B(o,t.notice.commandPreview??``)),z(e,i)};V(f,e=>{(t.notice.commandPreview||I(r)||t.notice.signal||t.notice.status)&&e(p)}),T(a),F(()=>B(l,I(i))),z(e,a),O()}var fEe=L(`<div class="status-actions svelte-h4d716"><!></div>`),pEe=L(`<article aria-live="polite"><div class="run-status-header svelte-h4d716"><!> <span class="badge svelte-h4d716"> </span> <span class="arg svelte-h4d716"> </span></div> <p class="status-summary svelte-h4d716"> </p> <!></article>`);function mEe(e,t){D(t,!0);let n=A(In(Date.now()));sr(()=>{if(t.notice.state!==`retrying`||!t.notice.retryAt)return;j(n,Date.now(),!0);let e=setInterval(()=>{j(n,Date.now(),!0)},250);return()=>clearInterval(e)});let r=k(()=>t.notice.state!==`retrying`&&t.isLast&&!t.sending&&t.notice.retryable===!0&&!!t.notice.entryId&&!!t.onContinueFromFailure),i=k(()=>t.notice.state===`retrying`?`running`:`warn`),a=k(()=>t.notice.state===`retrying`?`retrying`:`run`),o=k(()=>{switch(t.notice.state){case`retrying`:return`model request`;case`interrupted`:return`interrupted`;default:return`failed`}}),s=k(()=>{let e=t.notice.retryAt?Date.parse(t.notice.retryAt):NaN;if(Number.isFinite(e))return Math.max(0,Math.ceil((e-I(n))/1e3));if(typeof t.notice.delayMs==`number`&&t.notice.delayMs>0)return Math.ceil(t.notice.delayMs/1e3)}),c=k(()=>t.notice.errorMessage?.trim()?t.notice.errorMessage.trim():void 0),l=k(()=>typeof t.notice.attempt==`number`&&typeof t.notice.maxRetries==`number`?`attempt ${t.notice.attempt}/${t.notice.maxRetries}`:typeof t.notice.attempt==`number`?`attempt ${t.notice.attempt}`:void 0),u=k(()=>t.notice.state===`retrying`?`${I(c)?`Request failed with ${I(c)}`:`Request failed`}, ${typeof I(s)==`number`?I(s)>0?`retry in ${I(s)}s`:`retrying now`:`retrying soon`}${I(l)?` (${I(l)})`:``}`:t.notice.state===`interrupted`?`${I(c)??`The run was interrupted.`} Click Continue to resume.`:`${I(c)?`Request failed with ${I(c)}`:`Request failed`}. Click Continue to retry.`);function d(){!t.notice.entryId||!I(r)||t.onContinueFromFailure?.(t.notice.entryId)}var f=pEe(),p=M(f),m=M(p);{let e=k(()=>t.notice.state===`retrying`);lC(m,{get tone(){return I(i)},get pulse(){return I(e)},size:`xs`,class:`mr-1.5 align-middle`})}var h=P(m,2),g=M(h,!0);T(h);var _=P(h,2),v=M(_,!0);T(_),T(p);var y=P(p,2),b=M(y,!0);T(y);var x=P(y,2),S=e=>{var t=fEe();Ml(M(t),{size:`sm`,variant:`default`,onclick:d,children:(e,t)=>{E(),z(e,ki(`Continue`))},$$slots:{default:!0}}),T(t),z(e,t)};V(x,e=>{I(r)&&e(S)}),T(f),F(()=>{ra(f,1,`run-status-line state-${t.notice.state}`,`svelte-h4d716`),B(g,I(a)),B(v,I(o)),B(b,I(u))}),z(e,f),O()}var hEe=L(`<p class="redacted svelte-1ibxuqi">Provider returned redacted thinking.</p>`),gEe=L(`<span class="stream-caret svelte-1ibxuqi" aria-hidden="true"></span>`),_Ee=L(`<!> <!>`,1),vEe=L(`<div><!></div>`);function yEe(e,t){D(t,!0);let n=q(t,`live`,3,!1);var r=vEe(),i=M(r),a=e=>{z(e,hEe())},o=e=>{var r=_Ee(),i=N(r);z3(i,{get text(){return t.block.text},get onCopy(){return ld}});var a=P(i,2),o=e=>{z(e,gEe())};V(a,e=>{n()&&!t.block.text&&e(o)}),z(e,r)};V(i,e=>{t.block.redacted&&!t.block.text?e(a):e(o,-1)}),T(r),F(()=>ra(r,1,`thinking-block ${n()?`live`:``}`,`svelte-1ibxuqi`)),z(e,r),O()}var bEe=L(`<span class="stream-caret svelte-9q15cr" aria-hidden="true"></span>`),xEe=L(`<div class="message-content svelte-9q15cr"><!> <!></div>`),SEe=L(`<article><div class="message-body svelte-9q15cr"><!></div></article>`);function CEe(e,t){D(t,!0);let n=q(t,`hydrateToolBodies`,3,!0),r=q(t,`planReviewModels`,19,()=>[]),i=q(t,`planReviewModelKey`,3,``),a=q(t,`planReviewThinkingLevel`,3,`off`);var o=R(),s=N(o),c=e=>{{let o=k(()=>t.toolMenu(t.node.anchorEntryId,t.node.toolCall));j$(e,{get items(){return I(o)},triggerClass:`block min-w-0`,children:(e,o)=>{kve(e,{get toolCall(){return t.node.toolCall},get liveOutput(){return t.node.liveOutput},get pendingUserQuestion(){return t.pendingUserQuestion},get hydrateBody(){return n()},get pendingPlanReview(){return t.pendingPlanReview},get onOpenFile(){return t.onOpenFile},get planReviewModels(){return r()},get planReviewModelKey(){return i()},get planReviewThinkingLevel(){return a()},get onAnswerUserQuestion(){return t.onAnswerUserQuestion},get onDismissUserQuestion(){return t.onDismissUserQuestion},get onAcceptPlanReview(){return t.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return t.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return t.onRejectPlanReview}})},$$slots:{default:!0}})}},l=e=>{{let n=k(()=>t.activeProject?.dir);Jve(e,{get draft(){return t.node.draft},get cwd(){return I(n)}})}},u=e=>{Xve(e,{get toolName(){return t.node.toolName},get error(){return t.node.error}})},d=e=>{{let n=k(()=>t.node.key===t.lastTimelineKey);mEe(e,{get notice(){return t.node.notice},get isLast(){return I(n)},get sending(){return t.sending},get onContinueFromFailure(){return t.onContinueFromFailure}})}},f=e=>{sEe(e,{get notice(){return t.node.notice}})},p=e=>{dEe(e,{get notice(){return t.node.notice}})},m=e=>{{let n=k(()=>t.messageMenu(t.node.item)),r=k(()=>`select-text ${t.node.item.role===`user`?`user-msg-trigger`:``}`);j$(e,{get items(){return I(n)},get triggerClass(){return I(r)},children:(e,n)=>{var r=SEe(),i=M(r),a=M(i),o=e=>{{let n=k(()=>({text:t.node.item.text,redacted:t.node.item.redacted})),r=k(()=>t.node.item.live&&!t.node.item.done);yEe(e,{get block(){return I(n)},get live(){return I(r)}})}},s=e=>{var n=xEe(),r=M(n);{let e=k(()=>t.node.item.role!==`assistant`),n=k(()=>!!(t.node.item.live&&!t.node.item.done)),i=k(()=>t.activeProject?.dir);z3(r,{get text(){return t.node.item.text},get trimCodeBlocks(){return I(e)},get streaming(){return I(n)},get linkBasePath(){return I(i)},get onOpenFile(){return t.onOpenFile},get onCopy(){return ld}})}var i=P(r,2),a=e=>{z(e,bEe())};V(i,e=>{t.node.item.live&&!t.node.item.done&&e(a)}),T(n),z(e,n)};V(a,e=>{t.node.item.displayKind===`thinking`?e(o):t.node.item.text&&e(s,1)}),T(i),T(r),F(()=>ra(r,1,`transcript-entry ${t.node.item.role} ${t.node.item.displayKind===`thinking`?`thinking-entry`:``} ${t.node.item.live?`streaming`:``}`,`svelte-9q15cr`)),z(e,r)},$$slots:{default:!0}})}};V(s,e=>{t.node.kind===`tool`?e(c):t.node.kind===`tool_draft`?e(l,1):t.node.kind===`tool_result_error`?e(u,2):t.node.kind===`run_status`?e(d,3):t.node.kind===`compaction`?e(f,4):t.node.kind===`task_event`?e(p,5):e(m,-1)}),z(e,o),O()}var wEe=L(`<div class="prompt-project svelte-phh39z"><!> <span class="prompt-project-label svelte-phh39z">Project:</span> <span class="prompt-project-path svelte-phh39z"> </span></div>`),TEe=L(`<div class="empty-run-wrap svelte-phh39z"><div class="empty-run svelte-phh39z"><div class="prompt-line svelte-phh39z"><span class="prompt-sigil svelte-phh39z">nerve</span> <span class="prompt-arrow svelte-phh39z">❯</span> <span class="prompt-caret svelte-phh39z" aria-hidden="true"></span></div> <span class="prompt-hint svelte-phh39z">Type below to wake the agent.</span> <!></div></div>`),EEe=L(`<article class="transcript-entry assistant streaming waiting-entry svelte-phh39z"><div class="message-body svelte-phh39z"><div class="message-content streaming-content svelte-phh39z"><span class="stream-caret svelte-phh39z" aria-hidden="true"></span></div></div></article>`),DEe=L(`<div class="queued-prompt svelte-phh39z"><!> <span class="queued-label svelte-phh39z">Queued</span> <span class="queued-text svelte-phh39z"> </span></div>`);function OEe(e,t){D(t,!0);let n=q(t,`controller`,15),r=q(t,`atEnd`,15,!0),i=q(t,`paddingEnd`,3,0),a=q(t,`followBottom`,3,!0),o=q(t,`active`,3,!0),s=q(t,`planReviewModels`,19,()=>[]),c=q(t,`planReviewModelKey`,3,``),l=q(t,`planReviewThinkingLevel`,3,`off`),u=k(()=>{let e=t.timeline.map(e=>({kind:`timeline`,key:e.key,node:e}));t.sending&&!t.hasLiveTimelineNodes&&e.push({kind:`waiting`,key:`__waiting__`});for(let n of t.queuedPrompts)e.push({kind:`queued`,key:`__queued__:${n.id}`,prompt:n});return e}),d=k(()=>t.timeline.length===0&&!t.streamingText&&!t.sending);var f=R(),p=N(f),m=e=>{var n=TEe(),r=M(n),i=P(M(r),4),a=e=>{var n=wEe(),r=M(n);v$(r,{size:13,strokeWidth:2.2,"aria-hidden":`true`});var i=P(r,4),a=M(i,!0);T(i),T(n),F(()=>{W(n,`title`,t.activeProject?.dir),W(n,`aria-label`,`Conversation will be created in project ${t.activeProject?.dir}`),B(a,t.activeProjectLabel)}),z(e,n)};V(i,e=>{t.activeProjectLabel&&e(a)}),T(r),T(n),z(e,n)},h=e=>{O$(e,{get items(){return I(u)},getKey:e=>e.key,get heightCacheKey(){return t.heightCacheKey},contentVisibility:!0,estimateSize:()=>120,overscan:10,anchor:`end`,get followOutput(){return a()},scrollEndThreshold:32,paddingStart:12,get paddingEnd(){return i()},gap:2,viewportClass:`transcript-viewport`,get controller(){return n()},set controller(e){n(e)},get atEnd(){return r()},set atEnd(e){r(e)},row:(e,n)=>{let r=()=>n?.().item;var i=R(),a=N(i),u=e=>{CEe(e,{get node(){return r().node},get sending(){return t.sending},get hydrateToolBodies(){return o()},get activeProject(){return t.activeProject},get pendingUserQuestion(){return t.pendingUserQuestion},get pendingPlanReview(){return t.pendingPlanReview},get lastTimelineKey(){return t.lastTimelineKey},get planReviewModels(){return s()},get planReviewModelKey(){return c()},get planReviewThinkingLevel(){return l()},get onOpenFile(){return t.onOpenFile},get onAnswerUserQuestion(){return t.onAnswerUserQuestion},get onDismissUserQuestion(){return t.onDismissUserQuestion},get onAcceptPlanReview(){return t.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return t.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return t.onRejectPlanReview},get onContinueFromFailure(){return t.onContinueFromFailure},get messageMenu(){return t.messageMenu},get toolMenu(){return t.toolMenu}})},d=e=>{z(e,EEe())},f=e=>{var t=DEe(),n=M(t);eme(n,{size:14,strokeWidth:2.2});var i=P(n,4),a=M(i,!0);T(i),T(t),F(()=>B(a,r().prompt.text)),z(e,t)};V(a,e=>{r().kind===`timeline`?e(u):r().kind===`waiting`?e(d,1):e(f,-1)}),z(e,i)},$$slots:{row:!0}})};V(p,e=>{I(d)?e(m):e(h,-1)}),z(e,f),O()}var kEe=new Set([`$$slots`,`$$events`,`$$legacy`]);function B3(e,t){let n=G(t,kEe),r=[[`path`,{d:`M5 12h14`}],[`path`,{d:`m12 5 7 7-7 7`}]];uc(e,K({name:`arrow-right`},()=>n,{get iconNode(){return r}}))}var AEe=new Set([`$$slots`,`$$events`,`$$legacy`]);function jEe(e,t){let n=G(t,AEe),r=[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`}]];uc(e,K({name:`clipboard`},()=>n,{get iconNode(){return r}}))}var MEe=new Set([`$$slots`,`$$events`,`$$legacy`]);function V3(e,t){let n=G(t,MEe),r=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]];uc(e,K({name:`copy`},()=>n,{get iconNode(){return r}}))}var NEe=new Set([`$$slots`,`$$events`,`$$legacy`]);function PEe(e,t){let n=G(t,NEe),r=[[`path`,{d:`M17 5H3`}],[`path`,{d:`M21 12H8`}],[`path`,{d:`M21 19H8`}],[`path`,{d:`M3 12v7`}]];uc(e,K({name:`text-quote`},()=>n,{get iconNode(){return r}}))}function H3(e){if(e)return e.split(`:thinking:`)[0]}function FEe(e,t){let n=H3(e);return n?t.get(n):void 0}function IEe(e,t){let n=H3(e.id);return n?t.get(n):void 0}function LEe(e,t){let n=H3(e.id),r=!!(n&&t.treeEntriesById.has(n)),i=IEe(e,t.treeEntriesById),a=[];return r&&(a.push({label:`Continue from here`,icon:B3,onSelect:()=>t.onNavigateToEntry?.(n)},{label:`Fork from before this message`,icon:kd,onSelect:()=>t.onNavigateToEntry?.(FEe(e.id,t.parentEntryIdById))}),i?.role===`user`&&a.push({label:`Edit & resend`,icon:WQ,onSelect:()=>t.onEditEntry?.(i)}),a.push({type:`separator`})),a.push({label:`Copy text`,icon:jEe,onSelect:()=>void t.copyText(e.text)},{label:`Quote in composer`,icon:PEe,onSelect:()=>t.quoteInComposer(e.text)}),e.id&&(a.push({type:`separator`}),a.push({label:`Copy message id`,icon:V3,onSelect:()=>void t.copyText(e.id??``,`message id`)})),t.onOpenHistory&&(a.push({type:`separator`}),a.push({label:`Show branch history`,icon:kd,onSelect:t.onOpenHistory})),a}function REe(e,t,n){let r=[];return e&&(r.push({label:`Continue after this tool result`,icon:B3,onSelect:()=>n.onNavigateToEntry?.(e)}),r.push({type:`separator`})),r.push({label:`Copy tool id`,icon:V3,onSelect:()=>void n.copyText(t.id,`tool id`)}),n.onOpenHistory&&(r.push({type:`separator`}),r.push({label:`Show branch history`,icon:kd,onSelect:n.onOpenHistory})),r}function zEe({atEnd:e,scrollDelta:t,userScrollAwayIntent:n,scrollbarPointerActive:r,epsilon:i=1}){return e?!1:r?!0:n&&t<-i}var U3=30,BEe=2400,W3=32,G3=100,VEe=350,HEe=120,UEe=1,WEe=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),GEe=new Set([`ArrowUp`,`Home`,`PageUp`]);function K3(e){return Math.max(e.scrollHeight-e.clientHeight-e.scrollTop,0)}function q3(e,t=W3){return K3(e)<=t}function KEe(e,t){if(t.scrollHeight<=t.clientHeight)return!1;let n=t.offsetWidth-t.clientWidth;if(n<=0)return!1;let r=t.getBoundingClientRect();return e.clientX>=r.right-n&&e.clientX<=r.right&&e.clientY>=r.top&&e.clientY<=r.bottom}function qEe(e){let t=A(void 0),n=A(0),r=A(void 0),i=A(!0),a=A(!0),o,s=!1,c=!1,l,u=!1,d,f=!1,p;function m(){d!==void 0&&(clearTimeout(d),d=void 0)}function h(){p!==void 0&&(clearTimeout(p),p=void 0)}function g(){f=!0,h(),p=setTimeout(()=>{f=!1,p=void 0},HEe)}function _(){l!==void 0&&(cancelAnimationFrame(l),l=void 0)}function v(e){g(),I(r)?.scrollToEnd(e)}function y(e){let t=I(r);if(e){if(q3(e,W3)){j(a,!0);return}u&&K3(e)>G3&&(j(a,!1),_());return}if(t?.isAtEnd(W3)){j(a,!0);return}u&&(t?.getDistanceFromEnd()??0)>G3&&(j(a,!1),_())}function b(){j(a,!1),_()}function x(e){f||(u=e?.scrollAwayIntent??!!e?.disableFollowImmediately,e?.disableFollowImmediately&&b(),m(),d=setTimeout(()=>{u=!1,d=void 0},VEe),requestAnimationFrame(()=>y(e?.viewport)))}function S(){let e=I(r);e&&(j(a,!0),e.getDistanceFromEnd()<=BEe?v({behavior:`smooth`}):ee())}function ee(){_(),j(a,!0);let e=0,t=()=>{l=void 0,e+=1;let n=I(r);if(!n){e<U3&&(l=requestAnimationFrame(t));return}v({behavior:`instant`}),!n.isAtEnd(W3)&&e<U3&&(l=requestAnimationFrame(t))};l=requestAnimationFrame(t)}return sr(()=>{if(!I(i))return;let e=I(r)?.getViewportElement();e&&!q3(e,W3)||j(a,!0)}),sr(()=>{let t=e.active?.()??!0,n=e.conversationId(),r=e.contentReady(),i=t&&!s;if(s=t,n!==o&&(o=n,c=!1,j(a,!0),_()),!t){_();return}if(!(!e.conversationOpen()||!n||!r)){if(!c){c=!0,Zr().then(ee);return}i&&I(a)&&Zr().then(ee)}}),sr(()=>{let r=I(t),i=e.active?.()??!0;if(!r||typeof ResizeObserver>`u`)return;let a=()=>{j(n,i?r.offsetHeight:0,!0)};a();let o=new ResizeObserver(a);return o.observe(r),()=>o.disconnect()}),sr(()=>{let e=I(r)?.getViewportElement();if(!e)return;let t=e.scrollTop,n=!1,i=()=>{let r=e.scrollTop,i=r-t;if(t=r,f)return;let o=q3(e,W3);if(o){j(a,!0);return}zEe({atEnd:o,scrollDelta:i,userScrollAwayIntent:u,scrollbarPointerActive:n,epsilon:UEe})&&b()},o=t=>{n=KEe(t,e),n&&x({disableFollowImmediately:!0,viewport:e})},s=()=>{n&&x({disableFollowImmediately:!0,viewport:e})},c=()=>{n&&q3(e,W3)&&j(a,!0),n=!1},l=t=>{let n=t.deltaY<0;x({disableFollowImmediately:n,scrollAwayIntent:n,viewport:e})},d=()=>{x({disableFollowImmediately:!0,viewport:e})},p=t=>{if(!WEe.has(t.key))return;let n=GEe.has(t.key)||t.key===` `&&t.shiftKey;x({disableFollowImmediately:n,scrollAwayIntent:n,viewport:e})};return e.addEventListener(`scroll`,i,{passive:!0}),e.addEventListener(`wheel`,l,{passive:!0}),e.addEventListener(`touchmove`,d,{passive:!0}),e.addEventListener(`pointerdown`,o,{passive:!0}),e.addEventListener(`pointermove`,s,{passive:!0}),e.addEventListener(`pointerup`,c,{passive:!0}),e.addEventListener(`pointerleave`,c,{passive:!0}),e.addEventListener(`keydown`,p),()=>{e.removeEventListener(`scroll`,i),e.removeEventListener(`wheel`,l),e.removeEventListener(`touchmove`,d),e.removeEventListener(`pointerdown`,o),e.removeEventListener(`pointermove`,s),e.removeEventListener(`pointerup`,c),e.removeEventListener(`pointerleave`,c),e.removeEventListener(`keydown`,p)}}),sr(()=>()=>{_(),m(),h(),u=!1,f=!1}),{get composerWrapEl(){return I(t)},set composerWrapEl(e){j(t,e,!0)},get composerHeight(){return I(n)},get controller(){return I(r)},set controller(e){j(r,e,!0)},get atEnd(){return I(i)},set atEnd(e){j(i,e,!0)},get followBottom(){return I(a)},scrollToEnd:v,jumpToBottom:S}}var JEe=L(`<div class="scroll-bottom-button-wrap svelte-x6qg8k"><!></div>`),YEe=L(`<div class="transcript svelte-x6qg8k" role="log" aria-label="Conversation transcript" aria-live="polite"><!></div> <!> <div class="composer-wrap svelte-x6qg8k"><!></div>`,1),XEe=L(`<div class="empty-center svelte-x6qg8k"><div class="prompt-line svelte-x6qg8k" aria-label="Nerve prompt"><span class="prompt-sigil svelte-x6qg8k">nerve</span> <span class="prompt-arrow svelte-x6qg8k">❯</span> <span class="prompt-caret svelte-x6qg8k" aria-hidden="true"></span></div> <span class="prompt-hint svelte-x6qg8k">Open a conversation or start a new one.</span> <!></div>`),ZEe=L(`<section class="conversation-pane svelte-x6qg8k"><!></section>`);function QEe(e,t){D(t,!0);let n=q(t,`pendingConversationActive`,3,!1),r=q(t,`approvals`,19,()=>[]),i=q(t,`active`,3,!0),a=q(t,`transcript`,19,()=>[]),o=q(t,`toolCalls`,19,()=>[]),s=q(t,`treeNodes`,19,()=>[]),c=q(t,`streamingText`,3,``),l=q(t,`queuedPrompts`,19,()=>[]),u=q(t,`live`,3,!1),d=q(t,`sending`,3,!1),f=q(t,`composerText`,3,``),p=q(t,`models`,19,()=>[]),m=q(t,`selectedModelKey`,3,``),h=q(t,`planReviewModels`,19,()=>[]),g=q(t,`planReviewModelKey`,3,``),_=q(t,`planReviewThinkingLevel`,3,`off`),v=q(t,`contextWindow`,3,0),y=q(t,`composerFocusToken`,3,0),b=q(t,`composerEscapeToken`,3,0),x=q(t,`micShortcutToken`,3,0),S=q(t,`thinkingLevel`,3,`off`),ee=q(t,`mode`,3,`coding`),C=q(t,`permissionLevel`,3,`autonomous`),te=q(t,`slashCompletions`,19,()=>[]),ne=q(t,`gitSuggestions`,19,()=>[]),re=k(()=>!!(t.activeConversation||n())),ie=k(()=>t.activeProject?CE(t.activeProject.dir,t.homeDir):void 0),ae=k(()=>XE(a(),o())),oe=k(()=>$E(t.liveState,I(ae).context)),w=k(()=>QE(I(ae).items,t.liveState)),se=k(()=>[...I(w),...I(oe)]),ce=k(()=>t.liveState?.compaction?.state===`running`),le=k(()=>new Map(s().map(e=>[e.entry.id,e.entry]))),ue=k(()=>new Map(s().map(e=>[e.entry.id,e.entry.parentEntryId]))),de=k(()=>I(se).at(-1)?.key),fe=k(()=>I(oe).length>0||o().some(e=>e.status===`running`)),pe=k(()=>t.activeConversation?.id??(n()?t.activePendingConversation?.id??`pending`:void 0)),me=qEe({active:()=>i(),conversationOpen:()=>I(re),conversationId:()=>I(pe),contentReady:()=>I(se).length>0});async function he(e,t=`message`){try{await bE(e),cd.success(`Copied ${t}`)}catch{cd.error(`Could not copy to clipboard`)}}function ge(e){let n=e.split(`
|
|
134
|
-
`).map(e=>`> ${e}`).join(`
|
|
135
|
-
`),r=f()?`${f()}\n\n`:``;t.onComposerChange?.(`${r}${n}\n\n`)}function _e(e){return LEe(e,{treeEntriesById:I(le),parentEntryIdById:I(ue),copyText:he,quoteInComposer:ge,onNavigateToEntry:t.onNavigateToEntry,onEditEntry:t.onEditEntry,onOpenHistory:t.onOpenHistory})}function ve(e,n){return REe(e,n,{copyText:he,quoteInComposer:ge,onNavigateToEntry:t.onNavigateToEntry,onEditEntry:t.onEditEntry,onOpenHistory:t.onOpenHistory})}var ye=ZEe(),be=M(ye),xe=e=>{var a=YEe(),o=N(a),s=M(o);{let e=k(()=>i()?me.followBottom:!1);OEe(s,{paddingEnd:18,get heightCacheKey(){return I(pe)},get timeline(){return I(se)},get streamingText(){return c()},get sending(){return d()},get hasLiveTimelineNodes(){return I(fe)},get queuedPrompts(){return l()},get followBottom(){return I(e)},get activeProject(){return t.activeProject},get activeProjectLabel(){return I(ie)},get pendingUserQuestion(){return t.pendingUserQuestion},get pendingPlanReview(){return t.pendingPlanReview},get active(){return i()},get planReviewModels(){return h()},get planReviewModelKey(){return g()},get planReviewThinkingLevel(){return _()},get lastTimelineKey(){return I(de)},get onOpenFile(){return t.onOpenFile},get onAnswerUserQuestion(){return t.onAnswerUserQuestion},get onDismissUserQuestion(){return t.onDismissUserQuestion},get onAcceptPlanReview(){return t.onAcceptPlanReview},get onAcceptPlanReviewInNewChat(){return t.onAcceptPlanReviewInNewChat},get onRejectPlanReview(){return t.onRejectPlanReview},get onContinueFromFailure(){return t.onContinueFromFailure},messageMenu:_e,toolMenu:ve,get controller(){return me.controller},set controller(e){me.controller=e},get atEnd(){return me.atEnd},set atEnd(e){me.atEnd=e}})}T(o);var re=P(o,2),ae=e=>{var t=JEe();Ml(M(t),{class:`rounded-full`,variant:`secondary`,size:`icon-sm`,ariaLabel:`Scroll to latest`,title:`Scroll to latest`,onclick:()=>me.jumpToBottom(),children:(e,t)=>{yE(e,{size:16,strokeWidth:2.4})},$$slots:{default:!0}}),T(t),F(()=>aa(t,`bottom: ${me.composerHeight+8}px;`)),z(e,t)};V(re,e=>{i()&&!me.atEnd&&me.composerHeight>0&&e(ae)});var oe=P(re,2);Zpe(M(oe),{get text(){return f()},get activeProject(){return t.activeProject},get activeConversation(){return t.activeConversation},get activePendingConversation(){return t.activePendingConversation},get pendingConversationActive(){return n()},get approvals(){return r()},get pendingUserQuestion(){return t.pendingUserQuestion},get pendingPlanReview(){return t.pendingPlanReview},get interactive(){return i()},get live(){return u()},get sending(){return d()},get compacting(){return I(ce)},get models(){return p()},get selectedModelKey(){return m()},get contextUsage(){return t.contextUsage},get contextWindow(){return v()},get focusToken(){return y()},get composerEscapeToken(){return b()},get micShortcutToken(){return x()},get thinkingLevel(){return S()},get mode(){return ee()},get permissionLevel(){return C()},get slashCompletions(){return te()},get fileCompletions(){return t.fileCompletions},get gitSuggestions(){return ne()},get onSendGitSuggestion(){return t.onSendGitSuggestion},get onDraftGitSuggestion(){return t.onDraftGitSuggestion},get onChange(){return t.onComposerChange},get onSubmit(){return t.onSubmit},get onAbort(){return t.onAbort},get onModelChange(){return t.onModelChange},get onThinkingLevelChange(){return t.onThinkingLevelChange},get onModeChange(){return t.onModeChange},get onPermissionChange(){return t.onPermissionChange},get onGrantApproval(){return t.onGrantApproval},get onDenyApproval(){return t.onDenyApproval}}),T(oe),Aa(oe,e=>me.composerWrapEl=e,()=>me?.composerWrapEl),z(e,a)},Se=e=>{var n=XEe();Ml(P(M(n),4),{class:`empty-action`,variant:`ghost`,size:`sm`,get onclick(){return t.onOpenProject},children:(e,t)=>{E(),z(e,ki(`New chat`))},$$slots:{default:!0}}),T(n),z(e,n)};V(be,e=>{I(re)?e(xe):e(Se,-1)}),T(ye),z(e,ye),O()}var J3=In({focusToken:0,escapeToken:0,micToken:0,historyDialogOpen:!1});function Y3(){J3.focusToken+=1}function $Ee(){J3.escapeToken+=1}function eDe(){J3.micToken+=1}function tDe(){J3.historyDialogOpen=!0}var X3=new Co({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:1}}}),Z3={clientConfig:[`client-config`],workspace:[`workspace`],slashCompletions:[`completions`,`slash`],fileCompletions:(e,t)=>[`completions`,`files`,e??`none`,t]};function nDe(e,t={}){if(!e)return{messages:[],toolDrafts:[],toolOutputByToolCallId:{}};let n=new Set(t.excludeLiveMessageIds??[]),r=e.turns.map(e=>({...e,messages:e.messages.filter(e=>!n.has(e.liveMessageId))})),i=r.flatMap(e=>e.messages.flatMap(e=>e.blocks.flatMap(t=>t.kind===`tool_call_draft`?[]:[{id:`live:${e.liveMessageId}:${t.kind}:${t.contentIndex}`,role:`assistant`,displayKind:t.kind===`thinking`?`thinking`:`message`,text:t.text,createdAt:e.startedAt,contentIndex:t.contentIndex,live:!t.done,done:t.done,redacted:t.redacted}]))),a=r.flatMap(t=>t.messages.flatMap(t=>t.blocks.flatMap(n=>n.kind===`tool_call_draft`?[{kind:`tool_call_draft`,key:`live:${t.liveMessageId}:tool-draft:${n.contentIndex}`,runId:e.runId,conversationId:e.conversationId,contentIndex:n.contentIndex,providerToolCallId:n.providerToolCallId,toolName:n.toolName,argsText:n.argsText,args:n.args,progress:n.progress,done:n.done,createdAt:t.startedAt,updatedAt:t.startedAt}]:[])));return{runId:e.runId,messages:i,toolDrafts:a,toolOutputByToolCallId:e.toolOutputsByToolCallId,runStatus:e.retry?{conversationId:e.conversationId,agentId:e.agentId,runId:e.runId,state:`retrying`,...e.retry}:void 0,hiddenEntryIds:e.retry?.failedEntryId?[e.retry.failedEntryId]:void 0}}function Q3(e){return e.messages.filter(e=>e.displayKind!==`thinking`).sort((e,t)=>(e.contentIndex??0)-(t.contentIndex??0)).map(e=>e.text).join(`
|
|
136
|
-
`)}var rDe=/^\[Tool call:[\s\S]*\]$/;function $3(e){return typeof e==`string`&&e.length>0?e:void 0}function e6(e){return typeof e==`string`&&e.startsWith(`tool_`)?e:void 0}function iDe(e){return Array.isArray(e)?e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e,n=typeof t.text==`string`?t.text:``,r=t.redacted===!0;return n.length>0||r?[{text:n,redacted:r}]:[]}):[]}function t6(e){return e.details&&typeof e.details==`object`?e.details:void 0}function n6(e){let t=t6(e),n=t?.details&&typeof t.details==`object`?t.details:void 0,r=n?.toolCall&&typeof n.toolCall==`object`?n.toolCall:void 0;return{toolCallId:$3(t?.toolCallId),toolRecordId:e6(t?.toolRecordId)??e6(r?.id),toolName:$3(t?.toolName),isToolError:t?.isError===!0}}function r6(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function aDe(e){return e===`manual`||e===`threshold`||e===`overflow`?e:void 0}function oDe(e){if(e.kind!==`compaction`)return;let t=t6(e),n=t?.policy&&typeof t.policy==`object`?t.policy:void 0,r=r6(t?.tokensAfter),i=r6(t?.freedTokens)??(typeof e.tokensBefore==`number`&&typeof r==`number`?Math.max(0,e.tokensBefore-r):void 0);return{id:e.id,state:`completed`,reason:aDe(t?.reason),entryId:e.id,conversationId:e.conversationId,agentId:$3(e.agentId),runId:$3(e.runId),text:e.text,summary:e.summary??e.text,tokensBefore:e.tokensBefore,tokensAfter:r,freedTokens:i,contextWindow:r6(n?.contextWindow),thresholdTokens:r6(n?.thresholdTokens),triggerReserveTokens:r6(n?.triggerReserveTokens),keepRecentTokens:r6(n?.keepRecentTokens),firstKeptEntryId:$3(e.firstKeptEntryId),details:e.details,createdAt:e.createdAt,completedAt:e.createdAt}}function sDe(e){if(e.kind!==`run_status`)return;let t=t6(e);if(t?.type!==`agent_run_retry_status`)return;let n=t.state;if(!(n!==`retrying`&&n!==`retry_exhausted`&&n!==`failed`&&n!==`interrupted`))return{entryId:e.id,conversationId:e.conversationId,agentId:$3(e.agentId),runId:$3(t.runId)??e.runId,state:n,failedEntryId:$3(t.failedEntryId),attempt:typeof t.attempt==`number`?t.attempt:void 0,maxRetries:typeof t.maxRetries==`number`?t.maxRetries:void 0,delayMs:typeof t.delayMs==`number`?t.delayMs:void 0,retryAt:$3(t.retryAt),errorMessage:$3(t.errorMessage),retryable:t.retryable===!0,createdAt:e.createdAt}}function cDe(e){if(e.kind!==`task_event`)return;let t=t6(e);if(t?.type===`task_event`)return{entryId:e.id,conversationId:e.conversationId,agentId:$3(e.agentId),runId:$3(e.runId),taskId:$3(t.taskId),taskName:$3(t.taskName),groupId:$3(t.groupId),groupName:$3(t.groupName),event:$3(t.event),status:$3(t.status),exitCode:r6(t.exitCode),signal:$3(t.signal),commandPreview:$3(t.commandPreview),nextCursor:r6(t.nextCursor),createdAt:e.createdAt}}function i6(e){let t=oDe(e);if(t)return[{id:e.id,runId:e.runId,role:`system`,kind:e.kind,displayKind:`message`,text:e.summary??e.text,createdAt:e.createdAt,compaction:t}];let n=sDe(e);if(n)return[{id:e.id,role:`system`,kind:e.kind,displayKind:`message`,text:e.text,createdAt:e.createdAt,runStatus:n}];let r=cDe(e);if(r)return[{id:e.id,runId:e.runId,role:`system`,kind:e.kind,displayKind:`message`,text:e.text,createdAt:e.createdAt,taskEvent:r}];let i=t6(e),a=n6(e),o=i?.stopReason===`error`||i?.stopReason===`aborted`?i.stopReason:void 0,s=$3(i?.errorMessage),c=[],l=iDe(i?.thinkingBlocks);for(let[t,n]of l.entries())c.push({id:`${e.id}:thinking:${t}`,runId:e.runId,role:`assistant`,kind:e.kind,displayKind:`thinking`,text:n.text,redacted:n.redacted,createdAt:e.createdAt,stopReason:o,errorMessage:s});return(!(e.role===`assistant`&&rDe.test(e.text.trim()))||e.role!==`assistant`)&&c.push({id:e.id,runId:e.runId,role:e.role,kind:e.kind,displayKind:`message`,text:e.text,createdAt:e.createdAt,usage:e.usage,stopReason:o,errorMessage:s,...a}),c}function lDe(e){if(e.role===`user`||e.role===`assistant`||e.kind!==`message`)return!0;let t=n6(e);return!!(t.toolCallId||t.toolRecordId)}function uDe(e){return e.filter(lDe).flatMap(i6)}function dDe(e){return Y.agents.find(t=>t.id===e.activeAgentId||t.conversationId===e.id)}async function fDe(e){return Y.projects.find(t=>t.id===e.projectId)??(await jw(`/api/projects/${Dw(e.projectId)}`)).project}async function pDe(e){TT.conversationId=e.id,TT.projectId=e.projectId;let t=dDe(e);TT.agentId=e.activeAgentId??t?.id,TT.entryId=e.activeEntryId,ET.projectDir=(await fDe(e)).dir,t?.model&&(kT.selectedModelKey=aE(t.model)),kT.selectedThinkingLevel=t?.thinkingLevel??`off`,kT.selectedMode=t?.mode??e.mode,kT.selectedPermissionLevel=t?.permissionLevel??e.permissionLevel}async function a6(e){let t=sA(e);t.loading=!0;try{let n=await zw(e);t.activeEntryId=n.tree.activeEntryId,t.activeEntryIds=n.activeEntryIds,t.transcript=uDe(n.entries),t.toolCalls=n.toolCalls,t.treeNodes=n.tree.nodes,t.activeRun=n.activeRun,t.queuedPrompts=n.activeRun?.queuedPrompts??[],t.contextUsage=n.contextUsage,t.cursorSeq=n.cursorSeq,Y.conversations=Y.conversations.map(t=>t.id===e?n.conversation:t);let r=new Set(n.entries.flatMap(e=>e.role===`assistant`&&e.liveMessageId?[e.liveMessageId]:[]));t.live=nDe(n.activeRun,{excludeLiveMessageIds:r}),t.streamingText=Q3(t.live),t.sending=!!n.activeRun,TT.conversationId===e&&(TT.entryId=n.tree.activeEntryId)}finally{t.loading=!1}}function mDe(e){Y.conversations=[e,...Y.conversations.filter(t=>t.id!==e.id)]}function hDe(e){Y.agents=[e,...Y.agents.filter(t=>t.id!==e.id)]}async function o6(e){let t=Y.conversations.find(t=>t.id===e)??(await jw(`/api/conversations/${Dw(e)}`)).conversation;Gue(t.id),kT.activeConversationTabId=t.id,JT({kind:`conversation`,id:t.id}),cA(),await pDe(t),await a6(t.id),Y.error=sA(t.id).error}async function gDe(){let e=Uue(),t=Wue(e.tabIds,Y.conversations);UT(t.map(e=>({kind:`conversation`,id:e})));for(let e of t)sA(e);let n=e.activeId&&t.includes(e.activeId)?e.activeId:t[0];kT.activeConversationTabId=n,cA(),n&&await o6(n)}async function _De(e){let t=kT.openConversationTabIds,n=t.indexOf(e);if(n===-1)return;let r={kind:`conversation`,id:e},i=KT(r),a=t.filter(t=>t!==e),o=a[n]??a[n-1];await TA.cancelIfTarget({kind:`conversation`,id:e}),qT(r),delete kT.conversationViews[$T(e)];let s=Y.activeCenterTab?.kind===`conversation`&&Y.activeCenterTab.id===e;kT.activeConversationTabId===e&&(kT.activeConversationTabId=o),TT.conversationId===e&&!o&&fA(),cA(),s&&await XT(i)}async function vDe(e){if(!kT.pendingConversations[eE(e)])return;let t={kind:`pending-conversation`,id:e},n=KT(t),r=Y.activeCenterTab?.kind===`pending-conversation`&&Y.activeCenterTab.id===e;await TA.cancelIfTarget({kind:`pending-conversation`,id:e}),qT(t),delete kT.pendingConversations[eE(e)],r&&(fA(),await XT(n)),cA()}async function s6(e){let t=new Set(e),n=TT.conversationId?t.has(TT.conversationId):!1;await TA.cancelIfTargets(e.map(e=>({kind:`conversation`,id:e}))),UT(Y.openCenterTabs.filter(e=>e.kind!==`conversation`||!t.has(e.id)));for(let e of t)delete kT.conversationViews[$T(e)];if(!n){cA();return}let r=kT.openConversationTabIds[0];if(r){kT.activeConversationTabId=r,cA(),await o6(r);return}fA(),await XT(Y.openCenterTabs[0]),cA()}async function yDe(e){await Mw(`/api/approvals/${Dw(e)}/grant`,{}),Y.approvals=await $k(),cd.success(`Approval granted`)}async function bDe(e){await Mw(`/api/approvals/${Dw(e)}/deny`,{note:`Denied from UI.`}),Y.approvals=await $k(),cd.message(`Approval denied`)}async function xDe(e,t={}){await Pue(e,t),Y.planReviews=await tA(),await S6(),TT.conversationId&&await a6(TT.conversationId),cd.success(`Plan accepted`)}async function SDe(e,t={}){let{conversation:n}=await Fue(e,t);Y.planReviews=await tA(),await S6(),await o6(n.id),cd.success(`Plan accepted in new chat`)}async function CDe(e){await Iue(e,`Rejected from UI.`),Y.planReviews=await tA(),await S6(),TT.conversationId&&await a6(TT.conversationId),cd.message(`Plan rejected`)}async function wDe(e,t){let n=t.trim();n&&(await Lue(e,n),Y.userQuestions=await eA(),cd.success(`Reply sent`))}async function TDe(e){await Rue(e,`Dismissed from UI.`),Y.userQuestions=await eA(),cd.message(`Question dismissed`)}function EDe(e){let t=Kue(),n=NT.settingsDraft?xZ(NT.settingsDraft,NT.models,NT.authProviders):{selectedModelKey:kT.selectedModelKey,selectedThinkingLevel:kT.selectedThinkingLevel,selectedMode:kT.selectedMode,selectedPermissionLevel:kT.selectedPermissionLevel};kT.pendingConversations[eE(t)]={id:t,projectId:e.id,projectDir:e.dir,title:`New Conversation`,composerText:``,selectedModelKey:n.selectedModelKey,thinkingLevel:n.selectedThinkingLevel,mode:n.selectedMode,permissionLevel:n.selectedPermissionLevel,sending:!1,createdAt:new Date().toISOString()},WT({kind:`pending-conversation`,id:t}),c6(t)}function c6(e){let t=kT.pendingConversations[eE(e)];t&&(JT({kind:`pending-conversation`,id:t.id}),kT.activeConversationTabId=void 0,DT(),TT.projectId=t.projectId,ET.projectDir=t.projectDir,kT.selectedModelKey=t.selectedModelKey,kT.selectedThinkingLevel=t.thinkingLevel,kT.selectedMode=t.mode,kT.selectedPermissionLevel=t.permissionLevel,dA(),Y.error=t.error)}function DDe(){return Y.agents.find(e=>e.id===TT.agentId)}function l6(){return oE(kT.selectedModelKey)}function u6(){return NT.models.find(e=>aE(e)===kT.selectedModelKey)}function d6(e){let t=NT.settingsDraft;t?.rememberLastAgentSelection&&(t.lastAgentSelection={...t.lastAgentSelection,...e},BZ({lastAgentSelection:e},{immediate:!0}))}function f6(){let e=Y.activeCenterTab;if(e?.kind===`pending-conversation`)return kT.pendingConversations[eE(e.id)]}function p6(){return yZ(kT.selectedThinkingLevel,u6())}async function ODe(e){kT.selectedModelKey=e;let t=yZ(kT.selectedThinkingLevel,u6());kT.selectedThinkingLevel=t;let n=f6();n&&(n.selectedModelKey=e,n.thinkingLevel=t);let r=l6();if(d6({...r?{model:r}:{},thinkingLevel:t}),!TT.agentId)return;let i=await Hk(TT.agentId,{model:r??null,thinkingLevel:t});if(kT.selectedThinkingLevel=i.thinkingLevel,Y.agents=Y.agents.map(e=>e.id===i.id?i:e),TT.conversationId){let e=await Bw(TT.conversationId).catch(()=>void 0),t=kT.conversationViews[$T(TT.conversationId)];e&&t&&(t.contextUsage=e)}}async function m6(e){let t=yZ(e,u6());kT.selectedThinkingLevel=t;let n=f6();if(n&&(n.thinkingLevel=t),d6({thinkingLevel:t}),!TT.agentId)return;let r=await Hk(TT.agentId,{thinkingLevel:t});kT.selectedThinkingLevel=r.thinkingLevel,Y.agents=Y.agents.map(e=>e.id===r.id?r:e)}async function h6(e){kT.selectedMode=e;let t=f6();if(t&&(t.mode=e),d6({mode:e}),!TT.agentId)return;let n=await Hk(TT.agentId,{mode:e});Y.agents=Y.agents.map(e=>e.id===n.id?n:e)}async function g6(e){kT.selectedPermissionLevel=e;let t=f6();if(t&&(t.permissionLevel=e),d6({permissionLevel:e}),!TT.agentId)return;let n=await Hk(TT.agentId,{permissionLevel:e});Y.agents=Y.agents.map(e=>e.id===n.id?n:e)}function kDe(e){let t=l6(),n=p6();return{desired:t,thinkingLevel:n,needsModel:t&&aE(e?.model??{provider:``,modelId:``})!==aE(t),needsMode:e?.mode!==kT.selectedMode,needsPermission:e?.permissionLevel!==kT.selectedPermissionLevel,needsThinking:e?.thinkingLevel!==n}}function _6(e){let t=uA();if(t){t.composerText=e;return}if(!TT.conversationId){ET.text=e;return}sA(TT.conversationId).composerText=e}async function ADe(){if(TT.agentId){let{desired:e,thinkingLevel:t,needsModel:n,needsMode:r,needsPermission:i,needsThinking:a}=kDe(DDe());if(n||r||i||a){let n=await Hk(TT.agentId,{model:e??null,thinkingLevel:t,mode:kT.selectedMode,permissionLevel:kT.selectedPermissionLevel}).catch(()=>void 0);n&&(kT.selectedThinkingLevel=n.thinkingLevel,Y.agents=Y.agents.map(e=>e.id===n.id?n:e))}return TT.agentId}if(TT.projectId&&TT.conversationId){let{agent:e}=await Mw(`/api/agents`,{projectId:TT.projectId,conversationId:TT.conversationId,model:l6(),thinkingLevel:p6(),mode:kT.selectedMode,permissionLevel:kT.selectedPermissionLevel});return TT.agentId=e.id,await X3.invalidateQueries({queryKey:Z3.workspace}),await S6(),e.id}throw Y.projectPickerOpen=!0,Error(`Select a project directory before starting a conversation.`)}function v6(){return gE(NT.models,NT.authProviders,NT.settingsDraft?.scopedModels).length>0}function y6(e,t){cd.error(e,{description:t})}async function jDe(e,t,n={}){let r=n.clearComposer??!0;if(!v6()){kZ();let t=`Configure a model provider or adjust Scoped Models in Settings before prompting.`;e.error=t,Y.error=t,y6(`No usable model configured`,t);return}e.selectedModelKey=kT.selectedModelKey,e.thinkingLevel=p6(),e.mode=kT.selectedMode,e.permissionLevel=kT.selectedPermissionLevel,e.sending=!0,e.error=void 0,Y.error=void 0;let i,a;try{let{conversation:n}=await Mw(`/api/conversations`,{projectId:e.projectId,title:Ece(t),mode:e.mode,permissionLevel:e.permissionLevel});a=n.id;let{agent:o}=await Mw(`/api/agents`,{projectId:e.projectId,conversationId:n.id,model:l6(),thinkingLevel:e.thinkingLevel,mode:e.mode,permissionLevel:e.permissionLevel});mDe(n),hDe(o),GT({kind:`pending-conversation`,id:e.id},{kind:`conversation`,id:n.id}),kT.activeConversationTabId=n.id,TT.projectId=n.projectId,TT.conversationId=n.id,TT.entryId=n.activeEntryId,TT.agentId=o.id,ET.projectDir=e.projectDir;let s=r?``:e.composerText;delete kT.pendingConversations[eE(e.id)],i=sA(n.id),i.sending=!0,i.error=void 0,i.streamingText=``,i.live={messages:[],toolDrafts:[],toolOutputByToolCallId:{}},i.transcript=ak(t)?[]:[{role:`user`,text:t,optimistic:!0}],i.composerText=s,Y.error=void 0,r&&(ET.text=``),cA(),await X3.invalidateQueries({queryKey:Z3.workspace}),await S6(),await Mw(`/api/agents/${Dw(o.id)}/prompt`,{text:t})}catch(t){let n=t instanceof Error?t.message:String(t);i?(i.error=n,i.sending=!1):(a&&await Hw(a).catch(()=>void 0),e.error=n,e.sending=!1),Y.error=n,y6(`Prompt failed`,n)}}async function b6(e,t={}){let n=t.clearComposer??!0,r=uA(),i=TT.conversationId?sA(TT.conversationId):void 0,a=e.trim();if(!a||r?.sending)return;if(r){await jDe(r,a,{clearComposer:n});return}if(!TT.projectId||!TT.conversationId||!i){Y.projectPickerOpen=!0;let e=`Select a project directory before starting a conversation.`;Y.error=e,y6(`Select a project directory`,e);return}if(!v6()){kZ();let e=`Configure a model provider or adjust Scoped Models in Settings before prompting.`;i.error=e,Y.error=e,y6(`No usable model configured`,e);return}if(i.live.compaction?.state===`running`){y6(`Compaction in progress`,`Wait for context compaction to finish before sending another prompt.`);return}let o=!!i.sending;i.error=void 0,Y.error=void 0,o||(i.sending=!0,i.streamingText=``,i.live={messages:[],toolDrafts:[],toolOutputByToolCallId:{}});try{let e=await ADe();if(n&&(i.composerText=``,ET.text=``),o){await Mw(`/api/agents/${Dw(e)}/prompt`,{text:a,behavior:`steer`});return}ak(a)||(i.transcript=[...i.transcript,{role:`user`,text:a,optimistic:!0}]),await Mw(`/api/agents/${Dw(e)}/prompt`,{text:a})}catch(e){let t=e instanceof Error?e.message:String(e);i.error=t,Y.error=t,o||(i.sending=!1),y6(`Prompt failed`,t)}}async function MDe(){let e=uA(),t=TT.conversationId?sA(TT.conversationId):void 0,n=(e?.composerText??t?.composerText??ET.text).trim();if(!(!n||e?.sending)){if(n===`/abort`){e&&(e.composerText=``),t&&(t.composerText=``),ET.text=``,await O6();return}await b6(n,{clearComposer:!0})}}function x6(e,t){return!t||e.updatedAt>=t.updatedAt}function NDe(e,t){let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>{let t=n.get(e.id);return!t||x6(e,t)?e:t})}function PDe(e,t){let n=t.findIndex(t=>t.id===e.id);if(n===-1)return[...t,e];let r=t[n];return x6(e,r)?t.map(t=>t.id===e.id?e:t):t}async function S6(){let e=await X3.fetchQuery({queryKey:Z3.workspace,queryFn:zue}),t=NDe(e.agents,Y.agents);Y.projects=e.projects,Y.conversations=e.conversations,Y.agents=t,PT.tasks=e.tasks,FDe(t,e.conversations);let n=new Set(e.conversations.map(e=>e.id)),r=kT.openConversationTabIds.filter(e=>!n.has(e));r.length&&await s6(r),PT.selectedTaskId=PT.selectedTaskId??PT.tasks[0]?.id;let[i,a,o]=await Promise.all([$k(),eA(),tA()]);Y.approvals=i,Y.userQuestions=a,Y.planReviews=o,PT.selectedTaskId&&(PT.taskLogs=await Qk(PT.selectedTaskId))}function FDe(e,t){let n=TT.agentId?e.find(e=>e.id===TT.agentId):void 0;if(n){n.model&&(kT.selectedModelKey=aE(n.model)),kT.selectedThinkingLevel=n.thinkingLevel,kT.selectedMode=n.mode,kT.selectedPermissionLevel=n.permissionLevel;return}let r=TT.conversationId?t.find(e=>e.id===TT.conversationId):void 0;r&&(kT.selectedMode=r.mode,kT.selectedPermissionLevel=r.permissionLevel)}async function IDe(){kT.slashCompletions=await X3.fetchQuery({queryKey:Z3.slashCompletions,queryFn:rue})}function LDe(e){if(!TT.conversationId)return;let t=e===`json`?`export`:`export.${e}`;return`/api/conversations/${Dw(TT.conversationId)}/${t}`}function RDe(){if(TT.agentId)return`/api/agents/${Dw(TT.agentId)}/system-prompt`}async function zDe(e){return X3.fetchQuery({queryKey:Z3.fileCompletions(TT.projectId,e),queryFn:()=>iue(TT.projectId,e),staleTime:2e3})}function C6(){let e=Y.projects.find(e=>e.id===TT.projectId);if(!e){Y.projectPickerOpen=!0;return}E6(e.dir)}function w6(e){E6(e)}async function T6(e){try{let t=Y.conversations.filter(t=>t.projectId===e).map(e=>e.id);await Sue(e),await s6(t),await X3.invalidateQueries({queryKey:Z3.workspace}),await S6(),cd.success(`Project removed`)}catch(e){let t=e instanceof Error?e.message:String(e);Y.error=t,cd.error(`Could not remove project`,{description:t})}}async function BDe(e){try{await Hw(e),await s6([e]),await X3.invalidateQueries({queryKey:Z3.workspace}),await S6(),cd.success(`Conversation removed`)}catch(e){let t=e instanceof Error?e.message:String(e);Y.error=t,cd.error(`Could not remove conversation`,{description:t})}}async function VDe(e,t){try{await wue(e,t),cd.success(t===`vscode`?`Opening project in VS Code`:`Opening project in Zed`)}catch(e){let n=e instanceof Error?e.message:String(e);Y.error=n,cd.error(t===`vscode`?`Could not open VS Code`:`Could not open Zed`,{description:n})}}async function HDe(e,t){try{let n=await Cue(e,t);await s6(n.prunedConversationIds),await X3.invalidateQueries({queryKey:Z3.workspace}),await S6();let r=n.prunedConversationIds.length,i=n.skipped.length;cd.success(r===1?`Cleaned up 1 conversation`:`Cleaned up ${r} conversations`,i>0?{description:i===1?`Skipped 1 active conversation`:`Skipped ${i} active conversations`}:{})}catch(e){let t=e instanceof Error?e.message:String(e);Y.error=t,cd.error(`Could not clean up conversations`,{description:t})}}async function E6(e){Y.error=void 0;try{let{project:t}=await Mw(`/api/projects`,{dir:e});Y.projects=[t,...Y.projects.filter(e=>e.id!==t.id)],Y.projectPickerOpen=!1,EDe(t)}catch(e){let t=e instanceof Error?e.message:String(e);Y.error=t,cd.error(`Could not open project`,{description:t})}}async function D6(e,t=!1){if(!TT.conversationId)return;let n=TT.conversationId;await Mw(`/api/conversations/${Dw(n)}/navigate`,{activeEntryId:e??null,summarize:t}),await X3.invalidateQueries({queryKey:Z3.workspace}),await S6(),await o6(n)}async function UDe(){if(!TT.conversationId)return;let e=TT.conversationId,t=sA(e),n={id:`local:compaction:${e}:${Date.now()}`,state:`running`,reason:`manual`,conversationId:e,createdAt:new Date().toISOString()};t.live={...t.live,compaction:n},t.error=void 0;try{await Vw(e),t.live={...t.live,compaction:void 0},await X3.invalidateQueries({queryKey:Z3.workspace}),await S6(),await o6(e)}catch(e){let r=e instanceof Error?e.message:String(e);t.live={...t.live,compaction:{...n,state:`failed`,errorMessage:r}},cd.error(`Compaction failed`,{description:r})}}async function WDe(e){if(!TT.agentId||!TT.conversationId)return;let t=sA(TT.conversationId);t.sending=!0,t.error=void 0,Y.error=void 0;try{await Mw(`/api/agents/${Dw(TT.agentId)}/continue-from-failure`,{statusEntryId:e})}catch(e){let n=e instanceof Error?e.message:String(e);t.sending=!1,t.error=n,Y.error=n,cd.error(`Continue failed`,{description:n})}}async function O6(){if(!TT.agentId)return;let e=TT.conversationId?sA(TT.conversationId):void 0;await Mw(`/api/agents/${Dw(TT.agentId)}/abort`,{}),e&&(e.sending=!1,e.streamingText=``,e.live={messages:[],toolDrafts:[],toolOutputByToolCallId:{}},e.queuedPrompts=[])}var GDe=new Set([`.md`,`.markdown`,`.mdown`,`.mkd`]);function k6(e){if(!e)return!1;let t=e.split(/[?#]/,1)[0]?.toLowerCase()??``,n=t.lastIndexOf(`.`);return n===-1?!1:GDe.has(t.slice(n))}function A6(e){return k6(e)?`rendered`:`raw`}function KDe(e,t){return`${e}:${encodeURIComponent(t)}`}function j6(e){WT({kind:`file`,id:e})}async function M6(e){let t=AT.fileViews[tE(e)];if(t){t.loading=!0,t.error=void 0;try{t.content=await sue(t.projectId,t.path,t.line),t.path=t.content.path}catch(e){let n=e instanceof Error?e.message:String(e);t.error=n,cd.error(`Could not open file`,{description:n})}finally{t.loading=!1}}}async function qDe(e){let t=KDe(e.projectId,e.path),n=tE(t);j6(t),AT.fileViews[n]??={id:t,projectId:e.projectId,path:e.path,line:e.line,loading:!1},AT.fileViews[n].line=e.line,JT({kind:`file`,id:t}),await M6(t)}async function JDe(e){let t=AT.fileViews[tE(e)];t&&(j6(e),JT({kind:`file`,id:e}),!t.content&&!t.loading&&await M6(e))}async function N6(e){await M6(e)}function YDe(e){let t=AT.fileViews[tE(e)];t&&(t.displayMode=(t.displayMode??A6(t.content?.relativePath??t.path))===`raw`?`rendered`:`raw`)}function XDe(e){let t=AT.fileViews[tE(e)];t&&(t.wrapLines=!t.wrapLines)}function ZDe(e){let t={kind:`file`,id:e},n=Y.activeCenterTab?.kind===`file`&&Y.activeCenterTab.id===e,r=KT(t);qT(t),delete AT.fileViews[tE(e)],n&&XT(r)}var P6={tone:`neutral`,pulse:!1,busy:!1,needsUser:!1,source:`none`};function QDe(e,t){return t.find(t=>t.id===e.activeAgentId)??t.find(t=>t.conversationId===e.id)}function $De(e,t,n,r){return t.some(t=>t.conversationId===e&&t.status===`pending`)||n.some(t=>t.conversationId===e&&t.status===`pending`)||r.some(t=>t.conversationId===e&&t.status===`pending`)}function F6(e){let t=!!e.hasPendingHumanInput;return t||e.agent?.status===`awaiting_user`?{tone:`warn`,pulse:!1,label:`Needs user action`,busy:!1,needsUser:!0,source:t?`pending-input`:`agent`}:e.view?.live.compaction?.state===`running`?{tone:`running`,pulse:!0,label:`Compacting context`,busy:!0,needsUser:!1,source:`live-view`}:e.agent?.status===`running`||e.view?.sending||e.view?.activeRun?{tone:tT(e.agent?.mode??e.mode),pulse:!0,label:`Agent running`,busy:!0,needsUser:!1,source:e.agent?.status===`running`?`agent`:`live-view`}:e.agent?.status===`error`?{tone:`danger`,pulse:!1,label:`Agent error`,busy:!1,needsUser:!1,source:`agent`}:P6}function eOe(e){let t=Object.create(null);for(let n of e.conversations){let r=QDe(n,e.agents);t[n.id]=F6({conversationId:n.id,agent:r,mode:r?.mode??n.mode,view:e.views[$T(n.id)],hasPendingHumanInput:$De(n.id,e.approvals,e.userQuestions,e.planReviews)})}return t}function I6(e,t){return Y.activeCenterTab?.kind===e&&Y.activeCenterTab.id===t}function L6(){let e=Y.activeCenterTab;if(e?.kind===`pending-conversation`)return kT.pendingConversations[eE(e.id)]}function tOe(e){return[`starting`,`running`,`ready`,`stopping`].includes(e)}var R6={get status(){return Y.status},get connection(){return Y.connection},get error(){let e=TT.conversationId??kT.activeConversationTabId,t=e?kT.conversationViews[$T(e)]:void 0;return L6()?.error??t?.error??Y.error},get projects(){return Y.projects},get conversations(){return Y.conversations},get agents(){return Y.agents},get approvals(){return Y.approvals},get userQuestions(){return Y.userQuestions},get planReviews(){return Y.planReviews},get activeProject(){let e=L6()?.projectId??TT.projectId;return Y.projects.find(t=>t.id===e)},get activeConversation(){return Y.conversations.find(e=>e.id===TT.conversationId)},get activeAgent(){return Y.agents.find(e=>e.id===TT.agentId)},get conversationActivityById(){return eOe({conversations:Y.conversations,agents:Y.agents,views:kT.conversationViews,approvals:Y.approvals,userQuestions:Y.userQuestions,planReviews:Y.planReviews})},get openConversationTabs(){let e=[];for(let t of kT.openConversationTabIds){let n=Y.conversations.find(e=>e.id===t);if(!n)continue;let r=Y.projects.find(e=>e.id===n.projectId),i=Y.agents.find(e=>e.id===n.activeAgentId||e.conversationId===n.id),a=kT.conversationViews[$T(n.id)],o=this.conversationActivityById[n.id]??P6;e.push({kind:`conversation`,id:n.id,conversation:n,project:r,agent:i,active:I6(`conversation`,n.id),hasDraft:!!a?.composerText.trim(),sending:o.busy,activity:o,error:a?.error??(i?.status===`error`?`Agent error`:void 0)})}return e},get openPendingConversationTabs(){let e=[];for(let t of Y.openCenterTabs){if(t.kind!==`pending-conversation`)continue;let n=kT.pendingConversations[eE(t.id)];n&&e.push({kind:`pending-conversation`,id:n.id,title:n.title,project:Y.projects.find(e=>e.id===n.projectId),projectDir:n.projectDir,active:I6(`pending-conversation`,n.id),hasDraft:!!n.composerText.trim(),sending:n.sending,activity:n.sending?{tone:tT(n.mode),pulse:!0,label:`Agent running`,busy:!0,needsUser:!1,source:`live-view`}:P6,error:n.error})}return e},get openTaskTabs(){let e=[];for(let t of PT.openTaskTabIds){let n=PT.tasks.find(e=>e.id===t);e.push({kind:`task`,id:t,task:n,active:I6(`task`,t),sending:n?tOe(n.status):!1,error:n?n.status===`failed`?n.error??`Task failed`:void 0:`Task not found`})}return e},get openFileTabs(){return AT.openFileTabIds.map(e=>{let t=AT.fileViews[tE(e)],n=t?.content?.relativePath??t?.path;return{kind:`file`,id:e,file:t?.content,path:t?.path,relativePath:t?.content?.relativePath,displayMode:t?.displayMode??A6(n),wrapLines:!!t?.wrapLines,markdown:k6(n),active:I6(`file`,e),sending:!!t?.loading,error:t?.error}})},get openPrTabs(){return jT.openPrTabIds.map(e=>{let t=jT.prViews[nE(e)];return{kind:`pr`,id:e,number:t?.number??0,title:t?.detail?.title,checksStatus:t?.detail?.checks.status,isDraft:t?.detail?.isDraft,active:I6(`pr`,e),sending:!!t?.loading,error:t?.error}})},get openSettingsTabs(){return NT.settingsTabOpen?[{kind:`settings`,id:`settings`,active:I6(`settings`,`settings`),sending:!1,error:NT.settingsMessage}]:[]},get openAuthTabs(){return OT.authTabOpen?[{kind:`auth`,id:`auth`,active:I6(`auth`,`auth`),sending:!1}]:[]},get openLogsTabs(){return MT.logsTabOpen?[{kind:`logs`,id:`logs`,active:I6(`logs`,`logs`),sending:!1}]:[]},get openConversationTabIds(){let e=new Set;for(let t of Y.openCenterTabs)t.kind===`conversation`&&e.add(t.id);return e},get centerTabs(){let e=[];for(let t of Y.openCenterTabs)if(t.kind===`conversation`){let n=this.openConversationTabs.find(e=>e.id===t.id);n&&e.push(n)}else if(t.kind===`pending-conversation`){let n=this.openPendingConversationTabs.find(e=>e.id===t.id);n&&e.push(n)}else if(t.kind===`task`){let n=this.openTaskTabs.find(e=>e.id===t.id);n&&e.push(n)}else if(t.kind===`file`){let n=this.openFileTabs.find(e=>e.id===t.id);n&&e.push(n)}else if(t.kind===`pr`){let n=this.openPrTabs.find(e=>e.id===t.id);n&&e.push(n)}else t.kind===`settings`?e.push(...this.openSettingsTabs):t.kind===`auth`?e.push(...this.openAuthTabs):e.push(...this.openLogsTabs);return e},get activeCenterTab(){return Y.activeCenterTab}};function z6(e){return JSON.stringify({projectId:e.projectId,projectIsRepo:e.projectIsRepo,repos:e.repos.map(e=>({relativePath:e.relativePath,currentBranch:e.currentBranch,detached:e.detached,ahead:e.ahead,behind:e.behind,hasUpstream:e.hasUpstream,hasRemote:e.hasRemote,hasGithubRemote:e.hasGithubRemote,baseBranch:e.baseBranch,onBaseBranch:e.onBaseBranch,mergedToBase:e.mergedToBase,dirty:e.dirty,changeCount:e.changeCount})),github:e.github?{available:e.github.available,authenticated:e.github.authenticated}:void 0})}function nOe(e,t,n,r){return t?!e||e.projectId!==t?!0:n-e.loadedAt>=r:!1}function B6(e){return JSON.stringify({relativePath:e.relativePath,absDir:e.absDir,name:e.name,currentBranch:e.currentBranch,detached:e.detached,ahead:e.ahead,behind:e.behind,hasUpstream:e.hasUpstream,hasRemote:e.hasRemote,hasGithubRemote:e.hasGithubRemote,baseBranch:e.baseBranch,onBaseBranch:e.onBaseBranch,mergedToBase:e.mergedToBase,dirty:e.dirty,changeCount:e.changeCount})}function rOe(e){return{files:e.files,stagedCount:e.stagedCount,unstagedCount:e.unstagedCount,untrackedCount:e.untrackedCount,insertions:e.insertions,deletions:e.deletions}}function iOe(e){return JSON.stringify({counts:{staged:e.stagedCount,unstaged:e.unstagedCount,untracked:e.untrackedCount,insertions:e.insertions,deletions:e.deletions},files:e.files.map(e=>({path:e.path,renamedFrom:e.renamedFrom,index:e.index,worktree:e.worktree,staged:e.staged,untracked:e.untracked}))})}function aOe(e){return JSON.stringify(e.map(e=>({hash:e.hash,subject:e.subject,relativeDate:e.relativeDate})))}function oOe(e){return JSON.stringify(e.map(e=>({name:e.name,current:e.current,remote:e.remote,upstream:e.upstream})))}function sOe(e){if(e)return JSON.stringify({available:e.available,authenticated:e.authenticated,login:e.login,reason:e.reason})}function V6(e){return JSON.stringify(e)}function cOe(e){return JSON.stringify(e.map(e=>B6(e)))}var H6=In({projects:{}}),lOe=8;function uOe(){return{fetching:!1,syncing:!1,switchingBranch:void 0,creatingBranch:!1,fileMutation:void 0,bulkMutation:void 0}}function U6(){return{repoSummary:void 0,changes:void 0,recentCommits:[],github:void 0,prs:[],branches:[],operations:uOe(),loadingOverview:!1,loadingPrs:!1,loadingBranches:!1,prsRequestInFlight:!1,overviewRequestInFlight:!1,lastRepoSummaryFingerprint:void 0,lastChangesFingerprint:void 0,lastRecentCommitsFingerprint:void 0,lastBranchesFingerprint:void 0,lastPrsFingerprint:void 0,lastGithubFingerprint:void 0,loaded:!1,loadedAt:void 0,requestSeq:0}}function dOe(e){return{projectId:e.id,projectDir:e.dir,projectIsRepo:!1,repos:[],selectedRepo:`.`,repoStates:{},discoverError:void 0,loadingRepos:!1,refreshingRepos:!1,reposRequestInFlight:!1,lastReposFingerprint:void 0,loaded:!1,loadedAt:void 0,requestSeq:0,touchedAt:Date.now()}}function W6(e){return`nerve.git.repo.${e}`}function fOe(e){let t=H6.projects[rE(e)];t&&(t.touchedAt=Date.now(),pOe())}function pOe(){let e=Object.values(H6.projects).sort((e,t)=>t.touchedAt-e.touchedAt);for(let t of e.slice(lOe))delete H6.projects[rE(t.projectId)]}function G6(e){let t=rE(e.id);H6.projects[t]??=dOe(e);let n=H6.projects[t];return n.projectDir!==e.dir&&(n.projectDir=e.dir),fOe(e.id),n}function K6(e,t){let n=H6.projects[rE(e)];if(!n)return U6();let r=iE(t);return n.repoStates[r]??=U6(),n.repoStates[r]}function q6(e){if(e instanceof Error){try{let t=JSON.parse(e.message);if(t?.error?.message)return String(t.error.message)}catch{}return e.message}return String(e)}function J6(e){let t=e?.operations;return!!(t&&(t.fetching||t.syncing||t.creatingBranch||t.switchingBranch||t.fileMutation||t.bulkMutation))}function Y6(e,t){let n=B6(t);return e.lastRepoSummaryFingerprint===n&&e.repoSummary?!1:(e.repoSummary=t,e.lastRepoSummaryFingerprint=n,!0)}function mOe(e,t){let n=iOe(t);return e.lastChangesFingerprint===n&&e.changes?!1:(e.changes=t,e.lastChangesFingerprint=n,!0)}function hOe(e,t){let n=aOe(t);return e.lastRecentCommitsFingerprint===n?!1:(e.recentCommits=t,e.lastRecentCommitsFingerprint=n,!0)}function gOe(e,t){let n=Y6(e,t.repo),r=mOe(e,rOe(t)),i=hOe(e,t.recentCommits),a=n||r||i;return e.loaded||=!0,(a||e.loadedAt===void 0)&&(e.loadedAt=Date.now()),{changed:a,repoChanged:n,changesChanged:r,recentCommitsChanged:i}}function X6(e,t){let n=cOe(t);return e.lastReposFingerprint===n?!1:(e.repos=t,e.lastReposFingerprint=n,!0)}function Z6(e,t){let n=oOe(t);return e.lastBranchesFingerprint===n?!1:(e.branches=t,e.lastBranchesFingerprint=n,!0)}function Q6(e,t){let n=sOe(t);return e.lastGithubFingerprint===n?!1:(e.github=t,e.lastGithubFingerprint=n,!0)}function $6(e,t){let n=V6(t);return e.lastPrsFingerprint===n?!1:(e.prs=t,e.lastPrsFingerprint=n,!0)}function e8(e,t){let n=H6.projects[rE(e)];if(!n)return;let r=n.repos.find(e=>e.relativePath===t.relativePath);r?B6(r)!==B6(t)&&X6(n,n.repos.map(e=>e.relativePath===t.relativePath?t:e)):X6(n,[...n.repos,t]);let i=n.repoStates[iE(t.relativePath)];i&&Y6(i,t),i&&(!t.hasRemote||!t.hasGithubRemote)&&n8(e,i),r8(e)}function _Oe(e,t){let n=H6.projects[rE(e)];if(n)return n.repoStates[iE(t)]?.repoSummary??n.repos.find(e=>e.relativePath===t)}function t8(e,t){let n=_Oe(e,t);return!!(n?.hasRemote&&n.hasGithubRemote)}function n8(e,t){let n=!1;(t.github!==void 0||t.lastGithubFingerprint!==void 0)&&(t.github=void 0,t.lastGithubFingerprint=void 0,n=!0);let r=V6([]);(t.prs.length>0||t.lastPrsFingerprint!==void 0&&t.lastPrsFingerprint!==r)&&(t.prs=[],t.lastPrsFingerprint=r,n=!0),t.loadingPrs&&(t.loadingPrs=!1,n=!0),t.prsRequestInFlight&&(t.prsRequestInFlight=!1,n=!0),n&&r8(e)}function vOe(e){if(!(typeof localStorage>`u`))return localStorage.getItem(W6(e))??void 0}function yOe(e,t){typeof localStorage>`u`||localStorage.setItem(W6(e),t)}function bOe(e){if(!e.loaded&&e.repos.length===0)return;let t=e.repoStates[iE(e.selectedRepo)];return{projectId:e.projectId,projectIsRepo:e.projectIsRepo,repos:e.repos,github:t?.github?{available:t.github.available,authenticated:t.github.authenticated}:void 0,loadedAt:e.loadedAt??Date.now()}}function r8(e){let t=H6.projects[rE(e)];if(!t)return;let n=bOe(t);if(!n)return;let r=jT.gitContext;(!r||r.projectId!==n.projectId||z6(r)!==z6(n))&&(jT.gitContext=n)}async function i8(e,t={}){let n=G6(e);if(n.reposRequestInFlight&&!t.force)return;let r=n.requestSeq+1;n.requestSeq=r,n.reposRequestInFlight=!0,n.discoverError=void 0;let i=!n.loaded&&!t.silent;n.loadingRepos=i,n.refreshingRepos=!i&&!t.silent;try{let t=await cue(e.id);if(n.requestSeq!==r)return;let i=!1;n.projectIsRepo!==t.projectIsRepo&&(n.projectIsRepo=t.projectIsRepo,i=!0),i=X6(n,t.repos)||i;for(let n of t.repos)K6(e.id,n.relativePath);let a=vOe(e.id),o=t.repos.some(e=>e.relativePath===n.selectedRepo),s=t.repos[0]?.relativePath??`.`,c=n.selectedRepo;if(a&&t.repos.some(e=>e.relativePath===a)?c=a:o||(c=s),n.selectedRepo!==c&&(n.selectedRepo=c,i=!0),n.loaded||(n.loaded=!0,i=!0),(i||n.loadedAt===void 0)&&(n.loadedAt=Date.now()),r8(e.id),t.repos.length>0){let t=K6(e.id,n.selectedRepo).loaded?{silent:!0,onlyIfChanged:!0}:{};await Promise.all([a8(e.id,n.selectedRepo,t),o8(e.id,n.selectedRepo)])}}catch(e){if(n.requestSeq!==r)return;n.discoverError=q6(e),n.loaded||X6(n,[])}finally{n.requestSeq===r&&(n.loadingRepos=!1,n.refreshingRepos=!1,n.reposRequestInFlight=!1)}}async function a8(e,t,n={}){let r=K6(e,t);if(r.overviewRequestInFlight&&!n.force)return;let i=r.requestSeq+1;r.requestSeq=i,r.overviewRequestInFlight=!0,n.silent||(r.loadingOverview=!0);try{let n=await lue(e,t);if(r.requestSeq!==i)return;e8(e,n.repo),gOe(r,n)}catch(e){n.silent||cd.error(`Git overview failed: ${q6(e)}`)}finally{r.requestSeq===i&&(n.silent||(r.loadingOverview=!1),r.overviewRequestInFlight=!1)}}async function xOe(e,t){let n=K6(e,t);n.loadingBranches=!0;try{Z6(n,(await uue(e,t)).branches)}catch(e){cd.error(`Could not list branches: ${q6(e)}`)}finally{n.loadingBranches=!1}}async function o8(e,t){let n=K6(e,t);if(!t8(e,t)){n8(e,n);return}try{let r=await gue(e,t);Q6(n,r),r8(e),r.authenticated?await s8(e,t,!0):$6(n,[])}catch(t){Q6(n,{available:!1,authenticated:!1,login:null,reason:q6(t)}),$6(n,[]),r8(e)}}async function s8(e,t,n=!1){let r=K6(e,t);if(!t8(e,t)){n8(e,r);return}if(!r.prsRequestInFlight){r.prsRequestInFlight=!0,n||(r.loadingPrs=!0);try{$6(r,(await _ue(e,t)).prs)}catch(e){n||cd.error(`Could not list PRs: ${q6(e)}`)}finally{n||(r.loadingPrs=!1),r.prsRequestInFlight=!1}}}function SOe(e,t){if(typeof document<`u`&&document.visibilityState!==`visible`)return;let n=H6.projects[rE(e)]?.repoStates[iE(t)];!n||n.overviewRequestInFlight||J6(n)||a8(e,t,{silent:!0,onlyIfChanged:!0})}function COe(e){let t=G6(e);if(!t.loaded&&!t.reposRequestInFlight){i8(e);return}t.reposRequestInFlight||i8(e,{silent:!0,onlyIfChanged:!0})}function wOe(e,t){let n=H6.projects[rE(e)];if(!n||t===n.selectedRepo)return;n.selectedRepo=t,yOe(e,t);let r=K6(e,t);r.loaded?J6(r)||(a8(e,t,{silent:!0,onlyIfChanged:!0}),r.github?.authenticated&&s8(e,t,!0)):(a8(e,t),o8(e,t)),r8(e)}function TOe(e,t){let n=e?[H6.projects[rE(e)]].filter(e=>!!e):Object.values(H6.projects);for(let e of n){let n=e.projectId;t?(a8(n,t,{force:!0}),o8(n,t)):i8({id:n,dir:e.projectDir,name:e.projectDir,createdAt:``,updatedAt:``},{force:!0,silent:e.loaded})}}async function EOe(e,t){let n=K6(e,t);n.operations.fetching=!0;try{e8(e,(await mue(e,t)).repo),cd.success(`Fetched from remote`),await a8(e,t),n.github?.authenticated&&await s8(e,t,!0)}catch(e){cd.error(`Fetch failed: ${q6(e)}`)}finally{n.operations.fetching=!1}}async function DOe(e,t){let n=K6(e,t);n.operations.syncing=!0;try{e8(e,(await pue(e,t)).repo),cd.success(`Branch synced`),await a8(e,t),n.github?.authenticated&&await s8(e,t,!0)}catch(e){cd.error(`Sync failed: ${q6(e)}`)}finally{n.operations.syncing=!1}}async function OOe(e,t,n){if(n.current)return!1;let r=K6(e,t);r.operations.switchingBranch=n.name;try{let i=await fue(e,t,n.name);return e8(e,i.repo),Z6(r,[]),cd.success(`Switched to ${i.repo.currentBranch??n.name}`),await Promise.all([a8(e,t),o8(e,t)]),!0}catch(e){return cd.error(`Switch branch failed: ${q6(e)}`),!1}finally{r.operations.switchingBranch=void 0}}async function kOe(e,t,n){if(n.trim().length===0)return!1;let r=K6(e,t);r.operations.creatingBranch=!0;try{return e8(e,(await due(e,t,n.trim())).repo),Z6(r,[]),cd.success(`Created branch ${n.trim()}`),await Promise.all([a8(e,t),o8(e,t)]),!0}catch(e){return cd.error(`Create branch failed: ${q6(e)}`),!1}finally{r.operations.creatingBranch=!1}}async function AOe(e,t,n,r){let i=K6(e,t);i.operations.fileMutation={path:n.path,action:r};try{e8(e,(await(r===`stage`?Yk:r===`unstage`?Xk:hue)(e,t,n.path)).repo),await a8(e,t)}catch(e){cd.error(`${r[0].toUpperCase()}${r.slice(1)} failed: ${q6(e)}`)}finally{i.operations.fileMutation=void 0}}async function jOe(e,t,n){let r=K6(e,t),i=r.changes?.files??[],a=n===`stage-all`?i.filter(e=>e.untracked||e.worktree!==` `):i.filter(e=>e.staged);if(a.length===0)return;let o=n===`stage-all`?Yk:Xk;r.operations.bulkMutation=n;try{for(let n of a)await o(e,t,n.path);await a8(e,t)}catch(e){cd.error(`${n===`stage-all`?`Stage all`:`Unstage all`} failed: ${q6(e)}`)}finally{r.operations.bulkMutation=void 0}}function c8(e){return e.length>1?` for these repositories: ${e.map(e=>e.relativePath).join(`, `)}`:``}function l8(e){return`'${e.replace(/'/g,`'\\''`)}'`}function u8(e){return e.relativePath===`.`?`git status --short --branch`:`git -C ${l8(e.relativePath)} status --short --branch`}function d8(e){let t=f8(e);return`\`\`\`!!!\n${t.length===1?u8(t[0]):t.map(e=>`printf '\\n## %s\\n' ${l8(e.relativePath)}\n${u8(e)}`).join(`
|
|
137
|
-
`)}\n\`\`\`\n\n`}function f8(e){let t=new Set,n=[];for(let r of e)t.has(r.relativePath)||(t.add(r.relativePath),n.push(r));return n}function MOe(e){let t=e.repos,n=t.filter(e=>e.dirty),r=n.filter(e=>e.onBaseBranch),i=t.filter(e=>e.hasRemote&&e.hasGithubRemote),a=n.filter(e=>e.hasRemote&&e.hasGithubRemote),o=i.filter(e=>!e.detached&&e.currentBranch!==null&&!e.onBaseBranch&&!e.mergedToBase),s=f8([...a,...o]),c=!!(e.github?.available&&e.github?.authenticated),l=[];if(n.length>0&&l.push({id:`commit`,label:`Commit changes`,prompt:d8(n)+(n.length>1?`For each repository with uncommitted changes, stage and commit its changes with a clear, conventional commit message derived from that repo's own diff${c8(n)}.`:`Stage and commit the current changes with a clear, conventional commit message summarizing what changed.`)}),r.length>0&&l.push({id:`commit-branch`,label:`Commit on a feature branch`,prompt:d8(r)+(r.length>1?`Create a feature branch (reuse one descriptive branch name across repos) and commit the changes in each repository currently on its base branch${c8(r)}. Use a clear commit message per repo based on its diff.`:`Create a new feature branch with a descriptive name, then stage and commit the current changes to it with a clear commit message.`)}),c&&s.length>0){let e=s.length>1?` Do this for each of these repositories, reusing a shared feature branch name where it makes sense: ${s.map(e=>e.relativePath).join(`, `)}.`:``;l.push({id:`open-pr`,label:s.length>1?`Create PRs`:`Create a PR`,prompt:`${d8(s)}Open a pull request for the current work:
|
|
138
|
-
1. If on the base branch, create a new feature branch.
|
|
139
|
-
2. Stage and commit any uncommitted changes with a clear message.
|
|
140
|
-
3. Push the branch to origin (set upstream if needed).
|
|
141
|
-
4. Create a pull request with a concise title and a summary of the changes.${e}`})}return l}function NOe(){let e=TT.conversationId??kT.activeConversationTabId;if(e)return kT.conversationViews[$T(e)]}var p8={get activeCenterPrView(){let e=Y.activeCenterTab;if(e?.kind===`pr`)return jT.prViews[nE(e.id)]},get gitStatus(){let e=R6.activeProject?.id,t=e?H6.projects[rE(e)]:void 0;if(!t||t.repos.length===0)return;let n=t.repoStates[iE(t.selectedRepo)]?.repoSummary??t.repos.find(e=>e.relativePath===t.selectedRepo)??t.repos[0];return{branch:n.currentBranch??`detached`,dirty:n.dirty}},get gitSuggestions(){let e=jT.gitContext,t=R6.activeProject?.id;return!e||!t||e.projectId!==t?[]:MOe(e)},get branchDepth(){return NOe()?.treeNodes.length??0}};function m8(e,t){D(t,!0);let n=q(t,`active`,3,!0),r=k(()=>t.tab??Y.activeCenterTab),i=k(()=>I(r)?.kind===`conversation`?I(r).id:void 0),a=k(()=>I(r)?.kind===`pending-conversation`?I(r).id:void 0),o=k(()=>I(i)?kT.conversationViews[$T(I(i))]:void 0),s=k(()=>I(a)?kT.pendingConversations[eE(I(a))]:void 0),c=k(()=>I(i)?Y.conversations.find(e=>e.id===I(i)):void 0),l=k(()=>I(c)?Y.agents.find(e=>e.id===I(c).activeAgentId||e.conversationId===I(c).id):void 0),u=k(()=>{let e=I(s)?.projectId??I(c)?.projectId;return e?Y.projects.find(t=>t.id===e):void 0}),d=k(()=>!!I(s)),f=k(()=>{let e=I(l)?.id;return Y.userQuestions.find(t=>I(i)&&t.conversationId===I(i)?!0:!!(e&&t.agentId===e))}),p=k(()=>{let e=I(l)?.id;return Y.planReviews.find(t=>I(i)&&t.conversationId===I(i)?!0:!!(e&&t.agentId===e))}),m=k(()=>I(p)?Y.agents.find(e=>e.id===I(p).agentId):void 0),h=k(()=>I(s)?.selectedModelKey??(I(l)?.model?aE(I(l).model):kT.selectedModelKey)),g=k(()=>NT.models.find(e=>aE(e)===I(h))),_=k(()=>I(l)?.model),v=k(()=>I(_)?NT.models.find(e=>aE(e)===aE(I(_))):void 0),y=k(()=>I(s)?.thinkingLevel??I(l)?.thinkingLevel??`off`),b=k(()=>I(s)?.mode??I(l)?.mode??I(c)?.mode??kT.selectedMode),x=k(()=>I(s)?.permissionLevel??I(l)?.permissionLevel??I(c)?.permissionLevel??kT.selectedPermissionLevel),S=k(()=>I(s)?.composerText??I(o)?.composerText??``),ee=k(()=>gE(NT.models,NT.authProviders,NT.settingsDraft?.scopedModels)),C=k(()=>I(m)?.model?aE(I(m).model):I(h)),te=k(()=>I(m)?.thinkingLevel??I(y)),ne=k(()=>I(g)?.contextWindow??I(v)?.contextWindow??I(o)?.contextUsage?.contextWindow??0),re=k(()=>n()?p8.gitSuggestions:[]),ie=k(()=>n()?kT.slashCompletions:[]);function ae(e,t){return!!(e&&t&&e.kind===t.kind&&e.id===t.id)}async function oe(){let e=I(r);!e||ae(Y.activeCenterTab,e)||await XT(e)}function w(e){let t=I(s);if(t){t.composerText=e;return}if(I(i)){sA(I(i)).composerText=e;return}if(n()&&ae(Y.activeCenterTab,I(r))){_6(e);return}ET.text=e}async function se(e){await oe(),await e()}async function ce(e,t=!1){await se(()=>D6(e,t)),Y3()}async function le(e){await se(()=>D6(e.parentEntryId)),w(e.text),Y3()}function ue(){Y.projectPickerOpen=!0}function de(e,t){I(u)&&qDe({projectId:I(u).id,path:e,line:t})}function fe(e){w(I(S).trim()?`${I(S)}\n\n${e.prompt}`:e.prompt)}function pe(e){se(()=>b6(e.prompt,{clearComposer:!1}))}{let t=k(()=>Y.status?.storage.home),r=k(()=>I(o)?.transcript??[]),i=k(()=>I(o)?.toolCalls??[]),a=k(()=>I(o)?.treeNodes??[]),m=k(()=>I(o)?.streamingText??``),g=k(()=>I(o)?.live),_=k(()=>I(o)?.queuedPrompts??[]),v=k(()=>Y.connection===`live`),ae=k(()=>I(s)?.sending??I(o)?.sending??!1),oe=k(()=>I(o)?.contextUsage),me=k(()=>n()?zDe:void 0);QEe(e,{get active(){return n()},get activeProject(){return I(u)},get activeConversation(){return I(c)},get activeAgent(){return I(l)},get activePendingConversation(){return I(s)},get pendingConversationActive(){return I(d)},get projects(){return Y.projects},get conversations(){return Y.conversations},get agents(){return Y.agents},get homeDir(){return I(t)},get approvals(){return Y.approvals},get pendingUserQuestion(){return I(f)},get pendingPlanReview(){return I(p)},get transcript(){return I(r)},get toolCalls(){return I(i)},get treeNodes(){return I(a)},get streamingText(){return I(m)},get liveState(){return I(g)},get queuedPrompts(){return I(_)},get live(){return I(v)},get sending(){return I(ae)},get composerText(){return I(S)},get gitSuggestions(){return I(re)},onSendGitSuggestion:pe,onDraftGitSuggestion:fe,get models(){return I(ee)},get selectedModelKey(){return I(h)},get thinkingLevel(){return I(y)},get planReviewModels(){return I(ee)},get planReviewModelKey(){return I(C)},get planReviewThinkingLevel(){return I(te)},get mode(){return I(b)},get permissionLevel(){return I(x)},get slashCompletions(){return I(ie)},get contextUsage(){return I(oe)},get contextWindow(){return I(ne)},get composerFocusToken(){return J3.focusToken},get composerEscapeToken(){return J3.escapeToken},get micShortcutToken(){return J3.micToken},get fileCompletions(){return I(me)},onComposerChange:w,onSubmit:()=>{se(MDe)},get onAnswerUserQuestion(){return wDe},get onDismissUserQuestion(){return TDe},onAbort:()=>{se(O6)},onOpenProject:ue,get onNewConversationInProject(){return w6},onOpenFile:de,onModelChange:e=>{se(()=>ODe(e))},onThinkingLevelChange:e=>{se(()=>m6(e))},onModeChange:e=>{se(()=>h6(e))},onPermissionChange:e=>{se(()=>g6(e))},onGrantApproval:e=>void yDe(e),onDenyApproval:e=>void bDe(e),onAcceptPlanReview:(e,t)=>xDe(e,t),onAcceptPlanReviewInNewChat:(e,t)=>SDe(e,t),onRejectPlanReview:e=>void CDe(e),onContinueFromFailure:e=>{se(()=>WDe(e))},onNavigateToEntry:(e,t)=>{ce(e,t)},onEditEntry:e=>{le(e)},onOpenHistory:()=>{se(tDe)}})}O()}function h8(){let e=TT.conversationId??kT.activeConversationTabId;if(e)return kT.conversationViews[$T(e)]}function g8(){let e=Y.activeCenterTab;if(e?.kind===`pending-conversation`)return kT.pendingConversations[eE(e.id)]}var _8={get activeProject(){return R6.activeProject},get activeConversation(){return R6.activeConversation},get activeAgent(){return R6.activeAgent},get activePendingConversation(){return g8()},get pendingConversationActive(){return!!g8()},get activeUserQuestion(){let e=TT.conversationId,t=TT.agentId;return Y.userQuestions.find(n=>e&&n.conversationId===e?!0:!!(t&&n.agentId===t))},get activePlanReview(){let e=TT.conversationId,t=TT.agentId;return Y.planReviews.find(n=>e&&n.conversationId===e?!0:!!(t&&n.agentId===t))},get conversationActivityById(){return R6.conversationActivityById},get conversationAgents(){return Y.agents.filter(e=>e.conversationId===TT.conversationId)},get pendingApprovalCount(){return Y.approvals.length},get conversationLiveState(){return h8()?.live},get transcript(){return h8()?.transcript??[]},get toolCalls(){return h8()?.toolCalls??[]},get treeNodes(){return h8()?.treeNodes??[]},get streamingText(){return h8()?.streamingText??``},get queuedPrompts(){return h8()?.queuedPrompts??[]},get activeComposerText(){return g8()?.composerText??h8()?.composerText??``},get gitSuggestions(){return p8.gitSuggestions},get slashCompletions(){return kT.slashCompletions},get selectedModelKey(){return kT.selectedModelKey},get selectedThinkingLevel(){return kT.selectedThinkingLevel},get selectedMode(){return kT.selectedMode},get selectedPermissionLevel(){return kT.selectedPermissionLevel},get activeContextUsage(){return h8()?.contextUsage},get activeModelInfo(){let e=Y.agents.find(e=>e.id===TT.agentId)?.model;if(e)return NT.models.find(t=>t.provider===e.provider&&t.modelId===e.modelId)},get activeContextWindow(){let e=NT.models.find(e=>aE(e)===kT.selectedModelKey);return e?.contextWindow?e.contextWindow:this.activeModelInfo?.contextWindow?this.activeModelInfo.contextWindow:h8()?.contextUsage?.contextWindow??0},get activeConversationUsage(){let e={input:0,output:0,cacheRead:0,cacheWrite:0,cost:0};for(let t of h8()?.transcript??[])t.usage&&(e.input+=t.usage.input,e.output+=t.usage.output,e.cacheRead+=t.usage.cacheRead,e.cacheWrite+=t.usage.cacheWrite,e.cost+=t.usage.cost);return e},get usableModels(){return gE(NT.models,NT.authProviders,NT.settingsDraft?.scopedModels)},get live(){return Y.connection===`live`},get sending(){return g8()?.sending??h8()?.sending??!1},get activeSubscriptionProvider(){return Y.agents.find(e=>e.id===TT.agentId)?.model?.provider??oE(kT.selectedModelKey)?.provider},get activeSubscriptionUsage(){let e=this.activeSubscriptionProvider;if(e)return SZ.subscriptionUsage[e]}},POe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`,`size`]),FOe=L(`<div><!></div>`);function v8(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`size`,3,`default`),i=G(t,POe);var a=FOe();Sa(a,e=>({"data-slot":`card`,"data-size":r(),class:e,...i}),[()=>ul(`ring-foreground/10 bg-card text-card-foreground gap-6 overflow-hidden rounded-xl py-6 text-sm shadow-xs ring-1 has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col`,t.class)]),H(M(a),()=>t.children??w),T(a),Aa(a,e=>n(e),()=>n()),z(e,a),O()}function y8(e){return e?.status===`pending`}function IOe(e){return e.some(e=>y8(e.checks))}function LOe(e,t,n){return`${e}:${encodeURIComponent(t)}:${n}`}function b8(e){WT({kind:`pr`,id:e})}async function x8(e){let t=jT.prViews[nE(e)];if(!(!t||t.loading)){t.loading=!0,t.error=void 0;try{t.detail=await vue(t.projectId,t.repo,t.number)}catch(e){let n=e instanceof Error?e.message:String(e);t.error=n,cd.error(`Could not open pull request`,{description:n})}finally{t.loading=!1}}}async function ROe(e){let t=LOe(e.projectId,e.repo,e.number),n=nE(t);b8(t),jT.prViews[n]??={id:t,projectId:e.projectId,repo:e.repo,number:e.number,loading:!1},JT({kind:`pr`,id:t}),await x8(t)}async function zOe(e){let t=jT.prViews[nE(e)];t&&(b8(e),JT({kind:`pr`,id:e}),!t.detail&&!t.loading&&await x8(e))}async function S8(e){await x8(e)}function BOe(e){let t={kind:`pr`,id:e},n=Y.activeCenterTab?.kind===`pr`&&Y.activeCenterTab.id===e,r=KT(t);qT(t),delete jT.prViews[nE(e)],n&&XT(r)}var VOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function C8(e,t){let n=G(t,VOe),r=[[`path`,{d:`M12 17V3`}],[`path`,{d:`m6 11 6 6 6-6`}],[`path`,{d:`M19 21H5`}]];uc(e,K({name:`arrow-down-to-line`},()=>n,{get iconNode(){return r}}))}var HOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function w8(e,t){let n=G(t,HOe),r=[[`path`,{d:`m18 9-6-6-6 6`}],[`path`,{d:`M12 3v14`}],[`path`,{d:`M5 21h14`}]];uc(e,K({name:`arrow-up-from-line`},()=>n,{get iconNode(){return r}}))}var UOe=new Set([`$$slots`,`$$events`,`$$legacy`]);function T8(e,t){let n=G(t,UOe),r=[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`}]];uc(e,K({name:`file-pen`},()=>n,{get iconNode(){return r}}))}var E8=48;function WOe(e){return e.relativePath===`.`?`project root`:e.relativePath}function GOe(e){return e.untracked?`text-muted-foreground`:e.index===`A`?`text-success`:e.index===`D`||e.worktree===`D`?`text-destructive`:`text-info`}function KOe(e,t){if(e.untracked)return`?`;let n=t===`staged`?e.index:e.worktree;return n===` `?e.index===` `?`M`:e.index:n}function qOe(e,t){let n=t===`staged`?e.index:e.worktree;if(e.untracked)return`untracked`;switch(n){case`A`:return`added`;case`D`:return`deleted`;case`R`:return`renamed`;case`M`:return`modified`;case`U`:return`conflict`;default:return t}}function JOe(e){if(e.length<=E8)return e;let t=e.split(`/`);if(t.length<=2){let t=Math.ceil(Math.max(8,E8-3)/2);return`${e.slice(0,t)}...${e.slice(-22)}`}let n=t[0],r=[t.at(-1)??``];for(let e=t.length-2;e>0;--e){let i=`${n}/.../${[t[e],...r].join(`/`)}`;if(i.length>E8&&r.length>1||(r.unshift(t[e]),i.length>=E8))break}return`${n}/.../${r.join(`/`)}`}function YOe(e){let t=e.lastIndexOf(`/`);return t===-1?{dir:``,base:e}:{dir:e.slice(0,t+1),base:e.slice(t+1)}}function XOe(e){switch(e.status){case`passing`:return`good`;case`failing`:return`danger`;case`pending`:return`warn`;default:return`neutral`}}var ZOe=L(`<span class="text-muted-foreground"> </span>`),QOe=L(`<div class="group flex min-h-0 items-center gap-1 px-1 text-xs leading-tight"><span> </span> <div class="min-w-0 flex-1 truncate font-mono"><!><span class="text-foreground"> </span></div> <div class="flex w-9 shrink-0 items-center justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100"><!> <!></div></div>`),$Oe=L(`<span> </span> <span class="text-muted-foreground/50">·</span> <span> </span>`,1),D8=L(`<div class="py-1 text-xs text-muted-foreground">Loading…</div>`),eke=L(`<p class="py-1 text-xs text-muted-foreground">Working tree clean.</p>`),tke=L(`<div class="flex flex-col gap-0.5"><div class="flex h-5 items-center gap-1 px-1 text-xs font-medium text-muted-foreground"><span>Staged</span> <!> <span class="ml-auto"> </span></div> <!></div>`),nke=L(`<div class="flex flex-col gap-0.5"><div class="flex h-5 items-center gap-1 px-1 text-xs font-medium text-muted-foreground"><span>Unstaged</span> <!> <span class="ml-auto"> </span></div> <!></div>`),rke=L(`<div class="flex flex-col gap-1"><!> <!></div>`);function ike(e,t){D(t,!0);let n=(e,n=w,r=w)=>{let i=k(()=>YOe(JOe(n().path))),a=k(()=>t.fileMutation?.path===n().path);var o=QOe(),s=M(o),c=M(s,!0);T(s);var l=P(s,2),u=M(l),d=e=>{var t=ZOe(),n=M(t,!0);T(t),F(()=>B(n,I(i).dir)),z(e,t)};V(u,e=>{I(i).dir&&e(d)});var f=P(u),p=M(f,!0);T(f),T(l);var m=P(l,2),h=M(m),g=e=>{{let r=k(()=>`Unstage ${n().path}`);Ml(e,{size:`icon-xs`,class:`size-4`,variant:`ghost`,get ariaLabel(){return I(r)},title:`Unstage`,get disabled(){return I(a)},onclick:()=>t.onMutateFile(t.selectedRepo,n(),`unstage`),children:(e,n)=>{var r=R(),i=N(r),o=e=>{tD(e,{class:`animate-spin`})},s=e=>{C8(e,{})};V(i,e=>{I(a)&&t.fileMutation?.action===`unstage`?e(o):e(s,-1)}),z(e,r)},$$slots:{default:!0}})}},_=e=>{{let r=k(()=>`Stage ${n().path}`);Ml(e,{size:`icon-xs`,class:`size-4`,variant:`ghost`,get ariaLabel(){return I(r)},title:`Stage`,get disabled(){return I(a)},onclick:()=>t.onMutateFile(t.selectedRepo,n(),`stage`),children:(e,n)=>{var r=R(),i=N(r),o=e=>{tD(e,{class:`animate-spin`})},s=e=>{w8(e,{})};V(i,e=>{I(a)&&t.fileMutation?.action===`stage`?e(o):e(s,-1)}),z(e,r)},$$slots:{default:!0}})}};V(h,e=>{r()===`staged`?e(g):e(_,-1)});var v=P(h,2);{let e=k(()=>`Discard ${n().path}`);Ml(v,{size:`icon-xs`,class:`size-4`,variant:`ghost`,get ariaLabel(){return I(e)},title:`Discard`,get disabled(){return I(a)},onclick:()=>t.onRequestDiscard(n()),children:(e,n)=>{var r=R(),i=N(r),o=e=>{tD(e,{class:`animate-spin`})},s=e=>{ZX(e,{})};V(i,e=>{I(a)&&t.fileMutation?.action===`discard`?e(o):e(s,-1)}),z(e,r)},$$slots:{default:!0}})}T(m),T(o),F((e,t,r)=>{ra(s,1,e),W(s,`title`,t),B(c,r),W(l,`title`,n().path),B(p,I(i).base)},[()=>Zi(ul(`w-3 shrink-0 text-center font-mono font-semibold`,GOe(n()))),()=>qOe(n(),r()),()=>KOe(n(),r())]),z(e,o)},r=q(t,`open`,15,!0);dT(e,{title:`Changes`,get icon(){return T8},contentClass:`px-2 py-1.5`,get open(){return r()},set open(e){r(e)},meta:e=>{var n=R(),r=N(n),i=e=>{var n=$Oe(),r=N(n),i=M(r);T(r);var a=P(r,4),o=M(a);T(a),F(()=>{B(i,`${t.changes.stagedCount??``} staged`),B(o,`${t.changes.unstagedCount+t.changes.untrackedCount} unstaged`)}),z(e,n)};V(r,e=>{t.changes&&e(i)}),z(e,n)},children:(e,r)=>{var i=R(),a=N(i),o=e=>{z(e,D8())},s=e=>{var r=R(),i=N(r),a=e=>{z(e,eke())},o=e=>{var r=rke(),i=M(r),a=e=>{var r=tke(),i=M(r),a=P(M(i),2);{let e=k(()=>!!t.bulkMutation||!!t.fileMutation);Ml(a,{size:`icon-xs`,class:`size-5`,variant:`ghost`,ariaLabel:`Unstage all`,title:`Unstage all`,get disabled(){return I(e)},onclick:()=>t.onBulkStage(t.selectedRepo,`unstage-all`),children:(e,n)=>{var r=R(),i=N(r),a=e=>{tD(e,{class:`animate-spin`})},o=e=>{C8(e,{})};V(i,e=>{t.bulkMutation===`unstage-all`?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}})}var o=P(a,2),s=M(o,!0);T(o),T(i),Ri(P(i,2),17,()=>t.stagedFiles,e=>e.path,(e,t)=>{n(e,()=>I(t),()=>`staged`)}),T(r),F(()=>B(s,t.stagedFiles.length)),z(e,r)};V(i,e=>{t.stagedFiles.length>0&&e(a)});var o=P(i,2),s=e=>{var r=nke(),i=M(r),a=P(M(i),2);{let e=k(()=>!!t.bulkMutation||!!t.fileMutation);Ml(a,{size:`icon-xs`,class:`size-5`,variant:`ghost`,ariaLabel:`Stage all`,title:`Stage all`,get disabled(){return I(e)},onclick:()=>t.onBulkStage(t.selectedRepo,`stage-all`),children:(e,n)=>{var r=R(),i=N(r),a=e=>{tD(e,{class:`animate-spin`})},o=e=>{w8(e,{})};V(i,e=>{t.bulkMutation===`stage-all`?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}})}var o=P(a,2),s=M(o,!0);T(o),T(i),Ri(P(i,2),17,()=>t.unstagedFiles,e=>e.path,(e,t)=>{n(e,()=>I(t),()=>`unstaged`)}),T(r),F(()=>B(s,t.unstagedFiles.length)),z(e,r)};V(o,e=>{t.unstagedFiles.length>0&&e(s)}),T(r),z(e,r)};V(i,e=>{t.changes.files.length===0?e(a):e(o,-1)}),z(e,r)},c=e=>{z(e,D8())};V(a,e=>{t.loadingOverview&&!t.changes?e(o):t.changes?e(s,1):e(c,-1)}),z(e,i)},$$slots:{meta:!0,default:!0}}),O()}var ake=new Set([`$$slots`,`$$events`,`$$legacy`]);function O8(e,t){let n=G(t,ake),r=[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}],[`path`,{d:`M21 3v5h-5`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}],[`path`,{d:`M8 16H3v5`}]];uc(e,K({name:`refresh-cw`},()=>n,{get iconNode(){return r}}))}var oke=L(`<div class="py-1 text-xs text-muted-foreground">No remote configured for this repository.</div>`),ske=L(`<div class="py-1 text-xs text-muted-foreground">PRs are only available for GitHub remotes.</div>`),cke=L(`<div class="py-1 text-xs text-muted-foreground">Checking GitHub CLI…</div>`),lke=L(`<div class="py-1 text-xs text-muted-foreground"> </div>`),uke=L(`<div class="py-1 text-xs text-muted-foreground">Not authenticated. Run <code class="font-mono">gh auth login</code>.</div>`),dke=L(`<div class="py-1 text-xs text-muted-foreground">Loading…</div>`),fke=L(`<div class="py-1 text-xs text-muted-foreground">No open PRs for this repository.</div>`),pke=L(`<!> `,1),mke=L(`<div class="flex items-center gap-1.5 text-xs"><span class="font-mono text-muted-foreground"> </span> <span class="truncate text-foreground"> </span></div>`),hke=L(`<div class="mt-1.5 flex flex-col gap-1 rounded-md border bg-background px-2 py-1.5"></div>`),gke=L(`<div><div class="flex items-center gap-1.5"><button type="button" class="flex min-w-0 flex-1 items-center gap-1.5 text-left text-xs text-foreground hover:underline"><span class="font-mono text-muted-foreground"> </span> <span class="truncate"> </span></button> <a target="_blank" rel="noreferrer" class="shrink-0 text-muted-foreground hover:text-foreground" title="Open in browser" aria-label="Open in browser"><!></a></div> <div class="mt-1 flex flex-wrap items-center gap-1.5"><!> <!> <button type="button" title="Toggle check details"><!></button> <span class="truncate font-mono text-xs text-muted-foreground"> </span></div> <!></div>`),_ke=L(`<div class="flex flex-col gap-1.5"></div>`);function vke(e,t){D(t,!0);let n=q(t,`expandedPr`,15,void 0),r=q(t,`open`,15,!0);dT(e,{title:`PRs (GitHub)`,get icon(){return u$},get open(){return r()},set open(e){r(e)},actions:e=>{var n=R(),r=N(n),i=e=>{{let n=k(()=>`Refresh PRs · signed in as ${t.github.login??`unknown`}`);Ml(e,{size:`icon-xs`,variant:`ghost`,ariaLabel:`Refresh PRs`,get title(){return I(n)},get disabled(){return t.loadingPrs},onclick:()=>t.onRefreshPrs(),children:(e,n)=>{{let n=k(()=>t.loadingPrs?`animate-spin`:``);O8(e,{get class(){return I(n)}})}},$$slots:{default:!0}})}};V(r,e=>{t.selectedRepoHasGithubRemote&&t.github?.authenticated&&e(i)}),z(e,n)},children:(e,r)=>{var i=R(),a=N(i),o=e=>{z(e,oke())},s=e=>{z(e,ske())},c=e=>{z(e,cke())},l=e=>{var n=lke(),r=M(n,!0);T(n),F(()=>B(r,t.github.reason??`GitHub CLI (gh) is not installed.`)),z(e,n)},u=e=>{z(e,uke())},d=e=>{z(e,dke())},f=e=>{z(e,fke())},p=e=>{var r=_ke();Ri(r,21,()=>t.sortedPrs,e=>e.number,(e,r)=>{let i=k(()=>t.currentBranchName!==null&&I(r).headRefName===t.currentBranchName);var a=gke(),o=M(a),s=M(o),c=M(s),l=M(c);T(c);var u=P(c,2),d=M(u,!0);T(u),T(s);var f=P(s,2);wQ(M(f),{size:12}),T(f),T(o);var p=P(o,2),m=M(p),h=e=>{uf(e,{tone:`accent`,size:`xs`,children:(e,t)=>{E(),z(e,ki(`current`))},$$slots:{default:!0}})};V(m,e=>{I(i)&&e(h)});var g=P(m,2),_=e=>{uf(e,{tone:`neutral`,size:`xs`,children:(e,t)=>{E(),z(e,ki(`draft`))},$$slots:{default:!0}})};V(g,e=>{I(r).isDraft&&e(_)});var v=P(g,2),y=M(v);{let e=k(()=>XOe(I(r).checks));uf(y,{get tone(){return I(e)},size:`xs`,children:(e,t)=>{var n=pke(),i=N(n),a=e=>{JQ(e,{size:11})},o=e=>{ZX(e,{size:11})},s=e=>{tD(e,{size:11,class:`animate-spin`})};V(i,e=>{I(r).checks.status===`passing`?e(a):I(r).checks.status===`failing`?e(o,1):I(r).checks.status===`pending`&&e(s,2)});var c=P(i);F(()=>B(c,` ${I(r).checks.status===`none`?`no checks`:`${I(r).checks.passed}/${I(r).checks.total}`}`)),z(e,n)},$$slots:{default:!0}})}T(v);var b=P(v,2),x=M(b);T(b),T(p);var S=P(p,2),ee=e=>{var t=hke();Ri(t,21,()=>I(r).checks.runs,Fi,(e,t)=>{var n=mke(),r=M(n),i=M(r,!0);T(r);var a=P(r,2),o=M(a,!0);T(a),T(n),F(()=>{B(i,I(t).status),B(o,I(t).name)}),z(e,n)}),T(t),z(e,t)};V(S,e=>{n()===I(r).number&&I(r).checks.runs.length>0&&e(ee)}),T(a),F(e=>{ra(a,1,e),B(l,`#${I(r).number??``}`),B(d,I(r).title),W(f,`href`,I(r).url),B(x,`${I(r).baseRefName??``} ← ${I(r).headRefName??``}`)},[()=>Zi(ul(`rounded-md border px-2 py-1.5`,I(i)&&`border-accent bg-muted/40`))]),bi(`click`,s,()=>t.onOpenPr(I(r).number)),bi(`click`,v,()=>n(n()===I(r).number?void 0:I(r).number)),z(e,a)}),T(r),z(e,r)};V(a,e=>{t.selectedRepoSummary&&!t.selectedRepoSummary.hasRemote?e(o):t.selectedRepoSummary&&!t.selectedRepoSummary.hasGithubRemote?e(s,1):t.github?t.github.available?t.github.authenticated?t.loadingPrs&&t.prs.length===0?e(d,5):t.sortedPrs.length===0?e(f,6):e(p,-1):e(u,4):e(l,3):e(c,2)}),z(e,i)},$$slots:{actions:!0,default:!0}}),O()}xi([`click`]);var yke=new Set([`$$slots`,`$$events`,`$$legacy`]);function bke(e,t){let n=G(t,yke),r=[[`path`,{d:`m5 12 7-7 7 7`}],[`path`,{d:`M12 19V5`}]];uc(e,K({name:`arrow-up`},()=>n,{get iconNode(){return r}}))}var xke=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ske(e,t){let n=G(t,xke),r=[[`path`,{d:`M12 13v8l-4-4`}],[`path`,{d:`m12 21 4-4`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`}]];uc(e,K({name:`cloud-download`},()=>n,{get iconNode(){return r}}))}var Cke=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function k8(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=G(t,Cke);var i=R();U(N(i),()=>mb,(e,t)=>{t(e,K(()=>r,{get open(){return n()},set open(e){n(e)}}))}),z(e,i),O()}var wke=new Set([`$$slots`,`$$events`,`$$legacy`]);function Tke(e,t){let n=G(t,wke);var r=R();U(N(r),()=>im,(e,t)=>{t(e,K(()=>n))}),z(e,r)}var Eke=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`sideOffset`,`align`,`portalProps`]);function A8(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`sideOffset`,3,4),i=q(t,`align`,3,`center`),a=G(t,Eke);Tke(e,K(()=>t.portalProps,{children:(e,o)=>{var s=R(),c=N(s);{let e=k(()=>ul(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 flex flex-col gap-4 rounded-md p-4 text-sm shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 w-72 origin-(--transform-origin) outline-hidden`,t.class));U(c,()=>zy,(t,o)=>{o(t,K({"data-slot":`popover-content`,get sideOffset(){return r()},get align(){return i()},get class(){return I(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,s)},$$slots:{default:!0}})),O()}var Dke=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function j8(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Dke);var i=R(),a=N(i);{let e=k(()=>ul(``,t.class));U(a,()=>Hy,(t,i)=>{i(t,K({"data-slot":`popover-trigger`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var Oke=Dl({base:`hover:text-foreground aria-pressed:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive gap-1 rounded-md text-sm font-medium transition-[color,box-shadow] [&_svg:not([class*='size-'])]:size-4 group/toggle hover:bg-muted inline-flex items-center justify-center whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,variants:{variant:{default:`bg-transparent`,outline:`border-input hover:bg-muted border bg-transparent shadow-xs`},size:{default:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-10 min-w-10 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}});function kke(e){Tt(`toggleGroup`,e)}function Ake(){return wt(`toggleGroup`)}var jke=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`,`size`,`spacing`,`orientation`,`variant`]);function Mke(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`value`,15),i=q(t,`size`,3,`default`),a=q(t,`spacing`,3,0),o=q(t,`orientation`,3,`horizontal`),s=q(t,`variant`,3,`default`),c=G(t,jke);kke({get variant(){return s()},get size(){return i()},get spacing(){return a()},get orientation(){return o()}});var l=R(),u=N(l);{let e=k(()=>`--gap: ${a()}`),l=k(()=>ul(`rounded-md data-[spacing=0]:data-[variant=outline]:shadow-xs group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-vertical:flex-col data-vertical:items-stretch`,t.class));U(u,()=>AS,(t,u)=>{u(t,K({get orientation(){return o()},"data-slot":`toggle-group`,get"data-variant"(){return s()},get"data-size"(){return i()},get"data-spacing"(){return a()},get style(){return I(e)},get class(){return I(l)}},()=>c,{get value(){return r()},set value(e){r(e)},get ref(){return n()},set ref(e){n(e)}}))})}z(e,l),O()}var Nke=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`,`size`,`variant`]);function Pke(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Nke),i=Ake();var a=R(),o=N(a);{let e=k(()=>i.variant||t.variant),a=k(()=>i.size||t.size),s=k(()=>ul(`data-[state=on]:bg-muted group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-[spacing=0]/toggle-group:shadow-none group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md shrink-0 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,Oke({variant:i.variant||t.variant,size:i.size||t.size}),t.class));U(o,()=>NS,(o,c)=>{c(o,K({"data-slot":`toggle-group-item`,get"data-variant"(){return I(e)},get"data-size"(){return I(a)},get"data-spacing"(){return i.spacing},get class(){return I(s)},get value(){return t.value}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,a),O()}var Fke=L(`<span class="inline-flex h-6 w-6 items-center justify-center text-muted-foreground" role="status" aria-label="Refreshing Git status" title="Refreshing Git status"><!></span>`),Ike=L(`<!> <span class="truncate font-mono"> </span> <!>`,1),Lke=L(`<div class="flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground"><!> Loading branches…</div>`),Rke=L(`<div class="px-3 py-2 text-xs text-muted-foreground">No branches found.</div>`),zke=L(`<button type="button" class="flex w-full items-center gap-2 border-b px-2.5 py-1.5 text-left text-xs last:border-b-0 hover:bg-muted/60 disabled:opacity-60"><!> <span class="min-w-0 flex-1 truncate font-mono text-foreground"> </span> <!></button>`),Bke=L(`<!> Create`,1),Vke=L(`<div class="flex flex-col gap-0.5"><div class="text-xs font-medium text-foreground">Switch branch</div> <div class="text-xs text-muted-foreground">Current: <span class="font-mono text-foreground"> </span></div></div> <div class="relative"><!> <!></div> <div class="max-h-56 overflow-y-auto rounded-md border"><!></div> <div class="flex flex-col gap-1.5 border-t pt-3"><div class="text-xs font-medium text-foreground">Create from current</div> <div class="flex gap-1.5"><!> <!></div></div>`,1),M8=L(`<!> <!>`,1),Hke=L(`<span class="text-muted-foreground">local only</span>`),Uke=L(`<span class="text-muted-foreground">no upstream</span>`),Wke=L(`<span class="flex items-center gap-0.5 text-muted-foreground"><!> up to date</span>`),N8=L(`<!> `,1),Gke=L(`<div class="flex flex-col gap-2"><!> <div class="flex items-center gap-2"><!> <!> <div class="flex min-w-0 items-center gap-1 text-xs"><!> <!></div></div></div>`),Kke=L(`<div class="py-1 text-xs text-muted-foreground">Loading…</div>`);function qke(e,t){D(t,!0);let n=e=>{var n=R(),r=N(n),i=e=>{var t=Fke();tD(M(t),{size:12,class:`animate-spin`}),T(t),z(e,t)};V(r,e=>{t.refreshing&&e(i)}),z(e,n)},r=q(t,`branchFilter`,15,``),i=q(t,`newBranchName`,15,``),a=q(t,`branchPopoverOpen`,15,!1),o=q(t,`open`,15,!0);dT(e,{title:`Repo & Branch`,get icon(){return kd},get actions(){return n},get open(){return o()},set open(e){o(e)},children:(e,n)=>{var o=R(),s=N(o),c=e=>{let n=k(()=>t.repoSummary);var o=Gke(),s=M(o),c=e=>{Mke(e,{type:`single`,get value(){return t.selectedRepo},variant:`outline`,size:`sm`,class:`flex-wrap`,onValueChange:e=>{e&&t.onSelectRepo(e)},children:(e,n)=>{var r=R();Ri(N(r),17,()=>t.repos,e=>e.relativePath,(e,t,n,r)=>{{let n=k(()=>`Switch to ${I(t).name}`),r=k(()=>WOe(I(t)));Pke(e,{get value(){return I(t).relativePath},get"aria-label"(){return I(n)},get title(){return I(r)},class:`font-mono text-xs`,children:(e,n)=>{E();var r=ki();F(()=>B(r,I(t).name)),z(e,r)},$$slots:{default:!0}})}}),z(e,r)},$$slots:{default:!0}})};V(s,e=>{t.repos.length>1&&e(c)});var l=P(s,2),u=M(l);U(u,()=>k8,(e,o)=>{o(e,{get open(){return a()},set open(e){a(e)},children:(e,a)=>{var o=M8(),s=N(o);{let e=k(()=>ul(`inline-flex min-w-0 items-center gap-1.5 rounded-md border bg-background px-2 py-1 text-xs font-medium text-foreground shadow-xs transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,I(n).detached&&`text-muted-foreground`));U(s,()=>j8,(t,r)=>{r(t,{get class(){return I(e)},children:(e,t)=>{var r=Ike(),i=N(r);kd(i,{size:12,strokeWidth:2.2,class:`shrink-0`});var a=P(i,2),o=M(a,!0);T(a),Kw(P(a,2),{size:12,strokeWidth:2.2,class:`shrink-0 text-muted-foreground`}),F(()=>B(o,I(n).currentBranch??`(detached)`)),z(e,r)},$$slots:{default:!0}})})}U(P(s,2),()=>A8,(e,a)=>{a(e,{align:`start`,collisionPadding:8,class:`w-[min(360px,calc(100vw-2rem))] gap-3 p-3`,children:(e,a)=>{var o=Vke(),s=N(o),c=P(M(s),2),l=P(M(c)),u=M(l,!0);T(l),T(c),T(s);var d=P(s,2),f=M(d);cZ(f,{size:13,strokeWidth:2.1,class:`pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground`}),DQ(P(f,2),{placeholder:`Filter branches`,class:`h-8 pl-7 text-xs`,get value(){return r()},set value(e){r(e)}}),T(d);var p=P(d,2),m=M(p),h=e=>{var t=Lke();tD(M(t),{size:13,class:`animate-spin`}),E(),T(t),z(e,t)},g=e=>{z(e,Rke())},_=e=>{var n=R();Ri(N(n),17,()=>t.filteredBranches,e=>e.name,(e,n)=>{var r=zke(),i=M(r),a=e=>{tD(e,{size:13,class:`animate-spin text-muted-foreground`})},o=e=>{JQ(e,{size:13,class:`text-success`})},s=e=>{kd(e,{size:13,class:`text-muted-foreground`})};V(i,e=>{t.switchingBranch===I(n).name?e(a):I(n).current?e(o,1):e(s,-1)});var c=P(i,2),l=M(c,!0);T(c);var u=P(c,2),d=e=>{uf(e,{tone:`neutral`,size:`xs`,children:(e,t)=>{E(),z(e,ki(`remote`))},$$slots:{default:!0}})};V(u,e=>{I(n).remote&&e(d)}),T(r),F(()=>{r.disabled=I(n).current||t.switchingBranch===I(n).name,B(l,I(n).name)}),bi(`click`,r,()=>void t.onSwitchBranch(t.selectedRepo,I(n))),z(e,r)}),z(e,n)};V(m,e=>{t.loadingBranches?e(h):t.filteredBranches.length===0?e(g,1):e(_,-1)}),T(p);var v=P(p,2),y=P(M(v),2),b=M(y);DQ(b,{placeholder:`feature/branch-name`,class:`h-8 font-mono text-xs`,get value(){return i()},set value(e){i(e)}});var x=P(b,2);{let e=k(()=>t.creatingBranch||i().trim().length===0);Ml(x,{size:`sm`,get disabled(){return I(e)},onclick:()=>void t.onCreateBranch(t.selectedRepo),children:(e,n)=>{var r=Bke(),i=N(r),a=e=>{tD(e,{class:`animate-spin`})},o=e=>{kd(e,{})};V(i,e=>{t.creatingBranch?e(a):e(o,-1)}),E(),z(e,r)},$$slots:{default:!0}})}T(y),T(v),F(()=>B(u,I(n).currentBranch??`detached`)),z(e,o)},$$slots:{default:!0}})}),z(e,o)},$$slots:{default:!0}})});var d=P(u,2),f=e=>{Ml(e,{size:`icon-xs`,variant:`ghost`,ariaLabel:`Fetch`,title:`Fetch from remote`,get disabled(){return t.fetching},onclick:()=>void t.onFetch(t.selectedRepo),children:(e,n)=>{var r=R(),i=N(r),a=e=>{tD(e,{class:`animate-spin`})},o=e=>{Ske(e,{})};V(i,e=>{t.fetching?e(a):e(o,-1)}),z(e,r)},$$slots:{default:!0}})};V(d,e=>{I(n).hasRemote&&e(f)});var p=P(d,2),m=M(p),h=e=>{z(e,Hke())},g=e=>{z(e,Uke())},_=e=>{var t=Wke();JQ(M(t),{size:12,strokeWidth:2.2}),E(),T(t),z(e,t)},v=e=>{var r=M8(),i=N(r),a=e=>{{let r=k(()=>`Sync branch (${I(n).ahead} commits to push)`),i=k(()=>t.syncing||I(n).detached);Ml(e,{size:`xs`,variant:`ghost`,class:`gap-0.5 px-1.5 font-mono text-info`,title:`Sync current branch with upstream`,get ariaLabel(){return I(r)},get disabled(){return I(i)},onclick:()=>void t.onSync(t.selectedRepo),children:(e,r)=>{var i=N8(),a=N(i),o=e=>{tD(e,{class:`animate-spin`})},s=e=>{bke(e,{strokeWidth:2.4})};V(a,e=>{t.syncing?e(o):e(s,-1)});var c=P(a);F(()=>B(c,` ${I(n).ahead??``}`)),z(e,i)},$$slots:{default:!0}})}};V(i,e=>{(I(n).ahead??0)>0&&e(a)});var o=P(i,2),s=e=>{{let r=k(()=>`Sync branch (${I(n).behind} commits to pull)`),i=k(()=>t.syncing||I(n).detached);Ml(e,{size:`xs`,variant:`ghost`,class:`gap-0.5 px-1.5 font-mono text-warning`,title:`Sync current branch with upstream`,get ariaLabel(){return I(r)},get disabled(){return I(i)},onclick:()=>void t.onSync(t.selectedRepo),children:(e,r)=>{var i=N8(),a=N(i),o=e=>{tD(e,{class:`animate-spin`})},s=e=>{yE(e,{strokeWidth:2.4})};V(a,e=>{t.syncing?e(o):e(s,-1)});var c=P(a);F(()=>B(c,` ${I(n).behind??``}`)),z(e,i)},$$slots:{default:!0}})}};V(o,e=>{(I(n).behind??0)>0&&e(s)}),z(e,r)};V(m,e=>{I(n).hasRemote?I(n).hasUpstream?(I(n).ahead??0)===0&&(I(n).behind??0)===0?e(_,2):e(v,-1):e(g,1):e(h)});var y=P(m,2),b=e=>{uf(e,{tone:`warn`,size:`xs`,children:(e,t)=>{E(),z(e,ki(`detached`))},$$slots:{default:!0}})};V(y,e=>{I(n).detached&&e(b)}),T(p),T(l),T(o),z(e,o)},l=e=>{z(e,Kke())};V(s,e=>{t.repoSummary?e(c):e(l,-1)}),z(e,o)},$$slots:{default:!0}}),O()}xi([`click`]);var Jke=L(`<p class="px-1 py-6 text-center text-xs text-muted-foreground">Select a project to inspect its git repositories.</p>`),Yke=L(`<div class="px-3 py-3 text-xs text-destructive"> </div>`),Xke=L(`<div class="flex items-center justify-center gap-2 px-1 py-6 text-xs text-muted-foreground"><!> Loading git repositories…</div>`),Zke=L(`<p class="px-1 py-6 text-center text-xs text-muted-foreground">No git repositories found in this directory (searched up to 2 levels deep).</p>`),Qke=L(`<div class="px-3 py-2 text-xs text-warning"> </div>`),$ke=L(`<div class="flex flex-col gap-2"><!> <!> <!> <!></div>`),eAe=L(`<div class="p-2"><!></div> <!>`,1);function tAe(e,t){D(t,!0);let n=A(!0),r=A(!0),i=A(!0),a=A(!1),o=A(``),s=A(``),c=A(void 0),l=A(void 0),u=A(!1),d=k(()=>t.activeProject?H6.projects[rE(t.activeProject.id)]:void 0),f=k(()=>I(d)?.repos??[]),p=k(()=>I(d)?.selectedRepo??`.`),m=k(()=>I(d)?.repoStates[iE(I(p))]),h=k(()=>I(m)?.repoSummary),g=k(()=>I(m)?.changes),_=k(()=>I(m)?.operations),v=k(()=>I(m)?.github),y=k(()=>I(m)?.prs??[]),b=k(()=>I(m)?.branches??[]),x=k(()=>I(h)??I(f).find(e=>e.relativePath===I(p))),S=k(()=>!!(I(x)?.hasRemote&&I(x).hasGithubRemote)),ee=k(()=>I(d)?.discoverError),C=k(()=>I(d)?.loadingRepos??!1),te=k(()=>!!(t.activeProject&&!I(d))||I(C)||!!(I(d)?.reposRequestInFlight&&!I(d).loaded&&I(f).length===0)),ne=k(()=>I(d)?.refreshingRepos??!1),re=k(()=>I(m)?.loadingOverview??!1),ie=k(()=>I(m)?.loadingPrs??!1),ae=k(()=>I(m)?.loadingBranches??!1),oe=k(()=>I(_)?.fetching??!1),w=k(()=>I(_)?.syncing??!1),se=k(()=>I(_)?.switchingBranch),ce=k(()=>I(_)?.creatingBranch??!1),le=k(()=>I(_)?.fileMutation),ue=k(()=>I(_)?.bulkMutation),de=k(()=>I(ne)||I(re)&&!!(I(h)||I(g))),fe=k(()=>I(g)?.files.filter(e=>e.staged)??[]),pe=k(()=>I(g)?.files.filter(e=>e.untracked||e.worktree!==` `)??[]),me=k(()=>I(h)?.currentBranch??null),he=k(()=>IOe(I(y))),ge=k(()=>I(b).filter(e=>e.name.toLowerCase().includes(I(o).trim().toLowerCase()))),_e=k(()=>[...I(y)].sort((e,t)=>{let n=I(me),r=n!==null&&e.headRefName===n;return r===(n!==null&&t.headRefName===n)?Date.parse(t.updatedAt)-Date.parse(e.updatedAt):r?-1:1}));function ve(e){!t.activeProject||e===I(p)||(wOe(t.activeProject.id,e),j(o,``),j(s,``),j(c,void 0))}async function ye(e){t.activeProject&&await EOe(t.activeProject.id,e)}async function be(e){t.activeProject&&await DOe(t.activeProject.id,e)}async function xe(e,n){t.activeProject&&await OOe(t.activeProject.id,e,n)&&(j(a,!1),j(o,``),j(s,``))}async function Se(e){!t.activeProject||I(s).trim().length===0||await kOe(t.activeProject.id,e,I(s))&&(j(a,!1),j(o,``),j(s,``))}async function Ce(e,n,r){t.activeProject&&await AOe(t.activeProject.id,e,n,r)}async function we(e,n){t.activeProject&&await jOe(t.activeProject.id,e,n)}function Te(e){j(l,{repo:I(p),file:e},!0),j(u,!0)}function Ee(){let e=I(l);j(l,void 0),e&&Ce(e.repo,e.file,`discard`)}function De(){t.activeProject&&s8(t.activeProject.id,I(p))}function Oe(e){t.activeProject&&ROe({projectId:t.activeProject.id,repo:I(p),number:e})}let ke=A(void 0);sr(()=>{let e=t.activeProject,n=e?.id;n!==I(ke)&&(j(ke,n,!0),j(o,``),j(s,``),j(c,void 0),e&&queueMicrotask(()=>COe(e)))}),sr(()=>{let e=t.activeProject?.id,n=I(p),r=I(f).length;if(!e||r===0||!n)return;let i=window.setInterval(()=>SOe(e,n),5e3);return()=>window.clearInterval(i)}),sr(()=>{!I(a)||!t.activeProject||I(f).length===0||xOe(t.activeProject.id,I(p))}),sr(()=>{let e=t.activeProject?.id,n=I(p),r=I(f).length,i=I(v)?.authenticated,a=I(he),o=I(S);if(!e||r===0||!n||!o||!i||!a)return;let s=()=>{typeof document<`u`&&document.visibilityState!==`visible`||s8(e,n,!0)};s();let c=window.setInterval(s,1e4);return()=>window.clearInterval(c)});var Ae=eAe(),je=N(Ae),Me=M(je),Ne=e=>{z(e,Jke())},Pe=e=>{v8(e,{class:`gap-0 overflow-hidden p-0`,children:(e,t)=>{var n=Yke(),r=M(n,!0);T(n),F(()=>B(r,I(ee))),z(e,n)},$$slots:{default:!0}})},Fe=e=>{var t=Xke();tD(M(t),{size:13,class:`animate-spin`}),E(),T(t),z(e,t)},Ie=e=>{z(e,Zke())},Le=e=>{var t=$ke(),l=M(t),u=e=>{v8(e,{class:`gap-0 overflow-hidden p-0`,children:(e,t)=>{var n=Qke(),r=M(n);T(n),F(()=>B(r,`Using cached Git data. Refresh failed: ${I(ee)??``}`)),z(e,n)},$$slots:{default:!0}})};V(l,e=>{I(ee)&&e(u)});var d=P(l,2);qke(d,{get repoSummary(){return I(h)},get repos(){return I(f)},get selectedRepo(){return I(p)},get filteredBranches(){return I(ge)},get loadingBranches(){return I(ae)},get switchingBranch(){return I(se)},get creatingBranch(){return I(ce)},get fetching(){return I(oe)},get syncing(){return I(w)},get refreshing(){return I(de)},onSelectRepo:ve,onSwitchBranch:xe,onCreateBranch:Se,onFetch:ye,onSync:be,get branchFilter(){return I(o)},set branchFilter(e){j(o,e,!0)},get newBranchName(){return I(s)},set newBranchName(e){j(s,e,!0)},get branchPopoverOpen(){return I(a)},set branchPopoverOpen(e){j(a,e,!0)},get open(){return I(n)},set open(e){j(n,e,!0)}});var m=P(d,2);ike(m,{get changes(){return I(g)},get stagedFiles(){return I(fe)},get unstagedFiles(){return I(pe)},get fileMutation(){return I(le)},get bulkMutation(){return I(ue)},get selectedRepo(){return I(p)},get loadingOverview(){return I(re)},onMutateFile:Ce,onBulkStage:we,onRequestDiscard:Te,get open(){return I(r)},set open(e){j(r,e,!0)}}),vke(P(m,2),{get sortedPrs(){return I(_e)},get prs(){return I(y)},get selectedRepoSummary(){return I(x)},get github(){return I(v)},get selectedRepoHasGithubRemote(){return I(S)},get loadingPrs(){return I(ie)},get currentBranchName(){return I(me)},onRefreshPrs:De,onOpenPr:Oe,get expandedPr(){return I(c)},set expandedPr(e){j(c,e,!0)},get open(){return I(i)},set open(e){j(i,e,!0)}}),T(t),z(e,t)};V(Me,e=>{t.activeProject?I(ee)&&I(f).length===0?e(Pe,1):I(te)?e(Fe,2):I(f).length===0?e(Ie,3):e(Le,-1):e(Ne)}),T(je);var Re=P(je,2);{let e=k(()=>I(l)?`This will permanently discard all uncommitted changes for ${I(l).file.path}.`:`This will permanently discard this uncommitted change.`);SQ(Re,{title:`Discard change?`,get description(){return I(e)},confirmLabel:`Discard`,destructive:!0,onConfirm:Ee,onCancel:()=>j(l,void 0),get open(){return I(u)},set open(e){j(u,e,!0)}})}z(e,Ae),O()}var nAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function rAe(e,t){let n=G(t,nAe);tAe(e,K(()=>n))}function iAe(e){switch(e.status){case`passing`:return`good`;case`failing`:return`danger`;case`pending`:return`warn`;default:return`neutral`}}function aAe(e){return!e||e.isDraft?`neutral`:e.state===`MERGED`?`accent`:e.state===`CLOSED`?`danger`:`good`}function oAe(e){return e?e.isDraft?`draft`:e.state.toLowerCase():``}function sAe(e){return e===`APPROVED`?`good`:e===`CHANGES_REQUESTED`?`danger`:`warn`}function cAe(e){let t=e.toLowerCase();return[`success`,`neutral`,`skipped`,`completed`].includes(t)?`good`:[`failure`,`error`,`cancelled`,`timed_out`,`action_required`].includes(t)?`danger`:`warn`}function lAe(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString()}var uAe=L(`<div class="pr-empty svelte-6fj9e1"><!> <strong class="svelte-6fj9e1">No pull request selected</strong> <p>Open a PR from the Git panel to view its details here.</p></div>`),dAe=L(`<div class="pr-empty svelte-6fj9e1"><!> <strong class="svelte-6fj9e1">Loading pull request</strong> <p> </p></div>`),fAe=L(`<div class="pr-empty danger svelte-6fj9e1"><!> <strong class="svelte-6fj9e1">Could not open pull request</strong> <p> </p></div>`),pAe=L(`<!> `,1),mAe=L(`<span>by <span class="mono svelte-6fj9e1"> </span></span>`),hAe=L(`<span> </span>`),gAe=L(`<!> Refresh`,1),_Ae=L(`<!> Open in browser`,1),vAe=L(`<!> Checkout branch`,1),yAe=L(`<li class="pr-run svelte-6fj9e1"><!> <span class="truncate svelte-6fj9e1"> </span></li>`),bAe=L(`<section class="pr-section svelte-6fj9e1"><h2 class="svelte-6fj9e1">Checks</h2> <ul class="pr-list svelte-6fj9e1"></ul></section>`),xAe=L(`<div class="pr-body svelte-6fj9e1"><!></div>`),SAe=L(`<p class="pr-muted svelte-6fj9e1">No description provided.</p>`),CAe=L(`<p class="pr-muted svelte-6fj9e1">No file data available.</p>`),wAe=L(`<li class="pr-file svelte-6fj9e1"><span class="mono truncate svelte-6fj9e1"> </span> <span class="mono diffstat svelte-6fj9e1"><span class="add svelte-6fj9e1"> </span> <span class="del svelte-6fj9e1"> </span></span></li>`),P8=L(`<ul class="pr-list svelte-6fj9e1"></ul>`),TAe=L(`<p class="pr-muted svelte-6fj9e1">No commit data available.</p>`),EAe=L(`<li class="pr-commit svelte-6fj9e1"><!> <span class="mono pr-hash svelte-6fj9e1"> </span> <span class="truncate svelte-6fj9e1"> </span></li>`),DAe=L(`<header class="pr-header svelte-6fj9e1"><div class="pr-title-row svelte-6fj9e1"><span class="pr-number svelte-6fj9e1"> </span> <h1 class="pr-title svelte-6fj9e1"> </h1></div> <div class="pr-meta svelte-6fj9e1"><!> <!> <!> <span class="pr-branches svelte-6fj9e1"><span class="mono svelte-6fj9e1"> </span> ← <span class="mono svelte-6fj9e1"> </span></span></div> <div class="pr-subline svelte-6fj9e1"><!> <!> <span class="mono diffstat svelte-6fj9e1"><span class="add svelte-6fj9e1"> </span> <span class="del svelte-6fj9e1"> </span> </span></div> <div class="pr-actions svelte-6fj9e1"><!> <!> <!></div></header> <!> <section class="pr-section svelte-6fj9e1"><h2 class="svelte-6fj9e1">Description</h2> <!></section> <section class="pr-section svelte-6fj9e1"><h2 class="svelte-6fj9e1"> </h2> <!></section> <section class="pr-section svelte-6fj9e1"><h2 class="svelte-6fj9e1"> </h2> <!></section>`,1),OAe=L(`<section class="pr-pane svelte-6fj9e1"><!></section>`);function kAe(e,t){D(t,!0);let n=k(()=>t.view?.detail),r=k(()=>y8(I(n)?.checks));function i(){I(n)&&window.confirm(`Check out PR #${I(n).number} (${I(n).headRefName}) in this repo?`)&&t.onCheckout?.()}sr(()=>{let e=t.view?.id,n=I(r);if(!e||!n||!t.onRefresh)return;let i=()=>{typeof document<`u`&&document.visibilityState!==`visible`||t.onRefresh()};i();let a=window.setInterval(i,1e4);return()=>window.clearInterval(a)});var a=OAe();pZ(M(a),{class:`pr-scroll`,viewportClass:`pr-viewport`,type:`auto`,children:(e,r)=>{var a=R(),o=N(a),s=e=>{var t=uAe();u$(M(t),{size:28,strokeWidth:1.7}),E(4),T(t),z(e,t)},c=e=>{var n=dAe(),r=M(n);O8(r,{class:`spin`,size:28,strokeWidth:1.7});var i=P(r,4),a=M(i);T(i),T(n),F(()=>B(a,`#${t.view.number??``}`)),z(e,n)},l=e=>{var n=fAe(),r=M(n);Vd(r,{size:28,strokeWidth:1.7});var i=P(r,4),a=M(i,!0);T(i),T(n),F(()=>B(a,t.view.error)),z(e,n)},u=e=>{var r=DAe(),a=N(r),o=M(a),s=M(o),c=M(s);T(s);var l=P(s,2),u=M(l,!0);T(l),T(o);var d=P(o,2),f=M(d);{let e=k(()=>aAe(I(n)));uf(f,{get tone(){return I(e)},size:`sm`,children:(e,t)=>{E();var r=ki();F(e=>B(r,e),[()=>oAe(I(n))]),z(e,r)},$$slots:{default:!0}})}var p=P(f,2);{let e=k(()=>iAe(I(n).checks));uf(p,{get tone(){return I(e)},size:`sm`,children:(e,t)=>{var r=pAe(),i=N(r),a=e=>{JQ(e,{size:11})},o=e=>{ZX(e,{size:11})},s=e=>{tD(e,{class:`spin`,size:11})};V(i,e=>{I(n).checks.status===`passing`?e(a):I(n).checks.status===`failing`?e(o,1):I(n).checks.status===`pending`&&e(s,2)});var c=P(i);F(()=>B(c,` ${I(n).checks.status===`none`?`no checks`:`${I(n).checks.passed}/${I(n).checks.total} checks`}`)),z(e,r)},$$slots:{default:!0}})}var m=P(p,2),h=e=>{{let t=k(()=>sAe(I(n).reviewDecision));uf(e,{get tone(){return I(t)},size:`sm`,children:(e,t)=>{E();var r=ki();F(e=>B(r,e),[()=>I(n).reviewDecision.replace(`_`,` `).toLowerCase()]),z(e,r)},$$slots:{default:!0}})}};V(m,e=>{I(n).reviewDecision&&e(h)});var g=P(m,2),_=M(g),v=M(_,!0);T(_);var y=P(_,2),b=M(y,!0);T(y),T(g),T(d);var x=P(d,2),S=M(x),ee=e=>{var t=mAe(),r=P(M(t)),i=M(r,!0);T(r),T(t),F(()=>B(i,I(n).author)),z(e,t)};V(S,e=>{I(n).author&&e(ee)});var C=P(S,2),te=e=>{var t=hAe(),r=M(t);T(t),F(e=>B(r,`opened ${e??``}`),[()=>lAe(I(n).createdAt)]),z(e,t)};V(C,e=>{I(n).createdAt&&e(te)});var ne=P(C,2),re=M(ne),ie=M(re);T(re);var ae=P(re,2),oe=M(ae);T(ae);var w=P(ae);T(ne),T(x);var se=P(x,2),ce=M(se);Ml(ce,{size:`sm`,variant:`outline`,get disabled(){return t.view.loading},onclick:()=>t.onRefresh?.(),children:(e,n)=>{var r=gAe(),i=N(r);{let e=k(()=>t.view.loading?`spin`:``);O8(i,{get class(){return I(e)},size:14})}E(),z(e,r)},$$slots:{default:!0}});var le=P(ce,2);Ml(le,{size:`sm`,variant:`outline`,onclick:()=>t.onOpenExternal?.(),children:(e,t)=>{var n=_Ae();wQ(N(n),{size:14}),E(),z(e,n)},$$slots:{default:!0}}),Ml(P(le,2),{size:`sm`,variant:`outline`,onclick:i,children:(e,t)=>{var n=vAe();C8(N(n),{size:14}),E(),z(e,n)},$$slots:{default:!0}}),T(se),T(a);var ue=P(a,2),de=e=>{var t=bAe(),r=P(M(t),2);Ri(r,21,()=>I(n).checks.runs,e=>e.name,(e,t)=>{var n=yAe(),r=M(n);{let e=k(()=>cAe(I(t).status));uf(r,{get tone(){return I(e)},size:`xs`,children:(e,n)=>{E();var r=ki();F(()=>B(r,I(t).status)),z(e,r)},$$slots:{default:!0}})}var i=P(r,2),a=M(i,!0);T(i),T(n),F(()=>B(a,I(t).name)),z(e,n)}),T(r),T(t),z(e,t)};V(ue,e=>{I(n).checks.runs.length>0&&e(de)});var fe=P(ue,2),pe=P(M(fe),2),me=e=>{var t=xAe();z3(M(t),{get text(){return I(n).body},get onCopy(){return ld}}),T(t),z(e,t)},he=k(()=>I(n).body.trim()),ge=e=>{z(e,SAe())};V(pe,e=>{I(he)?e(me):e(ge,-1)}),T(fe);var _e=P(fe,2),ve=M(_e),ye=M(ve);T(ve);var be=P(ve,2),xe=e=>{z(e,CAe())},Se=e=>{var t=P8();Ri(t,21,()=>I(n).files,e=>e.path,(e,t)=>{var n=wAe(),r=M(n),i=M(r,!0);T(r);var a=P(r,2),o=M(a),s=M(o);T(o);var c=P(o,2),l=M(c);T(c),T(a),T(n),F(()=>{W(r,`title`,I(t).path),B(i,I(t).path),B(s,`+${I(t).additions??``}`),B(l,`−${I(t).deletions??``}`)}),z(e,n)}),T(t),z(e,t)};V(be,e=>{I(n).files.length===0?e(xe):e(Se,-1)}),T(_e);var Ce=P(_e,2),we=M(Ce),Te=M(we);T(we);var Ee=P(we,2),De=e=>{z(e,TAe())},Oe=e=>{var t=P8();Ri(t,21,()=>I(n).commits,e=>e.oid,(e,t)=>{var n=EAe(),r=M(n);l$(r,{size:13,strokeWidth:2.1});var i=P(r,2),a=M(i,!0);T(i);var o=P(i,2),s=M(o,!0);T(o),T(n),F(()=>{B(a,I(t).abbrev),B(s,I(t).messageHeadline)}),z(e,n)}),T(t),z(e,t)};V(Ee,e=>{I(n).commits.length===0?e(De):e(Oe,-1)}),T(Ce),F(()=>{B(c,`#${I(n).number??``}`),B(u,I(n).title),B(v,I(n).baseRefName),B(b,I(n).headRefName),B(ie,`+${I(n).additions??``}`),B(oe,`−${I(n).deletions??``}`),B(w,` · ${I(n).changedFiles??``} files`),B(ye,`Files changed (${I(n).changedFiles??``})`),B(Te,`Commits (${I(n).commits.length??``})`)}),z(e,r)};V(o,e=>{t.view?t.view.loading&&!I(n)?e(c,1):t.view.error&&!I(n)?e(l,2):I(n)&&e(u,3):e(s)}),z(e,a)},$$slots:{default:!0}}),T(a),z(e,a),O()}var AAe=1e4,jAe=5e3,F8=2e3,I8=new Set,L8,R8,z8=0;function MAe(e){return e===`poll`&&typeof document<`u`&&document.visibilityState!==`visible`}function B8(){R8===void 0||typeof window>`u`||(window.clearTimeout(R8),R8=void 0)}function V8(e,t,n){R8!==void 0||typeof window>`u`||(R8=window.setTimeout(()=>{R8=void 0,H8(e,{...t,force:!1})},n))}function NAe(e){let t=jT.gitContext;!t||t.projectId!==e.projectId||z6(t)!==z6(e)?jT.gitContext=e:jT.gitContext={...t,loadedAt:e.loadedAt}}async function PAe(e,t={}){let n=Y.projects.find(t=>t.id===e);if(!n)return;await i8(n,{force:t.force,silent:!0,onlyIfChanged:!t.force}),r8(e);let r=jT.gitContext;return r?.projectId===e?r:void 0}async function H8(e,t={}){let n=e??TT.projectId;if(!n||MAe(t.reason))return;t.force&&B8();let r=Date.now(),i=r-z8;if(!t.force&&z8>0&&i<F8){V8(n,t,F8-i);return}if(I8.has(n)){t.force&&V8(n,t,F8);return}z8=r,I8.add(n);try{let e=await PAe(n,t);e&&NAe(e)}catch{jT.gitContext?.projectId===n&&(jT.gitContext=void 0)}finally{I8.delete(n)}}function FAe(){B8(),jT.gitContext=void 0}function U8(){if(typeof document<`u`&&document.visibilityState!==`visible`)return;let e=TT.projectId;nOe(jT.gitContext,e,Date.now(),jAe)&&H8(e,{reason:`focus`,force:jT.gitContext?.projectId!==e})}function IAe(){return typeof window>`u`||L8!==void 0?W8:(L8=window.setInterval(()=>{H8(TT.projectId,{reason:`poll`})},AAe),window.addEventListener(`focus`,U8),typeof document<`u`&&document.addEventListener(`visibilitychange`,U8),W8)}function W8(){typeof window>`u`||(L8!==void 0&&(window.clearInterval(L8),L8=void 0),B8(),window.removeEventListener(`focus`,U8),typeof document<`u`&&document.removeEventListener(`visibilitychange`,U8))}function G8(e){TOe(e),H8(e,{reason:`invalidate`,force:!0})}function LAe(e,t){D(t,!0);let n=k(()=>p8.activeCenterPrView);async function r(){let e=I(n);if(e)try{await yue(e.projectId,e.repo,e.number),G8(e.projectId),S8(e.id)}catch(e){Y.error=e instanceof Error?e.message:String(e)}}kAe(e,{get view(){return I(n)},onRefresh:()=>I(n)&&void S8(I(n).id),onCheckout:()=>void r(),onOpenExternal:()=>I(n)?.detail&&window.open(I(n).detail.url,`_blank`,`noopener`)}),O()}var RAe=new Set([`$$slots`,`$$events`,`$$legacy`]);function K8(e,t){let n=G(t,RAe),r=[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`}],[`path`,{d:`M21 3v5h-5`}]];uc(e,K({name:`rotate-cw`},()=>n,{get iconNode(){return r}}))}var zAe=L(`<code class="svelte-t34um8"><span class="seq svelte-t34um8">--</span><span class="time svelte-t34um8">--:--:--</span><span class="stream svelte-t34um8">--</span><span class="line svelte-t34um8">No logs captured.</span></code>`),BAe=L(`<code><span class="seq svelte-t34um8"> </span> <span class="time svelte-t34um8"> </span> <span class="stream svelte-t34um8"><!> </span> <span class="line svelte-t34um8"> </span></code>`),VAe=L(`<div class="log-terminal svelte-t34um8" role="log" aria-label="Task output" aria-live="polite"><!> <!></div>`);function HAe(e,t){D(t,!0);var n=VAe(),r=M(n),i=e=>{z(e,zAe())};V(r,e=>{(t.taskLogs?.events??[]).length===0&&e(i)}),Ri(P(r,2),17,()=>t.taskLogs?.events??[],Fi,(e,t)=>{var n=BAe(),r=M(n),i=M(r);T(r);var a=P(r,2),o=M(a,!0);T(a);var s=P(a,2),c=M(s);{let e=k(()=>oT(I(t).level));lC(c,{size:`xs`,get tone(){return I(e)}})}var l=P(c,1,!0);T(s);var u=P(s,2),d=M(u,!0);T(u),T(n),F(e=>{ra(n,1,Zi(I(t).level),`svelte-t34um8`),B(i,`#${I(t).seq??``}`),B(o,e),B(l,I(t).stream),B(d,I(t).line)},[()=>E1(I(t).ts)]),z(e,n)}),T(n),z(e,n),O()}var UAe=L(`<!>Refresh`,1),WAe=L(`<!>Restart`,1),GAe=L(`<!> `,1),KAe=L(`<!> <footer class="flex items-center gap-2 border-t bg-card px-3 py-1.5"><!> <!> <div class="flex min-w-0 flex-1 items-baseline gap-2"><strong class="truncate text-sm font-semibold text-foreground"> </strong> <span class="truncate font-mono text-xs text-muted-foreground"> <!><!></span></div> <!> <div class="flex shrink-0 items-center gap-0.5"><!> <!> <!></div></footer>`,1),qAe=L(`<div class="empty-center svelte-kzg5qd"><!> <p class="svelte-kzg5qd">Task not found.</p> <span>The task may have been removed or is no longer available.</span></div>`),JAe=L(`<section class="task-output-pane svelte-kzg5qd"><!></section>`);function YAe(e,t){D(t,!0);let n=k(()=>t.task?.name??t.task?.command??`Task output`),r=k(()=>t.task?.readiness.matched??t.task?.readiness.outcome),i=k(()=>iT(t.task?.status)),a=k(()=>c(t.task)),o=k(()=>l(t.task)),s=k(()=>t.task?[`starting`,`running`,`ready`,`stopping`,`orphaned`].includes(t.task.status):!1);function c(e){let t=[];return e?.runtime?.childPid&&t.push(`pid ${e.runtime.childPid}`),e?.runtime?.platform&&t.push(e.runtime.platform),t.length>0?t.join(` · `):void 0}function l(e){let t=e?.envInfo?.keys.length??0;return t>0?`env ${t} redacted`:void 0}var u=JAe(),d=M(u),f=e=>{var c=KAe(),l=N(c);HAe(l,{get taskLogs(){return t.taskLogs}});var u=P(l,2),d=M(u);{let e=k(()=>aT(t.task.status));lC(d,{get tone(){return I(i)},get pulse(){return I(e)}})}var f=P(d,2);zd(f,{class:`size-3.5 shrink-0 text-muted-foreground`,strokeWidth:2.2});var p=P(f,2),m=M(p),h=M(m,!0);T(m);var g=P(m,2),_=M(g),v=P(_),y=e=>{var t=ki();F(()=>B(t,`· ${I(a)??``}`)),z(e,t)};V(v,e=>{I(a)&&e(y)});var b=P(v),x=e=>{var t=ki();F(()=>B(t,`· ${I(o)??``}`)),z(e,t)};V(b,e=>{I(o)&&e(x)}),T(g),T(p);var S=P(p,2);{let e=k(()=>I(i)===`neutral`?`border-border bg-muted text-muted-foreground`:``);uf(S,{size:`xs`,get tone(){return I(i)},get class(){return I(e)},children:(e,n)=>{E();var r=ki();F(()=>B(r,t.task.status)),z(e,r)},$$slots:{default:!0}})}var ee=P(S,2),C=M(ee);Ml(C,{size:`sm`,variant:`ghost`,class:`h-7`,onclick:()=>t.onRefresh?.(),children:(e,t)=>{var n=UAe();O8(N(n),{size:13,strokeWidth:2.3}),E(),z(e,n)},$$slots:{default:!0}});var te=P(C,2);Ml(te,{size:`sm`,variant:`ghost`,class:`h-7`,onclick:()=>t.onRestart?.(t.task.id),children:(e,t)=>{var n=WAe();K8(N(n),{size:13,strokeWidth:2.3}),E(),z(e,n)},$$slots:{default:!0}});var ne=P(te,2),re=e=>{Ml(e,{size:`sm`,variant:`ghost`,class:`h-7 text-muted-foreground hover:text-destructive`,onclick:()=>t.onCancel?.(t.task.id),children:(e,n)=>{var r=GAe(),i=N(r);sD(i,{size:13,strokeWidth:2.3});var a=P(i,1,!0);F(()=>B(a,t.task.status===`orphaned`?`Clean up`:`Cancel`)),z(e,r)},$$slots:{default:!0}})};V(ne,e=>{I(s)&&e(re)}),T(ee),T(u),F(e=>{W(m,`title`,t.task.command),B(h,I(n)),W(g,`title`,t.task.cwd),B(_,`${e??``} · ${I(r)??``}`)},[()=>Hd(t.task.cwd,t.homeDir)]),z(e,c)},p=e=>{var t=qAe();zd(M(t),{size:30,strokeWidth:1.7}),E(4),T(t),z(e,t)};V(d,e=>{t.task?e(f):e(p,-1)}),T(u),z(e,u),O()}var q8={get tasks(){return PT.tasks},get scopedTasks(){let e=R6.activeProject?.dir;return e?PT.tasks.filter(t=>qd(t.cwd,e)):[]},get selectedTask(){return PT.tasks.find(e=>e.id===PT.selectedTaskId)},get activeCenterTask(){let e=Y.activeCenterTab;if(e?.kind===`task`)return PT.tasks.find(t=>t.id===e.id)},get taskLogs(){return PT.taskLogs}};async function XAe(e){PT.selectedTaskId=e,PT.taskLogs=await Qk(e)}async function J8(e){let t=PT.tasks.find(t=>t.id===e)?.status===`orphaned`;await Aue(e),await S6(),PT.selectedTaskId&&(PT.taskLogs=await Qk(PT.selectedTaskId)),cd.success(t?`Orphaned task cleanup completed`:`Task cancelled`)}async function Y8(e){let t=await jue(e);GT({kind:`task`,id:e},{kind:`task`,id:t.id}),PT.selectedTaskId=t.id,await S6(),PT.taskLogs=await Qk(t.id),cd.success(`Task restarted`,{description:t.name??t.id})}function X8(e){qT({kind:`task`,id:e}),Y.activeCenterTab?.kind===`task`&&Y.activeCenterTab.id===e&&QT(),PT.selectedTaskId===e&&(PT.selectedTaskId=void 0,PT.taskLogs=void 0)}async function ZAe(e){await Mue(e),X8(e),await S6(),cd.success(`Task removed`)}async function QAe(){let{removed:e}=await Nue();for(let t of e)X8(t);await S6(),cd.success(e.length===1?`Removed 1 finished task`:`Removed ${e.length} finished tasks`)}async function $Ae(e){let t=await kue(e);return await S6(),await XAe(t.id),cd.success(`Command started`,{description:e.command}),t}async function eje(){PT.selectedTaskId&&(PT.taskLogs=await Qk(PT.selectedTaskId))}function tje(e,t){D(t,!0);let n=k(()=>R6.status),r=k(()=>q8.taskLogs),i=k(()=>q8.activeCenterTask);{let t=k(()=>I(n)?.storage.home);YAe(e,{get task(){return I(i)},get taskLogs(){return I(r)},get homeDir(){return I(t)},onRefresh:()=>void eje(),onRestart:e=>void Y8(e),onCancel:e=>void J8(e)})}O()}var nje=new Set([`$$slots`,`$$events`,`$$legacy`]);function Z8(e,t){let n=G(t,nje),r=[[`path`,{d:`M12 17v5`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}]];uc(e,K({name:`pin`},()=>n,{get iconNode(){return r}}))}var rje=new Set([`$$slots`,`$$events`,`$$legacy`]);function Q8(e,t){let n=G(t,rje),r=[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`}]];uc(e,K({name:`play`},()=>n,{get iconNode(){return r}}))}var ije=L(`<span class="truncate text-xs font-medium text-foreground"> </span>`),aje=L(`<button><!> <span class="truncate font-mono text-xs text-muted-foreground"> </span></button>`),oje=L(`<span class="tt-title"> </span>`),sje=L(`<!> <span class="tt-row"><span class="tt-key">command</span> </span> <span class="tt-row"><span class="tt-key">cwd</span> </span>`,1),cje=L(`<!> <!>`,1),lje=L(`<div class="group/row flex items-center gap-1 rounded-md border bg-card pr-1.5 transition-colors hover:border-ring/40"><!> <div class="flex shrink-0 items-center gap-0.5"><!> <!></div></div>`);function uje(e,t){D(t,!0);let n=q(t,`cwd`,3,``),r=q(t,`running`,3,!1);function i(e){e.stopPropagation()}var a=lje(),o=M(a);U(o,()=>S1,(e,r)=>{r(e,{children:(e,r)=>{var i=cje(),a=N(i);{let e=(e,n)=>{let r=()=>n?.().props;var i=aje(),a=()=>t.onRun?.(t.command);Sa(i,()=>({...r(),class:`flex min-w-0 flex-1 flex-col gap-0.5 rounded-md px-2.5 py-2 text-left`,type:`button`,onclick:a}));var o=M(i),s=e=>{var n=ije(),r=M(n,!0);T(n),F(()=>B(r,t.command.label)),z(e,n)};V(o,e=>{t.command.label&&e(s)});var c=P(o,2),l=M(c,!0);T(c),T(i),F(()=>B(l,t.command.command)),z(e,i)};U(a,()=>T1,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}U(P(a,2),()=>C1,(e,r)=>{r(e,{side:`left`,sideOffset:6,class:`nav-tooltip task-tooltip`,children:(e,r)=>{var i=sje(),a=N(i),o=e=>{var n=oje(),r=M(n,!0);T(n),F(()=>B(r,t.command.label)),z(e,n)};V(a,e=>{t.command.label&&e(o)});var s=P(a,2),c=P(M(s),1,!0);T(s);var l=P(s,2),u=P(M(l),1,!0);T(l),F(()=>{B(c,t.command.command),B(u,t.command.cwd??n())}),z(e,i)},$$slots:{default:!0}})}),z(e,i)},$$slots:{default:!0}})});var s=P(o,2),c=M(s);Ml(c,{size:`icon-xs`,variant:`ghost`,ariaLabel:`Run command`,title:`Run command`,class:`text-muted-foreground hover:text-foreground`,get disabled(){return r()},onclick:e=>{i(e),t.onRun?.(t.command)},children:(e,t)=>{Q8(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),Ml(P(c,2),{size:`icon-xs`,variant:`ghost`,ariaLabel:`Remove pinned command`,title:`Remove pinned command`,class:`text-muted-foreground hover:text-destructive`,onclick:e=>{i(e),t.onRemove?.(t.command)},children:(e,t)=>{GQ(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),T(s),T(a),z(e,a),O()}var dje=L(`<button><!> <div class="min-w-0 flex-1 truncate font-mono text-xs text-foreground"> </div> <!> <!></button>`),fje=L(`<span class="tt-row"><span class="tt-key">env</span> </span> <span class="tt-row tt-env-keys"><span class="tt-key">keys</span> </span>`,1),pje=L(`<span class="tt-row"><span class="tt-key">pid</span> </span>`),mje=L(`<span class="tt-row"><span class="tt-key">pgid</span> </span>`),hje=L(`<span class="tt-row"><span class="tt-key">pid</span>No PID metadata captured</span>`),gje=L(`<span class="tt-row"><span class="tt-key">platform</span> </span>`),_je=L(`<span class="tt-row"><span class="tt-key">spawned</span> </span>`),vje=L(`<span class="tt-row"><span class="tt-key">finished</span> </span>`),yje=L(`<span class="tt-row"><span class="tt-key">exit</span> </span>`),bje=L(`<span class="tt-row"><span class="tt-key">signal</span> </span>`),xje=L(`<span class="tt-row"><span class="tt-key">error</span> </span>`),Sje=L(`<span class="tt-title"> </span> <span class="tt-row"><span class="tt-key">command</span> </span> <span class="tt-row"><span class="tt-key">cwd</span> </span> <span class="tt-row"><span class="tt-key">status</span> </span> <!> <span class="tt-row"><span class="tt-key">started</span> </span> <!> <!> <!> <!> <!> <!> <!> <!> <span class="tt-id"> </span>`,1),$8=L(`<!> <!>`,1),Cje=L(`<!> <!> <!>`,1),wje=L(`<div class="group/row flex items-center gap-1 rounded-md border bg-card pr-1.5 transition-colors hover:border-ring/40 data-[active=true]:border-primary/60 data-[active=true]:bg-muted/40"><!> <div class="flex shrink-0 items-center gap-0.5"><!></div></div>`);function e5(e,t){D(t,!0);let n=q(t,`selected`,3,!1),r=new Set([`starting`,`running`,`ready`,`stopping`]),i=k(()=>r.has(t.task.status)),a=k(()=>t.task.envInfo?.keys.length??0),o=k(()=>I(a)===0?void 0:`${I(a)} redacted ${I(a)===1?`var`:`vars`}`),s=k(()=>t.task.envInfo?.keys.join(`, `));function c(){return I(i)?[{label:`Restart task`,icon:K8,onSelect:()=>t.onRestartTask?.(t.task.id)},{label:`Cancel task`,icon:sD,destructive:!0,onSelect:()=>t.onCancelTask?.(t.task.id)}]:t.task.status===`orphaned`?[{label:`Clean up orphan`,icon:Vd,destructive:!0,onSelect:()=>t.onCancelTask?.(t.task.id)},{label:`Restart task`,icon:K8,onSelect:()=>t.onRestartTask?.(t.task.id)},{label:`Forget record`,icon:GQ,destructive:!0,onSelect:()=>t.onRemoveTask?.(t.task.id)}]:[{label:`Restart task`,icon:K8,onSelect:()=>t.onRestartTask?.(t.task.id)},{label:`Remove task`,icon:GQ,destructive:!0,onSelect:()=>t.onRemoveTask?.(t.task.id)}]}function l(){return[{label:`Open output`,icon:zd,onSelect:()=>t.onOpenTaskOutput?.(t.task.id)},{label:`Pin command`,icon:Z8,onSelect:()=>t.onPinTask?.(t.task)},{label:`Copy command`,icon:V3,onSelect:()=>t.onCopyCommand?.(t.task.command)},{type:`separator`},...c()]}function u(e){e.stopPropagation()}{let r=k(l);j$(e,{get items(){return I(r)},triggerClass:`task-context-trigger`,children:(e,r)=>{var c=wje(),l=M(c);U(l,()=>S1,(e,n)=>{n(e,{children:(e,n)=>{var r=$8(),i=N(r);{let e=(e,n)=>{let r=()=>n?.().props;var i=dje(),o=()=>t.onOpenTaskOutput?.(t.task.id);Sa(i,()=>({...r(),class:`flex min-w-0 flex-1 items-center gap-2.5 rounded-md px-2.5 py-2 text-left`,type:`button`,onclick:o}));var c=M(i);{let e=k(()=>iT(t.task.status)),n=k(()=>aT(t.task.status));lC(c,{get tone(){return I(e)},get pulse(){return I(n)}})}var l=P(c,2),u=M(l,!0);T(l);var d=P(l,2),f=e=>{uf(e,{tone:`neutral`,size:`xs`,get title(){return I(s)},children:(e,t)=>{E(),z(e,ki(`env`))},$$slots:{default:!0}})};V(d,e=>{I(a)>0&&e(f)});var p=P(d,2);{let e=k(()=>iT(t.task.status)),n=k(()=>iT(t.task.status)===`neutral`?`border-border bg-muted text-muted-foreground`:``);uf(p,{get tone(){return I(e)},size:`xs`,get class(){return I(n)},children:(e,n)=>{E();var r=ki();F(()=>B(r,t.task.status)),z(e,r)},$$slots:{default:!0}})}T(i),F(()=>B(u,t.task.command)),z(e,i)};U(i,()=>T1,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}U(P(i,2),()=>C1,(e,n)=>{n(e,{side:`left`,sideOffset:6,class:`nav-tooltip task-tooltip`,children:(e,n)=>{var r=Sje(),i=N(r),c=M(i,!0);T(i);var l=P(i,2),u=P(M(l),1,!0);T(l);var d=P(l,2),f=P(M(d),1,!0);T(d);var p=P(d,2),m=P(M(p),1,!0);T(p);var h=P(p,2),g=e=>{var t=fje(),n=N(t),r=P(M(n),1,!0);T(n);var i=P(n,2),a=P(M(i),1,!0);T(i),F(()=>{B(r,I(o)),B(a,I(s))}),z(e,t)};V(h,e=>{I(a)>0&&e(g)});var _=P(h,2),v=P(M(_),1,!0);T(_);var y=P(_,2),b=e=>{var n=pje(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.runtime.childPid)),z(e,n)};V(y,e=>{t.task.runtime?.childPid&&e(b)});var x=P(y,2),S=e=>{var n=mje(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.runtime.processGroupId)),z(e,n)};V(x,e=>{t.task.runtime?.processGroupId&&e(S)});var ee=P(x,2),C=e=>{z(e,hje())};V(ee,e=>{t.task.status===`orphaned`&&!t.task.runtime?.childPid&&!t.task.runtime?.processGroupId&&e(C)});var te=P(ee,2),ne=e=>{var n=gje(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.runtime.platform)),z(e,n)};V(te,e=>{t.task.runtime?.platform&&e(ne)});var re=P(te,2),ie=e=>{var n=_je(),r=P(M(n),1,!0);T(n),F(e=>B(r,e),[()=>O1(t.task.runtime.spawnedAt)]),z(e,n)};V(re,e=>{t.task.runtime?.spawnedAt&&e(ie)});var ae=P(re,2),oe=e=>{var n=vje(),r=P(M(n),1,!0);T(n),F(e=>B(r,e),[()=>O1(t.task.finishedAt)]),z(e,n)};V(ae,e=>{t.task.finishedAt&&e(oe)});var w=P(ae,2),se=e=>{var n=yje(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.exitCode)),z(e,n)},ce=e=>{var n=bje(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.signal)),z(e,n)};V(w,e=>{t.task.exitCode!==void 0&&t.task.exitCode!==null?e(se):t.task.signal&&e(ce,1)});var le=P(w,2),ue=e=>{var n=xje(),r=P(M(n),1,!0);T(n),F(()=>B(r,t.task.error)),z(e,n)};V(le,e=>{t.task.error&&e(ue)});var de=P(le,2),fe=M(de,!0);T(de),F(e=>{B(c,t.task.name??t.task.command),B(u,t.task.command),B(f,t.task.cwd),B(m,t.task.status),B(v,e),B(fe,t.task.id)},[()=>O1(t.task.startedAt)]),z(e,r)},$$slots:{default:!0}})}),z(e,r)},$$slots:{default:!0}})});var d=P(l,2),f=M(d),p=e=>{var n=$8(),r=N(n);Ml(r,{size:`icon-xs`,variant:`ghost`,ariaLabel:`Restart task`,title:`Restart task`,class:`text-muted-foreground hover:text-foreground`,onclick:e=>{u(e),t.onRestartTask?.(t.task.id)},children:(e,t)=>{K8(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),Ml(P(r,2),{size:`icon-xs`,variant:`ghost`,ariaLabel:`Cancel task`,title:`Cancel task`,class:`text-muted-foreground hover:text-destructive`,onclick:e=>{u(e),t.onCancelTask?.(t.task.id)},children:(e,t)=>{sD(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),z(e,n)},m=e=>{var n=Cje(),r=N(n);Ml(r,{size:`icon-xs`,variant:`ghost`,ariaLabel:`Clean up orphaned task`,title:`Clean up orphan`,class:`text-muted-foreground hover:text-destructive`,onclick:e=>{u(e),t.onCancelTask?.(t.task.id)},children:(e,t)=>{Vd(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}});var i=P(r,2);Ml(i,{size:`icon-xs`,variant:`ghost`,ariaLabel:`Restart task`,title:`Restart task`,class:`text-muted-foreground hover:text-foreground`,onclick:e=>{u(e),t.onRestartTask?.(t.task.id)},children:(e,t)=>{K8(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),Ml(P(i,2),{size:`icon-xs`,variant:`ghost`,ariaLabel:`Forget task record`,title:`Forget record`,class:`text-muted-foreground hover:text-destructive`,onclick:e=>{u(e),t.onRemoveTask?.(t.task.id)},children:(e,t)=>{GQ(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),z(e,n)},h=e=>{var n=$8(),r=N(n);Ml(r,{size:`icon-xs`,variant:`ghost`,ariaLabel:`Restart task`,title:`Restart task`,class:`text-muted-foreground hover:text-foreground`,onclick:e=>{u(e),t.onRestartTask?.(t.task.id)},children:(e,t)=>{K8(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),Ml(P(r,2),{size:`icon-xs`,variant:`ghost`,ariaLabel:`Remove task`,title:`Remove task`,class:`text-muted-foreground hover:text-destructive`,onclick:e=>{u(e),t.onRemoveTask?.(t.task.id)},children:(e,t)=>{GQ(e,{size:12,strokeWidth:2.3})},$$slots:{default:!0}}),z(e,n)};V(f,e=>{I(i)?e(p):t.task.status===`orphaned`?e(m,1):e(h,-1)}),T(d),T(c),F(()=>W(c,`data-active`,n())),z(e,c)},$$slots:{default:!0}})}O()}var Tje=L(`<p class="px-1 py-6 text-center text-xs text-muted-foreground">Select a project to manage its tasks.</p>`),t5=L(`<span class="font-mono"> </span>`),Eje=L(`<!> Pin`,1),Dje=L(`<div class="text-xs font-medium text-foreground">Pin a command</div> <div class="flex flex-col gap-1.5"><!> <!> <div class="flex justify-end"><!></div></div>`,1),n5=L(`<!> <!>`,1),Oje=L(`<p class="px-1 py-1 text-xs text-muted-foreground">Loading…</p>`),kje=L(`<p class="px-1 py-1 text-xs text-muted-foreground">No pinned commands. Add one to run it anytime.</p>`),Aje=L(`<div class="flex flex-col gap-1.5"><!></div>`),r5=L(`<div class="flex flex-col gap-1.5"></div>`),jje=L(`<!>Prune`,1),Mje=L(`<!> <!> <!> <!>`,1),Nje=L(`<div class="flex flex-col gap-2 p-2"><!></div>`);function Pje(e,t){D(t,!0);let n=q(t,`tasks`,19,()=>[]),r=new Set([`starting`,`running`,`ready`,`stopping`]),i=e=>r.has(e.status),a=k(()=>n().filter(i)),o=k(()=>n().filter(e=>e.status===`orphaned`)),s=k(()=>n().filter(e=>!i(e)&&e.status!==`orphaned`)),c=A(!0),l=A(!0),u=A(!0),d=A(!1),f=A(!1),p=A(In([])),m=A(!1),h=A(!1),g=A(!1),_=A(``),v=A(``),y=A(void 0),b=A(void 0);sr(()=>{let e=t.activeProject?.id;e!==I(b)&&(j(b,e,!0),j(p,[],!0),e&&(j(m,!0),Tue(e).then(n=>{t.activeProject?.id===e&&j(p,n,!0)}).catch(e=>cd.error(`Could not load pinned commands: ${x(e)}`)).finally(()=>{t.activeProject?.id===e&&j(m,!1)})))});function x(e){return e instanceof Error?e.message:String(e)}async function S(e,t){try{await bE(e),cd.success(`Copied ${t}`)}catch{cd.error(`Could not copy to clipboard`)}}async function ee(e){if(t.activeProject)try{let n=await Zk(t.activeProject.id,{command:e.command,label:e.name,cwd:e.cwd===t.activeProject.dir?void 0:e.cwd});j(p,[...I(p),n],!0),j(c,!0),cd.success(`Command pinned`)}catch(e){cd.error(`Could not pin command: ${x(e)}`)}}async function C(){if(!t.activeProject)return;let e=I(_).trim();if(e.length===0)return;let n=I(v).trim();j(g,!0);try{let r=await Zk(t.activeProject.id,{command:e,label:n.length>0?n:void 0});j(p,[...I(p),r],!0),j(_,``),j(v,``),j(h,!1)}catch(e){cd.error(`Could not pin command: ${x(e)}`)}finally{j(g,!1)}}async function te(e){if(t.activeProject)try{await Eue(t.activeProject.id,e.id),j(p,I(p).filter(t=>t.id!==e.id),!0)}catch(e){cd.error(`Could not remove pinned command: ${x(e)}`)}}function ne(e){t.activeProject&&(j(y,e.id,!0),t.onRunCommand?.({projectId:t.activeProject.id,cwd:e.cwd??t.activeProject.dir,command:e.command,name:e.label??e.command}),window.setTimeout(()=>{I(y)===e.id&&j(y,void 0)},1200))}var re=n5(),ie=N(re);U(ie,()=>w1,(e,n)=>{n(e,{delayDuration:300,disableHoverableContent:!0,children:(e,n)=>{var r=Nje(),i=M(r),b=e=>{z(e,Tje())},x=e=>{var n=Mje(),r=N(n);dT(r,{title:`Pinned`,get icon(){return Z8},get open(){return I(c)},set open(e){j(c,e,!0)},meta:e=>{var t=t5(),n=M(t,!0);T(t),F(()=>B(n,I(p).length)),z(e,t)},actions:e=>{var t=R();U(N(t),()=>k8,(e,t)=>{t(e,{get open(){return I(h)},set open(e){j(h,e,!0)},children:(e,t)=>{var n=n5(),r=N(n);U(r,()=>j8,(e,t)=>{t(e,{class:`inline-flex size-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,title:`Pin a command`,"aria-label":`Pin a command`,children:(e,t)=>{ZZ(e,{size:13,strokeWidth:2.3})},$$slots:{default:!0}})}),U(P(r,2),()=>A8,(e,t)=>{t(e,{align:`end`,collisionPadding:8,class:`w-[min(340px,calc(100vw-2rem))] gap-3 p-3`,children:(e,t)=>{var n=Dje(),r=P(N(n),2),i=M(r);DQ(i,{placeholder:`pnpm dev`,class:`h-8 font-mono text-xs`,get value(){return I(_)},set value(e){j(_,e,!0)}});var a=P(i,2);DQ(a,{placeholder:`Label (optional)`,class:`h-8 text-xs`,get value(){return I(v)},set value(e){j(v,e,!0)}});var o=P(a,2),s=M(o);{let e=k(()=>I(g)||I(_).trim().length===0);Ml(s,{size:`sm`,get disabled(){return I(e)},onclick:()=>void C(),children:(e,t)=>{var n=Eje();Z8(N(n),{}),E(),z(e,n)},$$slots:{default:!0}})}T(o),T(r),z(e,n)},$$slots:{default:!0}})}),z(e,n)},$$slots:{default:!0}})}),z(e,t)},children:(e,n)=>{var r=Aje(),i=M(r),a=e=>{z(e,Oje())},o=e=>{z(e,kje())},s=e=>{var n=R();Ri(N(n),17,()=>I(p),e=>e.id,(e,n)=>{{let r=k(()=>I(y)===I(n).id);uje(e,{get command(){return I(n)},get cwd(){return t.activeProject.dir},get running(){return I(r)},onRun:ne,onRemove:e=>void te(e)})}}),z(e,n)};V(i,e=>{I(m)&&I(p).length===0?e(a):I(p).length===0?e(o,1):e(s,-1)}),T(r),z(e,r)},$$slots:{meta:!0,actions:!0,default:!0}});var i=P(r,2),b=e=>{dT(e,{title:`Running`,get icon(){return Q8},get open(){return I(l)},set open(e){j(l,e,!0)},meta:e=>{var t=t5(),n=M(t,!0);T(t),F(()=>B(n,I(a).length)),z(e,t)},children:(e,n)=>{var r=r5();Ri(r,21,()=>I(a),e=>e.id,(e,n)=>{{let r=k(()=>I(n).id===t.selectedTask?.id);e5(e,{get task(){return I(n)},get selected(){return I(r)},get onOpenTaskOutput(){return t.onOpenTaskOutput},get onCancelTask(){return t.onCancelTask},get onRestartTask(){return t.onRestartTask},get onRemoveTask(){return t.onRemoveTask},onPinTask:e=>void ee(e),onCopyCommand:e=>void S(e,`command`)})}}),T(r),z(e,r)},$$slots:{meta:!0,default:!0}})};V(i,e=>{I(a).length>0&&e(b)});var x=P(i,2),re=e=>{dT(e,{title:`Needs cleanup`,get icon(){return Vd},get open(){return I(u)},set open(e){j(u,e,!0)},meta:e=>{var t=t5(),n=M(t,!0);T(t),F(()=>B(n,I(o).length)),z(e,t)},children:(e,n)=>{var r=r5();Ri(r,21,()=>I(o),e=>e.id,(e,n)=>{{let r=k(()=>I(n).id===t.selectedTask?.id);e5(e,{get task(){return I(n)},get selected(){return I(r)},get onOpenTaskOutput(){return t.onOpenTaskOutput},get onCancelTask(){return t.onCancelTask},get onRestartTask(){return t.onRestartTask},get onRemoveTask(){return t.onRemoveTask},onPinTask:e=>void ee(e),onCopyCommand:e=>void S(e,`command`)})}}),T(r),z(e,r)},$$slots:{meta:!0,default:!0}})};V(x,e=>{I(o).length>0&&e(re)});var ie=P(x,2),ae=e=>{dT(e,{title:`Finished`,get icon(){return sD},get open(){return I(d)},set open(e){j(d,e,!0)},meta:e=>{var t=t5(),n=M(t,!0);T(t),F(()=>B(n,I(s).length)),z(e,t)},actions:e=>{Ml(e,{size:`xs`,variant:`ghost`,class:`h-6 gap-1 text-muted-foreground hover:text-destructive`,onclick:()=>j(f,!0),children:(e,t)=>{var n=jje();GQ(N(n),{size:12,strokeWidth:2.3}),E(),z(e,n)},$$slots:{default:!0}})},children:(e,n)=>{var r=r5();Ri(r,21,()=>I(s),e=>e.id,(e,n)=>{{let r=k(()=>I(n).id===t.selectedTask?.id);e5(e,{get task(){return I(n)},get selected(){return I(r)},get onOpenTaskOutput(){return t.onOpenTaskOutput},get onCancelTask(){return t.onCancelTask},get onRestartTask(){return t.onRestartTask},get onRemoveTask(){return t.onRemoveTask},onPinTask:e=>void ee(e),onCopyCommand:e=>void S(e,`command`)})}}),T(r),z(e,r)},$$slots:{meta:!0,actions:!0,default:!0}})};V(ie,e=>{I(s).length>0&&e(ae)}),z(e,n)};V(i,e=>{t.activeProject?e(x,-1):e(b)}),T(r),z(e,r)},$$slots:{default:!0}})});var ae=P(ie,2);{let e=k(()=>`This removes ${I(s).length} finished ${I(s).length===1?`task`:`tasks`} and their captured logs. This can't be undone.`);SQ(ae,{destructive:!0,title:`Prune finished tasks`,get description(){return I(e)},confirmLabel:`Prune`,onConfirm:()=>t.onPruneTasks?.(),get open(){return I(f)},set open(e){j(f,e,!0)}})}z(e,re),O()}function i5(e){WT({kind:`task`,id:e})}async function a5(e){i5(e),await o5(e)}async function o5(e){i5(e),PT.selectedTaskId=e,JT({kind:`task`,id:e}),PT.taskLogs=await Qk(e)}async function Fje(e){let t={kind:`task`,id:e},n=Y.activeCenterTab?.kind===`task`&&Y.activeCenterTab.id===e,r=KT(t);qT(t),PT.selectedTaskId===e&&(PT.selectedTaskId=void 0,PT.taskLogs=void 0),n&&await XT(r)}var Ije=new Set([`$$slots`,`$$events`,`$$legacy`]);function s5(e,t){let n=G(t,Ije),r=[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`}]];uc(e,K({name:`monitor`},()=>n,{get iconNode(){return r}}))}var Lje=new Set([`$$slots`,`$$events`,`$$legacy`]);function c5(e,t){let n=G(t,Lje),r=[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`}]];uc(e,K({name:`server`},()=>n,{get iconNode(){return r}}))}var Rje=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`value`]);function zje(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`value`,15,``),i=G(t,Rje);var a=R(),o=N(a);{let e=k(()=>ul(`grid gap-3 w-full`,t.class));U(o,()=>Ab,(t,a)=>{a(t,K({"data-slot":`radio-group`,get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)},get value(){return r()},set value(e){r(e)}}))})}z(e,a),O()}var Bje=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]),Vje=L(`<div data-slot="radio-group-indicator" class="flex size-4 items-center justify-center"><!></div>`);function Hje(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,Bje);var i=R(),a=N(i);{let e=(e,t)=>{let n=()=>t?.().checked;var r=Vje(),i=M(r),a=e=>{j1(e,{class:`bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full`})};V(i,e=>{n()&&e(a)}),T(r),z(e,r)},i=k(()=>ul(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 flex size-4 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,t.class));U(a,()=>Nb,(t,a)=>{a(t,K({"data-slot":`radio-group-item`,get class(){return I(i)}},()=>r,{get ref(){return n()},set ref(e){n(e)},children:e,$$slots:{default:!0}}))})}z(e,i),O()}var Uje=L(`<span class="text-xs leading-snug text-muted-foreground"> </span>`),Wje=L(`<!> <span class="grid min-w-0 gap-0.5"><span class="text-sm font-medium leading-tight"> </span> <!></span>`,1);function l5(e,t){D(t,!0);let n=q(t,`items`,19,()=>[]),r=q(t,`value`,15,``),i=q(t,`orientation`,3,`vertical`),a=q(t,`disabled`,3,!1);var o=R(),s=N(o);{let e=k(()=>ul(`grid gap-2`,i()===`horizontal`&&`grid-cols-[repeat(auto-fit,minmax(9rem,1fr))]`,t.class));U(s,()=>zje,(o,s)=>{s(o,{get orientation(){return i()},get disabled(){return a()},get"aria-label"(){return t.ariaLabel},get onValueChange(){return t.onValueChange},get class(){return I(e)},get value(){return r()},set value(e){r(e)},children:(e,t)=>{var r=R();Ri(N(r),17,n,e=>e.value,(e,t)=>{KQ(e,{class:`flex cursor-pointer items-start gap-2.5 rounded-md border border-border bg-input/30 p-3 transition-colors hover:bg-accent/50 has-data-[state=checked]:border-primary has-data-[state=checked]:bg-accent`,children:(e,n)=>{var r=Wje(),i=N(r);U(i,()=>Hje,(e,n)=>{n(e,{get value(){return I(t).value},get disabled(){return I(t).disabled},class:`mt-0.5`})});var a=P(i,2),o=M(a),s=M(o,!0);T(o);var c=P(o,2),l=e=>{var n=Uje(),r=M(n,!0);T(n),F(()=>B(r,I(t).detail)),z(e,n)};V(c,e=>{I(t).detail&&e(l)}),T(a),F(()=>B(s,I(t).label)),z(e,r)},$$slots:{default:!0}})}),z(e,r)},$$slots:{default:!0}})})}z(e,o),O()}var Gje=[{value:`system`,label:`System`,detail:`Follow the operating system`},{value:`dark`,label:`Dark`,detail:`Dark workbench surfaces`},{value:`light`,label:`Light`,detail:`Light workbench surfaces`}],Kje=[{value:`coding`,label:`Coding`,detail:`Implement, edit files, and run checks`},{value:`planning`,label:`Planning`,detail:`Inspect, reason, and prepare before edits`}],qje=[{value:`read_only`,label:`Read only`,detail:`No writes or mutating commands`},{value:`supervised`,label:`Supervised`,detail:`Ask before non-read tool calls`},{value:`autonomous`,label:`Autonomous`,detail:`Allow tool calls without approval`}],Jje=L(`<section id="settings-appearance" class="settings-section" data-section="appearance"><header class="settings-section-header"><div class="settings-section-kicker"><!> Appearance</div> <h2>Theme</h2> <p>Choose how Nerve renders the workbench. Theme changes apply immediately.</p></header> <div class="settings-section-body"><div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Color theme</strong> <span>Dark is the primary theme; light remains a compatibility fallback.</span></div> <!></div></div></section>`);function Yje(e,t){D(t,!0);let n=q(t,`settingsDraft`,7);function r(e){let r=e;n().ui.theme=r,t.onThemeChange?.(r),t.onSettingsChange?.({ui:{theme:r}},{immediate:!0})}var i=Jje(),a=M(i),o=M(a);s5(M(o),{size:14,strokeWidth:2.1}),E(),T(o),E(4),T(a);var s=P(a,2),c=M(s);l5(P(M(c),2),{get items(){return Gje},get value(){return n().ui.theme},orientation:`horizontal`,ariaLabel:`Theme preference`,onValueChange:r}),T(c),T(s),T(i),z(e,i),O()}var Xje=L(`<section id="settings-agents" class="settings-section" data-section="agents"><header class="settings-section-header"><div class="settings-section-kicker"><!> Agents</div> <h2>Default behavior and policy</h2> <p>Choose how new top-level agents pick their mode, permission, model, and thinking budget.</p></header> <div class="settings-section-body"><!> <!> <div class="settings-control-grid"><div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Root mode</strong> <span>The fixed starting workflow when last selections are disabled.</span></div> <!></div> <div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Root permission</strong> <span>The fixed approval policy when last selections are disabled.</span></div> <!></div> <div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Root model</strong> <span>The fixed model for new top-level agents when last selections are disabled.</span></div> <!></div> <div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Thinking level</strong> <span>The fixed reasoning budget when last selections are disabled.</span></div> <!></div></div> <div class="permission-table" role="table" aria-label="Default agent permissions"><div role="row"><span role="columnheader">Capability</span><span role="columnheader">New-agent policy</span></div> <div role="row"><span>File system read</span><strong>Allowed</strong></div> <div role="row"><span>File system write</span><strong> </strong></div> <div role="row"><span>Terminal command execution</span><strong> </strong></div> <div role="row"><span>Network access</span><strong>Tool-dependent</strong></div></div></div></section>`);function Zje(e,t){D(t,!0);let n=q(t,`settingsDraft`,7),r=q(t,`models`,19,()=>[]),i=q(t,`authProviders`,19,()=>[]),a=k(()=>gE(r(),i(),n().scopedModels)),o=k(()=>{let e=n().defaultModel;return e?I(a).find(t=>aE(t)===aE(e)):void 0}),s=k(()=>I(o)?aE(I(o)):`auto`),c=k(()=>I(o)??I(a)[0]),l=k(()=>n().rememberLastAgentSelection?n().lastAgentSelection.permissionLevel:n().defaultPermissionLevel),u=k(()=>[{value:`auto`,label:`First available scoped model`,detail:`Use the first configured model allowed by Scoped Models`},...I(a).map(e=>({value:aE(e),label:mE(e,I(a)),detail:`${uE(e.provider)} · ${e.modelId}`}))]),d=k(()=>(I(c)?.supportedThinkingLevels?.length?I(c).supportedThinkingLevels:[`off`]).map(e=>({value:e,label:e}))),f=k(()=>yZ(n().defaultThinkingLevel,I(c)));function p(e){return e===`read_only`?`Denied`:e===`supervised`?`Approval required`:e===`autonomous`?`Allowed`:`Policy-managed`}function m(e){return e===`read_only`?`Denied`:e===`supervised`?`Approval required`:e===`autonomous`?`Allowed`:`Policy-managed`}function h(e){n().defaultThinkingLevel=e,t.onSettingsChange?.({defaultThinkingLevel:e},{immediate:!0})}function g(e){let r=e===`auto`?void 0:oE(e),i=r?I(a).find(e=>aE(e)===aE(r)):I(a)[0],o=yZ(n().defaultThinkingLevel,i);n().defaultModel=r,n().defaultThinkingLevel=o,t.onSettingsChange?.({defaultModel:r??null,defaultThinkingLevel:o},{immediate:!0})}function _(e){n().compaction.auto=e,t.onSettingsChange?.({compaction:{auto:e}},{immediate:!0})}function v(e){if(n().rememberLastAgentSelection=e,!e){t.onSettingsChange?.({rememberLastAgentSelection:!1},{immediate:!0});return}let r=oE(kT.selectedModelKey),i={mode:kT.selectedMode,permissionLevel:kT.selectedPermissionLevel,...r?{model:r}:{},thinkingLevel:kT.selectedThinkingLevel};n().lastAgentSelection=i,t.onSettingsChange?.({rememberLastAgentSelection:!0,lastAgentSelection:{...i,model:r??null}},{immediate:!0})}var y=Xje(),b=M(y),x=M(b);Ww(M(x),{size:14,strokeWidth:2.1}),E(),T(x),E(4),T(b);var S=P(b,2),ee=M(S);QQ(ee,{class:`settings-full-switch`,get checked(){return n().rememberLastAgentSelection},label:`Use last selections for new agents`,description:`When enabled, new conversations reuse the last mode, permission, model, and thinking level you selected in the composer.`,onCheckedChange:v});var C=P(ee,2);QQ(C,{class:`settings-full-switch`,get checked(){return n().compaction.auto},label:`Auto-compact long conversations`,description:`Automatically summarize older context when the selected model approaches its context window.`,onCheckedChange:_});var te=P(C,2),ne=M(te);l5(P(M(ne),2),{get items(){return Kje},get value(){return n().defaultMode},ariaLabel:`Default root mode`,onValueChange:e=>{let r=e;n().defaultMode=r,t.onSettingsChange?.({defaultMode:r},{immediate:!0})}}),T(ne);var re=P(ne,2);l5(P(M(re),2),{get items(){return qje},get value(){return n().defaultPermissionLevel},ariaLabel:`Default root permission`,onValueChange:e=>{let r=e;n().defaultPermissionLevel=r,t.onSettingsChange?.({defaultPermissionLevel:r},{immediate:!0})}}),T(re);var ie=P(re,2);YQ(P(M(ie),2),{get items(){return I(u)},get value(){return I(s)},ariaLabel:`Default root model`,onValueChange:g}),T(ie);var ae=P(ie,2);YQ(P(M(ae),2),{get items(){return I(d)},get value(){return I(f)},ariaLabel:`Default root thinking level`,onValueChange:e=>h(e)}),T(ae),T(te);var oe=P(te,2),w=P(M(oe),4),se=P(M(w)),ce=M(se,!0);T(se),T(w);var le=P(w,2),ue=P(M(le)),de=M(ue,!0);T(ue),T(le),E(2),T(oe),T(S),T(y),F((e,t)=>{B(ce,e),B(de,t)},[()=>p(I(l)),()=>m(I(l))]),z(e,y),O()}var Qje=new Set([`$$slots`,`$$events`,`$$legacy`]);function $je(e,t){let n=G(t,Qje),r=[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}],[`path`,{d:`M10 4v4`}],[`path`,{d:`M2 8h20`}],[`path`,{d:`M6 4v4`}]];uc(e,K({name:`app-window`},()=>n,{get iconNode(){return r}}))}var eMe=L(`<section id="settings-desktop" class="settings-section" data-section="desktop"><header class="settings-section-header"><div class="settings-section-kicker"><!> Desktop</div> <h2>Window close behavior</h2> <p>Choose whether the desktop app keeps running in the tray after the window is closed.</p></header> <div class="settings-section-body"><div class="settings-row"><!></div></div></section>`);function tMe(e,t){D(t,!0);let n=q(t,`settingsDraft`,7);var r=eMe(),i=M(r),a=M(i);$je(M(a),{size:14,strokeWidth:2.1}),E(),T(a),E(4),T(i);var o=P(i,2),s=M(o);QQ(M(s),{class:`settings-full-switch`,label:`Close to system tray`,description:`When enabled, the Close button hides Nerve to the tray. When disabled, Close quits the desktop app.`,onCheckedChange:e=>{n().desktop.closeToTray=e,t.onSettingsChange?.({desktop:{closeToTray:e}},{immediate:!0})},get checked(){return n().desktop.closeToTray},set checked(e){n().desktop.closeToTray=e}}),T(s),T(o),T(r),z(e,r),O()}var nMe=L(`<section id="settings-explore" class="settings-section" data-section="explore"><header class="settings-section-header"><div class="settings-section-kicker"><!> Explore agent</div> <h2>Codebase exploration delegate</h2> <p>Configure the specialized read-only agent used by the explore tool.</p></header> <div class="settings-section-body"><div class="settings-control-grid"><div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Explore model</strong> <span>The model used when parent agents delegate codebase exploration.</span></div> <!></div> <div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Thinking level</strong> <span>Reasoning budget for explore reports.</span></div> <!></div></div> <div class="permission-table" role="table" aria-label="Explore agent fixed policy"><div role="row"><span role="columnheader">Capability</span><span role="columnheader">Explore policy</span></div> <div role="row"><span>Permission</span><strong>Read only</strong></div> <div role="row"><span>Mode</span><strong>Coding</strong></div> <div role="row"><span>Working directory</span><strong>Same as parent</strong></div> <div role="row"><span>Conversation history</span><strong>Fresh</strong></div></div></div></section>`);function rMe(e,t){D(t,!0);let n=q(t,`settingsDraft`,7),r=q(t,`models`,19,()=>[]),i=q(t,`authProviders`,19,()=>[]),a=k(()=>hE(r(),i())),o=k(()=>n().exploreAgent.model?aE(n().exploreAgent.model):`default`),s=k(()=>n().exploreAgent.model?I(a).find(e=>aE(e)===aE(n().exploreAgent.model)):void 0),c=k(()=>[{value:`default`,label:`Default model`,detail:`Use the platform fallback model`},...I(a).map(e=>({value:aE(e),label:mE(e,I(a)),detail:`${uE(e.provider)} · ${e.modelId}`}))]),l=k(()=>(I(s)?.supportedThinkingLevels?.length?I(s).supportedThinkingLevels:[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`]).map(e=>({value:e,label:e})));function u(e){n().exploreAgent={...n().exploreAgent,...e},t.onSettingsChange?.({exploreAgent:e},{immediate:!0})}function d(e){if(e==="default"){n().exploreAgent={...n().exploreAgent,model:void 0},t.onSettingsChange?.({exploreAgent:{model:null}},{immediate:!0});return}let r=oE(e);r&&u({model:r})}var f=nMe(),p=M(f),m=M(p);f1(M(m),{size:14,strokeWidth:2.1}),E(),T(m),E(4),T(p);var h=P(p,2),g=M(h),_=M(g);YQ(P(M(_),2),{get items(){return I(c)},get value(){return I(o)},ariaLabel:`Explore agent model`,onValueChange:d}),T(_);var v=P(_,2);YQ(P(M(v),2),{get items(){return I(l)},get value(){return n().exploreAgent.thinkingLevel},ariaLabel:`Explore agent thinking level`,onValueChange:e=>u({thinkingLevel:e})}),T(v),T(g),E(2),T(h),T(f),z(e,f),O()}var iMe=new Set([`$$slots`,`$$events`,`$$legacy`]);function aMe(e,t){let n=G(t,iMe),r=[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`}]];uc(e,K({name:`activity`},()=>n,{get iconNode(){return r}}))}var oMe=L(`<section id="settings-runtime" class="settings-section settings-section-muted" data-section="runtime"><header class="settings-section-header"><div class="settings-section-kicker"><!> Diagnostics</div> <h2>Daemon state</h2> <p>Read-only runtime metadata from the orchestrator.</p></header> <div class="settings-section-body"><div class="stat-grid"><section><span>Daemon</span><strong> </strong></section> <section><span>Version</span><strong> </strong></section> <section><span>Started</span><strong> </strong></section> <section><span>Index</span><strong> </strong></section> <section class="wide"><span>Data directory</span><strong> </strong></section> <section class="wide"><span>SQLite</span><strong> </strong></section></div></div></section>`);function sMe(e,t){D(t,!0);var n=oMe(),r=M(n),i=M(r);aMe(M(i),{size:14,strokeWidth:2.1}),E(),T(i),E(4),T(r);var a=P(r,2),o=M(a),s=M(o),c=P(M(s)),l=M(c,!0);T(c),T(s);var u=P(s,2),d=P(M(u)),f=M(d,!0);T(d),T(u);var p=P(u,2),m=P(M(p)),h=M(m,!0);T(m),T(p);var g=P(p,2),_=P(M(g)),v=M(_,!0);T(_),T(g);var y=P(g,2),b=P(M(y)),x=M(b,!0);T(b),T(y);var S=P(y,2),ee=P(M(S)),C=M(ee,!0);T(ee),T(S),T(o),T(a),T(n),F(e=>{B(l,t.status?.daemonId??`not loaded`),B(f,t.status?.version??`—`),B(h,e),B(v,t.status?.storage.indexHealthy?`healthy`:`unknown`),W(b,`title`,t.status?.dataDir),B(x,t.status?.dataDir??`—`),W(ee,`title`,t.status?.storage.sqlitePath),B(C,t.status?.storage.sqlitePath??`—`)},[()=>t.status?.startedAt?new Date(t.status.startedAt).toLocaleString():`—`]),z(e,n),O()}var cMe=new Set([`$$slots`,`$$events`,`$$legacy`]);function lMe(e,t){let n=G(t,cMe),r=[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`}]];uc(e,K({name:`braces`},()=>n,{get iconNode(){return r}}))}var uMe=L(`<section class="wide"><span>Validation</span> <strong> </strong></section>`),dMe=L(`<section id="settings-python" class="settings-section" data-section="python"><header class="settings-section-header"><div class="settings-section-kicker"><!> Python</div> <h2>Python runtime</h2> <p>Configure the interpreter used by the native python tool. The tool is hidden when no runtime is available.</p></header> <div class="settings-section-body"><div class="stat-grid"><section><span>Status</span> <strong> </strong></section> <section><span>Source</span> <strong> </strong></section> <section><span>Version</span> <strong> </strong></section> <section class="wide"><span>Executable</span> <strong> </strong></section> <!></div> <div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Manual executable path</strong> <span>Leave empty to auto-detect project virtualenvs or Python on PATH.</span></div> <div class="settings-field-grid"><label class="wide"><span>Python executable</span> <!></label></div> <div><!></div></div> <p class="settings-note">Planning-mode Python runs with file-write guardrails. This is not a hard security sandbox.</p></div></section>`);function fMe(e,t){D(t,!0);let n=q(t,`settingsDraft`,7),r=k(()=>t.status?.runtime.python),i=k(()=>n().runtime.pythonExecutablePath??``),a=k(()=>(I(r)?.source??`unavailable`).replace(/_/g,` `));function o(e){let r=e.trim().length>0?e:void 0;n().runtime.pythonExecutablePath=r,t.onSettingsChange?.({runtime:{pythonExecutablePath:r??null}},{debounceMs:650})}function s(){n().runtime.pythonExecutablePath=void 0,t.onSettingsChange?.({runtime:{pythonExecutablePath:null}},{immediate:!0})}var c=dMe(),l=M(c),u=M(l);lMe(M(u),{size:14,strokeWidth:2.1}),E(),T(u),E(4),T(l);var d=P(l,2),f=M(d),p=M(f),m=P(M(p),2),h=M(m,!0);T(m),T(p);var g=P(p,2),_=P(M(g),2),v=M(_,!0);T(_),T(g);var y=P(g,2),b=P(M(y),2),x=M(b,!0);T(b),T(y);var S=P(y,2),ee=P(M(S),2),C=M(ee,!0);T(ee),T(S);var te=P(S,2),ne=e=>{var t=uMe(),n=P(M(t),2),i=M(n,!0);T(n),T(t),F(()=>{W(n,`title`,I(r).error),B(i,I(r).error)}),z(e,t)};V(te,e=>{I(r)?.error&&e(ne)}),T(f);var re=P(f,2),ie=P(M(re),2),ae=M(ie);DQ(P(M(ae),2),{get value(){return I(i)},size:`sm`,placeholder:`Auto-detect`,ariaLabel:`Python executable path`,oninput:e=>o(e.currentTarget.value)}),T(ae),T(ie);var oe=P(ie,2);Ml(M(oe),{size:`sm`,variant:`outline`,onclick:s,children:(e,t)=>{E(),z(e,ki(`Reset to auto-detect`))},$$slots:{default:!0}}),T(oe),T(re),E(2),T(d),T(c),F(()=>{B(h,I(r)?.available?`available`:`unavailable`),B(v,I(a)),B(x,I(r)?.version??`—`),W(ee,`title`,I(r)?.executable),B(C,I(r)?.executable??`—`)}),z(e,c),O()}var pMe=new Set([`$$slots`,`$$events`,`$$legacy`]);function mMe(e,t){let n=G(t,pMe),r=[[`path`,{d:`M10 5H3`}],[`path`,{d:`M12 19H3`}],[`path`,{d:`M14 3v4`}],[`path`,{d:`M16 17v4`}],[`path`,{d:`M21 12h-9`}],[`path`,{d:`M21 19h-5`}],[`path`,{d:`M21 5h-7`}],[`path`,{d:`M8 10v4`}],[`path`,{d:`M8 12H3`}]];uc(e,K({name:`sliders-horizontal`},()=>n,{get iconNode(){return r}}))}var hMe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`checked`,`indeterminate`,`class`]),gMe=L(`<div data-slot="checkbox-indicator" class="[&>svg]:size-3.5 grid place-content-center text-current transition-none"><!></div>`);function u5(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`checked`,15,!1),i=q(t,`indeterminate`,15,!1),a=G(t,hMe);var o=R(),s=N(o);{let e=(e,t)=>{let n=()=>t?.().checked,r=()=>t?.().indeterminate;var i=gMe(),a=M(i),o=e=>{JQ(e,{})},s=e=>{h1(e,{})};V(a,e=>{n()?e(o):r()&&e(s,1)}),T(i),z(e,i)},o=k(()=>ul(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex size-4 items-center justify-center rounded-[4px] border shadow-xs transition-shadow group-has-disabled/field:opacity-50 focus-visible:ring-3 aria-invalid:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,t.class));U(s,()=>Fh,(t,s)=>{s(t,K({"data-slot":`checkbox`,get class(){return I(o)}},()=>a,{get ref(){return n()},set ref(e){n(e)},get checked(){return r()},set checked(e){r(e)},get indeterminate(){return i()},set indeterminate(e){i(e)},children:e,$$slots:{default:!0}}))})}z(e,o),O()}var _Me=L(`<span class="scoped-dialog-count svelte-19sy7aa"> </span> <!> <!>`,1),vMe=L(`<button type="button"> <span class="scoped-chip-count svelte-19sy7aa"> </span></button>`),yMe=L(`<div class="scoped-dialog-providers svelte-19sy7aa" role="group" aria-label="Filter by provider"></div>`),bMe=L(`<p class="scoped-dialog-empty svelte-19sy7aa">Authenticate a provider before choosing scoped models.</p>`),xMe=L(`<p class="scoped-dialog-empty svelte-19sy7aa">No models match the current filters.</p>`),SMe=L(`<li><label><!> <span class="scoped-dialog-row-text svelte-19sy7aa"><strong class="svelte-19sy7aa"> </strong> <span class="svelte-19sy7aa"> </span></span></label></li>`),CMe=L(`<ul class="scoped-dialog-list svelte-19sy7aa"></ul>`),wMe=L(`<div class="scoped-dialog-body svelte-19sy7aa"><div class="scoped-dialog-toolbar svelte-19sy7aa"><div class="scoped-dialog-search svelte-19sy7aa"><!> <!></div> <!></div> <div class="scoped-dialog-content svelte-19sy7aa"><!></div></div>`);function TMe(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`models`,19,()=>[]),i=q(t,`authProviders`,19,()=>[]),a=q(t,`scopedModels`,19,()=>[]),o=A(In(new Set)),s=A(``),c=A(`all`),l=!1,u=k(()=>_E(r(),i()));sr(()=>{n()&&!l&&(j(o,new Set(a().map(aE)),!0),j(s,``),j(c,`all`)),l=n()});let d=k(()=>{let e=new Map;for(let t of I(u))e.set(t.provider,(e.get(t.provider)??0)+1);let t=[...e.entries()].map(([e,t])=>({id:e,label:uE(e),count:t})).sort((e,t)=>e.label.localeCompare(t.label));return[{id:`all`,label:`All`,count:I(u).length},...t]}),f=k(()=>{let e=I(s).trim().toLowerCase();return[...I(u)].filter(t=>I(c)!==`all`&&t.provider!==I(c)?!1:e?`${dE(t)} ${t.modelId} ${uE(t.provider)}`.toLowerCase().includes(e):!0).sort((e,t)=>uE(e.provider).localeCompare(uE(t.provider))||dE(e).localeCompare(dE(t)))}),p=k(()=>I(o).size);function m(e,t){let n=new Set(I(o)),r=aE(e);t?n.add(r):n.delete(r),j(o,n,!0)}function h(){let e=I(u).filter(e=>I(o).has(aE(e))).map(e=>({provider:e.provider,modelId:e.modelId}));t.onSave?.(e),n(!1)}nZ(e,{title:`Scope composer models`,description:`Pick the authenticated models to show in the composer. Leave everything unchecked to keep all models available.`,class:`scoped-models-dialog`,get open(){return n()},set open(e){n(e)},footer:e=>{var t=_Me(),r=N(t),i=M(r,!0);T(r);var a=P(r,2);Ml(a,{variant:`ghost`,onclick:()=>n(!1),children:(e,t)=>{E(),z(e,ki(`Cancel`))},$$slots:{default:!0}});var o=P(a,2);{let e=k(()=>I(u).length===0);Ml(o,{onclick:h,get disabled(){return I(e)},children:(e,t)=>{E(),z(e,ki(`Save selection`))},$$slots:{default:!0}})}F(()=>B(i,I(p)===0?`All models available`:`${I(p)} selected`)),z(e,t)},children:(e,t)=>{var n=wMe(),r=M(n),i=M(r),a=M(i);cZ(a,{size:15,strokeWidth:2,"aria-hidden":`true`}),DQ(P(a,2),{type:`search`,placeholder:`Search models`,"aria-label":`Search models`,class:`rounded-sm`,get value(){return I(s)},set value(e){j(s,e,!0)}}),T(i);var l=P(i,2),p=e=>{var t=yMe();Ri(t,21,()=>I(d),e=>e.id,(e,t)=>{var n=vMe();let r;var i=M(n),a=P(i),o=M(a,!0);T(a),T(n),F(()=>{r=ra(n,1,`scoped-chip svelte-19sy7aa`,null,r,{active:I(c)===I(t).id}),W(n,`aria-pressed`,I(c)===I(t).id),B(i,`${I(t).label??``} `),B(o,I(t).count)}),bi(`click`,n,()=>j(c,I(t).id,!0)),z(e,n)}),T(t),z(e,t)};V(l,e=>{I(u).length>0&&e(p)}),T(r);var h=P(r,2),g=M(h),_=e=>{z(e,bMe())},v=e=>{z(e,xMe())},y=e=>{var t=CMe();Ri(t,21,()=>I(f),e=>aE(e),(e,t)=>{let n=k(()=>I(o).has(aE(I(t))));var r=SMe(),i=M(r);let a;var s=M(i);{let e=k(()=>dE(I(t)));u5(s,{get checked(){return I(n)},onCheckedChange:e=>m(I(t),e===!0),get"aria-label"(){return I(e)}})}var c=P(s,2),l=M(c),u=M(l,!0);T(l);var d=P(l,2),f=M(d);T(d),T(c),T(i),T(r),F((e,r)=>{a=ra(i,1,`scoped-dialog-row svelte-19sy7aa`,null,a,{selected:I(n)}),B(u,e),B(f,`${r??``} · ${I(t).modelId??``}`)},[()=>dE(I(t)),()=>uE(I(t).provider)]),z(e,r)}),T(t),z(e,t)};V(g,e=>{I(u).length===0?e(_):I(f).length===0?e(v,1):e(y,-1)}),T(h),T(n),z(e,n)},$$slots:{footer:!0,default:!0}}),O()}xi([`click`]);var EMe=L(`<!> Add models`,1),DMe=L(`<p class="settings-note">Authenticate a provider before choosing scoped models.</p>`),OMe=L(`<div class="scoped-empty svelte-d6l02t"><strong class="svelte-d6l02t">No scope set</strong> <span class="svelte-d6l02t">Every authenticated model appears in the composer picker. Add models to narrow it down.</span></div>`),kMe=L(`<span class="scoped-list-stale svelte-d6l02t"><!> Unavailable</span>`),AMe=L(`<li><span class="scoped-list-text svelte-d6l02t"><strong class="svelte-d6l02t"> </strong> <span class="svelte-d6l02t"> </span></span> <!> <button type="button" class="scoped-list-remove svelte-d6l02t"><!></button></li>`),jMe=L(`<p class="settings-note"> </p>`),MMe=L(`<ul class="scoped-list svelte-d6l02t" aria-label="Scoped models"></ul> <!>`,1),NMe=L(`<section id="settings-models" class="settings-section" data-section="models"><header class="settings-section-header"><div class="settings-section-kicker"><!> Scoped Models</div> <h2>Composer model scope</h2> <p>Keep the model picker focused on the authenticated models you regularly use.</p></header> <div class="settings-section-body"><div class="settings-row scoped-models-summary svelte-d6l02t"><div class="settings-copy"><strong> </strong> <span> </span></div> <div class="scoped-models-actions svelte-d6l02t"><!> <!></div></div> <!></div></section> <!>`,1);function PMe(e,t){D(t,!0);let n=q(t,`settingsDraft`,7),r=q(t,`models`,19,()=>[]),i=q(t,`authProviders`,19,()=>[]),a=A(!1),o=k(()=>_E(r(),i())),s=k(()=>new Map(I(o).map(e=>[aE(e),e]))),c=k(()=>n().scopedModels.length>0),l=k(()=>n().scopedModels.map(e=>{let t=aE(e),n=I(s).get(t);return{key:t,selection:e,model:n,stale:!n}}).sort((e,t)=>{let n=uE(e.selection.provider).localeCompare(uE(t.selection.provider)),r=e.model?dE(e.model):e.selection.modelId,i=t.model?dE(t.model):t.selection.modelId;return n||r.localeCompare(i)})),u=k(()=>I(l).filter(e=>e.stale).length),d=k(()=>I(l).length-I(u)),f=k(()=>I(c)?`Showing ${I(d)} of ${I(o).length} authenticated models in the composer.`:`All authenticated models are shown in the composer.`);function p(e){n().scopedModels=e,t.onSettingsChange?.({scopedModels:e},{immediate:!0})}function m(e){p(n().scopedModels.filter(t=>aE(t)!==e))}function h(){p([])}var g=NMe(),_=N(g),v=M(_),y=M(v);mMe(M(y),{size:14,strokeWidth:2.1}),E(),T(y),E(4),T(v);var b=P(v,2),x=M(b),S=M(x),ee=M(S),C=M(ee,!0);T(ee);var te=P(ee,2),ne=M(te,!0);T(te),T(S);var re=P(S,2),ie=M(re),ae=e=>{Ml(e,{variant:`ghost`,size:`sm`,onclick:h,children:(e,t)=>{E(),z(e,ki(`Clear`))},$$slots:{default:!0}})};V(ie,e=>{I(c)&&e(ae)});var oe=P(ie,2);{let e=k(()=>I(o).length===0);Ml(oe,{size:`sm`,get disabled(){return I(e)},onclick:()=>j(a,!0),children:(e,t)=>{var n=EMe();ZZ(N(n),{size:15,strokeWidth:2.2}),E(),z(e,n)},$$slots:{default:!0}})}T(re),T(x);var w=P(x,2),se=e=>{z(e,DMe())},ce=e=>{z(e,OMe())},le=e=>{var t=MMe(),n=N(t);Ri(n,21,()=>I(l),e=>e.key,(e,t)=>{var n=AMe();let r;var i=M(n),a=M(i),o=M(a,!0);T(a);var s=P(a,2),c=M(s);T(s),T(i);var l=P(i,2),u=e=>{var t=kMe();Vd(M(t),{size:13,strokeWidth:2}),E(),T(t),z(e,t)};V(l,e=>{I(t).stale&&e(u)});var d=P(l,2);ZX(M(d),{size:14,strokeWidth:2.2}),T(d),T(n),F((e,i,a)=>{r=ra(n,1,`scoped-list-item svelte-d6l02t`,null,r,{stale:I(t).stale}),B(o,e),B(c,`${i??``} · ${I(t).selection.modelId??``}`),W(d,`aria-label`,a)},[()=>I(t).model?dE(I(t).model):I(t).selection.modelId,()=>uE(I(t).selection.provider),()=>`Remove ${I(t).model?dE(I(t).model):I(t).selection.modelId}`]),bi(`click`,d,()=>m(I(t).key)),z(e,n)}),T(n);var r=P(n,2),i=e=>{var t=jMe(),n=M(t);T(t),F(()=>B(n,`${I(u)??``} scoped ${I(u)===1?`model is`:`models are`} no longer available and will be ignored by the picker.`)),z(e,t)};V(r,e=>{I(u)>0&&e(i)}),z(e,t)};V(w,e=>{I(o).length===0?e(se):I(c)?e(le,-1):e(ce,1)}),T(b),T(_),TMe(P(_,2),{get models(){return r()},get authProviders(){return i()},get scopedModels(){return n().scopedModels},onSave:p,get open(){return I(a)},set open(e){j(a,e,!0)}}),F(()=>{B(C,I(c)?`Scoped picker`:`All models`),B(ne,I(f))}),z(e,g),O()}xi([`click`]);var FMe=L(`<section id="settings-server" class="settings-section" data-section="server"><header class="settings-section-header"><div class="settings-section-kicker"><!> Server</div> <h2>Server binding</h2> <p>Host, port, and remote access settings are persisted immediately but apply after daemon restart.</p></header> <div class="settings-section-body"><div class="settings-field-grid"><label><span>Host</span> <!></label> <label><span>Port</span> <!></label></div> <div class="settings-row"><!></div> <p class="settings-note">Restart the daemon after changing host, port, or remote access.</p></div></section>`);function IMe(e,t){D(t,!0);let n=q(t,`settingsDraft`,7);function r(e){n().server.host=e,t.onSettingsChange?.({server:{host:e}},{debounceMs:650})}function i(e){let r=Number(e);if(Number.isFinite(r)&&r>0){let e=Math.floor(r);n().server.port=e,t.onSettingsChange?.({server:{port:e}},{debounceMs:650})}}var a=FMe(),o=M(a),s=M(o);c5(M(s),{size:14,strokeWidth:2.1}),E(),T(s),E(4),T(o);var c=P(o,2),l=M(c),u=M(l);DQ(P(M(u),2),{get value(){return n().server.host},size:`sm`,ariaLabel:`Server host`,oninput:e=>r(e.currentTarget.value)}),T(u);var d=P(u,2),f=P(M(d),2);{let e=k(()=>String(n().server.port));DQ(f,{get value(){return I(e)},type:`number`,size:`sm`,ariaLabel:`Server port`,oninput:e=>i(e.currentTarget.value)})}T(d),T(l);var p=P(l,2);QQ(M(p),{class:`settings-full-switch`,label:`Allow remote connections`,description:`Keep local binding unless remote access is required.`,onCheckedChange:e=>{n().server.allowRemote=e,t.onSettingsChange?.({server:{allowRemote:e}},{immediate:!0})},get checked(){return n().server.allowRemote},set checked(e){n().server.allowRemote=e}}),T(p),E(2),T(c),T(a),z(e,a),O()}var LMe=new Set([`$$slots`,`$$events`,`$$legacy`]);function RMe(e,t){let n=G(t,LMe),r=[[`path`,{d:`M10 16h.01`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`}],[`path`,{d:`M21.946 12.013H2.054`}],[`path`,{d:`M6 16h.01`}]];uc(e,K({name:`hard-drive`},()=>n,{get iconNode(){return r}}))}var zMe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`max`,`value`]),BMe=L(`<div data-slot="progress-indicator" class="bg-primary size-full flex-1 transition-all"></div>`);function VMe(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`max`,3,100),i=G(t,zMe);var a=R(),o=N(a);{let e=k(()=>ul(`bg-muted h-1.5 rounded-full relative flex w-full items-center overflow-x-hidden`,t.class));U(o,()=>bb,(a,o)=>{o(a,K({"data-slot":`progress`,get class(){return I(e)},get value(){return t.value},get max(){return r()}},()=>i,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var i=BMe();F(()=>aa(i,`transform: translateX(-${100-100*(t.value??0)/(r()??1)}%)`)),z(e,i)},$$slots:{default:!0}}))})}z(e,a),O()}function HMe(){return jw(`/api/storage/usage`)}function UMe(e){return Mw(`/api/storage/cleanup`,e)}var WMe=L(`<!> Refresh`,1),GMe=L(`<p class="settings-note settings-note-error"> </p>`),KMe=L(`<p class="settings-note">Calculating storage usage…</p>`),qMe=L(`<li class="storage-row"><div class="storage-row-head"><span class="storage-row-label"> <!></span> <span class="storage-row-size"> </span></div> <!> <span class="storage-row-meta"> </span></li>`),JMe=L(`<li><span> </span> <span class="storage-row-size"> </span></li>`),YMe=L(`<div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Largest conversations</strong> <span>Prune old conversations below to reclaim this space.</span></div> <ul class="storage-largest"></ul></div>`),XMe=L(`<!> `,1),ZMe=L(`<ul class="storage-breakdown"></ul> <div class="stat-grid storage-sqlite"><section><span>SQLite database</span><strong> </strong></section> <section><span>Write-ahead log</span><strong> </strong></section> <section><span>Conversations</span><strong> </strong></section></div> <!> <div class="settings-row settings-row-stacked"><div class="settings-copy"><strong>Free up space</strong> <span>Select what to remove. Conversation pruning skips active conversations and
|
|
142
|
-
keeps credentials and configuration intact.</span></div> <div class="storage-cleanup"><label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Old conversations</strong> <span>Delete conversations not updated recently.</span></span> <span class="storage-cleanup-control"><!> <span>days</span></span></label> <label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Old log files</strong> <span>Delete dated application and desktop logs.</span></span> <span class="storage-cleanup-control"><!> <span>days</span></span></label> <label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Tool-call log</strong> <span>Compact superseded tool-call history.</span></span></label> <label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Rotated event log</strong> <span>Remove the archived events.jsonl.1 file.</span></span></label> <label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Explore reports</strong> <span>Delete saved explore sub-agent output.</span></span></label> <label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Cache</strong> <span>Remove disposable cached data.</span></span></label> <label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Temporary files</strong> <span>Remove scratch files in the tmp directory.</span></span></label> <label class="storage-cleanup-item"><!> <span class="storage-cleanup-text"><strong>Search index</strong> <span>Checkpoint and VACUUM the SQLite cache.</span></span></label></div> <div><!></div></div> <p class="settings-note">Deletions are permanent. The search index is rebuildable, but pruned
|
|
143
|
-
conversations and logs cannot be recovered.</p>`,1),QMe=L(`<section id="settings-storage" class="settings-section" data-section="storage"><header class="settings-section-header"><div class="settings-section-kicker"><!> Storage</div> <h2>Storage usage</h2> <p>Disk used by Nerve under its data directory, and tools to free up space.</p></header> <div class="settings-section-body"><div class="storage-summary"><div class="storage-summary-total"><span>Total</span> <strong> </strong></div> <!></div> <!></div></section> <!>`,1);function $Me(e,t){D(t,!0);let n=A(void 0),r=A(!0),i=A(void 0),a=A(!1),o=A(!1),s=A(!1),c=A(30),l=A(!1),u=A(14),d=A(!1),f=A(!1),p=A(!1),m=A(!1),h=A(!1),g=A(!1);function _(e){if(e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=Math.min(t.length-1,Math.floor(Math.log(e)/Math.log(1024))),r=e/1024**n,i=r>=100||n===0?0:1;return`${r.toFixed(i)} ${t[n]}`}async function v(){j(r,!0),j(i,void 0);try{j(n,await HMe(),!0)}catch(e){j(i,e instanceof Error?e.message:`Could not load storage usage.`,!0)}finally{j(r,!1)}}Na(v);let y=k(()=>I(n)?.totalBytes??0);function b(e){return I(y)?Math.min(100,Math.round(e/I(y)*100)):0}function x(){let e={};return I(s)&&I(c)>0&&(e.conversationsOlderThanDays=Math.floor(I(c))),I(l)&&I(u)>0&&(e.logsOlderThanDays=Math.floor(I(u))),I(d)&&(e.truncateEventLog=!0),I(f)&&(e.clearToolCallLog=!0),I(p)&&(e.clearExploreReports=!0),I(m)&&(e.clearCache=!0),I(h)&&(e.clearTmp=!0),I(g)&&(e.vacuumSqlite=!0),Object.keys(e).length>0?e:void 0}let S=k(x),ee=k(()=>I(S)!==void 0);function C(){let e=[];return I(s)&&e.push(`conversations older than ${I(c)} days`),I(l)&&e.push(`logs older than ${I(u)} days`),I(d)&&e.push(`rotated event log`),I(f)&&e.push(`tool-call log`),I(p)&&e.push(`explore reports`),I(m)&&e.push(`cache`),I(h)&&e.push(`temporary files`),I(g)&&e.push(`compact the search index`),e.join(`, `)}async function te(){let e=I(S);if(e){j(a,!0);try{let t=await UMe(e);j(n,t.usage,!0),cd.success(`Freed ${_(t.freedBytes)}`,{description:t.results.filter(e=>e.freedBytes>0||e.note).map(e=>`${e.target}: ${_(e.freedBytes)}`).join(` · `)}),j(s,!1),j(l,!1),j(d,!1),j(f,!1),j(p,!1),j(m,!1),j(h,!1),j(g,!1)}catch(e){cd.error(`Cleanup failed`,{description:e instanceof Error?e.message:`Could not free up space.`})}finally{j(a,!1)}}}var ne=QMe(),re=N(ne),ie=M(re),ae=M(ie);RMe(M(ae),{size:14,strokeWidth:2.1}),E(),T(ae),E(4),T(ie);var oe=P(ie,2),w=M(oe),se=M(w),ce=P(M(se),2),le=M(ce,!0);T(ce),T(se),Ml(P(se,2),{size:`sm`,variant:`outline`,get disabled(){return I(r)},onclick:v,"aria-label":`Refresh storage usage`,children:(e,t)=>{var n=WMe();O8(N(n),{size:14,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}}),T(w);var ue=P(w,2),de=e=>{var t=GMe(),n=M(t,!0);T(t),F(()=>B(n,I(i))),z(e,t)},fe=e=>{z(e,KMe())},pe=e=>{var t=ZMe(),r=N(t);Ri(r,21,()=>I(n).categories,e=>e.key,(e,t)=>{var n=qMe(),r=M(n),i=M(r),a=M(i),o=P(a),s=e=>{uf(e,{size:`sm`,variant:`secondary`,children:(e,t)=>{E(),z(e,ki(`Protected`))},$$slots:{default:!0}})};V(o,e=>{I(t).protected&&e(s)}),T(i);var c=P(i,2),l=M(c,!0);T(c),T(r);var u=P(r,2);{let e=k(()=>b(I(t).bytes));VMe(u,{get value(){return I(e)},max:100})}var d=P(u,2),f=M(d);T(d),T(n),F((e,n,r)=>{B(a,`${I(t).label??``} `),B(l,e),B(f,`${n??``} files · ${r??``}%`)},[()=>_(I(t).bytes),()=>I(t).fileCount.toLocaleString(),()=>b(I(t).bytes)]),z(e,n)}),T(r);var i=P(r,2),v=M(i),y=P(M(v)),x=M(y,!0);T(y),T(v);var S=P(v,2),C=P(M(S)),te=M(C,!0);T(C),T(S);var ne=P(S,2),re=P(M(ne)),ie=M(re,!0);T(re),T(ne),T(i);var ae=P(i,2),oe=e=>{var t=YMe(),r=P(M(t),2);Ri(r,21,()=>I(n).conversations.largest,e=>e.conversationId,(e,t)=>{var n=JMe(),r=M(n),i=M(r,!0);T(r);var a=P(r,2),o=M(a,!0);T(a),T(n),F(e=>{W(r,`title`,I(t).conversationId),B(i,I(t).title??I(t).conversationId),B(o,e)},[()=>_(I(t).bytes)]),z(e,n)}),T(r),T(t),z(e,t)};V(ae,e=>{I(n).conversations.largest.length>0&&e(oe)});var w=P(ae,2),se=P(M(w),2),ce=M(se),le=M(ce);u5(le,{"aria-label":`Prune old conversations`,get checked(){return I(s)},set checked(e){j(s,e,!0)}});var ue=P(le,4),de=M(ue);{let e=k(()=>!I(s));DQ(de,{type:`number`,size:`sm`,min:1,get value(){return I(c)},get disabled(){return I(e)},ariaLabel:`Conversation age in days`,oninput:e=>j(c,Number(e.currentTarget.value),!0)})}E(2),T(ue),T(ce);var fe=P(ce,2),pe=M(fe);u5(pe,{"aria-label":`Prune old logs`,get checked(){return I(l)},set checked(e){j(l,e,!0)}});var me=P(pe,4),he=M(me);{let e=k(()=>!I(l));DQ(he,{type:`number`,size:`sm`,min:1,get value(){return I(u)},get disabled(){return I(e)},ariaLabel:`Log age in days`,oninput:e=>j(u,Number(e.currentTarget.value),!0)})}E(2),T(me),T(fe);var ge=P(fe,2);u5(M(ge),{"aria-label":`Compact tool-call log`,get checked(){return I(f)},set checked(e){j(f,e,!0)}}),E(2),T(ge);var _e=P(ge,2);u5(M(_e),{"aria-label":`Remove rotated event log`,get checked(){return I(d)},set checked(e){j(d,e,!0)}}),E(2),T(_e);var ve=P(_e,2);u5(M(ve),{"aria-label":`Clear explore reports`,get checked(){return I(p)},set checked(e){j(p,e,!0)}}),E(2),T(ve);var ye=P(ve,2);u5(M(ye),{"aria-label":`Clear cache`,get checked(){return I(m)},set checked(e){j(m,e,!0)}}),E(2),T(ye);var be=P(ye,2);u5(M(be),{"aria-label":`Clear temporary files`,get checked(){return I(h)},set checked(e){j(h,e,!0)}}),E(2),T(be);var xe=P(be,2);u5(M(xe),{"aria-label":`Compact search index`,get checked(){return I(g)},set checked(e){j(g,e,!0)}}),E(2),T(xe),T(se);var Se=P(se,2),Ce=M(Se);{let e=k(()=>!I(ee)||I(a));Ml(Ce,{size:`sm`,variant:`destructive`,get disabled(){return I(e)},onclick:()=>j(o,!0),children:(e,t)=>{var n=XMe(),r=N(n);GQ(r,{size:14,strokeWidth:2});var i=P(r);F(()=>B(i,` ${I(a)?`Freeing space…`:`Free up space`}`)),z(e,n)},$$slots:{default:!0}})}T(Se),T(w),E(2),F((e,t,n)=>{B(x,e),B(te,t),B(ie,n)},[()=>_(I(n).sqlite.dbBytes),()=>_(I(n).sqlite.walBytes),()=>I(n).conversations.total.toLocaleString()]),z(e,t)};V(ue,e=>{I(i)?e(de):I(r)&&!I(n)?e(fe,1):I(n)&&e(pe,2)}),T(oe),T(re);var me=P(re,2);{let e=k(()=>`This permanently removes: ${C()}.`);SQ(me,{title:`Free up storage?`,get description(){return I(e)},confirmLabel:`Delete data`,onConfirm:te,get open(){return I(o)},set open(e){j(o,e,!0)}})}F(e=>B(le,e),[()=>_(I(y))]),z(e,ne),O()}var eNe=L(`<button type="button"><!> <span> </span></button>`),tNe=L(`<button type="button" role="tab"> </button>`),nNe=L(`<div class="settings-subnav" role="tablist"></div>`),d5=L(`<!> <!>`,1),rNe=L(`<!> <!> <!> <!>`,1),iNe=L(`<header class="settings-panel-header"><h2> </h2> <p> </p> <!></header> <!>`,1),aNe=L(`<section class="app-empty-state settings-loading"><!> <strong>Settings are loading</strong> <p>Use the tab refresh action if this takes longer than expected.</p></section>`),oNe=L(`<div class="settings-main"><!></div>`),sNe=L(`<section class="settings-page"><aside class="settings-sidebar" aria-label="Settings sections"><div class="settings-sidebar-title"><strong>Settings</strong> <span>Auto-saved</span></div> <nav class="settings-nav"></nav> <div class="settings-save-state"><span></span> <p> </p></div></aside> <!></section>`);function cNe(e,t){D(t,!0);let n=[{id:`workbench`,label:`Workbench`,description:`Appearance and desktop window behavior.`,icon:s5,sections:[{id:`appearance`,label:`Appearance`},{id:`desktop`,label:`Desktop`}]},{id:`agents`,label:`Agents`,description:`Defaults for new agents and the codebase explore delegate.`,icon:Ww,sections:[{id:`agents`,label:`Defaults`},{id:`explore`,label:`Explore agent`}]},{id:`models`,label:`Models`,description:`Choose which authenticated models appear in the composer.`,icon:YX,sections:[{id:`models`,label:`Scoped models`}]},{id:`system`,label:`System`,description:`Server binding, Python runtime, and daemon diagnostics.`,icon:c5,sections:[{id:`server`,label:`Server`},{id:`python`,label:`Python`},{id:`storage`,label:`Storage`},{id:`runtime`,label:`Diagnostics`}]}],r=q(t,`models`,19,()=>[]),i=q(t,`authProviders`,19,()=>[]),a=q(t,`settingsSaveStatus`,3,`idle`),o=A(`workbench`),s=A(`appearance`),c=k(()=>n.find(e=>e.id===I(o))??n[0]);function l(e){if(e===I(o))return;j(o,e,!0);let t=n.find(t=>t.id===e)?.sections[0];t&&j(s,t.id,!0),u()}async function u(){await Zr(),document.querySelector(`.settings-viewport`)?.scrollTo({top:0})}function d(e){j(s,e,!0),document.getElementById(`settings-${e}`)?.scrollIntoView({behavior:`smooth`,block:`start`})}sr(()=>{let e=I(c);if(!t.settingsDraft)return;let n,r=!1;return(async()=>{if(await Zr(),r)return;let t=document.querySelector(`.settings-viewport`),i=e.sections.map(e=>document.getElementById(`settings-${e.id}`)).filter(e=>e!==null);if(i.length!==0){n=new IntersectionObserver(e=>{let t=e.filter(e=>e.isIntersecting).sort((e,t)=>e.boundingClientRect.top-t.boundingClientRect.top)[0]?.target.getAttribute(`data-section`);t&&j(s,t,!0)},{root:t,rootMargin:`0px 0px -65% 0px`,threshold:0});for(let e of i)n.observe(e)}})(),()=>{r=!0,n?.disconnect()}});function f(){return t.settingsMessage?t.settingsMessage:a()===`saving`?`Saving…`:a()===`dirty`?`Unsaved changes`:a()===`saved`?`Saved`:a()===`error`?`Could not save settings`:`Auto save enabled`}var p=sNe(),m=M(p),h=P(M(m),2);Ri(h,21,()=>n,Fi,(e,t)=>{let n=k(()=>I(t).icon);var r=eNe();let i;var a=M(r);U(a,()=>I(n),(e,t)=>{t(e,{size:16,strokeWidth:2})});var s=P(a,2),c=M(s,!0);T(s),T(r),F(()=>{W(r,`aria-current`,I(o)===I(t).id?`page`:void 0),i=ra(r,1,``,null,i,{active:I(o)===I(t).id}),B(c,I(t).label)}),bi(`click`,r,()=>l(I(t).id)),z(e,r)}),T(h);var g=P(h,2),_=P(M(g),2),v=M(_,!0);T(_),T(g),T(m),pZ(P(m,2),{class:`settings-scroll`,viewportClass:`settings-viewport`,type:`auto`,children:(e,n)=>{var a=oNe(),l=M(a),u=e=>{var n=iNe(),a=N(n),l=M(a),u=M(l,!0);T(l);var f=P(l,2),p=M(f,!0);T(f);var m=P(f,2),h=e=>{var t=nNe();Ri(t,21,()=>I(c).sections,Fi,(e,t)=>{var n=tNe();let r;var i=M(n,!0);T(n),F(()=>{W(n,`aria-selected`,I(s)===I(t).id),r=ra(n,1,``,null,r,{active:I(s)===I(t).id}),B(i,I(t).label)}),bi(`click`,n,()=>d(I(t).id)),z(e,n)}),T(t),F(()=>W(t,`aria-label`,`${I(c).label??``} sections`)),z(e,t)};V(m,e=>{I(c).sections.length>1&&e(h)}),T(a);var g=P(a,2),_=e=>{var n=d5(),r=N(n);Yje(r,{get settingsDraft(){return t.settingsDraft},get onThemeChange(){return t.onThemeChange},get onSettingsChange(){return t.onSettingsChange}}),tMe(P(r,2),{get settingsDraft(){return t.settingsDraft},get onSettingsChange(){return t.onSettingsChange}}),z(e,n)},v=e=>{var n=d5(),a=N(n);Zje(a,{get settingsDraft(){return t.settingsDraft},get models(){return r()},get authProviders(){return i()},get onSettingsChange(){return t.onSettingsChange}}),rMe(P(a,2),{get settingsDraft(){return t.settingsDraft},get models(){return r()},get authProviders(){return i()},get onSettingsChange(){return t.onSettingsChange}}),z(e,n)},y=e=>{PMe(e,{get settingsDraft(){return t.settingsDraft},get models(){return r()},get authProviders(){return i()},get onSettingsChange(){return t.onSettingsChange}})},b=e=>{var n=rNe(),r=N(n);IMe(r,{get settingsDraft(){return t.settingsDraft},get onSettingsChange(){return t.onSettingsChange}});var i=P(r,2);fMe(i,{get settingsDraft(){return t.settingsDraft},get status(){return t.status},get onSettingsChange(){return t.onSettingsChange}});var a=P(i,2);$Me(a,{}),sMe(P(a,2),{get status(){return t.status}}),z(e,n)};V(g,e=>{I(o)===`workbench`?e(_):I(o)===`agents`?e(v,1):I(o)===`models`?e(y,2):I(o)===`system`&&e(b,3)}),F(()=>{B(u,I(c).label),B(p,I(c).description)}),z(e,n)},f=e=>{var t=aNe();uZ(M(t),{size:28,strokeWidth:1.8}),E(4),T(t),z(e,t)};V(l,e=>{t.settingsDraft?e(u):e(f,-1)}),T(a),z(e,a)},$$slots:{default:!0}}),T(p),F(e=>{W(g,`data-status`,a()),B(v,e)},[()=>f()]),z(e,p),O()}xi([`click`]);var f5={get settingsDraft(){return NT.settingsDraft},get settingsSaveStatus(){return NT.settingsSaveStatus},get settingsMessage(){return NT.settingsMessage},get selectedModelKey(){return kT.selectedModelKey}};function lNe(e,t){D(t,!0);let n=k(()=>R6.status),r=k(()=>f5.settingsSaveStatus),i=k(()=>f5.settingsMessage);cNe(e,{get status(){return I(n)},get models(){return NT.models},get authProviders(){return NT.authProviders},get settingsSaveStatus(){return I(r)},get settingsMessage(){return I(i)},get onSettingsChange(){return BZ},get onThemeChange(){return HZ},get settingsDraft(){return NT.settingsDraft},set settingsDraft(e){NT.settingsDraft=e}}),O()}var uNe=[`anthropic`,`openai-codex`],dNe={get activeSubscriptionProvider(){return _8.activeSubscriptionProvider},get activeSubscriptionUsage(){return _8.activeSubscriptionUsage},get subscriptionUsages(){let e=_8.activeSubscriptionProvider;return uNe.map(t=>({provider:t,usage:SZ.subscriptionUsage[t],active:t===e}))}},p5={kind:`logs`,id:`logs`};function fNe(){WT(p5),JT(p5)}function pNe(){WT(p5),JT(p5)}function mNe(){let e=Y.activeCenterTab?.kind===`logs`,t=KT(p5);qT(p5),e&&XT(t)}zT({select:{conversation:e=>o6(e.id),"pending-conversation":e=>c6(e.id),task:e=>o5(e.id),file:e=>JDe(e.id),pr:e=>zOe(e.id),settings:()=>AZ(),auth:()=>KZ(),logs:()=>pNe()},close:{conversation:e=>_De(e.id),"pending-conversation":e=>vDe(e.id),task:e=>Fje(e.id),file:e=>ZDe(e.id),pr:e=>BOe(e.id),settings:()=>jZ(),auth:()=>qZ(),logs:()=>mNe()}});function m5(e){return Y.openCenterTabs.findIndex(t=>IT(t,e))}function hNe(e,t){return!!(e&&t.some(t=>IT(t,e)))}function gNe(e){return new Set(e.map(FT))}function _Ne(){DT(),Y.error=void 0,ET.text=``}function vNe(){oA(kT.openConversationTabIds,kT.activeConversationTabId)}function yNe(e,t,n){if(!t.length)return;let r=Math.min(...n);return e.slice(r).find(e=>t.some(t=>IT(t,e)))||e.slice(0,r).reverse().find(e=>t.some(t=>IT(t,e)))}function bNe(e){let t=m5(e);return t<=0?[]:Y.openCenterTabs.slice(0,t)}function xNe(e){let t=m5(e);return t===-1?[]:Y.openCenterTabs.slice(t+1)}function h5(e){return Y.openCenterTabs.filter(t=>!IT(t,e))}async function g5(e,t){let n=gNe(e);if(!n.size)return;let r=[...Y.openCenterTabs],i=r.map((e,t)=>n.has(FT(e))?t:-1).filter(e=>e!==-1);if(!i.length)return;let a=r.filter(e=>!n.has(FT(e))),o=!!(Y.activeCenterTab&&n.has(FT(Y.activeCenterTab))),s=!!(TT.conversationId&&n.has(FT({kind:`conversation`,id:TT.conversationId}))),c=!!(Y.activeCenterTab?.kind===`pending-conversation`&&n.has(FT(Y.activeCenterTab))),l=hNe(t,a)?t:yNe(r,a,i),u=[];for(let e of r)n.has(FT(e))&&(e.kind===`conversation`&&u.push({kind:`conversation`,id:e.id}),e.kind===`pending-conversation`&&u.push({kind:`pending-conversation`,id:e.id}));await TA.cancelIfTargets(u),UT(a);for(let e of r)n.has(FT(e))&&(e.kind===`file`&&delete AT.fileViews[tE(e.id)],e.kind===`conversation`&&delete kT.conversationViews[$T(e.id)],e.kind===`pending-conversation`&&delete kT.pendingConversations[eE(e.id)]);PT.selectedTaskId&&n.has(FT({kind:`task`,id:PT.selectedTaskId}))&&(PT.selectedTaskId=void 0,PT.taskLogs=void 0);let d=a.filter(e=>e.kind===`conversation`).map(e=>e.id);kT.activeConversationTabId&&n.has(FT({kind:`conversation`,id:kT.activeConversationTabId}))&&(kT.activeConversationTabId=l?.kind===`conversation`?l.id:d[0]),(s||c)&&l?.kind!==`conversation`&&l?.kind!==`pending-conversation`&&_Ne(),vNe(),o&&(Y.activeCenterTab=void 0,l&&await XT(l))}function SNe(e,t){D(t,!0);let n=k(()=>R6.activeProject),r=k(()=>R6.connection),i=k(()=>_8.live),a=k(()=>_8.pendingApprovalCount),o=k(()=>q8.scopedTasks),s=k(()=>p8.gitStatus),c=k(()=>dNe.subscriptionUsages),l=k(()=>R6.status),u=k(()=>f5.settingsDraft),d=k(()=>I(u)?.ui.zoomLevel??NC.level),f=k(()=>cw.isCompact),p=k(()=>cw.isPhone),m=k(()=>I(f)?!AC.navDrawerOpen:AC.sidebarCollapsed),h=k(()=>I(f)?!AC.utilityDrawerOpen:AC.utilityCollapsed);function g(){I(f)?AC.navDrawerOpen?qC():GC():BC(!AC.sidebarCollapsed)}function _(){I(f)?AC.utilityDrawerOpen?qC():KC():HC(!AC.utilityCollapsed)}{let t=k(()=>I(l)?.storage.home);rw(e,{get activeProject(){return I(n)},get connection(){return I(r)},get live(){return I(i)},get pendingApprovals(){return I(a)},get tasks(){return I(o)},get gitStatus(){return I(s)},get subscriptionUsages(){return I(c)},get status(){return I(l)},get homeDir(){return I(t)},get zoomLevel(){return I(d)},get sidebarCollapsed(){return I(m)},get utilityCollapsed(){return I(h)},get phone(){return I(p)},get onZoomLevelChange(){return UZ},onToggleSidebar:g,onToggleUtility:_})}O()}var CNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function _5(e,t){let n=G(t,CNe),r=[[`path`,{d:`M12 22v-6`}],[`path`,{d:`M12 8V2`}],[`path`,{d:`M4 12H2`}],[`path`,{d:`M10 12H8`}],[`path`,{d:`M16 12h-2`}],[`path`,{d:`M22 12h-2`}],[`path`,{d:`m15 19-3-3-3 3`}],[`path`,{d:`m15 5-3 3-3-3`}]];uc(e,K({name:`fold-vertical`},()=>n,{get iconNode(){return r}}))}var wNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function v5(e,t){let n=G(t,wNe),r=[[`circle`,{cx:`12`,cy:`12`,r:`1`}],[`circle`,{cx:`19`,cy:`12`,r:`1`}],[`circle`,{cx:`5`,cy:`12`,r:`1`}]];uc(e,K({name:`ellipsis`},()=>n,{get iconNode(){return r}}))}var TNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function y5(e,t){let n=G(t,TNe),r=[[`path`,{d:`M12 22v-6`}],[`path`,{d:`M12 8V2`}],[`path`,{d:`M4 12H2`}],[`path`,{d:`M10 12H8`}],[`path`,{d:`M16 12h-2`}],[`path`,{d:`M22 12h-2`}],[`path`,{d:`m15 19-3 3-3-3`}],[`path`,{d:`m15 5-3-3-3 3`}]];uc(e,K({name:`unfold-vertical`},()=>n,{get iconNode(){return r}}))}var ENe=/^\[Tool call:([\s\S]*)\]$/,b5=new Set([`ask_user`,`plan_mode_present`]),DNe={read:`file-text`,bash:`terminal`,python:`terminal`,edit:`file-pen`,write:`file-plus`,grep:`search`,find:`folder-search`,ls:`folder-tree`,web_search:`globe`,web_fetch:`download`,task_start:`cpu`,task_status:`cpu`,task_logs:`cpu`,task_cancel:`cpu`,task_restart:`cpu`,task_list:`cpu`,explore:`search`,ask_user:`message-circle-question`,plan_mode_enter:`clipboard-list`,plan_mode_present:`clipboard-check`,plan_mode_force_exit:`clipboard-list`,todos_set:`list-todo`,todos_get:`list-todo`};function x5(e){return e&&DNe[e]||`wrench`}function S5(e){return e&&typeof e==`object`?e:void 0}function ONe(e){return typeof e==`string`&&e.length>0?e:void 0}function C5(e){return typeof e==`string`&&e.startsWith(`tool_`)?e:void 0}function kNe(e){let t=e?.thinkingBlocks;return Array.isArray(t)?t.some(e=>{let t=S5(e);return t?typeof t.text==`string`&&t.text.length>0||t.redacted===!0:!1}):!1}function w5(e,t){if(!e)return;let n=S5(S5(e.details)?.toolCall),r=C5(e.toolRecordId)??C5(n?.id);return r?t.get(r):void 0}function ANe(e,t){return w5(S5(e.details),t)}function T5(e){let t=e.trim().match(ENe);return t?[...t[1].matchAll(/([a-z_][a-z0-9_]*)\s*\(/gi)].map(e=>e[1]):[]}function E5(e){let t=e.replace(/\s+/g,` `).trim();return t.length>160?`${t.slice(0,160)}…`:t}function D5(e,t){let n=S5(e.details),r=[],i=e.usage?.totalTokens,a=()=>i&&i>0?{icon:`sparkles`,label:i>=1e3?`${Math.round(i/1e3)}k`:`${i}`,tone:`default`,title:`${i.toLocaleString()} tokens`}:void 0;if(e.kind===`compaction`)return{type:`compaction`,icon:`fold-vertical`,label:`Compacted`,preview:E5(e.summary||e.text),tone:`info`,mono:!1,badges:r};if(e.kind===`branch_summary`)return{type:`branch_summary`,icon:`git-branch`,label:`Branch summary`,preview:E5(e.summary||e.text),tone:`info`,mono:!1,badges:r};if(e.kind===`explore_report`)return{type:`explore_report`,icon:`search`,label:`Explore`,preview:E5(e.summary||e.text),tone:`info`,mono:!1,badges:r};if(e.role===`user`)return{type:`user`,icon:`user`,label:`You`,preview:E5(e.text)||`empty message`,tone:`default`,mono:!1,badges:r};if(e.role===`assistant`){kNe(n)&&r.push({icon:`brain`,tone:`info`,title:`Includes thinking`});let t=T5(e.text);if(t.length>0){let e=t[0],n=t.some(e=>b5.has(e)),i=t.length>1?` +${t.length-1}`:``;return{type:n?`human_loop`:`tool_call`,icon:x5(e),label:`${e}${i}`,preview:t.slice(0,4).join(`, `),tone:n?`warning`:`default`,mono:!0,badges:n?[{icon:`hand`,label:`input`,tone:`warning`},...r]:r}}let i=a();return i&&r.push(i),{type:`assistant`,icon:`sparkles`,label:`Assistant`,preview:E5(e.text)||`(thinking)`,tone:`default`,mono:!1,badges:r}}let o=ONe(n?.toolName);if(o){let i=w5(n,t),a=n?.isError===!0||i?.status===`error`||i?.status===`denied`,s=b5.has(o)||i?.risk===`interaction`||!!i?.approvalId;return s&&r.push({icon:`hand`,label:`human`,tone:`warning`}),a&&r.push({icon:`triangle-alert`,label:`error`,tone:`danger`}),{type:s?`human_loop`:`tool_result`,icon:x5(o),label:o,preview:E5(e.text),tone:a?`danger`:s?`warning`:`success`,mono:!0,badges:r}}return{type:`system`,icon:`info`,label:`System`,preview:E5(e.text)||`system entry`,tone:`default`,mono:!1,badges:r}}function jNe(e,t){let n=new Map(e.map(e=>[e.entry.id,e])),r=e=>e.entry.parentEntryId!==void 0&&n.has(e.entry.parentEntryId),i=e.filter(e=>!r(e)),a=new Set;if(t){let e=t;for(;e;){let t=n.get(e);if(!t)break;a.add(t.entry.id),e=t.entry.parentEntryId}}let o=[],s=new Set,c=0,l=0,u=e=>e.childEntryIds.map(e=>n.get(e)).filter(e=>!!e),d=(e,n,r)=>{if(s.has(e.entry.id))return;s.add(e.entry.id);let i=u(e);o.push({node:e,index:++l,lane:n,parentLane:r,isOnActivePath:a.has(e.entry.id),isActive:e.entry.id===t,isLeaf:i.length===0,isBranchPoint:i.length>1}),i.forEach((e,t)=>{d(e,t===0?n:c++,n)})};for(let e of i)d(e,c++,void 0);for(let t of e)s.has(t.entry.id)||d(t,c++,void 0);return{rows:o,laneCount:o.reduce((e,t)=>Math.max(e,t.lane+1),1)}}var MNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function NNe(e,t){let n=G(t,MNe),r=[[`path`,{d:`M12 18V5`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`}]];uc(e,K({name:`brain`},()=>n,{get iconNode(){return r}}))}var PNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function FNe(e,t){let n=G(t,PNe),r=[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`}],[`path`,{d:`m9 14 2 2 4-4`}]];uc(e,K({name:`clipboard-check`},()=>n,{get iconNode(){return r}}))}var INe=new Set([`$$slots`,`$$events`,`$$legacy`]);function LNe(e,t){let n=G(t,INe),r=[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`}],[`path`,{d:`M12 11h4`}],[`path`,{d:`M12 16h4`}],[`path`,{d:`M8 11h.01`}],[`path`,{d:`M8 16h.01`}]];uc(e,K({name:`clipboard-list`},()=>n,{get iconNode(){return r}}))}var RNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function zNe(e,t){let n=G(t,RNe),r=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M9 15h6`}],[`path`,{d:`M12 18v-6`}]];uc(e,K({name:`file-plus`},()=>n,{get iconNode(){return r}}))}var BNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function VNe(e,t){let n=G(t,BNe),r=[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`}],[`path`,{d:`m21 21-1.9-1.9`}],[`circle`,{cx:`17`,cy:`17`,r:`3`}]];uc(e,K({name:`folder-search`},()=>n,{get iconNode(){return r}}))}var HNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function UNe(e,t){let n=G(t,HNe),r=[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`}]];uc(e,K({name:`folder-tree`},()=>n,{get iconNode(){return r}}))}var WNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function GNe(e,t){let n=G(t,WNe),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`}],[`path`,{d:`M2 12h20`}]];uc(e,K({name:`globe`},()=>n,{get iconNode(){return r}}))}var KNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function qNe(e,t){let n=G(t,KNe),r=[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`}]];uc(e,K({name:`hand`},()=>n,{get iconNode(){return r}}))}var JNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function O5(e,t){let n=G(t,JNe),r=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M12 16v-4`}],[`path`,{d:`M12 8h.01`}]];uc(e,K({name:`info`},()=>n,{get iconNode(){return r}}))}var YNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function XNe(e,t){let n=G(t,YNe),r=[[`path`,{d:`M13 5h8`}],[`path`,{d:`M13 12h8`}],[`path`,{d:`M13 19h8`}],[`path`,{d:`m3 17 2 2 4-4`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`}]];uc(e,K({name:`list-todo`},()=>n,{get iconNode(){return r}}))}var ZNe=new Set([`$$slots`,`$$events`,`$$legacy`]);function QNe(e,t){let n=G(t,ZNe),r=[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}],[`path`,{d:`M12 17h.01`}]];uc(e,K({name:`message-circle-question-mark`},()=>n,{get iconNode(){return r}}))}var $Ne=new Set([`$$slots`,`$$events`,`$$legacy`]);function ePe(e,t){let n=G(t,$Ne),r=[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`}],[`circle`,{cx:`12`,cy:`7`,r:`4`}]];uc(e,K({name:`user`},()=>n,{get iconNode(){return r}}))}var tPe=new Set([`$$slots`,`$$events`,`$$legacy`]);function nPe(e,t){let n=G(t,tPe),r=[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`}]];uc(e,K({name:`wrench`},()=>n,{get iconNode(){return r}}))}var k5={user:ePe,sparkles:uZ,brain:NNe,wrench:nPe,"file-text":d1,terminal:zd,"file-pen":T8,"file-plus":zNe,search:cZ,"folder-search":VNe,"folder-tree":UNe,globe:GNe,download:Xw,cpu:oZ,bot:Ww,"message-circle-question":QNe,"clipboard-list":LNe,"clipboard-check":FNe,"list-todo":XNe,"fold-vertical":_5,"git-branch":kd,info:O5,hand:qNe,"triangle-alert":Vd},A5={default:`text-muted-foreground`,success:`text-success`,warning:`text-warning`,info:`text-info`,danger:`text-destructive`},j5=Oi(`<path fill="none"></path>`),M5=Oi(`<circle fill="none" stroke="var(--primary)"></circle>`),rPe=Oi(`<circle fill="var(--background)" stroke-dasharray="2 2"></circle><circle></circle>`,1),iPe=Oi(`<circle></circle>`),aPe=Oi(`<!><!>`,1),N5=L(`<span class="absolute inset-y-1.5 left-0 w-0.5 rounded-full bg-primary" aria-hidden="true"></span>`),oPe=L(`<button type="button"><span class="flex size-5 shrink-0 items-center justify-center text-muted-foreground"><!></span> <span class="shrink-0 text-xs font-medium text-foreground"> </span> <span class="min-w-0 flex-1 truncate text-xs text-muted-foreground"> </span> <span role="button" tabindex="0" class="flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground"><!></span></button>`),sPe=L(`<span><!></span>`),cPe=L(`<button type="button" title="Click to preview · double-click to jump"><!> <span><!></span> <span class="font-mono text-xs tabular-nums text-muted-foreground/50"> </span> <span class="min-w-0 flex-1 truncate text-xs font-medium text-foreground"> </span> <!> <span class="shrink-0 font-mono text-xs text-muted-foreground/50"> </span></button>`),lPe=L(`<p class="px-1 py-4 text-center text-xs text-muted-foreground">No messages yet.</p>`),uPe=L(`<div class="relative"><svg class="pointer-events-none absolute left-0 top-0" aria-hidden="true"><!><!><!><circle></circle><!></svg> <div class="flex flex-col"><button class="relative flex w-full items-center gap-2 rounded-md pr-2 text-left transition-colors hover:bg-muted/60 data-[selected=true]:bg-muted data-[active=true]:bg-muted/70" type="button" title="Start a branch from the beginning"><!> <span><!></span> <span class="font-mono text-xs tabular-nums text-muted-foreground/50">00</span> <span class="truncate text-xs font-medium text-foreground">Start of conversation</span></button> <!></div></div>`),dPe=L(`<p class="px-1 py-6 text-center text-xs text-muted-foreground">No conversation history loaded.</p>`);function fPe(e,t){D(t,!0);let n=k(()=>+!!t.hasConversation),r=k(()=>(t.items.length+I(n))*36),i=k(()=>t.laneCount*18+8),a=k(()=>t.rootOnActivePath?`var(--primary)`:`var(--muted-foreground)`);function o(e){return 4+e*18+18/2}function s(e){return e*36+36/2}function c(e){return s(e+I(n))}let l=k(()=>t.items.map((e,t)=>e.type===`entry`?{visibleIndex:t,lane:e.row.lane,parentEntryId:e.row.node.entry.parentEntryId,parentLane:e.row.parentLane,isOnActivePath:e.row.isOnActivePath,isActive:e.row.isActive,isLeaf:e.row.isLeaf,isSegment:!1}:{visibleIndex:t,lane:e.segment.lane,parentEntryId:e.segment.headParentEntryId,parentLane:e.segment.headParentLane,isOnActivePath:e.segment.isOnActivePath,isActive:!1,isLeaf:!1,isSegment:!0})),u=k(()=>{let e=[];for(let n of I(l)){let r=n.parentEntryId;if(r===void 0||n.parentLane===void 0||!t.treeNodeIds.has(r))continue;let i=t.visibleIndexById.get(r);if(i===void 0)continue;let a=o(n.lane),s=c(n.visibleIndex),l=o(n.parentLane),u=c(i);if(n.lane===n.parentLane)e.push({d:`M ${l} ${u} L ${a} ${s}`,active:n.isOnActivePath});else{let t=u+36;e.push({d:`M ${l} ${u} C ${l} ${u+36*.6} ${a} ${u+36*.4} ${a} ${t} L ${a} ${s}`,active:n.isOnActivePath})}}return e}),d=k(()=>{if(!t.hasConversation)return[];let e=[],n=o(0),r=s(0);for(let i of I(l)){let a=i.parentEntryId;if(a!==void 0&&t.treeNodeIds.has(a))continue;let s=o(i.lane),l=c(i.visibleIndex);e.push({d:i.lane===0?`M ${n} ${r} L ${s} ${l}`:`M ${n} ${r} C ${n} ${r+36*.6} ${s} ${l-36*.6} ${s} ${l}`,active:i.isOnActivePath})}return e});function f(e){let t=e.parts.map(e=>`${e.count} ${e.label}`).join(`, `);return`${e.total} steps — ${t}`}function p(e){let n=[{label:`Jump here`,icon:B3,onSelect:()=>t.onNavigateToEntry?.(e.entry.id)},{label:`Jump + summarize from here`,icon:uZ,onSelect:()=>t.onNavigateToEntry?.(e.entry.id,!0)}];return e.entry.role===`user`&&n.push({label:`Edit & resend`,icon:WQ,onSelect:()=>t.onEditEntry?.(e.entry)}),n.push({type:`separator`},{label:`Copy entry id`,icon:V3,onSelect:async()=>{try{await bE(e.entry.id),cd.success(`Copied entry id`)}catch{cd.error(`Could not copy to clipboard`)}}}),n}var m=R(),h=N(m),g=e=>{var n=uPe(),m=M(n),h=M(m);Ri(h,17,()=>I(d),Fi,(e,t)=>{var n=j5();F(()=>{W(n,`d`,I(t).d),W(n,`stroke`,I(t).active?`var(--primary)`:`var(--border)`),W(n,`stroke-width`,I(t).active?2:1.5)}),z(e,n)});var g=P(h);Ri(g,17,()=>I(u),Fi,(e,t)=>{var n=j5();F(()=>{W(n,`d`,I(t).d),W(n,`stroke`,I(t).active?`var(--primary)`:`var(--border)`),W(n,`stroke-width`,I(t).active?2:1.5)}),z(e,n)});var _=P(g),v=e=>{var t=M5();W(t,`r`,6.5),W(t,`stroke-width`,1.5),W(t,`opacity`,.5),F((e,n)=>{W(t,`cx`,e),W(t,`cy`,n)},[()=>o(0),()=>s(0)]),z(e,t)};V(_,e=>{t.rootActive&&e(v)});var y=P(_);W(y,`stroke-width`,1.5),Ri(P(y),17,()=>I(l),e=>e.visibleIndex,(e,t)=>{let n=k(()=>o(I(t).lane)),r=k(()=>c(I(t).visibleIndex)),i=k(()=>I(t).isOnActivePath?`var(--primary)`:`var(--muted-foreground)`);var a=aPe(),s=N(a),l=e=>{var t=M5();W(t,`r`,6.5),W(t,`stroke-width`,1.5),W(t,`opacity`,.5),F(()=>{W(t,`cx`,I(n)),W(t,`cy`,I(r))}),z(e,t)};V(s,e=>{I(t).isActive&&e(l)});var u=P(s),d=e=>{var t=rPe(),a=N(t);W(a,`r`,6),W(a,`stroke-width`,1.5);var o=P(a);W(o,`r`,2),F(()=>{W(a,`cx`,I(n)),W(a,`cy`,I(r)),W(a,`stroke`,I(i)),W(o,`cx`,I(n)),W(o,`cy`,I(r)),W(o,`fill`,I(i))}),z(e,t)},f=e=>{var a=iPe();W(a,`stroke-width`,1.5),F(()=>{W(a,`cx`,I(n)),W(a,`cy`,I(r)),W(a,`r`,I(t).isLeaf?4.5:4),W(a,`fill`,I(t).isLeaf||I(t).isActive?I(i):`var(--background)`),W(a,`stroke`,I(i))}),z(e,a)};V(u,e=>{I(t).isSegment?e(d):e(f,-1)}),z(e,a)}),T(m);var b=P(m,2),x=M(b),S=M(x),ee=e=>{z(e,N5())};V(S,e=>{t.rootActive&&e(ee)});var C=P(S,2);let te;kd(M(C),{class:`size-4`,strokeWidth:2}),T(C),E(4),T(x);var ne=P(x,2),re=e=>{var n=R();Ri(N(n),17,()=>t.items,e=>e.type===`entry`?e.row.node.entry.id:`seg:${e.segment.id}`,(e,n)=>{var r=R(),a=N(r),o=e=>{let r=k(()=>t.expanded.has(I(n).segment.id));var a=oPe();let o;var s=M(a);Qw(M(s),{class:`size-4`,strokeWidth:2}),T(s);var c=P(s,2),l=M(c);T(c);var u=P(c,2),d=M(u,!0);T(u);var p=P(u,2),m=M(p),h=e=>{Kw(e,{class:`size-4`,strokeWidth:2})},g=e=>{Jw(e,{class:`size-4`,strokeWidth:2})};V(m,e=>{I(r)?e(h):e(g,-1)}),T(p),T(a),F((e,s)=>{o=ra(a,1,`relative flex w-full items-center gap-2 rounded-md pr-2 text-left transition-colors hover:bg-muted/60 data-[selected=true]:bg-muted`,null,o,{"opacity-55":!I(n).segment.isOnActivePath}),W(a,`data-selected`,t.selectedKey===`s:${I(n).segment.id}`),aa(a,`height:36px; padding-left:${I(i)+4}px`),W(a,`title`,e),B(l,`${I(n).segment.total??``} steps`),B(d,s),W(p,`title`,I(r)?`Collapse steps`:`Expand steps`),W(p,`aria-label`,I(r)?`Collapse steps`:`Expand steps`)},[()=>f(I(n).segment),()=>I(n).segment.parts.map(e=>`${e.count} ${e.label}`).join(` · `)]),bi(`click`,a,()=>t.onSelect({kind:`segment`,segment:I(n).segment})),bi(`click`,p,e=>{e.stopPropagation(),t.onToggleSegment(I(n).segment.id)}),bi(`keydown`,p,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),t.onToggleSegment(I(n).segment.id))}),z(e,a)},s=e=>{let r=k(()=>I(n).row),a=k(()=>D5(I(r).node.entry,t.toolCallsById)),o=k(()=>k5[I(a).icon]);{let n=k(()=>p(I(r).node));j$(e,{get items(){return I(n)},triggerClass:`block w-full min-w-0`,children:(e,n)=>{var s=cPe();let c;var l=M(s),u=e=>{z(e,N5())};V(l,e=>{I(r).isActive&&e(u)});var d=P(l,2);U(M(d),()=>I(o),(e,t)=>{t(e,{class:`size-4`,strokeWidth:2})}),T(d);var f=P(d,2),p=M(f,!0);T(f);var m=P(f,2),h=M(m,!0);T(m);var g=P(m,2);Ri(g,17,()=>I(a).badges,Fi,(e,t)=>{let n=k(()=>k5[I(t).icon]);var r=sPe();U(M(r),()=>I(n),(e,t)=>{t(e,{class:`size-3`,strokeWidth:2})}),T(r),F(()=>{ra(r,1,`flex shrink-0 items-center gap-0.5 ${A5[I(t).tone]}`),W(r,`title`,I(t).title??I(t).label)}),z(e,r)});var _=P(g,2),v=M(_,!0);T(_),T(s),F((e,n)=>{c=ra(s,1,`relative flex w-full items-center gap-2 rounded-md pr-2 text-left transition-colors hover:bg-muted/60 data-[selected=true]:bg-muted data-[active=true]:bg-muted/70`,null,c,{"opacity-55":!I(r).isOnActivePath}),W(s,`data-active`,I(r).isActive),W(s,`data-selected`,t.selectedKey===`e:${I(r).node.entry.id}`),aa(s,`height:36px; padding-left:${I(i)+4}px`),ra(d,1,`flex size-5 shrink-0 items-center justify-center ${A5[I(a).tone]}`),B(p,e),B(h,I(a).label),B(v,n)},[()=>String(I(r).index).padStart(2,`0`),()=>D1(I(r).node.entry.createdAt)]),bi(`click`,s,()=>t.onSelect({kind:`entry`,row:I(r)})),bi(`dblclick`,s,()=>t.onNavigateToEntry?.(I(r).node.entry.id)),z(e,s)},$$slots:{default:!0}})}};V(a,e=>{I(n).type===`segment`?e(o):e(s,-1)}),z(e,r)}),z(e,n)},ie=e=>{z(e,lPe())};V(ne,e=>{t.items.length?e(re):e(ie,-1)}),T(b),T(n),F((e,o)=>{aa(n,`min-height:${I(r)}px`),W(m,`width`,I(i)),W(m,`height`,I(r)),W(y,`cx`,e),W(y,`cy`,o),W(y,`r`,t.rootActive?4.5:4),W(y,`fill`,t.rootActive?I(a):`var(--background)`),W(y,`stroke`,I(a)),W(x,`data-active`,t.rootActive),W(x,`data-selected`,t.selectedKey===`root`),aa(x,`height:36px; padding-left:${I(i)+4}px`),te=ra(C,1,`flex size-5 shrink-0 items-center justify-center`,null,te,{"text-primary":t.rootOnActivePath,"text-muted-foreground":!t.rootOnActivePath})},[()=>o(0),()=>s(0)]),bi(`click`,x,()=>t.onSelect({kind:`root`})),bi(`dblclick`,x,()=>t.onNavigateToEntry?.(void 0)),z(e,n)},_=e=>{z(e,dPe())};V(h,e=>{t.hasConversation?e(g):e(_,-1)}),z(e,m),O()}xi([`click`,`dblclick`,`keydown`]);var pPe=L(`<div class="flex h-full items-center justify-center p-6 text-center text-xs text-muted-foreground">Select an entry on the left to preview it here.</div>`),mPe=L(`<!> New branch from beginning`,1),hPe=L(`<div class="flex flex-col gap-4 p-5"><div class="flex items-center gap-2 text-primary"><!> <h3 class="text-sm font-semibold text-foreground">Start of conversation</h3></div> <p class="text-sm text-muted-foreground">Jump here to fork a brand-new branch from the very beginning. Your next message becomes the
|
|
144
|
-
first entry of that branch; the existing history stays available in the tree.</p> <div><!></div></div>`),gPe=L(`<span class="flex items-center gap-1 rounded-full border bg-muted/40 px-2 py-0.5 text-xs text-muted-foreground"><!> <span class="font-medium text-foreground"> </span> </span>`),_Pe=L(`<!> Expand in tree`,1),vPe=L(`<button class="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted/60" type="button"><span><!></span> <span class="shrink-0 text-xs font-medium text-foreground"> </span> <span> </span></button>`),yPe=L(`<div class="flex flex-col gap-4 p-5"><div class="flex flex-col gap-1"><h3 class="text-sm font-semibold text-foreground"> </h3> <p class="text-xs text-muted-foreground"> </p></div> <div class="flex flex-wrap gap-1.5"></div> <div class="flex"><!></div> <div class="flex flex-col gap-0.5 border-t pt-3"></div></div>`),bPe=L(`<span><!> <!></span>`),xPe=L(`<span class="flex items-center gap-1"><!> </span>`),SPe=L(`<!> Jump here`,1),CPe=L(`<!> Jump + summarize`,1),wPe=L(`<!> Edit & resend`,1),TPe=L(`<span class="rounded-full border px-1.5 py-0.5"> </span>`),EPe=L(`<div class="flex items-center gap-2 text-xs text-muted-foreground"><span class="font-medium text-foreground">Tool</span> <span class="font-mono"> </span> <!></div>`),DPe=L(`<div class="flex flex-col gap-1"><span class="text-xs font-medium text-muted-foreground">Arguments</span> <pre class="overflow-x-auto rounded-md border bg-muted/40 p-3 font-mono text-xs whitespace-pre-wrap break-words"> </pre></div>`),OPe=L(`<div class="flex flex-col gap-1"><span class="text-xs font-medium text-muted-foreground">Result</span> <pre class="overflow-x-auto rounded-md border bg-muted/40 p-3 font-mono text-xs whitespace-pre-wrap break-words"> </pre></div>`),kPe=L(`<div class="flex flex-col gap-1"><span class="text-xs font-medium text-destructive">Error</span> <pre class="overflow-x-auto rounded-md border border-destructive/40 bg-destructive/10 p-3 font-mono text-xs whitespace-pre-wrap break-words"> </pre></div>`),APe=L(`<p class="text-xs text-muted-foreground">No tool details available for this entry.</p>`),jPe=L(`<div class="flex flex-col gap-3"><!> <!> <!> <!> <!></div>`),MPe=L(`<div class="text-sm text-muted-foreground"><!></div>`),NPe=L(`<div class="mt-4 border-t pt-3 text-sm text-muted-foreground"><span class="mb-1 block text-xs font-medium">Thinking</span> <!></div>`),PPe=L(`<div class="text-sm text-foreground"><!></div> <!>`,1),FPe=L(`<p class="text-xs text-muted-foreground">This entry has no text content.</p>`),IPe=L(`<div class="flex h-full flex-col"><div class="flex flex-col gap-3 border-b p-5"><div class="flex items-center gap-2"><span><!></span> <h3 class="text-sm font-semibold text-foreground"> </h3> <!></div> <div class="flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground"><span> </span> <!> <button class="flex items-center gap-1 font-mono hover:text-foreground" type="button" title="Copy entry id"><!> </button></div> <div class="flex flex-wrap gap-2"><!> <!> <!></div></div> <div class="min-h-0 flex-1 overflow-y-auto p-5"><!></div></div>`);function LPe(e,t){D(t,!0);let n=k(()=>t.selection?.kind===`entry`?t.selection.row.node.entry:void 0),r=k(()=>I(n)?D5(I(n),t.toolCallsById):void 0),i=k(()=>I(n)?ANe(I(n),t.toolCallsById):void 0);function a(e){let t=e.details?.thinkingBlocks;return Array.isArray(t)?t.map(e=>e?.text??``).filter(Boolean).join(`
|
|
145
|
-
|
|
146
|
-
`):``}function o(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}let s=k(()=>I(r)?.type===`tool_call`||I(r)?.type===`tool_result`||I(r)?.type===`human_loop`),c=k(()=>I(i)?.toolName??(I(n)?T5(I(n).text)[0]:void 0)??I(n)?.details?.toolName),l=k(()=>I(i)?.args!==void 0&&I(i)?.args!==null&&Object.keys(I(i).args).length>0),u=k(()=>I(n)?.role===`system`?I(n).text:typeof I(i)?.result==`string`?I(i).result:``);async function d(e){try{await bE(e),cd.success(`Copied entry id`)}catch{cd.error(`Could not copy to clipboard`)}}var f=R(),p=N(f),m=e=>{z(e,pPe())},h=e=>{var n=hPe(),r=M(n);kd(M(r),{class:`size-5`,strokeWidth:2}),E(2),T(r);var i=P(r,4);Ml(M(i),{size:`sm`,onclick:()=>t.onNavigateToEntry?.(void 0),children:(e,t)=>{var n=mPe();kd(N(n),{class:`size-4`,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}}),T(i),T(n),z(e,n)},g=e=>{let n=k(()=>t.selection.segment);var r=yPe(),i=M(r),a=M(i),o=M(a);T(a);var s=P(a,2),c=M(s);T(s),T(i);var l=P(i,2);Ri(l,21,()=>I(n).parts,Fi,(e,t)=>{let n=k(()=>k5[I(t).icon]);var r=gPe(),i=M(r);U(i,()=>I(n),(e,t)=>{t(e,{class:`size-3.5`,strokeWidth:2})});var a=P(i,2),o=M(a,!0);T(a);var s=P(a);T(r),F(()=>{B(o,I(t).count),B(s,` ${I(t).label??``}`)}),z(e,r)}),T(l);var u=P(l,2);Ml(M(u),{variant:`outline`,size:`sm`,onclick:()=>t.onExpandSegment?.(I(n).id),children:(e,t)=>{var n=_Pe();y5(N(n),{class:`size-4`,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}}),T(u);var d=P(u,2);Ri(d,21,()=>I(n).rows,e=>e.node.entry.id,(e,n)=>{let r=k(()=>D5(I(n).node.entry,t.toolCallsById)),i=k(()=>k5[I(r).icon]);var a=vPe(),o=M(a);U(M(o),()=>I(i),(e,t)=>{t(e,{class:`size-3.5`,strokeWidth:2})}),T(o);var s=P(o,2),c=M(s,!0);T(s);var l=P(s,2);let u;var d=M(l,!0);T(l),T(a),F(()=>{ra(o,1,`flex size-4 shrink-0 items-center justify-center ${A5[I(r).tone]}`),B(c,I(r).label),u=ra(l,1,`min-w-0 flex-1 truncate text-xs text-muted-foreground`,null,u,{"font-mono":I(r).mono}),B(d,I(r).preview)}),bi(`click`,a,()=>t.onSelectRow?.(I(n))),z(e,a)}),T(d),T(r),F((e,t)=>{B(o,`${I(n).total??``} collapsed steps`),B(c,`${e??``} — ${t??``}`)},[()=>O1(I(n).startedAt),()=>O1(I(n).endedAt)]),z(e,r)},_=e=>{let f=k(()=>k5[I(r).icon]),p=k(()=>a(I(n)));var m=IPe(),h=M(m),g=M(h),_=M(g);U(M(_),()=>I(f),(e,t)=>{t(e,{class:`size-5`,strokeWidth:2})}),T(_);var v=P(_,2),y=M(v,!0);T(v),Ri(P(v,2),17,()=>I(r).badges,Fi,(e,t)=>{let n=k(()=>k5[I(t).icon]);var r=bPe(),i=M(r);U(i,()=>I(n),(e,t)=>{t(e,{class:`size-3.5`,strokeWidth:2})});var a=P(i,2),o=e=>{var n=ki();F(()=>B(n,I(t).label)),z(e,n)};V(a,e=>{I(t).label&&e(o)}),T(r),F(()=>{ra(r,1,`flex items-center gap-0.5 text-xs ${A5[I(t).tone]}`),W(r,`title`,I(t).title??I(t).label)}),z(e,r)}),T(g);var b=P(g,2),x=M(b),S=M(x);T(x);var ee=P(x,2),C=e=>{var t=xPe(),r=M(t);uZ(r,{class:`size-3.5`,strokeWidth:2});var i=P(r);T(t),F(e=>B(i,` ${e??``} tokens`),[()=>I(n).usage.totalTokens.toLocaleString()]),z(e,t)};V(ee,e=>{I(n).usage?.totalTokens&&e(C)});var te=P(ee,2),ne=M(te);V3(ne,{class:`size-3`,strokeWidth:2});var re=P(ne);T(te),T(b);var ie=P(b,2),ae=M(ie);Ml(ae,{size:`sm`,onclick:()=>t.onNavigateToEntry?.(I(n).id),children:(e,t)=>{var n=SPe();B3(N(n),{class:`size-4`,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}});var oe=P(ae,2);Ml(oe,{variant:`outline`,size:`sm`,onclick:()=>t.onNavigateToEntry?.(I(n).id,!0),children:(e,t)=>{var n=CPe();uZ(N(n),{class:`size-4`,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}});var w=P(oe,2),se=e=>{Ml(e,{variant:`outline`,size:`sm`,onclick:()=>t.onEditEntry?.(I(n)),children:(e,t)=>{var n=wPe();WQ(N(n),{class:`size-4`,strokeWidth:2}),E(),z(e,n)},$$slots:{default:!0}})};V(w,e=>{I(n).role===`user`&&e(se)}),T(ie),T(h);var ce=P(h,2),le=M(ce),ue=e=>{var t=jPe(),n=M(t),r=e=>{var t=EPe(),n=P(M(t),2),r=M(n,!0);T(n);var a=P(n,2),o=e=>{var t=TPe(),n=M(t,!0);T(t),F(()=>B(n,I(i).status)),z(e,t)};V(a,e=>{I(i)?.status&&e(o)}),T(t),F(()=>B(r,I(c))),z(e,t)};V(n,e=>{I(c)&&e(r)});var a=P(n,2),s=e=>{var t=DPe(),n=P(M(t),2),r=M(n,!0);T(n),T(t),F(e=>B(r,e),[()=>o(I(i)?.args)]),z(e,t)};V(a,e=>{I(l)&&e(s)});var d=P(a,2),f=e=>{var t=OPe(),n=P(M(t),2),r=M(n,!0);T(n),T(t),F(()=>B(r,I(u))),z(e,t)};V(d,e=>{I(u)&&e(f)});var p=P(d,2),m=e=>{var t=kPe(),n=P(M(t),2),r=M(n,!0);T(n),T(t),F(()=>B(r,I(i).error)),z(e,t)};V(p,e=>{I(i)?.error&&e(m)});var h=P(p,2),g=e=>{z(e,APe())};V(h,e=>{!I(l)&&!I(u)&&!I(i)?.error&&e(g)}),T(t),z(e,t)},de=e=>{var t=MPe();z3(M(t),{get text(){return I(p)}}),T(t),z(e,t)},fe=e=>{var t=PPe(),r=N(t),i=M(r);{let e=k(()=>I(n).summary||I(n).text),t=k(()=>I(n).role!==`assistant`);z3(i,{get text(){return I(e)},get trimCodeBlocks(){return I(t)}})}T(r);var a=P(r,2),o=e=>{var t=NPe();z3(P(M(t),2),{get text(){return I(p)}}),T(t),z(e,t)};V(a,e=>{I(p)&&e(o)}),z(e,t)},pe=e=>{z(e,FPe())};V(le,e=>{I(s)?e(ue):I(p)&&!I(n).text?e(de,1):I(n).summary||I(n).text?e(fe,2):e(pe,-1)}),T(ce),T(m),F((e,t)=>{ra(_,1,`flex size-5 shrink-0 items-center justify-center ${A5[I(r).tone]}`),B(y,I(r).label),W(x,`title`,e),B(S,`${t??``} ago`),B(re,` ${I(n).id??``}`)},[()=>O1(I(n).createdAt),()=>D1(I(n).createdAt)]),bi(`click`,te,()=>d(I(n).id)),z(e,m)};V(p,e=>{t.selection?t.selection.kind===`root`?e(h,1):t.selection.kind===`segment`?e(g,2):I(n)&&I(r)&&e(_,3):e(m)}),z(e,f),O()}xi([`click`]);var RPe=new Set([`assistant`,`tool_call`,`tool_result`,`system`]);function zPe(e,t,n){let r=t[e[0]],i=t[e[e.length-1]],a=new Map;for(let t of e){let e=n[t],r=a.get(e.label);r?r.count+=1:a.set(e.label,{icon:e.icon,label:e.label,count:1})}return{id:r.node.entry.id,lane:r.lane,headParentEntryId:r.node.entry.parentEntryId,headParentLane:r.parentLane,rows:e.map(e=>t[e]),isOnActivePath:e.some(e=>t[e].isOnActivePath),total:e.length,parts:[...a.values()].sort((e,t)=>t.count-e.count),startedAt:r.node.entry.createdAt,endedAt:i.node.entry.createdAt}}function BPe(e,t,n){let r=e.map(e=>D5(e.node.entry,t)),i=t=>{let n=e[t];return!n.isActive&&!n.isLeaf&&!n.isBranchPoint&&RPe.has(r[t].type)},a=[],o=[],s=()=>{o.length&&(a.push({kind:`run`,indices:o}),o=[])};for(let t=0;t<e.length;t++){if(!i(t)){s(),a.push({kind:`row`,index:t});continue}let n=o.at(-1),r=n===void 0?void 0:e[n],c=r!==void 0&&e[t].node.entry.parentEntryId===r.node.entry.id&&e[t].lane===r.lane;o.length&&!c&&s(),o.push(t)}s();let c=[],l=[],u=new Map,d=t=>{u.set(e[t].node.entry.id,c.length),c.push({type:`entry`,row:e[t]})};for(let t of a){if(t.kind===`row`){d(t.index);continue}if(t.indices.length<3){for(let e of t.indices)d(e);continue}let i=zPe(t.indices,e,r);if(l.push(i),n.has(i.id))for(let e of t.indices)d(e);else{let n=c.length;c.push({type:`segment`,segment:i});for(let r of t.indices)u.set(e[r].node.entry.id,n)}}return{items:c,visibleIndexById:u,segments:l}}function VPe(e){switch(e.kind){case`root`:return`root`;case`entry`:return`e:${e.row.node.entry.id}`;case`segment`:return`s:${e.segment.id}`}}var HPe=L(`<!> Collapse all`,1),UPe=L(`<!> Expand all`,1),WPe=L(`<button type="button"><!></button>`),GPe=L(`<div class="flex h-full min-h-0"><div class="flex w-80 shrink-0 flex-col border-r"><div class="flex items-center justify-between gap-2 border-b px-3 py-2"><h2 class="text-xs font-medium text-muted-foreground">Branches</h2> <!></div> <div class="min-h-0 flex-1 overflow-y-auto p-2"><!></div></div> <div class="min-w-0 flex-1 overflow-y-auto bg-card"><!></div></div>`);function KPe(e,t){D(t,!0);let n=q(t,`treeNodes`,19,()=>[]),r=q(t,`toolCalls`,19,()=>[]),i=k(()=>new Map(r().map(e=>[e.id,e]))),a=k(()=>jNe(n(),t.activeConversation?.activeEntryId)),o=k(()=>new Set(n().map(e=>e.entry.id))),s=k(()=>!!t.activeConversation),c=k(()=>!!(t.activeConversation&&!t.activeConversation.activeEntryId)),l=k(()=>I(c)||I(a).rows.some(e=>e.isOnActivePath)),u=A(In(new Set)),d=A(void 0),f=k(()=>BPe(I(a).rows,I(i),I(u))),p=k(()=>I(d)?VPe(I(d)):``),m;sr(()=>{let e=t.activeConversation?.id;if(e===m)return;m=e,j(u,new Set,!0);let n=t.activeConversation?.activeEntryId,r=n?I(a).rows.find(e=>e.node.entry.id===n):void 0;j(d,r?{kind:`entry`,row:r}:{kind:`root`},!0)});let h=k(()=>I(f).segments.length>0&&I(f).segments.every(e=>I(u).has(e.id)));function g(e){let t=new Set(I(u));t.has(e)?t.delete(e):t.add(e),j(u,t,!0)}function _(){j(u,I(h)?new Set:new Set(I(f).segments.map(e=>e.id)),!0)}function v(e){let t=new Set(I(u));t.add(e),j(u,t,!0);let n=I(a).rows.find(t=>t.node.entry.id===e);n&&j(d,{kind:`entry`,row:n},!0)}var y=GPe(),b=M(y),x=M(b),S=P(M(x),2),ee=e=>{var t=WPe(),n=M(t),r=e=>{var t=HPe();_5(N(t),{class:`size-3.5`,strokeWidth:2}),E(),z(e,t)},i=e=>{var t=UPe();y5(N(t),{class:`size-3.5`,strokeWidth:2}),E(),z(e,t)};V(n,e=>{I(h)?e(r):e(i,-1)}),T(t),F(e=>ra(t,1,e),[()=>Zi(Ol({variant:`ghost`,size:`sm`}))]),bi(`click`,t,_),z(e,t)};V(S,e=>{I(f).segments.length>0&&e(ee)}),T(x);var C=P(x,2);fPe(M(C),{get items(){return I(f).items},get visibleIndexById(){return I(f).visibleIndexById},get treeNodeIds(){return I(o)},get toolCallsById(){return I(i)},get laneCount(){return I(a).laneCount},get hasConversation(){return I(s)},get rootActive(){return I(c)},get rootOnActivePath(){return I(l)},get expanded(){return I(u)},get selectedKey(){return I(p)},onSelect:e=>j(d,e,!0),onToggleSegment:g,get onNavigateToEntry(){return t.onNavigateToEntry},get onEditEntry(){return t.onEditEntry}}),T(C),T(b);var te=P(b,2);LPe(M(te),{get selection(){return I(d)},get toolCallsById(){return I(i)},get onNavigateToEntry(){return t.onNavigateToEntry},get onEditEntry(){return t.onEditEntry},onSelectRow:e=>j(d,{kind:`entry`,row:e},!0),onExpandSegment:v}),T(te),T(y),z(e,y),O()}xi([`click`]);var qPe=L(`<!> <span>Compact context</span>`,1),P5=L(`<!> <!>`,1);function JPe(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`treeNodes`,19,()=>[]),i=q(t,`toolCalls`,19,()=>[]),a=A(!1);function o(e){n(e),t.onOpenChange?.(e)}function s(e,r){t.onNavigateToEntry?.(e,r),n(!1),t.onOpenChange?.(!1)}function c(e){t.onEditEntry?.(e),n(!1),t.onOpenChange?.(!1)}var l=P5(),u=N(l);nZ(u,{title:`Conversation history`,description:`Browse the branch tree, preview any point, then jump to or fork from it.`,class:`conversation-history-dialog`,onOpenChange:o,get open(){return n()},set open(e){n(e)},headerActions:e=>{var n=R();U(N(n),()=>m1,(e,n)=>{n(e,{children:(e,n)=>{var r=P5(),i=N(r);{let e=k(()=>Ol({variant:`ghost`,size:`icon-sm`})),n=k(()=>!t.activeConversation);U(i,()=>y1,(t,r)=>{r(t,{get class(){return I(e)},"aria-label":`History actions`,get disabled(){return I(n)},children:(e,t)=>{v5(e,{class:`size-4`,strokeWidth:2})},$$slots:{default:!0}})})}U(P(i,2),()=>g1,(e,n)=>{n(e,{align:`end`,class:`w-48`,children:(e,n)=>{var r=R(),i=N(r);{let e=k(()=>!t.activeConversation);U(i,()=>_1,(t,n)=>{n(t,{get disabled(){return I(e)},onSelect:()=>j(a,!0),children:(e,t)=>{var n=qPe();_5(N(n),{}),E(2),z(e,n)},$$slots:{default:!0}})})}z(e,r)},$$slots:{default:!0}})}),z(e,r)},$$slots:{default:!0}})}),z(e,n)},children:(e,n)=>{KPe(e,{get activeConversation(){return t.activeConversation},get treeNodes(){return r()},get toolCalls(){return i()},onNavigateToEntry:s,onEditEntry:c})},$$slots:{headerActions:!0,default:!0}}),SQ(P(u,2),{title:`Compact conversation`,description:`This summarizes earlier messages to reduce context size. The full history stays available in the branch tree.`,confirmLabel:`Compact context`,onConfirm:()=>t.onCompact?.(),get open(){return I(a)},set open(e){j(a,e,!0)}}),z(e,l),O()}var YPe=new Set([`$$slots`,`$$events`,`$$legacy`]);function F5(e,t){let n=G(t,YPe),r=[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`}]];uc(e,K({name:`folder-open`},()=>n,{get iconNode(){return r}}))}var XPe=L(`<!> `,1),ZPe=L(`<!> Open`,1),QPe=L(`<div class="footer-path"><!> <span class="footer-path-text"> </span> <span class="footer-signals"></span></div> <div class="footer-actions"><!></div>`,1);function $Pe(e,t){D(t,!0);let n=q(t,`signals`,19,()=>[]),r=q(t,`loading`,3,!1);var i=QPe(),a=N(i),o=M(a);F5(o,{size:14,strokeWidth:2.1,"aria-hidden":`true`});var s=P(o,2),c=M(s,!0);T(s);var l=P(s,2);Ri(l,21,n,Fi,(e,n)=>{let r=k(()=>t.signalMeta[I(n)]),i=k(()=>I(r).icon);{let t=k(()=>I(r).tone??`neutral`);uf(e,{get tone(){return I(t)},size:`xs`,get title(){return I(r).title},children:(e,t)=>{var n=XPe(),a=N(n);U(a,()=>I(i),(e,t)=>{t(e,{size:11,strokeWidth:2.2})});var o=P(a,1,!0);F(()=>B(o,I(r).label)),z(e,n)},$$slots:{default:!0}})}}),T(l),T(a);var u=P(a,2),d=M(u);{let e=k(()=>!t.path||r()),n=k(()=>t.path?`Open ${t.path}`:`Open`);Ml(d,{class:`footer-open-button`,size:`sm`,get disabled(){return I(e)},get title(){return I(n)},get onclick(){return t.onOpen},children:(e,t)=>{var n=ZPe();F5(N(n),{size:14,strokeWidth:2.2}),E(),z(e,n)},$$slots:{default:!0}})}T(u),F(e=>{W(a,`title`,t.path),B(c,e)},[()=>t.path?Hd(t.path,t.homeDir):`—`]),z(e,i),O()}var eFe=new Set([`$$slots`,`$$events`,`$$legacy`]);function tFe(e,t){let n=G(t,eFe),r=[[`path`,{d:`M16 14v2.2l1.6 1`}],[`path`,{d:`M7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2`}],[`circle`,{cx:`16`,cy:`16`,r:`6`}]];uc(e,K({name:`folder-clock`},()=>n,{get iconNode(){return r}}))}var nFe=L(`<!><span>New chat</span>`,1),rFe=L(`<!><span>Copy path</span>`,1),iFe=L(`<!><span>Forget project</span>`,1),I5=L(`<!> <!>`,1),aFe=L(`<!> <!> <!>`,1),oFe=L(`<div role="option" tabindex="-1"><!> <span class="row-main"><span class="row-title"><strong> </strong> <small class="row-sub"> </small></span> <small class="row-path"> </small></span> <span class="row-actions"><button class="row-open" type="button" title="Open project"><!>Open</button> <!></span></div>`),sFe=L(`<section class="picker-group"><header class="group-head"><span>Recent</span></header> <div class="rows" role="listbox" aria-label="Recent projects"></div></section>`),cFe=L(`<span class="group-count"> </span>`),lFe=L(`<span class="skeleton-row"></span>`),uFe=L(`<div class="rows" aria-label="Loading directories"></div>`),dFe=L(`<!>Opened`,1),fFe=L(`<!> `,1),pFe=L(`<div role="option" tabindex="-1"><!> <span class="row-main"><strong> </strong></span> <span class="row-badges"><!> <!> <button class="row-drill" type="button" title="Open folder" aria-label="Open folder"><!></button></span></div>`),mFe=L(`<div class="rows" role="listbox" aria-label="Folders"></div>`),hFe=L(`<div class="empty"><!> <p> </p> <span> </span></div>`),gFe=L(`<div class="picker-scroll"><!> <section class="picker-group"><header class="group-head"><span>Folders</span> <!></header> <!></section></div>`);function _Fe(e,t){D(t,!0);let n=q(t,`listEl`,15);var r=gFe(),i=M(r),a=e=>{var n=sFe(),r=P(M(n),2);W(r,`tabindex`,-1),Ri(r,21,()=>t.recentProjects,Fi,(e,n,r)=>{let i=k(()=>r);var a=oFe();let o;var s=M(a);tFe(s,{size:16,strokeWidth:2.05,"aria-hidden":`true`});var c=P(s,2),l=M(c),u=M(l),d=M(u,!0);T(u);var f=P(u,2),p=M(f);T(f),T(l);var m=P(l,2),h=M(m,!0);T(m),T(c);var g=P(c,2),_=M(g);F5(M(_),{size:13,strokeWidth:2.2}),E(),T(_),U(P(_,2),()=>m1,(e,r)=>{r(e,{children:(e,r)=>{var i=I5(),a=N(i);{let e=k(()=>Ol({variant:`ghost`,size:`icon-xs`}));U(a,()=>y1,(t,n)=>{n(t,{get class(){return I(e)},title:`Project actions`,"aria-label":`Project actions`,onclick:e=>e.stopPropagation(),children:(e,t)=>{v5(e,{size:15,strokeWidth:2})},$$slots:{default:!0}})})}U(P(a,2),()=>g1,(e,r)=>{r(e,{align:`end`,class:`w-44`,children:(e,r)=>{var i=aFe(),a=N(i);U(a,()=>_1,(e,r)=>{r(e,{onSelect:()=>void t.onSelect?.(I(n).dir),children:(e,t)=>{var n=nFe();ZZ(N(n),{}),E(),z(e,n)},$$slots:{default:!0}})});var o=P(a,2);U(o,()=>_1,(e,r)=>{r(e,{onSelect:()=>void t.copyPath(I(n).dir),children:(e,t)=>{var n=rFe();V3(N(n),{}),E(),z(e,n)},$$slots:{default:!0}})});var s=P(o,2),c=e=>{var r=I5(),i=N(r);U(i,()=>v1,(e,t)=>{t(e,{})}),U(P(i,2),()=>_1,(e,r)=>{r(e,{variant:`destructive`,onSelect:()=>t.onForget?.(I(n).id),children:(e,t)=>{var n=iFe();GQ(N(n),{}),E(),z(e,n)},$$slots:{default:!0}})}),z(e,r)};V(s,e=>{t.onForget&&e(c)}),z(e,i)},$$slots:{default:!0}})}),z(e,i)},$$slots:{default:!0}})}),T(g),T(a),F((e,r,s,c)=>{W(a,`id`,`recent:${I(n).id}`),o=ra(a,1,`row recent-row app-interactive-row`,null,o,{selected:t.selectedIndex===I(i)}),W(a,`aria-selected`,t.selectedIndex===I(i)),W(a,`title`,e),B(d,I(n).name),B(p,`${r??``} chats · ${s??``}`),B(h,c)},[()=>`${I(n).dir}\n${O1(I(n).updatedAt)}`,()=>t.conversationCountFor(I(n)),()=>D1(I(n).updatedAt),()=>Jd(I(n).dir,t.homeDir)]),bi(`click`,a,()=>t.onSelectedIndexChange?.(I(i))),bi(`dblclick`,a,()=>void t.onSelect?.(I(n).dir)),bi(`keydown`,a,e=>t.onRowKeydown(e,I(i),{kind:`recent`,id:`recent:${I(n).id}`,path:I(n).dir,project:I(n)})),bi(`click`,_,e=>{e.stopPropagation(),t.onSelect?.(I(n).dir)}),z(e,a)}),T(r),T(n),F(()=>W(r,`aria-activedescendant`,t.selectedItem?.kind===`recent`?t.activeDescendant:void 0)),z(e,n)};V(i,e=>{t.showRecent&&e(a)});var o=P(i,2),s=M(o),c=P(M(s),2),l=e=>{var n=cFe(),r=M(n,!0);T(n),F(()=>B(r,t.filteredEntries.length)),z(e,n)};V(c,e=>{!t.loading&&t.filteredEntries.length&&e(l)}),T(s);var u=P(s,2),d=e=>{var t=uFe();Ri(t,20,()=>Array.from({length:7}),Fi,(e,t)=>{z(e,lFe())}),T(t),z(e,t)},f=e=>{var n=mFe();W(n,`tabindex`,-1),Ri(n,21,()=>t.filteredEntries,Fi,(e,n,r)=>{let i=k(()=>t.recentCount+r);var a=pFe();let o;var s=M(a);v$(s,{size:15,strokeWidth:2.1,"aria-hidden":`true`});var c=P(s,2),l=M(c),u=M(l,!0);T(l),T(c);var d=P(c,2),f=M(d),p=e=>{uf(e,{tone:`good`,size:`xs`,children:(e,t)=>{var n=dFe();ZQ(N(n),{size:11}),E(),z(e,n)},$$slots:{default:!0}})},m=k(()=>t.isOpened(I(n).path));V(f,e=>{I(m)&&e(p)});var h=P(f,2);Ri(h,17,()=>t.uniqueSignals(I(n).signals),Fi,(e,n)=>{let r=k(()=>t.signalMeta[I(n)]),i=k(()=>I(r).icon);{let t=k(()=>I(r).tone??`neutral`);uf(e,{get tone(){return I(t)},size:`xs`,get title(){return I(r).title},children:(e,t)=>{var n=fFe(),a=N(n);U(a,()=>I(i),(e,t)=>{t(e,{size:11,strokeWidth:2.2})});var o=P(a,1,!0);F(()=>B(o,I(r).label)),z(e,n)},$$slots:{default:!0}})}});var g=P(h,2);Jw(M(g),{size:15,strokeWidth:2.2,"aria-hidden":`true`}),T(g),T(d),T(a),F(()=>{W(a,`id`,`folder:${I(n).path}`),o=ra(a,1,`row folder-row app-interactive-row`,null,o,{selected:t.selectedIndex===I(i)}),W(a,`aria-selected`,t.selectedIndex===I(i)),W(a,`title`,I(n).path),B(u,I(n).name)}),bi(`click`,a,()=>t.onSelectedIndexChange?.(I(i))),bi(`dblclick`,a,()=>void t.load(I(n).path)),bi(`keydown`,a,e=>t.onRowKeydown(e,I(i),{kind:`folder`,id:`folder:${I(n).path}`,path:I(n).path,entry:I(n)})),bi(`click`,g,e=>{e.stopPropagation(),t.load(I(n).path)}),z(e,a)}),T(n),F(()=>W(n,`aria-activedescendant`,t.selectedItem?.kind===`folder`?t.activeDescendant:void 0)),z(e,n)},p=e=>{var n=hFe(),r=M(n);F5(r,{size:26,strokeWidth:1.8});var i=P(r,2),a=M(i,!0);T(i);var o=P(i,2),s=M(o,!0);T(o),T(n),F((e,t)=>{B(a,e),B(s,t)},[()=>t.query.trim()?`No folders match your filter.`:`No subfolders here.`,()=>t.query.trim()?`Clear the filter or paste a path.`:`Use Open below to choose this folder as the project.`]),z(e,n)};V(u,e=>{t.loading?e(d):t.filteredEntries.length?e(f,1):e(p,-1)}),T(o),T(r),Aa(r,e=>n(e),()=>n()),z(e,r),O()}xi([`click`,`dblclick`,`keydown`]);var vFe=new Set([`$$slots`,`$$events`,`$$legacy`]);function yFe(e,t){let n=G(t,vFe),r=[[`path`,{d:`M8 6L12 2L16 6`}],[`path`,{d:`M12 2V22`}]];uc(e,K({name:`move-up`},()=>n,{get iconNode(){return r}}))}var bFe=L(`<span class="crumb current"> </span>`),xFe=L(`<button class="crumb app-interactive-row" type="button"> </button>`),SFe=L(`<!> <!>`,1),CFe=L(`<div class="path-bar"><nav class="crumbs" aria-label="Current location"></nav> <div class="path-tools"><!> <!> <span class="path-tools-sep" aria-hidden="true"></span> <!></div></div> <form class="picker-search"><!> <!></form>`,1);function wFe(e,t){D(t,!0);let n=q(t,`query`,15),r=q(t,`showHidden`,15);var i=CFe(),a=N(i),o=M(a);Ri(o,21,()=>t.crumbs,Fi,(e,n,r)=>{var i=SFe(),a=N(i),o=e=>{Jw(e,{class:`crumb-sep`,size:13,strokeWidth:2.2,"aria-hidden":`true`})};V(a,e=>{r>0&&e(o)});var s=P(a,2),c=e=>{var t=bFe(),r=M(t,!0);T(t),F(()=>{W(t,`title`,I(n).path),B(r,I(n).label)}),z(e,t)},l=e=>{var r=xFe(),i=M(r,!0);T(r),F(()=>{W(r,`title`,I(n).path),r.disabled=t.loading,B(i,I(n).label)}),bi(`click`,r,()=>t.onLoad?.(I(n).path)),z(e,r)};V(s,e=>{r===t.crumbs.length-1?e(c):e(l,-1)}),z(e,i)}),T(o);var s=P(o,2),c=M(s);{let e=k(()=>!t.parent||t.loading);Ml(c,{variant:`ghost`,size:`icon-sm`,get disabled(){return I(e)},title:`Parent directory`,ariaLabel:`Parent directory`,onclick:()=>t.onLoad?.(t.parent),children:(e,t)=>{yFe(e,{size:14,strokeWidth:2.2})},$$slots:{default:!0}})}var l=P(c,2);Ml(l,{variant:`ghost`,size:`icon-sm`,get disabled(){return t.loading},title:`Refresh`,ariaLabel:`Refresh`,get onclick(){return t.onReload},children:(e,t)=>{O8(e,{size:14,strokeWidth:2.2})},$$slots:{default:!0}}),QQ(P(l,4),{label:`Hidden`,class:`hidden-switch`,get checked(){return r()},set checked(e){r(e)}}),T(s),T(a);var u=P(a,2),d=M(u);cZ(d,{size:14,strokeWidth:2.2,"aria-hidden":`true`}),DQ(P(d,2),{oninput:()=>t.onQueryChange?.(n()),placeholder:`Filter folders or paste a path`,get disabled(){return t.loading},size:`sm`,ariaLabel:`Filter folders or enter a path`,get value(){return n()},set value(e){n(e)}}),T(u),yi(`submit`,u,function(...e){t.onSubmit?.apply(this,e)}),z(e,i),O()}xi([`click`]);var TFe=new Set([`$$slots`,`$$events`,`$$legacy`]);function L5(e,t){let n=G(t,TFe),r=[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`}],[`path`,{d:`M12 22V12`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`}],[`path`,{d:`m7.5 4.27 9 5.15`}]];uc(e,K({name:`package`},()=>n,{get iconNode(){return r}}))}var R5={git:{label:`Git`,title:`Git repository`,tone:`accent`,icon:kd},package:{label:`Pkg`,title:`JavaScript package`,icon:L5},workspace:{label:`Workspace`,title:`Workspace marker`,tone:`accent`,icon:L5},python:{label:`Py`,title:`Python project`,icon:zd},rust:{label:`Rust`,title:`Rust project`,icon:zd},go:{label:`Go`,title:`Go module`,icon:zd}};function z5(e){return[...new Set(e??[])]}function EFe(e,t){let n=e.trim();if(!t)return n;if(n===`~`)return t;if(n.startsWith(`~/`)||n.startsWith(`~\\`)){let e=t.includes(`\\`)?`\\`:`/`;return`${t.replace(/[\\/]+$/,``)}${e}${n.slice(2)}`}return n}var DFe=L(`<p class="picker-error"> </p>`),OFe=L(`<div class="picker-body" role="presentation"><!> <!> <!></div>`);function kFe(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`projects`,19,()=>[]),i=q(t,`conversations`,19,()=>[]),a=A(``),o=A(void 0),s=A(!1),c=A(void 0),l=A(!1),u=A(-1),d=A(!1),f=A(!1),p=A(void 0),m=k(()=>new Set(r().map(e=>Yd(e.dir)))),h=k(()=>{let e=new Map;for(let t of i())e.set(t.projectId,(e.get(t.projectId)??0)+1);return e}),g=k(()=>{let e=new Set;return[...r()].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)).filter(t=>{let n=Yd(t.dir);return e.has(n)?!1:(e.add(n),!0)}).slice(0,7)}),_=k(()=>{let e=I(o)?.entries??[],t=I(a).trim();if(!t||Xd(t))return e;let n=t.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(n))}),v=k(()=>I(g).length>0&&!I(a).trim()),y=k(()=>{let e=[];if(I(v))for(let t of I(g))e.push({kind:`recent`,id:`recent:${t.id}`,path:t.dir,project:t});for(let t of I(_))e.push({kind:`folder`,id:`folder:${t.path}`,path:t.path,entry:t});return e}),b=k(()=>I(v)?I(g).length:0),x=k(()=>I(u)>=0?I(y)[I(u)]:void 0),S=k(()=>I(x)?.kind===`folder`?I(x).entry:void 0),ee=k(()=>I(x)?.path??I(o)?.path??``),C=k(()=>z5(I(S)?.signals??(I(x)?[]:I(o)?.signals))),te=k(()=>I(x)?.id),ne=k(()=>ef(I(o)?.path,t.homeDir));function re(e){return I(m).has(Yd(e))}function ie(e){return I(h).get(e.id)??0}async function ae(e){j(s,!0),j(c,void 0);try{j(o,await oue(e,I(l)),!0),j(a,``),j(u,-1)}catch(e){j(c,e instanceof Error?e.message:String(e),!0)}finally{j(s,!1)}}function oe(){ae(I(o)?.path||void 0)}function w(){requestAnimationFrame(()=>{I(p)?.querySelector(`.row.selected`)?.scrollIntoView({block:`nearest`})})}function se(e){n(e),e||t.onClose?.()}function ce(e){e.preventDefault();let n=I(a).trim();if(!n)return;if(Xd(n)){ae(EFe(n,t.homeDir));return}let r=I(y).find(e=>e.kind===`folder`);r&&ae(r.path)}async function le(){let e=I(ee);e&&await t.onSelect?.(e)}function ue(e){e.kind===`recent`?t.onSelect?.(e.path):ae(e.path)}function de(e,t,n){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),j(u,t,!0),ue(n))}async function fe(e){try{await bE(e),cd.success(`Path copied`)}catch{cd.error(`Could not copy to clipboard`)}}function pe(e){let t=e.target?.tagName===`INPUT`,n=I(y).length;switch(e.key){case`ArrowDown`:e.preventDefault(),n&&(j(u,I(u)<0?0:Math.min(I(u)+1,n-1),!0),w());break;case`ArrowUp`:e.preventDefault(),n&&(j(u,I(u)<=0?0:I(u)-1,!0),w());break;case`ArrowRight`:!t&&I(S)&&(e.preventDefault(),ae(I(S).path));break;case`Enter`:e.metaKey||e.ctrlKey?(e.preventDefault(),le()):!t&&I(x)&&(e.preventDefault(),ue(I(x)));break;case`ArrowLeft`:!t&&I(o)?.parent&&(e.preventDefault(),ae(I(o).parent));break;case`Backspace`:I(a).length===0&&I(o)?.parent&&(e.preventDefault(),ae(I(o).parent));break}}sr(()=>{n()&&!I(d)&&ae(I(o)?.path||void 0),j(d,n(),!0)}),sr(()=>{n()&&I(l)!==I(f)&&oe(),j(f,I(l),!0)}),nZ(e,{title:`Open Project`,class:`project-picker-dialog`,onOpenChange:se,get open(){return n()},set open(e){n(e)},footer:e=>{$Pe(e,{get path(){return I(ee)},get homeDir(){return t.homeDir},get signals(){return I(C)},get signalMeta(){return R5},get loading(){return I(s)},onOpen:()=>void le()})},children:(e,n)=>{var r=OFe(),i=M(r);{let e=k(()=>I(o)?.parent);wFe(i,{get crumbs(){return I(ne)},get loading(){return I(s)},get parent(){return I(e)},onLoad:e=>void ae(e),onReload:oe,onQueryChange:()=>j(u,-1),onSubmit:ce,get query(){return I(a)},set query(e){j(a,e,!0)},get showHidden(){return I(l)},set showHidden(e){j(l,e,!0)}})}var d=P(i,2),f=e=>{var t=DFe(),n=M(t,!0);T(t),F(()=>B(n,I(c))),z(e,t)};V(d,e=>{I(c)&&e(f)}),_Fe(P(d,2),{get showRecent(){return I(v)},get recentProjects(){return I(g)},get filteredEntries(){return I(_)},get loading(){return I(s)},get query(){return I(a)},get selectedIndex(){return I(u)},get selectedItem(){return I(x)},get activeDescendant(){return I(te)},get recentCount(){return I(b)},get signalMeta(){return R5},get homeDir(){return t.homeDir},isOpened:re,conversationCountFor:ie,get uniqueSignals(){return z5},load:e=>void ae(e),copyPath:e=>void fe(e),get onSelect(){return t.onSelect},get onForget(){return t.onForget},onSelectedIndexChange:e=>j(u,e,!0),onRowKeydown:de,get listEl(){return I(p)},set listEl(e){j(p,e,!0)}}),T(r),bi(`keydown`,r,pe),z(e,r)},$$slots:{footer:!0,default:!0}}),O()}xi([`keydown`]);var AFe=L(`<!> <!>`,1);function jFe(e,t){D(t,!0);let n=k(()=>R6.status),r=k(()=>R6.projects),i=k(()=>R6.conversations),a=k(()=>_8.activeConversation),o=k(()=>_8.treeNodes),s=k(()=>_8.toolCalls);async function c(e,t=!1){await D6(e,t),Y3()}async function l(e){await D6(e.parentEntryId),_6(e.text),Y3()}var u=AFe(),d=N(u);{let e=k(()=>I(n)?.storage.home);kFe(d,{get projects(){return I(r)},get conversations(){return I(i)},get homeDir(){return I(e)},onSelect:e=>void E6(e),onForget:e=>void T6(e),get open(){return Y.projectPickerOpen},set open(e){Y.projectPickerOpen=e}})}JPe(P(d,2),{get activeConversation(){return I(a)},get treeNodes(){return I(o)},get toolCalls(){return I(s)},onNavigateToEntry:(e,t)=>{c(e,t)},onEditEntry:e=>{l(e)},onCompact:()=>void UDe(),get open(){return J3.historyDialogOpen},set open(e){J3.historyDialogOpen=e}}),z(e,u),O()}function MFe(e){return typeof e==`function`}function B5(e){return typeof e==`object`&&!!e}var NFe=[`string`,`number`,`bigint`,`boolean`];function V5(e){return e==null||NFe.includes(typeof e)?!0:Array.isArray(e)?e.every(e=>V5(e)):typeof e==`object`?Object.getPrototypeOf(e)===Object.prototype:!1}var H5=Symbol(`box`),U5=Symbol(`is-writable`);function PFe(e){return B5(e)&&H5 in e}function FFe(e){return W5.isBox(e)&&U5 in e}function W5(e){let t=A(In(e));return{[H5]:!0,[U5]:!0,get current(){return I(t)},set current(e){j(t,e,!0)}}}function IFe(e,t){let n=k(e);return t?{[H5]:!0,[U5]:!0,get current(){return I(n)},set current(e){t(e)}}:{[H5]:!0,get current(){return e()}}}function LFe(e){return W5.isBox(e)?e:MFe(e)?W5.with(e):W5(e)}function RFe(e){return Object.entries(e).reduce((e,[t,n])=>W5.isBox(n)?(W5.isWritableBox(n)?Object.defineProperty(e,t,{get(){return n.current},set(e){n.current=e}}):Object.defineProperty(e,t,{get(){return n.current}}),e):Object.assign(e,{[t]:n}),{})}function zFe(e){return W5.isWritableBox(e)?{[H5]:!0,get current(){return e.current}}:e}W5.from=LFe,W5.with=IFe,W5.flatten=RFe,W5.readonly=zFe,W5.isBox=PFe,W5.isWritableBox=FFe;function BFe(...e){return function(t){for(let n of e)if(n){if(t.defaultPrevented)return;typeof n==`function`?n.call(this,t):n.current?.call(this,t)}}}var VFe=/\d/,HFe=[`-`,`_`,`/`,`.`];function UFe(e=``){if(!VFe.test(e))return e!==e.toLowerCase()}function WFe(e){let t=[],n=``,r,i;for(let a of e){let e=HFe.includes(a);if(e===!0){t.push(n),n=``,r=void 0;continue}let o=UFe(a);if(i===!1){if(r===!1&&o===!0){t.push(n),n=a,r=o;continue}if(r===!0&&o===!1&&n.length>1){let e=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=e+a,r=o;continue}}n+=a,r=o,i=e}return t.push(n),t}function G5(e){return e?WFe(e).map(e=>KFe(e)).join(``):``}function GFe(e){return qFe(G5(e||``))}function KFe(e){return e?e[0].toUpperCase()+e.slice(1):``}function qFe(e){return e?e[0].toLowerCase()+e.slice(1):``}function K5(e){if(!e)return{};let t={};function n(e,n){if(e.startsWith(`-moz-`)||e.startsWith(`-webkit-`)||e.startsWith(`-ms-`)||e.startsWith(`-o-`)){t[G5(e)]=n;return}if(e.startsWith(`--`)){t[e]=n;return}t[GFe(e)]=n}return Os(e,n),t}function q5(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function JFe(e,t,n,r){let i=Array.isArray(t)?t:[t];return i.forEach(t=>e.addEventListener(t,n,r)),()=>{i.forEach(t=>e.removeEventListener(t,n,r))}}function YFe(e,t){let n=RegExp(e,`g`);return e=>{if(typeof e!=`string`)throw TypeError(`expected an argument of type string, but got ${typeof e}`);return e.match(n)?e.replace(n,t):e}}var XFe=YFe(/[A-Z]/,e=>`-${e.toLowerCase()}`);function ZFe(e){if(!e||typeof e!=`object`||Array.isArray(e))throw TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${XFe(t)}: ${e[t]};`).join(`
|
|
147
|
-
`)}function J5(e={}){return ZFe(e).replace(`
|
|
148
|
-
`,` `)}J5({position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,transform:`translateX(-100%)`});var QFe=new Set(`onabort.onanimationcancel.onanimationend.onanimationiteration.onanimationstart.onauxclick.onbeforeinput.onbeforetoggle.onblur.oncancel.oncanplay.oncanplaythrough.onchange.onclick.onclose.oncompositionend.oncompositionstart.oncompositionupdate.oncontextlost.oncontextmenu.oncontextrestored.oncopy.oncuechange.oncut.ondblclick.ondrag.ondragend.ondragenter.ondragleave.ondragover.ondragstart.ondrop.ondurationchange.onemptied.onended.onerror.onfocus.onfocusin.onfocusout.onformdata.ongotpointercapture.oninput.oninvalid.onkeydown.onkeypress.onkeyup.onload.onloadeddata.onloadedmetadata.onloadstart.onlostpointercapture.onmousedown.onmouseenter.onmouseleave.onmousemove.onmouseout.onmouseover.onmouseup.onpaste.onpause.onplay.onplaying.onpointercancel.onpointerdown.onpointerenter.onpointerleave.onpointermove.onpointerout.onpointerover.onpointerup.onprogress.onratechange.onreset.onresize.onscroll.onscrollend.onsecuritypolicyviolation.onseeked.onseeking.onselect.onselectionchange.onselectstart.onslotchange.onstalled.onsubmit.onsuspend.ontimeupdate.ontoggle.ontouchcancel.ontouchend.ontouchmove.ontouchstart.ontransitioncancel.ontransitionend.ontransitionrun.ontransitionstart.onvolumechange.onwaiting.onwebkitanimationend.onwebkitanimationiteration.onwebkitanimationstart.onwebkittransitionend.onwheel`.split(`.`));function $Fe(e){return QFe.has(e)}function Y5(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];if(r){for(let e of Object.keys(r)){let n=t[e],i=r[e],a=typeof n==`function`,o=typeof i==`function`;if(a&&typeof o&&$Fe(e))t[e]=BFe(n,i);else if(a&&o)t[e]=q5(n,i);else if(e===`class`){let r=V5(n),a=V5(i);r&&a?t[e]=Xi(n,i):r?t[e]=Xi(n):a&&(t[e]=Xi(i))}else if(e===`style`){let r=typeof n==`object`,a=typeof i==`object`,o=typeof n==`string`,s=typeof i==`string`;if(r&&a)t[e]={...n,...i};else if(r&&s){let r=K5(i);t[e]={...n,...r}}else if(o&&a)t[e]={...K5(n),...i};else if(o&&s){let r=K5(n),a=K5(i);t[e]={...r,...a}}else r?t[e]=n:a?t[e]=i:o?t[e]=n:s&&(t[e]=i)}else t[e]=i===void 0?n:i}for(let e of Object.getOwnPropertySymbols(r)){let n=t[e],i=r[e];t[e]=i===void 0?n:i}}}return typeof t.style==`object`&&(t.style=J5(t.style).replaceAll(`
|
|
149
|
-
`,` `)),t.hidden!==!0&&(t.hidden=void 0,delete t.hidden),t.disabled!==!0&&(t.disabled=void 0,delete t.disabled),t}var eIe=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function tIe(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}new class{#e;#t;constructor(e={}){let{window:t=eIe,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=Kt(e=>{let n=vi(t,`focusin`,e),r=vi(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?tIe(this.#e):null}};function nIe(e,t){switch(e){case`post`:sr(t);break;case`pre`:lr(t);break}}function X5(e,t,n,r={}){let{lazy:i=!1}=r,a=!i,o=Array.isArray(e)?[]:void 0;nIe(t,()=>{let t=Array.isArray(e)?e.map(e=>e()):e();if(!a){a=!0,o=t;return}let r=ei(()=>n(t,o));return o=t,r})}function Z5(e,t,n){let r=ur(()=>{let i=!1;X5(e,t,(e,t)=>{if(i){r();return}let a=n(e,t);return i=!0,a},{lazy:!0})});sr(()=>r)}function Q5(e,t,n){X5(e,`post`,t,n)}function rIe(e,t,n){X5(e,`pre`,t,n)}Q5.pre=rIe;function iIe(e,t){Z5(e,`post`,t)}function aIe(e,t){Z5(e,`pre`,t)}iIe.pre=aIe;function oIe(e,t){let n,r=null;return(...i)=>new Promise(a=>{r&&r(void 0),r=a,clearTimeout(n),n=setTimeout(async()=>{let t=await e(...i);r&&=(r(t),null)},t)})}function sIe(e,t){let n=0,r=null;return(...i)=>{let a=Date.now();return n&&a-n<t?r??Promise.resolve(void 0):(n=a,r=e(...i),r)}}function $5(e,t,n={},r){let{lazy:i=!1,once:a=!1,initialValue:o,debounce:s,throttle:c}=n,l=A(In(o)),u=A(!1),d=A(void 0),f=A(In([])),p=()=>{I(f).forEach(e=>e()),j(f,[],!0)},m=e=>{j(f,[...I(f),e],!0)},h=async(e,n,r=!1)=>{try{j(u,!0),j(d,void 0),p();let i=new AbortController;m(()=>i.abort());let a=await t(e,n,{data:I(l),refetching:r,onCleanup:m,signal:i.signal});return j(l,a,!0),a}catch(e){e instanceof DOMException&&e.name===`AbortError`||j(d,e,!0);return}finally{j(u,!1)}},g=s?oIe(h,s):c?sIe(h,c):h,_=Array.isArray(e)?e:[e],v;return r((t,n)=>{a&&v||(v=t,g(Array.isArray(e)?t:t[0],Array.isArray(e)?n:n?.[0]))},{lazy:i}),{get current(){return I(l)},get loading(){return I(u)},get error(){return I(d)},mutate:e=>{j(l,e,!0)},refetch:t=>{let n=_.map(e=>e());return g(Array.isArray(e)?n:n[0],Array.isArray(e)?n:n[0],t??!0)}}}function cIe(e,t,n){return $5(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Q5(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}function lIe(e,t,n){return $5(e,t,n,(t,n)=>{let r=Array.isArray(e)?e:[e];Q5.pre(()=>r.map(e=>e()),(e,n)=>{t(e,n??[])},n)})}cIe.pre=lIe;function uIe(e){Zr().then(e)}var dIe=9;function fIe(e){return B5(e)&&e.nodeType===dIe}function pIe(e){return B5(e)&&e.constructor?.name===`VisualViewport`}function mIe(e){return fIe(e)?e:pIe(e)?e.document:e?.ownerDocument??document}function hIe(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var e7=class{element;#e=k(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return I(this.#e)}set root(e){j(this.#e,e)}constructor(e){typeof e==`function`?this.element=W5.with(e):this.element=e}getDocument=()=>mIe(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>hIe(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)};function t7(e,t){return{[ri()]:n=>W5.isBox(e)?(e.current=n,ei(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e.current=null,t?.(null))}):(e(n),ei(()=>t?.(n)),()=>{`isConnected`in n&&n.isConnected||(e(null),t?.(null))})}}function gIe({layout:e,panesArray:t,pivotIndices:n}){let r=0,i=100,a=0,o=0,s=n[0];for(let e=0;e<t.length;e++){let{maxSize:n=100,minSize:c=0}=t[e].constraints;e===s?(r=c,i=n):(a+=c,o+=n)}return{valueMax:Math.min(i,100-a),valueMin:Math.max(r,100-o),valueNow:e[s]}}function n7(e,t=`Assertion failed!`){if(!e)throw console.error(t),Error(t)}function r7(e,t,n=10){return i7(e,t,n)===0}function i7(e,t,n=10){let r=o7(e,n),i=o7(t,n);return Math.sign(r-i)}function a7(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function o7(e,t){return Number.parseFloat(e.toFixed(t))}var s7=typeof document<`u`;function _Ie(e){return e instanceof HTMLElement}function c7(e){return e.type===`keydown`}function l7(e){return e.type.startsWith(`mouse`)}function u7(e){return e.type.startsWith(`touch`)}function d7({paneConstraints:e,paneIndex:t,initialSize:n}){let r=e[t];n7(r!=null,`Pane constraints should not be null.`);let{collapsedSize:i=0,collapsible:a,maxSize:o=100,minSize:s=0}=r,c=n;return i7(c,s)<0&&(c=vIe(c,a,i,s)),c=Math.min(o,c),Number.parseFloat(c.toFixed(10))}function vIe(e,t,n,r){return t&&i7(e,(n+r)/2)<0?n:r}function f7(){}function yIe({groupId:e,layout:t,panesArray:n,domContext:r}){let i=p7(e,r);for(let e=0;e<n.length-1;e++){let{valueMax:r,valueMin:a,valueNow:o}=gIe({layout:t,panesArray:n,pivotIndices:[e,e+1]}),s=i[e];if(_Ie(s)){let t=n[e];s.setAttribute(`aria-controls`,t.opts.id.current),s.setAttribute(`aria-valuemax`,`${Math.round(r)}`),s.setAttribute(`aria-valuemin`,`${Math.round(a)}`),s.setAttribute(`aria-valuenow`,o==null?``:`${Math.round(o)}`)}}return()=>{for(let e of i)e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-valuemax`),e.removeAttribute(`aria-valuemin`),e.removeAttribute(`aria-valuenow`)}}function p7(e,t){return s7?Array.from(t.querySelectorAll(`[data-pane-resizer-id][data-pane-group-id="${e}"]`)):[]}function m7({groupId:e,id:t,domContext:n}){return s7?p7(e,n).findIndex(e=>e.getAttribute(`data-pane-resizer-id`)===t)??null:null}function h7({groupId:e,dragHandleId:t,domContext:n}){let r=m7({groupId:e,id:t,domContext:n});return r==null?[-1,-1]:[r,r+1]}function g7(e,t,n){let r=e.map(e=>e.constraints),i=_7(e,t),a=r[i],o=i===e.length-1?[i-1,i]:[i,i+1],s=n[i];return{...a,paneSize:s,pivotIndices:o}}function _7(e,t){return e.findIndex(e=>e.opts.id.current===t.opts.id.current)}function v7(e,t,n){for(let r=0;r<t.length;r++){let i=t[r],a=e[r];n7(a);let{collapsedSize:o=0,collapsible:s}=a.constraints,c=n[a.opts.id.current];if(!(c==null||i!==c))continue;n[a.opts.id.current]=i;let{onCollapse:l,onExpand:u,onResize:d}=a.callbacks;d?.(i,c),s&&(l||u)&&(u&&(c==null||c===o)&&i!==o&&u(),l&&(c==null||c!==o)&&i===o&&l())}}function bIe({panesArray:e}){let t=Array(e.length),n=e.map(e=>e.constraints),r=0,i=100;for(let a=0;a<e.length;a++){let e=n[a];n7(e);let{defaultSize:o}=e;o!=null&&(r++,t[a]=o,i-=o)}for(let a=0;a<e.length;a++){let o=n[a];n7(o);let{defaultSize:s}=o;if(s!=null)continue;let c=e.length-r,l=i/c;r++,t[a]=l,i-=l}return t}function xIe({layout:e,paneConstraints:t}){let n=[...e],r=n.reduce((e,t)=>e+t,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} pane layout: ${n.map(e=>`${e}%`).join(`, `)}`);if(!r7(r,100))for(let e=0;e<t.length;e++){let t=n[e];n7(t!=null),n[e]=100/r*t}let i=0;for(let e=0;e<t.length;e++){let r=n[e];n7(r!=null);let a=d7({paneConstraints:t,paneIndex:e,initialSize:r});r!==a&&(i+=r-a,n[e]=a)}if(!r7(i,0))for(let e=0;e<t.length;e++){let r=n[e];n7(r!=null);let a=r+i,o=d7({paneConstraints:t,paneIndex:e,initialSize:a});if(r!==o&&(i-=o-r,n[e]=o,r7(i,0)))break}return n}function SIe(e,t){return s7&&t.querySelector(`[data-pane-group][data-pane-group-id="${e}"]`)||null}function y7(e,t){return s7&&t.querySelector(`[data-pane-resizer-id="${e}"]`)||null}function CIe({event:e,dragHandleId:t,dir:n,initialDragState:r,domContext:i}){let a=n===`horizontal`,o=y7(t,i);n7(o);let s=o.getAttribute(`data-pane-group-id`);n7(s);let{initialCursorPosition:c}=r,l=b7(n,e),u=SIe(s,i);n7(u);let d=u.getBoundingClientRect(),f=a?d.width:d.height;return(l-c)/f*100}function wIe({event:e,dragHandleId:t,dir:n,initialDragState:r,keyboardResizeBy:i,domContext:a}){if(c7(e)){let t=n===`horizontal`,r=0;r=e.shiftKey?100:i??10;let a=0;switch(e.key){case`ArrowDown`:a=t?0:r;break;case`ArrowLeft`:a=t?-r:0;break;case`ArrowRight`:a=t?r:0;break;case`ArrowUp`:a=t?0:-r;break;case`End`:a=100;break;case`Home`:a=-100;break}return a}else return r==null?0:CIe({event:e,dragHandleId:t,dir:n,initialDragState:r,domContext:a})}function b7(e,t){let n=e===`horizontal`;if(l7(t))return n?t.clientX:t.clientY;if(u7(t)){let e=t.touches[0];return n7(e),n?e.screenX:e.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function TIe({groupId:e,handleId:t,panesArray:n,domContext:r}){let i=y7(t,r),a=p7(e,r),o=i?a.indexOf(i):-1;return[n[o]?.opts.id.current??null,n[o+1]?.opts.id.current??null]}function x7({delta:e,layout:t,paneConstraints:n,pivotIndices:r,trigger:i}){if(r7(e,0))return t;let a=[...t],[o,s]=r,c=0;if(i===`keyboard`){{let r=e<0?s:o,i=n[r];if(n7(i),i.collapsible){let i=t[r];n7(i!=null);let a=n[r];n7(a);let{collapsedSize:o=0,minSize:s=0}=a;if(r7(i,o)){let t=s-i;i7(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let r=e<0?o:s,i=n[r];n7(i);let{collapsible:a}=i;if(a){let i=t[r];n7(i!=null);let a=n[r];n7(a);let{collapsedSize:o=0,minSize:s=0}=a;if(r7(i,s)){let t=i-o;i7(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let r=e<0?1:-1,i=e<0?s:o,a=0;for(;;){let e=t[i];n7(e!=null);let o=d7({paneConstraints:n,paneIndex:i,initialSize:100})-e;if(a+=o,i+=r,i<0||i>=n.length)break}let c=Math.min(Math.abs(e),Math.abs(a));e=e<0?0-c:c}{let r=e<0?o:s;for(;r>=0&&r<n.length;){let i=Math.abs(e)-Math.abs(c),o=t[r];n7(o!=null);let s=o-i,l=d7({paneConstraints:n,paneIndex:r,initialSize:s});if(!r7(o,l)&&(c+=o-l,a[r]=l,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?r--:r++}}if(r7(c,0))return t;{let r=e<0?s:o,i=t[r];n7(i!=null);let l=i+c,u=d7({paneConstraints:n,paneIndex:r,initialSize:l});if(a[r]=u,!r7(u,l)){let t=l-u,r=e<0?s:o;for(;r>=0&&r<n.length;){let i=a[r];n7(i!=null);let o=i+t,s=d7({paneConstraints:n,paneIndex:r,initialSize:o});if(r7(i,s)||(t-=s-i,a[r]=s),r7(t,0))break;e>0?r--:r++}}}return r7(a.reduce((e,t)=>t+e,0),100)?a:t}var S7=null,C7=null;function w7(e){switch(e){case`horizontal`:return`ew-resize`;case`horizontal-max`:return`w-resize`;case`horizontal-min`:return`e-resize`;case`vertical`:return`ns-resize`;case`vertical-max`:return`n-resize`;case`vertical-min`:return`s-resize`}}function EIe(){C7!==null&&(document.head.removeChild(C7),S7=null,C7=null)}function DIe(e,t){if(S7===e)return;S7=e;let n=w7(e);C7===null&&(C7=t.createElement(`style`),t.head.appendChild(C7)),C7.innerHTML=`*{cursor: ${n}!important;}`}function OIe({defaultSize:e,dragState:t,layout:n,panesArray:r,paneIndex:i,precision:a=3}){let o=n[i],s;return s=o==null?e??`1`:r.length===1?`1`:o.toPrecision(a),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:`hidden`,pointerEvents:t===null?void 0:`none`}}function T7(e){try{if(typeof localStorage>`u`)throw TypeError(`localStorage is not supported in this environment`);e.getItem=e=>localStorage.getItem(e),e.setItem=(e,t)=>localStorage.setItem(e,t)}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function E7(e){return`paneforge:${e}`}function D7(e){return e.map(e=>e.opts.order.current?`${e.opts.order.current}:${JSON.stringify(e.constraints)}`:JSON.stringify(e.constraints)).sort().join(`,`)}function O7(e,t){try{let n=E7(e),r=t.getItem(n),i=JSON.parse(r||``);if(typeof i==`object`&&i)return i}catch{}return null}function kIe(e,t,n){return(O7(e,n)||{})[D7(t)]||null}function AIe(e,t,n,r,i){let a=E7(e),o=D7(t),s=O7(e,i)||{};s[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(a,JSON.stringify(s))}catch(e){console.error(e)}}var k7={};function jIe(e,t=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function MIe({autoSaveId:e,layout:t,storage:n,panesArray:r,paneSizeBeforeCollapse:i}){if(t.length===0||t.length!==r.length)return;let a=k7[e];a??(a=jIe(AIe,100),k7[e]=a);let o=[...r],s=new Map(i);a(e,o,s,t,n)}var A7={getItem:e=>(T7(A7),A7.getItem(e)),setItem:(e,t)=>{T7(A7),A7.setItem(e,t)}},j7=new Hs(`PaneGroup`),NIe=class e{static create(t){return j7.set(new e(t))}opts;attachment;domContext;#e=A(null);get dragState(){return I(this.#e)}set dragState(e){j(this.#e,e)}#t=A([]);get layout(){return I(this.#t)}set layout(e){j(this.#t,e)}#n=A([]);get panesArray(){return I(this.#n)}set panesArray(e){j(this.#n,e)}#r=A(!1);get panesArrayChanged(){return I(this.#r)}set panesArrayChanged(e){j(this.#r,e,!0)}#i=A(In({}));get paneIdToLastNotifiedSizeMap(){return I(this.#i)}set paneIdToLastNotifiedSizeMap(e){j(this.#i,e,!0)}paneSizeBeforeCollapseMap=new Map;prevDelta=0;constructor(e){this.opts=e,this.attachment=t7(this.opts.ref),this.domContext=new e7(this.opts.ref),Rs([()=>this.opts.id.current,()=>this.layout,()=>this.panesArray],()=>yIe({groupId:this.opts.id.current,layout:this.layout,panesArray:this.panesArray,domContext:this.domContext})),sr(()=>ei(()=>this.#a())),Rs([()=>this.opts.autoSaveId.current,()=>this.layout,()=>this.opts.storage.current],()=>{this.opts.autoSaveId.current&&MIe({autoSaveId:this.opts.autoSaveId.current,layout:this.layout,storage:this.opts.storage.current,panesArray:this.panesArray,paneSizeBeforeCollapse:this.paneSizeBeforeCollapseMap})}),Rs(()=>this.panesArrayChanged,()=>{if(!this.panesArrayChanged)return;this.panesArrayChanged=!1;let e=this.layout,t=null;if(this.opts.autoSaveId.current){let e=kIe(this.opts.autoSaveId.current,this.panesArray,this.opts.storage.current);e&&(this.paneSizeBeforeCollapseMap=new Map(Object.entries(e.expandToSizes)),t=e.layout)}t??=bIe({panesArray:this.panesArray});let n=xIe({layout:t,paneConstraints:this.panesArray.map(e=>e.constraints)});a7(e,n)||(this.layout=n,this.opts.onLayout.current?.(n),v7(this.panesArray,n,this.paneIdToLastNotifiedSizeMap))})}setLayout=e=>{this.layout=e};registerResizeHandle=e=>t=>{t.preventDefault();let n=this.opts.direction.current,r=this.dragState,i=this.opts.id.current,a=this.opts.keyboardResizeBy.current,o=this.layout,s=this.panesArray,{initialLayout:c}=r??{},l=this.domContext.getDocument(),u=h7({groupId:i,dragHandleId:e,domContext:this.domContext}),d=wIe({event:t,dragHandleId:e,dir:n,initialDragState:r,keyboardResizeBy:a,domContext:this.domContext});if(d===0)return;let f=n===`horizontal`;l.dir===`rtl`&&f&&(d=-d);let p=s.map(e=>e.constraints),m=x7({delta:d,layout:c??o,paneConstraints:p,pivotIndices:u,trigger:c7(t)?`keyboard`:`mouse-or-touch`}),h=!a7(o,m);(l7(t)||u7(t))&&this.prevDelta!==d&&(this.prevDelta=d,DIe(h?f?`horizontal`:`vertical`:f?d<0?`horizontal-min`:`horizontal-max`:d<0?`vertical-min`:`vertical-max`,l)),h&&(this.setLayout(m),this.opts.onLayout.current?.(m),v7(s,m,this.paneIdToLastNotifiedSizeMap))};resizePane=(e,t)=>{let n=this.layout,r=this.panesArray,i=r.map(e=>e.constraints),{paneSize:a,pivotIndices:o}=g7(r,e,n);n7(a!=null);let s=x7({delta:_7(r,e)===r.length-1?a-t:t-a,layout:n,paneConstraints:i,pivotIndices:o,trigger:`imperative-api`});a7(n,s)||(this.setLayout(s),this.opts.onLayout.current?.(s),v7(r,s,this.paneIdToLastNotifiedSizeMap))};startDragging=(e,t)=>{let n=this.opts.direction.current,r=this.layout,i=y7(e,this.domContext);n7(i);let a=b7(n,t);this.dragState={dragHandleId:e,dragHandleRect:i.getBoundingClientRect(),initialCursorPosition:a,initialLayout:r}};stopDragging=()=>{EIe(),this.dragState=null};isPaneCollapsed=e=>{let t=this.panesArray,n=this.layout,{collapsedSize:r=0,collapsible:i,paneSize:a}=g7(t,e,n);return typeof a!=`number`||typeof r!=`number`?!1:i===!0&&r7(a,r)};expandPane=e=>{let t=this.layout,n=this.panesArray;if(!e.constraints.collapsible)return;let r=n.map(e=>e.constraints),{collapsedSize:i=0,paneSize:a,minSize:o=0,pivotIndices:s}=g7(n,e,t);if(a!==i)return;let c=this.paneSizeBeforeCollapseMap.get(e.opts.id.current),l=c!=null&&c>=o?c:o,u=x7({delta:_7(n,e)===n.length-1?a-l:l-a,layout:t,paneConstraints:r,pivotIndices:s,trigger:`imperative-api`});a7(t,u)||(this.setLayout(u),this.opts.onLayout.current?.(u),v7(n,u,this.paneIdToLastNotifiedSizeMap))};collapsePane=e=>{let t=this.layout,n=this.panesArray;if(!e.constraints.collapsible)return;let r=n.map(e=>e.constraints),{collapsedSize:i=0,paneSize:a,pivotIndices:o}=g7(n,e,t);if(n7(a!=null),a===i)return;this.paneSizeBeforeCollapseMap.set(e.opts.id.current,a);let s=x7({delta:_7(n,e)===n.length-1?a-i:i-a,layout:t,paneConstraints:r,pivotIndices:o,trigger:`imperative-api`});a7(t,s)||(this.layout=s,this.opts.onLayout.current?.(s),v7(n,s,this.paneIdToLastNotifiedSizeMap))};getPaneSize=e=>g7(this.panesArray,e,this.layout).paneSize;getPaneStyle=(e,t)=>{let n=this.panesArray,r=this.layout,i=this.dragState;return OIe({defaultSize:t,dragState:i,layout:r,panesArray:n,paneIndex:_7(n,e)})};isPaneExpanded=e=>{let{collapsedSize:t=0,collapsible:n,paneSize:r}=g7(this.panesArray,e,this.layout);return!n||r>t};registerPane=e=>{let t=[...this.panesArray,e];return t.sort((e,t)=>{let n=e.opts.order.current,r=t.opts.order.current;return n==null&&r==null?0:n==null?-1:r==null?1:n-r}),this.panesArray=t,this.panesArrayChanged=!0,()=>{let t=[...this.panesArray],n=_7(this.panesArray,e);n<0||(t.splice(n,1),this.panesArray=t,delete this.paneIdToLastNotifiedSizeMap[e.opts.id.current],this.panesArrayChanged=!0)}};#a=()=>{let e=this.opts.id.current,t=p7(e,this.domContext),n=this.panesArray,r=t.map(t=>{let r=t.getAttribute(`data-pane-resizer-id`);if(!r)return f7;let[i,a]=TIe({groupId:e,handleId:r,panesArray:n,domContext:this.domContext});if(i==null||a==null)return f7;let o=JFe(t,`keydown`,t=>{if(t.defaultPrevented||t.key!==`Enter`)return;t.preventDefault();let n=this.panesArray,a=n.findIndex(e=>e.opts.id.current===i);if(a<0)return;let o=n[a];n7(o);let s=this.layout,c=s[a],{collapsedSize:l=0,collapsible:u,minSize:d=0}=o.constraints;if(!(c!=null&&u))return;let f=x7({delta:r7(c,l)?d-c:l-c,layout:s,paneConstraints:n.map(e=>e.constraints),pivotIndices:h7({groupId:e,dragHandleId:r,domContext:this.domContext}),trigger:`keyboard`});s!==f&&(this.layout=f)});return()=>{o()}});return()=>{for(let e of r)e()}};#o=k(()=>({id:this.opts.id.current,"data-pane-group":``,"data-direction":this.opts.direction.current,"data-pane-group-id":this.opts.id.current,style:{display:`flex`,flexDirection:this.opts.direction.current===`horizontal`?`row`:`column`,height:`100%`,overflow:`hidden`,width:`100%`},...this.attachment}));get props(){return I(this.#o)}set props(e){j(this.#o,e)}},PIe=[`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`],FIe=class e{static create(t){return new e(t,j7.get())}opts;#e;attachment;domContext;#t=k(()=>this.#e.dragState?.dragHandleId===this.opts.id.current);#n=A(!1);resizeHandler=null;constructor(e,t){this.opts=e,this.#e=t,this.attachment=t7(this.opts.ref),this.domContext=new e7(this.opts.ref),sr(()=>{this.opts.disabled.current?this.resizeHandler=null:this.resizeHandler=this.#e.registerResizeHandle(this.opts.id.current)}),sr(()=>{let e=this.opts.ref.current;if(!e)return;let t=this.opts.disabled.current,n=this.resizeHandler,r=I(this.#t);if(t||n===null||!r)return;let i=e=>{n(e)},a=e=>{n(e)},o=()=>{e.blur(),this.#e.stopDragging(),this.opts.onDraggingChange.current(!1)},s=this.domContext.getDocument().body,c=this.domContext.getWindow();return q5(vi(s,`contextmenu`,o),vi(s,`mousemove`,i),vi(s,`touchmove`,i,{passive:!1}),vi(s,`mouseleave`,a),vi(c,`mouseup`,o),vi(c,`touchend`,o))})}#r=e=>{e.preventDefault(),!this.opts.disabled.current&&(this.#e.startDragging(this.opts.id.current,e),this.opts.onDraggingChange.current(!0))};#i=()=>{let e=this.opts.ref.current;e&&(e.blur(),this.#e.stopDragging(),this.opts.onDraggingChange.current(!1))};#a=e=>{if(this.opts.disabled.current||!this.resizeHandler||e.defaultPrevented)return;if(PIe.includes(e.key)){e.preventDefault(),this.resizeHandler(e);return}if(e.key!==`F6`)return;e.preventDefault();let t=p7(this.#e.opts.id.current,this.domContext),n=m7({groupId:this.#e.opts.id.current,id:this.opts.id.current,domContext:this.domContext});if(n===null)return;let r=0;r=e.shiftKey?n>0?n-1:t.length-1:n+1<t.length?n+1:0,t[r].focus()};#o=()=>{j(this.#n,!1)};#s=()=>{j(this.#n,!0)};#c=e=>{this.#r(e)};#l=()=>{this.#i()};#u=()=>{this.#i()};#d=()=>{this.#i()};#f=e=>{this.#r(e)};#p=k(()=>({id:this.opts.id.current,role:`separator`,"data-direction":this.#e.opts.direction.current,"data-pane-group-id":this.#e.opts.id.current,"data-active":I(this.#t)?`pointer`:I(this.#n)?`keyboard`:void 0,"data-enabled":!this.opts.disabled.current,"data-pane-resizer-id":this.opts.id.current,"data-pane-resizer":``,tabIndex:this.opts.tabIndex.current,style:{cursor:w7(this.#e.opts.direction.current),touchAction:`none`,userSelect:`none`,"-webkit-user-select":`none`,"-webkit-touch-callout":`none`},onkeydown:this.#a,onblur:this.#o,onfocus:this.#s,onmousedown:this.#c,onmouseup:this.#l,ontouchcancel:this.#u,ontouchend:this.#d,ontouchstart:this.#f,...this.attachment}));get props(){return I(this.#p)}set props(e){j(this.#p,e)}},IIe=class e{static create(t){return new e(t,j7.get())}opts;group;attachment;domContext;#e=A(``);#t=k(()=>({onCollapse:this.opts.onCollapse.current,onExpand:this.opts.onExpand.current,onResize:this.opts.onResize.current}));get callbacks(){return I(this.#t)}set callbacks(e){j(this.#t,e)}#n=k(()=>({collapsedSize:this.opts.collapsedSize.current,collapsible:this.opts.collapsible.current,defaultSize:this.opts.defaultSize.current,maxSize:this.opts.maxSize.current,minSize:this.opts.minSize.current}));get constraints(){return I(this.#n)}set constraints(e){j(this.#n,e)}#r=e=>{j(this.#e,e,!0),uIe(()=>{if(this.opts.ref.current){let e=this.opts.ref.current;if(getComputedStyle(e).transitionDuration===`0s`){j(this.#e,``);return}let t=n=>{n.propertyName===`flex-grow`&&(j(this.#e,``),e.removeEventListener(`transitionend`,t))};e.addEventListener(`transitionend`,t)}else j(this.#e,``)})};pane={collapse:()=>{this.#r(`collapsing`),this.group.collapsePane(this)},expand:()=>{this.#r(`expanding`),this.group.expandPane(this)},getSize:()=>this.group.getPaneSize(this),isCollapsed:()=>this.group.isPaneCollapsed(this),isExpanded:()=>this.group.isPaneExpanded(this),resize:e=>this.group.resizePane(this,e),getId:()=>this.opts.id.current};constructor(e,t){this.opts=e,this.group=t,this.attachment=t7(this.opts.ref),this.domContext=new e7(this.opts.ref),Na(()=>this.group.registerPane(this)),Rs(()=>bt(this.constraints),()=>{this.group.panesArrayChanged=!0})}#i=k(()=>this.group.isPaneCollapsed(this));#a=k(()=>I(this.#e)===``?I(this.#i)?`collapsed`:`expanded`:I(this.#e));#o=k(()=>({id:this.opts.id.current,style:this.group.getPaneStyle(this,this.opts.defaultSize.current),"data-pane":``,"data-pane-id":this.opts.id.current,"data-pane-group-id":this.group.opts.id.current,"data-collapsed":I(this.#i)?``:void 0,"data-expanded":I(this.#i)?void 0:``,"data-pane-state":I(this.#a),...this.attachment}));get props(){return I(this.#o)}set props(e){j(this.#o,e)}},LIe=new Set([`$$slots`,`$$events`,`$$legacy`,`autoSaveId`,`direction`,`id`,`keyboardResizeBy`,`onLayoutChange`,`storage`,`ref`,`child`,`children`]),RIe=L(`<div><!></div>`);function zIe(e,t){let n=Ai();D(t,!0);let r=q(t,`autoSaveId`,3,null),i=q(t,`id`,3,n),a=q(t,`keyboardResizeBy`,3,null),o=q(t,`onLayoutChange`,3,f7),s=q(t,`storage`,3,A7),c=q(t,`ref`,15,null),l=G(t,LIe),u=NIe.create({id:W5.with(()=>i()??n),ref:W5.with(()=>c(),e=>c(e)),autoSaveId:W5.with(()=>r()),direction:W5.with(()=>t.direction),keyboardResizeBy:W5.with(()=>a()),onLayout:W5.with(()=>o()),storage:W5.with(()=>s())}),d=()=>u.layout,f=u.setLayout,p=()=>u.opts.id.current,m=k(()=>Y5(l,u.props));var h={getLayout:d,setLayout:f,getId:p},g=R(),_=N(g),v=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(m)})),z(e,n)},y=e=>{var n=RIe();Sa(n,()=>({...I(m)})),H(M(n),()=>t.children??w),T(n),z(e,n)};return V(_,e=>{t.child?e(v):e(y,-1)}),z(e,g),O(h)}var BIe=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`collapsedSize`,`collapsible`,`defaultSize`,`maxSize`,`minSize`,`onCollapse`,`onExpand`,`onResize`,`order`,`child`,`children`]),VIe=L(`<div><!></div>`);function M7(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,3,n),i=q(t,`ref`,15,null),a=q(t,`onCollapse`,3,f7),o=q(t,`onExpand`,3,f7),s=q(t,`onResize`,3,f7),c=G(t,BIe),l=IIe.create({id:W5.with(()=>r()),ref:W5.with(()=>i(),e=>i(e)),collapsedSize:W5.with(()=>t.collapsedSize),collapsible:W5.with(()=>t.collapsible),defaultSize:W5.with(()=>t.defaultSize),maxSize:W5.with(()=>t.maxSize),minSize:W5.with(()=>t.minSize),onCollapse:W5.with(()=>a()),onExpand:W5.with(()=>o()),onResize:W5.with(()=>s()),order:W5.with(()=>t.order)}),u=l.pane.collapse,d=l.pane.expand,f=l.pane.getSize,p=l.pane.isCollapsed,m=l.pane.isExpanded,h=l.pane.resize,g=l.pane.getId,_=k(()=>Y5(c,l.props));var v={collapse:u,expand:d,getSize:f,isCollapsed:p,isExpanded:m,resize:h,getId:g},y=R(),b=N(y),x=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(_)})),z(e,n)},S=e=>{var n=VIe();Sa(n,()=>({...I(_)})),H(M(n),()=>t.children??w),T(n),z(e,n)};return V(b,e=>{t.child?e(x):e(S,-1)}),z(e,y),O(v)}var HIe=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`disabled`,`onDraggingChange`,`tabindex`,`child`,`children`]),UIe=L(`<div><!></div>`);function WIe(e,t){let n=Ai();D(t,!0);let r=q(t,`id`,3,n),i=q(t,`ref`,15,null),a=q(t,`disabled`,3,!1),o=q(t,`onDraggingChange`,3,f7),s=q(t,`tabindex`,3,0),c=G(t,HIe),l=FIe.create({id:W5.with(()=>r()),ref:W5.with(()=>i(),e=>i(e)),disabled:W5.with(()=>a()),onDraggingChange:W5.with(()=>o()),tabIndex:W5.with(()=>s())}),u=k(()=>Y5(c,l.props));var d=R(),f=N(d),p=e=>{var n=R();H(N(n),()=>t.child,()=>({props:I(u)})),z(e,n)},m=e=>{var n=UIe();Sa(n,()=>({...I(u)})),H(M(n),()=>t.children??w),T(n),z(e,n)};V(f,e=>{t.child?e(p):e(m,-1)}),z(e,d),O()}var GIe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`withHandle`]),KIe=L(`<div class="bg-border h-6 w-1 rounded-lg z-10 flex shrink-0"></div>`);function N7(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`withHandle`,3,!1),i=G(t,GIe);var a=R(),o=N(a);{let e=k(()=>ul(`cn-resizable-handle bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:w-full data-[direction=vertical]:after:translate-x-0 data-[direction=vertical]:after:-translate-y-1/2 [&[data-direction=vertical]>div]:rotate-90`,t.class));U(o,()=>WIe,(t,a)=>{a(t,K({"data-slot":`resizable-handle`,get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)},children:(e,t)=>{var n=R(),i=N(n),a=e=>{z(e,KIe())};V(i,e=>{r()&&e(a)}),z(e,n)},$$slots:{default:!0}}))})}z(e,a),O()}var qIe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`this`,`class`]);function JIe(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`this`,15),i=G(t,qIe);var a=R(),o=N(a);{let e=k(()=>ul(`cn-resizable-panel-group flex h-full w-full data-[direction=vertical]:flex-col`,t.class));U(o,()=>zIe,(t,a)=>{Aa(a(t,K({"data-slot":`resizable-pane-group`,get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)}})),e=>r(e),()=>r())})}z(e,a),O()}var YIe=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function P7(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=G(t,YIe);var i=R();U(N(i),()=>Gy,(e,t)=>{t(e,K(()=>r,{get open(){return n()},set open(e){n(e)}}))}),z(e,i),O()}var XIe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function ZIe(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,XIe);var i=R(),a=N(i);{let e=k(()=>ul(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-sidebar/70 duration-200 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50`,t.class));U(a,()=>vh,(t,i)=>{i(t,K({"data-slot":`sheet-overlay`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var QIe=new Set([`$$slots`,`$$events`,`$$legacy`]);function $Ie(e,t){let n=G(t,QIe);var r=R();U(N(r),()=>im,(e,t)=>{t(e,K(()=>n))}),z(e,r)}var eLe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`side`,`portalProps`,`children`]),tLe=L(`<!> <!>`,1);function F7(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`side`,3,`right`),i=G(t,eLe);$Ie(e,K(()=>t.portalProps,{children:(e,a)=>{var o=tLe(),s=N(o);ZIe(s,{});var c=P(s,2);{let e=k(()=>ul(`bg-sidebar text-foreground data-open:animate-in data-closed:animate-out fixed z-50 flex flex-col overflow-hidden shadow-lg outline-none duration-200`,r()===`right`&&`data-open:slide-in-from-right data-closed:slide-out-to-right inset-y-0 right-0 h-full w-[min(90vw,24rem)] border-l`,r()===`left`&&`data-open:slide-in-from-left data-closed:slide-out-to-left inset-y-0 left-0 h-full w-[min(85vw,20rem)] border-r`,r()===`top`&&`data-open:slide-in-from-top data-closed:slide-out-to-top inset-x-0 top-0 h-auto max-h-[85vh] border-b`,r()===`bottom`&&`data-open:slide-in-from-bottom data-closed:slide-out-to-bottom inset-x-0 bottom-0 h-auto max-h-[85vh] border-t`,t.class));U(c,()=>Qy,(a,o)=>{o(a,K({"data-slot":`sheet-content`,get"data-side"(){return r()},get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var r=R();H(N(r),()=>t.children??w),z(e,r)},$$slots:{default:!0}}))})}z(e,o)},$$slots:{default:!0}})),O()}var nLe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function I7(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,nLe);var i=R(),a=N(i);{let e=k(()=>ul(`text-foreground font-medium`,t.class));U(a,()=>rm,(t,i)=>{i(t,K({"data-slot":`sheet-title`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var rLe=new Set([`$$slots`,`$$events`,`$$legacy`]);function iLe(e,t){let n=G(t,rLe),r=[[`path`,{d:`M12 7v14`}],[`path`,{d:`M16 12h2`}],[`path`,{d:`M16 8h2`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`}],[`path`,{d:`M6 12h2`}],[`path`,{d:`M6 8h2`}]];uc(e,K({name:`book-open-text`},()=>n,{get iconNode(){return r}}))}var aLe=new Set([`$$slots`,`$$events`,`$$legacy`]);function L7(e,t){let n=G(t,aLe),r=[[`path`,{d:`m18 16 4-4-4-4`}],[`path`,{d:`m6 8-4 4 4 4`}],[`path`,{d:`m14.5 4-5 16`}]];uc(e,K({name:`code-xml`},()=>n,{get iconNode(){return r}}))}var oLe=new Set([`$$slots`,`$$events`,`$$legacy`]);function R7(e,t){let n=G(t,oLe),r=[[`path`,{d:`M3 5h1`}],[`path`,{d:`M3 12h1`}],[`path`,{d:`M3 19h1`}],[`path`,{d:`M8 5h1`}],[`path`,{d:`M8 12h1`}],[`path`,{d:`M8 19h1`}],[`path`,{d:`M13 5h8`}],[`path`,{d:`M13 12h8`}],[`path`,{d:`M13 19h8`}]];uc(e,K({name:`logs`},()=>n,{get iconNode(){return r}}))}var sLe=new Set([`$$slots`,`$$events`,`$$legacy`]);function z7(e,t){let n=G(t,sLe),r=[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]];uc(e,K({name:`settings`},()=>n,{get iconNode(){return r}}))}function B7(e){return e.kind===`settings`?{kind:`settings`,id:`settings`}:e.kind===`auth`?{kind:`auth`,id:`auth`}:e.kind===`logs`?{kind:`logs`,id:`logs`}:{kind:e.kind,id:e.id}}function V7(e){return e.kind===`task`?e.task?.name??e.task?.command??e.id:e.kind===`file`?e.file?.name??e.relativePath?.split(`/`).pop()??e.path?.split(`/`).pop()??`File`:e.kind===`pr`?`#${e.number}`:e.kind===`settings`?`Settings`:e.kind===`auth`?`Authentication`:e.kind===`logs`?`Nerve Logs`:e.kind===`pending-conversation`?e.title:e.conversation.title}function cLe(e,t){if(e.kind===`task`)return e.task?`${e.task.name??e.task.command} · ${e.task.status} · ${Hd(e.task.cwd,t)} · ${e.task.id}`:`Missing task · ${e.id}`;if(e.kind===`file`)return e.file?.path??e.path??e.id;if(e.kind===`pr`)return e.title?`#${e.number} ${e.title}`:`Pull request #${e.number}`;if(e.kind===`settings`)return`Workbench settings`;if(e.kind===`auth`)return`Providers & authentication`;if(e.kind===`logs`)return`Nerve application logs`;let n=e.project?.dir?CE(e.project.dir,t):e.kind===`pending-conversation`?CE(e.projectDir,t):`Unknown project`;return e.kind===`pending-conversation`?`${e.title} · ${n} · created on first send`:`${e.conversation.title} · ${n} · ${e.conversation.id}`}function H7(e){if(e.error)return e.error;if(e.kind===`conversation`||e.kind===`pending-conversation`)return e.activity.label??(e.hasDraft?`Unsaved draft`:void 0);if(e.sending){if(e.kind===`task`)return`Task active`;if(e.kind===`file`)return`Loading file`}if(e.kind===`task`)return e.task?.status??`missing`;if(e.kind===`file`&&e.file?.truncated)return`Truncated`}function U7(e){return e.kind===`file`?e.displayMode===`rendered`?`Show raw markdown`:`Show rendered markdown`:``}function lLe(e){return e.kind===`file`?e.wrapLines?`Disable line wrap`:`Wrap long lines`:``}function uLe(e,t){let n=B7(t);return e.findIndex(e=>{let t=B7(e);return t.kind===n.kind&&t.id===n.id})}var dLe=L(`<span class="tab-status" aria-hidden="true"></span>`),fLe=L(`<button type="button" class="tab-file-toggle"><!></button>`),W7=L(`<span class="tab-kind-icon"><!></span>`),pLe=L(`<span class="draft-dot" title="Draft" aria-label="Draft"></span>`),mLe=L(`<div><div class="tab-leading"><!></div> <button type="button" class="tab-select" role="tab"><!> <span class="tab-title"> </span> <!></button> <button type="button" class="tab-close" title="Close tab"><!></button></div>`);function hLe(e,t){D(t,!0);function n(e){t.tab.kind===`file`&&(e.stopPropagation(),t.onToggleFileDisplayMode?.(t.tab.id))}async function r(e,t){if(e)try{await bE(e),cd.success(`Copied ${t}`)}catch{cd.error(`Could not copy to clipboard`)}}function i(){let e=B7(t.tab),n=uLe(t.tabs,t.tab),i=n>0,a=n!==-1&&n<t.tabs.length-1,o=[];if(t.tab.kind===`file`){let e=t.tab.file?.path??t.tab.path,n=t.tab.relativePath??t.tab.file?.relativePath;o.push({label:`Copy Path`,icon:V3,disabled:!e,onSelect:()=>void r(e,`path`)},{label:`Copy Relative Path`,icon:V3,disabled:!n,onSelect:()=>void r(n,`relative path`)},{type:`separator`},{label:lLe(t.tab),icon:L7,disabled:!t.onToggleFileLineWrap,onSelect:()=>t.onToggleFileLineWrap?.(t.tab.id)})}return o.push({label:`Refresh`,icon:O8,shortcut:t.refreshShortcut,disabled:!t.onRefresh,onSelect:()=>t.onRefresh?.(e)}),o.push({type:`separator`},{label:`Close Pane`,icon:ZX,shortcut:t.closeShortcut,onSelect:()=>t.onClose?.(e)},{label:`Close Other Panes`,icon:ZX,shortcut:t.closeOthersShortcut,disabled:t.tabs.length<=1||!t.onCloseOther,onSelect:()=>t.onCloseOther?.(e)},{label:`Close Panes on Right`,icon:ZX,disabled:!a||!t.onCloseRight,onSelect:()=>t.onCloseRight?.(e)},{label:`Close Panes on Left`,icon:ZX,disabled:!i||!t.onCloseLeft,onSelect:()=>t.onCloseLeft?.(e)}),o}{let r=k(i),a=k(()=>`center-tab-menu-trigger ${t.tab.kind===`task`||t.tab.kind===`file`?`wide-tab`:``}`);j$(e,{get items(){return I(r)},get triggerClass(){return I(a)},children:(e,r)=>{var i=mLe();let a;var o=M(i),s=M(o),c=e=>{{let n=k(()=>H7(t.tab));lC(e,{class:`tab-agent-status`,get tone(){return t.tab.activity.tone},get pulse(){return t.tab.activity.pulse},get label(){return I(n)}})}},l=e=>{var n=dLe();F(e=>W(n,`title`,e),[()=>H7(t.tab)]),z(e,n)},u=e=>{var r=R(),i=N(r),a=e=>{var r=fLe(),i=M(r),a=e=>{iLe(e,{size:12,strokeWidth:2.2,"aria-hidden":`true`})},o=e=>{L7(e,{size:12,strokeWidth:2.2,"aria-hidden":`true`})};V(i,e=>{t.tab.displayMode===`rendered`?e(a):e(o,-1)}),T(r),F((e,n)=>{W(r,`aria-label`,e),W(r,`title`,n),r.disabled=!t.onToggleFileDisplayMode},[()=>U7(t.tab),()=>U7(t.tab)]),bi(`click`,r,n),z(e,r)},o=e=>{var t=W7();d1(M(t),{size:12,strokeWidth:2.2,"aria-hidden":`true`}),T(t),z(e,t)};V(i,e=>{t.tab.markdown?e(a):e(o,-1)}),z(e,r)},d=e=>{var t=W7();u$(M(t),{size:12,strokeWidth:2.2,"aria-hidden":`true`}),T(t),z(e,t)},f=e=>{var t=W7();z7(M(t),{size:12,strokeWidth:2.2,"aria-hidden":`true`}),T(t),z(e,t)},p=e=>{var t=W7();qX(M(t),{size:12,strokeWidth:2.2,"aria-hidden":`true`}),T(t),z(e,t)},m=e=>{var t=W7();R7(M(t),{size:12,strokeWidth:2.2,"aria-hidden":`true`}),T(t),z(e,t)};V(s,e=>{t.tab.kind===`conversation`||t.tab.kind===`pending-conversation`?e(c):t.tab.kind===`task`?e(l,1):t.tab.kind===`file`?e(u,2):t.tab.kind===`pr`?e(d,3):t.tab.kind===`settings`?e(f,4):t.tab.kind===`auth`?e(p,5):t.tab.kind===`logs`&&e(m,6)}),T(o);var h=P(o,2),g=M(h),_=e=>{var t=W7();zd(M(t),{size:12,strokeWidth:2.2,"aria-hidden":`true`}),T(t),z(e,t)};V(g,e=>{t.tab.kind===`task`&&e(_)});var v=P(g,2),y=M(v,!0);T(v);var b=P(v,2),x=e=>{z(e,pLe())};V(b,e=>{(t.tab.kind===`conversation`||t.tab.kind===`pending-conversation`)&&t.tab.hasDraft&&e(x)}),T(h);var S=P(h,2);ZX(M(S),{size:13,strokeWidth:2.2}),T(S),T(i),F((e,n,r,o)=>{a=ra(i,1,`center-tab`,null,a,e),W(h,`aria-selected`,t.tab.active),W(h,`title`,n),B(y,r),W(S,`aria-label`,o)},[()=>({active:t.tab.active,running:t.tab.sending,errored:!!t.tab.error}),()=>cLe(t.tab,t.homeDir),()=>V7(t.tab),()=>`Close ${V7(t.tab)}`]),bi(`click`,h,()=>t.onSelect?.(B7(t.tab))),bi(`click`,S,()=>t.onClose?.(B7(t.tab))),z(e,i)},$$slots:{default:!0}})}O()}xi([`click`]);function gLe(e,t){{let n=k(()=>t.shortcut?`New chat (${t.shortcut})`:`New chat`);Ml(e,{variant:`ghost`,size:`icon-sm`,ariaLabel:`New chat`,get"aria-keyshortcuts"(){return t.shortcutAria},get title(){return I(n)},get onclick(){return t.onNewConversation},children:(e,t)=>{ZZ(e,{size:13,strokeWidth:2.25})},$$slots:{default:!0}})}}var _Le=L(`<nav class="center-tab-strip" aria-label="Open center tabs"><div class="tab-scroller" role="tablist" aria-label="Open center panes"></div> <div class="tab-actions"><!></div></nav>`);function vLe(e,t){D(t,!0);let n=q(t,`tabs`,19,()=>[]),r=g$(`conversation.new`),i=_$(`conversation.new`),a=g$(`pane.refresh`),o=g$(`pane.close`),s=g$(`pane.closeOthers`);var c=_Le(),l=M(c);Ri(l,21,n,e=>`${e.kind}:${e.id}`,(e,r)=>{hLe(e,{get tab(){return I(r)},get tabs(){return n()},get homeDir(){return t.homeDir},get refreshShortcut(){return a},get closeShortcut(){return o},get closeOthersShortcut(){return s},get onSelect(){return t.onSelect},get onClose(){return t.onClose},get onRefresh(){return t.onRefresh},get onCloseOther(){return t.onCloseOther},get onCloseRight(){return t.onCloseRight},get onCloseLeft(){return t.onCloseLeft},get onToggleFileDisplayMode(){return t.onToggleFileDisplayMode},get onToggleFileLineWrap(){return t.onToggleFileLineWrap}})}),T(l);var u=P(l,2);gLe(M(u),{get shortcut(){return r},get shortcutAria(){return i},get onNewConversation(){return t.onNewConversation}}),T(u),T(c),z(e,c),O()}var yLe=L(`<div class="file-empty svelte-lvkzk0"><!> <strong class="svelte-lvkzk0">No file selected</strong> <p class="svelte-lvkzk0">Open a file from a tool result to view it here.</p></div>`),bLe=L(`<div class="file-empty svelte-lvkzk0"><!> <strong class="svelte-lvkzk0">Loading file</strong> <p class="svelte-lvkzk0"> </p></div>`),xLe=L(`<div class="file-empty danger svelte-lvkzk0"><!> <strong class="svelte-lvkzk0">Could not open file</strong> <p class="svelte-lvkzk0"> </p></div>`),SLe=L(`<div class="image-wrap svelte-lvkzk0"><img class="svelte-lvkzk0"/></div>`),CLe=L(`<div class="markdown-view svelte-lvkzk0"><!></div>`),wLe=L(`<div></div>`),TLe=L(`<span> </span>`),ELe=L(`<pre><code class="svelte-lvkzk0"></code></pre>`),DLe=L(`<div class="file-empty svelte-lvkzk0"><!> <strong class="svelte-lvkzk0">Binary preview unavailable</strong> <p class="svelte-lvkzk0">This file can be opened as metadata only for now.</p></div>`),OLe=L(`<section class="file-pane svelte-lvkzk0"><!></section>`);function kLe(e,t){D(t,!0);let n=A(void 0),r=A(void 0),i=A(void 0),a=A(null),o=A(void 0),s=k(()=>t.view?.content),c=k(()=>I(s)?.relativePath??t.view?.path),l=k(()=>k6(I(c))),u=k(()=>I(s)?.lineStart??1),d=k(()=>t.view?.line??I(s)?.targetLine),f=k(()=>t.view?.displayMode??(I(d)?`raw`:A6(I(c)))),p=k(()=>x1(I(c))),m=k(()=>I(s)?.type===`text`&&I(s).text!==void 0&&I(f)===`raw`?`${I(p)??``}\0${I(s).text}`:void 0),h=k(()=>I(m)?`${I(m)}\0${I(u)}\0${I(d)??``}`:void 0),g=k(()=>I(s)?.type===`image`&&I(s).dataBase64&&I(s).mimeType?`data:${I(s).mimeType};base64,${I(s).dataBase64}`:void 0),_=k(()=>I(s)?.type===`text`&&I(s).text!==void 0?I(s).text.split(`
|
|
150
|
-
`):[]),v=k(()=>I(u)+Math.max(0,I(_).length-1)),y=k(()=>`${Math.max(2,String(I(v)).length)}ch`),b=k(()=>`--line-number-width: ${I(y)}; counter-reset: code-line ${I(u)-1};`);function x(e,t,n){let r=0;return e.replaceAll(/<\/span>\r?\n<span class="line">/g,`</span><span class="line">`).replaceAll(/<span class="line"/g,()=>{let e=t+r;return r+=1,`<span class="${e===n?`line file-target-line`:`line`}" data-file-line="${e}"`})}sr(()=>{if(I(s)?.type!==`text`||I(s).text===void 0||!I(m))return;let e=I(h);if(!e||I(r)===e||I(i)===e)return;let t=c1(I(s).text,I(p));if(typeof t==`string`){j(n,x(t,I(u),I(d)),!0),j(r,e,!0),j(i,void 0);return}if(!t){j(i,e,!0);return}let a=!1;return t.then(t=>{a||I(h)!==e||(t?(j(n,x(t,I(u),I(d)),!0),j(r,e,!0),j(i,void 0)):j(i,e,!0))}),()=>{a=!0}}),sr(()=>{if(!I(a)||I(s)?.type!==`text`||!I(d))return;let e=`${I(s).path}:${I(u)}:${I(d)}:${I(f)}:${I(r)??I(m)??I(_).length}`;I(o)!==e&&Zr().then(()=>{let t=I(a)?.querySelector(`[data-file-line="${I(d)}"]`);t&&(t.scrollIntoView({block:`center`,inline:`nearest`}),j(o,e))})});var S=OLe();pZ(M(S),{class:`file-scroll`,viewportClass:`file-viewport`,type:`auto`,orientation:`both`,get viewportRef(){return I(a)},set viewportRef(e){j(a,e,!0)},children:(e,i)=>{var a=R(),o=N(a),c=e=>{var t=yLe();d1(M(t),{size:28,strokeWidth:1.7}),E(4),T(t),z(e,t)},p=e=>{var n=bLe(),r=M(n);O8(r,{class:`spin`,size:28,strokeWidth:1.7});var i=P(r,4),a=M(i,!0);T(i),T(n),F(()=>B(a,t.view.path)),z(e,n)},m=e=>{var n=xLe(),r=M(n);Vd(r,{size:28,strokeWidth:1.7});var i=P(r,4),a=M(i,!0);T(i),T(n),F(()=>B(a,t.view.error)),z(e,n)},v=e=>{var t=SLe(),n=M(t);T(t),F(()=>{W(n,`src`,I(g)),W(n,`alt`,I(s)?.relativePath??`File preview`)}),z(e,t)},y=e=>{var i=R(),a=N(i),o=e=>{var t=CLe(),n=M(t);{let e=k(()=>I(s).text??``);z3(n,{get text(){return I(e)},trimCodeBlocks:!1,get onCopy(){return ld}})}T(t),z(e,t)},c=e=>{var r=wLe();let i;Wi(r,()=>I(n),!0),T(r),F(()=>{i=ra(r,1,`code-view svelte-lvkzk0`,null,i,{"wrap-lines":t.view?.wrapLines}),aa(r,I(b))}),z(e,r)},p=e=>{var n=ELe();let r;var i=M(n);Ri(i,21,()=>I(_),Fi,(e,t,n)=>{let r=k(()=>I(u)+n);var i=TLe(),a=M(i,!0);T(i),F(()=>{ra(i,1,Zi(I(r)===I(d)?`code-line file-target-line`:`code-line`),`svelte-lvkzk0`),W(i,`data-file-line`,I(r)),B(a,I(t))}),z(e,i)}),T(i),T(n),F(()=>{r=ra(n,1,`code-view plain svelte-lvkzk0`,null,r,{"wrap-lines":t.view?.wrapLines}),aa(n,I(b))}),z(e,n)};V(a,e=>{I(l)&&I(f)===`rendered`?e(o):I(n)&&I(r)===I(h)?e(c,1):e(p,-1)}),z(e,i)},x=e=>{var t=DLe();d1(M(t),{size:28,strokeWidth:1.7}),E(4),T(t),z(e,t)};V(o,e=>{t.view?t.view.loading&&!I(s)?e(p,1):t.view.error?e(m,2):I(g)?e(v,3):I(s)?.type===`text`?e(y,4):e(x,-1):e(c)}),z(e,a)},$$slots:{default:!0}}),T(S),z(e,S),O()}var ALe={get activeCenterFileView(){let e=Y.activeCenterTab;if(e?.kind===`file`)return AT.fileViews[tE(e.id)]},get openFileTabs(){return AT.openFileTabIds}};function jLe(e,t){D(t,!0);let n=k(()=>ALe.activeCenterFileView);kLe(e,{get view(){return I(n)}}),O()}var MLe=new Set([`$$slots`,`$$events`,`$$legacy`]);function NLe(e,t){let n=G(t,MLe),r=[[`path`,{d:`M12.531 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14v6a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341l.427-.473`}],[`path`,{d:`m16.5 3.5 5 5`}],[`path`,{d:`m21.5 3.5-5 5`}]];uc(e,K({name:`funnel-x`},()=>n,{get iconNode(){return r}}))}var PLe=new Set([`$$slots`,`$$events`,`$$legacy`]);function FLe(e,t){let n=G(t,PLe),r=[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`}]];uc(e,K({name:`tag`},()=>n,{get iconNode(){return r}}))}var ILe=L(`<button type="button"><!> </button>`),LLe=L(`<button type="button"> </button>`),RLe=L(`<!>Clear`,1),G7=L(`<!> `,1),zLe=L(`<!>Copy`,1),BLe=L(`<button type="button" class="field-clear svelte-11qnnwt" aria-label="Clear search"><!></button>`),VLe=L(`<button type="button" class="field-clear svelte-11qnnwt" aria-label="Clear component filter"><!></button>`),HLe=L(`<div class="logs-error svelte-11qnnwt"> </div>`),ULe=L(`<div class="logs-notice svelte-11qnnwt"> </div>`),WLe=L(`<div class="empty svelte-11qnnwt">No application logs match these filters.</div>`),GLe=L(`<button type="button" class="caret svelte-11qnnwt"><!></button>`),KLe=L(`<span class="caret svelte-11qnnwt" aria-hidden="true"></span>`),qLe=L(`<span class="duration svelte-11qnnwt"> </span>`),JLe=L(`<code class="svelte-11qnnwt"> </code>`),YLe=L(`<div class="refs svelte-11qnnwt"></div>`),XLe=L(`<dt class="svelte-11qnnwt"> </dt> <dd class="svelte-11qnnwt"> </dd>`,1),ZLe=L(`<dl class="context svelte-11qnnwt"></dl>`),QLe=L(`<pre class="error-block svelte-11qnnwt"> </pre>`),$Le=L(`<div class="log-detail svelte-11qnnwt"><!> <!> <!></div>`),eRe=L(`<article><div class="log-line svelte-11qnnwt"><!> <span class="time svelte-11qnnwt"> </span> <span> </span> <span class="source svelte-11qnnwt"> </span> <span class="message svelte-11qnnwt"> </span> <!></div> <!></article>`),tRe=L(`<div class="logs-list svelte-11qnnwt" role="log" aria-label="Application logs"><!> <!></div>`),nRe=L(`<section class="logs-pane svelte-11qnnwt"><header class="logs-toolbar svelte-11qnnwt"><div class="toolbar-line svelte-11qnnwt"><div class="segmented svelte-11qnnwt" role="group" aria-label="Log level filter"></div> <span class="toolbar-divider svelte-11qnnwt" aria-hidden="true"></span> <div class="segmented svelte-11qnnwt" role="group" aria-label="Log source filter"></div> <div class="toolbar-actions svelte-11qnnwt"><span class="result-count svelte-11qnnwt"> </span> <!> <!> <!> <!></div></div> <div class="toolbar-line search-line svelte-11qnnwt"><label class="field search-field svelte-11qnnwt"><!> <!> <!></label> <label class="field component-field svelte-11qnnwt"><!> <!> <!></label></div></header> <!> <!> <!></section> <!>`,1);function rRe(e,t){D(t,!0);let n=[`all`,`debug`,`info`,`warn`,`error`],r=[`all`,`orchestrator`,`desktop`,`web`,`cli`],i=A(void 0),a=A(`all`),o=A(`all`),s=A(``),c=A(``),l=A(!1),u=A(!1),d=A(!1),f=A(void 0),p=A(void 0),m=new ko,h=k(()=>[...I(i)?.logs??[]].reverse()),g=k(()=>I(a)!==`all`||I(o)!==`all`||I(s).trim()!==``||I(c).trim()!==``),_=k(()=>I(g)?`This removes stored Nerve application logs matching the current filters. New request logs may appear immediately after pruning.`:`This removes stored Nerve application logs. New request logs may appear immediately after pruning.`);function v(e){return[e.requestId,e.projectId,e.conversationId,e.agentId,e.runId,e.toolCallId,e.taskId].filter(e=>!!e)}function y(e){return e.context?Object.entries(e.context).map(([e,t])=>[e,typeof t==`string`?t:JSON.stringify(t)]):[]}function b(e){return!!e.error||y(e).length>0||v(e).length>0}function x(e){m.has(e)?m.delete(e):m.add(e)}async function S(){j(l,!0),j(f,void 0);try{j(i,await bue({level:I(a)===`all`?void 0:I(a),source:I(o)===`all`?void 0:I(o),component:I(s).trim()||void 0,contains:I(c).trim()||void 0,limit:160}),!0)}catch(e){j(f,e instanceof Error?e.message:String(e),!0)}finally{j(l,!1)}}function ee(){j(a,`all`),j(o,`all`),j(s,``),j(c,``)}function C(){return{level:I(a)===`all`?void 0:I(a),source:I(o)===`all`?void 0:I(o),component:I(s).trim()||void 0,contains:I(c).trim()||void 0}}async function te(){j(u,!0),j(f,void 0),j(p,void 0);try{let e=await xue(C());m.clear(),j(p,`Pruned ${e.pruned} ${e.pruned===1?`log entry`:`log entries`}.`),await S()}catch(e){j(f,e instanceof Error?e.message:String(e),!0)}finally{j(u,!1)}}function ne(){bE(I(h).map(e=>`${e.ts} ${e.level.toUpperCase()} ${e.source}/${e.component} ${e.message}`).join(`
|
|
151
|
-
`)).catch(()=>void 0)}sr(()=>{S()});var re=nRe(),ie=N(re),ae=M(ie),oe=M(ae),w=M(oe);Ri(w,20,()=>n,e=>e,(e,t)=>{var n=ILe();let r;var i=M(n),o=e=>{{let n=k(()=>oT(t));lC(e,{size:`xs`,get tone(){return I(n)}})}};V(i,e=>{t!==`all`&&e(o)});var s=P(i);T(n),F(()=>{r=ra(n,1,`svelte-11qnnwt`,null,r,{active:I(a)===t}),B(s,` ${t??``}`)}),bi(`click`,n,()=>j(a,t,!0)),z(e,n)}),T(w);var se=P(w,4);Ri(se,20,()=>r,e=>e,(e,t)=>{var n=LLe();let r;var i=M(n,!0);T(n),F(()=>{r=ra(n,1,`svelte-11qnnwt`,null,r,{active:I(o)===t}),B(i,t)}),bi(`click`,n,()=>j(o,t,!0)),z(e,n)}),T(se);var ce=P(se,2),le=M(ce),de=M(le);T(le);var fe=P(le,2),pe=e=>{Ml(e,{size:`sm`,variant:`ghost`,onclick:ee,children:(e,t)=>{var n=RLe();NLe(N(n),{size:13}),E(),z(e,n)},$$slots:{default:!0}})};V(fe,e=>{I(g)&&e(pe)});var me=P(fe,2);{let e=k(()=>I(l)||I(u));Ml(me,{size:`sm`,variant:`secondary`,onclick:S,get disabled(){return I(e)},children:(e,t)=>{var n=G7(),r=N(n);{let e=k(()=>I(l)?`animate-spin`:``);O8(r,{size:13,get class(){return I(e)}})}var i=P(r,1,!0);F(()=>B(i,I(l)?`Loading`:`Refresh`)),z(e,n)},$$slots:{default:!0}})}var he=P(me,2);{let e=k(()=>I(h).length===0||I(u));Ml(he,{size:`sm`,variant:`ghost`,onclick:ne,get disabled(){return I(e)},children:(e,t)=>{var n=zLe();V3(N(n),{size:13}),E(),z(e,n)},$$slots:{default:!0}})}var ge=P(he,2);{let e=k(()=>I(l)||I(u));Ml(ge,{size:`sm`,variant:`destructive`,onclick:()=>j(d,!0),get disabled(){return I(e)},children:(e,t)=>{var n=G7(),r=N(n);GQ(r,{size:13});var i=P(r,1,!0);F(()=>B(i,I(u)?`Pruning`:`Prune`)),z(e,n)},$$slots:{default:!0}})}T(ce),T(oe);var _e=P(oe,2),ve=M(_e),ye=M(ve);cZ(ye,{size:13,"aria-hidden":`true`});var be=P(ye,2);DQ(be,{placeholder:`Search messages`,get value(){return I(c)},set value(e){j(c,e,!0)}});var xe=P(be,2),Se=e=>{var t=BLe();ZX(M(t),{size:12}),T(t),bi(`click`,t,()=>j(c,``)),z(e,t)};V(xe,e=>{I(c)&&e(Se)}),T(ve);var Ce=P(ve,2),we=M(Ce);FLe(we,{size:13,"aria-hidden":`true`});var Te=P(we,2);DQ(Te,{placeholder:`Component filter`,get value(){return I(s)},set value(e){j(s,e,!0)}});var Ee=P(Te,2),De=e=>{var t=VLe();ZX(M(t),{size:12}),T(t),bi(`click`,t,()=>j(s,``)),z(e,t)};V(Ee,e=>{I(s)&&e(De)}),T(Ce),T(_e),T(ae);var Oe=P(ae,2),ke=e=>{var t=HLe(),n=M(t,!0);T(t),F(()=>B(n,I(f))),z(e,t)};V(Oe,e=>{I(f)&&e(ke)});var Ae=P(Oe,2),je=e=>{var t=ULe(),n=M(t,!0);T(t),F(()=>B(n,I(p))),z(e,t)};V(Ae,e=>{I(p)&&e(je)}),pZ(P(Ae,2),{class:`logs-scroll`,type:`auto`,children:(e,t)=>{var n=tRe(),r=M(n),i=e=>{z(e,WLe())};V(r,e=>{I(h).length===0&&!I(l)&&e(i)}),Ri(P(r,2),17,()=>I(h),e=>e.id,(e,t)=>{let n=k(()=>b(I(t))),r=k(()=>m.has(I(t).id));var i=eRe();let a;var o=M(i),s=M(o),c=e=>{var n=GLe();Jw(M(n),{size:13}),T(n),F(()=>{W(n,`aria-expanded`,I(r)),W(n,`aria-label`,I(r)?`Collapse details`:`Expand details`)}),bi(`click`,n,()=>x(I(t).id)),z(e,n)},l=e=>{z(e,KLe())};V(s,e=>{I(n)?e(c):e(l,-1)});var u=P(s,2),d=M(u,!0);T(u);var f=P(u,2),p=M(f,!0);T(f);var h=P(f,2),g=M(h);T(h);var _=P(h,2),S=M(_,!0);T(_);var ee=P(_,2),C=e=>{var n=qLe(),r=M(n);T(n),F(()=>B(r,`${I(t).durationMs??``}ms`)),z(e,n)};V(ee,e=>{I(t).durationMs!==void 0&&e(C)}),T(o);var te=P(o,2),ne=e=>{var n=$Le(),r=M(n),i=e=>{var n=YLe();Ri(n,20,()=>v(I(t)),e=>e,(e,t)=>{var n=JLe(),r=M(n,!0);T(n),F(()=>B(r,t)),z(e,n)}),T(n),z(e,n)},a=k(()=>v(I(t)).length>0);V(r,e=>{I(a)&&e(i)});var o=P(r,2),s=e=>{var n=ZLe();Ri(n,21,()=>y(I(t)),([e,t])=>e,(e,t)=>{var n=k(()=>ue(I(t),2));let r=()=>I(n)[0],i=()=>I(n)[1];var a=XLe(),o=N(a),s=M(o,!0);T(o);var c=P(o,2),l=M(c,!0);T(c),F(()=>{B(s,r()),B(l,i())}),z(e,a)}),T(n),z(e,n)},c=k(()=>y(I(t)).length>0);V(o,e=>{I(c)&&e(s)});var l=P(o,2),u=e=>{var n=QLe(),r=M(n,!0);T(n),F(()=>B(r,I(t).error.stack??I(t).error.message)),z(e,n)};V(l,e=>{I(t).error&&e(u)}),T(n),z(e,n)};V(te,e=>{I(n)&&I(r)&&e(ne)}),T(i),F(e=>{a=ra(i,1,`log-row ${I(t).level}`,`svelte-11qnnwt`,a,{open:I(r)}),W(o,`data-detail`,I(n)?``:void 0),B(d,e),ra(f,1,`level ${I(t).level}`,`svelte-11qnnwt`),B(p,I(t).level),W(h,`title`,`${I(t).source}/${I(t).component}`),B(g,`${I(t).source??``}/${I(t).component??``}`),W(_,`title`,I(t).message),B(S,I(t).message)},[()=>E1(I(t).ts)]),z(e,i)}),T(n),z(e,n)},$$slots:{default:!0}}),T(ie);var Me=P(ie,2);{let e=k(()=>I(g)?`Prune filtered logs?`:`Prune all logs?`),t=k(()=>I(g)?`Prune filtered logs`:`Prune all logs`);SQ(Me,{get title(){return I(e)},get description(){return I(_)},get confirmLabel(){return I(t)},destructive:!0,onConfirm:()=>void te(),get open(){return I(d)},set open(e){j(d,e,!0)}})}F(()=>B(de,`${I(h).length??``} ${I(h).length===1?`entry`:`entries`}`)),z(e,re),O()}xi([`click`]);function iRe(e){rRe(e,{})}function K7(e){return e?.kind===`conversation`||e?.kind===`pending-conversation`}function q7(e){return`${e.kind}:${e.id}`}function J7(e,t){return!!(e&&t&&e.kind===t.kind&&e.id===t.id)}function aRe(e,t){return e.length===t.length&&e.every((e,n)=>J7(e,t[n]))}function oRe(e,t,n,r=4){let i=new Set(n.filter(K7).map(q7)),a=e.filter(e=>i.has(q7(e)));if(!K7(t))return a.slice(0,r);let o=q7(t);return i.has(o)?[t,...a.filter(e=>q7(e)!==o)].slice(0,r):a.slice(0,r)}function sRe(e,t,n=4){if(!K7(t))return e.slice(0,n);let r=q7(t);return e.some(e=>q7(e)===r)?e.slice(0,n):[t,...e].slice(0,n)}var cRe=L(`<div class="conversation-pane-layer svelte-1iptmh4"><!></div>`),lRe=L(`<!> <div class="center-workspace-content svelte-1iptmh4"><!> <!></div>`,1);function Y7(e,t){D(t,!0);let n=k(()=>R6.status),r=k(()=>R6.centerTabs),i=k(()=>R6.activeCenterTab),a=k(()=>Y.openCenterTabs),o=k(()=>K7(I(i))?I(i):void 0),s=A(In([])),c=k(()=>sRe(I(s),I(o)));sr(()=>{let e=oRe(I(s),I(i),I(a));aRe(I(s),e)||j(s,e,!0)});function l(e){e.kind===`conversation`?a6(e.id):e.kind===`pending-conversation`||e.kind===`task`?XT(e):e.kind===`file`?N6(e.id):e.kind===`pr`?S8(e.id):e.kind===`auth`?JZ():NZ()}function u(e){g5(h5(e),e)}function d(e){g5(xNe(e),e)}function f(e){g5(bNe(e),e)}var p=lRe(),m=N(p);{let e=k(()=>I(n)?.storage.home);vLe(m,{get tabs(){return I(r)},get homeDir(){return I(e)},onSelect:e=>void XT(e),onClose:e=>void ZT(e),onRefresh:l,onCloseOther:u,onCloseRight:d,onCloseLeft:f,get onToggleFileDisplayMode(){return YDe},get onToggleFileLineWrap(){return XDe},get onNewConversation(){return C6}})}var h=P(m,2),g=M(h),_=e=>{tje(e,{})},v=e=>{jLe(e,{})},y=e=>{LAe(e,{})},b=e=>{lNe(e,{})},x=e=>{Qfe(e,{})},S=e=>{iRe(e,{})};V(g,e=>{I(i)?.kind===`task`?e(_):I(i)?.kind===`file`?e(v,1):I(i)?.kind===`pr`?e(y,2):I(i)?.kind===`settings`?e(b,3):I(i)?.kind===`auth`?e(x,4):I(i)?.kind===`logs`&&e(S,5)});var ee=P(g,2),C=e=>{var t=R();Ri(N(t),17,()=>I(c),e=>q7(e),(e,t)=>{let n=k(()=>J7(I(o),I(t)));var r=cRe();m8(M(r),{get tab(){return I(t)},get active(){return I(n)}}),T(r),F(()=>W(r,`hidden`,!I(n))),z(e,r)}),z(e,t)},te=e=>{m8(e,{active:!0})};V(ee,e=>{I(c).length>0?e(C):I(i)||e(te,1)}),T(h),z(e,p),O()}var uRe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`]);function dRe(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`value`,15,``),i=G(t,uRe);var a=R(),o=N(a);{let e=k(()=>ul(`gap-2 group/tabs flex data-[orientation=horizontal]:flex-col`,t.class));U(o,()=>pS,(t,a)=>{a(t,K({"data-slot":`tabs`,get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)},get value(){return r()},set value(e){r(e)}}))})}z(e,a),O()}var fRe=Dl({base:`rounded-lg p-[3px] group-data-horizontal/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col`,variants:{variant:{default:`cn-tabs-list-variant-default bg-muted`,line:`cn-tabs-list-variant-line gap-1 bg-transparent`}},defaultVariants:{variant:`default`}}),pRe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`variant`,`class`]);function mRe(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=q(t,`variant`,3,`default`),i=G(t,pRe);var a=R(),o=N(a);{let e=k(()=>ul(fRe({variant:r()}),t.class));U(o,()=>gS,(t,a)=>{a(t,K({"data-slot":`tabs-list`,get"data-variant"(){return r()},get class(){return I(e)}},()=>i,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,a),O()}var hRe=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function gRe(e,t){D(t,!0);let n=q(t,`ref`,15,null),r=G(t,hRe);var i=R(),a=N(i);{let e=k(()=>ul(`gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground`,`after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,t.class));U(a,()=>yS,(t,i)=>{i(t,K({"data-slot":`tabs-trigger`,get class(){return I(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}z(e,i),O()}var _Re=L(`<!> <span class="sr-only"> </span>`,1),X7=L(`<span> </span>`),vRe=L(`<!> <!>`,1);function yRe(e,t){D(t,!0);let n=q(t,`tabs`,19,()=>[]),r=q(t,`value`,15,``);function i(e){let t=e.ariaLabel??e.label;return e.count?`${t} (${e.count})`:t}var a=R(),o=N(a);{let e=k(()=>ul(`tabs-bar-root min-w-0`,t.class));U(o,()=>dRe,(a,o)=>{o(a,{get class(){return I(e)},get onValueChange(){return t.onValueChange},get value(){return r()},set value(e){r(e)},children:(e,r)=>{var a=R();U(N(a),()=>mRe,(e,r)=>{r(e,{variant:`line`,get"aria-label"(){return t.ariaLabel},class:`tabs-bar-list w-full justify-start overflow-x-auto overflow-y-hidden`,children:(e,t)=>{var r=R();Ri(N(r),17,n,e=>e.value,(e,t)=>{var n=R(),r=N(n);{let e=k(()=>i(I(t))),n=k(()=>I(t).title??i(I(t))),a=k(()=>ul(`tabs-bar-trigger`,I(t).icon&&`tabs-bar-icon-trigger`));U(r,()=>gRe,(r,i)=>{i(r,{get value(){return I(t).value},get disabled(){return I(t).disabled},get"aria-label"(){return I(e)},get title(){return I(n)},get class(){return I(a)},children:(e,n)=>{var r=vRe(),i=N(r),a=e=>{let n=k(()=>I(t).icon);var r=_Re(),i=N(r);U(i,()=>I(n),(e,t)=>{t(e,{size:14,strokeWidth:2.2,"aria-hidden":`true`})});var a=P(i,2),o=M(a,!0);T(a),F(()=>B(o,I(t).label)),z(e,r)},o=e=>{var n=X7(),r=M(n,!0);T(n),F(()=>B(r,I(t).label)),z(e,n)};V(i,e=>{I(t).icon?e(a):e(o,-1)});var s=P(i,2),c=e=>{var n=X7(),r=M(n,!0);T(n),F(e=>{ra(n,1,e),B(r,I(t).count)},[()=>Zi(ul(`tabs-bar-count`,I(t).icon&&`tabs-bar-icon-count`))]),z(e,n)};V(s,e=>{I(t).count&&e(c)}),z(e,r)},$$slots:{default:!0}})})}z(e,n)}),z(e,r)},$$slots:{default:!0}})}),z(e,a)},$$slots:{default:!0}})})}z(e,a),O()}var bRe=L(`<aside class="utility-panel"><div class="utility-tabs"><!></div> <!></aside>`);function xRe(e,t){D(t,!0);let n=q(t,`activeTab`,15,`git`),r=q(t,`conversationAgents`,19,()=>[]),i=q(t,`tasks`,19,()=>[]),a=new Set([`starting`,`running`,`ready`,`stopping`]),o=k(()=>i().filter(e=>a.has(e.status)).length),s=k(()=>[{value:`git`,label:`Git`,icon:kd},{value:`tasks`,label:`Tasks`,icon:zd,count:I(o)},{value:`info`,label:`Context`,icon:O5}]);function c(e){n(e),t.onTabChange?.(n())}var l=bRe(),u=M(l);yRe(M(u),{get tabs(){return I(s)},ariaLabel:`Utility panel tabs`,onValueChange:c,get value(){return n()},set value(e){n(e)}}),T(u),pZ(P(u,2),{class:`utility-scroll`,viewportClass:`utility-content`,type:`auto`,children:(e,a)=>{var o=R(),s=N(o),c=e=>{wT(e,{get status(){return t.status},get activeProject(){return t.activeProject},get activeConversation(){return t.activeConversation},get activeAgent(){return t.activeAgent},get conversationAgents(){return r()},get exportUrl(){return t.exportUrl},get systemPromptUrl(){return t.systemPromptUrl},get onSelectAgent(){return t.onSelectAgent}})},l=e=>{rAe(e,{get activeProject(){return t.activeProject},get activeAgent(){return t.activeAgent}})},u=e=>{Pje(e,{get activeProject(){return t.activeProject},get tasks(){return i()},get selectedTask(){return t.selectedTask},get homeDir(){return t.homeDir},get onOpenTaskOutput(){return t.onOpenTaskOutput},get onCancelTask(){return t.onCancelTask},get onRestartTask(){return t.onRestartTask},get onRemoveTask(){return t.onRemoveTask},get onPruneTasks(){return t.onPruneTasks},get onRunCommand(){return t.onRunCommand}})};V(s,e=>{n()===`info`?e(c):n()===`git`?e(l,1):n()===`tasks`&&e(u,2)}),z(e,o)},$$slots:{default:!0}}),T(l),z(e,l),O()}function Z7(e,t){D(t,!0);let n=k(()=>R6.status),r=k(()=>R6.activeProject),i=k(()=>_8.activeConversation),a=k(()=>_8.activeAgent),o=k(()=>_8.conversationAgents),s=k(()=>q8.scopedTasks),c=k(()=>q8.selectedTask);function l(e){TT.agentId=e.id,TT.projectId=e.projectId,TT.conversationId=e.conversationId,AC.utilityTab=`info`}{let t=k(()=>I(n)?.storage.home);xRe(e,{get activeTab(){return AC.utilityTab},get status(){return I(n)},get activeProject(){return I(r)},get activeConversation(){return I(i)},get activeAgent(){return I(a)},get conversationAgents(){return I(o)},get tasks(){return I(s)},get selectedTask(){return I(c)},get homeDir(){return I(t)},get exportUrl(){return LDe},get systemPromptUrl(){return RDe},onTabChange:e=>AC.utilityTab=e,onSelectAgent:l,onOpenTaskOutput:e=>{AC.utilityTab=`tasks`,a5(e)},onCancelTask:e=>void J8(e),onRestartTask:e=>void Y8(e),onRemoveTask:e=>void ZAe(e),onPruneTasks:()=>void QAe(),onRunCommand:e=>{AC.utilityTab=`tasks`,(async()=>{await a5((await $Ae(e)).id)})()}})}O()}var SRe=L(`<button><!> <span class="conversation-label svelte-prx1kd"> </span></button>`),CRe=L(`<span class="tt-title"> </span> <span class="tt-row"><span class="tt-key">status</span> </span> <span class="tt-row"><span class="tt-key">mode</span> </span> <span class="tt-row"><span class="tt-key">model</span> </span> <span class="tt-row"><span class="tt-key">updated</span> </span> <span class="tt-id"> </span>`,1),wRe=L(`<!> <!>`,1);function Q7(e,t){D(t,!0);let n=q(t,`isOpen`,3,!1),r=q(t,`isActive`,3,!1),i=k(()=>t.row.agent?.status??`idle`),a=k(()=>t.activity??F6({conversationId:t.row.conversation.id,agent:t.row.agent,mode:t.row.agent?.mode??t.row.conversation.mode})),o=k(()=>t.row.agent?.mode??t.row.conversation.mode),s=k(()=>t.row.agent?.permissionLevel??t.row.conversation.permissionLevel);j$(e,{get items(){return t.menuItems},triggerClass:`conversation-context-trigger`,children:(e,c)=>{var l=R();U(N(l),()=>S1,(e,c)=>{c(e,{children:(e,c)=>{var l=wRe(),u=N(l);{let e=(e,i)=>{let o=()=>i?.().props;var s=SRe(),c=()=>t.onOpenConversation?.(t.row.conversation.id);Sa(s,()=>({...o(),type:`button`,class:`conversation-row`,"data-active":r(),title:t.row.conversation.title,onclick:c}),void 0,void 0,void 0,`svelte-prx1kd`);var l=M(s);{let e=k(()=>n()?`solid`:`outline`);lC(l,{class:`conversation-status`,get tone(){return I(a).tone},get pulse(){return I(a).pulse},get label(){return I(a).label},get variant(){return I(e)},size:`sm`})}var u=P(l,2),d=M(u,!0);T(u),T(s),F(()=>B(d,t.row.conversation.title)),z(e,s)};U(u,()=>T1,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}U(P(u,2),()=>C1,(e,n)=>{n(e,{side:`right`,sideOffset:6,class:`nav-tooltip conversation-tooltip`,children:(e,n)=>{var r=CRe(),a=N(r),c=M(a,!0);T(a);var l=P(a,2),u=P(M(l),1,!0);T(l);var d=P(l,2),f=P(M(d));T(d);var p=P(d,2),m=P(M(p),1,!0);T(p);var h=P(p,2),g=P(M(h),1,!0);T(h);var _=P(h,2),v=M(_,!0);T(_),F((e,n)=>{B(c,t.row.conversation.title),B(u,I(i)),B(f,`${I(o)??``} · ${I(s)??``}`),B(m,e),B(g,n),B(v,t.row.conversation.id)},[()=>wE(t.row.agent),()=>O1(t.row.conversation.updatedAt)]),z(e,r)},$$slots:{default:!0}})}),z(e,l)},$$slots:{default:!0}})}),z(e,l)},$$slots:{default:!0}}),O()}var TRe=L(`<p class="empty svelte-1m5r4e2">No conversations match.</p>`),ERe=L(`<div class="conversations-modal svelte-1m5r4e2"><div class="search-box svelte-1m5r4e2"><!> <!></div> <div class="list-region svelte-1m5r4e2"><!></div></div>`);function DRe(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`projectLabel`,3,``),i=q(t,`projectIds`,19,()=>[]),a=q(t,`conversations`,19,()=>[]),o=q(t,`agents`,19,()=>[]),s=q(t,`conversationActivityById`,19,()=>({})),c=A(``),l=A(null),u=k(()=>DE({conversations:a(),agents:o(),projectIds:i(),filter:I(c)}));sr(()=>{n()&&(j(c,``),queueMicrotask(()=>I(l)?.focus()))});function d(e){n(e),t.onOpenChange?.(e)}function f(e){t.onOpenConversation?.(e),d(!1)}{let i=k(()=>`${I(u).length} in ${r()}`);nZ(e,{title:`Conversations`,get description(){return I(i)},class:`project-conversations-dialog`,onOpenChange:d,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var r=R();U(N(r),()=>w1,(e,n)=>{n(e,{delayDuration:300,disableHoverableContent:!0,children:(e,n)=>{var r=ERe(),i=M(r),a=M(i);cZ(a,{size:13,strokeWidth:2.25,"aria-hidden":`true`}),DQ(P(a,2),{size:`sm`,placeholder:`Filter conversations`,ariaLabel:`Filter conversations`,get ref(){return I(l)},set ref(e){j(l,e,!0)},get value(){return I(c)},set value(e){j(c,e,!0)}}),T(i);var o=P(i,2),d=M(o),p=e=>{z(e,TRe())},m=e=>{O$(e,{get items(){return I(u)},getKey:e=>e.conversation.id,estimateSize:()=>32,viewportClass:`conversations-virtual-list`,row:(e,n)=>{let r=()=>n?.().item;{let n=k(()=>t.openConversationTabIds?.has(r().conversation.id)??!1),i=k(()=>r().conversation.id===t.selectedConversationId),a=k(()=>t.buildMenu?.(r().conversation)??[]);Q7(e,{get row(){return r()},get isOpen(){return I(n)},get isActive(){return I(i)},get activity(){return s()[r().conversation.id]},get menuItems(){return I(a)},onOpenConversation:f})}},$$slots:{row:!0}})};V(d,e=>{I(u).length===0?e(p):e(m,-1)}),T(o),T(r),z(e,r)},$$slots:{default:!0}})}),z(e,r)},$$slots:{default:!0}})}O()}var ORe=L(`<!> <!>`,1),kRe=L(`<div class="prune-body svelte-1bkj6xz"><!> <div class="prune-control svelte-1bkj6xz"><!></div> <p class="prune-summary svelte-1bkj6xz">Removes up to <strong class="svelte-1bkj6xz"> </strong> </p></div>`);function ARe(e,t){D(t,!0);let n=q(t,`open`,15,!1),r=q(t,`projectLabel`,3,``),i=q(t,`totalCount`,3,0),a=q(t,`ageEligible`,3,()=>0),o=q(t,`keepEligible`,3,()=>0),s=[{value:`olderThanDays`,label:`By age`,detail:`Remove conversations not updated within the selected window.`},{value:`keepLatest`,label:`By count`,detail:`Keep the most recent conversations and remove the rest.`}],c=[{value:`1`,label:`Older than 1 day`},{value:`2`,label:`Older than 2 days`},{value:`3`,label:`Older than 3 days`},{value:`7`,label:`Older than 7 days`},{value:`14`,label:`Older than 14 days`},{value:`30`,label:`Older than 30 days`},{value:`90`,label:`Older than 90 days`}],l=[{value:`5`,label:`Keep the latest 5`},{value:`10`,label:`Keep the latest 10`},{value:`20`,label:`Keep the latest 20`},{value:`50`,label:`Keep the latest 50`},{value:`100`,label:`Keep the latest 100`}],u=A(`olderThanDays`),d=A(`7`),f=A(`20`),p=k(()=>I(u)===`olderThanDays`?a()(Number(I(d))):o()(Number(I(f))));function m(){return I(u)===`olderThanDays`?{strategy:`olderThanDays`,olderThanDays:Number(I(d))}:{strategy:`keepLatest`,keepLatest:Number(I(f))}}function h(){t.onConfirm?.(m()),n(!1),t.onOpenChange?.(!1)}function g(e){n(e),t.onOpenChange?.(e)}{let t=e=>{var t=ORe(),n=N(t);Ml(n,{variant:`ghost`,onclick:()=>g(!1),children:(e,t)=>{E(),z(e,ki(`Cancel`))},$$slots:{default:!0}});var r=P(n,2);{let e=k(()=>I(p)===0);Ml(r,{variant:`destructive`,onclick:h,get disabled(){return I(e)},children:(e,t)=>{E(),z(e,ki(`Clean up`))},$$slots:{default:!0}})}z(e,t)},a=k(()=>r()?`Choose how to clean up conversations in “${r()}”.`:`Choose how to clean up conversations.`);nZ(e,{title:`Clean up conversations`,get description(){return I(a)},class:`prune-dialog`,onOpenChange:g,get open(){return n()},set open(e){n(e)},footer:t,children:(e,t)=>{var n=kRe(),r=M(n);l5(r,{get items(){return s},ariaLabel:`Cleanup strategy`,get value(){return I(u)},set value(e){j(u,e,!0)}});var a=P(r,2),o=M(a),m=e=>{YQ(e,{get items(){return c},ariaLabel:`Age window`,get value(){return I(d)},set value(e){j(d,e,!0)}})},h=e=>{YQ(e,{get items(){return l},ariaLabel:`Conversations to keep`,get value(){return I(f)},set value(e){j(f,e,!0)}})};V(o,e=>{I(u)===`olderThanDays`?e(m):e(h,-1)}),T(a);var g=P(a,2),_=P(M(g)),v=M(_,!0);T(_);var y=P(_);T(g),T(n),F(()=>{B(v,I(p)),B(y,` of ${i()??``} conversation${i()===1?``:`s`}. Active conversations and tasks are skipped.`)}),z(e,n)},$$slots:{footer:!0,default:!0}})}O()}var jRe=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
|
|
152
|
-
<path d="M0.228341 8.36915C0.228341 8.36915 -0.356212 7.94324 0.345251 7.37453L1.97956 5.89736C1.97956 5.89736 2.44721 5.40004 2.94164 5.83334L18.0231 17.375V22.9094C18.0231 22.9094 18.0158 23.7785 16.9124 23.6825L0.228341 8.36915Z" fill="currentColor" />
|
|
153
|
-
<path d="M4.11555 11.9367L0.228273 15.5089C0.228273 15.5089 -0.171172 15.8093 0.228273 16.346L2.03308 18.0053C2.03308 18.0053 2.46175 18.4706 3.09502 17.9413L7.21611 14.7827L4.11555 11.9367Z" fill="currentColor" />
|
|
154
|
-
<path d="M10.94 11.9661L18.0691 6.46362L18.0228 0.95865C18.0228 0.95865 17.7183 -0.242793 16.7027 0.382548L7.21589 9.11025L10.94 11.9661Z" fill="currentColor" />
|
|
155
|
-
<path d="M16.9121 23.69C17.3261 24.1183 17.8279 23.978 17.8279 23.978L23.3838 21.2108C24.0951 20.7208 23.9952 20.1127 23.9952 20.1127V3.58803C23.9952 2.86175 23.2596 2.61063 23.2596 2.61063L18.4441 0.264377C17.3919 -0.392968 16.7027 0.382548 16.7027 0.382548C16.7027 0.382548 17.5892 -0.262484 18.0228 0.95865L18.0228 22.8086C18.0228 22.9588 17.9911 23.1065 17.9278 23.2394C17.8011 23.4979 17.5259 23.7392 16.8658 23.6383L16.9121 23.69Z" fill="currentColor" />
|
|
156
|
-
</svg>
|
|
157
|
-
`;function MRe(e,t){D(t,!1);let n=jRe.replace(`<svg `,`<svg class="size-3.5" `);ja();var r=R();Wi(N(r),()=>n),z(e,r),O()}var NRe=`<svg viewBox="0 0 90 90" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
|
|
158
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.4375 5.625C6.8842 5.625 5.625 6.8842 5.625 8.4375V70.3125H0V8.4375C0 3.7776 3.7776 0 8.4375 0H83.7925C87.551 0 89.4333 4.5442 86.7756 7.20186L40.3642 53.6133H53.4375V47.8125H59.0625V55.0195C59.0625 57.3495 57.1737 59.2383 54.8438 59.2383H34.7392L25.0712 68.9062H68.9062V33.75H74.5312V68.9062C74.5312 72.0128 72.0128 74.5312 68.9062 74.5312H19.4462L9.60248 84.375H81.5625C83.1158 84.375 84.375 83.1158 84.375 81.5625V19.6875H90V81.5625C90 86.2224 86.2224 90 81.5625 90H6.20749C2.44898 90 0.566723 85.4558 3.22438 82.7981L49.46 36.5625H36.5625V42.1875H30.9375V35.1562C30.9375 32.8263 32.8263 30.9375 35.1562 30.9375H55.085L64.9288 21.0938H21.0938V56.25H15.4688V21.0938C15.4688 17.9871 17.9871 15.4688 21.0938 15.4688H70.5538L80.3975 5.625H8.4375Z" fill="currentColor" />
|
|
159
|
-
</svg>
|
|
160
|
-
`;function PRe(e,t){D(t,!1);let n=NRe.replace(`<svg `,`<svg class="size-3.5" `);ja();var r=R();Wi(N(r),()=>n),z(e,r),O()}function $7(e,t){return e.filter(e=>e.projectId===t).length}function FRe(e,t,n){let r=Date.now()-n*24*60*60*1e3;return e.filter(e=>{let n=Date.parse(e.updatedAt);return e.projectId===t&&Number.isFinite(n)&&n<r}).length}function IRe(e,t,n){return Math.max(0,$7(e,t)-n)}async function e9(e,t){try{await bE(e),cd.success(`Copied ${t}`)}catch{cd.error(`Could not copy to clipboard`)}}function LRe(e,t){let n=[];return t.editorAvailability?.vscode.available&&n.push({label:`Open in VS Code`,icon:MRe,onSelect:()=>t.onOpenProjectInEditor?.(e.id,`vscode`)}),t.editorAvailability?.zed.available&&n.push({label:`Open in Zed`,icon:PRe,onSelect:()=>t.onOpenProjectInEditor?.(e.id,`zed`)}),n}function RRe(e,t){let n=LRe(e,t),r=[{label:`New chat`,icon:ZZ,shortcut:t.newConversationShortcut,onSelect:()=>t.onNewConversationInProject?.(e.dir)}];return n.length>0&&r.push({type:`separator`},...n),r.push({type:`separator`},{label:`Copy path`,icon:V3,onSelect:()=>void e9(e.dir,`path`)},{label:`Clean up`,icon:GQ,destructive:!0,disabled:t.conversationCount(e.id)===0,onSelect:()=>t.requestPrune(e)},{label:`Remove project`,icon:GQ,destructive:!0,onSelect:()=>t.requestDelete({kind:`project`,id:e.id,label:CE(e.dir,t.homeDir)})}),r}function t9(e,t,n){return[{label:`Open conversation`,icon:B3,onSelect:()=>n.onOpenConversation?.(t.id)},{label:`New chat`,icon:ZZ,shortcut:n.newConversationShortcut,onSelect:()=>n.onNewConversationInProject?.(e.dir)},{type:`separator`},{label:`Copy conversation id`,icon:V3,onSelect:()=>void e9(t.id,`conversation id`)},{label:`Delete conversation`,icon:GQ,destructive:!0,onSelect:()=>n.requestDelete({kind:`conversation`,id:t.id,label:t.title})}]}var zRe=L(`<p class="empty svelte-r5acf5">No projects yet.</p>`),BRe=L(`<span class="project-count svelte-r5acf5"> </span>`),VRe=L(`<p class="empty child svelte-r5acf5">No conversations.</p>`),HRe=L(`<button type="button" class="more-button svelte-r5acf5"> </button>`),URe=L(`<div class="conversation-list svelte-r5acf5"><!> <!> <!></div>`),WRe=L(`<p class="empty svelte-r5acf5"> </p>`),GRe=L(`<div class="tree-list svelte-r5acf5"><!> <!> <!></div>`),KRe=L(`<aside class="project-tree svelte-r5acf5"><div class="search-box svelte-r5acf5"><!> <!></div> <!></aside>`),qRe=L(`<!> <!> <!> <!>`,1);function JRe(e,t){D(t,!0);let n=q(t,`projects`,19,()=>[]),r=q(t,`conversations`,19,()=>[]),i=q(t,`agents`,19,()=>[]),a=q(t,`conversationActivityById`,19,()=>({})),o=q(t,`searchFocusToken`,3,0),s=A(``),c=A(null),l=0,u=In({}),d=A(void 0),f=A(void 0),p=A(void 0),m=g$(`projectSearch.focus`),h=_$(`projectSearch.focus`),g=g$(`conversation.new`);sr(()=>{o()!==l&&(l=o(),I(c)?.focus(),I(c)?.select())});function _(e){j(d,e,!0)}let v=k(()=>({homeDir:t.homeDir,newConversationShortcut:g,editorAvailability:t.editorAvailability,conversationCount:e=>$7(r(),e),onOpenConversation:t.onOpenConversation,onNewConversationInProject:t.onNewConversationInProject,onOpenProjectInEditor:t.onOpenProjectInEditor,requestPrune:y,requestDelete:_}));function y(e){j(f,{id:e.id,label:CE(e.dir,t.homeDir)},!0)}function b(){I(d)&&(I(d).kind===`project`?t.onDeleteProject?.(I(d).id):t.onDeleteConversation?.(I(d).id))}function x(e){I(f)&&t.onPruneProjectConversations?.(I(f).id,e)}let S=k(()=>OE({projects:n(),conversations:r(),agents:i(),filter:I(s),homeDir:t.homeDir})),ee=k(()=>I(S).groups),C=k(()=>I(S).hiddenProjects);var te=qRe(),ne=N(te);U(ne,()=>w1,(e,n)=>{n(e,{delayDuration:300,disableHoverableContent:!0,children:(e,n)=>{var r=KRe(),i=M(r),o=M(i);cZ(o,{size:13,strokeWidth:2.25,"aria-hidden":`true`});var l=P(o,2);{let e=k(()=>m?`Search projects / conversations (${m})`:`Search projects / conversations`);DQ(l,{size:`sm`,placeholder:`Search projects / conversations`,ariaLabel:`Search projects or conversations`,get"aria-keyshortcuts"(){return h},get title(){return I(e)},get ref(){return I(c)},set ref(e){j(c,e,!0)},get value(){return I(s)},set value(e){j(s,e,!0)}})}T(i),pZ(P(i,2),{class:`tree-scroll`,viewportClass:`tree-viewport`,type:`auto`,children:(e,n)=>{var r=GRe(),i=M(r),o=e=>{z(e,zRe())};V(i,e=>{I(ee).length===0&&e(o)});var s=P(i,2);Ri(s,17,()=>I(ee),e=>e.key,(e,n)=>{{let r=k(()=>RRe(I(n).project,I(v)));j$(e,{get items(){return I(r)},triggerClass:`project-context-trigger`,children:(e,r)=>{{let r=e=>{var t=R(),r=N(t),i=e=>{var t=BRe(),r=M(t,!0);T(t),F(()=>B(r,I(n).totalRows)),z(e,t)};V(r,e=>{I(n).totalRows>0&&e(i)}),z(e,t)},i=e=>{Ml(e,{size:`icon-xs`,variant:`ghost`,title:`New chat in project`,ariaLabel:`New chat`,onclick:()=>t.onNewConversationInProject?.(I(n).project.dir),children:(e,t)=>{ZZ(e,{})},$$slots:{default:!0}})},o=k(()=>!u[I(n).key]);dT(e,{get title(){return I(n).label},get icon(){return v$},get open(){return I(o)},onOpenChange:e=>u[I(n).key]=!e,meta:r,actions:i,children:(e,r)=>{var i=URe(),o=M(i),s=e=>{z(e,VRe())};V(o,e=>{I(n).rows.length===0&&e(s)});var c=P(o,2);Ri(c,17,()=>I(n).rows,e=>e.conversation.id,(e,r)=>{{let i=k(()=>t.openConversationTabIds?.has(I(r).conversation.id)??!1),o=k(()=>I(r).conversation.id===t.selectedConversationId),s=k(()=>t9(I(n).project,I(r).conversation,I(v)));Q7(e,{get row(){return I(r)},get isOpen(){return I(i)},get isActive(){return I(o)},get activity(){return a()[I(r).conversation.id]},get menuItems(){return I(s)},get onOpenConversation(){return t.onOpenConversation}})}});var l=P(c,2),u=e=>{var t=HRe(),r=M(t);T(t),F(()=>B(r,`+${I(n).hiddenRows??``} more`)),bi(`click`,t,()=>j(p,I(n),!0)),z(e,t)};V(l,e=>{I(n).hiddenRows>0&&e(u)}),T(i),z(e,i)},$$slots:{meta:!0,actions:!0,default:!0}})}},$$slots:{default:!0}})}});var c=P(s,2),l=e=>{var t=WRe(),n=M(t);T(t),F(()=>B(n,`+${I(C)??``} more projects`)),z(e,t)};V(c,e=>{I(C)>0&&e(l)}),T(r),z(e,r)},$$slots:{default:!0}}),T(r),z(e,r)},$$slots:{default:!0}})});var re=P(ne,2);{let e=k(()=>!!I(d)),t=k(()=>I(d)?.kind===`project`?`Remove project?`:`Delete conversation?`),n=k(()=>I(d)?I(d).kind===`project`?`This removes “${I(d).label}” from Nerve and deletes its Nerve conversations. Files on disk are not deleted.`:`This permanently removes “${I(d).label}”.`:``),r=k(()=>I(d)?.kind===`project`?`Remove`:`Delete`);SQ(re,{get open(){return I(e)},get title(){return I(t)},get description(){return I(n)},get confirmLabel(){return I(r)},destructive:!0,onConfirm:b,onOpenChange:e=>{e||j(d,void 0)}})}var ie=P(re,2),ae=e=>{{let n=k(()=>!!I(p)),o=k(()=>I(p).projects.map(e=>e.id));DRe(e,{get open(){return I(n)},get projectLabel(){return I(p).label},get project(){return I(p).project},get projectIds(){return I(o)},get conversations(){return r()},get agents(){return i()},get selectedConversationId(){return t.selectedConversationId},get openConversationTabIds(){return t.openConversationTabIds},get conversationActivityById(){return a()},get onOpenConversation(){return t.onOpenConversation},buildMenu:e=>I(p)?t9(I(p).project,e,I(v)):[],onOpenChange:e=>{e||j(p,void 0)}})}};V(ie,e=>{I(p)&&e(ae)});var oe=P(ie,2);{let e=k(()=>!!I(f)),t=k(()=>I(f)?.label??``),n=k(()=>I(f)?$7(r(),I(f).id):0);ARe(oe,{get open(){return I(e)},get projectLabel(){return I(t)},get totalCount(){return I(n)},ageEligible:e=>I(f)?FRe(r(),I(f).id,e):0,keepEligible:e=>I(f)?IRe(r(),I(f).id,e):0,onConfirm:x,onOpenChange:e=>{e||j(f,void 0)}})}z(e,te),O()}xi([`click`]);var n9=In({searchFocusToken:0});function YRe(){n9.searchFocusToken+=1}function r9(e,t){D(t,!0);let n=k(()=>R6.status),r=k(()=>R6.projects),i=k(()=>R6.conversations),a=k(()=>R6.agents),o=k(()=>R6.openConversationTabIds),s=k(()=>_8.conversationActivityById);{let t=k(()=>I(n)?.storage.home),c=k(()=>I(n)?.runtime.editors);JRe(e,{get projects(){return I(r)},get conversations(){return I(i)},get agents(){return I(a)},get homeDir(){return I(t)},get selectedProjectId(){return TT.projectId},get selectedConversationId(){return TT.conversationId},get openConversationTabIds(){return I(o)},get conversationActivityById(){return I(s)},get searchFocusToken(){return n9.searchFocusToken},get editorAvailability(){return I(c)},get onOpenConversation(){return o6},get onNewConversationInProject(){return w6},onOpenProjectInEditor:(e,t)=>void VDe(e,t),onDeleteProject:e=>void T6(e),onDeleteConversation:e=>void BDe(e),onPruneProjectConversations:(e,t)=>void HDe(e,t)})}O()}var XRe=L(`<!> <div class="pane-shell navigator-pane"><!></div>`,1),ZRe=L(`<!> <div class="pane-shell utility-shell"><!></div>`,1),QRe=L(`<div class="workspace-shell compact"><div class="pane-shell center-shell"><!></div></div> <!> <!>`,1),$Re=L(`<div class="pane-shell navigator-pane"><!></div>`),i9=L(`<!> <!>`,1),eze=L(`<div class="pane-shell center-shell"><!></div>`),tze=L(`<div class="pane-shell utility-shell"><!></div>`),nze=L(`<!> <!> <!>`,1),rze=L(`<div class="workspace-shell"><!></div>`);function ize(e,t){D(t,!0);let n=k(()=>cw.isCompact),r=k(()=>R6.activeCenterTab),i;sr(()=>{let e=I(r)?`${I(r).kind}:${I(r).id}`:void 0;e!==i&&(i=e,AC.navDrawerOpen&&qC())}),sr(()=>{!I(n)&&(AC.navDrawerOpen||AC.utilityDrawerOpen)&&qC()});var a=R(),o=N(a),s=e=>{var t=QRe(),n=N(t),r=M(n);Y7(M(r),{}),T(r),T(n);var i=P(n,2);U(i,()=>P7,(e,t)=>{t(e,{get open(){return AC.navDrawerOpen},get onOpenChange(){return UC},children:(e,t)=>{var n=R();U(N(n),()=>F7,(e,t)=>{t(e,{side:`left`,class:`sheet-pane`,children:(e,t)=>{var n=XRe(),r=N(n);U(r,()=>I7,(e,t)=>{t(e,{class:`sr-only`,children:(e,t)=>{E(),z(e,ki(`Project navigator`))},$$slots:{default:!0}})});var i=P(r,2);r9(M(i),{}),T(i),z(e,n)},$$slots:{default:!0}})}),z(e,n)},$$slots:{default:!0}})}),U(P(i,2),()=>P7,(e,t)=>{t(e,{get open(){return AC.utilityDrawerOpen},get onOpenChange(){return WC},children:(e,t)=>{var n=R();U(N(n),()=>F7,(e,t)=>{t(e,{side:`right`,class:`sheet-pane`,children:(e,t)=>{var n=ZRe(),r=N(n);U(r,()=>I7,(e,t)=>{t(e,{class:`sr-only`,children:(e,t)=>{E(),z(e,ki(`Utility panel`))},$$slots:{default:!0}})});var i=P(r,2);Z7(M(i),{}),T(i),z(e,n)},$$slots:{default:!0}})}),z(e,n)},$$slots:{default:!0}})}),z(e,t)},c=e=>{var t=rze();JIe(M(t),{direction:`horizontal`,autoSaveId:`nerve.workspace.v3`,keyboardResizeBy:8,children:(e,t)=>{var n=nze(),r=N(n),i=e=>{var t=i9(),n=N(t);M7(n,{defaultSize:19,minSize:14,maxSize:32,order:1,children:(e,t)=>{var n=$Re();r9(M(n),{}),T(n),z(e,n)},$$slots:{default:!0}}),N7(P(n,2),{"aria-label":`Resize agents panel`}),z(e,t)};V(r,e=>{AC.sidebarCollapsed||e(i)});var a=P(r,2);M7(a,{defaultSize:57,minSize:38,order:2,children:(e,t)=>{var n=eze();Y7(M(n),{}),T(n),z(e,n)},$$slots:{default:!0}});var o=P(a,2),s=e=>{var t=i9(),n=N(t);N7(n,{"aria-label":`Resize utility panel`}),M7(P(n,2),{defaultSize:24,minSize:19,maxSize:40,order:3,children:(e,t)=>{var n=tze();Z7(M(n),{}),T(n),z(e,n)},$$slots:{default:!0}}),z(e,t)};V(o,e=>{AC.utilityCollapsed||e(s)}),z(e,n)},$$slots:{default:!0}}),T(t),z(e,t)};V(o,e=>{I(n)?e(s):e(c,-1)}),z(e,a),O()}var aze=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="nerve-mark-title">
|
|
161
|
-
<title id="nerve-mark-title">Nerve</title>
|
|
162
|
-
<path d="M4 5v14" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" />
|
|
163
|
-
<path d="M4 5l6 7-6 7" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" />
|
|
164
|
-
<path d="M14 5l6 7-6 7" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" />
|
|
165
|
-
<circle cx="20" cy="12" r="1.125" fill="currentColor" />
|
|
166
|
-
</svg>
|
|
167
|
-
`,oze=L(`<!> <span class="project-button-label svelte-16e3b57">Open Project</span>`,1),sze=L(`<span class="window-divider svelte-16e3b57" aria-hidden="true"></span> <!> <!> <!>`,1),cze=L(`<!> <!> <!> <!>`,1),lze=L(`<header><div class="title-left svelte-16e3b57"><span class="brand svelte-16e3b57"><span class="brand-mark svelte-16e3b57" aria-hidden="true"></span></span> <span class="divider svelte-16e3b57" aria-hidden="true"></span> <!></div> <!></header>`);function uze(e,t){D(t,!0);let n=q(t,`desktop`,3,!1),r=q(t,`maximized`,3,!1),i=q(t,`closeToTray`,3,!0),a=q(t,`quitting`,3,!1),o=q(t,`settingsActive`,3,!1),s=q(t,`authActive`,3,!1),c=q(t,`logsActive`,3,!1);var l=lze();let u;var d=M(l),f=M(d),p=M(f);Wi(p,()=>aze,!0),T(p),T(f);var m=P(f,4);{let e=k(()=>t.activeProject?.dir??`Open a project`);Ml(m,{variant:`ghost`,size:`sm`,class:`project-button`,ariaLabel:`Open project`,get title(){return I(e)},onclick:()=>t.onOpenProject?.(),children:(e,t)=>{var n=oze();v$(N(n),{size:14,strokeWidth:2.1,"aria-hidden":`true`}),E(2),z(e,n)},$$slots:{default:!0}})}T(d),U(P(d,2),()=>zS,(e,l)=>{l(e,{class:`title-actions`,"aria-label":`Application actions`,children:(e,l)=>{var u=cze(),d=N(u);Ml(d,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Open Nerve logs`,title:`Open Nerve logs`,get active(){return c()},get pressed(){return c()},onclick:()=>t.onOpenLogs?.(),children:(e,t)=>{R7(e,{size:16,strokeWidth:2.1})},$$slots:{default:!0}});var f=P(d,2);Ml(f,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Open authentication`,title:`Providers & authentication`,get active(){return s()},get pressed(){return s()},onclick:()=>t.onOpenAuth?.(),children:(e,t)=>{qX(e,{size:16,strokeWidth:2.1})},$$slots:{default:!0}});var p=P(f,2);Ml(p,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Open settings`,title:`Open settings`,get active(){return o()},get pressed(){return o()},onclick:()=>t.onOpenSettings?.(),children:(e,t)=>{z7(e,{size:16,strokeWidth:2.1})},$$slots:{default:!0}});var m=P(p,2),h=e=>{var n=sze(),o=P(N(n),2);Ml(o,{variant:`ghost`,size:`icon-sm`,class:`window-control`,ariaLabel:`Minimize window`,title:`Minimize`,get disabled(){return a()},onclick:()=>t.onMinimize?.(),children:(e,t)=>{h1(e,{size:16,strokeWidth:2.1})},$$slots:{default:!0}});var s=P(o,2);{let e=k(()=>r()?`Restore window`:`Maximize window`),n=k(()=>r()?`Restore`:`Maximize`);Ml(s,{variant:`ghost`,size:`icon-sm`,class:`window-control`,get ariaLabel(){return I(e)},get title(){return I(n)},get disabled(){return a()},onclick:()=>t.onToggleMaximize?.(),children:(e,t)=>{var n=R(),i=N(n),a=e=>{V3(e,{size:15,strokeWidth:2.1})},o=e=>{sD(e,{size:14,strokeWidth:2.1})};V(i,e=>{r()?e(a):e(o,-1)}),z(e,n)},$$slots:{default:!0}})}var c=P(s,2);{let e=k(()=>a()?`Closing Nerve`:i()?`Close window to tray`:`Close Nerve`),n=k(()=>a()?`Closing Nerve…`:i()?`Close to tray`:`Close Nerve`);Ml(c,{variant:`ghost`,size:`icon-sm`,class:`window-control close-control`,get ariaLabel(){return I(e)},get title(){return I(n)},get disabled(){return a()},onclick:()=>t.onClose?.(),children:(e,t)=>{var n=R(),r=N(n),i=e=>{tD(e,{class:`animate-spin`,size:16,strokeWidth:2.1})},o=e=>{ZX(e,{size:16,strokeWidth:2.1})};V(r,e=>{a()?e(i):e(o,-1)}),z(e,n)},$$slots:{default:!0}})}z(e,n)};V(m,e=>{n()&&e(h)}),z(e,u)},$$slots:{default:!0}})}),T(l),F(()=>u=ra(l,1,`titlebar svelte-16e3b57`,null,u,{desktop:n()})),z(e,l),O()}function dze(e,t){D(t,!0);let n=k(()=>R6.activeProject),r=k(()=>R6.activeCenterTab),i=k(()=>f5.settingsDraft),a=k(()=>Zu.quitting||Td.quitRequested);function o(){Y.projectPickerOpen=!0}async function s(){let e=I(i)?.desktop.closeToTray??!0;e||(Td.quitRequested=!0,Zu.quitting=!0);try{await rd({closeToTray:e})}catch(t){e||(Td.quitRequested=!1,Zu.quitting=!1),Y.error=t instanceof Error?t.message:String(t)}}{let t=k(()=>I(i)?.desktop.closeToTray??!0),c=k(()=>I(r)?.kind===`settings`),l=k(()=>I(r)?.kind===`auth`),u=k(()=>I(r)?.kind===`logs`);uze(e,{get activeProject(){return I(n)},get desktop(){return Zu.isDesktop},get maximized(){return Zu.windowState.maximized},get closeToTray(){return I(t)},get quitting(){return I(a)},get settingsActive(){return I(c)},get authActive(){return I(l)},get logsActive(){return I(u)},onOpenProject:o,onOpenLogs:()=>fNe(),onOpenAuth:()=>GZ(),onOpenSettings:()=>void kZ(),onMinimize:()=>void td(),onToggleMaximize:()=>void nd(),onClose:()=>void s()})}O()}var fze=L(`<main class="app-frame svelte-1huiqxf"><!> <!> <!> <!> <!></main> <!>`,1);function pze(e){var t=fze(),n=N(t),r=M(n);dze(r,{});var i=P(r,2);ize(i,{});var a=P(i,2);SNe(a,{});var o=P(a,2);wd(o,{}),Dd(P(o,2),{}),T(n),jFe(P(n,2),{}),z(e,t)}var mze=32e3;function a9(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function o9(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function s9(e){return TT.conversationId===e}function c9(e){return Y.openCenterTabs.some(t=>t.kind===`conversation`&&t.id===e)}function l9(e){return{runId:e,messages:[],toolDrafts:[],toolOutputByToolCallId:{}}}function u9(e,t){return!t||e.live.runId===t||!e.live.runId?(e.live={...e.live,runId:t||e.live.runId},e.live):(e.live=l9(t),e.live)}function d9(e){return typeof e.liveMessageId==`string`?e.liveMessageId:String(e.runId??`unknown`)}function f9(e){return`live:${d9(e)}:${String(e.kind??`text`)}:${Number(e.contentIndex??0)}`}function hze(e){return`live:run-status:${e||`active`}`}function p9(e,t){e.transcript=e.transcript.filter(e=>e.runStatus?.state===`retrying`?!!(t&&e.runStatus.runId!==t):!0)}function gze(e){let t=e.text;t.length>32e3&&(t=t.slice(t.length-mze));let n=e.chunks.length>400?e.chunks.slice(e.chunks.length-400):e.chunks;return{...e,text:t,chunks:n}}function m9(e){if(!e||typeof e!=`object`)return;let t=e,n={estimated:typeof t.estimated==`boolean`?t.estimated:!0};return typeof t.path==`string`&&(n.path=t.path),n.lineCount=o9(t.lineCount),n.operationCount=o9(t.operationCount),n.generatedLineCount=o9(t.generatedLineCount),n.estimatedAdditions=o9(t.estimatedAdditions),n.estimatedDeletions=o9(t.estimatedDeletions),n}function h9(e){return`live:${d9(e)}:tool-draft:${Number(e.contentIndex??0)}`}function g9(e){s9(e.conversationId)&&(Y.error=e.error)}function _ze(e,t){if(e.activeEntryIds.indexOf(t.id)!==-1)return!0;let n=e.activeEntryId??e.activeEntryIds.at(-1);return n?t.parentEntryId===n:e.activeEntryIds.length===0&&!t.parentEntryId}function vze(e,t){let n=e.activeEntryIds.indexOf(t.id);n===-1?e.activeEntryIds=[...e.activeEntryIds,t.id]:e.activeEntryIds=e.activeEntryIds.slice(0,n+1),e.activeEntryId=t.id}function yze(e,t){Y.conversations=Y.conversations.map(n=>n.id===e?{...n,activeEntryId:t,updatedAt:new Date().toISOString()}:n)}function bze(e,t){if(e.treeNodes.find(e=>e.entry.id===t.id)){e.treeNodes=e.treeNodes.map(e=>e.entry.id===t.id?{...e,entry:t}:e);return}e.treeNodes=[...e.treeNodes.map(e=>t.parentEntryId&&e.entry.id===t.parentEntryId?{...e,childEntryIds:Array.from(new Set([...e.childEntryIds,t.id]))}:e),{entry:t,childEntryIds:[]}]}function xze(e){return e===`manual`||e===`threshold`||e===`overflow`?e:void 0}function Sze(e){return`live:compaction:${String(e.data?.runId??e.data?.conversationId??`active`)}:${String(e.data?.reason??`manual`)}`}function _9(e,t,n){return{id:n?.id??Sze(e),state:t,reason:xze(e.data?.reason)??n?.reason,conversationId:a9(e.data?.conversationId),agentId:a9(e.data?.agentId),runId:a9(e.data?.runId),contextWindow:o9(e.data?.contextWindow)??n?.contextWindow,contextTokens:o9(e.data?.contextTokens)??n?.contextTokens,thresholdTokens:o9(e.data?.thresholdTokens)??n?.thresholdTokens,triggerReserveTokens:o9(e.data?.triggerReserveTokens)??n?.triggerReserveTokens,keepRecentTokens:o9(e.data?.keepRecentTokens)??n?.keepRecentTokens,failedEntryId:a9(e.data?.failedEntryId)??n?.failedEntryId,errorMessage:t===`failed`?a9(e.data?.message)??n?.errorMessage:n?.errorMessage,createdAt:a9(e.data?.startedAt)??n?.createdAt??e.ts}}function Cze(e,t){let n=kT.conversationViews[$T(e)];n&&(t.seq<=n.cursorSeq||(n.cursorSeq=t.seq,n.live.compaction=void 0,n.error=void 0,g9(n)))}function wze(e,t){let n=u9(e,a9(t.data?.runId)),r=_9(t,`running`,n.compaction);n.compaction=r,r.failedEntryId&&(n.hiddenEntryIds=Array.from(new Set([...n.hiddenEntryIds??[],r.failedEntryId]))),e.error=void 0}function Tze(e,t){let n=u9(e,a9(t.data?.runId)),r=_9(t,`failed`,n.compaction);n.compaction=r,r.failedEntryId&&(n.hiddenEntryIds=(n.hiddenEntryIds??[]).filter(e=>e!==r.failedEntryId))}var v9=new Map,Eze=1e3;function y9(e){let t=v9.get(e);t&&(clearTimeout(t),v9.delete(e))}function Dze(e){if(!c9(e))return;y9(e);let t=setTimeout(()=>{v9.delete(e),b9(e)},Eze);v9.set(e,t)}async function b9(e){if(!c9(e))return;let t=await Bw(e).catch(()=>void 0),n=kT.conversationViews[$T(e)];!t||!n||(n.contextUsage=t)}function Oze(e,t,n){return e.filter(e=>e.key!==t&&(!n||e.providerToolCallId!==n))}function x9(e){return e&&typeof e==`object`?e:void 0}function kze(e){let t=x9(e.details);if(t?.type!==`inline_command_result`)return new Set;let n=typeof t.command==`string`?t.command.trim():``;return n?new Set([`!${n}`,`! ${n}`]):new Set}function Aze(e){let t=x9(e.details),n=x9(t?.details);for(let e of[t?.toolCall,n?.toolCall]){let t=hle.safeParse(e);if(t.success)return t.data}}function jze(e,t){if(!t)return!0;if(!_ze(e,t))return!1;vze(e,t),bze(e,t),yze(e.conversationId,t.id),s9(e.conversationId)&&(TT.entryId=t.id),t.kind===`run_status`&&p9(e,t.runId);let n=i6(t),r=new Set(n.map(e=>e.id).filter(Boolean)),i=kze(t);if(e.transcript=[...e.transcript.filter(e=>!e.id||!r.has(e.id)),...n].filter((e,n,r)=>e.optimistic?t.role===`user`&&e.role===`user`||e.role===`user`&&i.has(e.text.trim())?!1:!r.some(t=>!t.optimistic&&t.role===e.role&&t.text===e.text):!0),S9(e,Aze(t)),t.role===`assistant`&&t.liveMessageId){let n=`live:${t.liveMessageId}:`;e.live.messages=e.live.messages.filter(e=>!e.id?.startsWith(n)),e.live.toolDrafts=e.live.toolDrafts.filter(e=>!e.key.startsWith(n)),e.streamingText=Q3(e.live)}return!0}function S9(e,t){if(!t)return;if(t.hidden){e.toolCalls=e.toolCalls.filter(e=>e.id!==t.id);return}e.toolCalls=e.toolCalls.findIndex(e=>e.id===t.id)===-1?[...e.toolCalls,t]:e.toolCalls.map(e=>e.id===t.id?t:e);let n=t.providerToolCallId??t.sourceToolCallId;n&&(e.live.toolDrafts=e.live.toolDrafts.filter(e=>e.providerToolCallId!==n))}function C9(e,t){let n=e.live.messages.findIndex(e=>e.id===t.id);e.live.messages=n===-1?[...e.live.messages,t]:e.live.messages.map(e=>e.id===t.id?t:e)}function Mze(e,t){let n=typeof t.data?.delta==`string`?t.data.delta:``;if(!n)return;u9(e,typeof t.data?.runId==`string`?t.data.runId:void 0);let r=f9(t.data),i=e.live.messages.find(e=>e.id===r),a=Number(t.data?.offset??i?.text.length??0);if(!(i&&i.text.length>a)){if(i&&i.text.length<a){a6(e.conversationId);return}C9(e,{id:r,role:`assistant`,displayKind:(t.data?.kind===`thinking`?`thinking`:`text`)==`thinking`?`thinking`:`message`,text:`${i?.text??``}${n}`,createdAt:i?.createdAt??new Date().toISOString(),contentIndex:Number(t.data?.contentIndex??0),live:!0,done:!1,redacted:i?.redacted}),e.streamingText=Q3(e.live),e.sending=!0}}function Nze(e,t){u9(e,typeof t.data?.runId==`string`?t.data.runId:void 0);let n=f9(t.data),r=e.live.messages.find(e=>e.id===n),i=t.data?.kind===`thinking`?`thinking`:`text`;C9(e,{id:n,role:`assistant`,displayKind:i===`thinking`?`thinking`:`message`,text:typeof t.data?.finalText==`string`?t.data.finalText:r?.text??``,createdAt:r?.createdAt??new Date().toISOString(),contentIndex:Number(t.data?.contentIndex??0),live:!1,done:!0,redacted:i===`thinking`?!!t.data?.redacted:void 0}),e.streamingText=Q3(e.live)}function w9(e,t,n){let r=h9(t.data),i=e.live.toolDrafts.find(e=>e.key===r),a={kind:`tool_call_draft`,key:r,runId:typeof t.data?.runId==`string`?t.data.runId:i?.runId,conversationId:e.conversationId,contentIndex:Number(t.data?.contentIndex??i?.contentIndex??0),providerToolCallId:typeof t.data?.providerToolCallId==`string`?t.data.providerToolCallId:i?.providerToolCallId,toolName:typeof t.data?.toolName==`string`?t.data.toolName:i?.toolName,argsText:typeof n.argsText==`string`?n.argsText:i?.argsText??``,args:n.args??i?.args,progress:m9(n.progress)??i?.progress,done:typeof n.done==`boolean`?n.done:i?.done,createdAt:i?.createdAt??new Date().toISOString(),updatedAt:new Date().toISOString()};e.live.toolDrafts=i?e.live.toolDrafts.map(e=>e.key===r?a:e):[...e.live.toolDrafts,a]}function Pze(e,t){u9(e,typeof t.data?.runId==`string`?t.data.runId:void 0),w9(e,t,{})}function Fze(e,t){u9(e,typeof t.data?.runId==`string`?t.data.runId:void 0);let n=h9(t.data),r=e.live.toolDrafts.find(e=>e.key===n),i=typeof t.data?.delta==`string`?t.data.delta:``,a=Number(t.data?.offset??r?.argsText.length??0);if(!(r&&r.argsText.length>a)){if(r&&r.argsText.length<a){a6(e.conversationId);return}w9(e,t,{argsText:`${r?.argsText??``}${i}`})}}function Ize(e,t){u9(e,typeof t.data?.runId==`string`?t.data.runId:void 0),w9(e,t,{args:t.data?.args&&typeof t.data.args==`object`?t.data.args:void 0,done:!0})}function Lze(e,t){u9(e,typeof t.data?.runId==`string`?t.data.runId:void 0);let n=h9(t.data),r=typeof t.data?.providerToolCallId==`string`?t.data.providerToolCallId:void 0;e.live.toolDrafts=Oze(e.live.toolDrafts,n,r)}function Rze(e,t){u9(e,typeof t.data?.runId==`string`?t.data.runId:void 0);let n=m9(t.data?.progress);n&&w9(e,t,{progress:n})}function zze(e,t){let n=t.data?.toolCallId,r=t.data?.delta,i=t.data?.stream;if(typeof n!=`string`||typeof r!=`string`||r.length===0||i!==`stdout`&&i!==`stderr`&&i!==`combined`)return;u9(e,typeof t.data?.runId==`string`?t.data.runId:void 0);let a=e.live.toolOutputByToolCallId[n],o=Number(t.data?.offset??a?.text.length??0);if(a&&a.text.length>o)return;if(a&&a.text.length<o){a6(e.conversationId);return}let s=new Date().toISOString(),c=gze({chunks:[...a?.chunks??[],{stream:i,text:r,ts:s}],text:`${a?.text??``}${r}`,updatedAt:s});e.live.toolOutputByToolCallId={...e.live.toolOutputByToolCallId,[n]:c}}function Bze(e,t){let n=String(t.data?.runId??``),r=u9(e,n),i={attempt:o9(t.data?.attempt)??0,maxRetries:o9(t.data?.maxRetries)??0,delayMs:o9(t.data?.delayMs)??0,retryAt:a9(t.data?.retryAt)??new Date().toISOString(),errorMessage:a9(t.data?.errorMessage),failedEntryId:a9(t.data?.failedEntryId)},a={conversationId:a9(t.data?.conversationId),agentId:a9(t.data?.agentId),runId:n,state:`retrying`,...i};r.runStatus=a,i.failedEntryId&&(r.hiddenEntryIds=Array.from(new Set([...r.hiddenEntryIds??[],i.failedEntryId]))),p9(e,n),e.transcript=[...e.transcript,{id:hze(n),role:`system`,kind:`run_status`,displayKind:`message`,text:`Retrying model request…`,live:!0,createdAt:t.ts,runStatus:a}],e.activeRun&&e.activeRun.runId===n&&(e.activeRun={...e.activeRun,status:`retrying`,retry:i}),e.sending=!0,e.error=void 0}function Vze(e){return e===`conversation.entry.appended`||e===`conversation.compaction.started`||e===`conversation.compaction.failed`||e===`conversation.context.updated`||e===`conversation.tool_call.updated`||e.startsWith(`conversation.prompt.`)||e.startsWith(`conversation.run.`)||e.startsWith(`conversation.live.`)}function T9(e){let t=e.data?.conversationId;if(typeof t==`string`)return t;let n=e.data?.entry;if(typeof n?.conversationId==`string`)return n.conversationId;let r=e.data?.toolCall;if(typeof r?.conversationId==`string`)return r.conversationId}function Hze(e){let t=T9(e);if(!t||!c9(t))return;let n=sA(t);if(!(e.seq<=n.cursorSeq)){switch(n.cursorSeq=e.seq,e.type){case`conversation.run.started`:n.sending=!0,n.queuedPrompts=[],n.error=void 0;break;case`conversation.entry.appended`:jze(n,e.data?.entry)||a6(t),Dze(t);break;case`conversation.context.updated`:y9(t),n.contextUsage=e.data?.contextUsage??n.contextUsage;break;case`conversation.prompt.queued`:Uze(n,e.data?.queuedPrompt);break;case`conversation.prompt.dequeued`:case`conversation.prompt.cancelled`:Wze(n,e.data?.queuedPrompt);break;case`conversation.tool_call.updated`:S9(n,e.data?.toolCall);break;case`conversation.run.retrying`:Bze(n,e);break;case`conversation.compaction.started`:wze(n,e);break;case`conversation.compaction.failed`:Tze(n,e);break;case`conversation.live.message.started`:u9(n,String(e.data?.runId??``)),n.live.runStatus=void 0,p9(n,String(e.data?.runId??``)),n.sending=!0;break;case`conversation.live.content.delta`:Mze(n,e);break;case`conversation.live.content.done`:Nze(n,e);break;case`conversation.live.tool_draft.started`:Pze(n,e);break;case`conversation.live.tool_draft.delta`:Fze(n,e);break;case`conversation.live.tool_draft.done`:Ize(n,e);break;case`conversation.live.tool_draft.discarded`:Lze(n,e);break;case`conversation.live.tool_draft.progress`:Rze(n,e);break;case`conversation.live.tool_output.delta`:zze(n,e);break;case`conversation.run.completed`:p9(n,String(e.data?.runId??``)),n.sending=!1,n.streamingText=``,n.live=l9(),n.activeRun=void 0,n.queuedPrompts=[],n.error=void 0,a6(t).then(()=>{TT.conversationId===t&&o6(t)}),s9(t)&&G8(a9(e.data?.projectId));break;case`conversation.run.failed`:{p9(n,String(e.data?.runId??``));let t=n.live.compaction?.state===`failed`?n.live.compaction:void 0;n.sending=!1,n.streamingText=``,n.live={...l9(),compaction:t},n.activeRun=void 0,n.queuedPrompts=[],n.error=e.data?.aborted?void 0:String(e.data?.message??`Agent error`);break}case`conversation.run.suspended`:p9(n,String(e.data?.runId??``)),n.sending=!1,n.streamingText=``,n.live=l9(),n.activeRun=void 0,n.queuedPrompts=[],n.error=void 0;break}g9(n)}}function Uze(e,t){t&&(e.queuedPrompts=e.queuedPrompts.findIndex(e=>e.id===t.id)===-1?[...e.queuedPrompts,t]:e.queuedPrompts.map(e=>e.id===t.id?t:e))}function Wze(e,t){t&&(e.queuedPrompts=e.queuedPrompts.filter(e=>e.id!==t.id))}function Gze(){return n$(Kze)}function Kze(e){if(Vze(e.type)){Hze(e);return}if(e.type===`conversation.compacted`||e.type===`conversation.navigated`){let t=T9(e);t&&c9(t)&&(e.type===`conversation.compacted`&&Cze(t,e),a6(t))}if(e.type===`agent.configured`){let t=e.data?.agent;typeof t?.conversationId==`string`&&b9(t.conversationId)}}function qze(e,t){switch(e.type){case`approval.requested`:return Jze(e,t);case`user_question.requested`:return Yze(e,t);case`plan_review.requested`:return Xze(e,t);case`conversation.run.completed`:return Zze(e,t);case`conversation.run.failed`:return Qze(e,t);case`conversation.run.suspended`:return;default:return}}function Jze(e,t){let n=k9(e.data?.approval),r=k9(e.data?.toolCall),i=A9(r?.toolName),a=A9(n?.risk)??A9(r?.risk),o=A9(n?.reason);return{backgroundOnly:!1,kind:`error`,tag:j9(`approval`,A9(n?.id)),payload:{title:i?`Approval needed: ${i}`:`Approval needed`,body:O9([a?`Risk: ${a}`:void 0,o??`An agent is waiting for tool approval.`,E9(e,t)]),urgency:`attention`}}}function Yze(e,t){let n=k9(e.data?.question),r=A9(n?.question),i=A9(n?.context),a=A9(n?.recommendation);return{backgroundOnly:!1,kind:`error`,tag:j9(`question`,A9(n?.id)),payload:{title:`Nerve needs your answer`,body:O9([r??`An agent asked a question.`,i?`Context: ${i}`:void 0,a?`Recommendation: ${a}`:void 0,E9(e,t)]),urgency:`attention`}}}function Xze(e,t){let n=k9(e.data?.planReview),r=A9(n?.title),i=A9(n?.summary),a=A9(n?.planPath);return{backgroundOnly:!1,kind:`error`,tag:j9(`plan-review`,A9(n?.id)),payload:{title:r?`Plan ready: ${r}`:`Plan ready for review`,body:O9([r,i??`An agent submitted a plan for review.`,a?`Plan: ${a}`:void 0,E9(e,t)]),urgency:`attention`}}}function Zze(e,t){return{backgroundOnly:!0,kind:`success`,tag:j9(`run-completed`,A9(e.data?.runId)),payload:{title:`Agent run completed`,body:O9([E9(e,t)])??`Nerve finished a run.`,urgency:`normal`}}}function Qze(e,t){if(e.data?.aborted===!0)return;let n=k9(e.data?.retryExhausted);if(n){let r=nBe(n.maxRetries),i=A9(n.errorMessage)??A9(e.data?.message);return{backgroundOnly:!1,kind:`error`,tag:j9(`run-retry-exhausted`,A9(e.data?.runId)),payload:{title:`Model request needs retry`,body:O9([r===void 0?`Model request failed after retries. Open Nerve and click Continue.`:`Model request failed after ${r} ${r===1?`retry`:`retries`}. Open Nerve and click Continue.`,i,E9(e,t)]),urgency:`attention`}}}return{backgroundOnly:!0,kind:`error`,tag:j9(`run-failed`,A9(e.data?.runId)),payload:{title:`Agent run failed`,body:O9([A9(e.data?.message)??`Nerve hit an agent error.`,E9(e,t)]),urgency:`attention`}}}function E9(e,t){return O9([$ze(e,t),eBe(e,t)])}function $ze(e,t){let n=D9(e,`conversationId`);if(!n)return;let r=t.conversations.find(e=>e.id===n)?.title;return r?`Chat: ${r}`:void 0}function eBe(e,t){let n=D9(e,`projectId`);if(!n)return;let r=t.projects.find(e=>e.id===n);if(r)return`Project: ${r.name||r.dir}`}function D9(e,t){let n=A9(e.data?.[t]);if(n)return n;for(let n of[`approval`,`question`,`planReview`,`toolCall`]){let r=A9(k9(e.data?.[n])?.[t]);if(r)return r}}function O9(e){let t=e.filter(Boolean).join(` · `);return t?tBe(t):void 0}function tBe(e){let t=e.replace(/\s+/g,` `).trim();return t.length<=220?t:`${t.slice(0,219)}…`}function k9(e){return e&&typeof e==`object`?e:void 0}function A9(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function nBe(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function j9(e,t){return t?`nerve:${e}:${t}`:void 0}var M9;function rBe(){return M9||(M9=n$(iBe),()=>{M9?.(),M9=void 0})}function iBe(e){if(!aBe(e))return;let t=qze(e,{projects:Y.projects,conversations:Y.conversations});t&&pd(t.payload,{backgroundOnly:t.backgroundOnly,kind:t.kind,tag:t.tag})}function aBe(e){let t=Date.parse(e.ts);return Number.isFinite(t)&&Date.now()-t<6e4}function N9(e){return e&&typeof e==`object`?e:void 0}function P9(e){return typeof e==`string`?e:void 0}function oBe(e){let t=N9(e);return!!(t&&typeof t.id==`string`&&typeof t.updatedAt==`string`)}function sBe(e){let t=N9(e);return!!(t&&typeof t.id==`string`&&typeof t.projectId==`string`&&typeof t.updatedAt==`string`)}function cBe(e){let t=N9(e);return!!(t&&typeof t.id==`string`&&typeof t.conversationId==`string`&&typeof t.status==`string`)}function lBe(e){let t=N9(e);return!!(t&&typeof t.id==`string`&&typeof t.conversationId==`string`&&typeof t.status==`string`&&typeof t.updatedAt==`string`)}function uBe(e){let t=N9(e);return!!(t&&typeof t.id==`string`&&typeof t.conversationId==`string`&&typeof t.status==`string`&&typeof t.updatedAt==`string`)}function dBe(e){let t=N9(e);return!!(t&&typeof t.id==`string`)}function fBe(e){Y.conversations=Y.conversations.findIndex(t=>t.id===e.id)===-1?[e,...Y.conversations]:Y.conversations.map(t=>t.id===e.id?e:t)}function pBe(e){Y.conversations=Y.conversations.filter(t=>t.id!==e)}function F9(e){Y.agents=PDe(e,Y.agents)}function I9(e,t,n){if(!e)return;let r=Y.agents.find(t=>t.id===e);!r||r.updatedAt>n||F9({...r,status:t,updatedAt:n})}function mBe(e){if(e.status!==`pending`){hBe(e.id);return}Y.approvals=Y.approvals.findIndex(t=>t.id===e.id)===-1?[e,...Y.approvals]:Y.approvals.map(t=>t.id===e.id?{...t,...e}:t)}function hBe(e){Y.approvals=Y.approvals.filter(t=>t.id!==e)}function gBe(e){if(e.status!==`pending`){_Be(e.id);return}Y.userQuestions=Y.userQuestions.findIndex(t=>t.id===e.id)===-1?[e,...Y.userQuestions]:Y.userQuestions.map(t=>t.id===e.id?e:t)}function _Be(e){Y.userQuestions=Y.userQuestions.filter(t=>t.id!==e)}function vBe(e){if(e.status!==`pending`){yBe(e.id);return}Y.planReviews=Y.planReviews.findIndex(t=>t.id===e.id)===-1?[e,...Y.planReviews]:Y.planReviews.map(t=>t.id===e.id?e:t)}function yBe(e){Y.planReviews=Y.planReviews.filter(t=>t.id!==e)}function bBe(e){Y.planReviews=Y.planReviews.filter(t=>t.agentId!==e)}function xBe(e){let t=e.data??{},n=N9(t.agent),r=N9(t.conversation),i=N9(t.approval),a=N9(t.question),o=N9(t.planReview);if(sBe(r)&&fBe(r),e.type===`conversation.deleted`){let e=P9(t.conversationId)??P9(t.id);e&&pBe(e)}if(oBe(n)&&F9(n),cBe(i)){let e=dBe(t.toolCall)?t.toolCall:void 0;mBe({...i,toolCall:e})}if(lBe(a)&&gBe(a),uBe(o)&&vBe(o),e.type===`plan_review.force_exited`){let e=P9(t.agentId);e&&bBe(e)}}var SBe=150,L9;function CBe(){return n$(wBe)}function wBe(e){if(xBe(e),kBe(e),DBe(e.type)){let t=OBe(e.data?.agent);t&&F9(t)}ABe(e.type)&&TBe()}function TBe(){L9&&clearTimeout(L9),L9=setTimeout(()=>{L9=void 0,X3.invalidateQueries({queryKey:Z3.workspace}),S6()},SBe)}function EBe(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function DBe(e){return e===`agent.created`||e===`agent.configured`||e===`agent.mode_changed`||e===`agent.status_changed`}function OBe(e){if(!e||typeof e!=`object`)return;let t=e;return typeof t.id==`string`&&typeof t.updatedAt==`string`?t:void 0}function kBe(e){let t=EBe(e.data?.agentId);switch(e.type){case`conversation.run.started`:I9(t,`running`,e.ts);break;case`conversation.run.suspended`:I9(t,`awaiting_user`,e.ts);break;case`conversation.run.completed`:I9(t,`idle`,e.ts);break;case`conversation.run.failed`:I9(t,e.data?.aborted?`aborted`:`error`,e.ts);break}}function ABe(e){return e===`conversation.created`||e===`conversation.updated`||e===`conversation.deleted`||e===`conversation.compacted`||e===`conversation.branch_summarized`||e===`conversation.navigated`||e===`project.deleted`||e===`agent.created`||e===`agent.configured`||e===`agent.status_changed`||e.startsWith(`agent.subagent_`)||e.startsWith(`agent.explore_`)||e===`project.created`||e.startsWith(`approval.`)||e.startsWith(`user_question.`)||e.startsWith(`plan_review.`)||e===`plan.written`||e===`agent.mode_changed`||e===`conversation.tool_call.updated`||e===`conversation.run.started`||e===`conversation.run.completed`||e===`conversation.run.failed`||e===`conversation.run.suspended`||e.startsWith(`task.`)||R9(e)}function R9(e){return e.startsWith(`settings.`)||e.startsWith(`secrets.`)||e.startsWith(`auth.`)||e.startsWith(`providers.`)}function jBe(){return n$(MBe)}function MBe(e){R9(e.type)&&!(e.type.startsWith(`settings.`)&&RZ())&&NZ()}function NBe(e,t){if(t.visibility===`foreground`)return e.filter(e=>e.id!==t.id);let n=e.findIndex(e=>e.id===t.id);return n<0?[t,...e]:e.map((e,r)=>r===n?t:e)}function PBe(){let e=[t$(`task.log`,IBe),t$(`task.removed`,FBe),t$(`task.created`,z9),t$(`task.started`,z9),t$(`task.ready`,z9),t$(`task.ready_timeout`,z9),t$(`task.promoted`,z9),t$(`task.completed`,z9),t$(`task.failed`,z9),t$(`task.cancelled`,z9),t$(`task.orphaned`,z9),t$(`task.orphan_cleanup_succeeded`,z9)];return()=>{for(let t of e.splice(0))t()}}function z9(e){let t=e.data?.task;t?.id&&(PT.tasks=NBe(PT.tasks,t))}function FBe(e){let t=String(e.data?.taskId??``);t&&(PT.tasks=PT.tasks.filter(e=>e.id!==t),PT.selectedTaskId===t&&(PT.selectedTaskId=void 0,PT.taskLogs=void 0))}function IBe(e){z9(e);let t=String(e.data?.taskId??``),n=Y.activeCenterTab?.kind===`task`&&Y.activeCenterTab.id===t;t&&t===PT.selectedTaskId&&n&&Qk(t).then(e=>{PT.taskLogs=e})}function LBe(){return t$(`usage.subscription.updated`,RBe)}function RBe(e){let t=e.data;t?.provider&&(SZ.subscriptionUsage={...SZ.subscriptionUsage,[t.provider]:t})}function zBe(){let e=[CBe(),Gze(),PBe(),jBe(),npe(),LBe(),rBe()];return()=>{for(let t of e.splice(0))t()}}function BBe(e){function t(t){return!(t.metaKey||t.ctrlKey)||t.altKey?!1:t.key===`=`||t.key===`+`?(t.preventDefault(),e.setUiZoomLevel(e.currentZoomLevel()+1),!0):t.key===`-`||t.key===`_`?(t.preventDefault(),e.setUiZoomLevel(e.currentZoomLevel()-1),!0):t.key===`0`?(t.preventDefault(),e.setUiZoomLevel(0),!0):!1}function n(e){return e.kind===`settings`?{kind:`settings`,id:`settings`}:e.kind===`logs`?{kind:`logs`,id:`logs`}:{kind:e.kind,id:e.id}}function r(){let t=e.activeCenterTab();return t?e.centerTabs().findIndex(e=>e.kind===t.kind&&e.id===t.id):-1}function i(t){let i=e.centerTabs();if(i.length===0)return!1;let a=r(),o=((a===-1?0:a)+t+i.length)%i.length;return e.selectCenterTab(n(i[o])),!0}function a(t){let r=e.centerTabs()[t];return r?(e.selectCenterTab(n(r)),!0):!1}function o(){if(!e.hasConversationComposer())return!1;let t=[`read_only`,`supervised`,`autonomous`],n=t[(t.indexOf(e.selectedPermissionLevel())+1)%t.length]??t[0];return e.setComposerPermission(n),!0}function s(){if(!e.hasConversationComposer())return!1;let t=e.usableModels().find(t=>`${t.provider}:${t.modelId}`===e.selectedModelKey()),n=t?.supportedThinkingLevels?.length?t.supportedThinkingLevels:[`off`],r=n[(n.indexOf(e.selectedThinkingLevel())+1)%n.length]??n[0]??`off`;return e.setComposerThinkingLevel(r),!0}function c(){return e.hasConversationComposer()?(e.setComposerMode(e.selectedMode()===`coding`?`planning`:`coding`),!0):!1}function l(t){if(t.startsWith(`pane.focusByIndex.`)){let e=Number(t.split(`.`).at(-1))-1;return Number.isInteger(e)&&a(e)}let n=e.activeCenterTab();switch(t){case`conversation.new`:return e.newConversation(),!0;case`conversation.newFromProject`:return e.openProjectPicker(),!0;case`pane.close`:return n?(e.closeCenterTab(n),!0):!1;case`pane.closeOthers`:return n?(e.closeCenterTabs(e.centerTabsExcept(n),n),!0):!1;case`pane.refresh`:return n?(e.refreshCenterTab(n),!0):!1;case`pane.previous`:return i(-1);case`pane.next`:return i(1);case`projectSearch.focus`:return e.focusProjectSearch(),!0;case`composer.focus`:case`composer.cancelMic`:return e.hasConversationComposer()?(e.composerEscape(),!0):!1;case`composer.stopRun`:return!e.sending()&&!e.live()?!1:(e.abortActiveRun(),!0);case`composer.toggleMic`:return e.hasConversationComposer()?(e.toggleMic(),!0):!1;case`composer.toggleMode`:return c();case`composer.cyclePermission`:return o();case`composer.cycleThinking`:return s();case`zoom.in`:case`zoom.out`:case`zoom.reset`:case`composer.send`:return!1}return!1}function u(e){if(t(e))return;let n=m$.find(t=>Kpe(e,t.defaultBinding));n&&(Gpe(e.target)&&!n.allowInEditable||l(n.id)&&n.id!==`composer.focus`&&n.id!==`composer.cancelMic`&&e.preventDefault())}return{activeCenterTabIndex:r,centerTabIdentity:n,cyclePermissionLevel:o,cycleThinkingLevel:s,handleWorkbenchShortcut:u,handleZoomShortcut:t,selectCenterTabByIndex:a,selectRelativeCenterTab:i,toggleComposerModeShortcut:c}}var B9,V9,H9=0,U9=!1,W9=0,G9,K9,q9=0,VBe=1e4,HBe=15e3,UBe=7e4,WBe=[250,500,1e3,1500,2500,4e3,5e3];async function GBe(){U9=!1;try{vw(),PC(JC()),Y.config=await KBe(`load client config`,Jk),Y.status=Y.config.status,Y.error=void 0,ET.projectDir=Y.config.status.storage.home,await Promise.all([S6(),IDe()]),await gDe(),await NZ(),QBe(),yw(`info`,`workbench`,`Workbench initialized`),Z9(Y.config.wsUrl)}catch(e){Y.error=e instanceof Error?e.message:String(e),Y.connection=`error`,yw(`error`,`workbench`,`Workbench initialization failed`,{error:e})}}async function KBe(e,t){for(let[n,r]of WBe.entries())try{return await t()}catch(t){if(U9)throw t;Y.connection=`connecting`,Y.error=`Waiting for Nerve daemon to start (${JBe(t)})`,yw(`warn`,`workbench`,`Workbench initialization retrying`,{context:{label:e,attempt:n+1,delayMs:r},error:t}),await qBe(r)}return await t()}function qBe(e){return new Promise(t=>setTimeout(t,e))}function JBe(e){return e instanceof Error?e.message:String(e)}function YBe(e){if(globalThis.location?.protocol===`http:`||globalThis.location?.protocol===`https:`){let e=new URL(`/ws`,globalThis.location.href);return e.protocol=globalThis.location.protocol===`https:`?`wss:`:`ws:`,e}return new URL(e)}function J9(){V9!==void 0&&(clearTimeout(V9),V9=void 0)}function XBe(e){if(U9)return;J9();let t=Math.min(500*2**H9,5e3);H9+=1,Y.connection=`connecting`,V9=setTimeout(()=>{V9=void 0,U9||Z9(e)},t)}function ZBe(){Y9(),K9=setInterval(()=>{U9||Date.now()-q9<UBe||(yw(`warn`,`websocket`,`WebSocket liveness timeout; reconnecting`),B9?.close())},HBe)}function Y9(){K9!==void 0&&(clearInterval(K9),K9=void 0)}function QBe(){X9(),G9=setInterval(()=>{MZ().catch(()=>void 0)},VBe)}function X9(){G9!==void 0&&(clearInterval(G9),G9=void 0)}function $Be(e){e.seq&&e.seq<=Y.lastEventSeq||(e.seq&&(Y.lastEventSeq=e.seq),tpe(e))}function Z9(e){J9();let t=W9+1;W9=t,B9?.close();let n=YBe(e);Y.lastEventSeq>0&&n.searchParams.set(`since`,String(Y.lastEventSeq));let r=new WebSocket(n);B9=r,Y.connection=`connecting`,r.addEventListener(`open`,()=>{t===W9&&(H9=0,Y.connection=`live`,q9=Date.now(),ZBe(),yw(`info`,`websocket`,`WebSocket connected`,{context:{since:Y.lastEventSeq}}))}),r.addEventListener(`message`,e=>{if(t!==W9)return;q9=Date.now();let n=JSON.parse(String(e.data));n.type!==`heartbeat`&&n.type&&$Be(n)}),r.addEventListener(`close`,()=>{if(t===W9){if(B9=void 0,U9){Y.connection=`closed`;return}a$(),yw(`warn`,`websocket`,`WebSocket closed; reconnect scheduled`),XBe(e)}}),r.addEventListener(`error`,()=>{t===W9&&(Y.connection=`error`,yw(`error`,`websocket`,`WebSocket error`))})}function eVe(){U9=!0,J9(),X9(),Y9(),W9+=1,B9?.close(),B9=void 0,a$(),Y.connection=`closed`}function tVe(e,t){D(t,!0);let n=k(()=>R6.activeProject),r=k(()=>_8.activeConversation),i=k(()=>R6.activeCenterTab),a=k(()=>R6.centerTabs),o=k(()=>_8.live),s=k(()=>_8.pendingConversationActive),c=k(()=>_8.selectedMode),l=k(()=>_8.selectedModelKey),u=k(()=>_8.selectedPermissionLevel),d=k(()=>_8.selectedThinkingLevel),f=k(()=>_8.sending),p=k(()=>f5.settingsDraft),m=k(()=>_8.usableModels),h=k(()=>I(p)?.ui.zoomLevel??NC.level);function g(){Y.projectPickerOpen=!0}function _(){AC.sidebarCollapsed&&BC(!1),YRe()}function v(e){e.kind===`conversation`?a6(e.id):e.kind===`pending-conversation`||e.kind===`task`?XT(e):e.kind===`file`?N6(e.id):e.kind===`pr`?S8(e.id):NZ()}let y=BBe({currentZoomLevel:()=>I(h),setUiZoomLevel:UZ,centerTabs:()=>I(a),activeCenterTab:()=>I(i),selectCenterTab:XT,newConversation:C6,openProjectPicker:g,closeCenterTab:ZT,closeCenterTabs:g5,centerTabsExcept:h5,refreshCenterTab:v,focusProjectSearch:_,hasConversationComposer:()=>!!(I(r)||I(s)),sending:()=>I(f),live:()=>I(o),abortActiveRun:O6,composerEscape:$Ee,toggleMic:eDe,selectedPermissionLevel:()=>I(u),setComposerPermission:g6,usableModels:()=>I(m),selectedModelKey:()=>I(l),selectedThinkingLevel:()=>I(d),setComposerThinkingLevel:m6,selectedMode:()=>I(c),setComposerMode:h6}),b;sr(()=>{let e=I(p)?.desktop.closeToTray;!Zu.isDesktop||e===void 0||e===b||(b=e,id(e))});let x;sr(()=>{let e=I(n)?.id;e!==x&&(x=e,e?H8(e,{reason:`project`,force:!0}):FAe())}),Na(()=>{let e=zBe(),t=ed(),n=IAe();ud();let r=window.location.pathname===`/settings`||window.location.pathname===`/settings/`;return r&&window.history.replaceState({},``,`/${window.location.search}${window.location.hash}`),BC(zC()),HC(VC()),window.addEventListener(`keydown`,y.handleWorkbenchShortcut,{capture:!0}),GBe().then(()=>{r&&kZ()}),()=>{window.removeEventListener(`keydown`,y.handleWorkbenchShortcut,{capture:!0}),t(),n(),e(),eVe()}});var S=R();H(N(S),()=>t.children??w),z(e,S),O()}function nVe(e){Ki(`629kra`,e=>{dr(()=>{zn.title=`nerve`})}),tVe(e,{children:(e,t)=>{pze(e,{})},$$slots:{default:!0}})}function rVe(e){nVe(e,{})}var iVe=new Set([`$$slots`,`$$events`,`$$legacy`]);function aVe(e,t){let n=G(t,iVe),r=[[`path`,{d:`m15 9-6 6`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`}],[`path`,{d:`m9 9 6 6`}]];uc(e,K({name:`octagon-x`},()=>n,{get iconNode(){return r}}))}var oVe=new Set([`$$slots`,`$$events`,`$$legacy`]);function sVe(e,t){D(t,!0);let n=G(t,oVe);Yu(e,K({get theme(){return cc.current},class:`toaster group`,style:`--normal-bg: var(--color-popover); --normal-text: var(--color-popover-foreground); --normal-border: var(--color-border);`},()=>n,{loadingIcon:e=>{tD(e,{class:`size-4 animate-spin`})},successIcon:e=>{ZQ(e,{class:`size-4`})},errorIcon:e=>{aVe(e,{class:`size-4`})},infoIcon:e=>{O5(e,{class:`size-4`})},warningIcon:e=>{Vd(e,{class:`size-4`})},$$slots:{loadingIcon:!0,successIcon:!0,errorIcon:!0,infoIcon:!0,warningIcon:!0}})),O()}var Q9=L(`<!> <!>`,1);function cVe(e,t){D(t,!1),ja();var n=Q9(),r=N(n);qee(r,{}),Fo(P(r,2),{get client(){return X3},children:(e,t)=>{var n=Q9(),r=N(n);rVe(r,{});var i=P(r,2),a=e=>{sVe(e,{position:`bottom-right`,closeButton:!0})};V(i,e=>{Zu.isDesktop||e(a)}),z(e,n)},$$slots:{default:!0}}),z(e,n),O()}var $9=document.getElementById(`app`);if(!$9)throw Error(`Missing #app mount target.`);lVe()&&v({immediate:!0}),ji(cVe,{target:$9});function lVe(){return`serviceWorker`in navigator&&window.nerveDesktop?.kind!==`electron`}export{e2 as t};
|