@qodeca/xezar 0.13.1 → 0.14.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/README.md +45 -15
- package/dist/agent-config/account-identity.d.ts +2 -8
- package/dist/agent-config/account-identity.js +54 -10
- package/dist/agent-config/account-identity.js.map +1 -1
- package/dist/agent-config/catalog.d.ts +49 -7
- package/dist/agent-config/catalog.js +107 -0
- package/dist/agent-config/catalog.js.map +1 -1
- package/dist/agent-config/model-settings/pi.d.ts +12 -6
- package/dist/agent-config/model-settings/pi.js +12 -6
- package/dist/agent-config/model-settings/pi.js.map +1 -1
- package/dist/agent-config/seed.js +10 -0
- package/dist/agent-config/seed.js.map +1 -1
- package/dist/contract/github.d.ts +15 -0
- package/dist/contract/index.d.ts +9 -0
- package/dist/contract/index.js +1527 -895
- package/dist/contract/mcp-api-reference.d.ts +174 -0
- package/dist/contract/mcp-audit.d.ts +103 -0
- package/dist/contract/mcp-discovery.d.ts +257 -0
- package/dist/contract/mcp-event-catalog.d.ts +121 -0
- package/dist/contract/mcp-event-catalog.test.d.ts +1 -0
- package/dist/contract/mcp-idempotency.d.ts +200 -0
- package/dist/contract/mcp-journal.d.ts +268 -0
- package/dist/contract/mcp-leader.d.ts +88 -0
- package/dist/contract/mcp-ownership.d.ts +78 -0
- package/dist/contract/mcp-versioning.d.ts +139 -0
- package/dist/contract/runs.d.ts +81 -0
- package/dist/core/agent-profiles.d.ts +15 -4
- package/dist/core/agent-profiles.js +22 -8
- package/dist/core/agent-profiles.js.map +1 -1
- package/dist/core/opencode-server-runner.js +71 -11
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/core/secret-redaction.d.ts +7 -1
- package/dist/core/secret-redaction.js +44 -10
- package/dist/core/secret-redaction.js.map +1 -1
- package/dist/index.js +138 -27
- package/dist/index.js.map +1 -1
- package/dist/machine-identity.d.ts +66 -0
- package/dist/machine-identity.js +96 -0
- package/dist/machine-identity.js.map +1 -0
- package/dist/mcp/adapters/claude-code.d.ts +41 -0
- package/dist/mcp/adapters/claude-code.js +40 -0
- package/dist/mcp/adapters/claude-code.js.map +1 -0
- package/dist/mcp/adapters/codex.d.ts +140 -0
- package/dist/mcp/adapters/codex.js +323 -0
- package/dist/mcp/adapters/codex.js.map +1 -0
- package/dist/mcp/adapters/opencode.d.ts +148 -0
- package/dist/mcp/adapters/opencode.js +528 -0
- package/dist/mcp/adapters/opencode.js.map +1 -0
- package/dist/mcp/adapters/pi-link.d.ts +102 -0
- package/dist/mcp/adapters/pi-link.js +235 -0
- package/dist/mcp/adapters/pi-link.js.map +1 -0
- package/dist/mcp/adapters/pi.d.ts +188 -0
- package/dist/mcp/adapters/pi.js +418 -0
- package/dist/mcp/adapters/pi.js.map +1 -0
- package/dist/mcp/api-reference.d.ts +26 -0
- package/dist/mcp/api-reference.js +133 -0
- package/dist/mcp/api-reference.js.map +1 -0
- package/dist/mcp/audit-trail.d.ts +162 -0
- package/dist/mcp/audit-trail.js +306 -0
- package/dist/mcp/audit-trail.js.map +1 -0
- package/dist/mcp/bridge.d.ts +81 -0
- package/dist/mcp/bridge.js +407 -0
- package/dist/mcp/bridge.js.map +1 -0
- package/dist/mcp/connection-file.d.ts +49 -0
- package/dist/mcp/connection-file.js +63 -0
- package/dist/mcp/connection-file.js.map +1 -0
- package/dist/mcp/echo-guard.d.ts +94 -0
- package/dist/mcp/echo-guard.js +160 -0
- package/dist/mcp/echo-guard.js.map +1 -0
- package/dist/mcp/event-catalog.d.ts +120 -0
- package/dist/mcp/event-catalog.js +306 -0
- package/dist/mcp/event-catalog.js.map +1 -0
- package/dist/mcp/event-controller.d.ts +230 -0
- package/dist/mcp/event-controller.js +596 -0
- package/dist/mcp/event-controller.js.map +1 -0
- package/dist/mcp/event-journal.d.ts +57 -0
- package/dist/mcp/event-journal.js +423 -0
- package/dist/mcp/event-journal.js.map +1 -0
- package/dist/mcp/index.d.ts +63 -0
- package/dist/mcp/index.js +386 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/ipc.d.ts +202 -0
- package/dist/mcp/ipc.js +206 -0
- package/dist/mcp/ipc.js.map +1 -0
- package/dist/mcp/leader-delivery.d.ts +119 -0
- package/dist/mcp/leader-delivery.js +450 -0
- package/dist/mcp/leader-delivery.js.map +1 -0
- package/dist/mcp/operation-receipts.d.ts +210 -0
- package/dist/mcp/operation-receipts.js +723 -0
- package/dist/mcp/operation-receipts.js.map +1 -0
- package/dist/mcp/project-catalogs.d.ts +23 -0
- package/dist/mcp/project-catalogs.js +25 -0
- package/dist/mcp/project-catalogs.js.map +1 -0
- package/dist/mcp/project-leaders.d.ts +26 -0
- package/dist/mcp/project-leaders.js +17 -0
- package/dist/mcp/project-leaders.js.map +1 -0
- package/dist/mcp/protocol.d.ts +50 -0
- package/dist/mcp/protocol.js +47 -0
- package/dist/mcp/protocol.js.map +1 -0
- package/dist/mcp/reconnect.d.ts +297 -0
- package/dist/mcp/reconnect.js +465 -0
- package/dist/mcp/reconnect.js.map +1 -0
- package/dist/mcp/resource-ownership.d.ts +228 -0
- package/dist/mcp/resource-ownership.js +390 -0
- package/dist/mcp/resource-ownership.js.map +1 -0
- package/dist/mcp/service-adapter.d.ts +16488 -0
- package/dist/mcp/service-adapter.js +148 -0
- package/dist/mcp/service-adapter.js.map +1 -0
- package/dist/mcp/service.d.ts +83 -0
- package/dist/mcp/service.js +233 -0
- package/dist/mcp/service.js.map +1 -0
- package/dist/mcp/session-binding.d.ts +105 -0
- package/dist/mcp/session-binding.js +163 -0
- package/dist/mcp/session-binding.js.map +1 -0
- package/dist/mcp/stale-write.d.ts +145 -0
- package/dist/mcp/stale-write.js +219 -0
- package/dist/mcp/stale-write.js.map +1 -0
- package/dist/mcp/tool.d.ts +48 -0
- package/dist/mcp/tool.js +24 -0
- package/dist/mcp/tool.js.map +1 -0
- package/dist/mcp/tools/discovery.d.ts +40 -0
- package/dist/mcp/tools/discovery.js +232 -0
- package/dist/mcp/tools/discovery.js.map +1 -0
- package/dist/mcp/tools/execution-control.d.ts +171 -0
- package/dist/mcp/tools/execution-control.js +513 -0
- package/dist/mcp/tools/execution-control.js.map +1 -0
- package/dist/mcp/tools/handoff-git.d.ts +26 -0
- package/dist/mcp/tools/handoff-git.js +544 -0
- package/dist/mcp/tools/handoff-git.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +2 -0
- package/dist/mcp/tools/index.js +23 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/leader-events.d.ts +46 -0
- package/dist/mcp/tools/leader-events.js +126 -0
- package/dist/mcp/tools/leader-events.js.map +1 -0
- package/dist/mcp/tools/local-handoff.d.ts +102 -0
- package/dist/mcp/tools/local-handoff.js +306 -0
- package/dist/mcp/tools/local-handoff.js.map +1 -0
- package/dist/mcp/tools/project-config.d.ts +340 -0
- package/dist/mcp/tools/project-config.js +1075 -0
- package/dist/mcp/tools/project-config.js.map +1 -0
- package/dist/mcp/tools/results-evidence.d.ts +112 -0
- package/dist/mcp/tools/results-evidence.js +1045 -0
- package/dist/mcp/tools/results-evidence.js.map +1 -0
- package/dist/mcp/tools/task-create.d.ts +70 -0
- package/dist/mcp/tools/task-create.js +473 -0
- package/dist/mcp/tools/task-create.js.map +1 -0
- package/dist/mcp/tools/task-reads.d.ts +102 -0
- package/dist/mcp/tools/task-reads.js +689 -0
- package/dist/mcp/tools/task-reads.js.map +1 -0
- package/dist/mcp/tools/work-organisation.d.ts +2 -0
- package/dist/mcp/tools/work-organisation.js +502 -0
- package/dist/mcp/tools/work-organisation.js.map +1 -0
- package/dist/paths.d.ts +17 -7
- package/dist/paths.js +18 -8
- package/dist/paths.js.map +1 -1
- package/dist/runs/project-writer.js +76 -11
- package/dist/runs/project-writer.js.map +1 -1
- package/dist/runs/retention.d.ts +24 -1
- package/dist/runs/retention.js +62 -1
- package/dist/runs/retention.js.map +1 -1
- package/dist/server/forge/github.js +44 -0
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/forge/types.d.ts +16 -0
- package/dist/server/project-context.d.ts +81 -8
- package/dist/server/project-context.js +143 -35
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/server.d.ts +1050 -53
- package/dist/server/server.js +326 -120
- package/dist/server/server.js.map +1 -1
- package/dist/server/validators.d.ts +26 -6
- package/dist/server/validators.js +17 -0
- package/dist/server/validators.js.map +1 -1
- package/dist/skills-remote.js +64 -6
- package/dist/skills-remote.js.map +1 -1
- package/dist/workflows/run.d.ts +277 -12
- package/dist/workflows/run.js +554 -59
- package/dist/workflows/run.js.map +1 -1
- package/dist/workspace/agent-profiles.d.ts +30 -3
- package/dist/workspace/agent-profiles.js +39 -4
- package/dist/workspace/agent-profiles.js.map +1 -1
- package/dist/workspace/config.js +25 -4
- package/dist/workspace/config.js.map +1 -1
- package/dist/workspace/project-owner.d.ts +210 -0
- package/dist/workspace/project-owner.js +518 -0
- package/dist/workspace/project-owner.js.map +1 -0
- package/package.json +5 -3
- package/scripts/pi-leader-extension.ts +420 -0
- package/scripts/sync-readme.mjs +83 -2
- package/web/dist/assets/{alert-dialog-BVsVcbFy.js → alert-dialog-D6rP6d39.js} +1 -1
- package/web/dist/assets/arrow-down-DMOfFIzW.js +1 -0
- package/web/dist/assets/arrow-left-C4Ec2BUg.js +1 -0
- package/web/dist/assets/{centered-state-Djgly6Ni.js → centered-state-B0ZqrPaa.js} +12 -12
- package/web/dist/assets/chevron-right-mHJ-crvn.js +1 -0
- package/web/dist/assets/{collapsible-DZ4D-DHG.js → collapsible-DchEHgUM.js} +1 -1
- package/web/dist/assets/{commit-list-B-z1JL9G.js → commit-list-BpMim1Rv.js} +1 -1
- package/web/dist/assets/{compare-variants-D62m4j3B.js → compare-variants-D5ItQbAq.js} +1 -1
- package/web/dist/assets/{diff-BKew9rQX.js → diff-HqqZ_WDR.js} +2 -2
- package/web/dist/assets/{diff-stat-D0mc5V6Z.js → diff-stat-NsU-3ecr.js} +1 -1
- package/web/dist/assets/{diff-view-xpIcuLIC.js → diff-view-B7c11Xux.js} +1 -1
- package/web/dist/assets/{dropdown-menu-CEQziH7X.js → dropdown-menu-CtTpnyod.js} +1 -1
- package/web/dist/assets/{editable-title-BCX3T2BY.js → editable-title-BXtuGQry.js} +1 -1
- package/web/dist/assets/{ellipsis-vertical-ByVdDc4z.js → ellipsis-vertical-MHtGZSH6.js} +1 -1
- package/web/dist/assets/{file-xBSB5hXO.js → file-DKLw5SOb.js} +1 -1
- package/web/dist/assets/{folder-CldgbZ5A.js → folder-Drw6-ufH.js} +1 -1
- package/web/dist/assets/{git-toolbar-DJANqg7Y.js → git-toolbar-BQH8bORV.js} +1 -1
- package/web/dist/assets/github-ynnpKFCJ.js +1 -0
- package/web/dist/assets/{image-preview-Cv5mZr0n.js → image-preview-DLhMN_R9.js} +1 -1
- package/web/dist/assets/index-BEsrNdXt.js +29 -0
- package/web/dist/assets/index-Da8DOBau.css +2 -0
- package/web/dist/assets/{markdown-CgEEE2ND.js → markdown-q365eN6Y.js} +1 -1
- package/web/dist/assets/{new-task-form-1r2bgsdD.js → new-task-form-CW-hNIWQ.js} +1 -1
- package/web/dist/assets/{pill-q-x22_ej.js → pill-B_TFulXa.js} +1 -1
- package/web/dist/assets/{project-router-VDN4jQM8.js → project-router-CLPc-ImZ.js} +1 -1
- package/web/dist/assets/{prompt-templates-BmZtCe-L.js → prompt-templates-CLc4RxyO.js} +1 -1
- package/web/dist/assets/{repo-git-btG0sdbO.js → repo-git-Is7R6-Tj.js} +1 -1
- package/web/dist/assets/{run-diff-vguEMJzh.js → run-diff-DHMvDlVo.js} +2 -2
- package/web/dist/assets/run-header-DvZJbQ8I.js +1 -0
- package/web/dist/assets/{search-x-QmhaAbg5.js → search-x-Ce2MMetu.js} +1 -1
- package/web/dist/assets/{skill-empty-hint-BrzUwByZ.js → skill-empty-hint-C_xCSvzB.js} +1 -1
- package/web/dist/assets/skills-CivqD4si.js +1 -0
- package/web/dist/assets/{sparkles-CP8QDOgX.js → sparkles-BCqPoj5g.js} +1 -1
- package/web/dist/assets/{square-terminal-CGypshSD.js → square-terminal-ikj5g-oK.js} +1 -1
- package/web/dist/assets/{tab-link-D4lFzzI1.js → tab-link-VsEjFV1Y.js} +1 -1
- package/web/dist/assets/{task-changes-BtZId14z.js → task-changes-CH-E81-_.js} +1 -1
- package/web/dist/assets/{task-commits-BoeyJXrv.js → task-commits-DqfkMFxp.js} +1 -1
- package/web/dist/assets/{task-files-DIy2oUnj.js → task-files-D_nkHZ_a.js} +2 -2
- package/web/dist/assets/task-thread-bxQompxJ.js +9 -0
- package/web/dist/assets/{textarea-CyBCyKIk.js → textarea-xajuW1L_.js} +1 -1
- package/web/dist/assets/{thread-loading-Cuq2jchC.js → thread-loading-C3JQZbIE.js} +1 -1
- package/web/dist/assets/{trash-2-B6Dp3ZNs.js → trash-2-hJrBhpUD.js} +1 -1
- package/web/dist/assets/{triangle-alert-xBya8FUp.js → triangle-alert-D1u82y1a.js} +1 -1
- package/web/dist/assets/{upload-D6MXEB9p.js → upload-Bn6FBZ59.js} +1 -1
- package/web/dist/assets/{use-desktop-CPBwzQ7M.js → use-desktop-DOIMfHfY.js} +1 -1
- package/web/dist/assets/{use-submit-shortcut-JTpNzU-u.js → use-submit-shortcut-Dj4DHTdE.js} +1 -1
- package/web/dist/assets/utils-YwBpOoRN.js +64 -0
- package/web/dist/assets/{workflows-DG115scU.js → workflows-CTaAKz2m.js} +3 -3
- package/web/dist/assets/{zoomable-image-GTYwLtkS.js → zoomable-image-C1-6P3tg.js} +1 -1
- package/web/dist/index.html +23 -23
- package/web/dist/assets/arrow-down-CYgAlZtW.js +0 -1
- package/web/dist/assets/arrow-left-BOqE0a3k.js +0 -1
- package/web/dist/assets/chevron-right-Cc9BWnbN.js +0 -1
- package/web/dist/assets/github-D6vK0jFn.js +0 -1
- package/web/dist/assets/index-CkmR6h7s.css +0 -2
- package/web/dist/assets/index-DVDqF4bM.js +0 -9
- package/web/dist/assets/refresh-cw-DcNCj2nu.js +0 -1
- package/web/dist/assets/run-header-DM7MiKj9.js +0 -1
- package/web/dist/assets/skills-DMfxQtrD.js +0 -1
- package/web/dist/assets/task-thread-CbMPmrWq.js +0 -9
- package/web/dist/assets/utils--z9hRtl3.js +0 -64
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{a as n}from"./centered-state-
|
|
1
|
+
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{a as n}from"./centered-state-B0ZqrPaa.js";import{t as r}from"./utils-YwBpOoRN.js";import{n as i}from"./textarea-xajuW1L_.js";import{d as a,f as o,h as s,l as c,m as l,p as u,u as d}from"./alert-dialog-D6rP6d39.js";e();var f=t();function p({...e}){return(0,f.jsx)(c,{"data-slot":`dialog`,...e})}function m({...e}){return(0,f.jsx)(l,{"data-slot":`dialog-portal`,...e})}function h({...e}){return(0,f.jsx)(d,{"data-slot":`dialog-close`,...e})}function g({className:e,...t}){return(0,f.jsx)(u,{"data-slot":`dialog-overlay`,className:r(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function _({className:e,children:t,showCloseButton:n=!0,...o}){return(0,f.jsxs)(m,{"data-slot":`dialog-portal`,children:[(0,f.jsx)(g,{}),(0,f.jsxs)(a,{"data-slot":`dialog-content`,className:r(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...o,children:[t,n&&(0,f.jsxs)(d,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,f.jsx)(i,{}),(0,f.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function v({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`dialog-header`,className:r(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function y({className:e,showCloseButton:t=!1,children:i,...a}){return(0,f.jsxs)(`div`,{"data-slot":`dialog-footer`,className:r(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...a,children:[i,t&&(0,f.jsx)(d,{asChild:!0,children:(0,f.jsx)(n,{variant:`outline`,children:`Close`})})]})}function b({className:e,...t}){return(0,f.jsx)(s,{"data-slot":`dialog-title`,className:r(`text-lg leading-none font-semibold`,e),...t})}function x({className:e,...t}){return(0,f.jsx)(o,{"data-slot":`dialog-description`,className:r(`text-sm text-muted-foreground`,e),...t})}function S(e){return!(e.key!==`Enter`||e.shiftKey||e.altKey||e.repeat||e.isComposing)}function C(e=typeof navigator>`u`?``:navigator.platform){return/mac|iphone|ipad|ipod/i.test(e)?`⌘↵`:`Ctrl+↵`}export{_ as a,v as c,h as i,b as l,C as n,x as o,p as r,y as s,S as t};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{r as n,t as r}from"./bundle-mjs-BT31bpU6.js";var i;function a(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}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 o=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},s=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(i=globalThis).__zod_globalConfig??(i.__zod_globalConfig={});var c=globalThis.__zod_globalConfig;function l(e){return e&&Object.assign(c,e),c}function u(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 d(e,t){return typeof t==`bigint`?t.toString():t}function f(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function p(e){return e==null}function ee(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function te(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var ne=Symbol(`evaluating`);function m(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ne)return r===void 0&&(r=ne,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function h(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function g(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function re(e){return JSON.stringify(e)}function ie(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ae=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function oe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var se=f(()=>{if(c.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function _(e){if(oe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(oe(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ce(e){return _(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var le=new Set([`string`,`number`,`symbol`]);function v(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function y(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function b(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 ue(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var de={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function fe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return y(e,g(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 h(this,`shape`,e),e},checks:[]}))}function pe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return y(e,g(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 h(this,`shape`,r),r},checks:[]}))}function me(e,t){if(!_(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return y(e,g(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return h(this,`shape`,n),n}}))}function he(e,t){if(!_(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return y(e,g(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return h(this,`shape`,n),n}}))}function ge(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return y(e,g(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return h(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function _e(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return y(t,g(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 h(this,`shape`,i),i},checks:[]}))}function ve(e,t,n){return y(t,g(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 h(this,`shape`,i),i}}))}function x(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 ye(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function S(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function be(e){return typeof e==`string`?e:e?.message}function C(e,t,n){let r=e.message?e.message:be(e.inst?._zod.def?.error?.(e))??be(t?.error?.(e))??be(n.customError?.(e))??be(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function xe(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Se(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Ce=(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,d,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},we=a(`$ZodError`,Ce),Te=a(`$ZodError`,Ce,{Parent:Error});function Ee(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 De(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var Oe=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise)throw new o;if(s.issues.length){let t=new((i?.Err)??e)(s.issues.map(e=>C(e,a,l())));throw ae(t,i?.callee),t}return s.value},ke=e=>async(t,n,r,i)=>{let a=r?{...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=>C(e,a,l())));throw ae(t,i?.callee),t}return o.value},Ae=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 o;return a.issues.length?{success:!1,error:new(e??we)(a.issues.map(e=>C(e,i,l())))}:{success:!0,data:a.value}},je=Ae(Te),Me=e=>async(t,n,r)=>{let i=r?{...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=>C(e,i,l())))}:{success:!0,data:a.value}},Ne=Me(Te),Pe=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Oe(e)(t,n,i)},Fe=e=>(t,n,r)=>Oe(e)(t,n,r),Ie=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ke(e)(t,n,i)},Le=e=>async(t,n,r)=>ke(e)(t,n,r),Re=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ae(e)(t,n,i)},ze=e=>(t,n,r)=>Ae(e)(t,n,r),Be=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Me(e)(t,n,i)},Ve=e=>async(t,n,r)=>Me(e)(t,n,r),He=/^[cC][0-9a-z]{6,}$/,Ue=/^[0-9a-z]+$/,We=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ge=/^[0-9a-vA-V]{20}$/,Ke=/^[A-Za-z0-9]{27}$/,qe=/^[a-zA-Z0-9_-]{21}$/,Je=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ye=/^([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})$/,Xe=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)$/,Ze=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Qe=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function $e(){return new RegExp(Qe,`u`)}var et=/^(?:(?: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])$/,tt=/^(([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}|:))$/,nt=/^((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])$/,rt=/^(([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])$/,it=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,at=/^[A-Za-z0-9_-]*$/,ot=/^https?$/,st=/^\+[1-9]\d{6,14}$/,ct=`(?:(?:\\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])))`,lt=RegExp(`^${ct}$`);function ut(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 dt(e){return RegExp(`^${ut(e)}$`)}function ft(e){let t=ut({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(`^${ct}T(?:${r})$`)}var pt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},mt=/^-?\d+$/,ht=/^-?\d+(?:\.\d+)?$/,gt=/^(?:true|false)$/i,_t=/^null$/i,vt=/^[^A-Z]*$/,yt=/^[^a-z]*$/,w=a(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),bt={number:`number`,bigint:`bigint`,object:`date`},xt=a(`$ZodCheckLessThan`,(e,t)=>{w.init(e,t);let n=bt[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:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),St=a(`$ZodCheckGreaterThan`,(e,t)=>{w.init(e,t);let n=bt[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:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ct=a(`$ZodCheckMultipleOf`,(e,t)=>{w.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):te(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})}}),wt=a(`$ZodCheckNumberFormat`,(e,t)=>{w.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=de[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=mt)}),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,inclusive:!0,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,inclusive:!0,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,inclusive:!0,inst:e,continue:!t.abort})}}),Tt=a(`$ZodCheckMaxLength`,(e,t)=>{var n;w.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!p(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=xe(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Et=a(`$ZodCheckMinLength`,(e,t)=>{var n;w.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!p(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=xe(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Dt=a(`$ZodCheckLengthEquals`,(e,t)=>{var n;w.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!p(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=xe(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})}}),Ot=a(`$ZodCheckStringFormat`,(e,t)=>{var n,r;w.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=()=>{})}),kt=a(`$ZodCheckRegex`,(e,t)=>{Ot.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})}}),At=a(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=vt,Ot.init(e,t)}),jt=a(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=yt,Ot.init(e,t)}),Mt=a(`$ZodCheckIncludes`,(e,t)=>{w.init(e,t);let n=v(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})}}),Nt=a(`$ZodCheckStartsWith`,(e,t)=>{w.init(e,t);let n=RegExp(`^${v(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})}}),Pt=a(`$ZodCheckEndsWith`,(e,t)=>{w.init(e,t);let n=RegExp(`.*${v(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})}}),Ft=a(`$ZodCheckOverwrite`,(e,t)=>{w.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),It=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(`
|
|
2
|
+
`).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(`
|
|
3
|
+
`))}},Lt={major:4,minor:4,patch:3},T=a(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Lt;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=x(e),i;for(let a of t){if(a._zod.def.when){if(ye(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,s=a._zod.check(e);if(s instanceof Promise&&n?.async===!1)throw new o;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(r||=x(e,t))});else{if(e.issues.length===t)continue;r||=x(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(x(n))return n.aborted=!0,n;let s=t(i,r,a);if(s instanceof Promise){if(a.async===!1)throw new o;return s.then(t=>e._zod.parse(t,a))}return e._zod.parse(s,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 s=e._zod.parse(i,a);if(s instanceof Promise){if(a.async===!1)throw new o;return s.then(e=>t(e,r,a))}return t(s,r,a)}}m(e,`~standard`,()=>({validate:t=>{try{let n=je(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Ne(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Rt=a(`$ZodString`,(e,t)=>{T.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??pt(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}}),E=a(`$ZodStringFormat`,(e,t)=>{Ot.init(e,t),Rt.init(e,t)}),zt=a(`$ZodGUID`,(e,t)=>{t.pattern??=Ye,E.init(e,t)}),Bt=a(`$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??=Xe(e)}else t.pattern??=Xe();E.init(e,t)}),Vt=a(`$ZodEmail`,(e,t)=>{t.pattern??=Ze,E.init(e,t)}),Ht=a(`$ZodURL`,(e,t)=>{E.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===ot.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let 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:t.hostname.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})}}}),Ut=a(`$ZodEmoji`,(e,t)=>{t.pattern??=$e(),E.init(e,t)}),Wt=a(`$ZodNanoID`,(e,t)=>{t.pattern??=qe,E.init(e,t)}),Gt=a(`$ZodCUID`,(e,t)=>{t.pattern??=He,E.init(e,t)}),Kt=a(`$ZodCUID2`,(e,t)=>{t.pattern??=Ue,E.init(e,t)}),qt=a(`$ZodULID`,(e,t)=>{t.pattern??=We,E.init(e,t)}),Jt=a(`$ZodXID`,(e,t)=>{t.pattern??=Ge,E.init(e,t)}),Yt=a(`$ZodKSUID`,(e,t)=>{t.pattern??=Ke,E.init(e,t)}),Xt=a(`$ZodISODateTime`,(e,t)=>{t.pattern??=ft(t),E.init(e,t)}),Zt=a(`$ZodISODate`,(e,t)=>{t.pattern??=lt,E.init(e,t)}),Qt=a(`$ZodISOTime`,(e,t)=>{t.pattern??=dt(t),E.init(e,t)}),$t=a(`$ZodISODuration`,(e,t)=>{t.pattern??=Je,E.init(e,t)}),en=a(`$ZodIPv4`,(e,t)=>{t.pattern??=et,E.init(e,t),e._zod.bag.format=`ipv4`}),tn=a(`$ZodIPv6`,(e,t)=>{t.pattern??=tt,E.init(e,t),e._zod.bag.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})}}}),nn=a(`$ZodCIDRv4`,(e,t)=>{t.pattern??=nt,E.init(e,t)}),rn=a(`$ZodCIDRv6`,(e,t)=>{t.pattern??=rt,E.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 an(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var on=a(`$ZodBase64`,(e,t)=>{t.pattern??=it,E.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{an(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function sn(e){if(!at.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return an(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var cn=a(`$ZodBase64URL`,(e,t)=>{t.pattern??=at,E.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{sn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),ln=a(`$ZodE164`,(e,t)=>{t.pattern??=st,E.init(e,t)});function un(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 dn=a(`$ZodJWT`,(e,t)=>{E.init(e,t),e._zod.check=n=>{un(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),fn=a(`$ZodNumber`,(e,t)=>{T.init(e,t),e._zod.pattern=e._zod.bag.pattern??ht,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}}),pn=a(`$ZodNumberFormat`,(e,t)=>{wt.init(e,t),fn.init(e,t)}),mn=a(`$ZodBoolean`,(e,t)=>{T.init(e,t),e._zod.pattern=gt,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}}),hn=a(`$ZodNull`,(e,t)=>{T.init(e,t),e._zod.pattern=_t,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),gn=a(`$ZodAny`,(e,t)=>{T.init(e,t),e._zod.parse=e=>e}),_n=a(`$ZodUnknown`,(e,t)=>{T.init(e,t),e._zod.parse=e=>e}),vn=a(`$ZodNever`,(e,t)=>{T.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function yn(e,t,n){e.issues.length&&t.issues.push(...S(n,e.issues)),t.value[n]=e.value}var bn=a(`$ZodArray`,(e,t)=>{T.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=>yn(t,n,e))):yn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function xn(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...S(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Sn(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=ue(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Cn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||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=>xn(e,n,i,t,u,d))):xn(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var wn=a(`$ZodObject`,(e,t)=>{if(T.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=f(()=>Sn(t));m(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=oe,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],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>xn(n,t,e,s,r,i))):xn(a,t,e,s,r,i)}return i?Cn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Tn=a(`$ZodObjectJIT`,(e,t)=>{wn.init(e,t);let n=e._zod.parse,r=f(()=>Sn(t)),i=e=>{let t=new It([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=re(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 r of n.keys){let n=a[r],o=re(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
4
|
+
if (${n}.issues.length) {
|
|
5
|
+
if (${o} in input) {
|
|
6
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
7
|
+
...iss,
|
|
8
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
9
|
+
})));
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (${n}.value === undefined) {
|
|
14
|
+
if (${o} in input) {
|
|
15
|
+
newResult[${o}] = undefined;
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
newResult[${o}] = ${n}.value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
`):c?t.write(`
|
|
22
|
+
if (${n}.issues.length) {
|
|
23
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
24
|
+
...iss,
|
|
25
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
26
|
+
})));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (${n}.value === undefined) {
|
|
30
|
+
if (${o} in input) {
|
|
31
|
+
newResult[${o}] = undefined;
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
newResult[${o}] = ${n}.value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
`):t.write(`
|
|
38
|
+
const ${n}_present = ${o} in input;
|
|
39
|
+
if (${n}.issues.length) {
|
|
40
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
41
|
+
...iss,
|
|
42
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
46
|
+
payload.issues.push({
|
|
47
|
+
code: "invalid_type",
|
|
48
|
+
expected: "nonoptional",
|
|
49
|
+
input: undefined,
|
|
50
|
+
path: [${o}]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (${n}_present) {
|
|
55
|
+
if (${n}.value === undefined) {
|
|
56
|
+
newResult[${o}] = undefined;
|
|
57
|
+
} else {
|
|
58
|
+
newResult[${o}] = ${n}.value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=oe,s=!c.jitless,l=s&&se.value,u=t.catchall,d;e._zod.parse=(c,f)=>{d??=r.value;let p=c.value;return o(p)?s&&l&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),c=a(c,f),u?Cn([],p,c,f,d,e):c):n(c,f):(c.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),c)}});function En(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=>!x(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=>C(e,r,l())))}),t)}var Dn=a(`$ZodUnion`,(e,t)=>{T.init(e,t),m(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),m(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),m(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),m(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=>ee(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>En(t,r,e,i)):En(o,r,e,i)}}),On=a(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Dn.init(e,t);let n=e._zod.parse;m(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=f(()=>{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(!oe(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||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),kn=a(`$ZodIntersection`,(e,t)=>{T.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])=>jn(e,t,n)):jn(e,i,a)}});function An(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_(e)&&_(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=An(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=An(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 jn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),x(e))return e;let o=An(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Mn=a(`$ZodRecord`,(e,t)=>{T.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!_(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>C(e,r,l())),input:c,path:[c],inst:e});continue}let u=o.value,d=t.valueType._zod.run({value:i[c],issues:[]},r);d instanceof Promise?a.push(d.then(e=>{e.issues.length&&n.issues.push(...S(c,e.issues)),n.value[u]=e.value})):(d.issues.length&&n.issues.push(...S(c,d.issues)),n.value[u]=d.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))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(typeof o==`string`&&ht.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>C(e,r,l())),input:o,path:[o],inst:e});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(...S(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...S(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Nn=a(`$ZodEnum`,(e,t)=>{T.init(e,t);let n=u(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>le.has(typeof e)).map(e=>typeof e==`string`?v(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}}),Pn=a(`$ZodLiteral`,(e,t)=>{if(T.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?v(e):e?v(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Fn=a(`$ZodTransform`,(e,t)=>{T.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new s(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.fallback=!0,n));if(i instanceof Promise)throw new o;return n.value=i,n.fallback=!0,n}});function In(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Ln=a(`$ZodOptional`,(e,t)=>{T.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),m(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ee(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>In(e,r)):In(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Rn=a(`$ZodExactOptional`,(e,t)=>{Ln.init(e,t),m(e._zod,`values`,()=>t.innerType._zod.values),m(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),zn=a(`$ZodNullable`,(e,t)=>{T.init(e,t),m(e._zod,`optin`,()=>t.innerType._zod.optin),m(e._zod,`optout`,()=>t.innerType._zod.optout),m(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ee(e.source)}|null)$`):void 0}),m(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)}),Bn=a(`$ZodDefault`,(e,t)=>{T.init(e,t),e._zod.optin=`optional`,m(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=>Vn(e,t)):Vn(r,t)}});function Vn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Hn=a(`$ZodPrefault`,(e,t)=>{T.init(e,t),e._zod.optin=`optional`,m(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))}),Un=a(`$ZodNonOptional`,(e,t)=>{T.init(e,t),m(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=>Wn(t,e)):Wn(i,e)}});function Wn(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 Gn=a(`$ZodCatch`,(e,t)=>{T.init(e,t),e._zod.optin=`optional`,m(e._zod,`optout`,()=>t.innerType._zod.optout),m(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=>C(e,n,l()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>C(e,n,l()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Kn=a(`$ZodPipe`,(e,t)=>{T.init(e,t),m(e._zod,`values`,()=>t.in._zod.values),m(e._zod,`optin`,()=>t.in._zod.optin),m(e._zod,`optout`,()=>t.out._zod.optout),m(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=>qn(e,t.in,n)):qn(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>qn(e,t.out,n)):qn(r,t.out,n)}});function qn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Jn=a(`$ZodReadonly`,(e,t)=>{T.init(e,t),m(e._zod,`propValues`,()=>t.innerType._zod.propValues),m(e._zod,`values`,()=>t.innerType._zod.values),m(e._zod,`optin`,()=>t.innerType?._zod?.optin),m(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(Yn):Yn(r)}});function Yn(e){return e.value=Object.freeze(e.value),e}var Xn=a(`$ZodCustom`,(e,t)=>{w.init(e,t),T.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=>Zn(t,n,r,e));Zn(i,n,r,e)}});function Zn(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(Se(e))}}var Qn,$n=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),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 er(){return new $n}(Qn=globalThis).__zod_globalRegistry??(Qn.__zod_globalRegistry=er());var D=globalThis.__zod_globalRegistry;function tr(e,t){return new e({type:`string`,...b(t)})}function nr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...b(t)})}function rr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...b(t)})}function ir(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...b(t)})}function ar(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...b(t)})}function or(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...b(t)})}function sr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...b(t)})}function cr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...b(t)})}function lr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...b(t)})}function ur(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...b(t)})}function dr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...b(t)})}function fr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...b(t)})}function pr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...b(t)})}function mr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...b(t)})}function hr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...b(t)})}function gr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...b(t)})}function _r(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...b(t)})}function vr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...b(t)})}function yr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...b(t)})}function br(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...b(t)})}function xr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...b(t)})}function Sr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...b(t)})}function Cr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...b(t)})}function wr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...b(t)})}function Tr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...b(t)})}function Er(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...b(t)})}function Dr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...b(t)})}function Or(e,t){return new e({type:`number`,checks:[],...b(t)})}function kr(e,t){return new e({type:`number`,coerce:!0,checks:[],...b(t)})}function Ar(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...b(t)})}function jr(e,t){return new e({type:`boolean`,...b(t)})}function Mr(e,t){return new e({type:`null`,...b(t)})}function Nr(e){return new e({type:`any`})}function Pr(e){return new e({type:`unknown`})}function Fr(e,t){return new e({type:`never`,...b(t)})}function Ir(e,t){return new xt({check:`less_than`,...b(t),value:e,inclusive:!1})}function Lr(e,t){return new xt({check:`less_than`,...b(t),value:e,inclusive:!0})}function Rr(e,t){return new St({check:`greater_than`,...b(t),value:e,inclusive:!1})}function zr(e,t){return new St({check:`greater_than`,...b(t),value:e,inclusive:!0})}function Br(e,t){return new Ct({check:`multiple_of`,...b(t),value:e})}function Vr(e,t){return new Tt({check:`max_length`,...b(t),maximum:e})}function Hr(e,t){return new Et({check:`min_length`,...b(t),minimum:e})}function Ur(e,t){return new Dt({check:`length_equals`,...b(t),length:e})}function Wr(e,t){return new kt({check:`string_format`,format:`regex`,...b(t),pattern:e})}function Gr(e){return new At({check:`string_format`,format:`lowercase`,...b(e)})}function Kr(e){return new jt({check:`string_format`,format:`uppercase`,...b(e)})}function qr(e,t){return new Mt({check:`string_format`,format:`includes`,...b(t),includes:e})}function Jr(e,t){return new Nt({check:`string_format`,format:`starts_with`,...b(t),prefix:e})}function Yr(e,t){return new Pt({check:`string_format`,format:`ends_with`,...b(t),suffix:e})}function O(e){return new Ft({check:`overwrite`,tx:e})}function Xr(e){return O(t=>t.normalize(e))}function Zr(){return O(e=>e.trim())}function Qr(){return O(e=>e.toLowerCase())}function $r(){return O(e=>e.toUpperCase())}function ei(){return O(e=>ie(e))}function ti(e,t,n){return new e({type:`array`,element:t,...b(n)})}function ni(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...b(n)})}function ri(e,t){let n=ii(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Se(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Se(r))}},e(t.value,t)),t);return n}function ii(e,t){let n=new w({check:`custom`,...b(t)});return n._zod.check=e,n}function ai(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??D,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function k(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,k(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&A(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function oi(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
63
|
+
|
|
64
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function si(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:li(t,`input`,e.processors),output:li(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function A(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return A(r.element,n);if(r.type===`set`)return A(r.valueType,n);if(r.type===`lazy`)return A(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return A(r.innerType,n);if(r.type===`intersection`)return A(r.left,n)||A(r.right,n);if(r.type===`record`||r.type===`map`)return A(r.keyType,n)||A(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:A(r.in,n)||A(r.out,n);if(r.type===`object`){for(let e in r.shape)if(A(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(A(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(A(e,n))return!0;return!!(r.rest&&A(r.rest,n))}return!1}var ci=(e,t={})=>n=>{let r=ai({...n,processors:t});return k(e,r),oi(r,e),si(r,e)},li=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ai({...i??{},target:a,io:t,processors:n});return k(e,o),oi(o,e),si(o,e)},ui={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},di=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ui[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},fi=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},pi=(e,t,n,r)=>{n.type=`boolean`},mi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},hi=(e,t,n,r)=>{n.not={}},gi=(e,t,n,r)=>{let i=e._zod.def,a=u(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},_i=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},vi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},yi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},bi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=k(a.element,t,{...r,path:[...r.path,`items`]})},xi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=k(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=k(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Si=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>k(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ci=(e,t,n,r)=>{let i=e._zod.def,a=k(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=k(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},wi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=k(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=k(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=k(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Ti=(e,t,n,r)=>{let i=e._zod.def,a=k(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ei=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Di=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Oi=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},ki=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Ai=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;k(o,t,r);let s=t.seen.get(e);s.ref=o},ji=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Mi=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ni=a(`ZodISODateTime`,(e,t)=>{Xt.init(e,t),P.init(e,t)});function Pi(e){return wr(Ni,e)}var Fi=a(`ZodISODate`,(e,t)=>{Zt.init(e,t),P.init(e,t)});function Ii(e){return Tr(Fi,e)}var Li=a(`ZodISOTime`,(e,t)=>{Qt.init(e,t),P.init(e,t)});function Ri(e){return Er(Li,e)}var zi=a(`ZodISODuration`,(e,t)=>{$t.init(e,t),P.init(e,t)});function Bi(e){return Dr(zi,e)}var j=a(`ZodError`,(e,t)=>{we.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>De(e,t)},flatten:{value:t=>Ee(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,d,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,d,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Vi=Oe(j),Hi=ke(j),Ui=Ae(j),Wi=Me(j),Gi=Pe(j),Ki=Fe(j),qi=Ie(j),Ji=Le(j),Yi=Re(j),Xi=ze(j),Zi=Be(j),Qi=Ve(j),$i=new WeakMap;function ea(e,t,n){let r=Object.getPrototypeOf(e),i=$i.get(r);if(i||(i=new Set,$i.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var M=a(`ZodType`,(e,t)=>(T.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:li(e,`input`),output:li(e,`output`)}}),e.toJSONSchema=ci(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Vi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ui(e,t,n),e.parseAsync=async(t,n)=>Hi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Wi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Gi(e,t,n),e.decode=(t,n)=>Ki(e,t,n),e.encodeAsync=async(t,n)=>qi(e,t,n),e.decodeAsync=async(t,n)=>Ji(e,t,n),e.safeEncode=(t,n)=>Yi(e,t,n),e.safeDecode=(t,n)=>Xi(e,t,n),e.safeEncodeAsync=async(t,n)=>Zi(e,t,n),e.safeDecodeAsync=async(t,n)=>Qi(e,t,n),ea(e,`ZodType`,{check(...e){let t=this.def;return this.clone(g(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return y(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(fo(e,t))},superRefine(e,t){return this.check(po(e,t))},overwrite(e){return this.check(O(e))},optional(){return qa(this)},exactOptional(){return Ya(this)},nullable(){return Za(this)},nullish(){return qa(Za(this))},nonoptional(e){return ro(this,e)},array(){return R(this)},or(e){return H([this,e])},and(e){return Ba(this,e)},transform(e){return so(this,Ga(e))},default(e){return $a(this,e)},prefault(e){return to(this,e)},catch(e){return ao(this,e)},pipe(e){return so(this,e)},readonly(){return lo(this)},describe(e){let t=this.clone();return D.add(t,{description:e}),t},meta(...e){if(e.length===0)return D.get(this);let t=this.clone();return D.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return D.get(e)?.description},configurable:!0}),e)),ta=a(`_ZodString`,(e,t)=>{Rt.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,ea(e,`_ZodString`,{regex(...e){return this.check(Wr(...e))},includes(...e){return this.check(qr(...e))},startsWith(...e){return this.check(Jr(...e))},endsWith(...e){return this.check(Yr(...e))},min(...e){return this.check(Hr(...e))},max(...e){return this.check(Vr(...e))},length(...e){return this.check(Ur(...e))},nonempty(...e){return this.check(Hr(1,...e))},lowercase(e){return this.check(Gr(e))},uppercase(e){return this.check(Kr(e))},trim(){return this.check(Zr())},normalize(...e){return this.check(Xr(...e))},toLowerCase(){return this.check(Qr())},toUpperCase(){return this.check($r())},slugify(){return this.check(ei())}})}),na=a(`ZodString`,(e,t)=>{Rt.init(e,t),ta.init(e,t),e.email=t=>e.check(nr(ra,t)),e.url=t=>e.check(cr(oa,t)),e.jwt=t=>e.check(Cr(Sa,t)),e.emoji=t=>e.check(lr(ca,t)),e.guid=t=>e.check(rr(ia,t)),e.uuid=t=>e.check(ir(F,t)),e.uuidv4=t=>e.check(ar(F,t)),e.uuidv6=t=>e.check(or(F,t)),e.uuidv7=t=>e.check(sr(F,t)),e.nanoid=t=>e.check(ur(la,t)),e.guid=t=>e.check(rr(ia,t)),e.cuid=t=>e.check(dr(ua,t)),e.cuid2=t=>e.check(fr(da,t)),e.ulid=t=>e.check(pr(fa,t)),e.base64=t=>e.check(br(ya,t)),e.base64url=t=>e.check(xr(ba,t)),e.xid=t=>e.check(mr(pa,t)),e.ksuid=t=>e.check(hr(ma,t)),e.ipv4=t=>e.check(gr(ha,t)),e.ipv6=t=>e.check(_r(ga,t)),e.cidrv4=t=>e.check(vr(_a,t)),e.cidrv6=t=>e.check(yr(va,t)),e.e164=t=>e.check(Sr(xa,t)),e.datetime=t=>e.check(Pi(t)),e.date=t=>e.check(Ii(t)),e.time=t=>e.check(Ri(t)),e.duration=t=>e.check(Bi(t))});function N(e){return tr(na,e)}var P=a(`ZodStringFormat`,(e,t)=>{E.init(e,t),ta.init(e,t)}),ra=a(`ZodEmail`,(e,t)=>{Vt.init(e,t),P.init(e,t)}),ia=a(`ZodGUID`,(e,t)=>{zt.init(e,t),P.init(e,t)}),F=a(`ZodUUID`,(e,t)=>{Bt.init(e,t),P.init(e,t)});function aa(e){return ir(F,e)}var oa=a(`ZodURL`,(e,t)=>{Ht.init(e,t),P.init(e,t)});function sa(e){return cr(oa,e)}var ca=a(`ZodEmoji`,(e,t)=>{Ut.init(e,t),P.init(e,t)}),la=a(`ZodNanoID`,(e,t)=>{Wt.init(e,t),P.init(e,t)}),ua=a(`ZodCUID`,(e,t)=>{Gt.init(e,t),P.init(e,t)}),da=a(`ZodCUID2`,(e,t)=>{Kt.init(e,t),P.init(e,t)}),fa=a(`ZodULID`,(e,t)=>{qt.init(e,t),P.init(e,t)}),pa=a(`ZodXID`,(e,t)=>{Jt.init(e,t),P.init(e,t)}),ma=a(`ZodKSUID`,(e,t)=>{Yt.init(e,t),P.init(e,t)}),ha=a(`ZodIPv4`,(e,t)=>{en.init(e,t),P.init(e,t)}),ga=a(`ZodIPv6`,(e,t)=>{tn.init(e,t),P.init(e,t)}),_a=a(`ZodCIDRv4`,(e,t)=>{nn.init(e,t),P.init(e,t)}),va=a(`ZodCIDRv6`,(e,t)=>{rn.init(e,t),P.init(e,t)}),ya=a(`ZodBase64`,(e,t)=>{on.init(e,t),P.init(e,t)}),ba=a(`ZodBase64URL`,(e,t)=>{cn.init(e,t),P.init(e,t)}),xa=a(`ZodE164`,(e,t)=>{ln.init(e,t),P.init(e,t)}),Sa=a(`ZodJWT`,(e,t)=>{dn.init(e,t),P.init(e,t)}),Ca=a(`ZodNumber`,(e,t)=>{fn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r),ea(e,`ZodNumber`,{gt(e,t){return this.check(Rr(e,t))},gte(e,t){return this.check(zr(e,t))},min(e,t){return this.check(zr(e,t))},lt(e,t){return this.check(Ir(e,t))},lte(e,t){return this.check(Lr(e,t))},max(e,t){return this.check(Lr(e,t))},int(e){return this.check(Ta(e))},safe(e){return this.check(Ta(e))},positive(e){return this.check(Rr(0,e))},nonnegative(e){return this.check(zr(0,e))},negative(e){return this.check(Ir(0,e))},nonpositive(e){return this.check(Lr(0,e))},multipleOf(e,t){return this.check(Br(e,t))},step(e,t){return this.check(Br(e,t))},finite(){return this}});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 I(e){return Or(Ca,e)}var wa=a(`ZodNumberFormat`,(e,t)=>{pn.init(e,t),Ca.init(e,t)});function Ta(e){return Ar(wa,e)}var Ea=a(`ZodBoolean`,(e,t)=>{mn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r)});function L(e){return jr(Ea,e)}var Da=a(`ZodNull`,(e,t)=>{hn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r)});function Oa(e){return Mr(Da,e)}var ka=a(`ZodAny`,(e,t)=>{gn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Aa(){return Nr(ka)}var ja=a(`ZodUnknown`,(e,t)=>{_n.init(e,t),M.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ma(){return Pr(ja)}var Na=a(`ZodNever`,(e,t)=>{vn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r)});function Pa(e){return Fr(Na,e)}var Fa=a(`ZodArray`,(e,t)=>{bn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.element=t.element,ea(e,`ZodArray`,{min(e,t){return this.check(Hr(e,t))},nonempty(e){return this.check(Hr(1,e))},max(e,t){return this.check(Vr(e,t))},length(e,t){return this.check(Ur(e,t))},unwrap(){return this.element}})});function R(e,t){return ti(Fa,e,t)}var Ia=a(`ZodObject`,(e,t)=>{Tn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),m(e,`shape`,()=>t.shape),ea(e,`ZodObject`,{keyof(){return G(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Ma()})},loose(){return this.clone({...this._zod.def,catchall:Ma()})},strict(){return this.clone({...this._zod.def,catchall:Pa()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return me(this,e)},safeExtend(e){return he(this,e)},merge(e){return ge(this,e)},pick(e){return fe(this,e)},omit(e){return pe(this,e)},partial(...e){return _e(Ka,this,e[0])},required(...e){return ve(no,this,e[0])}})});function z(e,t){return new Ia({type:`object`,shape:e??{},...b(t)})}function B(e,t){return new Ia({type:`object`,shape:e,catchall:Pa(),...b(t)})}function V(e,t){return new Ia({type:`object`,shape:e,catchall:Ma(),...b(t)})}var La=a(`ZodUnion`,(e,t)=>{Dn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r),e.options=t.options});function H(e,t){return new La({type:`union`,options:e,...b(t)})}var Ra=a(`ZodDiscriminatedUnion`,(e,t)=>{La.init(e,t),On.init(e,t)});function U(e,t,n){return new Ra({type:`union`,options:t,discriminator:e,...b(n)})}var za=a(`ZodIntersection`,(e,t)=>{kn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r)});function Ba(e,t){return new za({type:`intersection`,left:e,right:t})}var Va=a(`ZodRecord`,(e,t)=>{Mn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function W(e,t,n){return!t||!t._zod?new Va({type:`record`,keyType:N(),valueType:e,...b(t)}):new Va({type:`record`,keyType:e,valueType:t,...b(n)})}var Ha=a(`ZodEnum`,(e,t)=>{Nn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r),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 Ha({...t,checks:[],...b(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 Ha({...t,checks:[],...b(r),entries:i})}});function G(e,t){return new Ha({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...b(t)})}var Ua=a(`ZodLiteral`,(e,t)=>{Pn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r),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 K(e,t){return new Ua({type:`literal`,values:Array.isArray(e)?e:[e],...b(t)})}var Wa=a(`ZodTransform`,(e,t)=>{Fn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new s(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Se(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(Se(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Ga(e){return new Wa({type:`transform`,transform:e})}var Ka=a(`ZodOptional`,(e,t)=>{Ln.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qa(e){return new Ka({type:`optional`,innerType:e})}var Ja=a(`ZodExactOptional`,(e,t)=>{Rn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ya(e){return new Ja({type:`optional`,innerType:e})}var Xa=a(`ZodNullable`,(e,t)=>{zn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Za(e){return new Xa({type:`nullable`,innerType:e})}var Qa=a(`ZodDefault`,(e,t)=>{Bn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function $a(e,t){return new Qa({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ce(t)}})}var eo=a(`ZodPrefault`,(e,t)=>{Hn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function to(e,t){return new eo({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ce(t)}})}var no=a(`ZodNonOptional`,(e,t)=>{Un.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ro(e,t){return new no({type:`nonoptional`,innerType:e,...b(t)})}var io=a(`ZodCatch`,(e,t)=>{Gn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ao(e,t){return new io({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var oo=a(`ZodPipe`,(e,t)=>{Kn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.in=t.in,e.out=t.out});function so(e,t){return new oo({type:`pipe`,in:e,out:t})}var co=a(`ZodReadonly`,(e,t)=>{Jn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lo(e){return new co({type:`readonly`,innerType:e})}var uo=a(`ZodCustom`,(e,t)=>{Xn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r)});function fo(e,t={}){return ni(uo,e,t)}function po(e,t){return ri(e,t)}function mo(e){return kr(Ca,e)}V({seq:I(),ts:N(),stepId:N().optional(),type:N()}),z({id:N().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)});var ho=N().min(1).max(2048);z({cursor:ho.optional()}),z({cursor:ho.optional(),afterSeq:mo().int().nonnegative().optional()});var go=z({seq:I(),ts:N(),stepId:N().optional(),type:N()}).catchall(Aa()),_o=z({events:R(go),itemCount:I().int().min(0).max(100),olderCursor:ho.optional(),newerCursor:ho.optional(),liveCursor:ho,asOfSeq:I().int().nonnegative(),hasOlder:L()}),vo=z({contextEvents:R(go),asOfSeq:I().int().nonnegative()});z({checkoutId:N().optional(),name:N(),phase:G([`cloning`,`done`,`error`]),line:N().optional(),error:N().optional()});var q=G([`claude`,`codex`,`opencode`,`pi`]),yo=z({root:N(),branch:N(),remote:N().optional()}),bo=z({name:G([`claude`,`codex`,`opencode`,`pi`,`gh`,`git`]),available:L(),version:N().optional(),hint:N().optional()}),xo=z({kind:K(`github`),available:L().optional(),reason:N().optional()}),So=z({localHandoff:L(),followups:L(),singleProject:L(),automations:L(),tokenMetrics:L(),tokenUsageMetrics:L(),costMetrics:L()});z({version:N(),latestVersion:N().optional(),repoRoot:N(),repo:yo.nullable(),checks:R(bo),defaultRunner:q,forge:xo.nullable(),capabilities:So,projects:R(z({id:N(),name:N()})),bootProject:N()}),z({code:K(-32080),message:N().min(1),data:z({reason:K(`com.qodeca.xezar/project-occupied`),projectId:N().min(1),retryable:K(!0)}).strict()}).strict(),z({code:K(-32081),message:N().min(1),data:z({reason:K(`com.qodeca.xezar/session-expired`),projectId:N().min(1),retryable:K(!0)}).strict()}).strict(),G([`unowned`,`owned`,`expired`]);var Co=G([`passing`,`failing`,`pending`]).nullable(),wo=z({kind:G([`issue`,`pr`]),number:I(),title:N(),author:N(),createdAt:N(),labels:R(N()),body:N(),url:N(),comments:I(),isDraft:L().optional(),additions:I().optional(),deletions:I().optional(),checks:Co.optional()});z({available:L(),reason:N().optional(),repo:N().optional(),syncedAt:N().optional(),issues:R(wo),prs:R(wo),labelColors:W(N(),N()).optional()}),U(`available`,[z({available:K(!0),checks:W(I(),Co)}),z({available:K(!1),reason:N()})]),z({available:L(),reason:N().optional(),items:R(wo),truncated:L().optional(),labelColors:W(N(),N()).optional()});var To=G([`draft`,`review-required`,`changes-requested`,`checks-pending`,`checks-failing`,`ready`,`merged`,`closed`,`open`,`completed`,`not-planned`]),Eo=I().nullable();U(`available`,[z({available:K(!0),prs:W(I(),To),issues:W(I(),To),conflicts:R(I()).optional(),recheckAfterMs:Eo}),z({available:K(!1),reason:N(),recheckAfterMs:Eo})]);var Do=z({id:I(),author:N(),avatarUrl:N().optional(),createdAt:N(),body:N(),kind:G([`comment`,`review`]),reviewState:G([`approved`,`changes_requested`,`commented`,`dismissed`]).optional(),url:N()}),Oo=G([`committed`,`labeled`,`unlabeled`,`assigned`,`unassigned`,`merged`,`closed`,`reopened`,`head_ref_force_pushed`,`cross-referenced`,`renamed`]),ko=z({id:N(),kind:Oo,actor:N(),avatarUrl:N().optional(),createdAt:N(),url:N().optional(),sha:N().optional(),message:N().optional(),checks:Co.optional(),label:z({name:N(),color:N().optional()}).optional(),subject:N().optional(),refNumber:I().optional(),refTitle:N().optional(),refIsPr:L().optional()});z({available:L(),reason:N().optional(),comments:R(Do),truncated:L().optional(),events:R(ko).optional()});var Ao=G([`merge`,`squash`,`rebase`]),jo=z({name:N(),state:G([`passing`,`failing`,`pending`,`unknown`]),required:L().nullable(),url:N().optional()}),Mo=z({number:I(),title:N(),url:N(),state:G([`open`,`closed`,`merged`]),isDraft:L(),headRef:N(),baseRef:N(),headSha:N(),mergeable:G([`mergeable`,`conflicting`,`unknown`]),reviewDecision:G([`approved`,`changes-requested`,`review-required`,`unknown`]),checks:R(jo),methods:R(Ao),defaultMethod:Ao.nullable(),eligibility:G([`ready`,`blocked`,`pending`,`unauthorized`,`terminal`,`unknown`]),blockers:R(z({code:N(),message:N()})),canMerge:L(),canOverride:L()});U(`available`,[z({available:K(!0),mergeState:Mo}),z({available:K(!1),reason:N()})]),z({merged:K(!0),number:I(),url:N(),method:Ao,mergeCommitSha:N().optional()}),z({expectedHeadSha:N().regex(/^[0-9a-f]{40}$/)}).strict(),z({ready:K(!0),number:I(),url:N()});var No=z({path:N(),previousPath:N().optional(),status:G([`added`,`modified`,`removed`,`renamed`,`copied`,`changed`]),additions:I(),deletions:I(),patch:N().optional(),patchUnavailableReason:G([`binary`,`too-large`,`not-provided`]).optional(),truncated:L().optional()});U(`available`,[z({available:K(!0),number:I(),headSha:N(),files:R(No),additions:I(),deletions:I(),truncated:L(),reason:N().optional()}),z({available:K(!1),reason:N()})]);var J=N().min(1).max(512),Po=z({kind:N().min(1).max(32).regex(/^[a-z][a-z0-9-]*$/),id:N().min(1)}),Fo=`Not applied: this changed after you read it. Read the current state and decide again; a new decision is a new operation.`,Io=`Attempted and failed: the change ran and did not complete, so part of it may have applied. Read the current state before deciding again; do not repeat it blindly.`,Lo=z({status:K(`conflict`),applied:K(!1),error:K(`stale_version`),resource:Po,currentVersion:J.optional(),changedSince:K(!0),guidance:K(Fo)}),Ro=z({status:K(`failed`),executed:K(!0),error:K(`execution_failed`),resource:Po,guidance:K(Io)});U(`status`,[z({status:K(`done`),resource:Po,version:J.optional()}),Lo,Ro]);var zo=z({id:N().min(1),name:N().optional(),prompt:N().optional(),skill:N().optional(),model:N().optional(),runner:q.optional(),allowedTools:R(N()).optional(),bashAllowlist:R(N()).optional(),timeout:N().optional(),command:N().optional(),onFail:z({retry:N().min(1),max:I().int().positive().default(2)}).optional()}).refine(e=>!!e.command!=!!(e.prompt??e.skill),{message:`a step is either an agent step (prompt/skill) or a check step (command), not both`}),Bo=z({name:N(),description:N().optional(),steps:R(zo),source:G([`built-in`,`file`]),path:N().optional()}),Vo=z({path:N(),message:N()});z({workflows:R(Bo),issues:R(Vo)}),z({name:N().trim().min(1).max(80),description:N().max(2e3,`must be at most 2000 characters`).optional(),steps:R(zo).min(1).max(8).optional(),skills:R(N().trim().min(1)).min(1).max(8).optional(),overwrite:L().optional()}).refine(e=>!!e.steps!=!!e.skills,{message:`provide either "steps" or "skills", not both`}),z({path:N(),name:N()}),z({name:N(),description:N().optional(),steps:R(zo)}),z({ok:K(!0),path:N()}),z({name:N().optional(),steps:R(zo),rationale:N(),fallback:L()});var Ho=G([`queued`,`running`,`waiting`,`review`,`done`,`failed`,`cancelled`]),Uo=G([`monitoring`]),Wo=G([`pending`,`running`,`waiting`,`review`,`done`,`failed`,`cancelled`,`skipped`]),Y=I().finite().nonnegative(),Go=z({id:N(),name:N(),kind:G([`agent`,`check`]),status:Wo,iterations:I(),tokensUsed:I(),inputTokens:Y.optional(),outputTokens:Y.optional(),usageInvocationsStarted:Y.optional(),usageInvocationsObserved:Y.optional(),usageTurnsStarted:Y.optional(),usageTurnsRecorded:Y.optional(),usageInvocationEpoch:Y.optional(),startedAt:N().optional(),finishedAt:N().optional(),error:N().optional(),sessionId:N().optional(),backend:q.optional(),profileId:N().optional(),costUsd:I().optional()}),Ko=z({adds:I(),dels:I(),files:I(),repointed:L().optional()}),qo=z({id:N(),text:N(),images:R(N()).optional(),createdAt:N()}),Jo=z({cpuPct:I(),rssBytes:I(),procCount:I()}),Yo=z({id:N(),title:N(),titleSummary:N().optional(),diffStat:Ko.optional(),workflow:N(),task:N(),queuedMessages:R(qo).optional(),taskImages:R(N()).optional(),model:N().optional(),modelIdentity:N().optional(),runner:q.optional(),agentProfile:N().optional(),systemPrompt:N().optional(),generateFollowups:L().optional(),autonomous:L().optional(),automation:z({automationId:N(),automationRevision:I(),receiptId:N(),event:N(),githubUrl:N()}).optional(),status:Ho,activity:Uo.optional(),monitoringWakeAt:N().optional(),monitoringWakeCapReached:L().optional(),autoResumeAt:N().optional(),autoResumeAttempts:I().optional(),createdAt:N(),startedAt:N().optional(),finishedAt:N().optional(),tokensUsed:I(),inputTokens:Y.optional(),outputTokens:Y.optional(),costUsd:I().optional(),pullRequestUrl:N().optional(),referencedPullRequestUrl:N().optional(),prNumber:I().optional(),issueNumber:I().optional(),referencedIssueNumberSeeded:L().optional(),titleOrigin:G([`user`,`auto`,`marker`]).optional(),markerRefs:z({pr:I().optional(),issue:I().optional()}).optional(),referencedPrCandidates:R(N()).optional(),referencedIssueUrl:N().optional(),referencedIssueCandidates:R(N()).optional(),worktree:K(!1).optional(),worktreePath:N().optional(),branch:N().optional(),baseBranch:N().optional(),worktreeReclaimedAt:N().optional(),groupId:N().optional(),variant:N().optional(),peakRssBytes:I().optional(),peakProcCount:I().optional(),archived:L(),archivedAt:N().optional(),pinned:L().optional(),pinnedAt:N().optional(),seenAt:N().optional(),currentStepId:N().optional(),error:N().optional(),steps:R(Go),workflowDef:Bo.optional()});Yo.extend({usage:Jo.optional()});var Xo=z({projectId:N(),id:N(),title:N(),titleSummary:N().optional(),titleOrigin:G([`user`,`auto`,`marker`]).optional(),status:Ho,activity:Uo.optional(),createdAt:N(),finishedAt:N().optional(),seenAt:N().optional(),archived:L(),autoResumeAt:N().optional(),workflow:N(),runner:q,runnerInherited:L().optional(),model:N().optional(),stepBackends:I().int().min(2).optional(),branch:N().optional(),startedAt:N().optional(),pullRequestUrl:N().optional(),referencedPullRequestUrl:N().optional(),prNumber:I().optional(),issueNumber:I().optional(),referencedIssueUrl:N().optional(),markerRefs:z({pr:I().optional(),issue:I().optional()}).optional(),costUsd:I().optional(),peakRssBytes:I().optional(),peakProcCount:I().optional(),usage:Jo.optional()}),Zo=W(N(),z({prs:W(I(),To),issues:W(I(),To)}));z({runs:R(Xo),referenceStatuses:Zo,perProjectLimit:I(),truncated:R(N())}),H([Yo,z({runs:R(Yo)})]),z({cancelled:L()}),z({cancelled:K(!0)}),z({archived:I()}),z({read:I()}),z({deleted:K(!0)}),z({finished:K(!0)}),z({continued:K(!0)}),z({url:N(),dryRun:L()}),H([z({delivered:K(!0)}),z({queued:K(!0),message:qo}),z({deferred:K(!0)})]),z({message:qo}),z({removed:K(!0)}),z({opened:K(!0),command:N()}),z({removed:K(!0)}),z({committed:K(!0),sha:N()}),z({pushed:K(!0),branch:N(),remote:N(),upstreamSet:L()}),z({commits:R(z({sha:N(),subject:N(),author:N(),when:N()}))});var Qo=z({id:N(),variant:N(),title:N(),status:Ho,archived:L(),tokensUsed:I(),inputTokens:Y.optional(),outputTokens:Y.optional(),costUsd:I().optional(),diffStat:N(),handoffExcerpt:N()});z({groupId:N(),runs:R(Qo)}),z({winner:Yo.optional()});var $o=[`text/plain`,`text/markdown`,`text/x-markdown`,`application/pdf`];function es(e){return/^image\//.test(e)}function ts(e){return es(e)||$o.includes(e)}function ns(e){return/png/.test(e)?`png`:/jpe?g/.test(e)?`jpg`:/webp/.test(e)?`webp`:/gif/.test(e)?`gif`:e===`application/pdf`?`pdf`:e===`text/plain`?`txt`:e===`text/markdown`||e===`text/x-markdown`?`md`:`img`}var rs=new Set([`png`,`jpg`,`jpeg`,`webp`,`gif`,`img`]);function is(e){let t=e.split(`.`).pop()?.toLowerCase();return t!==void 0&&rs.has(t)}var as=z({mediaType:N().refine(ts,{message:`unsupported attachment type — images, plain text, markdown and PDF only`}),data:N().min(1).max(7e6)}),os=z({workflow:N().min(1).optional(),steps:R(zo).min(1).max(8).optional(),task:N().min(1).max(1e5,`must be at most 100000 characters`),model:N().optional(),runner:q.optional(),agentProfile:N().max(64).optional(),variants:I().int().min(1).max(3).optional(),worktree:L().optional(),autonomous:L().optional(),generateFollowups:L().optional(),systemPrompt:N().trim().max(2e4,`must be at most 20000 characters`).optional().transform(e=>e||void 0),images:R(as).max(4).optional(),todoId:N().min(1).max(200,`must be at most 200 characters`).optional()});os.refine(e=>!!e.workflow!=!!e.steps,{message:`provide either "workflow" or "steps", not both`}),z({text:N().max(1e5).default(``),images:R(as).max(4).default([]),expectedVersion:J.optional()}).refine(e=>e.text.trim().length>0||e.images.length>0,{message:`message needs text or at least one attachment`}),z({title:N().trim().min(1).max(300).optional(),task:N().trim().min(1).max(1e5).optional(),expectedVersion:J.optional()});var X=z({expectedVersion:J.optional()});X.extend({runId:N().min(1)}),X.extend({archived:L().optional()}),X.extend({pinned:L().optional()}),X.extend({text:N().max(1e5).optional(),images:R(as).max(4).optional()}).refine(e=>e.text!==void 0||e.images!==void 0,{message:`message edit needs text or attachments`}),X.extend({text:N().max(1e5,`must be at most 100000 characters`).optional(),images:R(as).max(4).optional(),runner:q.optional(),model:N().max(200).optional(),agentProfile:N().max(64).optional()}),X.extend({message:N().trim().min(1,`must not be empty`).max(5e3)}),z({version:J});var ss=z({status:N(),path:N()}),cs=z({hash:N(),subject:N(),author:N(),when:N()});H([z({info:Oa(),status:R(Pa()),log:R(Pa()),branches:R(Pa()),baseBranch:Oa()}),z({info:yo,status:R(ss),log:R(cs),branches:R(N()),baseBranch:N().nullable()})]),z({branch:N(),created:L()});var ls=z({adds:I(),dels:I(),files:I()}),us=z({path:N(),oldPath:N().optional(),status:G([`added`,`modified`,`deleted`,`renamed`,`copied`]),adds:I(),dels:I(),binary:L(),image:L().optional(),patch:N()});z({files:R(us),stat:ls,repointedHead:z({headBranch:N(),taskBranch:N()}).optional()}),z({sha:N(),subject:N(),author:N(),when:N(),files:R(us),stat:ls});var ds=z({name:N(),type:G([`dir`,`file`]),size:I().optional()});U(`type`,[z({type:K(`dir`),path:N(),entries:R(ds)}),z({type:K(`file`),path:N(),size:I(),binary:L(),tooLarge:L(),content:N().optional()})]);var fs=G([`queued`,`running`,`waiting`,`review`,`done`,`failed`,`cancelled`]);z({worktrees:R(z({runId:N(),title:N(),status:fs,branch:N().nullable(),sizeBytes:I().nullable(),finishedAt:N().nullable(),reclaimable:L()})),totalBytes:I().nullable(),keep:I()}),z({reclaimed:R(N())});var ps=z({id:N(),name:N(),root:N(),addedAt:N(),lastOpenedAt:N(),source:G([`local`,`checkout`]),status:G([`ok`,`missing`,`not-git`]),branch:N().optional(),forge:K(`github`).optional(),repoUrl:N().optional(),maxParallel:I().optional(),tags:R(N()).optional()});z({projects:R(ps),bootProject:N(),projectsDir:N()}),z({project:ps,error:N().optional()}),z({removed:K(!0),id:N()}),z({project:ps}),z({maxParallel:I().int().min(1).max(16).nullable().optional(),tags:R(N().trim().min(1).max(32)).max(20).nullable().optional()}).refine(e=>e.maxParallel!==void 0||e.tags!==void 0,`specify maxParallel or tags`),z({url:N().trim().min(1).max(512),name:N().trim().max(128).optional(),checkoutId:N().trim().max(128).optional()});var ms=z({name:N(),path:N(),isRepo:L()});z({path:N(),parent:N().nullable(),dirs:R(ms),truncated:L()}),z({key:N()}),z({browseRoot:N(),projectsDir:N(),skillsAutoUpdate:L().nullable(),effectiveSkillsAutoUpdate:L(),followups:L().nullable(),effectiveFollowups:L(),agentEnvPassthrough:R(N()).nullable(),effectiveAgentEnvPassthrough:R(N()),composerDefaults:z({autonomous:L().nullable(),worktree:L().nullable(),inheritedAutonomous:H([L(),K(`source-dependent`)]),inheritedWorktree:L()}),resources:z({maxParallel:I(),maxMonitoringSessions:I(),monitoringWakeIntervalMinutes:I().nullable(),autoResumeOnUsageLimit:L(),idleTimeoutMinutes:I().nullable(),memoryLimitMb:I().nullable(),memoryLimitDefaultMb:I(),worktreeRetentionDefault:I()}),agentDefaults:z({runner:q.optional(),models:z({claude:N().optional(),codex:N().optional(),opencode:N().optional(),pi:N().optional()}).optional()})}),z({browseRoot:N().trim().min(1).max(4096).optional(),projectsDir:N().trim().min(1).max(4096).optional(),skillsAutoUpdate:L().nullable().optional(),followups:L().nullable().optional(),agentEnvPassthrough:R(N().trim().min(1).max(200)).max(64).nullable().optional(),composerDefaults:z({autonomous:L().nullable().optional(),worktree:L().nullable().optional()}).optional(),agentDefaults:z({runner:q.nullable().optional(),models:z({claude:N().trim().min(1).max(200).nullable().optional(),codex:N().trim().min(1).max(200).nullable().optional(),opencode:N().trim().min(1).max(200).nullable().optional(),pi:N().trim().min(1).max(200).nullable().optional()}).optional()}).optional(),resources:z({maxParallel:I().int().min(1).max(16).optional(),maxMonitoringSessions:I().int().min(0).max(16).optional(),monitoringWakeIntervalMinutes:I().int().min(1).max(60).nullable().optional(),autoResumeOnUsageLimit:L().optional(),idleTimeoutMinutes:I().int().min(1).max(1440).nullable().optional(),memoryLimitMb:I().int().min(0).max(1048576).nullable().optional(),worktreeRetentionDefault:I().int().min(0).max(1e3).optional()}).optional()});var hs=z({accent:G([`lime`,`violet`]).optional(),density:G([`comfortable`,`compact`,`ultra`]).optional(),width:G([`narrow`,`wide`]).optional()}),gs=V({expandedColumns:W(N(),L()).optional()});V({lastTask:z({source:G([`workflow`,`skill`]),ref:N()}).nullable().optional(),recentSources:R(z({source:G([`workflow`,`skill`]),ref:N()})).optional(),lastWorktree:L().optional(),lastAutonomous:L().optional(),lastGenerateFollowups:L().optional(),skillUsage:W(N(),I()).optional(),runsView:G([`list`,`table`]).optional(),githubView:G([`issues`,`prs`]).optional(),appearance:hs.optional(),promptTemplates:R(z({id:N(),label:N(),text:N(),skills:R(N()).optional()})).optional(),dismissedSkillsBanner:L().optional()});var _s=B({projectId:N().min(1).max(64),pathname:N().min(1).max(2048).startsWith(`/p/`),search:N().max(4096).startsWith(`?`).optional(),hash:N().max(2048).startsWith(`#`).optional()}),vs=V({sidebar:V({collapsed:W(N(),L()).optional()}).optional(),dismissedProviderAuthFailures:z({claude:N().optional(),codex:N().optional(),opencode:N().optional(),pi:N().optional()}).optional(),appearance:hs.optional(),notifications:V({enabled:L().optional()}).optional(),taskTable:gs.optional(),lastLocation:_s.optional(),importedSkills:R(N()).optional()}),Z=200,ys=50;V({...vs.shape,sidebar:V({collapsed:W(N().min(1).max(64),L()).refine(e=>Object.keys(e).length<=Z,{message:`sidebar.collapsed must have at most ${Z} entries`}).optional()}).optional(),dismissedProviderAuthFailures:B({claude:N().min(1).max(128).optional(),codex:N().min(1).max(128).optional(),opencode:N().min(1).max(128).optional(),pi:N().min(1).max(128).optional()}).optional(),importedSkills:R(N().min(1).max(200)).max(Z).optional(),taskTable:gs.extend({expandedColumns:W(N().min(1).max(64),L()).refine(e=>Object.keys(e).length<=ys,{message:`taskTable.expandedColumns must have at most ${ys} entries`}).optional()}).optional()}).superRefine((e,t)=>{Object.keys(e).length>Z&&t.addIssue({code:`custom`,message:`ui-state has too many keys (max ${Z})`})});var bs=z({claude:N().optional(),codex:N().optional(),opencode:N().optional(),pi:N().optional()});z({baseBranch:N().nullable(),defaultRunner:q,systemPrompt:N().nullable(),defaultModels:bs,modelsLocked:L(),maxParallel:I(),memoryLimitMb:I().nullable(),worktreeRetention:I(),liveTitleUpdates:L().nullable(),reviewGate:L().nullable(),plannerModel:N(),namerModel:N(),skillsRepos:R(z({repo:N(),ref:N()}))}),z({baseBranch:N().trim().min(1).max(200).nullable().optional(),defaultRunner:q.optional(),systemPrompt:N().trim().max(2e4).nullable().optional(),defaultModels:z({claude:N().trim().max(200).nullable().optional(),codex:N().trim().max(200).nullable().optional(),opencode:N().trim().max(200).nullable().optional(),pi:N().trim().max(200).nullable().optional()}).optional(),maxParallel:I().int().min(1).max(16).optional(),memoryLimitMb:I().int().min(0).max(1048576).nullable().optional(),worktreeRetention:I().int().min(0).max(1e3).nullable().optional(),liveTitleUpdates:L().nullable().optional(),reviewGate:L().nullable().optional(),plannerModel:N().trim().min(1).max(200).nullable().optional(),namerModel:N().trim().min(1).max(200).nullable().optional(),skillsRepos:R(z({repo:N().trim().min(1).max(500),ref:N().trim().min(1).max(200).optional()})).max(32).nullable().optional()});var xs=G([`idle`,`checking`,`available`,`updating`,`current`,`unavailable`,`error`]),Ss=z({scope:G([`project`,`global`]),status:xs,available:L(),skills:R(N()),checkedAt:N().nullable(),updatedAt:N().nullable(),reason:N().optional()});z({status:xs,available:L(),autoUpdateEnabled:L(),inherited:L(),checkedAt:N().nullable(),updatedAt:N().nullable(),scopes:R(Ss),needsUpgradeNotes:L()});var Cs=q,ws=G([`connected`,`disconnected`,`not-installed`,`unknown`]),Ts=z({provider:Cs,status:ws,enabled:L().optional(),hint:N().optional(),authFailureId:N().optional(),profileId:N().optional()});z({providers:R(Ts)}),U(`opened`,[z({opened:K(!0),command:N()}),z({opened:K(!1),connected:K(!0),command:N()})]);var Es=G([`claude`,`codex`,`opencode`,`pi`]).options;function Ds(e){return Es.includes(e)}z({runner:q,models:R(z({id:N(),label:N(),description:N()})),source:G([`live`,`cache`,`unavailable`]),stale:L(),reason:N().optional()}),z({targets:R(z({id:N(),label:N(),icon:N().optional()}))}),z({target:N().trim().min(1,`target required`).max(200)}),z({opened:K(!0),path:N()}),z({name:N(),description:N().optional(),interactive:K(!0).optional(),body:N(),path:N(),source:G([`ai`,`xezar`,`agents`,`global`,`team`]),team:z({repo:N(),ref:N(),path:N(),dir:L(),commit:N().optional()}).optional()}),z({name:N(),description:N().optional()}),z({id:N(),ts:N().optional(),taskId:N().optional(),summary:N().min(1),action:N().optional(),prUrl:N().optional(),suggestedSkill:N().optional(),suggestedArgs:N().optional(),suggestedPrompt:N().optional(),runnable:L().optional(),startedTaskId:N().optional()}),z({removed:K(!0)}),z({run:Yo});var Os=G([`json`,`jsonc`,`toml`,`markdown`]),ks=G([`user`,`project`,`local`]),As=G([`settings`,`memory`,`mcp`]),js=G([`tracked`,`gitignored`,`outside-repo`]),Ms=z({id:N(),runners:R(q),kind:As,scope:ks,label:N(),path:N(),format:Os,tracked:js,seeded:L(),holdsMcp:L(),precedence:N(),hotReload:N().optional(),docsUrl:N(),exists:L(),size:I(),version:N().nullable(),writable:L(),readOnlyReason:N().optional()}),Ns=z({path:N(),servers:R(N()),readable:L()});z({editable:L(),files:R(Ms),userMcp:Ns.nullable()}),z({id:N(),path:N(),exists:L(),content:N(),version:N().nullable()}),z({content:N().max(2e6),version:N().nullable()});var Ps=`default`,Fs=z({id:N(),label:N(),path:N(),exists:L()}),Is=z({id:N(),provider:Cs,label:N(),configDir:N(),path:N(),exists:L(),looksValid:L(),isDefault:L(),status:Ts.optional(),files:R(Fs)});function Ls(e){return e.isDefault?`default:${e.provider}`:e.id}var Rs=z({claude:N().optional(),codex:N().optional(),opencode:N().optional(),pi:N().optional()});z({editable:L(),profiles:R(Is),profileCapableProviders:R(Cs),selections:W(N(),Rs),defaults:Rs}),z({projectId:N().min(1).max(64).nullable(),provider:Cs,profileId:N().max(64).nullable()}),z({selections:W(N(),Rs),defaults:Rs}),z({status:Ts}),z({available:L(),reason:N().optional(),fields:R(z({label:N(),value:N()}))}),z({file:N().min(1).max(200),target:N().min(1).max(64).optional()}),z({opened:K(!0),path:N()}),z({provider:Cs,label:N().trim().max(200).optional(),configDir:N().trim().min(1).max(4096)}),z({profile:Is}),z({label:N().trim().max(200).optional(),configDir:N().trim().min(1).max(4096).optional()}),z({removed:K(!0),id:N()});var zs=G([`pull_request.opened`,`issue.opened`,`issue.labeled`,`issue.unlabeled`]),Bs=z({authors:R(N()).optional(),assignees:R(N()).optional(),allLabels:R(N()).optional(),anyLabels:R(N()).optional(),excludeLabels:R(N()).optional(),changedLabels:R(N()).optional(),lookbackDays:I(),maxRecords:I()}),Vs=os.omit({task:!0,images:!0,todoId:!0,systemPrompt:!0}).extend({prompt:N(),variants:H([K(1),K(2),K(3)]).optional(),systemPrompt:N().optional()}),Hs=z({id:N(),revision:I(),name:N(),description:N().optional(),enabled:L(),events:R(zs),intervalSeconds:I(),filters:Bs,task:Vs,createdAt:N(),updatedAt:N()}),Us=z({timestamp:N(),tieBreaker:N().optional()}),Ws=z({revision:I().optional(),baselineAt:N().optional(),cursor:Us.optional(),frozenHighWatermark:Us.extend({tieBreaker:N()}).optional(),backlogAfter:Us.extend({tieBreaker:N()}).optional(),nextCheckAt:N().optional(),lastSuccessAt:N().optional(),etags:W(N(),N()).optional(),backoffUntil:N().optional(),consecutiveFailures:I().optional()}),Gs=G([`launched`,`no-match`,`duplicate`,`rate-limited`,`error`,`baseline`,`preview`]),Ks=z({seq:I(),ts:N(),automationId:N(),revision:I(),event:zs.optional(),result:Gs,reason:N().optional(),durationMs:I().optional(),receiptId:N().optional(),runId:N().optional(),githubNumber:I().optional(),githubTitle:N().optional(),githubUrl:N().optional(),rateLimit:z({bucket:G([`core`,`search`]),remaining:I().optional(),resetAt:N().optional()}).optional()}),qs=z({matches:I(),launched:I(),duplicates:I(),errors:I()}),Js=Hs.extend({state:Ws.optional(),latestLog:Ks.optional(),counts:qs});z({available:L(),reason:N().optional(),scheduler:z({state:G([`scheduled`,`idle`]),nextDue:N().optional()}),automations:R(Js)}),z({automation:Hs}),z({automation:Hs,state:Ws.optional(),latestLog:Ks.optional()}),z({id:N(),automationId:N(),mode:G([`preview`,`execute`]),status:G([`queued`,`running`,`complete`,`error`]),createdAt:N(),completedAt:N().optional(),matches:I().optional(),truncated:L().optional(),error:N().optional()}),z({checkId:N()}),z({records:R(Ks)}),z({receiptId:N(),runId:N()}),Hs.omit({id:!0,revision:!0,createdAt:!0,updatedAt:!0,enabled:!0}).extend({enable:L().optional()}).omit({enable:!0}).extend({enabled:L().optional(),expectedRevision:I()}),z({mode:G([`preview`,`execute`])});var Ys=N().min(8).max(128).regex(/^[A-Za-z0-9_.:-]+$/);G([`ok`,`rejected`,`not-applied`,`unverified`]);var Xs=z({kind:N().min(1).max(64),id:N().min(1).max(256)}),Zs=N().min(1).max(64).regex(/^[a-z0-9_ -]+$/);U(`kind`,[z({kind:K(`run-by-key`),predictedRunId:aa()}),z({kind:K(`forge-search`),repository:N().min(1),headBranch:N().min(1)}),z({kind:K(`git-state`),ref:N().min(1),sha:N().min(1)}),z({kind:K(`none`)})]),H([z({status:G([`ok`,`rejected`,`not-applied`]),operationId:Ys,action:N().min(1),replayed:L(),resultRef:Xs.optional(),errorCode:Zs.optional()}),z({status:K(`in-progress`),operationId:Ys,action:N().min(1),startedAt:N()}),z({status:K(`unverified`),operationId:Ys,action:N().min(1),startedAt:N(),reconcile:z({kind:G([`run-by-key`,`forge-search`,`git-state`,`none`]),attemptedAt:N().optional(),reason:Zs}),guidance:K(`read current state; a new operationId is a new action`)}),z({error:K(`operation_key_conflict`),operationId:Ys,storedAction:N().min(1),storedAt:N(),mismatch:G([`action`,`payload`])}),z({error:K(`operation_receipt_unavailable`),operationId:Ys,reason:K(`journal_unwritable`)})]);var Qs=100,$s=2048,ec=G([`E-01`,`E-02`,`E-03`,`E-04`,`E-05`,`E-06`]),tc=G([`human`,`leader`,`system`]),nc=N().min(8).max(128).regex(/^[A-Za-z0-9_.:-]+$/),rc=N().regex(/^[a-z0-9][a-z0-9-]{0,63}$/),ic=z({type:N().regex(/^[a-z][a-z0-9-]{0,63}$/),id:N().min(1).max(256),version:N().min(1).max(512).nullable()}),ac=z({runId:N().min(1).max(128),runSeq:I().int().nonnegative()}),oc={category:ec,kind:N().max(64).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/),subject:ic,origin:tc,causedBy:nc.nullable(),summary:N().min(1).max(500),source:ac.optional()};function sc(e){return e.origin!==`leader`||e.causedBy!==null}var cc={message:`a leader row must name the operation that caused it`,path:[`causedBy`]};z(oc).refine(sc,cc);var lc=z({eventId:N().min(1),journalSeq:I().int().positive(),ts:N(),projectId:rc,...oc}).refine(sc,cc),uc=N().min(1).max($s);z({cursor:uc.optional(),limit:I().int().min(1).max(Qs).optional()}),U(`status`,[z({status:K(`ok`),events:R(lc),nextCursor:uc,hasMore:L(),oldestSeq:I().int().positive().nullable(),latestSeq:I().int().nonnegative()}),z({status:K(`cursor_too_old`),oldestSeq:I().int().positive().nullable(),latestSeq:I().int().nonnegative(),resumeCursor:uc,recovery:z({required:K(`current-state`),message:N()})})]),z({error:G([`invalid_cursor`,`cursor_project_mismatch`]),message:N()});var dc={"task.done":`E-01`,"task.failed":`E-01`,"task.cancelled":`E-01`,"task.blocked":`E-01`,"question.asked":`E-02`,"question.answered":`E-02`,"gate.passed":`E-03`,"gate.failed":`E-03`,"result.ready":`E-03`,"goal.changed":`E-04`,"instruction.added":`E-04`,"instruction.queued":`E-04`,"instruction.edited":`E-04`,"instruction.removed":`E-04`,"config.changed":`E-05`,"workflow.saved":`E-05`,"workflow.deleted":`E-05`,"agent-config.changed":`E-05`,"executor.available":`E-06`,"executor.unavailable":`E-06`},fc=G(Object.keys(dc)),pc=G([`run`,`config`,`workflow`,`agent-config`,`executor`]);lc.superRefine((e,t)=>{let n=fc.safeParse(e.kind);if(!n.success){t.addIssue({code:`custom`,path:[`kind`],message:`not a catalog kind: ${e.kind}`});return}dc[n.data]!==e.category&&t.addIssue({code:`custom`,path:[`category`],message:`${e.kind} belongs to ${dc[n.data]}`}),pc.safeParse(e.subject.type).success||t.addIssue({code:`custom`,path:[`subject`,`type`],message:`not a catalog subject: ${e.subject.type}`}),e.category===`E-04`&&e.origin!==`human`&&t.addIssue({code:`custom`,path:[`origin`],message:`an E-04 row is a human change`})});var mc=G([`ui`,`mcp`,`automation`,`cli`]),hc=G([`ok`,`rejected`,`not-applied`,`unverified`]),gc=/^[a-z][A-Za-z0-9-]*(\.[a-z][A-Za-z0-9-]*)+$/,_c=/^[a-z][a-z0-9-]*$/,vc=/^[A-Za-z0-9_.:-]+$/,yc=/^[a-z][a-z0-9_]*$/,bc=/^rev1:[a-z][a-z0-9-]*:[A-Za-z0-9_.-]{1,128}:(?:\d+|-):[0-9a-f]{12}$/,xc=z({kind:N().min(1).max(32).regex(_c),id:N().min(1).max(128).regex(vc)});z({v:K(1),ts:Pi(),projectId:N().min(1).max(128).regex(vc),action:N().min(3).max(64).regex(gc),resource:xc.optional(),outcome:hc,origin:mc,ownerGeneration:I().int().nonnegative().optional(),operationKey:N().min(1).max(257).regex(/^[A-Za-z0-9_.:-]+\/[A-Za-z0-9_.:-]{8,128}$/).optional(),versionToken:N().max(200).regex(bc).optional(),payloadDigest:N().regex(/^[0-9a-f]{64}$/).optional(),errorCode:N().min(1).max(64).regex(yc).optional()});var Sc=G([`create_task`,`parallel_variants`,`worktree_choice`,`model_selection`,`github`,`automations`,`inbox`,`open_in_app`,`agent_config_write`,`workspace_limits`]),Cc=U(`status`,[B({id:Sc,label:N(),status:K(`available`)}),B({id:Sc,label:N(),status:K(`unavailable`),reason:N().min(1)}),B({id:Sc,label:N(),status:K(`read-only`),reason:N().min(1)})]),wc=B({runner:q,installed:L(),version:N().optional(),enabled:L(),signIn:ws,usable:L(),reason:N().optional()}),Tc=B({name:G([`gh`,`git`]),available:L(),reason:N().optional()}),Ec=B({maxParallel:B({effective:I(),project:I().nullable(),workspace:I()}),memoryLimitMb:B({effective:I().nullable(),project:I().nullable(),workspace:I().nullable()}),maxMonitoringSessions:I(),monitoringWakeIntervalMinutes:I().nullable(),autoResumeOnUsageLimit:L(),idleTimeoutMinutes:I().nullable(),worktreeRetention:I()});B({project:B({id:N(),name:N(),root:N()}),xezarVersion:N(),repository:B({git:L(),branch:N().optional()}),settings:B({defaultRunner:q,baseBranch:N().nullable(),modelsLocked:L()}),capabilities:So.pick({localHandoff:!0,followups:!0,automations:!0}).strict(),agents:R(wc),tools:R(Tc),limits:Ec,actions:R(Cc)});var Dc=B({readOnlyHint:L().optional(),destructiveHint:L().optional(),idempotentHint:L().optional(),openWorldHint:L().optional()}),Oc=B({name:N(),title:N().optional(),description:N(),inputSchema:W(N(),Ma()),annotations:Dc.optional()}),kc=z({tool:N(),action:N(),boundary:N(),reason:N()}),Ac=z({tool:N(),argument:N(),reason:N()}),jc=z({tool:N(),argument:N(),everyCall:L(),requiredBy:R(N())}),Mc=z({what:N(),detail:N(),forbiddenBy:R(N())});U(`available`,[z({available:K(!0),xezarVersion:N(),protocolVersions:R(N()),capabilities:z({tools:z({listChanged:L()})}),tools:R(Oc),refusedActions:R(kc),refusedArguments:R(Ac),guards:R(jc),notExposed:R(Mc)}),z({available:K(!1),reason:N()})]),H([U(`client`,[B({action:K(`attach`),client:K(`opencode`),baseUrl:sa({protocol:/^https?$/}).max(500),sessionId:N().trim().min(1).max(200)}),B({action:K(`attach`),client:K(`pi`)})]),B({action:K(`stop`)})]);var Nc=z({client:G([`opencode`,`pi`]),state:K(`attached`)}),Pc=z({state:G([`inert`,`idle`,`dispatching`,`recovering`,`disconnected`,`ended`]),deliveredSeq:I().int().nonnegative(),ackedSeq:I().int().nonnegative(),reactedSeq:I().int().nonnegative(),latestSeq:I().int().nonnegative()}),Fc=z({code:N(),message:N(),fix:N()});U(`available`,[z({available:K(!1),reason:N()}),z({available:K(!0),leader:Nc.nullable(),delivery:Pc.nullable(),blocker:Fc.nullable()})]);var Ic=`/api/v1`,Q=``;function Lc(e){Q=e.replace(/\/+$/,``)}function Rc(){return Q}var zc=null;function Bc(e){zc=e===``?null:e}function Vc(){return zc}function Hc(){return zc??`default`}var Uc=/^\/(?:health$|models(?:$|[/?])|providers(?:$|[/?])|projects(?:$|[/?])|workspace\/|fs\/)/;function Wc(e){return`${Q}${Ic}${Gc(e)}`}function Gc(e){return zc===null||Uc.test(e)?e:`/p/${encodeURIComponent(zc)}${e}`}var Kc=/^\/api(?:\/v1)?(\/.*)$/;function qc(e){let t=/^[a-z][a-z0-9+.-]*:/i.exec(e);if(t){let n=e.indexOf(`//`,t[0].length);if(n!==t[0].length)return e;let r=e.indexOf(`/`,n+2);if(r===-1)return e;let i=e.slice(0,r),a=Jc(e.slice(r));return a===null?e:`${i}${a}`}let n=Jc(Q&&e.startsWith(Q)?e.slice(Q.length):e);return n===null?e:`${Q}${n}`}function Jc(e){let t=Kc.exec(e);if(!t)return null;let n=t[1];return n.startsWith(`/p/`)?`${Ic}${n}`:`${Ic}${Gc(n)}`}var $=e(t(),1),Yc=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Xc=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Zc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Qc=e=>{let t=Zc(e);return t.charAt(0).toUpperCase()+t.slice(1)},$c={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},el=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},tl=(0,$.createContext)({}),nl=()=>(0,$.useContext)(tl),rl=(0,$.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=nl()??{},ee=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,$.createElement)(`svg`,{ref:c,...$c,width:t??l??$c.width,height:t??l??$c.height,stroke:e??f,strokeWidth:ee,className:Yc(`lucide`,p,i),...!a&&!el(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,$.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),il=(e,t)=>{let n=(0,$.forwardRef)(({className:n,...r},i)=>(0,$.createElement)(rl,{ref:i,iconNode:t,className:Yc(`lucide-${Xc(Qc(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Qc(e),n},al=r({extend:{classGroups:{shadow:[`shadow-modal`]}}});function ol(...e){return al(n(e))}function sl(e){return typeof e==`string`&&/^https?:\/\//i.test(e)}export{is as _,Wc as a,_o as b,Hc as c,Bc as d,Ps as f,ts as g,ns as h,Ic as i,qc as l,Ds as m,sl as n,Rc as o,Ls as p,il as r,Vc as s,ol as t,Lc as u,es as v,vo as y};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{A as i,
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{A as i,Gt as a,Hr as o,Ht as s,Jr as c,Tn as l,Un as u,Vn as d,Wr as f,a as p,cr as m,dr as h,i as g,j as _,t as v,zt as y}from"./centered-state-B0ZqrPaa.js";import{r as b,t as x}from"./utils-YwBpOoRN.js";import{t as S}from"./arrow-down-DMOfFIzW.js";import{n as C,t as w}from"./trash-2-hJrBhpUD.js";import{n as ee,r as te}from"./skill-empty-hint-C_xCSvzB.js";import{t as T}from"./sparkles-BCqPoj5g.js";import{t as ne}from"./square-terminal-ikj5g-oK.js";import{t as re}from"./triangle-alert-D1u82y1a.js";import{t as ie}from"./upload-Bn6FBZ59.js";import{n as ae,t as oe}from"./textarea-xajuW1L_.js";import{a as E,c as se,i as ce,n as D,o as le,r as O,s as ue,t as k}from"./alert-dialog-D6rP6d39.js";import{i as de,s as A}from"./skills-D4P-Hgey.js";import{b as j,g as M,i as fe,x as N}from"./index-BEsrNdXt.js";var pe=b(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),me=e(n()),P=e(t());function he(){var e=[...arguments];return(0,P.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var F=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function I(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function L(e){return`nodeType`in e}function R(e){return e?I(e)?e:L(e)?e.ownerDocument?.defaultView??window:window:window}function ge(e){let{Document:t}=R(e);return e instanceof t}function _e(e){return!I(e)&&e instanceof R(e).HTMLElement}function ve(e){return e instanceof R(e).SVGElement}function z(e){return e?I(e)?e.document:L(e)?ge(e)?e:_e(e)||ve(e)?e.ownerDocument:document:document:document}var B=F?P.useLayoutEffect:P.useEffect;function ye(e){let t=(0,P.useRef)(e);return B(()=>{t.current=e}),(0,P.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function be(){let e=(0,P.useRef)(null);return[(0,P.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,P.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function xe(e,t){t===void 0&&(t=[e]);let n=(0,P.useRef)(e);return B(()=>{n.current!==e&&(n.current=e)},t),n}function V(e,t){let n=(0,P.useRef)();return(0,P.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function H(e){let t=ye(e),n=(0,P.useRef)(null);return[n,(0,P.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Se(e){let t=(0,P.useRef)();return(0,P.useEffect)(()=>{t.current=e},[e]),t.current}var U={};function Ce(e,t){return(0,P.useMemo)(()=>{if(t)return t;let n=U[e]==null?0:U[e]+1;return U[e]=n,e+`-`+n},[e,t])}function we(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var Te=we(1),Ee=we(-1);function De(e){return`clientX`in e&&`clientY`in e}function W(e){if(!e)return!1;let{KeyboardEvent:t}=R(e.target);return t&&e instanceof t}function G(e){if(!e)return!1;let{TouchEvent:t}=R(e.target);return t&&e instanceof t}function Oe(e){if(G(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return De(e)?{x:e.clientX,y:e.clientY}:null}var K=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[K.Translate.toString(e),K.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),ke=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Ae(e){return e.matches(ke)?e:e.querySelector(ke)}var je={display:`none`};function Me(e){let{id:t,value:n}=e;return P.createElement(`div`,{id:t,style:je},n)}function Ne(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return P.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function Pe(){let[e,t]=(0,P.useState)(``);return{announce:(0,P.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var Fe=(0,P.createContext)(null);function Ie(e){let t=(0,P.useContext)(Fe);(0,P.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Le(){let[e]=(0,P.useState)(()=>new Set),t=(0,P.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,P.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Re={draggable:`
|
|
2
2
|
To pick up a draggable item, press the space bar.
|
|
3
3
|
While dragging, use the arrow keys to move the item.
|
|
4
4
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
5
|
`},ze={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function Be(e){let{announcements:t=ze,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Re}=e,{announce:a,announcement:o}=Pe(),s=Ce(`DndLiveRegion`),[c,l]=(0,P.useState)(!1);if((0,P.useEffect)(()=>{l(!0)},[]),Ie((0,P.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=P.createElement(P.Fragment,null,P.createElement(Me,{id:r,value:i.draggable}),P.createElement(Ne,{id:s,announcement:o}));return n?(0,me.createPortal)(u,n):u}var q;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(q||={});function Ve(){}function He(e,t){return(0,P.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function Ue(){var e=[...arguments];return(0,P.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var J=Object.freeze({x:0,y:0});function We(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function Ge(e,t){let n=Oe(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function Ke(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function qe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Je(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Ye(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function Xe(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var Ze=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Xe(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=We(Xe(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(Ke)},Qe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Je(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=Je(r),o=i.reduce((e,t,r)=>e+We(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(Ke)};function $e(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var et=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=$e(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(qe)};function tt(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function nt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:J}function rt(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var it=rt(1);function at(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function ot(e,t,n){let r=at(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var st={ignoreTransform:!1};function ct(e,t){t===void 0&&(t=st);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=R(e).getComputedStyle(e);t&&(n=ot(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function lt(e){return ct(e,{ignoreTransform:!0})}function ut(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function dt(e,t){return t===void 0&&(t=R(e).getComputedStyle(e)),t.position===`fixed`}function ft(e,t){t===void 0&&(t=R(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function pt(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(ge(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!_e(i)||ve(i)||n.includes(i))return n;let a=R(e).getComputedStyle(i);return i!==e&&ft(i,a)&&n.push(i),dt(i,a)?n:r(i.parentNode)}return e?r(e):n}function mt(e){let[t]=pt(e,1);return t??null}function ht(e){return!F||!e?null:I(e)?e:L(e)?ge(e)||e===z(e).scrollingElement?window:_e(e)?e:null:null}function gt(e){return I(e)?e.scrollX:e.scrollLeft}function _t(e){return I(e)?e.scrollY:e.scrollTop}function vt(e){return{x:gt(e),y:_t(e)}}var Y;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(Y||={});function yt(e){return!F||!e?!1:e===document.scrollingElement}function bt(e){let t={x:0,y:0},n=yt(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var xt={x:.2,y:.2};function St(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=xt);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=bt(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=Y.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=Y.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=Y.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=Y.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function Ct(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function wt(e){return e.reduce((e,t)=>Te(e,vt(t)),J)}function Tt(e){return e.reduce((e,t)=>e+gt(t),0)}function Et(e){return e.reduce((e,t)=>e+_t(t),0)}function Dt(e,t){if(t===void 0&&(t=ct),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);mt(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var Ot=[[`x`,[`left`,`right`],Tt],[`y`,[`top`,`bottom`],Et]],kt=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=pt(t),r=wt(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of Ot)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},At=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function jt(e){let{EventTarget:t}=R(e);return e instanceof t?e:z(e)}function Mt(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var X;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(X||={});function Nt(e){e.preventDefault()}function Pt(e){e.stopPropagation()}var Z;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(Z||={});var Ft={start:[Z.Space,Z.Enter],cancel:[Z.Esc],end:[Z.Space,Z.Enter,Z.Tab]},It=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Z.Right:return{...n,x:n.x+25};case Z.Left:return{...n,x:n.x-25};case Z.Down:return{...n,y:n.y+25};case Z.Up:return{...n,y:n.y-25}}},Lt=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new At(z(t)),this.windowListeners=new At(R(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(X.Resize,this.handleCancel),this.windowListeners.add(X.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(X.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Dt(n),t(J)}handleKeyDown(e){if(W(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=Ft,coordinateGetter:a=It,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:J;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=Ee(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=bt(n),p=Ct(n),m={x:Math.min(i===Z.Right?p.right-p.width/2:p.right,Math.max(i===Z.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===Z.Down?p.bottom-p.height/2:p.bottom,Math.max(i===Z.Down?p.top:p.top+p.height/2,u.y))},h=i===Z.Right&&!s||i===Z.Left&&!c,g=i===Z.Down&&!l||i===Z.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===Z.Right&&e<=d.x||i===Z.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===Z.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===Z.Down&&e<=d.y||i===Z.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===Z.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,Te(Ee(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Lt.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=Ft,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function Rt(e){return!!(e&&`distance`in e)}function zt(e){return!!(e&&`delay`in e)}var Bt=class{constructor(e,t,n){n===void 0&&(n=jt(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=z(i),this.documentListeners=new At(this.document),this.listeners=new At(n),this.windowListeners=new At(R(i)),this.initialCoordinates=Oe(r)??J,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(X.Resize,this.handleCancel),this.windowListeners.add(X.DragStart,Nt),this.windowListeners.add(X.VisibilityChange,this.handleCancel),this.windowListeners.add(X.ContextMenu,Nt),this.documentListeners.add(X.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(zt(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Rt(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(X.Click,Pt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(X.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=Oe(e)??J,s=Ee(n,o);if(!t&&a){if(Rt(a)){if(a.tolerance!=null&&Mt(s,a.tolerance))return this.handleCancel();if(Mt(s,a.distance))return this.handleStart()}if(zt(a)&&Mt(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Z.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Vt={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},Ht=class extends Bt{constructor(e){let{event:t}=e,n=z(t.target);super(e,Vt,n)}};Ht.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var Ut={move:{name:`mousemove`},end:{name:`mouseup`}},Wt;(function(e){e[e.RightClick=2]=`RightClick`})(Wt||={});var Gt=class extends Bt{constructor(e){super(e,Ut,z(e.event.target))}};Gt.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Wt.RightClick?!1:(r?.({event:n}),!0)}}];var Kt={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},qt=class extends Bt{constructor(e){super(e,Kt)}static setup(){return window.addEventListener(Kt.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Kt.move.name,e)};function e(){}}};qt.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var Jt;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(Jt||={});var Yt;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(Yt||={});function Xt(e){let{acceleration:t,activator:n=Jt.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=Yt.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=Qt({delta:d,disabled:!a}),[m,h]=be(),g=(0,P.useRef)({x:0,y:0}),_=(0,P.useRef)({x:0,y:0}),v=(0,P.useMemo)(()=>{switch(n){case Jt.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Jt.DraggableRect:return i}},[n,i,c]),y=(0,P.useRef)(null),b=(0,P.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,P.useMemo)(()=>s===Yt.TreeOrder?[...l].reverse():l,[s,l]);(0,P.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=St(e,i,v,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){h(),y.current=e,m(b,o),g.current=s,_.current=a;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var Zt={x:{[Y.Backward]:!1,[Y.Forward]:!1},y:{[Y.Backward]:!1,[Y.Forward]:!1}};function Qt(e){let{delta:t,disabled:n}=e,r=Se(t);return V(e=>{if(n||!r||!e)return Zt;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Y.Backward]:e.x[Y.Backward]||i.x===-1,[Y.Forward]:e.x[Y.Forward]||i.x===1},y:{[Y.Backward]:e.y[Y.Backward]||i.y===-1,[Y.Forward]:e.y[Y.Forward]||i.y===1}}},[n,t,r])}function $t(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return V(e=>t==null?null:r??e??null,[r,t])}function en(e,t){return(0,P.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var tn;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(tn||={});var nn;(function(e){e.Optimized=`optimized`})(nn||={});var rn=new Map;function an(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,P.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,P.useRef)(e),d=g(),f=xe(d),p=(0,P.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,P.useRef)(null),h=V(t=>{if(d&&!n)return rn;if(!t||t===rn||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new kt(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,P.useEffect)(()=>{u.current=e},[e]),(0,P.useEffect)(()=>{d||p()},[n,d]),(0,P.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,P.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case tn.Always:return!1;case tn.BeforeDragging:return n;default:return!n}}}function on(e,t){return V(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function sn(e,t){return on(e,t)}function cn(e){let{callback:t,disabled:n}=e,r=ye(t),i=(0,P.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,P.useEffect)(()=>()=>i?.disconnect(),[i]),i}function ln(e){let{callback:t,disabled:n}=e,r=ye(t),i=(0,P.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,P.useEffect)(()=>()=>i?.disconnect(),[i]),i}function un(e){return new kt(ct(e),e)}function dn(e,t,n){t===void 0&&(t=un);let[r,i]=(0,P.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=cn({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=ln({callback:a});return B(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function fn(e){return nt(e,on(e))}var pn=[];function mn(e){let t=(0,P.useRef)(e),n=V(n=>e?n&&n!==pn&&e&&t.current&&e.parentNode===t.current.parentNode?n:pt(e):pn,[e]);return(0,P.useEffect)(()=>{t.current=e},[e]),n}function hn(e){let[t,n]=(0,P.useState)(null),r=(0,P.useRef)(e),i=(0,P.useCallback)(e=>{let t=ht(e.target);t&&n(e=>e?(e.set(t,vt(t)),new Map(e)):null)},[]);return(0,P.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=ht(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,vt(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{ht(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,P.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Te(e,t),J):wt(e):J,[e,t])}function gn(e,t){t===void 0&&(t=[]);let n=(0,P.useRef)(null);return(0,P.useEffect)(()=>{n.current=null},t),(0,P.useEffect)(()=>{let t=e!==J;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Ee(e,n.current):J}function _n(e){(0,P.useEffect)(()=>{if(!F)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function vn(e,t){return(0,P.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function yn(e){return(0,P.useMemo)(()=>e?ut(e):null,[e])}var bn=[];function xn(e,t){t===void 0&&(t=ct);let[n]=e,r=yn(n?R(n):null),[i,a]=(0,P.useState)(bn);function o(){a(()=>e.length?e.map(e=>yt(e)?r:new kt(t(e),e)):bn)}let s=ln({callback:o});return B(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function Sn(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return _e(t)?t:e}function Cn(e){let{measure:t}=e,[n,r]=(0,P.useState)(null),i=ln({callback:(0,P.useCallback)(e=>{for(let{target:n}of e)if(_e(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=H((0,P.useCallback)(e=>{let n=Sn(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,P.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var wn=[{sensor:Ht,options:{}},{sensor:Lt,options:{}}],Tn={current:{}},En={draggable:{measure:lt},droppable:{measure:lt,strategy:tn.WhileDragging,frequency:nn.Optimized},dragOverlay:{measure:ct}},Dn=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},On={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Dn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ve},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:En,measureDroppableContainers:Ve,windowRect:null,measuringScheduled:!1},kn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:Ve,draggableNodes:new Map,over:null,measureDroppableContainers:Ve},An=(0,P.createContext)(kn),jn=(0,P.createContext)(On);function Mn(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Dn}}}function Nn(e,t){switch(t.type){case q.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case q.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case q.DragEnd:case q.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case q.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new Dn(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case q.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new Dn(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case q.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new Dn(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Pn(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,P.useContext)(An),a=Se(r),o=Se(n?.id);return(0,P.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!W(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=Ae(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Fn(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function In(e){return(0,P.useMemo)(()=>({draggable:{...En.draggable,...e?.draggable},droppable:{...En.droppable,...e?.droppable},dragOverlay:{...En.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Ln(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,P.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;B(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=nt(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=mt(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var Rn=(0,P.createContext)({...J,scaleX:1,scaleY:1}),zn;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(zn||={});var Bn=(0,P.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=wn,collisionDetection:o=et,measuring:s,modifiers:c,...l}=e,[u,d]=(0,P.useReducer)(Nn,void 0,Mn),[f,p]=Le(),[m,h]=(0,P.useState)(zn.Uninitialized),g=m===zn.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,P.useRef)({initial:null,translated:null}),C=(0,P.useMemo)(()=>_==null?null:{id:_,data:x?.data??Tn,rect:S},[_,x]),w=(0,P.useRef)(null),[ee,te]=(0,P.useState)(null),[T,ne]=(0,P.useState)(null),re=xe(l,Object.values(l)),ie=Ce(`DndDescribedBy`,t),ae=(0,P.useMemo)(()=>b.getEnabled(),[b]),oe=In(s),{droppableRects:E,measureDroppableContainers:se,measuringScheduled:ce}=an(ae,{dragging:g,dependencies:[y.x,y.y],config:oe.droppable}),D=$t(v,_),le=(0,P.useMemo)(()=>T?Oe(T):null,[T]),O=Ae(),ue=sn(D,oe.draggable.measure);Ln({activeNode:_==null?null:v.get(_),config:O.layoutShiftCompensation,initialRect:ue,measure:oe.draggable.measure});let k=dn(D,oe.draggable.measure,ue),de=dn(D?D.parentElement:null),A=(0,P.useRef)({activatorEvent:null,active:null,activeNode:D,collisionRect:null,collisions:null,droppableRects:E,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),j=b.getNodeFor(A.current.over?.id),M=Cn({measure:oe.dragOverlay.measure}),fe=M.nodeRef.current??D,N=g?M.rect??k:null,pe=!!(M.nodeRef.current&&M.rect),he=fn(pe?null:k),F=yn(fe?R(fe):null),I=mn(g?j??D:null),L=xn(I),ge=Fn(c,{transform:{x:y.x-he.x,y:y.y-he.y,scaleX:1,scaleY:1},activatorEvent:T,active:C,activeNodeRect:k,containerNodeRect:de,draggingNodeRect:N,over:A.current.over,overlayNodeRect:M.rect,scrollableAncestors:I,scrollableAncestorRects:L,windowRect:F}),_e=le?Te(le,y):null,ve=hn(I),z=gn(ve),ye=gn(ve,[k]),be=Te(ge,z),V=N?it(N,ge):null,H=C&&V?o({active:C,collisionRect:V,droppableRects:E,droppableContainers:ae,pointerCoordinates:_e}):null,Se=Ye(H,`id`),[U,we]=(0,P.useState)(null),Ee=tt(pe?ge:Te(ge,ye),U?.rect??null,k),De=(0,P.useRef)(null),W=(0,P.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent,o=new n({active:w.current,activeNode:i,event:a,options:r,context:A,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=re.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=re.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=re.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,me.unstable_batchedUpdates)(()=>{r?.(i),h(zn.Initializing),d({type:q.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),te(De.current),ne(a)})},onMove(e){d({type:q.DragMove,coordinates:e})},onEnd:s(q.DragEnd),onCancel:s(q.DragCancel)});De.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=A.current,o=null;if(t&&i){let{cancelDrop:s}=re.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===q.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=q.DragCancel)}w.current=null,(0,me.unstable_batchedUpdates)(()=>{d({type:e}),h(zn.Uninitialized),we(null),te(null),ne(null),De.current=null;let t=e===q.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=re.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),G=en(a,(0,P.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,W(n,t))},[v,W]));_n(a),B(()=>{k&&m===zn.Initializing&&h(zn.Initialized)},[k,m]),(0,P.useEffect)(()=>{let{onDragMove:e}=re.current,{active:t,activatorEvent:n,collisions:r,over:i}=A.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:be.x,y:be.y},over:i};(0,me.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[be.x,be.y]),(0,P.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=A.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=re.current,o=r.get(Se),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,me.unstable_batchedUpdates)(()=>{we(s),a?.(c),f({type:`onDragOver`,event:c})})},[Se]),B(()=>{A.current={activatorEvent:T,active:C,activeNode:D,collisionRect:V,collisions:H,droppableRects:E,draggableNodes:v,draggingNode:fe,draggingNodeRect:N,droppableContainers:b,over:U,scrollableAncestors:I,scrollAdjustedTranslate:be},S.current={initial:N,translated:V}},[C,D,H,V,v,fe,N,E,b,U,I,be]),Xt({...O,delta:y,draggingRect:V,pointerCoordinates:_e,scrollableAncestors:I,scrollableAncestorRects:L});let K=(0,P.useMemo)(()=>({active:C,activeNode:D,activeNodeRect:k,activatorEvent:T,collisions:H,containerNodeRect:de,dragOverlay:M,draggableNodes:v,droppableContainers:b,droppableRects:E,over:U,measureDroppableContainers:se,scrollableAncestors:I,scrollableAncestorRects:L,measuringConfiguration:oe,measuringScheduled:ce,windowRect:F}),[C,D,k,T,H,de,M,v,b,E,U,se,I,L,oe,ce,F]),ke=(0,P.useMemo)(()=>({activatorEvent:T,activators:G,active:C,activeNodeRect:k,ariaDescribedById:{draggable:ie},dispatch:d,draggableNodes:v,over:U,measureDroppableContainers:se}),[T,G,C,k,d,ie,v,U,se]);return P.createElement(Fe.Provider,{value:p},P.createElement(An.Provider,{value:ke},P.createElement(jn.Provider,{value:K},P.createElement(Rn.Provider,{value:Ee},i)),P.createElement(Pn,{disabled:n?.restoreFocus===!1})),P.createElement(Be,{...n,hiddenTextDescribedById:ie}));function Ae(){let e=ee?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),Vn=(0,P.createContext)(null),Hn=`button`,Un=`Draggable`;function Wn(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=Ce(Un),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,P.useContext)(An),{role:p=Hn,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,P.useContext)(g?Rn:Vn),[v,y]=H(),[b,x]=H(),S=vn(o,t),C=xe(n);return B(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,P.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===Hn?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function Gn(){return(0,P.useContext)(jn)}var Kn=`Droppable`,qn={timeout:25};function Jn(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=Ce(Kn),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,P.useContext)(An),u=(0,P.useRef)({disabled:n}),d=(0,P.useRef)(!1),f=(0,P.useRef)(null),p=(0,P.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...qn,...i},_=xe(h??r),v=ln({callback:(0,P.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=H((0,P.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=xe(t);return(0,P.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,P.useEffect)(()=>(s({type:q.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:q.UnregisterDroppable,key:a,id:r})),[r]),(0,P.useEffect)(()=>{n!==u.current.disabled&&(s({type:q.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function Yn(e){let{animation:t,children:n}=e,[r,i]=(0,P.useState)(null),[a,o]=(0,P.useState)(null),s=Se(n);return!n&&!r&&s&&i(s),B(()=>{if(!a)return;let e=r?.key,n=r?.props.id;if(e==null||n==null){i(null);return}Promise.resolve(t(n,a)).then(()=>{i(null)})},[t,r,a]),P.createElement(P.Fragment,null,n,r?(0,P.cloneElement)(r,{ref:o}):null)}var Xn={x:0,y:0,scaleX:1,scaleY:1};function Zn(e){let{children:t}=e;return P.createElement(An.Provider,{value:kn},P.createElement(Rn.Provider,{value:Xn},t))}var Qn={position:`fixed`,touchAction:`none`},$n=e=>W(e)?`transform 250ms ease`:void 0,er=(0,P.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=$n}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...Qn,width:s.width,height:s.height,top:s.top,left:s.left,transform:K.Transform.toString(d),transformOrigin:i&&r?Ge(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return P.createElement(n,{className:o,style:f,ref:t},a)}),tr={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:K.Transform.toString(t)},{transform:K.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function nr(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return ye((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=Sn(a);if(!c)return;let{transform:l}=R(a).getComputedStyle(a),u=at(l);if(!u)return;let d=typeof t==`function`?t:rr(t);return Dt(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function rr(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...tr,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var ir=0;function ar(e){return(0,P.useMemo)(()=>{if(e!=null)return ir++,ir},[e])}var or=P.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=Gn(),S=(0,P.useContext)(Rn),C=ar(d?.id),w=Fn(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:S,windowRect:x}),ee=on(f),te=nr({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),T=ee?g.setRef:void 0;return P.createElement(Zn,null,P.createElement(Yn,{animation:te},d&&C?P.createElement(er,{key:C,id:d.id,ref:T,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:ee,style:{zIndex:l,...i},transform:w},n):null))});function sr(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function cr(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function lr(e){return e!==null&&e>=0}function ur(e,t){if(e===t)return!0;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 dr(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var fr=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=sr(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},pr={scaleX:1,scaleY:1},mr=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...pr}:null}let s=hr(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...pr}:r<t&&r>=a?{x:0,y:o.height+s,...pr}:{x:0,y:0,...pr}};function hr(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var gr=`Sortable`,_r=P.createContext({activeIndex:-1,containerId:gr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:fr,disabled:{draggable:!1,droppable:!1}});function vr(e){let{children:t,id:n,items:r,strategy:i=fr,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=Gn(),d=Ce(gr,n),f=s.rect!==null,p=(0,P.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,P.useRef)(p),v=!ur(p,_.current),y=g!==-1&&h===-1||v,b=dr(a);B(()=>{v&&m&&u(p)},[v,p,m,u]),(0,P.useEffect)(()=>{_.current=p},[p]);let x=(0,P.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:cr(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return P.createElement(_r.Provider,{value:x},t)}var yr=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return sr(n,r,i).indexOf(t)},br=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},xr={duration:200,easing:`ease`},Sr=`transform`,Cr=K.Transition.toString({property:Sr,duration:0,easing:`linear`}),wr={roleDescription:`sortable`};function Tr(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,P.useState)(null),s=(0,P.useRef)(n);return B(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=ct(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,P.useEffect)(()=>{a&&o(null)},[a]),a}function Er(e){let{animateLayoutChanges:t=br,attributes:n,disabled:r,data:i,getNewIndex:a=yr,id:o,strategy:s,resizeObserverConfig:c,transition:l=xr}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,P.useContext)(_r),y=Dr(r,p),b=u.indexOf(o),x=(0,P.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,P.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:ee,setNodeRef:te}=Jn({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:T,activatorEvent:ne,activeNodeRect:re,attributes:ie,setNodeRef:ae,listeners:oe,isDragging:E,over:se,setActivatorNodeRef:ce,transform:D}=Wn({id:o,data:x,attributes:{...wr,...n},disabled:y.draggable}),le=he(te,ae),O=!!T,ue=O&&!m&&lr(f)&&lr(g),k=!_&&E,de=ue?(k&&ue?D:null)??(s??v)({rects:h,activeNodeRect:re,activeIndex:f,overIndex:g,index:b}):null,A=lr(f)&&lr(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,j=T?.id,M=(0,P.useRef)({activeId:j,items:u,newIndex:A,containerId:d}),fe=u!==M.current.items,N=t({active:T,containerId:d,isDragging:E,isSorting:O,id:o,index:b,items:u,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:l,wasDragging:M.current.activeId!=null}),pe=Tr({disabled:!N,index:b,node:w,rect:C});return(0,P.useEffect)(()=>{O&&M.current.newIndex!==A&&(M.current.newIndex=A),d!==M.current.containerId&&(M.current.containerId=d),u!==M.current.items&&(M.current.items=u)},[O,A,d,u]),(0,P.useEffect)(()=>{if(j===M.current.activeId)return;if(j!=null&&M.current.activeId==null){M.current.activeId=j;return}let e=setTimeout(()=>{M.current.activeId=j},50);return()=>clearTimeout(e)},[j]),{active:T,activeIndex:f,attributes:ie,data:x,rect:C,index:b,newIndex:A,items:u,isOver:ee,isSorting:O,isDragging:E,listeners:oe,node:w,overIndex:g,over:se,setNodeRef:le,setActivatorNodeRef:ce,setDroppableNodeRef:te,setDraggableNodeRef:ae,transform:pe??de,transition:me()};function me(){if(pe||fe&&M.current.newIndex===b)return Cr;if(!(k&&!W(ne)||!l)&&(O||N))return K.Transition.toString({...l,property:Sr})}}function Dr(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function Or(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var kr=[Z.Down,Z.Right,Z.Up,Z.Left],Ar=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(kr.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case Z.Down:r.top<a.top&&t.push(n);break;case Z.Up:r.top>a.top&&t.push(n);break;case Z.Left:r.left>a.left&&t.push(n);break;case Z.Right:r.left<a.left&&t.push(n);break}});let c=Qe({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=Ye(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=pt(c).some((e,t)=>s[t]!==e),i=jr(e,t),a=Mr(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:Ee(u,l)}}}};function jr(e,t){return!Or(e)||!Or(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Mr(e,t){return!Or(e)||!Or(t)||!jr(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Nr(e){let t=[];for(let n of e){if(n.command||!n.skill||n.prompt!==void 0&&n.prompt!==`{{task}}`||n.name!==void 0&&n.name!==n.skill||n.model||n.runner||n.allowedTools||n.bashAllowlist||n.onFail||n.timeout!==void 0)return null;t.push(n.skill)}return t.length?t:null}function Pr(e,t){let n=new Set(t.map(e=>e.id)),r=e;for(let t=2;n.has(r);t++)r=`${e}-${t}`;return{id:r,name:e,skill:e,prompt:`{{task}}`}}function Fr(e,t,n){let r=[...e];return r.splice(Math.max(0,Math.min(n,r.length)),0,t),r}function Ir(e,t,n){if(t===n||t<0||t>=e.length||n<0||n>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return i===void 0?[...e]:(r.splice(n,0,i),r)}function Lr(e,t){return e.filter((e,n)=>n!==t)}function Q(e){let t=String(e),n=/^[A-Za-z0-9._][A-Za-z0-9 ._/-]*$/.test(t)&&!t.endsWith(` `),r=/^(true|false|yes|no|on|off|null|~)$/i.test(t)||/^[-+.]?\d/.test(t);return n&&!r?t:JSON.stringify(t)}function Rr(e,t,n){let r=` `.repeat(n);return t.includes(`
|
|
6
6
|
`)?[`${r}${e}: |`,...t.split(`
|
|
7
7
|
`).map(e=>`${r} ${e}`)]:[`${r}${e}: ${Q(t)}`]}function zr(e,t,n){let r=[`name: ${Q(e.trim()||`my-workflow`)}`];t.trim()&&r.push(...Rr(`description`,t.trim(),0));let i=Nr(n);if(i){r.push(`skills:`);for(let e of i)r.push(` - ${Q(e)}`)}else if(n.length){r.push(`steps:`);for(let e of n)r.push(` - id: ${Q(e.id)}`),e.name&&e.name!==e.id&&r.push(` name: ${Q(e.name)}`),e.skill&&r.push(` skill: ${Q(e.skill)}`),e.prompt&&r.push(...Rr(`prompt`,e.prompt,4)),e.model&&r.push(` model: ${Q(e.model)}`),e.runner&&r.push(` runner: ${Q(e.runner)}`),e.allowedTools&&r.push(` allowedTools: [${e.allowedTools.map(Q).join(`, `)}]`),e.bashAllowlist&&r.push(` bashAllowlist: [${e.bashAllowlist.map(Q).join(`, `)}]`),e.timeout&&r.push(` timeout: ${Q(e.timeout)}`),e.command&&r.push(...Rr(`command`,e.command,4)),e.onFail&&r.push(` onFail:`,` retry: ${Q(e.onFail.retry)}`,` max: ${e.onFail.max??2}`)}else r.push(`skills: []`);return`${r.join(`
|
|
8
|
-
`)}\n`}function Br(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`workflow`}function Vr(e){let t=Nr(e)?`skill`:`step`;return`${e.length} ${t}${e.length===1?``:`s`}`}function Hr(e,t){let n=new Set,r=[];for(let t of e.steps.slice(0,8)){let e=t.id||`step`,i=e;for(let t=2;n.has(i);t++)i=`${e}-${t}`;n.add(i),r.push({...t,id:i})}return{name:e.name?.trim()||t,steps:r}}function Ur(e,t,n){let r=Nr(n);return{name:e.trim(),...t.trim()?{description:t.trim()}:{},...r?{skills:r}:{steps:[...n]}}}var $=r(),Wr=`wb-canvas`;function Gr(){return{name:`my-workflow`,description:``,steps:[]}}function Kr(e){return{name:e.name,description:e.description??``,steps:structuredClone(e.steps??[])}}function qr(){let{name:e}=
|
|
8
|
+
`)}\n`}function Br(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`workflow`}function Vr(e){let t=Nr(e)?`skill`:`step`;return`${e.length} ${t}${e.length===1?``:`s`}`}function Hr(e,t){let n=new Set,r=[];for(let t of e.steps.slice(0,8)){let e=t.id||`step`,i=e;for(let t=2;n.has(i);t++)i=`${e}-${t}`;n.add(i),r.push({...t,id:i})}return{name:e.name?.trim()||t,steps:r}}function Ur(e,t,n){let r=Nr(n);return{name:e.trim(),...t.trim()?{description:t.trim()}:{},...r?{skills:r}:{steps:[...n]}}}var $=r(),Wr=`wb-canvas`;function Gr(){return{name:`my-workflow`,description:``,steps:[]}}function Kr(e){return{name:e.name,description:e.description??``,steps:structuredClone(e.steps??[])}}function qr(){let{name:e}=o();return(0,$.jsx)(Jr,{routeName:e},e??``)}function Jr({routeName:e}){let t=a(),n=y(),r=s(),o=c(),[b,S]=(0,P.useState)(null),[C,ee]=(0,P.useState)(``),[ne,ae]=(0,P.useState)(!1),[de,j]=(0,P.useState)(``),[N,me]=(0,P.useState)(``),[he,F]=(0,P.useState)(!1),[I,L]=(0,P.useState)(``),[R,ge]=(0,P.useState)(!1),[_e,ve]=(0,P.useState)(!1),[z,B]=(0,P.useState)(null),[ye,be]=(0,P.useState)(null),xe=(0,P.useRef)(null),V=t.data?.workflows??[],H=n.data??[],Se=A(H,r.data?.skillUsage);(0,P.useEffect)(()=>{if(b!==null||t.data===void 0)return;let n=t.data.workflows,r=(e?n.find(t=>t.name===e):void 0)??n.find(e=>e.source===`file`);S(r?Kr(r):Gr())},[b,t.data,e]);let U=e=>S(t=>t===null?t:{...t,steps:e}),Ce=f({mutationFn:e=>m(e),onSuccess:e=>{S({name:e.name,description:e.description??``,steps:e.steps}),ae(!1),j(``),me(``),g(`Imported "${e.name}" — review, then Save.`)},onError:e=>me(e.message)}),we=f({mutationFn:e=>h(e),onSuccess:e=>{S(t=>{let n=t??Gr(),{name:r,steps:i}=Hr(e,n.name);return{...n,name:r,steps:i}}),F(!1),L(``),g(e.fallback?`Planner unavailable — added a single step. Edit, then Save.`:`Built "${e.name??b?.name??`workflow`}" — review, tweak, then Save.`,e.fallback?{tone:`danger`}:void 0)},onError:e=>g(e instanceof Error?e.message:String(e),{tone:`danger`})}),Te=f({mutationFn:e=>d({...Ur(b?.name??``,b?.description??``,b?.steps??[]),...e?{overwrite:!0}:{}}),onSuccess:e=>{ge(!1),g(`Saved — ${e.path.split(`/`).pop()??e.path}`),o.invalidateQueries({queryKey:_.workflows})},onError:e=>{e instanceof l&&e.exists===!0?ge(!0):g(e instanceof Error?e.message:String(e),{tone:`danger`})}}),Ee=f({mutationFn:e=>u(e),onSuccess:(e,t)=>{ve(!1),g(`Deleted "${t}".`),S(Gr()),o.invalidateQueries({queryKey:_.workflows})},onError:e=>{ve(!1),g(e instanceof Error?e.message:String(e),{tone:`danger`})}}),De=Ue(He(Ht,{activationConstraint:{distance:4}}),He(Lt,{coordinateGetter:Ar}));if(t.isError)return(0,$.jsx)(`div`,{"data-route":`workflows`,className:`flex min-h-full flex-col`,children:(0,$.jsx)(v,{icon:(0,$.jsx)(re,{}),tone:`danger`,title:`Could not load workflows`,subtitle:t.error.message})});if(b===null)return(0,$.jsx)(fe,{});let W=b.steps,G=b.name.trim(),Oe=V.find(e=>e.name===G&&e.source===`file`),K=zr(b.name,b.description,W),ke=(e,t=W.length)=>{if(W.length>=8){g(`A workflow holds at most 8 steps.`,{tone:`danger`});return}U(Fr(W,Pr(e,W),t))},Ae=e=>{let t=e.active.data.current;B(t??null)},je=e=>{be(e.over?String(e.over.id):null)},Me=e=>{B(null),be(null);let{active:t,over:n}=e;if(n===null)return;let r=t.data.current;if(r?.type===`palette`){let e=n.id===Wr?W.length:W.findIndex(e=>e.id===n.id);ke(r.skill,e===-1?W.length:e);return}if(n.id===t.id)return;let i=W.findIndex(e=>e.id===t.id),a=W.findIndex(e=>e.id===n.id);i!==-1&&a!==-1&&U(Ir(W,i,a))},Ne=()=>{let e=de.trim();e!==``&&Ce.mutate(e)},Pe=()=>{let e=I.trim();e===``||we.isPending||we.mutate(e)};return(0,$.jsxs)(`div`,{"data-route":`workflows`,className:`flex min-h-full flex-col`,children:[(0,$.jsxs)(`header`,{className:`sticky top-0 z-10 hidden h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5 md:flex`,children:[(0,$.jsx)(`h1`,{className:`text-base font-semibold`,children:`Workflows`}),(0,$.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Portable skill chains — the agent applies them top to bottom.`})]}),(0,$.jsxs)(Bn,{sensors:De,collisionDetection:Ze,onDragStart:Ae,onDragOver:je,onDragEnd:Me,onDragCancel:()=>{B(null),be(null)},children:[(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col gap-6 p-3 pb-[calc(90px+env(safe-area-inset-bottom))] md:flex-row md:p-5 md:pb-5`,children:[(0,$.jsxs)(`section`,{"data-slot":`wb-main`,className:`mx-auto w-full min-w-0 max-w-3xl flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2.5`,children:[(0,$.jsx)(M,{ref:xe,"data-slot":`wb-name`,"aria-label":`Workflow name`,spellCheck:!1,value:b.name,onChange:e=>S({...b,name:e.target.value}),className:`h-8 max-w-56 font-mono text-[13px] font-semibold`}),(0,$.jsx)(`span`,{"data-slot":`wb-count`,className:`shrink-0 font-mono text-xs text-soft-foreground`,children:Vr(W)})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[Oe?(0,$.jsxs)(p,{type:`button`,variant:`danger-ghost`,size:`sm`,"data-slot":`wb-delete`,title:`Delete the saved workflow file`,onClick:()=>ve(!0),children:[(0,$.jsx)(w,{"aria-hidden":`true`,className:`size-3`}),`Delete`]}):null,(0,$.jsxs)(p,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto`,"aria-expanded":he,title:`Describe a chain — the agent builds it`,onClick:()=>{ae(!1),F(e=>!e)},children:[(0,$.jsx)(pe,{"aria-hidden":`true`,className:`size-3`}),`Auto`]}),(0,$.jsxs)(p,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-import`,onClick:()=>{me(``),F(!1),ae(e=>!e)},children:[(0,$.jsx)(ie,{"aria-hidden":`true`,className:`size-3`}),`Import`]}),(0,$.jsxs)(p,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-export`,title:`Download workflow.yaml`,onClick:()=>{let e=new Blob([K],{type:`text/yaml`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${Br(b.name)}.yaml`,document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)},children:[(0,$.jsx)(te,{"aria-hidden":`true`,className:`size-3`}),`Export`]}),(0,$.jsxs)(p,{type:`button`,variant:`contrast`,size:`sm`,"data-slot":`wb-save`,disabled:Te.isPending,onClick:()=>{if(G===``){xe.current?.focus();return}if(W.length===0){g(`Add at least one step first.`,{tone:`danger`});return}Te.mutate(!1)},children:[(0,$.jsx)(i,{"aria-hidden":`true`,className:`size-3`}),`Save`]})]})]}),(0,$.jsxs)(`div`,{"data-slot":`wb-load`,className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`mr-0.5 text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`edit`}),V.map(e=>(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-load-chip`,"data-name":e.name,title:e.description??``,"aria-pressed":G===e.name,onClick:()=>S(Kr(e)),className:x(`rounded-full border border-border bg-card px-2.5 py-1 font-mono text-[11.5px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,G===e.name&&`border-primary/40 bg-primary/10 text-foreground`),children:e.name},e.name)),(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-new`,title:`Start an empty workflow`,onClick:()=>S(Gr()),className:`rounded-full border border-dashed border-border px-2.5 py-1 font-mono text-[11.5px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:`+ new`})]}),he?(0,$.jsxs)(`div`,{"data-slot":`wb-auto-panel`,className:`mt-4 rounded-lg border border-border bg-card p-3 shadow-xs`,children:[(0,$.jsx)(`div`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`Build a chain from a prompt`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-soft-foreground`,children:`Describe what the chain should do. An agent proposes a title and an ordered set of skill / check steps — land it on the canvas, then tweak and Save.`}),(0,$.jsx)(oe,{"data-slot":`wb-auto-text`,"aria-label":`Describe the chain to build`,rows:3,autoFocus:!0,placeholder:`e.g. Fix the bug, run the tests, then review the diff for regressions.`,value:I,onChange:e=>L(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),Pe())},className:`mt-2 min-h-20 text-[13px]`}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,$.jsxs)(p,{type:`button`,variant:`contrast`,size:`sm`,"data-slot":`wb-auto-run`,disabled:we.isPending||I.trim()===``,onClick:Pe,children:[(0,$.jsx)(pe,{"aria-hidden":`true`,className:`size-3`}),we.isPending?`Building…`:`Build chain`]}),(0,$.jsx)(p,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto-cancel`,onClick:()=>{F(!1),L(``)},children:`Cancel`})]})]}):null,ne?(0,$.jsxs)(`div`,{"data-slot":`wb-import-panel`,className:`mt-4 rounded-lg border border-border bg-card p-3 shadow-xs`,children:[(0,$.jsx)(`div`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`Import workflow YAML`}),(0,$.jsx)(oe,{"data-slot":`wb-import-text`,"aria-label":`Workflow YAML to import`,rows:6,spellCheck:!1,placeholder:`name: my-flow
|
|
9
9
|
skills:
|
|
10
10
|
- test-conventions
|
|
11
|
-
- commit-style`,value:de,onChange:e=>j(e.target.value),className:`mt-2 min-h-28 font-mono text-xs`}),N===``?null:(0,$.jsx)(`p`,{"data-slot":`wb-import-error`,className:`mt-2 text-xs text-danger`,children:N}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,$.jsx)(f,{type:`button`,variant:`contrast`,size:`sm`,"data-slot":`wb-import-run`,disabled:Ce.isPending,onClick:Ne,children:`Import`}),(0,$.jsx)(f,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-import-cancel`,onClick:()=>{ae(!1),j(``),me(``)},children:`Cancel`})]})]}):null,(0,$.jsx)(Yr,{steps:W,skills:H,dragging:z!==null,overId:ye,activeStepId:z?.type===`step`?z.step.id:null,onRemove:e=>U(Lr(W,e))})]}),(0,$.jsxs)(`aside`,{"data-slot":`wb-aside`,className:`w-full shrink-0 md:w-[320px]`,children:[(0,$.jsx)(`div`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`Skills`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-soft-foreground`,children:`Drag into the flow. Order is execution order — the agent applies them top to bottom.`}),(0,$.jsx)(M,{"data-slot":`wb-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:C,onChange:e=>ee(e.target.value),className:`mt-2.5 h-8 text-[13px]`}),(0,$.jsx)(Qr,{skills:Se,query:C,error:n.isError?n.error.message:null,inFlow:new Set(W.map(e=>e.skill).filter(e=>!!e)),onAdd:e=>ke(e)}),(0,$.jsxs)(`div`,{className:`mt-5 flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`workflow.yaml`}),(0,$.jsx)(`span`,{className:`flex-1`}),(0,$.jsx)(ei,{yaml:K})]}),(0,$.jsx)(`pre`,{"data-slot":`wb-yaml`,className:`mt-2 overflow-x-auto rounded-lg border border-border bg-card p-3 font-mono text-[11.5px] leading-relaxed whitespace-pre text-muted-foreground shadow-xs`,children:K}),(0,$.jsx)(`p`,{className:`mt-2 text-[11.5px] leading-relaxed text-soft-foreground`,children:`Portable — export this file and import it in any repo running xezar.`})]})]}),(0,$.jsx)(or,{children:z?.type===`palette`?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-[13px] font-medium shadow-md`,children:[(0,$.jsx)(T,{"aria-hidden":`true`,className:`size-3.5 text-primary`}),z.skill]}):z?.type===`step`?(0,$.jsx)(Zr,{step:z.step,index:W.findIndex(e=>e.id===z.step.id),skills:H,overlay:!0}):null})]}),(0,$.jsx)(k,{open:R,onOpenChange:e=>!e&&ge(!1),children:(0,$.jsxs)(ce,{"data-slot":`wb-overwrite-dialog`,children:[(0,$.jsxs)(ue,{children:[(0,$.jsxs)(se,{children:[`“`,G,`” already exists`]}),(0,$.jsx)(E,{children:`Saving overwrites the existing workflow file. There is no undo.`})]}),(0,$.jsxs)(le,{children:[(0,$.jsx)(O,{children:`Keep the file`}),(0,$.jsx)(D,{"data-slot":`wb-overwrite-confirm`,onClick:()=>Te.mutate(!0),children:`Overwrite`})]})]})}),(0,$.jsx)(k,{open:_e,onOpenChange:e=>!e&&ve(!1),children:(0,$.jsxs)(ce,{"data-slot":`wb-delete-dialog`,children:[(0,$.jsxs)(ue,{children:[(0,$.jsxs)(se,{children:[`Delete workflow “`,G,`”?`]}),(0,$.jsxs)(E,{children:[`Removes `,Oe?.path?.split(`/`).pop()??`the saved file`,` from`,` `,(0,$.jsx)(`span`,{className:`font-mono`,children:`.xezar/workflows/`}),`. There is no undo.`]})]}),(0,$.jsxs)(le,{children:[(0,$.jsx)(O,{children:`Keep it`}),(0,$.jsx)(D,{"data-slot":`wb-delete-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>Ee.mutate(G),children:`Delete`})]})]})})]})}function Yr({steps:e,skills:t,dragging:n,overId:r,activeStepId:i,onRemove:a}){let{setNodeRef:o,isOver:s}=Jn({id:Wr}),c=n&&r===Wr;return(0,$.jsx)(`div`,{ref:o,"data-slot":`wb-steps`,"data-dragging":n||void 0,className:x(`mt-4 rounded-lg border border-dashed p-2 transition-colors`,s?`border-primary/60 bg-primary/5`:`border-muted-foreground/25`),children:e.length===0?(0,$.jsx)(`p`,{className:x(`rounded-md px-3 py-10 text-center text-[13px] transition-colors`,s?`text-primary`:`text-muted-foreground`),children:`Drop a skill here — or Import a workflow.yaml`}):(0,$.jsxs)(vr,{items:e.map(e=>e.id),strategy:mr,children:[(0,$.jsx)(`ol`,{className:`flex flex-col gap-2.5`,children:e.map((e,o)=>(0,$.jsx)(Xr,{step:e,index:o,skills:t,connector:o>0,dragging:n,insertBefore:n&&r===e.id&&i!==e.id,onRemove:()=>a(o)},e.id))}),(0,$.jsx)(`div`,{"aria-hidden":`true`,className:x(`mx-1 mt-2.5 h-[3px] rounded-full transition-colors`,c?`bg-primary`:`bg-transparent`)}),(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-1.5 pt-1.5 pb-1 text-[11px] text-muted-foreground`,children:[(0,$.jsx)(S,{"aria-hidden":`true`,className:`size-3`}),`runs top to bottom`]})]})})}function Xr({step:e,index:t,skills:n,connector:r,dragging:i,insertBefore:a,onRemove:o}){let{attributes:s,listeners:c,setNodeRef:l,transform:u,transition:d,isDragging:f}=Er({id:e.id,data:{type:`step`,step:e}});return(0,$.jsxs)(`li`,{ref:l,style:{transform:K.Transform.toString(u),transition:d},className:x(`relative`,f&&`opacity-40`),children:[r&&!i?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute -top-[11px] left-1/2 h-[9px] w-px -translate-x-1/2 bg-muted-foreground/30`}):null,a?(0,$.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`wb-drop-line`,className:`pointer-events-none absolute -top-[7px] right-0 left-0 h-[3px] rounded-full bg-primary`}):null,(0,$.jsx)(Zr,{step:e,index:t,skills:n,onRemove:o,gripProps:{...s,...c}})]})}function Zr({step:e,index:t,skills:n,onRemove:r,gripProps:i,overlay:a=!1}){let o=n.find(t=>t.name===e.skill),s=!!e.command,c=s||!e.skill?e.name??e.id:e.skill,l=s?`$ ${e.command}${e.onFail?` — on fail retry from "${e.onFail.retry}" (×${e.onFail.max??2})`:``}`:e.skill?o?.description??`Not in this repo or the team skills — the step runs on its plain prompt.`:e.prompt??``,u=s?`check`:e.skill?o?null:`unknown`:`prompt`;return(0,$.jsxs)(`div`,{"data-slot":`wb-step`,"data-id":e.id,"data-index":t,className:x(`flex items-center gap-2.5 rounded-md border border-muted-foreground/20 bg-card-2 px-2.5 py-2 shadow-xs`,a&&`shadow-md`),children:[(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-step-grip`,"aria-label":`Reorder step ${t+1}: ${c}`,className:`shrink-0 cursor-grab rounded text-muted-foreground outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50`,...i,children:(0,$.jsx)(j,{"aria-hidden":`true`,className:`size-3.5`})}),(0,$.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:String(t+1).padStart(2,`0`)}),s?(0,$.jsx)(ne,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-success`}):(0,$.jsx)(T,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-mono text-[13px] font-medium`,children:c}),l?(0,$.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:l}):null]}),u?(0,$.jsx)(`span`,{"data-slot":`wb-step-badge`,className:x(`shrink-0 rounded-full border px-2 py-px font-mono text-[10.5px]`,u===`check`&&`border-success/30 text-success`,u===`unknown`&&`border-danger/35 text-danger`,u===`prompt`&&`border-border text-soft-foreground`),children:u}):null,r?(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-step-remove`,"aria-label":`Remove step ${t+1}: ${c}`,title:`Remove from flow`,onClick:r,className:`shrink-0 rounded p-0.5 text-soft-foreground transition-colors outline-none hover:text-danger focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:(0,$.jsx)(ae,{"aria-hidden":`true`,className:`size-3.5`})}):null]})}function Qr({skills:e,query:t,error:n,inFlow:r,onAdd:i}){if(n!==null)return(0,$.jsxs)(`p`,{"data-slot":`wb-palette`,className:`mt-2.5 text-xs text-danger`,children:[`Could not load skills: `,n]});let a=t.trim().toLowerCase(),o=e.filter(e=>a===``||e.name.toLowerCase().includes(a)||(e.description??``).toLowerCase().includes(a));return(0,$.jsx)(`div`,{"data-slot":`wb-palette`,className:`mt-2.5 flex flex-col gap-1`,children:o.length>0?o.map(e=>(0,$.jsx)($r,{skill:e,inFlow:r.has(e.name),onAdd:i},e.path)):(0,$.jsx)(`p`,{className:`py-1 text-xs leading-relaxed text-soft-foreground`,children:e.length>0?`No skills match.`:(0,$.jsx)(ee,{})})})}function $r({skill:e,inFlow:t,onAdd:n}){let{attributes:r,listeners:a,setNodeRef:o,isDragging:s}=Wn({id:`palette:${e.name}`,data:{type:`palette`,skill:e.name}});return(0,$.jsxs)(`div`,{ref:o,"data-slot":`wb-skill`,"data-skill":e.name,title:e.description??``,className:x(`flex cursor-grab items-center gap-2 rounded-md border border-border bg-card px-2.5 py-1.5 shadow-xs transition-colors hover:bg-muted`,s&&`opacity-40`),...r,...a,children:[(0,$.jsx)(T,{"aria-hidden":`true`,className:x(`size-3.5 shrink-0`,de(e)?`text-violet`:`text-soft-foreground`)}),(0,$.jsx)(`span`,{className:x(`min-w-0 flex-1 truncate font-mono text-[13px]`,de(e)?`font-semibold text-foreground`:`font-medium text-muted-foreground`),children:e.name}),t?(0,$.jsx)(i,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-success`}):null,(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-skill-add`,"aria-label":`Add ${e.name} to the flow`,title:`Add to the flow`,onClick:()=>n(e.name),className:`shrink-0 rounded p-0.5 text-soft-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:(0,$.jsx)(N,{"aria-hidden":`true`,className:`size-3.5`})})]})}function ei({yaml:e}){let[t,n]=(0,P.useState)(!1),r=(0,P.useRef)(null);return(0,P.useEffect)(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]),(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-copy`,title:`Copy the YAML`,onClick:()=>{navigator.clipboard?.writeText(e).catch(()=>{}),n(!0),r.current!==null&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1600)},className:`flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,children:t?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(i,{"aria-hidden":`true`,className:`size-3 text-success`}),`Copied`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(C,{"aria-hidden":`true`,className:`size-3`}),`Copy`]})})}export{qr as WorkflowsRoute};
|
|
11
|
+
- commit-style`,value:de,onChange:e=>j(e.target.value),className:`mt-2 min-h-28 font-mono text-xs`}),N===``?null:(0,$.jsx)(`p`,{"data-slot":`wb-import-error`,className:`mt-2 text-xs text-danger`,children:N}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,$.jsx)(p,{type:`button`,variant:`contrast`,size:`sm`,"data-slot":`wb-import-run`,disabled:Ce.isPending,onClick:Ne,children:`Import`}),(0,$.jsx)(p,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-import-cancel`,onClick:()=>{ae(!1),j(``),me(``)},children:`Cancel`})]})]}):null,(0,$.jsx)(Yr,{steps:W,skills:H,dragging:z!==null,overId:ye,activeStepId:z?.type===`step`?z.step.id:null,onRemove:e=>U(Lr(W,e))})]}),(0,$.jsxs)(`aside`,{"data-slot":`wb-aside`,className:`w-full shrink-0 md:w-[320px]`,children:[(0,$.jsx)(`div`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`Skills`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-soft-foreground`,children:`Drag into the flow. Order is execution order — the agent applies them top to bottom.`}),(0,$.jsx)(M,{"data-slot":`wb-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:C,onChange:e=>ee(e.target.value),className:`mt-2.5 h-8 text-[13px]`}),(0,$.jsx)(Qr,{skills:Se,query:C,error:n.isError?n.error.message:null,inFlow:new Set(W.map(e=>e.skill).filter(e=>!!e)),onAdd:e=>ke(e)}),(0,$.jsxs)(`div`,{className:`mt-5 flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:`workflow.yaml`}),(0,$.jsx)(`span`,{className:`flex-1`}),(0,$.jsx)(ei,{yaml:K})]}),(0,$.jsx)(`pre`,{"data-slot":`wb-yaml`,className:`mt-2 overflow-x-auto rounded-lg border border-border bg-card p-3 font-mono text-[11.5px] leading-relaxed whitespace-pre text-muted-foreground shadow-xs`,children:K}),(0,$.jsx)(`p`,{className:`mt-2 text-[11.5px] leading-relaxed text-soft-foreground`,children:`Portable — export this file and import it in any repo running xezar.`})]})]}),(0,$.jsx)(or,{children:z?.type===`palette`?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-[13px] font-medium shadow-md`,children:[(0,$.jsx)(T,{"aria-hidden":`true`,className:`size-3.5 text-primary`}),z.skill]}):z?.type===`step`?(0,$.jsx)(Zr,{step:z.step,index:W.findIndex(e=>e.id===z.step.id),skills:H,overlay:!0}):null})]}),(0,$.jsx)(k,{open:R,onOpenChange:e=>!e&&ge(!1),children:(0,$.jsxs)(ce,{"data-slot":`wb-overwrite-dialog`,children:[(0,$.jsxs)(ue,{children:[(0,$.jsxs)(se,{children:[`“`,G,`” already exists`]}),(0,$.jsx)(E,{children:`Saving overwrites the existing workflow file. There is no undo.`})]}),(0,$.jsxs)(le,{children:[(0,$.jsx)(O,{children:`Keep the file`}),(0,$.jsx)(D,{"data-slot":`wb-overwrite-confirm`,onClick:()=>Te.mutate(!0),children:`Overwrite`})]})]})}),(0,$.jsx)(k,{open:_e,onOpenChange:e=>!e&&ve(!1),children:(0,$.jsxs)(ce,{"data-slot":`wb-delete-dialog`,children:[(0,$.jsxs)(ue,{children:[(0,$.jsxs)(se,{children:[`Delete workflow “`,G,`”?`]}),(0,$.jsxs)(E,{children:[`Removes `,Oe?.path?.split(`/`).pop()??`the saved file`,` from`,` `,(0,$.jsx)(`span`,{className:`font-mono`,children:`.xezar/workflows/`}),`. There is no undo.`]})]}),(0,$.jsxs)(le,{children:[(0,$.jsx)(O,{children:`Keep it`}),(0,$.jsx)(D,{"data-slot":`wb-delete-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>Ee.mutate(G),children:`Delete`})]})]})})]})}function Yr({steps:e,skills:t,dragging:n,overId:r,activeStepId:i,onRemove:a}){let{setNodeRef:o,isOver:s}=Jn({id:Wr}),c=n&&r===Wr;return(0,$.jsx)(`div`,{ref:o,"data-slot":`wb-steps`,"data-dragging":n||void 0,className:x(`mt-4 rounded-lg border border-dashed p-2 transition-colors`,s?`border-primary/60 bg-primary/5`:`border-muted-foreground/25`),children:e.length===0?(0,$.jsx)(`p`,{className:x(`rounded-md px-3 py-10 text-center text-[13px] transition-colors`,s?`text-primary`:`text-muted-foreground`),children:`Drop a skill here — or Import a workflow.yaml`}):(0,$.jsxs)(vr,{items:e.map(e=>e.id),strategy:mr,children:[(0,$.jsx)(`ol`,{className:`flex flex-col gap-2.5`,children:e.map((e,o)=>(0,$.jsx)(Xr,{step:e,index:o,skills:t,connector:o>0,dragging:n,insertBefore:n&&r===e.id&&i!==e.id,onRemove:()=>a(o)},e.id))}),(0,$.jsx)(`div`,{"aria-hidden":`true`,className:x(`mx-1 mt-2.5 h-[3px] rounded-full transition-colors`,c?`bg-primary`:`bg-transparent`)}),(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-1.5 pt-1.5 pb-1 text-[11px] text-muted-foreground`,children:[(0,$.jsx)(S,{"aria-hidden":`true`,className:`size-3`}),`runs top to bottom`]})]})})}function Xr({step:e,index:t,skills:n,connector:r,dragging:i,insertBefore:a,onRemove:o}){let{attributes:s,listeners:c,setNodeRef:l,transform:u,transition:d,isDragging:f}=Er({id:e.id,data:{type:`step`,step:e}});return(0,$.jsxs)(`li`,{ref:l,style:{transform:K.Transform.toString(u),transition:d},className:x(`relative`,f&&`opacity-40`),children:[r&&!i?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute -top-[11px] left-1/2 h-[9px] w-px -translate-x-1/2 bg-muted-foreground/30`}):null,a?(0,$.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`wb-drop-line`,className:`pointer-events-none absolute -top-[7px] right-0 left-0 h-[3px] rounded-full bg-primary`}):null,(0,$.jsx)(Zr,{step:e,index:t,skills:n,onRemove:o,gripProps:{...s,...c}})]})}function Zr({step:e,index:t,skills:n,onRemove:r,gripProps:i,overlay:a=!1}){let o=n.find(t=>t.name===e.skill),s=!!e.command,c=s||!e.skill?e.name??e.id:e.skill,l=s?`$ ${e.command}${e.onFail?` — on fail retry from "${e.onFail.retry}" (×${e.onFail.max??2})`:``}`:e.skill?o?.description??`Not in this repo or the team skills — the step runs on its plain prompt.`:e.prompt??``,u=s?`check`:e.skill?o?null:`unknown`:`prompt`;return(0,$.jsxs)(`div`,{"data-slot":`wb-step`,"data-id":e.id,"data-index":t,className:x(`flex items-center gap-2.5 rounded-md border border-muted-foreground/20 bg-card-2 px-2.5 py-2 shadow-xs`,a&&`shadow-md`),children:[(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-step-grip`,"aria-label":`Reorder step ${t+1}: ${c}`,className:`shrink-0 cursor-grab rounded text-muted-foreground outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50`,...i,children:(0,$.jsx)(N,{"aria-hidden":`true`,className:`size-3.5`})}),(0,$.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:String(t+1).padStart(2,`0`)}),s?(0,$.jsx)(ne,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-success`}):(0,$.jsx)(T,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-mono text-[13px] font-medium`,children:c}),l?(0,$.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:l}):null]}),u?(0,$.jsx)(`span`,{"data-slot":`wb-step-badge`,className:x(`shrink-0 rounded-full border px-2 py-px font-mono text-[10.5px]`,u===`check`&&`border-success/30 text-success`,u===`unknown`&&`border-danger/35 text-danger`,u===`prompt`&&`border-border text-soft-foreground`),children:u}):null,r?(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-step-remove`,"aria-label":`Remove step ${t+1}: ${c}`,title:`Remove from flow`,onClick:r,className:`shrink-0 rounded p-0.5 text-soft-foreground transition-colors outline-none hover:text-danger focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:(0,$.jsx)(ae,{"aria-hidden":`true`,className:`size-3.5`})}):null]})}function Qr({skills:e,query:t,error:n,inFlow:r,onAdd:i}){if(n!==null)return(0,$.jsxs)(`p`,{"data-slot":`wb-palette`,className:`mt-2.5 text-xs text-danger`,children:[`Could not load skills: `,n]});let a=t.trim().toLowerCase(),o=e.filter(e=>a===``||e.name.toLowerCase().includes(a)||(e.description??``).toLowerCase().includes(a));return(0,$.jsx)(`div`,{"data-slot":`wb-palette`,className:`mt-2.5 flex flex-col gap-1`,children:o.length>0?o.map(e=>(0,$.jsx)($r,{skill:e,inFlow:r.has(e.name),onAdd:i},e.path)):(0,$.jsx)(`p`,{className:`py-1 text-xs leading-relaxed text-soft-foreground`,children:e.length>0?`No skills match.`:(0,$.jsx)(ee,{})})})}function $r({skill:e,inFlow:t,onAdd:n}){let{attributes:r,listeners:a,setNodeRef:o,isDragging:s}=Wn({id:`palette:${e.name}`,data:{type:`palette`,skill:e.name}});return(0,$.jsxs)(`div`,{ref:o,"data-slot":`wb-skill`,"data-skill":e.name,title:e.description??``,className:x(`flex cursor-grab items-center gap-2 rounded-md border border-border bg-card px-2.5 py-1.5 shadow-xs transition-colors hover:bg-muted`,s&&`opacity-40`),...r,...a,children:[(0,$.jsx)(T,{"aria-hidden":`true`,className:x(`size-3.5 shrink-0`,de(e)?`text-violet`:`text-soft-foreground`)}),(0,$.jsx)(`span`,{className:x(`min-w-0 flex-1 truncate font-mono text-[13px]`,de(e)?`font-semibold text-foreground`:`font-medium text-muted-foreground`),children:e.name}),t?(0,$.jsx)(i,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-success`}):null,(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-skill-add`,"aria-label":`Add ${e.name} to the flow`,title:`Add to the flow`,onClick:()=>n(e.name),className:`shrink-0 rounded p-0.5 text-soft-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:(0,$.jsx)(j,{"aria-hidden":`true`,className:`size-3.5`})})]})}function ei({yaml:e}){let[t,n]=(0,P.useState)(!1),r=(0,P.useRef)(null);return(0,P.useEffect)(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]),(0,$.jsx)(`button`,{type:`button`,"data-slot":`wb-copy`,title:`Copy the YAML`,onClick:()=>{navigator.clipboard?.writeText(e).catch(()=>{}),n(!0),r.current!==null&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1600)},className:`flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,children:t?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(i,{"aria-hidden":`true`,className:`size-3 text-success`}),`Copied`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(C,{"aria-hidden":`true`,className:`size-3`}),`Copy`]})})}export{qr as WorkflowsRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{l as i,t as a}from"./utils
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{l as i,t as a}from"./utils-YwBpOoRN.js";var o=e(t(),1),s=e(n(),1),c=r();function l({src:e,alt:t=``,className:n,...r}){let[l,u]=(0,o.useState)(!1),d=i(e);return(0,o.useEffect)(()=>{if(!l)return;let e=e=>{e.key===`Escape`&&u(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[l]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`img`,{...r,src:d,alt:t,loading:`lazy`,onClick:()=>u(!0),className:a(`cursor-zoom-in`,n)}),l?(0,s.createPortal)((0,c.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Image preview`,"data-slot":`image-lightbox`,onClick:()=>u(!1),className:`fixed inset-0 z-[100] flex cursor-zoom-out items-center justify-center bg-black/80 p-4 backdrop-blur-sm`,children:(0,c.jsx)(`img`,{src:d,alt:t,className:`max-h-full max-w-full rounded-md object-contain shadow-2xl`})}),document.body):null]})}export{l as t};
|