{"version":3,"file":"dist-twPJIvYf.cjs","names":[],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@valibot/to-json-schema/1.7.0/b36fad4bd6524f21cfe585b3ac241b359a9e7ea8ac877b85e25b3da705437e48/node_modules/@valibot/to-json-schema/dist/index.mjs"],"sourcesContent":["//#region src/utils/addError.ts\n/**\n* Adds an error message to the errors array.\n*\n* @param errors The array of error messages.\n* @param message The error message to add.\n*\n* @returns The new errors.\n*/\nfunction addError(errors, message) {\n\tif (errors) {\n\t\terrors.push(message);\n\t\treturn errors;\n\t}\n\treturn [message];\n}\n\n//#endregion\n//#region src/utils/escapeRegExp.ts\nconst ESCAPE_REGEX = /[.*+?^${}()|[\\]\\\\]/g;\n/**\n* Escapes special regex characters in a string.\n*\n* @param string The string to escape.\n*\n* @returns The escaped string.\n*/\nfunction escapeRegExp(string) {\n\treturn string.replace(ESCAPE_REGEX, \"\\\\$&\");\n}\n\n//#endregion\n//#region src/utils/handleError.ts\n/**\n* Throws an error or logs a warning based on the configuration.\n*\n* @param message The message to throw or log.\n* @param config The conversion configuration.\n*/\nfunction handleError(message, config) {\n\tswitch (config?.errorMode) {\n\t\tcase \"ignore\": break;\n\t\tcase \"warn\":\n\t\t\tconsole.warn(message);\n\t\t\tbreak;\n\t\tdefault: throw new Error(message);\n\t}\n}\n\n//#endregion\n//#region src/utils/isJsonConstValue.ts\n/**\n* Whether a value is JSON compatible for a const keyword.\n*\n* @param value The value to check.\n*\n* @returns Whether the value is JSON compatible.\n*/\nfunction isJsonConstValue(value) {\n\treturn typeof value === \"boolean\" || typeof value === \"number\" && Number.isFinite(value) || typeof value === \"string\";\n}\n\n//#endregion\n//#region src/utils/isJsonEnumValues.ts\n/**\n* Whether values are JSON compatible for an enum keyword.\n*\n* @param values The values to check.\n*\n* @returns Whether the values are JSON compatible.\n*/\nfunction isJsonEnumValues(values) {\n\treturn values.every(isJsonConstValue);\n}\n\n//#endregion\n//#region src/converters/convertAction/convertAction.ts\n/**\n* Converts any supported Valibot action to the JSON Schema format.\n*\n* @param jsonSchema The JSON Schema object.\n* @param valibotAction The Valibot action object.\n* @param config The conversion configuration.\n*\n* @returns The converted JSON Schema.\n*/\nfunction convertAction(jsonSchema, valibotAction, config) {\n\tif (config?.ignoreActions?.includes(valibotAction.type)) return jsonSchema;\n\tlet errors;\n\tswitch (valibotAction.type) {\n\t\tcase \"base64\":\n\t\t\tjsonSchema.contentEncoding = \"base64\";\n\t\t\tbreak;\n\t\tcase \"bic\":\n\t\tcase \"cuid2\":\n\t\tcase \"decimal\":\n\t\tcase \"digits\":\n\t\tcase \"domain\":\n\t\tcase \"emoji\":\n\t\tcase \"hash\":\n\t\tcase \"hexadecimal\":\n\t\tcase \"hex_color\":\n\t\tcase \"isrc\":\n\t\tcase \"iso_time_second\":\n\t\tcase \"iso_week\":\n\t\tcase \"mac\":\n\t\tcase \"mac48\":\n\t\tcase \"mac64\":\n\t\tcase \"nanoid\":\n\t\tcase \"octal\":\n\t\tcase \"slug\":\n\t\tcase \"ulid\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"description\":\n\t\t\tjsonSchema.description = valibotAction.description;\n\t\t\tbreak;\n\t\tcase \"email\":\n\t\tcase \"rfc_email\":\n\t\t\tjsonSchema.format = \"email\";\n\t\t\tbreak;\n\t\tcase \"ends_with\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = `${escapeRegExp(valibotAction.requirement)}$`;\n\t\t\tbreak;\n\t\tcase \"empty\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.maxItems = 0;\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.maxLength = 0;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"entries\":\n\t\t\tjsonSchema.minProperties = valibotAction.requirement;\n\t\t\tjsonSchema.maxProperties = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"examples\":\n\t\t\tif (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.examples];\n\t\t\telse jsonSchema.examples = valibotAction.examples;\n\t\t\tbreak;\n\t\tcase \"gt_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") errors = addError(errors, `The \"gt_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\terrors = addError(errors, \"The \\\"gt_value\\\" action is not supported for OpenAPI 3.0.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.exclusiveMinimum = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"includes\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = escapeRegExp(valibotAction.requirement);\n\t\t\tbreak;\n\t\tcase \"integer\":\n\t\t\tjsonSchema.type = \"integer\";\n\t\t\tbreak;\n\t\tcase \"ipv4\":\n\t\t\tjsonSchema.format = \"ipv4\";\n\t\t\tbreak;\n\t\tcase \"ipv6\":\n\t\t\tjsonSchema.format = \"ipv6\";\n\t\t\tbreak;\n\t\tcase \"iso_date\":\n\t\t\tjsonSchema.format = \"date\";\n\t\t\tbreak;\n\t\tcase \"iso_date_time\":\n\t\tcase \"iso_timestamp\":\n\t\t\tjsonSchema.format = \"date-time\";\n\t\t\tbreak;\n\t\tcase \"iso_time\":\n\t\t\tjsonSchema.format = \"time\";\n\t\t\tbreak;\n\t\tcase \"jws_compact\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"length\":\n\t\t\tif (jsonSchema.type === \"array\") {\n\t\t\t\tjsonSchema.minItems = valibotAction.requirement;\n\t\t\t\tjsonSchema.maxItems = valibotAction.requirement;\n\t\t\t} else {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = valibotAction.requirement;\n\t\t\t\tjsonSchema.maxLength = valibotAction.requirement;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"lt_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") errors = addError(errors, `The \"lt_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\terrors = addError(errors, \"The \\\"lt_value\\\" action is not supported for OpenAPI 3.0.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.exclusiveMaximum = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"max_entries\":\n\t\t\tjsonSchema.maxProperties = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"max_length\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.maxItems = valibotAction.requirement;\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.maxLength = valibotAction.requirement;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"max_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") errors = addError(errors, `The \"max_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\tjsonSchema.maximum = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"metadata\":\n\t\t\tif (typeof valibotAction.metadata.title === \"string\") jsonSchema.title = valibotAction.metadata.title;\n\t\t\tif (typeof valibotAction.metadata.description === \"string\") jsonSchema.description = valibotAction.metadata.description;\n\t\t\tif (Array.isArray(valibotAction.metadata.examples)) if (Array.isArray(jsonSchema.examples)) jsonSchema.examples = [...jsonSchema.examples, ...valibotAction.metadata.examples];\n\t\t\telse jsonSchema.examples = valibotAction.metadata.examples;\n\t\t\tbreak;\n\t\tcase \"min_entries\":\n\t\t\tjsonSchema.minProperties = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"min_length\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.minItems = valibotAction.requirement;\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = valibotAction.requirement;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"min_value\":\n\t\t\tif (jsonSchema.type !== \"number\" && jsonSchema.type !== \"integer\") errors = addError(errors, `The \"min_value\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\tjsonSchema.minimum = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"multiple_of\":\n\t\t\tjsonSchema.multipleOf = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"non_empty\":\n\t\t\tif (jsonSchema.type === \"array\") jsonSchema.minItems = 1;\n\t\t\telse {\n\t\t\t\tif (jsonSchema.type !== \"string\") errors = addError(errors, `The \"${valibotAction.type}\" action is not supported on type \"${jsonSchema.type}\".`);\n\t\t\t\tjsonSchema.minLength = 1;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"not_value\":\n\t\t\tif (!isJsonConstValue(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"not_value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.not = { enum: [valibotAction.requirement] };\n\t\t\telse jsonSchema.not = { const: valibotAction.requirement };\n\t\t\tbreak;\n\t\tcase \"not_values\":\n\t\t\tif (!isJsonEnumValues(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"A requirement of the \\\"not_values\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.not = { enum: valibotAction.requirement };\n\t\t\tbreak;\n\t\tcase \"regex\":\n\t\t\tif (valibotAction.requirement.flags) errors = addError(errors, \"RegExp flags are not supported by JSON Schema.\");\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = valibotAction.requirement.source;\n\t\t\tbreak;\n\t\tcase \"safe_integer\":\n\t\t\tjsonSchema.type = \"integer\";\n\t\t\tif (typeof jsonSchema.minimum !== \"number\" || jsonSchema.minimum < Number.MIN_SAFE_INTEGER) jsonSchema.minimum = Number.MIN_SAFE_INTEGER;\n\t\t\tif (typeof jsonSchema.maximum !== \"number\" || jsonSchema.maximum > Number.MAX_SAFE_INTEGER) jsonSchema.maximum = Number.MAX_SAFE_INTEGER;\n\t\t\tbreak;\n\t\tcase \"starts_with\":\n\t\t\tif (jsonSchema.pattern) errors = addError(errors, `The \"${valibotAction.type}\" action is not supported in combination with another regex action.`);\n\t\t\telse jsonSchema.pattern = `^${escapeRegExp(valibotAction.requirement)}`;\n\t\t\tbreak;\n\t\tcase \"title\":\n\t\t\tjsonSchema.title = valibotAction.title;\n\t\t\tbreak;\n\t\tcase \"url\":\n\t\t\tjsonSchema.format = \"uri\";\n\t\t\tbreak;\n\t\tcase \"uuid\":\n\t\t\tjsonSchema.format = \"uuid\";\n\t\t\tbreak;\n\t\tcase \"value\":\n\t\t\tif (!isJsonConstValue(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"The requirement of the \\\"value\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.enum = [valibotAction.requirement];\n\t\t\telse jsonSchema.const = valibotAction.requirement;\n\t\t\tbreak;\n\t\tcase \"values\":\n\t\t\tif (!isJsonEnumValues(valibotAction.requirement)) {\n\t\t\t\terrors = addError(errors, \"A requirement of the \\\"values\\\" action is not JSON compatible.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tjsonSchema.enum = valibotAction.requirement;\n\t\t\tbreak;\n\t\tdefault: errors = addError(errors, `The \"${valibotAction.type}\" action cannot be converted to JSON Schema.`);\n\t}\n\tif (config?.overrideAction) {\n\t\tconst actionOverride = config.overrideAction({\n\t\t\tvalibotAction,\n\t\t\tjsonSchema,\n\t\t\terrors\n\t\t});\n\t\tif (actionOverride) return { ...actionOverride };\n\t}\n\tif (errors) for (const message of errors) handleError(message, config);\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/converters/convertSchema/convertSchema.ts\n/**\n* Flattens a Valibot pipe by recursively expanding nested pipes.\n*\n* @param pipe The pipeline to flatten.\n*\n* @returns A flat pipeline.\n*/\nfunction flattenPipe(pipe) {\n\treturn pipe.flatMap((item) => \"pipe\" in item ? flattenPipe(item.pipe) : item);\n}\nlet refCount = 0;\n/**\n* Converts any supported Valibot schema to the JSON Schema format.\n*\n* @param jsonSchema The JSON Schema object.\n* @param valibotSchema The Valibot schema object.\n* @param config The conversion configuration.\n* @param context The conversion context.\n* @param skipRef Whether to skip using a reference.\n*\n* @returns The converted JSON Schema.\n*/\nfunction convertSchema(jsonSchema, valibotSchema, config, context, skipRef = false) {\n\tif (!skipRef) {\n\t\tconst referenceId = context.referenceMap.get(valibotSchema);\n\t\tif (referenceId) {\n\t\t\tjsonSchema.$ref = `#/$defs/${referenceId}`;\n\t\t\tif (config?.overrideRef) {\n\t\t\t\tconst refOverride = config.overrideRef({\n\t\t\t\t\t...context,\n\t\t\t\t\treferenceId,\n\t\t\t\t\tvalibotSchema,\n\t\t\t\t\tjsonSchema\n\t\t\t\t});\n\t\t\t\tif (refOverride) jsonSchema.$ref = refOverride;\n\t\t\t}\n\t\t\treturn jsonSchema;\n\t\t}\n\t}\n\tif (\"pipe\" in valibotSchema) {\n\t\tconst flatPipe = flattenPipe(valibotSchema.pipe);\n\t\tlet startIndex = 0;\n\t\tlet stopIndex = flatPipe.length - 1;\n\t\tif (config?.typeMode === \"input\") {\n\t\t\tconst inputStopIndex = flatPipe.slice(1).findIndex((item) => item.kind === \"schema\" || item.kind === \"transformation\" && (item.type === \"find_item\" || item.type === \"parse_json\" || item.type === \"raw_transform\" || item.type === \"reduce_items\" || item.type === \"stringify_json\" || item.type === \"to_bigint\" || item.type === \"to_boolean\" || item.type === \"to_date\" || item.type === \"to_number\" || item.type === \"to_string\" || item.type === \"transform\"));\n\t\t\tif (inputStopIndex !== -1) stopIndex = inputStopIndex;\n\t\t} else if (config?.typeMode === \"output\") {\n\t\t\tconst outputStartIndex = flatPipe.findLastIndex((item) => item.kind === \"schema\");\n\t\t\tif (outputStartIndex !== -1) startIndex = outputStartIndex;\n\t\t}\n\t\tfor (let index = startIndex; index <= stopIndex; index++) {\n\t\t\tconst valibotPipeItem = flatPipe[index];\n\t\t\tif (valibotPipeItem.kind === \"schema\") {\n\t\t\t\tif (index > startIndex) handleError(\"Set the \\\"typeMode\\\" config to \\\"input\\\" or \\\"output\\\" to convert pipelines with multiple schemas.\", config);\n\t\t\t\tjsonSchema = convertSchema(jsonSchema, valibotPipeItem, config, context, true);\n\t\t\t} else jsonSchema = convertAction(jsonSchema, valibotPipeItem, config);\n\t\t}\n\t\treturn jsonSchema;\n\t}\n\tlet errors;\n\tswitch (valibotSchema.type) {\n\t\tcase \"boolean\":\n\t\t\tjsonSchema.type = \"boolean\";\n\t\t\tbreak;\n\t\tcase \"null\":\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.enum = [null];\n\t\t\telse jsonSchema.type = \"null\";\n\t\t\tbreak;\n\t\tcase \"number\":\n\t\t\tjsonSchema.type = \"number\";\n\t\t\tbreak;\n\t\tcase \"string\":\n\t\t\tjsonSchema.type = \"string\";\n\t\t\tbreak;\n\t\tcase \"array\":\n\t\t\tjsonSchema.type = \"array\";\n\t\t\tjsonSchema.items = convertSchema({}, valibotSchema.item, config, context);\n\t\t\tbreak;\n\t\tcase \"tuple\":\n\t\tcase \"tuple_with_rest\":\n\t\tcase \"loose_tuple\":\n\t\tcase \"strict_tuple\":\n\t\t\tjsonSchema.type = \"array\";\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\tjsonSchema.items = { anyOf: [] };\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.items.anyOf.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.items.anyOf.push(convertSchema({}, valibotSchema.rest, config, context));\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\" || valibotSchema.type === \"tuple\") jsonSchema.maxItems = valibotSchema.items.length;\n\t\t\t} else if (config?.target === \"draft-2020-12\") {\n\t\t\t\tjsonSchema.prefixItems = [];\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.prefixItems.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.items = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\") jsonSchema.items = false;\n\t\t\t} else {\n\t\t\t\tjsonSchema.items = [];\n\t\t\t\tjsonSchema.minItems = valibotSchema.items.length;\n\t\t\t\tfor (const item of valibotSchema.items) jsonSchema.items.push(convertSchema({}, item, config, context));\n\t\t\t\tif (valibotSchema.type === \"tuple_with_rest\") jsonSchema.additionalItems = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\t\telse if (valibotSchema.type === \"strict_tuple\") jsonSchema.additionalItems = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"object\":\n\t\tcase \"object_with_rest\":\n\t\tcase \"loose_object\":\n\t\tcase \"strict_object\":\n\t\t\tjsonSchema.type = \"object\";\n\t\t\tjsonSchema.properties = {};\n\t\t\tjsonSchema.required = [];\n\t\t\tfor (const key in valibotSchema.entries) {\n\t\t\t\tconst entry = valibotSchema.entries[key];\n\t\t\t\tjsonSchema.properties[key] = convertSchema({}, entry, config, context);\n\t\t\t\tif (entry.type !== \"exact_optional\" && entry.type !== \"nullish\" && entry.type !== \"optional\") jsonSchema.required.push(key);\n\t\t\t}\n\t\t\tif (valibotSchema.type === \"object_with_rest\") jsonSchema.additionalProperties = convertSchema({}, valibotSchema.rest, config, context);\n\t\t\telse if (valibotSchema.type === \"strict_object\") jsonSchema.additionalProperties = false;\n\t\t\tbreak;\n\t\tcase \"record\":\n\t\t\tif (config?.target === \"openapi-3.0\" && \"pipe\" in valibotSchema.key) errors = addError(errors, \"The \\\"record\\\" schema with a schema for the key that contains a \\\"pipe\\\" cannot be converted to JSON Schema.\");\n\t\t\tif (valibotSchema.key.type !== \"string\") errors = addError(errors, `The \"record\" schema with the \"${valibotSchema.key.type}\" schema for the key cannot be converted to JSON Schema.`);\n\t\t\tjsonSchema.type = \"object\";\n\t\t\tif (config?.target !== \"openapi-3.0\") jsonSchema.propertyNames = convertSchema({}, valibotSchema.key, config, context);\n\t\t\tjsonSchema.additionalProperties = convertSchema({}, valibotSchema.value, config, context);\n\t\t\tbreak;\n\t\tcase \"any\":\n\t\tcase \"unknown\": break;\n\t\tcase \"never\":\n\t\t\tjsonSchema.not = {};\n\t\t\tbreak;\n\t\tcase \"nullable\":\n\t\tcase \"nullish\":\n\t\t\tif (config?.target === \"openapi-3.0\") {\n\t\t\t\tconst innerSchema = convertSchema({}, valibotSchema.wrapped, config, context);\n\t\t\t\tObject.assign(jsonSchema, innerSchema);\n\t\t\t\tjsonSchema.nullable = true;\n\t\t\t} else jsonSchema.anyOf = [convertSchema({}, valibotSchema.wrapped, config, context), { type: \"null\" }];\n\t\t\tif (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === \"function\" ? valibotSchema.default() : valibotSchema.default;\n\t\t\tbreak;\n\t\tcase \"exact_optional\":\n\t\tcase \"optional\":\n\t\tcase \"undefinedable\":\n\t\t\tjsonSchema = convertSchema(jsonSchema, valibotSchema.wrapped, config, context);\n\t\t\tif (valibotSchema.default !== void 0) jsonSchema.default = typeof valibotSchema.default === \"function\" ? valibotSchema.default() : valibotSchema.default;\n\t\t\tbreak;\n\t\tcase \"literal\":\n\t\t\tif (typeof valibotSchema.literal !== \"boolean\" && typeof valibotSchema.literal !== \"number\" && typeof valibotSchema.literal !== \"string\") errors = addError(errors, \"The value of the \\\"literal\\\" schema is not JSON compatible.\");\n\t\t\tif (config?.target === \"openapi-3.0\") jsonSchema.enum = [valibotSchema.literal];\n\t\t\telse jsonSchema.const = valibotSchema.literal;\n\t\t\tbreak;\n\t\tcase \"enum\":\n\t\t\tjsonSchema.enum = valibotSchema.options;\n\t\t\tif (valibotSchema.options.every((option) => typeof option === \"string\")) jsonSchema.type = \"string\";\n\t\t\telse if (valibotSchema.options.every((option) => typeof option === \"number\")) jsonSchema.type = \"number\";\n\t\t\telse if (config?.target !== \"openapi-3.0\") jsonSchema.type = [\"string\", \"number\"];\n\t\t\tbreak;\n\t\tcase \"picklist\": {\n\t\t\tconst hasInvalidOption = valibotSchema.options.some((option) => typeof option !== \"number\" && typeof option !== \"string\");\n\t\t\tif (hasInvalidOption) errors = addError(errors, \"An option of the \\\"picklist\\\" schema is not JSON compatible.\");\n\t\t\tjsonSchema.enum = valibotSchema.options;\n\t\t\tif (valibotSchema.options.every((option) => typeof option === \"string\")) jsonSchema.type = \"string\";\n\t\t\telse if (valibotSchema.options.every((option) => typeof option === \"number\")) jsonSchema.type = \"number\";\n\t\t\telse if (!hasInvalidOption && config?.target !== \"openapi-3.0\") jsonSchema.type = [\"string\", \"number\"];\n\t\t\tbreak;\n\t\t}\n\t\tcase \"union\":\n\t\t\tjsonSchema.anyOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"variant\":\n\t\t\tjsonSchema.oneOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"intersect\":\n\t\t\tjsonSchema.allOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));\n\t\t\tbreak;\n\t\tcase \"lazy\": {\n\t\t\tlet wrappedValibotSchema = context.getterMap.get(valibotSchema.getter);\n\t\t\tif (!wrappedValibotSchema) {\n\t\t\t\twrappedValibotSchema = valibotSchema.getter(void 0);\n\t\t\t\tcontext.getterMap.set(valibotSchema.getter, wrappedValibotSchema);\n\t\t\t}\n\t\t\tlet referenceId = context.referenceMap.get(wrappedValibotSchema);\n\t\t\tif (!referenceId) {\n\t\t\t\treferenceId = `${refCount++}`;\n\t\t\t\tcontext.referenceMap.set(wrappedValibotSchema, referenceId);\n\t\t\t\tcontext.definitions[referenceId] = convertSchema({}, wrappedValibotSchema, config, context, true);\n\t\t\t}\n\t\t\tjsonSchema.$ref = `#/$defs/${referenceId}`;\n\t\t\tif (config?.overrideRef) {\n\t\t\t\tconst refOverride = config.overrideRef({\n\t\t\t\t\t...context,\n\t\t\t\t\treferenceId,\n\t\t\t\t\tvalibotSchema: wrappedValibotSchema,\n\t\t\t\t\tjsonSchema\n\t\t\t\t});\n\t\t\t\tif (refOverride) jsonSchema.$ref = refOverride;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault: errors = addError(errors, `The \"${valibotSchema.type}\" schema cannot be converted to JSON Schema.`);\n\t}\n\tif (config?.overrideSchema) {\n\t\tconst schemaOverride = config.overrideSchema({\n\t\t\t...context,\n\t\t\treferenceId: context.referenceMap.get(valibotSchema),\n\t\t\tvalibotSchema,\n\t\t\tjsonSchema,\n\t\t\terrors\n\t\t});\n\t\tif (schemaOverride) return { ...schemaOverride };\n\t}\n\tif (errors) for (const message of errors) handleError(message, config);\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/storages/globalDefs/globalDefs.ts\nlet store;\n/**\n* Adds new definitions to the global schema definitions.\n*\n* @param definitions The schema definitions.\n*\n* @beta\n*/\nfunction addGlobalDefs(definitions) {\n\tstore = {\n\t\t...store ?? {},\n\t\t...definitions\n\t};\n}\n/**\n* Returns the current global schema definitions.\n*\n* @returns The schema definitions.\n*\n* @beta\n*/\nfunction getGlobalDefs() {\n\treturn store;\n}\n\n//#endregion\n//#region src/functions/toJsonSchema/toJsonSchema.ts\n/**\n* Converts a Valibot schema to the JSON Schema format.\n*\n* @param schema The Valibot schema object.\n* @param config The JSON Schema configuration.\n*\n* @returns The converted JSON Schema.\n*/\nfunction toJsonSchema(schema, config) {\n\tconst context = {\n\t\tdefinitions: {},\n\t\treferenceMap: /* @__PURE__ */ new Map(),\n\t\tgetterMap: /* @__PURE__ */ new Map()\n\t};\n\tconst definitions = config?.definitions ?? getGlobalDefs();\n\tif (definitions) {\n\t\tfor (const key in definitions) context.referenceMap.set(definitions[key], key);\n\t\tfor (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);\n\t}\n\tconst jsonSchema = convertSchema({}, schema, config, context);\n\tconst target = config?.target ?? \"draft-07\";\n\tif (target === \"draft-2020-12\") jsonSchema.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n\telse if (target === \"draft-07\") jsonSchema.$schema = \"http://json-schema.org/draft-07/schema#\";\n\tif (context.referenceMap.size) jsonSchema.$defs = context.definitions;\n\treturn jsonSchema;\n}\n\n//#endregion\n//#region src/functions/toJsonSchemaDefs/toJsonSchemaDefs.ts\n/**\n* Converts Valibot schema definitions to JSON Schema definitions.\n*\n* @param definitions The Valibot schema definitions.\n* @param config The JSON Schema configuration.\n*\n* @returns The converted JSON Schema definitions.\n*/\nfunction toJsonSchemaDefs(definitions, config) {\n\tconst context = {\n\t\tdefinitions: {},\n\t\treferenceMap: /* @__PURE__ */ new Map(),\n\t\tgetterMap: /* @__PURE__ */ new Map()\n\t};\n\tfor (const key in definitions) context.referenceMap.set(definitions[key], key);\n\tfor (const key in definitions) context.definitions[key] = convertSchema({}, definitions[key], config, context, true);\n\treturn context.definitions;\n}\n\n//#endregion\n//#region src/functions/toStandardJsonSchema/toStandardJsonSchema.ts\nconst SUPPORTED_TARGETS = [\n\t\"draft-07\",\n\t\"draft-2020-12\",\n\t\"openapi-3.0\"\n];\n/**\n* Converts a Valibot schema to the Standard JSON Schema format.\n*\n* @param schema The Valibot schema object.\n*\n* @returns The Standard JSON Schema.\n*/\nfunction toStandardJsonSchema(schema) {\n\treturn { \"~standard\": {\n\t\t...schema[\"~standard\"],\n\t\tjsonSchema: {\n\t\t\tinput(options) {\n\t\t\t\tif (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {\n\t\t\t\t\ttypeMode: \"input\",\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\t...options.libraryOptions\n\t\t\t\t});\n\t\t\t\tthrow new Error(`Unsupported target: ${options.target}`);\n\t\t\t},\n\t\t\toutput(options) {\n\t\t\t\tif (SUPPORTED_TARGETS.includes(options.target)) return toJsonSchema(schema, {\n\t\t\t\t\ttypeMode: \"output\",\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\t...options.libraryOptions\n\t\t\t\t});\n\t\t\t\tthrow new Error(`Unsupported target: ${options.target}`);\n\t\t\t}\n\t\t}\n\t} };\n}\n\n//#endregion\nexport { addGlobalDefs, getGlobalDefs, toJsonSchema, toJsonSchemaDefs, toStandardJsonSchema };"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AASA,SAAS,SAAS,QAAQ,SAAS;CAClC,IAAI,QAAQ;EACX,OAAO,KAAK,OAAO;EACnB,OAAO;CACR;CACA,OAAO,CAAC,OAAO;AAChB;AAIA,MAAM,eAAe;;;;;;;;AAQrB,SAAS,aAAa,QAAQ;CAC7B,OAAO,OAAO,QAAQ,cAAc,MAAM;AAC3C;;;;;;;AAUA,SAAS,YAAY,SAAS,QAAQ;CACrC,QAAQ,QAAQ,WAAhB;EACC,KAAK,UAAU;EACf,KAAK;GAC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