@thirstie/thirstievalidators 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- var thirstievalidators=function(e){"use strict";const t=[78,52,0],a=["weak","acceptable","strong"];const s=e=>{const t=(/.*[0-9].*/.test(e)?10:0)+(/.*[a-z].*/.test(e)?26:0)+(/.*[A-Z].*/.test(e)?26:0)+(/.*[^a-zA-Z0-9].*/.test(e)?33:0),a=e.length;return Math.log2(t**a)},n=e=>{const a=t.findIndex((t=>e>=t));return t.length-1-a},r={"en-us":{name:"United States",alpha3:"USA",numeric:"840",administrativeAreas:{AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District of Columbia",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming"},alpha2:"US",currency:["$","USD"]},"en-ca":{name:"Canada",alpha3:"CAN",numeric:"124",administrativeAreas:{AB:"Alberta",BC:"British Columbia",MB:"Manitoba",NB:"New Brunswick",NL:"Newfoundland and Labrador",NS:"Nova Scotia",ON:"Ontario",PE:"Prince Edward Island",QC:"Quebec",SK:"Saskatchewan"},alpha1:"CA",currency:["$","CAD"]}},i=["gnail.co","gmil.com","gmsil.com","gamil.com","gmai.com","gnail.com","gmail.co","gmail.cm","gmail.co","gmal.com","gmaill.com","gmail.ca","gmal.com","gmai.com","gmaiil.com","gmail.con","gmail.comm","gmaol.com","gmail.om","gmaol.co","gmall.com","gmal.co","ail.com"],o=["gmail.com","yahoo.com","hotmail.com","aol.com","comcast.net","icloud.com","me.com","msn.com","outlook.com","sbcglobal.net","live.com","att.net","verizon.net","mac.com","ymail.com","optonline.net","cox.net","bellsouth.net","charter.net","anheuser-busch.com","mail.com","rocketmail.com","earthlink.net","aim.com","cbrands.com","kdrp.com","protonmail.com","roadrunner.com","pacbell.net","yopmail.com"];var d,c;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),s={};for(const e of a)s[e]=t[e];return e.objectValues(s)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(d||(d={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(c||(c={}));const u=d.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),l=e=>{switch(typeof e){case"undefined":return u.undefined;case"string":return u.string;case"number":return isNaN(e)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(e)?u.array:null===e?u.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?u.promise:"undefined"!=typeof Map&&e instanceof Map?u.map:"undefined"!=typeof Set&&e instanceof Set?u.set:"undefined"!=typeof Date&&e instanceof Date?u.date:u.object;default:return u.unknown}},h=d.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class p extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},a={_errors:[]},s=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(s);else if("invalid_return_type"===n.code)s(n.returnTypeError);else if("invalid_arguments"===n.code)s(n.argumentsError);else if(0===n.path.length)a._errors.push(t(n));else{let e=a,s=0;for(;s<n.path.length;){const a=n.path[s];s===n.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(n))):e[a]=e[a]||{_errors:[]},e=e[a],s++}}};return s(this),a}static assert(e){if(!(e instanceof p))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,d.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},a=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):a.push(e(s));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}p.create=e=>new p(e);const m=(e,t)=>{let a;switch(e.code){case h.invalid_type:a=e.received===u.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case h.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,d.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:a=`Unrecognized key(s) in object: ${d.joinValues(e.keys,", ")}`;break;case h.invalid_union:a="Invalid input";break;case h.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${d.joinValues(e.options)}`;break;case h.invalid_enum_value:a=`Invalid enum value. Expected ${d.joinValues(e.options)}, received '${e.received}'`;break;case h.invalid_arguments:a="Invalid function arguments";break;case h.invalid_return_type:a="Invalid function return type";break;case h.invalid_date:a="Invalid date";break;case h.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:d.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case h.too_small:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case h.too_big:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case h.custom:a="Invalid input";break;case h.invalid_intersection_types:a="Intersection results could not be merged";break;case h.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case h.not_finite:a="Number must be finite";break;default:a=t.defaultError,d.assertNever(e)}return{message:a}};let f=m;function y(){return f}const _=e=>{const{data:t,path:a,errorMaps:s,issueData:n}=e,r=[...a,...n.path||[]],i={...n,path:r};if(void 0!==n.message)return{...n,path:r,message:n.message};let o="";const d=s.filter((e=>!!e)).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...n,path:r,message:o}};function g(e,t){const a=y(),s=_({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===m?void 0:m].filter((e=>!!e))});e.common.issues.push(s)}class v{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const s of t){if("aborted"===s.status)return k;"dirty"===s.status&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t){const t=await e.key,s=await e.value;a.push({key:t,value:s})}return v.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const s of t){const{key:t,value:n}=s;if("aborted"===t.status)return k;if("aborted"===n.status)return k;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"===t.value||void 0===n.value&&!s.alwaysSet||(a[t.value]=n.value)}return{status:e.value,value:a}}}const k=Object.freeze({status:"aborted"}),b=e=>({status:"dirty",value:e}),x=e=>({status:"valid",value:e}),w=e=>"aborted"===e.status,Z=e=>"dirty"===e.status,T=e=>"valid"===e.status,C=e=>"undefined"!=typeof Promise&&e instanceof Promise;function N(e,t,a,s){if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function O(e,t,a,s,n){if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,a),a}var S,A,E;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(S||(S={}));class j{constructor(e,t,a,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const I=(e,t)=>{if(T(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new p(e.common.issues);return this._error=t,this._error}}};function P(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:s,description:n}=e;if(t&&(a||s))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:n};return{errorMap:(t,n)=>{var r,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:n.defaultError}:void 0===n.data?{message:null!==(r=null!=o?o:s)&&void 0!==r?r:n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:null!==(i=null!=o?o:a)&&void 0!==i?i:n.defaultError}},description:n}}class R{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return l(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new v,ctx:{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(C(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const s={common:{issues:[],async:null!==(a=null==t?void 0:t.async)&&void 0!==a&&a,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},n=this._parseSync({data:e,path:s.path,parent:s});return I(s,n)}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},s=this._parse({data:e,path:a.path,parent:a}),n=await(C(s)?s:Promise.resolve(s));return I(a,n)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,s)=>{const n=e(t),r=()=>s.addIssue({code:h.custom,...a(t)});return"undefined"!=typeof Promise&&n instanceof Promise?n.then((e=>!!e||(r(),!1))):!!n||(r(),!1)}))}refinement(e,t){return this._refinement(((a,s)=>!!e(a)||(s.addIssue("function"==typeof t?t(a,s):t),!1)))}_refinement(e){return new Se({schema:this,typeName:Ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ae.create(this,this._def)}nullable(){return Ee.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ue.create(this,this._def)}promise(){return Oe.create(this,this._def)}or(e){return pe.create([this,e],this._def)}and(e){return _e.create(this,e,this._def)}transform(e){return new Se({...P(this._def),schema:this,typeName:Ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new je({...P(this._def),innerType:this,defaultValue:t,typeName:Ve.ZodDefault})}brand(){return new Me({typeName:Ve.ZodBranded,type:this,...P(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Ie({...P(this._def),innerType:this,catchValue:t,typeName:Ve.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return $e.create(this,e)}readonly(){return De.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const M=/^c[^\s-]{8,}$/i,$=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Z]{26}$/,L=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,z=/^[a-z0-9_-]{21}$/i,V=/^[-+]?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)?)??$/,U=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let K;const B=/^(?:(?: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])$/,W=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,F=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,q="((\\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])))",H=new RegExp(`^${q}$`);function Y(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function G(e){let t=`${q}T${Y(e)}`;const a=[];return a.push(e.local?"Z?":"Z"),e.offset&&a.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${a.join("|")})`,new RegExp(`^${t}$`)}class J extends R{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==u.string){const t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:u.string,received:t.parsedType}),k}const t=new v;let a;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:h.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:h.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const s=e.data.length>r.value,n=e.data.length<r.value;(s||n)&&(a=this._getOrReturnCtx(e,a),s?g(a,{code:h.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):n&&g(a,{code:h.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)U.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"email",code:h.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)K||(K=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),K.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"emoji",code:h.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)L.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"uuid",code:h.invalid_string,message:r.message}),t.dirty());else if("nanoid"===r.kind)z.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"nanoid",code:h.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)M.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"cuid",code:h.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)$.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"cuid2",code:h.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)D.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"ulid",code:h.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch(s){a=this._getOrReturnCtx(e,a),g(a,{validation:"url",code:h.invalid_string,message:r.message}),t.dirty()}else if("regex"===r.kind){r.regex.lastIndex=0;r.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"regex",code:h.invalid_string,message:r.message}),t.dirty())}else if("trim"===r.kind)e.data=e.data.trim();else if("includes"===r.kind)e.data.includes(r.value,r.position)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty());else if("toLowerCase"===r.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===r.kind)e.data=e.data.toUpperCase();else if("startsWith"===r.kind)e.data.startsWith(r.value)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty());else if("endsWith"===r.kind)e.data.endsWith(r.value)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty());else if("datetime"===r.kind){G(r).test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:"datetime",message:r.message}),t.dirty())}else if("date"===r.kind){H.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:"date",message:r.message}),t.dirty())}else if("time"===r.kind){new RegExp(`^${Y(r)}$`).test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:"time",message:r.message}),t.dirty())}else"duration"===r.kind?V.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"duration",code:h.invalid_string,message:r.message}),t.dirty()):"ip"===r.kind?(s=e.data,("v4"!==(n=r.version)&&n||!B.test(s))&&("v6"!==n&&n||!W.test(s))&&(a=this._getOrReturnCtx(e,a),g(a,{validation:"ip",code:h.invalid_string,message:r.message}),t.dirty())):"base64"===r.kind?F.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"base64",code:h.invalid_string,message:r.message}),t.dirty()):d.assertNever(r);var s,n;return{status:t.value,value:e.data}}_regex(e,t,a){return this.refinement((t=>e.test(t)),{validation:t,code:h.invalid_string,...S.errToObj(a)})}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...S.errToObj(e)})}url(e){return this._addCheck({kind:"url",...S.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...S.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...S.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...S.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...S.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...S.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...S.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...S.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...S.errToObj(e)})}datetime(e){var t,a;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(a=null==e?void 0:e.local)&&void 0!==a&&a,...S.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...S.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...S.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...S.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...S.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...S.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...S.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...S.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...S.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...S.errToObj(t)})}nonempty(e){return this.min(1,S.errToObj(e))}trim(){return new J({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new J({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new J({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Q(e,t){const a=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=a>s?a:s;return parseInt(e.toFixed(n).replace(".",""))%parseInt(t.toFixed(n).replace(".",""))/Math.pow(10,n)}J.create=e=>{var t;return new J({checks:[],typeName:Ve.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...P(e)})};class X extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==u.number){const t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:u.number,received:t.parsedType}),k}let t;const a=new v;for(const s of this._def.checks)if("int"===s.kind)d.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),g(t,{code:h.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty());else if("min"===s.kind){(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:h.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty())}else if("max"===s.kind){(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:h.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty())}else"multipleOf"===s.kind?0!==Q(e.data,s.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:h.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):"finite"===s.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),g(t,{code:h.not_finite,message:s.message}),a.dirty()):d.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,a,s){return new X({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:S.toString(s)}]})}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:S.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:S.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:S.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:S.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&d.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}X.create=e=>new X({checks:[],typeName:Ve.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...P(e)});class ee extends R{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==u.bigint){const t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:u.bigint,received:t.parsedType}),k}let t;const a=new v;for(const s of this._def.checks)if("min"===s.kind){(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:h.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty())}else if("max"===s.kind){(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),g(t,{code:h.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty())}else"multipleOf"===s.kind?e.data%s.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),g(t,{code:h.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):d.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,a,s){return new ee({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:S.toString(s)}]})}_addCheck(e){return new ee({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ee.create=e=>{var t;return new ee({checks:[],typeName:Ve.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...P(e)})};class te extends R{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==u.boolean){const t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:u.boolean,received:t.parsedType}),k}return x(e.data)}}te.create=e=>new te({typeName:Ve.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...P(e)});class ae extends R{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==u.date){const t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:u.date,received:t.parsedType}),k}if(isNaN(e.data.getTime())){return g(this._getOrReturnCtx(e),{code:h.invalid_date}),k}const t=new v;let a;for(const s of this._def.checks)"min"===s.kind?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:h.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),t.dirty()):"max"===s.kind?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:h.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),t.dirty()):d.assertNever(s);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ae({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:S.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:S.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ae.create=e=>new ae({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ve.ZodDate,...P(e)});class se extends R{_parse(e){if(this._getType(e)!==u.symbol){const t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:u.symbol,received:t.parsedType}),k}return x(e.data)}}se.create=e=>new se({typeName:Ve.ZodSymbol,...P(e)});class ne extends R{_parse(e){if(this._getType(e)!==u.undefined){const t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:u.undefined,received:t.parsedType}),k}return x(e.data)}}ne.create=e=>new ne({typeName:Ve.ZodUndefined,...P(e)});class re extends R{_parse(e){if(this._getType(e)!==u.null){const t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:u.null,received:t.parsedType}),k}return x(e.data)}}re.create=e=>new re({typeName:Ve.ZodNull,...P(e)});class ie extends R{constructor(){super(...arguments),this._any=!0}_parse(e){return x(e.data)}}ie.create=e=>new ie({typeName:Ve.ZodAny,...P(e)});class oe extends R{constructor(){super(...arguments),this._unknown=!0}_parse(e){return x(e.data)}}oe.create=e=>new oe({typeName:Ve.ZodUnknown,...P(e)});class de extends R{_parse(e){const t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:u.never,received:t.parsedType}),k}}de.create=e=>new de({typeName:Ve.ZodNever,...P(e)});class ce extends R{_parse(e){if(this._getType(e)!==u.undefined){const t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:u.void,received:t.parsedType}),k}return x(e.data)}}ce.create=e=>new ce({typeName:Ve.ZodVoid,...P(e)});class ue extends R{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),s=this._def;if(t.parsedType!==u.array)return g(t,{code:h.invalid_type,expected:u.array,received:t.parsedType}),k;if(null!==s.exactLength){const e=t.data.length>s.exactLength.value,n=t.data.length<s.exactLength.value;(e||n)&&(g(t,{code:e?h.too_big:h.too_small,minimum:n?s.exactLength.value:void 0,maximum:e?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),a.dirty())}if(null!==s.minLength&&t.data.length<s.minLength.value&&(g(t,{code:h.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),a.dirty()),null!==s.maxLength&&t.data.length>s.maxLength.value&&(g(t,{code:h.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map(((e,a)=>s.type._parseAsync(new j(t,e,t.path,a))))).then((e=>v.mergeArray(a,e)));const n=[...t.data].map(((e,a)=>s.type._parseSync(new j(t,e,t.path,a))));return v.mergeArray(a,n)}get element(){return this._def.type}min(e,t){return new ue({...this._def,minLength:{value:e,message:S.toString(t)}})}max(e,t){return new ue({...this._def,maxLength:{value:e,message:S.toString(t)}})}length(e,t){return new ue({...this._def,exactLength:{value:e,message:S.toString(t)}})}nonempty(e){return this.min(1,e)}}function le(e){if(e instanceof he){const t={};for(const a in e.shape){const s=e.shape[a];t[a]=Ae.create(le(s))}return new he({...e._def,shape:()=>t})}return e instanceof ue?new ue({...e._def,type:le(e.element)}):e instanceof Ae?Ae.create(le(e.unwrap())):e instanceof Ee?Ee.create(le(e.unwrap())):e instanceof ge?ge.create(e.items.map((e=>le(e)))):e}ue.create=(e,t)=>new ue({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ve.ZodArray,...P(t)});class he extends R{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=d.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==u.object){const t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:u.object,received:t.parsedType}),k}const{status:t,ctx:a}=this._processInputParams(e),{shape:s,keys:n}=this._getCached(),r=[];if(!(this._def.catchall instanceof de&&"strip"===this._def.unknownKeys))for(const e in a.data)n.includes(e)||r.push(e);const i=[];for(const e of n){const t=s[e],n=a.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new j(a,n,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof de){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of r)i.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)r.length>0&&(g(a,{code:h.unrecognized_keys,keys:r}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of r){const s=a.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new j(a,s,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of i){const a=await t.key,s=await t.value;e.push({key:a,value:s,alwaysSet:t.alwaysSet})}return e})).then((e=>v.mergeObjectSync(t,e))):v.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return S.errToObj,new he({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{var s,n,r,i;const o=null!==(r=null===(n=(s=this._def).errorMap)||void 0===n?void 0:n.call(s,t,a).message)&&void 0!==r?r:a.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=S.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new he({...this._def,unknownKeys:"strip"})}passthrough(){return new he({...this._def,unknownKeys:"passthrough"})}extend(e){return new he({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new he({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ve.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new he({...this._def,catchall:e})}pick(e){const t={};return d.objectKeys(e).forEach((a=>{e[a]&&this.shape[a]&&(t[a]=this.shape[a])})),new he({...this._def,shape:()=>t})}omit(e){const t={};return d.objectKeys(this.shape).forEach((a=>{e[a]||(t[a]=this.shape[a])})),new he({...this._def,shape:()=>t})}deepPartial(){return le(this)}partial(e){const t={};return d.objectKeys(this.shape).forEach((a=>{const s=this.shape[a];e&&!e[a]?t[a]=s:t[a]=s.optional()})),new he({...this._def,shape:()=>t})}required(e){const t={};return d.objectKeys(this.shape).forEach((a=>{if(e&&!e[a])t[a]=this.shape[a];else{let e=this.shape[a];for(;e instanceof Ae;)e=e._def.innerType;t[a]=e}})),new he({...this._def,shape:()=>t})}keyof(){return Te(d.objectKeys(this.shape))}}he.create=(e,t)=>new he({shape:()=>e,unknownKeys:"strip",catchall:de.create(),typeName:Ve.ZodObject,...P(t)}),he.strictCreate=(e,t)=>new he({shape:()=>e,unknownKeys:"strict",catchall:de.create(),typeName:Ve.ZodObject,...P(t)}),he.lazycreate=(e,t)=>new he({shape:e,unknownKeys:"strip",catchall:de.create(),typeName:Ve.ZodObject,...P(t)});class pe extends R{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map((async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map((e=>new p(e.ctx.common.issues)));return g(t,{code:h.invalid_union,unionErrors:a}),k}));{let e;const s=[];for(const n of a){const a={...t,common:{...t.common,issues:[]},parent:null},r=n._parseSync({data:t.data,path:t.path,parent:a});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:a}),a.common.issues.length&&s.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const n=s.map((e=>new p(e)));return g(t,{code:h.invalid_union,unionErrors:n}),k}}get options(){return this._def.options}}pe.create=(e,t)=>new pe({options:e,typeName:Ve.ZodUnion,...P(t)});const me=e=>e instanceof we?me(e.schema):e instanceof Se?me(e.innerType()):e instanceof Ze?[e.value]:e instanceof Ce?e.options:e instanceof Ne?d.objectValues(e.enum):e instanceof je?me(e._def.innerType):e instanceof ne?[void 0]:e instanceof re?[null]:e instanceof Ae?[void 0,...me(e.unwrap())]:e instanceof Ee?[null,...me(e.unwrap())]:e instanceof Me||e instanceof De?me(e.unwrap()):e instanceof Ie?me(e._def.innerType):[];class fe extends R{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return g(t,{code:h.invalid_type,expected:u.object,received:t.parsedType}),k;const a=this.discriminator,s=t.data[a],n=this.optionsMap.get(s);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(g(t,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),k)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const s=new Map;for(const a of t){const t=me(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(s.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);s.set(n,a)}}return new fe({typeName:Ve.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...P(a)})}}function ye(e,t){const a=l(e),s=l(t);if(e===t)return{valid:!0,data:e};if(a===u.object&&s===u.object){const a=d.objectKeys(t),s=d.objectKeys(e).filter((e=>-1!==a.indexOf(e))),n={...e,...t};for(const a of s){const s=ye(e[a],t[a]);if(!s.valid)return{valid:!1};n[a]=s.data}return{valid:!0,data:n}}if(a===u.array&&s===u.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let s=0;s<e.length;s++){const n=ye(e[s],t[s]);if(!n.valid)return{valid:!1};a.push(n.data)}return{valid:!0,data:a}}return a===u.date&&s===u.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class _e extends R{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),s=(e,s)=>{if(w(e)||w(s))return k;const n=ye(e.value,s.value);return n.valid?((Z(e)||Z(s))&&t.dirty(),{status:t.value,value:n.data}):(g(a,{code:h.invalid_intersection_types}),k)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then((([e,t])=>s(e,t))):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}_e.create=(e,t,a)=>new _e({left:e,right:t,typeName:Ve.ZodIntersection,...P(a)});class ge extends R{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==u.array)return g(a,{code:h.invalid_type,expected:u.array,received:a.parsedType}),k;if(a.data.length<this._def.items.length)return g(a,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),k;!this._def.rest&&a.data.length>this._def.items.length&&(g(a,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...a.data].map(((e,t)=>{const s=this._def.items[t]||this._def.rest;return s?s._parse(new j(a,e,a.path,t)):null})).filter((e=>!!e));return a.common.async?Promise.all(s).then((e=>v.mergeArray(t,e))):v.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new ge({...this._def,rest:e})}}ge.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ge({items:e,typeName:Ve.ZodTuple,rest:null,...P(t)})};class ve extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==u.object)return g(a,{code:h.invalid_type,expected:u.object,received:a.parsedType}),k;const s=[],n=this._def.keyType,r=this._def.valueType;for(const e in a.data)s.push({key:n._parse(new j(a,e,a.path,e)),value:r._parse(new j(a,a.data[e],a.path,e)),alwaysSet:e in a.data});return a.common.async?v.mergeObjectAsync(t,s):v.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,a){return new ve(t instanceof R?{keyType:e,valueType:t,typeName:Ve.ZodRecord,...P(a)}:{keyType:J.create(),valueType:e,typeName:Ve.ZodRecord,...P(t)})}}class ke extends R{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==u.map)return g(a,{code:h.invalid_type,expected:u.map,received:a.parsedType}),k;const s=this._def.keyType,n=this._def.valueType,r=[...a.data.entries()].map((([e,t],r)=>({key:s._parse(new j(a,e,a.path,[r,"key"])),value:n._parse(new j(a,t,a.path,[r,"value"]))})));if(a.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const a of r){const s=await a.key,n=await a.value;if("aborted"===s.status||"aborted"===n.status)return k;"dirty"!==s.status&&"dirty"!==n.status||t.dirty(),e.set(s.value,n.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const a of r){const s=a.key,n=a.value;if("aborted"===s.status||"aborted"===n.status)return k;"dirty"!==s.status&&"dirty"!==n.status||t.dirty(),e.set(s.value,n.value)}return{status:t.value,value:e}}}}ke.create=(e,t,a)=>new ke({valueType:t,keyType:e,typeName:Ve.ZodMap,...P(a)});class be extends R{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==u.set)return g(a,{code:h.invalid_type,expected:u.set,received:a.parsedType}),k;const s=this._def;null!==s.minSize&&a.data.size<s.minSize.value&&(g(a,{code:h.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),null!==s.maxSize&&a.data.size>s.maxSize.value&&(g(a,{code:h.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const n=this._def.valueType;function r(e){const a=new Set;for(const s of e){if("aborted"===s.status)return k;"dirty"===s.status&&t.dirty(),a.add(s.value)}return{status:t.value,value:a}}const i=[...a.data.values()].map(((e,t)=>n._parse(new j(a,e,a.path,t))));return a.common.async?Promise.all(i).then((e=>r(e))):r(i)}min(e,t){return new be({...this._def,minSize:{value:e,message:S.toString(t)}})}max(e,t){return new be({...this._def,maxSize:{value:e,message:S.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}be.create=(e,t)=>new be({valueType:e,minSize:null,maxSize:null,typeName:Ve.ZodSet,...P(t)});class xe extends R{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.function)return g(t,{code:h.invalid_type,expected:u.function,received:t.parsedType}),k;function a(e,a){return _({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,y(),m].filter((e=>!!e)),issueData:{code:h.invalid_arguments,argumentsError:a}})}function s(e,a){return _({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,y(),m].filter((e=>!!e)),issueData:{code:h.invalid_return_type,returnTypeError:a}})}const n={errorMap:t.common.contextualErrorMap},r=t.data;if(this._def.returns instanceof Oe){const e=this;return x((async function(...t){const i=new p([]),o=await e._def.args.parseAsync(t,n).catch((e=>{throw i.addIssue(a(t,e)),i})),d=await Reflect.apply(r,this,o);return await e._def.returns._def.type.parseAsync(d,n).catch((e=>{throw i.addIssue(s(d,e)),i}))}))}{const e=this;return x((function(...t){const i=e._def.args.safeParse(t,n);if(!i.success)throw new p([a(t,i.error)]);const o=Reflect.apply(r,this,i.data),d=e._def.returns.safeParse(o,n);if(!d.success)throw new p([s(o,d.error)]);return d.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new xe({...this._def,args:ge.create(e).rest(oe.create())})}returns(e){return new xe({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new xe({args:e||ge.create([]).rest(oe.create()),returns:t||oe.create(),typeName:Ve.ZodFunction,...P(a)})}}class we extends R{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}we.create=(e,t)=>new we({getter:e,typeName:Ve.ZodLazy,...P(t)});class Ze extends R{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return g(t,{received:t.data,code:h.invalid_literal,expected:this._def.value}),k}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Te(e,t){return new Ce({values:e,typeName:Ve.ZodEnum,...P(t)})}Ze.create=(e,t)=>new Ze({value:e,typeName:Ve.ZodLiteral,...P(t)});class Ce extends R{constructor(){super(...arguments),A.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),a=this._def.values;return g(t,{expected:d.joinValues(a),received:t.parsedType,code:h.invalid_type}),k}if(N(this,A)||O(this,A,new Set(this._def.values)),!N(this,A).has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return g(t,{received:t.data,code:h.invalid_enum_value,options:a}),k}return x(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Ce.create(e,{...this._def,...t})}exclude(e,t=this._def){return Ce.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}A=new WeakMap,Ce.create=Te;class Ne extends R{constructor(){super(...arguments),E.set(this,void 0)}_parse(e){const t=d.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==u.string&&a.parsedType!==u.number){const e=d.objectValues(t);return g(a,{expected:d.joinValues(e),received:a.parsedType,code:h.invalid_type}),k}if(N(this,E)||O(this,E,new Set(d.getValidEnumValues(this._def.values))),!N(this,E).has(e.data)){const e=d.objectValues(t);return g(a,{received:a.data,code:h.invalid_enum_value,options:e}),k}return x(e.data)}get enum(){return this._def.values}}E=new WeakMap,Ne.create=(e,t)=>new Ne({values:e,typeName:Ve.ZodNativeEnum,...P(t)});class Oe extends R{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&!1===t.common.async)return g(t,{code:h.invalid_type,expected:u.promise,received:t.parsedType}),k;const a=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return x(a.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Oe.create=(e,t)=>new Oe({type:e,typeName:Ve.ZodPromise,...P(t)});class Se extends R{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),s=this._def.effect||null,n={addIssue:e=>{g(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===s.type){const e=s.transform(a.data,n);if(a.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return k;const s=await this._def.schema._parseAsync({data:e,path:a.path,parent:a});return"aborted"===s.status?k:"dirty"===s.status||"dirty"===t.value?b(s.value):s}));{if("aborted"===t.value)return k;const s=this._def.schema._parseSync({data:e,path:a.path,parent:a});return"aborted"===s.status?k:"dirty"===s.status||"dirty"===t.value?b(s.value):s}}if("refinement"===s.type){const e=e=>{const t=s.refinement(e,n);if(a.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===a.common.async){const s=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===s.status?k:("dirty"===s.status&&t.dirty(),e(s.value),{status:t.value,value:s.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((a=>"aborted"===a.status?k:("dirty"===a.status&&t.dirty(),e(a.value).then((()=>({status:t.value,value:a.value}))))))}if("transform"===s.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!T(e))return e;const r=s.transform(e.value,n);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((e=>T(e)?Promise.resolve(s.transform(e.value,n)).then((e=>({status:t.value,value:e}))):e))}d.assertNever(s)}}Se.create=(e,t,a)=>new Se({schema:e,typeName:Ve.ZodEffects,effect:t,...P(a)}),Se.createWithPreprocess=(e,t,a)=>new Se({schema:t,effect:{type:"preprocess",transform:e},typeName:Ve.ZodEffects,...P(a)});class Ae extends R{_parse(e){return this._getType(e)===u.undefined?x(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ae.create=(e,t)=>new Ae({innerType:e,typeName:Ve.ZodOptional,...P(t)});class Ee extends R{_parse(e){return this._getType(e)===u.null?x(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ee.create=(e,t)=>new Ee({innerType:e,typeName:Ve.ZodNullable,...P(t)});class je extends R{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===u.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}je.create=(e,t)=>new je({innerType:e,typeName:Ve.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...P(t)});class Ie extends R{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return C(s)?s.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new p(a.common.issues)},input:a.data})}))):{status:"valid",value:"valid"===s.status?s.value:this._def.catchValue({get error(){return new p(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Ie.create=(e,t)=>new Ie({innerType:e,typeName:Ve.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...P(t)});class Pe extends R{_parse(e){if(this._getType(e)!==u.nan){const t=this._getOrReturnCtx(e);return g(t,{code:h.invalid_type,expected:u.nan,received:t.parsedType}),k}return{status:"valid",value:e.data}}}Pe.create=e=>new Pe({typeName:Ve.ZodNaN,...P(e)});const Re=Symbol("zod_brand");class Me extends R{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class $e extends R{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?k:"dirty"===e.status?(t.dirty(),b(e.value)):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})()}{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?k:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new $e({in:e,out:t,typeName:Ve.ZodPipeline})}}class De extends R{_parse(e){const t=this._def.innerType._parse(e),a=e=>(T(e)&&(e.value=Object.freeze(e.value)),e);return C(t)?t.then((e=>a(e))):a(t)}unwrap(){return this._def.innerType}}function Le(e,t={},a){return e?ie.create().superRefine(((s,n)=>{var r,i;if(!e(s)){const e="function"==typeof t?t(s):"string"==typeof t?{message:t}:t,o=null===(i=null!==(r=e.fatal)&&void 0!==r?r:a)||void 0===i||i,d="string"==typeof e?{message:e}:e;n.addIssue({code:"custom",...d,fatal:o})}})):ie.create()}De.create=(e,t)=>new De({innerType:e,typeName:Ve.ZodReadonly,...P(t)});const ze={object:he.lazycreate};var Ve;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Ve||(Ve={}));const Ue=J.create,Ke=X.create,Be=Pe.create,We=ee.create,Fe=te.create,qe=ae.create,He=se.create,Ye=ne.create,Ge=re.create,Je=ie.create,Qe=oe.create,Xe=de.create,et=ce.create,tt=ue.create,at=he.create,st=he.strictCreate,nt=pe.create,rt=fe.create,it=_e.create,ot=ge.create,dt=ve.create,ct=ke.create,ut=be.create,lt=xe.create,ht=we.create,pt=Ze.create,mt=Ce.create,ft=Ne.create,yt=Oe.create,_t=Se.create,gt=Ae.create,vt=Ee.create,kt=Se.createWithPreprocess,bt=$e.create,xt={string:e=>J.create({...e,coerce:!0}),number:e=>X.create({...e,coerce:!0}),boolean:e=>te.create({...e,coerce:!0}),bigint:e=>ee.create({...e,coerce:!0}),date:e=>ae.create({...e,coerce:!0})},wt=k;var Zt=Object.freeze({__proto__:null,defaultErrorMap:m,setErrorMap:function(e){f=e},getErrorMap:y,makeIssue:_,EMPTY_PATH:[],addIssueToContext:g,ParseStatus:v,INVALID:k,DIRTY:b,OK:x,isAborted:w,isDirty:Z,isValid:T,isAsync:C,get util(){return d},get objectUtil(){return c},ZodParsedType:u,getParsedType:l,ZodType:R,datetimeRegex:G,ZodString:J,ZodNumber:X,ZodBigInt:ee,ZodBoolean:te,ZodDate:ae,ZodSymbol:se,ZodUndefined:ne,ZodNull:re,ZodAny:ie,ZodUnknown:oe,ZodNever:de,ZodVoid:ce,ZodArray:ue,ZodObject:he,ZodUnion:pe,ZodDiscriminatedUnion:fe,ZodIntersection:_e,ZodTuple:ge,ZodRecord:ve,ZodMap:ke,ZodSet:be,ZodFunction:xe,ZodLazy:we,ZodLiteral:Ze,ZodEnum:Ce,ZodNativeEnum:Ne,ZodPromise:Oe,ZodEffects:Se,ZodTransformer:Se,ZodOptional:Ae,ZodNullable:Ee,ZodDefault:je,ZodCatch:Ie,ZodNaN:Pe,BRAND:Re,ZodBranded:Me,ZodPipeline:$e,ZodReadonly:De,custom:Le,Schema:R,ZodSchema:R,late:ze,get ZodFirstPartyTypeKind(){return Ve},coerce:xt,any:Je,array:tt,bigint:We,boolean:Fe,date:qe,discriminatedUnion:rt,effect:_t,enum:mt,function:lt,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Le((t=>t instanceof e),t),intersection:it,lazy:ht,literal:pt,map:ct,nan:Be,nativeEnum:ft,never:Xe,null:Ge,nullable:vt,number:Ke,object:at,oboolean:()=>Fe().optional(),onumber:()=>Ke().optional(),optional:gt,ostring:()=>Ue().optional(),pipeline:bt,preprocess:kt,promise:yt,record:dt,set:ut,strictObject:st,string:Ue,symbol:He,transformer:_t,tuple:ot,undefined:Ye,union:nt,unknown:Qe,void:et,NEVER:wt,ZodIssueCode:h,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:p});const Tt={email:(e,t=null)=>{const a=!(!t||!t.checkTypeos)&&t.checkTypeos;let s=/^(?![.!#$%&'*+/=?^_`{|}~-])(?!.*\.{2})[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]{1,63}[a-zA-Z0-9]@[a-zA-Z0-9][a-zA-Z0-9.-]{0,250}[a-zA-Z0-9]\.[a-zA-Z]{2,}$/.test(e);if(s&&a){const t=e.split("@")[1].toLowerCase();s=!i.includes(t)}return s},emailHasTrustedDomain:(e,t=null)=>{const a=e&&e.toLowerCase().split("@");if(a&&2===a.length){const e=a[1];return o.includes(e)}return!1},phoneNumber:(e,t=null)=>{const a=/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/;if(e){const t=String(e).replace(/[^0-9]/g,"");return a.test(t)}return!1},postalCode:(e,t=null)=>{const a={"en-us":/^\d{5}$/,"en-ca":/^[a-zA-Z]\d[a-zA-Z]\s?\d[a-zA-Z]\d$/}[t&&t.countryCode?t.countryCode.toLowerCase():"en-us"];return!!a&&a.test(e)},stateProvinceCode:(e,t=null)=>{const a=t&&t.countryCode?t.countryCode.toLowerCase():"en-us",s=((e,t=null)=>{const a=t?t.toLowerCase():"en-us",s=r[a];return!!s&&s.administrativeAreas[e]})(e.toUpperCase(),a);return!!s},currencyValue:(e,t=null)=>{const a=t&&t.countryCode?t.countryCode.toLowerCase():"en-us",s=r[a].currency.reduce(((e,t)=>e.replace(t,"")),e).replace(" ",""),n=/\d+\.+\d+/;return!/[^.^\d]+/.test(s)&&n.test(s)}},Ct={passwordStrength:(e,t=null)=>function(e){const t=s(e),r=n(t);return{strength:r,label:a[r]}}(e),emailCheck:(e,t=null)=>({isValid:Tt.email(e,{checkTypeos:!0}),isTrusted:Tt.emailHasTrustedDomain(e)}),ageGate:(e,t=null)=>((e,t,a=null)=>{const s=Zt.enum(["yesno","dob"]),n=Zt.coerce.date();a=a||21;let r=null;try{r=s.parse(e.toLowerCase())}catch{return{}}let i=!1,{success:o,data:d}=n.safeParse(t);switch(r){case"yesno":i=!!t,d=null;break;case"dob":if(o){const e=new Date,t=new Date(d.getFullYear()+a,d.getMonth(),d.getDate());i=!!t&&t<=e}}return{ageGateType:r,ageGatePassed:i,ageGateDOB:d||null}})(t.ageGateType||"dob",e,t.legalAge)};return e.Checkers=Ct,e.Validators=Tt,e}({});
1
+ var thirstievalidators=function(e){"use strict";const t=[78,52,0],a=["weak","acceptable","strong"];const s=e=>{const t=(/.*[0-9].*/.test(e)?10:0)+(/.*[a-z].*/.test(e)?26:0)+(/.*[A-Z].*/.test(e)?26:0)+(/.*[^a-zA-Z0-9].*/.test(e)?33:0),a=e.length;return Math.log2(t**a)},n=e=>{const a=t.findIndex((t=>e>=t));return t.length-1-a},r={"en-us":{name:"United States",alpha3:"USA",numeric:"840",administrativeAreas:{AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District of Columbia",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming"},alpha2:"US",currency:["$","USD"]},"en-ca":{name:"Canada",alpha3:"CAN",numeric:"124",administrativeAreas:{AB:"Alberta",BC:"British Columbia",MB:"Manitoba",NB:"New Brunswick",NL:"Newfoundland and Labrador",NS:"Nova Scotia",ON:"Ontario",PE:"Prince Edward Island",QC:"Quebec",SK:"Saskatchewan"},alpha1:"CA",currency:["$","CAD"]}},i=["gnail.co","gmil.com","gmsil.com","gamil.com","gmai.com","gnail.com","gmail.co","gmail.cm","gmail.co","gmal.com","gmaill.com","gmail.ca","gmal.com","gmai.com","gmaiil.com","gmail.con","gmail.comm","gmaol.com","gmail.om","gmaol.co","gmall.com","gmal.co","ail.com"],o=["gmail.com","yahoo.com","hotmail.com","aol.com","comcast.net","icloud.com","me.com","msn.com","outlook.com","sbcglobal.net","live.com","att.net","verizon.net","mac.com","ymail.com","optonline.net","cox.net","bellsouth.net","charter.net","anheuser-busch.com","mail.com","rocketmail.com","earthlink.net","aim.com","cbrands.com","kdrp.com","protonmail.com","roadrunner.com","pacbell.net","yopmail.com"];var d,c;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),s={};for(const e of a)s[e]=t[e];return e.objectValues(s)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(d||(d={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(c||(c={}));const u=d.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),l=e=>{switch(typeof e){case"undefined":return u.undefined;case"string":return u.string;case"number":return isNaN(e)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(e)?u.array:null===e?u.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?u.promise:"undefined"!=typeof Map&&e instanceof Map?u.map:"undefined"!=typeof Set&&e instanceof Set?u.set:"undefined"!=typeof Date&&e instanceof Date?u.date:u.object;default:return u.unknown}},h=d.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class p extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},a={_errors:[]},s=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(s);else if("invalid_return_type"===n.code)s(n.returnTypeError);else if("invalid_arguments"===n.code)s(n.argumentsError);else if(0===n.path.length)a._errors.push(t(n));else{let e=a,s=0;for(;s<n.path.length;){const a=n.path[s];s===n.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(n))):e[a]=e[a]||{_errors:[]},e=e[a],s++}}};return s(this),a}static assert(e){if(!(e instanceof p))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,d.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},a=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):a.push(e(s));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}p.create=e=>new p(e);const m=(e,t)=>{let a;switch(e.code){case h.invalid_type:a=e.received===u.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case h.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,d.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:a=`Unrecognized key(s) in object: ${d.joinValues(e.keys,", ")}`;break;case h.invalid_union:a="Invalid input";break;case h.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${d.joinValues(e.options)}`;break;case h.invalid_enum_value:a=`Invalid enum value. Expected ${d.joinValues(e.options)}, received '${e.received}'`;break;case h.invalid_arguments:a="Invalid function arguments";break;case h.invalid_return_type:a="Invalid function return type";break;case h.invalid_date:a="Invalid date";break;case h.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:d.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case h.too_small:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case h.too_big:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case h.custom:a="Invalid input";break;case h.invalid_intersection_types:a="Intersection results could not be merged";break;case h.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case h.not_finite:a="Number must be finite";break;default:a=t.defaultError,d.assertNever(e)}return{message:a}};let f=m;function y(){return f}const _=e=>{const{data:t,path:a,errorMaps:s,issueData:n}=e,r=[...a,...n.path||[]],i={...n,path:r};if(void 0!==n.message)return{...n,path:r,message:n.message};let o="";const d=s.filter((e=>!!e)).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...n,path:r,message:o}};function v(e,t){const a=y(),s=_({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===m?void 0:m].filter((e=>!!e))});e.common.issues.push(s)}class g{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const s of t){if("aborted"===s.status)return k;"dirty"===s.status&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t){const t=await e.key,s=await e.value;a.push({key:t,value:s})}return g.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const s of t){const{key:t,value:n}=s;if("aborted"===t.status)return k;if("aborted"===n.status)return k;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"===t.value||void 0===n.value&&!s.alwaysSet||(a[t.value]=n.value)}return{status:e.value,value:a}}}const k=Object.freeze({status:"aborted"}),b=e=>({status:"dirty",value:e}),x=e=>({status:"valid",value:e}),w=e=>"aborted"===e.status,Z=e=>"dirty"===e.status,T=e=>"valid"===e.status,C=e=>"undefined"!=typeof Promise&&e instanceof Promise;function A(e,t,a,s){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function N(e,t,a,s,n){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,a),a}var O,S,j;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(O||(O={}));class E{constructor(e,t,a,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const I=(e,t)=>{if(T(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new p(e.common.issues);return this._error=t,this._error}}};function R(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:s,description:n}=e;if(t&&(a||s))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:n};return{errorMap:(t,n)=>{var r,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:n.defaultError}:void 0===n.data?{message:null!==(r=null!=o?o:s)&&void 0!==r?r:n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:null!==(i=null!=o?o:a)&&void 0!==i?i:n.defaultError}},description:n}}class P{get description(){return this._def.description}_getType(e){return l(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new g,ctx:{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(C(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const s={common:{issues:[],async:null!==(a=null==t?void 0:t.async)&&void 0!==a&&a,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},n=this._parseSync({data:e,path:s.path,parent:s});return I(s,n)}"~validate"(e){var t,a;const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:s});return T(t)?{value:t.value}:{issues:s.common.issues}}catch(e){(null===(a=null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.toLowerCase())||void 0===a?void 0:a.includes("encountered"))&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then((e=>T(e)?{value:e.value}:{issues:s.common.issues}))}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},s=this._parse({data:e,path:a.path,parent:a}),n=await(C(s)?s:Promise.resolve(s));return I(a,n)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,s)=>{const n=e(t),r=()=>s.addIssue({code:h.custom,...a(t)});return"undefined"!=typeof Promise&&n instanceof Promise?n.then((e=>!!e||(r(),!1))):!!n||(r(),!1)}))}refinement(e,t){return this._refinement(((a,s)=>!!e(a)||(s.addIssue("function"==typeof t?t(a,s):t),!1)))}_refinement(e){return new Pe({schema:this,typeName:He.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Me.create(this,this._def)}nullable(){return $e.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ye.create(this)}promise(){return Re.create(this,this._def)}or(e){return ge.create([this,e],this._def)}and(e){return we.create(this,e,this._def)}transform(e){return new Pe({...R(this._def),schema:this,typeName:He.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new De({...R(this._def),innerType:this,defaultValue:t,typeName:He.ZodDefault})}brand(){return new Ve({typeName:He.ZodBranded,type:this,...R(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Le({...R(this._def),innerType:this,catchValue:t,typeName:He.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ue.create(this,e)}readonly(){return Ke.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const M=/^c[^\s-]{8,}$/i,$=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Z]{26}$/i,L=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,z=/^[a-z0-9_-]{21}$/i,F=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,V=/^[-+]?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)?)??$/,U=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let K;const B=/^(?:(?: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])$/,W=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,q=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,H=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Y=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,G=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,J="((\\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])))",Q=new RegExp(`^${J}$`);function X(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function ee(e){let t=`${J}T${X(e)}`;const a=[];return a.push(e.local?"Z?":"Z"),e.offset&&a.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${a.join("|")})`,new RegExp(`^${t}$`)}function te(e,t){if(!F.test(e))return!1;try{const[a]=e.split("."),s=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),n=JSON.parse(atob(s));return"object"==typeof n&&null!==n&&(!(!n.typ||!n.alg)&&(!t||n.alg===t))}catch(e){return!1}}function ae(e,t){return!("v4"!==t&&t||!W.test(e))||!("v6"!==t&&t||!H.test(e))}class se extends P{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==u.string){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.string,received:t.parsedType}),k}const t=new g;let a;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const s=e.data.length>r.value,n=e.data.length<r.value;(s||n)&&(a=this._getOrReturnCtx(e,a),s?v(a,{code:h.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):n&&v(a,{code:h.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)U.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"email",code:h.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)K||(K=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),K.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"emoji",code:h.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)L.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"uuid",code:h.invalid_string,message:r.message}),t.dirty());else if("nanoid"===r.kind)z.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"nanoid",code:h.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)M.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cuid",code:h.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)$.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cuid2",code:h.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)D.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"ulid",code:h.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch(s){a=this._getOrReturnCtx(e,a),v(a,{validation:"url",code:h.invalid_string,message:r.message}),t.dirty()}else if("regex"===r.kind){r.regex.lastIndex=0;r.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"regex",code:h.invalid_string,message:r.message}),t.dirty())}else if("trim"===r.kind)e.data=e.data.trim();else if("includes"===r.kind)e.data.includes(r.value,r.position)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty());else if("toLowerCase"===r.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===r.kind)e.data=e.data.toUpperCase();else if("startsWith"===r.kind)e.data.startsWith(r.value)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty());else if("endsWith"===r.kind)e.data.endsWith(r.value)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty());else if("datetime"===r.kind){ee(r).test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:"datetime",message:r.message}),t.dirty())}else if("date"===r.kind){Q.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:"date",message:r.message}),t.dirty())}else if("time"===r.kind){new RegExp(`^${X(r)}$`).test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:"time",message:r.message}),t.dirty())}else"duration"===r.kind?V.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"duration",code:h.invalid_string,message:r.message}),t.dirty()):"ip"===r.kind?(s=e.data,("v4"!==(n=r.version)&&n||!B.test(s))&&("v6"!==n&&n||!q.test(s))&&(a=this._getOrReturnCtx(e,a),v(a,{validation:"ip",code:h.invalid_string,message:r.message}),t.dirty())):"jwt"===r.kind?te(e.data,r.alg)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"jwt",code:h.invalid_string,message:r.message}),t.dirty()):"cidr"===r.kind?ae(e.data,r.version)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cidr",code:h.invalid_string,message:r.message}),t.dirty()):"base64"===r.kind?Y.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"base64",code:h.invalid_string,message:r.message}),t.dirty()):"base64url"===r.kind?G.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"base64url",code:h.invalid_string,message:r.message}),t.dirty()):d.assertNever(r);var s,n;return{status:t.value,value:e.data}}_regex(e,t,a){return this.refinement((t=>e.test(t)),{validation:t,code:h.invalid_string,...O.errToObj(a)})}_addCheck(e){return new se({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...O.errToObj(e)})}url(e){return this._addCheck({kind:"url",...O.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...O.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...O.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...O.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...O.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...O.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...O.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...O.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...O.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...O.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...O.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...O.errToObj(e)})}datetime(e){var t,a;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(a=null==e?void 0:e.local)&&void 0!==a&&a,...O.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...O.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...O.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...O.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...O.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...O.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...O.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...O.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...O.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...O.errToObj(t)})}nonempty(e){return this.min(1,O.errToObj(e))}trim(){return new se({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new se({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new se({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function ne(e,t){const a=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=a>s?a:s;return parseInt(e.toFixed(n).replace(".",""))%parseInt(t.toFixed(n).replace(".",""))/Math.pow(10,n)}se.create=e=>{var t;return new se({checks:[],typeName:He.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...R(e)})};class re extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==u.number){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.number,received:t.parsedType}),k}let t;const a=new g;for(const s of this._def.checks)if("int"===s.kind)d.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),v(t,{code:h.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty());else if("min"===s.kind){(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:h.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty())}else if("max"===s.kind){(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:h.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty())}else"multipleOf"===s.kind?0!==ne(e.data,s.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:h.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):"finite"===s.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),v(t,{code:h.not_finite,message:s.message}),a.dirty()):d.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,O.toString(t))}gt(e,t){return this.setLimit("min",e,!1,O.toString(t))}lte(e,t){return this.setLimit("max",e,!0,O.toString(t))}lt(e,t){return this.setLimit("max",e,!1,O.toString(t))}setLimit(e,t,a,s){return new re({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:O.toString(s)}]})}_addCheck(e){return new re({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:O.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:O.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:O.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:O.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:O.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:O.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:O.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:O.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:O.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&d.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}re.create=e=>new re({checks:[],typeName:He.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...R(e)});class ie extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let t;const a=new g;for(const s of this._def.checks)if("min"===s.kind){(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:h.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty())}else if("max"===s.kind){(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:h.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty())}else"multipleOf"===s.kind?e.data%s.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),v(t,{code:h.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):d.assertNever(s);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.bigint,received:t.parsedType}),k}gte(e,t){return this.setLimit("min",e,!0,O.toString(t))}gt(e,t){return this.setLimit("min",e,!1,O.toString(t))}lte(e,t){return this.setLimit("max",e,!0,O.toString(t))}lt(e,t){return this.setLimit("max",e,!1,O.toString(t))}setLimit(e,t,a,s){return new ie({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:O.toString(s)}]})}_addCheck(e){return new ie({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:O.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:O.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:O.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:O.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:O.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ie.create=e=>{var t;return new ie({checks:[],typeName:He.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...R(e)})};class oe extends P{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==u.boolean){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.boolean,received:t.parsedType}),k}return x(e.data)}}oe.create=e=>new oe({typeName:He.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...R(e)});class de extends P{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==u.date){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.date,received:t.parsedType}),k}if(isNaN(e.data.getTime())){return v(this._getOrReturnCtx(e),{code:h.invalid_date}),k}const t=new g;let a;for(const s of this._def.checks)"min"===s.kind?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),t.dirty()):"max"===s.kind?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),t.dirty()):d.assertNever(s);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new de({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:O.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:O.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}de.create=e=>new de({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:He.ZodDate,...R(e)});class ce extends P{_parse(e){if(this._getType(e)!==u.symbol){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.symbol,received:t.parsedType}),k}return x(e.data)}}ce.create=e=>new ce({typeName:He.ZodSymbol,...R(e)});class ue extends P{_parse(e){if(this._getType(e)!==u.undefined){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.undefined,received:t.parsedType}),k}return x(e.data)}}ue.create=e=>new ue({typeName:He.ZodUndefined,...R(e)});class le extends P{_parse(e){if(this._getType(e)!==u.null){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.null,received:t.parsedType}),k}return x(e.data)}}le.create=e=>new le({typeName:He.ZodNull,...R(e)});class he extends P{constructor(){super(...arguments),this._any=!0}_parse(e){return x(e.data)}}he.create=e=>new he({typeName:He.ZodAny,...R(e)});class pe extends P{constructor(){super(...arguments),this._unknown=!0}_parse(e){return x(e.data)}}pe.create=e=>new pe({typeName:He.ZodUnknown,...R(e)});class me extends P{_parse(e){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.never,received:t.parsedType}),k}}me.create=e=>new me({typeName:He.ZodNever,...R(e)});class fe extends P{_parse(e){if(this._getType(e)!==u.undefined){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.void,received:t.parsedType}),k}return x(e.data)}}fe.create=e=>new fe({typeName:He.ZodVoid,...R(e)});class ye extends P{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),s=this._def;if(t.parsedType!==u.array)return v(t,{code:h.invalid_type,expected:u.array,received:t.parsedType}),k;if(null!==s.exactLength){const e=t.data.length>s.exactLength.value,n=t.data.length<s.exactLength.value;(e||n)&&(v(t,{code:e?h.too_big:h.too_small,minimum:n?s.exactLength.value:void 0,maximum:e?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),a.dirty())}if(null!==s.minLength&&t.data.length<s.minLength.value&&(v(t,{code:h.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),a.dirty()),null!==s.maxLength&&t.data.length>s.maxLength.value&&(v(t,{code:h.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map(((e,a)=>s.type._parseAsync(new E(t,e,t.path,a))))).then((e=>g.mergeArray(a,e)));const n=[...t.data].map(((e,a)=>s.type._parseSync(new E(t,e,t.path,a))));return g.mergeArray(a,n)}get element(){return this._def.type}min(e,t){return new ye({...this._def,minLength:{value:e,message:O.toString(t)}})}max(e,t){return new ye({...this._def,maxLength:{value:e,message:O.toString(t)}})}length(e,t){return new ye({...this._def,exactLength:{value:e,message:O.toString(t)}})}nonempty(e){return this.min(1,e)}}function _e(e){if(e instanceof ve){const t={};for(const a in e.shape){const s=e.shape[a];t[a]=Me.create(_e(s))}return new ve({...e._def,shape:()=>t})}return e instanceof ye?new ye({...e._def,type:_e(e.element)}):e instanceof Me?Me.create(_e(e.unwrap())):e instanceof $e?$e.create(_e(e.unwrap())):e instanceof Ze?Ze.create(e.items.map((e=>_e(e)))):e}ye.create=(e,t)=>new ye({type:e,minLength:null,maxLength:null,exactLength:null,typeName:He.ZodArray,...R(t)});class ve extends P{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=d.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==u.object){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.object,received:t.parsedType}),k}const{status:t,ctx:a}=this._processInputParams(e),{shape:s,keys:n}=this._getCached(),r=[];if(!(this._def.catchall instanceof me&&"strip"===this._def.unknownKeys))for(const e in a.data)n.includes(e)||r.push(e);const i=[];for(const e of n){const t=s[e],n=a.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new E(a,n,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof me){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of r)i.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)r.length>0&&(v(a,{code:h.unrecognized_keys,keys:r}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of r){const s=a.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new E(a,s,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of i){const a=await t.key,s=await t.value;e.push({key:a,value:s,alwaysSet:t.alwaysSet})}return e})).then((e=>g.mergeObjectSync(t,e))):g.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return O.errToObj,new ve({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{var s,n,r,i;const o=null!==(r=null===(n=(s=this._def).errorMap)||void 0===n?void 0:n.call(s,t,a).message)&&void 0!==r?r:a.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=O.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new ve({...this._def,unknownKeys:"strip"})}passthrough(){return new ve({...this._def,unknownKeys:"passthrough"})}extend(e){return new ve({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ve({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:He.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ve({...this._def,catchall:e})}pick(e){const t={};return d.objectKeys(e).forEach((a=>{e[a]&&this.shape[a]&&(t[a]=this.shape[a])})),new ve({...this._def,shape:()=>t})}omit(e){const t={};return d.objectKeys(this.shape).forEach((a=>{e[a]||(t[a]=this.shape[a])})),new ve({...this._def,shape:()=>t})}deepPartial(){return _e(this)}partial(e){const t={};return d.objectKeys(this.shape).forEach((a=>{const s=this.shape[a];e&&!e[a]?t[a]=s:t[a]=s.optional()})),new ve({...this._def,shape:()=>t})}required(e){const t={};return d.objectKeys(this.shape).forEach((a=>{if(e&&!e[a])t[a]=this.shape[a];else{let e=this.shape[a];for(;e instanceof Me;)e=e._def.innerType;t[a]=e}})),new ve({...this._def,shape:()=>t})}keyof(){return je(d.objectKeys(this.shape))}}ve.create=(e,t)=>new ve({shape:()=>e,unknownKeys:"strip",catchall:me.create(),typeName:He.ZodObject,...R(t)}),ve.strictCreate=(e,t)=>new ve({shape:()=>e,unknownKeys:"strict",catchall:me.create(),typeName:He.ZodObject,...R(t)}),ve.lazycreate=(e,t)=>new ve({shape:e,unknownKeys:"strip",catchall:me.create(),typeName:He.ZodObject,...R(t)});class ge extends P{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map((async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map((e=>new p(e.ctx.common.issues)));return v(t,{code:h.invalid_union,unionErrors:a}),k}));{let e;const s=[];for(const n of a){const a={...t,common:{...t.common,issues:[]},parent:null},r=n._parseSync({data:t.data,path:t.path,parent:a});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:a}),a.common.issues.length&&s.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const n=s.map((e=>new p(e)));return v(t,{code:h.invalid_union,unionErrors:n}),k}}get options(){return this._def.options}}ge.create=(e,t)=>new ge({options:e,typeName:He.ZodUnion,...R(t)});const ke=e=>e instanceof Oe?ke(e.schema):e instanceof Pe?ke(e.innerType()):e instanceof Se?[e.value]:e instanceof Ee?e.options:e instanceof Ie?d.objectValues(e.enum):e instanceof De?ke(e._def.innerType):e instanceof ue?[void 0]:e instanceof le?[null]:e instanceof Me?[void 0,...ke(e.unwrap())]:e instanceof $e?[null,...ke(e.unwrap())]:e instanceof Ve||e instanceof Ke?ke(e.unwrap()):e instanceof Le?ke(e._def.innerType):[];class be extends P{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return v(t,{code:h.invalid_type,expected:u.object,received:t.parsedType}),k;const a=this.discriminator,s=t.data[a],n=this.optionsMap.get(s);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(v(t,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),k)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const s=new Map;for(const a of t){const t=ke(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(s.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);s.set(n,a)}}return new be({typeName:He.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...R(a)})}}function xe(e,t){const a=l(e),s=l(t);if(e===t)return{valid:!0,data:e};if(a===u.object&&s===u.object){const a=d.objectKeys(t),s=d.objectKeys(e).filter((e=>-1!==a.indexOf(e))),n={...e,...t};for(const a of s){const s=xe(e[a],t[a]);if(!s.valid)return{valid:!1};n[a]=s.data}return{valid:!0,data:n}}if(a===u.array&&s===u.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let s=0;s<e.length;s++){const n=xe(e[s],t[s]);if(!n.valid)return{valid:!1};a.push(n.data)}return{valid:!0,data:a}}return a===u.date&&s===u.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class we extends P{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),s=(e,s)=>{if(w(e)||w(s))return k;const n=xe(e.value,s.value);return n.valid?((Z(e)||Z(s))&&t.dirty(),{status:t.value,value:n.data}):(v(a,{code:h.invalid_intersection_types}),k)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then((([e,t])=>s(e,t))):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}we.create=(e,t,a)=>new we({left:e,right:t,typeName:He.ZodIntersection,...R(a)});class Ze extends P{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==u.array)return v(a,{code:h.invalid_type,expected:u.array,received:a.parsedType}),k;if(a.data.length<this._def.items.length)return v(a,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),k;!this._def.rest&&a.data.length>this._def.items.length&&(v(a,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...a.data].map(((e,t)=>{const s=this._def.items[t]||this._def.rest;return s?s._parse(new E(a,e,a.path,t)):null})).filter((e=>!!e));return a.common.async?Promise.all(s).then((e=>g.mergeArray(t,e))):g.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Ze({...this._def,rest:e})}}Ze.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ze({items:e,typeName:He.ZodTuple,rest:null,...R(t)})};class Te extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==u.object)return v(a,{code:h.invalid_type,expected:u.object,received:a.parsedType}),k;const s=[],n=this._def.keyType,r=this._def.valueType;for(const e in a.data)s.push({key:n._parse(new E(a,e,a.path,e)),value:r._parse(new E(a,a.data[e],a.path,e)),alwaysSet:e in a.data});return a.common.async?g.mergeObjectAsync(t,s):g.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,a){return new Te(t instanceof P?{keyType:e,valueType:t,typeName:He.ZodRecord,...R(a)}:{keyType:se.create(),valueType:e,typeName:He.ZodRecord,...R(t)})}}class Ce extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==u.map)return v(a,{code:h.invalid_type,expected:u.map,received:a.parsedType}),k;const s=this._def.keyType,n=this._def.valueType,r=[...a.data.entries()].map((([e,t],r)=>({key:s._parse(new E(a,e,a.path,[r,"key"])),value:n._parse(new E(a,t,a.path,[r,"value"]))})));if(a.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const a of r){const s=await a.key,n=await a.value;if("aborted"===s.status||"aborted"===n.status)return k;"dirty"!==s.status&&"dirty"!==n.status||t.dirty(),e.set(s.value,n.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const a of r){const s=a.key,n=a.value;if("aborted"===s.status||"aborted"===n.status)return k;"dirty"!==s.status&&"dirty"!==n.status||t.dirty(),e.set(s.value,n.value)}return{status:t.value,value:e}}}}Ce.create=(e,t,a)=>new Ce({valueType:t,keyType:e,typeName:He.ZodMap,...R(a)});class Ae extends P{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==u.set)return v(a,{code:h.invalid_type,expected:u.set,received:a.parsedType}),k;const s=this._def;null!==s.minSize&&a.data.size<s.minSize.value&&(v(a,{code:h.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),null!==s.maxSize&&a.data.size>s.maxSize.value&&(v(a,{code:h.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const n=this._def.valueType;function r(e){const a=new Set;for(const s of e){if("aborted"===s.status)return k;"dirty"===s.status&&t.dirty(),a.add(s.value)}return{status:t.value,value:a}}const i=[...a.data.values()].map(((e,t)=>n._parse(new E(a,e,a.path,t))));return a.common.async?Promise.all(i).then((e=>r(e))):r(i)}min(e,t){return new Ae({...this._def,minSize:{value:e,message:O.toString(t)}})}max(e,t){return new Ae({...this._def,maxSize:{value:e,message:O.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ae.create=(e,t)=>new Ae({valueType:e,minSize:null,maxSize:null,typeName:He.ZodSet,...R(t)});class Ne extends P{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.function)return v(t,{code:h.invalid_type,expected:u.function,received:t.parsedType}),k;function a(e,a){return _({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,y(),m].filter((e=>!!e)),issueData:{code:h.invalid_arguments,argumentsError:a}})}function s(e,a){return _({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,y(),m].filter((e=>!!e)),issueData:{code:h.invalid_return_type,returnTypeError:a}})}const n={errorMap:t.common.contextualErrorMap},r=t.data;if(this._def.returns instanceof Re){const e=this;return x((async function(...t){const i=new p([]),o=await e._def.args.parseAsync(t,n).catch((e=>{throw i.addIssue(a(t,e)),i})),d=await Reflect.apply(r,this,o);return await e._def.returns._def.type.parseAsync(d,n).catch((e=>{throw i.addIssue(s(d,e)),i}))}))}{const e=this;return x((function(...t){const i=e._def.args.safeParse(t,n);if(!i.success)throw new p([a(t,i.error)]);const o=Reflect.apply(r,this,i.data),d=e._def.returns.safeParse(o,n);if(!d.success)throw new p([s(o,d.error)]);return d.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ne({...this._def,args:Ze.create(e).rest(pe.create())})}returns(e){return new Ne({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new Ne({args:e||Ze.create([]).rest(pe.create()),returns:t||pe.create(),typeName:He.ZodFunction,...R(a)})}}class Oe extends P{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Oe.create=(e,t)=>new Oe({getter:e,typeName:He.ZodLazy,...R(t)});class Se extends P{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return v(t,{received:t.data,code:h.invalid_literal,expected:this._def.value}),k}return{status:"valid",value:e.data}}get value(){return this._def.value}}function je(e,t){return new Ee({values:e,typeName:He.ZodEnum,...R(t)})}Se.create=(e,t)=>new Se({value:e,typeName:He.ZodLiteral,...R(t)});class Ee extends P{constructor(){super(...arguments),S.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),a=this._def.values;return v(t,{expected:d.joinValues(a),received:t.parsedType,code:h.invalid_type}),k}if(A(this,S)||N(this,S,new Set(this._def.values)),!A(this,S).has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return v(t,{received:t.data,code:h.invalid_enum_value,options:a}),k}return x(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Ee.create(e,{...this._def,...t})}exclude(e,t=this._def){return Ee.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}S=new WeakMap,Ee.create=je;class Ie extends P{constructor(){super(...arguments),j.set(this,void 0)}_parse(e){const t=d.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==u.string&&a.parsedType!==u.number){const e=d.objectValues(t);return v(a,{expected:d.joinValues(e),received:a.parsedType,code:h.invalid_type}),k}if(A(this,j)||N(this,j,new Set(d.getValidEnumValues(this._def.values))),!A(this,j).has(e.data)){const e=d.objectValues(t);return v(a,{received:a.data,code:h.invalid_enum_value,options:e}),k}return x(e.data)}get enum(){return this._def.values}}j=new WeakMap,Ie.create=(e,t)=>new Ie({values:e,typeName:He.ZodNativeEnum,...R(t)});class Re extends P{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&!1===t.common.async)return v(t,{code:h.invalid_type,expected:u.promise,received:t.parsedType}),k;const a=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return x(a.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Re.create=(e,t)=>new Re({type:e,typeName:He.ZodPromise,...R(t)});class Pe extends P{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===He.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),s=this._def.effect||null,n={addIssue:e=>{v(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===s.type){const e=s.transform(a.data,n);if(a.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return k;const s=await this._def.schema._parseAsync({data:e,path:a.path,parent:a});return"aborted"===s.status?k:"dirty"===s.status||"dirty"===t.value?b(s.value):s}));{if("aborted"===t.value)return k;const s=this._def.schema._parseSync({data:e,path:a.path,parent:a});return"aborted"===s.status?k:"dirty"===s.status||"dirty"===t.value?b(s.value):s}}if("refinement"===s.type){const e=e=>{const t=s.refinement(e,n);if(a.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===a.common.async){const s=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===s.status?k:("dirty"===s.status&&t.dirty(),e(s.value),{status:t.value,value:s.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((a=>"aborted"===a.status?k:("dirty"===a.status&&t.dirty(),e(a.value).then((()=>({status:t.value,value:a.value}))))))}if("transform"===s.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!T(e))return e;const r=s.transform(e.value,n);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((e=>T(e)?Promise.resolve(s.transform(e.value,n)).then((e=>({status:t.value,value:e}))):e))}d.assertNever(s)}}Pe.create=(e,t,a)=>new Pe({schema:e,typeName:He.ZodEffects,effect:t,...R(a)}),Pe.createWithPreprocess=(e,t,a)=>new Pe({schema:t,effect:{type:"preprocess",transform:e},typeName:He.ZodEffects,...R(a)});class Me extends P{_parse(e){return this._getType(e)===u.undefined?x(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Me.create=(e,t)=>new Me({innerType:e,typeName:He.ZodOptional,...R(t)});class $e extends P{_parse(e){return this._getType(e)===u.null?x(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$e.create=(e,t)=>new $e({innerType:e,typeName:He.ZodNullable,...R(t)});class De extends P{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===u.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}De.create=(e,t)=>new De({innerType:e,typeName:He.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...R(t)});class Le extends P{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return C(s)?s.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new p(a.common.issues)},input:a.data})}))):{status:"valid",value:"valid"===s.status?s.value:this._def.catchValue({get error(){return new p(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Le.create=(e,t)=>new Le({innerType:e,typeName:He.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...R(t)});class ze extends P{_parse(e){if(this._getType(e)!==u.nan){const t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:u.nan,received:t.parsedType}),k}return{status:"valid",value:e.data}}}ze.create=e=>new ze({typeName:He.ZodNaN,...R(e)});const Fe=Symbol("zod_brand");class Ve extends P{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ue extends P{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?k:"dirty"===e.status?(t.dirty(),b(e.value)):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})()}{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?k:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new Ue({in:e,out:t,typeName:He.ZodPipeline})}}class Ke extends P{_parse(e){const t=this._def.innerType._parse(e),a=e=>(T(e)&&(e.value=Object.freeze(e.value)),e);return C(t)?t.then((e=>a(e))):a(t)}unwrap(){return this._def.innerType}}function Be(e,t){const a="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof a?{message:a}:a}function We(e,t={},a){return e?he.create().superRefine(((s,n)=>{var r,i;const o=e(s);if(o instanceof Promise)return o.then((e=>{var r,i;if(!e){const e=Be(t,s),o=null===(i=null!==(r=e.fatal)&&void 0!==r?r:a)||void 0===i||i;n.addIssue({code:"custom",...e,fatal:o})}}));if(!o){const e=Be(t,s),o=null===(i=null!==(r=e.fatal)&&void 0!==r?r:a)||void 0===i||i;n.addIssue({code:"custom",...e,fatal:o})}})):he.create()}Ke.create=(e,t)=>new Ke({innerType:e,typeName:He.ZodReadonly,...R(t)});const qe={object:ve.lazycreate};var He;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(He||(He={}));const Ye=se.create,Ge=re.create,Je=ze.create,Qe=ie.create,Xe=oe.create,et=de.create,tt=ce.create,at=ue.create,st=le.create,nt=he.create,rt=pe.create,it=me.create,ot=fe.create,dt=ye.create,ct=ve.create,ut=ve.strictCreate,lt=ge.create,ht=be.create,pt=we.create,mt=Ze.create,ft=Te.create,yt=Ce.create,_t=Ae.create,vt=Ne.create,gt=Oe.create,kt=Se.create,bt=Ee.create,xt=Ie.create,wt=Re.create,Zt=Pe.create,Tt=Me.create,Ct=$e.create,At=Pe.createWithPreprocess,Nt=Ue.create,Ot={string:e=>se.create({...e,coerce:!0}),number:e=>re.create({...e,coerce:!0}),boolean:e=>oe.create({...e,coerce:!0}),bigint:e=>ie.create({...e,coerce:!0}),date:e=>de.create({...e,coerce:!0})},St=k;var jt=Object.freeze({__proto__:null,defaultErrorMap:m,setErrorMap:function(e){f=e},getErrorMap:y,makeIssue:_,EMPTY_PATH:[],addIssueToContext:v,ParseStatus:g,INVALID:k,DIRTY:b,OK:x,isAborted:w,isDirty:Z,isValid:T,isAsync:C,get util(){return d},get objectUtil(){return c},ZodParsedType:u,getParsedType:l,ZodType:P,datetimeRegex:ee,ZodString:se,ZodNumber:re,ZodBigInt:ie,ZodBoolean:oe,ZodDate:de,ZodSymbol:ce,ZodUndefined:ue,ZodNull:le,ZodAny:he,ZodUnknown:pe,ZodNever:me,ZodVoid:fe,ZodArray:ye,ZodObject:ve,ZodUnion:ge,ZodDiscriminatedUnion:be,ZodIntersection:we,ZodTuple:Ze,ZodRecord:Te,ZodMap:Ce,ZodSet:Ae,ZodFunction:Ne,ZodLazy:Oe,ZodLiteral:Se,ZodEnum:Ee,ZodNativeEnum:Ie,ZodPromise:Re,ZodEffects:Pe,ZodTransformer:Pe,ZodOptional:Me,ZodNullable:$e,ZodDefault:De,ZodCatch:Le,ZodNaN:ze,BRAND:Fe,ZodBranded:Ve,ZodPipeline:Ue,ZodReadonly:Ke,custom:We,Schema:P,ZodSchema:P,late:qe,get ZodFirstPartyTypeKind(){return He},coerce:Ot,any:nt,array:dt,bigint:Qe,boolean:Xe,date:et,discriminatedUnion:ht,effect:Zt,enum:bt,function:vt,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>We((t=>t instanceof e),t),intersection:pt,lazy:gt,literal:kt,map:yt,nan:Je,nativeEnum:xt,never:it,null:st,nullable:Ct,number:Ge,object:ct,oboolean:()=>Xe().optional(),onumber:()=>Ge().optional(),optional:Tt,ostring:()=>Ye().optional(),pipeline:Nt,preprocess:At,promise:wt,record:ft,set:_t,strictObject:ut,string:Ye,symbol:tt,transformer:Zt,tuple:mt,undefined:at,union:lt,unknown:rt,void:ot,NEVER:St,ZodIssueCode:h,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:p});const Et={email:(e,t=null)=>{const a=!(!t||!t.checkTypeos)&&t.checkTypeos;let s=/^(?![.!#$%&'*+/=?^_`{|}~-])(?!.*\.{2})[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]{1,63}[a-zA-Z0-9]@[a-zA-Z0-9][a-zA-Z0-9.-]{0,250}[a-zA-Z0-9]\.[a-zA-Z]{2,}$/.test(e);if(s&&a){const t=e.split("@")[1].toLowerCase();s=!i.includes(t)}return s},emailHasTrustedDomain:(e,t=null)=>{const a=e&&e.toLowerCase().split("@");if(a&&2===a.length){const e=a[1];return o.includes(e)}return!1},phoneNumber:(e,t=null)=>{const a=/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/;if(e){const t=String(e).replace(/[^0-9]/g,"");return a.test(t)}return!1},postalCode:(e,t=null)=>{const a={"en-us":/^\d{5}$/,"en-ca":/^[a-zA-Z]\d[a-zA-Z]\s?\d[a-zA-Z]\d$/}[t&&t.countryCode?t.countryCode.toLowerCase():"en-us"];return!!a&&a.test(e)},stateProvinceCode:(e,t=null)=>{const a=t&&t.countryCode?t.countryCode.toLowerCase():"en-us",s=((e,t=null)=>{const a=t?t.toLowerCase():"en-us",s=r[a];return!!s&&s.administrativeAreas[e]})(e.toUpperCase(),a);return!!s},currencyValue:(e,t=null)=>{const a=t&&t.countryCode?t.countryCode.toLowerCase():"en-us",s=r[a].currency.reduce(((e,t)=>e.replace(t,"")),e).replace(" ",""),n=/\d+\.+\d+/;return!/[^.^\d]+/.test(s)&&n.test(s)}},It={passwordStrength:(e,t=null)=>function(e){const t=s(e),r=n(t);return{strength:r,label:a[r]}}(e),emailCheck:(e,t=null)=>({isValid:Et.email(e,{checkTypeos:!0}),isTrusted:Et.emailHasTrustedDomain(e)}),ageGate:(e,t=null)=>((e,t,a=null)=>{const s=jt.enum(["yesno","dob"]),n=jt.coerce.date();a=a||21;let r=null;try{r=s.parse(e.toLowerCase())}catch{return{}}let i=!1,{success:o,data:d}=n.safeParse(t);switch(r){case"yesno":i=!!t,d=null;break;case"dob":if(o){const e=new Date,t=new Date(d.getFullYear()+a,d.getMonth(),d.getDate());i=!!t&&t<=e}}return{ageGateType:r,ageGatePassed:i,ageGateDOB:d||null}})(t.ageGateType||"dob",e,t.legalAge)};return e.Checkers=It,e.Validators=Et,e}({});