@powerhousedao/ph-clint-app 0.1.0-dev.90 → 0.1.0-dev.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/connect-ayTpkZ7D.js.map +1 -1
- package/dist/browser/document-models/index.js +1 -1
- package/dist/browser/document-models/ph-clint-project/index.js +2 -2
- package/dist/browser/{editor-Bp2wUo8R.js → editor-BmNIZjpu.js} +3 -3
- package/dist/browser/{editor-Bp2wUo8R.js.map → editor-BmNIZjpu.js.map} +1 -1
- package/dist/browser/editors/ph-clint-project-editor/module.js +1 -1
- package/dist/browser/factory-6X-atFO0.js.map +1 -1
- package/dist/browser/index.js +6 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/{module-B16ZT36n.js → module-BzVWlfCE.js} +19 -7
- package/dist/browser/module-BzVWlfCE.js.map +1 -0
- package/dist/browser/{ph-clint-project-CHq59BKL.js → ph-clint-project-1Xn2yUDQ.js} +3 -15
- package/dist/browser/ph-clint-project-1Xn2yUDQ.js.map +1 -0
- package/dist/browser/subgraphs/index.js +8 -0
- package/dist/browser/subgraphs/index.js.map +1 -0
- package/dist/browser/switchboard-DyNO-2Mk.js.map +1 -1
- package/dist/connect/__react__/chunks/chunk-DV4czemZ.js +1 -0
- package/dist/connect/__react__/chunks/{react-DInDUHsR.js → react-6__-7Yi6.js} +1 -1
- package/dist/connect/__react__/chunks/{react-dom-QyonbUot.js → react-dom-D8SQgl6v.js} +1 -1
- package/dist/connect/__react__/chunks/{react-dom-server-legacy.browser.production-KSpBOUM7.js → react-dom-server-legacy.browser.production-tEo0fxOJ.js} +2 -2
- package/dist/connect/__react__/chunks/{react-dom-server.browser.production-NeoI_ldE.js → react-dom-server.browser.production-CWSDDfJ2.js} +2 -2
- package/dist/connect/__react__/chunks/{react-dom-server.edge.production-Djx8cQAo.js → react-dom-server.edge.production-K2OjKVH3.js} +2 -2
- package/dist/connect/__react__/chunks/{scheduler-CxGS3ZcN.js → scheduler-C_FnfDtC.js} +1 -1
- package/dist/connect/__react__/chunks/server.browser-Bu7JkTx-.js +1 -0
- package/dist/connect/__react__/chunks/static.browser-C6ypYl2H.js +1 -0
- package/dist/connect/__react__/react/compiler-runtime.js +1 -1
- package/dist/connect/__react__/react/jsx-dev-runtime.js +1 -1
- package/dist/connect/__react__/react/jsx-runtime.js +1 -1
- package/dist/connect/__react__/react-dom/client.js +1 -1
- package/dist/connect/__react__/react-dom/profiling.js +1 -1
- package/dist/connect/__react__/react-dom/server.browser.js +1 -1
- package/dist/connect/__react__/react-dom/server.edge.js +1 -1
- package/dist/connect/__react__/react-dom/server.js +1 -1
- package/dist/connect/__react__/react-dom/static.browser.js +1 -1
- package/dist/connect/__react__/react-dom/static.edge.js +1 -1
- package/dist/connect/__react__/react-dom/static.js +1 -1
- package/dist/connect/__react__/react-dom/test-utils.js +1 -1
- package/dist/connect/__react__/react-dom.js +1 -1
- package/dist/connect/__react__/react.js +1 -1
- package/dist/connect/assets/{ClearStorageModal-CXoNWmRe-D3ifKRm-.js → ClearStorageModal-CXoNWmRe-CpE72nB8.js} +2 -2
- package/dist/connect/assets/{ClearStorageModal-CXoNWmRe-D3ifKRm-.js.map → ClearStorageModal-CXoNWmRe-CpE72nB8.js.map} +1 -1
- package/dist/connect/assets/{DebugSettingsModal-5SDhy5gt-DLMPdDQB.js → DebugSettingsModal-5SDhy5gt-Me3H9oNw.js} +2 -2
- package/dist/connect/assets/{DebugSettingsModal-5SDhy5gt-DLMPdDQB.js.map → DebugSettingsModal-5SDhy5gt-Me3H9oNw.js.map} +1 -1
- package/dist/connect/assets/{InspectorModal-BsSihzuc-B0n5gbGB.js → InspectorModal-BsSihzuc-DVTFZSUH.js} +2 -2
- package/dist/connect/assets/{InspectorModal-BsSihzuc-B0n5gbGB.js.map → InspectorModal-BsSihzuc-DVTFZSUH.js.map} +1 -1
- package/dist/connect/assets/{SettingsModal-S_A5qf95-uzigz0nk.js → SettingsModal-S_A5qf95-nzYOCl3o.js} +2 -2
- package/dist/connect/assets/{SettingsModal-S_A5qf95-uzigz0nk.js.map → SettingsModal-S_A5qf95-nzYOCl3o.js.map} +1 -1
- package/dist/connect/assets/{components-ByEUkO4U-xPZUVkzr.js → components-ByEUkO4U-DoBYY0k7.js} +4 -4
- package/dist/connect/assets/{components-ByEUkO4U-xPZUVkzr.js.map → components-ByEUkO4U-DoBYY0k7.js.map} +1 -1
- package/dist/connect/assets/connect-DGfzdELb.js.map +1 -1
- package/dist/connect/assets/{connect.config-Bt4pvvWV-Dj3FkjaZ.js → connect.config-Bt4pvvWV-DPiXrGYV.js} +2 -2
- package/dist/connect/assets/{connect.config-Bt4pvvWV-Dj3FkjaZ.js.map → connect.config-Bt4pvvWV-DPiXrGYV.js.map} +1 -1
- package/dist/connect/assets/editor-Bds50MuL.js +2 -0
- package/dist/connect/assets/{editor-BaQ62r3i.js.map → editor-Bds50MuL.js.map} +1 -1
- package/dist/connect/assets/hooks-CE3gZpe3.js +2 -0
- package/dist/connect/assets/hooks-CE3gZpe3.js.map +1 -0
- package/dist/connect/assets/{ph-clint-project-p1zY6e17.js → index-CK9tPzCS.js} +4 -3
- package/dist/connect/assets/index-CK9tPzCS.js.map +1 -0
- package/dist/connect/assets/index-Skfhz8KO.css +2 -0
- package/dist/connect/assets/{load-BWibkoFV-CDRjWwYQ.js → load-BWibkoFV-DWy1LALw.js} +2 -2
- package/dist/connect/assets/{load-BWibkoFV-CDRjWwYQ.js.map → load-BWibkoFV-DWy1LALw.js.map} +1 -1
- package/dist/connect/assets/{module-7zCQE1MC.js → module-5NdQh7xr.js} +2 -2
- package/dist/connect/assets/{module-7zCQE1MC.js.map → module-5NdQh7xr.js.map} +1 -1
- package/dist/connect/assets/{pglite-seed-BWk7yOwr-b2F0oJiP.js → pglite-seed-BWk7yOwr-BHQsaOhO.js} +2 -2
- package/dist/connect/assets/{pglite-seed-BWk7yOwr-b2F0oJiP.js.map → pglite-seed-BWk7yOwr-BHQsaOhO.js.map} +1 -1
- package/dist/connect/assets/{reactor-BxNvHOKC-CeMF1M2u.js → reactor-BxNvHOKC-CSy_kfH0.js} +2 -2
- package/dist/connect/assets/{reactor-BxNvHOKC-CeMF1M2u.js.map → reactor-BxNvHOKC-CSy_kfH0.js.map} +1 -1
- package/dist/connect/assets/{registerServiceWorker-D9l1kja7-DG3DqQna.js → registerServiceWorker-D9l1kja7-C-5yx671.js} +2 -2
- package/dist/connect/assets/{registerServiceWorker-D9l1kja7-DG3DqQna.js.map → registerServiceWorker-D9l1kja7-C-5yx671.js.map} +1 -1
- package/dist/connect/assets/switchboard-CPQzDmSh.js.map +1 -1
- package/dist/connect/index.html +6 -9
- package/dist/connect/powerhouse.config.json +3 -2
- package/dist/node/connect-CIR7GJmj.mjs.map +1 -1
- package/dist/node/document-models/index.mjs +1 -1
- package/dist/node/document-models/ph-clint-project/index.mjs +2 -2
- package/dist/node/{editor-BC9t7D3T.mjs → editor-8cCevQVX.mjs} +3 -3
- package/dist/node/{editor-BC9t7D3T.mjs.map → editor-8cCevQVX.mjs.map} +1 -1
- package/dist/node/editors/ph-clint-project-editor/module.mjs +1 -1
- package/dist/node/factory-BV9KTFaw.mjs.map +1 -1
- package/dist/node/index.mjs +6 -2
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/{module-BPw40Ypp.mjs → module-CJId0WUE.mjs} +19 -7
- package/dist/node/module-CJId0WUE.mjs.map +1 -0
- package/dist/node/{ph-clint-project-B5IjiXbp.mjs → ph-clint-project-CqqaE1LT.mjs} +3 -15
- package/dist/node/ph-clint-project-CqqaE1LT.mjs.map +1 -0
- package/dist/node/subgraphs/index.mjs +8 -0
- package/dist/node/subgraphs/index.mjs.map +1 -0
- package/dist/node/switchboard-kqcv15ax.mjs.map +1 -1
- package/dist/powerhouse.manifest.json +26 -26
- package/dist/style.css +198 -178
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/document-models/document-models.d.ts +30 -15
- package/dist/types/document-models/document-models.d.ts.map +1 -1
- package/dist/types/document-models/index.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/gen/schema/types.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/gen/schema/zod.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/index.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/upgrades/index.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/upgrades/upgrade-manifest.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/upgrades/upgrade-manifest.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/actions.d.ts +30 -15
- package/dist/types/document-models/ph-clint-project/v1/actions.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/actions.d.ts +29 -19
- package/dist/types/document-models/ph-clint-project/v1/gen/actions.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/controller.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/v1/gen/controller.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/creators.d.ts +28 -18
- package/dist/types/document-models/ph-clint-project/v1/gen/creators.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/deployment/actions.d.ts +10 -6
- package/dist/types/document-models/ph-clint-project/v1/gen/deployment/actions.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/deployment/creators.d.ts +3 -2
- package/dist/types/document-models/ph-clint-project/v1/gen/deployment/creators.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/deployment/error.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/deployment/operations.d.ts +4 -3
- package/dist/types/document-models/ph-clint-project/v1/gen/deployment/operations.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/document-model.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/document-model.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/document-schema.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/v1/gen/document-schema.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/external-skills/actions.d.ts +6 -6
- package/dist/types/document-models/ph-clint-project/v1/gen/external-skills/actions.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/external-skills/creators.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/v1/gen/external-skills/creators.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/external-skills/error.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/external-skills/error.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/external-skills/operations.d.ts +3 -3
- package/dist/types/document-models/ph-clint-project/v1/gen/external-skills/operations.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/features-mastra/actions.d.ts +6 -54
- package/dist/types/document-models/ph-clint-project/v1/gen/features-mastra/actions.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/features-mastra/creators.d.ts +2 -14
- package/dist/types/document-models/ph-clint-project/v1/gen/features-mastra/creators.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/features-mastra/error.d.ts +1 -78
- package/dist/types/document-models/ph-clint-project/v1/gen/features-mastra/error.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/features-mastra/operations.d.ts +3 -15
- package/dist/types/document-models/ph-clint-project/v1/gen/features-mastra/operations.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/features-powerhouse/actions.d.ts +3 -3
- package/dist/types/document-models/ph-clint-project/v1/gen/features-powerhouse/creators.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/v1/gen/features-powerhouse/creators.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/features-powerhouse/error.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/features-powerhouse/operations.d.ts +3 -3
- package/dist/types/document-models/ph-clint-project/v1/gen/features-powerhouse/operations.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/features-routine/actions.d.ts +4 -4
- package/dist/types/document-models/ph-clint-project/v1/gen/features-routine/actions.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/features-routine/creators.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/v1/gen/features-routine/creators.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/features-routine/operations.d.ts +3 -3
- package/dist/types/document-models/ph-clint-project/v1/gen/features-routine/operations.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/identity/actions.d.ts +5 -5
- package/dist/types/document-models/ph-clint-project/v1/gen/identity/actions.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/identity/creators.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/v1/gen/identity/creators.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/identity/error.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/identity/error.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/identity/operations.d.ts +3 -3
- package/dist/types/document-models/ph-clint-project/v1/gen/identity/operations.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/index.d.ts +25 -20
- package/dist/types/document-models/ph-clint-project/v1/gen/index.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/lifecycle/actions.d.ts +3 -3
- package/dist/types/document-models/ph-clint-project/v1/gen/lifecycle/creators.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/v1/gen/lifecycle/creators.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/lifecycle/operations.d.ts +3 -3
- package/dist/types/document-models/ph-clint-project/v1/gen/lifecycle/operations.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/actions.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/creators.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/error.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/operations.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-main-agent/actions.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-main-agent/creators.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-main-agent/error.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-main-agent/operations.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-models/actions.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-models/creators.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-models/error.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-models/operations.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-profiles/actions.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-profiles/creators.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-profiles/error.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-profiles/operations.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-sub-agents/actions.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-sub-agents/creators.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-sub-agents/error.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/mastra-sub-agents/operations.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/gen/ph-factories.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/v1/gen/ph-factories.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/powerhouse-packages/actions.d.ts +7 -7
- package/dist/types/document-models/ph-clint-project/v1/gen/powerhouse-packages/actions.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/powerhouse-packages/creators.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/v1/gen/powerhouse-packages/creators.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/powerhouse-packages/error.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/powerhouse-packages/error.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/powerhouse-packages/operations.d.ts +3 -3
- package/dist/types/document-models/ph-clint-project/v1/gen/powerhouse-packages/operations.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/publishing/actions.d.ts +7 -7
- package/dist/types/document-models/ph-clint-project/v1/gen/publishing/actions.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/publishing/creators.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/v1/gen/publishing/creators.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/publishing/error.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/publishing/operations.d.ts +3 -3
- package/dist/types/document-models/ph-clint-project/v1/gen/publishing/operations.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/reducer.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/v1/gen/reducer.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/schema/index.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/v1/gen/schema/types.d.ts +215 -131
- package/dist/types/document-models/ph-clint-project/v1/gen/schema/types.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/schema/zod.d.ts +24 -8
- package/dist/types/document-models/ph-clint-project/v1/gen/schema/zod.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/types.d.ts +5 -5
- package/dist/types/document-models/ph-clint-project/v1/gen/types.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/gen/utils.d.ts +2 -2
- package/dist/types/document-models/ph-clint-project/v1/gen/utils.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/hooks.d.ts +3 -6
- package/dist/types/document-models/ph-clint-project/v1/hooks.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/index.d.ts +6 -6
- package/dist/types/document-models/ph-clint-project/v1/module.d.ts +31 -16
- package/dist/types/document-models/ph-clint-project/v1/module.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/index.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/deployment.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/deployment.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/external-skills.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/external-skills.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/features-mastra.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/features-mastra.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/features-powerhouse.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/features-powerhouse.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/features-routine.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/features-routine.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/identity.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/identity.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/lifecycle.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/lifecycle.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/mastra-agent-bindings.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/mastra-main-agent.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/mastra-models.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/mastra-profiles.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/mastra-sub-agents.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/powerhouse-packages.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/powerhouse-packages.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/publishing.d.ts +1 -1
- package/dist/types/document-models/ph-clint-project/v1/src/reducers/publishing.d.ts.map +1 -1
- package/dist/types/document-models/ph-clint-project/v1/tests/mastra-agent-bindings.test.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/tests/mastra-main-agent.test.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/tests/mastra-models.test.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/tests/mastra-profiles.test.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/tests/mastra-sub-agents.test.d.ts.map +1 -0
- package/dist/types/document-models/ph-clint-project/v1/utils.d.ts +2 -2
- package/dist/types/document-models/upgrade-manifests.d.ts +1 -1
- package/dist/types/document-models/upgrade-manifests.d.ts.map +1 -1
- package/dist/types/editors/editors.d.ts +1 -5
- package/dist/types/editors/editors.d.ts.map +1 -1
- package/dist/types/editors/index.d.ts +1 -1
- package/dist/types/editors/ph-clint-project-editor/editor.d.ts.map +1 -1
- package/dist/types/editors/ph-clint-project-editor/module.d.ts +1 -5
- package/dist/types/editors/ph-clint-project-editor/module.d.ts.map +1 -1
- package/dist/types/index.d.ts +7 -9
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/processors/connect.d.ts +1 -1
- package/dist/types/processors/factory.d.ts +2 -2
- package/dist/types/processors/factory.d.ts.map +1 -1
- package/dist/types/processors/index.d.ts +1 -1
- package/dist/types/processors/switchboard.d.ts +1 -1
- package/package.json +38 -27
- package/dist/browser/module-B16ZT36n.js.map +0 -1
- package/dist/browser/ph-clint-project-CHq59BKL.js.map +0 -1
- package/dist/connect/__react__/chunks/chunk-BUAv4yFm.js +0 -1
- package/dist/connect/__react__/chunks/server.browser-Ds-0IcTb.js +0 -1
- package/dist/connect/__react__/chunks/static.browser-CL3g4nOE.js +0 -1
- package/dist/connect/assets/editor-BaQ62r3i.js +0 -2
- package/dist/connect/assets/index-NB86TKkT.js +0 -3
- package/dist/connect/assets/index-NB86TKkT.js.map +0 -1
- package/dist/connect/assets/index-vlKMuf0A.css +0 -2
- package/dist/connect/assets/ph-clint-project-p1zY6e17.js.map +0 -1
- package/dist/document-models/document-models.d.ts +0 -7
- package/dist/document-models/document-models.d.ts.map +0 -1
- package/dist/document-models/index.d.ts +0 -2
- package/dist/document-models/index.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/gen/schema/types.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/gen/schema/zod.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/index.d.ts +0 -3
- package/dist/document-models/ph-clint-project/index.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/upgrades/index.d.ts +0 -3
- package/dist/document-models/ph-clint-project/upgrades/index.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/upgrades/upgrade-manifest.d.ts +0 -8
- package/dist/document-models/ph-clint-project/upgrades/upgrade-manifest.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/upgrades/versions.d.ts +0 -3
- package/dist/document-models/ph-clint-project/upgrades/versions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/actions.d.ts +0 -68
- package/dist/document-models/ph-clint-project/v1/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/actions.d.ts +0 -34
- package/dist/document-models/ph-clint-project/v1/gen/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/controller.d.ts +0 -8
- package/dist/document-models/ph-clint-project/v1/gen/controller.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/creators.d.ts +0 -33
- package/dist/document-models/ph-clint-project/v1/gen/creators.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/deployment/actions.d.ts +0 -24
- package/dist/document-models/ph-clint-project/v1/gen/deployment/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/deployment/creators.d.ts +0 -7
- package/dist/document-models/ph-clint-project/v1/gen/deployment/creators.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/deployment/error.d.ts +0 -21
- package/dist/document-models/ph-clint-project/v1/gen/deployment/error.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/deployment/operations.d.ts +0 -14
- package/dist/document-models/ph-clint-project/v1/gen/deployment/operations.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/document-model.d.ts +0 -3
- package/dist/document-models/ph-clint-project/v1/gen/document-model.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/document-schema.d.ts +0 -68
- package/dist/document-models/ph-clint-project/v1/gen/document-schema.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/document-type.d.ts +0 -6
- package/dist/document-models/ph-clint-project/v1/gen/document-type.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/actions.d.ts +0 -24
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/creators.d.ts +0 -7
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/creators.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/error.d.ts +0 -34
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/error.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/operations.d.ts +0 -14
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/operations.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/actions.d.ts +0 -20
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/creators.d.ts +0 -6
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/creators.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/error.d.ts +0 -31
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/error.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/operations.d.ts +0 -13
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/operations.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/actions.d.ts +0 -12
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/creators.d.ts +0 -4
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/creators.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/error.d.ts +0 -14
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/error.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/operations.d.ts +0 -11
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/operations.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/actions.d.ts +0 -16
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/creators.d.ts +0 -5
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/creators.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/error.d.ts +0 -2
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/error.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/operations.d.ts +0 -12
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/operations.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/identity/actions.d.ts +0 -20
- package/dist/document-models/ph-clint-project/v1/gen/identity/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/identity/creators.d.ts +0 -6
- package/dist/document-models/ph-clint-project/v1/gen/identity/creators.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/identity/error.d.ts +0 -21
- package/dist/document-models/ph-clint-project/v1/gen/identity/error.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/identity/operations.d.ts +0 -13
- package/dist/document-models/ph-clint-project/v1/gen/identity/operations.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/index.d.ts +0 -30
- package/dist/document-models/ph-clint-project/v1/gen/index.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/actions.d.ts +0 -12
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/creators.d.ts +0 -4
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/creators.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/error.d.ts +0 -8
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/error.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/operations.d.ts +0 -11
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/operations.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/creators.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/error.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/operations.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/creators.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/error.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/operations.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/creators.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/error.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/operations.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/creators.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/error.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/operations.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/creators.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/error.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/operations.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/ph-factories.d.ts +0 -25
- package/dist/document-models/ph-clint-project/v1/gen/ph-factories.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/actions.d.ts +0 -28
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/creators.d.ts +0 -8
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/creators.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/error.d.ts +0 -60
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/error.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/operations.d.ts +0 -15
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/operations.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/publishing/actions.d.ts +0 -28
- package/dist/document-models/ph-clint-project/v1/gen/publishing/actions.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/publishing/creators.d.ts +0 -8
- package/dist/document-models/ph-clint-project/v1/gen/publishing/creators.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/publishing/error.d.ts +0 -21
- package/dist/document-models/ph-clint-project/v1/gen/publishing/error.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/publishing/operations.d.ts +0 -15
- package/dist/document-models/ph-clint-project/v1/gen/publishing/operations.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/reducer.d.ts +0 -4
- package/dist/document-models/ph-clint-project/v1/gen/reducer.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/schema/index.d.ts +0 -7
- package/dist/document-models/ph-clint-project/v1/gen/schema/index.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/schema/types.d.ts +0 -475
- package/dist/document-models/ph-clint-project/v1/gen/schema/types.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/schema/zod.d.ts +0 -97
- package/dist/document-models/ph-clint-project/v1/gen/schema/zod.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/types.d.ts +0 -16
- package/dist/document-models/ph-clint-project/v1/gen/types.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/gen/utils.d.ts +0 -10
- package/dist/document-models/ph-clint-project/v1/gen/utils.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/hooks.d.ts +0 -15
- package/dist/document-models/ph-clint-project/v1/hooks.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/index.d.ts +0 -11
- package/dist/document-models/ph-clint-project/v1/index.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/module.d.ts +0 -75
- package/dist/document-models/ph-clint-project/v1/module.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/index.d.ts +0 -6
- package/dist/document-models/ph-clint-project/v1/src/index.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/deployment.d.ts +0 -3
- package/dist/document-models/ph-clint-project/v1/src/reducers/deployment.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/external-skills.d.ts +0 -3
- package/dist/document-models/ph-clint-project/v1/src/reducers/external-skills.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-mastra.d.ts +0 -3
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-mastra.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-powerhouse.d.ts +0 -3
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-powerhouse.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-routine.d.ts +0 -3
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-routine.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/identity.d.ts +0 -3
- package/dist/document-models/ph-clint-project/v1/src/reducers/identity.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/lifecycle.d.ts +0 -3
- package/dist/document-models/ph-clint-project/v1/src/reducers/lifecycle.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-agent-bindings.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-main-agent.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-models.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-profiles.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-sub-agents.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/powerhouse-packages.d.ts +0 -3
- package/dist/document-models/ph-clint-project/v1/src/reducers/powerhouse-packages.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/publishing.d.ts +0 -3
- package/dist/document-models/ph-clint-project/v1/src/reducers/publishing.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/src/utils.d.ts +0 -2
- package/dist/document-models/ph-clint-project/v1/src/utils.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/tests/deployment.test.d.ts +0 -2
- package/dist/document-models/ph-clint-project/v1/tests/deployment.test.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/tests/document-model.test.d.ts +0 -10
- package/dist/document-models/ph-clint-project/v1/tests/document-model.test.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/tests/external-skills.test.d.ts +0 -2
- package/dist/document-models/ph-clint-project/v1/tests/external-skills.test.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/tests/features-mastra.test.d.ts +0 -2
- package/dist/document-models/ph-clint-project/v1/tests/features-mastra.test.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/tests/features-powerhouse.test.d.ts +0 -2
- package/dist/document-models/ph-clint-project/v1/tests/features-powerhouse.test.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/tests/features-routine.test.d.ts +0 -2
- package/dist/document-models/ph-clint-project/v1/tests/features-routine.test.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/tests/identity.test.d.ts +0 -2
- package/dist/document-models/ph-clint-project/v1/tests/identity.test.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/tests/lifecycle.test.d.ts +0 -2
- package/dist/document-models/ph-clint-project/v1/tests/lifecycle.test.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/tests/mastra-agent-bindings.test.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/tests/mastra-main-agent.test.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/tests/mastra-models.test.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/tests/mastra-profiles.test.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/tests/mastra-sub-agents.test.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/tests/powerhouse-packages.test.d.ts +0 -2
- package/dist/document-models/ph-clint-project/v1/tests/powerhouse-packages.test.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/tests/publishing.test.d.ts +0 -2
- package/dist/document-models/ph-clint-project/v1/tests/publishing.test.d.ts.map +0 -1
- package/dist/document-models/ph-clint-project/v1/utils.d.ts +0 -9
- package/dist/document-models/ph-clint-project/v1/utils.d.ts.map +0 -1
- package/dist/document-models/upgrade-manifests.d.ts +0 -7
- package/dist/document-models/upgrade-manifests.d.ts.map +0 -1
- package/dist/editors/editors.d.ts +0 -3
- package/dist/editors/editors.d.ts.map +0 -1
- package/dist/editors/index.d.ts +0 -2
- package/dist/editors/index.d.ts.map +0 -1
- package/dist/editors/ph-clint-project-editor/editor.d.ts +0 -2
- package/dist/editors/ph-clint-project-editor/editor.d.ts.map +0 -1
- package/dist/editors/ph-clint-project-editor/module.d.ts +0 -4
- package/dist/editors/ph-clint-project-editor/module.d.ts.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/main.d.ts +0 -2
- package/dist/main.d.ts.map +0 -1
- package/dist/node/module-BPw40Ypp.mjs.map +0 -1
- package/dist/node/ph-clint-project-B5IjiXbp.mjs.map +0 -1
- package/dist/processors/connect.d.ts +0 -3
- package/dist/processors/connect.d.ts.map +0 -1
- package/dist/processors/factory.d.ts +0 -8
- package/dist/processors/factory.d.ts.map +0 -1
- package/dist/processors/index.d.ts +0 -6
- package/dist/processors/index.d.ts.map +0 -1
- package/dist/processors/switchboard.d.ts +0 -3
- package/dist/processors/switchboard.d.ts.map +0 -1
- package/dist/subgraphs/index.d.ts +0 -2
- package/dist/subgraphs/index.d.ts.map +0 -1
- /package/dist/{document-models → types/document-models}/ph-clint-project/gen/schema/types.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/gen/schema/zod.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-agent-bindings/actions.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-agent-bindings/creators.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-agent-bindings/error.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-agent-bindings/operations.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-main-agent/actions.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-main-agent/creators.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-main-agent/error.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-main-agent/operations.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-models/actions.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-models/creators.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-models/error.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-models/operations.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-profiles/actions.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-profiles/creators.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-profiles/error.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-profiles/operations.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-sub-agents/actions.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-sub-agents/creators.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-sub-agents/error.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/gen/mastra-sub-agents/operations.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/src/reducers/mastra-agent-bindings.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/src/reducers/mastra-main-agent.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/src/reducers/mastra-models.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/src/reducers/mastra-profiles.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/src/reducers/mastra-sub-agents.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/tests/mastra-agent-bindings.test.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/tests/mastra-main-agent.test.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/tests/mastra-models.test.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/tests/mastra-profiles.test.d.ts +0 -0
- /package/dist/{document-models → types/document-models}/ph-clint-project/v1/tests/mastra-sub-agents.test.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-BzVWlfCE.js","names":["stringify","cjsModule","stringify","initializer","util.jsonStringifyReplacer","core.$ZodAsyncError","util.finalizeIssue","core.config","parse","errors.$ZodRealError","parseAsync","errors.$ZodError","safeParse","safeParseAsync","encode","decode","encodeAsync","decodeAsync","safeEncode","safeDecode","safeEncodeAsync","safeDecodeAsync","duration","_emoji","date","time","datetime","string","number","boolean","util.floatSafeRemainder","util.NUMBER_FORMAT_RANGES","regexes.integer","util.nullish","util.getLengthableOrigin","regexes.lowercase","regexes.uppercase","util.escapeRegex","util.aborted","core.$ZodAsyncError","safeParse","safeParseAsync","regexes.string","regexes.guid","regexes.uuid","regexes.email","regexes.emoji","regexes.nanoid","regexes.cuid","regexes.cuid2","regexes.ulid","regexes.xid","regexes.ksuid","regexes.datetime","regexes.date","regexes.time","regexes.duration","regexes.ipv4","regexes.ipv6","regexes.cidrv4","regexes.cidrv6","regexes.base64","regexes.base64url","regexes.e164","regexes.number","regexes.boolean","util.prefixIssues","util.optionalKeys","util.cached","isObject","util.isObject","util.esc","allowsEval","util.allowsEval","util.finalizeIssue","core.config","util.cleanRegex","util.isPlainObject","util.getEnumValues","util.escapeRegex","core.$ZodEncodeError","util.issue","_a","util.normalizeParams","checks.$ZodCheckLessThan","checks.$ZodCheckGreaterThan","checks.$ZodCheckMultipleOf","checks.$ZodCheckMaxLength","checks.$ZodCheckMinLength","checks.$ZodCheckLengthEquals","checks.$ZodCheckRegex","checks.$ZodCheckLowerCase","checks.$ZodCheckUpperCase","checks.$ZodCheckIncludes","checks.$ZodCheckStartsWith","checks.$ZodCheckEndsWith","checks.$ZodCheckOverwrite","util.slugify","issue","util.issue","checks.$ZodCheck","describe","meta","core._isoDateTime","core._isoDate","core._isoTime","core._isoDuration","core.formatError","core.flattenError","util.jsonStringifyReplacer","core.$constructor","util.mergeDefs","core.clone","parse.parse","parse.safeParse","parse.parseAsync","parse.safeParseAsync","parse.encode","parse.decode","parse.encodeAsync","parse.decodeAsync","parse.safeEncode","parse.safeDecode","parse.safeEncodeAsync","parse.safeDecodeAsync","checks.overwrite","processors.stringProcessor","checks.regex","checks.includes","checks.startsWith","checks.endsWith","checks.minLength","checks.maxLength","checks.length","checks.lowercase","checks.uppercase","checks.trim","checks.normalize","checks.toLowerCase","checks.toUpperCase","checks.slugify","core._email","core._url","core._jwt","core._emoji","core._guid","core._uuid","core._uuidv4","core._uuidv6","core._uuidv7","core._nanoid","core._cuid","core._cuid2","core._ulid","core._base64","core._base64url","core._xid","core._ksuid","core._ipv4","core._ipv6","core._cidrv4","core._cidrv6","core._e164","iso.datetime","iso.date","iso.time","iso.duration","core._string","processors.numberProcessor","checks.gt","checks.gte","checks.lt","checks.lte","checks.multipleOf","core._number","core._int","processors.booleanProcessor","core._boolean","processors.anyProcessor","core._any","processors.unknownProcessor","core._unknown","processors.neverProcessor","core._never","processors.arrayProcessor","core._array","processors.objectProcessor","util.extend","util.safeExtend","util.merge","util.pick","util.omit","util.partial","util.required","util.normalizeParams","processors.unionProcessor","processors.intersectionProcessor","processors.enumProcessor","processors.literalProcessor","processors.transformProcessor","core.$ZodEncodeError","issue","util.issue","processors.optionalProcessor","processors.nullableProcessor","processors.defaultProcessor","util.shallowClone","processors.prefaultProcessor","processors.nonoptionalProcessor","processors.catchProcessor","processors.pipeProcessor","processors.readonlyProcessor","processors.lazyProcessor","processors.customProcessor","core._refine","core._superRefine","core.describe","core.meta","isDefinedNonNullAny","definedNonNullAnySchema","z.any","z.enum","z.string","z.union","z.object","z.lazy","z.number","z.unknown","z.literal","z.array","z.boolean","actions","stringify","utils","#tags","#tagString","#level","#includeStack","z.any","z.enum","z.object","z.string","z.url","z.boolean","z.literal","z.array","z.lazy","z.iso.datetime","phClintProjectIdentityActions","phClintProjectFeaturesPowerhouseActions","phClintProjectFeaturesRoutineActions","phClintProjectPowerhousePackagesActions","phClintProjectExternalSkillsActions","phClintProjectPublishingActions","phClintProjectLifecycleActions","phClintProjectDeploymentActions","phClintProjectFeaturesMastraActions","phClintProjectMastraModelsActions","phClintProjectMastraProfilesActions","phClintProjectMastraMainAgentActions","phClintProjectMastraSubAgentsActions","phClintProjectMastraAgentBindingsActions","InvalidSkillNameError","SkillNotFoundError","InvalidSkillNameError","SkillNotFoundError","InvalidAgentIdError","InvalidAgentNameError","MastraNotEnabledError","InvalidAgentIdError","InvalidAgentNameError","MastraNotEnabledError","InvalidVersionError","InvalidVersionError","MastraNotEnabledError","AgentNotFoundError","ModelReferenceNotFoundError","MastraNotEnabledError","AgentNotFoundError","ModelReferenceNotFoundError","MastraNotEnabledError","InvalidAgentNameError","MastraNotEnabledError","InvalidAgentNameError","MastraNotEnabledError","MastraNotEnabledError","MastraNotEnabledError","MastraNotEnabledError","InvalidVersionError","InvalidVersionError","z.literal","z.object","utils","genUtils","customUtils"],"sources":["../../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js","../../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/esm/wrapper.js","../../../../node_modules/.pnpm/sha1-uint8array@0.10.7/node_modules/sha1-uint8array/dist/sha1-uint8array.mjs","../../../../node_modules/.pnpm/@powerhousedao+shared@6.2.0-dev.23_@sentry+node-core@10.58.0_@opentelemetry+api@1.9.1_@_b658b833cfb712fadb570e50952defdb/node_modules/@powerhousedao/shared/dist/utils-DKOFCM0Q.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/regexes.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/doc.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/iso.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js","../../../../node_modules/.pnpm/fflate@0.8.3/node_modules/fflate/esm/browser.js","../../../../node_modules/.pnpm/mutative@1.3.0/node_modules/mutative/dist/mutative.esm.mjs","../../../../node_modules/.pnpm/change-case@5.4.4/node_modules/change-case/dist/index.js","../../../../node_modules/.pnpm/@powerhousedao+shared@6.2.0-dev.23_@sentry+node-core@10.58.0_@opentelemetry+api@1.9.1_@_b658b833cfb712fadb570e50952defdb/node_modules/@powerhousedao/shared/dist/document-model/index.js","../../../../node_modules/.pnpm/document-model@6.2.0-dev.23_@sentry+node-core@10.58.0_@opentelemetry+api@1.9.1_@opentel_4faf0b1fd96a1b542720b7b34661d56d/node_modules/document-model/dist/index.js","../../document-models/ph-clint-project/v1/gen/schema/zod.ts","../../document-models/ph-clint-project/v1/gen/deployment/creators.ts","../../document-models/ph-clint-project/v1/gen/external-skills/creators.ts","../../document-models/ph-clint-project/v1/gen/features-mastra/creators.ts","../../document-models/ph-clint-project/v1/gen/features-powerhouse/creators.ts","../../document-models/ph-clint-project/v1/gen/features-routine/creators.ts","../../document-models/ph-clint-project/v1/gen/identity/creators.ts","../../document-models/ph-clint-project/v1/gen/lifecycle/creators.ts","../../document-models/ph-clint-project/v1/gen/mastra-agent-bindings/creators.ts","../../document-models/ph-clint-project/v1/gen/mastra-main-agent/creators.ts","../../document-models/ph-clint-project/v1/gen/mastra-models/creators.ts","../../document-models/ph-clint-project/v1/gen/mastra-profiles/creators.ts","../../document-models/ph-clint-project/v1/gen/mastra-sub-agents/creators.ts","../../document-models/ph-clint-project/v1/gen/powerhouse-packages/creators.ts","../../document-models/ph-clint-project/v1/gen/publishing/creators.ts","../../document-models/ph-clint-project/v1/actions.ts","../../document-models/ph-clint-project/v1/gen/document-model.ts","../../document-models/ph-clint-project/v1/gen/deployment/error.ts","../../document-models/ph-clint-project/v1/src/reducers/deployment.ts","../../document-models/ph-clint-project/v1/gen/external-skills/error.ts","../../document-models/ph-clint-project/v1/src/reducers/external-skills.ts","../../document-models/ph-clint-project/v1/gen/features-mastra/error.ts","../../document-models/ph-clint-project/v1/src/reducers/features-mastra.ts","../../document-models/ph-clint-project/v1/gen/features-powerhouse/error.ts","../../document-models/ph-clint-project/v1/src/reducers/features-powerhouse.ts","../../document-models/ph-clint-project/v1/src/reducers/features-routine.ts","../../document-models/ph-clint-project/v1/gen/identity/error.ts","../../document-models/ph-clint-project/v1/src/reducers/identity.ts","../../document-models/ph-clint-project/v1/src/reducers/lifecycle.ts","../../document-models/ph-clint-project/v1/gen/mastra-agent-bindings/error.ts","../../document-models/ph-clint-project/v1/src/reducers/mastra-agent-bindings.ts","../../document-models/ph-clint-project/v1/gen/mastra-main-agent/error.ts","../../document-models/ph-clint-project/v1/src/reducers/mastra-main-agent.ts","../../document-models/ph-clint-project/v1/gen/mastra-models/error.ts","../../document-models/ph-clint-project/v1/src/reducers/mastra-models.ts","../../document-models/ph-clint-project/v1/gen/mastra-profiles/error.ts","../../document-models/ph-clint-project/v1/src/reducers/mastra-profiles.ts","../../document-models/ph-clint-project/v1/gen/mastra-sub-agents/error.ts","../../document-models/ph-clint-project/v1/src/reducers/mastra-sub-agents.ts","../../document-models/ph-clint-project/v1/gen/powerhouse-packages/error.ts","../../document-models/ph-clint-project/v1/src/reducers/powerhouse-packages.ts","../../document-models/ph-clint-project/v1/gen/publishing/error.ts","../../document-models/ph-clint-project/v1/src/reducers/publishing.ts","../../document-models/ph-clint-project/v1/gen/reducer.ts","../../document-models/ph-clint-project/upgrades/versions.ts","../../document-models/ph-clint-project/upgrades/upgrade-manifest.ts","../../document-models/ph-clint-project/v1/gen/document-type.ts","../../document-models/ph-clint-project/v1/gen/document-schema.ts","../../document-models/ph-clint-project/v1/gen/utils.ts","../../document-models/ph-clint-project/v1/src/utils.ts","../../document-models/ph-clint-project/v1/utils.ts","../../document-models/ph-clint-project/v1/module.ts"],"sourcesContent":["'use strict'\n\nconst { hasOwnProperty } = Object.prototype\n\nconst stringify = configure()\n\n// @ts-expect-error\nstringify.configure = configure\n// @ts-expect-error\nstringify.stringify = stringify\n\n// @ts-expect-error\nstringify.default = stringify\n\n// @ts-expect-error used for named export\nexports.stringify = stringify\n// @ts-expect-error used for named export\nexports.configure = configure\n\nmodule.exports = stringify\n\n// eslint-disable-next-line no-control-regex\nconst strEscapeSequencesRegExp = /[\\u0000-\\u001f\\u0022\\u005c\\ud800-\\udfff]/\n\n// Escape C0 control characters, double quotes, the backslash and every code\n// unit with a numeric value in the inclusive range 0xD800 to 0xDFFF.\nfunction strEscape (str) {\n // Some magic numbers that worked out fine while benchmarking with v8 8.0\n if (str.length < 5000 && !strEscapeSequencesRegExp.test(str)) {\n return `\"${str}\"`\n }\n return JSON.stringify(str)\n}\n\nfunction sort (array, comparator) {\n // Insertion sort is very efficient for small input sizes, but it has a bad\n // worst case complexity. Thus, use native array sort for bigger values.\n if (array.length > 2e2 || comparator) {\n return array.sort(comparator)\n }\n for (let i = 1; i < array.length; i++) {\n const currentValue = array[i]\n let position = i\n while (position !== 0 && array[position - 1] > currentValue) {\n array[position] = array[position - 1]\n position--\n }\n array[position] = currentValue\n }\n return array\n}\n\nconst typedArrayPrototypeGetSymbolToStringTag =\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(\n Object.getPrototypeOf(\n new Int8Array()\n )\n ),\n Symbol.toStringTag\n ).get\n\nfunction isTypedArrayWithEntries (value) {\n return typedArrayPrototypeGetSymbolToStringTag.call(value) !== undefined && value.length !== 0\n}\n\nfunction stringifyTypedArray (array, separator, maximumBreadth) {\n if (array.length < maximumBreadth) {\n maximumBreadth = array.length\n }\n const whitespace = separator === ',' ? '' : ' '\n let res = `\"0\":${whitespace}${array[0]}`\n for (let i = 1; i < maximumBreadth; i++) {\n res += `${separator}\"${i}\":${whitespace}${array[i]}`\n }\n return res\n}\n\nfunction getCircularValueOption (options) {\n if (hasOwnProperty.call(options, 'circularValue')) {\n const circularValue = options.circularValue\n if (typeof circularValue === 'string') {\n return `\"${circularValue}\"`\n }\n if (circularValue == null) {\n return circularValue\n }\n if (circularValue === Error || circularValue === TypeError) {\n return {\n toString () {\n throw new TypeError('Converting circular structure to JSON')\n }\n }\n }\n throw new TypeError('The \"circularValue\" argument must be of type string or the value null or undefined')\n }\n return '\"[Circular]\"'\n}\n\nfunction getDeterministicOption (options) {\n let value\n if (hasOwnProperty.call(options, 'deterministic')) {\n value = options.deterministic\n if (typeof value !== 'boolean' && typeof value !== 'function') {\n throw new TypeError('The \"deterministic\" argument must be of type boolean or comparator function')\n }\n }\n return value === undefined ? true : value\n}\n\nfunction getBooleanOption (options, key) {\n let value\n if (hasOwnProperty.call(options, key)) {\n value = options[key]\n if (typeof value !== 'boolean') {\n throw new TypeError(`The \"${key}\" argument must be of type boolean`)\n }\n }\n return value === undefined ? true : value\n}\n\nfunction getPositiveIntegerOption (options, key) {\n let value\n if (hasOwnProperty.call(options, key)) {\n value = options[key]\n if (typeof value !== 'number') {\n throw new TypeError(`The \"${key}\" argument must be of type number`)\n }\n if (!Number.isInteger(value)) {\n throw new TypeError(`The \"${key}\" argument must be an integer`)\n }\n if (value < 1) {\n throw new RangeError(`The \"${key}\" argument must be >= 1`)\n }\n }\n return value === undefined ? Infinity : value\n}\n\nfunction getItemCount (number) {\n if (number === 1) {\n return '1 item'\n }\n return `${number} items`\n}\n\nfunction getUniqueReplacerSet (replacerArray) {\n const replacerSet = new Set()\n for (const value of replacerArray) {\n if (typeof value === 'string' || typeof value === 'number') {\n replacerSet.add(String(value))\n }\n }\n return replacerSet\n}\n\nfunction getStrictOption (options) {\n if (hasOwnProperty.call(options, 'strict')) {\n const value = options.strict\n if (typeof value !== 'boolean') {\n throw new TypeError('The \"strict\" argument must be of type boolean')\n }\n if (value) {\n return (value) => {\n let message = `Object can not safely be stringified. Received type ${typeof value}`\n if (typeof value !== 'function') message += ` (${value.toString()})`\n throw new Error(message)\n }\n }\n }\n}\n\nfunction configure (options) {\n options = { ...options }\n const fail = getStrictOption(options)\n if (fail) {\n if (options.bigint === undefined) {\n options.bigint = false\n }\n if (!('circularValue' in options)) {\n options.circularValue = Error\n }\n }\n const circularValue = getCircularValueOption(options)\n const bigint = getBooleanOption(options, 'bigint')\n const deterministic = getDeterministicOption(options)\n const comparator = typeof deterministic === 'function' ? deterministic : undefined\n const maximumDepth = getPositiveIntegerOption(options, 'maximumDepth')\n const maximumBreadth = getPositiveIntegerOption(options, 'maximumBreadth')\n\n function stringifyFnReplacer (key, parent, stack, replacer, spacer, indentation) {\n let value = parent[key]\n\n if (typeof value === 'object' && value !== null && typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n }\n value = replacer.call(parent, key, value)\n\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n let res = ''\n let join = ','\n const originalIndentation = indentation\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n if (spacer !== '') {\n indentation += spacer\n res += `\\n${indentation}`\n join = `,\\n${indentation}`\n }\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n if (spacer !== '') {\n res += `\\n${originalIndentation}`\n }\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n let whitespace = ''\n let separator = ''\n if (spacer !== '') {\n indentation += spacer\n join = `,\\n${indentation}`\n whitespace = ' '\n }\n const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (deterministic && !isTypedArrayWithEntries(value)) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifyFnReplacer(key, value, stack, replacer, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${whitespace}${tmp}`\n separator = join\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\":${whitespace}\"${getItemCount(removedKeys)} not stringified\"`\n separator = join\n }\n if (spacer !== '' && separator.length > 1) {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifyArrayReplacer (key, value, stack, replacer, spacer, indentation) {\n if (typeof value === 'object' && value !== null && typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n }\n\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n const originalIndentation = indentation\n let res = ''\n let join = ','\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n if (spacer !== '') {\n indentation += spacer\n res += `\\n${indentation}`\n join = `,\\n${indentation}`\n }\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n if (spacer !== '') {\n res += `\\n${originalIndentation}`\n }\n stack.pop()\n return `[${res}]`\n }\n stack.push(value)\n let whitespace = ''\n if (spacer !== '') {\n indentation += spacer\n join = `,\\n${indentation}`\n whitespace = ' '\n }\n let separator = ''\n for (const key of replacer) {\n const tmp = stringifyArrayReplacer(key, value[key], stack, replacer, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${whitespace}${tmp}`\n separator = join\n }\n }\n if (spacer !== '' && separator.length > 1) {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifyIndent (key, value, stack, spacer, indentation) {\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n // Prevent calling `toJSON` again.\n if (typeof value !== 'object') {\n return stringifyIndent(key, value, stack, spacer, indentation)\n }\n if (value === null) {\n return 'null'\n }\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n const originalIndentation = indentation\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n indentation += spacer\n let res = `\\n${indentation}`\n const join = `,\\n${indentation}`\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n res += `\\n${originalIndentation}`\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n indentation += spacer\n const join = `,\\n${indentation}`\n let res = ''\n let separator = ''\n let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (isTypedArrayWithEntries(value)) {\n res += stringifyTypedArray(value, join, maximumBreadth)\n keys = keys.slice(value.length)\n maximumPropertiesToStringify -= value.length\n separator = join\n }\n if (deterministic) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifyIndent(key, value[key], stack, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}: ${tmp}`\n separator = join\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\": \"${getItemCount(removedKeys)} not stringified\"`\n separator = join\n }\n if (separator !== '') {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifySimple (key, value, stack) {\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n // Prevent calling `toJSON` again\n if (typeof value !== 'object') {\n return stringifySimple(key, value, stack)\n }\n if (value === null) {\n return 'null'\n }\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n let res = ''\n\n const hasLength = value.length !== undefined\n if (hasLength && Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifySimple(String(i), value[i], stack)\n res += tmp !== undefined ? tmp : 'null'\n res += ','\n }\n const tmp = stringifySimple(String(i), value[i], stack)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `,\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n let separator = ''\n let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (hasLength && isTypedArrayWithEntries(value)) {\n res += stringifyTypedArray(value, ',', maximumBreadth)\n keys = keys.slice(value.length)\n maximumPropertiesToStringify -= value.length\n separator = ','\n }\n if (deterministic) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifySimple(key, value[key], stack)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${tmp}`\n separator = ','\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\":\"${getItemCount(removedKeys)} not stringified\"`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringify (value, replacer, space) {\n if (arguments.length > 1) {\n let spacer = ''\n if (typeof space === 'number') {\n spacer = ' '.repeat(Math.min(space, 10))\n } else if (typeof space === 'string') {\n spacer = space.slice(0, 10)\n }\n if (replacer != null) {\n if (typeof replacer === 'function') {\n return stringifyFnReplacer('', { '': value }, [], replacer, spacer, '')\n }\n if (Array.isArray(replacer)) {\n return stringifyArrayReplacer('', value, [], getUniqueReplacerSet(replacer), spacer, '')\n }\n }\n if (spacer.length !== 0) {\n return stringifyIndent('', value, [], spacer, '')\n }\n }\n return stringifySimple('', value, [])\n }\n\n return stringify\n}\n","import cjsModule from '../index.js'\n\nexport const configure = cjsModule.configure\n\nexport const stringify = cjsModule\nexport default cjsModule\n","/**\n * sha1-uint8array.ts\n */\nconst K = [\n 0x5a827999 | 0,\n 0x6ed9eba1 | 0,\n 0x8f1bbcdc | 0,\n 0xca62c1d6 | 0,\n];\nconst algorithms = {\n sha1: 1,\n};\nexport function createHash(algorithm) {\n if (algorithm && !algorithms[algorithm] && !algorithms[algorithm.toLowerCase()]) {\n throw new Error(\"Digest method not supported\");\n }\n return new Hash();\n}\nclass Hash {\n constructor() {\n this.A = 0x67452301 | 0;\n this.B = 0xefcdab89 | 0;\n this.C = 0x98badcfe | 0;\n this.D = 0x10325476 | 0;\n this.E = 0xc3d2e1f0 | 0;\n this._size = 0;\n this._sp = 0; // surrogate pair\n if (!sharedBuffer || sharedOffset >= 8000 /* N.allocTotal */) {\n sharedBuffer = new ArrayBuffer(8000 /* N.allocTotal */);\n sharedOffset = 0;\n }\n this._byte = new Uint8Array(sharedBuffer, sharedOffset, 80 /* N.allocBytes */);\n this._word = new Int32Array(sharedBuffer, sharedOffset, 20 /* N.allocWords */);\n sharedOffset += 80 /* N.allocBytes */;\n }\n update(data) {\n // data: string\n if (\"string\" === typeof data) {\n return this._utf8(data);\n }\n // data: undefined\n if (data == null) {\n throw new TypeError(\"Invalid type: \" + typeof data);\n }\n const byteOffset = data.byteOffset;\n const length = data.byteLength;\n let blocks = (length / 64 /* N.inputBytes */) | 0;\n let offset = 0;\n // longer than 1 block\n if (blocks && !(byteOffset & 3) && !(this._size % 64 /* N.inputBytes */)) {\n const block = new Int32Array(data.buffer, byteOffset, blocks * 16 /* N.inputWords */);\n while (blocks--) {\n this._int32(block, offset >> 2);\n offset += 64 /* N.inputBytes */;\n }\n this._size += offset;\n }\n // data: TypedArray | DataView\n const BYTES_PER_ELEMENT = data.BYTES_PER_ELEMENT;\n if (BYTES_PER_ELEMENT !== 1 && data.buffer) {\n const rest = new Uint8Array(data.buffer, byteOffset + offset, length - offset);\n return this._uint8(rest);\n }\n // no more bytes\n if (offset === length)\n return this;\n // data: Uint8Array | Int8Array\n return this._uint8(data, offset);\n }\n _uint8(data, offset) {\n const { _byte, _word } = this;\n const length = data.length;\n offset = offset | 0;\n while (offset < length) {\n const start = this._size % 64 /* N.inputBytes */;\n let index = start;\n while (offset < length && index < 64 /* N.inputBytes */) {\n _byte[index++] = data[offset++];\n }\n if (index >= 64 /* N.inputBytes */) {\n this._int32(_word);\n }\n this._size += index - start;\n }\n return this;\n }\n _utf8(text) {\n const { _byte, _word } = this;\n const length = text.length;\n let surrogate = this._sp;\n for (let offset = 0; offset < length;) {\n const start = this._size % 64 /* N.inputBytes */;\n let index = start;\n while (offset < length && index < 64 /* N.inputBytes */) {\n let code = text.charCodeAt(offset++) | 0;\n if (code < 0x80) {\n // ASCII characters\n _byte[index++] = code;\n }\n else if (code < 0x800) {\n // 2 bytes\n _byte[index++] = 0xC0 | (code >>> 6);\n _byte[index++] = 0x80 | (code & 0x3F);\n }\n else if (code < 0xD800 || code > 0xDFFF) {\n // 3 bytes\n _byte[index++] = 0xE0 | (code >>> 12);\n _byte[index++] = 0x80 | ((code >>> 6) & 0x3F);\n _byte[index++] = 0x80 | (code & 0x3F);\n }\n else if (surrogate) {\n // 4 bytes - surrogate pair\n code = ((surrogate & 0x3FF) << 10) + (code & 0x3FF) + 0x10000;\n _byte[index++] = 0xF0 | (code >>> 18);\n _byte[index++] = 0x80 | ((code >>> 12) & 0x3F);\n _byte[index++] = 0x80 | ((code >>> 6) & 0x3F);\n _byte[index++] = 0x80 | (code & 0x3F);\n surrogate = 0;\n }\n else {\n surrogate = code;\n }\n }\n if (index >= 64 /* N.inputBytes */) {\n this._int32(_word);\n _word[0] = _word[16 /* N.inputWords */];\n }\n this._size += index - start;\n }\n this._sp = surrogate;\n return this;\n }\n _int32(data, offset) {\n let { A, B, C, D, E } = this;\n let i = 0;\n offset = offset | 0;\n while (i < 16 /* N.inputWords */) {\n W[i++] = swap32(data[offset++]);\n }\n for (i = 16 /* N.inputWords */; i < 80 /* N.workWords */; i++) {\n W[i] = rotate1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]);\n }\n for (i = 0; i < 80 /* N.workWords */; i++) {\n const S = (i / 20) | 0;\n const T = (rotate5(A) + ft(S, B, C, D) + E + W[i] + K[S]) | 0;\n E = D;\n D = C;\n C = rotate30(B);\n B = A;\n A = T;\n }\n this.A = (A + this.A) | 0;\n this.B = (B + this.B) | 0;\n this.C = (C + this.C) | 0;\n this.D = (D + this.D) | 0;\n this.E = (E + this.E) | 0;\n }\n digest(encoding) {\n const { _byte, _word } = this;\n let i = (this._size % 64 /* N.inputBytes */) | 0;\n _byte[i++] = 0x80;\n // pad 0 for current word\n while (i & 3) {\n _byte[i++] = 0;\n }\n i >>= 2;\n if (i > 14 /* N.highIndex */) {\n while (i < 16 /* N.inputWords */) {\n _word[i++] = 0;\n }\n i = 0;\n this._int32(_word);\n }\n // pad 0 for rest words\n while (i < 16 /* N.inputWords */) {\n _word[i++] = 0;\n }\n // input size\n const bits64 = this._size * 8;\n const low32 = (bits64 & 0xffffffff) >>> 0;\n const high32 = (bits64 - low32) / 0x100000000;\n if (high32)\n _word[14 /* N.highIndex */] = swap32(high32);\n if (low32)\n _word[15 /* N.lowIndex */] = swap32(low32);\n this._int32(_word);\n return (encoding === \"hex\") ? this._hex() : this._bin();\n }\n _hex() {\n const { A, B, C, D, E } = this;\n return hex32(A) + hex32(B) + hex32(C) + hex32(D) + hex32(E);\n }\n _bin() {\n const { A, B, C, D, E, _byte, _word } = this;\n _word[0] = swap32(A);\n _word[1] = swap32(B);\n _word[2] = swap32(C);\n _word[3] = swap32(D);\n _word[4] = swap32(E);\n return _byte.slice(0, 20);\n }\n}\nconst W = new Int32Array(80 /* N.workWords */);\nlet sharedBuffer;\nlet sharedOffset = 0;\nconst hex32 = num => (num + 0x100000000).toString(16).substr(-8);\nconst swapLE = (c => (((c << 24) & 0xff000000) | ((c << 8) & 0xff0000) | ((c >> 8) & 0xff00) | ((c >> 24) & 0xff)));\nconst swapBE = (c => c);\nconst swap32 = isBE() ? swapBE : swapLE;\nconst rotate1 = num => (num << 1) | (num >>> 31);\nconst rotate5 = num => (num << 5) | (num >>> 27);\nconst rotate30 = num => (num << 30) | (num >>> 2);\nfunction ft(s, b, c, d) {\n if (s === 0)\n return (b & c) | ((~b) & d);\n if (s === 2)\n return (b & c) | (b & d) | (c & d);\n return b ^ c ^ d;\n}\nfunction isBE() {\n const buf = new Uint8Array(new Uint16Array([0xFEFF]).buffer); // BOM\n return (buf[0] === 0xFE);\n}\n","import { stringify } from \"safe-stable-stringify\";\nimport { createHash } from \"sha1-uint8array\";\n//#region document-model/crypto.ts\nconst hashBrowser = (data, algorithm = \"sha1\", encoding = \"base64\", _params) => {\n\tif (![\"sha1\"].includes(algorithm)) throw new Error(`Hashing algorithm not supported: \"${algorithm}\". Available: sha1`);\n\tif (![\"base64\", \"hex\"].includes(encoding)) throw new Error(`Hash encoding not supported: \"${encoding}\". Available: base64, hex`);\n\tconst hash = hashUIntArray(data, algorithm);\n\tif (encoding === \"hex\") return uint8ArrayToHex(hash);\n\treturn uint8ArrayToBase64(hash);\n};\nfunction uint8ArrayToBase64(uint8Array) {\n\tlet binaryString = \"\";\n\tfor (let i = 0; i < uint8Array.length; i++) binaryString += String.fromCharCode(uint8Array[i]);\n\treturn btoa(binaryString);\n}\nfunction uint8ArrayToHex(uint8Array) {\n\treturn Array.from(uint8Array).map((byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n}\nfunction hashUIntArray(data, algorithm = \"sha1\") {\n\tif (![\"sha1\"].includes(algorithm)) throw new Error(\"Hashing algorithm not supported: Available: sha1\");\n\treturn createHash(\"sha1\").update(data).digest();\n}\nfunction getUnixTimestamp(date) {\n\treturn (new Date(date).getTime() / 1e3).toFixed(0);\n}\nfunction buildOperationSignatureParams({ documentId, signer, action, previousStateHash }) {\n\tconst { scope, type } = action;\n\treturn [\n\t\tgetUnixTimestamp(/* @__PURE__ */ new Date()),\n\t\tsigner.app.key,\n\t\thashBrowser([\n\t\t\tdocumentId,\n\t\t\tscope,\n\t\t\ttype,\n\t\t\tstringify(action.input)\n\t\t].join(\"\")),\n\t\tpreviousStateHash\n\t];\n}\nconst textEncode = new TextEncoder();\nfunction buildOperationSignatureMessage(params) {\n\tconst message = params.join(\"\");\n\tconst prefix = \"\u0019Signed Operation:\\n\" + message.length.toString();\n\treturn textEncode.encode(prefix + message);\n}\nfunction ab2hex(ab) {\n\tconst view = ArrayBuffer.isView(ab) ? ab : new Uint8Array(ab);\n\treturn Array.prototype.map.call(view, (x) => (\"00\" + x.toString(16)).slice(-2)).join(\"\");\n}\nfunction hex2ab(hex) {\n\treturn new Uint8Array(hex.match(/[\\da-f]{2}/gi)?.map(function(h) {\n\t\treturn parseInt(h, 16);\n\t}) ?? []);\n}\n//#endregion\n//#region document-model/utils.ts\nfunction generateId(method) {\n\tif (method && method.toString() !== \"UUIDv4\") throw new Error(`Id generation method not supported: \"${method.toString()}\"`);\n\treturn globalThis.crypto.randomUUID();\n}\n/**\n* Derives a deterministic operation ID from stable properties.\n*/\nfunction deriveOperationId(documentId, scope, branch, actionId) {\n\treturn hashBrowser(`${documentId}:${scope}:${branch}:${actionId}`, \"sha1\", \"hex\").slice(0, 32);\n}\n//#endregion\nexport { buildOperationSignatureParams as a, hex2ab as c, buildOperationSignatureMessage as i, generateId as n, getUnixTimestamp as o, ab2hex as r, hashBrowser as s, deriveOperationId as t };\n\n//# sourceMappingURL=utils-DKOFCM0Q.js.map","/** A special constant with type `never` */\nexport const NEVER = Object.freeze({\n status: \"aborted\",\n});\nexport /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, params) {\n function init(inst, def) {\n if (!inst._zod) {\n Object.defineProperty(inst, \"_zod\", {\n value: {\n def,\n constr: _,\n traits: new Set(),\n },\n enumerable: false,\n });\n }\n if (inst._zod.traits.has(name)) {\n return;\n }\n inst._zod.traits.add(name);\n initializer(inst, def);\n // support prototype modifications\n const proto = _.prototype;\n const keys = Object.keys(proto);\n for (let i = 0; i < keys.length; i++) {\n const k = keys[i];\n if (!(k in inst)) {\n inst[k] = proto[k].bind(inst);\n }\n }\n }\n // doesn't work if Parent has a constructor with arguments\n const Parent = params?.Parent ?? Object;\n class Definition extends Parent {\n }\n Object.defineProperty(Definition, \"name\", { value: name });\n function _(def) {\n var _a;\n const inst = params?.Parent ? new Definition() : this;\n init(inst, def);\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n for (const fn of inst._zod.deferred) {\n fn();\n }\n return inst;\n }\n Object.defineProperty(_, \"init\", { value: init });\n Object.defineProperty(_, Symbol.hasInstance, {\n value: (inst) => {\n if (params?.Parent && inst instanceof params.Parent)\n return true;\n return inst?._zod?.traits?.has(name);\n },\n });\n Object.defineProperty(_, \"name\", { value: name });\n return _;\n}\n////////////////////////////// UTILITIES ///////////////////////////////////////\nexport const $brand = Symbol(\"zod_brand\");\nexport class $ZodAsyncError extends Error {\n constructor() {\n super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);\n }\n}\nexport class $ZodEncodeError extends Error {\n constructor(name) {\n super(`Encountered unidirectional transform during encode: ${name}`);\n this.name = \"ZodEncodeError\";\n }\n}\nexport const globalConfig = {};\nexport function config(newConfig) {\n if (newConfig)\n Object.assign(globalConfig, newConfig);\n return globalConfig;\n}\n","// functions\nexport function assertEqual(val) {\n return val;\n}\nexport function assertNotEqual(val) {\n return val;\n}\nexport function assertIs(_arg) { }\nexport function assertNever(_x) {\n throw new Error(\"Unexpected value in exhaustive check\");\n}\nexport function assert(_) { }\nexport function getEnumValues(entries) {\n const numericValues = Object.values(entries).filter((v) => typeof v === \"number\");\n const values = Object.entries(entries)\n .filter(([k, _]) => numericValues.indexOf(+k) === -1)\n .map(([_, v]) => v);\n return values;\n}\nexport function joinValues(array, separator = \"|\") {\n return array.map((val) => stringifyPrimitive(val)).join(separator);\n}\nexport function jsonStringifyReplacer(_, value) {\n if (typeof value === \"bigint\")\n return value.toString();\n return value;\n}\nexport function cached(getter) {\n const set = false;\n return {\n get value() {\n if (!set) {\n const value = getter();\n Object.defineProperty(this, \"value\", { value });\n return value;\n }\n throw new Error(\"cached value already set\");\n },\n };\n}\nexport function nullish(input) {\n return input === null || input === undefined;\n}\nexport function cleanRegex(source) {\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n return source.slice(start, end);\n}\nexport function floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepString = step.toString();\n let stepDecCount = (stepString.split(\".\")[1] || \"\").length;\n if (stepDecCount === 0 && /\\d?e-\\d?/.test(stepString)) {\n const match = stepString.match(/\\d?e-(\\d?)/);\n if (match?.[1]) {\n stepDecCount = Number.parseInt(match[1]);\n }\n }\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nconst EVALUATING = Symbol(\"evaluating\");\nexport function defineLazy(object, key, getter) {\n let value = undefined;\n Object.defineProperty(object, key, {\n get() {\n if (value === EVALUATING) {\n // Circular reference detected, return undefined to break the cycle\n return undefined;\n }\n if (value === undefined) {\n value = EVALUATING;\n value = getter();\n }\n return value;\n },\n set(v) {\n Object.defineProperty(object, key, {\n value: v,\n // configurable: true,\n });\n // object[key] = v;\n },\n configurable: true,\n });\n}\nexport function objectClone(obj) {\n return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));\n}\nexport function assignProp(target, prop, value) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n}\nexport function mergeDefs(...defs) {\n const mergedDescriptors = {};\n for (const def of defs) {\n const descriptors = Object.getOwnPropertyDescriptors(def);\n Object.assign(mergedDescriptors, descriptors);\n }\n return Object.defineProperties({}, mergedDescriptors);\n}\nexport function cloneDef(schema) {\n return mergeDefs(schema._zod.def);\n}\nexport function getElementAtPath(obj, path) {\n if (!path)\n return obj;\n return path.reduce((acc, key) => acc?.[key], obj);\n}\nexport function promiseAllObject(promisesObj) {\n const keys = Object.keys(promisesObj);\n const promises = keys.map((key) => promisesObj[key]);\n return Promise.all(promises).then((results) => {\n const resolvedObj = {};\n for (let i = 0; i < keys.length; i++) {\n resolvedObj[keys[i]] = results[i];\n }\n return resolvedObj;\n });\n}\nexport function randomString(length = 10) {\n const chars = \"abcdefghijklmnopqrstuvwxyz\";\n let str = \"\";\n for (let i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n}\nexport function esc(str) {\n return JSON.stringify(str);\n}\nexport function slugify(input) {\n return input\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/[\\s_-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\nexport const captureStackTrace = (\"captureStackTrace\" in Error ? Error.captureStackTrace : (..._args) => { });\nexport function isObject(data) {\n return typeof data === \"object\" && data !== null && !Array.isArray(data);\n}\nexport const allowsEval = cached(() => {\n // @ts-ignore\n if (typeof navigator !== \"undefined\" && navigator?.userAgent?.includes(\"Cloudflare\")) {\n return false;\n }\n try {\n const F = Function;\n new F(\"\");\n return true;\n }\n catch (_) {\n return false;\n }\n});\nexport function isPlainObject(o) {\n if (isObject(o) === false)\n return false;\n // modified constructor\n const ctor = o.constructor;\n if (ctor === undefined)\n return true;\n if (typeof ctor !== \"function\")\n return true;\n // modified prototype\n const prot = ctor.prototype;\n if (isObject(prot) === false)\n return false;\n // ctor doesn't have static `isPrototypeOf`\n if (Object.prototype.hasOwnProperty.call(prot, \"isPrototypeOf\") === false) {\n return false;\n }\n return true;\n}\nexport function shallowClone(o) {\n if (isPlainObject(o))\n return { ...o };\n if (Array.isArray(o))\n return [...o];\n return o;\n}\nexport function numKeys(data) {\n let keyCount = 0;\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n keyCount++;\n }\n }\n return keyCount;\n}\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return \"undefined\";\n case \"string\":\n return \"string\";\n case \"number\":\n return Number.isNaN(data) ? \"nan\" : \"number\";\n case \"boolean\":\n return \"boolean\";\n case \"function\":\n return \"function\";\n case \"bigint\":\n return \"bigint\";\n case \"symbol\":\n return \"symbol\";\n case \"object\":\n if (Array.isArray(data)) {\n return \"array\";\n }\n if (data === null) {\n return \"null\";\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return \"promise\";\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return \"map\";\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return \"set\";\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return \"date\";\n }\n // @ts-ignore\n if (typeof File !== \"undefined\" && data instanceof File) {\n return \"file\";\n }\n return \"object\";\n default:\n throw new Error(`Unknown data type: ${t}`);\n }\n};\nexport const propertyKeyTypes = new Set([\"string\", \"number\", \"symbol\"]);\nexport const primitiveTypes = new Set([\"string\", \"number\", \"bigint\", \"boolean\", \"symbol\", \"undefined\"]);\nexport function escapeRegex(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n// zod-specific utils\nexport function clone(inst, def, params) {\n const cl = new inst._zod.constr(def ?? inst._zod.def);\n if (!def || params?.parent)\n cl._zod.parent = inst;\n return cl;\n}\nexport function normalizeParams(_params) {\n const params = _params;\n if (!params)\n return {};\n if (typeof params === \"string\")\n return { error: () => params };\n if (params?.message !== undefined) {\n if (params?.error !== undefined)\n throw new Error(\"Cannot specify both `message` and `error` params\");\n params.error = params.message;\n }\n delete params.message;\n if (typeof params.error === \"string\")\n return { ...params, error: () => params.error };\n return params;\n}\nexport function createTransparentProxy(getter) {\n let target;\n return new Proxy({}, {\n get(_, prop, receiver) {\n target ?? (target = getter());\n return Reflect.get(target, prop, receiver);\n },\n set(_, prop, value, receiver) {\n target ?? (target = getter());\n return Reflect.set(target, prop, value, receiver);\n },\n has(_, prop) {\n target ?? (target = getter());\n return Reflect.has(target, prop);\n },\n deleteProperty(_, prop) {\n target ?? (target = getter());\n return Reflect.deleteProperty(target, prop);\n },\n ownKeys(_) {\n target ?? (target = getter());\n return Reflect.ownKeys(target);\n },\n getOwnPropertyDescriptor(_, prop) {\n target ?? (target = getter());\n return Reflect.getOwnPropertyDescriptor(target, prop);\n },\n defineProperty(_, prop, descriptor) {\n target ?? (target = getter());\n return Reflect.defineProperty(target, prop, descriptor);\n },\n });\n}\nexport function stringifyPrimitive(value) {\n if (typeof value === \"bigint\")\n return value.toString() + \"n\";\n if (typeof value === \"string\")\n return `\"${value}\"`;\n return `${value}`;\n}\nexport function optionalKeys(shape) {\n return Object.keys(shape).filter((k) => {\n return shape[k]._zod.optin === \"optional\" && shape[k]._zod.optout === \"optional\";\n });\n}\nexport const NUMBER_FORMAT_RANGES = {\n safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],\n int32: [-2147483648, 2147483647],\n uint32: [0, 4294967295],\n float32: [-3.4028234663852886e38, 3.4028234663852886e38],\n float64: [-Number.MAX_VALUE, Number.MAX_VALUE],\n};\nexport const BIGINT_FORMAT_RANGES = {\n int64: [/* @__PURE__*/ BigInt(\"-9223372036854775808\"), /* @__PURE__*/ BigInt(\"9223372036854775807\")],\n uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt(\"18446744073709551615\")],\n};\nexport function pick(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".pick() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = {};\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n newShape[key] = currDef.shape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function omit(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".omit() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = { ...schema._zod.def.shape };\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n delete newShape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function extend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to extend: expected a plain object\");\n }\n const checks = schema._zod.def.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n // Only throw if new shape overlaps with existing shape\n // Use getOwnPropertyDescriptor to check key existence without accessing values\n const existingShape = schema._zod.def.shape;\n for (const key in shape) {\n if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {\n throw new Error(\"Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.\");\n }\n }\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function safeExtend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to safeExtend: expected a plain object\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function merge(a, b) {\n const def = mergeDefs(a._zod.def, {\n get shape() {\n const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n get catchall() {\n return b._zod.def.catchall;\n },\n checks: [], // delete existing checks\n });\n return clone(a, def);\n}\nexport function partial(Class, schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".partial() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in oldShape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n else {\n for (const key in oldShape) {\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function required(Class, schema, mask) {\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n else {\n for (const key in oldShape) {\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n });\n return clone(schema, def);\n}\n// invalid_type | too_big | too_small | invalid_format | not_multiple_of | unrecognized_keys | invalid_union | invalid_key | invalid_element | invalid_value | custom\nexport function aborted(x, startIndex = 0) {\n if (x.aborted === true)\n return true;\n for (let i = startIndex; i < x.issues.length; i++) {\n if (x.issues[i]?.continue !== true) {\n return true;\n }\n }\n return false;\n}\nexport function prefixIssues(path, issues) {\n return issues.map((iss) => {\n var _a;\n (_a = iss).path ?? (_a.path = []);\n iss.path.unshift(path);\n return iss;\n });\n}\nexport function unwrapMessage(message) {\n return typeof message === \"string\" ? message : message?.message;\n}\nexport function finalizeIssue(iss, ctx, config) {\n const full = { ...iss, path: iss.path ?? [] };\n // for backwards compatibility\n if (!iss.message) {\n const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??\n unwrapMessage(ctx?.error?.(iss)) ??\n unwrapMessage(config.customError?.(iss)) ??\n unwrapMessage(config.localeError?.(iss)) ??\n \"Invalid input\";\n full.message = message;\n }\n // delete (full as any).def;\n delete full.inst;\n delete full.continue;\n if (!ctx?.reportInput) {\n delete full.input;\n }\n return full;\n}\nexport function getSizableOrigin(input) {\n if (input instanceof Set)\n return \"set\";\n if (input instanceof Map)\n return \"map\";\n // @ts-ignore\n if (input instanceof File)\n return \"file\";\n return \"unknown\";\n}\nexport function getLengthableOrigin(input) {\n if (Array.isArray(input))\n return \"array\";\n if (typeof input === \"string\")\n return \"string\";\n return \"unknown\";\n}\nexport function parsedType(data) {\n const t = typeof data;\n switch (t) {\n case \"number\": {\n return Number.isNaN(data) ? \"nan\" : \"number\";\n }\n case \"object\": {\n if (data === null) {\n return \"null\";\n }\n if (Array.isArray(data)) {\n return \"array\";\n }\n const obj = data;\n if (obj && Object.getPrototypeOf(obj) !== Object.prototype && \"constructor\" in obj && obj.constructor) {\n return obj.constructor.name;\n }\n }\n }\n return t;\n}\nexport function issue(...args) {\n const [iss, input, inst] = args;\n if (typeof iss === \"string\") {\n return {\n message: iss,\n code: \"custom\",\n input,\n inst,\n };\n }\n return { ...iss };\n}\nexport function cleanEnum(obj) {\n return Object.entries(obj)\n .filter(([k, _]) => {\n // return true if NaN, meaning it's not a number, thus a string key\n return Number.isNaN(Number.parseInt(k, 10));\n })\n .map((el) => el[1]);\n}\n// Codec utility functions\nexport function base64ToUint8Array(base64) {\n const binaryString = atob(base64);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes;\n}\nexport function uint8ArrayToBase64(bytes) {\n let binaryString = \"\";\n for (let i = 0; i < bytes.length; i++) {\n binaryString += String.fromCharCode(bytes[i]);\n }\n return btoa(binaryString);\n}\nexport function base64urlToUint8Array(base64url) {\n const base64 = base64url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padding = \"=\".repeat((4 - (base64.length % 4)) % 4);\n return base64ToUint8Array(base64 + padding);\n}\nexport function uint8ArrayToBase64url(bytes) {\n return uint8ArrayToBase64(bytes).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=/g, \"\");\n}\nexport function hexToUint8Array(hex) {\n const cleanHex = hex.replace(/^0x/, \"\");\n if (cleanHex.length % 2 !== 0) {\n throw new Error(\"Invalid hex string length\");\n }\n const bytes = new Uint8Array(cleanHex.length / 2);\n for (let i = 0; i < cleanHex.length; i += 2) {\n bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);\n }\n return bytes;\n}\nexport function uint8ArrayToHex(bytes) {\n return Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n// instanceof\nexport class Class {\n constructor(..._args) { }\n}\n","import { $constructor } from \"./core.js\";\nimport * as util from \"./util.js\";\nconst initializer = (inst, def) => {\n inst.name = \"$ZodError\";\n Object.defineProperty(inst, \"_zod\", {\n value: inst._zod,\n enumerable: false,\n });\n Object.defineProperty(inst, \"issues\", {\n value: def,\n enumerable: false,\n });\n inst.message = JSON.stringify(def, util.jsonStringifyReplacer, 2);\n Object.defineProperty(inst, \"toString\", {\n value: () => inst.message,\n enumerable: false,\n });\n};\nexport const $ZodError = $constructor(\"$ZodError\", initializer);\nexport const $ZodRealError = $constructor(\"$ZodError\", initializer, { Parent: Error });\nexport function flattenError(error, mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of error.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n}\nexport function formatError(error, mapper = (issue) => issue.message) {\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n issue.errors.map((issues) => processError({ issues }));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues });\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues });\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(error);\n return fieldErrors;\n}\nexport function treeifyError(error, mapper = (issue) => issue.message) {\n const result = { errors: [] };\n const processError = (error, path = []) => {\n var _a, _b;\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n // regular union error\n issue.errors.map((issues) => processError({ issues }, issue.path));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n result.errors.push(mapper(issue));\n continue;\n }\n let curr = result;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n if (typeof el === \"string\") {\n curr.properties ?? (curr.properties = {});\n (_a = curr.properties)[el] ?? (_a[el] = { errors: [] });\n curr = curr.properties[el];\n }\n else {\n curr.items ?? (curr.items = []);\n (_b = curr.items)[el] ?? (_b[el] = { errors: [] });\n curr = curr.items[el];\n }\n if (terminal) {\n curr.errors.push(mapper(issue));\n }\n i++;\n }\n }\n }\n };\n processError(error);\n return result;\n}\n/** Format a ZodError as a human-readable string in the following form.\n *\n * From\n *\n * ```ts\n * ZodError {\n * issues: [\n * {\n * expected: 'string',\n * code: 'invalid_type',\n * path: [ 'username' ],\n * message: 'Invalid input: expected string'\n * },\n * {\n * expected: 'number',\n * code: 'invalid_type',\n * path: [ 'favoriteNumbers', 1 ],\n * message: 'Invalid input: expected number'\n * }\n * ];\n * }\n * ```\n *\n * to\n *\n * ```\n * username\n * ✖ Expected number, received string at \"username\n * favoriteNumbers[0]\n * ✖ Invalid input: expected number\n * ```\n */\nexport function toDotPath(_path) {\n const segs = [];\n const path = _path.map((seg) => (typeof seg === \"object\" ? seg.key : seg));\n for (const seg of path) {\n if (typeof seg === \"number\")\n segs.push(`[${seg}]`);\n else if (typeof seg === \"symbol\")\n segs.push(`[${JSON.stringify(String(seg))}]`);\n else if (/[^\\w$]/.test(seg))\n segs.push(`[${JSON.stringify(seg)}]`);\n else {\n if (segs.length)\n segs.push(\".\");\n segs.push(seg);\n }\n }\n return segs.join(\"\");\n}\nexport function prettifyError(error) {\n const lines = [];\n // sort by path length\n const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);\n // Process each issue\n for (const issue of issues) {\n lines.push(`✖ ${issue.message}`);\n if (issue.path?.length)\n lines.push(` → at ${toDotPath(issue.path)}`);\n }\n // Convert Map to formatted string\n return lines.join(\"\\n\");\n}\n","import * as core from \"./core.js\";\nimport * as errors from \"./errors.js\";\nimport * as util from \"./util.js\";\nexport const _parse = (_Err) => (schema, value, _ctx, _params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n if (result.issues.length) {\n const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, _params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);\nexport const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n if (result.issues.length) {\n const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);\nexport const _safeParse = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n return result.issues.length\n ? {\n success: false,\n error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);\nexport const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n return result.issues.length\n ? {\n success: false,\n error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);\nexport const _encode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _parse(_Err)(schema, value, ctx);\n};\nexport const encode = /* @__PURE__*/ _encode(errors.$ZodRealError);\nexport const _decode = (_Err) => (schema, value, _ctx) => {\n return _parse(_Err)(schema, value, _ctx);\n};\nexport const decode = /* @__PURE__*/ _decode(errors.$ZodRealError);\nexport const _encodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _parseAsync(_Err)(schema, value, ctx);\n};\nexport const encodeAsync = /* @__PURE__*/ _encodeAsync(errors.$ZodRealError);\nexport const _decodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _parseAsync(_Err)(schema, value, _ctx);\n};\nexport const decodeAsync = /* @__PURE__*/ _decodeAsync(errors.$ZodRealError);\nexport const _safeEncode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _safeParse(_Err)(schema, value, ctx);\n};\nexport const safeEncode = /* @__PURE__*/ _safeEncode(errors.$ZodRealError);\nexport const _safeDecode = (_Err) => (schema, value, _ctx) => {\n return _safeParse(_Err)(schema, value, _ctx);\n};\nexport const safeDecode = /* @__PURE__*/ _safeDecode(errors.$ZodRealError);\nexport const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _safeParseAsync(_Err)(schema, value, ctx);\n};\nexport const safeEncodeAsync = /* @__PURE__*/ _safeEncodeAsync(errors.$ZodRealError);\nexport const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _safeParseAsync(_Err)(schema, value, _ctx);\n};\nexport const safeDecodeAsync = /* @__PURE__*/ _safeDecodeAsync(errors.$ZodRealError);\n","import * as util from \"./util.js\";\nexport const cuid = /^[cC][^\\s-]{8,}$/;\nexport const cuid2 = /^[0-9a-z]+$/;\nexport const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;\nexport const xid = /^[0-9a-vA-V]{20}$/;\nexport const ksuid = /^[A-Za-z0-9]{27}$/;\nexport const nanoid = /^[a-zA-Z0-9_-]{21}$/;\n/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */\nexport const duration = /^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/;\n/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */\nexport const extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */\nexport const guid = /^([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})$/;\n/** Returns a regex for validating an RFC 9562/4122 UUID.\n *\n * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */\nexport const uuid = (version) => {\n if (!version)\n return /^([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)$/;\n return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);\n};\nexport const uuid4 = /*@__PURE__*/ uuid(4);\nexport const uuid6 = /*@__PURE__*/ uuid(6);\nexport const uuid7 = /*@__PURE__*/ uuid(7);\n/** Practical email validation */\nexport const email = /^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/;\n/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */\nexport const html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n/** The classic emailregex.com regex for RFC 5322-compliant emails */\nexport const rfc5322Email = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */\nexport const unicodeEmail = /^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u;\nexport const idnEmail = unicodeEmail;\nexport const browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emoji = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nexport function emoji() {\n return new RegExp(_emoji, \"u\");\n}\nexport const ipv4 = /^(?:(?: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])$/;\nexport const ipv6 = /^(([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}|:))$/;\nexport const mac = (delimiter) => {\n const escapedDelim = util.escapeRegex(delimiter ?? \":\");\n return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);\n};\nexport const cidrv4 = /^((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])$/;\nexport const cidrv6 = /^(([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])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nexport const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;\nexport const base64url = /^[A-Za-z0-9_-]*$/;\n// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address\n// export const hostname: RegExp = /^([a-zA-Z0-9-]+\\.)*[a-zA-Z0-9-]+$/;\nexport const hostname = /^(?=.{1,253}\\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\\.?$/;\nexport const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/;\n// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)\n// E.164: leading digit must be 1-9; total digits (excluding '+') between 7-15\nexport const e164 = /^\\+[1-9]\\d{6,14}$/;\n// const dateSource = `((\\\\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])))`;\nconst dateSource = `(?:(?:\\\\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])))`;\nexport const date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);\nfunction timeSource(args) {\n const hhmm = `(?:[01]\\\\d|2[0-3]):[0-5]\\\\d`;\n const regex = typeof args.precision === \"number\"\n ? args.precision === -1\n ? `${hhmm}`\n : args.precision === 0\n ? `${hhmm}:[0-5]\\\\d`\n : `${hhmm}:[0-5]\\\\d\\\\.\\\\d{${args.precision}}`\n : `${hhmm}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`;\n return regex;\n}\nexport function time(args) {\n return new RegExp(`^${timeSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetime(args) {\n const time = timeSource({ precision: args.precision });\n const opts = [\"Z\"];\n if (args.local)\n opts.push(\"\");\n // if (args.offset) opts.push(`([+-]\\\\d{2}:\\\\d{2})`);\n if (args.offset)\n opts.push(`([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)`);\n const timeRegex = `${time}(?:${opts.join(\"|\")})`;\n return new RegExp(`^${dateSource}T(?:${timeRegex})$`);\n}\nexport const string = (params) => {\n const regex = params ? `[\\\\s\\\\S]{${params?.minimum ?? 0},${params?.maximum ?? \"\"}}` : `[\\\\s\\\\S]*`;\n return new RegExp(`^${regex}$`);\n};\nexport const bigint = /^-?\\d+n?$/;\nexport const integer = /^-?\\d+$/;\nexport const number = /^-?\\d+(?:\\.\\d+)?$/;\nexport const boolean = /^(?:true|false)$/i;\nconst _null = /^null$/i;\nexport { _null as null };\nconst _undefined = /^undefined$/i;\nexport { _undefined as undefined };\n// regex for string with no uppercase letters\nexport const lowercase = /^[^A-Z]*$/;\n// regex for string with no lowercase letters\nexport const uppercase = /^[^a-z]*$/;\n// regex for hexadecimal strings (any length)\nexport const hex = /^[0-9a-fA-F]*$/;\n// Hash regexes for different algorithms and encodings\n// Helper function to create base64 regex with exact length and padding\nfunction fixedBase64(bodyLength, padding) {\n return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`);\n}\n// Helper function to create base64url regex with exact length (no padding)\nfunction fixedBase64url(length) {\n return new RegExp(`^[A-Za-z0-9_-]{${length}}$`);\n}\n// MD5 (16 bytes): base64 = 24 chars total (22 + \"==\")\nexport const md5_hex = /^[0-9a-fA-F]{32}$/;\nexport const md5_base64 = /*@__PURE__*/ fixedBase64(22, \"==\");\nexport const md5_base64url = /*@__PURE__*/ fixedBase64url(22);\n// SHA1 (20 bytes): base64 = 28 chars total (27 + \"=\")\nexport const sha1_hex = /^[0-9a-fA-F]{40}$/;\nexport const sha1_base64 = /*@__PURE__*/ fixedBase64(27, \"=\");\nexport const sha1_base64url = /*@__PURE__*/ fixedBase64url(27);\n// SHA256 (32 bytes): base64 = 44 chars total (43 + \"=\")\nexport const sha256_hex = /^[0-9a-fA-F]{64}$/;\nexport const sha256_base64 = /*@__PURE__*/ fixedBase64(43, \"=\");\nexport const sha256_base64url = /*@__PURE__*/ fixedBase64url(43);\n// SHA384 (48 bytes): base64 = 64 chars total (no padding)\nexport const sha384_hex = /^[0-9a-fA-F]{96}$/;\nexport const sha384_base64 = /*@__PURE__*/ fixedBase64(64, \"\");\nexport const sha384_base64url = /*@__PURE__*/ fixedBase64url(64);\n// SHA512 (64 bytes): base64 = 88 chars total (86 + \"==\")\nexport const sha512_hex = /^[0-9a-fA-F]{128}$/;\nexport const sha512_base64 = /*@__PURE__*/ fixedBase64(86, \"==\");\nexport const sha512_base64url = /*@__PURE__*/ fixedBase64url(86);\n","// import { $ZodType } from \"./schemas.js\";\nimport * as core from \"./core.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nexport const $ZodCheck = /*@__PURE__*/ core.$constructor(\"$ZodCheck\", (inst, def) => {\n var _a;\n inst._zod ?? (inst._zod = {});\n inst._zod.def = def;\n (_a = inst._zod).onattach ?? (_a.onattach = []);\n});\nconst numericOriginMap = {\n number: \"number\",\n bigint: \"bigint\",\n object: \"date\",\n};\nexport const $ZodCheckLessThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckLessThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;\n if (def.value < curr) {\n if (def.inclusive)\n bag.maximum = def.value;\n else\n bag.exclusiveMaximum = def.value;\n }\n });\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {\n return;\n }\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckGreaterThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckGreaterThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;\n if (def.value > curr) {\n if (def.inclusive)\n bag.minimum = def.value;\n else\n bag.exclusiveMinimum = def.value;\n }\n });\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {\n return;\n }\n payload.issues.push({\n origin,\n code: \"too_small\",\n minimum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMultipleOf = \n/*@__PURE__*/ core.$constructor(\"$ZodCheckMultipleOf\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.onattach.push((inst) => {\n var _a;\n (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);\n });\n inst._zod.check = (payload) => {\n if (typeof payload.value !== typeof def.value)\n throw new Error(\"Cannot mix number and bigint in multiple_of check.\");\n const isMultiple = typeof payload.value === \"bigint\"\n ? payload.value % def.value === BigInt(0)\n : util.floatSafeRemainder(payload.value, def.value) === 0;\n if (isMultiple)\n return;\n payload.issues.push({\n origin: typeof payload.value,\n code: \"not_multiple_of\",\n divisor: def.value,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckNumberFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n def.format = def.format || \"float64\";\n const isInt = def.format?.includes(\"int\");\n const origin = isInt ? \"int\" : \"number\";\n const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n bag.minimum = minimum;\n bag.maximum = maximum;\n if (isInt)\n bag.pattern = regexes.integer;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (isInt) {\n if (!Number.isInteger(input)) {\n // invalid_format issue\n // payload.issues.push({\n // expected: def.format,\n // format: def.format,\n // code: \"invalid_format\",\n // input,\n // inst,\n // });\n // invalid_type issue\n payload.issues.push({\n expected: origin,\n format: def.format,\n code: \"invalid_type\",\n continue: false,\n input,\n inst,\n });\n return;\n // not_multiple_of issue\n // payload.issues.push({\n // code: \"not_multiple_of\",\n // origin: \"number\",\n // input,\n // inst,\n // divisor: 1,\n // });\n }\n if (!Number.isSafeInteger(input)) {\n if (input > 0) {\n // too_big\n payload.issues.push({\n input,\n code: \"too_big\",\n maximum: Number.MAX_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n else {\n // too_small\n payload.issues.push({\n input,\n code: \"too_small\",\n minimum: Number.MIN_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n return;\n }\n }\n if (input < minimum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_small\",\n minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckBigIntFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n bag.minimum = minimum;\n bag.maximum = maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (input < minimum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_small\",\n minimum: minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckMaxSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);\n if (def.maximum < curr)\n inst._zod.bag.maximum = def.maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size <= def.maximum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);\n if (def.minimum > curr)\n inst._zod.bag.minimum = def.minimum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size >= def.minimum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckSizeEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckSizeEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.minimum = def.size;\n bag.maximum = def.size;\n bag.size = def.size;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size === def.size)\n return;\n const tooBig = size > def.size;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n ...(tooBig ? { code: \"too_big\", maximum: def.size } : { code: \"too_small\", minimum: def.size }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMaxLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);\n if (def.maximum < curr)\n inst._zod.bag.maximum = def.maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length <= def.maximum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);\n if (def.minimum > curr)\n inst._zod.bag.minimum = def.minimum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length >= def.minimum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLengthEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckLengthEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.minimum = def.length;\n bag.maximum = def.length;\n bag.length = def.length;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length === def.length)\n return;\n const origin = util.getLengthableOrigin(input);\n const tooBig = length > def.length;\n payload.issues.push({\n origin,\n ...(tooBig ? { code: \"too_big\", maximum: def.length } : { code: \"too_small\", minimum: def.length }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckStringFormat\", (inst, def) => {\n var _a, _b;\n $ZodCheck.init(inst, def);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n if (def.pattern) {\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(def.pattern);\n }\n });\n if (def.pattern)\n (_a = inst._zod).check ?? (_a.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n ...(def.pattern ? { pattern: def.pattern.toString() } : {}),\n inst,\n continue: !def.abort,\n });\n });\n else\n (_b = inst._zod).check ?? (_b.check = () => { });\n});\nexport const $ZodCheckRegex = /*@__PURE__*/ core.$constructor(\"$ZodCheckRegex\", (inst, def) => {\n $ZodCheckStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"regex\",\n input: payload.value,\n pattern: def.pattern.toString(),\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLowerCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckLowerCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.lowercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckUpperCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckUpperCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.uppercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckIncludes = /*@__PURE__*/ core.$constructor(\"$ZodCheckIncludes\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const escapedRegex = util.escapeRegex(def.includes);\n const pattern = new RegExp(typeof def.position === \"number\" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);\n def.pattern = pattern;\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.includes(def.includes, def.position))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"includes\",\n includes: def.includes,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStartsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckStartsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.startsWith(def.prefix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"starts_with\",\n prefix: def.prefix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckEndsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckEndsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.endsWith(def.suffix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"ends_with\",\n suffix: def.suffix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n///////////////////////////////////\n///// $ZodCheckProperty /////\n///////////////////////////////////\nfunction handleCheckPropertyResult(result, payload, property) {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(property, result.issues));\n }\n}\nexport const $ZodCheckProperty = /*@__PURE__*/ core.$constructor(\"$ZodCheckProperty\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n const result = def.schema._zod.run({\n value: payload.value[def.property],\n issues: [],\n }, {});\n if (result instanceof Promise) {\n return result.then((result) => handleCheckPropertyResult(result, payload, def.property));\n }\n handleCheckPropertyResult(result, payload, def.property);\n return;\n };\n});\nexport const $ZodCheckMimeType = /*@__PURE__*/ core.$constructor(\"$ZodCheckMimeType\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const mimeSet = new Set(def.mime);\n inst._zod.onattach.push((inst) => {\n inst._zod.bag.mime = def.mime;\n });\n inst._zod.check = (payload) => {\n if (mimeSet.has(payload.value.type))\n return;\n payload.issues.push({\n code: \"invalid_value\",\n values: def.mime,\n input: payload.value.type,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckOverwrite = /*@__PURE__*/ core.$constructor(\"$ZodCheckOverwrite\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n payload.value = def.tx(payload.value);\n };\n});\n","export class Doc {\n constructor(args = []) {\n this.content = [];\n this.indent = 0;\n if (this)\n this.args = args;\n }\n indented(fn) {\n this.indent += 1;\n fn(this);\n this.indent -= 1;\n }\n write(arg) {\n if (typeof arg === \"function\") {\n arg(this, { execution: \"sync\" });\n arg(this, { execution: \"async\" });\n return;\n }\n const content = arg;\n const lines = content.split(\"\\n\").filter((x) => x);\n const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));\n const dedented = lines.map((x) => x.slice(minIndent)).map((x) => \" \".repeat(this.indent * 2) + x);\n for (const line of dedented) {\n this.content.push(line);\n }\n }\n compile() {\n const F = Function;\n const args = this?.args;\n const content = this?.content ?? [``];\n const lines = [...content.map((x) => ` ${x}`)];\n // console.log(lines.join(\"\\n\"));\n return new F(...args, lines.join(\"\\n\"));\n }\n}\n","export const version = {\n major: 4,\n minor: 3,\n patch: 6,\n};\n","import * as checks from \"./checks.js\";\nimport * as core from \"./core.js\";\nimport { Doc } from \"./doc.js\";\nimport { parse, parseAsync, safeParse, safeParseAsync } from \"./parse.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nimport { version } from \"./versions.js\";\nexport const $ZodType = /*@__PURE__*/ core.$constructor(\"$ZodType\", (inst, def) => {\n var _a;\n inst ?? (inst = {});\n inst._zod.def = def; // set _def property\n inst._zod.bag = inst._zod.bag || {}; // initialize _bag object\n inst._zod.version = version;\n const checks = [...(inst._zod.def.checks ?? [])];\n // if inst is itself a checks.$ZodCheck, run it as a check\n if (inst._zod.traits.has(\"$ZodCheck\")) {\n checks.unshift(inst);\n }\n for (const ch of checks) {\n for (const fn of ch._zod.onattach) {\n fn(inst);\n }\n }\n if (checks.length === 0) {\n // deferred initializer\n // inst._zod.parse is not yet defined\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred?.push(() => {\n inst._zod.run = inst._zod.parse;\n });\n }\n else {\n const runChecks = (payload, checks, ctx) => {\n let isAborted = util.aborted(payload);\n let asyncResult;\n for (const ch of checks) {\n if (ch._zod.def.when) {\n const shouldRun = ch._zod.def.when(payload);\n if (!shouldRun)\n continue;\n }\n else if (isAborted) {\n continue;\n }\n const currLen = payload.issues.length;\n const _ = ch._zod.check(payload);\n if (_ instanceof Promise && ctx?.async === false) {\n throw new core.$ZodAsyncError();\n }\n if (asyncResult || _ instanceof Promise) {\n asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {\n await _;\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n return;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n });\n }\n else {\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n continue;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n }\n }\n if (asyncResult) {\n return asyncResult.then(() => {\n return payload;\n });\n }\n return payload;\n };\n const handleCanaryResult = (canary, payload, ctx) => {\n // abort if the canary is aborted\n if (util.aborted(canary)) {\n canary.aborted = true;\n return canary;\n }\n // run checks first, then\n const checkResult = runChecks(payload, checks, ctx);\n if (checkResult instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));\n }\n return inst._zod.parse(checkResult, ctx);\n };\n inst._zod.run = (payload, ctx) => {\n if (ctx.skipChecks) {\n return inst._zod.parse(payload, ctx);\n }\n if (ctx.direction === \"backward\") {\n // run canary\n // initial pass (no checks)\n const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });\n if (canary instanceof Promise) {\n return canary.then((canary) => {\n return handleCanaryResult(canary, payload, ctx);\n });\n }\n return handleCanaryResult(canary, payload, ctx);\n }\n // forward\n const result = inst._zod.parse(payload, ctx);\n if (result instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return result.then((result) => runChecks(result, checks, ctx));\n }\n return runChecks(result, checks, ctx);\n };\n }\n // Lazy initialize ~standard to avoid creating objects for every schema\n util.defineLazy(inst, \"~standard\", () => ({\n validate: (value) => {\n try {\n const r = safeParse(inst, value);\n return r.success ? { value: r.data } : { issues: r.error?.issues };\n }\n catch (_) {\n return safeParseAsync(inst, value).then((r) => (r.success ? { value: r.data } : { issues: r.error?.issues }));\n }\n },\n vendor: \"zod\",\n version: 1,\n }));\n});\nexport { clone } from \"./util.js\";\nexport const $ZodString = /*@__PURE__*/ core.$constructor(\"$ZodString\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);\n inst._zod.parse = (payload, _) => {\n if (def.coerce)\n try {\n payload.value = String(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"string\")\n return payload;\n payload.issues.push({\n expected: \"string\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodStringFormat\", (inst, def) => {\n // check initialization must come first\n checks.$ZodCheckStringFormat.init(inst, def);\n $ZodString.init(inst, def);\n});\nexport const $ZodGUID = /*@__PURE__*/ core.$constructor(\"$ZodGUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.guid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodUUID = /*@__PURE__*/ core.$constructor(\"$ZodUUID\", (inst, def) => {\n if (def.version) {\n const versionMap = {\n v1: 1,\n v2: 2,\n v3: 3,\n v4: 4,\n v5: 5,\n v6: 6,\n v7: 7,\n v8: 8,\n };\n const v = versionMap[def.version];\n if (v === undefined)\n throw new Error(`Invalid UUID version: \"${def.version}\"`);\n def.pattern ?? (def.pattern = regexes.uuid(v));\n }\n else\n def.pattern ?? (def.pattern = regexes.uuid());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodEmail = /*@__PURE__*/ core.$constructor(\"$ZodEmail\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.email);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodURL = /*@__PURE__*/ core.$constructor(\"$ZodURL\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n try {\n // Trim whitespace from input\n const trimmed = payload.value.trim();\n // @ts-ignore\n const url = new URL(trimmed);\n if (def.hostname) {\n def.hostname.lastIndex = 0;\n if (!def.hostname.test(url.hostname)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid hostname\",\n pattern: def.hostname.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n }\n if (def.protocol) {\n def.protocol.lastIndex = 0;\n if (!def.protocol.test(url.protocol.endsWith(\":\") ? url.protocol.slice(0, -1) : url.protocol)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid protocol\",\n pattern: def.protocol.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n }\n // Set the output value based on normalize flag\n if (def.normalize) {\n // Use normalized URL\n payload.value = url.href;\n }\n else {\n // Preserve the original input (trimmed)\n payload.value = trimmed;\n }\n return;\n }\n catch (_) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodEmoji = /*@__PURE__*/ core.$constructor(\"$ZodEmoji\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.emoji());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodNanoID = /*@__PURE__*/ core.$constructor(\"$ZodNanoID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.nanoid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID = /*@__PURE__*/ core.$constructor(\"$ZodCUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID2 = /*@__PURE__*/ core.$constructor(\"$ZodCUID2\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid2);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodULID = /*@__PURE__*/ core.$constructor(\"$ZodULID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ulid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodXID = /*@__PURE__*/ core.$constructor(\"$ZodXID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.xid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodKSUID = /*@__PURE__*/ core.$constructor(\"$ZodKSUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ksuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODateTime = /*@__PURE__*/ core.$constructor(\"$ZodISODateTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.datetime(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODate = /*@__PURE__*/ core.$constructor(\"$ZodISODate\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.date);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISOTime = /*@__PURE__*/ core.$constructor(\"$ZodISOTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.time(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODuration = /*@__PURE__*/ core.$constructor(\"$ZodISODuration\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.duration);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodIPv4 = /*@__PURE__*/ core.$constructor(\"$ZodIPv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv4);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `ipv4`;\n});\nexport const $ZodIPv6 = /*@__PURE__*/ core.$constructor(\"$ZodIPv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv6);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `ipv6`;\n inst._zod.check = (payload) => {\n try {\n // @ts-ignore\n new URL(`http://[${payload.value}]`);\n // return;\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"ipv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodMAC = /*@__PURE__*/ core.$constructor(\"$ZodMAC\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.mac(def.delimiter));\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `mac`;\n});\nexport const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv4);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n const parts = payload.value.split(\"/\");\n try {\n if (parts.length !== 2)\n throw new Error();\n const [address, prefix] = parts;\n if (!prefix)\n throw new Error();\n const prefixNum = Number(prefix);\n if (`${prefixNum}` !== prefix)\n throw new Error();\n if (prefixNum < 0 || prefixNum > 128)\n throw new Error();\n // @ts-ignore\n new URL(`http://[${address}]`);\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"cidrv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64(data) {\n if (data === \"\")\n return true;\n if (data.length % 4 !== 0)\n return false;\n try {\n // @ts-ignore\n atob(data);\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodBase64 = /*@__PURE__*/ core.$constructor(\"$ZodBase64\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.contentEncoding = \"base64\";\n inst._zod.check = (payload) => {\n if (isValidBase64(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64URL(data) {\n if (!regexes.base64url.test(data))\n return false;\n const base64 = data.replace(/[-_]/g, (c) => (c === \"-\" ? \"+\" : \"/\"));\n const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, \"=\");\n return isValidBase64(padded);\n}\nexport const $ZodBase64URL = /*@__PURE__*/ core.$constructor(\"$ZodBase64URL\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64url);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.contentEncoding = \"base64url\";\n inst._zod.check = (payload) => {\n if (isValidBase64URL(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodE164 = /*@__PURE__*/ core.$constructor(\"$ZodE164\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.e164);\n $ZodStringFormat.init(inst, def);\n});\n////////////////////////////// ZodJWT //////////////////////////////\nexport function isValidJWT(token, algorithm = null) {\n try {\n const tokensParts = token.split(\".\");\n if (tokensParts.length !== 3)\n return false;\n const [header] = tokensParts;\n if (!header)\n return false;\n // @ts-ignore\n const parsedHeader = JSON.parse(atob(header));\n if (\"typ\" in parsedHeader && parsedHeader?.typ !== \"JWT\")\n return false;\n if (!parsedHeader.alg)\n return false;\n if (algorithm && (!(\"alg\" in parsedHeader) || parsedHeader.alg !== algorithm))\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodJWT = /*@__PURE__*/ core.$constructor(\"$ZodJWT\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidJWT(payload.value, def.alg))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"jwt\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCustomStringFormat\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (def.fn(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodNumber = /*@__PURE__*/ core.$constructor(\"$ZodNumber\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Number(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"number\" && !Number.isNaN(input) && Number.isFinite(input)) {\n return payload;\n }\n const received = typeof input === \"number\"\n ? Number.isNaN(input)\n ? \"NaN\"\n : !Number.isFinite(input)\n ? \"Infinity\"\n : undefined\n : undefined;\n payload.issues.push({\n expected: \"number\",\n code: \"invalid_type\",\n input,\n inst,\n ...(received ? { received } : {}),\n });\n return payload;\n };\n});\nexport const $ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodNumberFormat\", (inst, def) => {\n checks.$ZodCheckNumberFormat.init(inst, def);\n $ZodNumber.init(inst, def); // no format checks\n});\nexport const $ZodBoolean = /*@__PURE__*/ core.$constructor(\"$ZodBoolean\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.boolean;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Boolean(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"boolean\")\n return payload;\n payload.issues.push({\n expected: \"boolean\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigInt = /*@__PURE__*/ core.$constructor(\"$ZodBigInt\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.bigint;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = BigInt(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"bigint\")\n return payload;\n payload.issues.push({\n expected: \"bigint\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodBigIntFormat\", (inst, def) => {\n checks.$ZodCheckBigIntFormat.init(inst, def);\n $ZodBigInt.init(inst, def); // no format checks\n});\nexport const $ZodSymbol = /*@__PURE__*/ core.$constructor(\"$ZodSymbol\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"symbol\")\n return payload;\n payload.issues.push({\n expected: \"symbol\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodUndefined = /*@__PURE__*/ core.$constructor(\"$ZodUndefined\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.undefined;\n inst._zod.values = new Set([undefined]);\n inst._zod.optin = \"optional\";\n inst._zod.optout = \"optional\";\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"undefined\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodNull = /*@__PURE__*/ core.$constructor(\"$ZodNull\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.null;\n inst._zod.values = new Set([null]);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (input === null)\n return payload;\n payload.issues.push({\n expected: \"null\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodAny = /*@__PURE__*/ core.$constructor(\"$ZodAny\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodUnknown = /*@__PURE__*/ core.$constructor(\"$ZodUnknown\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodNever = /*@__PURE__*/ core.$constructor(\"$ZodNever\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n payload.issues.push({\n expected: \"never\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodVoid = /*@__PURE__*/ core.$constructor(\"$ZodVoid\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"void\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodDate = /*@__PURE__*/ core.$constructor(\"$ZodDate\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce) {\n try {\n payload.value = new Date(payload.value);\n }\n catch (_err) { }\n }\n const input = payload.value;\n const isDate = input instanceof Date;\n const isValidDate = isDate && !Number.isNaN(input.getTime());\n if (isValidDate)\n return payload;\n payload.issues.push({\n expected: \"date\",\n code: \"invalid_type\",\n input,\n ...(isDate ? { received: \"Invalid Date\" } : {}),\n inst,\n });\n return payload;\n };\n});\nfunction handleArrayResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodArray = /*@__PURE__*/ core.$constructor(\"$ZodArray\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n expected: \"array\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = Array(input.length);\n const proms = [];\n for (let i = 0; i < input.length; i++) {\n const item = input[i];\n const result = def.element._zod.run({\n value: item,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleArrayResult(result, payload, i)));\n }\n else {\n handleArrayResult(result, payload, i);\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload; //handleArrayResultsAsync(parseResults, final);\n };\n});\nfunction handlePropertyResult(result, final, key, input, isOptionalOut) {\n if (result.issues.length) {\n // For optional-out schemas, ignore errors on absent keys\n if (isOptionalOut && !(key in input)) {\n return;\n }\n final.issues.push(...util.prefixIssues(key, result.issues));\n }\n if (result.value === undefined) {\n if (key in input) {\n final.value[key] = undefined;\n }\n }\n else {\n final.value[key] = result.value;\n }\n}\nfunction normalizeDef(def) {\n const keys = Object.keys(def.shape);\n for (const k of keys) {\n if (!def.shape?.[k]?._zod?.traits?.has(\"$ZodType\")) {\n throw new Error(`Invalid element at key \"${k}\": expected a Zod schema`);\n }\n }\n const okeys = util.optionalKeys(def.shape);\n return {\n ...def,\n keys,\n keySet: new Set(keys),\n numKeys: keys.length,\n optionalKeys: new Set(okeys),\n };\n}\nfunction handleCatchall(proms, input, payload, ctx, def, inst) {\n const unrecognized = [];\n // iterate over input keys\n const keySet = def.keySet;\n const _catchall = def.catchall._zod;\n const t = _catchall.def.type;\n const isOptionalOut = _catchall.optout === \"optional\";\n for (const key in input) {\n if (keySet.has(key))\n continue;\n if (t === \"never\") {\n unrecognized.push(key);\n continue;\n }\n const r = _catchall.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));\n }\n else {\n handlePropertyResult(r, payload, key, input, isOptionalOut);\n }\n }\n if (unrecognized.length) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n keys: unrecognized,\n input,\n inst,\n });\n }\n if (!proms.length)\n return payload;\n return Promise.all(proms).then(() => {\n return payload;\n });\n}\nexport const $ZodObject = /*@__PURE__*/ core.$constructor(\"$ZodObject\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodType.init(inst, def);\n // const sh = def.shape;\n const desc = Object.getOwnPropertyDescriptor(def, \"shape\");\n if (!desc?.get) {\n const sh = def.shape;\n Object.defineProperty(def, \"shape\", {\n get: () => {\n const newSh = { ...sh };\n Object.defineProperty(def, \"shape\", {\n value: newSh,\n });\n return newSh;\n },\n });\n }\n const _normalized = util.cached(() => normalizeDef(def));\n util.defineLazy(inst._zod, \"propValues\", () => {\n const shape = def.shape;\n const propValues = {};\n for (const key in shape) {\n const field = shape[key]._zod;\n if (field.values) {\n propValues[key] ?? (propValues[key] = new Set());\n for (const v of field.values)\n propValues[key].add(v);\n }\n }\n return propValues;\n });\n const isObject = util.isObject;\n const catchall = def.catchall;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = {};\n const proms = [];\n const shape = value.shape;\n for (const key of value.keys) {\n const el = shape[key];\n const isOptionalOut = el._zod.optout === \"optional\";\n const r = el._zod.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));\n }\n else {\n handlePropertyResult(r, payload, key, input, isOptionalOut);\n }\n }\n if (!catchall) {\n return proms.length ? Promise.all(proms).then(() => payload) : payload;\n }\n return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);\n };\n});\nexport const $ZodObjectJIT = /*@__PURE__*/ core.$constructor(\"$ZodObjectJIT\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodObject.init(inst, def);\n const superParse = inst._zod.parse;\n const _normalized = util.cached(() => normalizeDef(def));\n const generateFastpass = (shape) => {\n const doc = new Doc([\"shape\", \"payload\", \"ctx\"]);\n const normalized = _normalized.value;\n const parseStr = (key) => {\n const k = util.esc(key);\n return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;\n };\n doc.write(`const input = payload.value;`);\n const ids = Object.create(null);\n let counter = 0;\n for (const key of normalized.keys) {\n ids[key] = `key_${counter++}`;\n }\n // A: preserve key order {\n doc.write(`const newResult = {};`);\n for (const key of normalized.keys) {\n const id = ids[key];\n const k = util.esc(key);\n const schema = shape[key];\n const isOptionalOut = schema?._zod?.optout === \"optional\";\n doc.write(`const ${id} = ${parseStr(key)};`);\n if (isOptionalOut) {\n // For optional-out schemas, ignore errors on absent keys\n doc.write(`\n if (${id}.issues.length) {\n if (${k} in input) {\n payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}]\n })));\n }\n }\n \n if (${id}.value === undefined) {\n if (${k} in input) {\n newResult[${k}] = undefined;\n }\n } else {\n newResult[${k}] = ${id}.value;\n }\n \n `);\n }\n else {\n doc.write(`\n if (${id}.issues.length) {\n payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}]\n })));\n }\n \n if (${id}.value === undefined) {\n if (${k} in input) {\n newResult[${k}] = undefined;\n }\n } else {\n newResult[${k}] = ${id}.value;\n }\n \n `);\n }\n }\n doc.write(`payload.value = newResult;`);\n doc.write(`return payload;`);\n const fn = doc.compile();\n return (payload, ctx) => fn(shape, payload, ctx);\n };\n let fastpass;\n const isObject = util.isObject;\n const jit = !core.globalConfig.jitless;\n const allowsEval = util.allowsEval;\n const fastEnabled = jit && allowsEval.value; // && !def.catchall;\n const catchall = def.catchall;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {\n // always synchronous\n if (!fastpass)\n fastpass = generateFastpass(def.shape);\n payload = fastpass(payload, ctx);\n if (!catchall)\n return payload;\n return handleCatchall([], input, payload, ctx, value, inst);\n }\n return superParse(payload, ctx);\n };\n});\nfunction handleUnionResults(results, final, inst, ctx) {\n for (const result of results) {\n if (result.issues.length === 0) {\n final.value = result.value;\n return final;\n }\n }\n const nonaborted = results.filter((r) => !util.aborted(r));\n if (nonaborted.length === 1) {\n final.value = nonaborted[0].value;\n return nonaborted[0];\n }\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n return final;\n}\nexport const $ZodUnion = /*@__PURE__*/ core.$constructor(\"$ZodUnion\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.options.some((o) => o._zod.optin === \"optional\") ? \"optional\" : undefined);\n util.defineLazy(inst._zod, \"optout\", () => def.options.some((o) => o._zod.optout === \"optional\") ? \"optional\" : undefined);\n util.defineLazy(inst._zod, \"values\", () => {\n if (def.options.every((o) => o._zod.values)) {\n return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));\n }\n return undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n if (def.options.every((o) => o._zod.pattern)) {\n const patterns = def.options.map((o) => o._zod.pattern);\n return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join(\"|\")})$`);\n }\n return undefined;\n });\n const single = def.options.length === 1;\n const first = def.options[0]._zod.run;\n inst._zod.parse = (payload, ctx) => {\n if (single) {\n return first(payload, ctx);\n }\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n if (result.issues.length === 0)\n return result;\n results.push(result);\n }\n }\n if (!async)\n return handleUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleUnionResults(results, payload, inst, ctx);\n });\n };\n});\nfunction handleExclusiveUnionResults(results, final, inst, ctx) {\n const successes = results.filter((r) => r.issues.length === 0);\n if (successes.length === 1) {\n final.value = successes[0].value;\n return final;\n }\n if (successes.length === 0) {\n // No matches - same as regular union\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n }\n else {\n // Multiple matches - exclusive union failure\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: [],\n inclusive: false,\n });\n }\n return final;\n}\nexport const $ZodXor = /*@__PURE__*/ core.$constructor(\"$ZodXor\", (inst, def) => {\n $ZodUnion.init(inst, def);\n def.inclusive = false;\n const single = def.options.length === 1;\n const first = def.options[0]._zod.run;\n inst._zod.parse = (payload, ctx) => {\n if (single) {\n return first(payload, ctx);\n }\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n results.push(result);\n }\n }\n if (!async)\n return handleExclusiveUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleExclusiveUnionResults(results, payload, inst, ctx);\n });\n };\n});\nexport const $ZodDiscriminatedUnion = \n/*@__PURE__*/\ncore.$constructor(\"$ZodDiscriminatedUnion\", (inst, def) => {\n def.inclusive = false;\n $ZodUnion.init(inst, def);\n const _super = inst._zod.parse;\n util.defineLazy(inst._zod, \"propValues\", () => {\n const propValues = {};\n for (const option of def.options) {\n const pv = option._zod.propValues;\n if (!pv || Object.keys(pv).length === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(option)}\"`);\n for (const [k, v] of Object.entries(pv)) {\n if (!propValues[k])\n propValues[k] = new Set();\n for (const val of v) {\n propValues[k].add(val);\n }\n }\n }\n return propValues;\n });\n const disc = util.cached(() => {\n const opts = def.options;\n const map = new Map();\n for (const o of opts) {\n const values = o._zod.propValues?.[def.discriminator];\n if (!values || values.size === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(o)}\"`);\n for (const v of values) {\n if (map.has(v)) {\n throw new Error(`Duplicate discriminator value \"${String(v)}\"`);\n }\n map.set(v, o);\n }\n }\n return map;\n });\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isObject(input)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"object\",\n input,\n inst,\n });\n return payload;\n }\n const opt = disc.value.get(input?.[def.discriminator]);\n if (opt) {\n return opt._zod.run(payload, ctx);\n }\n if (def.unionFallback) {\n return _super(payload, ctx);\n }\n // no matching discriminator\n payload.issues.push({\n code: \"invalid_union\",\n errors: [],\n note: \"No matching discriminator\",\n discriminator: def.discriminator,\n input,\n path: [def.discriminator],\n inst,\n });\n return payload;\n };\n});\nexport const $ZodIntersection = /*@__PURE__*/ core.$constructor(\"$ZodIntersection\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n const left = def.left._zod.run({ value: input, issues: [] }, ctx);\n const right = def.right._zod.run({ value: input, issues: [] }, ctx);\n const async = left instanceof Promise || right instanceof Promise;\n if (async) {\n return Promise.all([left, right]).then(([left, right]) => {\n return handleIntersectionResults(payload, left, right);\n });\n }\n return handleIntersectionResults(payload, left, right);\n };\n});\nfunction mergeValues(a, b) {\n // const aType = parse.t(a);\n // const bType = parse.t(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n if (a instanceof Date && b instanceof Date && +a === +b) {\n return { valid: true, data: a };\n }\n if (util.isPlainObject(a) && util.isPlainObject(b)) {\n const bKeys = Object.keys(b);\n const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [key, ...sharedValue.mergeErrorPath],\n };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return { valid: false, mergeErrorPath: [] };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [index, ...sharedValue.mergeErrorPath],\n };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n return { valid: false, mergeErrorPath: [] };\n}\nfunction handleIntersectionResults(result, left, right) {\n // Track which side(s) report each key as unrecognized\n const unrecKeys = new Map();\n let unrecIssue;\n for (const iss of left.issues) {\n if (iss.code === \"unrecognized_keys\") {\n unrecIssue ?? (unrecIssue = iss);\n for (const k of iss.keys) {\n if (!unrecKeys.has(k))\n unrecKeys.set(k, {});\n unrecKeys.get(k).l = true;\n }\n }\n else {\n result.issues.push(iss);\n }\n }\n for (const iss of right.issues) {\n if (iss.code === \"unrecognized_keys\") {\n for (const k of iss.keys) {\n if (!unrecKeys.has(k))\n unrecKeys.set(k, {});\n unrecKeys.get(k).r = true;\n }\n }\n else {\n result.issues.push(iss);\n }\n }\n // Report only keys unrecognized by BOTH sides\n const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);\n if (bothKeys.length && unrecIssue) {\n result.issues.push({ ...unrecIssue, keys: bothKeys });\n }\n if (util.aborted(result))\n return result;\n const merged = mergeValues(left.value, right.value);\n if (!merged.valid) {\n throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);\n }\n result.value = merged.data;\n return result;\n}\nexport const $ZodTuple = /*@__PURE__*/ core.$constructor(\"$ZodTuple\", (inst, def) => {\n $ZodType.init(inst, def);\n const items = def.items;\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n input,\n inst,\n expected: \"tuple\",\n code: \"invalid_type\",\n });\n return payload;\n }\n payload.value = [];\n const proms = [];\n const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== \"optional\");\n const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;\n if (!def.rest) {\n const tooBig = input.length > items.length;\n const tooSmall = input.length < optStart - 1;\n if (tooBig || tooSmall) {\n payload.issues.push({\n ...(tooBig\n ? { code: \"too_big\", maximum: items.length, inclusive: true }\n : { code: \"too_small\", minimum: items.length }),\n input,\n inst,\n origin: \"array\",\n });\n return payload;\n }\n }\n let i = -1;\n for (const item of items) {\n i++;\n if (i >= input.length)\n if (i >= optStart)\n continue;\n const result = item._zod.run({\n value: input[i],\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n if (def.rest) {\n const rest = input.slice(items.length);\n for (const el of rest) {\n i++;\n const result = def.rest._zod.run({\n value: el,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleTupleResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodRecord = /*@__PURE__*/ core.$constructor(\"$ZodRecord\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isPlainObject(input)) {\n payload.issues.push({\n expected: \"record\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n const values = def.keyType._zod.values;\n if (values) {\n payload.value = {};\n const recordKeys = new Set();\n for (const key of values) {\n if (typeof key === \"string\" || typeof key === \"number\" || typeof key === \"symbol\") {\n recordKeys.add(typeof key === \"number\" ? key.toString() : key);\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }\n }\n }\n let unrecognized;\n for (const key in input) {\n if (!recordKeys.has(key)) {\n unrecognized = unrecognized ?? [];\n unrecognized.push(key);\n }\n }\n if (unrecognized && unrecognized.length > 0) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n input,\n inst,\n keys: unrecognized,\n });\n }\n }\n else {\n payload.value = {};\n for (const key of Reflect.ownKeys(input)) {\n if (key === \"__proto__\")\n continue;\n let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n if (keyResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n // Numeric string fallback: if key is a numeric string and failed, retry with Number(key)\n // This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals\n const checkNumericKey = typeof key === \"string\" && regexes.number.test(key) && keyResult.issues.length;\n if (checkNumericKey) {\n const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);\n if (retryResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n if (retryResult.issues.length === 0) {\n keyResult = retryResult;\n }\n }\n if (keyResult.issues.length) {\n if (def.mode === \"loose\") {\n // Pass through unchanged\n payload.value[key] = input[key];\n }\n else {\n // Default \"strict\" behavior: error on invalid key\n payload.issues.push({\n code: \"invalid_key\",\n origin: \"record\",\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n input: key,\n path: [key],\n inst,\n });\n }\n continue;\n }\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload;\n };\n});\nexport const $ZodMap = /*@__PURE__*/ core.$constructor(\"$ZodMap\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Map)) {\n payload.issues.push({\n expected: \"map\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n payload.value = new Map();\n for (const [key, value] of input) {\n const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);\n if (keyResult instanceof Promise || valueResult instanceof Promise) {\n proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }));\n }\n else {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {\n if (keyResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, keyResult.issues));\n }\n else {\n final.issues.push({\n code: \"invalid_key\",\n origin: \"map\",\n input,\n inst,\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n if (valueResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, valueResult.issues));\n }\n else {\n final.issues.push({\n origin: \"map\",\n code: \"invalid_element\",\n input,\n inst,\n key: key,\n issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n final.value.set(keyResult.value, valueResult.value);\n}\nexport const $ZodSet = /*@__PURE__*/ core.$constructor(\"$ZodSet\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Set)) {\n payload.issues.push({\n input,\n inst,\n expected: \"set\",\n code: \"invalid_type\",\n });\n return payload;\n }\n const proms = [];\n payload.value = new Set();\n for (const item of input) {\n const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleSetResult(result, payload)));\n }\n else\n handleSetResult(result, payload);\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleSetResult(result, final) {\n if (result.issues.length) {\n final.issues.push(...result.issues);\n }\n final.value.add(result.value);\n}\nexport const $ZodEnum = /*@__PURE__*/ core.$constructor(\"$ZodEnum\", (inst, def) => {\n $ZodType.init(inst, def);\n const values = util.getEnumValues(def.entries);\n const valuesSet = new Set(values);\n inst._zod.values = valuesSet;\n inst._zod.pattern = new RegExp(`^(${values\n .filter((k) => util.propertyKeyTypes.has(typeof k))\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o.toString()))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (valuesSet.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodLiteral = /*@__PURE__*/ core.$constructor(\"$ZodLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n if (def.values.length === 0) {\n throw new Error(\"Cannot create literal schema with no valid values\");\n }\n const values = new Set(def.values);\n inst._zod.values = values;\n inst._zod.pattern = new RegExp(`^(${def.values\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (values.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values: def.values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodFile = /*@__PURE__*/ core.$constructor(\"$ZodFile\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n // @ts-ignore\n if (input instanceof File)\n return payload;\n payload.issues.push({\n expected: \"file\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodTransform = /*@__PURE__*/ core.$constructor(\"$ZodTransform\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(inst.constructor.name);\n }\n const _out = def.transform(payload.value, payload);\n if (ctx.async) {\n const output = _out instanceof Promise ? _out : Promise.resolve(_out);\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n if (_out instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n payload.value = _out;\n return payload;\n };\n});\nfunction handleOptionalResult(result, input) {\n if (result.issues.length && input === undefined) {\n return { issues: [], value: undefined };\n }\n return result;\n}\nexport const $ZodOptional = /*@__PURE__*/ core.$constructor(\"$ZodOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n inst._zod.optout = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n if (def.innerType._zod.optin === \"optional\") {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise)\n return result.then((r) => handleOptionalResult(r, payload.value));\n return handleOptionalResult(result, payload.value);\n }\n if (payload.value === undefined) {\n return payload;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodExactOptional = /*@__PURE__*/ core.$constructor(\"$ZodExactOptional\", (inst, def) => {\n // Call parent init - inherits optin/optout = \"optional\"\n $ZodOptional.init(inst, def);\n // Override values/pattern to NOT add undefined\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n util.defineLazy(inst._zod, \"pattern\", () => def.innerType._zod.pattern);\n // Override parse to just delegate (no undefined handling)\n inst._zod.parse = (payload, ctx) => {\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNullable = /*@__PURE__*/ core.$constructor(\"$ZodNullable\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;\n });\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n // Forward direction (decode): allow null to pass through\n if (payload.value === null)\n return payload;\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodDefault = /*@__PURE__*/ core.$constructor(\"$ZodDefault\", (inst, def) => {\n $ZodType.init(inst, def);\n // inst._zod.qin = \"true\";\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply defaults for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n /**\n * $ZodDefault returns the default value immediately in forward direction.\n * It doesn't pass the default value into the validator (\"prefault\"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a \"prefault\" for the pipe. */\n return payload;\n }\n // Forward direction: continue with default handling\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleDefaultResult(result, def));\n }\n return handleDefaultResult(result, def);\n };\n});\nfunction handleDefaultResult(payload, def) {\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return payload;\n}\nexport const $ZodPrefault = /*@__PURE__*/ core.$constructor(\"$ZodPrefault\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply prefault for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNonOptional = /*@__PURE__*/ core.$constructor(\"$ZodNonOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => {\n const v = def.innerType._zod.values;\n return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleNonOptionalResult(result, inst));\n }\n return handleNonOptionalResult(result, inst);\n };\n});\nfunction handleNonOptionalResult(payload, inst) {\n if (!payload.issues.length && payload.value === undefined) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: payload.value,\n inst,\n });\n }\n return payload;\n}\nexport const $ZodSuccess = /*@__PURE__*/ core.$constructor(\"$ZodSuccess\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(\"ZodSuccess\");\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.issues.length === 0;\n return payload;\n });\n }\n payload.value = result.issues.length === 0;\n return payload;\n };\n});\nexport const $ZodCatch = /*@__PURE__*/ core.$constructor(\"$ZodCatch\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply catch logic\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n });\n }\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n };\n});\nexport const $ZodNaN = /*@__PURE__*/ core.$constructor(\"$ZodNaN\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"number\" || !Number.isNaN(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"nan\",\n code: \"invalid_type\",\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodPipe = /*@__PURE__*/ core.$constructor(\"$ZodPipe\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n util.defineLazy(inst._zod, \"propValues\", () => def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handlePipeResult(right, def.in, ctx));\n }\n return handlePipeResult(right, def.in, ctx);\n }\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handlePipeResult(left, def.out, ctx));\n }\n return handlePipeResult(left, def.out, ctx);\n };\n});\nfunction handlePipeResult(left, next, ctx) {\n if (left.issues.length) {\n // prevent further checks\n left.aborted = true;\n return left;\n }\n return next._zod.run({ value: left.value, issues: left.issues }, ctx);\n}\nexport const $ZodCodec = /*@__PURE__*/ core.$constructor(\"$ZodCodec\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n util.defineLazy(inst._zod, \"propValues\", () => def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handleCodecAResult(left, def, ctx));\n }\n return handleCodecAResult(left, def, ctx);\n }\n else {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handleCodecAResult(right, def, ctx));\n }\n return handleCodecAResult(right, def, ctx);\n }\n };\n});\nfunction handleCodecAResult(result, def, ctx) {\n if (result.issues.length) {\n // prevent further checks\n result.aborted = true;\n return result;\n }\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const transformed = def.transform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));\n }\n return handleCodecTxResult(result, transformed, def.out, ctx);\n }\n else {\n const transformed = def.reverseTransform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));\n }\n return handleCodecTxResult(result, transformed, def.in, ctx);\n }\n}\nfunction handleCodecTxResult(left, value, nextSchema, ctx) {\n // Check if transform added any issues\n if (left.issues.length) {\n left.aborted = true;\n return left;\n }\n return nextSchema._zod.run({ value, issues: left.issues }, ctx);\n}\nexport const $ZodReadonly = /*@__PURE__*/ core.$constructor(\"$ZodReadonly\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"propValues\", () => def.innerType._zod.propValues);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType?._zod?.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType?._zod?.optout);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then(handleReadonlyResult);\n }\n return handleReadonlyResult(result);\n };\n});\nfunction handleReadonlyResult(payload) {\n payload.value = Object.freeze(payload.value);\n return payload;\n}\nexport const $ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"$ZodTemplateLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n const regexParts = [];\n for (const part of def.parts) {\n if (typeof part === \"object\" && part !== null) {\n // is Zod schema\n if (!part._zod.pattern) {\n // if (!source)\n throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);\n }\n const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;\n if (!source)\n throw new Error(`Invalid template literal part: ${part._zod.traits}`);\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n regexParts.push(source.slice(start, end));\n }\n else if (part === null || util.primitiveTypes.has(typeof part)) {\n regexParts.push(util.escapeRegex(`${part}`));\n }\n else {\n throw new Error(`Invalid template literal part: ${part}`);\n }\n }\n inst._zod.pattern = new RegExp(`^${regexParts.join(\"\")}$`);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"string\") {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"string\",\n code: \"invalid_type\",\n });\n return payload;\n }\n inst._zod.pattern.lastIndex = 0;\n if (!inst._zod.pattern.test(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n code: \"invalid_format\",\n format: def.format ?? \"template_literal\",\n pattern: inst._zod.pattern.source,\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodFunction = /*@__PURE__*/ core.$constructor(\"$ZodFunction\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._def = def;\n inst._zod.def = def;\n inst.implement = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implement() must be called with a function\");\n }\n return function (...args) {\n const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args;\n const result = Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return parse(inst._def.output, result);\n }\n return result;\n };\n };\n inst.implementAsync = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implementAsync() must be called with a function\");\n }\n return async function (...args) {\n const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args;\n const result = await Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return await parseAsync(inst._def.output, result);\n }\n return result;\n };\n };\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"function\") {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"function\",\n input: payload.value,\n inst,\n });\n return payload;\n }\n // Check if output is a promise type to determine if we should use async implementation\n const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === \"promise\";\n if (hasPromiseOutput) {\n payload.value = inst.implementAsync(payload.value);\n }\n else {\n payload.value = inst.implement(payload.value);\n }\n return payload;\n };\n inst.input = (...args) => {\n const F = inst.constructor;\n if (Array.isArray(args[0])) {\n return new F({\n type: \"function\",\n input: new $ZodTuple({\n type: \"tuple\",\n items: args[0],\n rest: args[1],\n }),\n output: inst._def.output,\n });\n }\n return new F({\n type: \"function\",\n input: args[0],\n output: inst._def.output,\n });\n };\n inst.output = (output) => {\n const F = inst.constructor;\n return new F({\n type: \"function\",\n input: inst._def.input,\n output,\n });\n };\n return inst;\n});\nexport const $ZodPromise = /*@__PURE__*/ core.$constructor(\"$ZodPromise\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));\n };\n});\nexport const $ZodLazy = /*@__PURE__*/ core.$constructor(\"$ZodLazy\", (inst, def) => {\n $ZodType.init(inst, def);\n // let _innerType!: any;\n // util.defineLazy(def, \"getter\", () => {\n // if (!_innerType) {\n // _innerType = def.getter();\n // }\n // return () => _innerType;\n // });\n util.defineLazy(inst._zod, \"innerType\", () => def.getter());\n util.defineLazy(inst._zod, \"pattern\", () => inst._zod.innerType?._zod?.pattern);\n util.defineLazy(inst._zod, \"propValues\", () => inst._zod.innerType?._zod?.propValues);\n util.defineLazy(inst._zod, \"optin\", () => inst._zod.innerType?._zod?.optin ?? undefined);\n util.defineLazy(inst._zod, \"optout\", () => inst._zod.innerType?._zod?.optout ?? undefined);\n inst._zod.parse = (payload, ctx) => {\n const inner = inst._zod.innerType;\n return inner._zod.run(payload, ctx);\n };\n});\nexport const $ZodCustom = /*@__PURE__*/ core.$constructor(\"$ZodCustom\", (inst, def) => {\n checks.$ZodCheck.init(inst, def);\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _) => {\n return payload;\n };\n inst._zod.check = (payload) => {\n const input = payload.value;\n const r = def.fn(input);\n if (r instanceof Promise) {\n return r.then((r) => handleRefineResult(r, payload, input, inst));\n }\n handleRefineResult(r, payload, input, inst);\n return;\n };\n});\nfunction handleRefineResult(result, payload, input, inst) {\n if (!result) {\n const _iss = {\n code: \"custom\",\n input,\n inst, // incorporates params.error into issue reporting\n path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting\n continue: !inst._zod.def.abort,\n // params: inst._zod.def.params,\n };\n if (inst._zod.def.params)\n _iss.params = inst._zod.def.params;\n payload.issues.push(util.issue(_iss));\n }\n}\n","var _a;\nexport const $output = Symbol(\"ZodOutput\");\nexport const $input = Symbol(\"ZodInput\");\nexport class $ZodRegistry {\n constructor() {\n this._map = new WeakMap();\n this._idmap = new Map();\n }\n add(schema, ..._meta) {\n const meta = _meta[0];\n this._map.set(schema, meta);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.set(meta.id, schema);\n }\n return this;\n }\n clear() {\n this._map = new WeakMap();\n this._idmap = new Map();\n return this;\n }\n remove(schema) {\n const meta = this._map.get(schema);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.delete(meta.id);\n }\n this._map.delete(schema);\n return this;\n }\n get(schema) {\n // return this._map.get(schema) as any;\n // inherit metadata\n const p = schema._zod.parent;\n if (p) {\n const pm = { ...(this.get(p) ?? {}) };\n delete pm.id; // do not inherit id\n const f = { ...pm, ...this._map.get(schema) };\n return Object.keys(f).length ? f : undefined;\n }\n return this._map.get(schema);\n }\n has(schema) {\n return this._map.has(schema);\n }\n}\n// registries\nexport function registry() {\n return new $ZodRegistry();\n}\n(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());\nexport const globalRegistry = globalThis.__zod_globalRegistry;\n","import * as checks from \"./checks.js\";\nimport * as registries from \"./registries.js\";\nimport * as schemas from \"./schemas.js\";\nimport * as util from \"./util.js\";\n// @__NO_SIDE_EFFECTS__\nexport function _string(Class, params) {\n return new Class({\n type: \"string\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedString(Class, params) {\n return new Class({\n type: \"string\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _email(Class, params) {\n return new Class({\n type: \"string\",\n format: \"email\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _guid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"guid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v4\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v6\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv7(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v7\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _emoji(Class, params) {\n return new Class({\n type: \"string\",\n format: \"emoji\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nanoid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"nanoid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid2(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid2\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ulid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ulid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _xid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"xid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ksuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ksuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mac(Class, params) {\n return new Class({\n type: \"string\",\n format: \"mac\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _e164(Class, params) {\n return new Class({\n type: \"string\",\n format: \"e164\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _jwt(Class, params) {\n return new Class({\n type: \"string\",\n format: \"jwt\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport const TimePrecision = {\n Any: null,\n Minute: -1,\n Second: 0,\n Millisecond: 3,\n Microsecond: 6,\n};\n// @__NO_SIDE_EFFECTS__\nexport function _isoDateTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"datetime\",\n check: \"string_format\",\n offset: false,\n local: false,\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDate(Class, params) {\n return new Class({\n type: \"string\",\n format: \"date\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"time\",\n check: \"string_format\",\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDuration(Class, params) {\n return new Class({\n type: \"string\",\n format: \"duration\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _number(Class, params) {\n return new Class({\n type: \"number\",\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedNumber(Class, params) {\n return new Class({\n type: \"number\",\n coerce: true,\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"safeint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float64(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"int32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"uint32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _boolean(Class, params) {\n return new Class({\n type: \"boolean\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBoolean(Class, params) {\n return new Class({\n type: \"boolean\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _bigint(Class, params) {\n return new Class({\n type: \"bigint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBigint(Class, params) {\n return new Class({\n type: \"bigint\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"int64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"uint64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _symbol(Class, params) {\n return new Class({\n type: \"symbol\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _undefined(Class, params) {\n return new Class({\n type: \"undefined\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _null(Class, params) {\n return new Class({\n type: \"null\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _any(Class) {\n return new Class({\n type: \"any\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _unknown(Class) {\n return new Class({\n type: \"unknown\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _never(Class, params) {\n return new Class({\n type: \"never\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _void(Class, params) {\n return new Class({\n type: \"void\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _date(Class, params) {\n return new Class({\n type: \"date\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedDate(Class, params) {\n return new Class({\n type: \"date\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nan(Class, params) {\n return new Class({\n type: \"nan\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lt(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lte(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.lte()` instead. */\n_lte as _max, };\n// @__NO_SIDE_EFFECTS__\nexport function _gt(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _gte(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.gte()` instead. */\n_gte as _min, };\n// @__NO_SIDE_EFFECTS__\nexport function _positive(params) {\n return _gt(0, params);\n}\n// negative\n// @__NO_SIDE_EFFECTS__\nexport function _negative(params) {\n return _lt(0, params);\n}\n// nonpositive\n// @__NO_SIDE_EFFECTS__\nexport function _nonpositive(params) {\n return _lte(0, params);\n}\n// nonnegative\n// @__NO_SIDE_EFFECTS__\nexport function _nonnegative(params) {\n return _gte(0, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function _multipleOf(value, params) {\n return new checks.$ZodCheckMultipleOf({\n check: \"multiple_of\",\n ...util.normalizeParams(params),\n value,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxSize(maximum, params) {\n return new checks.$ZodCheckMaxSize({\n check: \"max_size\",\n ...util.normalizeParams(params),\n maximum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minSize(minimum, params) {\n return new checks.$ZodCheckMinSize({\n check: \"min_size\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _size(size, params) {\n return new checks.$ZodCheckSizeEquals({\n check: \"size_equals\",\n ...util.normalizeParams(params),\n size,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxLength(maximum, params) {\n const ch = new checks.$ZodCheckMaxLength({\n check: \"max_length\",\n ...util.normalizeParams(params),\n maximum,\n });\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minLength(minimum, params) {\n return new checks.$ZodCheckMinLength({\n check: \"min_length\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _length(length, params) {\n return new checks.$ZodCheckLengthEquals({\n check: \"length_equals\",\n ...util.normalizeParams(params),\n length,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _regex(pattern, params) {\n return new checks.$ZodCheckRegex({\n check: \"string_format\",\n format: \"regex\",\n ...util.normalizeParams(params),\n pattern,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lowercase(params) {\n return new checks.$ZodCheckLowerCase({\n check: \"string_format\",\n format: \"lowercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uppercase(params) {\n return new checks.$ZodCheckUpperCase({\n check: \"string_format\",\n format: \"uppercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _includes(includes, params) {\n return new checks.$ZodCheckIncludes({\n check: \"string_format\",\n format: \"includes\",\n ...util.normalizeParams(params),\n includes,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _startsWith(prefix, params) {\n return new checks.$ZodCheckStartsWith({\n check: \"string_format\",\n format: \"starts_with\",\n ...util.normalizeParams(params),\n prefix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _endsWith(suffix, params) {\n return new checks.$ZodCheckEndsWith({\n check: \"string_format\",\n format: \"ends_with\",\n ...util.normalizeParams(params),\n suffix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _property(property, schema, params) {\n return new checks.$ZodCheckProperty({\n check: \"property\",\n property,\n schema,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mime(types, params) {\n return new checks.$ZodCheckMimeType({\n check: \"mime_type\",\n mime: types,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _overwrite(tx) {\n return new checks.$ZodCheckOverwrite({\n check: \"overwrite\",\n tx,\n });\n}\n// normalize\n// @__NO_SIDE_EFFECTS__\nexport function _normalize(form) {\n return _overwrite((input) => input.normalize(form));\n}\n// trim\n// @__NO_SIDE_EFFECTS__\nexport function _trim() {\n return _overwrite((input) => input.trim());\n}\n// toLowerCase\n// @__NO_SIDE_EFFECTS__\nexport function _toLowerCase() {\n return _overwrite((input) => input.toLowerCase());\n}\n// toUpperCase\n// @__NO_SIDE_EFFECTS__\nexport function _toUpperCase() {\n return _overwrite((input) => input.toUpperCase());\n}\n// slugify\n// @__NO_SIDE_EFFECTS__\nexport function _slugify() {\n return _overwrite((input) => util.slugify(input));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _array(Class, element, params) {\n return new Class({\n type: \"array\",\n element,\n // get element() {\n // return element;\n // },\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _union(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n ...util.normalizeParams(params),\n });\n}\nexport function _xor(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _discriminatedUnion(Class, discriminator, options, params) {\n return new Class({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _intersection(Class, left, right) {\n return new Class({\n type: \"intersection\",\n left,\n right,\n });\n}\n// export function _tuple(\n// Class: util.SchemaClass<schemas.$ZodTuple>,\n// items: [],\n// params?: string | $ZodTupleParams\n// ): schemas.$ZodTuple<[], null>;\n// @__NO_SIDE_EFFECTS__\nexport function _tuple(Class, items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof schemas.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new Class({\n type: \"tuple\",\n items,\n rest,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _record(Class, keyType, valueType, params) {\n return new Class({\n type: \"record\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _map(Class, keyType, valueType, params) {\n return new Class({\n type: \"map\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _set(Class, valueType, params) {\n return new Class({\n type: \"set\",\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _enum(Class, values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n // if (Array.isArray(values)) {\n // for (const value of values) {\n // entries[value] = value;\n // }\n // } else {\n // Object.assign(entries, values);\n // }\n // const entries: util.EnumLike = {};\n // for (const val of values) {\n // entries[val] = val;\n // }\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function _nativeEnum(Class, entries, params) {\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _literal(Class, value, params) {\n return new Class({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _file(Class, params) {\n return new Class({\n type: \"file\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _transform(Class, fn) {\n return new Class({\n type: \"transform\",\n transform: fn,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _optional(Class, innerType) {\n return new Class({\n type: \"optional\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nullable(Class, innerType) {\n return new Class({\n type: \"nullable\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _default(Class, innerType, defaultValue) {\n return new Class({\n type: \"default\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nonoptional(Class, innerType, params) {\n return new Class({\n type: \"nonoptional\",\n innerType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _success(Class, innerType) {\n return new Class({\n type: \"success\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _catch(Class, innerType, catchValue) {\n return new Class({\n type: \"catch\",\n innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _pipe(Class, in_, out) {\n return new Class({\n type: \"pipe\",\n in: in_,\n out,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _readonly(Class, innerType) {\n return new Class({\n type: \"readonly\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _templateLiteral(Class, parts, params) {\n return new Class({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lazy(Class, getter) {\n return new Class({\n type: \"lazy\",\n getter,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _promise(Class, innerType) {\n return new Class({\n type: \"promise\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _custom(Class, fn, _params) {\n const norm = util.normalizeParams(_params);\n norm.abort ?? (norm.abort = true); // default to abort:false\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...norm,\n });\n return schema;\n}\n// same as _custom but defaults to abort:false\n// @__NO_SIDE_EFFECTS__\nexport function _refine(Class, fn, _params) {\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...util.normalizeParams(_params),\n });\n return schema;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _superRefine(fn) {\n const ch = _check((payload) => {\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, ch._zod.def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = ch);\n _issue.continue ?? (_issue.continue = !ch._zod.def.abort); // abort is always undefined, so this is always true...\n payload.issues.push(util.issue(_issue));\n }\n };\n return fn(payload.value, payload);\n });\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _check(fn, params) {\n const ch = new checks.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function describe(description) {\n const ch = new checks.$ZodCheck({ check: \"describe\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, description });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function meta(metadata) {\n const ch = new checks.$ZodCheck({ check: \"meta\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, ...metadata });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringbool(Classes, _params) {\n const params = util.normalizeParams(_params);\n let truthyArray = params.truthy ?? [\"true\", \"1\", \"yes\", \"on\", \"y\", \"enabled\"];\n let falsyArray = params.falsy ?? [\"false\", \"0\", \"no\", \"off\", \"n\", \"disabled\"];\n if (params.case !== \"sensitive\") {\n truthyArray = truthyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n falsyArray = falsyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n }\n const truthySet = new Set(truthyArray);\n const falsySet = new Set(falsyArray);\n const _Codec = Classes.Codec ?? schemas.$ZodCodec;\n const _Boolean = Classes.Boolean ?? schemas.$ZodBoolean;\n const _String = Classes.String ?? schemas.$ZodString;\n const stringSchema = new _String({ type: \"string\", error: params.error });\n const booleanSchema = new _Boolean({ type: \"boolean\", error: params.error });\n const codec = new _Codec({\n type: \"pipe\",\n in: stringSchema,\n out: booleanSchema,\n transform: ((input, payload) => {\n let data = input;\n if (params.case !== \"sensitive\")\n data = data.toLowerCase();\n if (truthySet.has(data)) {\n return true;\n }\n else if (falsySet.has(data)) {\n return false;\n }\n else {\n payload.issues.push({\n code: \"invalid_value\",\n expected: \"stringbool\",\n values: [...truthySet, ...falsySet],\n input: payload.value,\n inst: codec,\n continue: false,\n });\n return {};\n }\n }),\n reverseTransform: ((input, _payload) => {\n if (input === true) {\n return truthyArray[0] || \"true\";\n }\n else {\n return falsyArray[0] || \"false\";\n }\n }),\n error: params.error,\n });\n return codec;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringFormat(Class, format, fnOrRegex, _params = {}) {\n const params = util.normalizeParams(_params);\n const def = {\n ...util.normalizeParams(_params),\n check: \"string_format\",\n type: \"string\",\n format,\n fn: typeof fnOrRegex === \"function\" ? fnOrRegex : (val) => fnOrRegex.test(val),\n ...params,\n };\n if (fnOrRegex instanceof RegExp) {\n def.pattern = fnOrRegex;\n }\n const inst = new Class(def);\n return inst;\n}\n","import { globalRegistry } from \"./registries.js\";\n// function initializeContext<T extends schemas.$ZodType>(inputs: JSONSchemaGeneratorParams<T>): ToJSONSchemaContext<T> {\n// return {\n// processor: inputs.processor,\n// metadataRegistry: inputs.metadata ?? globalRegistry,\n// target: inputs.target ?? \"draft-2020-12\",\n// unrepresentable: inputs.unrepresentable ?? \"throw\",\n// };\n// }\nexport function initializeContext(params) {\n // Normalize target: convert old non-hyphenated versions to hyphenated versions\n let target = params?.target ?? \"draft-2020-12\";\n if (target === \"draft-4\")\n target = \"draft-04\";\n if (target === \"draft-7\")\n target = \"draft-07\";\n return {\n processors: params.processors ?? {},\n metadataRegistry: params?.metadata ?? globalRegistry,\n target,\n unrepresentable: params?.unrepresentable ?? \"throw\",\n override: params?.override ?? (() => { }),\n io: params?.io ?? \"output\",\n counter: 0,\n seen: new Map(),\n cycles: params?.cycles ?? \"ref\",\n reused: params?.reused ?? \"inline\",\n external: params?.external ?? undefined,\n };\n}\nexport function process(schema, ctx, _params = { path: [], schemaPath: [] }) {\n var _a;\n const def = schema._zod.def;\n // check for schema in seens\n const seen = ctx.seen.get(schema);\n if (seen) {\n seen.count++;\n // check if cycle\n const isCycle = _params.schemaPath.includes(schema);\n if (isCycle) {\n seen.cycle = _params.path;\n }\n return seen.schema;\n }\n // initialize\n const result = { schema: {}, count: 1, cycle: undefined, path: _params.path };\n ctx.seen.set(schema, result);\n // custom method overrides default behavior\n const overrideSchema = schema._zod.toJSONSchema?.();\n if (overrideSchema) {\n result.schema = overrideSchema;\n }\n else {\n const params = {\n ..._params,\n schemaPath: [..._params.schemaPath, schema],\n path: _params.path,\n };\n if (schema._zod.processJSONSchema) {\n schema._zod.processJSONSchema(ctx, result.schema, params);\n }\n else {\n const _json = result.schema;\n const processor = ctx.processors[def.type];\n if (!processor) {\n throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);\n }\n processor(schema, ctx, _json, params);\n }\n const parent = schema._zod.parent;\n if (parent) {\n // Also set ref if processor didn't (for inheritance)\n if (!result.ref)\n result.ref = parent;\n process(parent, ctx, params);\n ctx.seen.get(parent).isParent = true;\n }\n }\n // metadata\n const meta = ctx.metadataRegistry.get(schema);\n if (meta)\n Object.assign(result.schema, meta);\n if (ctx.io === \"input\" && isTransforming(schema)) {\n // examples/defaults only apply to output type of pipe\n delete result.schema.examples;\n delete result.schema.default;\n }\n // set prefault as default\n if (ctx.io === \"input\" && result.schema._prefault)\n (_a = result.schema).default ?? (_a.default = result.schema._prefault);\n delete result.schema._prefault;\n // pulling fresh from ctx.seen in case it was overwritten\n const _result = ctx.seen.get(schema);\n return _result.schema;\n}\nexport function extractDefs(ctx, schema\n// params: EmitParams\n) {\n // iterate over seen map;\n const root = ctx.seen.get(schema);\n if (!root)\n throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n // Track ids to detect duplicates across different schemas\n const idToSchema = new Map();\n for (const entry of ctx.seen.entries()) {\n const id = ctx.metadataRegistry.get(entry[0])?.id;\n if (id) {\n const existing = idToSchema.get(id);\n if (existing && existing !== entry[0]) {\n throw new Error(`Duplicate schema id \"${id}\" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);\n }\n idToSchema.set(id, entry[0]);\n }\n }\n // returns a ref to the schema\n // defId will be empty if the ref points to an external schema (or #)\n const makeURI = (entry) => {\n // comparing the seen objects because sometimes\n // multiple schemas map to the same seen object.\n // e.g. lazy\n // external is configured\n const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n if (ctx.external) {\n const externalId = ctx.external.registry.get(entry[0])?.id; // ?? \"__shared\";// `__schema${ctx.counter++}`;\n // check if schema is in the external registry\n const uriGenerator = ctx.external.uri ?? ((id) => id);\n if (externalId) {\n return { ref: uriGenerator(externalId) };\n }\n // otherwise, add to __shared\n const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;\n entry[1].defId = id; // set defId so it will be reused if needed\n return { defId: id, ref: `${uriGenerator(\"__shared\")}#/${defsSegment}/${id}` };\n }\n if (entry[1] === root) {\n return { ref: \"#\" };\n }\n // self-contained schema\n const uriPrefix = `#`;\n const defUriPrefix = `${uriPrefix}/${defsSegment}/`;\n const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;\n return { defId, ref: defUriPrefix + defId };\n };\n // stored cached version in `def` property\n // remove all properties, set $ref\n const extractToDef = (entry) => {\n // if the schema is already a reference, do not extract it\n if (entry[1].schema.$ref) {\n return;\n }\n const seen = entry[1];\n const { ref, defId } = makeURI(entry);\n seen.def = { ...seen.schema };\n // defId won't be set if the schema is a reference to an external schema\n // or if the schema is the root schema\n if (defId)\n seen.defId = defId;\n // wipe away all properties except $ref\n const schema = seen.schema;\n for (const key in schema) {\n delete schema[key];\n }\n schema.$ref = ref;\n };\n // throw on cycles\n // break cycles\n if (ctx.cycles === \"throw\") {\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n if (seen.cycle) {\n throw new Error(\"Cycle detected: \" +\n `#/${seen.cycle?.join(\"/\")}/<root>` +\n '\\n\\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.');\n }\n }\n }\n // extract schemas into $defs\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n // convert root schema to # $ref\n if (schema === entry[0]) {\n extractToDef(entry); // this has special handling for the root schema\n continue;\n }\n // extract schemas that are in the external registry\n if (ctx.external) {\n const ext = ctx.external.registry.get(entry[0])?.id;\n if (schema !== entry[0] && ext) {\n extractToDef(entry);\n continue;\n }\n }\n // extract schemas with `id` meta\n const id = ctx.metadataRegistry.get(entry[0])?.id;\n if (id) {\n extractToDef(entry);\n continue;\n }\n // break cycles\n if (seen.cycle) {\n // any\n extractToDef(entry);\n continue;\n }\n // extract reused schemas\n if (seen.count > 1) {\n if (ctx.reused === \"ref\") {\n extractToDef(entry);\n // biome-ignore lint:\n continue;\n }\n }\n }\n}\nexport function finalize(ctx, schema) {\n const root = ctx.seen.get(schema);\n if (!root)\n throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n // flatten refs - inherit properties from parent schemas\n const flattenRef = (zodSchema) => {\n const seen = ctx.seen.get(zodSchema);\n // already processed\n if (seen.ref === null)\n return;\n const schema = seen.def ?? seen.schema;\n const _cached = { ...schema };\n const ref = seen.ref;\n seen.ref = null; // prevent infinite recursion\n if (ref) {\n flattenRef(ref);\n const refSeen = ctx.seen.get(ref);\n const refSchema = refSeen.schema;\n // merge referenced schema into current\n if (refSchema.$ref && (ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\")) {\n // older drafts can't combine $ref with other properties\n schema.allOf = schema.allOf ?? [];\n schema.allOf.push(refSchema);\n }\n else {\n Object.assign(schema, refSchema);\n }\n // restore child's own properties (child wins)\n Object.assign(schema, _cached);\n const isParentRef = zodSchema._zod.parent === ref;\n // For parent chain, child is a refinement - remove parent-only properties\n if (isParentRef) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (!(key in _cached)) {\n delete schema[key];\n }\n }\n }\n // When ref was extracted to $defs, remove properties that match the definition\n if (refSchema.$ref && refSeen.def) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) {\n delete schema[key];\n }\n }\n }\n }\n // If parent was extracted (has $ref), propagate $ref to this schema\n // This handles cases like: readonly().meta({id}).describe()\n // where processor sets ref to innerType but parent should be referenced\n const parent = zodSchema._zod.parent;\n if (parent && parent !== ref) {\n // Ensure parent is processed first so its def has inherited properties\n flattenRef(parent);\n const parentSeen = ctx.seen.get(parent);\n if (parentSeen?.schema.$ref) {\n schema.$ref = parentSeen.schema.$ref;\n // De-duplicate with parent's definition\n if (parentSeen.def) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) {\n delete schema[key];\n }\n }\n }\n }\n }\n // execute overrides\n ctx.override({\n zodSchema: zodSchema,\n jsonSchema: schema,\n path: seen.path ?? [],\n });\n };\n for (const entry of [...ctx.seen.entries()].reverse()) {\n flattenRef(entry[0]);\n }\n const result = {};\n if (ctx.target === \"draft-2020-12\") {\n result.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n }\n else if (ctx.target === \"draft-07\") {\n result.$schema = \"http://json-schema.org/draft-07/schema#\";\n }\n else if (ctx.target === \"draft-04\") {\n result.$schema = \"http://json-schema.org/draft-04/schema#\";\n }\n else if (ctx.target === \"openapi-3.0\") {\n // OpenAPI 3.0 schema objects should not include a $schema property\n }\n else {\n // Arbitrary string values are allowed but won't have a $schema property set\n }\n if (ctx.external?.uri) {\n const id = ctx.external.registry.get(schema)?.id;\n if (!id)\n throw new Error(\"Schema is missing an `id` property\");\n result.$id = ctx.external.uri(id);\n }\n Object.assign(result, root.def ?? root.schema);\n // build defs object\n const defs = ctx.external?.defs ?? {};\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n if (seen.def && seen.defId) {\n defs[seen.defId] = seen.def;\n }\n }\n // set definitions in result\n if (ctx.external) {\n }\n else {\n if (Object.keys(defs).length > 0) {\n if (ctx.target === \"draft-2020-12\") {\n result.$defs = defs;\n }\n else {\n result.definitions = defs;\n }\n }\n }\n try {\n // this \"finalizes\" this schema and ensures all cycles are removed\n // each call to finalize() is functionally independent\n // though the seen map is shared\n const finalized = JSON.parse(JSON.stringify(result));\n Object.defineProperty(finalized, \"~standard\", {\n value: {\n ...schema[\"~standard\"],\n jsonSchema: {\n input: createStandardJSONSchemaMethod(schema, \"input\", ctx.processors),\n output: createStandardJSONSchemaMethod(schema, \"output\", ctx.processors),\n },\n },\n enumerable: false,\n writable: false,\n });\n return finalized;\n }\n catch (_err) {\n throw new Error(\"Error converting schema to JSON.\");\n }\n}\nfunction isTransforming(_schema, _ctx) {\n const ctx = _ctx ?? { seen: new Set() };\n if (ctx.seen.has(_schema))\n return false;\n ctx.seen.add(_schema);\n const def = _schema._zod.def;\n if (def.type === \"transform\")\n return true;\n if (def.type === \"array\")\n return isTransforming(def.element, ctx);\n if (def.type === \"set\")\n return isTransforming(def.valueType, ctx);\n if (def.type === \"lazy\")\n return isTransforming(def.getter(), ctx);\n if (def.type === \"promise\" ||\n def.type === \"optional\" ||\n def.type === \"nonoptional\" ||\n def.type === \"nullable\" ||\n def.type === \"readonly\" ||\n def.type === \"default\" ||\n def.type === \"prefault\") {\n return isTransforming(def.innerType, ctx);\n }\n if (def.type === \"intersection\") {\n return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);\n }\n if (def.type === \"record\" || def.type === \"map\") {\n return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);\n }\n if (def.type === \"pipe\") {\n return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);\n }\n if (def.type === \"object\") {\n for (const key in def.shape) {\n if (isTransforming(def.shape[key], ctx))\n return true;\n }\n return false;\n }\n if (def.type === \"union\") {\n for (const option of def.options) {\n if (isTransforming(option, ctx))\n return true;\n }\n return false;\n }\n if (def.type === \"tuple\") {\n for (const item of def.items) {\n if (isTransforming(item, ctx))\n return true;\n }\n if (def.rest && isTransforming(def.rest, ctx))\n return true;\n return false;\n }\n return false;\n}\n/**\n * Creates a toJSONSchema method for a schema instance.\n * This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.\n */\nexport const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {\n const ctx = initializeContext({ ...params, processors });\n process(schema, ctx);\n extractDefs(ctx, schema);\n return finalize(ctx, schema);\n};\nexport const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {\n const { libraryOptions, target } = params ?? {};\n const ctx = initializeContext({ ...(libraryOptions ?? {}), target, io, processors });\n process(schema, ctx);\n extractDefs(ctx, schema);\n return finalize(ctx, schema);\n};\n","import { extractDefs, finalize, initializeContext, process, } from \"./to-json-schema.js\";\nimport { getEnumValues } from \"./util.js\";\nconst formatMap = {\n guid: \"uuid\",\n url: \"uri\",\n datetime: \"date-time\",\n json_string: \"json-string\",\n regex: \"\", // do not set\n};\n// ==================== SIMPLE TYPE PROCESSORS ====================\nexport const stringProcessor = (schema, ctx, _json, _params) => {\n const json = _json;\n json.type = \"string\";\n const { minimum, maximum, format, patterns, contentEncoding } = schema._zod\n .bag;\n if (typeof minimum === \"number\")\n json.minLength = minimum;\n if (typeof maximum === \"number\")\n json.maxLength = maximum;\n // custom pattern overrides format\n if (format) {\n json.format = formatMap[format] ?? format;\n if (json.format === \"\")\n delete json.format; // empty format is not valid\n // JSON Schema format: \"time\" requires a full time with offset or Z\n // z.iso.time() does not include timezone information, so format: \"time\" should never be used\n if (format === \"time\") {\n delete json.format;\n }\n }\n if (contentEncoding)\n json.contentEncoding = contentEncoding;\n if (patterns && patterns.size > 0) {\n const regexes = [...patterns];\n if (regexes.length === 1)\n json.pattern = regexes[0].source;\n else if (regexes.length > 1) {\n json.allOf = [\n ...regexes.map((regex) => ({\n ...(ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\"\n ? { type: \"string\" }\n : {}),\n pattern: regex.source,\n })),\n ];\n }\n }\n};\nexport const numberProcessor = (schema, ctx, _json, _params) => {\n const json = _json;\n const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;\n if (typeof format === \"string\" && format.includes(\"int\"))\n json.type = \"integer\";\n else\n json.type = \"number\";\n if (typeof exclusiveMinimum === \"number\") {\n if (ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\") {\n json.minimum = exclusiveMinimum;\n json.exclusiveMinimum = true;\n }\n else {\n json.exclusiveMinimum = exclusiveMinimum;\n }\n }\n if (typeof minimum === \"number\") {\n json.minimum = minimum;\n if (typeof exclusiveMinimum === \"number\" && ctx.target !== \"draft-04\") {\n if (exclusiveMinimum >= minimum)\n delete json.minimum;\n else\n delete json.exclusiveMinimum;\n }\n }\n if (typeof exclusiveMaximum === \"number\") {\n if (ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\") {\n json.maximum = exclusiveMaximum;\n json.exclusiveMaximum = true;\n }\n else {\n json.exclusiveMaximum = exclusiveMaximum;\n }\n }\n if (typeof maximum === \"number\") {\n json.maximum = maximum;\n if (typeof exclusiveMaximum === \"number\" && ctx.target !== \"draft-04\") {\n if (exclusiveMaximum <= maximum)\n delete json.maximum;\n else\n delete json.exclusiveMaximum;\n }\n }\n if (typeof multipleOf === \"number\")\n json.multipleOf = multipleOf;\n};\nexport const booleanProcessor = (_schema, _ctx, json, _params) => {\n json.type = \"boolean\";\n};\nexport const bigintProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"BigInt cannot be represented in JSON Schema\");\n }\n};\nexport const symbolProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Symbols cannot be represented in JSON Schema\");\n }\n};\nexport const nullProcessor = (_schema, ctx, json, _params) => {\n if (ctx.target === \"openapi-3.0\") {\n json.type = \"string\";\n json.nullable = true;\n json.enum = [null];\n }\n else {\n json.type = \"null\";\n }\n};\nexport const undefinedProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Undefined cannot be represented in JSON Schema\");\n }\n};\nexport const voidProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Void cannot be represented in JSON Schema\");\n }\n};\nexport const neverProcessor = (_schema, _ctx, json, _params) => {\n json.not = {};\n};\nexport const anyProcessor = (_schema, _ctx, _json, _params) => {\n // empty schema accepts anything\n};\nexport const unknownProcessor = (_schema, _ctx, _json, _params) => {\n // empty schema accepts anything\n};\nexport const dateProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Date cannot be represented in JSON Schema\");\n }\n};\nexport const enumProcessor = (schema, _ctx, json, _params) => {\n const def = schema._zod.def;\n const values = getEnumValues(def.entries);\n // Number enums can have both string and number values\n if (values.every((v) => typeof v === \"number\"))\n json.type = \"number\";\n if (values.every((v) => typeof v === \"string\"))\n json.type = \"string\";\n json.enum = values;\n};\nexport const literalProcessor = (schema, ctx, json, _params) => {\n const def = schema._zod.def;\n const vals = [];\n for (const val of def.values) {\n if (val === undefined) {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Literal `undefined` cannot be represented in JSON Schema\");\n }\n else {\n // do not add to vals\n }\n }\n else if (typeof val === \"bigint\") {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"BigInt literals cannot be represented in JSON Schema\");\n }\n else {\n vals.push(Number(val));\n }\n }\n else {\n vals.push(val);\n }\n }\n if (vals.length === 0) {\n // do nothing (an undefined literal was stripped)\n }\n else if (vals.length === 1) {\n const val = vals[0];\n json.type = val === null ? \"null\" : typeof val;\n if (ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\") {\n json.enum = [val];\n }\n else {\n json.const = val;\n }\n }\n else {\n if (vals.every((v) => typeof v === \"number\"))\n json.type = \"number\";\n if (vals.every((v) => typeof v === \"string\"))\n json.type = \"string\";\n if (vals.every((v) => typeof v === \"boolean\"))\n json.type = \"boolean\";\n if (vals.every((v) => v === null))\n json.type = \"null\";\n json.enum = vals;\n }\n};\nexport const nanProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"NaN cannot be represented in JSON Schema\");\n }\n};\nexport const templateLiteralProcessor = (schema, _ctx, json, _params) => {\n const _json = json;\n const pattern = schema._zod.pattern;\n if (!pattern)\n throw new Error(\"Pattern not found in template literal\");\n _json.type = \"string\";\n _json.pattern = pattern.source;\n};\nexport const fileProcessor = (schema, _ctx, json, _params) => {\n const _json = json;\n const file = {\n type: \"string\",\n format: \"binary\",\n contentEncoding: \"binary\",\n };\n const { minimum, maximum, mime } = schema._zod.bag;\n if (minimum !== undefined)\n file.minLength = minimum;\n if (maximum !== undefined)\n file.maxLength = maximum;\n if (mime) {\n if (mime.length === 1) {\n file.contentMediaType = mime[0];\n Object.assign(_json, file);\n }\n else {\n Object.assign(_json, file); // shared props at root\n _json.anyOf = mime.map((m) => ({ contentMediaType: m })); // only contentMediaType differs\n }\n }\n else {\n Object.assign(_json, file);\n }\n};\nexport const successProcessor = (_schema, _ctx, json, _params) => {\n json.type = \"boolean\";\n};\nexport const customProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Custom types cannot be represented in JSON Schema\");\n }\n};\nexport const functionProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Function types cannot be represented in JSON Schema\");\n }\n};\nexport const transformProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Transforms cannot be represented in JSON Schema\");\n }\n};\nexport const mapProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Map cannot be represented in JSON Schema\");\n }\n};\nexport const setProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Set cannot be represented in JSON Schema\");\n }\n};\n// ==================== COMPOSITE TYPE PROCESSORS ====================\nexport const arrayProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n const { minimum, maximum } = schema._zod.bag;\n if (typeof minimum === \"number\")\n json.minItems = minimum;\n if (typeof maximum === \"number\")\n json.maxItems = maximum;\n json.type = \"array\";\n json.items = process(def.element, ctx, { ...params, path: [...params.path, \"items\"] });\n};\nexport const objectProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"object\";\n json.properties = {};\n const shape = def.shape;\n for (const key in shape) {\n json.properties[key] = process(shape[key], ctx, {\n ...params,\n path: [...params.path, \"properties\", key],\n });\n }\n // required keys\n const allKeys = new Set(Object.keys(shape));\n const requiredKeys = new Set([...allKeys].filter((key) => {\n const v = def.shape[key]._zod;\n if (ctx.io === \"input\") {\n return v.optin === undefined;\n }\n else {\n return v.optout === undefined;\n }\n }));\n if (requiredKeys.size > 0) {\n json.required = Array.from(requiredKeys);\n }\n // catchall\n if (def.catchall?._zod.def.type === \"never\") {\n // strict\n json.additionalProperties = false;\n }\n else if (!def.catchall) {\n // regular\n if (ctx.io === \"output\")\n json.additionalProperties = false;\n }\n else if (def.catchall) {\n json.additionalProperties = process(def.catchall, ctx, {\n ...params,\n path: [...params.path, \"additionalProperties\"],\n });\n }\n};\nexport const unionProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n // Exclusive unions (inclusive === false) use oneOf (exactly one match) instead of anyOf (one or more matches)\n // This includes both z.xor() and discriminated unions\n const isExclusive = def.inclusive === false;\n const options = def.options.map((x, i) => process(x, ctx, {\n ...params,\n path: [...params.path, isExclusive ? \"oneOf\" : \"anyOf\", i],\n }));\n if (isExclusive) {\n json.oneOf = options;\n }\n else {\n json.anyOf = options;\n }\n};\nexport const intersectionProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n const a = process(def.left, ctx, {\n ...params,\n path: [...params.path, \"allOf\", 0],\n });\n const b = process(def.right, ctx, {\n ...params,\n path: [...params.path, \"allOf\", 1],\n });\n const isSimpleIntersection = (val) => \"allOf\" in val && Object.keys(val).length === 1;\n const allOf = [\n ...(isSimpleIntersection(a) ? a.allOf : [a]),\n ...(isSimpleIntersection(b) ? b.allOf : [b]),\n ];\n json.allOf = allOf;\n};\nexport const tupleProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"array\";\n const prefixPath = ctx.target === \"draft-2020-12\" ? \"prefixItems\" : \"items\";\n const restPath = ctx.target === \"draft-2020-12\" ? \"items\" : ctx.target === \"openapi-3.0\" ? \"items\" : \"additionalItems\";\n const prefixItems = def.items.map((x, i) => process(x, ctx, {\n ...params,\n path: [...params.path, prefixPath, i],\n }));\n const rest = def.rest\n ? process(def.rest, ctx, {\n ...params,\n path: [...params.path, restPath, ...(ctx.target === \"openapi-3.0\" ? [def.items.length] : [])],\n })\n : null;\n if (ctx.target === \"draft-2020-12\") {\n json.prefixItems = prefixItems;\n if (rest) {\n json.items = rest;\n }\n }\n else if (ctx.target === \"openapi-3.0\") {\n json.items = {\n anyOf: prefixItems,\n };\n if (rest) {\n json.items.anyOf.push(rest);\n }\n json.minItems = prefixItems.length;\n if (!rest) {\n json.maxItems = prefixItems.length;\n }\n }\n else {\n json.items = prefixItems;\n if (rest) {\n json.additionalItems = rest;\n }\n }\n // length\n const { minimum, maximum } = schema._zod.bag;\n if (typeof minimum === \"number\")\n json.minItems = minimum;\n if (typeof maximum === \"number\")\n json.maxItems = maximum;\n};\nexport const recordProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"object\";\n // For looseRecord with regex patterns, use patternProperties\n // This correctly represents \"only validate keys matching the pattern\" semantics\n // and composes well with allOf (intersections)\n const keyType = def.keyType;\n const keyBag = keyType._zod.bag;\n const patterns = keyBag?.patterns;\n if (def.mode === \"loose\" && patterns && patterns.size > 0) {\n // Use patternProperties for looseRecord with regex patterns\n const valueSchema = process(def.valueType, ctx, {\n ...params,\n path: [...params.path, \"patternProperties\", \"*\"],\n });\n json.patternProperties = {};\n for (const pattern of patterns) {\n json.patternProperties[pattern.source] = valueSchema;\n }\n }\n else {\n // Default behavior: use propertyNames + additionalProperties\n if (ctx.target === \"draft-07\" || ctx.target === \"draft-2020-12\") {\n json.propertyNames = process(def.keyType, ctx, {\n ...params,\n path: [...params.path, \"propertyNames\"],\n });\n }\n json.additionalProperties = process(def.valueType, ctx, {\n ...params,\n path: [...params.path, \"additionalProperties\"],\n });\n }\n // Add required for keys with discrete values (enum, literal, etc.)\n const keyValues = keyType._zod.values;\n if (keyValues) {\n const validKeyValues = [...keyValues].filter((v) => typeof v === \"string\" || typeof v === \"number\");\n if (validKeyValues.length > 0) {\n json.required = validKeyValues;\n }\n }\n};\nexport const nullableProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n const inner = process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n if (ctx.target === \"openapi-3.0\") {\n seen.ref = def.innerType;\n json.nullable = true;\n }\n else {\n json.anyOf = [inner, { type: \"null\" }];\n }\n};\nexport const nonoptionalProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const defaultProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n json.default = JSON.parse(JSON.stringify(def.defaultValue));\n};\nexport const prefaultProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n if (ctx.io === \"input\")\n json._prefault = JSON.parse(JSON.stringify(def.defaultValue));\n};\nexport const catchProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n let catchValue;\n try {\n catchValue = def.catchValue(undefined);\n }\n catch {\n throw new Error(\"Dynamic catch values are not supported in JSON Schema\");\n }\n json.default = catchValue;\n};\nexport const pipeProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n const innerType = ctx.io === \"input\" ? (def.in._zod.def.type === \"transform\" ? def.out : def.in) : def.out;\n process(innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = innerType;\n};\nexport const readonlyProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n json.readOnly = true;\n};\nexport const promiseProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const optionalProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const lazyProcessor = (schema, ctx, _json, params) => {\n const innerType = schema._zod.innerType;\n process(innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = innerType;\n};\n// ==================== ALL PROCESSORS ====================\nexport const allProcessors = {\n string: stringProcessor,\n number: numberProcessor,\n boolean: booleanProcessor,\n bigint: bigintProcessor,\n symbol: symbolProcessor,\n null: nullProcessor,\n undefined: undefinedProcessor,\n void: voidProcessor,\n never: neverProcessor,\n any: anyProcessor,\n unknown: unknownProcessor,\n date: dateProcessor,\n enum: enumProcessor,\n literal: literalProcessor,\n nan: nanProcessor,\n template_literal: templateLiteralProcessor,\n file: fileProcessor,\n success: successProcessor,\n custom: customProcessor,\n function: functionProcessor,\n transform: transformProcessor,\n map: mapProcessor,\n set: setProcessor,\n array: arrayProcessor,\n object: objectProcessor,\n union: unionProcessor,\n intersection: intersectionProcessor,\n tuple: tupleProcessor,\n record: recordProcessor,\n nullable: nullableProcessor,\n nonoptional: nonoptionalProcessor,\n default: defaultProcessor,\n prefault: prefaultProcessor,\n catch: catchProcessor,\n pipe: pipeProcessor,\n readonly: readonlyProcessor,\n promise: promiseProcessor,\n optional: optionalProcessor,\n lazy: lazyProcessor,\n};\nexport function toJSONSchema(input, params) {\n if (\"_idmap\" in input) {\n // Registry case\n const registry = input;\n const ctx = initializeContext({ ...params, processors: allProcessors });\n const defs = {};\n // First pass: process all schemas to build the seen map\n for (const entry of registry._idmap.entries()) {\n const [_, schema] = entry;\n process(schema, ctx);\n }\n const schemas = {};\n const external = {\n registry,\n uri: params?.uri,\n defs,\n };\n // Update the context with external configuration\n ctx.external = external;\n // Second pass: emit each schema\n for (const entry of registry._idmap.entries()) {\n const [key, schema] = entry;\n extractDefs(ctx, schema);\n schemas[key] = finalize(ctx, schema);\n }\n if (Object.keys(defs).length > 0) {\n const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n schemas.__shared = {\n [defsSegment]: defs,\n };\n }\n return { schemas };\n }\n // Single schema case\n const ctx = initializeContext({ ...params, processors: allProcessors });\n process(input, ctx);\n extractDefs(ctx, input);\n return finalize(ctx, input);\n}\n","import * as core from \"../core/index.js\";\nimport * as schemas from \"./schemas.js\";\nexport const ZodISODateTime = /*@__PURE__*/ core.$constructor(\"ZodISODateTime\", (inst, def) => {\n core.$ZodISODateTime.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function datetime(params) {\n return core._isoDateTime(ZodISODateTime, params);\n}\nexport const ZodISODate = /*@__PURE__*/ core.$constructor(\"ZodISODate\", (inst, def) => {\n core.$ZodISODate.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function date(params) {\n return core._isoDate(ZodISODate, params);\n}\nexport const ZodISOTime = /*@__PURE__*/ core.$constructor(\"ZodISOTime\", (inst, def) => {\n core.$ZodISOTime.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function time(params) {\n return core._isoTime(ZodISOTime, params);\n}\nexport const ZodISODuration = /*@__PURE__*/ core.$constructor(\"ZodISODuration\", (inst, def) => {\n core.$ZodISODuration.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function duration(params) {\n return core._isoDuration(ZodISODuration, params);\n}\n","import * as core from \"../core/index.js\";\nimport { $ZodError } from \"../core/index.js\";\nimport * as util from \"../core/util.js\";\nconst initializer = (inst, issues) => {\n $ZodError.init(inst, issues);\n inst.name = \"ZodError\";\n Object.defineProperties(inst, {\n format: {\n value: (mapper) => core.formatError(inst, mapper),\n // enumerable: false,\n },\n flatten: {\n value: (mapper) => core.flattenError(inst, mapper),\n // enumerable: false,\n },\n addIssue: {\n value: (issue) => {\n inst.issues.push(issue);\n inst.message = JSON.stringify(inst.issues, util.jsonStringifyReplacer, 2);\n },\n // enumerable: false,\n },\n addIssues: {\n value: (issues) => {\n inst.issues.push(...issues);\n inst.message = JSON.stringify(inst.issues, util.jsonStringifyReplacer, 2);\n },\n // enumerable: false,\n },\n isEmpty: {\n get() {\n return inst.issues.length === 0;\n },\n // enumerable: false,\n },\n });\n // Object.defineProperty(inst, \"isEmpty\", {\n // get() {\n // return inst.issues.length === 0;\n // },\n // });\n};\nexport const ZodError = core.$constructor(\"ZodError\", initializer);\nexport const ZodRealError = core.$constructor(\"ZodError\", initializer, {\n Parent: Error,\n});\n// /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */\n// export type ErrorMapCtx = core.$ZodErrorMapCtx;\n","import * as core from \"../core/index.js\";\nimport { ZodRealError } from \"./errors.js\";\nexport const parse = /* @__PURE__ */ core._parse(ZodRealError);\nexport const parseAsync = /* @__PURE__ */ core._parseAsync(ZodRealError);\nexport const safeParse = /* @__PURE__ */ core._safeParse(ZodRealError);\nexport const safeParseAsync = /* @__PURE__ */ core._safeParseAsync(ZodRealError);\n// Codec functions\nexport const encode = /* @__PURE__ */ core._encode(ZodRealError);\nexport const decode = /* @__PURE__ */ core._decode(ZodRealError);\nexport const encodeAsync = /* @__PURE__ */ core._encodeAsync(ZodRealError);\nexport const decodeAsync = /* @__PURE__ */ core._decodeAsync(ZodRealError);\nexport const safeEncode = /* @__PURE__ */ core._safeEncode(ZodRealError);\nexport const safeDecode = /* @__PURE__ */ core._safeDecode(ZodRealError);\nexport const safeEncodeAsync = /* @__PURE__ */ core._safeEncodeAsync(ZodRealError);\nexport const safeDecodeAsync = /* @__PURE__ */ core._safeDecodeAsync(ZodRealError);\n","import * as core from \"../core/index.js\";\nimport { util } from \"../core/index.js\";\nimport * as processors from \"../core/json-schema-processors.js\";\nimport { createStandardJSONSchemaMethod, createToJSONSchemaMethod } from \"../core/to-json-schema.js\";\nimport * as checks from \"./checks.js\";\nimport * as iso from \"./iso.js\";\nimport * as parse from \"./parse.js\";\nexport const ZodType = /*@__PURE__*/ core.$constructor(\"ZodType\", (inst, def) => {\n core.$ZodType.init(inst, def);\n Object.assign(inst[\"~standard\"], {\n jsonSchema: {\n input: createStandardJSONSchemaMethod(inst, \"input\"),\n output: createStandardJSONSchemaMethod(inst, \"output\"),\n },\n });\n inst.toJSONSchema = createToJSONSchemaMethod(inst, {});\n inst.def = def;\n inst.type = def.type;\n Object.defineProperty(inst, \"_def\", { value: def });\n // base methods\n inst.check = (...checks) => {\n return inst.clone(util.mergeDefs(def, {\n checks: [\n ...(def.checks ?? []),\n ...checks.map((ch) => typeof ch === \"function\" ? { _zod: { check: ch, def: { check: \"custom\" }, onattach: [] } } : ch),\n ],\n }), {\n parent: true,\n });\n };\n inst.with = inst.check;\n inst.clone = (def, params) => core.clone(inst, def, params);\n inst.brand = () => inst;\n inst.register = ((reg, meta) => {\n reg.add(inst, meta);\n return inst;\n });\n // parsing\n inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });\n inst.safeParse = (data, params) => parse.safeParse(inst, data, params);\n inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });\n inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);\n inst.spa = inst.safeParseAsync;\n // encoding/decoding\n inst.encode = (data, params) => parse.encode(inst, data, params);\n inst.decode = (data, params) => parse.decode(inst, data, params);\n inst.encodeAsync = async (data, params) => parse.encodeAsync(inst, data, params);\n inst.decodeAsync = async (data, params) => parse.decodeAsync(inst, data, params);\n inst.safeEncode = (data, params) => parse.safeEncode(inst, data, params);\n inst.safeDecode = (data, params) => parse.safeDecode(inst, data, params);\n inst.safeEncodeAsync = async (data, params) => parse.safeEncodeAsync(inst, data, params);\n inst.safeDecodeAsync = async (data, params) => parse.safeDecodeAsync(inst, data, params);\n // refinements\n inst.refine = (check, params) => inst.check(refine(check, params));\n inst.superRefine = (refinement) => inst.check(superRefine(refinement));\n inst.overwrite = (fn) => inst.check(checks.overwrite(fn));\n // wrappers\n inst.optional = () => optional(inst);\n inst.exactOptional = () => exactOptional(inst);\n inst.nullable = () => nullable(inst);\n inst.nullish = () => optional(nullable(inst));\n inst.nonoptional = (params) => nonoptional(inst, params);\n inst.array = () => array(inst);\n inst.or = (arg) => union([inst, arg]);\n inst.and = (arg) => intersection(inst, arg);\n inst.transform = (tx) => pipe(inst, transform(tx));\n inst.default = (def) => _default(inst, def);\n inst.prefault = (def) => prefault(inst, def);\n // inst.coalesce = (def, params) => coalesce(inst, def, params);\n inst.catch = (params) => _catch(inst, params);\n inst.pipe = (target) => pipe(inst, target);\n inst.readonly = () => readonly(inst);\n // meta\n inst.describe = (description) => {\n const cl = inst.clone();\n core.globalRegistry.add(cl, { description });\n return cl;\n };\n Object.defineProperty(inst, \"description\", {\n get() {\n return core.globalRegistry.get(inst)?.description;\n },\n configurable: true,\n });\n inst.meta = (...args) => {\n if (args.length === 0) {\n return core.globalRegistry.get(inst);\n }\n const cl = inst.clone();\n core.globalRegistry.add(cl, args[0]);\n return cl;\n };\n // helpers\n inst.isOptional = () => inst.safeParse(undefined).success;\n inst.isNullable = () => inst.safeParse(null).success;\n inst.apply = (fn) => fn(inst);\n return inst;\n});\n/** @internal */\nexport const _ZodString = /*@__PURE__*/ core.$constructor(\"_ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.stringProcessor(inst, ctx, json, params);\n const bag = inst._zod.bag;\n inst.format = bag.format ?? null;\n inst.minLength = bag.minimum ?? null;\n inst.maxLength = bag.maximum ?? null;\n // validations\n inst.regex = (...args) => inst.check(checks.regex(...args));\n inst.includes = (...args) => inst.check(checks.includes(...args));\n inst.startsWith = (...args) => inst.check(checks.startsWith(...args));\n inst.endsWith = (...args) => inst.check(checks.endsWith(...args));\n inst.min = (...args) => inst.check(checks.minLength(...args));\n inst.max = (...args) => inst.check(checks.maxLength(...args));\n inst.length = (...args) => inst.check(checks.length(...args));\n inst.nonempty = (...args) => inst.check(checks.minLength(1, ...args));\n inst.lowercase = (params) => inst.check(checks.lowercase(params));\n inst.uppercase = (params) => inst.check(checks.uppercase(params));\n // transforms\n inst.trim = () => inst.check(checks.trim());\n inst.normalize = (...args) => inst.check(checks.normalize(...args));\n inst.toLowerCase = () => inst.check(checks.toLowerCase());\n inst.toUpperCase = () => inst.check(checks.toUpperCase());\n inst.slugify = () => inst.check(checks.slugify());\n});\nexport const ZodString = /*@__PURE__*/ core.$constructor(\"ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n _ZodString.init(inst, def);\n inst.email = (params) => inst.check(core._email(ZodEmail, params));\n inst.url = (params) => inst.check(core._url(ZodURL, params));\n inst.jwt = (params) => inst.check(core._jwt(ZodJWT, params));\n inst.emoji = (params) => inst.check(core._emoji(ZodEmoji, params));\n inst.guid = (params) => inst.check(core._guid(ZodGUID, params));\n inst.uuid = (params) => inst.check(core._uuid(ZodUUID, params));\n inst.uuidv4 = (params) => inst.check(core._uuidv4(ZodUUID, params));\n inst.uuidv6 = (params) => inst.check(core._uuidv6(ZodUUID, params));\n inst.uuidv7 = (params) => inst.check(core._uuidv7(ZodUUID, params));\n inst.nanoid = (params) => inst.check(core._nanoid(ZodNanoID, params));\n inst.guid = (params) => inst.check(core._guid(ZodGUID, params));\n inst.cuid = (params) => inst.check(core._cuid(ZodCUID, params));\n inst.cuid2 = (params) => inst.check(core._cuid2(ZodCUID2, params));\n inst.ulid = (params) => inst.check(core._ulid(ZodULID, params));\n inst.base64 = (params) => inst.check(core._base64(ZodBase64, params));\n inst.base64url = (params) => inst.check(core._base64url(ZodBase64URL, params));\n inst.xid = (params) => inst.check(core._xid(ZodXID, params));\n inst.ksuid = (params) => inst.check(core._ksuid(ZodKSUID, params));\n inst.ipv4 = (params) => inst.check(core._ipv4(ZodIPv4, params));\n inst.ipv6 = (params) => inst.check(core._ipv6(ZodIPv6, params));\n inst.cidrv4 = (params) => inst.check(core._cidrv4(ZodCIDRv4, params));\n inst.cidrv6 = (params) => inst.check(core._cidrv6(ZodCIDRv6, params));\n inst.e164 = (params) => inst.check(core._e164(ZodE164, params));\n // iso\n inst.datetime = (params) => inst.check(iso.datetime(params));\n inst.date = (params) => inst.check(iso.date(params));\n inst.time = (params) => inst.check(iso.time(params));\n inst.duration = (params) => inst.check(iso.duration(params));\n});\nexport function string(params) {\n return core._string(ZodString, params);\n}\nexport const ZodStringFormat = /*@__PURE__*/ core.$constructor(\"ZodStringFormat\", (inst, def) => {\n core.$ZodStringFormat.init(inst, def);\n _ZodString.init(inst, def);\n});\nexport const ZodEmail = /*@__PURE__*/ core.$constructor(\"ZodEmail\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmail.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function email(params) {\n return core._email(ZodEmail, params);\n}\nexport const ZodGUID = /*@__PURE__*/ core.$constructor(\"ZodGUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodGUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function guid(params) {\n return core._guid(ZodGUID, params);\n}\nexport const ZodUUID = /*@__PURE__*/ core.$constructor(\"ZodUUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodUUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function uuid(params) {\n return core._uuid(ZodUUID, params);\n}\nexport function uuidv4(params) {\n return core._uuidv4(ZodUUID, params);\n}\n// ZodUUIDv6\nexport function uuidv6(params) {\n return core._uuidv6(ZodUUID, params);\n}\n// ZodUUIDv7\nexport function uuidv7(params) {\n return core._uuidv7(ZodUUID, params);\n}\nexport const ZodURL = /*@__PURE__*/ core.$constructor(\"ZodURL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodURL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function url(params) {\n return core._url(ZodURL, params);\n}\nexport function httpUrl(params) {\n return core._url(ZodURL, {\n protocol: /^https?$/,\n hostname: core.regexes.domain,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodEmoji = /*@__PURE__*/ core.$constructor(\"ZodEmoji\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmoji.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function emoji(params) {\n return core._emoji(ZodEmoji, params);\n}\nexport const ZodNanoID = /*@__PURE__*/ core.$constructor(\"ZodNanoID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodNanoID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function nanoid(params) {\n return core._nanoid(ZodNanoID, params);\n}\nexport const ZodCUID = /*@__PURE__*/ core.$constructor(\"ZodCUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cuid(params) {\n return core._cuid(ZodCUID, params);\n}\nexport const ZodCUID2 = /*@__PURE__*/ core.$constructor(\"ZodCUID2\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID2.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cuid2(params) {\n return core._cuid2(ZodCUID2, params);\n}\nexport const ZodULID = /*@__PURE__*/ core.$constructor(\"ZodULID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodULID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ulid(params) {\n return core._ulid(ZodULID, params);\n}\nexport const ZodXID = /*@__PURE__*/ core.$constructor(\"ZodXID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodXID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function xid(params) {\n return core._xid(ZodXID, params);\n}\nexport const ZodKSUID = /*@__PURE__*/ core.$constructor(\"ZodKSUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodKSUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ksuid(params) {\n return core._ksuid(ZodKSUID, params);\n}\nexport const ZodIPv4 = /*@__PURE__*/ core.$constructor(\"ZodIPv4\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv4(params) {\n return core._ipv4(ZodIPv4, params);\n}\nexport const ZodMAC = /*@__PURE__*/ core.$constructor(\"ZodMAC\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodMAC.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function mac(params) {\n return core._mac(ZodMAC, params);\n}\nexport const ZodIPv6 = /*@__PURE__*/ core.$constructor(\"ZodIPv6\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv6(params) {\n return core._ipv6(ZodIPv6, params);\n}\nexport const ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv4\", (inst, def) => {\n core.$ZodCIDRv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv4(params) {\n return core._cidrv4(ZodCIDRv4, params);\n}\nexport const ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv6\", (inst, def) => {\n core.$ZodCIDRv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv6(params) {\n return core._cidrv6(ZodCIDRv6, params);\n}\nexport const ZodBase64 = /*@__PURE__*/ core.$constructor(\"ZodBase64\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64(params) {\n return core._base64(ZodBase64, params);\n}\nexport const ZodBase64URL = /*@__PURE__*/ core.$constructor(\"ZodBase64URL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64URL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64url(params) {\n return core._base64url(ZodBase64URL, params);\n}\nexport const ZodE164 = /*@__PURE__*/ core.$constructor(\"ZodE164\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodE164.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function e164(params) {\n return core._e164(ZodE164, params);\n}\nexport const ZodJWT = /*@__PURE__*/ core.$constructor(\"ZodJWT\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodJWT.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function jwt(params) {\n return core._jwt(ZodJWT, params);\n}\nexport const ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"ZodCustomStringFormat\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCustomStringFormat.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function stringFormat(format, fnOrRegex, _params = {}) {\n return core._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);\n}\nexport function hostname(_params) {\n return core._stringFormat(ZodCustomStringFormat, \"hostname\", core.regexes.hostname, _params);\n}\nexport function hex(_params) {\n return core._stringFormat(ZodCustomStringFormat, \"hex\", core.regexes.hex, _params);\n}\nexport function hash(alg, params) {\n const enc = params?.enc ?? \"hex\";\n const format = `${alg}_${enc}`;\n const regex = core.regexes[format];\n if (!regex)\n throw new Error(`Unrecognized hash format: ${format}`);\n return core._stringFormat(ZodCustomStringFormat, format, regex, params);\n}\nexport const ZodNumber = /*@__PURE__*/ core.$constructor(\"ZodNumber\", (inst, def) => {\n core.$ZodNumber.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.numberProcessor(inst, ctx, json, params);\n inst.gt = (value, params) => inst.check(checks.gt(value, params));\n inst.gte = (value, params) => inst.check(checks.gte(value, params));\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.lt = (value, params) => inst.check(checks.lt(value, params));\n inst.lte = (value, params) => inst.check(checks.lte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n inst.int = (params) => inst.check(int(params));\n inst.safe = (params) => inst.check(int(params));\n inst.positive = (params) => inst.check(checks.gt(0, params));\n inst.nonnegative = (params) => inst.check(checks.gte(0, params));\n inst.negative = (params) => inst.check(checks.lt(0, params));\n inst.nonpositive = (params) => inst.check(checks.lte(0, params));\n inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));\n inst.step = (value, params) => inst.check(checks.multipleOf(value, params));\n // inst.finite = (params) => inst.check(core.finite(params));\n inst.finite = () => inst;\n const bag = inst._zod.bag;\n inst.minValue =\n Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;\n inst.maxValue =\n Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;\n inst.isInt = (bag.format ?? \"\").includes(\"int\") || Number.isSafeInteger(bag.multipleOf ?? 0.5);\n inst.isFinite = true;\n inst.format = bag.format ?? null;\n});\nexport function number(params) {\n return core._number(ZodNumber, params);\n}\nexport const ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"ZodNumberFormat\", (inst, def) => {\n core.$ZodNumberFormat.init(inst, def);\n ZodNumber.init(inst, def);\n});\nexport function int(params) {\n return core._int(ZodNumberFormat, params);\n}\nexport function float32(params) {\n return core._float32(ZodNumberFormat, params);\n}\nexport function float64(params) {\n return core._float64(ZodNumberFormat, params);\n}\nexport function int32(params) {\n return core._int32(ZodNumberFormat, params);\n}\nexport function uint32(params) {\n return core._uint32(ZodNumberFormat, params);\n}\nexport const ZodBoolean = /*@__PURE__*/ core.$constructor(\"ZodBoolean\", (inst, def) => {\n core.$ZodBoolean.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.booleanProcessor(inst, ctx, json, params);\n});\nexport function boolean(params) {\n return core._boolean(ZodBoolean, params);\n}\nexport const ZodBigInt = /*@__PURE__*/ core.$constructor(\"ZodBigInt\", (inst, def) => {\n core.$ZodBigInt.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.bigintProcessor(inst, ctx, json, params);\n inst.gte = (value, params) => inst.check(checks.gte(value, params));\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.gt = (value, params) => inst.check(checks.gt(value, params));\n inst.gte = (value, params) => inst.check(checks.gte(value, params));\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.lt = (value, params) => inst.check(checks.lt(value, params));\n inst.lte = (value, params) => inst.check(checks.lte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n inst.positive = (params) => inst.check(checks.gt(BigInt(0), params));\n inst.negative = (params) => inst.check(checks.lt(BigInt(0), params));\n inst.nonpositive = (params) => inst.check(checks.lte(BigInt(0), params));\n inst.nonnegative = (params) => inst.check(checks.gte(BigInt(0), params));\n inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));\n const bag = inst._zod.bag;\n inst.minValue = bag.minimum ?? null;\n inst.maxValue = bag.maximum ?? null;\n inst.format = bag.format ?? null;\n});\nexport function bigint(params) {\n return core._bigint(ZodBigInt, params);\n}\nexport const ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"ZodBigIntFormat\", (inst, def) => {\n core.$ZodBigIntFormat.init(inst, def);\n ZodBigInt.init(inst, def);\n});\n// int64\nexport function int64(params) {\n return core._int64(ZodBigIntFormat, params);\n}\n// uint64\nexport function uint64(params) {\n return core._uint64(ZodBigIntFormat, params);\n}\nexport const ZodSymbol = /*@__PURE__*/ core.$constructor(\"ZodSymbol\", (inst, def) => {\n core.$ZodSymbol.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.symbolProcessor(inst, ctx, json, params);\n});\nexport function symbol(params) {\n return core._symbol(ZodSymbol, params);\n}\nexport const ZodUndefined = /*@__PURE__*/ core.$constructor(\"ZodUndefined\", (inst, def) => {\n core.$ZodUndefined.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.undefinedProcessor(inst, ctx, json, params);\n});\nfunction _undefined(params) {\n return core._undefined(ZodUndefined, params);\n}\nexport { _undefined as undefined };\nexport const ZodNull = /*@__PURE__*/ core.$constructor(\"ZodNull\", (inst, def) => {\n core.$ZodNull.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nullProcessor(inst, ctx, json, params);\n});\nfunction _null(params) {\n return core._null(ZodNull, params);\n}\nexport { _null as null };\nexport const ZodAny = /*@__PURE__*/ core.$constructor(\"ZodAny\", (inst, def) => {\n core.$ZodAny.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.anyProcessor(inst, ctx, json, params);\n});\nexport function any() {\n return core._any(ZodAny);\n}\nexport const ZodUnknown = /*@__PURE__*/ core.$constructor(\"ZodUnknown\", (inst, def) => {\n core.$ZodUnknown.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unknownProcessor(inst, ctx, json, params);\n});\nexport function unknown() {\n return core._unknown(ZodUnknown);\n}\nexport const ZodNever = /*@__PURE__*/ core.$constructor(\"ZodNever\", (inst, def) => {\n core.$ZodNever.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.neverProcessor(inst, ctx, json, params);\n});\nexport function never(params) {\n return core._never(ZodNever, params);\n}\nexport const ZodVoid = /*@__PURE__*/ core.$constructor(\"ZodVoid\", (inst, def) => {\n core.$ZodVoid.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.voidProcessor(inst, ctx, json, params);\n});\nfunction _void(params) {\n return core._void(ZodVoid, params);\n}\nexport { _void as void };\nexport const ZodDate = /*@__PURE__*/ core.$constructor(\"ZodDate\", (inst, def) => {\n core.$ZodDate.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.dateProcessor(inst, ctx, json, params);\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n const c = inst._zod.bag;\n inst.minDate = c.minimum ? new Date(c.minimum) : null;\n inst.maxDate = c.maximum ? new Date(c.maximum) : null;\n});\nexport function date(params) {\n return core._date(ZodDate, params);\n}\nexport const ZodArray = /*@__PURE__*/ core.$constructor(\"ZodArray\", (inst, def) => {\n core.$ZodArray.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.arrayProcessor(inst, ctx, json, params);\n inst.element = def.element;\n inst.min = (minLength, params) => inst.check(checks.minLength(minLength, params));\n inst.nonempty = (params) => inst.check(checks.minLength(1, params));\n inst.max = (maxLength, params) => inst.check(checks.maxLength(maxLength, params));\n inst.length = (len, params) => inst.check(checks.length(len, params));\n inst.unwrap = () => inst.element;\n});\nexport function array(element, params) {\n return core._array(ZodArray, element, params);\n}\n// .keyof\nexport function keyof(schema) {\n const shape = schema._zod.def.shape;\n return _enum(Object.keys(shape));\n}\nexport const ZodObject = /*@__PURE__*/ core.$constructor(\"ZodObject\", (inst, def) => {\n core.$ZodObjectJIT.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.objectProcessor(inst, ctx, json, params);\n util.defineLazy(inst, \"shape\", () => {\n return def.shape;\n });\n inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));\n inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall: catchall });\n inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });\n inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });\n inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });\n inst.strip = () => inst.clone({ ...inst._zod.def, catchall: undefined });\n inst.extend = (incoming) => {\n return util.extend(inst, incoming);\n };\n inst.safeExtend = (incoming) => {\n return util.safeExtend(inst, incoming);\n };\n inst.merge = (other) => util.merge(inst, other);\n inst.pick = (mask) => util.pick(inst, mask);\n inst.omit = (mask) => util.omit(inst, mask);\n inst.partial = (...args) => util.partial(ZodOptional, inst, args[0]);\n inst.required = (...args) => util.required(ZodNonOptional, inst, args[0]);\n});\nexport function object(shape, params) {\n const def = {\n type: \"object\",\n shape: shape ?? {},\n ...util.normalizeParams(params),\n };\n return new ZodObject(def);\n}\n// strictObject\nexport function strictObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n shape,\n catchall: never(),\n ...util.normalizeParams(params),\n });\n}\n// looseObject\nexport function looseObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n shape,\n catchall: unknown(),\n ...util.normalizeParams(params),\n });\n}\nexport const ZodUnion = /*@__PURE__*/ core.$constructor(\"ZodUnion\", (inst, def) => {\n core.$ZodUnion.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);\n inst.options = def.options;\n});\nexport function union(options, params) {\n return new ZodUnion({\n type: \"union\",\n options: options,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodXor = /*@__PURE__*/ core.$constructor(\"ZodXor\", (inst, def) => {\n ZodUnion.init(inst, def);\n core.$ZodXor.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);\n inst.options = def.options;\n});\n/** Creates an exclusive union (XOR) where exactly one option must match.\n * Unlike regular unions that succeed when any option matches, xor fails if\n * zero or more than one option matches the input. */\nexport function xor(options, params) {\n return new ZodXor({\n type: \"union\",\n options: options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodDiscriminatedUnion = /*@__PURE__*/ core.$constructor(\"ZodDiscriminatedUnion\", (inst, def) => {\n ZodUnion.init(inst, def);\n core.$ZodDiscriminatedUnion.init(inst, def);\n});\nexport function discriminatedUnion(discriminator, options, params) {\n // const [options, params] = args;\n return new ZodDiscriminatedUnion({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodIntersection = /*@__PURE__*/ core.$constructor(\"ZodIntersection\", (inst, def) => {\n core.$ZodIntersection.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.intersectionProcessor(inst, ctx, json, params);\n});\nexport function intersection(left, right) {\n return new ZodIntersection({\n type: \"intersection\",\n left: left,\n right: right,\n });\n}\nexport const ZodTuple = /*@__PURE__*/ core.$constructor(\"ZodTuple\", (inst, def) => {\n core.$ZodTuple.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.tupleProcessor(inst, ctx, json, params);\n inst.rest = (rest) => inst.clone({\n ...inst._zod.def,\n rest: rest,\n });\n});\nexport function tuple(items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof core.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new ZodTuple({\n type: \"tuple\",\n items: items,\n rest,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodRecord = /*@__PURE__*/ core.$constructor(\"ZodRecord\", (inst, def) => {\n core.$ZodRecord.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.recordProcessor(inst, ctx, json, params);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n});\nexport function record(keyType, valueType, params) {\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\n// type alksjf = core.output<core.$ZodRecordKey>;\nexport function partialRecord(keyType, valueType, params) {\n const k = core.clone(keyType);\n k._zod.values = undefined;\n return new ZodRecord({\n type: \"record\",\n keyType: k,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function looseRecord(keyType, valueType, params) {\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n mode: \"loose\",\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMap = /*@__PURE__*/ core.$constructor(\"ZodMap\", (inst, def) => {\n core.$ZodMap.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.mapProcessor(inst, ctx, json, params);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n inst.min = (...args) => inst.check(core._minSize(...args));\n inst.nonempty = (params) => inst.check(core._minSize(1, params));\n inst.max = (...args) => inst.check(core._maxSize(...args));\n inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function map(keyType, valueType, params) {\n return new ZodMap({\n type: \"map\",\n keyType: keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSet = /*@__PURE__*/ core.$constructor(\"ZodSet\", (inst, def) => {\n core.$ZodSet.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.setProcessor(inst, ctx, json, params);\n inst.min = (...args) => inst.check(core._minSize(...args));\n inst.nonempty = (params) => inst.check(core._minSize(1, params));\n inst.max = (...args) => inst.check(core._maxSize(...args));\n inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function set(valueType, params) {\n return new ZodSet({\n type: \"set\",\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodEnum = /*@__PURE__*/ core.$constructor(\"ZodEnum\", (inst, def) => {\n core.$ZodEnum.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.enumProcessor(inst, ctx, json, params);\n inst.enum = def.entries;\n inst.options = Object.values(def.entries);\n const keys = new Set(Object.keys(def.entries));\n inst.extract = (values, params) => {\n const newEntries = {};\n for (const value of values) {\n if (keys.has(value)) {\n newEntries[value] = def.entries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n inst.exclude = (values, params) => {\n const newEntries = { ...def.entries };\n for (const value of values) {\n if (keys.has(value)) {\n delete newEntries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n});\nfunction _enum(values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n return new ZodEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport { _enum as enum };\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function nativeEnum(entries, params) {\n return new ZodEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLiteral = /*@__PURE__*/ core.$constructor(\"ZodLiteral\", (inst, def) => {\n core.$ZodLiteral.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.literalProcessor(inst, ctx, json, params);\n inst.values = new Set(def.values);\n Object.defineProperty(inst, \"value\", {\n get() {\n if (def.values.length > 1) {\n throw new Error(\"This schema contains multiple valid literal values. Use `.values` instead.\");\n }\n return def.values[0];\n },\n });\n});\nexport function literal(value, params) {\n return new ZodLiteral({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\nexport const ZodFile = /*@__PURE__*/ core.$constructor(\"ZodFile\", (inst, def) => {\n core.$ZodFile.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.fileProcessor(inst, ctx, json, params);\n inst.min = (size, params) => inst.check(core._minSize(size, params));\n inst.max = (size, params) => inst.check(core._maxSize(size, params));\n inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));\n});\nexport function file(params) {\n return core._file(ZodFile, params);\n}\nexport const ZodTransform = /*@__PURE__*/ core.$constructor(\"ZodTransform\", (inst, def) => {\n core.$ZodTransform.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.transformProcessor(inst, ctx, json, params);\n inst._zod.parse = (payload, _ctx) => {\n if (_ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(inst.constructor.name);\n }\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = inst);\n // _issue.continue ??= true;\n payload.issues.push(util.issue(_issue));\n }\n };\n const output = def.transform(payload.value, payload);\n if (output instanceof Promise) {\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n payload.value = output;\n return payload;\n };\n});\nexport function transform(fn) {\n return new ZodTransform({\n type: \"transform\",\n transform: fn,\n });\n}\nexport const ZodOptional = /*@__PURE__*/ core.$constructor(\"ZodOptional\", (inst, def) => {\n core.$ZodOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function optional(innerType) {\n return new ZodOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodExactOptional = /*@__PURE__*/ core.$constructor(\"ZodExactOptional\", (inst, def) => {\n core.$ZodExactOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function exactOptional(innerType) {\n return new ZodExactOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodNullable = /*@__PURE__*/ core.$constructor(\"ZodNullable\", (inst, def) => {\n core.$ZodNullable.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nullableProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nullable(innerType) {\n return new ZodNullable({\n type: \"nullable\",\n innerType: innerType,\n });\n}\n// nullish\nexport function nullish(innerType) {\n return optional(nullable(innerType));\n}\nexport const ZodDefault = /*@__PURE__*/ core.$constructor(\"ZodDefault\", (inst, def) => {\n core.$ZodDefault.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.defaultProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeDefault = inst.unwrap;\n});\nexport function _default(innerType, defaultValue) {\n return new ZodDefault({\n type: \"default\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodPrefault = /*@__PURE__*/ core.$constructor(\"ZodPrefault\", (inst, def) => {\n core.$ZodPrefault.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.prefaultProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function prefault(innerType, defaultValue) {\n return new ZodPrefault({\n type: \"prefault\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodNonOptional = /*@__PURE__*/ core.$constructor(\"ZodNonOptional\", (inst, def) => {\n core.$ZodNonOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nonoptionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nonoptional(innerType, params) {\n return new ZodNonOptional({\n type: \"nonoptional\",\n innerType: innerType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSuccess = /*@__PURE__*/ core.$constructor(\"ZodSuccess\", (inst, def) => {\n core.$ZodSuccess.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.successProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function success(innerType) {\n return new ZodSuccess({\n type: \"success\",\n innerType: innerType,\n });\n}\nexport const ZodCatch = /*@__PURE__*/ core.$constructor(\"ZodCatch\", (inst, def) => {\n core.$ZodCatch.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.catchProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeCatch = inst.unwrap;\n});\nfunction _catch(innerType, catchValue) {\n return new ZodCatch({\n type: \"catch\",\n innerType: innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\nexport { _catch as catch };\nexport const ZodNaN = /*@__PURE__*/ core.$constructor(\"ZodNaN\", (inst, def) => {\n core.$ZodNaN.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nanProcessor(inst, ctx, json, params);\n});\nexport function nan(params) {\n return core._nan(ZodNaN, params);\n}\nexport const ZodPipe = /*@__PURE__*/ core.$constructor(\"ZodPipe\", (inst, def) => {\n core.$ZodPipe.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.pipeProcessor(inst, ctx, json, params);\n inst.in = def.in;\n inst.out = def.out;\n});\nexport function pipe(in_, out) {\n return new ZodPipe({\n type: \"pipe\",\n in: in_,\n out: out,\n // ...util.normalizeParams(params),\n });\n}\nexport const ZodCodec = /*@__PURE__*/ core.$constructor(\"ZodCodec\", (inst, def) => {\n ZodPipe.init(inst, def);\n core.$ZodCodec.init(inst, def);\n});\nexport function codec(in_, out, params) {\n return new ZodCodec({\n type: \"pipe\",\n in: in_,\n out: out,\n transform: params.decode,\n reverseTransform: params.encode,\n });\n}\nexport const ZodReadonly = /*@__PURE__*/ core.$constructor(\"ZodReadonly\", (inst, def) => {\n core.$ZodReadonly.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.readonlyProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function readonly(innerType) {\n return new ZodReadonly({\n type: \"readonly\",\n innerType: innerType,\n });\n}\nexport const ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"ZodTemplateLiteral\", (inst, def) => {\n core.$ZodTemplateLiteral.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.templateLiteralProcessor(inst, ctx, json, params);\n});\nexport function templateLiteral(parts, params) {\n return new ZodTemplateLiteral({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLazy = /*@__PURE__*/ core.$constructor(\"ZodLazy\", (inst, def) => {\n core.$ZodLazy.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.lazyProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.getter();\n});\nexport function lazy(getter) {\n return new ZodLazy({\n type: \"lazy\",\n getter: getter,\n });\n}\nexport const ZodPromise = /*@__PURE__*/ core.$constructor(\"ZodPromise\", (inst, def) => {\n core.$ZodPromise.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.promiseProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function promise(innerType) {\n return new ZodPromise({\n type: \"promise\",\n innerType: innerType,\n });\n}\nexport const ZodFunction = /*@__PURE__*/ core.$constructor(\"ZodFunction\", (inst, def) => {\n core.$ZodFunction.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.functionProcessor(inst, ctx, json, params);\n});\nexport function _function(params) {\n return new ZodFunction({\n type: \"function\",\n input: Array.isArray(params?.input) ? tuple(params?.input) : (params?.input ?? array(unknown())),\n output: params?.output ?? unknown(),\n });\n}\nexport { _function as function };\nexport const ZodCustom = /*@__PURE__*/ core.$constructor(\"ZodCustom\", (inst, def) => {\n core.$ZodCustom.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.customProcessor(inst, ctx, json, params);\n});\n// custom checks\nexport function check(fn) {\n const ch = new core.$ZodCheck({\n check: \"custom\",\n // ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\nexport function custom(fn, _params) {\n return core._custom(ZodCustom, fn ?? (() => true), _params);\n}\nexport function refine(fn, _params = {}) {\n return core._refine(ZodCustom, fn, _params);\n}\n// superRefine\nexport function superRefine(fn) {\n return core._superRefine(fn);\n}\n// Re-export describe and meta from core\nexport const describe = core.describe;\nexport const meta = core.meta;\nfunction _instanceof(cls, params = {}) {\n const inst = new ZodCustom({\n type: \"custom\",\n check: \"custom\",\n fn: (data) => data instanceof cls,\n abort: true,\n ...util.normalizeParams(params),\n });\n inst._zod.bag.Class = cls;\n // Override check to emit invalid_type instead of custom\n inst._zod.check = (payload) => {\n if (!(payload.value instanceof cls)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: cls.name,\n input: payload.value,\n inst,\n path: [...(inst._zod.def.path ?? [])],\n });\n }\n };\n return inst;\n}\nexport { _instanceof as instanceof };\n// stringbool\nexport const stringbool = (...args) => core._stringbool({\n Codec: ZodCodec,\n Boolean: ZodBoolean,\n String: ZodString,\n}, ...args);\nexport function json(params) {\n const jsonSchema = lazy(() => {\n return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);\n });\n return jsonSchema;\n}\n// preprocess\n// /** @deprecated Use `z.pipe()` and `z.transform()` instead. */\nexport function preprocess(fn, schema) {\n return pipe(transform(fn), schema);\n}\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new i32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return { b: b, r: r };\n};\nvar _a = freb(fleb, 2), fl = _a.b, revfl = _a.r;\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b.b, revfd = _b.r;\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8)) >> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i) {\n if (cd[i])\n ++l[cd[i] - 1];\n }\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 1; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n return new u8(v.subarray(s, e));\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n , // determined by compression function\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, st, buf, dict) {\n // source length dict length\n var sl = dat.length, dl = dict ? dict.length : 0;\n if (!sl || st.f && !st.l)\n return buf || new u8(0);\n var noBuf = !buf;\n // have to estimate size\n var resize = noBuf || st.i != 2;\n // no state\n var noSt = st.i;\n // Assumes roughly 33% compression ratio average\n if (noBuf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (resize)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17\n if (resize)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & (1 << b) - 1, pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (resize)\n cbuf(bt + 131072);\n var end = bt + add;\n if (bt < dt) {\n var shift = dl - dt, dend = Math.min(dt, end);\n if (shift + bt < 0)\n err(3);\n for (; bt < dend; ++bt)\n buf[bt] = dict[shift + bt];\n }\n for (; bt < end; ++bt)\n buf[bt] = buf[bt - dt];\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n // don't reallocate for streams or user buffers\n return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n d[o + 2] |= v >> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return { t: et, l: 0 };\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return { t: v, l: 1 };\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return { t: new u8(tr), l: mbt };\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return { c: cl.subarray(0, cli), n: s };\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a.t, mlb = _a.l;\n var _b = hTree(df, 15), ddt = _b.t, mdb = _b.l;\n var _c = lc(dlt), lclt = _c.c, nlc = _c.n;\n var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n ++lcfreq[lclt[i] & 31];\n for (var i = 0; i < lcdt.length; ++i)\n ++lcfreq[lcdt[i] & 31];\n var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];\n if (bs >= 0 && flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >> 5) & 127), p += clct[i] >> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n var sym = syms[i];\n if (sym > 255) {\n var len = (sym >> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (sym >> 23) & 31), p += fleb[len];\n var dst = sym & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (sym >> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[sym]), p += ll[sym];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, st) {\n var s = st.z || dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var lst = st.l;\n var pos = (st.r || 0) & 7;\n if (lvl) {\n if (pos)\n w[0] = st.r >> 3;\n var opt = deo[lvl - 1];\n var n = opt >> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new i32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx blkpos\n var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0;\n for (; i + 2 < s; ++i) {\n // hash value\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = i - dif + j & 32767;\n var pti = prev[ti];\n var cd = ti - pti & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += imod - pimod & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one int32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n for (i = Math.max(i, wi); i < s; ++i) {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n if (!lst) {\n st.r = (pos & 7) | w[(pos / 8) | 0] << 3;\n // shft(pos) now 1 less if pos & 7 != 0\n pos -= 7;\n st.h = head, st.p = prev, st.i = i, st.w = wi;\n }\n }\n else {\n for (var i = st.w || 0; i < s + lst; i += 65535) {\n // end\n var e = i + 65535;\n if (e >= s) {\n // write final block\n w[(pos / 8) | 0] = lst;\n e = s;\n }\n pos = wfblk(w, pos + 1, dat.subarray(i, e));\n }\n st.i = s;\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Adler32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a & 0xFF00) << 8 | (b & 255) << 8 | (b >> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n if (!st) {\n st = { l: 1 };\n if (opt.dictionary) {\n var dict = opt.dictionary.subarray(-32768);\n var newDat = new u8(dict.length + dat.length);\n newDat.set(dict);\n newDat.set(dat, dict.length);\n dat = newDat;\n st.w = dict.length;\n }\n }\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? (st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20) : (12 + opt.mem), pre, post, st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\\s+/g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return fnStr;\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k].buffer) {\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n fnStr = wcln(fns[i], fnStr, td_1);\n ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 };\n }\n var td = mrg({}, ch[id].e);\n return wk(ch[id].c + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt]; };\nvar bDflt = function () { return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zls]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get opts\nvar gopt = function (o) { return o && {\n out: o.size && new u8(o.size),\n dictionary: o.dictionary\n}; };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) {\n if (ev.data[0]) {\n strm.push(ev.data[0], ev.data[1]);\n postMessage([ev.data[0].length]);\n }\n else\n strm.flush(ev.data[1]);\n };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id, flush, ext) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else if (!Array.isArray(dat))\n ext(dat);\n else if (dat.length == 1) {\n strm.queuedSize -= dat[0];\n if (strm.ondrain)\n strm.ondrain(dat[0]);\n }\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.queuedSize = 0;\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n strm.queuedSize += d.length;\n // can fail for cross-realm Uint8Array, but ok - only a small performance penalty\n w.postMessage([d, t = f], d.buffer instanceof ArrayBuffer ? [d.buffer] : []);\n };\n strm.terminate = function () { w.terminate(); };\n if (flush) {\n strm.flush = function (sync) { w.postMessage([0, sync]); };\n }\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\n// read 8 bytes\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += (d[10] | d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + (o.filename ? o.filename.length + 1 : 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (o.dictionary && 32);\n c[1] |= 31 - ((c[0] << 8) | c[1]) % 31;\n if (o.dictionary) {\n var h = adler();\n h.p(o.dictionary);\n wbytes(c, 2, h.d());\n }\n};\n// zlib start\nvar zls = function (d, dict) {\n if ((d[0] & 15) != 8 || (d[0] >> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if ((d[1] >> 5 & 1) == +!dict)\n err(6, 'invalid zlib data: ' + (d[1] & 32 ? 'need' : 'unexpected') + ' dictionary');\n return (d[1] >> 3 & 4) + 2;\n};\nfunction StrmOpt(opts, cb) {\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n this.s = { l: 0, i: 32768, w: 32768, z: 32768 };\n // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev\n // 98304 = 32768 (lookback) + 65536 (common chunk size)\n this.b = new u8(98304);\n if (this.o.dictionary) {\n var dict = this.o.dictionary.subarray(-32768);\n this.b.set(dict, 32768 - dict.length);\n this.s.i = 32768 - dict.length;\n }\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, this.s), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.s.l)\n err(4);\n var endLen = chunk.length + this.s.z;\n if (endLen > this.b.length) {\n if (endLen > 2 * this.b.length - 32768) {\n var newBuf = new u8(endLen & -32768);\n newBuf.set(this.b.subarray(0, this.s.z));\n this.b = newBuf;\n }\n var split = this.b.length - this.s.z;\n this.b.set(chunk.subarray(0, split), this.s.z);\n this.s.z = this.b.length;\n this.p(this.b, false);\n this.b.set(this.b.subarray(-32768));\n this.b.set(chunk.subarray(split), 32768);\n this.s.z = chunk.length - split + 32768;\n this.s.i = 32766, this.s.w = 32768;\n }\n else {\n this.b.set(chunk, this.s.z);\n this.s.z += chunk.length;\n }\n this.s.l = final & 1;\n if (this.s.z > this.s.w + 8191 || final) {\n this.p(this.b, final || false);\n this.s.w = this.s.i, this.s.i -= 2;\n }\n if (final) {\n // cleanup unneeded buffers/state to reduce memory usage\n this.s = this.o = {};\n this.b = et;\n }\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * deflated output for small inputs.\n * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5\n * extra bytes, but guarantees all pushed data is immediately\n * decompressible. A separate DEFLATE stream may be concatenated\n * with the current output after a sync flush.\n */\n Deflate.prototype.flush = function (sync) {\n if (!this.ondata)\n err(5);\n if (this.s.l)\n err(4);\n this.p(this.b, false);\n this.s.w = this.s.i, this.s.i -= 2;\n // could technically skip writing the type-0 block for (this.s.r & 7) == 0,\n // but the deterministic trailer (00 00 FF FF) is useful in some situations\n if (sync) {\n var c = new u8(6);\n c[0] = this.s.r >> 3;\n // write empty, non-final type-0 block\n var ep = wfblk(c, this.s.r, et);\n this.s.r = 0;\n this.ondata(c.subarray(0, ep >> 3), false);\n }\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6, 1);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n function Inflate(opts, cb) {\n // no StrmOpt here to avoid adding to workerizer\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768);\n this.s = { i: 0, b: dict ? dict.length : 0 };\n this.o = new u8(32768);\n this.p = new u8(0);\n if (dict)\n this.o.set(dict);\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n if (!this.p.length)\n this.p = c;\n else if (c.length) {\n var n = new u8(this.p.length + c.length);\n n.set(this.p), n.set(c, this.p.length), this.p = n;\n }\n };\n Inflate.prototype.c = function (final) {\n this.s.i = +(this.d = final || false);\n var bts = this.s.b;\n var dt = inflt(this.p, this.s, this.o);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n function AsyncInflate(opts, cb) {\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Inflate(ev.data);\n onmessage = astrm(strm);\n }, 7, 0);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); }, 1, cb);\n}\nexport function inflateSync(data, opts) {\n return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n this.l += chunk.length;\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * GZIPped output for small inputs.\n * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5\n * extra bytes, but guarantees all pushed data is immediately\n * decompressible.\n */\n Gzip.prototype.flush = function (sync) {\n Deflate.prototype.flush.call(this, sync);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8, 1);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming single or multi-member GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n function Gunzip(opts, cb) {\n this.v = 1;\n this.r = 0;\n Inflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n this.r += chunk.length;\n if (this.v) {\n var p = this.p.subarray(this.v - 1);\n var s = p.length > 3 ? gzs(p) : 4;\n if (s > p.length) {\n if (!final)\n return;\n }\n else if (this.v > 1 && this.onmember) {\n this.onmember(this.r - p.length);\n }\n this.p = p.subarray(s), this.v = 0;\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, 0);\n // process concatenated GZIP\n if (this.s.f && !this.s.l) {\n this.v = shft(this.s.p) + 9;\n this.s = { i: 0 };\n this.o = new u8(0);\n this.push(new u8(0), final);\n }\n else if (final) {\n Inflate.prototype.c.call(this, final);\n }\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming single or multi-member GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n function AsyncGunzip(opts, cb) {\n var _this = this;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gunzip(ev.data);\n strm.onmember = function (offset) { return postMessage(offset); };\n onmessage = astrm(strm);\n }, 9, 0, function (offset) { return _this.onmember && _this.onmember(offset); });\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0], ev.data[1])); }, 3, cb);\n}\nexport function gunzipSync(data, opts) {\n var st = gzs(data);\n if (st + 8 > data.length)\n err(6, 'invalid gzip data');\n return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary);\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * zlibbed output for small inputs.\n * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5\n * extra bytes, but guarantees all pushed data is immediately\n * decompressible.\n */\n Zlib.prototype.flush = function (sync) {\n Deflate.prototype.flush.call(this, sync);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10, 1);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n function Unzlib(opts, cb) {\n Inflate.call(this, opts, cb);\n this.v = opts && opts.dictionary ? 2 : 1;\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 6 && !final)\n return;\n this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n function AsyncUnzlib(opts, cb) {\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Unzlib(ev.data);\n onmessage = astrm(strm);\n }, 11, 0);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); }, 5, cb);\n}\nexport function unzlibSync(data, opts) {\n return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n function Decompress(opts, cb) {\n this.o = StrmOpt.call(this, opts, cb) || {};\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n }\n // init substream\n // overriden by AsyncDecompress\n Decompress.prototype.i = function () {\n var _this = this;\n this.s.ondata = function (dat, final) {\n _this.ondata(dat, final);\n };\n };\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(this.o)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(this.o)\n : new this.Z(this.o);\n this.i();\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n function AsyncDecompress(opts, cb) {\n Decompress.call(this, opts, cb);\n this.queuedSize = 0;\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n }\n AsyncDecompress.prototype.i = function () {\n var _this = this;\n this.s.ondata = function (err, dat, final) {\n _this.ondata(err, dat, final);\n };\n this.s.ondrain = function (size) {\n _this.queuedSize -= size;\n if (_this.ondrain)\n _this.ondrain(size);\n };\n };\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n this.queuedSize += chunk.length;\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, opts) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, opts)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, opts)\n : unzlibSync(data, opts);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k, op = o;\n if (Array.isArray(val))\n op = mrg(o, val[1]), val = val[0];\n if (ArrayBuffer.isView(val))\n t[n] = [val, op];\n else {\n t[n += '/'] = [new u8(0), op];\n fltn(val, n, t, o);\n }\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return { s: r, r: slc(d, i - 1) };\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), s = _a.s, r = _a.r;\n if (final) {\n if (r.length)\n err(8);\n this.p = null;\n }\n else\n this.p = r;\n this.ondata(s, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td) {\n return td.decode(dat);\n }\n else {\n var _a = dutf8(dat), s = _a.s, r = _a.r;\n if (r.length)\n err(8);\n return s;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), efl = b2(d, b + 30), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl;\n var _a = z64hs(d, es, efl, z, b4(d, b + 20), b4(d, b + 24), b4(d, b + 42)), sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + efl + b2(d, b + 32), off];\n};\n// read zip64 header sizes\nvar z64hs = function (d, b, l, z, sc, su, off) {\n var nsc = sc == 4294967295, nsu = su == 4294967295, noff = off == 4294967295, e = b + l;\n var nf = nsc + nsu + noff;\n if (z && nf) {\n for (; b + 4 < e; b += 4 + b2(d, b + 2)) {\n if (b2(d, b) == 1) {\n return [\n nsc ? b8(d, b + 4 + 8 * nsu) : sc,\n nsu ? b8(d, b + 4) : su,\n noff ? b8(d, b + 4 + 8 * (nsu + nsc)) : off,\n 1\n ];\n }\n }\n // z == 2 for unknown whether or not zip64\n if (z < 2)\n err(13);\n }\n return [sc, su, off, 0];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >> 1)), b += 4;\n if (c != -1) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c < 0 ? -c - 2 : c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n // we shouldn't really do this cast, but properly handling ArrayBufferLike\n // makes the API unergonomic with Buffer\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u, -1);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this.ondata(err, dat, final);\n _this.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this.d & 1))\n return;\n _this.u.splice(-1, 1);\n _this.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (chunk, final) {\n // same as ZipPassThrough: cast to retain Buffer ergonomics\n this.ondata(null, chunk, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this = this;\n this.i = new Inflate(function (dat, final) {\n _this.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (chunk, final) {\n try {\n this.i.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (chunk, final) {\n if (this.i.terminate)\n chunk = slc(chunk, 0);\n this.i.push(chunk, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var lsc = b4(buf, i + 18), lsu = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n var _a = z64hs(buf, i, es, 2, lsc, lsu, 0), sc_1 = _a[0], su_1 = _a[1], z64 = _a[3];\n if (dd)\n sc_1 = -1 - z64;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this.k[0] == chks_3 && _this.c)\n _this.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = b4(data, e - 20) == 0x7064B50;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = lft = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n // Synchronously decompress under 512KB, or barely-compressed data\n if (su < 524288 || sc > 0.8 * su) {\n try {\n cbl(null, inflateSync(infl, { out: new u8(su) }));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = b4(data, e - 20) == 0x7064B50;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) });\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","const Operation = {\n Remove: 'remove',\n Replace: 'replace',\n Add: 'add',\n};\n\n// Don't use `Symbol()` just for 3rd party access the draft\nconst PROXY_DRAFT = Symbol.for('__MUTATIVE_PROXY_DRAFT__');\nconst RAW_RETURN_SYMBOL = Symbol('__MUTATIVE_RAW_RETURN_SYMBOL__');\nconst iteratorSymbol = Symbol.iterator;\nconst dataTypes = {\n mutable: 'mutable',\n immutable: 'immutable',\n};\n\nconst internal = {};\n\nfunction has(target, key) {\n return target instanceof Map\n ? target.has(key)\n : Object.prototype.hasOwnProperty.call(target, key);\n}\nfunction getDescriptor(target, key) {\n if (key in target) {\n let prototype = Reflect.getPrototypeOf(target);\n while (prototype) {\n const descriptor = Reflect.getOwnPropertyDescriptor(prototype, key);\n if (descriptor)\n return descriptor;\n prototype = Reflect.getPrototypeOf(prototype);\n }\n }\n return;\n}\nfunction isBaseSetInstance(obj) {\n return Object.getPrototypeOf(obj) === Set.prototype;\n}\nfunction isBaseMapInstance(obj) {\n return Object.getPrototypeOf(obj) === Map.prototype;\n}\n\nfunction latest(proxyDraft) {\n var _a;\n return (_a = proxyDraft.copy) !== null && _a !== void 0 ? _a : proxyDraft.original;\n}\n/**\n * Check if the value is a draft\n */\nfunction isDraft(target) {\n return !!getProxyDraft(target);\n}\nfunction getProxyDraft(value) {\n if (typeof value !== 'object')\n return null;\n return value === null || value === void 0 ? void 0 : value[PROXY_DRAFT];\n}\nfunction getValue(value) {\n var _a;\n const proxyDraft = getProxyDraft(value);\n return proxyDraft ? ((_a = proxyDraft.copy) !== null && _a !== void 0 ? _a : proxyDraft.original) : value;\n}\n/**\n * Check if a value is draftable\n */\nfunction isDraftable(value, options) {\n if (!value || typeof value !== 'object')\n return false;\n let markResult;\n return (Object.getPrototypeOf(value) === Object.prototype ||\n Array.isArray(value) ||\n value instanceof Map ||\n value instanceof Set ||\n (!!(options === null || options === void 0 ? void 0 : options.mark) &&\n ((markResult = options.mark(value, dataTypes)) === dataTypes.immutable ||\n typeof markResult === 'function')));\n}\nfunction getPath(target, path = []) {\n if (Object.hasOwnProperty.call(target, 'key')) {\n // check if the parent is a draft and the original value is not equal to the current value\n const parentCopy = target.parent.copy;\n const proxyDraft = getProxyDraft(get(parentCopy, target.key));\n if (proxyDraft !== null && (proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.original) !== target.original) {\n return null;\n }\n const isSet = target.parent.type === 3 /* DraftType.Set */;\n const key = isSet\n ? Array.from(target.parent.setMap.keys()).indexOf(target.key)\n : target.key;\n // check if the key is still in the next state parent\n if (!((isSet && parentCopy.size > key) || has(parentCopy, key)))\n return null;\n path.push(key);\n }\n if (target.parent) {\n return getPath(target.parent, path);\n }\n // `target` is root draft.\n path.reverse();\n try {\n // check if the path is valid\n resolvePath(target.copy, path);\n }\n catch (e) {\n return null;\n }\n return path;\n}\nfunction getType(target) {\n if (Array.isArray(target))\n return 1 /* DraftType.Array */;\n if (target instanceof Map)\n return 2 /* DraftType.Map */;\n if (target instanceof Set)\n return 3 /* DraftType.Set */;\n return 0 /* DraftType.Object */;\n}\nfunction get(target, key) {\n return getType(target) === 2 /* DraftType.Map */ ? target.get(key) : target[key];\n}\nfunction set(target, key, value) {\n const type = getType(target);\n if (type === 2 /* DraftType.Map */) {\n target.set(key, value);\n }\n else {\n target[key] = value;\n }\n}\nfunction peek(target, key) {\n const state = getProxyDraft(target);\n const source = state ? latest(state) : target;\n return source[key];\n}\nfunction isEqual(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n }\n else {\n return x !== x && y !== y;\n }\n}\nfunction revokeProxy(proxyDraft) {\n if (!proxyDraft)\n return;\n while (proxyDraft.finalities.revoke.length > 0) {\n const revoke = proxyDraft.finalities.revoke.pop();\n revoke();\n }\n}\n// handle JSON Pointer path with spec https://www.rfc-editor.org/rfc/rfc6901\nfunction escapePath(path, pathAsArray) {\n return pathAsArray\n ? path\n : ['']\n .concat(path)\n .map((_item) => {\n const item = `${_item}`;\n if (item.indexOf('/') === -1 && item.indexOf('~') === -1)\n return item;\n return item.replace(/~/g, '~0').replace(/\\//g, '~1');\n })\n .join('/');\n}\nfunction unescapePath(path) {\n if (Array.isArray(path))\n return path;\n return path\n .split('/')\n .map((_item) => _item.replace(/~1/g, '/').replace(/~0/g, '~'))\n .slice(1);\n}\nfunction resolvePath(base, path) {\n for (let index = 0; index < path.length - 1; index += 1) {\n const key = path[index];\n // use `index` in Set draft\n base = get(getType(base) === 3 /* DraftType.Set */ ? Array.from(base) : base, key);\n if (typeof base !== 'object') {\n throw new Error(`Cannot resolve patch at '${path.join('/')}'.`);\n }\n }\n return base;\n}\n\nfunction strictCopy(target) {\n const copy = Object.create(Object.getPrototypeOf(target));\n Reflect.ownKeys(target).forEach((key) => {\n let desc = Reflect.getOwnPropertyDescriptor(target, key);\n if (desc.enumerable && desc.configurable && desc.writable) {\n copy[key] = target[key];\n return;\n }\n // for freeze\n if (!desc.writable) {\n desc.writable = true;\n desc.configurable = true;\n }\n if (desc.get || desc.set)\n desc = {\n configurable: true,\n writable: true,\n enumerable: desc.enumerable,\n value: target[key],\n };\n Reflect.defineProperty(copy, key, desc);\n });\n return copy;\n}\nconst propIsEnum = Object.prototype.propertyIsEnumerable;\nfunction shallowCopy(original, options) {\n let markResult;\n if (Array.isArray(original)) {\n return Array.prototype.concat.call(original);\n }\n else if (original instanceof Set) {\n if (!isBaseSetInstance(original)) {\n const SubClass = Object.getPrototypeOf(original).constructor;\n return new SubClass(original.values());\n }\n return Set.prototype.difference\n ? Set.prototype.difference.call(original, new Set())\n : new Set(original.values());\n }\n else if (original instanceof Map) {\n if (!isBaseMapInstance(original)) {\n const SubClass = Object.getPrototypeOf(original).constructor;\n return new SubClass(original);\n }\n return new Map(original);\n }\n else if ((options === null || options === void 0 ? void 0 : options.mark) &&\n ((markResult = options.mark(original, dataTypes)),\n markResult !== undefined) &&\n markResult !== dataTypes.mutable) {\n if (markResult === dataTypes.immutable) {\n return strictCopy(original);\n }\n else if (typeof markResult === 'function') {\n if ((options.enablePatches || options.enableAutoFreeze)) {\n throw new Error(`You can't use mark and patches or auto freeze together.`);\n }\n return markResult();\n }\n throw new Error(`Unsupported mark result: ${markResult}`);\n }\n else if (typeof original === 'object' &&\n Object.getPrototypeOf(original) === Object.prototype) {\n // For best performance with shallow copies,\n // don't use `Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));` by default.\n const copy = {};\n Object.keys(original).forEach((key) => {\n copy[key] = original[key];\n });\n Object.getOwnPropertySymbols(original).forEach((key) => {\n if (propIsEnum.call(original, key)) {\n copy[key] = original[key];\n }\n });\n return copy;\n }\n else {\n throw new Error(`Please check mark() to ensure that it is a stable marker draftable function.`);\n }\n}\nfunction ensureShallowCopy(target) {\n if (target.copy)\n return;\n target.copy = shallowCopy(target.original, target.options);\n}\nfunction deepClone(target) {\n if (!isDraftable(target))\n return getValue(target);\n if (Array.isArray(target))\n return target.map(deepClone);\n if (target instanceof Map) {\n const iterable = Array.from(target.entries()).map(([k, v]) => [\n k,\n deepClone(v),\n ]);\n if (!isBaseMapInstance(target)) {\n const SubClass = Object.getPrototypeOf(target).constructor;\n return new SubClass(iterable);\n }\n return new Map(iterable);\n }\n if (target instanceof Set) {\n const iterable = Array.from(target).map(deepClone);\n if (!isBaseSetInstance(target)) {\n const SubClass = Object.getPrototypeOf(target).constructor;\n return new SubClass(iterable);\n }\n return new Set(iterable);\n }\n const copy = Object.create(Object.getPrototypeOf(target));\n for (const key in target)\n copy[key] = deepClone(target[key]);\n return copy;\n}\nfunction cloneIfNeeded(target) {\n return isDraft(target) ? deepClone(target) : target;\n}\n\nfunction markChanged(proxyDraft) {\n var _a;\n proxyDraft.assignedMap = (_a = proxyDraft.assignedMap) !== null && _a !== void 0 ? _a : new Map();\n if (!proxyDraft.operated) {\n proxyDraft.operated = true;\n if (proxyDraft.parent) {\n markChanged(proxyDraft.parent);\n }\n }\n}\n\nfunction throwFrozenError() {\n throw new Error('Cannot modify frozen object');\n}\nfunction deepFreeze(target, subKey, updatedValues, stack, keys) {\n {\n updatedValues = updatedValues !== null && updatedValues !== void 0 ? updatedValues : new WeakMap();\n stack = stack !== null && stack !== void 0 ? stack : [];\n keys = keys !== null && keys !== void 0 ? keys : [];\n const value = updatedValues.has(target)\n ? updatedValues.get(target)\n : target;\n if (stack.length > 0) {\n const index = stack.indexOf(value);\n if (value && typeof value === 'object' && index !== -1) {\n if (stack[0] === value) {\n throw new Error(`Forbids circular reference`);\n }\n throw new Error(`Forbids circular reference: ~/${keys\n .slice(0, index)\n .map((key, index) => {\n if (typeof key === 'symbol')\n return `[${key.toString()}]`;\n const parent = stack[index];\n if (typeof key === 'object' &&\n (parent instanceof Map || parent instanceof Set))\n return Array.from(parent.keys()).indexOf(key);\n return key;\n })\n .join('/')}`);\n }\n stack.push(value);\n keys.push(subKey);\n }\n else {\n stack.push(value);\n }\n }\n if (Object.isFrozen(target) || isDraft(target)) {\n {\n stack.pop();\n keys.pop();\n }\n return;\n }\n const type = getType(target);\n switch (type) {\n case 2 /* DraftType.Map */:\n for (const [key, value] of target) {\n deepFreeze(key, key, updatedValues, stack, keys);\n deepFreeze(value, key, updatedValues, stack, keys);\n }\n target.set = target.clear = target.delete = throwFrozenError;\n break;\n case 3 /* DraftType.Set */:\n for (const value of target) {\n deepFreeze(value, value, updatedValues, stack, keys);\n }\n target.add = target.clear = target.delete = throwFrozenError;\n break;\n case 1 /* DraftType.Array */:\n Object.freeze(target);\n let index = 0;\n for (const value of target) {\n deepFreeze(value, index, updatedValues, stack, keys);\n index += 1;\n }\n break;\n default:\n Object.freeze(target);\n // ignore non-enumerable or symbol properties\n Object.keys(target).forEach((name) => {\n const value = target[name];\n deepFreeze(value, name, updatedValues, stack, keys);\n });\n }\n {\n stack.pop();\n keys.pop();\n }\n}\n\nfunction forEach(target, iter) {\n const type = getType(target);\n if (type === 0 /* DraftType.Object */) {\n Reflect.ownKeys(target).forEach((key) => {\n iter(key, target[key], target);\n });\n }\n else if (type === 1 /* DraftType.Array */) {\n let index = 0;\n for (const entry of target) {\n iter(index, entry, target);\n index += 1;\n }\n }\n else {\n target.forEach((entry, index) => iter(index, entry, target));\n }\n}\n\nfunction handleValue(target, handledSet, options) {\n if (isDraft(target) ||\n !isDraftable(target, options) ||\n handledSet.has(target) ||\n Object.isFrozen(target))\n return;\n const isSet = target instanceof Set;\n const setMap = isSet ? new Map() : undefined;\n handledSet.add(target);\n forEach(target, (key, value) => {\n var _a;\n if (isDraft(value)) {\n const proxyDraft = getProxyDraft(value);\n ensureShallowCopy(proxyDraft);\n // A draft where a child node has been changed, or assigned a value\n const updatedValue = ((_a = proxyDraft.assignedMap) === null || _a === void 0 ? void 0 : _a.size) || proxyDraft.operated\n ? proxyDraft.copy\n : proxyDraft.original;\n // final update value\n set(isSet ? setMap : target, key, updatedValue);\n }\n else {\n handleValue(value, handledSet, options);\n }\n });\n if (setMap) {\n const set = target;\n const values = Array.from(set);\n set.clear();\n values.forEach((value) => {\n set.add(setMap.has(value) ? setMap.get(value) : value);\n });\n }\n}\nfunction finalizeAssigned(proxyDraft, key) {\n // handle the draftable assigned values, and the value is not a draft\n const copy = proxyDraft.type === 3 /* DraftType.Set */ ? proxyDraft.setMap : proxyDraft.copy;\n if (proxyDraft.finalities.revoke.length > 1 &&\n proxyDraft.assignedMap.get(key) &&\n copy) {\n handleValue(get(copy, key), proxyDraft.finalities.handledSet, proxyDraft.options);\n }\n}\nfunction finalizeSetValue(target) {\n if (target.type === 3 /* DraftType.Set */ && target.copy) {\n target.copy.clear();\n target.setMap.forEach((value) => {\n target.copy.add(getValue(value));\n });\n }\n}\nfunction finalizePatches(target, generatePatches, patches, inversePatches) {\n const shouldFinalize = target.operated &&\n target.assignedMap &&\n target.assignedMap.size > 0 &&\n !target.finalized;\n if (shouldFinalize) {\n if (patches && inversePatches) {\n const basePath = getPath(target);\n if (basePath) {\n generatePatches(target, basePath, patches, inversePatches);\n }\n }\n target.finalized = true;\n }\n}\nfunction markFinalization(target, key, value, generatePatches) {\n const proxyDraft = getProxyDraft(value);\n if (proxyDraft) {\n // !case: assign the draft value\n if (!proxyDraft.callbacks) {\n proxyDraft.callbacks = [];\n }\n proxyDraft.callbacks.push((patches, inversePatches) => {\n var _a;\n const copy = target.type === 3 /* DraftType.Set */ ? target.setMap : target.copy;\n if (isEqual(get(copy, key), value)) {\n let updatedValue = proxyDraft.original;\n if (proxyDraft.copy) {\n updatedValue = proxyDraft.copy;\n }\n finalizeSetValue(target);\n finalizePatches(target, generatePatches, patches, inversePatches);\n if (target.options.enableAutoFreeze) {\n target.options.updatedValues =\n (_a = target.options.updatedValues) !== null && _a !== void 0 ? _a : new WeakMap();\n target.options.updatedValues.set(updatedValue, proxyDraft.original);\n }\n // final update value\n set(copy, key, updatedValue);\n }\n });\n if (target.options.enableAutoFreeze) {\n // !case: assign the draft value in cross draft tree\n if (proxyDraft.finalities !== target.finalities) {\n target.options.enableAutoFreeze = false;\n }\n }\n }\n if (isDraftable(value, target.options)) {\n // !case: assign the non-draft value\n target.finalities.draft.push(() => {\n const copy = target.type === 3 /* DraftType.Set */ ? target.setMap : target.copy;\n if (isEqual(get(copy, key), value)) {\n finalizeAssigned(target, key);\n }\n });\n }\n}\n\nfunction generateArrayPatches(proxyState, basePath, patches, inversePatches, pathAsArray) {\n let { original, assignedMap, options } = proxyState;\n let copy = proxyState.copy;\n if (copy.length < original.length) {\n [original, copy] = [copy, original];\n [patches, inversePatches] = [inversePatches, patches];\n }\n for (let index = 0; index < original.length; index += 1) {\n if (assignedMap.get(index.toString()) && copy[index] !== original[index]) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Replace,\n path,\n // If it is a draft, it needs to be deep cloned, and it may also be non-draft.\n value: cloneIfNeeded(copy[index]),\n });\n inversePatches.push({\n op: Operation.Replace,\n path,\n // If it is a draft, it needs to be deep cloned, and it may also be non-draft.\n value: cloneIfNeeded(original[index]),\n });\n }\n }\n for (let index = original.length; index < copy.length; index += 1) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Add,\n path,\n // If it is a draft, it needs to be deep cloned, and it may also be non-draft.\n value: cloneIfNeeded(copy[index]),\n });\n }\n if (original.length < copy.length) {\n // https://www.rfc-editor.org/rfc/rfc6902#appendix-A.4\n // For performance, here we only generate an operation that replaces the length of the array,\n // which is inconsistent with JSON Patch specification\n const { arrayLengthAssignment = true } = options.enablePatches;\n if (arrayLengthAssignment) {\n const _path = basePath.concat(['length']);\n const path = escapePath(_path, pathAsArray);\n inversePatches.push({\n op: Operation.Replace,\n path,\n value: original.length,\n });\n }\n else {\n for (let index = copy.length; original.length < index; index -= 1) {\n const _path = basePath.concat([index - 1]);\n const path = escapePath(_path, pathAsArray);\n inversePatches.push({\n op: Operation.Remove,\n path,\n });\n }\n }\n }\n}\nfunction generatePatchesFromAssigned({ original, copy, assignedMap }, basePath, patches, inversePatches, pathAsArray) {\n assignedMap.forEach((assignedValue, key) => {\n const originalValue = get(original, key);\n const value = cloneIfNeeded(get(copy, key));\n const op = !assignedValue\n ? Operation.Remove\n : has(original, key)\n ? Operation.Replace\n : Operation.Add;\n if (isEqual(originalValue, value) && op === Operation.Replace)\n return;\n const _path = basePath.concat(key);\n const path = escapePath(_path, pathAsArray);\n patches.push(op === Operation.Remove ? { op, path } : { op, path, value });\n inversePatches.push(op === Operation.Add\n ? { op: Operation.Remove, path }\n : op === Operation.Remove\n ? { op: Operation.Add, path, value: originalValue }\n : { op: Operation.Replace, path, value: originalValue });\n });\n}\nfunction generateSetPatches({ original, copy }, basePath, patches, inversePatches, pathAsArray) {\n let index = 0;\n original.forEach((value) => {\n if (!copy.has(value)) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Remove,\n path,\n value,\n });\n inversePatches.unshift({\n op: Operation.Add,\n path,\n value,\n });\n }\n index += 1;\n });\n index = 0;\n copy.forEach((value) => {\n if (!original.has(value)) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Add,\n path,\n value,\n });\n inversePatches.unshift({\n op: Operation.Remove,\n path,\n value,\n });\n }\n index += 1;\n });\n}\nfunction generatePatches(proxyState, basePath, patches, inversePatches) {\n const { pathAsArray = true } = proxyState.options.enablePatches;\n switch (proxyState.type) {\n case 0 /* DraftType.Object */:\n case 2 /* DraftType.Map */:\n return generatePatchesFromAssigned(proxyState, basePath, patches, inversePatches, pathAsArray);\n case 1 /* DraftType.Array */:\n return generateArrayPatches(proxyState, basePath, patches, inversePatches, pathAsArray);\n case 3 /* DraftType.Set */:\n return generateSetPatches(proxyState, basePath, patches, inversePatches, pathAsArray);\n }\n}\n\nlet readable = false;\nconst checkReadable = (value, options, ignoreCheckDraftable = false) => {\n if (typeof value === 'object' &&\n value !== null &&\n (!isDraftable(value, options) || ignoreCheckDraftable) &&\n !readable) {\n throw new Error(`Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.`);\n }\n};\n/**\n * `unsafe(callback)` to access mutable data directly in strict mode.\n *\n * ## Example\n *\n * ```ts\n * import { create, unsafe } from '../index';\n *\n * class Foobar {\n * bar = 1;\n * }\n *\n * const baseState = { foobar: new Foobar() };\n * const state = create(\n * baseState,\n * (draft) => {\n * unsafe(() => {\n * draft.foobar.bar = 2;\n * });\n * },\n * {\n * strict: true,\n * }\n * );\n *\n * expect(state).toBe(baseState);\n * expect(state.foobar).toBe(baseState.foobar);\n * expect(state.foobar.bar).toBe(2);\n * ```\n */\nfunction unsafe(callback) {\n readable = true;\n let result;\n try {\n result = callback();\n }\n finally {\n readable = false;\n }\n return result;\n}\n\nconst mapHandler = {\n get size() {\n const current = latest(getProxyDraft(this));\n return current.size;\n },\n has(key) {\n return latest(getProxyDraft(this)).has(key);\n },\n set(key, value) {\n const target = getProxyDraft(this);\n const source = latest(target);\n if (!source.has(key) || !isEqual(source.get(key), value)) {\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap.set(key, true);\n target.copy.set(key, value);\n markFinalization(target, key, value, generatePatches);\n }\n return this;\n },\n delete(key) {\n if (!this.has(key)) {\n return false;\n }\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n markChanged(target);\n if (target.original.has(key)) {\n target.assignedMap.set(key, false);\n }\n else {\n target.assignedMap.delete(key);\n }\n target.copy.delete(key);\n return true;\n },\n clear() {\n const target = getProxyDraft(this);\n if (!this.size)\n return;\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap = new Map();\n for (const [key] of target.original) {\n target.assignedMap.set(key, false);\n }\n target.copy.clear();\n },\n forEach(callback, thisArg) {\n const target = getProxyDraft(this);\n latest(target).forEach((_value, _key) => {\n callback.call(thisArg, this.get(_key), _key, this);\n });\n },\n get(key) {\n var _a, _b;\n const target = getProxyDraft(this);\n const value = latest(target).get(key);\n const mutable = ((_b = (_a = target.options).mark) === null || _b === void 0 ? void 0 : _b.call(_a, value, dataTypes)) === dataTypes.mutable;\n if (target.options.strict) {\n checkReadable(value, target.options, mutable);\n }\n if (mutable) {\n return value;\n }\n if (target.finalized || !isDraftable(value, target.options)) {\n return value;\n }\n // drafted or reassigned\n if (value !== target.original.get(key)) {\n return value;\n }\n const draft = internal.createDraft({\n original: value,\n parentDraft: target,\n key,\n finalities: target.finalities,\n options: target.options,\n });\n ensureShallowCopy(target);\n target.copy.set(key, draft);\n return draft;\n },\n keys() {\n return latest(getProxyDraft(this)).keys();\n },\n values() {\n const iterator = this.keys();\n return {\n [iteratorSymbol]: () => this.values(),\n next: () => {\n const result = iterator.next();\n if (result.done)\n return result;\n const value = this.get(result.value);\n return {\n done: false,\n value,\n };\n },\n };\n },\n entries() {\n const iterator = this.keys();\n return {\n [iteratorSymbol]: () => this.entries(),\n next: () => {\n const result = iterator.next();\n if (result.done)\n return result;\n const value = this.get(result.value);\n return {\n done: false,\n value: [result.value, value],\n };\n },\n };\n },\n [iteratorSymbol]() {\n return this.entries();\n },\n};\nconst mapHandlerKeys = Reflect.ownKeys(mapHandler);\n\nconst getNextIterator = (target, iterator, { isValuesIterator }) => () => {\n var _a, _b;\n const result = iterator.next();\n if (result.done)\n return result;\n const key = result.value;\n let value = target.setMap.get(key);\n const currentDraft = getProxyDraft(value);\n const mutable = ((_b = (_a = target.options).mark) === null || _b === void 0 ? void 0 : _b.call(_a, value, dataTypes)) === dataTypes.mutable;\n if (target.options.strict) {\n checkReadable(key, target.options, mutable);\n }\n if (!mutable &&\n !currentDraft &&\n isDraftable(key, target.options) &&\n !target.finalized &&\n target.original.has(key)) {\n // draft a draftable original set item\n const proxy = internal.createDraft({\n original: key,\n parentDraft: target,\n key,\n finalities: target.finalities,\n options: target.options,\n });\n target.setMap.set(key, proxy);\n value = proxy;\n }\n else if (currentDraft) {\n // drafted\n value = currentDraft.proxy;\n }\n return {\n done: false,\n value: isValuesIterator ? value : [value, value],\n };\n};\nconst setHandler = {\n get size() {\n const target = getProxyDraft(this);\n return target.setMap.size;\n },\n has(value) {\n const target = getProxyDraft(this);\n // reassigned or non-draftable values\n if (target.setMap.has(value))\n return true;\n ensureShallowCopy(target);\n const valueProxyDraft = getProxyDraft(value);\n // drafted\n if (valueProxyDraft && target.setMap.has(valueProxyDraft.original))\n return true;\n return false;\n },\n add(value) {\n const target = getProxyDraft(this);\n if (!this.has(value)) {\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap.set(value, true);\n target.setMap.set(value, value);\n markFinalization(target, value, value, generatePatches);\n }\n return this;\n },\n delete(value) {\n if (!this.has(value)) {\n return false;\n }\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n markChanged(target);\n const valueProxyDraft = getProxyDraft(value);\n if (valueProxyDraft && target.setMap.has(valueProxyDraft.original)) {\n // delete drafted\n target.assignedMap.set(valueProxyDraft.original, false);\n return target.setMap.delete(valueProxyDraft.original);\n }\n if (!valueProxyDraft && target.setMap.has(value)) {\n // non-draftable values\n target.assignedMap.set(value, false);\n }\n else {\n // reassigned\n target.assignedMap.delete(value);\n }\n // delete reassigned or non-draftable values\n return target.setMap.delete(value);\n },\n clear() {\n if (!this.size)\n return;\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n markChanged(target);\n for (const value of target.original) {\n target.assignedMap.set(value, false);\n }\n target.setMap.clear();\n },\n values() {\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n const iterator = target.setMap.keys();\n return {\n [Symbol.iterator]: () => this.values(),\n next: getNextIterator(target, iterator, { isValuesIterator: true }),\n };\n },\n entries() {\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n const iterator = target.setMap.keys();\n return {\n [Symbol.iterator]: () => this.entries(),\n next: getNextIterator(target, iterator, {\n isValuesIterator: false,\n }),\n };\n },\n keys() {\n return this.values();\n },\n [iteratorSymbol]() {\n return this.values();\n },\n forEach(callback, thisArg) {\n const iterator = this.values();\n let result = iterator.next();\n while (!result.done) {\n callback.call(thisArg, result.value, result.value, this);\n result = iterator.next();\n }\n },\n};\nif (Set.prototype.difference) {\n // for compatibility with new Set methods\n // https://github.com/tc39/proposal-set-methods\n // And `https://github.com/tc39/proposal-set-methods/blob/main/details.md#symbolspecies` has some details about the `@@species` symbol.\n // So we can't use SubSet instance constructor to get the constructor of the SubSet instance.\n Object.assign(setHandler, {\n intersection(other) {\n return Set.prototype.intersection.call(new Set(this.values()), other);\n },\n union(other) {\n return Set.prototype.union.call(new Set(this.values()), other);\n },\n difference(other) {\n return Set.prototype.difference.call(new Set(this.values()), other);\n },\n symmetricDifference(other) {\n return Set.prototype.symmetricDifference.call(new Set(this.values()), other);\n },\n isSubsetOf(other) {\n return Set.prototype.isSubsetOf.call(new Set(this.values()), other);\n },\n isSupersetOf(other) {\n return Set.prototype.isSupersetOf.call(new Set(this.values()), other);\n },\n isDisjointFrom(other) {\n return Set.prototype.isDisjointFrom.call(new Set(this.values()), other);\n },\n });\n}\nconst setHandlerKeys = Reflect.ownKeys(setHandler);\n\nconst proxyHandler = {\n get(target, key, receiver) {\n var _a, _b;\n const copy = (_a = target.copy) === null || _a === void 0 ? void 0 : _a[key];\n // Improve draft reading performance by caching the draft copy.\n if (copy && target.finalities.draftsCache.has(copy)) {\n return copy;\n }\n if (key === PROXY_DRAFT)\n return target;\n let markResult;\n if (target.options.mark) {\n // handle `Uncaught TypeError: Method get Map.prototype.size called on incompatible receiver #<Map>`\n // or `Uncaught TypeError: Method get Set.prototype.size called on incompatible receiver #<Set>`\n const value = key === 'size' &&\n (target.original instanceof Map || target.original instanceof Set)\n ? Reflect.get(target.original, key)\n : Reflect.get(target.original, key, receiver);\n markResult = target.options.mark(value, dataTypes);\n if (markResult === dataTypes.mutable) {\n if (target.options.strict) {\n checkReadable(value, target.options, true);\n }\n return value;\n }\n }\n const source = latest(target);\n if (source instanceof Map && mapHandlerKeys.includes(key)) {\n if (key === 'size') {\n return Object.getOwnPropertyDescriptor(mapHandler, 'size').get.call(target.proxy);\n }\n const handle = mapHandler[key];\n return handle.bind(target.proxy);\n }\n if (source instanceof Set && setHandlerKeys.includes(key)) {\n if (key === 'size') {\n return Object.getOwnPropertyDescriptor(setHandler, 'size').get.call(target.proxy);\n }\n const handle = setHandler[key];\n return handle.bind(target.proxy);\n }\n if (!has(source, key)) {\n const desc = getDescriptor(source, key);\n return desc\n ? `value` in desc\n ? desc.value\n : // !case: support for getter\n (_b = desc.get) === null || _b === void 0 ? void 0 : _b.call(target.proxy)\n : undefined;\n }\n const value = source[key];\n if (target.options.strict) {\n checkReadable(value, target.options);\n }\n if (target.finalized || !isDraftable(value, target.options)) {\n return value;\n }\n // Ensure that the assigned values are not drafted\n if (value === peek(target.original, key)) {\n ensureShallowCopy(target);\n target.copy[key] = createDraft({\n original: target.original[key],\n parentDraft: target,\n key: target.type === 1 /* DraftType.Array */ ? Number(key) : key,\n finalities: target.finalities,\n options: target.options,\n });\n // !case: support for custom shallow copy function\n if (typeof markResult === 'function') {\n const subProxyDraft = getProxyDraft(target.copy[key]);\n ensureShallowCopy(subProxyDraft);\n // Trigger a custom shallow copy to update to a new copy\n markChanged(subProxyDraft);\n return subProxyDraft.copy;\n }\n return target.copy[key];\n }\n if (isDraft(value)) {\n target.finalities.draftsCache.add(value);\n }\n return value;\n },\n set(target, key, value) {\n var _a;\n if (target.type === 3 /* DraftType.Set */ || target.type === 2 /* DraftType.Map */) {\n throw new Error(`Map/Set draft does not support any property assignment.`);\n }\n let _key;\n if (target.type === 1 /* DraftType.Array */ &&\n key !== 'length' &&\n !(Number.isInteger((_key = Number(key))) &&\n _key >= 0 &&\n (key === 0 || _key === 0 || String(_key) === String(key)))) {\n throw new Error(`Only supports setting array indices and the 'length' property.`);\n }\n const desc = getDescriptor(latest(target), key);\n if (desc === null || desc === void 0 ? void 0 : desc.set) {\n // !case: cover the case of setter\n desc.set.call(target.proxy, value);\n return true;\n }\n const current = peek(latest(target), key);\n const currentProxyDraft = getProxyDraft(current);\n if (currentProxyDraft && isEqual(currentProxyDraft.original, value)) {\n // !case: ignore the case of assigning the original draftable value to a draft\n target.copy[key] = value;\n target.assignedMap = (_a = target.assignedMap) !== null && _a !== void 0 ? _a : new Map();\n target.assignedMap.set(key, false);\n return true;\n }\n // !case: handle new props with value 'undefined'\n if (isEqual(value, current) &&\n (value !== undefined || has(target.original, key)))\n return true;\n ensureShallowCopy(target);\n markChanged(target);\n if (has(target.original, key) && isEqual(value, target.original[key])) {\n // !case: handle the case of assigning the original non-draftable value to a draft\n target.assignedMap.delete(key);\n }\n else {\n target.assignedMap.set(key, true);\n }\n target.copy[key] = value;\n markFinalization(target, key, value, generatePatches);\n return true;\n },\n has(target, key) {\n return key in latest(target);\n },\n ownKeys(target) {\n return Reflect.ownKeys(latest(target));\n },\n getOwnPropertyDescriptor(target, key) {\n const source = latest(target);\n const descriptor = Reflect.getOwnPropertyDescriptor(source, key);\n if (!descriptor)\n return descriptor;\n return {\n writable: true,\n configurable: target.type !== 1 /* DraftType.Array */ || key !== 'length',\n enumerable: descriptor.enumerable,\n value: source[key],\n };\n },\n getPrototypeOf(target) {\n return Reflect.getPrototypeOf(target.original);\n },\n setPrototypeOf() {\n throw new Error(`Cannot call 'setPrototypeOf()' on drafts`);\n },\n defineProperty() {\n throw new Error(`Cannot call 'defineProperty()' on drafts`);\n },\n deleteProperty(target, key) {\n var _a;\n if (target.type === 1 /* DraftType.Array */) {\n return proxyHandler.set.call(this, target, key, undefined, target.proxy);\n }\n if (peek(target.original, key) !== undefined || key in target.original) {\n // !case: delete an existing key\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap.set(key, false);\n }\n else {\n target.assignedMap = (_a = target.assignedMap) !== null && _a !== void 0 ? _a : new Map();\n // The original non-existent key has been deleted\n target.assignedMap.delete(key);\n }\n if (target.copy)\n delete target.copy[key];\n return true;\n },\n};\nfunction createDraft(createDraftOptions) {\n const { original, parentDraft, key, finalities, options } = createDraftOptions;\n const type = getType(original);\n const proxyDraft = {\n type,\n finalized: false,\n parent: parentDraft,\n original,\n copy: null,\n proxy: null,\n finalities,\n options,\n // Mapping of draft Set items to their corresponding draft values.\n setMap: type === 3 /* DraftType.Set */\n ? new Map(original.entries())\n : undefined,\n };\n // !case: undefined as a draft map key\n if (key || 'key' in createDraftOptions) {\n proxyDraft.key = key;\n }\n const { proxy, revoke } = Proxy.revocable(type === 1 /* DraftType.Array */ ? Object.assign([], proxyDraft) : proxyDraft, proxyHandler);\n finalities.revoke.push(revoke);\n proxyDraft.proxy = proxy;\n if (parentDraft) {\n const target = parentDraft;\n target.finalities.draft.push((patches, inversePatches) => {\n var _a, _b;\n const oldProxyDraft = getProxyDraft(proxy);\n // if target is a Set draft, `setMap` is the real Set copies proxy mapping.\n let copy = target.type === 3 /* DraftType.Set */ ? target.setMap : target.copy;\n const draft = get(copy, key);\n const proxyDraft = getProxyDraft(draft);\n if (proxyDraft) {\n // assign the updated value to the copy object\n let updatedValue = proxyDraft.original;\n if (proxyDraft.operated) {\n updatedValue = getValue(draft);\n }\n finalizeSetValue(proxyDraft);\n finalizePatches(proxyDraft, generatePatches, patches, inversePatches);\n if (target.options.enableAutoFreeze) {\n target.options.updatedValues =\n (_a = target.options.updatedValues) !== null && _a !== void 0 ? _a : new WeakMap();\n target.options.updatedValues.set(updatedValue, proxyDraft.original);\n }\n // final update value\n set(copy, key, updatedValue);\n }\n // !case: handle the deleted key\n (_b = oldProxyDraft.callbacks) === null || _b === void 0 ? void 0 : _b.forEach((callback) => {\n callback(patches, inversePatches);\n });\n });\n }\n else {\n // !case: handle the root draft\n const target = getProxyDraft(proxy);\n target.finalities.draft.push((patches, inversePatches) => {\n finalizeSetValue(target);\n finalizePatches(target, generatePatches, patches, inversePatches);\n });\n }\n return proxy;\n}\ninternal.createDraft = createDraft;\nfunction finalizeDraft(result, returnedValue, patches, inversePatches, enableAutoFreeze) {\n var _a;\n const proxyDraft = getProxyDraft(result);\n const original = (_a = proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.original) !== null && _a !== void 0 ? _a : result;\n const hasReturnedValue = !!returnedValue.length;\n if (proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.operated) {\n while (proxyDraft.finalities.draft.length > 0) {\n const finalize = proxyDraft.finalities.draft.pop();\n finalize(patches, inversePatches);\n }\n }\n const state = hasReturnedValue\n ? returnedValue[0]\n : proxyDraft\n ? proxyDraft.operated\n ? proxyDraft.copy\n : proxyDraft.original\n : result;\n if (proxyDraft)\n revokeProxy(proxyDraft);\n if (enableAutoFreeze) {\n deepFreeze(state, state, proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.options.updatedValues);\n }\n return [\n state,\n patches && hasReturnedValue\n ? [{ op: Operation.Replace, path: [], value: returnedValue[0] }]\n : patches,\n inversePatches && hasReturnedValue\n ? [{ op: Operation.Replace, path: [], value: original }]\n : inversePatches,\n ];\n}\n\nfunction draftify(baseState, options) {\n var _a;\n const finalities = {\n draft: [],\n revoke: [],\n handledSet: new WeakSet(),\n draftsCache: new WeakSet(),\n };\n let patches;\n let inversePatches;\n if (options.enablePatches) {\n patches = [];\n inversePatches = [];\n }\n const isMutable = ((_a = options.mark) === null || _a === void 0 ? void 0 : _a.call(options, baseState, dataTypes)) === dataTypes.mutable ||\n !isDraftable(baseState, options);\n const draft = isMutable\n ? baseState\n : createDraft({\n original: baseState,\n parentDraft: null,\n finalities,\n options,\n });\n return [\n draft,\n (returnedValue = []) => {\n const [finalizedState, finalizedPatches, finalizedInversePatches] = finalizeDraft(draft, returnedValue, patches, inversePatches, options.enableAutoFreeze);\n return (options.enablePatches\n ? [finalizedState, finalizedPatches, finalizedInversePatches]\n : finalizedState);\n },\n ];\n}\n\nfunction handleReturnValue(options) {\n const { rootDraft, value, useRawReturn = false, isRoot = true } = options;\n forEach(value, (key, item, source) => {\n const proxyDraft = getProxyDraft(item);\n // just handle the draft which is created by the same rootDraft\n if (proxyDraft &&\n rootDraft &&\n proxyDraft.finalities === rootDraft.finalities) {\n options.isContainDraft = true;\n const currentValue = proxyDraft.original;\n // final update value, but just handle return value\n if (source instanceof Set) {\n const arr = Array.from(source);\n source.clear();\n arr.forEach((_item) => source.add(key === _item ? currentValue : _item));\n }\n else {\n set(source, key, currentValue);\n }\n }\n else if (typeof item === 'object' && item !== null) {\n options.value = item;\n options.isRoot = false;\n handleReturnValue(options);\n }\n });\n if (isRoot) {\n if (!options.isContainDraft)\n console.warn(`The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance.`);\n if (useRawReturn) {\n console.warn(`The return value contains drafts, please don't use 'rawReturn()' to wrap the return value.`);\n }\n }\n}\nfunction getCurrent(target) {\n var _a;\n const proxyDraft = getProxyDraft(target);\n if (!isDraftable(target, proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.options))\n return target;\n const type = getType(target);\n if (proxyDraft && !proxyDraft.operated)\n return proxyDraft.original;\n let currentValue;\n function ensureShallowCopy() {\n currentValue =\n type === 2 /* DraftType.Map */\n ? !isBaseMapInstance(target)\n ? new (Object.getPrototypeOf(target).constructor)(target)\n : new Map(target)\n : type === 3 /* DraftType.Set */\n ? Array.from(proxyDraft.setMap.values())\n : shallowCopy(target, proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.options);\n }\n if (proxyDraft) {\n // It's a proxy draft, let's create a shallow copy eagerly\n proxyDraft.finalized = true;\n try {\n ensureShallowCopy();\n }\n finally {\n proxyDraft.finalized = false;\n }\n }\n else {\n // It's not a proxy draft, let's use the target directly and let's see\n // lazily if we need to create a shallow copy\n currentValue = target;\n }\n forEach(currentValue, (key, value) => {\n if (proxyDraft && isEqual(get(proxyDraft.original, key), value))\n return;\n const newValue = getCurrent(value);\n if (newValue !== value) {\n if (currentValue === target)\n ensureShallowCopy();\n set(currentValue, key, newValue);\n }\n });\n if (type === 3 /* DraftType.Set */) {\n const value = (_a = proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.original) !== null && _a !== void 0 ? _a : currentValue;\n return !isBaseSetInstance(value)\n ? new (Object.getPrototypeOf(value).constructor)(currentValue)\n : new Set(currentValue);\n }\n return currentValue;\n}\nfunction current(target) {\n if (!isDraft(target)) {\n throw new Error(`current() is only used for Draft, parameter: ${target}`);\n }\n return getCurrent(target);\n}\n\n/**\n * `makeCreator(options)` to make a creator function.\n *\n * ## Example\n *\n * ```ts\n * import { makeCreator } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const create = makeCreator({ enableAutoFreeze: true });\n * const state = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * },\n * );\n *\n * expect(state).toEqual({ foo: { bar: 'str2' }, arr: [] });\n * expect(state).not.toBe(baseState);\n * expect(state.foo).not.toBe(baseState.foo);\n * expect(state.arr).toBe(baseState.arr);\n * expect(Object.isFrozen(state)).toBeTruthy();\n * ```\n */\nconst makeCreator = (arg) => {\n if (arg !== undefined &&\n Object.prototype.toString.call(arg) !== '[object Object]') {\n throw new Error(`Invalid options: ${String(arg)}, 'options' should be an object.`);\n }\n return function create(arg0, arg1, arg2) {\n var _a, _b, _c;\n if (typeof arg0 === 'function' && typeof arg1 !== 'function') {\n return function (base, ...args) {\n return create(base, (draft) => arg0.call(this, draft, ...args), arg1);\n };\n }\n const base = arg0;\n const mutate = arg1;\n let options = arg2;\n if (typeof arg1 !== 'function') {\n options = arg1;\n }\n if (options !== undefined &&\n Object.prototype.toString.call(options) !== '[object Object]') {\n throw new Error(`Invalid options: ${options}, 'options' should be an object.`);\n }\n options = Object.assign(Object.assign({}, arg), options);\n const state = isDraft(base) ? current(base) : base;\n const mark = Array.isArray(options.mark)\n ? ((value, types) => {\n for (const mark of options.mark) {\n if (typeof mark !== 'function') {\n throw new Error(`Invalid mark: ${mark}, 'mark' should be a function.`);\n }\n const result = mark(value, types);\n if (result) {\n return result;\n }\n }\n return;\n })\n : options.mark;\n const enablePatches = (_a = options.enablePatches) !== null && _a !== void 0 ? _a : false;\n const strict = (_b = options.strict) !== null && _b !== void 0 ? _b : false;\n const enableAutoFreeze = (_c = options.enableAutoFreeze) !== null && _c !== void 0 ? _c : false;\n const _options = {\n enableAutoFreeze,\n mark,\n strict,\n enablePatches,\n };\n if (!isDraftable(state, _options) &&\n typeof state === 'object' &&\n state !== null) {\n throw new Error(`Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.`);\n }\n const [draft, finalize] = draftify(state, _options);\n if (typeof arg1 !== 'function') {\n if (!isDraftable(state, _options)) {\n throw new Error(`Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.`);\n }\n return [draft, finalize];\n }\n let result;\n try {\n result = mutate(draft);\n }\n catch (error) {\n revokeProxy(getProxyDraft(draft));\n throw error;\n }\n const returnValue = (value) => {\n const proxyDraft = getProxyDraft(draft);\n if (!isDraft(value)) {\n if (value !== undefined &&\n !isEqual(value, draft) &&\n (proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.operated)) {\n throw new Error(`Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.`);\n }\n const rawReturnValue = value === null || value === void 0 ? void 0 : value[RAW_RETURN_SYMBOL];\n if (rawReturnValue) {\n const _value = rawReturnValue[0];\n if (_options.strict && typeof value === 'object' && value !== null) {\n handleReturnValue({\n rootDraft: proxyDraft,\n value,\n useRawReturn: true,\n });\n }\n return finalize([_value]);\n }\n if (value !== undefined) {\n if (typeof value === 'object' && value !== null) {\n handleReturnValue({ rootDraft: proxyDraft, value });\n }\n return finalize([value]);\n }\n }\n if (value === draft || value === undefined) {\n return finalize([]);\n }\n const returnedProxyDraft = getProxyDraft(value);\n if (_options === returnedProxyDraft.options) {\n if (returnedProxyDraft.operated) {\n throw new Error(`Cannot return a modified child draft.`);\n }\n return finalize([current(value)]);\n }\n return finalize([value]);\n };\n if (result instanceof Promise) {\n return result.then(returnValue, (error) => {\n revokeProxy(getProxyDraft(draft));\n throw error;\n });\n }\n return returnValue(result);\n };\n};\n\n/**\n * `create(baseState, callback, options)` to create the next state\n *\n * ## Example\n *\n * ```ts\n * import { create } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const state = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * },\n * );\n *\n * expect(state).toEqual({ foo: { bar: 'str2' }, arr: [] });\n * expect(state).not.toBe(baseState);\n * expect(state.foo).not.toBe(baseState.foo);\n * expect(state.arr).toBe(baseState.arr);\n * ```\n */\nconst create = makeCreator();\n\n/**\n * `apply(state, patches)` to apply patches to state\n *\n * ## Example\n *\n * ```ts\n * import { create, apply } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const [state, patches] = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * },\n * { enablePatches: true }\n * );\n * expect(state).toEqual({ foo: { bar: 'str2' }, arr: [] });\n * expect(patches).toEqual([{ op: 'replace', path: ['foo', 'bar'], value: 'str2' }]);\n * expect(state).toEqual(apply(baseState, patches));\n * ```\n */\nfunction apply(state, patches, applyOptions) {\n let i;\n for (i = patches.length - 1; i >= 0; i -= 1) {\n const { value, op, path } = patches[i];\n if ((!path.length && op === Operation.Replace) ||\n (path === '' && op === Operation.Add)) {\n state = value;\n break;\n }\n }\n if (i > -1) {\n patches = patches.slice(i + 1);\n }\n const mutate = (draft) => {\n patches.forEach((patch) => {\n const { path: _path, op } = patch;\n const path = unescapePath(_path);\n let base = draft;\n for (let index = 0; index < path.length - 1; index += 1) {\n const parentType = getType(base);\n let key = path[index];\n if (typeof key !== 'string' && typeof key !== 'number') {\n key = String(key);\n }\n if (((parentType === 0 /* DraftType.Object */ ||\n parentType === 1 /* DraftType.Array */) &&\n (key === '__proto__' || key === 'constructor')) ||\n (typeof base === 'function' && key === 'prototype')) {\n throw new Error(`Patching reserved attributes like __proto__ and constructor is not allowed.`);\n }\n // use `index` in Set draft\n base = get(parentType === 3 /* DraftType.Set */ ? Array.from(base) : base, key);\n if (typeof base !== 'object') {\n throw new Error(`Cannot apply patch at '${path.join('/')}'.`);\n }\n }\n const type = getType(base);\n // ensure the original patch is not modified.\n const value = deepClone(patch.value);\n const key = path[path.length - 1];\n switch (op) {\n case Operation.Replace:\n switch (type) {\n case 2 /* DraftType.Map */:\n return base.set(key, value);\n case 3 /* DraftType.Set */:\n throw new Error(`Cannot apply replace patch to set.`);\n default:\n return (base[key] = value);\n }\n case Operation.Add:\n switch (type) {\n case 1 /* DraftType.Array */:\n // If the \"-\" character is used to\n // index the end of the array (see [RFC6901](https://datatracker.ietf.org/doc/html/rfc6902)),\n // this has the effect of appending the value to the array.\n return key === '-'\n ? base.push(value)\n : base.splice(key, 0, value);\n case 2 /* DraftType.Map */:\n return base.set(key, value);\n case 3 /* DraftType.Set */:\n return base.add(value);\n default:\n return (base[key] = value);\n }\n case Operation.Remove:\n switch (type) {\n case 1 /* DraftType.Array */:\n return base.splice(key, 1);\n case 2 /* DraftType.Map */:\n return base.delete(key);\n case 3 /* DraftType.Set */:\n return base.delete(patch.value);\n default:\n return delete base[key];\n }\n default:\n throw new Error(`Unsupported patch operation: ${op}.`);\n }\n });\n };\n if (applyOptions === null || applyOptions === void 0 ? void 0 : applyOptions.mutable) {\n {\n if (Object.keys(applyOptions).filter((key) => key !== 'mutable').length) {\n console.warn('The \"mutable\" option is not allowed to be used with other options.');\n }\n }\n mutate(state);\n return undefined;\n }\n if (isDraft(state)) {\n if (applyOptions !== undefined) {\n throw new Error(`Cannot apply patches with options to a draft.`);\n }\n mutate(state);\n return state;\n }\n return create(state, mutate, Object.assign(Object.assign({}, applyOptions), { enablePatches: false }));\n}\n\n/**\n * `original(draft)` to get original state in the draft mutation function.\n *\n * ## Example\n *\n * ```ts\n * import { create, original } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const state = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * expect(original(draft.foo)).toEqual({ bar: 'str' });\n * }\n * );\n * ```\n */\nfunction original(target) {\n const proxyDraft = getProxyDraft(target);\n if (!proxyDraft) {\n throw new Error(`original() is only used for a draft, parameter: ${target}`);\n }\n return proxyDraft.original;\n}\n\n/**\n * Use rawReturn() to wrap the return value to skip the draft check and thus improve performance.\n *\n * ## Example\n *\n * ```ts\n * import { create, rawReturn } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const state = create(\n * baseState,\n * (draft) => {\n * return rawReturn(baseState);\n * },\n * );\n * expect(state).toBe(baseState);\n * ```\n */\nfunction rawReturn(value) {\n if (arguments.length === 0) {\n throw new Error('rawReturn() must be called with a value.');\n }\n if (arguments.length > 1) {\n throw new Error('rawReturn() must be called with one argument.');\n }\n if (value !== undefined &&\n (typeof value !== 'object' || value === null)) {\n console.warn('rawReturn() must be called with an object(including plain object, arrays, Set, Map, etc.) or `undefined`, other types do not need to be returned via rawReturn().');\n }\n return {\n [RAW_RETURN_SYMBOL]: [value],\n };\n}\n\nconst constructorString = Object.prototype.constructor.toString();\n/**\n * Check if the value is a simple object(No prototype chain object or iframe same-origin object),\n * support case: https://github.com/unadlib/mutative/issues/17\n */\nconst isSimpleObject = (value) => {\n if (!value || typeof value !== 'object')\n return false;\n const prototype = Object.getPrototypeOf(value);\n if (prototype === null) {\n return true;\n }\n const constructor = Object.hasOwnProperty.call(prototype, 'constructor') &&\n prototype.constructor;\n if (constructor === Object)\n return true;\n return (typeof constructor === 'function' &&\n Function.toString.call(constructor) === constructorString);\n};\nconst markSimpleObject = (value) => {\n if (isSimpleObject(value)) {\n return dataTypes.immutable;\n }\n return;\n};\n\n/**\n * Cast a value to an Draft type value.\n */\nfunction castDraft(value) {\n return value;\n}\n/**\n * Cast a value to an Immutable type value.\n */\nfunction castImmutable(value) {\n return value;\n}\n/**\n * Cast a value to an Mutable type value.\n */\nfunction castMutable(draft) {\n return draft;\n}\n\nexport { apply, castDraft, castImmutable, castMutable, create, current, isDraft, isDraftable, makeCreator, markSimpleObject, original, rawReturn, unsafe };\n//# sourceMappingURL=mutative.esm.mjs.map\n","// Regexps involved with splitting words in various case formats.\nconst SPLIT_LOWER_UPPER_RE = /([\\p{Ll}\\d])(\\p{Lu})/gu;\nconst SPLIT_UPPER_UPPER_RE = /(\\p{Lu})([\\p{Lu}][\\p{Ll}])/gu;\n// Used to iterate over the initial split result and separate numbers.\nconst SPLIT_SEPARATE_NUMBER_RE = /(\\d)\\p{Ll}|(\\p{L})\\d/u;\n// Regexp involved with stripping non-word characters from the result.\nconst DEFAULT_STRIP_REGEXP = /[^\\p{L}\\d]+/giu;\n// The replacement value for splits.\nconst SPLIT_REPLACE_VALUE = \"$1\\0$2\";\n// The default characters to keep after transforming case.\nconst DEFAULT_PREFIX_SUFFIX_CHARACTERS = \"\";\n/**\n * Split any cased input strings into an array of words.\n */\nexport function split(value) {\n let result = value.trim();\n result = result\n .replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE)\n .replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);\n result = result.replace(DEFAULT_STRIP_REGEXP, \"\\0\");\n let start = 0;\n let end = result.length;\n // Trim the delimiter from around the output string.\n while (result.charAt(start) === \"\\0\")\n start++;\n if (start === end)\n return [];\n while (result.charAt(end - 1) === \"\\0\")\n end--;\n return result.slice(start, end).split(/\\0/g);\n}\n/**\n * Split the input string into an array of words, separating numbers.\n */\nexport function splitSeparateNumbers(value) {\n const words = split(value);\n for (let i = 0; i < words.length; i++) {\n const word = words[i];\n const match = SPLIT_SEPARATE_NUMBER_RE.exec(word);\n if (match) {\n const offset = match.index + (match[1] ?? match[2]).length;\n words.splice(i, 1, word.slice(0, offset), word.slice(offset));\n }\n }\n return words;\n}\n/**\n * Convert a string to space separated lower case (`foo bar`).\n */\nexport function noCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n return (prefix +\n words.map(lowerFactory(options?.locale)).join(options?.delimiter ?? \" \") +\n suffix);\n}\n/**\n * Convert a string to camel case (`fooBar`).\n */\nexport function camelCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = options?.mergeAmbiguousCharacters\n ? capitalCaseTransformFactory(lower, upper)\n : pascalCaseTransformFactory(lower, upper);\n return (prefix +\n words\n .map((word, index) => {\n if (index === 0)\n return lower(word);\n return transform(word, index);\n })\n .join(options?.delimiter ?? \"\") +\n suffix);\n}\n/**\n * Convert a string to pascal case (`FooBar`).\n */\nexport function pascalCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = options?.mergeAmbiguousCharacters\n ? capitalCaseTransformFactory(lower, upper)\n : pascalCaseTransformFactory(lower, upper);\n return prefix + words.map(transform).join(options?.delimiter ?? \"\") + suffix;\n}\n/**\n * Convert a string to pascal snake case (`Foo_Bar`).\n */\nexport function pascalSnakeCase(input, options) {\n return capitalCase(input, { delimiter: \"_\", ...options });\n}\n/**\n * Convert a string to capital case (`Foo Bar`).\n */\nexport function capitalCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n return (prefix +\n words\n .map(capitalCaseTransformFactory(lower, upper))\n .join(options?.delimiter ?? \" \") +\n suffix);\n}\n/**\n * Convert a string to constant case (`FOO_BAR`).\n */\nexport function constantCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n return (prefix +\n words.map(upperFactory(options?.locale)).join(options?.delimiter ?? \"_\") +\n suffix);\n}\n/**\n * Convert a string to dot case (`foo.bar`).\n */\nexport function dotCase(input, options) {\n return noCase(input, { delimiter: \".\", ...options });\n}\n/**\n * Convert a string to kebab case (`foo-bar`).\n */\nexport function kebabCase(input, options) {\n return noCase(input, { delimiter: \"-\", ...options });\n}\n/**\n * Convert a string to path case (`foo/bar`).\n */\nexport function pathCase(input, options) {\n return noCase(input, { delimiter: \"/\", ...options });\n}\n/**\n * Convert a string to path case (`Foo bar`).\n */\nexport function sentenceCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = capitalCaseTransformFactory(lower, upper);\n return (prefix +\n words\n .map((word, index) => {\n if (index === 0)\n return transform(word);\n return lower(word);\n })\n .join(options?.delimiter ?? \" \") +\n suffix);\n}\n/**\n * Convert a string to snake case (`foo_bar`).\n */\nexport function snakeCase(input, options) {\n return noCase(input, { delimiter: \"_\", ...options });\n}\n/**\n * Convert a string to header case (`Foo-Bar`).\n */\nexport function trainCase(input, options) {\n return capitalCase(input, { delimiter: \"-\", ...options });\n}\nfunction lowerFactory(locale) {\n return locale === false\n ? (input) => input.toLowerCase()\n : (input) => input.toLocaleLowerCase(locale);\n}\nfunction upperFactory(locale) {\n return locale === false\n ? (input) => input.toUpperCase()\n : (input) => input.toLocaleUpperCase(locale);\n}\nfunction capitalCaseTransformFactory(lower, upper) {\n return (word) => `${upper(word[0])}${lower(word.slice(1))}`;\n}\nfunction pascalCaseTransformFactory(lower, upper) {\n return (word, index) => {\n const char0 = word[0];\n const initial = index > 0 && char0 >= \"0\" && char0 <= \"9\" ? \"_\" + char0 : upper(char0);\n return initial + lower(word.slice(1));\n };\n}\nfunction splitPrefixSuffix(input, options = {}) {\n const splitFn = options.split ?? (options.separateNumbers ? splitSeparateNumbers : split);\n const prefixCharacters = options.prefixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;\n const suffixCharacters = options.suffixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;\n let prefixIndex = 0;\n let suffixIndex = input.length;\n while (prefixIndex < input.length) {\n const char = input.charAt(prefixIndex);\n if (!prefixCharacters.includes(char))\n break;\n prefixIndex++;\n }\n while (suffixIndex > prefixIndex) {\n const index = suffixIndex - 1;\n const char = input.charAt(index);\n if (!suffixCharacters.includes(char))\n break;\n suffixIndex = index;\n }\n return [\n input.slice(0, prefixIndex),\n splitFn(input.slice(prefixIndex, suffixIndex)),\n input.slice(suffixIndex),\n ];\n}\n//# sourceMappingURL=index.js.map","import { a as buildOperationSignatureParams, c as hex2ab, i as buildOperationSignatureMessage, n as generateId, o as getUnixTimestamp, r as ab2hex, s as hashBrowser, t as deriveOperationId } from \"../utils-DKOFCM0Q.js\";\nimport { generateMock } from \"./mock.js\";\nimport { ZodError, z } from \"zod\";\nimport { stringify } from \"safe-stable-stringify\";\nimport { strFromU8, strToU8, unzip, zip } from \"fflate\";\nimport { castDraft, create, unsafe } from \"mutative\";\nimport { constantCase, pascalCase } from \"change-case\";\n//#region document-model/errors.ts\nconst FileSystemError = /* @__PURE__ */ new Error(\"File system not available.\");\nvar InvalidActionInputError = class extends Error {\n\tdata;\n\tconstructor(data) {\n\t\tsuper();\n\t\tthis.name = \"InvalidActionInputError\";\n\t\tthis.data = data;\n\t\tthis.message = this.message || `Invalid action input: ${JSON.stringify(data, null, 2)}`;\n\t}\n};\nvar InvalidActionInputZodError = class extends InvalidActionInputError {\n\tissues;\n\tconstructor(issues) {\n\t\tsuper(issues);\n\t\tthis.issues = issues;\n\t\tthis.name = \"InvalidActionInputZodError\";\n\t}\n};\n/**\n* Error thrown when attempting to downgrade a document version.\n*/\nvar DowngradeNotSupportedError = class extends Error {\n\tdocumentType;\n\tfromVersion;\n\ttoVersion;\n\tconstructor(documentType, fromVersion, toVersion) {\n\t\tsuper(`Downgrade not supported for ${documentType}: cannot upgrade from version ${fromVersion} to ${toVersion}`);\n\t\tthis.name = \"DowngradeNotSupportedError\";\n\t\tthis.documentType = documentType;\n\t\tthis.fromVersion = fromVersion;\n\t\tthis.toVersion = toVersion;\n\t}\n};\nvar HashMismatchError = class extends Error {\n\t_scope;\n\t_document;\n\t_operation;\n\tconstructor(scope, document, operation) {\n\t\tsuper();\n\t\tthis.name = \"HashMismatchError\";\n\t\tthis._document = document;\n\t\tthis._scope = scope;\n\t\tthis._operation = operation;\n\t\tthis.message = JSON.stringify({\n\t\t\terror: `Hash mismatch on document ${document.header.id}, scope ${scope}, index ${operation.index}`,\n\t\t\tdocument,\n\t\t\toperation\n\t\t}, null, 1);\n\t}\n\tget document() {\n\t\treturn this._document;\n\t}\n\tget scope() {\n\t\treturn this._scope;\n\t}\n\tget operation() {\n\t\treturn this._operation;\n\t}\n};\n//#endregion\n//#region document-model/schemas.ts\nconst isDefinedNonNullAny = (v) => v !== void 0 && v !== null;\nconst definedNonNullAnySchema = z.any().refine((v) => isDefinedNonNullAny(v));\nconst Load_StateSchema = z.enum([\"LOAD_STATE\"]);\nconst PruneSchema = z.enum([\"PRUNE\"]);\nconst RedoSchema = z.enum([\"REDO\"]);\nconst Set_NameSchema = z.enum([\"SET_NAME\"]);\nconst Set_PreferredEditorSchema = z.enum([\"SET_PREFERRED_EDITOR\"]);\nconst UndoSchema = z.enum([\"UNDO\"]);\nfunction OperationScopeSchema() {\n\treturn z.string();\n}\nfunction DocumentActionSchema() {\n\treturn z.union([\n\t\tLoadStateActionSchema(),\n\t\tPruneActionSchema(),\n\t\tRedoActionSchema(),\n\t\tSetNameActionSchema(),\n\t\tSetPreferredEditorActionSchema(),\n\t\tUndoActionSchema()\n\t]);\n}\nfunction LoadStateActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string(),\n\t\tinput: z.lazy(() => LoadStateActionInputSchema()),\n\t\ttype: Load_StateSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction LoadStateActionInputSchema() {\n\treturn z.object({\n\t\toperations: z.number(),\n\t\tstate: z.lazy(() => LoadStateActionStateInputSchema())\n\t});\n}\nfunction LoadStateActionStateInputSchema() {\n\treturn z.object({\n\t\tdata: z.unknown().nullish(),\n\t\tname: z.string()\n\t});\n}\nfunction PruneActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string(),\n\t\tinput: z.lazy(() => PruneActionInputSchema()),\n\t\ttype: PruneSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction PruneActionInputSchema() {\n\treturn z.object({\n\t\tend: z.number().nullish(),\n\t\tstart: z.number().nullish()\n\t});\n}\nfunction RedoActionInputSchema() {\n\treturn z.object({ count: z.number() });\n}\nfunction RedoActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string().datetime(),\n\t\tinput: RedoActionInputSchema(),\n\t\ttype: RedoSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction SetNameActionInputSchema() {\n\treturn z.object({ name: z.string() });\n}\nfunction SetNameActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string().datetime(),\n\t\tinput: SetNameActionInputSchema(),\n\t\ttype: Set_NameSchema,\n\t\tscope: z.literal(\"global\")\n\t});\n}\nfunction SetPreferredEditorActionInputSchema() {\n\treturn z.object({ preferredEditor: z.string().nullable() });\n}\nfunction SetPreferredEditorActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string().datetime(),\n\t\tinput: SetPreferredEditorActionInputSchema(),\n\t\ttype: Set_PreferredEditorSchema,\n\t\tscope: z.literal(\"header\")\n\t});\n}\nfunction UndoActionInputSchema() {\n\treturn z.object({ count: z.number() });\n}\nfunction UndoActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string().datetime(),\n\t\tinput: UndoActionInputSchema(),\n\t\ttype: UndoSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction AddChangeLogItemInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"AddChangeLogItemInput\").optional(),\n\t\tcontent: z.string(),\n\t\tid: z.string(),\n\t\tinsertBefore: z.string().nullable()\n\t});\n}\nfunction AddModuleInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string(),\n\t\tname: z.string()\n\t});\n}\nfunction AddOperationErrorInputSchema() {\n\treturn z.object({\n\t\terrorCode: z.string().nullish(),\n\t\terrorDescription: z.string().nullish(),\n\t\terrorName: z.string().nullish(),\n\t\terrorTemplate: z.string().nullish(),\n\t\tid: z.string(),\n\t\toperationId: z.string()\n\t});\n}\nfunction AddOperationExampleInputSchema() {\n\treturn z.object({\n\t\texample: z.string(),\n\t\tid: z.string(),\n\t\toperationId: z.string()\n\t});\n}\nfunction AddOperationInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string(),\n\t\tmoduleId: z.string(),\n\t\tname: z.string(),\n\t\treducer: z.string().nullish(),\n\t\tschema: z.string().nullish(),\n\t\ttemplate: z.string().nullish(),\n\t\tscope: OperationScopeSchema().nullish()\n\t});\n}\nfunction AddStateExampleInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\texample: z.string(),\n\t\tid: z.string(),\n\t\tinsertBefore: z.string().nullish()\n\t});\n}\nfunction AuthorSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"Author\").optional(),\n\t\tname: z.string(),\n\t\twebsite: z.string().nullable()\n\t});\n}\nfunction CodeExampleSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"CodeExample\").optional(),\n\t\tid: z.string(),\n\t\tvalue: z.string()\n\t});\n}\nfunction DeleteChangeLogItemInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DeleteChangeLogItemInput\").optional(),\n\t\tid: z.string()\n\t});\n}\nfunction DeleteModuleInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteOperationErrorInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteOperationExampleInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteOperationInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteStateExampleInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tid: z.string()\n\t});\n}\nfunction DocumentModelInputSchema() {\n\treturn z.union([\n\t\tAddChangeLogItemInputSchema(),\n\t\tAddModuleInputSchema(),\n\t\tAddOperationErrorInputSchema(),\n\t\tAddOperationExampleInputSchema(),\n\t\tAddOperationInputSchema(),\n\t\tAddStateExampleInputSchema(),\n\t\tDeleteChangeLogItemInputSchema(),\n\t\tDeleteModuleInputSchema(),\n\t\tDeleteOperationErrorInputSchema(),\n\t\tDeleteOperationExampleInputSchema(),\n\t\tDeleteOperationInputSchema(),\n\t\tDeleteStateExampleInputSchema(),\n\t\tMoveOperationInputSchema(),\n\t\tReorderChangeLogItemsInputSchema(),\n\t\tReorderModuleOperationsInputSchema(),\n\t\tReorderModulesInputSchema(),\n\t\tReorderOperationErrorsInputSchema(),\n\t\tReorderOperationExamplesInputSchema(),\n\t\tReorderStateExamplesInputSchema(),\n\t\tSetAuthorNameInputSchema(),\n\t\tSetAuthorWebsiteInputSchema(),\n\t\tSetInitialStateInputSchema(),\n\t\tSetModelDescriptionInputSchema(),\n\t\tSetModelExtensionInputSchema(),\n\t\tSetModelIdInputSchema(),\n\t\tSetModelNameInputSchema(),\n\t\tSetModuleDescriptionInputSchema(),\n\t\tSetModuleNameInputSchema(),\n\t\tSetOperationDescriptionInputSchema(),\n\t\tSetOperationErrorCodeInputSchema(),\n\t\tSetOperationErrorDescriptionInputSchema(),\n\t\tSetOperationErrorNameInputSchema(),\n\t\tSetOperationErrorTemplateInputSchema(),\n\t\tSetOperationNameInputSchema(),\n\t\tSetOperationReducerInputSchema(),\n\t\tSetOperationSchemaInputSchema(),\n\t\tSetOperationTemplateInputSchema(),\n\t\tSetStateSchemaInputSchema(),\n\t\tUpdateChangeLogItemInputSchema(),\n\t\tUpdateOperationExampleInputSchema(),\n\t\tUpdateStateExampleInputSchema()\n\t]);\n}\nfunction DocumentModelGlobalStateSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DocumentModelGlobalState\").optional(),\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tauthor: AuthorSchema(),\n\t\textension: z.string(),\n\t\tdescription: z.string(),\n\t\tspecifications: z.array(DocumentSpecificationSchema())\n\t});\n}\nfunction DocumentSpecificationSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DocumentSpecification\").optional(),\n\t\tstate: ScopeStateSchema(),\n\t\tmodules: z.array(ModuleSchema()),\n\t\tversion: z.number().int(),\n\t\tchangeLog: z.array(z.string())\n\t});\n}\nfunction ModuleSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"ModuleSpecification\").optional(),\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tdescription: z.string().nullable(),\n\t\toperations: z.array(OperationSpecificationSchema())\n\t});\n}\nfunction MoveOperationInputSchema() {\n\treturn z.object({\n\t\tnewModuleId: z.string(),\n\t\toperationId: z.string()\n\t});\n}\nfunction OperationSpecificationSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"OperationSpecification\").optional(),\n\t\tid: z.string(),\n\t\tname: z.string().nullable(),\n\t\tdescription: z.string().nullable(),\n\t\tschema: z.string().nullable(),\n\t\ttemplate: z.string().nullable(),\n\t\treducer: z.string().nullable(),\n\t\terrors: z.array(OperationErrorSchema()),\n\t\texamples: z.array(CodeExampleSchema()),\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction OperationErrorSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"OperationErrorSpecification\").optional(),\n\t\tid: z.string(),\n\t\tname: z.string().nullable(),\n\t\tcode: z.string().nullable(),\n\t\tdescription: z.string().nullable(),\n\t\ttemplate: z.string().nullable()\n\t});\n}\nfunction ReorderChangeLogItemsInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"ReorderChangeLogItemsInput\").optional(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderModuleOperationsInputSchema() {\n\treturn z.object({\n\t\tmoduleId: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderModulesInputSchema() {\n\treturn z.object({ order: z.array(z.string()) });\n}\nfunction ReorderOperationErrorsInputSchema() {\n\treturn z.object({\n\t\toperationId: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderOperationExamplesInputSchema() {\n\treturn z.object({\n\t\toperationId: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderStateExamplesInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction SetAuthorNameInputSchema() {\n\treturn z.object({ authorName: z.string() });\n}\nfunction SetAuthorWebsiteInputSchema() {\n\treturn z.object({ authorWebsite: z.string() });\n}\nfunction SetInitialStateInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tinitialValue: z.string()\n\t});\n}\nfunction SetModelDescriptionInputSchema() {\n\treturn z.object({ description: z.string() });\n}\nfunction SetModelExtensionInputSchema() {\n\treturn z.object({ extension: z.string() });\n}\nfunction SetModelIdInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction SetModelNameInputSchema() {\n\treturn z.object({ name: z.string() });\n}\nfunction SetModuleDescriptionInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetModuleNameInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tname: z.string().nullish()\n\t});\n}\nfunction SetOperationDescriptionInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorCodeInputSchema() {\n\treturn z.object({\n\t\terrorCode: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorDescriptionInputSchema() {\n\treturn z.object({\n\t\terrorDescription: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorNameInputSchema() {\n\treturn z.object({\n\t\terrorName: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorTemplateInputSchema() {\n\treturn z.object({\n\t\terrorTemplate: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationNameInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tname: z.string().nullish()\n\t});\n}\nfunction SetOperationScopeInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction SetOperationReducerInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\treducer: z.string().nullish()\n\t});\n}\nfunction SetOperationSchemaInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tschema: z.string().nullish()\n\t});\n}\nfunction SetOperationTemplateInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttemplate: z.string().nullish()\n\t});\n}\nfunction SetStateSchemaInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tschema: z.string()\n\t});\n}\nfunction StateSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"State\").optional(),\n\t\tschema: z.string(),\n\t\texamples: z.array(CodeExampleSchema()),\n\t\tinitialValue: z.string()\n\t});\n}\nfunction ScopeStateSchema() {\n\treturn z.object({\n\t\tlocal: StateSchema(),\n\t\tglobal: StateSchema()\n\t});\n}\nfunction UpdateChangeLogItemInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"UpdateChangeLogItemInput\").optional(),\n\t\tid: z.string(),\n\t\tnewContent: z.string()\n\t});\n}\nfunction UpdateOperationExampleInputSchema() {\n\treturn z.object({\n\t\texample: z.string(),\n\t\tid: z.string()\n\t});\n}\nfunction UpdateStateExampleInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tid: z.string(),\n\t\tnewExample: z.string()\n\t});\n}\nconst PowerhouseModuleSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tdocumentTypes: z.array(z.string()).optional()\n});\nconst PowerhouseModulesSchema = z.array(PowerhouseModuleSchema).optional();\nconst PublisherSchema = z.object({\n\tname: z.string().optional(),\n\turl: z.string().optional()\n});\nconst ConfigEntryTypeSchema = z.union([z.literal(\"var\"), z.literal(\"secret\")]);\nconst ConfigEntrySchema = z.object({\n\tname: z.string(),\n\ttype: ConfigEntryTypeSchema,\n\tdescription: z.string().optional(),\n\trequired: z.boolean().optional(),\n\tdefault: z.boolean().optional()\n});\nconst ManifestSchema = z.object({\n\tname: z.string(),\n\tdescription: z.string().optional(),\n\tcategory: z.string().optional(),\n\tpublisher: PublisherSchema.optional(),\n\tdocumentModels: PowerhouseModulesSchema,\n\tapps: PowerhouseModulesSchema,\n\teditors: PowerhouseModulesSchema,\n\tprocessors: PowerhouseModulesSchema,\n\tsubgraphs: PowerhouseModulesSchema,\n\tconfig: z.array(ConfigEntrySchema).optional()\n});\n//#endregion\n//#region document-model/actions.ts\n/**\n* Cancels the last `count` operations.\n*\n* @param count - Number of operations to cancel\n* @category Actions\n*/\nconst undo = (count = 1, scope = \"global\") => createAction(\"UNDO\", { count }, void 0, UndoActionInputSchema, scope);\n/**\n* Cancels the last `count` {@link undo | UNDO} operations.\n*\n* @param count - Number of UNDO operations to cancel\n* @category Actions\n*/\nconst redo = (count = 1, scope = \"global\") => createAction(\"REDO\", { count }, void 0, RedoActionInputSchema, scope);\n/**\n* Joins multiple operations into a single {@link loadState | LOAD_STATE} operation.\n*\n* @remarks\n* Useful to keep operations history smaller. Operations to prune are selected by index,\n* similar to the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice | slice} method in Arrays.\n*\n* @param start - Index of the first operation to prune\n* @param end - Index of the last operation to prune\n* @category Actions\n*/\nconst prune = (start, end, scope = \"global\") => createAction(\"PRUNE\", {\n\tstart,\n\tend\n}, void 0, PruneActionInputSchema, scope);\n/**\n* Replaces the state of the document.\n*\n* @remarks\n* This action shouldn't be used directly. It is dispatched by the {@link prune} action.\n*\n* @param state - State to be set in the document.\n* @param operations - Number of operations that were removed from the previous state.\n* @category Actions\n*/\nconst loadState = (state, operations) => createAction(\"LOAD_STATE\", {\n\tstate,\n\toperations\n}, void 0, LoadStateActionInputSchema);\nconst noop = (scope = \"global\") => createAction(\"NOOP\", {}, void 0, void 0, scope);\n/**\n* Helper function to be used by action creators.\n*\n* @remarks\n* Creates an action with the given type and input properties. The input\n* properties default to an empty object.\n*\n* @typeParam A - Type of the action to be returned.\n*\n* @param type - The type of the action.\n* @param input - The input properties of the action.\n* @param _attachments - Deprecated and ignored. Retained so action creators\n* generated before the attachment-system removal keep their 5-argument shape.\n* @param validator - The validator to use for the input properties.\n* @param scope - The scope of the action, can either be 'global' or 'local'.\n*\n* @throws Error if the type is empty or not a string.\n*\n* @returns The new action.\n*/\nfunction createAction(type, input, _attachments, validator, scope = \"global\") {\n\tif (!type) throw new Error(\"Empty action type\");\n\tif (typeof type !== \"string\") throw new Error(`Invalid action type: ${JSON.stringify(type)}`);\n\tconst action = {\n\t\tid: generateId(),\n\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\ttype,\n\t\tinput,\n\t\tscope\n\t};\n\ttry {\n\t\tvalidator?.().parse(action.input);\n\t} catch (error) {\n\t\tif (error instanceof ZodError) throw new InvalidActionInputZodError(error.issues);\n\t\tthrow new InvalidActionInputError(error);\n\t}\n\treturn action;\n}\n/**\n* This function should be used instead of { ...action } to ensure\n* that extra properties are not included in the action.\n*/\nconst actionFromAction = (action) => {\n\treturn {\n\t\tid: action.id,\n\t\ttimestampUtcMs: action.timestampUtcMs,\n\t\ttype: action.type,\n\t\tinput: action.input,\n\t\tscope: action.scope,\n\t\tcontext: action.context\n\t};\n};\nconst operationFromAction = (action, index, skip, context) => {\n\treturn {\n\t\t...action,\n\t\taction,\n\t\tid: deriveOperationId(context.documentId, context.scope, context.branch, action.id),\n\t\ttimestampUtcMs: action.timestampUtcMs,\n\t\thash: \"\",\n\t\terror: void 0,\n\t\tindex,\n\t\tskip\n\t};\n};\nconst operationFromOperation = (operation, index, skip, context) => {\n\tconst id = deriveOperationId(context.documentId, context.scope, context.branch, operation.action.id);\n\treturn {\n\t\t...operation,\n\t\thash: \"\",\n\t\terror: void 0,\n\t\tindex,\n\t\tskip,\n\t\tid\n\t};\n};\nconst operationWithContext = (operation, context) => {\n\tif (!operation.action) throw new Error(\"Operation has no action\");\n\treturn {\n\t\t...operation,\n\t\taction: {\n\t\t\t...operation.action,\n\t\t\tcontext\n\t\t}\n\t};\n};\nconst actionContext = () => ({});\nconst actionSigner = (user, app, signatures = []) => ({\n\tuser,\n\tapp,\n\tsignatures\n});\nasync function buildOperationSignature(context, signMethod) {\n\tconst params = buildOperationSignatureParams(context);\n\tconst signature = await signMethod(buildOperationSignatureMessage(params));\n\treturn [...params, `0x${ab2hex(signature)}`];\n}\nasync function buildSignedAction(action, reducer, document, signer, signHandler) {\n\tconst scopeOperations = reducer(document, action, void 0, { reuseOperationResultingState: true }).operations[action.scope];\n\tif (!scopeOperations) throw new Error(`No operations found for scope: ${action.scope}`);\n\tconst operation = scopeOperations.at(-1);\n\tif (!operation) throw new Error(\"Action was not applied\");\n\tconst previousStateHash = scopeOperations.at(-2)?.hash ?? \"\";\n\tconst signature = await buildOperationSignature({\n\t\tdocumentId: document.header.id,\n\t\tsigner,\n\t\taction,\n\t\tpreviousStateHash\n\t}, signHandler);\n\treturn operationWithContext(operation, { signer: actionSigner(signer.user, signer.app, [...signer.signatures, signature]) });\n}\nasync function verifyOperationSignature(signature, signer, verifyHandler) {\n\tconst publicKey = signer.app.key;\n\tconst params = signature.slice(0, 4);\n\treturn verifyHandler(publicKey, hex2ab(signature[4]), buildOperationSignatureMessage(params));\n}\n/**\n* Changes the name of the document.\n*\n* @param name - The name to be set in the document.\n* @category Actions\n*/\nconst setName = (name) => createAction(\"SET_NAME\", typeof name === \"string\" ? { name } : name, void 0, SetNameActionInputSchema, \"global\");\n/**\n* Changes the preferred editor recorded in the document header meta.\n*\n* Passing `null` clears the preferred editor.\n*\n* @category Actions\n*/\nconst setPreferredEditor = (input) => createAction(\"SET_PREFERRED_EDITOR\", typeof input === \"object\" && input !== null ? input : { preferredEditor: input }, void 0, SetPreferredEditorActionInputSchema, \"header\");\nconst setModelName = (input) => createAction(\"SET_MODEL_NAME\", { ...input }, void 0, SetModelNameInputSchema, \"global\");\nconst setModelId = (input) => createAction(\"SET_MODEL_ID\", { ...input }, void 0, SetModelIdInputSchema, \"global\");\nconst setModelExtension = (input) => createAction(\"SET_MODEL_EXTENSION\", { ...input }, void 0, SetModelExtensionInputSchema, \"global\");\nconst setModelDescription = (input) => createAction(\"SET_MODEL_DESCRIPTION\", { ...input }, void 0, SetModelDescriptionInputSchema, \"global\");\nconst setAuthorName = (input) => createAction(\"SET_AUTHOR_NAME\", { ...input }, void 0, SetAuthorNameInputSchema, \"global\");\nconst setAuthorWebsite = (input) => createAction(\"SET_AUTHOR_WEBSITE\", { ...input }, void 0, SetAuthorWebsiteInputSchema, \"global\");\nconst addModule = (input) => createAction(\"ADD_MODULE\", { ...input }, void 0, AddModuleInputSchema, \"global\");\nconst setModuleName = (input) => createAction(\"SET_MODULE_NAME\", { ...input }, void 0, SetModuleNameInputSchema, \"global\");\nconst setModuleDescription = (input) => createAction(\"SET_MODULE_DESCRIPTION\", { ...input }, void 0, SetModuleDescriptionInputSchema, \"global\");\nconst deleteModule = (input) => createAction(\"DELETE_MODULE\", { ...input }, void 0, DeleteModuleInputSchema, \"global\");\nconst reorderModules = (input) => createAction(\"REORDER_MODULES\", { ...input }, void 0, ReorderModulesInputSchema, \"global\");\nconst addOperation = (input) => createAction(\"ADD_OPERATION\", { ...input }, void 0, AddOperationInputSchema, \"global\");\nconst setOperationName = (input) => createAction(\"SET_OPERATION_NAME\", { ...input }, void 0, SetOperationNameInputSchema, \"global\");\nconst setOperationScope = (input) => createAction(\"SET_OPERATION_SCOPE\", { ...input }, void 0, SetOperationScopeInputSchema, \"global\");\nconst setOperationSchema = (input) => createAction(\"SET_OPERATION_SCHEMA\", { ...input }, void 0, SetOperationSchemaInputSchema, \"global\");\nconst setOperationDescription = (input) => createAction(\"SET_OPERATION_DESCRIPTION\", { ...input }, void 0, SetOperationDescriptionInputSchema, \"global\");\nconst setOperationTemplate = (input) => createAction(\"SET_OPERATION_TEMPLATE\", { ...input }, void 0, SetOperationTemplateInputSchema, \"global\");\nconst setOperationReducer = (input) => createAction(\"SET_OPERATION_REDUCER\", { ...input }, void 0, SetOperationReducerInputSchema, \"global\");\nconst moveOperation = (input) => createAction(\"MOVE_OPERATION\", { ...input }, void 0, MoveOperationInputSchema, \"global\");\nconst deleteOperation = (input) => createAction(\"DELETE_OPERATION\", { ...input }, void 0, DeleteOperationInputSchema, \"global\");\nconst reorderModuleOperations = (input) => createAction(\"REORDER_MODULE_OPERATIONS\", { ...input }, void 0, ReorderModuleOperationsInputSchema, \"global\");\nconst addOperationError = (input) => createAction(\"ADD_OPERATION_ERROR\", { ...input }, void 0, AddOperationErrorInputSchema, \"global\");\nconst setOperationErrorCode = (input) => createAction(\"SET_OPERATION_ERROR_CODE\", { ...input }, void 0, SetOperationErrorCodeInputSchema, \"global\");\nconst setOperationErrorName = (input) => createAction(\"SET_OPERATION_ERROR_NAME\", { ...input }, void 0, SetOperationErrorNameInputSchema, \"global\");\nconst setOperationErrorDescription = (input) => createAction(\"SET_OPERATION_ERROR_DESCRIPTION\", { ...input }, void 0, SetOperationErrorDescriptionInputSchema, \"global\");\nconst setOperationErrorTemplate = (input) => createAction(\"SET_OPERATION_ERROR_TEMPLATE\", { ...input }, void 0, SetOperationErrorTemplateInputSchema, \"global\");\nconst deleteOperationError = (input) => createAction(\"DELETE_OPERATION_ERROR\", { ...input }, void 0, DeleteOperationErrorInputSchema, \"global\");\nconst reorderOperationErrors = (input) => createAction(\"REORDER_OPERATION_ERRORS\", { ...input }, void 0, ReorderOperationErrorsInputSchema, \"global\");\nconst addOperationExample = (input) => createAction(\"ADD_OPERATION_EXAMPLE\", { ...input }, void 0, AddOperationExampleInputSchema, \"global\");\nconst updateOperationExample = (input) => createAction(\"UPDATE_OPERATION_EXAMPLE\", { ...input }, void 0, UpdateOperationExampleInputSchema, \"global\");\nconst deleteOperationExample = (input) => createAction(\"DELETE_OPERATION_EXAMPLE\", { ...input }, void 0, DeleteOperationExampleInputSchema, \"global\");\nconst reorderOperationExamples = (input) => createAction(\"REORDER_OPERATION_EXAMPLES\", { ...input }, void 0, ReorderOperationExamplesInputSchema, \"global\");\nconst operationExampleCreators = {\n\taddOperationExample,\n\tupdateOperationExample,\n\tdeleteOperationExample,\n\treorderOperationExamples\n};\nconst setStateSchema = (input) => createAction(\"SET_STATE_SCHEMA\", { ...input }, void 0, SetStateSchemaInputSchema, \"global\");\nconst setInitialState = (input) => createAction(\"SET_INITIAL_STATE\", { ...input }, void 0, SetInitialStateInputSchema, \"global\");\nconst addStateExample = (input) => createAction(\"ADD_STATE_EXAMPLE\", { ...input }, void 0, AddStateExampleInputSchema, \"global\");\nconst updateStateExample = (input) => createAction(\"UPDATE_STATE_EXAMPLE\", { ...input }, void 0, UpdateStateExampleInputSchema, \"global\");\nconst deleteStateExample = (input) => createAction(\"DELETE_STATE_EXAMPLE\", { ...input }, void 0, DeleteStateExampleInputSchema, \"global\");\nconst reorderStateExamples = (input) => createAction(\"REORDER_STATE_EXAMPLES\", { ...input }, void 0, ReorderStateExamplesInputSchema, \"global\");\nconst addChangeLogItem = (input) => createAction(\"ADD_CHANGE_LOG_ITEM\", { ...input }, void 0, AddChangeLogItemInputSchema, \"global\");\nconst updateChangeLogItem = (input) => createAction(\"UPDATE_CHANGE_LOG_ITEM\", { ...input }, void 0, UpdateChangeLogItemInputSchema, \"global\");\nconst deleteChangeLogItem = (input) => createAction(\"DELETE_CHANGE_LOG_ITEM\", { ...input }, void 0, DeleteChangeLogItemInputSchema, \"global\");\nconst reorderChangeLogItems = (input) => createAction(\"REORDER_CHANGE_LOG_ITEMS\", { ...input }, void 0, ReorderChangeLogItemsInputSchema, \"global\");\nconst releaseNewVersion = () => createAction(\"RELEASE_NEW_VERSION\", {}, void 0, void 0, \"global\");\nconst baseActions = {\n\tsetName,\n\tsetPreferredEditor,\n\tundo,\n\tredo,\n\tprune,\n\tloadState,\n\tnoop\n};\nconst documentModelActions = {\n\tsetModelName,\n\tsetModelId,\n\tsetModelExtension,\n\tsetModelDescription,\n\tsetAuthorName,\n\tsetAuthorWebsite,\n\taddModule,\n\tsetModuleName,\n\tsetModuleDescription,\n\tdeleteModule,\n\treorderModules,\n\taddOperation,\n\tsetOperationName,\n\tsetOperationScope,\n\tsetOperationSchema,\n\tsetOperationDescription,\n\tsetOperationTemplate,\n\tsetOperationReducer,\n\tmoveOperation,\n\tdeleteOperation,\n\treorderModuleOperations,\n\taddOperationError,\n\tsetOperationErrorCode,\n\tsetOperationErrorName,\n\tsetOperationErrorDescription,\n\tsetOperationErrorTemplate,\n\tdeleteOperationError,\n\treorderOperationErrors,\n\taddOperationExample,\n\tupdateOperationExample,\n\tdeleteOperationExample,\n\treorderOperationExamples,\n\tsetStateSchema,\n\tsetInitialState,\n\taddStateExample,\n\tupdateStateExample,\n\tdeleteStateExample,\n\treorderStateExamples,\n\taddChangeLogItem,\n\tupdateChangeLogItem,\n\tdeleteChangeLogItem,\n\treorderChangeLogItems,\n\treleaseNewVersion\n};\nconst actions = {\n\t...baseActions,\n\t...documentModelActions\n};\n//#endregion\n//#region document-model/constants.ts\nconst documentModelFileExtension = \"phdm\";\nconst documentModelInitialLocalState = {};\nconst documentModelInitialGlobalState = {\n\tid: \"\",\n\tname: \"\",\n\textension: \"\",\n\tdescription: \"\",\n\tauthor: {\n\t\tname: \"\",\n\t\twebsite: \"\"\n\t},\n\tspecifications: [{\n\t\tversion: 1,\n\t\tchangeLog: [],\n\t\tstate: {\n\t\t\tglobal: {\n\t\t\t\tschema: \"\",\n\t\t\t\tinitialValue: \"\",\n\t\t\t\texamples: []\n\t\t\t},\n\t\t\tlocal: {\n\t\t\t\tschema: \"\",\n\t\t\t\tinitialValue: \"\",\n\t\t\t\texamples: []\n\t\t\t}\n\t\t},\n\t\tmodules: []\n\t}]\n};\nconst documentModelGlobalState = {\n\tid: \"powerhouse/document-model\",\n\tname: \"DocumentModel\",\n\textension: \"phdm\",\n\tdescription: \"The Powerhouse Document Model describes the state and operations of a document type.\",\n\tauthor: {\n\t\tname: \"Powerhouse\",\n\t\twebsite: \"https://www.powerhouse.inc/\"\n\t},\n\tspecifications: [{\n\t\tversion: 1,\n\t\tchangeLog: [],\n\t\tstate: {\n\t\t\tglobal: {\n\t\t\t\tschema: \"type CodeExample {\\n id: ID!\\n value: String!\\n}\\n\\ntype OperationError {\\n id: ID!\\n code: String\\n name: String\\n description: String\\n template: String\\n}\\n\\ntype Operation {\\n id: ID!\\n name: String\\n schema: String\\n description: String\\n template: String\\n errors: [OperationError!]!\\n examples: [CodeExample!]!\\n reducer: String\\n scope: String\\n}\\n\\ntype Module {\\n id: ID!\\n name: String!\\n description: String\\n operations: [Operation!]!\\n}\\n\\ntype State {\\n schema: String!\\n initialValue: String!\\n examples: [CodeExample!]!\\n}\\n\\ntype ScopeState {\\n global: State!\\n local: State!\\n}\\n\\ntype Author {\\n name: String!\\n website: String\\n}\\n\\ntype DocumentSpecification {\\n version: Int!\\n state: ScopeState!\\n modules: [Module!]!\\n changeLog: [String!]!\\n}\\n\\ntype DocumentModelGlobalState {\\n name: String!\\n id: String!\\n extension: String!\\n description: String!\\n author: Author!\\n specifications: [DocumentSpecification!]!\\n}\",\n\t\t\t\tinitialValue: \"{\\n \\\"id\\\": \\\"\\\",\\n \\\"name\\\": \\\"\\\",\\n \\\"extension\\\": \\\"\\\",\\n \\\"description\\\": \\\"\\\",\\n \\\"author\\\": {\\n \\\"name\\\": \\\"\\\",\\n \\\"website\\\": \\\"\\\"\\n },\\n \\\"specifications\\\": [\\n {\\n \\\"version\\\": 1,\\n \\\"changeLog\\\": [],\\n \\\"state\\\": {\\n \\\"global\\\": {\\n \\\"schema\\\": \\\"\\\",\\n \\\"initialValue\\\": \\\"\\\",\\n \\\"examples\\\": []\\n },\\n \\\"local\\\": {\\n \\\"schema\\\": \\\"\\\",\\n \\\"initialValue\\\": \\\"\\\",\\n \\\"examples\\\": []\\n }\\n },\\n \\\"modules\\\": []\\n }\\n ]\\n}\",\n\t\t\t\texamples: []\n\t\t\t},\n\t\t\tlocal: {\n\t\t\t\tschema: \"\",\n\t\t\t\tinitialValue: \"\",\n\t\t\t\texamples: []\n\t\t\t}\n\t\t},\n\t\tmodules: [\n\t\t\t{\n\t\t\t\tname: \"header\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of the document model\",\n\t\t\t\t\t\tschema: \"input SetModelNameInput {\\n name: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_ID\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the unique identifier for the document model\",\n\t\t\t\t\t\tschema: \"input SetModelIdInput {\\n id: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_EXTENSION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the file extension associated with this document model\",\n\t\t\t\t\t\tschema: \"input SetModelExtensionInput {\\n extension: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description text for the document model\",\n\t\t\t\t\t\tschema: \"input SetModelDescriptionInput {\\n description: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_AUTHOR_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of the document model author\",\n\t\t\t\t\t\tschema: \"input SetAuthorNameInput {\\n authorName: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_AUTHOR_WEBSITE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the website URL of the document model author\",\n\t\t\t\t\t\tschema: \"input SetAuthorWebsiteInput {\\n authorWebsite: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"versioning\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_CHANGE_LOG_ITEM\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new item to the document model changelog\",\n\t\t\t\t\t\tschema: \"input AddChangeLogItemInput {\\n id: ID!\\n insertBefore: ID\\n content: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"UPDATE_CHANGE_LOG_ITEM\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Updates an existing changelog item\",\n\t\t\t\t\t\tschema: \"input UpdateChangeLogItemInput {\\n id: ID!\\n newContent: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_CHANGE_LOG_ITEM\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes an item from the document model changelog\",\n\t\t\t\t\t\tschema: \"input DeleteChangeLogItemInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_CHANGE_LOG_ITEMS\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of changelog items\",\n\t\t\t\t\t\tschema: \"input ReorderChangeLogItemsInput {\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"RELEASE_NEW_VERSION\",\n\t\t\t\t\t\tschema: null,\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Creates a new version of the document model specification\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"module\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_MODULE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new module to the document model specification\",\n\t\t\t\t\t\tschema: \"input AddModuleInput {\\n id: ID!\\n name: String!\\n description: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODULE_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of an existing module\",\n\t\t\t\t\t\tschema: \"input SetModuleNameInput {\\n id: ID!\\n name: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODULE_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description of an existing module\",\n\t\t\t\t\t\tschema: \"input SetModuleDescriptionInput {\\n id: ID!\\n description: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_MODULE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes a module from the document model specification\",\n\t\t\t\t\t\tschema: \"input DeleteModuleInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_MODULES\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of modules in the document model specification\",\n\t\t\t\t\t\tschema: \"input ReorderModulesInput {\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"operation-error\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_OPERATION_ERROR\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new error definition to an operation\",\n\t\t\t\t\t\tschema: \"input AddOperationErrorInput {\\n operationId: ID!\\n id: ID!\\n errorCode: String\\n errorName: String\\n errorDescription: String\\n errorTemplate: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_CODE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the error code for an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorCodeInput {\\n id: ID!\\n errorCode: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorNameInput {\\n id: ID!\\n errorName: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description of an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorDescriptionInput {\\n id: ID!\\n errorDescription: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_TEMPLATE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the template for an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorTemplateInput {\\n id: ID!\\n errorTemplate: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_OPERATION_ERROR\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes an error definition from an operation\",\n\t\t\t\t\t\tschema: \"input DeleteOperationErrorInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_OPERATION_ERRORS\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of error definitions for an operation\",\n\t\t\t\t\t\tschema: \"input ReorderOperationErrorsInput {\\n operationId: ID!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"operation-example\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_OPERATION_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new code example to an operation\",\n\t\t\t\t\t\tschema: \"input AddOperationExampleInput {\\n operationId: ID!\\n id: ID!\\n example: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"UPDATE_OPERATION_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Updates an existing code example for an operation\",\n\t\t\t\t\t\tschema: \"input UpdateOperationExampleInput {\\n id: ID!\\n example: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_OPERATION_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes a code example from an operation\",\n\t\t\t\t\t\tschema: \"input DeleteOperationExampleInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_OPERATION_EXAMPLES\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of code examples for an operation\",\n\t\t\t\t\t\tschema: \"input ReorderOperationExamplesInput {\\n operationId: ID!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"operation\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_OPERATION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new operation to a module\",\n\t\t\t\t\t\tschema: \"input AddOperationInput {\\n moduleId: ID!\\n id: ID!\\n name: String!\\n schema: String\\n description: String\\n template: String\\n reducer: String\\n scope: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationNameInput {\\n id: ID!\\n name: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_SCHEMA\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the GraphQL schema definition for an operation's input\",\n\t\t\t\t\t\tschema: \"input SetOperationSchemaInput {\\n id: ID!\\n schema: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description of an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationDescriptionInput {\\n id: ID!\\n description: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_TEMPLATE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the template code for an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationTemplateInput {\\n id: ID!\\n template: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_REDUCER\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the reducer function code for an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationReducerInput {\\n id: ID!\\n reducer: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_SCOPE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the scope of an operation (global or local)\",\n\t\t\t\t\t\tschema: \"input SetOperationScopeInput {\\n id: ID!\\n scope: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"MOVE_OPERATION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Moves an operation from one module to another\",\n\t\t\t\t\t\tschema: \"input MoveOperationInput {\\n operationId: ID!\\n newModuleId: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_OPERATION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes an operation from a module\",\n\t\t\t\t\t\tschema: \"input DeleteOperationInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_MODULE_OPERATIONS\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of operations within a module\",\n\t\t\t\t\t\tschema: \"input ReorderModuleOperationsInput {\\n moduleId: ID!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"state\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_STATE_SCHEMA\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the GraphQL schema definition for document state\",\n\t\t\t\t\t\tschema: \"input SetStateSchemaInput {\\n scope: String!\\n schema: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_INITIAL_STATE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the initial state value for a document scope\",\n\t\t\t\t\t\tschema: \"input SetInitialStateInput {\\n scope: String!\\n initialValue: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_STATE_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new state example to a document scope\",\n\t\t\t\t\t\tschema: \"input AddStateExampleInput {\\n scope: String!\\n id: ID!\\n insertBefore: ID\\n example: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"UPDATE_STATE_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Updates an existing state example for a document scope\",\n\t\t\t\t\t\tschema: \"input UpdateStateExampleInput {\\n scope: String!\\n id: ID!\\n newExample: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_STATE_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes a state example from a document scope\",\n\t\t\t\t\t\tschema: \"input DeleteStateExampleInput {\\n scope: String!\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_STATE_EXAMPLES\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of state examples for a document scope\",\n\t\t\t\t\t\tschema: \"input ReorderStateExamplesInput {\\n scope: String!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t}\n\t\t]\n\t}]\n};\nconst HASH_ALGORITHM_SHA1 = \"sha1\";\nconst HASH_ALGORITHM_SHA256 = \"sha256\";\nconst HASH_ALGORITHM_SHA512 = \"sha512\";\nconst HASH_ENCODING_BASE64 = \"base64\";\nconst HASH_ENCODING_HEX = \"hex\";\n//#endregion\n//#region document-model/document-type.ts\nconst documentModelDocumentType = \"powerhouse/document-model\";\n//#endregion\n//#region document-model/document-schema.ts\nconst BaseDocumentHeaderSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tcreatedAtUtcIso: z.string(),\n\tlastModifiedAtUtcIso: z.string(),\n\tdocumentType: z.string()\n});\nconst BaseDocumentStateSchema = z.object({ global: z.unknown() });\n/** Schema for validating the header object of a DocumentModel document */\nconst DocumentModelHeaderSchema = BaseDocumentHeaderSchema.extend({ documentType: z.literal(documentModelDocumentType) });\n/** Schema for validating the state object of a DocumentModel document */\nconst DocumentModelPHStateSchema = BaseDocumentStateSchema.extend({ global: DocumentModelGlobalStateSchema() });\nconst DocumentModelSchema = z.object({\n\theader: DocumentModelHeaderSchema,\n\tstate: DocumentModelPHStateSchema,\n\tinitialState: DocumentModelPHStateSchema\n});\n/** Simple helper function to check if a state object is a DocumentModel document state object */\nfunction isDocumentModelState(state) {\n\treturn DocumentModelPHStateSchema.safeParse(state).success;\n}\n/** Simple helper function to assert that a document state object is a DocumentModel document state object */\nfunction assertIsDocumentModelState(state) {\n\tDocumentModelPHStateSchema.parse(state);\n}\n/** Simple helper function to check if a document is a DocumentModel document */\nfunction isDocumentModelDocument(document) {\n\treturn DocumentModelSchema.safeParse(document).success;\n}\n/** Simple helper function to assert that a document is a DocumentModel document */\nfunction assertIsDocumentModelDocument(document) {\n\tDocumentModelSchema.parse(document);\n}\n//#endregion\n//#region document-model/header.ts\n/**\n* Generates a deterministic payload from signing parameters\n*/\nconst generateStablePayload = (parameters) => `${parameters.documentType}:${parameters.createdAtUtcIso}:${parameters.nonce}`;\n/**\n* Creates a verification-only signer from a public key.\n* This signer can only verify signatures, not sign data.\n*\n* @param pubKey - The public key to use for verification.\n* @returns An ISigner that can only verify signatures.\n*/\nasync function createVerificationSigner(pubKey) {\n\tconst cryptoKey = await crypto.subtle.importKey(\"jwk\", pubKey, {\n\t\tname: \"ECDSA\",\n\t\tnamedCurve: \"P-256\"\n\t}, true, [\"verify\"]);\n\treturn {\n\t\tpublicKey: cryptoKey,\n\t\tasync sign(_data) {\n\t\t\tthrow new Error(\"verification-only signer cannot sign data\");\n\t\t},\n\t\tasync signAction(_action, _abortSignal) {\n\t\t\tthrow new Error(\"verification-only signer cannot sign actions\");\n\t\t},\n\t\tasync verify(data, signature) {\n\t\t\tlet isValid;\n\t\t\ttry {\n\t\t\t\tisValid = await crypto.subtle.verify({\n\t\t\t\t\tname: \"ECDSA\",\n\t\t\t\t\thash: \"SHA-256\"\n\t\t\t\t}, cryptoKey, new Uint8Array(signature), new Uint8Array(data));\n\t\t\t} catch {\n\t\t\t\tthrow new Error(\"invalid signature\");\n\t\t\t}\n\t\t\tif (!isValid) throw new Error(\"invalid signature\");\n\t\t}\n\t};\n}\n/**\n* Creates a verification-only signer from a header.\n*\n* @param header - The header to create a signer from.\n* @returns A signer that can verify the header's signature.\n*/\nconst createSignerFromHeader = async (header) => {\n\treturn createVerificationSigner(header.sig.publicKey);\n};\n/**\n* Signs a header. Generally, this is not called directly, but rather through\n* {@link createSignedHeader}.\n*\n* @param parameters - The parameters used to sign the header.\n* @param signer - The signer of the document.\n*\n* @returns The signature of the header.\n*/\nconst sign = async (parameters, signer) => {\n\tconst payload = generateStablePayload(parameters);\n\tconst data = new TextEncoder().encode(payload);\n\tconst signature = await signer.sign(data);\n\tconst signatureArray = new Uint8Array(signature);\n\treturn btoa(String.fromCharCode(...signatureArray));\n};\n/**\n* Verifies a header signature. Generally, this is not called directly, but\n* rather through {@link validateHeader}.\n*\n* @param parameters - The parameters used to sign the header.\n* @param signature - The signature to verify.\n* @param signer - The signer of the document.\n*/\nconst verify = async (parameters, signature, signer) => {\n\tconst payload = generateStablePayload(parameters);\n\tconst data = new TextEncoder().encode(payload);\n\tconst signatureBytes = Uint8Array.from(atob(signature), (c) => c.charCodeAt(0));\n\tawait signer.verify(data, signatureBytes);\n};\n/**\n* Validates a header signature.\n*/\nconst validateHeader = async (header) => {\n\tconst signer = await createSignerFromHeader(header);\n\treturn verify({\n\t\tdocumentType: header.documentType,\n\t\tcreatedAtUtcIso: header.createdAtUtcIso,\n\t\tnonce: header.sig.nonce\n\t}, header.id, signer);\n};\n/**\n* Creates a header that has yet to be signed. This header is not valid, but\n* can be input into {@link createSignedHeader} to create a signed header.\n*\n* @returns An unsigned header for a document.\n*/\nconst createPresignedHeader = (id = generateId(), documentType = \"\") => {\n\treturn {\n\t\tid,\n\t\tsig: {\n\t\t\tpublicKey: {},\n\t\t\tnonce: \"\"\n\t\t},\n\t\tdocumentType,\n\t\tcreatedAtUtcIso: (/* @__PURE__ */ new Date()).toISOString(),\n\t\tslug: \"\",\n\t\tname: \"\",\n\t\tbranch: \"main\",\n\t\trevision: { document: 0 },\n\t\tlastModifiedAtUtcIso: (/* @__PURE__ */ new Date()).toISOString(),\n\t\tmeta: {}\n\t};\n};\n/**\n* Creates a new, signed header for a document. This will replace the id of the\n* document.\n*\n* @param unsignedHeader - The unsigned header to created the signed header from.\n* @param signer - The signer of the document.\n*\n* @returns A new signed header for a document. Some fields are mutable and\n* some are not. See the PHDocumentHeader type for more information.\n*/\nconst createSignedHeader = async (unsignedHeader, documentType, signer) => {\n\tconst parameters = {\n\t\tdocumentType,\n\t\tcreatedAtUtcIso: unsignedHeader.createdAtUtcIso,\n\t\tnonce: generateId()\n\t};\n\treturn {\n\t\tid: await sign(parameters, signer),\n\t\tsig: {\n\t\t\tpublicKey: await crypto.subtle.exportKey(\"jwk\", signer.publicKey),\n\t\t\tnonce: parameters.nonce\n\t\t},\n\t\tdocumentType,\n\t\tcreatedAtUtcIso: unsignedHeader.createdAtUtcIso,\n\t\tslug: unsignedHeader.slug,\n\t\tname: unsignedHeader.name,\n\t\tbranch: unsignedHeader.branch,\n\t\trevision: unsignedHeader.revision,\n\t\tlastModifiedAtUtcIso: unsignedHeader.lastModifiedAtUtcIso,\n\t\tmeta: unsignedHeader.meta\n\t};\n};\n/**\n* Creates a signed header for a document. The document header requires a signer\n* as the document id is a cryptographic signature.\n*\n* @param documentType - The type of the document.\n* @param signer - The signer of the document.\n*\n* @returns The signed header for a document. Some fields are mutable and\n* some are not. See the PHDocumentHeader type for more information.\n*/\nconst createSignedHeaderForSigner = async (documentType, signer) => {\n\treturn await createSignedHeader(createPresignedHeader(), documentType, signer);\n};\n//#endregion\n//#region document-model/documents.ts\nfunction isNoopOperation(op) {\n\treturn op.type === \"NOOP\" && op.skip !== void 0 && op.skip > 0 && op.hash !== void 0;\n}\nfunction isUndoRedo(action) {\n\treturn [\"UNDO\", \"REDO\"].includes(action.type);\n}\nfunction isUndo(action) {\n\treturn action.type === \"UNDO\";\n}\nfunction isDocumentAction(action) {\n\treturn [\n\t\t\"SET_NAME\",\n\t\t\"SET_PREFERRED_EDITOR\",\n\t\t\"UNDO\",\n\t\t\"REDO\",\n\t\t\"PRUNE\",\n\t\t\"LOAD_STATE\"\n\t].includes(action.type);\n}\n/**\n* The document-scope operations a reactor mints on `create`, so a standalone\n* document carries its initial state when exported outside a reactor.\n*/\nfunction createDocumentScopeOperations(header, state) {\n\tconst createInput = {\n\t\tmodel: header.documentType,\n\t\tversion: 0,\n\t\tdocumentId: header.id,\n\t\tsigning: {\n\t\t\tsignature: header.id,\n\t\t\tpublicKey: header.sig.publicKey,\n\t\t\tnonce: header.sig.nonce,\n\t\t\tcreatedAtUtcIso: header.createdAtUtcIso,\n\t\t\tdocumentType: header.documentType\n\t\t},\n\t\tslug: header.slug,\n\t\tname: header.name,\n\t\tbranch: header.branch,\n\t\tmeta: header.meta,\n\t\tprotocolVersions: header.protocolVersions ?? { \"base-reducer\": 2 }\n\t};\n\tconst upgradeInput = {\n\t\tmodel: header.documentType,\n\t\tfromVersion: 0,\n\t\ttoVersion: state.document.version,\n\t\tdocumentId: header.id,\n\t\tinitialState: state\n\t};\n\treturn [{\n\t\tid: generateId(),\n\t\ttype: \"CREATE_DOCUMENT\",\n\t\tscope: \"document\",\n\t\ttimestampUtcMs: header.createdAtUtcIso,\n\t\tinput: createInput\n\t}, {\n\t\tid: generateId(),\n\t\ttype: \"UPGRADE_DOCUMENT\",\n\t\tscope: \"document\",\n\t\ttimestampUtcMs: header.createdAtUtcIso,\n\t\tinput: upgradeInput\n\t}].map((action, index) => ({\n\t\t...action,\n\t\taction,\n\t\tid: deriveOperationId(header.id, \"document\", header.branch, action.id),\n\t\thash: \"\",\n\t\terror: void 0,\n\t\tindex,\n\t\tskip: 0\n\t}));\n}\n/**\n* Creates a new document. When `documentType` is given the header is stamped\n* with it and the document-scope operations are seeded.\n*/\nfunction baseCreateDocument(createState, initialState, documentType = \"\") {\n\tconst state = createState(initialState);\n\tconst header = createPresignedHeader(generateId(), documentType);\n\treturn {\n\t\theader,\n\t\tstate,\n\t\tinitialState: state,\n\t\toperations: documentType ? {\n\t\t\tglobal: [],\n\t\t\tlocal: [],\n\t\t\tdocument: createDocumentScopeOperations(header, state)\n\t\t} : {\n\t\t\tglobal: [],\n\t\t\tlocal: []\n\t\t},\n\t\tclipboard: []\n\t};\n}\nfunction hashDocumentStateForScope(document, scope = \"global\") {\n\treturn hashBrowser(stringify(document.state[scope] || \"\"));\n}\nfunction readOnly(value) {\n\treturn Object.freeze(value);\n}\n/**\n* Maps skipped operations in an array of operations.\n* Skipped operations are operations that are ignored during processing.\n* @param operations - The array of operations to map.\n* @param skippedHeadOperations - The number of operations to skip at the head of the array of operations.\n* @returns An array of mapped operations with ignore flag indicating if the operation is skipped.\n* @throws Error if the operation index is invalid and there are missing operations.\n*/\nfunction mapSkippedOperations(operations, skippedHeadOperations) {\n\tconst ops = [...operations];\n\tlet skipped = skippedHeadOperations || 0;\n\tlet latestOpIndex = ops.length > 0 ? ops[ops.length - 1].index : 0;\n\tconst scopeOpsWithIgnore = [];\n\tfor (const operation of ops.reverse()) {\n\t\tif (skipped > 0) {\n\t\t\tconst operationsDiff = latestOpIndex - operation.index;\n\t\t\tskipped -= operationsDiff;\n\t\t}\n\t\tif (skipped < 0) throw new Error(\"Invalid operation index, missing operations\");\n\t\tconst mappedOp = {\n\t\t\tignore: skipped > 0,\n\t\t\toperation\n\t\t};\n\t\tconst operationSkip = operation.skip > 0 ? operation.skip + 1 : 0;\n\t\tif (operationSkip > 0 && operationSkip > skipped) {\n\t\t\tconst skipDiff = operationSkip - skipped;\n\t\t\tskipped = skipped + skipDiff;\n\t\t}\n\t\tlatestOpIndex = operation.index;\n\t\tscopeOpsWithIgnore.push(mappedOp);\n\t}\n\treturn scopeOpsWithIgnore.reverse();\n}\n/**\n* V2 version of mapSkippedOperations for protocol version 2+.\n* In V2, all NOOPs have skip=1 and consecutive NOOPs form chains.\n* N consecutive NOOPs at any point skip N preceding content operations.\n*\n* Algorithm: Process from end to start\n* - When hitting a NOOP: increment chain length, mark as ignored\n* - When hitting a non-NOOP:\n* - If chain > 0: decrement chain, mark as ignored (this op was undone)\n* - If chain == 0: mark as not ignored (apply this op)\n*/\nfunction mapSkippedOperationsV2(operations) {\n\tconst ops = [...operations];\n\tconst result = [];\n\tlet noopChainLength = 0;\n\tfor (let i = ops.length - 1; i >= 0; i--) {\n\t\tconst operation = ops[i];\n\t\tif (operation.action.type === \"NOOP\") {\n\t\t\tnoopChainLength++;\n\t\t\tresult.unshift({\n\t\t\t\tignore: true,\n\t\t\t\toperation\n\t\t\t});\n\t\t} else if (noopChainLength > 0) {\n\t\t\tnoopChainLength--;\n\t\t\tresult.unshift({\n\t\t\t\tignore: true,\n\t\t\t\toperation\n\t\t\t});\n\t\t} else result.unshift({\n\t\t\tignore: false,\n\t\t\toperation\n\t\t});\n\t}\n\treturn result;\n}\n/**\n* V2 garbage collect that returns only operations that should be applied for state.\n* Uses the V2 model where consecutive NOOPs form chains.\n* Unlike V1 garbageCollect, this preserves ALL operations but marks which to apply.\n*/\nfunction garbageCollectV2(sortedOperations) {\n\tconst result = [];\n\tlet noopChainLength = 0;\n\tfor (let i = sortedOperations.length - 1; i >= 0; i--) {\n\t\tconst op = sortedOperations[i];\n\t\tif (\"action\" in op && op.action.type === \"NOOP\" && op.skip > 0) {\n\t\t\tnoopChainLength++;\n\t\t\tresult.unshift(op);\n\t\t} else if (noopChainLength > 0) noopChainLength--;\n\t\telse result.unshift(op);\n\t}\n\treturn result;\n}\nfunction sortMappedOperations(operations) {\n\treturn Object.values(operations).flatMap((array) => array).sort((a, b) => new Date(a.operation.timestampUtcMs).getTime() - new Date(b.operation.timestampUtcMs).getTime());\n}\nconst defaultCreateState = (state) => {\n\treturn state;\n};\nfunction replayDocument(initialState, operations, reducer, header, dispatch, skipHeaderOperations = {}, options) {\n\tconst { checkHashes = true, reuseOperationResultingState, operationResultingStateParser = parseResultingState, skipIndexValidation } = options || {};\n\tlet documentState = initialState;\n\tconst operationsToReplay = [];\n\tconst allScopes = new Set([\n\t\t...Object.keys(operations),\n\t\t\"global\",\n\t\t\"local\"\n\t]);\n\tconst initialOperations = {};\n\tfor (const scope of allScopes) initialOperations[scope] = [];\n\tif (reuseOperationResultingState) for (const [scope, scopeOperations] of Object.entries(operations)) {\n\t\tif (!scopeOperations) continue;\n\t\tconst index = scopeOperations.findLastIndex((s) => !!s.resultingState);\n\t\tif (index < 0) {\n\t\t\toperationsToReplay.push(...scopeOperations);\n\t\t\tcontinue;\n\t\t}\n\t\tconst opWithState = scopeOperations[index];\n\t\tif (!opWithState || !opWithState.resultingState) continue;\n\t\ttry {\n\t\t\tconst scopeState = operationResultingStateParser(opWithState.resultingState);\n\t\t\tdocumentState = {\n\t\t\t\t...documentState,\n\t\t\t\t[scope]: scopeState\n\t\t\t};\n\t\t\tconst scopeInitialOps = initialOperations[scope];\n\t\t\tif (scopeInitialOps) scopeInitialOps.push(...scopeOperations.slice(0, index + 1));\n\t\t\toperationsToReplay.push(...scopeOperations.slice(index + 1));\n\t\t} catch {\n\t\t\toperationsToReplay.push(...scopeOperations);\n\t\t}\n\t}\n\telse operationsToReplay.push(...Object.values(operations).flatMap((ops) => ops || []));\n\tconst document = {\n\t\theader,\n\t\tstate: defaultCreateState(documentState),\n\t\tinitialState,\n\t\toperations: initialOperations,\n\t\tclipboard: []\n\t};\n\tlet result = document;\n\tif (operationsToReplay.length) result = operationsToReplay.reduce((document, operation) => {\n\t\treturn reducer(document, operation.action, dispatch, {\n\t\t\tignoreSkipOperations: true,\n\t\t\tcheckHashes,\n\t\t\tskipIndexValidation,\n\t\t\treplayOptions: { operation }\n\t\t});\n\t}, document);\n\telse for (const scopeOperations of Object.values(initialOperations)) {\n\t\tif (!scopeOperations) continue;\n\t\tconst lastOperation = scopeOperations.at(-1);\n\t\tif (lastOperation) result = updateHeaderRevision(result, lastOperation.action.scope, lastOperation.timestampUtcMs);\n\t}\n\tif (!checkHashes) for (const scope of Object.keys(result.state)) for (let i = operationsToReplay.length - 1; i >= 0; i--) {\n\t\tconst operation = operationsToReplay[i];\n\t\tif (operation.action.scope !== scope) continue;\n\t\tif (operation.hash !== hashDocumentStateForScope(result, scope)) throw new HashMismatchError(scope, result, operation);\n\t\telse break;\n\t}\n\tconst allResultScopes = new Set([\n\t\t...Object.keys(result.operations),\n\t\t...Object.keys(operations),\n\t\t\"global\",\n\t\t\"local\"\n\t]);\n\tconst initialResultOperations = {};\n\tfor (const scope of allResultScopes) initialResultOperations[scope] = [];\n\tconst resultOperations = Array.from(allResultScopes).reduce((acc, scope) => {\n\t\tconst scopeOps = result.operations[scope] || [];\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[scope]: [...scopeOps.map((operation, index) => {\n\t\t\t\treturn {\n\t\t\t\t\t...operation,\n\t\t\t\t\ttimestamp: operations[scope]?.[index]?.timestampUtcMs ?? operation.timestampUtcMs\n\t\t\t\t};\n\t\t\t})]\n\t\t};\n\t}, initialResultOperations);\n\tconst lastModified = header ? header.lastModifiedAtUtcIso : Object.values(resultOperations).reduce((acc, curr) => {\n\t\tif (!curr) return acc;\n\t\tconst operation = curr.at(-1);\n\t\tif (operation) {\n\t\t\tif (operation.timestampUtcMs > acc) return operation.timestampUtcMs;\n\t\t}\n\t\treturn acc;\n\t}, document.header.lastModifiedAtUtcIso);\n\tif (header) result.header = {\n\t\t...header,\n\t\trevision: result.header.revision,\n\t\tlastModifiedAtUtcIso: lastModified\n\t};\n\treturn {\n\t\t...result,\n\t\toperations: resultOperations\n\t};\n}\nfunction parseResultingState(state) {\n\tconst stateType = typeof state;\n\tif (stateType === \"string\") return JSON.parse(state);\n\telse if (stateType === \"object\") return state;\n\telse throw new Error(`Providing resulting state is of type: ${stateType}`);\n}\nlet IntegrityIssueType = /* @__PURE__ */ function(IntegrityIssueType) {\n\tIntegrityIssueType[\"UNEXPECTED_INDEX\"] = \"UNEXPECTED_INDEX\";\n\treturn IntegrityIssueType;\n}({});\nlet IntegrityIssueSubType = /* @__PURE__ */ function(IntegrityIssueSubType) {\n\tIntegrityIssueSubType[\"DUPLICATED_INDEX\"] = \"DUPLICATED_INDEX\";\n\tIntegrityIssueSubType[\"MISSING_INDEX\"] = \"MISSING_INDEX\";\n\treturn IntegrityIssueSubType;\n}({});\nfunction checkCleanedOperationsIntegrity(sortedOperations) {\n\tconst result = [];\n\tlet currentIndex = -1;\n\tfor (const nextOperation of sortedOperations) {\n\t\tconst nextIndex = nextOperation.index - nextOperation.skip;\n\t\tif (nextIndex !== currentIndex + 1) result.push({\n\t\t\toperation: {\n\t\t\t\tindex: nextOperation.index,\n\t\t\t\tskip: nextOperation.skip\n\t\t\t},\n\t\t\tissue: IntegrityIssueType.UNEXPECTED_INDEX,\n\t\t\tcategory: nextIndex > currentIndex + 1 ? IntegrityIssueSubType.MISSING_INDEX : IntegrityIssueSubType.DUPLICATED_INDEX,\n\t\t\tmessage: `Expected index ${currentIndex + 1} with skip 0 or equivalent, got index ${nextOperation.index} with skip ${nextOperation.skip}`\n\t\t});\n\t\tcurrentIndex = nextOperation.index;\n\t}\n\treturn result;\n}\nfunction garbageCollect(sortedOperations) {\n\tconst result = [];\n\tlet i = sortedOperations.length - 1;\n\twhile (i > -1) {\n\t\tresult.unshift(sortedOperations[i]);\n\t\tconst skipUntil = (sortedOperations[i]?.index || 0) - (sortedOperations[i]?.skip || 0) - 1;\n\t\tlet j = i - 1;\n\t\twhile (j > -1 && (sortedOperations[j]?.index || 0) > skipUntil) j--;\n\t\ti = j;\n\t}\n\treturn result;\n}\nfunction addUndo(sortedOperations) {\n\tconst operationsCopy = [...sortedOperations];\n\tconst latestOperation = operationsCopy[operationsCopy.length - 1];\n\tif (!latestOperation) return operationsCopy;\n\tif (latestOperation.action.type === \"NOOP\") operationsCopy.push({\n\t\t...latestOperation,\n\t\tindex: latestOperation.index,\n\t\tskip: nextSkipNumber(sortedOperations),\n\t\taction: {\n\t\t\t...latestOperation.action,\n\t\t\tid: generateId(),\n\t\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\ttype: \"NOOP\"\n\t\t}\n\t});\n\telse operationsCopy.push({\n\t\tid: generateId(),\n\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\tindex: latestOperation.index + 1,\n\t\tskip: 1,\n\t\thash: latestOperation.hash,\n\t\taction: {\n\t\t\tid: generateId(),\n\t\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\ttype: \"NOOP\",\n\t\t\tinput: {},\n\t\t\tscope: latestOperation.action.scope\n\t\t}\n\t});\n\treturn operationsCopy;\n}\nfunction sortOperations(operations) {\n\treturn operations.slice().sort((a, b) => a.skip - b.skip).sort((a, b) => a.index - b.index);\n}\nfunction reshuffleByTimestamp(startIndex, opsA, opsB) {\n\treturn [...opsA, ...opsB].sort((a, b) => {\n\t\tconst timestampDiff = new Date(a.timestampUtcMs || \"\").getTime() - new Date(b.timestampUtcMs || \"\").getTime();\n\t\tif (timestampDiff !== 0) return timestampDiff;\n\t\treturn (a.id || \"\").localeCompare(b.id || \"\");\n\t}).map((op, i) => ({\n\t\t...op,\n\t\tindex: startIndex.index + i,\n\t\tskip: i === 0 ? startIndex.skip : 0\n\t}));\n}\nfunction reshuffleByTimestampAndIndex(startIndex, opsA, opsB) {\n\treturn [...opsA, ...opsB].sort((a, b) => {\n\t\tconst indexDiff = a.index - b.index;\n\t\tif (indexDiff !== 0) return indexDiff;\n\t\tconst timestampDiff = new Date(a.timestampUtcMs || \"\").getTime() - new Date(b.timestampUtcMs || \"\").getTime();\n\t\tif (timestampDiff !== 0) return timestampDiff;\n\t\treturn (a.id || \"\").localeCompare(b.id || \"\");\n\t}).map((op, i) => ({\n\t\t...op,\n\t\tindex: startIndex.index + i,\n\t\tskip: i === 0 ? startIndex.skip : 0\n\t}));\n}\nfunction operationsAreEqual(op1, op2) {\n\tconst a = op1;\n\tconst b = op2;\n\tconst aComparable = {\n\t\tindex: a.index,\n\t\tskip: a.skip,\n\t\ttype: a.type ?? null,\n\t\tscope: a.scope ?? null,\n\t\tinput: a.input ?? null\n\t};\n\tconst bComparable = {\n\t\tindex: b.index,\n\t\tskip: b.skip,\n\t\ttype: b.type ?? null,\n\t\tscope: b.scope ?? null,\n\t\tinput: b.input ?? null\n\t};\n\treturn stringify(aComparable) === stringify(bComparable);\n}\nfunction attachBranch(trunk, newBranch) {\n\tconst trunkCopy = garbageCollect(sortOperations(trunk.slice()));\n\tconst newOperations = garbageCollect(sortOperations(newBranch.slice()));\n\tif (trunkCopy.length < 1) return [newOperations, []];\n\tconst result = [];\n\tlet enteredBranch = false;\n\twhile (newOperations.length > 0) {\n\t\tconst newOperationCandidate = newOperations[0];\n\t\tlet nextTrunkOperation = trunkCopy.shift();\n\t\twhile (nextTrunkOperation && precedes(nextTrunkOperation, newOperationCandidate)) {\n\t\t\tresult.push(nextTrunkOperation);\n\t\t\tnextTrunkOperation = trunkCopy.shift();\n\t\t}\n\t\tif (!nextTrunkOperation) enteredBranch = true;\n\t\telse if (!enteredBranch) if (operationsAreEqual(nextTrunkOperation, newOperationCandidate)) {\n\t\t\tnewOperations.shift();\n\t\t\tresult.push(nextTrunkOperation);\n\t\t} else {\n\t\t\ttrunkCopy.unshift(nextTrunkOperation);\n\t\t\tenteredBranch = true;\n\t\t}\n\t\tif (enteredBranch) {\n\t\t\tlet nextAppend = newOperations.shift();\n\t\t\twhile (nextAppend) {\n\t\t\t\tresult.push(nextAppend);\n\t\t\t\tnextAppend = newOperations.shift();\n\t\t\t}\n\t\t}\n\t}\n\tif (!enteredBranch) {\n\t\tlet nextAppend = trunkCopy.shift();\n\t\twhile (nextAppend) {\n\t\t\tresult.push(nextAppend);\n\t\t\tnextAppend = trunkCopy.shift();\n\t\t}\n\t}\n\treturn [garbageCollect(result), trunkCopy];\n}\nfunction precedes(op1, op2) {\n\treturn op1.index < op2.index || op1.index === op2.index && op1.id === op2.id && op1.skip < op2.skip;\n}\nfunction split(sortedTargetOperations, sortedMergeOperations) {\n\tconst commonOperations = [];\n\tconst targetDiffOperations = [];\n\tconst mergeDiffOperations = [];\n\tconst maxLength = Math.max(sortedTargetOperations.length, sortedMergeOperations.length);\n\tlet splitHappened = false;\n\tfor (let i = 0; i < maxLength; i++) {\n\t\tconst targetOperation = sortedTargetOperations[i];\n\t\tconst mergeOperation = sortedMergeOperations[i];\n\t\tif (targetOperation && mergeOperation) if (!splitHappened && operationsAreEqual(targetOperation, mergeOperation)) commonOperations.push(targetOperation);\n\t\telse {\n\t\t\tsplitHappened = true;\n\t\t\ttargetDiffOperations.push(targetOperation);\n\t\t\tmergeDiffOperations.push(mergeOperation);\n\t\t}\n\t\telse if (targetOperation) targetDiffOperations.push(targetOperation);\n\t\telse if (mergeOperation) mergeDiffOperations.push(mergeOperation);\n\t}\n\treturn [\n\t\tcommonOperations,\n\t\ttargetDiffOperations,\n\t\tmergeDiffOperations\n\t];\n}\nfunction merge(sortedTargetOperations, sortedMergeOperations, reshuffle) {\n\tconst [_commonOperations, _targetOperations, _mergeOperations] = split(garbageCollect(sortedTargetOperations), garbageCollect(sortedMergeOperations));\n\tconst maxCommonIndex = getMaxIndex(_commonOperations);\n\tconst nextIndex = 1 + Math.max(maxCommonIndex, getMaxIndex(_targetOperations), getMaxIndex(_mergeOperations));\n\tconst filteredMergeOperations = filterDuplicatedOperations(_mergeOperations, _targetOperations);\n\tconst newOperationHistory = reshuffle({\n\t\tindex: nextIndex,\n\t\tskip: nextIndex - (maxCommonIndex + 1)\n\t}, _targetOperations, filteredMergeOperations);\n\treturn _commonOperations.concat(newOperationHistory);\n}\nfunction getMaxIndex(sortedOperations) {\n\tconst lastElement = sortedOperations[sortedOperations.length - 1];\n\tif (!lastElement) return -1;\n\treturn lastElement.index;\n}\nfunction nextSkipNumber(sortedOperations) {\n\tif (sortedOperations.length < 1) return -1;\n\tconst cleanedOperations = garbageCollect(sortedOperations);\n\tlet nextSkip = (cleanedOperations[cleanedOperations.length - 1]?.skip || 0) + 1;\n\tif (cleanedOperations.length > 1) nextSkip += cleanedOperations[cleanedOperations.length - 2]?.skip || 0;\n\treturn (cleanedOperations[cleanedOperations.length - 1]?.index || -1) < nextSkip ? -1 : nextSkip;\n}\nfunction checkOperationsIntegrity(operations) {\n\treturn checkCleanedOperationsIntegrity(garbageCollect(sortOperations(operations)));\n}\nfunction groupOperationsByScope(operations) {\n\treturn operations.reduce((acc, operation) => {\n\t\tif (!acc[operation.action.scope]) acc[operation.action.scope] = [];\n\t\tacc[operation.action.scope]?.push(operation);\n\t\treturn acc;\n\t}, {});\n}\nfunction prepareOperations(operationsHistory, newOperations) {\n\tconst result = {\n\t\tintegrityIssues: [],\n\t\tvalidOperations: [],\n\t\tinvalidOperations: [],\n\t\tduplicatedOperations: []\n\t};\n\tconst sortedOperationsHistory = sortOperations(operationsHistory);\n\tconst sortedOperations = sortOperations(newOperations);\n\tconst integrityErrors = checkCleanedOperationsIntegrity([...sortedOperationsHistory, ...sortedOperations]);\n\tconst firstMissingIndexOperation = [...integrityErrors.filter((integrityIssue) => integrityIssue.category === IntegrityIssueSubType.MISSING_INDEX)].sort((a, b) => b.operation.index - a.operation.index).pop()?.operation;\n\tfor (const newOperation of sortedOperations) {\n\t\tif (firstMissingIndexOperation && newOperation.index >= firstMissingIndexOperation.index) {\n\t\t\tresult.invalidOperations.push(newOperation);\n\t\t\tcontinue;\n\t\t}\n\t\tif (integrityErrors.some((integrityError) => {\n\t\t\treturn integrityError.operation.index === newOperation.index && integrityError.operation.skip === newOperation.skip && integrityError.category === IntegrityIssueSubType.DUPLICATED_INDEX;\n\t\t})) {\n\t\t\tresult.duplicatedOperations.push(newOperation);\n\t\t\tcontinue;\n\t\t}\n\t\tresult.validOperations.push(newOperation);\n\t}\n\tresult.integrityIssues.push(...integrityErrors);\n\treturn result;\n}\nfunction removeExistingOperations(newOperations, operationsHistory) {\n\treturn newOperations.filter((newOperation) => {\n\t\treturn !operationsHistory.some((historyOperation) => {\n\t\t\treturn newOperation.action.type === \"NOOP\" && newOperation.skip === 0 && newOperation.index === historyOperation.index || newOperation.index === historyOperation.index && newOperation.skip === historyOperation.skip && newOperation.action.scope === historyOperation.action.scope && newOperation.hash === historyOperation.hash && newOperation.action.type === historyOperation.action.type;\n\t\t});\n\t});\n}\n/**\n* Skips header operations and returns the remaining operations.\n*\n* @param operations - The array of operations.\n* @param skipHeaderOperation - The skip header operation index.\n* @returns The remaining operations after skipping header operations.\n*/\nfunction skipHeaderOperations(operations, skipHeaderOperation) {\n\tconst lastIndex = sortOperations(operations).at(-1)?.index ?? -1;\n\tconst nextIndex = lastIndex + 1;\n\tconst skipOperationIndex = {\n\t\t...skipHeaderOperation,\n\t\tindex: skipHeaderOperation.index ?? nextIndex\n\t};\n\tif (skipOperationIndex.index < lastIndex) throw new Error(`The skip header operation index must be greater than or equal to ${lastIndex}`);\n\treturn garbageCollect(sortOperations([...operations, skipOperationIndex])).slice(0, -1);\n}\nfunction garbageCollectDocumentOperations(documentOperations) {\n\treturn Object.entries(documentOperations).reduce((acc, entry) => {\n\t\tconst [scope, ops] = entry;\n\t\tif (!ops) return acc;\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[scope]: garbageCollect(sortOperations(ops))\n\t\t};\n\t}, {});\n}\n/**\n* Filters out duplicated operations from the target operations array based on their IDs.\n* If an operation has an ID, it is considered duplicated if there is another operation in the source operations array with the same ID.\n* If an operation does not have an ID, it is considered unique and will not be filtered out.\n* @param targetOperations - The array of target operations to filter.\n* @param sourceOperations - The array of source operations to compare against.\n* @returns An array of operations with duplicates filtered out.\n*/\nfunction filterDuplicatedOperations(targetOperations, sourceOperations) {\n\treturn targetOperations.filter((op) => {\n\t\tif (op.id) return !sourceOperations.some((targetOp) => targetOp.id === op.id);\n\t\treturn true;\n\t});\n}\nfunction filterDocumentOperationsResultingState(documentOperations) {\n\tif (!documentOperations) return {};\n\treturn Object.entries(documentOperations).reduce((acc, [scope, operations]) => {\n\t\tif (!operations) return acc;\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[scope]: operations.map((op) => {\n\t\t\t\tconst { resultingState, ...restProps } = op;\n\t\t\t\treturn restProps;\n\t\t\t})\n\t\t};\n\t}, {});\n}\n/**\n* Calculates the difference between two arrays of operations.\n* Returns an array of operations that are present in `clearedOperationsA` but not in `clearedOperationsB`.\n*\n* @template TOp - The type of the operations.\n* @param {TOp[]} clearedOperationsA - The first array of operations.\n* @param {TOp[]} clearedOperationsB - The second array of operations.\n* @returns {TOp[]} - The difference between the two arrays of operations.\n*/\nfunction diffOperations(clearedOperationsA, clearedOperationsB) {\n\treturn clearedOperationsA.filter((operationA) => !clearedOperationsB.some((operationB) => operationA.index === operationB.index));\n}\nfunction getDocumentLastModified(document) {\n\tlet latest;\n\tfor (const ops of Object.values(document.operations)) {\n\t\tif (!ops) continue;\n\t\tfor (const op of ops) if (!latest || op.index > latest.index || op.index === latest.index && op.skip > latest.skip) latest = op;\n\t}\n\treturn latest?.timestampUtcMs || document.header.lastModifiedAtUtcIso;\n}\n/**\n* Gets the next revision number based on the provided scope.\n*\n* @param state The current state of the document.\n* @param scope The scope of the operation.\n* @returns The next revision number.\n*/\nfunction getNextRevision(document, scope) {\n\treturn (document.operations[scope]?.at(-1)?.index ?? -1) + 1;\n}\n/**\n* Updates the document header with the latest revision number and\n* date of last modification.\n*\n* @param document The current state of the document.\n* @param scope The scope of the operation.\n* @param lastModifiedTimestamp Optional timestamp to use directly, avoiding a scan of all operations.\n* @returns The updated document state.\n*/\nfunction updateHeaderRevision(document, scope, lastModifiedTimestamp) {\n\tconst newTimestamp = lastModifiedTimestamp ?? getDocumentLastModified(document);\n\tconst currentTimestamp = document.header.lastModifiedAtUtcIso;\n\tconst header = {\n\t\t...document.header,\n\t\trevision: {\n\t\t\t...document.header.revision,\n\t\t\t[scope]: getNextRevision(document, scope)\n\t\t},\n\t\tlastModifiedAtUtcIso: !currentTimestamp || newTimestamp > currentTimestamp ? newTimestamp : currentTimestamp\n\t};\n\treturn {\n\t\t...document,\n\t\theader\n\t};\n}\n//#endregion\n//#region document-model/operations.ts\nfunction setNameOperation(document, input) {\n\treturn {\n\t\t...document,\n\t\theader: {\n\t\t\t...document.header,\n\t\t\tname: input.name\n\t\t}\n\t};\n}\nfunction setPreferredEditorOperation(document, input) {\n\tconst existingMeta = document.header.meta ?? {};\n\tif (input.preferredEditor) return {\n\t\t...document,\n\t\theader: {\n\t\t\t...document.header,\n\t\t\tmeta: {\n\t\t\t\t...existingMeta,\n\t\t\t\tpreferredEditor: input.preferredEditor\n\t\t\t}\n\t\t}\n\t};\n\tconst { preferredEditor: _removed, ...rest } = existingMeta;\n\treturn {\n\t\t...document,\n\t\theader: {\n\t\t\t...document.header,\n\t\t\tmeta: rest\n\t\t}\n\t};\n}\nfunction undoOperation(document, action, skip) {\n\tconst { scope } = action;\n\treturn create({\n\t\tdocument,\n\t\taction,\n\t\tskip,\n\t\treuseLastOperationIndex: false\n\t}, (draft) => {\n\t\tconst sortedOperations = sortOperations([...document.operations[scope]]);\n\t\tdraft.action = noop(scope);\n\t\tconst lastOperation = sortedOperations.at(-1);\n\t\tlet nextIndex = lastOperation?.index ?? -1;\n\t\tconst isNewNoop = lastOperation?.action.type !== \"NOOP\";\n\t\tif (isNewNoop) nextIndex = nextIndex + 1;\n\t\telse draft.reuseLastOperationIndex = true;\n\t\tdraft.skip = nextSkipNumber(isNewNoop ? [...sortedOperations, {\n\t\t\tindex: nextIndex,\n\t\t\tskip: 0\n\t\t}] : sortedOperations);\n\t\tif (lastOperation && draft.skip > lastOperation.skip + 1) draft.skip = draft.skip + 1;\n\t\tif (draft.skip < 0) throw new Error(`Cannot undo: you can't undo more operations than the ones in the scope history`);\n\t});\n}\n/**\n* V2 of undoOperation for protocol version 2+.\n* Key differences from undoOperation:\n* - Never reuses operation index (always increments)\n* - Always sets skip=1 (consecutive NOOPs are handled during rebuild/GC)\n* - No complex skip calculation - simpler model where each UNDO is independent\n*/\nfunction undoOperationV2(document, action, skip) {\n\tconst { scope } = action;\n\treturn create({\n\t\tdocument,\n\t\taction,\n\t\tskip,\n\t\treuseLastOperationIndex: false\n\t}, (draft) => {\n\t\tconst sortedOperations = sortOperations([...document.operations[scope] || []]);\n\t\tconst nonNoopOps = sortedOperations.filter((op) => op.action.type !== \"NOOP\");\n\t\tlet noopChainLength = 0;\n\t\tfor (let i = sortedOperations.length - 1; i >= 0; i--) if (sortedOperations[i].action.type === \"NOOP\") noopChainLength++;\n\t\telse break;\n\t\tif (nonNoopOps.length <= noopChainLength) throw new Error(`Cannot undo: no more operations to undo in scope history`);\n\t\tdraft.action = noop(scope);\n\t\tdraft.skip = 1;\n\t});\n}\nfunction redoOperation(document, action, skip) {\n\tconst { scope, input } = action;\n\treturn create({\n\t\tdocument,\n\t\taction,\n\t\tskip,\n\t\treuseLastOperationIndex: false\n\t}, (draft) => {\n\t\tif (draft.skip > 0) throw new Error(`Cannot redo: skip value from reducer cannot be used with REDO action`);\n\t\tconst count = typeof input === \"object\" && input !== null && \"count\" in input ? input.count : input;\n\t\tif (typeof count !== \"number\" || count > 1) throw new Error(`Cannot redo: you can only redo one operation at a time`);\n\t\tif (typeof count !== \"number\" || count < 1) throw new Error(`Invalid REDO action: invalid redo input value`);\n\t\tif (draft.document.clipboard.length < 1) throw new Error(`Cannot redo: no operations in the clipboard`);\n\t\tconst operationIndex = draft.document.clipboard.findLastIndex((op) => op.action.scope === scope);\n\t\tif (operationIndex < 0) throw new Error(`Cannot redo: no operations in clipboard for scope \"${scope}\"`);\n\t\tconst operation = draft.document.clipboard.splice(operationIndex, 1)[0];\n\t\tdraft.action = castDraft({\n\t\t\ttype: operation.action.type,\n\t\t\tscope: operation.action.scope,\n\t\t\tinput: operation.action.input\n\t\t});\n\t});\n}\nfunction loadStateOperation(document, action) {\n\treturn {\n\t\t...document,\n\t\theader: {\n\t\t\t...document.header,\n\t\t\tname: action.state.name\n\t\t},\n\t\tstate: action.state.data\n\t};\n}\n//#endregion\n//#region document-model/reducer.ts\nfunction replayOperations(initialState, clearedOperations, stateReducer, header, dispatch, documentReducer = baseReducer, skipHeaderOperations = {}, options) {\n\treturn replayDocument(initialState, clearedOperations, createReducer(stateReducer, documentReducer), header, dispatch, skipHeaderOperations, options);\n}\n/**\n* Updates the operations history of the document based on the provided action.\n*\n* @param state The current state of the document.\n* @param action The action being applied to the document.\n* @param index The index of the operation to update.\n* @param skip The number of operations to skip before applying the action.\n* @param reuseLastOperationIndex Whether to reuse the last operation index (used when a an UNDO operation is performed after an existing one).\n* @param context The operation context for deterministic ID generation.\n* @returns The updated document state.\n*/\nfunction updateOperationsForAction(document, action, reuseLastOperationIndex, skip, context) {\n\tif ([\n\t\t\"UNDO\",\n\t\t\"REDO\",\n\t\t\"PRUNE\"\n\t].includes(action.type)) return document;\n\tconst scope = action.scope;\n\tconst existing = document.operations[scope];\n\tconst lastOperationIndex = existing?.at(-1)?.index ?? -1;\n\tconst newOperation = operationFromAction(action, reuseLastOperationIndex ? lastOperationIndex : lastOperationIndex + 1, skip, context);\n\tconst operations = [...existing ?? [], newOperation];\n\treturn {\n\t\t...document,\n\t\toperations: {\n\t\t\t...document.operations,\n\t\t\t[scope]: operations\n\t\t}\n\t};\n}\nfunction updateOperationsForOperation(document, operation, reuseLastOperationIndex, skip, context, skipIndexValidation) {\n\tconst scope = operation.action.scope;\n\tconst existing = document.operations[scope];\n\tconst lastOperationIndex = existing?.at(-1)?.index ?? -1;\n\tconst nextIndex = reuseLastOperationIndex ? lastOperationIndex : lastOperationIndex + 1;\n\tif (!skipIndexValidation && operation.index - skip > nextIndex) throw new Error(`Missing operations: expected ${nextIndex} with skip 0 or equivalent, got index ${operation.index} with skip ${skip}`);\n\tconst newOperation = operationFromOperation(operation, operation.index, skip, context);\n\tconst operations = [...existing ?? [], newOperation];\n\treturn {\n\t\t...document,\n\t\toperations: {\n\t\t\t...document.operations,\n\t\t\t[scope]: operations\n\t\t}\n\t};\n}\n/**\n* Updates the document state based on the provided action.\n*\n* @param state The current state of the document.\n* @param action The action being applied to the document.\n* @param skip The number of operations to skip before applying the action.\n* @param reuseLastOperationIndex Whether to reuse the last operation index (used when a an UNDO operation is performed after an existing one).\n* @param context The operation context for deterministic ID generation.\n* @returns The updated document state.\n*/\nfunction updateDocument(document, action, reuseLastOperationIndex, skip, context, operation, skipIndexValidation) {\n\tlet newDocument;\n\tif (operation) newDocument = updateOperationsForOperation(document, operation, reuseLastOperationIndex, skip, context, skipIndexValidation);\n\telse newDocument = updateOperationsForAction(document, action, reuseLastOperationIndex, skip, context);\n\tnewDocument = updateHeaderRevision(newDocument, action.scope, action.timestampUtcMs);\n\treturn newDocument;\n}\n/**\n* The base document reducer function that wraps a custom reducer function.\n*\n* @param state The current state of the document.\n* @param action The action being applied to the document.\n* @param wrappedReducer The custom reducer function being wrapped by the base reducer.\n* @returns The updated document state.\n*/\nfunction _baseReducer(document, action, wrappedReducer) {\n\tconst parsedAction = DocumentActionSchema().parse(action);\n\tswitch (parsedAction.type) {\n\t\tcase \"SET_NAME\": return setNameOperation(document, parsedAction.input);\n\t\tcase \"SET_PREFERRED_EDITOR\": return setPreferredEditorOperation(document, parsedAction.input);\n\t\tcase \"PRUNE\": return pruneOperation(document, parsedAction.input, wrappedReducer);\n\t\tcase \"LOAD_STATE\": return loadStateOperation(document, parsedAction.input);\n\t\tdefault: return document;\n\t}\n}\n/**\n* Processes an UNDO or REDO action.\n*\n* @param document The current state of the document.\n* @param action The action being applied to the document.\n* @param skip The number of operations to skip before applying the action.\n* @returns The updated document, calculated skip value and transformed action (if applied).\n*/\nfunction processUndoRedo(document, action, skip, protocolVersion = 1) {\n\tswitch (action.type) {\n\t\tcase \"UNDO\":\n\t\t\tif (protocolVersion >= 2) return undoOperationV2(document, action, skip);\n\t\t\treturn undoOperation(document, action, skip);\n\t\tcase \"REDO\": return redoOperation(document, action, skip);\n\t\tdefault: return {\n\t\t\tdocument,\n\t\t\taction,\n\t\t\tskip,\n\t\t\treuseLastOperationIndex: false\n\t\t};\n\t}\n}\nfunction processSkipOperation(document, action, customReducer, skipValue, reuseOperationResultingState = false, resultingStateParser = parseResultingState) {\n\tconst scope = action.scope;\n\tconst scopeOperations = document.operations[scope];\n\tif (!scopeOperations) return document;\n\tconst latestOperation = scopeOperations.at(-1);\n\tif (!latestOperation) return document;\n\tconst documentOperations = garbageCollectDocumentOperations({\n\t\t...document.operations,\n\t\t[scope]: skipHeaderOperations(scopeOperations, latestOperation)\n\t});\n\tlet scopeState = void 0;\n\tconst lastRemainingOperation = documentOperations[scope]?.at(-1);\n\tif (reuseOperationResultingState && lastRemainingOperation?.resultingState) scopeState = resultingStateParser(lastRemainingOperation.resultingState);\n\telse {\n\t\tconst { state } = replayOperations(document.initialState, documentOperations, customReducer, document.header, void 0, void 0, void 0, {\n\t\t\treuseOperationResultingState,\n\t\t\toperationResultingStateParser: resultingStateParser,\n\t\t\tskipIndexValidation: true\n\t\t});\n\t\tscopeState = state[scope];\n\t}\n\treturn {\n\t\t...document,\n\t\tstate: {\n\t\t\t...document.state,\n\t\t\t[scope]: scopeState\n\t\t},\n\t\toperations: garbageCollectDocumentOperations({ ...document.operations })\n\t};\n}\nfunction processUndoOperation(document, scope, customReducer, reuseOperationResultingState = false, resultingStateParser = parseResultingState) {\n\tconst scopeOperations = document.operations[scope];\n\tif (!scopeOperations) return document;\n\tconst sortedOperations = sortOperations([...scopeOperations]);\n\tsortedOperations.pop();\n\tconst documentOperations = garbageCollectDocumentOperations({ ...document.operations });\n\tconst documentScopeOps = documentOperations[scope];\n\tif (!documentScopeOps) return document;\n\tconst clearedOperations = [...documentScopeOps];\n\tconst diff = diffOperations(garbageCollect(sortedOperations), clearedOperations);\n\tconst doc = replayOperations(document.initialState, documentOperations, customReducer, document.header, void 0, void 0, void 0, {\n\t\treuseOperationResultingState,\n\t\toperationResultingStateParser: resultingStateParser\n\t});\n\tconst clipboard = sortOperations([...document.clipboard, ...diff].filter((op) => op.action.type !== \"NOOP\")).reverse();\n\treturn {\n\t\t...doc,\n\t\tclipboard\n\t};\n}\n/**\n* Base document reducer that wraps a custom document reducer and handles\n* document-level actions such as undo, redo, prune, and set name.\n*\n* @template TGlobalState - The type of the state of the custom reducer.\n* @template TAction - The type of the actions of the custom reducer.\n* @param state - The current state of the document.\n* @param action - The action object to apply to the state.\n* @param customReducer - The custom reducer that implements the application logic\n* specific to the document's state.\n* @returns The new state of the document.\n*/\nfunction baseReducer(document, action, customReducer, dispatch, options = {}) {\n\tconst { skip, ignoreSkipOperations = false, reuseOperationResultingState = false, operationResultingStateParser, pruneOnSkip = true, branch = \"main\" } = options;\n\tlet _action = actionFromAction(action);\n\tlet skipValue = skip ?? options.replayOptions?.operation.skip ?? 0;\n\tlet newDocument = { ...document };\n\tlet reuseLastOperationIndex = false;\n\tconst shouldProcessSkipOperation = !ignoreSkipOperations && skipValue > 0;\n\tif (isUndoRedo(_action)) {\n\t\tconst { skip: calculatedSkip, action: transformedAction, document: processedDocument, reuseLastOperationIndex: reuseIndex } = processUndoRedo(document, _action, skipValue, options.protocolVersion ?? 1);\n\t\t_action = transformedAction;\n\t\tskipValue = calculatedSkip;\n\t\tnewDocument = processedDocument;\n\t\treuseLastOperationIndex = reuseIndex;\n\t} else newDocument = {\n\t\t...newDocument,\n\t\tclipboard: []\n\t};\n\tif (isDocumentAction(_action)) newDocument = _baseReducer(newDocument, _action, customReducer);\n\tconst operationContext = {\n\t\tdocumentId: document.header.id,\n\t\tscope: _action.scope,\n\t\tbranch\n\t};\n\tnewDocument = updateDocument(newDocument, _action, reuseLastOperationIndex, skipValue, operationContext, options.replayOptions?.operation, options.skipIndexValidation);\n\tconst protocolVersion = options.protocolVersion ?? 1;\n\tif (isUndo(action) && protocolVersion < 2) return processUndoOperation(newDocument, action.scope, customReducer);\n\tconst isNoopWithSkip = _action.type === \"NOOP\" && skipValue > 0;\n\tif ((isUndo(action) || isNoopWithSkip) && protocolVersion >= 2) {\n\t\tconst scope = _action.scope;\n\t\tconst opsToReplay = garbageCollectV2(sortOperations([...newDocument.operations[scope] || []])).filter((op) => op.action.type !== \"NOOP\");\n\t\tconst replayOps = {\n\t\t\t...newDocument.operations,\n\t\t\t[scope]: opsToReplay\n\t\t};\n\t\treturn {\n\t\t\t...replayOperations(newDocument.initialState, replayOps, customReducer, newDocument.header, dispatch, baseReducer, {}, { skipIndexValidation: true }),\n\t\t\toperations: newDocument.operations,\n\t\t\tclipboard: []\n\t\t};\n\t}\n\tif (shouldProcessSkipOperation) {\n\t\tconst processed = processSkipOperation(newDocument, _action, customReducer, skipValue, reuseOperationResultingState, operationResultingStateParser);\n\t\tif (!pruneOnSkip) newDocument = {\n\t\t\t...processed,\n\t\t\toperations: newDocument.operations\n\t\t};\n\t\telse newDocument = processed;\n\t}\n\tnewDocument = create(newDocument, (draft) => {\n\t\ttry {\n\t\t\tconst newState = customReducer(draft.state, _action, dispatch);\n\t\t\tif (newState) unsafe(() => {\n\t\t\t\tdraft.state = castDraft(newState);\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst actionScopeOps = newDocument.operations[_action.scope];\n\t\t\tif (!actionScopeOps) throw new Error(`No operations found for scope: ${_action.scope}`, { cause: error });\n\t\t\tconst lastOperationIndex = actionScopeOps.length - 1;\n\t\t\tconst draftScopeOps = draft.operations[_action.scope];\n\t\t\tif (!draftScopeOps) throw new Error(`No operations found in draft for scope: ${_action.scope}`, { cause: error });\n\t\t\tdraftScopeOps[lastOperationIndex].error = error.message;\n\t\t\tdraftScopeOps[lastOperationIndex].skip = 0;\n\t\t\tif (shouldProcessSkipOperation) {\n\t\t\t\tdraft.state = castDraft({ ...document.state });\n\t\t\t\tconst documentScopeOps = document.operations[_action.scope];\n\t\t\t\tif (!documentScopeOps) throw new Error(`No operations found for scope: ${_action.scope}`, { cause: error });\n\t\t\t\tdraft.operations = castDraft({\n\t\t\t\t\t...document.operations,\n\t\t\t\t\t[_action.scope]: [...documentScopeOps, { ...draftScopeOps[lastOperationIndex] }]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n\tif ([\n\t\t\"UNDO\",\n\t\t\"REDO\",\n\t\t\"PRUNE\"\n\t].includes(_action.type)) return newDocument;\n\tconst scope = _action.scope || \"global\";\n\tlet hash = hashDocumentStateForScope(newDocument, scope);\n\tif (options.replayOptions?.operation.hash && options.replayOptions.operation.hash !== \"\") hash = options.replayOptions.operation.hash;\n\tconst lastOperation = newDocument.operations[scope]?.at(-1);\n\tif (lastOperation) {\n\t\tlastOperation.hash = hash;\n\t\tif (reuseOperationResultingState) lastOperation.resultingState = JSON.stringify(newDocument.state[scope]);\n\t}\n\treturn newDocument;\n}\n/**\n* Helper function to create a document model reducer.\n*\n* @remarks\n* This function creates a new reducer that wraps the provided `reducer` with\n* `documentReducer`, adding support for document actions:\n* - `SET_NAME`\n* - `UNDO`\n* - `REDO`\n* - `PRUNE`\n*\n* It also updates the document-related attributes on every operation.\n*\n* @param reducer - The custom reducer to wrap.\n* @param documentReducer - The document reducer to use.\n*\n* @returns The new reducer.\n*/\nfunction createReducer(stateReducer, documentReducer = baseReducer) {\n\tconst reducer = (document, action, dispatch, options) => {\n\t\treturn documentReducer(document, action, stateReducer, dispatch, options);\n\t};\n\treturn reducer;\n}\nfunction pruneOperation(document, input, wrappedReducer) {\n\tconst operations = document.operations.global;\n\tif (!operations) throw new Error(\"No global operations found\");\n\tlet { start, end } = input;\n\tstart = start || 0;\n\tend = end || operations.length;\n\tconst actionsToPrune = operations.slice(start, end);\n\tconst actionsToKeepStart = operations.slice(0, start);\n\tconst actionsToKeepEnd = operations.slice(end);\n\tconst newDocument = replayOperations(document.initialState, {\n\t\t...document.operations,\n\t\tglobal: actionsToKeepStart.concat(actionsToPrune)\n\t}, wrappedReducer, document.header);\n\tconst newState = newDocument.state;\n\tconst name = newDocument.header.name;\n\tconst loadStateIndex = actionsToKeepStart.length;\n\tconst loadStateTimestamp = actionsToKeepStart.length ? actionsToKeepStart[actionsToKeepStart.length - 1].timestampUtcMs : actionsToKeepEnd.length ? actionsToKeepEnd[0].timestampUtcMs : (/* @__PURE__ */ new Date()).toISOString();\n\tconst action = loadState({\n\t\tname,\n\t\t...newState\n\t}, actionsToPrune.length);\n\treturn replayOperations(document.initialState, {\n\t\t...document.operations,\n\t\tglobal: [\n\t\t\t...actionsToKeepStart,\n\t\t\t{\n\t\t\t\tskip: 0,\n\t\t\t\t...action,\n\t\t\t\taction,\n\t\t\t\ttimestampUtcMs: loadStateTimestamp,\n\t\t\t\tindex: loadStateIndex,\n\t\t\t\thash: hashDocumentStateForScope({ state: newState }, \"global\")\n\t\t\t},\n\t\t\t...actionsToKeepEnd.map((action, index) => ({\n\t\t\t\t...action,\n\t\t\t\tindex: loadStateIndex + index + 1\n\t\t\t}))\n\t\t]\n\t}, wrappedReducer, document.header);\n}\n//#endregion\n//#region document-model/validation.ts\n/**\n* Reserved operation names from base reducer (core/actions.ts).\n* These names cannot be used for custom operations.\n*/\nconst RESERVED_OPERATION_NAMES = [\n\t\"UNDO\",\n\t\"REDO\",\n\t\"PRUNE\",\n\t\"LOAD_STATE\",\n\t\"SET_NAME\",\n\t\"SET_PREFERRED_EDITOR\",\n\t\"NOOP\"\n];\n/**\n* Operation names become the literal action `type` string at runtime and the\n* key for codegen's action union. They must be SCREAMING_SNAKE_CASE so the\n* generated TypeScript is valid.\n*/\nconst OPERATION_NAME_PATTERN = /^[A-Z][A-Z0-9_]*$/;\nfunction isValidOperationNameFormat(name) {\n\treturn OPERATION_NAME_PATTERN.test(name);\n}\n/**\n* Check if name conflicts with base reducer actions (case-insensitive).\n*/\nfunction isReservedOperationName(name) {\n\treturn RESERVED_OPERATION_NAMES.includes(name.toUpperCase());\n}\n/**\n* Get all operation names from all modules in the latest specification.\n* Returns names in uppercase for case-insensitive comparison.\n*/\nfunction getAllOperationNames(state, excludeOperationId) {\n\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\tif (!latestSpec) return [];\n\tconst names = [];\n\tfor (const module of latestSpec.modules) for (const operation of module.operations) {\n\t\tif (excludeOperationId && operation.id === excludeOperationId) continue;\n\t\tif (operation.name) names.push(operation.name.toUpperCase());\n\t}\n\treturn names;\n}\n/**\n* Validate operation name is not reserved or duplicate. Throws on failure.\n*\n* @param name - The operation name to validate\n* @param state - The document model global state\n* @param excludeOperationId - Optional operation ID to exclude (for rename validation)\n* @throws Error if the name is reserved or a duplicate\n*/\nfunction validateOperationName(name, state, excludeOperationId) {\n\tif (!name) return;\n\tif (!isValidOperationNameFormat(name)) {\n\t\tconst suggestion = constantCase(name);\n\t\tconst hint = suggestion && suggestion !== name && isValidOperationNameFormat(suggestion) ? ` Did you mean \"${suggestion}\"?` : \"\";\n\t\tthrow new Error(`Operation name \"${name}\" is invalid. Names must be SCREAMING_SNAKE_CASE (matching ${OPERATION_NAME_PATTERN.source}).${hint}`);\n\t}\n\tconst upperName = name.toUpperCase();\n\tif (isReservedOperationName(name)) throw new Error(`Operation name \"${name}\" is reserved. Please use a different name.`);\n\tif (getAllOperationNames(state, excludeOperationId).includes(upperName)) throw new Error(`Operation name \"${name}\" is already used by another operation. Operation names must be unique across all modules.`);\n}\nfunction validateInitialState(initialState, allowEmptyState = false) {\n\tconst errors = [];\n\tif (allowEmptyState && initialState === \"\") return errors;\n\ttry {\n\t\tconst state = JSON.parse(initialState);\n\t\tif (!allowEmptyState && !Object.keys(state).length) errors.push({\n\t\t\tmessage: \"Initial state cannot be empty\",\n\t\t\tdetails: { initialState }\n\t\t});\n\t} catch {\n\t\terrors.push({\n\t\t\tmessage: \"Invalid initial state\",\n\t\t\tdetails: { initialState }\n\t\t});\n\t}\n\treturn errors;\n}\nfunction validateStateSchemaName(schema, documentName, scope = \"\", allowEmptySchema = true) {\n\tconst errors = [];\n\tif (!allowEmptySchema && !schema) {\n\t\terrors.push({\n\t\t\tmessage: \"State schema is required\",\n\t\t\tdetails: { schema }\n\t\t});\n\t\treturn errors;\n\t}\n\tif (allowEmptySchema && !schema) return errors;\n\tconst expectedTypeName = `${pascalCase(documentName)}${pascalCase(scope)}State`;\n\tif (!new RegExp(`\\\\btype\\\\s+${expectedTypeName}(?:\\\\s|\\\\{|@|$)`).test(schema)) errors.push({\n\t\tmessage: `Invalid state schema name. Expected type ${expectedTypeName}`,\n\t\tdetails: { schema }\n\t});\n\treturn errors;\n}\nfunction validateModules(modules) {\n\tconst errors = [];\n\tif (!modules.length) errors.push({\n\t\tmessage: \"Modules are required\",\n\t\tdetails: { modules }\n\t});\n\tconst modulesError = modules.reduce((acc, mod) => [...acc, ...validateModule(mod)], []);\n\treturn [...errors, ...modulesError];\n}\nfunction validateModule(mod) {\n\tconst errors = [];\n\tif (!mod.name) errors.push({\n\t\tmessage: \"Module name is required\",\n\t\tdetails: { module: mod }\n\t});\n\tif (!mod.operations.length) errors.push({\n\t\tmessage: \"Module operations are required\",\n\t\tdetails: { module: mod }\n\t});\n\tconst operationErrors = mod.operations.reduce((acc, operation) => [...acc, ...validateModuleOperation(operation)], []);\n\treturn [...errors, ...operationErrors];\n}\nfunction validateModuleOperation(operation) {\n\tconst errors = [];\n\tif (!operation.name) errors.push({\n\t\tmessage: \"Operation name is required\",\n\t\tdetails: { operation }\n\t});\n\tif (!operation.schema) errors.push({\n\t\tmessage: \"Operation schema is required\",\n\t\tdetails: { operation }\n\t});\n\treturn errors;\n}\n/**\n* Find a module in the latest specification by id, or throw. Reducers that\n* mutate-by-id should call this up front so an unknown id fails loudly\n* instead of silently no-opping.\n*/\nfunction findModuleOrThrow(state, moduleId) {\n\tconst mod = state.specifications[state.specifications.length - 1]?.modules.find((m) => m.id === moduleId);\n\tif (!mod) throw new Error(`Module \"${moduleId}\" not found in the latest specification`);\n\treturn mod;\n}\n/**\n* Find an operation in the latest specification by id, or throw. Same\n* rationale as findModuleOrThrow — reducers that target an operation must\n* fail loudly when the operation doesn't exist.\n*/\nfunction findOperationOrThrow(state, operationId) {\n\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\tif (latestSpec) for (const mod of latestSpec.modules) {\n\t\tconst op = mod.operations.find((o) => o.id === operationId);\n\t\tif (op) return op;\n\t}\n\tthrow new Error(`Operation \"${operationId}\" not found in the latest specification`);\n}\n/**\n* Find an operation error by id across all operations in the latest\n* specification, or throw. Throws on a duplicate id too: setters act on a\n* single error, so an ambiguous id must fail loudly rather than mutate an\n* arbitrary match.\n*/\nfunction findOperationErrorOrThrow(state, errorId) {\n\tconst matches = state.specifications[state.specifications.length - 1]?.modules.flatMap((mod) => mod.operations.flatMap((op) => op.errors.filter((e) => e.id === errorId))) ?? [];\n\tif (matches.length === 0) throw new Error(`Operation error \"${errorId}\" not found in the latest specification`);\n\tif (matches.length > 1) throw new Error(`Operation error \"${errorId}\" is duplicated in the latest specification`);\n\treturn matches[0];\n}\n/**\n* Find an operation example (code example) by id across all operations in the\n* latest specification, or throw. Throws on a duplicate id for the same reason\n* as findOperationErrorOrThrow.\n*/\nfunction findOperationExampleOrThrow(state, exampleId) {\n\tconst matches = state.specifications[state.specifications.length - 1]?.modules.flatMap((mod) => mod.operations.flatMap((op) => op.examples.filter((e) => e.id === exampleId))) ?? [];\n\tif (matches.length === 0) throw new Error(`Operation example \"${exampleId}\" not found in the latest specification`);\n\tif (matches.length > 1) throw new Error(`Operation example \"${exampleId}\" is duplicated in the latest specification`);\n\treturn matches[0];\n}\n/**\n* Assert no module in the latest specification already uses `id`. Modules are\n* targeted by id by the setter/delete/reorder reducers, so a duplicate id makes\n* those operations ambiguous.\n*/\nfunction assertModuleIdUnique(state, id) {\n\tif (state.specifications[state.specifications.length - 1]?.modules.some((m) => m.id === id)) throw new Error(`Module \"${id}\" already exists in the latest specification`);\n}\n/**\n* Assert no operation in the latest specification already uses `id`. Operations\n* are targeted by id across all modules, so the id must be unique document-wide.\n*/\nfunction assertOperationIdUnique(state, id) {\n\tif (state.specifications[state.specifications.length - 1]?.modules.some((m) => m.operations.some((o) => o.id === id))) throw new Error(`Operation \"${id}\" already exists in the latest specification`);\n}\n/**\n* Assert no operation error in the latest specification already uses `id`.\n* Error ids are targeted document-wide by the setter/delete reducers, so the id\n* must be unique to keep those operations unambiguous.\n*/\nfunction assertOperationErrorIdUnique(state, id) {\n\tif (state.specifications[state.specifications.length - 1]?.modules.some((m) => m.operations.some((o) => o.errors.some((e) => e.id === id)))) throw new Error(`Operation error \"${id}\" already exists in the latest specification`);\n}\n/**\n* Assert no operation example in the latest specification already uses `id`.\n* Example ids are targeted document-wide by the update/delete reducers, so the\n* id must be unique to keep those operations unambiguous.\n*/\nfunction assertOperationExampleIdUnique(state, id) {\n\tif (state.specifications[state.specifications.length - 1]?.modules.some((m) => m.operations.some((o) => o.examples.some((e) => e.id === id)))) throw new Error(`Operation example \"${id}\" already exists in the latest specification`);\n}\nfunction validateOperations(operations) {\n\tconst errors = [];\n\tconst scopes = Object.keys(operations);\n\tfor (const scope of scopes) {\n\t\tconst scopeOperations = operations[scope];\n\t\tif (!scopeOperations) continue;\n\t\tconst ops = scopeOperations.sort((a, b) => a.index - b.index);\n\t\tlet opIndex = -1;\n\t\tfor (let i = 0; i < ops.length; i++) {\n\t\t\topIndex = opIndex + 1 + ops[i].skip;\n\t\t\tif (ops[i].index !== opIndex) errors.push({\n\t\t\t\tmessage: `Invalid operation index ${ops[i].index} at position ${i}`,\n\t\t\t\tdetails: {\n\t\t\t\t\tposition: i,\n\t\t\t\t\toperation: ops[i],\n\t\t\t\t\tscope: ops[i].action.scope\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\treturn errors;\n}\n//#endregion\n//#region document-model/reducers.ts\n/**\n* Reorder `items` by the position of their id in `order`. Ids not listed in\n* `order` keep their relative position after the listed ones. Throws if `order`\n* references an id that isn't present, so a stale or mistyped id fails loudly\n* instead of silently producing an arbitrary order.\n*/\nfunction orderBy(items, order) {\n\tconst ids = new Set(items.map((item) => item.id));\n\tfor (const id of order) if (!ids.has(id)) throw new Error(`Cannot reorder: unknown id \"${id}\"`);\n\tconst rank = new Map(order.map((id, index) => [id, index]));\n\treturn items.map((item, index) => ({\n\t\titem,\n\t\tindex\n\t})).sort((a, b) => {\n\t\treturn (rank.get(a.item.id) ?? Number.MAX_SAFE_INTEGER) - (rank.get(b.item.id) ?? Number.MAX_SAFE_INTEGER) || a.index - b.index;\n\t}).map(({ item }) => item);\n}\nconst documentModelHeaderReducer = {\n\tsetModelNameOperation(state, action) {\n\t\tstate.name = action.input.name;\n\t},\n\tsetModelIdOperation(state, action) {\n\t\tstate.id = action.input.id;\n\t},\n\tsetModelExtensionOperation(state, action) {\n\t\tstate.extension = action.input.extension;\n\t},\n\tsetModelDescriptionOperation(state, action) {\n\t\tstate.description = action.input.description;\n\t},\n\tsetAuthorNameOperation(state, action) {\n\t\tstate.author = state.author || {\n\t\t\tname: \"\",\n\t\t\twebsite: null\n\t\t};\n\t\tstate.author.name = action.input.authorName;\n\t},\n\tsetAuthorWebsiteOperation(state, action) {\n\t\tstate.author = state.author || {\n\t\t\tname: \"\",\n\t\t\twebsite: null\n\t\t};\n\t\tstate.author.website = action.input.authorWebsite;\n\t}\n};\nconst documentModelModuleReducer = {\n\taddModuleOperation(state, action) {\n\t\tassertModuleIdUnique(state, action.input.id);\n\t\tstate.specifications[state.specifications.length - 1].modules.push({\n\t\t\tid: action.input.id,\n\t\t\tname: action.input.name,\n\t\t\tdescription: action.input.description || \"\",\n\t\t\toperations: []\n\t\t});\n\t},\n\tsetModuleNameOperation(state, action) {\n\t\tconst targetModule = findModuleOrThrow(state, action.input.id);\n\t\ttargetModule.name = action.input.name || \"\";\n\t},\n\tsetModuleDescriptionOperation(state, action) {\n\t\tconst targetModule = findModuleOrThrow(state, action.input.id);\n\t\ttargetModule.description = action.input.description || \"\";\n\t},\n\tdeleteModuleOperation(state, action) {\n\t\tfindModuleOrThrow(state, action.input.id);\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tlatestSpec.modules = latestSpec.modules.filter((m) => m.id != action.input.id);\n\t},\n\treorderModulesOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tlatestSpec.modules = orderBy(latestSpec.modules, action.input.order);\n\t}\n};\nconst documentModelOperationErrorReducer = {\n\taddOperationErrorOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.operationId);\n\t\tassertOperationErrorIdUnique(state, action.input.id);\n\t\ttargetOp.errors.push({\n\t\t\tid: action.input.id,\n\t\t\tname: action.input.errorName || \"\",\n\t\t\tcode: action.input.errorCode || \"\",\n\t\t\tdescription: action.input.errorDescription || \"\",\n\t\t\ttemplate: action.input.errorTemplate || \"\"\n\t\t});\n\t},\n\tsetOperationErrorCodeOperation(state, action) {\n\t\tconst error = findOperationErrorOrThrow(state, action.input.id);\n\t\terror.code = action.input.errorCode || \"\";\n\t},\n\tsetOperationErrorNameOperation(state, action) {\n\t\tconst error = findOperationErrorOrThrow(state, action.input.id);\n\t\terror.name = action.input.errorName || \"\";\n\t},\n\tsetOperationErrorDescriptionOperation(state, action) {\n\t\tconst error = findOperationErrorOrThrow(state, action.input.id);\n\t\terror.description = action.input.errorDescription || \"\";\n\t},\n\tsetOperationErrorTemplateOperation(state, action) {\n\t\tconst error = findOperationErrorOrThrow(state, action.input.id);\n\t\terror.template = action.input.errorTemplate || \"\";\n\t},\n\tdeleteOperationErrorOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (!latestSpec.modules.some((mod) => mod.operations.some((op) => op.errors.some((e) => e.id === action.input.id)))) throw new Error(`Operation error \"${action.input.id}\" not found in the latest specification`);\n\t\tfor (const mod of latestSpec.modules) for (const op of mod.operations) op.errors = op.errors.filter((e) => e.id != action.input.id);\n\t},\n\treorderOperationErrorsOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.operationId);\n\t\ttargetOp.errors = orderBy(targetOp.errors, action.input.order);\n\t}\n};\nconst documentModelOperationExampleReducer = {\n\taddOperationExampleOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.operationId);\n\t\tassertOperationExampleIdUnique(state, action.input.id);\n\t\ttargetOp.examples.push({\n\t\t\tid: action.input.id,\n\t\t\tvalue: action.input.example\n\t\t});\n\t},\n\tupdateOperationExampleOperation(state, action) {\n\t\tconst example = findOperationExampleOrThrow(state, action.input.id);\n\t\texample.value = action.input.example;\n\t},\n\tdeleteOperationExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (!latestSpec.modules.some((mod) => mod.operations.some((op) => op.examples.some((e) => e.id === action.input.id)))) throw new Error(`Operation example \"${action.input.id}\" not found in the latest specification`);\n\t\tfor (const mod of latestSpec.modules) for (const op of mod.operations) op.examples = op.examples.filter((e) => e.id != action.input.id);\n\t},\n\treorderOperationExamplesOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.operationId);\n\t\ttargetOp.examples = orderBy(targetOp.examples, action.input.order);\n\t}\n};\nconst documentModelOperationReducer = {\n\taddOperationOperation(state, action) {\n\t\tvalidateOperationName(action.input.name, state);\n\t\tassertOperationIdUnique(state, action.input.id);\n\t\tfindModuleOrThrow(state, action.input.moduleId).operations.push({\n\t\t\tid: action.input.id,\n\t\t\tname: action.input.name,\n\t\t\tdescription: action.input.description || \"\",\n\t\t\tschema: action.input.schema || \"\",\n\t\t\ttemplate: action.input.template || action.input.description || \"\",\n\t\t\treducer: action.input.reducer || \"\",\n\t\t\terrors: [],\n\t\t\texamples: [],\n\t\t\tscope: action.input.scope || \"global\"\n\t\t});\n\t},\n\tsetOperationNameOperation(state, action) {\n\t\tif (action.input.name) validateOperationName(action.input.name, state, action.input.id);\n\t\tconst targetOp = findOperationOrThrow(state, action.input.id);\n\t\ttargetOp.name = action.input.name || \"\";\n\t},\n\tsetOperationScopeOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.id);\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tconst allowedScopes = Object.keys(latestSpec.state);\n\t\tif (action.input.scope && !allowedScopes.includes(action.input.scope)) throw new Error(`Invalid scope: ${action.input.scope}`);\n\t\ttargetOp.scope = action.input.scope || \"global\";\n\t},\n\tsetOperationSchemaOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.id);\n\t\ttargetOp.schema = action.input.schema || \"\";\n\t},\n\tsetOperationDescriptionOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.id);\n\t\ttargetOp.description = action.input.description || \"\";\n\t},\n\tsetOperationTemplateOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.id);\n\t\ttargetOp.template = action.input.template || \"\";\n\t},\n\tsetOperationReducerOperation(state, action) {\n\t\tconst targetOp = findOperationOrThrow(state, action.input.id);\n\t\ttargetOp.reducer = action.input.reducer || \"\";\n\t},\n\tmoveOperationOperation(state, action) {\n\t\tconst targetModule = findModuleOrThrow(state, action.input.newModuleId);\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tconst matches = latestSpec.modules.flatMap((mod) => mod.operations.filter((op) => op.id === action.input.operationId));\n\t\tif (matches.length === 0) throw new Error(`Operation \"${action.input.operationId}\" not found in the latest specification`);\n\t\tif (matches.length > 1) throw new Error(`Operation \"${action.input.operationId}\" is duplicated in the latest specification`);\n\t\tconst moved = matches[0];\n\t\tfor (const mod of latestSpec.modules) mod.operations = mod.operations.filter((op) => op.id !== action.input.operationId);\n\t\ttargetModule.operations.push(moved);\n\t},\n\tdeleteOperationOperation(state, action) {\n\t\tfindOperationOrThrow(state, action.input.id);\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (const mod of latestSpec.modules) mod.operations = mod.operations.filter((operation) => operation.id != action.input.id);\n\t},\n\treorderModuleOperationsOperation(state, action) {\n\t\tconst targetModule = findModuleOrThrow(state, action.input.moduleId);\n\t\ttargetModule.operations = orderBy(targetModule.operations, action.input.order);\n\t}\n};\nconst documentModelStateSchemaReducer = {\n\tsetStateSchemaOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].schema = action.input.schema;\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t},\n\tsetInitialStateOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].initialValue = action.input.initialValue;\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t},\n\taddStateExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].examples.push({\n\t\t\tid: action.input.id,\n\t\t\tvalue: action.input.example\n\t\t});\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t},\n\tupdateStateExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (!Object.keys(latestSpec.state).includes(action.input.scope)) throw new Error(`Invalid scope: ${action.input.scope}`);\n\t\tconst example = latestSpec.state[action.input.scope].examples.find((e) => e.id == action.input.id);\n\t\tif (!example) throw new Error(`State example \"${action.input.id}\" not found in scope \"${action.input.scope}\"`);\n\t\texample.value = action.input.newExample;\n\t},\n\tdeleteStateExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (!Object.keys(latestSpec.state).includes(action.input.scope)) throw new Error(`Invalid scope: ${action.input.scope}`);\n\t\tconst scopeState = latestSpec.state[action.input.scope];\n\t\tif (!scopeState.examples.some((e) => e.id == action.input.id)) throw new Error(`State example \"${action.input.id}\" not found in scope \"${action.input.scope}\"`);\n\t\tscopeState.examples = scopeState.examples.filter((e) => e.id != action.input.id);\n\t},\n\treorderStateExamplesOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (!Object.keys(latestSpec.state).includes(action.input.scope)) throw new Error(`Invalid scope: ${action.input.scope}`);\n\t\tconst scopeState = latestSpec.state[action.input.scope];\n\t\tscopeState.examples = orderBy(scopeState.examples, action.input.order);\n\t}\n};\nconst documentModelVersioningReducer = {\n\taddChangeLogItemOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"addChangeLogItemOperation\\\" not yet implemented\");\n\t},\n\tupdateChangeLogItemOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"updateChangeLogItemOperation\\\" not yet implemented\");\n\t},\n\tdeleteChangeLogItemOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"deleteChangeLogItemOperation\\\" not yet implemented\");\n\t},\n\treorderChangeLogItemsOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"reorderChangeLogItemsOperation\\\" not yet implemented\");\n\t},\n\treleaseNewVersionOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tconst copiedModules = latestSpec.modules.map((module) => ({\n\t\t\t...module,\n\t\t\toperations: module.operations.map((op) => ({\n\t\t\t\t...op,\n\t\t\t\terrors: op.errors.map((err) => ({ ...err })),\n\t\t\t\texamples: op.examples.map((ex) => ({ ...ex }))\n\t\t\t}))\n\t\t}));\n\t\tconst copiedState = {\n\t\t\tglobal: {\n\t\t\t\t...latestSpec.state.global,\n\t\t\t\texamples: latestSpec.state.global.examples.map((ex) => ({ ...ex }))\n\t\t\t},\n\t\t\tlocal: {\n\t\t\t\t...latestSpec.state.local,\n\t\t\t\texamples: latestSpec.state.local.examples.map((ex) => ({ ...ex }))\n\t\t\t}\n\t\t};\n\t\tconst newSpec = {\n\t\t\tversion: latestSpec.version + 1,\n\t\t\tchangeLog: [],\n\t\t\tstate: copiedState,\n\t\t\tmodules: copiedModules\n\t\t};\n\t\tstate.specifications.push(newSpec);\n\t}\n};\nconst documentModelStateReducer = (state, action) => {\n\tif (isDocumentAction(action)) return state;\n\tswitch (action.type) {\n\t\tcase \"SET_MODEL_NAME\":\n\t\t\tSetModelNameInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODEL_ID\":\n\t\t\tSetModelIdInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelIdOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODEL_EXTENSION\":\n\t\t\tSetModelExtensionInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelExtensionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODEL_DESCRIPTION\":\n\t\t\tSetModelDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_AUTHOR_NAME\":\n\t\t\tSetAuthorNameInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setAuthorNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_AUTHOR_WEBSITE\":\n\t\t\tSetAuthorWebsiteInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setAuthorWebsiteOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_CHANGE_LOG_ITEM\":\n\t\t\tAddChangeLogItemInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.addChangeLogItemOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"UPDATE_CHANGE_LOG_ITEM\":\n\t\t\tUpdateChangeLogItemInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.updateChangeLogItemOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_CHANGE_LOG_ITEM\":\n\t\t\tDeleteChangeLogItemInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.deleteChangeLogItemOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_CHANGE_LOG_ITEMS\":\n\t\t\tReorderChangeLogItemsInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.reorderChangeLogItemsOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"RELEASE_NEW_VERSION\":\n\t\t\tif (Object.keys(action.input).length > 0) throw new Error(\"Expected empty input for action RELEASE_NEW_VERSION\");\n\t\t\tdocumentModelVersioningReducer.releaseNewVersionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_MODULE\":\n\t\t\tAddModuleInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.addModuleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODULE_NAME\":\n\t\t\tSetModuleNameInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.setModuleNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODULE_DESCRIPTION\":\n\t\t\tSetModuleDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.setModuleDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_MODULE\":\n\t\t\tDeleteModuleInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.deleteModuleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_MODULES\":\n\t\t\tReorderModulesInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.reorderModulesOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_OPERATION_ERROR\":\n\t\t\tAddOperationErrorInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.addOperationErrorOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_CODE\":\n\t\t\tSetOperationErrorCodeInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorCodeOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_NAME\":\n\t\t\tSetOperationErrorNameInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_DESCRIPTION\":\n\t\t\tSetOperationErrorDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_TEMPLATE\":\n\t\t\tSetOperationErrorTemplateInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorTemplateOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_OPERATION_ERROR\":\n\t\t\tDeleteOperationErrorInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.deleteOperationErrorOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_OPERATION_ERRORS\":\n\t\t\tReorderOperationErrorsInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.reorderOperationErrorsOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_OPERATION_EXAMPLE\":\n\t\t\tAddOperationExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.addOperationExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"UPDATE_OPERATION_EXAMPLE\":\n\t\t\tUpdateOperationExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.updateOperationExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_OPERATION_EXAMPLE\":\n\t\t\tDeleteOperationExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.deleteOperationExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_OPERATION_EXAMPLES\":\n\t\t\tReorderOperationExamplesInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.reorderOperationExamplesOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_OPERATION\":\n\t\t\tAddOperationInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.addOperationOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_NAME\":\n\t\t\tSetOperationNameInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_SCOPE\":\n\t\t\tSetOperationScopeInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationScopeOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_SCHEMA\":\n\t\t\tSetOperationSchemaInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationSchemaOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_DESCRIPTION\":\n\t\t\tSetOperationDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_TEMPLATE\":\n\t\t\tSetOperationTemplateInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationTemplateOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_REDUCER\":\n\t\t\tSetOperationReducerInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationReducerOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"MOVE_OPERATION\":\n\t\t\tMoveOperationInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.moveOperationOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_OPERATION\":\n\t\t\tDeleteOperationInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.deleteOperationOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_MODULE_OPERATIONS\":\n\t\t\tReorderModuleOperationsInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.reorderModuleOperationsOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_STATE_SCHEMA\":\n\t\t\tSetStateSchemaInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.setStateSchemaOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_INITIAL_STATE\":\n\t\t\tSetInitialStateInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.setInitialStateOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_STATE_EXAMPLE\":\n\t\t\tAddStateExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.addStateExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"UPDATE_STATE_EXAMPLE\":\n\t\t\tUpdateStateExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.updateStateExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_STATE_EXAMPLE\":\n\t\t\tDeleteStateExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.deleteStateExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_STATE_EXAMPLES\":\n\t\t\tReorderStateExamplesInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.reorderStateExamplesOperation(state.global, action);\n\t\t\tbreak;\n\t\tdefault: return state;\n\t}\n};\nconst documentModelReducer = createReducer(documentModelStateReducer);\n//#endregion\n//#region document-model/upgrades.ts\nfunction applyInitialState(document, action) {\n\tconst input = action.input;\n\tconst newState = input.initialState || input.state;\n\tif (newState) {\n\t\tdocument.state = {\n\t\t\t...document.state,\n\t\t\t...newState\n\t\t};\n\t\tdocument.initialState = document.state;\n\t}\n}\n/**\n* Applies an UPGRADE_DOCUMENT action to a document.\n* Handles all upgrade scenarios including initial upgrades, no-ops, and multi-step upgrades.\n*\n* Behavior based on fromVersion/toVersion:\n* - fromVersion === toVersion (and fromVersion > 0): No-op - return unchanged document\n* - fromVersion > toVersion: Throw DowngradeNotSupportedError\n* - All other cases: Apply upgradePath transitions (if provided), then apply initialState, set version\n*/\nfunction applyUpgradeDocumentAction(document, action, upgradePath) {\n\tconst fromVersion = action.input.fromVersion;\n\tconst toVersion = action.input.toVersion;\n\tif (fromVersion === toVersion && fromVersion > 0) return document;\n\tif (fromVersion > toVersion) throw new DowngradeNotSupportedError(document.header.documentType, fromVersion, toVersion);\n\tif (upgradePath) for (const transition of upgradePath) document = transition.upgradeReducer(document, action);\n\tapplyInitialState(document, action);\n\tdocument.state.document = {\n\t\t...document.state.document,\n\t\tversion: toVersion\n\t};\n\treturn document;\n}\n/**\n* Applies a DELETE_DOCUMENT action to a document.\n* Marks the document as deleted in the document scope state.\n*/\nfunction applyDeleteDocumentAction(document, action) {\n\tconst deletedAt = action.timestampUtcMs || (/* @__PURE__ */ new Date()).toISOString();\n\tdocument.state = {\n\t\t...document.state,\n\t\tdocument: {\n\t\t\t...document.state.document,\n\t\t\tisDeleted: true,\n\t\t\tdeletedAtUtcIso: deletedAt\n\t\t}\n\t};\n\treturn document;\n}\n/**\n* Computes the ordered list of upgrade transitions needed to move from\n* fromVersion to toVersion using the provided manifest.\n* Walks keys v(fromVersion+1)..v(toVersion) and throws a descriptive Error\n* if the manifest is absent or any step is missing.\n*/\nfunction computeUpgradeTransitions(manifest, fromVersion, toVersion) {\n\tif (!manifest) throw new Error(`No upgrade manifest provided for transition from version ${fromVersion} to ${toVersion}`);\n\tconst transitions = [];\n\tconst upgrades = manifest.upgrades;\n\tfor (let v = fromVersion + 1; v <= toVersion; v++) {\n\t\tconst key = `v${v}`;\n\t\tconst transition = upgrades[key];\n\t\tif (!transition) throw new Error(`Upgrade manifest for \"${manifest.documentType}\" is missing step \"${key}\" (from v${fromVersion} to v${toVersion}). Available keys: ${Object.keys(upgrades).join(\", \")}`);\n\t\ttransitions.push(transition);\n\t}\n\treturn transitions;\n}\n//#endregion\n//#region document-model/versioned-replay.ts\nconst NON_DOMAIN_SCOPES$1 = new Set([\"auth\", \"document\"]);\nfunction highestReducerVersion(reducers) {\n\tconst keys = Object.keys(reducers).map(Number);\n\tif (keys.length === 0) throw new Error(\"VersionedReplayConfig.reducers must not be empty\");\n\treturn Math.max(...keys);\n}\n/**\n* Version-aware document replay. Replays a versioned document through per-version\n* reducers, applying upgrade transitions at segment boundaries.\n*\n* Algorithm (D5):\n* a. Build spine from operations[\"document\"]. Empty spine or no upgrades → legacy fallback.\n* b. Collect UPGRADE_DOCUMENT ops from the spine.\n* c. Seed state from the creation upgrade (fromVersion===0). Missing seed with validated\n* upgrades throws; otherwise falls back to legacy.\n* d. Identify validated upgrades (fromVersion > 0, version increases). Compute per-scope\n* boundaries using revision snapshot (preferred) or timestamp fallback.\n* e. Loop over version segments, replaying each scope's ops through the matching reducer,\n* then applying the upgrade transition before the next segment.\n* f. Set header.revision[\"document\"], verify per-scope hashes against state at op-time\n* (not post-upgrade state) when checkHashes is false, and map timestamps from input.\n*\n* operations must include ALL scopes (document scope is NOT stripped).\n* reuseOperationResultingState is ignored by this function — zip operations never carry\n* resultingState.\n*/\nfunction replayDocumentVersioned(initialState, operations, config, header, dispatch, options) {\n\tconst { checkHashes = true, skipIndexValidation } = options || {};\n\tconst protocolVersion = header.protocolVersions?.[\"base-reducer\"] ?? 1;\n\tconst spine = (operations[\"document\"] ?? []).slice().sort((a, b) => a.index - b.index);\n\tconst upgrades = spine.filter((op) => op.action.type === \"UPGRADE_DOCUMENT\");\n\tconst legacyFallback = () => {\n\t\tconst domainOps = Object.fromEntries(Object.entries(operations).filter(([s]) => !NON_DOMAIN_SCOPES$1.has(s)));\n\t\tconst latestVersion = highestReducerVersion(config.reducers);\n\t\tconst reducer = config.reducers[latestVersion];\n\t\treturn {\n\t\t\t...replayDocument(initialState, domainOps, reducer, header, dispatch, {}, options),\n\t\t\toperations\n\t\t};\n\t};\n\tif (spine.length === 0 || upgrades.length === 0) return legacyFallback();\n\tconst seedOp = upgrades[0];\n\tif (!seedOp) return legacyFallback();\n\tconst seedAction = seedOp.action;\n\tif (seedAction.input.fromVersion !== 0) return legacyFallback();\n\tconst seedInput = seedAction.input;\n\tconst seedState = seedInput.initialState ?? seedInput.state;\n\tif (!seedState) {\n\t\tconst validatedUpgradeCount = upgrades.filter((op) => {\n\t\t\tconst a = op.action;\n\t\t\treturn a.input.fromVersion > 0 && a.input.fromVersion < a.input.toVersion;\n\t\t}).length;\n\t\tif (validatedUpgradeCount > 0) throw new Error(`Cannot reconstruct versioned history: the creation UPGRADE_DOCUMENT operation carries no initialState, but the document has ${validatedUpgradeCount} version-changing upgrade(s) recorded after creation. Pre-migration states cannot be reconstructed without the seeded initialState.`);\n\t\treturn legacyFallback();\n\t}\n\tconst startVersion = seedAction.input.toVersion;\n\tconst validatedUpgrades = upgrades.filter((op) => {\n\t\tconst a = op.action;\n\t\treturn a.input.fromVersion > 0 && a.input.fromVersion < a.input.toVersion;\n\t});\n\tconst domainScopes = Object.keys(operations).filter((s) => !NON_DOMAIN_SCOPES$1.has(s));\n\tconst scopeOps = {};\n\tfor (const s of domainScopes) scopeOps[s] = (operations[s] ?? []).slice().sort((a, b) => a.index - b.index);\n\tconst boundaries = validatedUpgrades.map((upgradeOp) => {\n\t\tconst revisionSnapshot = upgradeOp.action.input.revision;\n\t\tconst upgradeTimestamp = upgradeOp.timestampUtcMs;\n\t\tconst boundary = {};\n\t\tfor (const s of domainScopes) {\n\t\t\tconst ops = scopeOps[s] ?? [];\n\t\t\tif (revisionSnapshot !== void 0) {\n\t\t\t\tconst rev = revisionSnapshot[s] ?? 0;\n\t\t\t\tlet b = 0;\n\t\t\t\tfor (let j = 0; j < ops.length; j++) if ((ops[j]?.index ?? 0) < rev) b = j + 1;\n\t\t\t\tboundary[s] = b;\n\t\t\t} else {\n\t\t\t\tlet b = ops.length;\n\t\t\t\tfor (let j = 0; j < ops.length; j++) if ((ops[j]?.timestampUtcMs ?? \"\") >= upgradeTimestamp) {\n\t\t\t\t\tb = j;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tboundary[s] = b;\n\t\t\t}\n\t\t}\n\t\treturn boundary;\n\t});\n\tfor (let i = 1; i < boundaries.length; i++) for (const s of domainScopes) {\n\t\tconst prev = boundaries[i - 1]?.[s] ?? 0;\n\t\tconst curr = boundaries[i]?.[s] ?? 0;\n\t\tif (boundaries[i]) boundaries[i][s] = Math.max(prev, curr);\n\t}\n\tconst allScopes = new Set([\n\t\t...Object.keys(operations),\n\t\t\"global\",\n\t\t\"local\"\n\t]);\n\tconst initialOperations = {};\n\tfor (const s of allScopes) initialOperations[s] = [];\n\tlet document = {\n\t\theader,\n\t\tstate: seedState,\n\t\tinitialState: seedState,\n\t\toperations: initialOperations,\n\t\tclipboard: []\n\t};\n\tlet currentVersion = startVersion;\n\tconst segmentEndHashPerScope = /* @__PURE__ */ new Map();\n\tfor (let k = 0; k <= validatedUpgrades.length; k++) {\n\t\tconst reducer = config.reducers[currentVersion];\n\t\tif (!reducer) {\n\t\t\tconst available = Object.keys(config.reducers).join(\", \");\n\t\t\tthrow new Error(`No reducer registered for document version ${currentVersion}. Available versions: ${available}`);\n\t\t}\n\t\tfor (const s of domainScopes) {\n\t\t\tconst ops = scopeOps[s] ?? [];\n\t\t\tconst segStart = k === 0 ? 0 : boundaries[k - 1]?.[s] ?? 0;\n\t\t\tconst segEnd = k < validatedUpgrades.length ? boundaries[k]?.[s] ?? ops.length : ops.length;\n\t\t\tconst segOps = ops.slice(segStart, segEnd);\n\t\t\tfor (const op of segOps) {\n\t\t\t\tdocument = reducer(document, op.action, dispatch, {\n\t\t\t\t\tignoreSkipOperations: true,\n\t\t\t\t\tcheckHashes,\n\t\t\t\t\tskipIndexValidation,\n\t\t\t\t\treplayOptions: { operation: op },\n\t\t\t\t\tprotocolVersion\n\t\t\t\t});\n\t\t\t\tsegmentEndHashPerScope.set(s, hashDocumentStateForScope(document, s));\n\t\t\t}\n\t\t}\n\t\tconst prevUpgradeSpineIdx = k === 0 ? -1 : spine.indexOf(validatedUpgrades[k - 1]);\n\t\tconst nextUpgradeSpineIdx = k < validatedUpgrades.length ? spine.indexOf(validatedUpgrades[k]) : spine.length;\n\t\tfor (let si = prevUpgradeSpineIdx + 1; si < nextUpgradeSpineIdx; si++) {\n\t\t\tconst spineOp = spine[si];\n\t\t\tif (!spineOp) continue;\n\t\t\tconst spineActionType = spineOp.action.type;\n\t\t\tif (spineActionType === \"CREATE_DOCUMENT\" || spineActionType === \"UPGRADE_DOCUMENT\") continue;\n\t\t\tif (spineActionType === \"DELETE_DOCUMENT\") document = applyDeleteDocumentAction(document, spineOp.action);\n\t\t\telse document = reducer(document, spineOp.action, dispatch, {\n\t\t\t\tignoreSkipOperations: true,\n\t\t\t\tcheckHashes,\n\t\t\t\tskipIndexValidation,\n\t\t\t\treplayOptions: { operation: spineOp },\n\t\t\t\tprotocolVersion\n\t\t\t});\n\t\t}\n\t\tif (k < validatedUpgrades.length) {\n\t\t\tconst upgradeAction = validatedUpgrades[k].action;\n\t\t\tconst fromVer = upgradeAction.input.fromVersion;\n\t\t\tconst toVer = upgradeAction.input.toVersion;\n\t\t\tconst transitions = computeUpgradeTransitions(config.upgradeManifest, fromVer, toVer);\n\t\t\tdocument = applyUpgradeDocumentAction(document, upgradeAction, transitions);\n\t\t\tcurrentVersion = toVer;\n\t\t}\n\t}\n\tconst lastSpineOp = spine.at(-1);\n\tif (lastSpineOp !== void 0 && validatedUpgrades.length > 0) document = {\n\t\t...document,\n\t\theader: {\n\t\t\t...document.header,\n\t\t\trevision: {\n\t\t\t\t...document.header.revision,\n\t\t\t\tdocument: lastSpineOp.index + 1\n\t\t\t}\n\t\t}\n\t};\n\tif (!checkHashes) {\n\t\tconst allReplayedOps = domainScopes.flatMap((s) => scopeOps[s] ?? []);\n\t\tfor (const scope of Object.keys(document.state)) {\n\t\t\tconst capturedHash = segmentEndHashPerScope.get(scope);\n\t\t\tconst scopeHash = capturedHash !== void 0 ? capturedHash : hashDocumentStateForScope(document, scope);\n\t\t\tfor (let i = allReplayedOps.length - 1; i >= 0; i--) {\n\t\t\t\tconst operation = allReplayedOps[i];\n\t\t\t\tif (!operation || operation.action.scope !== scope) continue;\n\t\t\t\tif (operation.hash !== scopeHash) throw new HashMismatchError(scope, document, operation);\n\t\t\t\telse break;\n\t\t\t}\n\t\t}\n\t}\n\tconst allResultScopes = new Set([\n\t\t...Object.keys(document.operations),\n\t\t...Object.keys(operations),\n\t\t\"global\",\n\t\t\"local\"\n\t]);\n\tallResultScopes.delete(\"document\");\n\tconst resultOperations = {};\n\tfor (const s of allResultScopes) resultOperations[s] = (document.operations[s] ?? []).map((op, index) => ({\n\t\t...op,\n\t\ttimestamp: operations[s]?.[index]?.timestampUtcMs ?? op.timestampUtcMs\n\t}));\n\tconst lastModified = header.lastModifiedAtUtcIso ? header.lastModifiedAtUtcIso : Object.values(resultOperations).reduce((acc, curr) => {\n\t\tif (!curr) return acc;\n\t\tconst last = curr.at(-1);\n\t\tif (last && last.timestampUtcMs > acc) return last.timestampUtcMs;\n\t\treturn acc;\n\t}, document.header.lastModifiedAtUtcIso);\n\treturn {\n\t\t...document,\n\t\theader: {\n\t\t\t...document.header,\n\t\t\tlastModifiedAtUtcIso: lastModified\n\t\t},\n\t\toperations: {\n\t\t\t...operations,\n\t\t\t...resultOperations\n\t\t}\n\t};\n}\n//#endregion\n//#region document-model/files.ts\nconst NON_DOMAIN_SCOPES = new Set([\"auth\", \"document\"]);\nfunction zipAsync(data) {\n\treturn new Promise((resolve, reject) => {\n\t\tzip(data, (err, out) => err ? reject(err) : resolve(out));\n\t});\n}\nfunction unzipAsync(data) {\n\treturn new Promise((resolve, reject) => {\n\t\tunzip(data, (err, out) => err ? reject(err) : resolve(out));\n\t});\n}\nconst BASE64_RE = /^[A-Za-z0-9+/]+={0,2}$/;\nfunction isLikelyBase64(s) {\n\tif (s.length === 0 || s.length % 4 !== 0) return false;\n\treturn BASE64_RE.test(s);\n}\nfunction binaryStringToUint8Array(s) {\n\tconst arr = new Uint8Array(s.length);\n\tfor (let i = 0; i < s.length; i++) arr[i] = s.charCodeAt(i) & 255;\n\treturn arr;\n}\nfunction base64ToUint8Array(s) {\n\tif (typeof atob === \"function\") return binaryStringToUint8Array(atob(s));\n\tconst BufferCtor = globalThis.Buffer;\n\tif (!BufferCtor) throw new Error(\"Cannot decode base64 string: neither `atob` nor `Buffer` is available in this environment\");\n\treturn BufferCtor.from(s, \"base64\");\n}\nasync function toUint8Array(input) {\n\tif (input instanceof Uint8Array) return input;\n\tif (input instanceof ArrayBuffer) return new Uint8Array(input);\n\tif (typeof Blob !== \"undefined\" && input instanceof Blob) return new Uint8Array(await input.arrayBuffer());\n\tif (Array.isArray(input)) return new Uint8Array(input);\n\tif (typeof input === \"string\") return isLikelyBase64(input) ? base64ToUint8Array(input) : binaryStringToUint8Array(input);\n\tthrow new Error(\"Unsupported FileInput type\");\n}\nfunction jsonEntry(value) {\n\treturn strToU8(JSON.stringify(value, null, 2));\n}\nasync function createZip(document) {\n\treturn zipAsync({\n\t\t\"header.json\": jsonEntry(document.header),\n\t\t\"state.json\": jsonEntry(document.initialState || {}),\n\t\t\"current-state.json\": jsonEntry(document.state || {}),\n\t\t\"operations.json\": jsonEntry(filterDocumentOperationsResultingState(document.operations))\n\t});\n}\n/**\n* Creates a minimal ZIP backup from strand data.\n* Used when the full document is not available (e.g., in onOperations handler).\n* Creates a ZIP with minimal header and empty operations.\n*/\nasync function createMinimalZip(data) {\n\tconst now = (/* @__PURE__ */ new Date()).toISOString();\n\tconst header = {\n\t\tid: data.documentId,\n\t\tsig: {\n\t\t\tpublicKey: {},\n\t\t\tnonce: \"\"\n\t\t},\n\t\tdocumentType: data.documentType,\n\t\tcreatedAtUtcIso: now,\n\t\tslug: data.name,\n\t\tname: data.name,\n\t\tbranch: data.branch,\n\t\trevision: {},\n\t\tlastModifiedAtUtcIso: now\n\t};\n\treturn zipAsync({\n\t\t\"header.json\": jsonEntry(header),\n\t\t\"state.json\": jsonEntry(data.state),\n\t\t\"current-state.json\": jsonEntry(data.state),\n\t\t\"operations.json\": jsonEntry({})\n\t});\n}\nasync function baseSaveToFileHandle(document, input) {\n\tconst data = await createZip(document);\n\tconst writable = await input.createWritable();\n\tawait writable.write(new Uint8Array(data));\n\tawait writable.close();\n}\nfunction readEntry(files, name) {\n\tconst entry = files[name];\n\tif (!entry) throw new Error(`${name} not found in document zip`);\n\treturn strFromU8(entry);\n}\nasync function parseZipData(data) {\n\tconst files = await unzipAsync(data);\n\tif (!files[\"state.json\"]) throw new Error(\"Initial state not found\");\n\tconst initialState = JSON.parse(readEntry(files, \"state.json\"));\n\tif (!files[\"header.json\"]) throw new Error(\"Document header not found - file format may be outdated\");\n\tconst header = JSON.parse(readEntry(files, \"header.json\"));\n\tif (!files[\"operations.json\"]) throw new Error(\"Operations history not found\");\n\tconst clearedOperations = garbageCollectDocumentOperations(JSON.parse(readEntry(files, \"operations.json\")));\n\tconst operationsError = validateOperations(clearedOperations);\n\tif (operationsError.length) {\n\t\tconst errorMessages = operationsError.map((err) => err.message);\n\t\tthrow new Error(errorMessages.join(\"\\n\"));\n\t}\n\treturn {\n\t\tinitialState,\n\t\theader,\n\t\tclearedOperations\n\t};\n}\nasync function loadFromZipData(data, reducer, options) {\n\tconst { initialState, header, clearedOperations } = await parseZipData(data);\n\treturn {\n\t\t...replayDocument(initialState, Object.fromEntries(Object.entries(clearedOperations).filter(([scope]) => !NON_DOMAIN_SCOPES.has(scope))), reducer, header, void 0, {}, options),\n\t\toperations: clearedOperations\n\t};\n}\nasync function loadFromZipDataVersioned(data, config, options) {\n\tconst { initialState, header, clearedOperations } = await parseZipData(data);\n\treturn {\n\t\t...replayDocumentVersioned(initialState, clearedOperations, config, header, void 0, options),\n\t\toperations: clearedOperations\n\t};\n}\nasync function baseLoadFromInput(input, reducer, options) {\n\treturn loadFromZipData(await toUint8Array(input), reducer, options);\n}\nasync function baseLoadFromInputVersioned(input, config, options) {\n\treturn loadFromZipDataVersioned(await toUint8Array(input), config, options);\n}\nconst documentModelLoadFromInput = (input) => {\n\treturn baseLoadFromInput(input, documentModelReducer);\n};\nconst documentModelSaveToFileHandle = (document, input) => {\n\treturn baseSaveToFileHandle(document, input);\n};\nfunction writeFileBrowser(path, name, stream) {\n\tthrow FileSystemError;\n}\nfunction readFileBrowser(path) {\n\tthrow FileSystemError;\n}\nfunction fetchFileBrowser(url) {\n\tthrow FileSystemError;\n}\nconst getFileBrowser = (file) => {\n\treturn Promise.resolve().then(() => readFileBrowser(file));\n};\n//#endregion\n//#region document-model/state.ts\n/**\n* Creates a default PHAuthState\n*/\nfunction defaultAuthState() {\n\treturn {};\n}\n/**\n* Creates a default PHDocumentState\n*/\nfunction defaultDocumentState() {\n\treturn {\n\t\tversion: 0,\n\t\thash: {\n\t\t\talgorithm: HASH_ALGORITHM_SHA1,\n\t\t\tencoding: HASH_ENCODING_BASE64\n\t\t}\n\t};\n}\n/**\n* Creates a default PHBaseState with auth and document properties\n*/\nfunction defaultBaseState() {\n\treturn {\n\t\tauth: defaultAuthState(),\n\t\tdocument: defaultDocumentState()\n\t};\n}\n/**\n* Creates a PHAuthState with the given properties\n*/\nfunction createAuthState(auth) {\n\treturn {\n\t\t...defaultAuthState(),\n\t\t...auth\n\t};\n}\n/**\n* Creates a PHDocumentState with the given properties\n*/\nfunction createDocumentState(document) {\n\treturn {\n\t\t...defaultDocumentState(),\n\t\t...document\n\t};\n}\n/**\n* Creates a PHBaseState with the given auth and document properties\n*/\nfunction createBaseState(auth, document) {\n\treturn {\n\t\tauth: createAuthState(auth),\n\t\tdocument: createDocumentState(document)\n\t};\n}\nfunction defaultGlobalState() {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tauthor: {\n\t\t\tname: \"\",\n\t\t\twebsite: \"\"\n\t\t},\n\t\tdescription: \"\",\n\t\textension: \"\",\n\t\tid: \"\",\n\t\tname: \"\",\n\t\tspecifications: []\n\t};\n}\nfunction defaultLocalState() {\n\treturn {};\n}\nfunction defaultPHState() {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tglobal: defaultGlobalState(),\n\t\tlocal: defaultLocalState()\n\t};\n}\nfunction createGlobalState(state) {\n\treturn {\n\t\t...defaultGlobalState(),\n\t\t...state || {}\n\t};\n}\nfunction createLocalState(state) {\n\treturn {\n\t\t...defaultLocalState(),\n\t\t...state || {}\n\t};\n}\nfunction createState(baseState, globalState, localState) {\n\treturn {\n\t\t...createBaseState(baseState?.auth, baseState?.document),\n\t\tglobal: createGlobalState(globalState),\n\t\tlocal: createLocalState(localState)\n\t};\n}\n//#endregion\nexport { AddChangeLogItemInputSchema, AddModuleInputSchema, AddOperationErrorInputSchema, AddOperationExampleInputSchema, AddOperationInputSchema, AddStateExampleInputSchema, AuthorSchema, BaseDocumentHeaderSchema, BaseDocumentStateSchema, CodeExampleSchema, ConfigEntrySchema, ConfigEntryTypeSchema, DeleteChangeLogItemInputSchema, DeleteModuleInputSchema, DeleteOperationErrorInputSchema, DeleteOperationExampleInputSchema, DeleteOperationInputSchema, DeleteStateExampleInputSchema, DocumentActionSchema, DocumentModelGlobalStateSchema, DocumentModelHeaderSchema, DocumentModelInputSchema, DocumentModelPHStateSchema, DocumentModelSchema, DocumentSpecificationSchema, DowngradeNotSupportedError, FileSystemError, HASH_ALGORITHM_SHA1, HASH_ALGORITHM_SHA256, HASH_ALGORITHM_SHA512, HASH_ENCODING_BASE64, HASH_ENCODING_HEX, HashMismatchError, IntegrityIssueSubType, IntegrityIssueType, InvalidActionInputError, InvalidActionInputZodError, LoadStateActionInputSchema, LoadStateActionSchema, LoadStateActionStateInputSchema, Load_StateSchema, ManifestSchema, ModuleSchema, MoveOperationInputSchema, OPERATION_NAME_PATTERN, OperationErrorSchema, OperationScopeSchema, OperationSpecificationSchema, PowerhouseModuleSchema, PowerhouseModulesSchema, PruneActionInputSchema, PruneActionSchema, PruneSchema, PublisherSchema, RESERVED_OPERATION_NAMES, RedoActionInputSchema, RedoActionSchema, RedoSchema, ReorderChangeLogItemsInputSchema, ReorderModuleOperationsInputSchema, ReorderModulesInputSchema, ReorderOperationErrorsInputSchema, ReorderOperationExamplesInputSchema, ReorderStateExamplesInputSchema, ScopeStateSchema, SetAuthorNameInputSchema, SetAuthorWebsiteInputSchema, SetInitialStateInputSchema, SetModelDescriptionInputSchema, SetModelExtensionInputSchema, SetModelIdInputSchema, SetModelNameInputSchema, SetModuleDescriptionInputSchema, SetModuleNameInputSchema, SetNameActionInputSchema, SetNameActionSchema, SetOperationDescriptionInputSchema, SetOperationErrorCodeInputSchema, SetOperationErrorDescriptionInputSchema, SetOperationErrorNameInputSchema, SetOperationErrorTemplateInputSchema, SetOperationNameInputSchema, SetOperationReducerInputSchema, SetOperationSchemaInputSchema, SetOperationScopeInputSchema, SetOperationTemplateInputSchema, SetPreferredEditorActionInputSchema, SetPreferredEditorActionSchema, SetStateSchemaInputSchema, Set_NameSchema, Set_PreferredEditorSchema, StateSchema, UndoActionInputSchema, UndoActionSchema, UndoSchema, UpdateChangeLogItemInputSchema, UpdateOperationExampleInputSchema, UpdateStateExampleInputSchema, ab2hex, actionContext, actionFromAction, actionSigner, actions, addChangeLogItem, addModule, addOperation, addOperationError, addOperationExample, addStateExample, addUndo, applyDeleteDocumentAction, applyUpgradeDocumentAction, assertIsDocumentModelDocument, assertIsDocumentModelState, assertModuleIdUnique, assertOperationErrorIdUnique, assertOperationExampleIdUnique, assertOperationIdUnique, attachBranch, baseActions, baseCreateDocument, baseLoadFromInput, baseLoadFromInputVersioned, baseReducer, baseSaveToFileHandle, buildOperationSignature, buildOperationSignatureMessage, buildOperationSignatureParams, buildSignedAction, checkCleanedOperationsIntegrity, checkOperationsIntegrity, computeUpgradeTransitions, createAction, createAuthState, createBaseState, createDocumentState, createGlobalState, createLocalState, createMinimalZip, createPresignedHeader, createReducer, createSignedHeader, createSignedHeaderForSigner, createState, createVerificationSigner, createZip, defaultAuthState, defaultBaseState, defaultDocumentState, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, deleteChangeLogItem, deleteModule, deleteOperation, deleteOperationError, deleteOperationExample, deleteStateExample, deriveOperationId, diffOperations, documentModelActions, documentModelDocumentType, documentModelFileExtension, documentModelGlobalState, documentModelHeaderReducer, documentModelInitialGlobalState, documentModelInitialLocalState, documentModelLoadFromInput, documentModelModuleReducer, documentModelOperationErrorReducer, documentModelOperationExampleReducer, documentModelOperationReducer, documentModelReducer, documentModelSaveToFileHandle, documentModelStateReducer, documentModelStateSchemaReducer, documentModelVersioningReducer, fetchFileBrowser, filterDocumentOperationsResultingState, filterDuplicatedOperations, findModuleOrThrow, findOperationErrorOrThrow, findOperationExampleOrThrow, findOperationOrThrow, garbageCollect, garbageCollectDocumentOperations, garbageCollectV2, generateId, generateMock, getAllOperationNames, getDocumentLastModified, getFileBrowser, getUnixTimestamp, groupOperationsByScope, hashBrowser, hashDocumentStateForScope, hex2ab, isDefinedNonNullAny, isDocumentAction, isDocumentModelDocument, isDocumentModelState, isNoopOperation, isReservedOperationName, isUndo, isUndoRedo, isValidOperationNameFormat, loadState, loadStateOperation, mapSkippedOperations, mapSkippedOperationsV2, merge, moveOperation, nextSkipNumber, noop, operationExampleCreators, operationFromAction, operationFromOperation, operationWithContext, operationsAreEqual, parseResultingState, precedes, prepareOperations, processUndoRedo, prune, pruneOperation, readFileBrowser, readOnly, redo, redoOperation, releaseNewVersion, removeExistingOperations, reorderChangeLogItems, reorderModuleOperations, reorderModules, reorderOperationErrors, reorderOperationExamples, reorderStateExamples, replayDocument, replayDocumentVersioned, replayOperations, reshuffleByTimestamp, reshuffleByTimestampAndIndex, setAuthorName, setAuthorWebsite, setInitialState, setModelDescription, setModelExtension, setModelId, setModelName, setModuleDescription, setModuleName, setName, setNameOperation, setOperationDescription, setOperationErrorCode, setOperationErrorDescription, setOperationErrorName, setOperationErrorTemplate, setOperationName, setOperationReducer, setOperationSchema, setOperationScope, setOperationTemplate, setPreferredEditor, setPreferredEditorOperation, setStateSchema, sign, skipHeaderOperations, sortMappedOperations, sortOperations, split, undo, undoOperation, undoOperationV2, updateChangeLogItem, updateDocument, updateHeaderRevision, updateOperationExample, updateStateExample, validateHeader, validateInitialState, validateModule, validateModuleOperation, validateModules, validateOperationName, validateOperations, validateStateSchemaName, verify, verifyOperationSignature, writeFileBrowser };\n\n//# sourceMappingURL=index.js.map","import { actions, assertIsDocumentModelDocument, assertIsDocumentModelState, baseCreateDocument, createState, defaultBaseState, documentModelDocumentType, documentModelFileExtension, documentModelGlobalState, documentModelInitialGlobalState, documentModelInitialLocalState, documentModelLoadFromInput, documentModelReducer, documentModelSaveToFileHandle, isDocumentModelDocument, isDocumentModelState } from \"@powerhousedao/shared/document-model\";\nexport * from \"@powerhousedao/shared/document-model\";\n//#region src/state.ts\nconst isStateOfType = (state) => {\n\treturn isDocumentModelState(state);\n};\nconst assertIsStateOfType = (state) => {\n\tassertIsDocumentModelState(state);\n};\nconst isDocumentOfType = (document) => {\n\treturn isDocumentModelDocument(document);\n};\nconst assertIsDocumentOfType = (document) => {\n\tassertIsDocumentModelDocument(document);\n};\nconst documentModelCreateState = (state) => {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tglobal: {\n\t\t\t...documentModelInitialGlobalState,\n\t\t\t...state?.global ?? {}\n\t\t},\n\t\tlocal: {\n\t\t\t...documentModelInitialLocalState,\n\t\t\t...state?.local ?? {}\n\t\t}\n\t};\n};\nfunction documentModelCreateDocument(state) {\n\treturn baseCreateDocument(documentModelCreateState, state, documentModelDocumentType);\n}\n//#endregion\n//#region src/module.ts\nconst utils = {\n\tfileExtension: documentModelFileExtension,\n\tcreateState: documentModelCreateState,\n\tcreateDocument: documentModelCreateDocument,\n\tloadFromInput: documentModelLoadFromInput,\n\tsaveToFileHandle: documentModelSaveToFileHandle,\n\tisStateOfType,\n\tassertIsStateOfType,\n\tisDocumentOfType,\n\tassertIsDocumentOfType\n};\nconst documentModelDocumentModelModule = {\n\treducer: documentModelReducer,\n\tdocumentModel: createState(defaultBaseState(), documentModelGlobalState),\n\tactions,\n\tutils\n};\n//#endregion\n//#region src/controller.ts\nvar PHDocumentController = class PHDocumentController {\n\tmodule;\n\t_document;\n\tlisteners = [];\n\tconstructor(module, initialDocument) {\n\t\tthis.module = module;\n\t\tthis._document = initialDocument ?? module.utils.createDocument();\n\t\tfor (const actionType in this.module.actions) Object.defineProperty(this, actionType, { value: (input) => {\n\t\t\tconst action = this.module.actions[actionType](input);\n\t\t\tthis._document = this.module.reducer(this._document, action);\n\t\t\tthis.notifyListeners();\n\t\t\treturn this;\n\t\t} });\n\t}\n\tget document() {\n\t\treturn this._document;\n\t}\n\tget header() {\n\t\treturn this.document.header;\n\t}\n\tget state() {\n\t\treturn this.document.state;\n\t}\n\tget initialState() {\n\t\treturn this.document.initialState;\n\t}\n\tget operations() {\n\t\treturn this.document.operations;\n\t}\n\tget clipboard() {\n\t\treturn this.document.clipboard;\n\t}\n\tonChange(listener) {\n\t\tthis.listeners.push(listener);\n\t\treturn () => {\n\t\t\tthis.listeners = this.listeners.filter((l) => l !== listener);\n\t\t};\n\t}\n\tnotifyListeners() {\n\t\tif (this.listeners.length === 0) return;\n\t\tconst event = { document: this._document };\n\t\tfor (const listener of this.listeners) listener(event);\n\t}\n\tstatic forDocumentModel(module) {\n\t\treturn class extends PHDocumentController {\n\t\t\tconstructor(initialDocument) {\n\t\t\t\tsuper(module, initialDocument);\n\t\t\t}\n\t\t};\n\t}\n};\nconst DocumentModelController = PHDocumentController.forDocumentModel(documentModelDocumentModelModule);\n//#endregion\n//#region src/logger.ts\nconst tokenSub = /@([a-zA-Z0-9_]+)/g;\nconst dtf = new Intl.DateTimeFormat(void 0, {\n\thour12: false,\n\thour: \"2-digit\",\n\tminute: \"2-digit\",\n\tsecond: \"2-digit\",\n\tfractionalSecondDigits: 2\n});\nconst stringify = (value, includeStack) => {\n\tif (value === null || value === void 0) return \"null\";\n\tif (typeof value === \"string\") return value;\n\tif (value instanceof Error) {\n\t\tconst base = `${value.name}: ${value.message}`;\n\t\treturn includeStack && value.stack ? `${base}\\n${value.stack}` : base;\n\t}\n\tif (typeof value === \"object\") try {\n\t\treturn JSON.stringify(value);\n\t} catch {\n\t\treturn Object.prototype.toString.call(value);\n\t}\n\tif (typeof value === \"function\") {\n\t\tconst name = value.name;\n\t\treturn name ? `${name}()` : \"anonymous()\";\n\t}\n\treturn String(value);\n};\nconst formatMessage = (tagString, message, replacements, includeStack) => {\n\tconst meta = {};\n\tconst uniqueTokens = [];\n\tlet results;\n\twhile ((results = tokenSub.exec(message)) !== null) {\n\t\tconst tokenName = results[1];\n\t\tif (uniqueTokens.indexOf(tokenName) === -1) {\n\t\t\tuniqueTokens.push(tokenName);\n\t\t\tmeta[tokenName] = replacements[uniqueTokens.length - 1];\n\t\t}\n\t}\n\tfor (const [key, value] of Object.entries(meta)) message = message.replaceAll(`@${key}`, stringify(value, includeStack));\n\tconst extras = replacements.slice(uniqueTokens.length);\n\tif (extras.length > 0) message = `${message} ${extras.map((v) => stringify(v, includeStack)).join(\" \")}`;\n\tif (tagString.length > 0) message = `${tagString} ${message}`;\n\tconst now = /* @__PURE__ */ new Date();\n\tmeta[\"timestamp\"] = dtf.format(now);\n\treturn [message, meta];\n};\nconst LOG_LEVELS = {\n\tverbose: 0,\n\tdebug: 1,\n\tinfo: 2,\n\twarn: 3,\n\terror: 4\n};\nvar ConsoleLogger = class ConsoleLogger {\n\t#tags;\n\t#tagString;\n\t#level = LOG_LEVELS.info;\n\terrorHandler;\n\tconstructor(tags, handler) {\n\t\tthis.#tags = tags || [];\n\t\tthis.#tagString = this.#tags.map((tag) => `[${tag}]`).join(\"\");\n\t\tthis.errorHandler = handler ?? (() => {});\n\t}\n\tget level() {\n\t\treturn Object.keys(LOG_LEVELS).find((key) => LOG_LEVELS[key] === this.#level);\n\t}\n\tset level(value) {\n\t\tthis.#level = LOG_LEVELS[value];\n\t}\n\tchild(tags) {\n\t\tconst logger = new ConsoleLogger([...this.#tags, ...tags], this.errorHandler);\n\t\tlogger.level = this.level;\n\t\treturn logger;\n\t}\n\tget #includeStack() {\n\t\treturn this.#level <= LOG_LEVELS.debug;\n\t}\n\tverbose(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.verbose) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements, this.#includeStack);\n\t\t\tconsole.debug(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\tdebug(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.debug) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements, this.#includeStack);\n\t\t\tconsole.debug(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\tinfo(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.info) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements, this.#includeStack);\n\t\t\tconsole.info(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\twarn(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.warn) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements, this.#includeStack);\n\t\t\tconsole.warn(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\terror(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.error) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements, this.#includeStack);\n\t\t\tconsole.error(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n};\nconst logger = new ConsoleLogger();\nconst setLogLevel = (level) => {\n\tlogger.level = level;\n};\nconst setErrorHandler = (handler) => {\n\tlogger.errorHandler = handler;\n};\nconst childLogger = (tags) => {\n\treturn logger.child(tags);\n};\n//#endregion\nexport { ConsoleLogger, DocumentModelController, PHDocumentController, assertIsDocumentOfType, assertIsStateOfType, childLogger, documentModelCreateDocument, documentModelCreateState, documentModelDocumentModelModule, isDocumentOfType, isStateOfType, logger, setErrorHandler, setLogLevel };\n\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-empty-object-type */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport * as z from 'zod';\nimport type {\n AddAgentProfileRefInput,\n AddAgentSkillInput,\n AddAgentToolPatternInput,\n AddExternalSkillInput,\n AddModelInput,\n AddPackageDocumentTypeInput,\n AddPowerhousePackageInput,\n AddProfileInput,\n AddSubAgentInput,\n AddSupportedResourceInput,\n BumpVersionInput,\n ClearMainAgentDescriptionInput,\n ClearMainAgentImageInput,\n DisableMastraInput,\n DisableRoutineInput,\n EnableMastraInput,\n EnableRoutineInput,\n ExternalSkill,\n ImportMainAgentInput,\n ImportModelInput,\n ImportPackageInput,\n ImportProfileInput,\n ImportSkillInput,\n ImportSpecInput,\n ImportSubAgentInput,\n PhClintAgentModel,\n PhClintAgentProfile,\n PhClintDeployment,\n PhClintFeatures,\n PhClintMainAgent,\n PhClintMastraCommon,\n PhClintMastraFeature,\n PhClintProjectState,\n PhClintRoutineFeature,\n PhClintSubAgent,\n PowerhouseLevel,\n PowerhousePackage,\n PublishDevInput,\n PublishProductionInput,\n PublishRecord,\n PublishStagingInput,\n PublishStatus,\n PublishTag,\n RemoveAgentProfileRefInput,\n RemoveAgentSkillInput,\n RemoveAgentToolPatternInput,\n RemoveExternalSkillInput,\n RemoveModelInput,\n RemovePackageDocumentTypeInput,\n RemovePowerhousePackageInput,\n RemoveProfileInput,\n RemoveSubAgentInput,\n RemoveSupportedResourceInput,\n ReorderAgentProfileRefsInput,\n ReorderProfilesInput,\n SetAgentModelInput,\n SetDescriptionInput,\n SetEnableChatInput,\n SetExternalSkillGithubUrlInput,\n SetExternalSkillNameInput,\n SetMainAgentDescriptionInput,\n SetMainAgentImageInput,\n SetMainAgentNameInput,\n SetObservabilityEnabledInput,\n SetPackageIdentifierInput,\n SetPackageVersionInput,\n SetPowerhouseLevelInput,\n SetProxyEnabledInput,\n SetPublishStatusInput,\n SetSubAgentDescriptionInput,\n SetSubAgentNameInput,\n SetVersionInput,\n UpdateProfileInput,\n} from './types.js';\n\ntype Properties<T> = Required<{\n [K in keyof T]: z.ZodType<T[K]>;\n}>;\n\ntype definedNonNullAny = {};\n\nexport const isDefinedNonNullAny = (v: any): v is definedNonNullAny => v !== undefined && v !== null;\n\nexport const definedNonNullAnySchema = z.any().refine((v) => isDefinedNonNullAny(v));\n\nexport const PowerhouseLevelSchema = z.enum(['Connect', 'Disabled', 'Reactor', 'Switchboard']);\n\nexport const PublishStatusSchema = z.enum(['Failed', 'InProgress', 'Pending', 'Succeeded']);\n\nexport const PublishTagSchema = z.enum(['Dev', 'Production', 'Staging']);\n\nexport function AddAgentProfileRefInputSchema(): z.ZodObject<Properties<AddAgentProfileRefInput>> {\n return z.object({\n agentId: z.string(),\n insertBefore: z.string().nullish(),\n profileId: z.string(),\n });\n}\n\nexport function AddAgentSkillInputSchema(): z.ZodObject<Properties<AddAgentSkillInput>> {\n return z.object({\n agentId: z.string(),\n name: z.string(),\n });\n}\n\nexport function AddAgentToolPatternInputSchema(): z.ZodObject<Properties<AddAgentToolPatternInput>> {\n return z.object({\n agentId: z.string(),\n pattern: z.string(),\n });\n}\n\nexport function AddExternalSkillInputSchema(): z.ZodObject<Properties<AddExternalSkillInput>> {\n return z.object({\n githubUrl: z.url(),\n id: z.string(),\n name: z.string(),\n });\n}\n\nexport function AddModelInputSchema(): z.ZodObject<Properties<AddModelInput>> {\n return z.object({\n id: z.string(),\n });\n}\n\nexport function AddPackageDocumentTypeInputSchema(): z.ZodObject<Properties<AddPackageDocumentTypeInput>> {\n return z.object({\n documentType: z.string(),\n packageId: z.string(),\n });\n}\n\nexport function AddPowerhousePackageInputSchema(): z.ZodObject<Properties<AddPowerhousePackageInput>> {\n return z.object({\n id: z.string(),\n packageName: z.string(),\n });\n}\n\nexport function AddProfileInputSchema(): z.ZodObject<Properties<AddProfileInput>> {\n return z.object({\n content: z.string(),\n id: z.string(),\n insertBefore: z.string().nullish(),\n title: z.string(),\n });\n}\n\nexport function AddSubAgentInputSchema(): z.ZodObject<Properties<AddSubAgentInput>> {\n return z.object({\n description: z.string(),\n id: z.string(),\n modelId: z.string(),\n name: z.string(),\n });\n}\n\nexport function AddSupportedResourceInputSchema(): z.ZodObject<Properties<AddSupportedResourceInput>> {\n return z.object({\n resource: z.string(),\n });\n}\n\nexport function BumpVersionInputSchema(): z.ZodObject<Properties<BumpVersionInput>> {\n return z.object({\n version: z.string(),\n });\n}\n\nexport function ClearMainAgentDescriptionInputSchema(): z.ZodObject<Properties<ClearMainAgentDescriptionInput>> {\n return z.object({\n _: z.boolean().nullish(),\n });\n}\n\nexport function ClearMainAgentImageInputSchema(): z.ZodObject<Properties<ClearMainAgentImageInput>> {\n return z.object({\n _: z.boolean().nullish(),\n });\n}\n\nexport function DisableMastraInputSchema(): z.ZodObject<Properties<DisableMastraInput>> {\n return z.object({\n _: z.boolean().nullish(),\n });\n}\n\nexport function DisableRoutineInputSchema(): z.ZodObject<Properties<DisableRoutineInput>> {\n return z.object({\n _: z.boolean().nullish(),\n });\n}\n\nexport function EnableMastraInputSchema(): z.ZodObject<Properties<EnableMastraInput>> {\n return z.object({\n agentId: z.string(),\n agentName: z.string(),\n });\n}\n\nexport function EnableRoutineInputSchema(): z.ZodObject<Properties<EnableRoutineInput>> {\n return z.object({\n _: z.boolean().nullish(),\n });\n}\n\nexport function ExternalSkillSchema(): z.ZodObject<Properties<ExternalSkill>> {\n return z.object({\n __typename: z.literal('ExternalSkill').optional(),\n githubUrl: z.url(),\n id: z.string(),\n name: z.string(),\n });\n}\n\nexport function ImportMainAgentInputSchema(): z.ZodObject<Properties<ImportMainAgentInput>> {\n return z.object({\n attachment: z.string().nullish(),\n description: z.string().nullish(),\n id: z.string(),\n modelId: z.string(),\n name: z.string(),\n profileIds: z.array(z.string()),\n skills: z.array(z.string()),\n toolPatterns: z.array(z.string()),\n });\n}\n\nexport function ImportModelInputSchema(): z.ZodObject<Properties<ImportModelInput>> {\n return z.object({\n id: z.string(),\n });\n}\n\nexport function ImportPackageInputSchema(): z.ZodObject<Properties<ImportPackageInput>> {\n return z.object({\n documentTypes: z.array(z.string()),\n id: z.string(),\n packageName: z.string(),\n version: z.string().nullish(),\n });\n}\n\nexport function ImportProfileInputSchema(): z.ZodObject<Properties<ImportProfileInput>> {\n return z.object({\n content: z.string(),\n id: z.string(),\n title: z.string(),\n });\n}\n\nexport function ImportSkillInputSchema(): z.ZodObject<Properties<ImportSkillInput>> {\n return z.object({\n githubUrl: z.url(),\n id: z.string(),\n name: z.string(),\n });\n}\n\nexport function ImportSpecInputSchema(): z.ZodObject<Properties<ImportSpecInput>> {\n return z.object({\n description: z.string(),\n enableChat: z.boolean().nullish(),\n externalSkills: z.array(z.lazy(() => ImportSkillInputSchema())),\n mainAgent: z.lazy(() => ImportMainAgentInputSchema().nullish()),\n mastraEnabled: z.boolean(),\n models: z.array(z.lazy(() => ImportModelInputSchema())),\n name: z.string(),\n observabilityEnabled: z.boolean().nullish(),\n packages: z.array(z.lazy(() => ImportPackageInputSchema())),\n powerhouse: PowerhouseLevelSchema,\n profiles: z.array(z.lazy(() => ImportProfileInputSchema())),\n proxyEnabled: z.boolean().nullish(),\n routineEnabled: z.boolean(),\n scope: z.string().nullish(),\n subAgents: z.array(z.lazy(() => ImportSubAgentInputSchema())),\n supportedResources: z.array(z.string()).nullish(),\n version: z.string(),\n });\n}\n\nexport function ImportSubAgentInputSchema(): z.ZodObject<Properties<ImportSubAgentInput>> {\n return z.object({\n description: z.string(),\n id: z.string(),\n modelId: z.string(),\n name: z.string(),\n profileIds: z.array(z.string()),\n skills: z.array(z.string()),\n toolPatterns: z.array(z.string()),\n });\n}\n\nexport function PhClintAgentModelSchema(): z.ZodObject<Properties<PhClintAgentModel>> {\n return z.object({\n __typename: z.literal('PhClintAgentModel').optional(),\n id: z.string(),\n });\n}\n\nexport function PhClintAgentProfileSchema(): z.ZodObject<Properties<PhClintAgentProfile>> {\n return z.object({\n __typename: z.literal('PhClintAgentProfile').optional(),\n content: z.string(),\n id: z.string(),\n title: z.string(),\n });\n}\n\nexport function PhClintDeploymentSchema(): z.ZodObject<Properties<PhClintDeployment>> {\n return z.object({\n __typename: z.literal('PhClintDeployment').optional(),\n observabilityEnabled: z.boolean(),\n proxyEnabled: z.boolean(),\n supportedResources: z.array(z.string()),\n });\n}\n\nexport function PhClintFeaturesSchema(): z.ZodObject<Properties<PhClintFeatures>> {\n return z.object({\n __typename: z.literal('PhClintFeatures').optional(),\n mastra: z.lazy(() => PhClintMastraFeatureSchema()),\n powerhouse: PowerhouseLevelSchema,\n routine: z.lazy(() => PhClintRoutineFeatureSchema()),\n });\n}\n\nexport function PhClintMainAgentSchema(): z.ZodObject<Properties<PhClintMainAgent>> {\n return z.object({\n __typename: z.literal('PhClintMainAgent').optional(),\n attachment: z.string().nullish(),\n description: z.string().nullish(),\n id: z.string(),\n modelId: z.string(),\n name: z.string(),\n profileIds: z.array(z.string()),\n skills: z.array(z.string()),\n toolPatterns: z.array(z.string()),\n });\n}\n\nexport function PhClintMastraCommonSchema(): z.ZodObject<Properties<PhClintMastraCommon>> {\n return z.object({\n __typename: z.literal('PhClintMastraCommon').optional(),\n enableChat: z.boolean(),\n });\n}\n\nexport function PhClintMastraFeatureSchema(): z.ZodObject<Properties<PhClintMastraFeature>> {\n return z.object({\n __typename: z.literal('PhClintMastraFeature').optional(),\n common: z.lazy(() => PhClintMastraCommonSchema()),\n enabled: z.boolean(),\n mainAgent: z.lazy(() => PhClintMainAgentSchema().nullish()),\n models: z.array(z.lazy(() => PhClintAgentModelSchema())),\n profiles: z.array(z.lazy(() => PhClintAgentProfileSchema())),\n subAgents: z.array(z.lazy(() => PhClintSubAgentSchema())),\n });\n}\n\nexport function PhClintProjectStateSchema(): z.ZodObject<Properties<PhClintProjectState>> {\n return z.object({\n __typename: z.literal('PhClintProjectState').optional(),\n deployment: z.lazy(() => PhClintDeploymentSchema()),\n description: z.string(),\n externalSkills: z.array(z.lazy(() => ExternalSkillSchema())),\n features: z.lazy(() => PhClintFeaturesSchema()),\n name: z.string().nullish(),\n packages: z.array(z.lazy(() => PowerhousePackageSchema())),\n publishHistory: z.array(z.lazy(() => PublishRecordSchema())),\n scope: z.string().nullish(),\n version: z.string(),\n });\n}\n\nexport function PhClintRoutineFeatureSchema(): z.ZodObject<Properties<PhClintRoutineFeature>> {\n return z.object({\n __typename: z.literal('PhClintRoutineFeature').optional(),\n enabled: z.boolean(),\n });\n}\n\nexport function PhClintSubAgentSchema(): z.ZodObject<Properties<PhClintSubAgent>> {\n return z.object({\n __typename: z.literal('PhClintSubAgent').optional(),\n description: z.string(),\n id: z.string(),\n modelId: z.string(),\n name: z.string(),\n profileIds: z.array(z.string()),\n skills: z.array(z.string()),\n toolPatterns: z.array(z.string()),\n });\n}\n\nexport function PowerhousePackageSchema(): z.ZodObject<Properties<PowerhousePackage>> {\n return z.object({\n __typename: z.literal('PowerhousePackage').optional(),\n documentTypes: z.array(z.string()),\n id: z.string(),\n managed: z.boolean(),\n packageName: z.string(),\n version: z.string().nullish(),\n });\n}\n\nexport function PublishDevInputSchema(): z.ZodObject<Properties<PublishDevInput>> {\n return z.object({\n id: z.string(),\n timestamp: z.iso.datetime(),\n });\n}\n\nexport function PublishProductionInputSchema(): z.ZodObject<Properties<PublishProductionInput>> {\n return z.object({\n id: z.string(),\n timestamp: z.iso.datetime(),\n });\n}\n\nexport function PublishRecordSchema(): z.ZodObject<Properties<PublishRecord>> {\n return z.object({\n __typename: z.literal('PublishRecord').optional(),\n id: z.string(),\n status: PublishStatusSchema,\n tag: PublishTagSchema,\n timestamp: z.iso.datetime(),\n version: z.string(),\n });\n}\n\nexport function PublishStagingInputSchema(): z.ZodObject<Properties<PublishStagingInput>> {\n return z.object({\n id: z.string(),\n timestamp: z.iso.datetime(),\n });\n}\n\nexport function RemoveAgentProfileRefInputSchema(): z.ZodObject<Properties<RemoveAgentProfileRefInput>> {\n return z.object({\n agentId: z.string(),\n profileId: z.string(),\n });\n}\n\nexport function RemoveAgentSkillInputSchema(): z.ZodObject<Properties<RemoveAgentSkillInput>> {\n return z.object({\n agentId: z.string(),\n name: z.string(),\n });\n}\n\nexport function RemoveAgentToolPatternInputSchema(): z.ZodObject<Properties<RemoveAgentToolPatternInput>> {\n return z.object({\n agentId: z.string(),\n pattern: z.string(),\n });\n}\n\nexport function RemoveExternalSkillInputSchema(): z.ZodObject<Properties<RemoveExternalSkillInput>> {\n return z.object({\n id: z.string(),\n });\n}\n\nexport function RemoveModelInputSchema(): z.ZodObject<Properties<RemoveModelInput>> {\n return z.object({\n id: z.string(),\n });\n}\n\nexport function RemovePackageDocumentTypeInputSchema(): z.ZodObject<Properties<RemovePackageDocumentTypeInput>> {\n return z.object({\n documentType: z.string(),\n packageId: z.string(),\n });\n}\n\nexport function RemovePowerhousePackageInputSchema(): z.ZodObject<Properties<RemovePowerhousePackageInput>> {\n return z.object({\n id: z.string(),\n });\n}\n\nexport function RemoveProfileInputSchema(): z.ZodObject<Properties<RemoveProfileInput>> {\n return z.object({\n id: z.string(),\n });\n}\n\nexport function RemoveSubAgentInputSchema(): z.ZodObject<Properties<RemoveSubAgentInput>> {\n return z.object({\n id: z.string(),\n });\n}\n\nexport function RemoveSupportedResourceInputSchema(): z.ZodObject<Properties<RemoveSupportedResourceInput>> {\n return z.object({\n resource: z.string(),\n });\n}\n\nexport function ReorderAgentProfileRefsInputSchema(): z.ZodObject<Properties<ReorderAgentProfileRefsInput>> {\n return z.object({\n agentId: z.string(),\n ids: z.array(z.string()),\n insertBefore: z.string().nullish(),\n });\n}\n\nexport function ReorderProfilesInputSchema(): z.ZodObject<Properties<ReorderProfilesInput>> {\n return z.object({\n ids: z.array(z.string()),\n insertBefore: z.string().nullish(),\n });\n}\n\nexport function SetAgentModelInputSchema(): z.ZodObject<Properties<SetAgentModelInput>> {\n return z.object({\n agentId: z.string(),\n modelId: z.string(),\n });\n}\n\nexport function SetDescriptionInputSchema(): z.ZodObject<Properties<SetDescriptionInput>> {\n return z.object({\n description: z.string(),\n });\n}\n\nexport function SetEnableChatInputSchema(): z.ZodObject<Properties<SetEnableChatInput>> {\n return z.object({\n enabled: z.boolean(),\n });\n}\n\nexport function SetExternalSkillGithubUrlInputSchema(): z.ZodObject<Properties<SetExternalSkillGithubUrlInput>> {\n return z.object({\n githubUrl: z.url(),\n id: z.string(),\n });\n}\n\nexport function SetExternalSkillNameInputSchema(): z.ZodObject<Properties<SetExternalSkillNameInput>> {\n return z.object({\n id: z.string(),\n name: z.string(),\n });\n}\n\nexport function SetMainAgentDescriptionInputSchema(): z.ZodObject<Properties<SetMainAgentDescriptionInput>> {\n return z.object({\n description: z.string(),\n });\n}\n\nexport function SetMainAgentImageInputSchema(): z.ZodObject<Properties<SetMainAgentImageInput>> {\n return z.object({\n attachment: z.string(),\n });\n}\n\nexport function SetMainAgentNameInputSchema(): z.ZodObject<Properties<SetMainAgentNameInput>> {\n return z.object({\n name: z.string(),\n });\n}\n\nexport function SetObservabilityEnabledInputSchema(): z.ZodObject<Properties<SetObservabilityEnabledInput>> {\n return z.object({\n enabled: z.boolean(),\n });\n}\n\nexport function SetPackageIdentifierInputSchema(): z.ZodObject<Properties<SetPackageIdentifierInput>> {\n return z.object({\n identifier: z.string(),\n });\n}\n\nexport function SetPackageVersionInputSchema(): z.ZodObject<Properties<SetPackageVersionInput>> {\n return z.object({\n packageId: z.string(),\n version: z.string().nullish(),\n });\n}\n\nexport function SetPowerhouseLevelInputSchema(): z.ZodObject<Properties<SetPowerhouseLevelInput>> {\n return z.object({\n level: PowerhouseLevelSchema,\n skipAutoProxy: z.boolean().nullish(),\n });\n}\n\nexport function SetProxyEnabledInputSchema(): z.ZodObject<Properties<SetProxyEnabledInput>> {\n return z.object({\n enabled: z.boolean(),\n });\n}\n\nexport function SetPublishStatusInputSchema(): z.ZodObject<Properties<SetPublishStatusInput>> {\n return z.object({\n id: z.string(),\n status: PublishStatusSchema,\n });\n}\n\nexport function SetSubAgentDescriptionInputSchema(): z.ZodObject<Properties<SetSubAgentDescriptionInput>> {\n return z.object({\n description: z.string(),\n id: z.string(),\n });\n}\n\nexport function SetSubAgentNameInputSchema(): z.ZodObject<Properties<SetSubAgentNameInput>> {\n return z.object({\n id: z.string(),\n name: z.string(),\n });\n}\n\nexport function SetVersionInputSchema(): z.ZodObject<Properties<SetVersionInput>> {\n return z.object({\n version: z.string(),\n });\n}\n\nexport function UpdateProfileInputSchema(): z.ZodObject<Properties<UpdateProfileInput>> {\n return z.object({\n content: z.string().nullish(),\n id: z.string(),\n title: z.string().nullish(),\n });\n}\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { AddSupportedResourceInputSchema, RemoveSupportedResourceInputSchema, SetObservabilityEnabledInputSchema, SetProxyEnabledInputSchema } from '../schema/zod.js';\nimport type { AddSupportedResourceInput, RemoveSupportedResourceInput, SetObservabilityEnabledInput, SetProxyEnabledInput } from '../types.js';\nimport type { AddSupportedResourceAction, RemoveSupportedResourceAction, SetObservabilityEnabledAction, SetProxyEnabledAction } from './actions.js';\n\nexport const addSupportedResource = (input: AddSupportedResourceInput) => createAction<AddSupportedResourceAction>('ADD_SUPPORTED_RESOURCE', { ...input }, undefined, AddSupportedResourceInputSchema, 'global');\n\nexport const removeSupportedResource = (input: RemoveSupportedResourceInput) => createAction<RemoveSupportedResourceAction>('REMOVE_SUPPORTED_RESOURCE', { ...input }, undefined, RemoveSupportedResourceInputSchema, 'global');\n\nexport const setProxyEnabled = (input: SetProxyEnabledInput) => createAction<SetProxyEnabledAction>('SET_PROXY_ENABLED', { ...input }, undefined, SetProxyEnabledInputSchema, 'global');\n\nexport const setObservabilityEnabled = (input: SetObservabilityEnabledInput) => createAction<SetObservabilityEnabledAction>('SET_OBSERVABILITY_ENABLED', { ...input }, undefined, SetObservabilityEnabledInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { AddExternalSkillInputSchema, RemoveExternalSkillInputSchema, SetExternalSkillGithubUrlInputSchema, SetExternalSkillNameInputSchema } from '../schema/zod.js';\nimport type { AddExternalSkillInput, RemoveExternalSkillInput, SetExternalSkillGithubUrlInput, SetExternalSkillNameInput } from '../types.js';\nimport type { AddExternalSkillAction, RemoveExternalSkillAction, SetExternalSkillGithubUrlAction, SetExternalSkillNameAction } from './actions.js';\n\nexport const addExternalSkill = (input: AddExternalSkillInput) => createAction<AddExternalSkillAction>('ADD_EXTERNAL_SKILL', { ...input }, undefined, AddExternalSkillInputSchema, 'global');\n\nexport const removeExternalSkill = (input: RemoveExternalSkillInput) => createAction<RemoveExternalSkillAction>('REMOVE_EXTERNAL_SKILL', { ...input }, undefined, RemoveExternalSkillInputSchema, 'global');\n\nexport const setExternalSkillName = (input: SetExternalSkillNameInput) => createAction<SetExternalSkillNameAction>('SET_EXTERNAL_SKILL_NAME', { ...input }, undefined, SetExternalSkillNameInputSchema, 'global');\n\nexport const setExternalSkillGithubUrl = (input: SetExternalSkillGithubUrlInput) => createAction<SetExternalSkillGithubUrlAction>('SET_EXTERNAL_SKILL_GITHUB_URL', { ...input }, undefined, SetExternalSkillGithubUrlInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { DisableMastraInputSchema, EnableMastraInputSchema, SetEnableChatInputSchema } from '../schema/zod.js';\nimport type { DisableMastraInput, EnableMastraInput, SetEnableChatInput } from '../types.js';\nimport type { DisableMastraAction, EnableMastraAction, SetEnableChatAction } from './actions.js';\n\nexport const enableMastra = (input: EnableMastraInput) => createAction<EnableMastraAction>('ENABLE_MASTRA', { ...input }, undefined, EnableMastraInputSchema, 'global');\n\nexport const disableMastra = (input: DisableMastraInput) => createAction<DisableMastraAction>('DISABLE_MASTRA', { ...input }, undefined, DisableMastraInputSchema, 'global');\n\nexport const setEnableChat = (input: SetEnableChatInput) => createAction<SetEnableChatAction>('SET_ENABLE_CHAT', { ...input }, undefined, SetEnableChatInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { SetPowerhouseLevelInputSchema } from '../schema/zod.js';\nimport type { SetPowerhouseLevelInput } from '../types.js';\nimport type { SetPowerhouseLevelAction } from './actions.js';\n\nexport const setPowerhouseLevel = (input: SetPowerhouseLevelInput) => createAction<SetPowerhouseLevelAction>('SET_POWERHOUSE_LEVEL', { ...input }, undefined, SetPowerhouseLevelInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { DisableRoutineInputSchema, EnableRoutineInputSchema } from '../schema/zod.js';\nimport type { DisableRoutineInput, EnableRoutineInput } from '../types.js';\nimport type { DisableRoutineAction, EnableRoutineAction } from './actions.js';\n\nexport const enableRoutine = (input: EnableRoutineInput) => createAction<EnableRoutineAction>('ENABLE_ROUTINE', { ...input }, undefined, EnableRoutineInputSchema, 'global');\n\nexport const disableRoutine = (input: DisableRoutineInput) => createAction<DisableRoutineAction>('DISABLE_ROUTINE', { ...input }, undefined, DisableRoutineInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { SetDescriptionInputSchema, SetPackageIdentifierInputSchema, SetVersionInputSchema } from '../schema/zod.js';\nimport type { SetDescriptionInput, SetPackageIdentifierInput, SetVersionInput } from '../types.js';\nimport type { SetDescriptionAction, SetPackageIdentifierAction, SetVersionAction } from './actions.js';\n\nexport const setDescription = (input: SetDescriptionInput) => createAction<SetDescriptionAction>('SET_DESCRIPTION', { ...input }, undefined, SetDescriptionInputSchema, 'global');\n\nexport const setVersion = (input: SetVersionInput) => createAction<SetVersionAction>('SET_VERSION', { ...input }, undefined, SetVersionInputSchema, 'global');\n\nexport const setPackageIdentifier = (input: SetPackageIdentifierInput) => createAction<SetPackageIdentifierAction>('SET_PACKAGE_IDENTIFIER', { ...input }, undefined, SetPackageIdentifierInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { ImportSpecInputSchema } from '../schema/zod.js';\nimport type { ImportSpecInput } from '../types.js';\nimport type { ImportSpecAction } from './actions.js';\n\nexport const importSpec = (input: ImportSpecInput) => createAction<ImportSpecAction>('IMPORT_SPEC', { ...input }, undefined, ImportSpecInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport {\n AddAgentProfileRefInputSchema,\n AddAgentSkillInputSchema,\n AddAgentToolPatternInputSchema,\n RemoveAgentProfileRefInputSchema,\n RemoveAgentSkillInputSchema,\n RemoveAgentToolPatternInputSchema,\n ReorderAgentProfileRefsInputSchema,\n SetAgentModelInputSchema,\n} from '../schema/zod.js';\nimport type { AddAgentProfileRefInput, AddAgentSkillInput, AddAgentToolPatternInput, RemoveAgentProfileRefInput, RemoveAgentSkillInput, RemoveAgentToolPatternInput, ReorderAgentProfileRefsInput, SetAgentModelInput } from '../types.js';\nimport type { AddAgentProfileRefAction, AddAgentSkillAction, AddAgentToolPatternAction, RemoveAgentProfileRefAction, RemoveAgentSkillAction, RemoveAgentToolPatternAction, ReorderAgentProfileRefsAction, SetAgentModelAction } from './actions.js';\n\nexport const setAgentModel = (input: SetAgentModelInput) => createAction<SetAgentModelAction>('SET_AGENT_MODEL', { ...input }, undefined, SetAgentModelInputSchema, 'global');\n\nexport const addAgentProfileRef = (input: AddAgentProfileRefInput) => createAction<AddAgentProfileRefAction>('ADD_AGENT_PROFILE_REF', { ...input }, undefined, AddAgentProfileRefInputSchema, 'global');\n\nexport const removeAgentProfileRef = (input: RemoveAgentProfileRefInput) => createAction<RemoveAgentProfileRefAction>('REMOVE_AGENT_PROFILE_REF', { ...input }, undefined, RemoveAgentProfileRefInputSchema, 'global');\n\nexport const reorderAgentProfileRefs = (input: ReorderAgentProfileRefsInput) => createAction<ReorderAgentProfileRefsAction>('REORDER_AGENT_PROFILE_REFS', { ...input }, undefined, ReorderAgentProfileRefsInputSchema, 'global');\n\nexport const addAgentSkill = (input: AddAgentSkillInput) => createAction<AddAgentSkillAction>('ADD_AGENT_SKILL', { ...input }, undefined, AddAgentSkillInputSchema, 'global');\n\nexport const removeAgentSkill = (input: RemoveAgentSkillInput) => createAction<RemoveAgentSkillAction>('REMOVE_AGENT_SKILL', { ...input }, undefined, RemoveAgentSkillInputSchema, 'global');\n\nexport const addAgentToolPattern = (input: AddAgentToolPatternInput) => createAction<AddAgentToolPatternAction>('ADD_AGENT_TOOL_PATTERN', { ...input }, undefined, AddAgentToolPatternInputSchema, 'global');\n\nexport const removeAgentToolPattern = (input: RemoveAgentToolPatternInput) => createAction<RemoveAgentToolPatternAction>('REMOVE_AGENT_TOOL_PATTERN', { ...input }, undefined, RemoveAgentToolPatternInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { ClearMainAgentDescriptionInputSchema, ClearMainAgentImageInputSchema, SetMainAgentDescriptionInputSchema, SetMainAgentImageInputSchema, SetMainAgentNameInputSchema } from '../schema/zod.js';\nimport type { ClearMainAgentDescriptionInput, ClearMainAgentImageInput, SetMainAgentDescriptionInput, SetMainAgentImageInput, SetMainAgentNameInput } from '../types.js';\nimport type { ClearMainAgentDescriptionAction, ClearMainAgentImageAction, SetMainAgentDescriptionAction, SetMainAgentImageAction, SetMainAgentNameAction } from './actions.js';\n\nexport const setMainAgentName = (input: SetMainAgentNameInput) => createAction<SetMainAgentNameAction>('SET_MAIN_AGENT_NAME', { ...input }, undefined, SetMainAgentNameInputSchema, 'global');\n\nexport const setMainAgentDescription = (input: SetMainAgentDescriptionInput) => createAction<SetMainAgentDescriptionAction>('SET_MAIN_AGENT_DESCRIPTION', { ...input }, undefined, SetMainAgentDescriptionInputSchema, 'global');\n\nexport const clearMainAgentDescription = (input: ClearMainAgentDescriptionInput) => createAction<ClearMainAgentDescriptionAction>('CLEAR_MAIN_AGENT_DESCRIPTION', { ...input }, undefined, ClearMainAgentDescriptionInputSchema, 'global');\n\nexport const setMainAgentImage = (input: SetMainAgentImageInput) => createAction<SetMainAgentImageAction>('SET_MAIN_AGENT_IMAGE', { ...input }, undefined, SetMainAgentImageInputSchema, 'global');\n\nexport const clearMainAgentImage = (input: ClearMainAgentImageInput) => createAction<ClearMainAgentImageAction>('CLEAR_MAIN_AGENT_IMAGE', { ...input }, undefined, ClearMainAgentImageInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { AddModelInputSchema, RemoveModelInputSchema } from '../schema/zod.js';\nimport type { AddModelInput, RemoveModelInput } from '../types.js';\nimport type { AddModelAction, RemoveModelAction } from './actions.js';\n\nexport const addModel = (input: AddModelInput) => createAction<AddModelAction>('ADD_MODEL', { ...input }, undefined, AddModelInputSchema, 'global');\n\nexport const removeModel = (input: RemoveModelInput) => createAction<RemoveModelAction>('REMOVE_MODEL', { ...input }, undefined, RemoveModelInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { AddProfileInputSchema, RemoveProfileInputSchema, ReorderProfilesInputSchema, UpdateProfileInputSchema } from '../schema/zod.js';\nimport type { AddProfileInput, RemoveProfileInput, ReorderProfilesInput, UpdateProfileInput } from '../types.js';\nimport type { AddProfileAction, RemoveProfileAction, ReorderProfilesAction, UpdateProfileAction } from './actions.js';\n\nexport const addProfile = (input: AddProfileInput) => createAction<AddProfileAction>('ADD_PROFILE', { ...input }, undefined, AddProfileInputSchema, 'global');\n\nexport const updateProfile = (input: UpdateProfileInput) => createAction<UpdateProfileAction>('UPDATE_PROFILE', { ...input }, undefined, UpdateProfileInputSchema, 'global');\n\nexport const removeProfile = (input: RemoveProfileInput) => createAction<RemoveProfileAction>('REMOVE_PROFILE', { ...input }, undefined, RemoveProfileInputSchema, 'global');\n\nexport const reorderProfiles = (input: ReorderProfilesInput) => createAction<ReorderProfilesAction>('REORDER_PROFILES', { ...input }, undefined, ReorderProfilesInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { AddSubAgentInputSchema, RemoveSubAgentInputSchema, SetSubAgentDescriptionInputSchema, SetSubAgentNameInputSchema } from '../schema/zod.js';\nimport type { AddSubAgentInput, RemoveSubAgentInput, SetSubAgentDescriptionInput, SetSubAgentNameInput } from '../types.js';\nimport type { AddSubAgentAction, RemoveSubAgentAction, SetSubAgentDescriptionAction, SetSubAgentNameAction } from './actions.js';\n\nexport const addSubAgent = (input: AddSubAgentInput) => createAction<AddSubAgentAction>('ADD_SUB_AGENT', { ...input }, undefined, AddSubAgentInputSchema, 'global');\n\nexport const removeSubAgent = (input: RemoveSubAgentInput) => createAction<RemoveSubAgentAction>('REMOVE_SUB_AGENT', { ...input }, undefined, RemoveSubAgentInputSchema, 'global');\n\nexport const setSubAgentName = (input: SetSubAgentNameInput) => createAction<SetSubAgentNameAction>('SET_SUB_AGENT_NAME', { ...input }, undefined, SetSubAgentNameInputSchema, 'global');\n\nexport const setSubAgentDescription = (input: SetSubAgentDescriptionInput) => createAction<SetSubAgentDescriptionAction>('SET_SUB_AGENT_DESCRIPTION', { ...input }, undefined, SetSubAgentDescriptionInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { AddPackageDocumentTypeInputSchema, AddPowerhousePackageInputSchema, RemovePackageDocumentTypeInputSchema, RemovePowerhousePackageInputSchema, SetPackageVersionInputSchema } from '../schema/zod.js';\nimport type { AddPackageDocumentTypeInput, AddPowerhousePackageInput, RemovePackageDocumentTypeInput, RemovePowerhousePackageInput, SetPackageVersionInput } from '../types.js';\nimport type { AddPackageDocumentTypeAction, AddPowerhousePackageAction, RemovePackageDocumentTypeAction, RemovePowerhousePackageAction, SetPackageVersionAction } from './actions.js';\n\nexport const addPowerhousePackage = (input: AddPowerhousePackageInput) => createAction<AddPowerhousePackageAction>('ADD_POWERHOUSE_PACKAGE', { ...input }, undefined, AddPowerhousePackageInputSchema, 'global');\n\nexport const removePowerhousePackage = (input: RemovePowerhousePackageInput) => createAction<RemovePowerhousePackageAction>('REMOVE_POWERHOUSE_PACKAGE', { ...input }, undefined, RemovePowerhousePackageInputSchema, 'global');\n\nexport const addPackageDocumentType = (input: AddPackageDocumentTypeInput) => createAction<AddPackageDocumentTypeAction>('ADD_PACKAGE_DOCUMENT_TYPE', { ...input }, undefined, AddPackageDocumentTypeInputSchema, 'global');\n\nexport const removePackageDocumentType = (input: RemovePackageDocumentTypeInput) => createAction<RemovePackageDocumentTypeAction>('REMOVE_PACKAGE_DOCUMENT_TYPE', { ...input }, undefined, RemovePackageDocumentTypeInputSchema, 'global');\n\nexport const setPackageVersion = (input: SetPackageVersionInput) => createAction<SetPackageVersionAction>('SET_PACKAGE_VERSION', { ...input }, undefined, SetPackageVersionInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { BumpVersionInputSchema, PublishDevInputSchema, PublishProductionInputSchema, PublishStagingInputSchema, SetPublishStatusInputSchema } from '../schema/zod.js';\nimport type { BumpVersionInput, PublishDevInput, PublishProductionInput, PublishStagingInput, SetPublishStatusInput } from '../types.js';\nimport type { BumpVersionAction, PublishDevAction, PublishProductionAction, PublishStagingAction, SetPublishStatusAction } from './actions.js';\n\nexport const bumpVersion = (input: BumpVersionInput) => createAction<BumpVersionAction>('BUMP_VERSION', { ...input }, undefined, BumpVersionInputSchema, 'global');\n\nexport const publishDev = (input: PublishDevInput) => createAction<PublishDevAction>('PUBLISH_DEV', { ...input }, undefined, PublishDevInputSchema, 'global');\n\nexport const publishStaging = (input: PublishStagingInput) => createAction<PublishStagingAction>('PUBLISH_STAGING', { ...input }, undefined, PublishStagingInputSchema, 'global');\n\nexport const publishProduction = (input: PublishProductionInput) => createAction<PublishProductionAction>('PUBLISH_PRODUCTION', { ...input }, undefined, PublishProductionInputSchema, 'global');\n\nexport const setPublishStatus = (input: SetPublishStatusInput) => createAction<SetPublishStatusAction>('SET_PUBLISH_STATUS', { ...input }, undefined, SetPublishStatusInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { baseActions } from 'document-model';\nimport {\n phClintProjectDeploymentActions,\n phClintProjectExternalSkillsActions,\n phClintProjectFeaturesMastraActions,\n phClintProjectFeaturesPowerhouseActions,\n phClintProjectFeaturesRoutineActions,\n phClintProjectIdentityActions,\n phClintProjectLifecycleActions,\n phClintProjectMastraAgentBindingsActions,\n phClintProjectMastraMainAgentActions,\n phClintProjectMastraModelsActions,\n phClintProjectMastraProfilesActions,\n phClintProjectMastraSubAgentsActions,\n phClintProjectPowerhousePackagesActions,\n phClintProjectPublishingActions,\n} from './gen/creators.js';\n\n/** Actions for the PhClintProject document model */\n\nexport const actions = {\n ...baseActions,\n ...phClintProjectIdentityActions,\n ...phClintProjectFeaturesPowerhouseActions,\n ...phClintProjectFeaturesRoutineActions,\n ...phClintProjectPowerhousePackagesActions,\n ...phClintProjectExternalSkillsActions,\n ...phClintProjectPublishingActions,\n ...phClintProjectLifecycleActions,\n ...phClintProjectDeploymentActions,\n ...phClintProjectFeaturesMastraActions,\n ...phClintProjectMastraModelsActions,\n ...phClintProjectMastraProfilesActions,\n ...phClintProjectMastraMainAgentActions,\n ...phClintProjectMastraSubAgentsActions,\n ...phClintProjectMastraAgentBindingsActions,\n};\n","import type { DocumentModelGlobalState } from 'document-model';\n\nexport const documentModel: DocumentModelGlobalState = {\n id: 'powerhouse/ph-clint-project',\n name: 'PhClintProject',\n author: {\n name: 'Powerhouse Inc.',\n website: 'https://powerhouse.inc',\n },\n extension: 'pcp',\n description:\n 'A ph-clint implementation project specification. Drives code generation of a ph-clint CLI project: identity fields (name, scope, version, description, bin) plus three feature toggles (Powerhouse, Mastra, Routine). Enabling Powerhouse is irreversible; enabling Mastra auto-enables Routine; disabling Routine is blocked while Mastra is on.',\n specifications: [\n {\n state: {\n local: {\n schema: '',\n examples: [],\n initialValue: '',\n },\n global: {\n schema:\n 'type PhClintProjectState {\\n name: String\\n scope: String\\n version: String!\\n description: String!\\n features: PhClintFeatures!\\n packages: [PowerhousePackage!]!\\n externalSkills: [ExternalSkill!]!\\n publishHistory: [PublishRecord!]!\\n deployment: PhClintDeployment!\\n}\\n\\ntype PhClintFeatures {\\n powerhouse: PowerhouseLevel!\\n mastra: PhClintMastraFeature!\\n routine: PhClintRoutineFeature!\\n}\\n\\nenum PowerhouseLevel {\\n Disabled\\n Reactor\\n Switchboard\\n Connect\\n}\\n\\ntype PhClintMastraFeature {\\n enabled: Boolean!\\n mainAgent: PhClintMainAgent\\n subAgents: [PhClintSubAgent!]!\\n models: [PhClintAgentModel!]!\\n profiles: [PhClintAgentProfile!]!\\n common: PhClintMastraCommon!\\n}\\n\\ntype PhClintMainAgent {\\n id: OID!\\n name: String!\\n description: String\\n attachment: String\\n modelId: OID!\\n profileIds: [OID!]!\\n skills: [String!]!\\n toolPatterns: [String!]!\\n}\\n\\ntype PhClintSubAgent {\\n id: OID!\\n name: String!\\n description: String!\\n modelId: OID!\\n profileIds: [OID!]!\\n skills: [String!]!\\n toolPatterns: [String!]!\\n}\\n\\ntype PhClintMastraCommon {\\n enableChat: Boolean!\\n}\\n\\ntype PhClintAgentModel {\\n id: OID!\\n}\\n\\ntype PhClintAgentProfile {\\n id: OID!\\n title: String!\\n content: String!\\n}\\n\\ntype PhClintRoutineFeature {\\n enabled: Boolean!\\n}\\n\\ntype PowerhousePackage {\\n id: OID!\\n packageName: String!\\n documentTypes: [String!]!\\n version: String\\n managed: Boolean!\\n}\\n\\ntype ExternalSkill {\\n id: OID!\\n name: String!\\n githubUrl: URL!\\n}\\n\\nenum PublishTag {\\n Dev\\n Staging\\n Production\\n}\\n\\nenum PublishStatus {\\n Pending\\n InProgress\\n Succeeded\\n Failed\\n}\\n\\ntype PublishRecord {\\n id: OID!\\n tag: PublishTag!\\n version: String!\\n timestamp: DateTime!\\n status: PublishStatus!\\n}\\n\\ntype PhClintDeployment {\\n proxyEnabled: Boolean!\\n observabilityEnabled: Boolean!\\n supportedResources: [String!]!\\n}',\n examples: [],\n initialValue:\n '{\\n \"name\": null,\\n \"scope\": null,\\n \"version\": \"0.1.0\",\\n \"description\": \"\",\\n \"features\": {\\n \"powerhouse\": \"Disabled\",\\n \"mastra\": {\\n \"enabled\": false,\\n \"mainAgent\": null,\\n \"subAgents\": [],\\n \"models\": [],\\n \"profiles\": [],\\n \"common\": { \"enableChat\": false }\\n },\\n \"routine\": { \"enabled\": false }\\n },\\n \"packages\": [],\\n \"externalSkills\": [],\\n \"publishHistory\": [],\\n \"deployment\": {\\n \"proxyEnabled\": false,\\n \"observabilityEnabled\": false,\\n \"supportedResources\": [\\n \"vetra-agent-s\",\\n \"vetra-agent-m\",\\n \"vetra-agent-l\",\\n \"vetra-agent-xl\",\\n \"vetra-agent-xxl\"\\n ]\\n }\\n}',\n },\n },\n modules: [\n {\n id: 'm-identity',\n name: 'identity',\n description: 'Package identity fields: name, scope, version, description, bin',\n operations: [\n {\n id: 'o-set-description',\n name: 'SET_DESCRIPTION',\n description: 'Set the package description.',\n schema: 'input SetDescriptionInput {\\n description: String!\\n}',\n template: 'Set the package description.',\n reducer: 'state.description = action.input.description;',\n errors: [],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-version',\n name: 'SET_VERSION',\n description: 'Set the package version. Must be a valid semver string.',\n schema: 'input SetVersionInput {\\n version: String!\\n}',\n template: 'Set the package version. Must be a valid semver string.',\n reducer: 'if (!/^\\\\d+\\\\.\\\\d+\\\\.\\\\d+(?:-[0-9A-Za-z.-]+)?(?:\\\\+[0-9A-Za-z.-]+)?$/.test(action.input.version)) {\\n throw new InvalidVersionError(`Invalid version: ${action.input.version}`);\\n}\\nstate.version = action.input.version;',\n errors: [\n {\n id: 'e-set-version-invalid',\n name: 'InvalidVersionError',\n code: 'INVALID_VERSION',\n description: 'The version must be a valid semver string (major.minor.patch, optionally with prerelease/build metadata).',\n template: 'Invalid version: {{version}}',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-package-identifier',\n name: 'SET_PACKAGE_IDENTIFIER',\n description: \"Set the package identifier. Parses scope and name from a string like '@scope/name-cli' or just 'name-cli'. Auto-adds '-cli' suffix if missing, stores scope with '@' prefix.\",\n schema: 'input SetPackageIdentifierInput {\\n identifier: String!\\n}',\n template: \"Set the package identifier. Parses scope and name from a string like '@scope/name-cli' or just 'name-cli'.\",\n reducer:\n \"const trimmed = action.input.identifier.trim();\\nif (!trimmed) {\\n throw new InvalidPackageIdentifierError('Package identifier must not be empty');\\n}\\nlet scopePart = null;\\nlet namePart = trimmed;\\nif (trimmed.includes('/')) {\\n const parts = trimmed.split('/');\\n if (parts.length !== 2 || !parts[0] || !parts[1]) {\\n throw new InvalidPackageIdentifierError(`Invalid package identifier: ${trimmed}`);\\n }\\n scopePart = parts[0].replace(/^@/, '');\\n namePart = parts[1];\\n}\\nif (scopePart !== null) {\\n if (!/^[a-z][a-z0-9-]*$/.test(scopePart)) {\\n throw new InvalidPackageIdentifierError(`Invalid scope: ${scopePart}`);\\n }\\n}\\nif (!namePart.endsWith('-cli')) {\\n namePart = namePart + '-cli';\\n}\\nif (!/^[a-z][a-z0-9-]*$/.test(namePart)) {\\n throw new InvalidPackageIdentifierError(`Invalid package name: ${namePart}`);\\n}\\nstate.scope = scopePart ? `@${scopePart}` : null;\\nstate.name = namePart;\\nconst managed = state.packages.find((p) => p.managed);\\nif (managed) {\\n const appBase = namePart.replace(/-cli$/, '-app');\\n managed.packageName = scopePart ? `@${scopePart}/${appBase}` : appBase;\\n managed.id = `app-${namePart}`;\\n}\",\n errors: [\n {\n id: 'e-invalid-package-identifier',\n name: 'InvalidPackageIdentifierError',\n code: 'INVALID_PACKAGE_IDENTIFIER',\n description: 'The package identifier is invalid. Must be a valid npm package name with optional scope.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-features-powerhouse',\n name: 'features_powerhouse',\n description: 'Powerhouse integration level. Ordered enum: Disabled < Reactor < Switchboard < Connect. Once above Disabled, cannot go back to Disabled (irreversible migration).',\n operations: [\n {\n id: 'o-set-powerhouse-level',\n name: 'SET_POWERHOUSE_LEVEL',\n description: 'Set the Powerhouse integration level. Ordered: Disabled < Reactor < Switchboard < Connect. Lowering below Reactor once above Disabled is not allowed (irreversible migration).',\n schema: 'input SetPowerhouseLevelInput {\\n level: PowerhouseLevel!\\n skipAutoProxy: Boolean\\n}',\n template: 'Set the Powerhouse integration level. Ordered: Disabled < Reactor < Switchboard < Connect. Lowering below Reactor once above Disabled is not allowed (irreversible migration).',\n reducer:\n \"const LEVELS = ['Disabled', 'Reactor', 'Switchboard', 'Connect'];\\nconst current = LEVELS.indexOf(state.features.powerhouse);\\nconst next = LEVELS.indexOf(action.input.level);\\nif (current >= 1 && next < 1) {\\n throw new CannotLowerPowerhouseError(\\n 'Cannot lower Powerhouse level below Reactor once enabled',\\n );\\n}\\nstate.features.powerhouse = action.input.level;\\nif (current === 0 && next >= 1) {\\n const hasManaged = state.packages.some((p) => p.managed);\\n if (!hasManaged) {\\n const baseName = state.name\\n ? state.name.replace(/-cli$/, '-app')\\n : 'app';\\n const appName =\\n state.scope && state.name\\n ? `${state.scope}/${baseName}`\\n : baseName;\\n state.packages.push({\\n id: `app-${state.name || 'managed'}`,\\n packageName: appName,\\n documentTypes: ['*/*'],\\n version: null,\\n managed: true,\\n });\\n }\\n}\\nif (next >= 2 && !action.input.skipAutoProxy) {\\n state.deployment.proxyEnabled = true;\\n}\",\n errors: [\n {\n id: 'e-cannot-lower-powerhouse',\n name: 'CannotLowerPowerhouseError',\n code: 'CANNOT_LOWER_POWERHOUSE',\n description: 'Cannot lower the Powerhouse level below Reactor once it has been set above Disabled.',\n template: 'Cannot lower Powerhouse level below Reactor once enabled',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-features-routine',\n name: 'features_routine',\n description: 'Routine loop feature toggle.',\n operations: [\n {\n id: 'o-enable-routine',\n name: 'ENABLE_ROUTINE',\n description: 'Enable the routine loop. Idempotent.',\n schema: 'input EnableRoutineInput {\\n _: Boolean\\n}',\n template: 'Enable the routine loop. Idempotent.',\n reducer: 'state.features.routine.enabled = true;',\n errors: [],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-disable-routine',\n name: 'DISABLE_ROUTINE',\n description: 'Disable the routine loop. Always allowed.',\n schema: 'input DisableRoutineInput {\\n _: Boolean\\n}',\n template: 'Disable the routine loop.',\n reducer: 'state.features.routine.enabled = false;',\n errors: [],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-powerhouse-packages',\n name: 'powerhouse_packages',\n description: 'Manage reactor packages and their document types. The app package is auto-created when Powerhouse level goes above Disabled.',\n operations: [\n {\n id: 'o-add-powerhouse-package',\n name: 'ADD_POWERHOUSE_PACKAGE',\n description: 'Add an external reactor package. The app package is auto-managed by SET_POWERHOUSE_LEVEL.',\n schema: 'input AddPowerhousePackageInput {\\n id: OID!\\n packageName: String!\\n}',\n template: 'Add an external reactor package. The app package is auto-managed by SET_POWERHOUSE_LEVEL.',\n reducer:\n 'const exists = state.packages.find(\\n (p) =>\\n p.id === action.input.id ||\\n p.packageName === action.input.packageName,\\n);\\nif (exists) {\\n throw new DuplicatePackageError(\\n `Package already exists: ${action.input.packageName}`,\\n );\\n}\\nstate.packages.push({\\n id: action.input.id,\\n packageName: action.input.packageName,\\n documentTypes: [],\\n version: null,\\n managed: false,\\n});',\n errors: [\n {\n id: 'e-duplicate-package',\n name: 'DuplicatePackageError',\n code: 'DUPLICATE_PACKAGE',\n description: 'A package with the same ID or name already exists.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-powerhouse-package',\n name: 'REMOVE_POWERHOUSE_PACKAGE',\n description: 'Remove a reactor package. Cannot remove the auto-managed app package.',\n schema: 'input RemovePowerhousePackageInput {\\n id: OID!\\n}',\n template: 'Remove a reactor package. Cannot remove the auto-managed app package.',\n reducer:\n 'const idx = state.packages.findIndex((p) => p.id === action.input.id);\\nif (idx === -1) {\\n throw new PackageNotFoundError(`Package not found: ${action.input.id}`);\\n}\\nconst pkg = state.packages[idx];\\nif (pkg.managed) {\\n throw new CannotRemoveManagedPackageError(\\n \"Cannot remove a managed package\",\\n );\\n}\\nstate.packages.splice(idx, 1);',\n errors: [\n {\n id: 'e-package-not-found-remove',\n name: 'PackageNotFoundError',\n code: 'PACKAGE_NOT_FOUND',\n description: 'The specified package ID was not found.',\n template: '',\n },\n {\n id: 'e-cannot-remove-app-package',\n name: 'CannotRemoveAppPackageError',\n code: 'CANNOT_REMOVE_APP_PACKAGE',\n description: 'The auto-managed app package cannot be removed.',\n template: '',\n },\n {\n id: 'e-cannot-remove-managed',\n name: 'CannotRemoveManagedPackageError',\n code: 'CANNOT_REMOVE_MANAGED_PACKAGE',\n description: 'Cannot remove a managed (framework-controlled) package',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-add-package-document-type',\n name: 'ADD_PACKAGE_DOCUMENT_TYPE',\n description: 'Add a document type ID to a package (app or external).',\n schema: 'input AddPackageDocumentTypeInput {\\n packageId: OID!\\n documentType: String!\\n}',\n template: 'Add a document type ID to a package (app or external).',\n reducer:\n \"if (action.input.documentType !== '*/*' && !/^[a-z0-9-]+\\\\/[a-z0-9-]+$/.test(action.input.documentType)) {\\n throw new InvalidDocumentTypeError(\\n `Invalid document type format: ${action.input.documentType}. Expected org/name.`,\\n );\\n}\\nconst pkg = state.packages.find((p) => p.id === action.input.packageId);\\nif (!pkg) {\\n throw new PackageNotFoundError(\\n `Package not found: ${action.input.packageId}`,\\n );\\n}\\nif (action.input.documentType === '*/*') {\\n pkg.documentTypes.length = 0;\\n pkg.documentTypes.push('*/*');\\n return;\\n}\\nif (pkg.documentTypes.includes('*/*')) {\\n return;\\n}\\nif (pkg.documentTypes.includes(action.input.documentType)) {\\n throw new DuplicateDocumentTypeError(\\n `Document type already registered: ${action.input.documentType}`,\\n );\\n}\\npkg.documentTypes.push(action.input.documentType);\",\n errors: [\n {\n id: 'e-invalid-document-type',\n name: 'InvalidDocumentTypeError',\n code: 'INVALID_DOCUMENT_TYPE',\n description: 'Document type must match org/name format (e.g. powerhouse/ph-clint-project).',\n template: '',\n },\n {\n id: 'e-package-not-found-add-dt',\n name: 'PackageNotFoundError',\n code: 'PACKAGE_NOT_FOUND',\n description: 'The specified package ID was not found.',\n template: '',\n },\n {\n id: 'e-duplicate-document-type',\n name: 'DuplicateDocumentTypeError',\n code: 'DUPLICATE_DOCUMENT_TYPE',\n description: 'This document type is already registered in the package.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-package-document-type',\n name: 'REMOVE_PACKAGE_DOCUMENT_TYPE',\n description: 'Remove a document type ID from a package.',\n schema: 'input RemovePackageDocumentTypeInput {\\n packageId: OID!\\n documentType: String!\\n}',\n template: 'Remove a document type ID from a package.',\n reducer:\n 'const pkg = state.packages.find(p => p.id === action.input.packageId);\\nif (!pkg) {\\n throw new PackageNotFoundError(`Package not found: ${action.input.packageId}`);\\n}\\nconst idx = pkg.documentTypes.indexOf(action.input.documentType);\\nif (idx === -1) {\\n throw new DocumentTypeNotFoundError(`Document type not found: ${action.input.documentType}`);\\n}\\npkg.documentTypes.splice(idx, 1);',\n errors: [\n {\n id: 'e-package-not-found-rm-dt',\n name: 'PackageNotFoundError',\n code: 'PACKAGE_NOT_FOUND',\n description: 'The specified package ID was not found.',\n template: '',\n },\n {\n id: 'e-document-type-not-found',\n name: 'DocumentTypeNotFoundError',\n code: 'DOCUMENT_TYPE_NOT_FOUND',\n description: 'The specified document type was not found in this package.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-package-version',\n name: 'SET_PACKAGE_VERSION',\n description: '',\n schema: 'input SetPackageVersionInput {\\n packageId: OID!\\n version: String\\n}',\n template: '',\n reducer:\n 'const pkg = state.packages.find((p) => p.id === action.input.packageId);\\nif (!pkg) {\\n throw new PackageNotFoundError(\\n `Package not found: ${action.input.packageId}`,\\n );\\n}\\nif (action.input.version != null) {\\n const SEMVER = /^\\\\d+\\\\.\\\\d+\\\\.\\\\d+(?:-[0-9A-Za-z.-]+)?(?:\\\\+[0-9A-Za-z.-]+)?$/;\\n if (!SEMVER.test(action.input.version)) {\\n throw new InvalidVersionError(\\n `Invalid version: ${action.input.version}`,\\n );\\n }\\n}\\npkg.version = action.input.version || null;',\n errors: [\n {\n id: 'e-pkg-not-found-set-ver',\n name: 'PackageNotFoundError',\n code: 'PACKAGE_NOT_FOUND',\n description: 'Referenced package does not exist',\n template: '',\n },\n {\n id: 'e-invalid-version',\n name: 'InvalidVersionError',\n code: 'INVALID_VERSION',\n description: 'Version string is not valid semver',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-external-skills',\n name: 'external_skills',\n description: 'External skills from the skills.sh ecosystem. Each skill has a name and GitHub URL for installation.',\n operations: [\n {\n id: 'o-add-external-skill',\n name: 'ADD_EXTERNAL_SKILL',\n description: 'Add an external skill. Name must be lowercase kebab-case.',\n schema: 'input AddExternalSkillInput {\\n id: OID!\\n name: String!\\n githubUrl: URL!\\n}',\n template: 'Add an external skill. Name must be lowercase kebab-case.',\n reducer:\n 'if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {\\n throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);\\n}\\nconst exists = state.externalSkills.find(s => s.id === action.input.id || s.name === action.input.name);\\nif (exists) {\\n throw new DuplicateSkillError(`Skill already exists: ${action.input.name}`);\\n}\\nstate.externalSkills.push({\\n id: action.input.id,\\n name: action.input.name,\\n githubUrl: action.input.githubUrl,\\n});',\n errors: [\n {\n id: 'e-invalid-skill-name',\n name: 'InvalidSkillNameError',\n code: 'INVALID_SKILL_NAME',\n description: 'Skill name must be lowercase kebab-case (e.g. playwright-cli).',\n template: '',\n },\n {\n id: 'e-duplicate-skill',\n name: 'DuplicateSkillError',\n code: 'DUPLICATE_SKILL',\n description: 'A skill with the same ID or name already exists.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-external-skill',\n name: 'REMOVE_EXTERNAL_SKILL',\n description: 'Remove an external skill by ID.',\n schema: 'input RemoveExternalSkillInput {\\n id: OID!\\n}',\n template: 'Remove an external skill by ID.',\n reducer: 'const idx = state.externalSkills.findIndex(s => s.id === action.input.id);\\nif (idx === -1) {\\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\\n}\\nstate.externalSkills.splice(idx, 1);',\n errors: [\n {\n id: 'e-skill-not-found-remove',\n name: 'SkillNotFoundError',\n code: 'SKILL_NOT_FOUND',\n description: 'The specified skill ID was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-external-skill-name',\n name: 'SET_EXTERNAL_SKILL_NAME',\n description: 'Update the name of an external skill.',\n schema: 'input SetExternalSkillNameInput {\\n id: OID!\\n name: String!\\n}',\n template: 'Update the name of an external skill.',\n reducer:\n 'const skill = state.externalSkills.find(s => s.id === action.input.id);\\nif (!skill) {\\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\\n}\\nif (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {\\n throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);\\n}\\nconst duplicate = state.externalSkills.find(s => s.name === action.input.name && s.id !== action.input.id);\\nif (duplicate) {\\n throw new DuplicateSkillError(`Skill name already in use: ${action.input.name}`);\\n}\\nskill.name = action.input.name;',\n errors: [\n {\n id: 'e-skill-not-found-set-name',\n name: 'SkillNotFoundError',\n code: 'SKILL_NOT_FOUND',\n description: 'The specified skill ID was not found.',\n template: '',\n },\n {\n id: 'e-invalid-skill-name-set',\n name: 'InvalidSkillNameError',\n code: 'INVALID_SKILL_NAME',\n description: 'Skill name must be lowercase kebab-case.',\n template: '',\n },\n {\n id: 'e-duplicate-skill-set-name',\n name: 'DuplicateSkillError',\n code: 'DUPLICATE_SKILL',\n description: 'Another skill already uses this name.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-external-skill-github-url',\n name: 'SET_EXTERNAL_SKILL_GITHUB_URL',\n description: 'Update the GitHub URL of an external skill.',\n schema: 'input SetExternalSkillGithubUrlInput {\\n id: OID!\\n githubUrl: URL!\\n}',\n template: 'Update the GitHub URL of an external skill.',\n reducer: 'const skill = state.externalSkills.find(s => s.id === action.input.id);\\nif (!skill) {\\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\\n}\\nskill.githubUrl = action.input.githubUrl;',\n errors: [\n {\n id: 'e-skill-not-found-set-url',\n name: 'SkillNotFoundError',\n code: 'SKILL_NOT_FOUND',\n description: 'The specified skill ID was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-publishing',\n name: 'publishing',\n description: 'Version bumping and publish records. Tracks dev/staging/production publish intents and their status.',\n operations: [\n {\n id: 'o-bump-version',\n name: 'BUMP_VERSION',\n description: 'Bump the project version. Must be a valid semver string greater than the current version.',\n schema: 'input BumpVersionInput {\\n version: String!\\n}',\n template: 'Bump the project version. Must be a valid semver string greater than the current version.',\n reducer: 'if (!/^\\\\d+\\\\.\\\\d+\\\\.\\\\d+(?:-[0-9A-Za-z.-]+)?(?:\\\\+[0-9A-Za-z.-]+)?$/.test(action.input.version)) {\\n throw new InvalidVersionError(`Invalid version: ${action.input.version}`);\\n}\\nstate.version = action.input.version;',\n errors: [\n {\n id: 'e-invalid-version-bump',\n name: 'InvalidVersionError',\n code: 'INVALID_VERSION',\n description: 'The version must be a valid semver string.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-publish-dev',\n name: 'PUBLISH_DEV',\n description: 'Record a dev publish intent. Creates a Pending publish record.',\n schema: 'input PublishDevInput {\\n id: OID!\\n timestamp: DateTime!\\n}',\n template: 'Record a dev publish intent. Creates a Pending publish record.',\n reducer: \"state.publishHistory.push({\\n id: action.input.id,\\n tag: 'Dev',\\n version: state.version,\\n timestamp: action.input.timestamp,\\n status: 'Pending',\\n});\",\n errors: [],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-publish-staging',\n name: 'PUBLISH_STAGING',\n description: 'Record a staging publish intent. Creates a Pending publish record.',\n schema: 'input PublishStagingInput {\\n id: OID!\\n timestamp: DateTime!\\n}',\n template: 'Record a staging publish intent. Creates a Pending publish record.',\n reducer: \"state.publishHistory.push({\\n id: action.input.id,\\n tag: 'Staging',\\n version: state.version,\\n timestamp: action.input.timestamp,\\n status: 'Pending',\\n});\",\n errors: [],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-publish-production',\n name: 'PUBLISH_PRODUCTION',\n description: 'Record a production publish intent. Creates a Pending publish record.',\n schema: 'input PublishProductionInput {\\n id: OID!\\n timestamp: DateTime!\\n}',\n template: 'Record a production publish intent. Creates a Pending publish record.',\n reducer: \"state.publishHistory.push({\\n id: action.input.id,\\n tag: 'Production',\\n version: state.version,\\n timestamp: action.input.timestamp,\\n status: 'Pending',\\n});\",\n errors: [],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-publish-status',\n name: 'SET_PUBLISH_STATUS',\n description: 'Update the status of a publish record. Used by the trigger after publish completes.',\n schema: 'input SetPublishStatusInput {\\n id: OID!\\n status: PublishStatus!\\n}',\n template: 'Update the status of a publish record. Used by the trigger after publish completes.',\n reducer: 'const record = state.publishHistory.find(r => r.id === action.input.id);\\nif (!record) {\\n throw new PublishRecordNotFoundError(`Publish record not found: ${action.input.id}`);\\n}\\nrecord.status = action.input.status;',\n errors: [\n {\n id: 'e-publish-record-not-found',\n name: 'PublishRecordNotFoundError',\n code: 'PUBLISH_RECORD_NOT_FOUND',\n description: 'The specified publish record ID was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-lifecycle',\n name: 'lifecycle',\n description: 'Document lifecycle operations. IMPORT_SPEC bulk-imports a full project spec into the document.',\n operations: [\n {\n id: 'o-import-spec',\n name: 'IMPORT_SPEC',\n description: 'Bulk-import a full project spec into the document. Sets all identity fields, features, packages, and skills. Used by the multi-project boot sync.',\n schema:\n 'input ImportSpecInput {\\n name: String!\\n scope: String\\n version: String!\\n description: String!\\n powerhouse: PowerhouseLevel!\\n mastraEnabled: Boolean!\\n routineEnabled: Boolean!\\n packages: [ImportPackageInput!]!\\n externalSkills: [ImportSkillInput!]!\\n mainAgent: ImportMainAgentInput\\n subAgents: [ImportSubAgentInput!]!\\n models: [ImportModelInput!]!\\n profiles: [ImportProfileInput!]!\\n enableChat: Boolean\\n proxyEnabled: Boolean\\n observabilityEnabled: Boolean\\n supportedResources: [String!]\\n}\\n\\ninput ImportPackageInput {\\n id: OID!\\n packageName: String!\\n documentTypes: [String!]!\\n version: String\\n}\\n\\ninput ImportSkillInput {\\n id: OID!\\n name: String!\\n githubUrl: URL!\\n}\\n\\ninput ImportModelInput {\\n id: OID!\\n}\\n\\ninput ImportProfileInput {\\n id: OID!\\n title: String!\\n content: String!\\n}\\n\\ninput ImportMainAgentInput {\\n id: OID!\\n name: String!\\n description: String\\n attachment: String\\n modelId: OID!\\n profileIds: [OID!]!\\n skills: [String!]!\\n toolPatterns: [String!]!\\n}\\n\\ninput ImportSubAgentInput {\\n id: OID!\\n name: String!\\n description: String!\\n modelId: OID!\\n profileIds: [OID!]!\\n skills: [String!]!\\n toolPatterns: [String!]!\\n}',\n template: 'Bulk-import a full project spec into the document. Sets all identity fields, features, packages, and skills. Used by the multi-project boot sync.',\n reducer:\n \"state.name = action.input.name;\\nstate.scope = action.input.scope || null;\\nstate.version = action.input.version;\\nstate.description = action.input.description;\\nstate.features.powerhouse = action.input.powerhouse;\\nstate.features.mastra.enabled = action.input.mastraEnabled;\\nstate.features.routine.enabled = action.input.routineEnabled;\\n\\nconst appBase = action.input.name.replace(/-cli$/, '-app');\\nconst appPkgName = action.input.scope\\n ? `${action.input.scope}/${appBase}`\\n : appBase;\\nconst phEnabled = action.input.powerhouse !== 'Disabled';\\n\\nstate.packages = action.input.packages.map((p) => ({\\n id: p.id,\\n packageName: p.packageName,\\n documentTypes: [...p.documentTypes],\\n version: p.version || null,\\n managed: phEnabled && p.packageName === appPkgName,\\n}));\\nstate.externalSkills = action.input.externalSkills.map((s) => ({\\n id: s.id,\\n name: s.name,\\n githubUrl: s.githubUrl,\\n}));\\n\\nstate.features.mastra.models = action.input.models.map((m) => ({\\n id: m.id,\\n}));\\nstate.features.mastra.profiles = action.input.profiles.map((p) => ({\\n id: p.id,\\n title: p.title,\\n content: p.content,\\n}));\\n\\nif (action.input.mainAgent && state.features.mastra.enabled) {\\n const m = action.input.mainAgent;\\n state.features.mastra.mainAgent = {\\n id: m.id,\\n name: m.name,\\n description: m.description || null,\\n attachment: m.attachment || null,\\n modelId: m.modelId,\\n profileIds: [...m.profileIds],\\n skills: [...m.skills],\\n toolPatterns: [...m.toolPatterns],\\n };\\n} else {\\n state.features.mastra.mainAgent = null;\\n}\\n\\nif (state.features.mastra.enabled) {\\n state.features.mastra.subAgents = action.input.subAgents.map((s) => ({\\n id: s.id,\\n name: s.name,\\n description: s.description,\\n modelId: s.modelId,\\n profileIds: [...s.profileIds],\\n skills: [...s.skills],\\n toolPatterns: [...s.toolPatterns],\\n }));\\n} else {\\n state.features.mastra.subAgents = [];\\n}\\n\\nif (\\n action.input.enableChat &&\\n state.features.mastra.enabled &&\\n state.features.powerhouse !== 'Disabled'\\n) {\\n state.features.mastra.common.enableChat = true;\\n const CLINT_COMMON_PKG = '@powerhousedao/clint-common';\\n const CHAT_DOC_TYPE = 'powerhouse/chat-session';\\n const existing = state.packages.find(\\n (p) => p.packageName === CLINT_COMMON_PKG,\\n );\\n if (!existing) {\\n state.packages.push({\\n id: 'pkg-clint-common',\\n packageName: CLINT_COMMON_PKG,\\n documentTypes: [CHAT_DOC_TYPE],\\n version: null,\\n managed: true,\\n });\\n } else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) {\\n existing.documentTypes.push(CHAT_DOC_TYPE);\\n }\\n} else {\\n state.features.mastra.common.enableChat = false;\\n}\\n\\nstate.deployment.proxyEnabled = action.input.proxyEnabled ?? false;\\nstate.deployment.observabilityEnabled = action.input.observabilityEnabled ?? false;\\nstate.deployment.supportedResources = action.input.supportedResources\\n ? [...action.input.supportedResources]\\n : [];\",\n errors: [],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-deployment',\n name: 'deployment',\n description: 'Deployment settings: service announcement toggle and supported resource tiers.',\n operations: [\n {\n id: 'o-add-supported-resource',\n name: 'ADD_SUPPORTED_RESOURCE',\n description: 'Add a supported resource tier. Guards against duplicates.',\n schema: 'input AddSupportedResourceInput {\\n resource: String!\\n}',\n template: 'Add a supported resource tier. Guards against duplicates.',\n reducer:\n 'if (state.deployment.supportedResources.includes(action.input.resource)) {\\n throw new DuplicateResourceError(`Resource already exists: ${action.input.resource}`);\\n}\\nstate.deployment.supportedResources.push(action.input.resource);',\n errors: [\n {\n id: 'e-duplicate-resource',\n name: 'DuplicateResourceError',\n code: 'DUPLICATE_RESOURCE',\n description: 'This resource is already in the supported resources list.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-supported-resource',\n name: 'REMOVE_SUPPORTED_RESOURCE',\n description: 'Remove a supported resource tier.',\n schema: 'input RemoveSupportedResourceInput {\\n resource: String!\\n}',\n template: 'Remove a supported resource tier.',\n reducer:\n 'const idx = state.deployment.supportedResources.indexOf(action.input.resource);\\nif (idx === -1) {\\n throw new ResourceNotFoundError(`Resource not found: ${action.input.resource}`);\\n}\\nstate.deployment.supportedResources.splice(idx, 1);',\n errors: [\n {\n id: 'e-resource-not-found',\n name: 'ResourceNotFoundError',\n code: 'RESOURCE_NOT_FOUND',\n description: 'The specified resource was not found in the supported resources list.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-proxy-enabled',\n name: 'SET_PROXY_ENABLED',\n description: 'Toggle the embedded reverse proxy.',\n schema: 'input SetProxyEnabledInput {\\n enabled: Boolean!\\n}',\n template: 'Toggle the embedded reverse proxy.',\n reducer: 'state.deployment.proxyEnabled = action.input.enabled;',\n errors: [],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-observability-enabled',\n name: 'SET_OBSERVABILITY_ENABLED',\n description: 'Toggle the observability plugin (Sentry + OpenTelemetry).',\n schema: 'input SetObservabilityEnabledInput {\\n enabled: Boolean!\\n}',\n template: 'Toggle the observability plugin (Sentry + OpenTelemetry).',\n reducer: 'state.deployment.observabilityEnabled = action.input.enabled;',\n errors: [],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-features-mastra',\n name: 'features_mastra',\n description: 'Top-level Mastra feature toggles: enable/disable and chat integration.',\n operations: [\n {\n id: 'o-enable-mastra',\n name: 'ENABLE_MASTRA',\n description: 'Enable Mastra. Seeds mainAgent with a default model (clint/demo-agent) and a base profile. Idempotent.',\n schema: 'input EnableMastraInput {\\n agentId: OID!\\n agentName: String!\\n}',\n template: 'Enable the Mastra agent feature. Seeds mainAgent with the seeded model + profile.',\n reducer:\n \"if (!/^[a-z][a-z0-9-]*$/.test(action.input.agentId)) {\\n throw new InvalidAgentIdError(\\n `Invalid agent ID: ${action.input.agentId}. Must be lowercase kebab-case.`,\\n );\\n}\\nconst trimmedName = action.input.agentName.trim();\\nif (!trimmedName) {\\n throw new InvalidAgentNameError('Agent name must not be empty.');\\n}\\nstate.features.mastra.enabled = true;\\nif (state.features.mastra.models.length === 0) {\\n state.features.mastra.models.push({ id: 'clint/demo-agent' });\\n}\\nif (state.features.mastra.profiles.length === 0) {\\n state.features.mastra.profiles.push({ id: 'base', title: 'Base Profile', content: 'You are a helpful assistant.' });\\n}\\nconst existing = state.features.mastra.mainAgent;\\nif (!existing) {\\n state.features.mastra.mainAgent = {\\n id: action.input.agentId,\\n name: trimmedName,\\n description: null,\\n attachment: null,\\n modelId: 'clint/demo-agent',\\n profileIds: ['base'],\\n skills: [],\\n toolPatterns: [],\\n };\\n} else {\\n existing.id = action.input.agentId;\\n existing.name = trimmedName;\\n}\",\n errors: [\n {\n id: 'e-enable-mastra-invalid-id',\n name: 'InvalidAgentIdError',\n code: 'INVALID_AGENT_ID',\n description: 'The agent ID must match /^[a-z][a-z0-9-]*$/ \\u2014 lowercase kebab-case.',\n template: '',\n },\n {\n id: 'e-enable-mastra-invalid-name',\n name: 'InvalidAgentNameError',\n code: 'INVALID_AGENT_NAME',\n description: 'The agent name must not be empty after trimming.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-disable-mastra',\n name: 'DISABLE_MASTRA',\n description: 'Disable Mastra. Clears mainAgent, subAgents, models, profiles and the chat integration. Removes the auto-managed clint-common package.',\n schema: 'input DisableMastraInput {\\n _: Boolean\\n}',\n template: 'Disable the Mastra agent feature.',\n reducer:\n \"state.features.mastra.enabled = false;\\nstate.features.mastra.mainAgent = null;\\nstate.features.mastra.subAgents = [];\\nstate.features.mastra.models = [];\\nstate.features.mastra.profiles = [];\\nstate.features.mastra.common.enableChat = false;\\nconst ccIdx = state.packages.findIndex(\\n (p) => p.packageName === '@powerhousedao/clint-common' && p.managed,\\n);\\nif (ccIdx !== -1) {\\n state.packages.splice(ccIdx, 1);\\n}\",\n errors: [],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-enable-chat',\n name: 'SET_ENABLE_CHAT',\n description: 'Enable or disable the chat integration. When enabled, auto-adds @powerhousedao/clint-common as a managed package with powerhouse/chat-session doc type. When disabled, removes it if it only has that doc type.',\n schema: 'input SetEnableChatInput {\\n enabled: Boolean!\\n}',\n template: 'Toggle the chat integration feature. Requires both Mastra and Powerhouse to be enabled.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot toggle chat when Mastra is disabled.');\\n}\\nif (state.features.powerhouse === 'Disabled') {\\n throw new PowerhouseNotEnabledError('Cannot toggle chat when Powerhouse is disabled.');\\n}\\nstate.features.mastra.common.enableChat = action.input.enabled;\\nconst CLINT_COMMON_PKG = '@powerhousedao/clint-common';\\nconst CHAT_DOC_TYPE = 'powerhouse/chat-session';\\nif (action.input.enabled) {\\n const existing = state.packages.find((p) => p.packageName === CLINT_COMMON_PKG);\\n if (!existing) {\\n state.packages.push({\\n id: 'pkg-clint-common',\\n packageName: CLINT_COMMON_PKG,\\n documentTypes: [CHAT_DOC_TYPE],\\n version: null,\\n managed: true,\\n });\\n } else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) {\\n existing.documentTypes.push(CHAT_DOC_TYPE);\\n }\\n} else {\\n const idx = state.packages.findIndex(\\n (p) => p.packageName === CLINT_COMMON_PKG && p.managed,\\n );\\n if (idx !== -1) {\\n const pkg = state.packages[idx];\\n if (pkg.documentTypes.length === 1 && pkg.documentTypes[0] === CHAT_DOC_TYPE) {\\n state.packages.splice(idx, 1);\\n } else {\\n const dtIdx = pkg.documentTypes.indexOf(CHAT_DOC_TYPE);\\n if (dtIdx !== -1) pkg.documentTypes.splice(dtIdx, 1);\\n }\\n }\\n}\",\n errors: [\n {\n id: 'e-chat-mastra-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before toggling chat.',\n template: '',\n },\n {\n id: 'e-chat-powerhouse-not-enabled',\n name: 'PowerhouseNotEnabledError',\n code: 'POWERHOUSE_NOT_ENABLED',\n description: 'Powerhouse must be enabled (Reactor or above) before toggling chat.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-mastra-models',\n name: 'mastra_models',\n description: 'Model library CRUD. Models are referenced by main and sub agents via modelId.',\n operations: [\n {\n id: 'o-add-model',\n name: 'ADD_MODEL',\n description: 'Add a model to the library. ID must be provider/model-name format. First model is forced default. If isDefault is true, previous default is unset.',\n schema: 'input AddModelInput {\\n id: OID!\\n}',\n template: 'Add a model to the library.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot add model when Mastra is disabled.');\\n}\\nif (!/^[a-z0-9-]+\\\\/[a-z0-9._-]+$/.test(action.input.id)) {\\n throw new InvalidModelIdError(`Invalid model ID: ${action.input.id}. Must be provider/model-name format.`);\\n}\\nif (state.features.mastra.models.find((m) => m.id === action.input.id)) {\\n throw new DuplicateModelError(`Model already exists: ${action.input.id}`);\\n}\\nstate.features.mastra.models.push({ id: action.input.id });\",\n errors: [\n {\n id: 'e-add-model-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing models.',\n template: '',\n },\n {\n id: 'e-add-model-invalid-id',\n name: 'InvalidModelIdError',\n code: 'INVALID_MODEL_ID',\n description: 'Model ID must match provider/model-name format.',\n template: '',\n },\n {\n id: 'e-add-model-duplicate',\n name: 'DuplicateModelError',\n code: 'DUPLICATE_MODEL',\n description: 'A model with this ID already exists.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-model',\n name: 'REMOVE_MODEL',\n description: 'Remove a model from the library. Rejects when any agent (main or sub) references it. Promotes first remaining to default if removing the current default.',\n schema: 'input RemoveModelInput {\\n id: OID!\\n}',\n template: 'Remove a model from the library.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot remove model when Mastra is disabled.');\\n}\\nconst idx = state.features.mastra.models.findIndex((m) => m.id === action.input.id);\\nif (idx === -1) {\\n throw new ModelNotFoundError(`Model not found: ${action.input.id}`);\\n}\\nconst main = state.features.mastra.mainAgent;\\nconst usedByMain = !!main && main.modelId === action.input.id;\\nconst usedBySub = state.features.mastra.subAgents.some(\\n (s) => s.modelId === action.input.id,\\n);\\nif (usedByMain || usedBySub) {\\n throw new ModelInUseError(\\n `Model ${action.input.id} is in use by an agent.`,\\n );\\n}\\nstate.features.mastra.models.splice(idx, 1);\",\n errors: [\n {\n id: 'e-remove-model-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing models.',\n template: '',\n },\n {\n id: 'e-remove-model-not-found',\n name: 'ModelNotFoundError',\n code: 'MODEL_NOT_FOUND',\n description: 'The specified model was not found.',\n template: '',\n },\n {\n id: 'e-remove-model-in-use',\n name: 'ModelInUseError',\n code: 'MODEL_IN_USE',\n description: 'Cannot remove a model that is still referenced by an agent.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-mastra-profiles',\n name: 'mastra_profiles',\n description: 'Profile library CRUD. Profiles are referenced by main and sub agents via profileIds.',\n operations: [\n {\n id: 'o-add-profile',\n name: 'ADD_PROFILE',\n description: 'Add a profile to the library. Inserted before insertBefore if provided, otherwise appended.',\n schema: 'input AddProfileInput {\\n id: OID!\\n title: String!\\n content: String!\\n insertBefore: OID\\n}',\n template: 'Add a profile to the library.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot add profile when Mastra is disabled.');\\n}\\nif (!/^[a-z][a-z0-9-]*$/.test(action.input.id)) {\\n throw new InvalidProfileIdError(`Invalid profile ID: ${action.input.id}. Must be lowercase kebab-case.`);\\n}\\nif (state.features.mastra.profiles.find(p => p.id === action.input.id)) {\\n throw new DuplicateProfileError(`Profile already exists: ${action.input.id}`);\\n}\\nconst profile = {\\n id: action.input.id,\\n title: action.input.title,\\n content: action.input.content,\\n};\\nif (action.input.insertBefore) {\\n const beforeIdx = state.features.mastra.profiles.findIndex(p => p.id === action.input.insertBefore);\\n if (beforeIdx === -1) {\\n throw new ProfileNotFoundError(`insertBefore profile not found: ${action.input.insertBefore}`);\\n }\\n state.features.mastra.profiles.splice(beforeIdx, 0, profile);\\n} else {\\n state.features.mastra.profiles.push(profile);\\n}\",\n errors: [\n {\n id: 'e-add-profile-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing profiles.',\n template: '',\n },\n {\n id: 'e-add-profile-invalid-id',\n name: 'InvalidProfileIdError',\n code: 'INVALID_PROFILE_ID',\n description: 'Profile ID must match /^[a-z][a-z0-9-]*$/ \\u2014 lowercase kebab-case.',\n template: '',\n },\n {\n id: 'e-add-profile-duplicate',\n name: 'DuplicateProfileError',\n code: 'DUPLICATE_PROFILE',\n description: 'A profile with this ID already exists.',\n template: '',\n },\n {\n id: 'e-add-profile-not-found',\n name: 'ProfileNotFoundError',\n code: 'PROFILE_NOT_FOUND',\n description: 'The insertBefore profile was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-update-profile',\n name: 'UPDATE_PROFILE',\n description: \"Update an existing profile's title and/or content. Only updates provided fields.\",\n schema: 'input UpdateProfileInput {\\n id: OID!\\n title: String\\n content: String\\n}',\n template: 'Update an existing profile.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot update profile when Mastra is disabled.');\\n}\\nconst profile = state.features.mastra.profiles.find(p => p.id === action.input.id);\\nif (!profile) {\\n throw new ProfileNotFoundError(`Profile not found: ${action.input.id}`);\\n}\\nif (action.input.title) profile.title = action.input.title;\\nif (action.input.content) profile.content = action.input.content;\",\n errors: [\n {\n id: 'e-update-profile-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing profiles.',\n template: '',\n },\n {\n id: 'e-update-profile-not-found',\n name: 'ProfileNotFoundError',\n code: 'PROFILE_NOT_FOUND',\n description: 'The specified profile was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-profile',\n name: 'REMOVE_PROFILE',\n description: 'Remove a profile from the library. Rejects when any agent (main or sub) references it.',\n schema: 'input RemoveProfileInput {\\n id: OID!\\n}',\n template: 'Remove a profile from the library.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot remove profile when Mastra is disabled.');\\n}\\nconst idx = state.features.mastra.profiles.findIndex((p) => p.id === action.input.id);\\nif (idx === -1) {\\n throw new ProfileNotFoundError(`Profile not found: ${action.input.id}`);\\n}\\nconst main = state.features.mastra.mainAgent;\\nconst usedByMain = !!main && main.profileIds.includes(action.input.id);\\nconst usedBySub = state.features.mastra.subAgents.some(\\n (s) => s.profileIds.includes(action.input.id),\\n);\\nif (usedByMain || usedBySub) {\\n throw new ProfileInUseError(\\n `Profile ${action.input.id} is in use by an agent.`,\\n );\\n}\\nstate.features.mastra.profiles.splice(idx, 1);\",\n errors: [\n {\n id: 'e-remove-profile-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing profiles.',\n template: '',\n },\n {\n id: 'e-remove-profile-not-found',\n name: 'ProfileNotFoundError',\n code: 'PROFILE_NOT_FOUND',\n description: 'The specified profile was not found.',\n template: '',\n },\n {\n id: 'e-remove-profile-in-use',\n name: 'ProfileInUseError',\n code: 'PROFILE_IN_USE',\n description: 'Cannot remove a profile that is still referenced by an agent.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-reorder-profiles',\n name: 'REORDER_PROFILES',\n description: 'Move one or more profiles before another profile, or to the end if insertBefore is null.',\n schema: 'input ReorderProfilesInput {\\n ids: [OID!]!\\n insertBefore: OID\\n}',\n template: 'Reorder profiles.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot reorder profiles when Mastra is disabled.');\\n}\\nconst moving = [];\\nfor (const id of action.input.ids) {\\n const profile = state.features.mastra.profiles.find(p => p.id === id);\\n if (!profile) {\\n throw new ProfileNotFoundError(`Profile not found: ${id}`);\\n }\\n moving.push(profile);\\n}\\nstate.features.mastra.profiles = state.features.mastra.profiles.filter(p => !action.input.ids.includes(p.id));\\nif (action.input.insertBefore) {\\n const beforeIdx = state.features.mastra.profiles.findIndex(p => p.id === action.input.insertBefore);\\n if (beforeIdx === -1) {\\n throw new ProfileNotFoundError(`insertBefore profile not found: ${action.input.insertBefore}`);\\n }\\n state.features.mastra.profiles.splice(beforeIdx, 0, ...moving);\\n} else {\\n state.features.mastra.profiles.push(...moving);\\n}\",\n errors: [\n {\n id: 'e-reorder-profiles-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing profiles.',\n template: '',\n },\n {\n id: 'e-reorder-profiles-not-found',\n name: 'ProfileNotFoundError',\n code: 'PROFILE_NOT_FOUND',\n description: 'A referenced profile was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-mastra-main-agent',\n name: 'mastra_main_agent',\n description: 'Main agent identity ops. Main agent ID is set at ENABLE_MASTRA and stable thereafter \\u2014 to change it, disable then re-enable.',\n operations: [\n {\n id: 'o-set-main-agent-name',\n name: 'SET_MAIN_AGENT_NAME',\n description: \"Set the main agent's display name. Must be non-empty after trim.\",\n schema: 'input SetMainAgentNameInput {\\n name: String!\\n}',\n template: \"Set the main agent's display name.\",\n reducer:\n \"const main = state.features.mastra.mainAgent;\\nif (!state.features.mastra.enabled || !main) {\\n throw new MastraNotEnabledError(\\n 'Cannot set main agent name when Mastra is disabled.',\\n );\\n}\\nconst trimmed = action.input.name.trim();\\nif (!trimmed) {\\n throw new InvalidAgentNameError('Agent name must not be empty.');\\n}\\nmain.name = trimmed;\",\n errors: [\n {\n id: 'e-set-main-name-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing the main agent.',\n template: '',\n },\n {\n id: 'e-set-main-name-invalid',\n name: 'InvalidAgentNameError',\n code: 'INVALID_AGENT_NAME',\n description: 'The agent name must not be empty after trimming.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-main-agent-description',\n name: 'SET_MAIN_AGENT_DESCRIPTION',\n description: \"Set the main agent's description.\",\n schema: 'input SetMainAgentDescriptionInput {\\n description: String!\\n}',\n template: \"Set the main agent's description.\",\n reducer:\n \"const main = state.features.mastra.mainAgent;\\nif (!state.features.mastra.enabled || !main) {\\n throw new MastraNotEnabledError(\\n 'Cannot set main agent description when Mastra is disabled.',\\n );\\n}\\nmain.description = action.input.description;\",\n errors: [\n {\n id: 'e-set-main-desc-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing the main agent.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-clear-main-agent-description',\n name: 'CLEAR_MAIN_AGENT_DESCRIPTION',\n description: \"Clear the main agent's description.\",\n schema: 'input ClearMainAgentDescriptionInput {\\n _: Boolean\\n}',\n template: \"Clear the main agent's description.\",\n reducer:\n \"const main = state.features.mastra.mainAgent;\\nif (!state.features.mastra.enabled || !main) {\\n throw new MastraNotEnabledError(\\n 'Cannot clear main agent description when Mastra is disabled.',\\n );\\n}\\nmain.description = null;\",\n errors: [\n {\n id: 'e-clear-main-desc-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing the main agent.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-main-agent-image',\n name: 'SET_MAIN_AGENT_IMAGE',\n description: \"Set the main agent's avatar attachment ref.\",\n schema: 'input SetMainAgentImageInput {\\n attachment: String!\\n}',\n template: \"Set the main agent's avatar.\",\n reducer:\n \"const main = state.features.mastra.mainAgent;\\nif (!state.features.mastra.enabled || !main) {\\n throw new MastraNotEnabledError(\\n 'Cannot set main agent image when Mastra is disabled.',\\n );\\n}\\nif (!action.input.attachment.startsWith('attachment://')) {\\n throw new InvalidAgentImageError(\\n 'Agent image must be an attachment ref (attachment://...)',\\n );\\n}\\nmain.attachment = action.input.attachment;\",\n errors: [\n {\n id: 'e-set-main-image-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing the main agent.',\n template: '',\n },\n {\n id: 'e-set-main-image-invalid',\n name: 'InvalidAgentImageError',\n code: 'INVALID_AGENT_IMAGE',\n description: 'Agent image must be an attachment ref',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-clear-main-agent-image',\n name: 'CLEAR_MAIN_AGENT_IMAGE',\n description: \"Clear the main agent's avatar.\",\n schema: 'input ClearMainAgentImageInput {\\n _: Boolean\\n}',\n template: \"Clear the main agent's avatar.\",\n reducer:\n \"const main = state.features.mastra.mainAgent;\\nif (!state.features.mastra.enabled || !main) {\\n throw new MastraNotEnabledError(\\n 'Cannot clear main agent image when Mastra is disabled.',\\n );\\n}\\nmain.attachment = null;\",\n errors: [\n {\n id: 'e-clear-main-image-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing the main agent.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-mastra-sub-agents',\n name: 'mastra_sub_agents',\n description: 'Sub-agent CRUD. Sub-agent ids are unique across the main agent and all other sub-agents.',\n operations: [\n {\n id: 'o-add-sub-agent',\n name: 'ADD_SUB_AGENT',\n description: 'Add a sub-agent. ID must be lowercase kebab-case and unique (across main + sub agents). modelId must exist in the model library. Seeds empty profileIds/skills/toolPatterns.',\n schema: 'input AddSubAgentInput {\\n id: OID!\\n name: String!\\n description: String!\\n modelId: OID!\\n}',\n template: 'Add a sub-agent.',\n reducer:\n \"const main = state.features.mastra.mainAgent;\\nif (!state.features.mastra.enabled || !main) {\\n throw new MastraNotEnabledError(\\n 'Cannot add sub-agent when Mastra is disabled.',\\n );\\n}\\nif (!/^[a-z][a-z0-9-]*$/.test(action.input.id)) {\\n throw new InvalidAgentIdError(\\n `Invalid sub-agent ID: ${action.input.id}. Must be lowercase kebab-case.`,\\n );\\n}\\nconst trimmedName = action.input.name.trim();\\nif (!trimmedName) {\\n throw new InvalidAgentNameError('Sub-agent name must not be empty.');\\n}\\nif (main.id === action.input.id) {\\n throw new DuplicateAgentIdError(\\n `Agent ID already taken by main agent: ${action.input.id}`,\\n );\\n}\\nif (state.features.mastra.subAgents.find((s) => s.id === action.input.id)) {\\n throw new DuplicateAgentIdError(\\n `Sub-agent already exists: ${action.input.id}`,\\n );\\n}\\nif (!state.features.mastra.models.find((m) => m.id === action.input.modelId)) {\\n throw new ModelReferenceNotFoundError(\\n `Model not in library: ${action.input.modelId}`,\\n );\\n}\\nstate.features.mastra.subAgents.push({\\n id: action.input.id,\\n name: trimmedName,\\n description: action.input.description,\\n modelId: action.input.modelId,\\n profileIds: [],\\n skills: [],\\n toolPatterns: [],\\n});\",\n errors: [\n {\n id: 'e-add-sub-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing sub-agents.',\n template: '',\n },\n {\n id: 'e-add-sub-invalid-id',\n name: 'InvalidAgentIdError',\n code: 'INVALID_AGENT_ID',\n description: 'Sub-agent ID must be lowercase kebab-case.',\n template: '',\n },\n {\n id: 'e-add-sub-invalid-name',\n name: 'InvalidAgentNameError',\n code: 'INVALID_AGENT_NAME',\n description: 'Sub-agent name must not be empty after trimming.',\n template: '',\n },\n {\n id: 'e-add-sub-duplicate',\n name: 'DuplicateAgentIdError',\n code: 'DUPLICATE_AGENT_ID',\n description: 'An agent with this ID already exists (main or sub).',\n template: '',\n },\n {\n id: 'e-add-sub-model-not-found',\n name: 'ModelReferenceNotFoundError',\n code: 'MODEL_REFERENCE_NOT_FOUND',\n description: 'The referenced modelId does not exist in the model library.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-sub-agent',\n name: 'REMOVE_SUB_AGENT',\n description: 'Remove a sub-agent.',\n schema: 'input RemoveSubAgentInput {\\n id: OID!\\n}',\n template: 'Remove a sub-agent.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot remove sub-agent when Mastra is disabled.');\\n}\\nconst idx = state.features.mastra.subAgents.findIndex(s => s.id === action.input.id);\\nif (idx === -1) {\\n throw new AgentNotFoundError(`Sub-agent not found: ${action.input.id}`);\\n}\\nstate.features.mastra.subAgents.splice(idx, 1);\",\n errors: [\n {\n id: 'e-remove-sub-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing sub-agents.',\n template: '',\n },\n {\n id: 'e-remove-sub-not-found',\n name: 'AgentNotFoundError',\n code: 'AGENT_NOT_FOUND',\n description: 'The specified sub-agent was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-sub-agent-name',\n name: 'SET_SUB_AGENT_NAME',\n description: \"Set a sub-agent's display name.\",\n schema: 'input SetSubAgentNameInput {\\n id: OID!\\n name: String!\\n}',\n template: \"Set a sub-agent's display name.\",\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot set sub-agent name when Mastra is disabled.');\\n}\\nconst sub = state.features.mastra.subAgents.find(s => s.id === action.input.id);\\nif (!sub) {\\n throw new AgentNotFoundError(`Sub-agent not found: ${action.input.id}`);\\n}\\nconst trimmed = action.input.name.trim();\\nif (!trimmed) {\\n throw new InvalidAgentNameError('Sub-agent name must not be empty.');\\n}\\nsub.name = trimmed;\",\n errors: [\n {\n id: 'e-set-sub-name-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing sub-agents.',\n template: '',\n },\n {\n id: 'e-set-sub-name-not-found',\n name: 'AgentNotFoundError',\n code: 'AGENT_NOT_FOUND',\n description: 'The specified sub-agent was not found.',\n template: '',\n },\n {\n id: 'e-set-sub-name-invalid',\n name: 'InvalidAgentNameError',\n code: 'INVALID_AGENT_NAME',\n description: 'Sub-agent name must not be empty after trimming.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-sub-agent-description',\n name: 'SET_SUB_AGENT_DESCRIPTION',\n description: \"Set a sub-agent's description.\",\n schema: 'input SetSubAgentDescriptionInput {\\n id: OID!\\n description: String!\\n}',\n template: \"Set a sub-agent's description.\",\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot set sub-agent description when Mastra is disabled.');\\n}\\nconst sub = state.features.mastra.subAgents.find(s => s.id === action.input.id);\\nif (!sub) {\\n throw new AgentNotFoundError(`Sub-agent not found: ${action.input.id}`);\\n}\\nsub.description = action.input.description;\",\n errors: [\n {\n id: 'e-set-sub-desc-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing sub-agents.',\n template: '',\n },\n {\n id: 'e-set-sub-desc-not-found',\n name: 'AgentNotFoundError',\n code: 'AGENT_NOT_FOUND',\n description: 'The specified sub-agent was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-mastra-agent-bindings',\n name: 'mastra_agent_bindings',\n description: 'Per-agent assignments of model, profile references, skills, and tool-name patterns. agentId resolves to main if it matches mainAgent.id, else looks up subAgents.',\n operations: [\n {\n id: 'o-set-agent-model',\n name: 'SET_AGENT_MODEL',\n description: \"Set the agent's model. modelId must exist in the model library. agentId resolves to main or a sub.\",\n schema: 'input SetAgentModelInput {\\n agentId: OID!\\n modelId: OID!\\n}',\n template: 'Bind an agent to a model.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot set agent model when Mastra is disabled.');\\n}\\nconst main = state.features.mastra.mainAgent;\\nlet agent;\\nif (main && main.id === action.input.agentId) {\\n agent = main;\\n} else {\\n agent = state.features.mastra.subAgents.find(\\n (s) => s.id === action.input.agentId,\\n );\\n}\\nif (!agent) {\\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\\n}\\nif (!state.features.mastra.models.find((m) => m.id === action.input.modelId)) {\\n throw new ModelReferenceNotFoundError(\\n `Model not in library: ${action.input.modelId}`,\\n );\\n}\\nagent.modelId = action.input.modelId;\",\n errors: [\n {\n id: 'e-set-model-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing agent bindings.',\n template: '',\n },\n {\n id: 'e-set-model-agent-not-found',\n name: 'AgentNotFoundError',\n code: 'AGENT_NOT_FOUND',\n description: 'The specified agentId resolves to neither main nor any sub-agent.',\n template: '',\n },\n {\n id: 'e-set-model-ref-not-found',\n name: 'ModelReferenceNotFoundError',\n code: 'MODEL_REFERENCE_NOT_FOUND',\n description: 'The referenced modelId does not exist in the model library.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-add-agent-profile-ref',\n name: 'ADD_AGENT_PROFILE_REF',\n description: 'Add a profile reference to an agent. profileId must exist in the profile library. Inserts before insertBefore if provided, otherwise appends. Dedup: silent if already present.',\n schema: 'input AddAgentProfileRefInput {\\n agentId: OID!\\n profileId: OID!\\n insertBefore: OID\\n}',\n template: 'Add a profile reference to an agent.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot add profile ref when Mastra is disabled.');\\n}\\nconst main = state.features.mastra.mainAgent;\\nlet agent;\\nif (main && main.id === action.input.agentId) {\\n agent = main;\\n} else {\\n agent = state.features.mastra.subAgents.find(\\n (s) => s.id === action.input.agentId,\\n );\\n}\\nif (!agent) {\\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\\n}\\nif (!state.features.mastra.profiles.find((p) => p.id === action.input.profileId)) {\\n throw new ProfileReferenceNotFoundError(\\n `Profile not in library: ${action.input.profileId}`,\\n );\\n}\\nif (agent.profileIds.includes(action.input.profileId)) {\\n return;\\n}\\nif (action.input.insertBefore) {\\n const beforeIdx = agent.profileIds.indexOf(action.input.insertBefore);\\n if (beforeIdx === -1) {\\n throw new ProfileReferenceNotFoundError(\\n `insertBefore profile not in agent's profileIds: ${action.input.insertBefore}`,\\n );\\n }\\n agent.profileIds.splice(beforeIdx, 0, action.input.profileId);\\n} else {\\n agent.profileIds.push(action.input.profileId);\\n}\",\n errors: [\n {\n id: 'e-add-profile-ref-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled.',\n template: '',\n },\n {\n id: 'e-add-profile-ref-agent-not-found',\n name: 'AgentNotFoundError',\n code: 'AGENT_NOT_FOUND',\n description: 'The specified agentId was not found.',\n template: '',\n },\n {\n id: 'e-add-profile-ref-not-found',\n name: 'ProfileReferenceNotFoundError',\n code: 'PROFILE_REFERENCE_NOT_FOUND',\n description: 'The referenced profileId does not exist in the profile library, or insertBefore is not present in the agent.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-agent-profile-ref',\n name: 'REMOVE_AGENT_PROFILE_REF',\n description: 'Remove a profile reference from an agent.',\n schema: 'input RemoveAgentProfileRefInput {\\n agentId: OID!\\n profileId: OID!\\n}',\n template: 'Remove a profile reference from an agent.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot remove profile ref when Mastra is disabled.');\\n}\\nconst main = state.features.mastra.mainAgent;\\nlet agent;\\nif (main && main.id === action.input.agentId) {\\n agent = main;\\n} else {\\n agent = state.features.mastra.subAgents.find(\\n (s) => s.id === action.input.agentId,\\n );\\n}\\nif (!agent) {\\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\\n}\\nconst idx = agent.profileIds.indexOf(action.input.profileId);\\nif (idx === -1) {\\n throw new ProfileReferenceNotFoundError(\\n `Profile not in agent's profileIds: ${action.input.profileId}`,\\n );\\n}\\nagent.profileIds.splice(idx, 1);\",\n errors: [\n {\n id: 'e-remove-profile-ref-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled.',\n template: '',\n },\n {\n id: 'e-remove-profile-ref-agent-not-found',\n name: 'AgentNotFoundError',\n code: 'AGENT_NOT_FOUND',\n description: 'The specified agentId was not found.',\n template: '',\n },\n {\n id: 'e-remove-profile-ref-not-found',\n name: 'ProfileReferenceNotFoundError',\n code: 'PROFILE_REFERENCE_NOT_FOUND',\n description: \"The profileId is not present in this agent's profileIds.\",\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-reorder-agent-profile-refs',\n name: 'REORDER_AGENT_PROFILE_REFS',\n description: \"Reorder an agent's profile references. Moves the given ids before insertBefore, or to the end if insertBefore is null.\",\n schema: 'input ReorderAgentProfileRefsInput {\\n agentId: OID!\\n ids: [OID!]!\\n insertBefore: OID\\n}',\n template: \"Reorder an agent's profile references.\",\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot reorder profile refs when Mastra is disabled.');\\n}\\nconst main = state.features.mastra.mainAgent;\\nlet agent;\\nif (main && main.id === action.input.agentId) {\\n agent = main;\\n} else {\\n agent = state.features.mastra.subAgents.find(\\n (s) => s.id === action.input.agentId,\\n );\\n}\\nif (!agent) {\\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\\n}\\nfor (const id of action.input.ids) {\\n if (!agent.profileIds.includes(id)) {\\n throw new ProfileReferenceNotFoundError(\\n `Profile not in agent's profileIds: ${id}`,\\n );\\n }\\n}\\nconst remaining = agent.profileIds.filter(\\n (id) => !action.input.ids.includes(id),\\n);\\nif (action.input.insertBefore) {\\n const beforeIdx = remaining.indexOf(action.input.insertBefore);\\n if (beforeIdx === -1) {\\n throw new ProfileReferenceNotFoundError(\\n `insertBefore profile not in agent's profileIds: ${action.input.insertBefore}`,\\n );\\n }\\n remaining.splice(beforeIdx, 0, ...action.input.ids);\\n} else {\\n remaining.push(...action.input.ids);\\n}\\nagent.profileIds = remaining;\",\n errors: [\n {\n id: 'e-reorder-refs-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled.',\n template: '',\n },\n {\n id: 'e-reorder-refs-agent-not-found',\n name: 'AgentNotFoundError',\n code: 'AGENT_NOT_FOUND',\n description: 'The specified agentId was not found.',\n template: '',\n },\n {\n id: 'e-reorder-refs-not-found',\n name: 'ProfileReferenceNotFoundError',\n code: 'PROFILE_REFERENCE_NOT_FOUND',\n description: 'A referenced profileId is not present in this agent.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-add-agent-skill',\n name: 'ADD_AGENT_SKILL',\n description: 'Add a skill name to an agent. Dedup: silent if already present.',\n schema: 'input AddAgentSkillInput {\\n agentId: OID!\\n name: String!\\n}',\n template: 'Add a skill to an agent.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot add skill when Mastra is disabled.');\\n}\\nconst main = state.features.mastra.mainAgent;\\nlet agent;\\nif (main && main.id === action.input.agentId) {\\n agent = main;\\n} else {\\n agent = state.features.mastra.subAgents.find(\\n (s) => s.id === action.input.agentId,\\n );\\n}\\nif (!agent) {\\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\\n}\\nconst trimmed = action.input.name.trim();\\nif (!/^[a-z][a-z0-9-]*$/.test(trimmed)) {\\n throw new InvalidSkillNameError(\\n `Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`,\\n );\\n}\\nif (!agent.skills.includes(trimmed)) {\\n agent.skills.push(trimmed);\\n}\",\n errors: [\n {\n id: 'e-add-skill-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled.',\n template: '',\n },\n {\n id: 'e-add-skill-agent-not-found',\n name: 'AgentNotFoundError',\n code: 'AGENT_NOT_FOUND',\n description: 'The specified agentId was not found.',\n template: '',\n },\n {\n id: 'e-add-skill-invalid',\n name: 'InvalidSkillNameError',\n code: 'INVALID_SKILL_NAME',\n description: 'Skill name must be lowercase kebab-case.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-agent-skill',\n name: 'REMOVE_AGENT_SKILL',\n description: 'Remove a skill name from an agent.',\n schema: 'input RemoveAgentSkillInput {\\n agentId: OID!\\n name: String!\\n}',\n template: 'Remove a skill from an agent.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot remove skill when Mastra is disabled.');\\n}\\nconst main = state.features.mastra.mainAgent;\\nlet agent;\\nif (main && main.id === action.input.agentId) {\\n agent = main;\\n} else {\\n agent = state.features.mastra.subAgents.find(\\n (s) => s.id === action.input.agentId,\\n );\\n}\\nif (!agent) {\\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\\n}\\nconst idx = agent.skills.indexOf(action.input.name);\\nif (idx === -1) {\\n throw new SkillNotFoundError(`Skill not on agent: ${action.input.name}`);\\n}\\nagent.skills.splice(idx, 1);\",\n errors: [\n {\n id: 'e-remove-skill-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled.',\n template: '',\n },\n {\n id: 'e-remove-skill-agent-not-found',\n name: 'AgentNotFoundError',\n code: 'AGENT_NOT_FOUND',\n description: 'The specified agentId was not found.',\n template: '',\n },\n {\n id: 'e-remove-skill-not-found',\n name: 'SkillNotFoundError',\n code: 'SKILL_NOT_FOUND',\n description: 'The skill name is not on this agent.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-add-agent-tool-pattern',\n name: 'ADD_AGENT_TOOL_PATTERN',\n description: 'Add a tool-name glob pattern to an agent. Dedup: silent if already present.',\n schema: 'input AddAgentToolPatternInput {\\n agentId: OID!\\n pattern: String!\\n}',\n template: 'Add a tool-name pattern to an agent.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot add tool pattern when Mastra is disabled.');\\n}\\nconst main = state.features.mastra.mainAgent;\\nlet agent;\\nif (main && main.id === action.input.agentId) {\\n agent = main;\\n} else {\\n agent = state.features.mastra.subAgents.find(\\n (s) => s.id === action.input.agentId,\\n );\\n}\\nif (!agent) {\\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\\n}\\nconst trimmed = action.input.pattern.trim();\\nif (!trimmed) {\\n throw new InvalidToolPatternError('Tool pattern must not be empty after trimming.');\\n}\\nif (!agent.toolPatterns.includes(trimmed)) {\\n agent.toolPatterns.push(trimmed);\\n}\",\n errors: [\n {\n id: 'e-add-pattern-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled.',\n template: '',\n },\n {\n id: 'e-add-pattern-agent-not-found',\n name: 'AgentNotFoundError',\n code: 'AGENT_NOT_FOUND',\n description: 'The specified agentId was not found.',\n template: '',\n },\n {\n id: 'e-add-pattern-invalid',\n name: 'InvalidToolPatternError',\n code: 'INVALID_TOOL_PATTERN',\n description: 'Tool pattern must not be empty after trimming.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-agent-tool-pattern',\n name: 'REMOVE_AGENT_TOOL_PATTERN',\n description: 'Remove a tool-name glob pattern from an agent.',\n schema: 'input RemoveAgentToolPatternInput {\\n agentId: OID!\\n pattern: String!\\n}',\n template: 'Remove a tool-name pattern from an agent.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot remove tool pattern when Mastra is disabled.');\\n}\\nconst main = state.features.mastra.mainAgent;\\nlet agent;\\nif (main && main.id === action.input.agentId) {\\n agent = main;\\n} else {\\n agent = state.features.mastra.subAgents.find(\\n (s) => s.id === action.input.agentId,\\n );\\n}\\nif (!agent) {\\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\\n}\\nconst idx = agent.toolPatterns.indexOf(action.input.pattern);\\nif (idx === -1) {\\n throw new ToolPatternNotFoundError(\\n `Tool pattern not on agent: ${action.input.pattern}`,\\n );\\n}\\nagent.toolPatterns.splice(idx, 1);\",\n errors: [\n {\n id: 'e-remove-pattern-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled.',\n template: '',\n },\n {\n id: 'e-remove-pattern-agent-not-found',\n name: 'AgentNotFoundError',\n code: 'AGENT_NOT_FOUND',\n description: 'The specified agentId was not found.',\n template: '',\n },\n {\n id: 'e-remove-pattern-not-found',\n name: 'ToolPatternNotFoundError',\n code: 'TOOL_PATTERN_NOT_FOUND',\n description: 'The tool pattern is not on this agent.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n ],\n version: 1,\n changeLog: [],\n },\n ],\n};\n","export type ErrorCode = 'DuplicateResourceError' | 'ResourceNotFoundError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class DuplicateResourceError extends Error implements ReducerError {\n errorCode = 'DuplicateResourceError' as ErrorCode;\n constructor(message = 'DuplicateResourceError') {\n super(message);\n }\n}\n\nexport class ResourceNotFoundError extends Error implements ReducerError {\n errorCode = 'ResourceNotFoundError' as ErrorCode;\n constructor(message = 'ResourceNotFoundError') {\n super(message);\n }\n}\n\nexport const errors = {\n AddSupportedResource: { DuplicateResourceError },\n RemoveSupportedResource: { ResourceNotFoundError },\n};\n","import type { PhClintProjectDeploymentOperations } from 'document-models/ph-clint-project/v1';\nimport { DuplicateResourceError, ResourceNotFoundError } from '../../gen/deployment/error.js';\n\nexport const phClintProjectDeploymentOperations: PhClintProjectDeploymentOperations = {\n addSupportedResourceOperation(state, action) {\n if (state.deployment.supportedResources.includes(action.input.resource)) {\n throw new DuplicateResourceError(`Resource already exists: ${action.input.resource}`);\n }\n state.deployment.supportedResources.push(action.input.resource);\n },\n removeSupportedResourceOperation(state, action) {\n const idx = state.deployment.supportedResources.indexOf(action.input.resource);\n if (idx === -1) {\n throw new ResourceNotFoundError(`Resource not found: ${action.input.resource}`);\n }\n state.deployment.supportedResources.splice(idx, 1);\n },\n setProxyEnabledOperation(state, action) {\n state.deployment.proxyEnabled = action.input.enabled;\n },\n setObservabilityEnabledOperation(state, action) {\n state.deployment.observabilityEnabled = action.input.enabled;\n },\n};\n","export type ErrorCode = 'InvalidSkillNameError' | 'DuplicateSkillError' | 'SkillNotFoundError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class InvalidSkillNameError extends Error implements ReducerError {\n errorCode = 'InvalidSkillNameError' as ErrorCode;\n constructor(message = 'InvalidSkillNameError') {\n super(message);\n }\n}\n\nexport class DuplicateSkillError extends Error implements ReducerError {\n errorCode = 'DuplicateSkillError' as ErrorCode;\n constructor(message = 'DuplicateSkillError') {\n super(message);\n }\n}\n\nexport class SkillNotFoundError extends Error implements ReducerError {\n errorCode = 'SkillNotFoundError' as ErrorCode;\n constructor(message = 'SkillNotFoundError') {\n super(message);\n }\n}\n\nexport const errors = {\n AddExternalSkill: { InvalidSkillNameError, DuplicateSkillError },\n RemoveExternalSkill: { SkillNotFoundError },\n SetExternalSkillName: {\n SkillNotFoundError,\n InvalidSkillNameError,\n DuplicateSkillError,\n },\n SetExternalSkillGithubUrl: { SkillNotFoundError },\n};\n","import type { PhClintProjectExternalSkillsOperations } from 'document-models/ph-clint-project/v1';\nimport { DuplicateSkillError, InvalidSkillNameError, SkillNotFoundError } from '../../gen/external-skills/error.js';\n\nexport const phClintProjectExternalSkillsOperations: PhClintProjectExternalSkillsOperations = {\n addExternalSkillOperation(state, action) {\n if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {\n throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);\n }\n const exists = state.externalSkills.find((s) => s.id === action.input.id || s.name === action.input.name);\n if (exists) {\n throw new DuplicateSkillError(`Skill already exists: ${action.input.name}`);\n }\n state.externalSkills.push({\n id: action.input.id,\n name: action.input.name,\n githubUrl: action.input.githubUrl,\n });\n },\n removeExternalSkillOperation(state, action) {\n const idx = state.externalSkills.findIndex((s) => s.id === action.input.id);\n if (idx === -1) {\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\n }\n state.externalSkills.splice(idx, 1);\n },\n setExternalSkillNameOperation(state, action) {\n const skill = state.externalSkills.find((s) => s.id === action.input.id);\n if (!skill) {\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\n }\n if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {\n throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);\n }\n const duplicate = state.externalSkills.find((s) => s.name === action.input.name && s.id !== action.input.id);\n if (duplicate) {\n throw new DuplicateSkillError(`Skill name already in use: ${action.input.name}`);\n }\n skill.name = action.input.name;\n },\n setExternalSkillGithubUrlOperation(state, action) {\n const skill = state.externalSkills.find((s) => s.id === action.input.id);\n if (!skill) {\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\n }\n skill.githubUrl = action.input.githubUrl;\n },\n};\n","export type ErrorCode = 'InvalidAgentIdError' | 'InvalidAgentNameError' | 'MastraNotEnabledError' | 'PowerhouseNotEnabledError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class InvalidAgentIdError extends Error implements ReducerError {\n errorCode = 'InvalidAgentIdError' as ErrorCode;\n constructor(message = 'InvalidAgentIdError') {\n super(message);\n }\n}\n\nexport class InvalidAgentNameError extends Error implements ReducerError {\n errorCode = 'InvalidAgentNameError' as ErrorCode;\n constructor(message = 'InvalidAgentNameError') {\n super(message);\n }\n}\n\nexport class MastraNotEnabledError extends Error implements ReducerError {\n errorCode = 'MastraNotEnabledError' as ErrorCode;\n constructor(message = 'MastraNotEnabledError') {\n super(message);\n }\n}\n\nexport class PowerhouseNotEnabledError extends Error implements ReducerError {\n errorCode = 'PowerhouseNotEnabledError' as ErrorCode;\n constructor(message = 'PowerhouseNotEnabledError') {\n super(message);\n }\n}\n\nexport const errors = {\n EnableMastra: { InvalidAgentIdError, InvalidAgentNameError },\n SetEnableChat: { MastraNotEnabledError, PowerhouseNotEnabledError },\n};\n","import type { PhClintProjectFeaturesMastraOperations } from 'document-models/ph-clint-project/v1';\nimport { InvalidAgentIdError, InvalidAgentNameError, MastraNotEnabledError, PowerhouseNotEnabledError } from '../../gen/features-mastra/error.js';\n\nexport const phClintProjectFeaturesMastraOperations: PhClintProjectFeaturesMastraOperations = {\n enableMastraOperation(state, action) {\n if (!/^[a-z][a-z0-9-]*$/.test(action.input.agentId)) {\n throw new InvalidAgentIdError(`Invalid agent ID: ${action.input.agentId}. Must be lowercase kebab-case.`);\n }\n const trimmedName = action.input.agentName.trim();\n if (!trimmedName) {\n throw new InvalidAgentNameError('Agent name must not be empty.');\n }\n state.features.mastra.enabled = true;\n if (state.features.mastra.models.length === 0) {\n state.features.mastra.models.push({ id: 'clint/demo-agent' });\n }\n if (state.features.mastra.profiles.length === 0) {\n state.features.mastra.profiles.push({\n id: 'base',\n title: 'Base Profile',\n content: 'You are a helpful assistant.',\n });\n }\n const existing = state.features.mastra.mainAgent;\n if (!existing) {\n state.features.mastra.mainAgent = {\n id: action.input.agentId,\n name: trimmedName,\n description: null,\n attachment: null,\n modelId: 'clint/demo-agent',\n profileIds: ['base'],\n skills: [],\n toolPatterns: [],\n };\n } else {\n existing.id = action.input.agentId;\n existing.name = trimmedName;\n }\n },\n disableMastraOperation(state) {\n state.features.mastra.enabled = false;\n state.features.mastra.mainAgent = null;\n state.features.mastra.subAgents = [];\n state.features.mastra.models = [];\n state.features.mastra.profiles = [];\n state.features.mastra.common.enableChat = false;\n const ccIdx = state.packages.findIndex((p) => p.packageName === '@powerhousedao/clint-common' && p.managed);\n if (ccIdx !== -1) {\n state.packages.splice(ccIdx, 1);\n }\n },\n setEnableChatOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot toggle chat when Mastra is disabled.');\n }\n if (state.features.powerhouse === 'Disabled') {\n throw new PowerhouseNotEnabledError('Cannot toggle chat when Powerhouse is disabled.');\n }\n state.features.mastra.common.enableChat = action.input.enabled;\n const CLINT_COMMON_PKG = '@powerhousedao/clint-common';\n const CHAT_DOC_TYPE = 'powerhouse/chat-session';\n if (action.input.enabled) {\n const existing = state.packages.find((p) => p.packageName === CLINT_COMMON_PKG);\n if (!existing) {\n state.packages.push({\n id: 'pkg-clint-common',\n packageName: CLINT_COMMON_PKG,\n documentTypes: [CHAT_DOC_TYPE],\n version: null,\n managed: true,\n });\n } else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) {\n existing.documentTypes.push(CHAT_DOC_TYPE);\n }\n } else {\n const idx = state.packages.findIndex((p) => p.packageName === CLINT_COMMON_PKG && p.managed);\n if (idx !== -1) {\n const pkg = state.packages[idx];\n if (pkg.documentTypes.length === 1 && pkg.documentTypes[0] === CHAT_DOC_TYPE) {\n state.packages.splice(idx, 1);\n } else {\n const dtIdx = pkg.documentTypes.indexOf(CHAT_DOC_TYPE);\n if (dtIdx !== -1) pkg.documentTypes.splice(dtIdx, 1);\n }\n }\n }\n },\n};\n","export type ErrorCode = 'CannotLowerPowerhouseError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class CannotLowerPowerhouseError extends Error implements ReducerError {\n errorCode = 'CannotLowerPowerhouseError' as ErrorCode;\n constructor(message = 'CannotLowerPowerhouseError') {\n super(message);\n }\n}\n\nexport const errors = {\n SetPowerhouseLevel: { CannotLowerPowerhouseError },\n};\n","import type { PhClintProjectFeaturesPowerhouseOperations } from 'document-models/ph-clint-project/v1';\nimport { CannotLowerPowerhouseError } from '../../gen/features-powerhouse/error.js';\n\nconst LEVELS = ['Disabled', 'Reactor', 'Switchboard', 'Connect'] as const;\n\nexport const phClintProjectFeaturesPowerhouseOperations: PhClintProjectFeaturesPowerhouseOperations = {\n setPowerhouseLevelOperation(state, action) {\n const current = LEVELS.indexOf(state.features.powerhouse);\n const next = LEVELS.indexOf(action.input.level);\n if (current >= 1 && next < 1) {\n throw new CannotLowerPowerhouseError('Cannot lower Powerhouse level below Reactor once enabled');\n }\n state.features.powerhouse = action.input.level;\n // Auto-create managed app package when transitioning from Disabled to enabled\n if (current === 0 && next >= 1) {\n const hasManaged = state.packages.some((p) => p.managed);\n if (!hasManaged) {\n const baseName = state.name ? state.name.replace(/-cli$/, '-app') : 'app';\n const appName = state.scope && state.name ? `${state.scope}/${baseName}` : baseName;\n state.packages.push({\n id: `app-${state.name || 'managed'}`,\n packageName: appName,\n documentTypes: ['*/*'],\n version: null,\n managed: true,\n });\n }\n }\n // Auto-enable proxy when reaching Switchboard or above\n if (next >= 2 && !action.input.skipAutoProxy) {\n state.deployment.proxyEnabled = true;\n }\n },\n};\n","import type { PhClintProjectFeaturesRoutineOperations } from 'document-models/ph-clint-project/v1';\n\nexport const phClintProjectFeaturesRoutineOperations: PhClintProjectFeaturesRoutineOperations = {\n enableRoutineOperation(state) {\n state.features.routine.enabled = true;\n },\n disableRoutineOperation(state) {\n state.features.routine.enabled = false;\n },\n};\n","export type ErrorCode = 'InvalidVersionError' | 'InvalidPackageIdentifierError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class InvalidVersionError extends Error implements ReducerError {\n errorCode = 'InvalidVersionError' as ErrorCode;\n constructor(message = 'InvalidVersionError') {\n super(message);\n }\n}\n\nexport class InvalidPackageIdentifierError extends Error implements ReducerError {\n errorCode = 'InvalidPackageIdentifierError' as ErrorCode;\n constructor(message = 'InvalidPackageIdentifierError') {\n super(message);\n }\n}\n\nexport const errors = {\n SetVersion: { InvalidVersionError },\n SetPackageIdentifier: { InvalidPackageIdentifierError },\n};\n","import type { PhClintProjectIdentityOperations } from 'document-models/ph-clint-project/v1';\nimport { InvalidPackageIdentifierError, InvalidVersionError } from '../../gen/identity/error.js';\n\nconst SEMVER_PATTERN = /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/;\nconst NAME_PATTERN = /^[a-z][a-z0-9-]*$/;\n\nexport const phClintProjectIdentityOperations: PhClintProjectIdentityOperations = {\n setVersionOperation(state, action) {\n if (!SEMVER_PATTERN.test(action.input.version)) {\n throw new InvalidVersionError(`Invalid version: ${action.input.version}`);\n }\n state.version = action.input.version;\n },\n setDescriptionOperation(state, action) {\n state.description = action.input.description;\n },\n setPackageIdentifierOperation(state, action) {\n const trimmed = action.input.identifier.trim();\n if (!trimmed) {\n throw new InvalidPackageIdentifierError('Package identifier must not be empty');\n }\n let scopePart: string | null = null;\n let namePart = trimmed;\n if (trimmed.includes('/')) {\n const parts = trimmed.split('/');\n if (parts.length !== 2 || !parts[0] || !parts[1]) {\n throw new InvalidPackageIdentifierError(`Invalid package identifier: ${trimmed}`);\n }\n scopePart = parts[0].replace(/^@/, '');\n namePart = parts[1];\n }\n if (scopePart !== null) {\n if (!NAME_PATTERN.test(scopePart)) {\n throw new InvalidPackageIdentifierError(`Invalid scope: ${scopePart}`);\n }\n }\n if (!namePart.endsWith('-cli')) {\n namePart = namePart + '-cli';\n }\n if (!NAME_PATTERN.test(namePart)) {\n throw new InvalidPackageIdentifierError(`Invalid package name: ${namePart}`);\n }\n state.scope = scopePart ? `@${scopePart}` : null;\n state.name = namePart;\n // Update managed app package name to match new identity\n const managed = state.packages.find((p) => p.managed);\n if (managed) {\n const appBase = namePart.replace(/-cli$/, '-app');\n managed.packageName = scopePart ? `@${scopePart}/${appBase}` : appBase;\n managed.id = `app-${namePart}`;\n }\n },\n};\n","import type { PhClintProjectLifecycleOperations } from 'document-models/ph-clint-project/v1';\n\nexport const phClintProjectLifecycleOperations: PhClintProjectLifecycleOperations = {\n importSpecOperation(state, action) {\n state.name = action.input.name;\n state.scope = action.input.scope || null;\n state.version = action.input.version;\n state.description = action.input.description;\n state.features.powerhouse = action.input.powerhouse;\n state.features.mastra.enabled = action.input.mastraEnabled;\n state.features.routine.enabled = action.input.routineEnabled;\n\n const appBase = action.input.name.replace(/-cli$/, '-app');\n const appPkgName = action.input.scope ? `${action.input.scope}/${appBase}` : appBase;\n const phEnabled = action.input.powerhouse !== 'Disabled';\n\n state.packages = action.input.packages.map((p) => ({\n id: p.id,\n packageName: p.packageName,\n documentTypes: [...p.documentTypes],\n version: p.version || null,\n managed: phEnabled && p.packageName === appPkgName,\n }));\n state.externalSkills = action.input.externalSkills.map((s) => ({\n id: s.id,\n name: s.name,\n githubUrl: s.githubUrl,\n }));\n\n state.features.mastra.models = action.input.models.map((m) => ({\n id: m.id,\n }));\n state.features.mastra.profiles = action.input.profiles.map((p) => ({\n id: p.id,\n title: p.title,\n content: p.content,\n }));\n\n if (action.input.mainAgent && state.features.mastra.enabled) {\n const m = action.input.mainAgent;\n state.features.mastra.mainAgent = {\n id: m.id,\n name: m.name,\n description: m.description || null,\n attachment: m.attachment || null,\n modelId: m.modelId,\n profileIds: [...m.profileIds],\n skills: [...m.skills],\n toolPatterns: [...m.toolPatterns],\n };\n } else {\n state.features.mastra.mainAgent = null;\n }\n\n if (state.features.mastra.enabled) {\n state.features.mastra.subAgents = action.input.subAgents.map((s) => ({\n id: s.id,\n name: s.name,\n description: s.description,\n modelId: s.modelId,\n profileIds: [...s.profileIds],\n skills: [...s.skills],\n toolPatterns: [...s.toolPatterns],\n }));\n } else {\n state.features.mastra.subAgents = [];\n }\n\n if (action.input.enableChat && state.features.mastra.enabled && state.features.powerhouse !== 'Disabled') {\n state.features.mastra.common.enableChat = true;\n const CLINT_COMMON_PKG = '@powerhousedao/clint-common';\n const CHAT_DOC_TYPE = 'powerhouse/chat-session';\n const existing = state.packages.find((p) => p.packageName === CLINT_COMMON_PKG);\n if (!existing) {\n state.packages.push({\n id: 'pkg-clint-common',\n packageName: CLINT_COMMON_PKG,\n documentTypes: [CHAT_DOC_TYPE],\n version: null,\n managed: true,\n });\n } else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) {\n existing.documentTypes.push(CHAT_DOC_TYPE);\n }\n } else {\n state.features.mastra.common.enableChat = false;\n }\n\n state.deployment.proxyEnabled = action.input.proxyEnabled ?? false;\n state.deployment.observabilityEnabled = action.input.observabilityEnabled ?? false;\n state.deployment.supportedResources = action.input.supportedResources ? [...action.input.supportedResources] : [];\n },\n};\n","export type ErrorCode = 'MastraNotEnabledError' | 'AgentNotFoundError' | 'ModelReferenceNotFoundError' | 'ProfileReferenceNotFoundError' | 'InvalidSkillNameError' | 'SkillNotFoundError' | 'InvalidToolPatternError' | 'ToolPatternNotFoundError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class MastraNotEnabledError extends Error implements ReducerError {\n errorCode = 'MastraNotEnabledError' as ErrorCode;\n constructor(message = 'MastraNotEnabledError') {\n super(message);\n }\n}\n\nexport class AgentNotFoundError extends Error implements ReducerError {\n errorCode = 'AgentNotFoundError' as ErrorCode;\n constructor(message = 'AgentNotFoundError') {\n super(message);\n }\n}\n\nexport class ModelReferenceNotFoundError extends Error implements ReducerError {\n errorCode = 'ModelReferenceNotFoundError' as ErrorCode;\n constructor(message = 'ModelReferenceNotFoundError') {\n super(message);\n }\n}\n\nexport class ProfileReferenceNotFoundError extends Error implements ReducerError {\n errorCode = 'ProfileReferenceNotFoundError' as ErrorCode;\n constructor(message = 'ProfileReferenceNotFoundError') {\n super(message);\n }\n}\n\nexport class InvalidSkillNameError extends Error implements ReducerError {\n errorCode = 'InvalidSkillNameError' as ErrorCode;\n constructor(message = 'InvalidSkillNameError') {\n super(message);\n }\n}\n\nexport class SkillNotFoundError extends Error implements ReducerError {\n errorCode = 'SkillNotFoundError' as ErrorCode;\n constructor(message = 'SkillNotFoundError') {\n super(message);\n }\n}\n\nexport class InvalidToolPatternError extends Error implements ReducerError {\n errorCode = 'InvalidToolPatternError' as ErrorCode;\n constructor(message = 'InvalidToolPatternError') {\n super(message);\n }\n}\n\nexport class ToolPatternNotFoundError extends Error implements ReducerError {\n errorCode = 'ToolPatternNotFoundError' as ErrorCode;\n constructor(message = 'ToolPatternNotFoundError') {\n super(message);\n }\n}\n\nexport const errors = {\n SetAgentModel: {\n MastraNotEnabledError,\n AgentNotFoundError,\n ModelReferenceNotFoundError,\n },\n AddAgentProfileRef: {\n MastraNotEnabledError,\n AgentNotFoundError,\n ProfileReferenceNotFoundError,\n },\n RemoveAgentProfileRef: {\n MastraNotEnabledError,\n AgentNotFoundError,\n ProfileReferenceNotFoundError,\n },\n ReorderAgentProfileRefs: {\n MastraNotEnabledError,\n AgentNotFoundError,\n ProfileReferenceNotFoundError,\n },\n AddAgentSkill: {\n MastraNotEnabledError,\n AgentNotFoundError,\n InvalidSkillNameError,\n },\n RemoveAgentSkill: {\n MastraNotEnabledError,\n AgentNotFoundError,\n SkillNotFoundError,\n },\n AddAgentToolPattern: {\n MastraNotEnabledError,\n AgentNotFoundError,\n InvalidToolPatternError,\n },\n RemoveAgentToolPattern: {\n MastraNotEnabledError,\n AgentNotFoundError,\n ToolPatternNotFoundError,\n },\n};\n","import type { PhClintProjectMastraAgentBindingsOperations } from 'document-models/ph-clint-project/v1';\nimport {\n AgentNotFoundError,\n InvalidSkillNameError,\n InvalidToolPatternError,\n MastraNotEnabledError,\n ModelReferenceNotFoundError,\n ProfileReferenceNotFoundError,\n SkillNotFoundError,\n ToolPatternNotFoundError,\n} from '../../gen/mastra-agent-bindings/error.js';\nimport type { PhClintMainAgent, PhClintSubAgent } from '../../gen/schema/types.js';\n\ntype Agent = PhClintMainAgent | PhClintSubAgent;\n\nfunction resolveAgent(main: PhClintMainAgent | null | undefined, subs: PhClintSubAgent[], agentId: string): Agent | undefined {\n if (main && main.id === agentId) return main;\n return subs.find((s) => s.id === agentId);\n}\n\nexport const phClintProjectMastraAgentBindingsOperations: PhClintProjectMastraAgentBindingsOperations = {\n setAgentModelOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set agent model when Mastra is disabled.');\n }\n const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);\n if (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n }\n if (!state.features.mastra.models.find((m) => m.id === action.input.modelId)) {\n throw new ModelReferenceNotFoundError(`Model not in library: ${action.input.modelId}`);\n }\n agent.modelId = action.input.modelId;\n },\n addAgentProfileRefOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot add profile ref when Mastra is disabled.');\n }\n const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);\n if (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n }\n if (!state.features.mastra.profiles.find((p) => p.id === action.input.profileId)) {\n throw new ProfileReferenceNotFoundError(`Profile not in library: ${action.input.profileId}`);\n }\n if (agent.profileIds.includes(action.input.profileId)) {\n return;\n }\n if (action.input.insertBefore) {\n const beforeIdx = agent.profileIds.indexOf(action.input.insertBefore);\n if (beforeIdx === -1) {\n throw new ProfileReferenceNotFoundError(`insertBefore profile not in agent's profileIds: ${action.input.insertBefore}`);\n }\n agent.profileIds.splice(beforeIdx, 0, action.input.profileId);\n } else {\n agent.profileIds.push(action.input.profileId);\n }\n },\n removeAgentProfileRefOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove profile ref when Mastra is disabled.');\n }\n const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);\n if (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n }\n const idx = agent.profileIds.indexOf(action.input.profileId);\n if (idx === -1) {\n throw new ProfileReferenceNotFoundError(`Profile not in agent's profileIds: ${action.input.profileId}`);\n }\n agent.profileIds.splice(idx, 1);\n },\n reorderAgentProfileRefsOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot reorder profile refs when Mastra is disabled.');\n }\n const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);\n if (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n }\n for (const id of action.input.ids) {\n if (!agent.profileIds.includes(id)) {\n throw new ProfileReferenceNotFoundError(`Profile not in agent's profileIds: ${id}`);\n }\n }\n const remaining = agent.profileIds.filter((id) => !action.input.ids.includes(id));\n if (action.input.insertBefore) {\n const beforeIdx = remaining.indexOf(action.input.insertBefore);\n if (beforeIdx === -1) {\n throw new ProfileReferenceNotFoundError(`insertBefore profile not in agent's profileIds: ${action.input.insertBefore}`);\n }\n remaining.splice(beforeIdx, 0, ...action.input.ids);\n } else {\n remaining.push(...action.input.ids);\n }\n agent.profileIds = remaining;\n },\n addAgentSkillOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot add skill when Mastra is disabled.');\n }\n const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);\n if (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n }\n const trimmed = action.input.name.trim();\n if (!/^[a-z][a-z0-9-]*$/.test(trimmed)) {\n throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);\n }\n if (!agent.skills.includes(trimmed)) {\n agent.skills.push(trimmed);\n }\n },\n removeAgentSkillOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove skill when Mastra is disabled.');\n }\n const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);\n if (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n }\n const idx = agent.skills.indexOf(action.input.name);\n if (idx === -1) {\n throw new SkillNotFoundError(`Skill not on agent: ${action.input.name}`);\n }\n agent.skills.splice(idx, 1);\n },\n addAgentToolPatternOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot add tool pattern when Mastra is disabled.');\n }\n const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);\n if (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n }\n const trimmed = action.input.pattern.trim();\n if (!trimmed) {\n throw new InvalidToolPatternError('Tool pattern must not be empty after trimming.');\n }\n if (!agent.toolPatterns.includes(trimmed)) {\n agent.toolPatterns.push(trimmed);\n }\n },\n removeAgentToolPatternOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove tool pattern when Mastra is disabled.');\n }\n const agent = resolveAgent(state.features.mastra.mainAgent, state.features.mastra.subAgents, action.input.agentId);\n if (!agent) {\n throw new AgentNotFoundError(`Agent not found: ${action.input.agentId}`);\n }\n const idx = agent.toolPatterns.indexOf(action.input.pattern);\n if (idx === -1) {\n throw new ToolPatternNotFoundError(`Tool pattern not on agent: ${action.input.pattern}`);\n }\n agent.toolPatterns.splice(idx, 1);\n },\n};\n","export type ErrorCode = 'MastraNotEnabledError' | 'InvalidAgentNameError' | 'InvalidAgentImageError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class MastraNotEnabledError extends Error implements ReducerError {\n errorCode = 'MastraNotEnabledError' as ErrorCode;\n constructor(message = 'MastraNotEnabledError') {\n super(message);\n }\n}\n\nexport class InvalidAgentNameError extends Error implements ReducerError {\n errorCode = 'InvalidAgentNameError' as ErrorCode;\n constructor(message = 'InvalidAgentNameError') {\n super(message);\n }\n}\n\nexport class InvalidAgentImageError extends Error implements ReducerError {\n errorCode = 'InvalidAgentImageError' as ErrorCode;\n constructor(message = 'InvalidAgentImageError') {\n super(message);\n }\n}\n\nexport const errors = {\n SetMainAgentName: { MastraNotEnabledError, InvalidAgentNameError },\n SetMainAgentDescription: { MastraNotEnabledError },\n ClearMainAgentDescription: { MastraNotEnabledError },\n SetMainAgentImage: { MastraNotEnabledError, InvalidAgentImageError },\n ClearMainAgentImage: { MastraNotEnabledError },\n};\n","import type { PhClintProjectMastraMainAgentOperations } from 'document-models/ph-clint-project/v1';\nimport { InvalidAgentImageError, InvalidAgentNameError, MastraNotEnabledError } from '../../gen/mastra-main-agent/error.js';\n\nexport const phClintProjectMastraMainAgentOperations: PhClintProjectMastraMainAgentOperations = {\n setMainAgentNameOperation(state, action) {\n const main = state.features.mastra.mainAgent;\n if (!state.features.mastra.enabled || !main) {\n throw new MastraNotEnabledError('Cannot set main agent name when Mastra is disabled.');\n }\n const trimmed = action.input.name.trim();\n if (!trimmed) {\n throw new InvalidAgentNameError('Agent name must not be empty.');\n }\n main.name = trimmed;\n },\n setMainAgentDescriptionOperation(state, action) {\n const main = state.features.mastra.mainAgent;\n if (!state.features.mastra.enabled || !main) {\n throw new MastraNotEnabledError('Cannot set main agent description when Mastra is disabled.');\n }\n main.description = action.input.description;\n },\n clearMainAgentDescriptionOperation(state) {\n const main = state.features.mastra.mainAgent;\n if (!state.features.mastra.enabled || !main) {\n throw new MastraNotEnabledError('Cannot clear main agent description when Mastra is disabled.');\n }\n main.description = null;\n },\n setMainAgentImageOperation(state, action) {\n const main = state.features.mastra.mainAgent;\n if (!state.features.mastra.enabled || !main) {\n throw new MastraNotEnabledError('Cannot set main agent image when Mastra is disabled.');\n }\n if (!action.input.attachment.startsWith('attachment://')) {\n throw new InvalidAgentImageError('Agent image must be an attachment ref (attachment://...)');\n }\n main.attachment = action.input.attachment;\n },\n clearMainAgentImageOperation(state) {\n const main = state.features.mastra.mainAgent;\n if (!state.features.mastra.enabled || !main) {\n throw new MastraNotEnabledError('Cannot clear main agent image when Mastra is disabled.');\n }\n main.attachment = null;\n },\n};\n","export type ErrorCode = 'MastraNotEnabledError' | 'InvalidModelIdError' | 'DuplicateModelError' | 'ModelNotFoundError' | 'ModelInUseError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class MastraNotEnabledError extends Error implements ReducerError {\n errorCode = 'MastraNotEnabledError' as ErrorCode;\n constructor(message = 'MastraNotEnabledError') {\n super(message);\n }\n}\n\nexport class InvalidModelIdError extends Error implements ReducerError {\n errorCode = 'InvalidModelIdError' as ErrorCode;\n constructor(message = 'InvalidModelIdError') {\n super(message);\n }\n}\n\nexport class DuplicateModelError extends Error implements ReducerError {\n errorCode = 'DuplicateModelError' as ErrorCode;\n constructor(message = 'DuplicateModelError') {\n super(message);\n }\n}\n\nexport class ModelNotFoundError extends Error implements ReducerError {\n errorCode = 'ModelNotFoundError' as ErrorCode;\n constructor(message = 'ModelNotFoundError') {\n super(message);\n }\n}\n\nexport class ModelInUseError extends Error implements ReducerError {\n errorCode = 'ModelInUseError' as ErrorCode;\n constructor(message = 'ModelInUseError') {\n super(message);\n }\n}\n\nexport const errors = {\n AddModel: { MastraNotEnabledError, InvalidModelIdError, DuplicateModelError },\n RemoveModel: { MastraNotEnabledError, ModelNotFoundError, ModelInUseError },\n};\n","import type { PhClintProjectMastraModelsOperations } from 'document-models/ph-clint-project/v1';\nimport { DuplicateModelError, InvalidModelIdError, MastraNotEnabledError, ModelInUseError, ModelNotFoundError } from '../../gen/mastra-models/error.js';\n\nexport const phClintProjectMastraModelsOperations: PhClintProjectMastraModelsOperations = {\n addModelOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot add model when Mastra is disabled.');\n }\n if (!/^[a-z0-9-]+\\/[a-z0-9._-]+$/.test(action.input.id)) {\n throw new InvalidModelIdError(`Invalid model ID: ${action.input.id}. Must be provider/model-name format.`);\n }\n if (state.features.mastra.models.find((m) => m.id === action.input.id)) {\n throw new DuplicateModelError(`Model already exists: ${action.input.id}`);\n }\n state.features.mastra.models.push({ id: action.input.id });\n },\n removeModelOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove model when Mastra is disabled.');\n }\n const idx = state.features.mastra.models.findIndex((m) => m.id === action.input.id);\n if (idx === -1) {\n throw new ModelNotFoundError(`Model not found: ${action.input.id}`);\n }\n const main = state.features.mastra.mainAgent;\n const usedByMain = !!main && main.modelId === action.input.id;\n const usedBySub = state.features.mastra.subAgents.some((s) => s.modelId === action.input.id);\n if (usedByMain || usedBySub) {\n throw new ModelInUseError(`Model ${action.input.id} is in use by an agent.`);\n }\n state.features.mastra.models.splice(idx, 1);\n },\n};\n","export type ErrorCode = 'MastraNotEnabledError' | 'InvalidProfileIdError' | 'DuplicateProfileError' | 'ProfileNotFoundError' | 'ProfileInUseError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class MastraNotEnabledError extends Error implements ReducerError {\n errorCode = 'MastraNotEnabledError' as ErrorCode;\n constructor(message = 'MastraNotEnabledError') {\n super(message);\n }\n}\n\nexport class InvalidProfileIdError extends Error implements ReducerError {\n errorCode = 'InvalidProfileIdError' as ErrorCode;\n constructor(message = 'InvalidProfileIdError') {\n super(message);\n }\n}\n\nexport class DuplicateProfileError extends Error implements ReducerError {\n errorCode = 'DuplicateProfileError' as ErrorCode;\n constructor(message = 'DuplicateProfileError') {\n super(message);\n }\n}\n\nexport class ProfileNotFoundError extends Error implements ReducerError {\n errorCode = 'ProfileNotFoundError' as ErrorCode;\n constructor(message = 'ProfileNotFoundError') {\n super(message);\n }\n}\n\nexport class ProfileInUseError extends Error implements ReducerError {\n errorCode = 'ProfileInUseError' as ErrorCode;\n constructor(message = 'ProfileInUseError') {\n super(message);\n }\n}\n\nexport const errors = {\n AddProfile: {\n MastraNotEnabledError,\n InvalidProfileIdError,\n DuplicateProfileError,\n ProfileNotFoundError,\n },\n UpdateProfile: { MastraNotEnabledError, ProfileNotFoundError },\n RemoveProfile: {\n MastraNotEnabledError,\n ProfileNotFoundError,\n ProfileInUseError,\n },\n ReorderProfiles: { MastraNotEnabledError, ProfileNotFoundError },\n};\n","import type { PhClintProjectMastraProfilesOperations } from 'document-models/ph-clint-project/v1';\nimport { DuplicateProfileError, InvalidProfileIdError, MastraNotEnabledError, ProfileInUseError, ProfileNotFoundError } from '../../gen/mastra-profiles/error.js';\n\nexport const phClintProjectMastraProfilesOperations: PhClintProjectMastraProfilesOperations = {\n addProfileOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot add profile when Mastra is disabled.');\n }\n if (!/^[a-z][a-z0-9-]*$/.test(action.input.id)) {\n throw new InvalidProfileIdError(`Invalid profile ID: ${action.input.id}. Must be lowercase kebab-case.`);\n }\n if (state.features.mastra.profiles.find((p) => p.id === action.input.id)) {\n throw new DuplicateProfileError(`Profile already exists: ${action.input.id}`);\n }\n const profile = {\n id: action.input.id,\n title: action.input.title,\n content: action.input.content,\n };\n if (action.input.insertBefore) {\n const beforeIdx = state.features.mastra.profiles.findIndex((p) => p.id === action.input.insertBefore);\n if (beforeIdx === -1) {\n throw new ProfileNotFoundError(`insertBefore profile not found: ${action.input.insertBefore}`);\n }\n state.features.mastra.profiles.splice(beforeIdx, 0, profile);\n } else {\n state.features.mastra.profiles.push(profile);\n }\n },\n updateProfileOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot update profile when Mastra is disabled.');\n }\n const profile = state.features.mastra.profiles.find((p) => p.id === action.input.id);\n if (!profile) {\n throw new ProfileNotFoundError(`Profile not found: ${action.input.id}`);\n }\n if (action.input.title) profile.title = action.input.title;\n if (action.input.content) profile.content = action.input.content;\n },\n removeProfileOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove profile when Mastra is disabled.');\n }\n const idx = state.features.mastra.profiles.findIndex((p) => p.id === action.input.id);\n if (idx === -1) {\n throw new ProfileNotFoundError(`Profile not found: ${action.input.id}`);\n }\n const main = state.features.mastra.mainAgent;\n const usedByMain = !!main && main.profileIds.includes(action.input.id);\n const usedBySub = state.features.mastra.subAgents.some((s) => s.profileIds.includes(action.input.id));\n if (usedByMain || usedBySub) {\n throw new ProfileInUseError(`Profile ${action.input.id} is in use by an agent.`);\n }\n state.features.mastra.profiles.splice(idx, 1);\n },\n reorderProfilesOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot reorder profiles when Mastra is disabled.');\n }\n const moving = [];\n for (const id of action.input.ids) {\n const profile = state.features.mastra.profiles.find((p) => p.id === id);\n if (!profile) {\n throw new ProfileNotFoundError(`Profile not found: ${id}`);\n }\n moving.push(profile);\n }\n state.features.mastra.profiles = state.features.mastra.profiles.filter((p) => !action.input.ids.includes(p.id));\n if (action.input.insertBefore) {\n const beforeIdx = state.features.mastra.profiles.findIndex((p) => p.id === action.input.insertBefore);\n if (beforeIdx === -1) {\n throw new ProfileNotFoundError(`insertBefore profile not found: ${action.input.insertBefore}`);\n }\n state.features.mastra.profiles.splice(beforeIdx, 0, ...moving);\n } else {\n state.features.mastra.profiles.push(...moving);\n }\n },\n};\n","export type ErrorCode = 'MastraNotEnabledError' | 'InvalidAgentIdError' | 'InvalidAgentNameError' | 'DuplicateAgentIdError' | 'ModelReferenceNotFoundError' | 'AgentNotFoundError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class MastraNotEnabledError extends Error implements ReducerError {\n errorCode = 'MastraNotEnabledError' as ErrorCode;\n constructor(message = 'MastraNotEnabledError') {\n super(message);\n }\n}\n\nexport class InvalidAgentIdError extends Error implements ReducerError {\n errorCode = 'InvalidAgentIdError' as ErrorCode;\n constructor(message = 'InvalidAgentIdError') {\n super(message);\n }\n}\n\nexport class InvalidAgentNameError extends Error implements ReducerError {\n errorCode = 'InvalidAgentNameError' as ErrorCode;\n constructor(message = 'InvalidAgentNameError') {\n super(message);\n }\n}\n\nexport class DuplicateAgentIdError extends Error implements ReducerError {\n errorCode = 'DuplicateAgentIdError' as ErrorCode;\n constructor(message = 'DuplicateAgentIdError') {\n super(message);\n }\n}\n\nexport class ModelReferenceNotFoundError extends Error implements ReducerError {\n errorCode = 'ModelReferenceNotFoundError' as ErrorCode;\n constructor(message = 'ModelReferenceNotFoundError') {\n super(message);\n }\n}\n\nexport class AgentNotFoundError extends Error implements ReducerError {\n errorCode = 'AgentNotFoundError' as ErrorCode;\n constructor(message = 'AgentNotFoundError') {\n super(message);\n }\n}\n\nexport const errors = {\n AddSubAgent: {\n MastraNotEnabledError,\n InvalidAgentIdError,\n InvalidAgentNameError,\n DuplicateAgentIdError,\n ModelReferenceNotFoundError,\n },\n RemoveSubAgent: { MastraNotEnabledError, AgentNotFoundError },\n SetSubAgentName: {\n MastraNotEnabledError,\n AgentNotFoundError,\n InvalidAgentNameError,\n },\n SetSubAgentDescription: { MastraNotEnabledError, AgentNotFoundError },\n};\n","import type { PhClintProjectMastraSubAgentsOperations } from 'document-models/ph-clint-project/v1';\nimport { AgentNotFoundError, DuplicateAgentIdError, InvalidAgentIdError, InvalidAgentNameError, MastraNotEnabledError, ModelReferenceNotFoundError } from '../../gen/mastra-sub-agents/error.js';\n\nexport const phClintProjectMastraSubAgentsOperations: PhClintProjectMastraSubAgentsOperations = {\n addSubAgentOperation(state, action) {\n const main = state.features.mastra.mainAgent;\n if (!state.features.mastra.enabled || !main) {\n throw new MastraNotEnabledError('Cannot add sub-agent when Mastra is disabled.');\n }\n if (!/^[a-z][a-z0-9-]*$/.test(action.input.id)) {\n throw new InvalidAgentIdError(`Invalid sub-agent ID: ${action.input.id}. Must be lowercase kebab-case.`);\n }\n const trimmedName = action.input.name.trim();\n if (!trimmedName) {\n throw new InvalidAgentNameError('Sub-agent name must not be empty.');\n }\n if (main.id === action.input.id) {\n throw new DuplicateAgentIdError(`Agent ID already taken by main agent: ${action.input.id}`);\n }\n if (state.features.mastra.subAgents.find((s) => s.id === action.input.id)) {\n throw new DuplicateAgentIdError(`Sub-agent already exists: ${action.input.id}`);\n }\n if (!state.features.mastra.models.find((m) => m.id === action.input.modelId)) {\n throw new ModelReferenceNotFoundError(`Model not in library: ${action.input.modelId}`);\n }\n state.features.mastra.subAgents.push({\n id: action.input.id,\n name: trimmedName,\n description: action.input.description,\n modelId: action.input.modelId,\n profileIds: [],\n skills: [],\n toolPatterns: [],\n });\n },\n removeSubAgentOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove sub-agent when Mastra is disabled.');\n }\n const idx = state.features.mastra.subAgents.findIndex((s) => s.id === action.input.id);\n if (idx === -1) {\n throw new AgentNotFoundError(`Sub-agent not found: ${action.input.id}`);\n }\n state.features.mastra.subAgents.splice(idx, 1);\n },\n setSubAgentNameOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set sub-agent name when Mastra is disabled.');\n }\n const sub = state.features.mastra.subAgents.find((s) => s.id === action.input.id);\n if (!sub) {\n throw new AgentNotFoundError(`Sub-agent not found: ${action.input.id}`);\n }\n const trimmed = action.input.name.trim();\n if (!trimmed) {\n throw new InvalidAgentNameError('Sub-agent name must not be empty.');\n }\n sub.name = trimmed;\n },\n setSubAgentDescriptionOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set sub-agent description when Mastra is disabled.');\n }\n const sub = state.features.mastra.subAgents.find((s) => s.id === action.input.id);\n if (!sub) {\n throw new AgentNotFoundError(`Sub-agent not found: ${action.input.id}`);\n }\n sub.description = action.input.description;\n },\n};\n","export type ErrorCode =\n | 'DuplicatePackageError'\n | 'PackageNotFoundError'\n | 'CannotRemoveAppPackageError'\n | 'CannotRemoveManagedPackageError'\n | 'InvalidDocumentTypeError'\n | 'DuplicateDocumentTypeError'\n | 'DocumentTypeNotFoundError'\n | 'InvalidVersionError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class DuplicatePackageError extends Error implements ReducerError {\n errorCode = 'DuplicatePackageError' as ErrorCode;\n constructor(message = 'DuplicatePackageError') {\n super(message);\n }\n}\n\nexport class PackageNotFoundError extends Error implements ReducerError {\n errorCode = 'PackageNotFoundError' as ErrorCode;\n constructor(message = 'PackageNotFoundError') {\n super(message);\n }\n}\n\nexport class CannotRemoveAppPackageError extends Error implements ReducerError {\n errorCode = 'CannotRemoveAppPackageError' as ErrorCode;\n constructor(message = 'CannotRemoveAppPackageError') {\n super(message);\n }\n}\n\nexport class CannotRemoveManagedPackageError extends Error implements ReducerError {\n errorCode = 'CannotRemoveManagedPackageError' as ErrorCode;\n constructor(message = 'CannotRemoveManagedPackageError') {\n super(message);\n }\n}\n\nexport class InvalidDocumentTypeError extends Error implements ReducerError {\n errorCode = 'InvalidDocumentTypeError' as ErrorCode;\n constructor(message = 'InvalidDocumentTypeError') {\n super(message);\n }\n}\n\nexport class DuplicateDocumentTypeError extends Error implements ReducerError {\n errorCode = 'DuplicateDocumentTypeError' as ErrorCode;\n constructor(message = 'DuplicateDocumentTypeError') {\n super(message);\n }\n}\n\nexport class DocumentTypeNotFoundError extends Error implements ReducerError {\n errorCode = 'DocumentTypeNotFoundError' as ErrorCode;\n constructor(message = 'DocumentTypeNotFoundError') {\n super(message);\n }\n}\n\nexport class InvalidVersionError extends Error implements ReducerError {\n errorCode = 'InvalidVersionError' as ErrorCode;\n constructor(message = 'InvalidVersionError') {\n super(message);\n }\n}\n\nexport const errors = {\n AddPowerhousePackage: { DuplicatePackageError },\n RemovePowerhousePackage: {\n PackageNotFoundError,\n CannotRemoveAppPackageError,\n CannotRemoveManagedPackageError,\n },\n AddPackageDocumentType: {\n InvalidDocumentTypeError,\n PackageNotFoundError,\n DuplicateDocumentTypeError,\n },\n RemovePackageDocumentType: {\n PackageNotFoundError,\n DocumentTypeNotFoundError,\n },\n SetPackageVersion: { PackageNotFoundError, InvalidVersionError },\n};\n","import type { PhClintProjectPowerhousePackagesOperations } from 'document-models/ph-clint-project/v1';\nimport { CannotRemoveManagedPackageError, DocumentTypeNotFoundError, DuplicateDocumentTypeError, DuplicatePackageError, InvalidDocumentTypeError, InvalidVersionError, PackageNotFoundError } from '../../gen/powerhouse-packages/error.js';\n\nconst SEMVER = /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/;\n\nexport const phClintProjectPowerhousePackagesOperations: PhClintProjectPowerhousePackagesOperations = {\n addPowerhousePackageOperation(state, action) {\n const exists = state.packages.find((p) => p.id === action.input.id || p.packageName === action.input.packageName);\n if (exists) {\n throw new DuplicatePackageError(`Package already exists: ${action.input.packageName}`);\n }\n state.packages.push({\n id: action.input.id,\n packageName: action.input.packageName,\n documentTypes: [],\n version: null,\n managed: false,\n });\n },\n removePowerhousePackageOperation(state, action) {\n const idx = state.packages.findIndex((p) => p.id === action.input.id);\n if (idx === -1) {\n throw new PackageNotFoundError(`Package not found: ${action.input.id}`);\n }\n const pkg = state.packages[idx];\n if (pkg.managed) {\n throw new CannotRemoveManagedPackageError('Cannot remove a managed package');\n }\n state.packages.splice(idx, 1);\n },\n addPackageDocumentTypeOperation(state, action) {\n if (action.input.documentType !== '*/*' && !/^[a-z0-9-]+\\/[a-z0-9-]+$/.test(action.input.documentType)) {\n throw new InvalidDocumentTypeError(`Invalid document type format: ${action.input.documentType}. Expected org/name.`);\n }\n const pkg = state.packages.find((p) => p.id === action.input.packageId);\n if (!pkg) {\n throw new PackageNotFoundError(`Package not found: ${action.input.packageId}`);\n }\n if (action.input.documentType === '*/*') {\n pkg.documentTypes.length = 0;\n pkg.documentTypes.push('*/*');\n return;\n }\n if (pkg.documentTypes.includes('*/*')) {\n return;\n }\n if (pkg.documentTypes.includes(action.input.documentType)) {\n throw new DuplicateDocumentTypeError(`Document type already registered: ${action.input.documentType}`);\n }\n pkg.documentTypes.push(action.input.documentType);\n },\n removePackageDocumentTypeOperation(state, action) {\n const pkg = state.packages.find((p) => p.id === action.input.packageId);\n if (!pkg) {\n throw new PackageNotFoundError(`Package not found: ${action.input.packageId}`);\n }\n const idx = pkg.documentTypes.indexOf(action.input.documentType);\n if (idx === -1) {\n throw new DocumentTypeNotFoundError(`Document type not found: ${action.input.documentType}`);\n }\n pkg.documentTypes.splice(idx, 1);\n },\n setPackageVersionOperation(state, action) {\n const pkg = state.packages.find((p) => p.id === action.input.packageId);\n if (!pkg) {\n throw new PackageNotFoundError(`Package not found: ${action.input.packageId}`);\n }\n if (action.input.version != null) {\n if (!SEMVER.test(action.input.version)) {\n throw new InvalidVersionError(`Invalid version: ${action.input.version}`);\n }\n }\n pkg.version = action.input.version || null;\n },\n};\n","export type ErrorCode = 'InvalidVersionError' | 'PublishRecordNotFoundError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class InvalidVersionError extends Error implements ReducerError {\n errorCode = 'InvalidVersionError' as ErrorCode;\n constructor(message = 'InvalidVersionError') {\n super(message);\n }\n}\n\nexport class PublishRecordNotFoundError extends Error implements ReducerError {\n errorCode = 'PublishRecordNotFoundError' as ErrorCode;\n constructor(message = 'PublishRecordNotFoundError') {\n super(message);\n }\n}\n\nexport const errors = {\n BumpVersion: { InvalidVersionError },\n SetPublishStatus: { PublishRecordNotFoundError },\n};\n","import type { PhClintProjectPublishingOperations } from 'document-models/ph-clint-project/v1';\nimport { InvalidVersionError, PublishRecordNotFoundError } from '../../gen/publishing/error.js';\n\nexport const phClintProjectPublishingOperations: PhClintProjectPublishingOperations = {\n bumpVersionOperation(state, action) {\n if (!/^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/.test(action.input.version)) {\n throw new InvalidVersionError(`Invalid version: ${action.input.version}`);\n }\n state.version = action.input.version;\n },\n publishDevOperation(state, action) {\n state.publishHistory.push({\n id: action.input.id,\n tag: 'Dev',\n version: state.version,\n timestamp: action.input.timestamp,\n status: 'Pending',\n });\n },\n publishStagingOperation(state, action) {\n state.publishHistory.push({\n id: action.input.id,\n tag: 'Staging',\n version: state.version,\n timestamp: action.input.timestamp,\n status: 'Pending',\n });\n },\n publishProductionOperation(state, action) {\n state.publishHistory.push({\n id: action.input.id,\n tag: 'Production',\n version: state.version,\n timestamp: action.input.timestamp,\n status: 'Pending',\n });\n },\n setPublishStatusOperation(state, action) {\n const record = state.publishHistory.find((r) => r.id === action.input.id);\n if (!record) {\n throw new PublishRecordNotFoundError(`Publish record not found: ${action.input.id}`);\n }\n record.status = action.input.status;\n },\n};\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\nimport type { Reducer, StateReducer } from 'document-model';\nimport { createReducer, isDocumentAction } from 'document-model';\nimport type { PhClintProjectPHState } from 'document-models/ph-clint-project/v1';\n\nimport { phClintProjectDeploymentOperations } from '../src/reducers/deployment.js';\nimport { phClintProjectExternalSkillsOperations } from '../src/reducers/external-skills.js';\nimport { phClintProjectFeaturesMastraOperations } from '../src/reducers/features-mastra.js';\nimport { phClintProjectFeaturesPowerhouseOperations } from '../src/reducers/features-powerhouse.js';\nimport { phClintProjectFeaturesRoutineOperations } from '../src/reducers/features-routine.js';\nimport { phClintProjectIdentityOperations } from '../src/reducers/identity.js';\nimport { phClintProjectLifecycleOperations } from '../src/reducers/lifecycle.js';\nimport { phClintProjectMastraAgentBindingsOperations } from '../src/reducers/mastra-agent-bindings.js';\nimport { phClintProjectMastraMainAgentOperations } from '../src/reducers/mastra-main-agent.js';\nimport { phClintProjectMastraModelsOperations } from '../src/reducers/mastra-models.js';\nimport { phClintProjectMastraProfilesOperations } from '../src/reducers/mastra-profiles.js';\nimport { phClintProjectMastraSubAgentsOperations } from '../src/reducers/mastra-sub-agents.js';\nimport { phClintProjectPowerhousePackagesOperations } from '../src/reducers/powerhouse-packages.js';\nimport { phClintProjectPublishingOperations } from '../src/reducers/publishing.js';\n\nimport {\n AddAgentProfileRefInputSchema,\n AddAgentSkillInputSchema,\n AddAgentToolPatternInputSchema,\n AddExternalSkillInputSchema,\n AddModelInputSchema,\n AddPackageDocumentTypeInputSchema,\n AddPowerhousePackageInputSchema,\n AddProfileInputSchema,\n AddSubAgentInputSchema,\n AddSupportedResourceInputSchema,\n BumpVersionInputSchema,\n ClearMainAgentDescriptionInputSchema,\n ClearMainAgentImageInputSchema,\n DisableMastraInputSchema,\n DisableRoutineInputSchema,\n EnableMastraInputSchema,\n EnableRoutineInputSchema,\n ImportSpecInputSchema,\n PublishDevInputSchema,\n PublishProductionInputSchema,\n PublishStagingInputSchema,\n RemoveAgentProfileRefInputSchema,\n RemoveAgentSkillInputSchema,\n RemoveAgentToolPatternInputSchema,\n RemoveExternalSkillInputSchema,\n RemoveModelInputSchema,\n RemovePackageDocumentTypeInputSchema,\n RemovePowerhousePackageInputSchema,\n RemoveProfileInputSchema,\n RemoveSubAgentInputSchema,\n RemoveSupportedResourceInputSchema,\n ReorderAgentProfileRefsInputSchema,\n ReorderProfilesInputSchema,\n SetAgentModelInputSchema,\n SetDescriptionInputSchema,\n SetEnableChatInputSchema,\n SetExternalSkillGithubUrlInputSchema,\n SetExternalSkillNameInputSchema,\n SetMainAgentDescriptionInputSchema,\n SetMainAgentImageInputSchema,\n SetMainAgentNameInputSchema,\n SetObservabilityEnabledInputSchema,\n SetPackageIdentifierInputSchema,\n SetPackageVersionInputSchema,\n SetPowerhouseLevelInputSchema,\n SetProxyEnabledInputSchema,\n SetPublishStatusInputSchema,\n SetSubAgentDescriptionInputSchema,\n SetSubAgentNameInputSchema,\n SetVersionInputSchema,\n UpdateProfileInputSchema,\n} from './schema/zod.js';\n\nconst stateReducer: StateReducer<PhClintProjectPHState> = (state, action, dispatch) => {\n if (isDocumentAction(action)) {\n return state;\n }\n switch (action.type) {\n case 'SET_DESCRIPTION': {\n SetDescriptionInputSchema().parse(action.input);\n\n phClintProjectIdentityOperations.setDescriptionOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_VERSION': {\n SetVersionInputSchema().parse(action.input);\n\n phClintProjectIdentityOperations.setVersionOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_PACKAGE_IDENTIFIER': {\n SetPackageIdentifierInputSchema().parse(action.input);\n\n phClintProjectIdentityOperations.setPackageIdentifierOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_POWERHOUSE_LEVEL': {\n SetPowerhouseLevelInputSchema().parse(action.input);\n\n phClintProjectFeaturesPowerhouseOperations.setPowerhouseLevelOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ENABLE_ROUTINE': {\n EnableRoutineInputSchema().parse(action.input);\n\n phClintProjectFeaturesRoutineOperations.enableRoutineOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'DISABLE_ROUTINE': {\n DisableRoutineInputSchema().parse(action.input);\n\n phClintProjectFeaturesRoutineOperations.disableRoutineOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_POWERHOUSE_PACKAGE': {\n AddPowerhousePackageInputSchema().parse(action.input);\n\n phClintProjectPowerhousePackagesOperations.addPowerhousePackageOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_POWERHOUSE_PACKAGE': {\n RemovePowerhousePackageInputSchema().parse(action.input);\n\n phClintProjectPowerhousePackagesOperations.removePowerhousePackageOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_PACKAGE_DOCUMENT_TYPE': {\n AddPackageDocumentTypeInputSchema().parse(action.input);\n\n phClintProjectPowerhousePackagesOperations.addPackageDocumentTypeOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_PACKAGE_DOCUMENT_TYPE': {\n RemovePackageDocumentTypeInputSchema().parse(action.input);\n\n phClintProjectPowerhousePackagesOperations.removePackageDocumentTypeOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_PACKAGE_VERSION': {\n SetPackageVersionInputSchema().parse(action.input);\n\n phClintProjectPowerhousePackagesOperations.setPackageVersionOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_EXTERNAL_SKILL': {\n AddExternalSkillInputSchema().parse(action.input);\n\n phClintProjectExternalSkillsOperations.addExternalSkillOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_EXTERNAL_SKILL': {\n RemoveExternalSkillInputSchema().parse(action.input);\n\n phClintProjectExternalSkillsOperations.removeExternalSkillOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_EXTERNAL_SKILL_NAME': {\n SetExternalSkillNameInputSchema().parse(action.input);\n\n phClintProjectExternalSkillsOperations.setExternalSkillNameOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_EXTERNAL_SKILL_GITHUB_URL': {\n SetExternalSkillGithubUrlInputSchema().parse(action.input);\n\n phClintProjectExternalSkillsOperations.setExternalSkillGithubUrlOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'BUMP_VERSION': {\n BumpVersionInputSchema().parse(action.input);\n\n phClintProjectPublishingOperations.bumpVersionOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'PUBLISH_DEV': {\n PublishDevInputSchema().parse(action.input);\n\n phClintProjectPublishingOperations.publishDevOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'PUBLISH_STAGING': {\n PublishStagingInputSchema().parse(action.input);\n\n phClintProjectPublishingOperations.publishStagingOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'PUBLISH_PRODUCTION': {\n PublishProductionInputSchema().parse(action.input);\n\n phClintProjectPublishingOperations.publishProductionOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_PUBLISH_STATUS': {\n SetPublishStatusInputSchema().parse(action.input);\n\n phClintProjectPublishingOperations.setPublishStatusOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'IMPORT_SPEC': {\n ImportSpecInputSchema().parse(action.input);\n\n phClintProjectLifecycleOperations.importSpecOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_SUPPORTED_RESOURCE': {\n AddSupportedResourceInputSchema().parse(action.input);\n\n phClintProjectDeploymentOperations.addSupportedResourceOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_SUPPORTED_RESOURCE': {\n RemoveSupportedResourceInputSchema().parse(action.input);\n\n phClintProjectDeploymentOperations.removeSupportedResourceOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_PROXY_ENABLED': {\n SetProxyEnabledInputSchema().parse(action.input);\n\n phClintProjectDeploymentOperations.setProxyEnabledOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_OBSERVABILITY_ENABLED': {\n SetObservabilityEnabledInputSchema().parse(action.input);\n\n phClintProjectDeploymentOperations.setObservabilityEnabledOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ENABLE_MASTRA': {\n EnableMastraInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.enableMastraOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'DISABLE_MASTRA': {\n DisableMastraInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.disableMastraOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_ENABLE_CHAT': {\n SetEnableChatInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.setEnableChatOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_MODEL': {\n AddModelInputSchema().parse(action.input);\n\n phClintProjectMastraModelsOperations.addModelOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_MODEL': {\n RemoveModelInputSchema().parse(action.input);\n\n phClintProjectMastraModelsOperations.removeModelOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_PROFILE': {\n AddProfileInputSchema().parse(action.input);\n\n phClintProjectMastraProfilesOperations.addProfileOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'UPDATE_PROFILE': {\n UpdateProfileInputSchema().parse(action.input);\n\n phClintProjectMastraProfilesOperations.updateProfileOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_PROFILE': {\n RemoveProfileInputSchema().parse(action.input);\n\n phClintProjectMastraProfilesOperations.removeProfileOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REORDER_PROFILES': {\n ReorderProfilesInputSchema().parse(action.input);\n\n phClintProjectMastraProfilesOperations.reorderProfilesOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_MAIN_AGENT_NAME': {\n SetMainAgentNameInputSchema().parse(action.input);\n\n phClintProjectMastraMainAgentOperations.setMainAgentNameOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_MAIN_AGENT_DESCRIPTION': {\n SetMainAgentDescriptionInputSchema().parse(action.input);\n\n phClintProjectMastraMainAgentOperations.setMainAgentDescriptionOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'CLEAR_MAIN_AGENT_DESCRIPTION': {\n ClearMainAgentDescriptionInputSchema().parse(action.input);\n\n phClintProjectMastraMainAgentOperations.clearMainAgentDescriptionOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_MAIN_AGENT_IMAGE': {\n SetMainAgentImageInputSchema().parse(action.input);\n\n phClintProjectMastraMainAgentOperations.setMainAgentImageOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'CLEAR_MAIN_AGENT_IMAGE': {\n ClearMainAgentImageInputSchema().parse(action.input);\n\n phClintProjectMastraMainAgentOperations.clearMainAgentImageOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_SUB_AGENT': {\n AddSubAgentInputSchema().parse(action.input);\n\n phClintProjectMastraSubAgentsOperations.addSubAgentOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_SUB_AGENT': {\n RemoveSubAgentInputSchema().parse(action.input);\n\n phClintProjectMastraSubAgentsOperations.removeSubAgentOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_SUB_AGENT_NAME': {\n SetSubAgentNameInputSchema().parse(action.input);\n\n phClintProjectMastraSubAgentsOperations.setSubAgentNameOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_SUB_AGENT_DESCRIPTION': {\n SetSubAgentDescriptionInputSchema().parse(action.input);\n\n phClintProjectMastraSubAgentsOperations.setSubAgentDescriptionOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_AGENT_MODEL': {\n SetAgentModelInputSchema().parse(action.input);\n\n phClintProjectMastraAgentBindingsOperations.setAgentModelOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_AGENT_PROFILE_REF': {\n AddAgentProfileRefInputSchema().parse(action.input);\n\n phClintProjectMastraAgentBindingsOperations.addAgentProfileRefOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_AGENT_PROFILE_REF': {\n RemoveAgentProfileRefInputSchema().parse(action.input);\n\n phClintProjectMastraAgentBindingsOperations.removeAgentProfileRefOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REORDER_AGENT_PROFILE_REFS': {\n ReorderAgentProfileRefsInputSchema().parse(action.input);\n\n phClintProjectMastraAgentBindingsOperations.reorderAgentProfileRefsOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_AGENT_SKILL': {\n AddAgentSkillInputSchema().parse(action.input);\n\n phClintProjectMastraAgentBindingsOperations.addAgentSkillOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_AGENT_SKILL': {\n RemoveAgentSkillInputSchema().parse(action.input);\n\n phClintProjectMastraAgentBindingsOperations.removeAgentSkillOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_AGENT_TOOL_PATTERN': {\n AddAgentToolPatternInputSchema().parse(action.input);\n\n phClintProjectMastraAgentBindingsOperations.addAgentToolPatternOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_AGENT_TOOL_PATTERN': {\n RemoveAgentToolPatternInputSchema().parse(action.input);\n\n phClintProjectMastraAgentBindingsOperations.removeAgentToolPatternOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n default:\n return state;\n }\n};\n\nexport const reducer: Reducer<PhClintProjectPHState> = createReducer(stateReducer);\n","export const supportedVersions = [1] as const;\n\nexport const latestVersion = supportedVersions[0];\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { UpgradeManifest } from 'document-model';\nimport { latestVersion, supportedVersions } from './versions.js';\n\nexport const phClintProjectUpgradeManifest: UpgradeManifest<typeof supportedVersions> = {\n documentType: 'powerhouse/ph-clint-project',\n latestVersion,\n supportedVersions,\n upgrades: {},\n};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nexport const phClintProjectDocumentType = 'powerhouse/ph-clint-project';\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { BaseDocumentHeaderSchema, BaseDocumentStateSchema } from 'document-model';\nimport { z } from 'zod';\nimport { phClintProjectDocumentType } from './document-type.js';\nimport { PhClintProjectStateSchema } from './schema/zod.js';\nimport type { PhClintProjectDocument, PhClintProjectPHState } from './types.js';\n\n/** Schema for validating the header object of a PhClintProject document */\nexport const PhClintProjectDocumentHeaderSchema = BaseDocumentHeaderSchema.extend({\n documentType: z.literal(phClintProjectDocumentType),\n});\n\n/** Schema for validating the state object of a PhClintProject document */\nexport const PhClintProjectPHStateSchema = BaseDocumentStateSchema.extend({\n global: PhClintProjectStateSchema(),\n});\n\nexport const PhClintProjectDocumentSchema = z.object({\n header: PhClintProjectDocumentHeaderSchema,\n state: PhClintProjectPHStateSchema,\n initialState: PhClintProjectPHStateSchema,\n});\n\n/** Simple helper function to check if a state object is a PhClintProject document state object */\nexport function isPhClintProjectState(state: unknown): state is PhClintProjectPHState {\n return PhClintProjectPHStateSchema.safeParse(state).success;\n}\n\n/** Simple helper function to assert that a document state object is a PhClintProject document state object */\nexport function assertIsPhClintProjectState(state: unknown): asserts state is PhClintProjectPHState {\n PhClintProjectPHStateSchema.parse(state);\n}\n\n/** Simple helper function to check if a document is a PhClintProject document */\nexport function isPhClintProjectDocument(document: unknown): document is PhClintProjectDocument {\n return PhClintProjectDocumentSchema.safeParse(document).success;\n}\n\n/** Simple helper function to assert that a document is a PhClintProject document */\nexport function assertIsPhClintProjectDocument(document: unknown): asserts document is PhClintProjectDocument {\n PhClintProjectDocumentSchema.parse(document);\n}\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelUtils, PHBaseState, Reducer } from 'document-model';\nimport { baseCreateDocument, baseLoadFromInputVersioned, baseSaveToFileHandle, defaultBaseState } from 'document-model';\nimport { phClintProjectUpgradeManifest } from '../../upgrades/upgrade-manifest.js';\nimport { assertIsPhClintProjectDocument, assertIsPhClintProjectState, isPhClintProjectDocument, isPhClintProjectState } from './document-schema.js';\nimport { phClintProjectDocumentType } from './document-type.js';\nimport { reducer } from './reducer.js';\nimport type { PhClintProjectGlobalState, PhClintProjectLocalState, PhClintProjectPHState } from './types.js';\n\nexport const initialGlobalState: PhClintProjectGlobalState = {\n name: null,\n scope: null,\n version: '0.1.0',\n description: '',\n features: {\n powerhouse: 'Disabled',\n mastra: {\n enabled: false,\n mainAgent: null,\n subAgents: [],\n models: [],\n profiles: [],\n common: { enableChat: false },\n },\n routine: { enabled: false },\n },\n packages: [],\n externalSkills: [],\n publishHistory: [],\n deployment: {\n proxyEnabled: false,\n observabilityEnabled: false,\n supportedResources: ['vetra-agent-s', 'vetra-agent-m', 'vetra-agent-l', 'vetra-agent-xl', 'vetra-agent-xxl'],\n },\n};\nexport const initialLocalState: PhClintProjectLocalState = {};\n\nexport const utils: DocumentModelUtils<PhClintProjectPHState> = {\n fileExtension: 'pcp',\n createState(state) {\n return {\n ...defaultBaseState(),\n global: { ...initialGlobalState, ...state?.global },\n local: { ...initialLocalState, ...state?.local },\n };\n },\n createDocument(state) {\n return baseCreateDocument(utils.createState, state, phClintProjectDocumentType);\n },\n saveToFileHandle(document, input) {\n return baseSaveToFileHandle(document, input);\n },\n loadFromInput(input) {\n return baseLoadFromInputVersioned(input, {\n reducers: { 1: reducer as unknown as Reducer<PHBaseState> },\n upgradeManifest: phClintProjectUpgradeManifest,\n });\n },\n isStateOfType(state) {\n return isPhClintProjectState(state);\n },\n assertIsStateOfType(state) {\n return assertIsPhClintProjectState(state);\n },\n isDocumentOfType(document) {\n return isPhClintProjectDocument(document);\n },\n assertIsDocumentOfType(document) {\n return assertIsPhClintProjectDocument(document);\n },\n};\n","export {};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelUtils } from 'document-model';\nimport type { PhClintProjectPHState } from './gen/types.js';\nimport { utils as genUtils } from './gen/utils.js';\nimport * as customUtils from './src/utils.js';\n\n/** Utils for the PhClintProject document model */\nexport const utils: DocumentModelUtils<PhClintProjectPHState> = {\n ...genUtils,\n ...customUtils,\n};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelModule } from 'document-model';\nimport { createState, defaultBaseState } from 'document-model';\nimport { actions } from './actions.js';\nimport { documentModel } from './gen/document-model.js';\nimport { reducer } from './gen/reducer.js';\nimport type { PhClintProjectPHState } from './gen/types.js';\nimport { utils } from './utils.js';\n\n/** Document model module for the PhClintProject document type */\nexport const PhClintProject = {\n version: 1,\n reducer,\n actions,\n utils,\n documentModel: createState(defaultBaseState(), documentModel),\n} as const satisfies DocumentModelModule<PhClintProjectPHState>;\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACF;IACF;GACD;IACE,IAAI;IACJ,MAAM;IACN,aAAa;IACb,YAAY;KACV;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SAAS;MACT,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ;OACN;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD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AAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACF;IACF;GACD;IACE,IAAI;IACJ,MAAM;IACN,aAAa;IACb,YAAY,CACV;KACE,IAAI;KACJ,MAAM;KACN,aAAa;KACb,QAAQ;KACR,UAAU;KACV,SACE;KACF,QAAQ;MACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX;MACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX;MACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX;MACF;KACD,UAAU,EAAE;KACZ,OAAO;KACR,EACD;KACE,IAAI;KACJ,MAAM;KACN,aAAa;KACb,QAAQ;KACR,UAAU;KACV,SACE;KACF,QAAQ;MACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX;MACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX;MACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX;MACF;KACD,UAAU,EAAE;KACZ,OAAO;KACR,CACF;IACF;GACD;IACE,IAAI;IACJ,MAAM;IACN,aAAa;IACb,YAAY;KACV;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ;OACN;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ;OACN;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACF;IACF;GACD;IACE,IAAI;IACJ,MAAM;IACN,aAAa;IACb,YAAY;KACV;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACF;IACF;GACD;IACE,IAAI;IACJ,MAAM;IACN,aAAa;IACb,YAAY;KACV;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ;OACN;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ;OACN;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACF;IACF;GACD;IACE,IAAI;IACJ,MAAM;IACN,aAAa;IACb,YAAY;KACV;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ;OACN;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ;OACN;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ;OACN;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ;OACN;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ;OACN;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;M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