@scalar/agent-chat 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js +12 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/core.js +67 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/core.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/errors.js +25 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/errors.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/parse.js +64 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/parse.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/regexes.js +8 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/regexes.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/schemas.js +181 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/schemas.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/util.js +85 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/util.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/versions.js +9 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/versions.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/mini/schemas.js +61 -0
- package/dist/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/mini/schemas.js.map +1 -0
- package/dist/package.json +67 -0
- package/package.json +4 -1
- /package/{App.vue.d.ts → dist/App.vue.d.ts} +0 -0
- /package/{App.vue.d.ts.map → dist/App.vue.d.ts.map} +0 -0
- /package/{App.vue.js → dist/App.vue.js} +0 -0
- /package/{App.vue.js.map → dist/App.vue.js.map} +0 -0
- /package/{App.vue2.js → dist/App.vue2.js} +0 -0
- /package/{App.vue2.js.map → dist/App.vue2.js.map} +0 -0
- /package/{Chat.vue.d.ts → dist/Chat.vue.d.ts} +0 -0
- /package/{Chat.vue.d.ts.map → dist/Chat.vue.d.ts.map} +0 -0
- /package/{Chat.vue.js → dist/Chat.vue.js} +0 -0
- /package/{Chat.vue.js.map → dist/Chat.vue.js.map} +0 -0
- /package/{Chat.vue2.js → dist/Chat.vue2.js} +0 -0
- /package/{Chat.vue2.js.map → dist/Chat.vue2.js.map} +0 -0
- /package/{_virtual → dist/_virtual}/_plugin-vue_export-helper.js +0 -0
- /package/{_virtual → dist/_virtual}/_plugin-vue_export-helper.js.map +0 -0
- /package/{components → dist/components}/ApprovalSection.vue.d.ts +0 -0
- /package/{components → dist/components}/ApprovalSection.vue.d.ts.map +0 -0
- /package/{components → dist/components}/ApprovalSection.vue.js +0 -0
- /package/{components → dist/components}/ApprovalSection.vue.js.map +0 -0
- /package/{components → dist/components}/ApprovalSection.vue2.js +0 -0
- /package/{components → dist/components}/ApprovalSection.vue2.js.map +0 -0
- /package/{components → dist/components}/AutosendPaused.vue.d.ts +0 -0
- /package/{components → dist/components}/AutosendPaused.vue.d.ts.map +0 -0
- /package/{components → dist/components}/AutosendPaused.vue.js +0 -0
- /package/{components → dist/components}/AutosendPaused.vue.js.map +0 -0
- /package/{components → dist/components}/ContextItem.vue.d.ts +0 -0
- /package/{components → dist/components}/ContextItem.vue.d.ts.map +0 -0
- /package/{components → dist/components}/ContextItem.vue.js +0 -0
- /package/{components → dist/components}/ContextItem.vue.js.map +0 -0
- /package/{components → dist/components}/ContextItem.vue2.js +0 -0
- /package/{components → dist/components}/ContextItem.vue2.js.map +0 -0
- /package/{components → dist/components}/Endpoint.vue.d.ts +0 -0
- /package/{components → dist/components}/Endpoint.vue.d.ts.map +0 -0
- /package/{components → dist/components}/Endpoint.vue.js +0 -0
- /package/{components → dist/components}/Endpoint.vue.js.map +0 -0
- /package/{components → dist/components}/Endpoint.vue2.js +0 -0
- /package/{components → dist/components}/Endpoint.vue2.js.map +0 -0
- /package/{components → dist/components}/ErrorMessage.vue.d.ts +0 -0
- /package/{components → dist/components}/ErrorMessage.vue.d.ts.map +0 -0
- /package/{components → dist/components}/ErrorMessage.vue.js +0 -0
- /package/{components → dist/components}/ErrorMessage.vue.js.map +0 -0
- /package/{components → dist/components}/ErrorMessage.vue2.js +0 -0
- /package/{components → dist/components}/ErrorMessage.vue2.js.map +0 -0
- /package/{components → dist/components}/LoadingMiniOpenAPIDoc.vue.d.ts +0 -0
- /package/{components → dist/components}/LoadingMiniOpenAPIDoc.vue.d.ts.map +0 -0
- /package/{components → dist/components}/LoadingMiniOpenAPIDoc.vue.js +0 -0
- /package/{components → dist/components}/LoadingMiniOpenAPIDoc.vue.js.map +0 -0
- /package/{components → dist/components}/LoadingOpenAPISpecsSummary.vue.d.ts +0 -0
- /package/{components → dist/components}/LoadingOpenAPISpecsSummary.vue.d.ts.map +0 -0
- /package/{components → dist/components}/LoadingOpenAPISpecsSummary.vue.js +0 -0
- /package/{components → dist/components}/LoadingOpenAPISpecsSummary.vue.js.map +0 -0
- /package/{components → dist/components}/Logo.vue.d.ts +0 -0
- /package/{components → dist/components}/Logo.vue.d.ts.map +0 -0
- /package/{components → dist/components}/Logo.vue.js +0 -0
- /package/{components → dist/components}/Logo.vue.js.map +0 -0
- /package/{components → dist/components}/RequestApproved.vue.d.ts +0 -0
- /package/{components → dist/components}/RequestApproved.vue.d.ts.map +0 -0
- /package/{components → dist/components}/RequestApproved.vue.js +0 -0
- /package/{components → dist/components}/RequestApproved.vue.js.map +0 -0
- /package/{components → dist/components}/RequestFailed.vue.d.ts +0 -0
- /package/{components → dist/components}/RequestFailed.vue.d.ts.map +0 -0
- /package/{components → dist/components}/RequestFailed.vue.js +0 -0
- /package/{components → dist/components}/RequestFailed.vue.js.map +0 -0
- /package/{components → dist/components}/RequestPreview.vue.d.ts +0 -0
- /package/{components → dist/components}/RequestPreview.vue.d.ts.map +0 -0
- /package/{components → dist/components}/RequestPreview.vue.js +0 -0
- /package/{components → dist/components}/RequestPreview.vue.js.map +0 -0
- /package/{components → dist/components}/RequestPreview.vue2.js +0 -0
- /package/{components → dist/components}/RequestPreview.vue2.js.map +0 -0
- /package/{components → dist/components}/RequestRejected.vue.d.ts +0 -0
- /package/{components → dist/components}/RequestRejected.vue.d.ts.map +0 -0
- /package/{components → dist/components}/RequestRejected.vue.js +0 -0
- /package/{components → dist/components}/RequestRejected.vue.js.map +0 -0
- /package/{components → dist/components}/RequestSuccess.vue.d.ts +0 -0
- /package/{components → dist/components}/RequestSuccess.vue.d.ts.map +0 -0
- /package/{components → dist/components}/RequestSuccess.vue.js +0 -0
- /package/{components → dist/components}/RequestSuccess.vue.js.map +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBody.vue.d.ts +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBody.vue.d.ts.map +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBody.vue.js +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBody.vue.js.map +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBody.vue2.js +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBody.vue2.js.map +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyInfo.vue.d.ts +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyInfo.vue.d.ts.map +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyInfo.vue.js +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyInfo.vue.js.map +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyPreview.vue.d.ts +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyPreview.vue.d.ts.map +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyPreview.vue.js +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyPreview.vue.js.map +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyPreview.vue2.js +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyPreview.vue2.js.map +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyRaw.vue.d.ts +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyRaw.vue.d.ts.map +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyRaw.vue.js +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyRaw.vue.js.map +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyRaw.vue2.js +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyRaw.vue2.js.map +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyToggle.vue.d.ts +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyToggle.vue.d.ts.map +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyToggle.vue.js +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyToggle.vue.js.map +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyToggle.vue2.js +0 -0
- /package/{components → dist/components}/ResponseBody/ResponseBodyToggle.vue2.js.map +0 -0
- /package/{components → dist/components}/ResponseBody/helpers/media-types.d.ts +0 -0
- /package/{components → dist/components}/ResponseBody/helpers/media-types.d.ts.map +0 -0
- /package/{components → dist/components}/ResponseBody/helpers/media-types.js +0 -0
- /package/{components → dist/components}/ResponseBody/helpers/media-types.js.map +0 -0
- /package/{components → dist/components}/ResponseBody/helpers/process-response-body.d.ts +0 -0
- /package/{components → dist/components}/ResponseBody/helpers/process-response-body.d.ts.map +0 -0
- /package/{components → dist/components}/ResponseBody/helpers/process-response-body.js +0 -0
- /package/{components → dist/components}/ResponseBody/helpers/process-response-body.js.map +0 -0
- /package/{components → dist/components}/SearchPopover.vue.d.ts +0 -0
- /package/{components → dist/components}/SearchPopover.vue.d.ts.map +0 -0
- /package/{components → dist/components}/SearchPopover.vue.js +0 -0
- /package/{components → dist/components}/SearchPopover.vue.js.map +0 -0
- /package/{components → dist/components}/SearchPopover.vue2.js +0 -0
- /package/{components → dist/components}/SearchPopover.vue2.js.map +0 -0
- /package/{components → dist/components}/SendingRequest.vue.d.ts +0 -0
- /package/{components → dist/components}/SendingRequest.vue.d.ts.map +0 -0
- /package/{components → dist/components}/SendingRequest.vue.js +0 -0
- /package/{components → dist/components}/SendingRequest.vue.js.map +0 -0
- /package/{components → dist/components}/Suggestion.vue.d.ts +0 -0
- /package/{components → dist/components}/Suggestion.vue.d.ts.map +0 -0
- /package/{components → dist/components}/Suggestion.vue.js +0 -0
- /package/{components → dist/components}/Suggestion.vue.js.map +0 -0
- /package/{components → dist/components}/Suggestion.vue2.js +0 -0
- /package/{components → dist/components}/Suggestion.vue2.js.map +0 -0
- /package/{components → dist/components}/TestRequestButton.vue.d.ts +0 -0
- /package/{components → dist/components}/TestRequestButton.vue.d.ts.map +0 -0
- /package/{components → dist/components}/TestRequestButton.vue.js +0 -0
- /package/{components → dist/components}/TestRequestButton.vue.js.map +0 -0
- /package/{components → dist/components}/TestRequestButton.vue2.js +0 -0
- /package/{components → dist/components}/TestRequestButton.vue2.js.map +0 -0
- /package/{helpers.d.ts → dist/helpers.d.ts} +0 -0
- /package/{helpers.d.ts.map → dist/helpers.d.ts.map} +0 -0
- /package/{helpers.js → dist/helpers.js} +0 -0
- /package/{helpers.js.map → dist/helpers.js.map} +0 -0
- /package/{hooks → dist/hooks}/useChatApprovals.d.ts +0 -0
- /package/{hooks → dist/hooks}/useChatApprovals.d.ts.map +0 -0
- /package/{hooks → dist/hooks}/useChatApprovals.js +0 -0
- /package/{hooks → dist/hooks}/useChatApprovals.js.map +0 -0
- /package/{hooks → dist/hooks}/useChatOperationBlocks.d.ts +0 -0
- /package/{hooks → dist/hooks}/useChatOperationBlocks.d.ts.map +0 -0
- /package/{hooks → dist/hooks}/useChatOperationBlocks.js +0 -0
- /package/{hooks → dist/hooks}/useChatOperationBlocks.js.map +0 -0
- /package/{hooks → dist/hooks}/useChatScroll.d.ts +0 -0
- /package/{hooks → dist/hooks}/useChatScroll.d.ts.map +0 -0
- /package/{hooks → dist/hooks}/useChatScroll.js +0 -0
- /package/{hooks → dist/hooks}/useChatScroll.js.map +0 -0
- /package/{hooks → dist/hooks}/useSearch.d.ts +0 -0
- /package/{hooks → dist/hooks}/useSearch.d.ts.map +0 -0
- /package/{hooks → dist/hooks}/useSearch.js +0 -0
- /package/{hooks → dist/hooks}/useSearch.js.map +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{index.d.ts.map → dist/index.d.ts.map} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{index.js.map → dist/index.js.map} +0 -0
- /package/{registry → dist/registry}/add-documents-to-store.d.ts +0 -0
- /package/{registry → dist/registry}/add-documents-to-store.d.ts.map +0 -0
- /package/{registry → dist/registry}/add-documents-to-store.js +0 -0
- /package/{registry → dist/registry}/add-documents-to-store.js.map +0 -0
- /package/{state → dist/state}/state.d.ts +0 -0
- /package/{state → dist/state}/state.d.ts.map +0 -0
- /package/{state → dist/state}/state.js +0 -0
- /package/{state → dist/state}/state.js.map +0 -0
- /package/{style.css → dist/style.css} +0 -0
- /package/{views → dist/views}/Chat/Chat.vue.d.ts +0 -0
- /package/{views → dist/views}/Chat/Chat.vue.d.ts.map +0 -0
- /package/{views → dist/views}/Chat/Chat.vue.js +0 -0
- /package/{views → dist/views}/Chat/Chat.vue.js.map +0 -0
- /package/{views → dist/views}/Chat/Chat.vue2.js +0 -0
- /package/{views → dist/views}/Chat/Chat.vue2.js.map +0 -0
- /package/{views → dist/views}/Chat/Messages/ExecuteRequestTool.vue.d.ts +0 -0
- /package/{views → dist/views}/Chat/Messages/ExecuteRequestTool.vue.d.ts.map +0 -0
- /package/{views → dist/views}/Chat/Messages/ExecuteRequestTool.vue.js +0 -0
- /package/{views → dist/views}/Chat/Messages/ExecuteRequestTool.vue.js.map +0 -0
- /package/{views → dist/views}/Chat/Messages/ExecuteRequestTool.vue2.js +0 -0
- /package/{views → dist/views}/Chat/Messages/ExecuteRequestTool.vue2.js.map +0 -0
- /package/{views → dist/views}/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts +0 -0
- /package/{views → dist/views}/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts.map +0 -0
- /package/{views → dist/views}/Chat/Messages/GetMiniOpenAPIDocTool.vue.js +0 -0
- /package/{views → dist/views}/Chat/Messages/GetMiniOpenAPIDocTool.vue.js.map +0 -0
- /package/{views → dist/views}/Chat/Messages/GetMiniOpenAPIDocTool.vue2.js +0 -0
- /package/{views → dist/views}/Chat/Messages/GetMiniOpenAPIDocTool.vue2.js.map +0 -0
- /package/{views → dist/views}/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts +0 -0
- /package/{views → dist/views}/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts.map +0 -0
- /package/{views → dist/views}/Chat/Messages/GetOpenAPISpecsSummary.vue.js +0 -0
- /package/{views → dist/views}/Chat/Messages/GetOpenAPISpecsSummary.vue.js.map +0 -0
- /package/{views → dist/views}/Chat/Messages/GetOpenAPISpecsSummary.vue2.js +0 -0
- /package/{views → dist/views}/Chat/Messages/GetOpenAPISpecsSummary.vue2.js.map +0 -0
- /package/{views → dist/views}/Chat/Messages/Text.vue.d.ts +0 -0
- /package/{views → dist/views}/Chat/Messages/Text.vue.d.ts.map +0 -0
- /package/{views → dist/views}/Chat/Messages/Text.vue.js +0 -0
- /package/{views → dist/views}/Chat/Messages/Text.vue.js.map +0 -0
- /package/{views → dist/views}/Chat/Messages/Text.vue2.js +0 -0
- /package/{views → dist/views}/Chat/Messages/Text.vue2.js.map +0 -0
- /package/{views → dist/views}/Layout.vue.d.ts +0 -0
- /package/{views → dist/views}/Layout.vue.d.ts.map +0 -0
- /package/{views → dist/views}/Layout.vue.js +0 -0
- /package/{views → dist/views}/Layout.vue.js.map +0 -0
- /package/{views → dist/views}/Layout.vue2.js +0 -0
- /package/{views → dist/views}/Layout.vue2.js.map +0 -0
- /package/{views → dist/views}/PromptForm.vue.d.ts +0 -0
- /package/{views → dist/views}/PromptForm.vue.d.ts.map +0 -0
- /package/{views → dist/views}/PromptForm.vue.js +0 -0
- /package/{views → dist/views}/PromptForm.vue.js.map +0 -0
- /package/{views → dist/views}/PromptForm.vue2.js +0 -0
- /package/{views → dist/views}/PromptForm.vue2.js.map +0 -0
- /package/{views → dist/views}/Settings/Auth.vue.d.ts +0 -0
- /package/{views → dist/views}/Settings/Auth.vue.d.ts.map +0 -0
- /package/{views → dist/views}/Settings/Auth.vue.js +0 -0
- /package/{views → dist/views}/Settings/Auth.vue.js.map +0 -0
- /package/{views → dist/views}/Settings/Auth.vue2.js +0 -0
- /package/{views → dist/views}/Settings/Auth.vue2.js.map +0 -0
- /package/{views → dist/views}/Settings/DocSettings.vue.d.ts +0 -0
- /package/{views → dist/views}/Settings/DocSettings.vue.d.ts.map +0 -0
- /package/{views → dist/views}/Settings/DocSettings.vue.js +0 -0
- /package/{views → dist/views}/Settings/DocSettings.vue.js.map +0 -0
- /package/{views → dist/views}/Settings/DocSettings.vue2.js +0 -0
- /package/{views → dist/views}/Settings/DocSettings.vue2.js.map +0 -0
- /package/{views → dist/views}/Settings/Settings.vue.d.ts +0 -0
- /package/{views → dist/views}/Settings/Settings.vue.d.ts.map +0 -0
- /package/{views → dist/views}/Settings/Settings.vue.js +0 -0
- /package/{views → dist/views}/Settings/Settings.vue.js.map +0 -0
- /package/{views → dist/views}/Settings/Settings.vue2.js +0 -0
- /package/{views → dist/views}/Settings/Settings.vue2.js.map +0 -0
- /package/{views → dist/views}/Start.vue.d.ts +0 -0
- /package/{views → dist/views}/Start.vue.d.ts.map +0 -0
- /package/{views → dist/views}/Start.vue.js +0 -0
- /package/{views → dist/views}/Start.vue.js.map +0 -0
- /package/{views → dist/views}/Start.vue2.js +0 -0
- /package/{views → dist/views}/Start.vue2.js.map +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sources":["../../../../../../../../../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js"],"sourcesContent":["import * as checks from \"./checks.js\";\nimport * as registries from \"./registries.js\";\nimport * as schemas from \"./schemas.js\";\nimport * as util from \"./util.js\";\n// @__NO_SIDE_EFFECTS__\nexport function _string(Class, params) {\n return new Class({\n type: \"string\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedString(Class, params) {\n return new Class({\n type: \"string\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _email(Class, params) {\n return new Class({\n type: \"string\",\n format: \"email\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _guid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"guid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v4\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v6\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv7(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v7\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _emoji(Class, params) {\n return new Class({\n type: \"string\",\n format: \"emoji\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nanoid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"nanoid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid2(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid2\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ulid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ulid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _xid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"xid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ksuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ksuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mac(Class, params) {\n return new Class({\n type: \"string\",\n format: \"mac\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _e164(Class, params) {\n return new Class({\n type: \"string\",\n format: \"e164\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _jwt(Class, params) {\n return new Class({\n type: \"string\",\n format: \"jwt\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport const TimePrecision = {\n Any: null,\n Minute: -1,\n Second: 0,\n Millisecond: 3,\n Microsecond: 6,\n};\n// @__NO_SIDE_EFFECTS__\nexport function _isoDateTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"datetime\",\n check: \"string_format\",\n offset: false,\n local: false,\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDate(Class, params) {\n return new Class({\n type: \"string\",\n format: \"date\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"time\",\n check: \"string_format\",\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDuration(Class, params) {\n return new Class({\n type: \"string\",\n format: \"duration\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _number(Class, params) {\n return new Class({\n type: \"number\",\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedNumber(Class, params) {\n return new Class({\n type: \"number\",\n coerce: true,\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"safeint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float64(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"int32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"uint32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _boolean(Class, params) {\n return new Class({\n type: \"boolean\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBoolean(Class, params) {\n return new Class({\n type: \"boolean\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _bigint(Class, params) {\n return new Class({\n type: \"bigint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBigint(Class, params) {\n return new Class({\n type: \"bigint\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"int64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"uint64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _symbol(Class, params) {\n return new Class({\n type: \"symbol\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _undefined(Class, params) {\n return new Class({\n type: \"undefined\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _null(Class, params) {\n return new Class({\n type: \"null\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _any(Class) {\n return new Class({\n type: \"any\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _unknown(Class) {\n return new Class({\n type: \"unknown\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _never(Class, params) {\n return new Class({\n type: \"never\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _void(Class, params) {\n return new Class({\n type: \"void\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _date(Class, params) {\n return new Class({\n type: \"date\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedDate(Class, params) {\n return new Class({\n type: \"date\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nan(Class, params) {\n return new Class({\n type: \"nan\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lt(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lte(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.lte()` instead. */\n_lte as _max, };\n// @__NO_SIDE_EFFECTS__\nexport function _gt(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _gte(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.gte()` instead. */\n_gte as _min, };\n// @__NO_SIDE_EFFECTS__\nexport function _positive(params) {\n return _gt(0, params);\n}\n// negative\n// @__NO_SIDE_EFFECTS__\nexport function _negative(params) {\n return _lt(0, params);\n}\n// nonpositive\n// @__NO_SIDE_EFFECTS__\nexport function _nonpositive(params) {\n return _lte(0, params);\n}\n// nonnegative\n// @__NO_SIDE_EFFECTS__\nexport function _nonnegative(params) {\n return _gte(0, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function _multipleOf(value, params) {\n return new checks.$ZodCheckMultipleOf({\n check: \"multiple_of\",\n ...util.normalizeParams(params),\n value,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxSize(maximum, params) {\n return new checks.$ZodCheckMaxSize({\n check: \"max_size\",\n ...util.normalizeParams(params),\n maximum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minSize(minimum, params) {\n return new checks.$ZodCheckMinSize({\n check: \"min_size\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _size(size, params) {\n return new checks.$ZodCheckSizeEquals({\n check: \"size_equals\",\n ...util.normalizeParams(params),\n size,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxLength(maximum, params) {\n const ch = new checks.$ZodCheckMaxLength({\n check: \"max_length\",\n ...util.normalizeParams(params),\n maximum,\n });\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minLength(minimum, params) {\n return new checks.$ZodCheckMinLength({\n check: \"min_length\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _length(length, params) {\n return new checks.$ZodCheckLengthEquals({\n check: \"length_equals\",\n ...util.normalizeParams(params),\n length,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _regex(pattern, params) {\n return new checks.$ZodCheckRegex({\n check: \"string_format\",\n format: \"regex\",\n ...util.normalizeParams(params),\n pattern,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lowercase(params) {\n return new checks.$ZodCheckLowerCase({\n check: \"string_format\",\n format: \"lowercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uppercase(params) {\n return new checks.$ZodCheckUpperCase({\n check: \"string_format\",\n format: \"uppercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _includes(includes, params) {\n return new checks.$ZodCheckIncludes({\n check: \"string_format\",\n format: \"includes\",\n ...util.normalizeParams(params),\n includes,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _startsWith(prefix, params) {\n return new checks.$ZodCheckStartsWith({\n check: \"string_format\",\n format: \"starts_with\",\n ...util.normalizeParams(params),\n prefix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _endsWith(suffix, params) {\n return new checks.$ZodCheckEndsWith({\n check: \"string_format\",\n format: \"ends_with\",\n ...util.normalizeParams(params),\n suffix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _property(property, schema, params) {\n return new checks.$ZodCheckProperty({\n check: \"property\",\n property,\n schema,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mime(types, params) {\n return new checks.$ZodCheckMimeType({\n check: \"mime_type\",\n mime: types,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _overwrite(tx) {\n return new checks.$ZodCheckOverwrite({\n check: \"overwrite\",\n tx,\n });\n}\n// normalize\n// @__NO_SIDE_EFFECTS__\nexport function _normalize(form) {\n return _overwrite((input) => input.normalize(form));\n}\n// trim\n// @__NO_SIDE_EFFECTS__\nexport function _trim() {\n return _overwrite((input) => input.trim());\n}\n// toLowerCase\n// @__NO_SIDE_EFFECTS__\nexport function _toLowerCase() {\n return _overwrite((input) => input.toLowerCase());\n}\n// toUpperCase\n// @__NO_SIDE_EFFECTS__\nexport function _toUpperCase() {\n return _overwrite((input) => input.toUpperCase());\n}\n// slugify\n// @__NO_SIDE_EFFECTS__\nexport function _slugify() {\n return _overwrite((input) => util.slugify(input));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _array(Class, element, params) {\n return new Class({\n type: \"array\",\n element,\n // get element() {\n // return element;\n // },\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _union(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n ...util.normalizeParams(params),\n });\n}\nexport function _xor(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _discriminatedUnion(Class, discriminator, options, params) {\n return new Class({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _intersection(Class, left, right) {\n return new Class({\n type: \"intersection\",\n left,\n right,\n });\n}\n// export function _tuple(\n// Class: util.SchemaClass<schemas.$ZodTuple>,\n// items: [],\n// params?: string | $ZodTupleParams\n// ): schemas.$ZodTuple<[], null>;\n// @__NO_SIDE_EFFECTS__\nexport function _tuple(Class, items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof schemas.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new Class({\n type: \"tuple\",\n items,\n rest,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _record(Class, keyType, valueType, params) {\n return new Class({\n type: \"record\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _map(Class, keyType, valueType, params) {\n return new Class({\n type: \"map\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _set(Class, valueType, params) {\n return new Class({\n type: \"set\",\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _enum(Class, values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n // if (Array.isArray(values)) {\n // for (const value of values) {\n // entries[value] = value;\n // }\n // } else {\n // Object.assign(entries, values);\n // }\n // const entries: util.EnumLike = {};\n // for (const val of values) {\n // entries[val] = val;\n // }\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function _nativeEnum(Class, entries, params) {\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _literal(Class, value, params) {\n return new Class({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _file(Class, params) {\n return new Class({\n type: \"file\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _transform(Class, fn) {\n return new Class({\n type: \"transform\",\n transform: fn,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _optional(Class, innerType) {\n return new Class({\n type: \"optional\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nullable(Class, innerType) {\n return new Class({\n type: \"nullable\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _default(Class, innerType, defaultValue) {\n return new Class({\n type: \"default\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nonoptional(Class, innerType, params) {\n return new Class({\n type: \"nonoptional\",\n innerType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _success(Class, innerType) {\n return new Class({\n type: \"success\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _catch(Class, innerType, catchValue) {\n return new Class({\n type: \"catch\",\n innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _pipe(Class, in_, out) {\n return new Class({\n type: \"pipe\",\n in: in_,\n out,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _readonly(Class, innerType) {\n return new Class({\n type: \"readonly\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _templateLiteral(Class, parts, params) {\n return new Class({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lazy(Class, getter) {\n return new Class({\n type: \"lazy\",\n getter,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _promise(Class, innerType) {\n return new Class({\n type: \"promise\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _custom(Class, fn, _params) {\n const norm = util.normalizeParams(_params);\n norm.abort ?? (norm.abort = true); // default to abort:false\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...norm,\n });\n return schema;\n}\n// same as _custom but defaults to abort:false\n// @__NO_SIDE_EFFECTS__\nexport function _refine(Class, fn, _params) {\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...util.normalizeParams(_params),\n });\n return schema;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _superRefine(fn) {\n const ch = _check((payload) => {\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, ch._zod.def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = ch);\n _issue.continue ?? (_issue.continue = !ch._zod.def.abort); // abort is always undefined, so this is always true...\n payload.issues.push(util.issue(_issue));\n }\n };\n return fn(payload.value, payload);\n });\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _check(fn, params) {\n const ch = new checks.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function describe(description) {\n const ch = new checks.$ZodCheck({ check: \"describe\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, description });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function meta(metadata) {\n const ch = new checks.$ZodCheck({ check: \"meta\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, ...metadata });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringbool(Classes, _params) {\n const params = util.normalizeParams(_params);\n let truthyArray = params.truthy ?? [\"true\", \"1\", \"yes\", \"on\", \"y\", \"enabled\"];\n let falsyArray = params.falsy ?? [\"false\", \"0\", \"no\", \"off\", \"n\", \"disabled\"];\n if (params.case !== \"sensitive\") {\n truthyArray = truthyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n falsyArray = falsyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n }\n const truthySet = new Set(truthyArray);\n const falsySet = new Set(falsyArray);\n const _Codec = Classes.Codec ?? schemas.$ZodCodec;\n const _Boolean = Classes.Boolean ?? schemas.$ZodBoolean;\n const _String = Classes.String ?? schemas.$ZodString;\n const stringSchema = new _String({ type: \"string\", error: params.error });\n const booleanSchema = new _Boolean({ type: \"boolean\", error: params.error });\n const codec = new _Codec({\n type: \"pipe\",\n in: stringSchema,\n out: booleanSchema,\n transform: ((input, payload) => {\n let data = input;\n if (params.case !== \"sensitive\")\n data = data.toLowerCase();\n if (truthySet.has(data)) {\n return true;\n }\n else if (falsySet.has(data)) {\n return false;\n }\n else {\n payload.issues.push({\n code: \"invalid_value\",\n expected: \"stringbool\",\n values: [...truthySet, ...falsySet],\n input: payload.value,\n inst: codec,\n continue: false,\n });\n return {};\n }\n }),\n reverseTransform: ((input, _payload) => {\n if (input === true) {\n return truthyArray[0] || \"true\";\n }\n else {\n return falsyArray[0] || \"false\";\n }\n }),\n error: params.error,\n });\n return codec;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringFormat(Class, format, fnOrRegex, _params = {}) {\n const params = util.normalizeParams(_params);\n const def = {\n ...util.normalizeParams(_params),\n check: \"string_format\",\n type: \"string\",\n format,\n fn: typeof fnOrRegex === \"function\" ? fnOrRegex : (val) => fnOrRegex.test(val),\n ...params,\n };\n if (fnOrRegex instanceof RegExp) {\n def.pattern = fnOrRegex;\n }\n const inst = new Class(def);\n return inst;\n}\n"],"names":["util.normalizeParams"],"mappings":";;AAKO,SAAS,QAAQ,OAAO,QAAQ;AACnC,SAAO,IAAI,MAAM;AAAA,IACb,MAAM;AAAA,IACN,GAAGA,gBAA2B;AAAA,EACtC,CAAK;AACL;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
function $constructor(name, initializer, params) {
|
|
2
|
+
function init(inst, def) {
|
|
3
|
+
if (!inst._zod) {
|
|
4
|
+
Object.defineProperty(inst, "_zod", {
|
|
5
|
+
value: {
|
|
6
|
+
def,
|
|
7
|
+
constr: _,
|
|
8
|
+
traits: /* @__PURE__ */ new Set()
|
|
9
|
+
},
|
|
10
|
+
enumerable: false
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
if (inst._zod.traits.has(name)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
inst._zod.traits.add(name);
|
|
17
|
+
initializer(inst, def);
|
|
18
|
+
const proto = _.prototype;
|
|
19
|
+
const keys = Object.keys(proto);
|
|
20
|
+
for (let i = 0; i < keys.length; i++) {
|
|
21
|
+
const k = keys[i];
|
|
22
|
+
if (!(k in inst)) {
|
|
23
|
+
inst[k] = proto[k].bind(inst);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const Parent = params?.Parent ?? Object;
|
|
28
|
+
class Definition extends Parent {
|
|
29
|
+
}
|
|
30
|
+
Object.defineProperty(Definition, "name", { value: name });
|
|
31
|
+
function _(def) {
|
|
32
|
+
var _a;
|
|
33
|
+
const inst = params?.Parent ? new Definition() : this;
|
|
34
|
+
init(inst, def);
|
|
35
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
36
|
+
for (const fn of inst._zod.deferred) {
|
|
37
|
+
fn();
|
|
38
|
+
}
|
|
39
|
+
return inst;
|
|
40
|
+
}
|
|
41
|
+
Object.defineProperty(_, "init", { value: init });
|
|
42
|
+
Object.defineProperty(_, Symbol.hasInstance, {
|
|
43
|
+
value: (inst) => {
|
|
44
|
+
if (params?.Parent && inst instanceof params.Parent)
|
|
45
|
+
return true;
|
|
46
|
+
return inst?._zod?.traits?.has(name);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(_, "name", { value: name });
|
|
50
|
+
return _;
|
|
51
|
+
}
|
|
52
|
+
class $ZodAsyncError extends Error {
|
|
53
|
+
constructor() {
|
|
54
|
+
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const globalConfig = {};
|
|
58
|
+
function config(newConfig) {
|
|
59
|
+
return globalConfig;
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
$ZodAsyncError,
|
|
63
|
+
$constructor,
|
|
64
|
+
config,
|
|
65
|
+
globalConfig
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.js","sources":["../../../../../../../../../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/core.js"],"sourcesContent":["/** A special constant with type `never` */\nexport const NEVER = Object.freeze({\n status: \"aborted\",\n});\nexport /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, params) {\n function init(inst, def) {\n if (!inst._zod) {\n Object.defineProperty(inst, \"_zod\", {\n value: {\n def,\n constr: _,\n traits: new Set(),\n },\n enumerable: false,\n });\n }\n if (inst._zod.traits.has(name)) {\n return;\n }\n inst._zod.traits.add(name);\n initializer(inst, def);\n // support prototype modifications\n const proto = _.prototype;\n const keys = Object.keys(proto);\n for (let i = 0; i < keys.length; i++) {\n const k = keys[i];\n if (!(k in inst)) {\n inst[k] = proto[k].bind(inst);\n }\n }\n }\n // doesn't work if Parent has a constructor with arguments\n const Parent = params?.Parent ?? Object;\n class Definition extends Parent {\n }\n Object.defineProperty(Definition, \"name\", { value: name });\n function _(def) {\n var _a;\n const inst = params?.Parent ? new Definition() : this;\n init(inst, def);\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n for (const fn of inst._zod.deferred) {\n fn();\n }\n return inst;\n }\n Object.defineProperty(_, \"init\", { value: init });\n Object.defineProperty(_, Symbol.hasInstance, {\n value: (inst) => {\n if (params?.Parent && inst instanceof params.Parent)\n return true;\n return inst?._zod?.traits?.has(name);\n },\n });\n Object.defineProperty(_, \"name\", { value: name });\n return _;\n}\n////////////////////////////// UTILITIES ///////////////////////////////////////\nexport const $brand = Symbol(\"zod_brand\");\nexport class $ZodAsyncError extends Error {\n constructor() {\n super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);\n }\n}\nexport class $ZodEncodeError extends Error {\n constructor(name) {\n super(`Encountered unidirectional transform during encode: ${name}`);\n this.name = \"ZodEncodeError\";\n }\n}\nexport const globalConfig = {};\nexport function config(newConfig) {\n if (newConfig)\n Object.assign(globalConfig, newConfig);\n return globalConfig;\n}\n"],"names":[],"mappings":"AAIgC,SAAS,aAAa,MAAM,aAAa,QAAQ;AAC7E,WAAS,KAAK,MAAM,KAAK;AACrB,QAAI,CAAC,KAAK,MAAM;AACZ,aAAO,eAAe,MAAM,QAAQ;AAAA,QAChC,OAAO;AAAA,UACH;AAAA,UACA,QAAQ;AAAA,UACR,QAAQ,oBAAI,IAAG;AAAA,QACnC;AAAA,QACgB,YAAY;AAAA,MAC5B,CAAa;AAAA,IACL;AACA,QAAI,KAAK,KAAK,OAAO,IAAI,IAAI,GAAG;AAC5B;AAAA,IACJ;AACA,SAAK,KAAK,OAAO,IAAI,IAAI;AACzB,gBAAY,MAAM,GAAG;AAErB,UAAM,QAAQ,EAAE;AAChB,UAAM,OAAO,OAAO,KAAK,KAAK;AAC9B,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AAClC,YAAM,IAAI,KAAK,CAAC;AAChB,UAAI,EAAE,KAAK,OAAO;AACd,aAAK,CAAC,IAAI,MAAM,CAAC,EAAE,KAAK,IAAI;AAAA,MAChC;AAAA,IACJ;AAAA,EACJ;AAEA,QAAM,SAAS,QAAQ,UAAU;AAAA,EACjC,MAAM,mBAAmB,OAAO;AAAA,EACpC;AACI,SAAO,eAAe,YAAY,QAAQ,EAAE,OAAO,MAAM;AACzD,WAAS,EAAE,KAAK;AACZ,QAAI;AACJ,UAAM,OAAO,QAAQ,SAAS,IAAI,WAAU,IAAK;AACjD,SAAK,MAAM,GAAG;AACd,KAAC,KAAK,KAAK,MAAM,aAAa,GAAG,WAAW;AAC5C,eAAW,MAAM,KAAK,KAAK,UAAU;AACjC,SAAE;AAAA,IACN;AACA,WAAO;AAAA,EACX;AACA,SAAO,eAAe,GAAG,QAAQ,EAAE,OAAO,MAAM;AAChD,SAAO,eAAe,GAAG,OAAO,aAAa;AAAA,IACzC,OAAO,CAAC,SAAS;AACb,UAAI,QAAQ,UAAU,gBAAgB,OAAO;AACzC,eAAO;AACX,aAAO,MAAM,MAAM,QAAQ,IAAI,IAAI;AAAA,IACvC;AAAA,EACR,CAAK;AACD,SAAO,eAAe,GAAG,QAAQ,EAAE,OAAO,MAAM;AAChD,SAAO;AACX;AAGO,MAAM,uBAAuB,MAAM;AAAA,EACtC,cAAc;AACV,UAAM,0EAA0E;AAAA,EACpF;AACJ;AAOY,MAAC,eAAe,CAAA;AACrB,SAAS,OAAO,WAAW;AAG9B,SAAO;AACX;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { $constructor } from "./core.js";
|
|
2
|
+
import { jsonStringifyReplacer } from "./util.js";
|
|
3
|
+
const initializer = (inst, def) => {
|
|
4
|
+
inst.name = "$ZodError";
|
|
5
|
+
Object.defineProperty(inst, "_zod", {
|
|
6
|
+
value: inst._zod,
|
|
7
|
+
enumerable: false
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(inst, "issues", {
|
|
10
|
+
value: def,
|
|
11
|
+
enumerable: false
|
|
12
|
+
});
|
|
13
|
+
inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
|
|
14
|
+
Object.defineProperty(inst, "toString", {
|
|
15
|
+
value: () => inst.message,
|
|
16
|
+
enumerable: false
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
const $ZodError = $constructor("$ZodError", initializer);
|
|
20
|
+
const $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
|
|
21
|
+
export {
|
|
22
|
+
$ZodError,
|
|
23
|
+
$ZodRealError
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sources":["../../../../../../../../../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/errors.js"],"sourcesContent":["import { $constructor } from \"./core.js\";\nimport * as util from \"./util.js\";\nconst initializer = (inst, def) => {\n inst.name = \"$ZodError\";\n Object.defineProperty(inst, \"_zod\", {\n value: inst._zod,\n enumerable: false,\n });\n Object.defineProperty(inst, \"issues\", {\n value: def,\n enumerable: false,\n });\n inst.message = JSON.stringify(def, util.jsonStringifyReplacer, 2);\n Object.defineProperty(inst, \"toString\", {\n value: () => inst.message,\n enumerable: false,\n });\n};\nexport const $ZodError = $constructor(\"$ZodError\", initializer);\nexport const $ZodRealError = $constructor(\"$ZodError\", initializer, { Parent: Error });\nexport function flattenError(error, mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of error.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n}\nexport function formatError(error, mapper = (issue) => issue.message) {\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n issue.errors.map((issues) => processError({ issues }));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues });\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues });\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(error);\n return fieldErrors;\n}\nexport function treeifyError(error, mapper = (issue) => issue.message) {\n const result = { errors: [] };\n const processError = (error, path = []) => {\n var _a, _b;\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n // regular union error\n issue.errors.map((issues) => processError({ issues }, issue.path));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n result.errors.push(mapper(issue));\n continue;\n }\n let curr = result;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n if (typeof el === \"string\") {\n curr.properties ?? (curr.properties = {});\n (_a = curr.properties)[el] ?? (_a[el] = { errors: [] });\n curr = curr.properties[el];\n }\n else {\n curr.items ?? (curr.items = []);\n (_b = curr.items)[el] ?? (_b[el] = { errors: [] });\n curr = curr.items[el];\n }\n if (terminal) {\n curr.errors.push(mapper(issue));\n }\n i++;\n }\n }\n }\n };\n processError(error);\n return result;\n}\n/** Format a ZodError as a human-readable string in the following form.\n *\n * From\n *\n * ```ts\n * ZodError {\n * issues: [\n * {\n * expected: 'string',\n * code: 'invalid_type',\n * path: [ 'username' ],\n * message: 'Invalid input: expected string'\n * },\n * {\n * expected: 'number',\n * code: 'invalid_type',\n * path: [ 'favoriteNumbers', 1 ],\n * message: 'Invalid input: expected number'\n * }\n * ];\n * }\n * ```\n *\n * to\n *\n * ```\n * username\n * ✖ Expected number, received string at \"username\n * favoriteNumbers[0]\n * ✖ Invalid input: expected number\n * ```\n */\nexport function toDotPath(_path) {\n const segs = [];\n const path = _path.map((seg) => (typeof seg === \"object\" ? seg.key : seg));\n for (const seg of path) {\n if (typeof seg === \"number\")\n segs.push(`[${seg}]`);\n else if (typeof seg === \"symbol\")\n segs.push(`[${JSON.stringify(String(seg))}]`);\n else if (/[^\\w$]/.test(seg))\n segs.push(`[${JSON.stringify(seg)}]`);\n else {\n if (segs.length)\n segs.push(\".\");\n segs.push(seg);\n }\n }\n return segs.join(\"\");\n}\nexport function prettifyError(error) {\n const lines = [];\n // sort by path length\n const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);\n // Process each issue\n for (const issue of issues) {\n lines.push(`✖ ${issue.message}`);\n if (issue.path?.length)\n lines.push(` → at ${toDotPath(issue.path)}`);\n }\n // Convert Map to formatted string\n return lines.join(\"\\n\");\n}\n"],"names":["util.jsonStringifyReplacer"],"mappings":";;AAEA,MAAM,cAAc,CAAC,MAAM,QAAQ;AAC/B,OAAK,OAAO;AACZ,SAAO,eAAe,MAAM,QAAQ;AAAA,IAChC,OAAO,KAAK;AAAA,IACZ,YAAY;AAAA,EACpB,CAAK;AACD,SAAO,eAAe,MAAM,UAAU;AAAA,IAClC,OAAO;AAAA,IACP,YAAY;AAAA,EACpB,CAAK;AACD,OAAK,UAAU,KAAK,UAAU,KAAKA,uBAA4B,CAAC;AAChE,SAAO,eAAe,MAAM,YAAY;AAAA,IACpC,OAAO,MAAM,KAAK;AAAA,IAClB,YAAY;AAAA,EACpB,CAAK;AACL;AACY,MAAC,YAAY,aAAa,aAAa,WAAW;AAClD,MAAC,gBAAgB,aAAa,aAAa,aAAa,EAAE,QAAQ,MAAK,CAAE;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { $ZodAsyncError, config } from "./core.js";
|
|
2
|
+
import { $ZodError, $ZodRealError } from "./errors.js";
|
|
3
|
+
import { finalizeIssue, captureStackTrace } from "./util.js";
|
|
4
|
+
const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
5
|
+
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
6
|
+
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
7
|
+
if (result instanceof Promise) {
|
|
8
|
+
throw new $ZodAsyncError();
|
|
9
|
+
}
|
|
10
|
+
if (result.issues.length) {
|
|
11
|
+
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
12
|
+
captureStackTrace(e, _params?.callee);
|
|
13
|
+
throw e;
|
|
14
|
+
}
|
|
15
|
+
return result.value;
|
|
16
|
+
};
|
|
17
|
+
const parse = /* @__PURE__ */ _parse($ZodRealError);
|
|
18
|
+
const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
19
|
+
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
20
|
+
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
21
|
+
if (result instanceof Promise)
|
|
22
|
+
result = await result;
|
|
23
|
+
if (result.issues.length) {
|
|
24
|
+
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
25
|
+
captureStackTrace(e, params?.callee);
|
|
26
|
+
throw e;
|
|
27
|
+
}
|
|
28
|
+
return result.value;
|
|
29
|
+
};
|
|
30
|
+
const parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
31
|
+
const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
32
|
+
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
33
|
+
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
34
|
+
if (result instanceof Promise) {
|
|
35
|
+
throw new $ZodAsyncError();
|
|
36
|
+
}
|
|
37
|
+
return result.issues.length ? {
|
|
38
|
+
success: false,
|
|
39
|
+
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
40
|
+
} : { success: true, data: result.value };
|
|
41
|
+
};
|
|
42
|
+
const safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
43
|
+
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
44
|
+
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
45
|
+
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
46
|
+
if (result instanceof Promise)
|
|
47
|
+
result = await result;
|
|
48
|
+
return result.issues.length ? {
|
|
49
|
+
success: false,
|
|
50
|
+
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
51
|
+
} : { success: true, data: result.value };
|
|
52
|
+
};
|
|
53
|
+
const safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
54
|
+
export {
|
|
55
|
+
_parse,
|
|
56
|
+
_parseAsync,
|
|
57
|
+
_safeParse,
|
|
58
|
+
_safeParseAsync,
|
|
59
|
+
parse,
|
|
60
|
+
parseAsync,
|
|
61
|
+
safeParse,
|
|
62
|
+
safeParseAsync
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=parse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.js","sources":["../../../../../../../../../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/parse.js"],"sourcesContent":["import * as core from \"./core.js\";\nimport * as errors from \"./errors.js\";\nimport * as util from \"./util.js\";\nexport const _parse = (_Err) => (schema, value, _ctx, _params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n if (result.issues.length) {\n const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, _params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);\nexport const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n if (result.issues.length) {\n const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);\nexport const _safeParse = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n return result.issues.length\n ? {\n success: false,\n error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);\nexport const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n return result.issues.length\n ? {\n success: false,\n error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);\nexport const _encode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _parse(_Err)(schema, value, ctx);\n};\nexport const encode = /* @__PURE__*/ _encode(errors.$ZodRealError);\nexport const _decode = (_Err) => (schema, value, _ctx) => {\n return _parse(_Err)(schema, value, _ctx);\n};\nexport const decode = /* @__PURE__*/ _decode(errors.$ZodRealError);\nexport const _encodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _parseAsync(_Err)(schema, value, ctx);\n};\nexport const encodeAsync = /* @__PURE__*/ _encodeAsync(errors.$ZodRealError);\nexport const _decodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _parseAsync(_Err)(schema, value, _ctx);\n};\nexport const decodeAsync = /* @__PURE__*/ _decodeAsync(errors.$ZodRealError);\nexport const _safeEncode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _safeParse(_Err)(schema, value, ctx);\n};\nexport const safeEncode = /* @__PURE__*/ _safeEncode(errors.$ZodRealError);\nexport const _safeDecode = (_Err) => (schema, value, _ctx) => {\n return _safeParse(_Err)(schema, value, _ctx);\n};\nexport const safeDecode = /* @__PURE__*/ _safeDecode(errors.$ZodRealError);\nexport const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _safeParseAsync(_Err)(schema, value, ctx);\n};\nexport const safeEncodeAsync = /* @__PURE__*/ _safeEncodeAsync(errors.$ZodRealError);\nexport const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _safeParseAsync(_Err)(schema, value, _ctx);\n};\nexport const safeDecodeAsync = /* @__PURE__*/ _safeDecodeAsync(errors.$ZodRealError);\n"],"names":["core.$ZodAsyncError","util.finalizeIssue","core.config","util.captureStackTrace","errors.$ZodRealError","errors.$ZodError"],"mappings":";;;AAGY,MAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,OAAO,MAAM,YAAY;AAC9D,QAAM,MAAM,OAAO,OAAO,OAAO,MAAM,EAAE,OAAO,MAAK,CAAE,IAAI,EAAE,OAAO,MAAK;AACzE,QAAM,SAAS,OAAO,KAAK,IAAI,EAAE,OAAO,QAAQ,GAAE,GAAI,GAAG;AACzD,MAAI,kBAAkB,SAAS;AAC3B,UAAM,IAAIA,eAAmB;AAAA,EACjC;AACA,MAAI,OAAO,OAAO,QAAQ;AACtB,UAAM,IAAI,KAAK,SAAS,OAAO,MAAM,OAAO,OAAO,IAAI,CAAC,QAAQC,cAAmB,KAAK,KAAKC,OAAW,CAAE,CAAC,CAAC;AAC5GC,sBAAuB,GAAG,SAAS,MAAM;AACzC,UAAM;AAAA,EACV;AACA,SAAO,OAAO;AAClB;AACY,MAAC,QAAuB,uBAAOC,aAAoB;AACnD,MAAC,cAAc,CAAC,SAAS,OAAO,QAAQ,OAAO,MAAM,WAAW;AACxE,QAAM,MAAM,OAAO,OAAO,OAAO,MAAM,EAAE,OAAO,KAAI,CAAE,IAAI,EAAE,OAAO,KAAI;AACvE,MAAI,SAAS,OAAO,KAAK,IAAI,EAAE,OAAO,QAAQ,GAAE,GAAI,GAAG;AACvD,MAAI,kBAAkB;AAClB,aAAS,MAAM;AACnB,MAAI,OAAO,OAAO,QAAQ;AACtB,UAAM,IAAI,KAAK,QAAQ,OAAO,MAAM,OAAO,OAAO,IAAI,CAAC,QAAQH,cAAmB,KAAK,KAAKC,OAAW,CAAE,CAAC,CAAC;AAC3GC,sBAAuB,GAAG,QAAQ,MAAM;AACxC,UAAM;AAAA,EACV;AACA,SAAO,OAAO;AAClB;AACY,MAAC,aAA4B,4BAAYC,aAAoB;AAC7D,MAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,OAAO,SAAS;AACzD,QAAM,MAAM,OAAO,EAAE,GAAG,MAAM,OAAO,MAAK,IAAK,EAAE,OAAO,MAAK;AAC7D,QAAM,SAAS,OAAO,KAAK,IAAI,EAAE,OAAO,QAAQ,GAAE,GAAI,GAAG;AACzD,MAAI,kBAAkB,SAAS;AAC3B,UAAM,IAAIJ,eAAmB;AAAA,EACjC;AACA,SAAO,OAAO,OAAO,SACf;AAAA,IACE,SAAS;AAAA,IACT,OAAO,KAAK,QAAQK,WAAkB,OAAO,OAAO,IAAI,CAAC,QAAQJ,cAAmB,KAAK,KAAKC,OAAW,CAAE,CAAC,CAAC;AAAA,EACzH,IACU,EAAE,SAAS,MAAM,MAAM,OAAO,MAAK;AAC7C;AACY,MAAC,YAA2B,2BAAWE,aAAoB;AAC3D,MAAC,kBAAkB,CAAC,SAAS,OAAO,QAAQ,OAAO,SAAS;AACpE,QAAM,MAAM,OAAO,OAAO,OAAO,MAAM,EAAE,OAAO,KAAI,CAAE,IAAI,EAAE,OAAO,KAAI;AACvE,MAAI,SAAS,OAAO,KAAK,IAAI,EAAE,OAAO,QAAQ,GAAE,GAAI,GAAG;AACvD,MAAI,kBAAkB;AAClB,aAAS,MAAM;AACnB,SAAO,OAAO,OAAO,SACf;AAAA,IACE,SAAS;AAAA,IACT,OAAO,IAAI,KAAK,OAAO,OAAO,IAAI,CAAC,QAAQH,cAAmB,KAAK,KAAKC,OAAW,CAAE,CAAC,CAAC;AAAA,EACnG,IACU,EAAE,SAAS,MAAM,MAAM,OAAO,MAAK;AAC7C;AACY,MAAC,iBAAgC,gCAAgBE,aAAoB;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regexes.js","sources":["../../../../../../../../../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/regexes.js"],"sourcesContent":["import * as util from \"./util.js\";\nexport const cuid = /^[cC][^\\s-]{8,}$/;\nexport const cuid2 = /^[0-9a-z]+$/;\nexport const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;\nexport const xid = /^[0-9a-vA-V]{20}$/;\nexport const ksuid = /^[A-Za-z0-9]{27}$/;\nexport const nanoid = /^[a-zA-Z0-9_-]{21}$/;\n/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */\nexport const duration = /^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/;\n/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */\nexport const extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */\nexport const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;\n/** Returns a regex for validating an RFC 9562/4122 UUID.\n *\n * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */\nexport const uuid = (version) => {\n if (!version)\n return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;\n return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);\n};\nexport const uuid4 = /*@__PURE__*/ uuid(4);\nexport const uuid6 = /*@__PURE__*/ uuid(6);\nexport const uuid7 = /*@__PURE__*/ uuid(7);\n/** Practical email validation */\nexport const email = /^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/;\n/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */\nexport const html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n/** The classic emailregex.com regex for RFC 5322-compliant emails */\nexport const rfc5322Email = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */\nexport const unicodeEmail = /^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u;\nexport const idnEmail = unicodeEmail;\nexport const browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emoji = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nexport function emoji() {\n return new RegExp(_emoji, \"u\");\n}\nexport const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nexport const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;\nexport const mac = (delimiter) => {\n const escapedDelim = util.escapeRegex(delimiter ?? \":\");\n return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);\n};\nexport const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$/;\nexport const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nexport const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;\nexport const base64url = /^[A-Za-z0-9_-]*$/;\n// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address\n// export const hostname: RegExp = /^([a-zA-Z0-9-]+\\.)*[a-zA-Z0-9-]+$/;\nexport const hostname = /^(?=.{1,253}\\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\\.?$/;\nexport const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/;\n// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)\n// E.164: leading digit must be 1-9; total digits (excluding '+') between 7-15\nexport const e164 = /^\\+[1-9]\\d{6,14}$/;\n// const dateSource = `((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))`;\nconst dateSource = `(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))`;\nexport const date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);\nfunction timeSource(args) {\n const hhmm = `(?:[01]\\\\d|2[0-3]):[0-5]\\\\d`;\n const regex = typeof args.precision === \"number\"\n ? args.precision === -1\n ? `${hhmm}`\n : args.precision === 0\n ? `${hhmm}:[0-5]\\\\d`\n : `${hhmm}:[0-5]\\\\d\\\\.\\\\d{${args.precision}}`\n : `${hhmm}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`;\n return regex;\n}\nexport function time(args) {\n return new RegExp(`^${timeSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetime(args) {\n const time = timeSource({ precision: args.precision });\n const opts = [\"Z\"];\n if (args.local)\n opts.push(\"\");\n // if (args.offset) opts.push(`([+-]\\\\d{2}:\\\\d{2})`);\n if (args.offset)\n opts.push(`([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)`);\n const timeRegex = `${time}(?:${opts.join(\"|\")})`;\n return new RegExp(`^${dateSource}T(?:${timeRegex})$`);\n}\nexport const string = (params) => {\n const regex = params ? `[\\\\s\\\\S]{${params?.minimum ?? 0},${params?.maximum ?? \"\"}}` : `[\\\\s\\\\S]*`;\n return new RegExp(`^${regex}$`);\n};\nexport const bigint = /^-?\\d+n?$/;\nexport const integer = /^-?\\d+$/;\nexport const number = /^-?\\d+(?:\\.\\d+)?$/;\nexport const boolean = /^(?:true|false)$/i;\nconst _null = /^null$/i;\nexport { _null as null };\nconst _undefined = /^undefined$/i;\nexport { _undefined as undefined };\n// regex for string with no uppercase letters\nexport const lowercase = /^[^A-Z]*$/;\n// regex for string with no lowercase letters\nexport const uppercase = /^[^a-z]*$/;\n// regex for hexadecimal strings (any length)\nexport const hex = /^[0-9a-fA-F]*$/;\n// Hash regexes for different algorithms and encodings\n// Helper function to create base64 regex with exact length and padding\nfunction fixedBase64(bodyLength, padding) {\n return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`);\n}\n// Helper function to create base64url regex with exact length (no padding)\nfunction fixedBase64url(length) {\n return new RegExp(`^[A-Za-z0-9_-]{${length}}$`);\n}\n// MD5 (16 bytes): base64 = 24 chars total (22 + \"==\")\nexport const md5_hex = /^[0-9a-fA-F]{32}$/;\nexport const md5_base64 = /*@__PURE__*/ fixedBase64(22, \"==\");\nexport const md5_base64url = /*@__PURE__*/ fixedBase64url(22);\n// SHA1 (20 bytes): base64 = 28 chars total (27 + \"=\")\nexport const sha1_hex = /^[0-9a-fA-F]{40}$/;\nexport const sha1_base64 = /*@__PURE__*/ fixedBase64(27, \"=\");\nexport const sha1_base64url = /*@__PURE__*/ fixedBase64url(27);\n// SHA256 (32 bytes): base64 = 44 chars total (43 + \"=\")\nexport const sha256_hex = /^[0-9a-fA-F]{64}$/;\nexport const sha256_base64 = /*@__PURE__*/ fixedBase64(43, \"=\");\nexport const sha256_base64url = /*@__PURE__*/ fixedBase64url(43);\n// SHA384 (48 bytes): base64 = 64 chars total (no padding)\nexport const sha384_hex = /^[0-9a-fA-F]{96}$/;\nexport const sha384_base64 = /*@__PURE__*/ fixedBase64(64, \"\");\nexport const sha384_base64url = /*@__PURE__*/ fixedBase64url(64);\n// SHA512 (64 bytes): base64 = 88 chars total (86 + \"==\")\nexport const sha512_hex = /^[0-9a-fA-F]{128}$/;\nexport const sha512_base64 = /*@__PURE__*/ fixedBase64(86, \"==\");\nexport const sha512_base64url = /*@__PURE__*/ fixedBase64url(86);\n"],"names":[],"mappings":"AAsFY,MAAC,SAAS,CAAC,WAAW;AAC9B,QAAM,QAAQ,SAAS,YAAY,QAAQ,WAAW,CAAC,IAAI,QAAQ,WAAW,EAAE,MAAM;AACtF,SAAO,IAAI,OAAO,IAAI,KAAK,GAAG;AAClC;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { $constructor, $ZodAsyncError } from "./core.js";
|
|
2
|
+
import { safeParse, safeParseAsync } from "./parse.js";
|
|
3
|
+
import { string } from "./regexes.js";
|
|
4
|
+
import { defineLazy, aborted, prefixIssues } from "./util.js";
|
|
5
|
+
import { clone } from "./util.js";
|
|
6
|
+
import { version } from "./versions.js";
|
|
7
|
+
const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
8
|
+
var _a;
|
|
9
|
+
inst ?? (inst = {});
|
|
10
|
+
inst._zod.def = def;
|
|
11
|
+
inst._zod.bag = inst._zod.bag || {};
|
|
12
|
+
inst._zod.version = version;
|
|
13
|
+
const checks = [...inst._zod.def.checks ?? []];
|
|
14
|
+
if (inst._zod.traits.has("$ZodCheck")) {
|
|
15
|
+
checks.unshift(inst);
|
|
16
|
+
}
|
|
17
|
+
for (const ch of checks) {
|
|
18
|
+
for (const fn of ch._zod.onattach) {
|
|
19
|
+
fn(inst);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (checks.length === 0) {
|
|
23
|
+
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
24
|
+
inst._zod.deferred?.push(() => {
|
|
25
|
+
inst._zod.run = inst._zod.parse;
|
|
26
|
+
});
|
|
27
|
+
} else {
|
|
28
|
+
const runChecks = (payload, checks2, ctx) => {
|
|
29
|
+
let isAborted = aborted(payload);
|
|
30
|
+
let asyncResult;
|
|
31
|
+
for (const ch of checks2) {
|
|
32
|
+
if (ch._zod.def.when) {
|
|
33
|
+
const shouldRun = ch._zod.def.when(payload);
|
|
34
|
+
if (!shouldRun)
|
|
35
|
+
continue;
|
|
36
|
+
} else if (isAborted) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const currLen = payload.issues.length;
|
|
40
|
+
const _ = ch._zod.check(payload);
|
|
41
|
+
if (_ instanceof Promise && ctx?.async === false) {
|
|
42
|
+
throw new $ZodAsyncError();
|
|
43
|
+
}
|
|
44
|
+
if (asyncResult || _ instanceof Promise) {
|
|
45
|
+
asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
46
|
+
await _;
|
|
47
|
+
const nextLen = payload.issues.length;
|
|
48
|
+
if (nextLen === currLen)
|
|
49
|
+
return;
|
|
50
|
+
if (!isAborted)
|
|
51
|
+
isAborted = aborted(payload, currLen);
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
const nextLen = payload.issues.length;
|
|
55
|
+
if (nextLen === currLen)
|
|
56
|
+
continue;
|
|
57
|
+
if (!isAborted)
|
|
58
|
+
isAborted = aborted(payload, currLen);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (asyncResult) {
|
|
62
|
+
return asyncResult.then(() => {
|
|
63
|
+
return payload;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return payload;
|
|
67
|
+
};
|
|
68
|
+
const handleCanaryResult = (canary, payload, ctx) => {
|
|
69
|
+
if (aborted(canary)) {
|
|
70
|
+
canary.aborted = true;
|
|
71
|
+
return canary;
|
|
72
|
+
}
|
|
73
|
+
const checkResult = runChecks(payload, checks, ctx);
|
|
74
|
+
if (checkResult instanceof Promise) {
|
|
75
|
+
if (ctx.async === false)
|
|
76
|
+
throw new $ZodAsyncError();
|
|
77
|
+
return checkResult.then((checkResult2) => inst._zod.parse(checkResult2, ctx));
|
|
78
|
+
}
|
|
79
|
+
return inst._zod.parse(checkResult, ctx);
|
|
80
|
+
};
|
|
81
|
+
inst._zod.run = (payload, ctx) => {
|
|
82
|
+
if (ctx.skipChecks) {
|
|
83
|
+
return inst._zod.parse(payload, ctx);
|
|
84
|
+
}
|
|
85
|
+
if (ctx.direction === "backward") {
|
|
86
|
+
const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
|
|
87
|
+
if (canary instanceof Promise) {
|
|
88
|
+
return canary.then((canary2) => {
|
|
89
|
+
return handleCanaryResult(canary2, payload, ctx);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return handleCanaryResult(canary, payload, ctx);
|
|
93
|
+
}
|
|
94
|
+
const result = inst._zod.parse(payload, ctx);
|
|
95
|
+
if (result instanceof Promise) {
|
|
96
|
+
if (ctx.async === false)
|
|
97
|
+
throw new $ZodAsyncError();
|
|
98
|
+
return result.then((result2) => runChecks(result2, checks, ctx));
|
|
99
|
+
}
|
|
100
|
+
return runChecks(result, checks, ctx);
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
defineLazy(inst, "~standard", () => ({
|
|
104
|
+
validate: (value) => {
|
|
105
|
+
try {
|
|
106
|
+
const r = safeParse(inst, value);
|
|
107
|
+
return r.success ? { value: r.data } : { issues: r.error?.issues };
|
|
108
|
+
} catch (_) {
|
|
109
|
+
return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
vendor: "zod",
|
|
113
|
+
version: 1
|
|
114
|
+
}));
|
|
115
|
+
});
|
|
116
|
+
const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
117
|
+
$ZodType.init(inst, def);
|
|
118
|
+
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
|
|
119
|
+
inst._zod.parse = (payload, _) => {
|
|
120
|
+
if (def.coerce)
|
|
121
|
+
try {
|
|
122
|
+
payload.value = String(payload.value);
|
|
123
|
+
} catch (_2) {
|
|
124
|
+
}
|
|
125
|
+
if (typeof payload.value === "string")
|
|
126
|
+
return payload;
|
|
127
|
+
payload.issues.push({
|
|
128
|
+
expected: "string",
|
|
129
|
+
code: "invalid_type",
|
|
130
|
+
input: payload.value,
|
|
131
|
+
inst
|
|
132
|
+
});
|
|
133
|
+
return payload;
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
function handleArrayResult(result, final, index) {
|
|
137
|
+
if (result.issues.length) {
|
|
138
|
+
final.issues.push(...prefixIssues(index, result.issues));
|
|
139
|
+
}
|
|
140
|
+
final.value[index] = result.value;
|
|
141
|
+
}
|
|
142
|
+
const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
143
|
+
$ZodType.init(inst, def);
|
|
144
|
+
inst._zod.parse = (payload, ctx) => {
|
|
145
|
+
const input = payload.value;
|
|
146
|
+
if (!Array.isArray(input)) {
|
|
147
|
+
payload.issues.push({
|
|
148
|
+
expected: "array",
|
|
149
|
+
code: "invalid_type",
|
|
150
|
+
input,
|
|
151
|
+
inst
|
|
152
|
+
});
|
|
153
|
+
return payload;
|
|
154
|
+
}
|
|
155
|
+
payload.value = Array(input.length);
|
|
156
|
+
const proms = [];
|
|
157
|
+
for (let i = 0; i < input.length; i++) {
|
|
158
|
+
const item = input[i];
|
|
159
|
+
const result = def.element._zod.run({
|
|
160
|
+
value: item,
|
|
161
|
+
issues: []
|
|
162
|
+
}, ctx);
|
|
163
|
+
if (result instanceof Promise) {
|
|
164
|
+
proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
|
|
165
|
+
} else {
|
|
166
|
+
handleArrayResult(result, payload, i);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (proms.length) {
|
|
170
|
+
return Promise.all(proms).then(() => payload);
|
|
171
|
+
}
|
|
172
|
+
return payload;
|
|
173
|
+
};
|
|
174
|
+
});
|
|
175
|
+
export {
|
|
176
|
+
$ZodArray,
|
|
177
|
+
$ZodString,
|
|
178
|
+
$ZodType,
|
|
179
|
+
clone
|
|
180
|
+
};
|
|
181
|
+
//# sourceMappingURL=schemas.js.map
|