eve 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +3 -3
- package/dist/src/chunks/{use-eve-agent-BNdcle_M.js → use-eve-agent-COmP-H8R.js} +6 -3
- package/dist/src/chunks/{use-eve-agent-FJkEMXYk.js → use-eve-agent-CnppTEFk.js} +6 -3
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/cli/commands/trace-detail.d.ts +3 -2
- package/dist/src/cli/commands/trace-detail.js +1 -1
- package/dist/src/cli/dev/tui/traces/trace-conversation.d.ts +4 -6
- package/dist/src/cli/dev/tui/traces/trace-conversation.js +1 -2
- package/dist/src/client/agent-info-schema.d.ts +12 -4
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/index.d.ts +1 -1
- package/dist/src/compiled/.vendor-stamp.json +3 -3
- package/dist/src/compiled/@chat-adapter/slack/index.js +1 -1
- package/dist/src/compiled/@workflow/core/index.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime.js +3 -3
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world/env-config.d.ts +1 -0
- package/dist/src/compiled/@workflow/world/events.d.ts +92 -35
- package/dist/src/compiled/@workflow/world/index.d.ts +3 -2
- package/dist/src/compiled/@workflow/world/interfaces.d.ts +25 -23
- package/dist/src/compiled/@workflow/world/queue.d.ts +4 -0
- package/dist/src/compiled/@workflow/world/runs.d.ts +4 -0
- package/dist/src/compiled/@workflow/world/slot-identity.d.ts +53 -0
- package/dist/src/compiled/@workflow/world/spec-version.d.ts +36 -1
- package/dist/src/compiled/@workflow/world/steps.d.ts +4 -0
- package/dist/src/compiled/@workflow/world/ulid.d.ts +6 -0
- package/dist/src/compiled/@workflow/world-local/index.js +4 -4
- package/dist/src/compiled/@workflow/world-vercel/index.js +13 -17
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-6OqdYdi4.js → attribute-changes-BoH7JsWp.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/dist-DlFv0aHY.js +40 -0
- package/dist/src/compiled/_chunks/workflow/env-config-DxamfI7T.js +1 -0
- package/dist/src/compiled/_chunks/workflow/frames-CTpeJYEQ.js +3 -0
- package/dist/src/compiled/_chunks/workflow/{functions-CXb61C6h.js → functions-CeeNvKsq.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-BPQHjeY5.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-DQ5dOyjm.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-id-BdE0MZz9.js +1 -0
- package/dist/src/compiled/_chunks/workflow/sleep-CzdoBiqy.js +1 -0
- package/dist/src/compiled/_chunks/workflow/spec-version-DBUVfF_R.js +1 -0
- package/dist/src/compiled/_chunks/workflow/undici-CUIybhQ2.js +95 -0
- package/dist/src/compiled/_chunks/workflow/wait-until-DK2lnH6U.js +15 -0
- package/dist/src/compiled/_chunks/workflow/{wrapper-CDq65xJV.js → wrapper-CMGju7QA.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/ws-transport-Csi6Cydc.js +1 -0
- package/dist/src/compiler/extension-compatibility.d.ts +10 -10
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +8 -8
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-extension.d.ts +3 -3
- package/dist/src/compiler/normalize-extension.js +1 -1
- package/dist/src/compiler/normalize-instructions.d.ts +1 -1
- package/dist/src/compiler/normalize-instructions.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -3
- package/dist/src/context/dynamic-instruction-lifecycle.d.ts +5 -1
- package/dist/src/context/dynamic-instruction-lifecycle.js +1 -1
- package/dist/src/context/keys.d.ts +6 -2
- package/dist/src/context/keys.js +1 -1
- package/dist/src/discover/manifest.d.ts +1 -1
- package/dist/src/discover/manifest.js +1 -1
- package/dist/src/evals/index.d.ts +2 -2
- package/dist/src/evals/reporters/index.d.ts +1 -1
- package/dist/src/evals/runner/artifacts.js +1 -1
- package/dist/src/evals/runner/execute-eval.d.ts +5 -0
- package/dist/src/evals/runner/execute-eval.js +1 -1
- package/dist/src/evals/runner/execute-task.d.ts +3 -0
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/runner/reporters/braintrust.js +1 -1
- package/dist/src/evals/runner/reporters/types.d.ts +28 -2
- package/dist/src/evals/runner/run-evals.js +1 -1
- package/dist/src/evals/session.d.ts +11 -2
- package/dist/src/evals/session.js +1 -1
- package/dist/src/evals/target.js +1 -1
- package/dist/src/evals/types.d.ts +10 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/session.js +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/execution/workflow-trace-context.d.ts +11 -0
- package/dist/src/execution/workflow-trace-context.js +1 -0
- package/dist/src/harness/ai-sdk-hook-bridge.d.ts +1 -1
- package/dist/src/harness/ai-sdk-hook-bridge.js +1 -1
- package/dist/src/harness/channel-delivery-instrumentation.d.ts +1 -1
- package/dist/src/harness/channel-delivery-instrumentation.js +1 -1
- package/dist/src/harness/emission.d.ts +2 -2
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/instrumentation/config.js +1 -0
- package/dist/src/harness/{instrumentation-content.d.ts → instrumentation/content.d.ts} +1 -1
- package/dist/src/harness/{instrumentation-dispatch.d.ts → instrumentation/dispatch.d.ts} +1 -1
- package/dist/src/harness/{instrumentation-dispatch.js → instrumentation/dispatch.js} +1 -1
- package/dist/src/harness/{instrumentation-lifecycle.d.ts → instrumentation/lifecycle.d.ts} +3 -6
- package/dist/src/harness/{instrumentation-lifecycle.js → instrumentation/lifecycle.js} +1 -1
- package/dist/src/harness/{instrumentation-native-events.d.ts → instrumentation/native-events.d.ts} +1 -1
- package/dist/src/harness/{instrumentation-native-events.js → instrumentation/native-events.js} +1 -1
- package/dist/src/harness/{instrumentation-providers.d.ts → instrumentation/providers.d.ts} +1 -1
- package/dist/src/harness/{instrumentation-providers.js → instrumentation/providers.js} +1 -1
- package/dist/src/harness/{instrumentation-runtime.d.ts → instrumentation/runtime.d.ts} +4 -2
- package/dist/src/harness/{instrumentation-state.d.ts → instrumentation/state.d.ts} +1 -1
- package/dist/src/harness/parent-lineage.d.ts +1 -1
- package/dist/src/harness/prepare-trace-context.d.ts +16 -0
- package/dist/src/harness/prepare-trace-context.js +1 -0
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/types.d.ts +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +2 -2
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.d.ts +3 -3
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-package-boundary.js +1 -1
- package/dist/src/internal/helpers/markdown.js +1 -1
- package/dist/src/internal/instrumentation.d.ts +1 -1
- package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +4 -3
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/channel-request-instrumentation.js +1 -1
- package/dist/src/internal/vercel/project-link.d.ts +1 -1
- package/dist/src/internal/vercel/project-link.js +1 -1
- package/dist/src/internal/vercel-agent-summary.d.ts +10 -9
- package/dist/src/internal/vercel-agent-summary.js +1 -1
- package/dist/src/internal/workflow/development-world-client.js +1 -1
- package/dist/src/protocol/message.d.ts +15 -1
- package/dist/src/protocol/message.js +1 -1
- package/dist/src/public/channels/github/auth.d.ts +30 -0
- package/dist/src/public/channels/github/auth.js +2 -2
- package/dist/src/public/channels/github/defaults.d.ts +4 -4
- package/dist/src/public/channels/github/defaults.js +1 -1
- package/dist/src/public/channels/github/dispatch.d.ts +3 -2
- package/dist/src/public/channels/github/dispatch.js +1 -1
- package/dist/src/public/channels/github/githubChannel.d.ts +7 -2
- package/dist/src/public/channels/github/githubChannel.js +1 -1
- package/dist/src/public/channels/github/index.d.ts +1 -1
- package/dist/src/public/definitions/instructions.d.ts +14 -4
- package/dist/src/public/definitions/instructions.js +1 -1
- package/dist/src/public/definitions/tool.d.ts +5 -8
- package/dist/src/public/instructions/index.d.ts +1 -2
- package/dist/src/public/instructions/index.js +1 -1
- package/dist/src/public/instrumentation/index.d.ts +4 -3
- package/dist/src/public/instrumentation/otel.d.ts +5 -4
- package/dist/src/public/instrumentation/provider.d.ts +2 -2
- package/dist/src/runtime/agent/bootstrap.d.ts +2 -0
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/prompt/compose.d.ts +1 -1
- package/dist/src/runtime/prompt/compose.js +3 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/types.d.ts +4 -3
- package/dist/src/setup/project-resolution.d.ts +3 -3
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/slack-connect-lifecycle.d.ts +0 -9
- package/dist/src/setup/slack-connect-lifecycle.js +1 -1
- package/dist/src/setup/slackbot.d.ts +2 -1
- package/dist/src/setup/slackbot.js +1 -1
- package/dist/src/shared/dynamic-tool-definition.d.ts +3 -4
- package/dist/src/shared/instructions-definition.d.ts +15 -11
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tracing/agent-action-instrumentation.d.ts +1 -1
- package/dist/src/tracing/agent-action-instrumentation.js +1 -1
- package/dist/src/tracing/agent-approval-instrumentation.d.ts +1 -1
- package/dist/src/tracing/agent-channel-delivery-instrumentation.d.ts +1 -1
- package/dist/src/tracing/agent-channel-delivery-instrumentation.js +1 -1
- package/dist/src/tracing/agent-otel-provider.d.ts +4 -2
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/agent-otel-session-context.d.ts +17 -0
- package/dist/src/tracing/agent-otel-session-context.js +1 -0
- package/dist/src/tracing/agent-otel-usage.d.ts +1 -1
- package/dist/src/tracing/agent-tool-instrumentation.d.ts +1 -1
- package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
- package/dist/src/tracing/agent-trace-state.d.ts +1 -1
- package/dist/src/tracing/install-instrumentation-runtime.d.ts +2 -2
- package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
- package/dist/src/tracing/local-instrumentation-runtime.d.ts +1 -1
- package/dist/src/tracing/local-instrumentation-runtime.js +1 -1
- package/dist/src/tracing/local-traces.d.ts +3 -3
- package/dist/src/tracing/local-traces.js +1 -1
- package/dist/src/tracing/otel-declaration.d.ts +2 -2
- package/dist/src/tracing/otel-declaration.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/README.md +18 -20
- package/docs/agent-config.md +5 -5
- package/docs/channels/eve.mdx +10 -56
- package/docs/channels/github.mdx +1 -1
- package/docs/channels/meta.json +1 -0
- package/docs/concepts/context-control.md +32 -56
- package/docs/concepts/default-harness.md +2 -2
- package/docs/concepts/execution-model-and-durability.mdx +4 -4
- package/docs/concepts/meta.json +3 -1
- package/docs/concepts/sessions-runs-and-streaming.md +22 -10
- package/docs/{guides → concepts}/state.md +3 -3
- package/docs/connections/mcp.mdx +6 -89
- package/docs/connections/meta.json +1 -0
- package/docs/connections/openapi.mdx +5 -69
- package/docs/connections/overview.mdx +29 -3
- package/docs/evals/meta.json +1 -0
- package/docs/evals/reporters.mdx +14 -4
- package/docs/extensions.md +1 -1
- package/docs/getting-started.mdx +175 -13
- package/docs/guides/auth-and-route-protection.md +3 -18
- package/docs/guides/client/meta.json +2 -1
- package/docs/guides/client/output-schema.mdx +2 -2
- package/docs/guides/client/overview.mdx +1 -1
- package/docs/guides/deployment/meta.json +1 -0
- package/docs/guides/deployment/overview.md +1 -1
- package/docs/guides/deployment/self-hosting.md +3 -3
- package/docs/guides/deployment/vercel.mdx +1 -1
- package/docs/guides/dev-tui.md +3 -13
- package/docs/guides/dynamic-capabilities.md +26 -4
- package/docs/guides/frontend/meta.json +2 -1
- package/docs/guides/frontend/nextjs.mdx +1 -10
- package/docs/guides/frontend/nuxt.mdx +1 -10
- package/docs/guides/frontend/overview.mdx +12 -3
- package/docs/guides/frontend/sveltekit.mdx +1 -10
- package/docs/guides/frontend/use-eve-agent-svelte.mdx +39 -126
- package/docs/guides/frontend/use-eve-agent-vue.mdx +40 -139
- package/docs/guides/instrumentation.md +15 -15
- package/docs/guides/meta.json +1 -5
- package/docs/guides/remote-agents.md +9 -9
- package/docs/guides/session-context.md +34 -103
- package/docs/install-integrations.mdx +1 -1
- package/docs/instructions.mdx +45 -12
- package/docs/meta.json +24 -13
- package/docs/patterns/dynamic-scheduling.md +1 -1
- package/docs/patterns/meta.json +1 -0
- package/docs/patterns/multi-tenant-approvals.md +1 -1
- package/docs/patterns/multi-tenant-auth.md +1 -1
- package/docs/patterns/multi-tenant-memory.md +4 -3
- package/docs/{guides → protocols}/acp.md +1 -1
- package/docs/protocols/meta.json +5 -0
- package/docs/reference/cli.md +34 -34
- package/docs/reference/meta.json +1 -1
- package/docs/reference/typescript-api.md +4 -2
- package/docs/{subagents.mdx → subagents/index.mdx} +2 -2
- package/docs/subagents/meta.json +5 -0
- package/docs/{guides/dynamic-workflows.md → subagents/workflow-tool.md} +6 -6
- package/docs/tools/human-in-the-loop.md +1 -1
- package/docs/tools/meta.json +1 -0
- package/docs/tools/overview.mdx +1 -1
- package/docs/tutorial/connect-a-warehouse.mdx +1 -1
- package/docs/tutorial/meta.json +1 -0
- package/docs/tutorial/remember-definitions.mdx +2 -2
- package/docs/tutorial/ship-it.mdx +2 -2
- package/package.json +4 -4
- package/dist/src/compiled/_chunks/workflow/dist-C8PhDW9B.js +0 -1
- package/dist/src/compiled/_chunks/workflow/functions-xMPAeWFr.js +0 -1
- package/dist/src/compiled/_chunks/workflow/node-Smb57EnG.js +0 -40
- package/dist/src/compiled/_chunks/workflow/resume-hook-BrduAuFX.js +0 -1
- package/dist/src/compiled/_chunks/workflow/run-CX7_sJnW.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-tsb2HjWK.js +0 -1
- package/dist/src/compiled/_chunks/workflow/undici-BNc_0O4m.js +0 -95
- package/dist/src/compiled/_chunks/workflow/wait-until-BYKVqrwc.js +0 -15
- package/dist/src/harness/instrumentation-config.js +0 -1
- package/docs/installation.mdx +0 -66
- package/docs/project-structure.mdx +0 -53
- package/docs/reference/project-layout.md +0 -123
- /package/dist/src/harness/{instrumentation-config.d.ts → instrumentation/config.d.ts} +0 -0
- /package/dist/src/harness/{instrumentation-content.js → instrumentation/content.js} +0 -0
- /package/dist/src/harness/{instrumentation-runtime-context.d.ts → instrumentation/runtime-context.d.ts} +0 -0
- /package/dist/src/harness/{instrumentation-runtime-context.js → instrumentation/runtime-context.js} +0 -0
- /package/dist/src/harness/{instrumentation-runtime.js → instrumentation/runtime.js} +0 -0
- /package/dist/src/harness/{instrumentation-setup-context.d.ts → instrumentation/setup-context.d.ts} +0 -0
- /package/dist/src/harness/{instrumentation-setup-context.js → instrumentation/setup-context.js} +0 -0
- /package/dist/src/harness/{instrumentation-state.js → instrumentation/state.js} +0 -0
- /package/docs/{guides → protocols}/ucp.mdx +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DaDcL9Zw.js";var t=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{CITY_HEADER_NAME:()=>u,COUNTRY_HEADER_NAME:()=>d,EMOJI_FLAG_UNICODE_STARTING_POSITION:()=>v,IP_HEADER_NAME:()=>f,LATITUDE_HEADER_NAME:()=>p,LONGITUDE_HEADER_NAME:()=>m,POSTAL_CODE_HEADER_NAME:()=>g,REGION_HEADER_NAME:()=>h,REQUEST_ID_HEADER_NAME:()=>_,geolocation:()=>w,ipAddress:()=>S}),t.exports=c(l);let u=`x-vercel-ip-city`,d=`x-vercel-ip-country`,f=`x-real-ip`,p=`x-vercel-ip-latitude`,m=`x-vercel-ip-longitude`,h=`x-vercel-ip-country-region`,g=`x-vercel-ip-postal-code`,_=`x-vercel-id`,v=127397;function y(e,t){return e.get(t)??void 0}function b(e,t){let n=y(e.headers,t);return n?decodeURIComponent(n):void 0}function x(e){let t=RegExp(`^[A-Z]{2}$`).test(e);if(!(!e||!t))return String.fromCodePoint(...e.split(``).map(e=>v+e.charCodeAt(0)))}function S(e){return y(`headers`in e?e.headers:e,f)}function C(e){return e?e.split(`:`)[0]:`dev1`}function w(e){return{city:b(e,u),country:y(e.headers,d),flag:x(y(e.headers,d)),countryRegion:y(e.headers,h),region:C(y(e.headers,_)),latitude:y(e.headers,p),longitude:y(e.headers,m),postalCode:y(e.headers,g)}}0&&(t.exports={CITY_HEADER_NAME:u,COUNTRY_HEADER_NAME:d,EMOJI_FLAG_UNICODE_STARTING_POSITION:v,IP_HEADER_NAME:f,LATITUDE_HEADER_NAME:p,LONGITUDE_HEADER_NAME:m,POSTAL_CODE_HEADER_NAME:g,REGION_HEADER_NAME:h,REQUEST_ID_HEADER_NAME:_,geolocation:w,ipAddress:S})})),n=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{getEnv:()=>u}),t.exports=c(l);let u=(e=process.env)=>({VERCEL:d(e,`VERCEL`),CI:d(e,`CI`),VERCEL_ENV:d(e,`VERCEL_ENV`),VERCEL_URL:d(e,`VERCEL_URL`),VERCEL_BRANCH_URL:d(e,`VERCEL_BRANCH_URL`),VERCEL_PROJECT_PRODUCTION_URL:d(e,`VERCEL_PROJECT_PRODUCTION_URL`),VERCEL_REGION:d(e,`VERCEL_REGION`),VERCEL_DEPLOYMENT_ID:d(e,`VERCEL_DEPLOYMENT_ID`),VERCEL_SKEW_PROTECTION_ENABLED:d(e,`VERCEL_SKEW_PROTECTION_ENABLED`),VERCEL_AUTOMATION_BYPASS_SECRET:d(e,`VERCEL_AUTOMATION_BYPASS_SECRET`),VERCEL_GIT_PROVIDER:d(e,`VERCEL_GIT_PROVIDER`),VERCEL_GIT_REPO_SLUG:d(e,`VERCEL_GIT_REPO_SLUG`),VERCEL_GIT_REPO_OWNER:d(e,`VERCEL_GIT_REPO_OWNER`),VERCEL_GIT_REPO_ID:d(e,`VERCEL_GIT_REPO_ID`),VERCEL_GIT_COMMIT_REF:d(e,`VERCEL_GIT_COMMIT_REF`),VERCEL_GIT_COMMIT_SHA:d(e,`VERCEL_GIT_COMMIT_SHA`),VERCEL_GIT_COMMIT_MESSAGE:d(e,`VERCEL_GIT_COMMIT_MESSAGE`),VERCEL_GIT_COMMIT_AUTHOR_LOGIN:d(e,`VERCEL_GIT_COMMIT_AUTHOR_LOGIN`),VERCEL_GIT_COMMIT_AUTHOR_NAME:d(e,`VERCEL_GIT_COMMIT_AUTHOR_NAME`),VERCEL_GIT_PREVIOUS_SHA:d(e,`VERCEL_GIT_PREVIOUS_SHA`),VERCEL_GIT_PULL_REQUEST_ID:d(e,`VERCEL_GIT_PULL_REQUEST_ID`)}),d=(e,t)=>{let n=e[t];return n===``?void 0:n};0&&(t.exports={getEnv:u})})),r=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{SYMBOL_FOR_REQ_CONTEXT:()=>u,getContext:()=>d}),t.exports=c(l);let u=Symbol.for(`@vercel/request-context`);function d(){return globalThis[u]?.get?.()??{}}0&&(t.exports={SYMBOL_FOR_REQ_CONTEXT:u,getContext:d})})),i=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{getDeadline:()=>f}),t.exports=l(u);var d=r();function f(){let e=(0,d.getContext)().deadline;if(e===void 0)return;let t=new Date(e);if(!isNaN(t.getTime()))return t}0&&(t.exports={getDeadline:f})})),a=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{waitUntil:()=>f}),t.exports=l(u);var d=r();let f=e=>{if(typeof e!=`object`||!e||typeof e.then!=`function`)throw TypeError(`waitUntil can only be called with a Promise, got ${typeof e}`);return(0,d.getContext)().waitUntil?.(e)};0&&(t.exports={waitUntil:f})})),o=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{next:()=>f,rewrite:()=>d}),t.exports=c(l);function u(e,t){if(e?.request?.headers){if(!(e.request.headers instanceof Headers))throw Error(`request.headers must be an instance of Headers`);let n=[];for(let[r,i]of e.request.headers)t.set(`x-middleware-request-`+r,i),n.push(r);t.set(`x-middleware-override-headers`,n.join(`,`))}}function d(e,t){let n=new Headers(t?.headers??{});return n.set(`x-middleware-rewrite`,String(e)),u(t,n),new Response(null,{...t,headers:n})}function f(e){let t=new Headers(e?.headers??{});return t.set(`x-middleware-next`,`1`),u(e,t),new Response(null,{...e,headers:t})}0&&(t.exports={next:f,rewrite:d})})),s=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{InMemoryCache:()=>u}),t.exports=c(l);var u=class{constructor(){this.cache={}}async get(e){let t=this.cache[e];return t?t.ttl&&t.lastModified+t.ttl*1e3<Date.now()?(await this.delete(e),null):JSON.parse(t.value):null}async set(e,t,n){let r=JSON.stringify(t??null);this.cache[e]={value:r,lastModified:Date.now(),ttl:n?.ttl,tags:new Set(n?.tags||[])}}async delete(e){delete this.cache[e]}async expireTag(e){let t=Array.isArray(e)?e:[e];for(let e in this.cache)if(Object.prototype.hasOwnProperty.call(this.cache,e)){let n=this.cache[e];t.some(e=>n.tags.has(e))&&delete this.cache[e]}}};0&&(t.exports={InMemoryCache:u})})),c=e(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),u={};o(u,{BuildCache:()=>f}),t.exports=c(u);var d=l(),f=class{constructor({endpoint:e,headers:t,onError:n,timeout:r=500}){this.get=async e=>{let t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout);try{let r=await fetch(`${this.endpoint}${e}`,{headers:this.headers,method:`GET`,signal:t.signal});if(r.status===404)return clearTimeout(n),null;if(r.status===200){if(r.headers.get(d.HEADERS_VERCEL_CACHE_STATE)!==d.PkgCacheState.Fresh)return r.body?.cancel?.(),clearTimeout(n),null;let e=await r.json();return clearTimeout(n),e}else throw clearTimeout(n),Error(`Failed to get cache: ${r.statusText}`)}catch(e){if(clearTimeout(n),e.name===`AbortError`){let t=Error(`Cache request timed out after ${this.timeout}ms`);t.stack=e.stack,this.onError?.(t)}else this.onError?.(e);return null}},this.set=async(e,t,n)=>{let r=new AbortController,i=setTimeout(()=>r.abort(),this.timeout);try{let a={};n?.ttl&&(a[d.HEADERS_VERCEL_REVALIDATE]=n.ttl.toString()),n?.tags&&n.tags.length>0&&(a[d.HEADERS_VERCEL_CACHE_TAGS]=n.tags.join(`,`)),n?.name&&(a[d.HEADERS_VERCEL_CACHE_ITEM_NAME]=n.name);let o=await fetch(`${this.endpoint}${e}`,{method:`POST`,headers:{...this.headers,...a},body:JSON.stringify(t),signal:r.signal});if(clearTimeout(i),o.status!==200)throw Error(`Failed to set cache: ${o.status} ${o.statusText}`)}catch(e){if(clearTimeout(i),e.name===`AbortError`){let t=Error(`Cache request timed out after ${this.timeout}ms`);t.stack=e.stack,this.onError?.(t)}else this.onError?.(e)}},this.delete=async e=>{let t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout);try{let r=await fetch(`${this.endpoint}${e}`,{method:`DELETE`,headers:this.headers,signal:t.signal});if(clearTimeout(n),r.status!==200)throw Error(`Failed to delete cache: ${r.statusText}`)}catch(e){if(clearTimeout(n),e.name===`AbortError`){let t=Error(`Cache request timed out after ${this.timeout}ms`);t.stack=e.stack,this.onError?.(t)}else this.onError?.(e)}},this.expireTag=async e=>{let t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout);try{Array.isArray(e)&&(e=e.join(`,`));let r=await fetch(`${this.endpoint}revalidate?tags=${e}`,{method:`POST`,headers:this.headers,signal:t.signal});if(clearTimeout(n),r.status!==200)throw Error(`Failed to revalidate tag: ${r.statusText}`)}catch(e){if(clearTimeout(n),e.name===`AbortError`){let t=Error(`Cache request timed out after ${this.timeout}ms`);t.stack=e.stack,this.onError?.(t)}else this.onError?.(e)}},this.endpoint=e,this.headers=t,this.onError=n,this.timeout=r}};0&&(t.exports={BuildCache:f})})),l=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},u=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},d=e=>u(n({},`__esModule`,{value:!0}),e),f={};l(f,{HEADERS_VERCEL_CACHE_ITEM_NAME:()=>O,HEADERS_VERCEL_CACHE_STATE:()=>T,HEADERS_VERCEL_CACHE_TAGS:()=>D,HEADERS_VERCEL_REVALIDATE:()=>E,PkgCacheState:()=>w,getCache:()=>y}),t.exports=d(f);var p=r(),m=s(),h=c();let g=e=>{let t=5381;for(let n=0;n<e.length;n++)t=t*33^e.charCodeAt(n);return(t>>>0).toString(16)},_=null,v=null,y=e=>x(()=>{let e;return e=(0,p.getContext)().cache?(0,p.getContext)().cache:C(process.env.SUSPENSE_CACHE_DEBUG===`true`),e},b(e));function b(e){let t=e?.keyHashFunction||g;return n=>{if(!e?.namespace)return t(n);let r=e.namespaceSeparator||`$`;return`${e.namespace}${r}${t(n)}`}}function x(e,t){return{get:n=>e().get(t(n)),set:(n,r,i)=>e().set(t(n),r,{...i,name:i?.name??n}),delete:n=>e().delete(t(n)),expireTag:t=>e().expireTag(t)}}let S=!1;function C(e){if(_||=new m.InMemoryCache,process.env.RUNTIME_CACHE_DISABLE_BUILD_CACHE===`true`)return e&&console.log(`Using InMemoryCache as build cache is disabled`),_;let{RUNTIME_CACHE_ENDPOINT:t,RUNTIME_CACHE_HEADERS:n}=process.env;if(e&&console.log(`Runtime cache environment variables:`,{RUNTIME_CACHE_ENDPOINT:t,RUNTIME_CACHE_HEADERS:n}),!t||!n)return S||=(console.warn(`Runtime Cache unavailable in this environment. Falling back to in-memory cache.`),!0),_;if(!v){let e={};try{e=JSON.parse(n)}catch(e){return console.error(`Failed to parse RUNTIME_CACHE_HEADERS:`,e),_}let r=500;if(process.env.RUNTIME_CACHE_TIMEOUT){let e=parseInt(process.env.RUNTIME_CACHE_TIMEOUT,10);!isNaN(e)&&e>0?r=e:console.warn(`Invalid RUNTIME_CACHE_TIMEOUT value: "${process.env.RUNTIME_CACHE_TIMEOUT}". Using default: ${r}ms`)}v=new h.BuildCache({endpoint:t,headers:e,onError:e=>console.error(e),timeout:r})}return v}var w=(e=>(e.Fresh=`fresh`,e.Stale=`stale`,e.Expired=`expired`,e.NotFound=`notFound`,e.Error=`error`,e))(w||{});let T=`x-vercel-cache-state`,E=`x-vercel-revalidate`,D=`x-vercel-cache-tags`,O=`x-vercel-cache-item-name`;0&&(t.exports={HEADERS_VERCEL_CACHE_ITEM_NAME:O,HEADERS_VERCEL_CACHE_STATE:T,HEADERS_VERCEL_CACHE_TAGS:D,HEADERS_VERCEL_REVALIDATE:E,PkgCacheState:w,getCache:y})})),u=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{attachDatabasePool:()=>v,experimental_attachDatabasePool:()=>y}),t.exports=l(u);var d=r();let f=!!process.env.DEBUG;function p(e){if(`options`in e&&e.options){if(`idleTimeoutMillis`in e.options)return typeof e.options.idleTimeoutMillis==`number`?e.options.idleTimeoutMillis:1e4;if(`maxIdleTimeMS`in e.options)return typeof e.options.maxIdleTimeMS==`number`?e.options.maxIdleTimeMS:0;if(`status`in e)return 5e3;if(`connect`in e&&`execute`in e)return 3e4}if(`config`in e&&e.config){if(`connectionConfig`in e.config&&e.config.connectionConfig)return e.config.connectionConfig.idleTimeout||6e4;if(`idleTimeout`in e.config)return typeof e.config.idleTimeout==`number`?e.config.idleTimeout:6e4}return`poolTimeout`in e?typeof e.poolTimeout==`number`?e.poolTimeout:6e4:`idleTimeout`in e?typeof e.idleTimeout==`number`?e.idleTimeout:0:1e4}let m=null,h=()=>{},g=Date.now();function _(e){if(!process.env.VERCEL_URL||!process.env.VERCEL_REGION)return;m&&(clearTimeout(m),h());let t=new Promise(e=>{h=e}),n=Math.min(p(e)+100,Math.max(100,899e3-(Date.now()-g)));m=setTimeout(()=>{h?.(),f&&console.log(`Database pool idle timeout reached. Releasing connections.`)},n);let r=(0,d.getContext)();r?.waitUntil?r.waitUntil(t):console.warn(`Pool release event triggered outside of request scope.`)}function v(e){if(m&&(h?.(),clearTimeout(m)),`on`in e&&e.on&&`options`in e&&`idleTimeoutMillis`in e.options){e.on(`release`,()=>{f&&console.log(`Client released from pool`),_(e)});return}else if(`on`in e&&e.on&&`config`in e&&e.config&&`connectionConfig`in e.config){e.on(`release`,()=>{f&&console.log(`MySQL client released from pool`),_(e)});return}else if(`on`in e&&e.on&&`config`in e&&e.config&&`idleTimeout`in e.config){e.on(`release`,()=>{f&&console.log(`MySQL2/MariaDB client released from pool`),_(e)});return}if(`on`in e&&e.on&&`options`in e&&e.options&&`maxIdleTimeMS`in e.options){e.on(`connectionCheckedOut`,()=>{f&&console.log(`MongoDB connection checked out`),_(e)});return}if(`on`in e&&e.on&&`options`in e&&e.options&&`socket`in e.options){e.on(`end`,()=>{f&&console.log(`Redis connection ended`),_(e)});return}throw Error(`Unsupported database pool type`)}let y=v;0&&(t.exports={attachDatabasePool:v,experimental_attachDatabasePool:y})})),d=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{dangerouslyDeleteBySrcImage:()=>h,dangerouslyDeleteByTag:()=>p,invalidateBySrcImage:()=>m,invalidateByTag:()=>f}),t.exports=l(u);var d=r();let f=e=>{let t=(0,d.getContext)().purge;return t?t.invalidateByTag(e):Promise.resolve()},p=(e,t)=>{let n=(0,d.getContext)().purge;return n?n.dangerouslyDeleteByTag(e,t):Promise.resolve()},m=e=>{let t=(0,d.getContext)().purge;return t?t.invalidateBySrcImage(e):Promise.resolve()},h=(e,t)=>{let n=(0,d.getContext)().purge;return n?n.dangerouslyDeleteBySrcImage(e,t):Promise.resolve()};0&&(t.exports={dangerouslyDeleteBySrcImage:h,dangerouslyDeleteByTag:p,invalidateBySrcImage:m,invalidateByTag:f})})),f=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{addCacheTag:()=>f}),t.exports=l(u);var d=r();let f=e=>{let t=(0,d.getContext)().addCacheTag;return t?t(e):Promise.resolve()};0&&(t.exports={addCacheTag:f})})),p=e(((e,t)=>{var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==r&&n(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{experimental_upgradeWebSocket:()=>p}),t.exports=l(u);var d=r();async function f(){try{return(await import(`./wrapper-CDq65xJV.js`)).WebSocketServer}catch{throw Error(`The "ws" package is required for experimental_upgradeWebSocket(). Install it with: npm install ws`)}}async function p(e,t={}){let n=(0,d.getContext)();if(typeof n.upgradeWebSocket!=`function`)throw Error(`experimental_upgradeWebSocket is not available in the current runtime environment. This feature requires a Vercel runtime that supports WebSocket upgrades.`);let r=await f(),{req:i,socket:a,head:o}=n.upgradeWebSocket(),s=new r({noServer:!0,maxPayload:t.maxPayload??262144}),c=await new Promise((e,t)=>{let n=()=>{a.removeListener(`error`,l),a.removeListener(`close`,u)},r=e=>{if(n(),e instanceof Error){t(e);return}let r=Error(`WebSocket upgrade failed`);r.cause=e,t(r)},c=t=>{n(),e(t)},l=e=>r(e),u=()=>r(Error(`socket closed before the WebSocket upgrade completed`));a.once(`error`,l),a.once(`close`,u);try{s.handleUpgrade(i,a,o,c)}catch(e){r(e)}});try{await e(c)}catch(e){throw c.close(1011,`WebSocket handler failed`),e}return new Response(null,{status:204})}0&&(t.exports={experimental_upgradeWebSocket:p})})),m=e(((e,r)=>{var s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,g=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})},_=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of m(t))!h.call(e,i)&&i!==n&&s(e,i,{get:()=>t[i],enumerable:!(r=c(t,i))||r.enumerable});return e},v=e=>_(s({},`__esModule`,{value:!0}),e),y={};g(y,{addCacheTag:()=>O.addCacheTag,attachDatabasePool:()=>E.attachDatabasePool,dangerouslyDeleteBySrcImage:()=>D.dangerouslyDeleteBySrcImage,dangerouslyDeleteByTag:()=>D.dangerouslyDeleteByTag,experimental_attachDatabasePool:()=>E.experimental_attachDatabasePool,experimental_upgradeWebSocket:()=>k.experimental_upgradeWebSocket,geolocation:()=>b.geolocation,getCache:()=>T.getCache,getDeadline:()=>S.getDeadline,getEnv:()=>x.getEnv,invalidateBySrcImage:()=>D.invalidateBySrcImage,invalidateByTag:()=>D.invalidateByTag,ipAddress:()=>b.ipAddress,next:()=>w.next,rewrite:()=>w.rewrite,waitUntil:()=>C.waitUntil}),r.exports=v(y);var b=t(),x=n(),S=i(),C=a(),w=o(),T=l(),E=u(),D=d(),O=f(),k=p();0&&(r.exports={addCacheTag,attachDatabasePool,dangerouslyDeleteBySrcImage,dangerouslyDeleteByTag,experimental_attachDatabasePool,experimental_upgradeWebSocket,geolocation,getCache,getDeadline,getEnv,invalidateBySrcImage,invalidateByTag,ipAddress,next,rewrite,waitUntil})}));export default m();export{};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-DaDcL9Zw.js";import t from"node:crypto";const n=Object.freeze({status:`aborted`});function r(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}const i=Symbol(`zod_brand`);var a=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},o=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};const s={};function c(e){return e&&Object.assign(s,e),s}var l=e({BIGINT_FORMAT_RANGES:()=>Oe,Class:()=>qe,NUMBER_FORMAT_RANGES:()=>De,aborted:()=>x,allowsEval:()=>ve,assert:()=>ne,assertEqual:()=>u,assertIs:()=>d,assertNever:()=>te,assertNotEqual:()=>ee,assignProp:()=>m,base64ToUint8Array:()=>Ve,base64urlToUint8Array:()=>Ue,cached:()=>oe,captureStackTrace:()=>_e,cleanEnum:()=>Be,cleanRegex:()=>se,clone:()=>y,cloneDef:()=>de,createTransparentProxy:()=>we,defineLazy:()=>p,esc:()=>he,escapeRegex:()=>v,extend:()=>je,finalizeIssue:()=>C,floatSafeRemainder:()=>ce,getElementAtPath:()=>fe,getEnumValues:()=>re,getLengthableOrigin:()=>Re,getParsedType:()=>xe,getSizableOrigin:()=>Le,hexToUint8Array:()=>Ge,isObject:()=>g,isPlainObject:()=>_,issue:()=>w,joinValues:()=>ie,jsonStringifyReplacer:()=>ae,merge:()=>Ne,mergeDefs:()=>h,normalizeParams:()=>b,nullish:()=>f,numKeys:()=>be,objectClone:()=>ue,omit:()=>Ae,optionalKeys:()=>Ee,parsedType:()=>ze,partial:()=>Pe,pick:()=>ke,prefixIssues:()=>S,primitiveTypes:()=>Ce,promiseAllObject:()=>pe,propertyKeyTypes:()=>Se,randomString:()=>me,required:()=>Fe,safeExtend:()=>Me,shallowClone:()=>ye,slugify:()=>ge,stringifyPrimitive:()=>Te,uint8ArrayToBase64:()=>He,uint8ArrayToBase64url:()=>We,uint8ArrayToHex:()=>Ke,unwrapMessage:()=>Ie});function u(e){return e}function ee(e){return e}function d(e){}function te(e){throw Error(`Unexpected value in exhaustive check`)}function ne(e){}function re(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function ie(e,t=`|`){return e.map(e=>Te(e)).join(t)}function ae(e,t){return typeof t==`bigint`?t.toString():t}function oe(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function f(e){return e==null}function se(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ce(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}const le=Symbol(`evaluating`);function p(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==le)return r===void 0&&(r=le,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ue(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function m(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function h(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function de(e){return h(e._zod.def)}function fe(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function pe(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function me(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function he(e){return JSON.stringify(e)}function ge(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const _e=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const ve=oe(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function _(e){if(g(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(g(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ye(e){return _(e)?{...e}:Array.isArray(e)?[...e]:e}function be(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const xe=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},Se=new Set([`string`,`number`,`symbol`]),Ce=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function v(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function y(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function b(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function we(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function Te(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Ee(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const De={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Oe={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function ke(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return y(e,h(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return m(this,`shape`,e),e},checks:[]}))}function Ae(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return y(e,h(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return m(this,`shape`,r),r},checks:[]}))}function je(e,t){if(!_(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return y(e,h(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return m(this,`shape`,n),n}}))}function Me(e,t){if(!_(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return y(e,h(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return m(this,`shape`,n),n}}))}function Ne(e,t){return y(e,h(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return m(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Pe(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return y(t,h(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return m(this,`shape`,i),i},checks:[]}))}function Fe(e,t,n){return y(t,h(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return m(this,`shape`,i),i}}))}function x(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function S(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ie(e){return typeof e==`string`?e:e?.message}function C(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Ie(e.inst?._zod.def?.error?.(e))??Ie(t?.error?.(e))??Ie(n.customError?.(e))??Ie(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Le(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function Re(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function ze(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function w(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Be(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Ve(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function He(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Ue(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return Ve(t+`=`.repeat((4-t.length%4)%4))}function We(e){return He(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function Ge(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function Ke(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var qe=class{constructor(...e){}};const Je=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ae,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ye=r(`$ZodError`,Je),T=r(`$ZodError`,Je,{Parent:Error});function Xe(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ze(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}function Qe(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},s.path));else if(s.code===`invalid_key`)r({issues:s.issues},s.path);else if(s.code===`invalid_element`)r({issues:s.issues},s.path);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??={},(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??=[],(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}};return r(e),n}function $e(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function et(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${$e(e.path)}`);return t.join(`
|
|
2
|
-
`)}const E=e=>(t,n,r,i)=>{let o=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new a;if(s.issues.length){let t=new((i?.Err)??e)(s.issues.map(e=>C(e,o,c())));throw _e(t,i?.callee),t}return s.value},tt=E(T),D=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>C(e,a,c())));throw _e(t,i?.callee),t}return o.value},nt=D(T),rt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new a;return o.issues.length?{success:!1,error:new(e??Ye)(o.issues.map(e=>C(e,i,c())))}:{success:!0,data:o.value}},it=rt(T),at=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>C(e,i,c())))}:{success:!0,data:a.value}},ot=at(T),st=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return E(e)(t,n,i)},ct=st(T),lt=e=>(t,n,r)=>E(e)(t,n,r),ut=lt(T),dt=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return D(e)(t,n,i)},ft=dt(T),pt=e=>async(t,n,r)=>D(e)(t,n,r),mt=pt(T),ht=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return rt(e)(t,n,i)},gt=ht(T),_t=e=>(t,n,r)=>rt(e)(t,n,r),vt=_t(T),yt=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return at(e)(t,n,i)},bt=yt(T),xt=e=>async(t,n,r)=>at(e)(t,n,r),St=xt(T);var Ct=e({base64:()=>Jt,base64url:()=>Yt,bigint:()=>on,boolean:()=>ln,browserEmail:()=>Vt,cidrv4:()=>Kt,cidrv6:()=>qt,cuid:()=>wt,cuid2:()=>Tt,date:()=>en,datetime:()=>rn,domain:()=>Zt,duration:()=>At,e164:()=>Qt,email:()=>It,emoji:()=>Ht,extendedDuration:()=>jt,guid:()=>Mt,hex:()=>mn,hostname:()=>Xt,html5Email:()=>Lt,idnEmail:()=>Bt,integer:()=>sn,ipv4:()=>Ut,ipv6:()=>Wt,ksuid:()=>Ot,lowercase:()=>fn,mac:()=>Gt,md5_base64:()=>_n,md5_base64url:()=>vn,md5_hex:()=>gn,nanoid:()=>kt,null:()=>un,number:()=>cn,rfc5322Email:()=>Rt,sha1_base64:()=>bn,sha1_base64url:()=>xn,sha1_hex:()=>yn,sha256_base64:()=>Cn,sha256_base64url:()=>wn,sha256_hex:()=>Sn,sha384_base64:()=>En,sha384_base64url:()=>Dn,sha384_hex:()=>Tn,sha512_base64:()=>kn,sha512_base64url:()=>An,sha512_hex:()=>On,string:()=>an,time:()=>nn,ulid:()=>Et,undefined:()=>dn,unicodeEmail:()=>zt,uppercase:()=>pn,uuid:()=>O,uuid4:()=>Nt,uuid6:()=>Pt,uuid7:()=>Ft,xid:()=>Dt});const wt=/^[cC][^\s-]{8,}$/,Tt=/^[0-9a-z]+$/,Et=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Dt=/^[0-9a-vA-V]{20}$/,Ot=/^[A-Za-z0-9]{27}$/,kt=/^[a-zA-Z0-9_-]{21}$/,At=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,jt=/^[-+]?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)?)??$/,Mt=/^([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})$/,O=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Nt=O(4),Pt=O(6),Ft=O(7),It=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Lt=/^[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])?)*$/,Rt=/^(([^<>()\[\]\\.,;:\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,}))$/,zt=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Bt=zt,Vt=/^[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])?)*$/;function Ht(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const Ut=/^(?:(?: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])$/,Wt=/^(([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}|:))$/,Gt=e=>{let t=v(e??`:`);return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Kt=/^((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])$/,qt=/^(([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])$/,Jt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yt=/^[A-Za-z0-9_-]*$/,Xt=/^(?=.{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])?)*\.?$/,Zt=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Qt=/^\+[1-9]\d{6,14}$/,$t=`(?:(?:\\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])))`,en=RegExp(`^${$t}$`);function tn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function nn(e){return RegExp(`^${tn(e)}$`)}function rn(e){let t=tn({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${$t}T(?:${r})$`)}const an=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},on=/^-?\d+n?$/,sn=/^-?\d+$/,cn=/^-?\d+(?:\.\d+)?$/,ln=/^(?:true|false)$/i,un=/^null$/i,dn=/^undefined$/i,fn=/^[^A-Z]*$/,pn=/^[^a-z]*$/,mn=/^[0-9a-fA-F]*$/;function hn(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function k(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const gn=/^[0-9a-fA-F]{32}$/,_n=hn(22,`==`),vn=k(22),yn=/^[0-9a-fA-F]{40}$/,bn=hn(27,`=`),xn=k(27),Sn=/^[0-9a-fA-F]{64}$/,Cn=hn(43,`=`),wn=k(43),Tn=/^[0-9a-fA-F]{96}$/,En=hn(64,``),Dn=k(64),On=/^[0-9a-fA-F]{128}$/,kn=hn(86,`==`),An=k(86),A=r(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),jn={number:`number`,bigint:`bigint`,object:`date`},Mn=r(`$ZodCheckLessThan`,(e,t)=>{A.init(e,t);let n=jn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Nn=r(`$ZodCheckGreaterThan`,(e,t)=>{A.init(e,t);let n=jn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pn=r(`$ZodCheckMultipleOf`,(e,t)=>{A.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):ce(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Fn=r(`$ZodCheckNumberFormat`,(e,t)=>{A.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=De[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=sn)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),In=r(`$ZodCheckBigIntFormat`,(e,t)=>{A.init(e,t);let[n,r]=Oe[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Ln=r(`$ZodCheckMaxSize`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!f(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:Le(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Rn=r(`$ZodCheckMinSize`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!f(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:Le(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),zn=r(`$ZodCheckSizeEquals`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!f(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:Le(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Bn=r(`$ZodCheckMaxLength`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!f(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Re(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Vn=r(`$ZodCheckMinLength`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!f(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Re(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Hn=r(`$ZodCheckLengthEquals`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!f(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Re(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Un=r(`$ZodCheckStringFormat`,(e,t)=>{var n,r;A.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Wn=r(`$ZodCheckRegex`,(e,t)=>{Un.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Gn=r(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=fn,Un.init(e,t)}),Kn=r(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=pn,Un.init(e,t)}),qn=r(`$ZodCheckIncludes`,(e,t)=>{A.init(e,t);let n=v(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Jn=r(`$ZodCheckStartsWith`,(e,t)=>{A.init(e,t);let n=RegExp(`^${v(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Yn=r(`$ZodCheckEndsWith`,(e,t)=>{A.init(e,t);let n=RegExp(`.*${v(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function Xn(e,t,n){e.issues.length&&t.issues.push(...S(n,e.issues))}const Zn=r(`$ZodCheckProperty`,(e,t)=>{A.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>Xn(n,e,t.property));Xn(n,e,t.property)}}),Qn=r(`$ZodCheckMimeType`,(e,t)=>{A.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),$n=r(`$ZodCheckOverwrite`,(e,t)=>{A.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var er=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
3
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
4
|
-
`))}};const tr={major:4,minor:3,patch:6},j=r(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tr;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=x(e),i;for(let o of t){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&n?.async===!1)throw new a;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(r||=x(e,t))});else{if(e.issues.length===t)continue;r||=x(e,t)}}return i?i.then(()=>e):e},n=(n,i,o)=>{if(x(n))return n.aborted=!0,n;let s=t(i,r,o);if(s instanceof Promise){if(o.async===!1)throw new a;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(i,o)=>{if(o.skipChecks)return e._zod.parse(i,o);if(o.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,o)):n(t,i,o)}let s=e._zod.parse(i,o);if(s instanceof Promise){if(o.async===!1)throw new a;return s.then(e=>t(e,r,o))}return t(s,r,o)}}p(e,`~standard`,()=>({validate:t=>{try{let n=it(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return ot(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),nr=r(`$ZodString`,(e,t)=>{j.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??an(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),M=r(`$ZodStringFormat`,(e,t)=>{Un.init(e,t),nr.init(e,t)}),rr=r(`$ZodGUID`,(e,t)=>{t.pattern??=Mt,M.init(e,t)}),ir=r(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=O(e)}else t.pattern??=O();M.init(e,t)}),ar=r(`$ZodEmail`,(e,t)=>{t.pattern??=It,M.init(e,t)}),or=r(`$ZodURL`,(e,t)=>{M.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),sr=r(`$ZodEmoji`,(e,t)=>{t.pattern??=Ht(),M.init(e,t)}),cr=r(`$ZodNanoID`,(e,t)=>{t.pattern??=kt,M.init(e,t)}),lr=r(`$ZodCUID`,(e,t)=>{t.pattern??=wt,M.init(e,t)}),ur=r(`$ZodCUID2`,(e,t)=>{t.pattern??=Tt,M.init(e,t)}),dr=r(`$ZodULID`,(e,t)=>{t.pattern??=Et,M.init(e,t)}),fr=r(`$ZodXID`,(e,t)=>{t.pattern??=Dt,M.init(e,t)}),pr=r(`$ZodKSUID`,(e,t)=>{t.pattern??=Ot,M.init(e,t)}),mr=r(`$ZodISODateTime`,(e,t)=>{t.pattern??=rn(t),M.init(e,t)}),hr=r(`$ZodISODate`,(e,t)=>{t.pattern??=en,M.init(e,t)}),gr=r(`$ZodISOTime`,(e,t)=>{t.pattern??=nn(t),M.init(e,t)}),_r=r(`$ZodISODuration`,(e,t)=>{t.pattern??=At,M.init(e,t)}),vr=r(`$ZodIPv4`,(e,t)=>{t.pattern??=Ut,M.init(e,t),e._zod.bag.format=`ipv4`}),yr=r(`$ZodIPv6`,(e,t)=>{t.pattern??=Wt,M.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),br=r(`$ZodMAC`,(e,t)=>{t.pattern??=Gt(t.delimiter),M.init(e,t),e._zod.bag.format=`mac`}),xr=r(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Kt,M.init(e,t)}),Sr=r(`$ZodCIDRv6`,(e,t)=>{t.pattern??=qt,M.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Cr(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const wr=r(`$ZodBase64`,(e,t)=>{t.pattern??=Jt,M.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Cr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Tr(e){if(!Yt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Cr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Er=r(`$ZodBase64URL`,(e,t)=>{t.pattern??=Yt,M.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Tr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Dr=r(`$ZodE164`,(e,t)=>{t.pattern??=Qt,M.init(e,t)});function Or(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const kr=r(`$ZodJWT`,(e,t)=>{M.init(e,t),e._zod.check=n=>{Or(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Ar=r(`$ZodCustomStringFormat`,(e,t)=>{M.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),jr=r(`$ZodNumber`,(e,t)=>{j.init(e,t),e._zod.pattern=e._zod.bag.pattern??cn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Mr=r(`$ZodNumberFormat`,(e,t)=>{Fn.init(e,t),jr.init(e,t)}),Nr=r(`$ZodBoolean`,(e,t)=>{j.init(e,t),e._zod.pattern=ln,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Pr=r(`$ZodBigInt`,(e,t)=>{j.init(e,t),e._zod.pattern=on,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),Fr=r(`$ZodBigIntFormat`,(e,t)=>{In.init(e,t),Pr.init(e,t)}),Ir=r(`$ZodSymbol`,(e,t)=>{j.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),Lr=r(`$ZodUndefined`,(e,t)=>{j.init(e,t),e._zod.pattern=dn,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Rr=r(`$ZodNull`,(e,t)=>{j.init(e,t),e._zod.pattern=un,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),zr=r(`$ZodAny`,(e,t)=>{j.init(e,t),e._zod.parse=e=>e}),Br=r(`$ZodUnknown`,(e,t)=>{j.init(e,t),e._zod.parse=e=>e}),Vr=r(`$ZodNever`,(e,t)=>{j.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),Hr=r(`$ZodVoid`,(e,t)=>{j.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),Ur=r(`$ZodDate`,(e,t)=>{j.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function Wr(e,t,n){e.issues.length&&t.issues.push(...S(n,e.issues)),t.value[n]=e.value}const Gr=r(`$ZodArray`,(e,t)=>{j.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Wr(t,n,e))):Wr(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Kr(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...S(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function qr(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Ee(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Jr(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Kr(e,n,i,t,u))):Kr(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Yr=r(`$ZodObject`,(e,t)=>{if(j.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=oe(()=>qr(t));p(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=g,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>Kr(n,t,e,s,r))):Kr(i,t,e,s,r)}return i?Jr(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Xr=r(`$ZodObjectJIT`,(e,t)=>{Yr.init(e,t);let n=e._zod.parse,r=oe(()=>qr(t)),i=e=>{let t=new er([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=he(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=he(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|
|
5
|
-
if (${n}.issues.length) {
|
|
6
|
-
if (${o} in input) {
|
|
7
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
8
|
-
...iss,
|
|
9
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
10
|
-
})));
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (${n}.value === undefined) {
|
|
15
|
-
if (${o} in input) {
|
|
16
|
-
newResult[${o}] = undefined;
|
|
17
|
-
}
|
|
18
|
-
} else {
|
|
19
|
-
newResult[${o}] = ${n}.value;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
`):t.write(`
|
|
23
|
-
if (${n}.issues.length) {
|
|
24
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
25
|
-
...iss,
|
|
26
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
27
|
-
})));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (${n}.value === undefined) {
|
|
31
|
-
if (${o} in input) {
|
|
32
|
-
newResult[${o}] = undefined;
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
newResult[${o}] = ${n}.value;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=g,c=!s.jitless,l=c&&ve.value,u=t.catchall,ee;e._zod.parse=(s,d)=>{ee??=r.value;let te=s.value;return o(te)?c&&l&&d?.async===!1&&d.jitless!==!0?(a||=i(t.shape),s=a(s,d),u?Jr([],te,s,d,ee,e):s):n(s,d):(s.issues.push({expected:`object`,code:`invalid_type`,input:te,inst:e}),s)}});function Zr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!x(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>C(e,r,c())))}),t)}const Qr=r(`$ZodUnion`,(e,t)=>{j.init(e,t),p(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),p(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),p(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),p(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>se(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Zr(t,i,e,a)):Zr(s,i,e,a)}});function $r(e,t,n,r){let i=e.filter(e=>e.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>C(e,r,c())))}):t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:[],inclusive:!1}),t)}const ei=r(`$ZodXor`,(e,t)=>{Qr.init(e,t),t.inclusive=!1;let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);t instanceof Promise?(s.push(t),o=!0):s.push(t)}return o?Promise.all(s).then(t=>$r(t,i,e,a)):$r(s,i,e,a)}}),ti=r(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Qr.init(e,t);let n=e._zod.parse;p(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=oe(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!g(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),ni=r(`$ZodIntersection`,(e,t)=>{j.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>ii(e,t,n)):ii(e,i,a)}});function ri(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_(e)&&_(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=ri(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=ri(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ii(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),x(e))return e;let o=ri(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const ai=r(`$ZodTuple`,(e,t)=>{j.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=[...n].reverse().findIndex(e=>e._zod.optin!==`optional`),c=s===-1?0:n.length-s;if(!t.rest){let t=a.length>n.length,i=a.length<c-1;if(t||i)return r.issues.push({...t?{code:`too_big`,maximum:n.length,inclusive:!0}:{code:`too_small`,minimum:n.length},input:a,inst:e,origin:`array`}),r}let l=-1;for(let e of n){if(l++,l>=a.length&&l>=c)continue;let t=e._zod.run({value:a[l],issues:[]},i);t instanceof Promise?o.push(t.then(e=>oi(e,r,l))):oi(t,r,l)}if(t.rest){let e=a.slice(n.length);for(let n of e){l++;let e=t.rest._zod.run({value:n,issues:[]},i);e instanceof Promise?o.push(e.then(e=>oi(e,r,l))):oi(e,r,l)}}return o.length?Promise.all(o).then(()=>r):r}});function oi(e,t,n){e.issues.length&&t.issues.push(...S(n,e.issues)),t.value[n]=e.value}const si=r(`$ZodRecord`,(e,t)=>{j.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!_(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...S(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...S(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&cn.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>C(e,r,c())),input:o,path:[o],inst:e});continue}let l=t.valueType._zod.run({value:i[o],issues:[]},r);l instanceof Promise?a.push(l.then(e=>{e.issues.length&&n.issues.push(...S(o,e.issues)),n.value[s.value]=e.value})):(l.issues.length&&n.issues.push(...S(o,l.issues)),n.value[s.value]=l.value)}}return a.length?Promise.all(a).then(()=>n):n}}),ci=r(`$ZodMap`,(e,t)=>{j.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:`map`,code:`invalid_type`,input:i,inst:e}),n;let a=[];n.value=new Map;for(let[o,s]of i){let c=t.keyType._zod.run({value:o,issues:[]},r),l=t.valueType._zod.run({value:s,issues:[]},r);c instanceof Promise||l instanceof Promise?a.push(Promise.all([c,l]).then(([t,a])=>{li(t,a,n,o,i,e,r)})):li(c,l,n,o,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}});function li(e,t,n,r,i,a,o){e.issues.length&&(Se.has(typeof r)?n.issues.push(...S(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:a,issues:e.issues.map(e=>C(e,o,c()))})),t.issues.length&&(Se.has(typeof r)?n.issues.push(...S(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>C(e,o,c()))})),n.value.set(e.value,t.value)}const ui=r(`$ZodSet`,(e,t)=>{j.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:`set`,code:`invalid_type`}),n;let a=[];n.value=new Set;for(let e of i){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?a.push(i.then(e=>di(e,n))):di(i,n)}return a.length?Promise.all(a).then(()=>n):n}});function di(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const fi=r(`$ZodEnum`,(e,t)=>{j.init(e,t);let n=re(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Se.has(typeof e)).map(e=>typeof e==`string`?v(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),pi=r(`$ZodLiteral`,(e,t)=>{if(j.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?v(e):e?v(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),mi=r(`$ZodFile`,(e,t)=>{j.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),hi=r(`$ZodTransform`,(e,t)=>{j.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new o(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new a;return n.value=i,n}});function gi(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const _i=r(`$ZodOptional`,(e,t)=>{j.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${se(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>gi(t,e.value)):gi(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),vi=r(`$ZodExactOptional`,(e,t)=>{_i.init(e,t),p(e._zod,`values`,()=>t.innerType._zod.values),p(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),yi=r(`$ZodNullable`,(e,t)=>{j.init(e,t),p(e._zod,`optin`,()=>t.innerType._zod.optin),p(e._zod,`optout`,()=>t.innerType._zod.optout),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${se(e.source)}|null)$`):void 0}),p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),bi=r(`$ZodDefault`,(e,t)=>{j.init(e,t),e._zod.optin=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>xi(e,t)):xi(r,t)}});function xi(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Si=r(`$ZodPrefault`,(e,t)=>{j.init(e,t),e._zod.optin=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Ci=r(`$ZodNonOptional`,(e,t)=>{j.init(e,t),p(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>wi(t,e)):wi(i,e)}});function wi(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Ti=r(`$ZodSuccess`,(e,t)=>{j.init(e,t),e._zod.parse=(e,n)=>{if(n.direction===`backward`)throw new o(`ZodSuccess`);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}}),Ei=r(`$ZodCatch`,(e,t)=>{j.init(e,t),p(e._zod,`optin`,()=>t.innerType._zod.optin),p(e._zod,`optout`,()=>t.innerType._zod.optout),p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>C(e,n,c()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>C(e,n,c()))},input:e.value}),e.issues=[]),e)}}),Di=r(`$ZodNaN`,(e,t)=>{j.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),Oi=r(`$ZodPipe`,(e,t)=>{j.init(e,t),p(e._zod,`values`,()=>t.in._zod.values),p(e._zod,`optin`,()=>t.in._zod.optin),p(e._zod,`optout`,()=>t.out._zod.optout),p(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ki(e,t.in,n)):ki(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ki(e,t.out,n)):ki(r,t.out,n)}});function ki(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Ai=r(`$ZodCodec`,(e,t)=>{j.init(e,t),p(e._zod,`values`,()=>t.in._zod.values),p(e._zod,`optin`,()=>t.in._zod.optin),p(e._zod,`optout`,()=>t.out._zod.optout),p(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ji(e,t,n)):ji(r,t,n)}else{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ji(e,t,n)):ji(r,t,n)}}});function ji(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>Mi(e,r,t.out,n)):Mi(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>Mi(e,r,t.in,n)):Mi(e,r,t.in,n)}}function Mi(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const Ni=r(`$ZodReadonly`,(e,t)=>{j.init(e,t),p(e._zod,`propValues`,()=>t.innerType._zod.propValues),p(e._zod,`values`,()=>t.innerType._zod.values),p(e._zod,`optin`,()=>t.innerType?._zod?.optin),p(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Pi):Pi(r)}});function Pi(e){return e.value=Object.freeze(e.value),e}const Fi=r(`$ZodTemplateLiteral`,(e,t)=>{j.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith(`^`),i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||Ce.has(typeof e))n.push(v(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`string`,code:`invalid_type`}),n)}),Ii=r(`$ZodFunction`,(e,t)=>(j.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?tt(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?tt(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await nt(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await nt(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(e._def.output&&e._def.output._zod.def.type===`promise`?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new ai({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),Li=r(`$ZodPromise`,(e,t)=>{j.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),Ri=r(`$ZodLazy`,(e,t)=>{j.init(e,t),p(e._zod,`innerType`,()=>t.getter()),p(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),p(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),p(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),p(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),zi=r(`$ZodCustom`,(e,t)=>{A.init(e,t),j.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Bi(t,n,r,e));Bi(i,n,r,e)}});function Bi(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(w(e))}}var Vi;const Hi=Symbol(`ZodOutput`),Ui=Symbol(`ZodInput`);var Wi=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Gi(){return new Wi}(Vi=globalThis).__zod_globalRegistry??(Vi.__zod_globalRegistry=Gi());const N=globalThis.__zod_globalRegistry;function Ki(e,t){return new e({type:`string`,...b(t)})}function qi(e,t){return new e({type:`string`,coerce:!0,...b(t)})}function Ji(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...b(t)})}function Yi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...b(t)})}function Xi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...b(t)})}function Zi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...b(t)})}function Qi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...b(t)})}function $i(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...b(t)})}function ea(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...b(t)})}function ta(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...b(t)})}function na(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...b(t)})}function ra(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...b(t)})}function ia(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...b(t)})}function aa(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...b(t)})}function oa(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...b(t)})}function sa(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...b(t)})}function ca(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...b(t)})}function la(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...b(t)})}function ua(e,t){return new e({type:`string`,format:`mac`,check:`string_format`,abort:!1,...b(t)})}function da(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...b(t)})}function fa(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...b(t)})}function pa(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...b(t)})}function ma(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...b(t)})}function ha(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...b(t)})}function ga(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...b(t)})}const _a={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function va(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...b(t)})}function ya(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...b(t)})}function ba(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...b(t)})}function xa(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...b(t)})}function Sa(e,t){return new e({type:`number`,checks:[],...b(t)})}function Ca(e,t){return new e({type:`number`,coerce:!0,checks:[],...b(t)})}function wa(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...b(t)})}function Ta(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...b(t)})}function Ea(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...b(t)})}function Da(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...b(t)})}function Oa(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...b(t)})}function ka(e,t){return new e({type:`boolean`,...b(t)})}function Aa(e,t){return new e({type:`boolean`,coerce:!0,...b(t)})}function ja(e,t){return new e({type:`bigint`,...b(t)})}function Ma(e,t){return new e({type:`bigint`,coerce:!0,...b(t)})}function Na(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...b(t)})}function Pa(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...b(t)})}function Fa(e,t){return new e({type:`symbol`,...b(t)})}function Ia(e,t){return new e({type:`undefined`,...b(t)})}function La(e,t){return new e({type:`null`,...b(t)})}function Ra(e){return new e({type:`any`})}function za(e){return new e({type:`unknown`})}function Ba(e,t){return new e({type:`never`,...b(t)})}function Va(e,t){return new e({type:`void`,...b(t)})}function Ha(e,t){return new e({type:`date`,...b(t)})}function Ua(e,t){return new e({type:`date`,coerce:!0,...b(t)})}function Wa(e,t){return new e({type:`nan`,...b(t)})}function P(e,t){return new Mn({check:`less_than`,...b(t),value:e,inclusive:!1})}function F(e,t){return new Mn({check:`less_than`,...b(t),value:e,inclusive:!0})}function I(e,t){return new Nn({check:`greater_than`,...b(t),value:e,inclusive:!1})}function L(e,t){return new Nn({check:`greater_than`,...b(t),value:e,inclusive:!0})}function Ga(e){return I(0,e)}function Ka(e){return P(0,e)}function qa(e){return F(0,e)}function Ja(e){return L(0,e)}function Ya(e,t){return new Pn({check:`multiple_of`,...b(t),value:e})}function Xa(e,t){return new Ln({check:`max_size`,...b(t),maximum:e})}function R(e,t){return new Rn({check:`min_size`,...b(t),minimum:e})}function Za(e,t){return new zn({check:`size_equals`,...b(t),size:e})}function Qa(e,t){return new Bn({check:`max_length`,...b(t),maximum:e})}function $a(e,t){return new Vn({check:`min_length`,...b(t),minimum:e})}function eo(e,t){return new Hn({check:`length_equals`,...b(t),length:e})}function to(e,t){return new Wn({check:`string_format`,format:`regex`,...b(t),pattern:e})}function no(e){return new Gn({check:`string_format`,format:`lowercase`,...b(e)})}function ro(e){return new Kn({check:`string_format`,format:`uppercase`,...b(e)})}function io(e,t){return new qn({check:`string_format`,format:`includes`,...b(t),includes:e})}function ao(e,t){return new Jn({check:`string_format`,format:`starts_with`,...b(t),prefix:e})}function oo(e,t){return new Yn({check:`string_format`,format:`ends_with`,...b(t),suffix:e})}function so(e,t,n){return new Zn({check:`property`,property:e,schema:t,...b(n)})}function co(e,t){return new Qn({check:`mime_type`,mime:e,...b(t)})}function z(e){return new $n({check:`overwrite`,tx:e})}function lo(e){return z(t=>t.normalize(e))}function uo(){return z(e=>e.trim())}function fo(){return z(e=>e.toLowerCase())}function po(){return z(e=>e.toUpperCase())}function mo(){return z(e=>ge(e))}function ho(e,t,n){return new e({type:`array`,element:t,...b(n)})}function go(e,t,n){return new e({type:`union`,options:t,...b(n)})}function _o(e,t,n){return new e({type:`union`,options:t,inclusive:!1,...b(n)})}function vo(e,t,n,r){return new e({type:`union`,options:n,discriminator:t,...b(r)})}function yo(e,t,n){return new e({type:`intersection`,left:t,right:n})}function bo(e,t,n,r){let i=n instanceof j;return new e({type:`tuple`,items:t,rest:i?n:null,...b(i?r:n)})}function xo(e,t,n,r){return new e({type:`record`,keyType:t,valueType:n,...b(r)})}function So(e,t,n,r){return new e({type:`map`,keyType:t,valueType:n,...b(r)})}function Co(e,t,n){return new e({type:`set`,valueType:t,...b(n)})}function wo(e,t,n){return new e({type:`enum`,entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...b(n)})}function To(e,t,n){return new e({type:`enum`,entries:t,...b(n)})}function Eo(e,t,n){return new e({type:`literal`,values:Array.isArray(t)?t:[t],...b(n)})}function Do(e,t){return new e({type:`file`,...b(t)})}function Oo(e,t){return new e({type:`transform`,transform:t})}function ko(e,t){return new e({type:`optional`,innerType:t})}function Ao(e,t){return new e({type:`nullable`,innerType:t})}function jo(e,t,n){return new e({type:`default`,innerType:t,get defaultValue(){return typeof n==`function`?n():ye(n)}})}function Mo(e,t,n){return new e({type:`nonoptional`,innerType:t,...b(n)})}function No(e,t){return new e({type:`success`,innerType:t})}function Po(e,t,n){return new e({type:`catch`,innerType:t,catchValue:typeof n==`function`?n:()=>n})}function Fo(e,t,n){return new e({type:`pipe`,in:t,out:n})}function Io(e,t){return new e({type:`readonly`,innerType:t})}function Lo(e,t,n){return new e({type:`template_literal`,parts:t,...b(n)})}function Ro(e,t){return new e({type:`lazy`,getter:t})}function zo(e,t){return new e({type:`promise`,innerType:t})}function Bo(e,t,n){let r=b(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Vo(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...b(n)})}function Ho(e){let t=Uo(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(w(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(w(r))}},e(n.value,n)));return t}function Uo(e,t){let n=new A({check:`custom`,...b(t)});return n._zod.check=e,n}function Wo(e){let t=new A({check:`describe`});return t._zod.onattach=[t=>{let n=N.get(t)??{};N.add(t,{...n,description:e})}],t._zod.check=()=>{},t}function Go(e){let t=new A({check:`meta`});return t._zod.onattach=[t=>{let n=N.get(t)??{};N.add(t,{...n,...e})}],t._zod.check=()=>{},t}function Ko(e,t){let n=b(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Codec??Ai,c=e.Boolean??Nr,l=new s({type:`pipe`,in:new(e.String??nr)({type:`string`,error:n.error}),out:new c({type:`boolean`,error:n.error}),transform:((e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:o.has(r)?!1:(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:l,continue:!1}),{})}),reverseTransform:((e,t)=>e===!0?r[0]||`true`:i[0]||`false`),error:n.error});return l}function qo(e,t,n,r={}){let i=b(r),a={...b(r),check:`string_format`,type:`string`,format:t,fn:typeof n==`function`?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}function Jo(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??N,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function B(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,B(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&H(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Yo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
39
|
-
|
|
40
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function V(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Zo(t,`input`,e.processors),output:Zo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function H(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return H(r.element,n);if(r.type===`set`)return H(r.valueType,n);if(r.type===`lazy`)return H(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return H(r.innerType,n);if(r.type===`intersection`)return H(r.left,n)||H(r.right,n);if(r.type===`record`||r.type===`map`)return H(r.keyType,n)||H(r.valueType,n);if(r.type===`pipe`)return H(r.in,n)||H(r.out,n);if(r.type===`object`){for(let e in r.shape)if(H(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(H(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(H(e,n))return!0;return!!(r.rest&&H(r.rest,n))}return!1}const Xo=(e,t={})=>n=>{let r=Jo({...n,processors:t});return B(e,r),Yo(r,e),V(r,e)},Zo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Jo({...i??{},target:a,io:t,processors:n});return B(e,o),Yo(o,e),V(o,e)},Qo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},$o=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Qo[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},es=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},ts=(e,t,n,r)=>{n.type=`boolean`},ns=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},rs=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},is=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},as=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},os=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},ss=(e,t,n,r)=>{n.not={}},cs=(e,t,n,r)=>{},ls=(e,t,n,r)=>{},us=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},ds=(e,t,n,r)=>{let i=e._zod.def,a=re(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},fs=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},ps=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},ms=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},hs=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},gs=(e,t,n,r)=>{n.type=`boolean`},_s=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},vs=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},ys=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},bs=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},xs=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},Ss=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=B(a.element,t,{...r,path:[...r.path,`items`]})},Cs=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=B(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=B(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},ws=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>B(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ts=(e,t,n,r)=>{let i=e._zod.def,a=B(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=B(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Es=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>B(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?B(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:ee}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof ee==`number`&&(i.maxItems=ee)},Ds=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=B(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=B(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=B(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Os=(e,t,n,r)=>{let i=e._zod.def,a=B(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ks=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},As=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},js=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ms=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Ns=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;B(a,t,r);let o=t.seen.get(e);o.ref=a},Ps=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Fs=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Is=(e,t,n,r)=>{let i=e._zod.def;B(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ls=(e,t,n,r)=>{let i=e._zod.innerType;B(i,t,r);let a=t.seen.get(e);a.ref=i},Rs={string:$o,number:es,boolean:ts,bigint:ns,symbol:rs,null:is,undefined:as,void:os,never:ss,any:cs,unknown:ls,date:us,enum:ds,literal:fs,nan:ps,template_literal:ms,file:hs,success:gs,custom:_s,function:vs,transform:ys,map:bs,set:xs,array:Ss,object:Cs,union:ws,intersection:Ts,tuple:Es,record:Ds,nullable:Os,nonoptional:ks,default:As,prefault:js,catch:Ms,pipe:Ns,readonly:Ps,promise:Fs,optional:Is,lazy:Ls};function zs(e,t){if(`_idmap`in e){let n=e,r=Jo({...t,processors:Rs}),i={};for(let e of n._idmap.entries()){let[t,n]=e;B(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Yo(r,n),a[t]=V(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Jo({...t,processors:Rs});return B(e,n),Yo(n,e),V(n,e)}var Bs=e({ZodISODate:()=>Us,ZodISODateTime:()=>Vs,ZodISODuration:()=>qs,ZodISOTime:()=>Gs,date:()=>Ws,datetime:()=>Hs,duration:()=>Js,time:()=>Ks});const Vs=r(`ZodISODateTime`,(e,t)=>{mr.init(e,t),G.init(e,t)});function Hs(e){return va(Vs,e)}const Us=r(`ZodISODate`,(e,t)=>{hr.init(e,t),G.init(e,t)});function Ws(e){return ya(Us,e)}const Gs=r(`ZodISOTime`,(e,t)=>{gr.init(e,t),G.init(e,t)});function Ks(e){return ba(Gs,e)}const qs=r(`ZodISODuration`,(e,t)=>{_r.init(e,t),G.init(e,t)});function Js(e){return xa(qs,e)}const Ys=(e,t)=>{Ye.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ze(e,t)},flatten:{value:t=>Xe(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ae,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ae,2)}},isEmpty:{get(){return e.issues.length===0}}})},Xs=r(`ZodError`,Ys),U=r(`ZodError`,Ys,{Parent:Error}),Zs=E(U),Qs=D(U),$s=rt(U),ec=at(U),tc=st(U),nc=lt(U),rc=dt(U),ic=pt(U),ac=ht(U),oc=_t(U),sc=yt(U),cc=xt(U);var lc=e({ZodAny:()=>El,ZodArray:()=>Fl,ZodBase64:()=>Jc,ZodBase64URL:()=>Xc,ZodBigInt:()=>hl,ZodBigIntFormat:()=>_l,ZodBoolean:()=>pl,ZodCIDRv4:()=>Wc,ZodCIDRv6:()=>Kc,ZodCUID:()=>Oc,ZodCUID2:()=>Ac,ZodCatch:()=>ku,ZodCodec:()=>Fu,ZodCustom:()=>qu,ZodCustomStringFormat:()=>q,ZodDate:()=>Nl,ZodDefault:()=>xu,ZodDiscriminatedUnion:()=>Kl,ZodE164:()=>Qc,ZodEmail:()=>pc,ZodEmoji:()=>wc,ZodEnum:()=>X,ZodExactOptional:()=>gu,ZodFile:()=>uu,ZodFunction:()=>Gu,ZodGUID:()=>hc,ZodIPv4:()=>Rc,ZodIPv6:()=>Hc,ZodIntersection:()=>Jl,ZodJWT:()=>el,ZodKSUID:()=>Ic,ZodLazy:()=>Vu,ZodLiteral:()=>cu,ZodMAC:()=>Bc,ZodMap:()=>nu,ZodNaN:()=>ju,ZodNanoID:()=>Ec,ZodNever:()=>kl,ZodNonOptional:()=>Tu,ZodNull:()=>wl,ZodNullable:()=>vu,ZodNumber:()=>ol,ZodNumberFormat:()=>J,ZodObject:()=>Rl,ZodOptional:()=>mu,ZodPipe:()=>Nu,ZodPrefault:()=>Cu,ZodPromise:()=>Uu,ZodReadonly:()=>Lu,ZodRecord:()=>Ql,ZodSet:()=>iu,ZodString:()=>dc,ZodStringFormat:()=>G,ZodSuccess:()=>Du,ZodSymbol:()=>bl,ZodTemplateLiteral:()=>zu,ZodTransform:()=>fu,ZodTuple:()=>Xl,ZodType:()=>W,ZodULID:()=>Mc,ZodURL:()=>xc,ZodUUID:()=>K,ZodUndefined:()=>Sl,ZodUnion:()=>Hl,ZodUnknown:()=>Ol,ZodVoid:()=>jl,ZodXID:()=>Pc,ZodXor:()=>Wl,_ZodString:()=>uc,_default:()=>Su,_function:()=>Ku,any:()=>Dl,array:()=>Il,base64:()=>Yc,base64url:()=>Zc,bigint:()=>gl,boolean:()=>ml,catch:()=>Au,check:()=>Ju,cidrv4:()=>Gc,cidrv6:()=>qc,codec:()=>Iu,cuid:()=>kc,cuid2:()=>jc,custom:()=>Yu,date:()=>Pl,describe:()=>Qu,discriminatedUnion:()=>ql,e164:()=>$c,email:()=>mc,emoji:()=>Tc,enum:()=>ou,exactOptional:()=>_u,file:()=>du,float32:()=>ll,float64:()=>ul,function:()=>Ku,guid:()=>gc,hash:()=>al,hex:()=>il,hostname:()=>rl,httpUrl:()=>Cc,instanceof:()=>ed,int:()=>cl,int32:()=>dl,int64:()=>vl,intersection:()=>Yl,ipv4:()=>zc,ipv6:()=>Uc,json:()=>nd,jwt:()=>tl,keyof:()=>Ll,ksuid:()=>Lc,lazy:()=>Hu,literal:()=>lu,looseObject:()=>Vl,looseRecord:()=>tu,mac:()=>Vc,map:()=>ru,meta:()=>$u,nan:()=>Mu,nanoid:()=>Dc,nativeEnum:()=>su,never:()=>Al,nonoptional:()=>Eu,null:()=>Tl,nullable:()=>yu,nullish:()=>bu,number:()=>sl,object:()=>zl,optional:()=>hu,partialRecord:()=>eu,pipe:()=>Pu,prefault:()=>wu,preprocess:()=>rd,promise:()=>Wu,readonly:()=>Ru,record:()=>$l,refine:()=>Xu,set:()=>au,strictObject:()=>Bl,string:()=>fc,stringFormat:()=>nl,stringbool:()=>td,success:()=>Ou,superRefine:()=>Zu,symbol:()=>xl,templateLiteral:()=>Bu,transform:()=>pu,tuple:()=>Zl,uint32:()=>fl,uint64:()=>yl,ulid:()=>Nc,undefined:()=>Cl,union:()=>Ul,unknown:()=>Y,url:()=>Sc,uuid:()=>_c,uuidv4:()=>vc,uuidv6:()=>yc,uuidv7:()=>bc,void:()=>Ml,xid:()=>Fc,xor:()=>Gl});const W=r(`ZodType`,(e,t)=>(j.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Zo(e,`input`),output:Zo(e,`output`)}}),e.toJSONSchema=Xo(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(h(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>y(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Zs(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>$s(e,t,n),e.parseAsync=async(t,n)=>Qs(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ec(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>tc(e,t,n),e.decode=(t,n)=>nc(e,t,n),e.encodeAsync=async(t,n)=>rc(e,t,n),e.decodeAsync=async(t,n)=>ic(e,t,n),e.safeEncode=(t,n)=>ac(e,t,n),e.safeDecode=(t,n)=>oc(e,t,n),e.safeEncodeAsync=async(t,n)=>sc(e,t,n),e.safeDecodeAsync=async(t,n)=>cc(e,t,n),e.refine=(t,n)=>e.check(Xu(t,n)),e.superRefine=t=>e.check(Zu(t)),e.overwrite=t=>e.check(z(t)),e.optional=()=>hu(e),e.exactOptional=()=>_u(e),e.nullable=()=>yu(e),e.nullish=()=>hu(yu(e)),e.nonoptional=t=>Eu(e,t),e.array=()=>Il(e),e.or=t=>Ul([e,t]),e.and=t=>Yl(e,t),e.transform=t=>Pu(e,pu(t)),e.default=t=>Su(e,t),e.prefault=t=>wu(e,t),e.catch=t=>Au(e,t),e.pipe=t=>Pu(e,t),e.readonly=()=>Ru(e),e.describe=t=>{let n=e.clone();return N.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return N.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return N.get(e);let n=e.clone();return N.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),uc=r(`_ZodString`,(e,t)=>{nr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$o(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(to(...t)),e.includes=(...t)=>e.check(io(...t)),e.startsWith=(...t)=>e.check(ao(...t)),e.endsWith=(...t)=>e.check(oo(...t)),e.min=(...t)=>e.check($a(...t)),e.max=(...t)=>e.check(Qa(...t)),e.length=(...t)=>e.check(eo(...t)),e.nonempty=(...t)=>e.check($a(1,...t)),e.lowercase=t=>e.check(no(t)),e.uppercase=t=>e.check(ro(t)),e.trim=()=>e.check(uo()),e.normalize=(...t)=>e.check(lo(...t)),e.toLowerCase=()=>e.check(fo()),e.toUpperCase=()=>e.check(po()),e.slugify=()=>e.check(mo())}),dc=r(`ZodString`,(e,t)=>{nr.init(e,t),uc.init(e,t),e.email=t=>e.check(Ji(pc,t)),e.url=t=>e.check(ea(xc,t)),e.jwt=t=>e.check(ga(el,t)),e.emoji=t=>e.check(ta(wc,t)),e.guid=t=>e.check(Yi(hc,t)),e.uuid=t=>e.check(Xi(K,t)),e.uuidv4=t=>e.check(Zi(K,t)),e.uuidv6=t=>e.check(Qi(K,t)),e.uuidv7=t=>e.check($i(K,t)),e.nanoid=t=>e.check(na(Ec,t)),e.guid=t=>e.check(Yi(hc,t)),e.cuid=t=>e.check(ra(Oc,t)),e.cuid2=t=>e.check(ia(Ac,t)),e.ulid=t=>e.check(aa(Mc,t)),e.base64=t=>e.check(pa(Jc,t)),e.base64url=t=>e.check(ma(Xc,t)),e.xid=t=>e.check(oa(Pc,t)),e.ksuid=t=>e.check(sa(Ic,t)),e.ipv4=t=>e.check(ca(Rc,t)),e.ipv6=t=>e.check(la(Hc,t)),e.cidrv4=t=>e.check(da(Wc,t)),e.cidrv6=t=>e.check(fa(Kc,t)),e.e164=t=>e.check(ha(Qc,t)),e.datetime=t=>e.check(Hs(t)),e.date=t=>e.check(Ws(t)),e.time=t=>e.check(Ks(t)),e.duration=t=>e.check(Js(t))});function fc(e){return Ki(dc,e)}const G=r(`ZodStringFormat`,(e,t)=>{M.init(e,t),uc.init(e,t)}),pc=r(`ZodEmail`,(e,t)=>{ar.init(e,t),G.init(e,t)});function mc(e){return Ji(pc,e)}const hc=r(`ZodGUID`,(e,t)=>{rr.init(e,t),G.init(e,t)});function gc(e){return Yi(hc,e)}const K=r(`ZodUUID`,(e,t)=>{ir.init(e,t),G.init(e,t)});function _c(e){return Xi(K,e)}function vc(e){return Zi(K,e)}function yc(e){return Qi(K,e)}function bc(e){return $i(K,e)}const xc=r(`ZodURL`,(e,t)=>{or.init(e,t),G.init(e,t)});function Sc(e){return ea(xc,e)}function Cc(e){return ea(xc,{protocol:/^https?$/,hostname:Zt,...b(e)})}const wc=r(`ZodEmoji`,(e,t)=>{sr.init(e,t),G.init(e,t)});function Tc(e){return ta(wc,e)}const Ec=r(`ZodNanoID`,(e,t)=>{cr.init(e,t),G.init(e,t)});function Dc(e){return na(Ec,e)}const Oc=r(`ZodCUID`,(e,t)=>{lr.init(e,t),G.init(e,t)});function kc(e){return ra(Oc,e)}const Ac=r(`ZodCUID2`,(e,t)=>{ur.init(e,t),G.init(e,t)});function jc(e){return ia(Ac,e)}const Mc=r(`ZodULID`,(e,t)=>{dr.init(e,t),G.init(e,t)});function Nc(e){return aa(Mc,e)}const Pc=r(`ZodXID`,(e,t)=>{fr.init(e,t),G.init(e,t)});function Fc(e){return oa(Pc,e)}const Ic=r(`ZodKSUID`,(e,t)=>{pr.init(e,t),G.init(e,t)});function Lc(e){return sa(Ic,e)}const Rc=r(`ZodIPv4`,(e,t)=>{vr.init(e,t),G.init(e,t)});function zc(e){return ca(Rc,e)}const Bc=r(`ZodMAC`,(e,t)=>{br.init(e,t),G.init(e,t)});function Vc(e){return ua(Bc,e)}const Hc=r(`ZodIPv6`,(e,t)=>{yr.init(e,t),G.init(e,t)});function Uc(e){return la(Hc,e)}const Wc=r(`ZodCIDRv4`,(e,t)=>{xr.init(e,t),G.init(e,t)});function Gc(e){return da(Wc,e)}const Kc=r(`ZodCIDRv6`,(e,t)=>{Sr.init(e,t),G.init(e,t)});function qc(e){return fa(Kc,e)}const Jc=r(`ZodBase64`,(e,t)=>{wr.init(e,t),G.init(e,t)});function Yc(e){return pa(Jc,e)}const Xc=r(`ZodBase64URL`,(e,t)=>{Er.init(e,t),G.init(e,t)});function Zc(e){return ma(Xc,e)}const Qc=r(`ZodE164`,(e,t)=>{Dr.init(e,t),G.init(e,t)});function $c(e){return ha(Qc,e)}const el=r(`ZodJWT`,(e,t)=>{kr.init(e,t),G.init(e,t)});function tl(e){return ga(el,e)}const q=r(`ZodCustomStringFormat`,(e,t)=>{Ar.init(e,t),G.init(e,t)});function nl(e,t,n={}){return qo(q,e,t,n)}function rl(e){return qo(q,`hostname`,Xt,e)}function il(e){return qo(q,`hex`,mn,e)}function al(e,t){let n=`${e}_${t?.enc??`hex`}`,r=Ct[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return qo(q,n,r,t)}const ol=r(`ZodNumber`,(e,t)=>{jr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>es(e,t,n,r),e.gt=(t,n)=>e.check(I(t,n)),e.gte=(t,n)=>e.check(L(t,n)),e.min=(t,n)=>e.check(L(t,n)),e.lt=(t,n)=>e.check(P(t,n)),e.lte=(t,n)=>e.check(F(t,n)),e.max=(t,n)=>e.check(F(t,n)),e.int=t=>e.check(cl(t)),e.safe=t=>e.check(cl(t)),e.positive=t=>e.check(I(0,t)),e.nonnegative=t=>e.check(L(0,t)),e.negative=t=>e.check(P(0,t)),e.nonpositive=t=>e.check(F(0,t)),e.multipleOf=(t,n)=>e.check(Ya(t,n)),e.step=(t,n)=>e.check(Ya(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function sl(e){return Sa(ol,e)}const J=r(`ZodNumberFormat`,(e,t)=>{Mr.init(e,t),ol.init(e,t)});function cl(e){return wa(J,e)}function ll(e){return Ta(J,e)}function ul(e){return Ea(J,e)}function dl(e){return Da(J,e)}function fl(e){return Oa(J,e)}const pl=r(`ZodBoolean`,(e,t)=>{Nr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ts(e,t,n,r)});function ml(e){return ka(pl,e)}const hl=r(`ZodBigInt`,(e,t)=>{Pr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ns(e,t,n,r),e.gte=(t,n)=>e.check(L(t,n)),e.min=(t,n)=>e.check(L(t,n)),e.gt=(t,n)=>e.check(I(t,n)),e.gte=(t,n)=>e.check(L(t,n)),e.min=(t,n)=>e.check(L(t,n)),e.lt=(t,n)=>e.check(P(t,n)),e.lte=(t,n)=>e.check(F(t,n)),e.max=(t,n)=>e.check(F(t,n)),e.positive=t=>e.check(I(BigInt(0),t)),e.negative=t=>e.check(P(BigInt(0),t)),e.nonpositive=t=>e.check(F(BigInt(0),t)),e.nonnegative=t=>e.check(L(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(Ya(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function gl(e){return ja(hl,e)}const _l=r(`ZodBigIntFormat`,(e,t)=>{Fr.init(e,t),hl.init(e,t)});function vl(e){return Na(_l,e)}function yl(e){return Pa(_l,e)}const bl=r(`ZodSymbol`,(e,t)=>{Ir.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rs(e,t,n,r)});function xl(e){return Fa(bl,e)}const Sl=r(`ZodUndefined`,(e,t)=>{Lr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>as(e,t,n,r)});function Cl(e){return Ia(Sl,e)}const wl=r(`ZodNull`,(e,t)=>{Rr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>is(e,t,n,r)});function Tl(e){return La(wl,e)}const El=r(`ZodAny`,(e,t)=>{zr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Dl(){return Ra(El)}const Ol=r(`ZodUnknown`,(e,t)=>{Br.init(e,t),W.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Y(){return za(Ol)}const kl=r(`ZodNever`,(e,t)=>{Vr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ss(e,t,n,r)});function Al(e){return Ba(kl,e)}const jl=r(`ZodVoid`,(e,t)=>{Hr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>os(e,t,n,r)});function Ml(e){return Va(jl,e)}const Nl=r(`ZodDate`,(e,t)=>{Ur.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>us(e,t,n,r),e.min=(t,n)=>e.check(L(t,n)),e.max=(t,n)=>e.check(F(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Pl(e){return Ha(Nl,e)}const Fl=r(`ZodArray`,(e,t)=>{Gr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ss(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check($a(t,n)),e.nonempty=t=>e.check($a(1,t)),e.max=(t,n)=>e.check(Qa(t,n)),e.length=(t,n)=>e.check(eo(t,n)),e.unwrap=()=>e.element});function Il(e,t){return ho(Fl,e,t)}function Ll(e){let t=e._zod.def.shape;return ou(Object.keys(t))}const Rl=r(`ZodObject`,(e,t)=>{Xr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cs(e,t,n,r),p(e,`shape`,()=>t.shape),e.keyof=()=>ou(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Y()}),e.loose=()=>e.clone({...e._zod.def,catchall:Y()}),e.strict=()=>e.clone({...e._zod.def,catchall:Al()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>je(e,t),e.safeExtend=t=>Me(e,t),e.merge=t=>Ne(e,t),e.pick=t=>ke(e,t),e.omit=t=>Ae(e,t),e.partial=(...t)=>Pe(mu,e,t[0]),e.required=(...t)=>Fe(Tu,e,t[0])});function zl(e,t){let n={type:`object`,shape:e??{},...b(t)};return new Rl(n)}function Bl(e,t){return new Rl({type:`object`,shape:e,catchall:Al(),...b(t)})}function Vl(e,t){return new Rl({type:`object`,shape:e,catchall:Y(),...b(t)})}const Hl=r(`ZodUnion`,(e,t)=>{Qr.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ws(e,t,n,r),e.options=t.options});function Ul(e,t){return new Hl({type:`union`,options:e,...b(t)})}const Wl=r(`ZodXor`,(e,t)=>{Hl.init(e,t),ei.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ws(e,t,n,r),e.options=t.options});function Gl(e,t){return new Wl({type:`union`,options:e,inclusive:!1,...b(t)})}const Kl=r(`ZodDiscriminatedUnion`,(e,t)=>{Hl.init(e,t),ti.init(e,t)});function ql(e,t,n){return new Kl({type:`union`,options:t,discriminator:e,...b(n)})}const Jl=r(`ZodIntersection`,(e,t)=>{ni.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ts(e,t,n,r)});function Yl(e,t){return new Jl({type:`intersection`,left:e,right:t})}const Xl=r(`ZodTuple`,(e,t)=>{ai.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Es(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Zl(e,t,n){let r=t instanceof j;return new Xl({type:`tuple`,items:e,rest:r?t:null,...b(r?n:t)})}const Ql=r(`ZodRecord`,(e,t)=>{si.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ds(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function $l(e,t,n){return new Ql({type:`record`,keyType:e,valueType:t,...b(n)})}function eu(e,t,n){let r=y(e);return r._zod.values=void 0,new Ql({type:`record`,keyType:r,valueType:t,...b(n)})}function tu(e,t,n){return new Ql({type:`record`,keyType:e,valueType:t,mode:`loose`,...b(n)})}const nu=r(`ZodMap`,(e,t)=>{ci.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bs(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(R(...t)),e.nonempty=t=>e.check(R(1,t)),e.max=(...t)=>e.check(Xa(...t)),e.size=(...t)=>e.check(Za(...t))});function ru(e,t,n){return new nu({type:`map`,keyType:e,valueType:t,...b(n)})}const iu=r(`ZodSet`,(e,t)=>{ui.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xs(e,t,n,r),e.min=(...t)=>e.check(R(...t)),e.nonempty=t=>e.check(R(1,t)),e.max=(...t)=>e.check(Xa(...t)),e.size=(...t)=>e.check(Za(...t))});function au(e,t){return new iu({type:`set`,valueType:e,...b(t)})}const X=r(`ZodEnum`,(e,t)=>{fi.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ds(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new X({...t,checks:[],...b(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new X({...t,checks:[],...b(r),entries:i})}});function ou(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new X({type:`enum`,entries:n,...b(t)})}function su(e,t){return new X({type:`enum`,entries:e,...b(t)})}const cu=r(`ZodLiteral`,(e,t)=>{pi.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fs(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function lu(e,t){return new cu({type:`literal`,values:Array.isArray(e)?e:[e],...b(t)})}const uu=r(`ZodFile`,(e,t)=>{mi.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hs(e,t,n,r),e.min=(t,n)=>e.check(R(t,n)),e.max=(t,n)=>e.check(Xa(t,n)),e.mime=(t,n)=>e.check(co(Array.isArray(t)?t:[t],n))});function du(e){return Do(uu,e)}const fu=r(`ZodTransform`,(e,t)=>{hi.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ys(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new o(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(w(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(w(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function pu(e){return new fu({type:`transform`,transform:e})}const mu=r(`ZodOptional`,(e,t)=>{_i.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Is(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hu(e){return new mu({type:`optional`,innerType:e})}const gu=r(`ZodExactOptional`,(e,t)=>{vi.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Is(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _u(e){return new gu({type:`optional`,innerType:e})}const vu=r(`ZodNullable`,(e,t)=>{yi.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Os(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yu(e){return new vu({type:`nullable`,innerType:e})}function bu(e){return hu(yu(e))}const xu=r(`ZodDefault`,(e,t)=>{bi.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>As(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Su(e,t){return new xu({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ye(t)}})}const Cu=r(`ZodPrefault`,(e,t)=>{Si.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>js(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wu(e,t){return new Cu({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ye(t)}})}const Tu=r(`ZodNonOptional`,(e,t)=>{Ci.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ks(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Eu(e,t){return new Tu({type:`nonoptional`,innerType:e,...b(t)})}const Du=r(`ZodSuccess`,(e,t)=>{Ti.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ou(e){return new Du({type:`success`,innerType:e})}const ku=r(`ZodCatch`,(e,t)=>{Ei.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ms(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Au(e,t){return new ku({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const ju=r(`ZodNaN`,(e,t)=>{Di.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r)});function Mu(e){return Wa(ju,e)}const Nu=r(`ZodPipe`,(e,t)=>{Oi.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ns(e,t,n,r),e.in=t.in,e.out=t.out});function Pu(e,t){return new Nu({type:`pipe`,in:e,out:t})}const Fu=r(`ZodCodec`,(e,t)=>{Nu.init(e,t),Ai.init(e,t)});function Iu(e,t,n){return new Fu({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const Lu=r(`ZodReadonly`,(e,t)=>{Ni.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ps(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ru(e){return new Lu({type:`readonly`,innerType:e})}const zu=r(`ZodTemplateLiteral`,(e,t)=>{Fi.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ms(e,t,n,r)});function Bu(e,t){return new zu({type:`template_literal`,parts:e,...b(t)})}const Vu=r(`ZodLazy`,(e,t)=>{Ri.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ls(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Hu(e){return new Vu({type:`lazy`,getter:e})}const Uu=r(`ZodPromise`,(e,t)=>{Li.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Wu(e){return new Uu({type:`promise`,innerType:e})}const Gu=r(`ZodFunction`,(e,t)=>{Ii.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vs(e,t,n,r)});function Ku(e){return new Gu({type:`function`,input:Array.isArray(e?.input)?Zl(e?.input):e?.input??Il(Y()),output:e?.output??Y()})}const qu=r(`ZodCustom`,(e,t)=>{zi.init(e,t),W.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_s(e,t,n,r)});function Ju(e){let t=new A({check:`custom`});return t._zod.check=e,t}function Yu(e,t){return Bo(qu,e??(()=>!0),t)}function Xu(e,t={}){return Vo(qu,e,t)}function Zu(e){return Ho(e)}const Qu=Wo,$u=Go;function ed(e,t={}){let n=new qu({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...b(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}const td=(...e)=>Ko({Codec:Fu,Boolean:pl,String:dc},...e);function nd(e){let t=Hu(()=>Ul([fc(e),sl(),ml(),Tl(),Il(t),$l(fc(),t)]));return t}function rd(e,t){return Pu(pu(e),t)}var id=e({bigint:()=>cd,boolean:()=>sd,date:()=>ld,number:()=>od,string:()=>ad});function ad(e){return qi(dc,e)}function od(e){return Ca(ol,e)}function sd(e){return Aa(pl,e)}function cd(e){return Ma(hl,e)}function ld(e){return Ua(Nl,e)}const Z=`0123456789ABCDEFGHJKMNPQRSTVWXYZ`;var Q;(function(e){e.Base32IncorrectEncoding=`B32_ENC_INVALID`,e.DecodeTimeInvalidCharacter=`DEC_TIME_CHAR`,e.DecodeTimeValueMalformed=`DEC_TIME_MALFORMED`,e.EncodeTimeNegative=`ENC_TIME_NEG`,e.EncodeTimeSizeExceeded=`ENC_TIME_SIZE_EXCEED`,e.EncodeTimeValueMalformed=`ENC_TIME_MALFORMED`,e.PRNGDetectFailure=`PRNG_DETECT`,e.ULIDInvalid=`ULID_INVALID`,e.Unexpected=`UNEXPECTED`,e.UUIDInvalid=`UUID_INVALID`})(Q||={});var $=class extends Error{constructor(e,t){super(`${t} (${e})`),this.name=`ULIDError`,this.code=e}};function ud(e){let t=Math.floor(e()*32)%32;return Z.charAt(t)}function dd(e,t,n){return t>e.length-1?e:e.substr(0,t)+n+e.substr(t+1)}function fd(e){let t,n=e.length,r,i,a=e;for(;!t&&n-->=0;){if(r=a[n],i=Z.indexOf(r),i===-1)throw new $(Q.Base32IncorrectEncoding,`Incorrectly encoded string`);if(i===31){a=dd(a,n,Z[0]);continue}t=dd(a,n,Z[i+1])}if(typeof t==`string`)return t;throw new $(Q.Base32IncorrectEncoding,`Failed incrementing string`)}function pd(e){if(e.length!==26)throw new $(Q.DecodeTimeValueMalformed,`Malformed ULID`);let t=e.substr(0,10).toUpperCase().split(``).reverse().reduce((e,t,n)=>{let r=Z.indexOf(t);if(r===-1)throw new $(Q.DecodeTimeInvalidCharacter,`Time decode error: Invalid character: ${t}`);return e+=r*32**n},0);if(t>0xffffffffffff)throw new $(Q.DecodeTimeValueMalformed,`Malformed ULID: timestamp too large: ${t}`);return t}function md(e){let n=hd(),r=n&&(n.crypto||n.msCrypto)||(t===void 0?null:t);if(typeof r?.getRandomValues==`function`)return()=>{let e=new Uint8Array(1);return r.getRandomValues(e),e[0]/256};if(typeof r?.randomBytes==`function`)return()=>r.randomBytes(1).readUInt8()/256;if(t?.randomBytes)return()=>t.randomBytes(1).readUInt8()/256;throw new $(Q.PRNGDetectFailure,`Failed to find a reliable PRNG`)}function hd(){return vd()?self:typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:null}function gd(e,t){let n=``;for(;e>0;e--)n=ud(t)+n;return n}function _d(e,t=10){if(isNaN(e))throw new $(Q.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>0xffffffffffff)throw new $(Q.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${e}`);if(e<0)throw new $(Q.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new $(Q.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let n,r=``;for(let i=t;i>0;i--)n=e%32,r=Z.charAt(n)+r,e=(e-n)/32;return r}function vd(){return typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope}function yd(e){let t=e||md(),n=0,r;return function(e){let i=!e||isNaN(e)?Date.now():e;if(i<=n){let e=r=fd(r);return _d(n,10)+e}n=i;let a=r=gd(16,t);return _d(i,10)+a}}function bd(e,t){let n=t||md();return _d(!e||isNaN(e)?Date.now():e,10)+gd(16,n)}export{Cu as $,Fr as $a,Sa as $i,Nc as $n,Ir as $o,ia as $r,ut as $s,gc as $t,uu as A,go as Aa,Eo as Ai,hu as An,pi as Ao,Zo as Ar,Rn as As,Dl as At,Bc as B,_o as Ba,R as Bi,au as Bn,Mr as Bo,ma as Br,Ct as Bs,kc as Bt,xu as C,Oo as Ca,a as Cc,va as Ci,su as Cn,mr as Co,Us as Cr,Hn as Cs,Su as Ct,wc as D,Pa as Da,n as Dc,sa as Di,bu as Dn,kr as Do,Bs as Dr,Ln as Ds,Tl as Dt,pc as E,Oa as Ea,r as Ec,ga as Ei,yu as En,ni as Eo,Gs as Er,Bn as Es,ed as Et,Jl as F,Zi as Fa,So as Fi,Wu as Fn,Vr as Fo,B as Fr,Wn as Fs,ml as Ft,Tu as G,Hi as Ga,Ka as Gi,Ou as Gn,Si as Go,da as Gr,E as Gs,ql as Gt,ju as H,Go as Ha,Wa as Hi,fc as Hn,Xr as Ho,ka as Hr,pt as Hs,Yu as Ht,el as I,Qi as Ia,Qa as Ii,Ru as In,Ci as Io,_a as Ir,zn as Is,Ju as It,ol as J,zr as Ja,Mo as Ji,Bu as Jn,si as Jo,Aa as Jr,xt as Js,Tc as Jt,wl as K,N as Ka,Ba as Ki,Zu as Kn,Li as Ko,fa as Kr,D as Ks,$c as Kt,Ic as L,$i as La,Xa as Li,$l as Ln,Rr as Lo,Ra as Lr,Jn as Ls,Gc as Lt,hc as M,ro as Ma,P as Mi,Pu as Mn,ci as Mo,Yo as Mr,Fn as Ms,Yc as Mt,Rc as N,ea as Na,F as Ni,wu as Nn,Di as No,V as Nr,$n as Ns,Zc as Nt,X as O,aa as Oa,c as Oc,Ro as Oi,sl as On,pr as Oo,Rs as Or,Qn as Os,Cl as Ot,Hc as P,Xi as Pa,ua as Pi,rd as Pn,cr as Po,Jo as Pr,Zn as Ps,gl as Pt,Nu as Q,Pr as Qa,Ao as Qi,yl as Qn,Ti as Qo,ra as Qr,at as Qs,ul as Qt,Vu as R,Va as Ra,co as Ri,Xu as Rn,yi as Ro,ho as Rr,Un as Rs,qc as Rt,Nl as S,po as Sa,l as Sc,ya as Si,Dc as Sn,hr as So,U as Sr,qn as Ss,Au as St,Qc as T,bo as Ta,i as Tc,ba as Ti,Eu as Tn,gr as To,qs as Tr,Gn as Ts,Ku as Tt,Ec as U,Wi as Ua,na as Ui,nl as Un,_i as Uo,Po as Ur,st as Us,Pl as Ut,nu as V,Wo as Va,Ya as Vi,Bl as Vn,Yr as Vo,ja as Vr,lt as Vs,jc as Vt,kl as W,Ui as Wa,To as Wi,td as Wn,Oi as Wo,Uo as Wr,dt as Ws,Qu as Wt,Rl as X,wr as Xa,lo as Xi,Zl as Xn,nr as Xo,Ca as Xr,yt as Xs,du as Xt,J as Y,Gr as Ya,qa as Yi,pu as Yn,ui as Yo,Ua as Yr,ht as Ys,_u as Yt,mu as Z,Er as Za,La as Zi,fl as Zn,M as Zo,qi as Zr,rt as Zs,ll as Zt,Ac as _,No as _a,Qe as _c,Da as _i,tu as _n,mi as _o,ac as _r,er as _s,Ol as _t,ld as a,so as aa,vt as ac,Ji as ai,dl as an,Ei as ao,yc as ar,or as as,G as at,qu as b,Lo as ba,ze as bc,ca as bi,$u as bn,vr as bo,ec as br,Yn as bs,Wl as bt,Fl as c,Vo as ca,bt as cc,wo as ci,zc as cn,Ar as co,Gl as cr,Qr as cs,zu as ct,hl as d,Za as da,Ye as dc,Ea as di,tl as dn,ti as do,tc as dr,fr as ds,W as dt,ko as ea,mt as ec,Bo as ei,al as en,Nr as eo,Ul as er,Fi as es,Uu as et,_l as f,mo as fa,T as fc,I as fi,Ll as fn,Dr as fo,rc as fr,ei as fs,Mc as ft,Oc as g,Ko as ga,$e as gc,wa as gi,Vl as gn,vi as go,cc as gr,tr as gs,Hl as gt,Kc as h,qo as ha,et as hc,io as hi,lu as hn,fi as ho,oc as hr,Or as hs,Sl as ht,id as i,zo as ia,nt as ic,ha as ii,cl as in,ur as io,vc as ir,dr as is,dc as it,Gu as j,za as ja,no as ji,eu as jn,br as jo,Xo as jr,Pn as js,Il as jt,gu as k,Ia as ka,s as kc,eo as ki,zl as kn,Ri as ko,zs as kr,Vn as ks,Ml as kt,Jc as l,to as la,it as lc,Do as li,Uc as ln,Ur as lo,nc as lr,Br as ls,fu as lt,Wc as m,Ki as ma,Ze as mc,Yi as mi,Hu as mn,sr as mo,Qs as mr,Tr as ms,K as mt,yd as n,Fo as na,ft as nc,jo as ni,rl as nn,Sr as no,Sc as nr,ai as ns,Ql as nt,od as o,Io as oa,St as oc,ta as oi,vl as on,Ai as oo,bc as or,ir as os,Du as ot,pl as p,ao as pa,Xe as pc,L as pi,Lc as pn,ar as po,Zs as pr,Cr as ps,xc as pt,vu as q,Gi as qa,Ja as qi,xl as qn,Ni as qo,Ma as qr,_t as qs,mc as qt,bd as r,Ga as ra,tt as rc,vo as ri,Cc as rn,lr as ro,_c as rr,j as rs,iu as rt,El as s,xo as sa,gt as sc,oo as si,Yl as sn,zi as so,Fc as sr,Lr as ss,bl as st,pd as t,z as ta,ct as tc,Ha as ti,il as tn,xr as to,Y as tr,hi as ts,Lu as tt,Xc as u,Co as ua,ot as uc,Ta as ui,nd as un,bi as uo,ic as ur,Hr as us,Xl as ut,ku as v,Ho as va,y as vc,Na as vi,Vc as vn,Ii as vo,sc as vr,A as vs,jl as vt,Kl as w,uo as wa,o as wc,xa as wi,Al as wn,_r as wo,Vs as wr,Mn as ws,ou as wt,q as x,fo as xa,Te as xc,la as xi,Mu as xn,yr as xo,Xs as xr,Nn as xs,uc as xt,Fu as y,Fa as ya,ie as yc,yo as yi,ru as yn,rr as yo,$s as yr,In as ys,Pc as yt,cu as z,oa as za,$a as zi,lc as zn,jr as zo,pa as zr,Kn as zs,Iu as zt};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A as t,Hn as n,L as r,Nn as i,Pn as a,S as o,Wn as s,Z as c,_t as ee,a as te,bn as l,cn as u,ct as d,gt as f,jn as p,lr as m,mr as h,n as g,ot as _,sr as v,t as y,tr as b,vt as x,w as S,xt as C}from"./wait-until-BYKVqrwc.js";import{D as w,d as T,n as E,o as D,r as O}from"./dist-CRTn4Sg8.js";import{n as k}from"./node-Smb57EnG.js";var A=e({getHookByToken:()=>L,resumeHook:()=>R,resumeWebhook:()=>B});const j=k();async function M(e){let t=await crypto.subtle.digest(`SHA-256`,e),n=new Uint8Array(t),r=``;for(let e of n)r+=e.toString(16).padStart(2,`0`);return r}function N(e){let t=e.executionContext?.workflowCoreVersion,n=e.executionContext?.traceCarrier,r=e.executionContext?.hookResumeInputVersion;return{deploymentId:e.deploymentId,workflowName:e.workflowName,runSpecVersion:e.specVersion,workflowCoreVersion:typeof t==`string`?t:void 0,traceCarrier:n&&typeof n==`object`?n:void 0,encryptionPublicKey:e.encryptionPublicKey,hookResumeInputVersion:typeof r==`number`?r:void 0}}async function P(e){if(e.resumeContext)return{resumeContext:e.resumeContext,source:`hook`};let t=await(await s()).runs.get(e.runId);return{resumeContext:N(t),source:`run_fallback`,run:t}}async function F(e,t){let n=await s(),r=t.run?await n.getEncryptionKeyForRun?.(t.run):await n.getEncryptionKeyForRun?.(e.runId,{deploymentId:t.resumeContext.deploymentId});return r?await v(r):void 0}async function I(e){let t=await s(),n=await t.hooks.getByToken(e),i;if(n.metadata!==void 0){let e=await P(n),a=e.run?await t.getEncryptionKeyForRun?.(e.run):await t.getEncryptionKeyForRun?.(n.runId,{deploymentId:e.resumeContext.deploymentId});i=a?await p(a):void 0,n.metadata=await r(n.metadata,n.runId,i)}return{hook:n,encryptionKey:i}}async function L(e){let{hook:t}=await I(e);return t}async function R(e,t,n){return z(e,t,n,!1)}async function z(e,r,p,v){return await g(()=>d(`hook.resume`,async d=>{let g=await s();try{let s=typeof e==`string`,f=s?await g.hooks.getByToken(e):e,b=s||v,w=await P(f),{resumeContext:E}=w;if(d?.setAttributes({...C(f.token),...ee(f.hookId),...l(f.runId),"workflow.hook.resume_context_source":w.source}),w.run&&h(w.run.status))throw new D(f.token);let k=S(E.workflowCoreVersion),A,N=p?void 0:n(E.encryptionPublicKey);if(N)A=i(N);else{let e=p??await F(f,w);k.supportedFormats.has(a.ENCRYPTED)||(e=void 0),A=e}let I=(E.runSpecVersion??0)>=5&&k.supportedFormats.has(a.GZIP),L=[],R=m(f.specVersion),z=await t(r,f.runId,A,L,globalThis,R,k.framedByteStreams,I);y(Promise.all(L),e=>{e!==void 0&&c.warn(`Background flush of hook payload ops failed`,{workflowRunId:f.runId,hookId:f.hookId,error:e instanceof Error?e.message:String(e)})}),d?.setAttributes({...u(E.workflowName)});let B=await _(E.traceCarrier);B&&d?.addLink?.(B);let V={...R?{}:{token:f.token},payload:z},H=te(E.workflowName),U={deploymentId:E.deploymentId,specVersion:E.runSpecVersion??1},W=process.env.WORKFLOW_DISABLE_LAZY_HOOK_RESUME===`1`,G=(b?f.resumeCapabilities?.hookResumeDedupVersion??0:0)>=1||g.capabilities?.hookResumeDedup===!0,K=W?`disabled`:G?(E.hookResumeInputVersion??0)<1?`consumer_unsupported`:R?`legacy`:(E.runSpecVersion??0)<3?`non_cbor_transport`:z instanceof Uint8Array?z.byteLength>131072?`oversized`:null:`non_bytes`:`backend_unsupported`,q=K===null;d?.setAttributes({"workflow.hook.resume_strategy":q?`parallel`:`sequential`,...K?{"workflow.hook.resume_fallback_reason":K}:{}});let J=e=>D.is(e)||O.is(e)||T.is(e);if(!q){try{await g.events.create(f.runId,{eventType:`hook_received`,specVersion:5,correlationId:f.hookId,eventData:V},{v1Compat:R})}catch(e){throw J(e)?new D(f.token):e}return await g.queue(H,{runId:f.runId,traceCarrier:E.traceCarrier??void 0},U),f}let Y=j(),X=await M(z);d?.setAttributes({"workflow.hook.resume_id":Y});let[Z,Q]=await Promise.allSettled([g.events.create(f.runId,{eventType:`hook_received`,specVersion:5,correlationId:f.hookId,eventData:V},{v1Compat:R,resumeId:Y,resumePayloadDigest:X}),g.queue(H,{runId:f.runId,traceCarrier:E.traceCarrier??void 0,hookInput:{resumeId:Y,hookId:f.hookId,token:f.token,payload:z,payloadDigest:X,deploymentId:E.deploymentId}},U)]);if(Q.status===`rejected`)throw Q.reason;let $=!1;if(Z.status===`rejected`){let e=Z.reason;if(D.is(e)||T.is(e))throw new D(f.token);if(O.is(e)||o(e))$=!0,d?.setAttributes({...x(!0),"workflow.hook.resume_event_write_recovered":!0,"workflow.hook.resume_event_write_error":e instanceof Error?e.name:`unknown`}),c.warn(`Hook resume event write failed, but the run was re-triggered via the queue. The hook_received event will be ensured by the queue consumer.`,{workflowRunId:f.runId,hookId:f.hookId,resumeId:Y,error:e instanceof Error?e.message:String(e)});else throw e}return $?{...f,resilientResume:!0}:f}catch(t){throw d?.setAttributes({...C(typeof e==`string`?e:e.token),...f(!1)}),t}}))}async function B(e,t){let{hook:n,encryptionKey:r}=await I(e);if(n.isWebhook===!1)throw new D(e);let i,a;if(n.metadata&&typeof n.metadata==`object`&&`respondWith`in n.metadata)if(n.metadata.respondWith===`manual`){let{readable:e,writable:n}=new TransformStream;a=e,t[b]=n}else if(n.metadata.respondWith instanceof Response)i=n.metadata.respondWith;else throw new w(`Invalid \`respondWith\` value: ${n.metadata.respondWith}`,{slug:E.WEBHOOK_INVALID_RESPOND_WITH_VALUE});else i=new Response(null,{status:202});if(await z(n,t,r,!0),a){let e=a.getReader(),t=await e.read();t.value&&(i=t.value),e.cancel()}if(!i)throw new w(`Workflow run did not send a response`,{slug:E.WEBHOOK_RESPONSE_NOT_SENT});return i}export{A as i,R as n,B as r,L as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as e,Er as t,Gn as n,Hn as r,I as i,Nn as a,P as o,Pn as s,Qt as c,Rn as l,S as u,Sn as d,Un as f,V as p,Vn as m,Wn as h,X as g,Y as _,Z as v,_r as y,a as b,b as x,bn as ee,cn as te,cr as ne,ct as S,dt as re,j as ie,jn as C,ln as ae,lr as w,n as T,pr as E,s as oe,sr as se,st as ce,t as le,vr as D,w as ue,zn as O}from"./wait-until-BYKVqrwc.js";import{C as k,D as A,E as j,T as M,r as N,w as P}from"./dist-CRTn4Sg8.js";import{t as de}from"./attribute-changes-6OqdYdi4.js";import{n as F}from"./node-Smb57EnG.js";const I=[`node`,`quickjs`];function L(e=process.env){let t=e.WORKFLOW_VM;if(!(t===void 0||t===``)){if(I.includes(t))return t;throw new A(`Invalid WORKFLOW_VM value: "${t}". Expected one of: ${I.join(`, `)}.`)}}function R(e){let t=e.executionContext?.workflowVm;if(t!==void 0){if(!I.includes(t))throw new A(`Invalid executionContext.workflowVm value: "${t}". Expected one of: ${I.join(`, `)}.`);return t===`quickjs`}return L()===`quickjs`}const z=F();function B(){let e=g.getStore(),t=e?.workflowMetadata?.workflowRunId;if(t)return{[D]:e.rootRunId??t,[y]:t}}let V=!1;async function H(e,i,o){"use step";return await T(()=>{let l=e?.workflowId;if(!l)throw new A(`'start' received an invalid workflow function. Ensure the Workflow SDK is configured correctly and the function includes a 'use workflow' directive.`,{slug:`start-invalid-workflow-function`});return S(`workflow.start ${t(l)}`,async e=>{e?.setAttributes({...te(l),...ae(`start`)});let t=[],p=o??{};Array.isArray(i)?t=i:typeof i==`object`&&(p=i),e?.setAttributes({...c(t.length)});let g=p.world??await h();n(g);let _=await g.getDeploymentId(),y=p.deploymentId??_;y===`latest`&&(g.resolveLatestDeploymentId?y=await g.resolveLatestDeploymentId():(V||(V=!0,v.warn(`deploymentId: 'latest' has no effect in this world and was ignored. It is only supported by worlds with atomic deployments, such as Vercel. The run will target the current deployment.`,{currentDeploymentId:_})),y=_));let S=`wrun_${g.createRunId?g.createRunId(p):z()}`,C,T,E,D;if(y===_)C=!0,T=!0,E=1;else if(typeof g.streams?.get!=`function`)C=!1,T=!1,E=void 0;else{let e=await oe(g,{deploymentId:y,runId:S,timeout:2e3,namespace:p.namespace}).catch(()=>void 0);D=e?.encryptionPublicKey;let t=ue(e?.workflowCoreVersion);C=t.framedByteStreams,T=t.supportedFormats.has(s.GZIP),E=e?.hookResumeInputVersion}let O=[],k=await ce(),j=p.specVersion??g.specVersion,M=w(j),P=p.allowReservedAttributes===!0,F;if(p.attributes&&Object.keys(p.attributes).length>0){if(j<4)throw new A(`Initial workflow attributes require a World that supports spec version 4 or later.`);for(let[e,t]of Object.entries(p.attributes))if(typeof t!=`string`)throw new A(`Initial workflow attribute ${JSON.stringify(e)} must be a string value.`);let e=de(p.attributes,{allowReservedAttributes:P});F=Object.fromEntries(e.map(({key:e,value:t})=>[e,t]))}let I=j>=4?B():void 0,R=I?{...I,...F}:F,H=R?{attributes:R,...P||I!=null?{allowReservedAttributes:!0}:{}}:{};if(p.replayedFromRunId!==void 0&&!ne.safeParse(p.replayedFromRunId).success)throw new A(`replayedFromRunId must be a run ID (wrun_<ulid>); received ${JSON.stringify(String(p.replayedFromRunId).slice(0,64))}.`);let U=r(D),W,G;if(U)W=a(U),G=D;else{let e=await g.getEncryptionKeyForRun?.(S,{...p,deploymentId:y});W=e?await se(e):void 0,G=e?m((await f(e)).publicKey):void 0}let K=await ie(t,S,W,O,globalThis,M,C,T&&j>=5),q=g.getEnvironment?.(),J=L(),Y={traceCarrier:k,workflowCoreVersion:x,features:{encryption:!!W},...E===void 0?{}:{hookResumeInputVersion:E},...J?{workflowVm:J}:{},...p.replayedFromRunId?{replayedFromRunId:p.replayedFromRunId}:{}},[X,Z]=await Promise.allSettled([g.events.create(S,{eventType:`run_created`,specVersion:j,eventData:{deploymentId:y,workflowName:l,input:K,executionContext:Y,...G?{encryptionPublicKey:G}:{},...H}},{v1Compat:M}),g.queue(b(l,p.namespace),{runId:S,traceCarrier:k,...j>=3?{runInput:{input:K,deploymentId:y,workflowName:l,specVersion:j,executionContext:Y,...G?{encryptionPublicKey:G}:{},...q===void 0?{}:{environment:q},...H}}:{}},{deploymentId:y,specVersion:j,...p.region===void 0?{}:{region:p.region}})]);if(Z.status===`rejected`)throw Z.reason;let $=!1;if(X.status===`rejected`){let e=X.reason;if(!N.is(e))if(u(e))$=!0,v.warn(`Run creation event failed, but the run was accepted via the queue. The run_created event will be re-tried async by the runtime.`,{workflowRunId:S,error:e.message});else throw e}else{let e=X.value;if(!M&&e.run.runId!==S)throw new A(`Server returned different runId than requested: expected ${S}, got ${e.run.runId}`)}return le(Promise.all(O),e=>{v.warn(`Background flush of workflow argument streams failed`,{workflowRunId:S,error:e instanceof Error?e.message:String(e)})}),e?.setAttributes({...ee(S),...re(y),...X.status===`fulfilled`?d(X.value.run.status):{}}),new Q(S,{resilientStart:$})})})}const U=e=>Array.isArray(e)?e:[e];async function W(t,n,r={}){try{let i=await t.runs.get(n,{resolveData:`all`}),a=await t.getEncryptionKeyForRun?.(i),o=a?await C(a):void 0,s=U(await e(i.input,n,o,globalThis)),c=r.specVersion??i.specVersion??1,l=r.deploymentId??i.deploymentId;return(await H({workflowId:i.workflowName},s,{deploymentId:l,world:t,specVersion:c,replayedFromRunId:n,namespace:r.namespace})).runId}catch(e){throw Error(`Failed to recreate run from ${n}: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async function G(e,t,n){try{let r=(await e.runs.get(t,{resolveData:`none`})).specVersion??1,i=w(r),a={eventType:`run_cancelled`,specVersion:r,...n?.cancelReason===void 0?{}:{eventData:{cancelReason:n.cancelReason}}};await e.events.create(t,a,{v1Compat:i})}catch(e){throw Error(`Failed to cancel run ${t}: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async function K(e,t,n){if(t.length===0)throw Error(`cancelRuns requires at least one run ID.`);if(t.length>500)throw Error(`cancelRuns accepts at most 500 run IDs (received ${t.length}).`);if(new Set(t).size!==t.length)throw Error(`cancelRuns requires unique run IDs (duplicates found).`);if(e.runs.cancelMany)return e.runs.cancelMany({runIds:t,...n?.cancelReason===void 0?{}:{cancelReason:n.cancelReason}});let r=Array(t.length),i=0,a=async()=>{for(;;){let a=i++;if(a>=t.length)return;let o=t[a];try{await G(e,o,n),r[a]={runId:o,outcome:`cancelled`}}catch{r[a]={runId:o,outcome:`failed`,code:`internal_error`,retryable:!0}}}},o=Math.min(20,t.length);await Promise.all(Array.from({length:o},()=>a()));let s={requested:t.length,cancelled:0,alreadyCancelled:0,notCancellable:0,notFound:0,failed:0};for(let e of r)switch(e.outcome){case`cancelled`:s.cancelled++;break;case`already_cancelled`:s.alreadyCancelled++;break;case`not_cancellable`:s.notCancellable++;break;case`not_found`:s.notFound++;break;case`failed`:s.failed++;break}return{summary:s,results:r}}async function q(e,t,n){try{let r=await e.runs.get(t,{resolveData:`none`});await e.queue(b(r.workflowName,n?.namespace),{runId:t},{deploymentId:r.deploymentId,specVersion:r.specVersion??1})}catch(e){throw Error(`Failed to re-enqueue run ${t}: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async function J(e,t,n){try{let r=await e.runs.get(t,{resolveData:`none`}),i=w(r.specVersion),a=[],o=null;do{let n=await e.events.list({runId:t,pagination:{sortOrder:`asc`,...o?{cursor:o}:{}},resolveData:`none`});a.push(...n.data),o=n.hasMore?n.cursor:null}while(o);let s=a.filter(e=>e.eventType===`wait_created`),c=new Set(a.filter(e=>e.eventType===`wait_completed`).map(e=>e.correlationId)),l=s.filter(e=>!c.has(e.correlationId));if(n?.correlationIds&&n.correlationIds.length>0){let e=new Set(n.correlationIds);l=l.filter(t=>t.correlationId&&e.has(t.correlationId))}let u=[],d=0;for(let n of l){if(!n.correlationId)continue;let a=i?{eventType:`wait_completed`,correlationId:n.correlationId}:{eventType:`wait_completed`,correlationId:n.correlationId,specVersion:r.specVersion,eventData:{resumeAt:n.eventData.resumeAt}};try{await e.events.create(t,a,{v1Compat:i}),d++}catch(e){N.is(e)?d++:u.push(e instanceof Error?e:Error(String(e)))}}if(d>0&&await e.queue(b(r.workflowName,n?.namespace),{runId:t},{deploymentId:r.deploymentId,specVersion:r.specVersion??1}),u.length>0)throw AggregateError(u,`Failed to complete ${u.length}/${l.length} pending wait(s) for run ${t}`);return{stoppedCount:d}}catch(e){throw e instanceof AggregateError?e:Error(`Failed to wake up run ${t}: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async function Y(e,t,n,r){try{return await e.streams.get(t,n,r?.startIndex)}catch(e){throw Error(`Failed to read stream ${n}: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async function X(e,t){try{return await e.streams.list(t)}catch(e){throw Error(`Failed to list streams for run ${t}: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}function Z(){return E(`WORKFLOW_RETURN_VALUE_POLL_INTERVAL_MS`,1e3,{integer:!0,min:1})}var Q=class e{static[O](e){return{runId:e.runId,resilientStart:e.#r}}static[l](t){return new e(t.runId,{resilientStart:t.resilientStart})}runId;#e;get#t(){return this.#e||=h(),this.#e}#n=null;#r=!1;constructor(e,t){this.runId=e,this.#r=t?.resilientStart??!1}#i(){return this.#n||=(async()=>{let e=await this.#t,t=await e.runs.get(this.runId),n=await e.getEncryptionKeyForRun?.(t);return n?await C(n):void 0})(),this.#n}#a(){return()=>this.#i()}async wakeUp(e){"use step";return J(await this.#t,this.runId,e)}async cancel(e){"use step";await(await this.#t).events.create(this.runId,{eventType:`run_cancelled`,specVersion:5,...e?.cancelReason===void 0?{}:{eventData:{cancelReason:e.cancelReason}}})}get exists(){"use step";return this.#t.then(e=>e.runs.get(this.runId,{resolveData:`none`}).then(()=>!0).catch(e=>{if(j.is(e))return!1;throw e}))}get status(){"use step";return this.#t.then(e=>e.runs.get(this.runId).then(e=>e.status))}get returnValue(){"use step";return this.#o()}get workflowName(){"use step";return this.#t.then(e=>e.runs.get(this.runId).then(e=>e.workflowName))}get createdAt(){"use step";return this.#t.then(e=>e.runs.get(this.runId).then(e=>e.createdAt))}get startedAt(){"use step";return this.#t.then(e=>e.runs.get(this.runId).then(e=>e.startedAt))}get completedAt(){"use step";return this.#t.then(e=>e.runs.get(this.runId).then(e=>e.completedAt))}get readable(){return this.getReadable()}getReadable(e={}){"use step";let{ops:t=[],global:n=globalThis,startIndex:r,namespace:i}=e,a=_(this.runId,i),s=this.#a(),c=o(n,t,this.runId,s).ReadableStream({name:a,startIndex:r}),l=this.#t,u=this.runId;return Object.assign(c,{getTailIndex:async()=>(await(await l).streams.getInfo(u,a)).tailIndex})}async#o(){let e=await this.#t,t=0,n=this.#r?3:0,r=[1e3,3e3,6e3];for(;;)try{let t=await e.runs.get(this.runId);if(t.status===`completed`){let e=await this.#i();return await p(t.output,this.runId,e)}if(t.status===`cancelled`)throw new k(this.runId);if(t.status===`failed`){let e=await this.#i(),n;try{n=await i(t.error,this.runId,e)}catch{n=Error(`Failed to hydrate workflow run error`)}throw new P(this.runId,n,{errorCode:t.errorCode})}throw new M(this.runId,t.status)}catch(e){if(M.is(e)){await new Promise(e=>setTimeout(e,Z()));continue}if(j.is(e)&&t<n){let e=r[t];t++,await new Promise(t=>setTimeout(t,e));continue}throw e}}};function $(e){return new Q(e)}export{X as a,q as c,R as d,K as i,J as l,$ as n,Y as o,G as r,W as s,Q as t,H as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ar as e}from"./wait-until-BYKVqrwc.js";import{i as t}from"./attribute-changes-6OqdYdi4.js";async function n(r){let i=globalThis[e];return i||t(`sleep()`,`https://workflow-sdk.dev/docs/api-reference/workflow/sleep`,n),i(r)}export{n as t};
|