import { ZodParsedType, util } from "../helpers/util.js";
import { ZodIssueCode } from "../ZodError.js";
var en_default = (r, i) => {
	let a;
	switch (r.code) {
		case ZodIssueCode.invalid_type:
			a = r.received === ZodParsedType.undefined ? "Required" : `Expected ${r.expected}, received ${r.received}`;
			break;
		case ZodIssueCode.invalid_literal:
			a = `Invalid literal value, expected ${JSON.stringify(r.expected, util.jsonStringifyReplacer)}`;
			break;
		case ZodIssueCode.unrecognized_keys:
			a = `Unrecognized key(s) in object: ${util.joinValues(r.keys, ", ")}`;
			break;
		case ZodIssueCode.invalid_union:
			a = "Invalid input";
			break;
		case ZodIssueCode.invalid_union_discriminator:
			a = `Invalid discriminator value. Expected ${util.joinValues(r.options)}`;
			break;
		case ZodIssueCode.invalid_enum_value:
			a = `Invalid enum value. Expected ${util.joinValues(r.options)}, received '${r.received}'`;
			break;
		case ZodIssueCode.invalid_arguments:
			a = "Invalid function arguments";
			break;
		case ZodIssueCode.invalid_return_type:
			a = "Invalid function return type";
			break;
		case ZodIssueCode.invalid_date:
			a = "Invalid date";
			break;
		case ZodIssueCode.invalid_string:
			typeof r.validation == "object" ? "includes" in r.validation ? (a = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (a = `${a} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? a = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? a = `Invalid input: must end with "${r.validation.endsWith}"` : util.assertNever(r.validation) : a = r.validation === "regex" ? "Invalid" : `Invalid ${r.validation}`;
			break;
		case ZodIssueCode.too_small:
			a = r.type === "array" ? `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" || r.type === "bigint" ? `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : "Invalid input";
			break;
		case ZodIssueCode.too_big:
			a = r.type === "array" ? `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : "Invalid input";
			break;
		case ZodIssueCode.custom:
			a = "Invalid input";
			break;
		case ZodIssueCode.invalid_intersection_types:
			a = "Intersection results could not be merged";
			break;
		case ZodIssueCode.not_multiple_of:
			a = `Number must be a multiple of ${r.multipleOf}`;
			break;
		case ZodIssueCode.not_finite:
			a = "Number must be finite";
			break;
		default: a = i.defaultError, util.assertNever(r);
	}
	return { message: a };
};
export { en_default as default };
