const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
const require_core = require('../core/core.cjs');
const require_util = require('../core/util.cjs');
const require_schemas = require('../core/schemas.cjs');
const require_registries = require('../core/registries.cjs');
const require_api = require('../core/api.cjs');
const require_iso = require('./iso.cjs');
const require_parse = require('./parse.cjs');

//#region ../../node_modules/zod/v4/classic/schemas.js
const ZodType = /* @__PURE__ */ require_core.$constructor("ZodType", (inst, def) => {
	require_schemas.$ZodType.init(inst, def);
	inst.def = def;
	inst.type = def.type;
	Object.defineProperty(inst, "_def", { value: def });
	inst.check = (...checks) => {
		return inst.clone(require_util.mergeDefs(def, { checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
			check: ch,
			def: { check: "custom" },
			onattach: []
		} } : ch)] }));
	};
	inst.clone = (def$1, params) => require_util.clone(inst, def$1, params);
	inst.brand = () => inst;
	inst.register = ((reg, meta) => {
		reg.add(inst, meta);
		return inst;
	});
	inst.parse = (data, params) => require_parse.parse(inst, data, params, { callee: inst.parse });
	inst.safeParse = (data, params) => require_parse.safeParse(inst, data, params);
	inst.parseAsync = async (data, params) => require_parse.parseAsync(inst, data, params, { callee: inst.parseAsync });
	inst.safeParseAsync = async (data, params) => require_parse.safeParseAsync(inst, data, params);
	inst.spa = inst.safeParseAsync;
	inst.encode = (data, params) => require_parse.encode(inst, data, params);
	inst.decode = (data, params) => require_parse.decode(inst, data, params);
	inst.encodeAsync = async (data, params) => require_parse.encodeAsync(inst, data, params);
	inst.decodeAsync = async (data, params) => require_parse.decodeAsync(inst, data, params);
	inst.safeEncode = (data, params) => require_parse.safeEncode(inst, data, params);
	inst.safeDecode = (data, params) => require_parse.safeDecode(inst, data, params);
	inst.safeEncodeAsync = async (data, params) => require_parse.safeEncodeAsync(inst, data, params);
	inst.safeDecodeAsync = async (data, params) => require_parse.safeDecodeAsync(inst, data, params);
	inst.refine = (check, params) => inst.check(refine(check, params));
	inst.superRefine = (refinement) => inst.check(superRefine(refinement));
	inst.overwrite = (fn) => inst.check(require_api._overwrite(fn));
	inst.optional = () => optional(inst);
	inst.nullable = () => nullable(inst);
	inst.nullish = () => optional(nullable(inst));
	inst.nonoptional = (params) => nonoptional(inst, params);
	inst.array = () => array(inst);
	inst.or = (arg) => union([inst, arg]);
	inst.and = (arg) => intersection(inst, arg);
	inst.transform = (tx) => pipe(inst, transform(tx));
	inst.default = (def$1) => _default(inst, def$1);
	inst.prefault = (def$1) => prefault(inst, def$1);
	inst.catch = (params) => _catch(inst, params);
	inst.pipe = (target) => pipe(inst, target);
	inst.readonly = () => readonly(inst);
	inst.describe = (description) => {
		const cl = inst.clone();
		require_registries.globalRegistry.add(cl, { description });
		return cl;
	};
	Object.defineProperty(inst, "description", {
		get() {
			return require_registries.globalRegistry.get(inst)?.description;
		},
		configurable: true
	});
	inst.meta = (...args) => {
		if (args.length === 0) return require_registries.globalRegistry.get(inst);
		const cl = inst.clone();
		require_registries.globalRegistry.add(cl, args[0]);
		return cl;
	};
	inst.isOptional = () => inst.safeParse(void 0).success;
	inst.isNullable = () => inst.safeParse(null).success;
	return inst;
});
/** @internal */
const _ZodString = /* @__PURE__ */ require_core.$constructor("_ZodString", (inst, def) => {
	require_schemas.$ZodString.init(inst, def);
	ZodType.init(inst, def);
	const bag = inst._zod.bag;
	inst.format = bag.format ?? null;
	inst.minLength = bag.minimum ?? null;
	inst.maxLength = bag.maximum ?? null;
	inst.regex = (...args) => inst.check(require_api._regex(...args));
	inst.includes = (...args) => inst.check(require_api._includes(...args));
	inst.startsWith = (...args) => inst.check(require_api._startsWith(...args));
	inst.endsWith = (...args) => inst.check(require_api._endsWith(...args));
	inst.min = (...args) => inst.check(require_api._minLength(...args));
	inst.max = (...args) => inst.check(require_api._maxLength(...args));
	inst.length = (...args) => inst.check(require_api._length(...args));
	inst.nonempty = (...args) => inst.check(require_api._minLength(1, ...args));
	inst.lowercase = (params) => inst.check(require_api._lowercase(params));
	inst.uppercase = (params) => inst.check(require_api._uppercase(params));
	inst.trim = () => inst.check(require_api._trim());
	inst.normalize = (...args) => inst.check(require_api._normalize(...args));
	inst.toLowerCase = () => inst.check(require_api._toLowerCase());
	inst.toUpperCase = () => inst.check(require_api._toUpperCase());
});
const ZodString = /* @__PURE__ */ require_core.$constructor("ZodString", (inst, def) => {
	require_schemas.$ZodString.init(inst, def);
	_ZodString.init(inst, def);
	inst.email = (params) => inst.check(require_api._email(ZodEmail, params));
	inst.url = (params) => inst.check(require_api._url(ZodURL, params));
	inst.jwt = (params) => inst.check(require_api._jwt(ZodJWT, params));
	inst.emoji = (params) => inst.check(require_api._emoji(ZodEmoji, params));
	inst.guid = (params) => inst.check(require_api._guid(ZodGUID, params));
	inst.uuid = (params) => inst.check(require_api._uuid(ZodUUID, params));
	inst.uuidv4 = (params) => inst.check(require_api._uuidv4(ZodUUID, params));
	inst.uuidv6 = (params) => inst.check(require_api._uuidv6(ZodUUID, params));
	inst.uuidv7 = (params) => inst.check(require_api._uuidv7(ZodUUID, params));
	inst.nanoid = (params) => inst.check(require_api._nanoid(ZodNanoID, params));
	inst.guid = (params) => inst.check(require_api._guid(ZodGUID, params));
	inst.cuid = (params) => inst.check(require_api._cuid(ZodCUID, params));
	inst.cuid2 = (params) => inst.check(require_api._cuid2(ZodCUID2, params));
	inst.ulid = (params) => inst.check(require_api._ulid(ZodULID, params));
	inst.base64 = (params) => inst.check(require_api._base64(ZodBase64, params));
	inst.base64url = (params) => inst.check(require_api._base64url(ZodBase64URL, params));
	inst.xid = (params) => inst.check(require_api._xid(ZodXID, params));
	inst.ksuid = (params) => inst.check(require_api._ksuid(ZodKSUID, params));
	inst.ipv4 = (params) => inst.check(require_api._ipv4(ZodIPv4, params));
	inst.ipv6 = (params) => inst.check(require_api._ipv6(ZodIPv6, params));
	inst.cidrv4 = (params) => inst.check(require_api._cidrv4(ZodCIDRv4, params));
	inst.cidrv6 = (params) => inst.check(require_api._cidrv6(ZodCIDRv6, params));
	inst.e164 = (params) => inst.check(require_api._e164(ZodE164, params));
	inst.datetime = (params) => inst.check(require_iso.datetime(params));
	inst.date = (params) => inst.check(require_iso.date(params));
	inst.time = (params) => inst.check(require_iso.time(params));
	inst.duration = (params) => inst.check(require_iso.duration(params));
});
function string(params) {
	return require_api._string(ZodString, params);
}
const ZodStringFormat = /* @__PURE__ */ require_core.$constructor("ZodStringFormat", (inst, def) => {
	require_schemas.$ZodStringFormat.init(inst, def);
	_ZodString.init(inst, def);
});
const ZodEmail = /* @__PURE__ */ require_core.$constructor("ZodEmail", (inst, def) => {
	require_schemas.$ZodEmail.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodGUID = /* @__PURE__ */ require_core.$constructor("ZodGUID", (inst, def) => {
	require_schemas.$ZodGUID.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodUUID = /* @__PURE__ */ require_core.$constructor("ZodUUID", (inst, def) => {
	require_schemas.$ZodUUID.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodURL = /* @__PURE__ */ require_core.$constructor("ZodURL", (inst, def) => {
	require_schemas.$ZodURL.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodEmoji = /* @__PURE__ */ require_core.$constructor("ZodEmoji", (inst, def) => {
	require_schemas.$ZodEmoji.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodNanoID = /* @__PURE__ */ require_core.$constructor("ZodNanoID", (inst, def) => {
	require_schemas.$ZodNanoID.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodCUID = /* @__PURE__ */ require_core.$constructor("ZodCUID", (inst, def) => {
	require_schemas.$ZodCUID.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodCUID2 = /* @__PURE__ */ require_core.$constructor("ZodCUID2", (inst, def) => {
	require_schemas.$ZodCUID2.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodULID = /* @__PURE__ */ require_core.$constructor("ZodULID", (inst, def) => {
	require_schemas.$ZodULID.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodXID = /* @__PURE__ */ require_core.$constructor("ZodXID", (inst, def) => {
	require_schemas.$ZodXID.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodKSUID = /* @__PURE__ */ require_core.$constructor("ZodKSUID", (inst, def) => {
	require_schemas.$ZodKSUID.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodIPv4 = /* @__PURE__ */ require_core.$constructor("ZodIPv4", (inst, def) => {
	require_schemas.$ZodIPv4.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodIPv6 = /* @__PURE__ */ require_core.$constructor("ZodIPv6", (inst, def) => {
	require_schemas.$ZodIPv6.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodCIDRv4 = /* @__PURE__ */ require_core.$constructor("ZodCIDRv4", (inst, def) => {
	require_schemas.$ZodCIDRv4.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodCIDRv6 = /* @__PURE__ */ require_core.$constructor("ZodCIDRv6", (inst, def) => {
	require_schemas.$ZodCIDRv6.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodBase64 = /* @__PURE__ */ require_core.$constructor("ZodBase64", (inst, def) => {
	require_schemas.$ZodBase64.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodBase64URL = /* @__PURE__ */ require_core.$constructor("ZodBase64URL", (inst, def) => {
	require_schemas.$ZodBase64URL.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodE164 = /* @__PURE__ */ require_core.$constructor("ZodE164", (inst, def) => {
	require_schemas.$ZodE164.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodJWT = /* @__PURE__ */ require_core.$constructor("ZodJWT", (inst, def) => {
	require_schemas.$ZodJWT.init(inst, def);
	ZodStringFormat.init(inst, def);
});
const ZodBoolean = /* @__PURE__ */ require_core.$constructor("ZodBoolean", (inst, def) => {
	require_schemas.$ZodBoolean.init(inst, def);
	ZodType.init(inst, def);
});
function boolean(params) {
	return require_api._boolean(ZodBoolean, params);
}
const ZodAny = /* @__PURE__ */ require_core.$constructor("ZodAny", (inst, def) => {
	require_schemas.$ZodAny.init(inst, def);
	ZodType.init(inst, def);
});
function any() {
	return require_api._any(ZodAny);
}
const ZodUnknown = /* @__PURE__ */ require_core.$constructor("ZodUnknown", (inst, def) => {
	require_schemas.$ZodUnknown.init(inst, def);
	ZodType.init(inst, def);
});
function unknown() {
	return require_api._unknown(ZodUnknown);
}
const ZodNever = /* @__PURE__ */ require_core.$constructor("ZodNever", (inst, def) => {
	require_schemas.$ZodNever.init(inst, def);
	ZodType.init(inst, def);
});
function never(params) {
	return require_api._never(ZodNever, params);
}
const ZodArray = /* @__PURE__ */ require_core.$constructor("ZodArray", (inst, def) => {
	require_schemas.$ZodArray.init(inst, def);
	ZodType.init(inst, def);
	inst.element = def.element;
	inst.min = (minLength, params) => inst.check(require_api._minLength(minLength, params));
	inst.nonempty = (params) => inst.check(require_api._minLength(1, params));
	inst.max = (maxLength, params) => inst.check(require_api._maxLength(maxLength, params));
	inst.length = (len, params) => inst.check(require_api._length(len, params));
	inst.unwrap = () => inst.element;
});
function array(element, params) {
	return require_api._array(ZodArray, element, params);
}
const ZodObject = /* @__PURE__ */ require_core.$constructor("ZodObject", (inst, def) => {
	require_schemas.$ZodObjectJIT.init(inst, def);
	ZodType.init(inst, def);
	require_util.defineLazy(inst, "shape", () => {
		return def.shape;
	});
	inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
	inst.catchall = (catchall) => inst.clone({
		...inst._zod.def,
		catchall
	});
	inst.passthrough = () => inst.clone({
		...inst._zod.def,
		catchall: unknown()
	});
	inst.loose = () => inst.clone({
		...inst._zod.def,
		catchall: unknown()
	});
	inst.strict = () => inst.clone({
		...inst._zod.def,
		catchall: never()
	});
	inst.strip = () => inst.clone({
		...inst._zod.def,
		catchall: void 0
	});
	inst.extend = (incoming) => {
		return require_util.extend(inst, incoming);
	};
	inst.safeExtend = (incoming) => {
		return require_util.safeExtend(inst, incoming);
	};
	inst.merge = (other) => require_util.merge(inst, other);
	inst.pick = (mask) => require_util.pick(inst, mask);
	inst.omit = (mask) => require_util.omit(inst, mask);
	inst.partial = (...args) => require_util.partial(ZodOptional, inst, args[0]);
	inst.required = (...args) => require_util.required(ZodNonOptional, inst, args[0]);
});
function object(shape, params) {
	return new ZodObject({
		type: "object",
		shape: shape ?? {},
		...require_util.normalizeParams(params)
	});
}
const ZodUnion = /* @__PURE__ */ require_core.$constructor("ZodUnion", (inst, def) => {
	require_schemas.$ZodUnion.init(inst, def);
	ZodType.init(inst, def);
	inst.options = def.options;
});
function union(options, params) {
	return new ZodUnion({
		type: "union",
		options,
		...require_util.normalizeParams(params)
	});
}
const ZodIntersection = /* @__PURE__ */ require_core.$constructor("ZodIntersection", (inst, def) => {
	require_schemas.$ZodIntersection.init(inst, def);
	ZodType.init(inst, def);
});
function intersection(left, right) {
	return new ZodIntersection({
		type: "intersection",
		left,
		right
	});
}
const ZodRecord = /* @__PURE__ */ require_core.$constructor("ZodRecord", (inst, def) => {
	require_schemas.$ZodRecord.init(inst, def);
	ZodType.init(inst, def);
	inst.keyType = def.keyType;
	inst.valueType = def.valueType;
});
function record(keyType, valueType, params) {
	return new ZodRecord({
		type: "record",
		keyType,
		valueType,
		...require_util.normalizeParams(params)
	});
}
const ZodEnum = /* @__PURE__ */ require_core.$constructor("ZodEnum", (inst, def) => {
	require_schemas.$ZodEnum.init(inst, def);
	ZodType.init(inst, def);
	inst.enum = def.entries;
	inst.options = Object.values(def.entries);
	const keys = new Set(Object.keys(def.entries));
	inst.extract = (values, params) => {
		const newEntries = {};
		for (const value of values) if (keys.has(value)) newEntries[value] = def.entries[value];
		else throw new Error(`Key ${value} not found in enum`);
		return new ZodEnum({
			...def,
			checks: [],
			...require_util.normalizeParams(params),
			entries: newEntries
		});
	};
	inst.exclude = (values, params) => {
		const newEntries = { ...def.entries };
		for (const value of values) if (keys.has(value)) delete newEntries[value];
		else throw new Error(`Key ${value} not found in enum`);
		return new ZodEnum({
			...def,
			checks: [],
			...require_util.normalizeParams(params),
			entries: newEntries
		});
	};
});
function _enum(values, params) {
	return new ZodEnum({
		type: "enum",
		entries: Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values,
		...require_util.normalizeParams(params)
	});
}
const ZodTransform = /* @__PURE__ */ require_core.$constructor("ZodTransform", (inst, def) => {
	require_schemas.$ZodTransform.init(inst, def);
	ZodType.init(inst, def);
	inst._zod.parse = (payload, _ctx) => {
		if (_ctx.direction === "backward") throw new require_core.$ZodEncodeError(inst.constructor.name);
		payload.addIssue = (issue$1) => {
			if (typeof issue$1 === "string") payload.issues.push(require_util.issue(issue$1, payload.value, def));
			else {
				const _issue = issue$1;
				if (_issue.fatal) _issue.continue = false;
				_issue.code ?? (_issue.code = "custom");
				_issue.input ?? (_issue.input = payload.value);
				_issue.inst ?? (_issue.inst = inst);
				payload.issues.push(require_util.issue(_issue));
			}
		};
		const output = def.transform(payload.value, payload);
		if (output instanceof Promise) return output.then((output$1) => {
			payload.value = output$1;
			return payload;
		});
		payload.value = output;
		return payload;
	};
});
function transform(fn) {
	return new ZodTransform({
		type: "transform",
		transform: fn
	});
}
const ZodOptional = /* @__PURE__ */ require_core.$constructor("ZodOptional", (inst, def) => {
	require_schemas.$ZodOptional.init(inst, def);
	ZodType.init(inst, def);
	inst.unwrap = () => inst._zod.def.innerType;
});
function optional(innerType) {
	return new ZodOptional({
		type: "optional",
		innerType
	});
}
const ZodNullable = /* @__PURE__ */ require_core.$constructor("ZodNullable", (inst, def) => {
	require_schemas.$ZodNullable.init(inst, def);
	ZodType.init(inst, def);
	inst.unwrap = () => inst._zod.def.innerType;
});
function nullable(innerType) {
	return new ZodNullable({
		type: "nullable",
		innerType
	});
}
const ZodDefault = /* @__PURE__ */ require_core.$constructor("ZodDefault", (inst, def) => {
	require_schemas.$ZodDefault.init(inst, def);
	ZodType.init(inst, def);
	inst.unwrap = () => inst._zod.def.innerType;
	inst.removeDefault = inst.unwrap;
});
function _default(innerType, defaultValue) {
	return new ZodDefault({
		type: "default",
		innerType,
		get defaultValue() {
			return typeof defaultValue === "function" ? defaultValue() : require_util.shallowClone(defaultValue);
		}
	});
}
const ZodPrefault = /* @__PURE__ */ require_core.$constructor("ZodPrefault", (inst, def) => {
	require_schemas.$ZodPrefault.init(inst, def);
	ZodType.init(inst, def);
	inst.unwrap = () => inst._zod.def.innerType;
});
function prefault(innerType, defaultValue) {
	return new ZodPrefault({
		type: "prefault",
		innerType,
		get defaultValue() {
			return typeof defaultValue === "function" ? defaultValue() : require_util.shallowClone(defaultValue);
		}
	});
}
const ZodNonOptional = /* @__PURE__ */ require_core.$constructor("ZodNonOptional", (inst, def) => {
	require_schemas.$ZodNonOptional.init(inst, def);
	ZodType.init(inst, def);
	inst.unwrap = () => inst._zod.def.innerType;
});
function nonoptional(innerType, params) {
	return new ZodNonOptional({
		type: "nonoptional",
		innerType,
		...require_util.normalizeParams(params)
	});
}
const ZodCatch = /* @__PURE__ */ require_core.$constructor("ZodCatch", (inst, def) => {
	require_schemas.$ZodCatch.init(inst, def);
	ZodType.init(inst, def);
	inst.unwrap = () => inst._zod.def.innerType;
	inst.removeCatch = inst.unwrap;
});
function _catch(innerType, catchValue) {
	return new ZodCatch({
		type: "catch",
		innerType,
		catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
	});
}
const ZodPipe = /* @__PURE__ */ require_core.$constructor("ZodPipe", (inst, def) => {
	require_schemas.$ZodPipe.init(inst, def);
	ZodType.init(inst, def);
	inst.in = def.in;
	inst.out = def.out;
});
function pipe(in_, out) {
	return new ZodPipe({
		type: "pipe",
		in: in_,
		out
	});
}
const ZodReadonly = /* @__PURE__ */ require_core.$constructor("ZodReadonly", (inst, def) => {
	require_schemas.$ZodReadonly.init(inst, def);
	ZodType.init(inst, def);
	inst.unwrap = () => inst._zod.def.innerType;
});
function readonly(innerType) {
	return new ZodReadonly({
		type: "readonly",
		innerType
	});
}
const ZodCustom = /* @__PURE__ */ require_core.$constructor("ZodCustom", (inst, def) => {
	require_schemas.$ZodCustom.init(inst, def);
	ZodType.init(inst, def);
});
function refine(fn, _params = {}) {
	return require_api._refine(ZodCustom, fn, _params);
}
function superRefine(fn) {
	return require_api._superRefine(fn);
}

//#endregion
exports.ZodStringFormat = ZodStringFormat;
exports._enum = _enum;
exports.any = any;
exports.array = array;
exports.boolean = boolean;
exports.object = object;
exports.record = record;
exports.string = string;
//# sourceMappingURL=schemas.cjs.map