@fern-api/typescript-dynamic-snippets 3.88.3 → 3.89.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.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ ${o}`);this.isAtStartOfLine()&&(u=o+u),r&&(u+=`
|
|
|
16
16
|
${e}`)}return e}toString(){let e=this.getContent();if(this.formatter!=null)try{return this.formatter.formatSync(e)}catch(t){throw new Error(`Failed to format TypeScript file: ${t}
|
|
17
17
|
${e}`)}return e}getContent(){let e=this.stringifyImports();return e.length>0?e+`
|
|
18
18
|
`+this.buffer:this.buffer}stringifyImports(){let e="";for(let[t,r]of Object.entries(this.imports)){let a=this.defaultImports[t],o="",u=r.filter(x=>x.importFrom?.type==="named"),h=this.starImportAliases[t];if(u.length>0||a!=null||h!=null){if(e+="import",a!=null&&(e+=` ${a.name}`),u.length>0){for(let E of u.slice(0,-1))o+=`${E.name}, `;let x=u[u.length-1];x!=null&&(o+=`${x.name}`),a!=null&&(e+=","),e+=` { ${o} }`}h!=null&&((a!=null||u.length>0)&&(e+=", "),e+=` * as ${h}`),e+=` from "${t}";
|
|
19
|
-
`}}return e}};var W=class extends $e{async toStringAsync({customConfig:e,formatter:t}){let r=new Ut({customConfig:e,formatter:t});return this.write(r),await r.toStringAsync()}toString({customConfig:e,formatter:t}){let r=new Ut({customConfig:e,formatter:t});return this.write(r),r.toString()}};p();f();d();p();f();d();var m={};ue(m,{BRAND:()=>Mu,DIRTY:()=>De,EMPTY_PATH:()=>yu,INVALID:()=>B,NEVER:()=>_l,OK:()=>ee,ParseStatus:()=>X,Schema:()=>L,ZodAny:()=>Fe,ZodArray:()=>ke,ZodBigInt:()=>We,ZodBoolean:()=>qe,ZodBranded:()=>Dt,ZodCatch:()=>tt,ZodDate:()=>ze,ZodDefault:()=>et,ZodDiscriminatedUnion:()=>nr,ZodEffects:()=>pe,ZodEnum:()=>Xe,ZodError:()=>ae,ZodFirstPartyTypeKind:()=>F,ZodFunction:()=>ar,ZodIntersection:()=>Je,ZodIssueCode:()=>T,ZodLazy:()=>Ye,ZodLiteral:()=>Ke,ZodMap:()=>yt,ZodNaN:()=>xt,ZodNativeEnum:()=>Qe,ZodNever:()=>me,ZodNull:()=>Ge,ZodNullable:()=>ve,ZodNumber:()=>Ve,ZodObject:()=>se,ZodOptional:()=>le,ZodParsedType:()=>S,ZodPipeline:()=>Vt,ZodPromise:()=>Oe,ZodReadonly:()=>rt,ZodRecord:()=>ir,ZodSchema:()=>L,ZodSet:()=>gt,ZodString:()=>Be,ZodSymbol:()=>mt,ZodTransformer:()=>pe,ZodTuple:()=>xe,ZodType:()=>L,ZodUndefined:()=>Ze,ZodUnion:()=>He,ZodUnknown:()=>Ie,ZodVoid:()=>ht,addIssueToContext:()=>A,any:()=>Gu,array:()=>Ku,bigint:()=>Vu,boolean:()=>Na,coerce:()=>wl,custom:()=>Aa,date:()=>Wu,datetimeRegex:()=>Ia,defaultErrorMap:()=>Te,discriminatedUnion:()=>tl,effect:()=>fl,enum:()=>cl,function:()=>ol,getErrorMap:()=>pt,getParsedType:()=>ge,instanceof:()=>$u,intersection:()=>rl,isAborted:()=>tr,isAsync:()=>dt,isDirty:()=>rr,isValid:()=>Ce,late:()=>Uu,lazy:()=>ul,literal:()=>ll,makeIssue:()=>$t,map:()=>al,nan:()=>Du,nativeEnum:()=>pl,never:()=>Ju,null:()=>Zu,nullable:()=>hl,number:()=>Sa,object:()=>Xu,objectUtil:()=>wr,oboolean:()=>bl,onumber:()=>vl,optional:()=>ml,ostring:()=>xl,pipeline:()=>gl,preprocess:()=>yl,promise:()=>dl,quotelessJson:()=>fu,record:()=>il,set:()=>sl,setErrorMap:()=>hu,strictObject:()=>Qu,string:()=>Ra,symbol:()=>qu,transformer:()=>fl,tuple:()=>nl,undefined:()=>zu,union:()=>el,unknown:()=>Hu,util:()=>U,void:()=>Yu});p();f();d();p();f();d();p();f();d();p();f();d();p();f();d();var U;(function(n){n.assertEqual=a=>{};function e(a){}n.assertIs=e;function t(a){throw new Error}n.assertNever=t,n.arrayToEnum=a=>{let o={};for(let u of a)o[u]=u;return o},n.getValidEnumValues=a=>{let o=n.objectKeys(a).filter(h=>typeof a[a[h]]!="number"),u={};for(let h of o)u[h]=a[h];return n.objectValues(u)},n.objectValues=a=>n.objectKeys(a).map(function(o){return a[o]}),n.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let o=[];for(let u in a)Object.prototype.hasOwnProperty.call(a,u)&&o.push(u);return o},n.find=(a,o)=>{for(let u of a)if(o(u))return u},n.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,o=" | "){return a.map(u=>typeof u=="string"?`'${u}'`:u).join(o)}n.joinValues=r,n.jsonStringifyReplacer=(a,o)=>typeof o=="bigint"?o.toString():o})(U||(U={}));var wr;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(wr||(wr={}));var S=U.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ge=n=>{switch(typeof n){case"undefined":return S.undefined;case"string":return S.string;case"number":return Number.isNaN(n)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(n)?S.array:n===null?S.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?S.promise:typeof Map<"u"&&n instanceof Map?S.map:typeof Set<"u"&&n instanceof Set?S.set:typeof Date<"u"&&n instanceof Date?S.date:S.object;default:return S.unknown}};var T=U.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"]),fu=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),ae=class n extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(o){return o.message},r={_errors:[]},a=o=>{for(let u of o.issues)if(u.code==="invalid_union")u.unionErrors.map(a);else if(u.code==="invalid_return_type")a(u.returnTypeError);else if(u.code==="invalid_arguments")a(u.argumentsError);else if(u.path.length===0)r._errors.push(t(u));else{let h=r,x=0;for(;x<u.path.length;){let E=u.path[x];x===u.path.length-1?(h[E]=h[E]||{_errors:[]},h[E]._errors.push(t(u))):h[E]=h[E]||{_errors:[]},h=h[E],x++}}};return a(this),r}static assert(e){if(!(e instanceof n))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,U.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},r=[];for(let a of this.issues)if(a.path.length>0){let o=a.path[0];t[o]=t[o]||[],t[o].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}};ae.create=n=>new ae(n);var mu=(n,e)=>{let t;switch(n.code){case T.invalid_type:n.received===S.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case T.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,U.jsonStringifyReplacer)}`;break;case T.unrecognized_keys:t=`Unrecognized key(s) in object: ${U.joinValues(n.keys,", ")}`;break;case T.invalid_union:t="Invalid input";break;case T.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${U.joinValues(n.options)}`;break;case T.invalid_enum_value:t=`Invalid enum value. Expected ${U.joinValues(n.options)}, received '${n.received}'`;break;case T.invalid_arguments:t="Invalid function arguments";break;case T.invalid_return_type:t="Invalid function return type";break;case T.invalid_date:t="Invalid date";break;case T.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:U.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case T.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case T.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case T.custom:t="Invalid input";break;case T.invalid_intersection_types:t="Intersection results could not be merged";break;case T.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case T.not_finite:t="Number must be finite";break;default:t=e.defaultError,U.assertNever(n)}return{message:t}},Te=mu;var ba=Te;function hu(n){ba=n}function pt(){return ba}p();f();d();var $t=n=>{let{data:e,path:t,errorMaps:r,issueData:a}=n,o=[...t,...a.path||[]],u={...a,path:o};if(a.message!==void 0)return{...a,path:o,message:a.message};let h="",x=r.filter(E=>!!E).slice().reverse();for(let E of x)h=E(u,{data:e,defaultError:h}).message;return{...a,path:o,message:h}},yu=[];function A(n,e){let t=pt(),r=$t({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===Te?void 0:Te].filter(a=>!!a)});n.common.issues.push(r)}var X=class n{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let a of t){if(a.status==="aborted")return B;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let a of t){let o=await a.key,u=await a.value;r.push({key:o,value:u})}return n.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let a of t){let{key:o,value:u}=a;if(o.status==="aborted"||u.status==="aborted")return B;o.status==="dirty"&&e.dirty(),u.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof u.value<"u"||a.alwaysSet)&&(r[o.value]=u.value)}return{status:e.value,value:r}}},B=Object.freeze({status:"aborted"}),De=n=>({status:"dirty",value:n}),ee=n=>({status:"valid",value:n}),tr=n=>n.status==="aborted",rr=n=>n.status==="dirty",Ce=n=>n.status==="valid",dt=n=>typeof Promise<"u"&&n instanceof Promise;p();f();d();p();f();d();var N;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e?.message})(N||(N={}));var ce=class{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},wa=(n,e)=>{if(Ce(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new ae(n.common.issues);return this._error=t,this._error}}};function O(n){if(!n)return{};let{errorMap:e,invalid_type_error:t,required_error:r,description:a}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(u,h)=>{let{message:x}=n;return u.code==="invalid_enum_value"?{message:x??h.defaultError}:typeof h.data>"u"?{message:x??r??h.defaultError}:u.code!=="invalid_type"?{message:h.defaultError}:{message:x??t??h.defaultError}},description:a}}var L=class{get description(){return this._def.description}_getType(e){return ge(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ge(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new X,ctx:{common:e.parent.common,data:e.data,parsedType:ge(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(dt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ge(e)},a=this._parseSync({data:e,path:r.path,parent:r});return wa(r,a)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ge(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return Ce(r)?{value:r.value}:{issues:t.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(r=>Ce(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ge(e)},a=this._parse({data:e,path:r.path,parent:r}),o=await(dt(a)?a:Promise.resolve(a));return wa(r,o)}refine(e,t){let r=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,o)=>{let u=e(a),h=()=>o.addIssue({code:T.custom,...r(a)});return typeof Promise<"u"&&u instanceof Promise?u.then(x=>x?!0:(h(),!1)):u?!0:(h(),!1)})}refinement(e,t){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof t=="function"?t(r,a):t),!1))}_refinement(e){return new pe({schema:this,typeName:F.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:t=>this["~validate"](t)}}optional(){return le.create(this,this._def)}nullable(){return ve.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ke.create(this)}promise(){return Oe.create(this,this._def)}or(e){return He.create([this,e],this._def)}and(e){return Je.create(this,e,this._def)}transform(e){return new pe({...O(this._def),schema:this,typeName:F.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new et({...O(this._def),innerType:this,defaultValue:t,typeName:F.ZodDefault})}brand(){return new Dt({typeName:F.ZodBranded,type:this,...O(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new tt({...O(this._def),innerType:this,catchValue:t,typeName:F.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Vt.create(this,e)}readonly(){return rt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},gu=/^c[^\s-]{8,}$/i,xu=/^[0-9a-z]+$/,vu=/^[0-9A-HJKMNP-TV-Z]{26}$/i,bu=/^[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,wu=/^[a-z0-9_-]{21}$/i,_u=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Tu=/^[-+]?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)?)??$/,Eu=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Iu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",_r,ku=/^(?:(?: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])$/,Au=/^(?:(?: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])$/,Ru=/^(([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]))$/,Su=/^(([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])$/,Nu=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Cu=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ta="((\\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])))",Bu=new RegExp(`^${Ta}$`);function Ea(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);let t=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Fu(n){return new RegExp(`^${Ea(n)}$`)}function Ia(n){let e=`${Ta}T${Ea(n)}`,t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Ou(n,e){return!!((e==="v4"||!e)&&ku.test(n)||(e==="v6"||!e)&&Ru.test(n))}function Lu(n,e){if(!_u.test(n))return!1;try{let[t]=n.split(".");if(!t)return!1;let r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function Pu(n,e){return!!((e==="v4"||!e)&&Au.test(n)||(e==="v6"||!e)&&Su.test(n))}var Be=class n extends L{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==S.string){let o=this._getOrReturnCtx(e);return A(o,{code:T.invalid_type,expected:S.string,received:o.parsedType}),B}let r=new X,a;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(a=this._getOrReturnCtx(e,a),A(a,{code:T.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(a=this._getOrReturnCtx(e,a),A(a,{code:T.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let u=e.data.length>o.value,h=e.data.length<o.value;(u||h)&&(a=this._getOrReturnCtx(e,a),u?A(a,{code:T.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):h&&A(a,{code:T.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Eu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"email",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")_r||(_r=new RegExp(Iu,"u")),_r.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"emoji",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")bu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"uuid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")wu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"nanoid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")gu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"cuid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")xu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"cuid2",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")vu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"ulid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),A(a,{validation:"url",code:T.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"regex",code:T.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(e,a),A(a,{code:T.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(a=this._getOrReturnCtx(e,a),A(a,{code:T.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(a=this._getOrReturnCtx(e,a),A(a,{code:T.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Ia(o).test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{code:T.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?Bu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{code:T.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Fu(o).test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{code:T.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?Tu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"duration",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?Ou(e.data,o.version)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"ip",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?Lu(e.data,o.alg)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"jwt",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?Pu(e.data,o.version)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"cidr",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?Nu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"base64",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?Cu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"base64url",code:T.invalid_string,message:o.message}),r.dirty()):U.assertNever(o);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(a=>e.test(a),{validation:t,code:T.invalid_string,...N.errToObj(r)})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...N.errToObj(e)})}url(e){return this._addCheck({kind:"url",...N.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...N.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...N.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...N.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...N.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...N.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...N.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...N.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...N.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...N.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...N.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...N.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...N.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...N.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...N.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...N.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...N.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...N.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...N.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...N.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...N.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...N.errToObj(t)})}nonempty(e){return this.min(1,N.errToObj(e))}trim(){return new n({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Be.create=n=>new Be({checks:[],typeName:F.ZodString,coerce:n?.coerce??!1,...O(n)});function ju(n,e){let t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=t>r?t:r,o=Number.parseInt(n.toFixed(a).replace(".","")),u=Number.parseInt(e.toFixed(a).replace(".",""));return o%u/10**a}var Ve=class n extends L{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==S.number){let o=this._getOrReturnCtx(e);return A(o,{code:T.invalid_type,expected:S.number,received:o.parsedType}),B}let r,a=new X;for(let o of this._def.checks)o.kind==="int"?U.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),A(r,{code:T.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),A(r,{code:T.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),A(r,{code:T.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="multipleOf"?ju(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),A(r,{code:T.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),A(r,{code:T.not_finite,message:o.message}),a.dirty()):U.assertNever(o);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,N.toString(t))}gt(e,t){return this.setLimit("min",e,!1,N.toString(t))}lte(e,t){return this.setLimit("max",e,!0,N.toString(t))}lt(e,t){return this.setLimit("max",e,!1,N.toString(t))}setLimit(e,t,r,a){return new n({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:N.toString(a)}]})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:N.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:N.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:N.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:N.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:N.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:N.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&U.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}};Ve.create=n=>new Ve({checks:[],typeName:F.ZodNumber,coerce:n?.coerce||!1,...O(n)});var We=class n extends L{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==S.bigint)return this._getInvalidInput(e);let r,a=new X;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),A(r,{code:T.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),A(r,{code:T.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),A(r,{code:T.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):U.assertNever(o);return{status:a.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return A(t,{code:T.invalid_type,expected:S.bigint,received:t.parsedType}),B}gte(e,t){return this.setLimit("min",e,!0,N.toString(t))}gt(e,t){return this.setLimit("min",e,!1,N.toString(t))}lte(e,t){return this.setLimit("max",e,!0,N.toString(t))}lt(e,t){return this.setLimit("max",e,!1,N.toString(t))}setLimit(e,t,r,a){return new n({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:N.toString(a)}]})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:N.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:N.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};We.create=n=>new We({checks:[],typeName:F.ZodBigInt,coerce:n?.coerce??!1,...O(n)});var qe=class extends L{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==S.boolean){let r=this._getOrReturnCtx(e);return A(r,{code:T.invalid_type,expected:S.boolean,received:r.parsedType}),B}return ee(e.data)}};qe.create=n=>new qe({typeName:F.ZodBoolean,coerce:n?.coerce||!1,...O(n)});var ze=class n extends L{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==S.date){let o=this._getOrReturnCtx(e);return A(o,{code:T.invalid_type,expected:S.date,received:o.parsedType}),B}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return A(o,{code:T.invalid_date}),B}let r=new X,a;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(a=this._getOrReturnCtx(e,a),A(a,{code:T.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(a=this._getOrReturnCtx(e,a),A(a,{code:T.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):U.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:N.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:N.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};ze.create=n=>new ze({checks:[],coerce:n?.coerce||!1,typeName:F.ZodDate,...O(n)});var mt=class extends L{_parse(e){if(this._getType(e)!==S.symbol){let r=this._getOrReturnCtx(e);return A(r,{code:T.invalid_type,expected:S.symbol,received:r.parsedType}),B}return ee(e.data)}};mt.create=n=>new mt({typeName:F.ZodSymbol,...O(n)});var Ze=class extends L{_parse(e){if(this._getType(e)!==S.undefined){let r=this._getOrReturnCtx(e);return A(r,{code:T.invalid_type,expected:S.undefined,received:r.parsedType}),B}return ee(e.data)}};Ze.create=n=>new Ze({typeName:F.ZodUndefined,...O(n)});var Ge=class extends L{_parse(e){if(this._getType(e)!==S.null){let r=this._getOrReturnCtx(e);return A(r,{code:T.invalid_type,expected:S.null,received:r.parsedType}),B}return ee(e.data)}};Ge.create=n=>new Ge({typeName:F.ZodNull,...O(n)});var Fe=class extends L{constructor(){super(...arguments),this._any=!0}_parse(e){return ee(e.data)}};Fe.create=n=>new Fe({typeName:F.ZodAny,...O(n)});var Ie=class extends L{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ee(e.data)}};Ie.create=n=>new Ie({typeName:F.ZodUnknown,...O(n)});var me=class extends L{_parse(e){let t=this._getOrReturnCtx(e);return A(t,{code:T.invalid_type,expected:S.never,received:t.parsedType}),B}};me.create=n=>new me({typeName:F.ZodNever,...O(n)});var ht=class extends L{_parse(e){if(this._getType(e)!==S.undefined){let r=this._getOrReturnCtx(e);return A(r,{code:T.invalid_type,expected:S.void,received:r.parsedType}),B}return ee(e.data)}};ht.create=n=>new ht({typeName:F.ZodVoid,...O(n)});var ke=class n extends L{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==S.array)return A(t,{code:T.invalid_type,expected:S.array,received:t.parsedType}),B;if(a.exactLength!==null){let u=t.data.length>a.exactLength.value,h=t.data.length<a.exactLength.value;(u||h)&&(A(t,{code:u?T.too_big:T.too_small,minimum:h?a.exactLength.value:void 0,maximum:u?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(A(t,{code:T.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(A(t,{code:T.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((u,h)=>a.type._parseAsync(new ce(t,u,t.path,h)))).then(u=>X.mergeArray(r,u));let o=[...t.data].map((u,h)=>a.type._parseSync(new ce(t,u,t.path,h)));return X.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new n({...this._def,minLength:{value:e,message:N.toString(t)}})}max(e,t){return new n({...this._def,maxLength:{value:e,message:N.toString(t)}})}length(e,t){return new n({...this._def,exactLength:{value:e,message:N.toString(t)}})}nonempty(e){return this.min(1,e)}};ke.create=(n,e)=>new ke({type:n,minLength:null,maxLength:null,exactLength:null,typeName:F.ZodArray,...O(e)});function ft(n){if(n instanceof se){let e={};for(let t in n.shape){let r=n.shape[t];e[t]=le.create(ft(r))}return new se({...n._def,shape:()=>e})}else return n instanceof ke?new ke({...n._def,type:ft(n.element)}):n instanceof le?le.create(ft(n.unwrap())):n instanceof ve?ve.create(ft(n.unwrap())):n instanceof xe?xe.create(n.items.map(e=>ft(e))):n}var se=class n extends L{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=U.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==S.object){let E=this._getOrReturnCtx(e);return A(E,{code:T.invalid_type,expected:S.object,received:E.parsedType}),B}let{status:r,ctx:a}=this._processInputParams(e),{shape:o,keys:u}=this._getCached(),h=[];if(!(this._def.catchall instanceof me&&this._def.unknownKeys==="strip"))for(let E in a.data)u.includes(E)||h.push(E);let x=[];for(let E of u){let R=o[E],P=a.data[E];x.push({key:{status:"valid",value:E},value:R._parse(new ce(a,P,a.path,E)),alwaysSet:E in a.data})}if(this._def.catchall instanceof me){let E=this._def.unknownKeys;if(E==="passthrough")for(let R of h)x.push({key:{status:"valid",value:R},value:{status:"valid",value:a.data[R]}});else if(E==="strict")h.length>0&&(A(a,{code:T.unrecognized_keys,keys:h}),r.dirty());else if(E!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let E=this._def.catchall;for(let R of h){let P=a.data[R];x.push({key:{status:"valid",value:R},value:E._parse(new ce(a,P,a.path,R)),alwaysSet:R in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let E=[];for(let R of x){let P=await R.key,Y=await R.value;E.push({key:P,value:Y,alwaysSet:R.alwaysSet})}return E}).then(E=>X.mergeObjectSync(r,E)):X.mergeObjectSync(r,x)}get shape(){return this._def.shape()}strict(e){return N.errToObj,new n({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{let a=this._def.errorMap?.(t,r).message??r.defaultError;return t.code==="unrecognized_keys"?{message:N.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new n({...this._def,unknownKeys:"strip"})}passthrough(){return new n({...this._def,unknownKeys:"passthrough"})}extend(e){return new n({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new n({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:F.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new n({...this._def,catchall:e})}pick(e){let t={};for(let r of U.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new n({...this._def,shape:()=>t})}omit(e){let t={};for(let r of U.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new n({...this._def,shape:()=>t})}deepPartial(){return ft(this)}partial(e){let t={};for(let r of U.objectKeys(this.shape)){let a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}return new n({...this._def,shape:()=>t})}required(e){let t={};for(let r of U.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof le;)o=o._def.innerType;t[r]=o}return new n({...this._def,shape:()=>t})}keyof(){return ka(U.objectKeys(this.shape))}};se.create=(n,e)=>new se({shape:()=>n,unknownKeys:"strip",catchall:me.create(),typeName:F.ZodObject,...O(e)});se.strictCreate=(n,e)=>new se({shape:()=>n,unknownKeys:"strict",catchall:me.create(),typeName:F.ZodObject,...O(e)});se.lazycreate=(n,e)=>new se({shape:n,unknownKeys:"strip",catchall:me.create(),typeName:F.ZodObject,...O(e)});var He=class extends L{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function a(o){for(let h of o)if(h.result.status==="valid")return h.result;for(let h of o)if(h.result.status==="dirty")return t.common.issues.push(...h.ctx.common.issues),h.result;let u=o.map(h=>new ae(h.ctx.common.issues));return A(t,{code:T.invalid_union,unionErrors:u}),B}if(t.common.async)return Promise.all(r.map(async o=>{let u={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:u}),ctx:u}})).then(a);{let o,u=[];for(let x of r){let E={...t,common:{...t.common,issues:[]},parent:null},R=x._parseSync({data:t.data,path:t.path,parent:E});if(R.status==="valid")return R;R.status==="dirty"&&!o&&(o={result:R,ctx:E}),E.common.issues.length&&u.push(E.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let h=u.map(x=>new ae(x));return A(t,{code:T.invalid_union,unionErrors:h}),B}}get options(){return this._def.options}};He.create=(n,e)=>new He({options:n,typeName:F.ZodUnion,...O(e)});var Ee=n=>n instanceof Ye?Ee(n.schema):n instanceof pe?Ee(n.innerType()):n instanceof Ke?[n.value]:n instanceof Xe?n.options:n instanceof Qe?U.objectValues(n.enum):n instanceof et?Ee(n._def.innerType):n instanceof Ze?[void 0]:n instanceof Ge?[null]:n instanceof le?[void 0,...Ee(n.unwrap())]:n instanceof ve?[null,...Ee(n.unwrap())]:n instanceof Dt||n instanceof rt?Ee(n.unwrap()):n instanceof tt?Ee(n._def.innerType):[],nr=class n extends L{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.object)return A(t,{code:T.invalid_type,expected:S.object,received:t.parsedType}),B;let r=this.discriminator,a=t.data[r],o=this.optionsMap.get(a);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(A(t,{code:T.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),B)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let a=new Map;for(let o of t){let u=Ee(o.shape[e]);if(!u.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let h of u){if(a.has(h))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(h)}`);a.set(h,o)}}return new n({typeName:F.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...O(r)})}};function Tr(n,e){let t=ge(n),r=ge(e);if(n===e)return{valid:!0,data:n};if(t===S.object&&r===S.object){let a=U.objectKeys(e),o=U.objectKeys(n).filter(h=>a.indexOf(h)!==-1),u={...n,...e};for(let h of o){let x=Tr(n[h],e[h]);if(!x.valid)return{valid:!1};u[h]=x.data}return{valid:!0,data:u}}else if(t===S.array&&r===S.array){if(n.length!==e.length)return{valid:!1};let a=[];for(let o=0;o<n.length;o++){let u=n[o],h=e[o],x=Tr(u,h);if(!x.valid)return{valid:!1};a.push(x.data)}return{valid:!0,data:a}}else return t===S.date&&r===S.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}var Je=class extends L{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),a=(o,u)=>{if(tr(o)||tr(u))return B;let h=Tr(o.value,u.value);return h.valid?((rr(o)||rr(u))&&t.dirty(),{status:t.value,value:h.data}):(A(r,{code:T.invalid_intersection_types}),B)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,u])=>a(o,u)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Je.create=(n,e,t)=>new Je({left:n,right:e,typeName:F.ZodIntersection,...O(t)});var xe=class n extends L{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==S.array)return A(r,{code:T.invalid_type,expected:S.array,received:r.parsedType}),B;if(r.data.length<this._def.items.length)return A(r,{code:T.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),B;!this._def.rest&&r.data.length>this._def.items.length&&(A(r,{code:T.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let o=[...r.data].map((u,h)=>{let x=this._def.items[h]||this._def.rest;return x?x._parse(new ce(r,u,r.path,h)):null}).filter(u=>!!u);return r.common.async?Promise.all(o).then(u=>X.mergeArray(t,u)):X.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new n({...this._def,rest:e})}};xe.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xe({items:n,typeName:F.ZodTuple,rest:null,...O(e)})};var ir=class n extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==S.object)return A(r,{code:T.invalid_type,expected:S.object,received:r.parsedType}),B;let a=[],o=this._def.keyType,u=this._def.valueType;for(let h in r.data)a.push({key:o._parse(new ce(r,h,r.path,h)),value:u._parse(new ce(r,r.data[h],r.path,h)),alwaysSet:h in r.data});return r.common.async?X.mergeObjectAsync(t,a):X.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof L?new n({keyType:e,valueType:t,typeName:F.ZodRecord,...O(r)}):new n({keyType:Be.create(),valueType:e,typeName:F.ZodRecord,...O(t)})}},yt=class extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==S.map)return A(r,{code:T.invalid_type,expected:S.map,received:r.parsedType}),B;let a=this._def.keyType,o=this._def.valueType,u=[...r.data.entries()].map(([h,x],E)=>({key:a._parse(new ce(r,h,r.path,[E,"key"])),value:o._parse(new ce(r,x,r.path,[E,"value"]))}));if(r.common.async){let h=new Map;return Promise.resolve().then(async()=>{for(let x of u){let E=await x.key,R=await x.value;if(E.status==="aborted"||R.status==="aborted")return B;(E.status==="dirty"||R.status==="dirty")&&t.dirty(),h.set(E.value,R.value)}return{status:t.value,value:h}})}else{let h=new Map;for(let x of u){let E=x.key,R=x.value;if(E.status==="aborted"||R.status==="aborted")return B;(E.status==="dirty"||R.status==="dirty")&&t.dirty(),h.set(E.value,R.value)}return{status:t.value,value:h}}}};yt.create=(n,e,t)=>new yt({valueType:e,keyType:n,typeName:F.ZodMap,...O(t)});var gt=class n extends L{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==S.set)return A(r,{code:T.invalid_type,expected:S.set,received:r.parsedType}),B;let a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(A(r,{code:T.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(A(r,{code:T.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());let o=this._def.valueType;function u(x){let E=new Set;for(let R of x){if(R.status==="aborted")return B;R.status==="dirty"&&t.dirty(),E.add(R.value)}return{status:t.value,value:E}}let h=[...r.data.values()].map((x,E)=>o._parse(new ce(r,x,r.path,E)));return r.common.async?Promise.all(h).then(x=>u(x)):u(h)}min(e,t){return new n({...this._def,minSize:{value:e,message:N.toString(t)}})}max(e,t){return new n({...this._def,maxSize:{value:e,message:N.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};gt.create=(n,e)=>new gt({valueType:n,minSize:null,maxSize:null,typeName:F.ZodSet,...O(e)});var ar=class n extends L{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.function)return A(t,{code:T.invalid_type,expected:S.function,received:t.parsedType}),B;function r(h,x){return $t({data:h,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,pt(),Te].filter(E=>!!E),issueData:{code:T.invalid_arguments,argumentsError:x}})}function a(h,x){return $t({data:h,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,pt(),Te].filter(E=>!!E),issueData:{code:T.invalid_return_type,returnTypeError:x}})}let o={errorMap:t.common.contextualErrorMap},u=t.data;if(this._def.returns instanceof Oe){let h=this;return ee(async function(...x){let E=new ae([]),R=await h._def.args.parseAsync(x,o).catch(C=>{throw E.addIssue(r(x,C)),E}),P=await Reflect.apply(u,this,R);return await h._def.returns._def.type.parseAsync(P,o).catch(C=>{throw E.addIssue(a(P,C)),E})})}else{let h=this;return ee(function(...x){let E=h._def.args.safeParse(x,o);if(!E.success)throw new ae([r(x,E.error)]);let R=Reflect.apply(u,this,E.data),P=h._def.returns.safeParse(R,o);if(!P.success)throw new ae([a(R,P.error)]);return P.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new n({...this._def,args:xe.create(e).rest(Ie.create())})}returns(e){return new n({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new n({args:e||xe.create([]).rest(Ie.create()),returns:t||Ie.create(),typeName:F.ZodFunction,...O(r)})}},Ye=class extends L{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Ye.create=(n,e)=>new Ye({getter:n,typeName:F.ZodLazy,...O(e)});var Ke=class extends L{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return A(t,{received:t.data,code:T.invalid_literal,expected:this._def.value}),B}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ke.create=(n,e)=>new Ke({value:n,typeName:F.ZodLiteral,...O(e)});function ka(n,e){return new Xe({values:n,typeName:F.ZodEnum,...O(e)})}var Xe=class n extends L{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return A(t,{expected:U.joinValues(r),received:t.parsedType,code:T.invalid_type}),B}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return A(t,{received:t.data,code:T.invalid_enum_value,options:r}),B}return ee(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return n.create(e,{...this._def,...t})}exclude(e,t=this._def){return n.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}};Xe.create=ka;var Qe=class extends L{_parse(e){let t=U.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==S.string&&r.parsedType!==S.number){let a=U.objectValues(t);return A(r,{expected:U.joinValues(a),received:r.parsedType,code:T.invalid_type}),B}if(this._cache||(this._cache=new Set(U.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let a=U.objectValues(t);return A(r,{received:r.data,code:T.invalid_enum_value,options:a}),B}return ee(e.data)}get enum(){return this._def.values}};Qe.create=(n,e)=>new Qe({values:n,typeName:F.ZodNativeEnum,...O(e)});var Oe=class extends L{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.promise&&t.common.async===!1)return A(t,{code:T.invalid_type,expected:S.promise,received:t.parsedType}),B;let r=t.parsedType===S.promise?t.data:Promise.resolve(t.data);return ee(r.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Oe.create=(n,e)=>new Oe({type:n,typeName:F.ZodPromise,...O(e)});var pe=class extends L{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===F.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,o={addIssue:u=>{A(r,u),u.fatal?t.abort():t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),a.type==="preprocess"){let u=a.transform(r.data,o);if(r.common.async)return Promise.resolve(u).then(async h=>{if(t.value==="aborted")return B;let x=await this._def.schema._parseAsync({data:h,path:r.path,parent:r});return x.status==="aborted"?B:x.status==="dirty"?De(x.value):t.value==="dirty"?De(x.value):x});{if(t.value==="aborted")return B;let h=this._def.schema._parseSync({data:u,path:r.path,parent:r});return h.status==="aborted"?B:h.status==="dirty"?De(h.value):t.value==="dirty"?De(h.value):h}}if(a.type==="refinement"){let u=h=>{let x=a.refinement(h,o);if(r.common.async)return Promise.resolve(x);if(x instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return h};if(r.common.async===!1){let h=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return h.status==="aborted"?B:(h.status==="dirty"&&t.dirty(),u(h.value),{status:t.value,value:h.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(h=>h.status==="aborted"?B:(h.status==="dirty"&&t.dirty(),u(h.value).then(()=>({status:t.value,value:h.value}))))}if(a.type==="transform")if(r.common.async===!1){let u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ce(u))return B;let h=a.transform(u.value,o);if(h instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:h}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>Ce(u)?Promise.resolve(a.transform(u.value,o)).then(h=>({status:t.value,value:h})):B);U.assertNever(a)}};pe.create=(n,e,t)=>new pe({schema:n,typeName:F.ZodEffects,effect:e,...O(t)});pe.createWithPreprocess=(n,e,t)=>new pe({schema:e,effect:{type:"preprocess",transform:n},typeName:F.ZodEffects,...O(t)});var le=class extends L{_parse(e){return this._getType(e)===S.undefined?ee(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};le.create=(n,e)=>new le({innerType:n,typeName:F.ZodOptional,...O(e)});var ve=class extends L{_parse(e){return this._getType(e)===S.null?ee(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ve.create=(n,e)=>new ve({innerType:n,typeName:F.ZodNullable,...O(e)});var et=class extends L{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===S.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};et.create=(n,e)=>new et({innerType:n,typeName:F.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...O(e)});var tt=class extends L{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return dt(a)?a.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ae(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ae(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};tt.create=(n,e)=>new tt({innerType:n,typeName:F.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...O(e)});var xt=class extends L{_parse(e){if(this._getType(e)!==S.nan){let r=this._getOrReturnCtx(e);return A(r,{code:T.invalid_type,expected:S.nan,received:r.parsedType}),B}return{status:"valid",value:e.data}}};xt.create=n=>new xt({typeName:F.ZodNaN,...O(n)});var Mu=Symbol("zod_brand"),Dt=class extends L{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}},Vt=class n extends L{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?B:o.status==="dirty"?(t.dirty(),De(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?B:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,t){return new n({in:e,out:t,typeName:F.ZodPipeline})}},rt=class extends L{_parse(e){let t=this._def.innerType._parse(e),r=a=>(Ce(a)&&(a.value=Object.freeze(a.value)),a);return dt(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}};rt.create=(n,e)=>new rt({innerType:n,typeName:F.ZodReadonly,...O(e)});function _a(n,e){let t=typeof n=="function"?n(e):typeof n=="string"?{message:n}:n;return typeof t=="string"?{message:t}:t}function Aa(n,e={},t){return n?Fe.create().superRefine((r,a)=>{let o=n(r);if(o instanceof Promise)return o.then(u=>{if(!u){let h=_a(e,r),x=h.fatal??t??!0;a.addIssue({code:"custom",...h,fatal:x})}});if(!o){let u=_a(e,r),h=u.fatal??t??!0;a.addIssue({code:"custom",...u,fatal:h})}}):Fe.create()}var Uu={object:se.lazycreate},F;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(F||(F={}));var $u=(n,e={message:`Input not instance of ${n.name}`})=>Aa(t=>t instanceof n,e),Ra=Be.create,Sa=Ve.create,Du=xt.create,Vu=We.create,Na=qe.create,Wu=ze.create,qu=mt.create,zu=Ze.create,Zu=Ge.create,Gu=Fe.create,Hu=Ie.create,Ju=me.create,Yu=ht.create,Ku=ke.create,Xu=se.create,Qu=se.strictCreate,el=He.create,tl=nr.create,rl=Je.create,nl=xe.create,il=ir.create,al=yt.create,sl=gt.create,ol=ar.create,ul=Ye.create,ll=Ke.create,cl=Xe.create,pl=Qe.create,dl=Oe.create,fl=pe.create,ml=le.create,hl=ve.create,yl=pe.createWithPreprocess,gl=Vt.create,xl=()=>Ra().optional(),vl=()=>Sa().optional(),bl=()=>Na().optional(),wl={string:(n=>Be.create({...n,coerce:!0})),number:(n=>Ve.create({...n,coerce:!0})),boolean:(n=>qe.create({...n,coerce:!0})),bigint:(n=>We.create({...n,coerce:!0})),date:(n=>ze.create({...n,coerce:!0}))};var _l=B;p();f();d();var Ca=m.strictObject({title:m.string(),content:m.string()});var Tl=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,Ba=m.string().refine(n=>Tl.test(n),{message:"Must be a valid JavaScript identifier (e.g., 'acme', 'MySDK')"}),Fa=m.strictObject({namespace:m.optional(Ba),client:m.optional(m.string()),error:m.optional(m.string()),timeoutError:m.optional(m.string()),environment:m.optional(m.string()),environmentUrls:m.optional(m.string()),version:m.optional(m.string())}),Oa=m.union([Ba,Fa]),El=m.strictObject({neverThrowErrors:m.optional(m.boolean()),outputEsm:m.optional(m.boolean()),outputSourceFiles:m.optional(m.boolean()),outputSrcOnly:m.optional(m.boolean()),includeCredentialsOnCrossOriginRequests:m.optional(m.boolean()),bundle:m.optional(m.boolean()),allowCustomFetcher:m.optional(m.boolean()),generateWebSocketClients:m.optional(m.boolean()),defaultTimeout:m.optional(m.union([m.literal("infinity"),m.number()])),skipResponseValidation:m.optional(m.boolean()),extraDependencies:m.optional(m.record(m.string())),extraDevDependencies:m.optional(m.record(m.string())),extraPeerDependencies:m.optional(m.record(m.string())),extraPeerDependenciesMeta:m.optional(m.record(m.any())),treatUnknownAsAny:m.optional(m.boolean()),noOptionalProperties:m.optional(m.boolean()),tolerateRepublish:m.optional(m.boolean()),packageJson:m.optional(m.record(m.any())),publishToJsr:m.optional(m.boolean()),omitUndefined:m.optional(m.boolean()),useLegacyExports:m.optional(m.boolean()),streamType:m.optional(m.enum(["wrapper","web"])),fileResponseType:m.optional(m.enum(["stream","binary-response"])),formDataSupport:m.optional(m.enum(["Node16","Node18"])),fetchSupport:m.optional(m.enum(["node-fetch","native"])),packagePath:m.optional(m.string()),omitFernHeaders:m.optional(m.boolean()),includePlatformHeaders:m.optional(m.boolean()),allowUserAgentAppInfo:m.optional(m.boolean()),useDefaultRequestParameterValues:m.optional(m.boolean()),packageManager:m.optional(m.enum(["pnpm","yarn"])),flattenRequestParameters:m.optional(m.boolean()),respectOptionalRequestBody:m.optional(m.boolean()),exportAllRequestsAtRoot:m.optional(m.boolean()),customReadmeSections:m.optional(m.array(Ca)),testFramework:m.optional(m.enum(["jest","vitest"])),consolidateTypeFiles:m.optional(m.boolean()),generateEndpointMetadata:m.optional(m.boolean()),wireTestsFallbackToAutoGeneratedErrorExamples:m.boolean().optional(),linter:m.optional(m.enum(["biome","oxlint","none"])),formatter:m.optional(m.enum(["prettier","biome","oxfmt","none"])),enableForwardCompatibleEnums:m.optional(m.boolean()),parameterNaming:m.optional(m.enum(["originalName","wireValue","camelCase","snakeCase","default"])),generateSubpackageExports:m.optional(m.boolean()),allowExtraFields:m.optional(m.boolean()),enableInlineTypes:m.optional(m.boolean()),inlineFileProperties:m.optional(m.boolean()),inlinePathParameters:m.optional(m.boolean()),naming:m.optional(Oa),namespaceExport:m.optional(m.string()),noSerdeLayer:m.optional(m.boolean()),serdeLayer:m.optional(m.boolean()),private:m.optional(m.boolean()),requireDefaultEnvironment:m.optional(m.boolean()),requireBaseUrl:m.optional(m.boolean()),retainOriginalCasing:m.optional(m.boolean()),useBigInt:m.optional(m.boolean()),useBrandedStringAliases:m.optional(m.boolean()),offsetSemantics:m.optional(m.enum(["item-index","page-index"])),customPagerName:m.optional(m.string()),resolveQueryParameterNameConflicts:m.optional(m.boolean()),alwaysSendAuth:m.optional(m.boolean()),"optional-auth":m.optional(m.boolean()),generateReactQueryHooks:m.optional(m.boolean()),includeContentHeadersOnFileDownloadResponse:m.optional(m.boolean()),includeUtilsOnUnionMembers:m.optional(m.boolean()),includeOtherInUnionTypes:m.optional(m.boolean()),writeUnitTests:m.optional(m.boolean()),generateWireTests:m.optional(m.boolean()),noScripts:m.optional(m.boolean()),skipNpmPkgFix:m.optional(m.boolean()),experimentalGenerateReadWriteOnlyTypes:m.optional(m.boolean()),defaultTimeoutInSeconds:m.optional(m.union([m.literal("infinity"),m.number()])),timeoutInSeconds:m.optional(m.union([m.literal("infinity"),m.number()])),includeApiReference:m.optional(m.boolean()),shouldGenerateWebsocketClients:m.optional(m.boolean()),_fernLicenseName:m.optional(m.string()),maxRetries:m.optional(m.number().int().min(0)),retryStatusCodes:m.optional(m.enum(["legacy","recommended"]))});function Wt(n){return n?.serdeLayer!=null?!n.serdeLayer:!!n?.noSerdeLayer}var k={};ue(k,{AstNode:()=>W,ClassInstantiation:()=>vt,CodeBlock:()=>bt,Comment:()=>Le,Function:()=>wt,FunctionInvocation:()=>_t,MethodInvocation:()=>Tt,Parameter:()=>Et,Reference:()=>it,Type:()=>nt,TypeLiteral:()=>Ae,Types:()=>nt,Variable:()=>It,Writer:()=>ct,codeblock:()=>Sl,function_:()=>Nl,instantiateClass:()=>Cl,invokeFunction:()=>Bl,invokeMethod:()=>Fl,parameter:()=>Ol,reference:()=>Ll,variable:()=>Pl});p();f();d();p();f();d();p();f();d();var vt=class extends W{constructor({class_:t,arguments_:r}){super();I(this,"class_");I(this,"arguments_");this.class_=t,this.arguments_=r}write(t){t.write("new "),t.writeNode(this.class_),t.write("("),t.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:r=>r.write(t)}),t.write(")")}};p();f();d();var bt=class extends W{constructor(t){super();I(this,"args");this.args=t}write(t){return new de(this.args).write(t)}};p();f();d();var Le=class extends W{constructor({docs:t}={docs:void 0}){super();I(this,"docs");this.docs=t}write(t){this.docs!=null&&(t.writeLine("/**"),this.docs.split(`
|
|
19
|
+
`}}return e}};var W=class extends $e{async toStringAsync({customConfig:e,formatter:t}){let r=new Ut({customConfig:e,formatter:t});return this.write(r),await r.toStringAsync()}toString({customConfig:e,formatter:t}){let r=new Ut({customConfig:e,formatter:t});return this.write(r),r.toString()}};p();f();d();p();f();d();var m={};ue(m,{BRAND:()=>Mu,DIRTY:()=>De,EMPTY_PATH:()=>yu,INVALID:()=>B,NEVER:()=>_l,OK:()=>ee,ParseStatus:()=>X,Schema:()=>L,ZodAny:()=>Fe,ZodArray:()=>ke,ZodBigInt:()=>We,ZodBoolean:()=>qe,ZodBranded:()=>Dt,ZodCatch:()=>tt,ZodDate:()=>ze,ZodDefault:()=>et,ZodDiscriminatedUnion:()=>nr,ZodEffects:()=>pe,ZodEnum:()=>Xe,ZodError:()=>ae,ZodFirstPartyTypeKind:()=>F,ZodFunction:()=>ar,ZodIntersection:()=>Je,ZodIssueCode:()=>T,ZodLazy:()=>Ye,ZodLiteral:()=>Ke,ZodMap:()=>yt,ZodNaN:()=>xt,ZodNativeEnum:()=>Qe,ZodNever:()=>me,ZodNull:()=>Ge,ZodNullable:()=>ve,ZodNumber:()=>Ve,ZodObject:()=>se,ZodOptional:()=>le,ZodParsedType:()=>S,ZodPipeline:()=>Vt,ZodPromise:()=>Oe,ZodReadonly:()=>rt,ZodRecord:()=>ir,ZodSchema:()=>L,ZodSet:()=>gt,ZodString:()=>Be,ZodSymbol:()=>mt,ZodTransformer:()=>pe,ZodTuple:()=>xe,ZodType:()=>L,ZodUndefined:()=>Ze,ZodUnion:()=>He,ZodUnknown:()=>Ie,ZodVoid:()=>ht,addIssueToContext:()=>A,any:()=>Gu,array:()=>Ku,bigint:()=>Vu,boolean:()=>Na,coerce:()=>wl,custom:()=>Aa,date:()=>Wu,datetimeRegex:()=>Ia,defaultErrorMap:()=>Te,discriminatedUnion:()=>tl,effect:()=>fl,enum:()=>cl,function:()=>ol,getErrorMap:()=>pt,getParsedType:()=>ge,instanceof:()=>$u,intersection:()=>rl,isAborted:()=>tr,isAsync:()=>dt,isDirty:()=>rr,isValid:()=>Ce,late:()=>Uu,lazy:()=>ul,literal:()=>ll,makeIssue:()=>$t,map:()=>al,nan:()=>Du,nativeEnum:()=>pl,never:()=>Ju,null:()=>Zu,nullable:()=>hl,number:()=>Sa,object:()=>Xu,objectUtil:()=>wr,oboolean:()=>bl,onumber:()=>vl,optional:()=>ml,ostring:()=>xl,pipeline:()=>gl,preprocess:()=>yl,promise:()=>dl,quotelessJson:()=>fu,record:()=>il,set:()=>sl,setErrorMap:()=>hu,strictObject:()=>Qu,string:()=>Ra,symbol:()=>qu,transformer:()=>fl,tuple:()=>nl,undefined:()=>zu,union:()=>el,unknown:()=>Hu,util:()=>U,void:()=>Yu});p();f();d();p();f();d();p();f();d();p();f();d();p();f();d();var U;(function(n){n.assertEqual=a=>{};function e(a){}n.assertIs=e;function t(a){throw new Error}n.assertNever=t,n.arrayToEnum=a=>{let o={};for(let u of a)o[u]=u;return o},n.getValidEnumValues=a=>{let o=n.objectKeys(a).filter(h=>typeof a[a[h]]!="number"),u={};for(let h of o)u[h]=a[h];return n.objectValues(u)},n.objectValues=a=>n.objectKeys(a).map(function(o){return a[o]}),n.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let o=[];for(let u in a)Object.prototype.hasOwnProperty.call(a,u)&&o.push(u);return o},n.find=(a,o)=>{for(let u of a)if(o(u))return u},n.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,o=" | "){return a.map(u=>typeof u=="string"?`'${u}'`:u).join(o)}n.joinValues=r,n.jsonStringifyReplacer=(a,o)=>typeof o=="bigint"?o.toString():o})(U||(U={}));var wr;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(wr||(wr={}));var S=U.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ge=n=>{switch(typeof n){case"undefined":return S.undefined;case"string":return S.string;case"number":return Number.isNaN(n)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(n)?S.array:n===null?S.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?S.promise:typeof Map<"u"&&n instanceof Map?S.map:typeof Set<"u"&&n instanceof Set?S.set:typeof Date<"u"&&n instanceof Date?S.date:S.object;default:return S.unknown}};var T=U.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"]),fu=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),ae=class n extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(o){return o.message},r={_errors:[]},a=o=>{for(let u of o.issues)if(u.code==="invalid_union")u.unionErrors.map(a);else if(u.code==="invalid_return_type")a(u.returnTypeError);else if(u.code==="invalid_arguments")a(u.argumentsError);else if(u.path.length===0)r._errors.push(t(u));else{let h=r,x=0;for(;x<u.path.length;){let E=u.path[x];x===u.path.length-1?(h[E]=h[E]||{_errors:[]},h[E]._errors.push(t(u))):h[E]=h[E]||{_errors:[]},h=h[E],x++}}};return a(this),r}static assert(e){if(!(e instanceof n))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,U.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},r=[];for(let a of this.issues)if(a.path.length>0){let o=a.path[0];t[o]=t[o]||[],t[o].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}};ae.create=n=>new ae(n);var mu=(n,e)=>{let t;switch(n.code){case T.invalid_type:n.received===S.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case T.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,U.jsonStringifyReplacer)}`;break;case T.unrecognized_keys:t=`Unrecognized key(s) in object: ${U.joinValues(n.keys,", ")}`;break;case T.invalid_union:t="Invalid input";break;case T.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${U.joinValues(n.options)}`;break;case T.invalid_enum_value:t=`Invalid enum value. Expected ${U.joinValues(n.options)}, received '${n.received}'`;break;case T.invalid_arguments:t="Invalid function arguments";break;case T.invalid_return_type:t="Invalid function return type";break;case T.invalid_date:t="Invalid date";break;case T.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:U.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case T.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case T.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case T.custom:t="Invalid input";break;case T.invalid_intersection_types:t="Intersection results could not be merged";break;case T.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case T.not_finite:t="Number must be finite";break;default:t=e.defaultError,U.assertNever(n)}return{message:t}},Te=mu;var ba=Te;function hu(n){ba=n}function pt(){return ba}p();f();d();var $t=n=>{let{data:e,path:t,errorMaps:r,issueData:a}=n,o=[...t,...a.path||[]],u={...a,path:o};if(a.message!==void 0)return{...a,path:o,message:a.message};let h="",x=r.filter(E=>!!E).slice().reverse();for(let E of x)h=E(u,{data:e,defaultError:h}).message;return{...a,path:o,message:h}},yu=[];function A(n,e){let t=pt(),r=$t({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===Te?void 0:Te].filter(a=>!!a)});n.common.issues.push(r)}var X=class n{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let a of t){if(a.status==="aborted")return B;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let a of t){let o=await a.key,u=await a.value;r.push({key:o,value:u})}return n.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let a of t){let{key:o,value:u}=a;if(o.status==="aborted"||u.status==="aborted")return B;o.status==="dirty"&&e.dirty(),u.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof u.value<"u"||a.alwaysSet)&&(r[o.value]=u.value)}return{status:e.value,value:r}}},B=Object.freeze({status:"aborted"}),De=n=>({status:"dirty",value:n}),ee=n=>({status:"valid",value:n}),tr=n=>n.status==="aborted",rr=n=>n.status==="dirty",Ce=n=>n.status==="valid",dt=n=>typeof Promise<"u"&&n instanceof Promise;p();f();d();p();f();d();var N;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e?.message})(N||(N={}));var ce=class{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},wa=(n,e)=>{if(Ce(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new ae(n.common.issues);return this._error=t,this._error}}};function O(n){if(!n)return{};let{errorMap:e,invalid_type_error:t,required_error:r,description:a}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(u,h)=>{let{message:x}=n;return u.code==="invalid_enum_value"?{message:x??h.defaultError}:typeof h.data>"u"?{message:x??r??h.defaultError}:u.code!=="invalid_type"?{message:h.defaultError}:{message:x??t??h.defaultError}},description:a}}var L=class{get description(){return this._def.description}_getType(e){return ge(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ge(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new X,ctx:{common:e.parent.common,data:e.data,parsedType:ge(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(dt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ge(e)},a=this._parseSync({data:e,path:r.path,parent:r});return wa(r,a)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ge(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return Ce(r)?{value:r.value}:{issues:t.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(r=>Ce(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ge(e)},a=this._parse({data:e,path:r.path,parent:r}),o=await(dt(a)?a:Promise.resolve(a));return wa(r,o)}refine(e,t){let r=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,o)=>{let u=e(a),h=()=>o.addIssue({code:T.custom,...r(a)});return typeof Promise<"u"&&u instanceof Promise?u.then(x=>x?!0:(h(),!1)):u?!0:(h(),!1)})}refinement(e,t){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof t=="function"?t(r,a):t),!1))}_refinement(e){return new pe({schema:this,typeName:F.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:t=>this["~validate"](t)}}optional(){return le.create(this,this._def)}nullable(){return ve.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ke.create(this)}promise(){return Oe.create(this,this._def)}or(e){return He.create([this,e],this._def)}and(e){return Je.create(this,e,this._def)}transform(e){return new pe({...O(this._def),schema:this,typeName:F.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new et({...O(this._def),innerType:this,defaultValue:t,typeName:F.ZodDefault})}brand(){return new Dt({typeName:F.ZodBranded,type:this,...O(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new tt({...O(this._def),innerType:this,catchValue:t,typeName:F.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Vt.create(this,e)}readonly(){return rt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},gu=/^c[^\s-]{8,}$/i,xu=/^[0-9a-z]+$/,vu=/^[0-9A-HJKMNP-TV-Z]{26}$/i,bu=/^[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,wu=/^[a-z0-9_-]{21}$/i,_u=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Tu=/^[-+]?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)?)??$/,Eu=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Iu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",_r,ku=/^(?:(?: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])$/,Au=/^(?:(?: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])$/,Ru=/^(([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]))$/,Su=/^(([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])$/,Nu=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Cu=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ta="((\\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])))",Bu=new RegExp(`^${Ta}$`);function Ea(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);let t=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Fu(n){return new RegExp(`^${Ea(n)}$`)}function Ia(n){let e=`${Ta}T${Ea(n)}`,t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Ou(n,e){return!!((e==="v4"||!e)&&ku.test(n)||(e==="v6"||!e)&&Ru.test(n))}function Lu(n,e){if(!_u.test(n))return!1;try{let[t]=n.split(".");if(!t)return!1;let r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function Pu(n,e){return!!((e==="v4"||!e)&&Au.test(n)||(e==="v6"||!e)&&Su.test(n))}var Be=class n extends L{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==S.string){let o=this._getOrReturnCtx(e);return A(o,{code:T.invalid_type,expected:S.string,received:o.parsedType}),B}let r=new X,a;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(a=this._getOrReturnCtx(e,a),A(a,{code:T.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(a=this._getOrReturnCtx(e,a),A(a,{code:T.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let u=e.data.length>o.value,h=e.data.length<o.value;(u||h)&&(a=this._getOrReturnCtx(e,a),u?A(a,{code:T.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):h&&A(a,{code:T.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Eu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"email",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")_r||(_r=new RegExp(Iu,"u")),_r.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"emoji",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")bu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"uuid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")wu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"nanoid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")gu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"cuid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")xu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"cuid2",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")vu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"ulid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),A(a,{validation:"url",code:T.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"regex",code:T.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(e,a),A(a,{code:T.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(a=this._getOrReturnCtx(e,a),A(a,{code:T.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(a=this._getOrReturnCtx(e,a),A(a,{code:T.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Ia(o).test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{code:T.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?Bu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{code:T.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Fu(o).test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{code:T.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?Tu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"duration",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?Ou(e.data,o.version)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"ip",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?Lu(e.data,o.alg)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"jwt",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?Pu(e.data,o.version)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"cidr",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?Nu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"base64",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?Cu.test(e.data)||(a=this._getOrReturnCtx(e,a),A(a,{validation:"base64url",code:T.invalid_string,message:o.message}),r.dirty()):U.assertNever(o);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(a=>e.test(a),{validation:t,code:T.invalid_string,...N.errToObj(r)})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...N.errToObj(e)})}url(e){return this._addCheck({kind:"url",...N.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...N.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...N.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...N.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...N.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...N.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...N.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...N.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...N.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...N.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...N.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...N.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...N.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...N.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...N.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...N.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...N.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...N.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...N.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...N.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...N.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...N.errToObj(t)})}nonempty(e){return this.min(1,N.errToObj(e))}trim(){return new n({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Be.create=n=>new Be({checks:[],typeName:F.ZodString,coerce:n?.coerce??!1,...O(n)});function ju(n,e){let t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=t>r?t:r,o=Number.parseInt(n.toFixed(a).replace(".","")),u=Number.parseInt(e.toFixed(a).replace(".",""));return o%u/10**a}var Ve=class n extends L{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==S.number){let o=this._getOrReturnCtx(e);return A(o,{code:T.invalid_type,expected:S.number,received:o.parsedType}),B}let r,a=new X;for(let o of this._def.checks)o.kind==="int"?U.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),A(r,{code:T.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),A(r,{code:T.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),A(r,{code:T.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="multipleOf"?ju(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),A(r,{code:T.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),A(r,{code:T.not_finite,message:o.message}),a.dirty()):U.assertNever(o);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,N.toString(t))}gt(e,t){return this.setLimit("min",e,!1,N.toString(t))}lte(e,t){return this.setLimit("max",e,!0,N.toString(t))}lt(e,t){return this.setLimit("max",e,!1,N.toString(t))}setLimit(e,t,r,a){return new n({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:N.toString(a)}]})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:N.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:N.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:N.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:N.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:N.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:N.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&U.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}};Ve.create=n=>new Ve({checks:[],typeName:F.ZodNumber,coerce:n?.coerce||!1,...O(n)});var We=class n extends L{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==S.bigint)return this._getInvalidInput(e);let r,a=new X;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),A(r,{code:T.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),A(r,{code:T.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),A(r,{code:T.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):U.assertNever(o);return{status:a.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return A(t,{code:T.invalid_type,expected:S.bigint,received:t.parsedType}),B}gte(e,t){return this.setLimit("min",e,!0,N.toString(t))}gt(e,t){return this.setLimit("min",e,!1,N.toString(t))}lte(e,t){return this.setLimit("max",e,!0,N.toString(t))}lt(e,t){return this.setLimit("max",e,!1,N.toString(t))}setLimit(e,t,r,a){return new n({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:N.toString(a)}]})}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:N.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:N.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};We.create=n=>new We({checks:[],typeName:F.ZodBigInt,coerce:n?.coerce??!1,...O(n)});var qe=class extends L{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==S.boolean){let r=this._getOrReturnCtx(e);return A(r,{code:T.invalid_type,expected:S.boolean,received:r.parsedType}),B}return ee(e.data)}};qe.create=n=>new qe({typeName:F.ZodBoolean,coerce:n?.coerce||!1,...O(n)});var ze=class n extends L{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==S.date){let o=this._getOrReturnCtx(e);return A(o,{code:T.invalid_type,expected:S.date,received:o.parsedType}),B}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return A(o,{code:T.invalid_date}),B}let r=new X,a;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(a=this._getOrReturnCtx(e,a),A(a,{code:T.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(a=this._getOrReturnCtx(e,a),A(a,{code:T.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):U.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new n({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:N.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:N.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};ze.create=n=>new ze({checks:[],coerce:n?.coerce||!1,typeName:F.ZodDate,...O(n)});var mt=class extends L{_parse(e){if(this._getType(e)!==S.symbol){let r=this._getOrReturnCtx(e);return A(r,{code:T.invalid_type,expected:S.symbol,received:r.parsedType}),B}return ee(e.data)}};mt.create=n=>new mt({typeName:F.ZodSymbol,...O(n)});var Ze=class extends L{_parse(e){if(this._getType(e)!==S.undefined){let r=this._getOrReturnCtx(e);return A(r,{code:T.invalid_type,expected:S.undefined,received:r.parsedType}),B}return ee(e.data)}};Ze.create=n=>new Ze({typeName:F.ZodUndefined,...O(n)});var Ge=class extends L{_parse(e){if(this._getType(e)!==S.null){let r=this._getOrReturnCtx(e);return A(r,{code:T.invalid_type,expected:S.null,received:r.parsedType}),B}return ee(e.data)}};Ge.create=n=>new Ge({typeName:F.ZodNull,...O(n)});var Fe=class extends L{constructor(){super(...arguments),this._any=!0}_parse(e){return ee(e.data)}};Fe.create=n=>new Fe({typeName:F.ZodAny,...O(n)});var Ie=class extends L{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ee(e.data)}};Ie.create=n=>new Ie({typeName:F.ZodUnknown,...O(n)});var me=class extends L{_parse(e){let t=this._getOrReturnCtx(e);return A(t,{code:T.invalid_type,expected:S.never,received:t.parsedType}),B}};me.create=n=>new me({typeName:F.ZodNever,...O(n)});var ht=class extends L{_parse(e){if(this._getType(e)!==S.undefined){let r=this._getOrReturnCtx(e);return A(r,{code:T.invalid_type,expected:S.void,received:r.parsedType}),B}return ee(e.data)}};ht.create=n=>new ht({typeName:F.ZodVoid,...O(n)});var ke=class n extends L{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==S.array)return A(t,{code:T.invalid_type,expected:S.array,received:t.parsedType}),B;if(a.exactLength!==null){let u=t.data.length>a.exactLength.value,h=t.data.length<a.exactLength.value;(u||h)&&(A(t,{code:u?T.too_big:T.too_small,minimum:h?a.exactLength.value:void 0,maximum:u?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(A(t,{code:T.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(A(t,{code:T.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((u,h)=>a.type._parseAsync(new ce(t,u,t.path,h)))).then(u=>X.mergeArray(r,u));let o=[...t.data].map((u,h)=>a.type._parseSync(new ce(t,u,t.path,h)));return X.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new n({...this._def,minLength:{value:e,message:N.toString(t)}})}max(e,t){return new n({...this._def,maxLength:{value:e,message:N.toString(t)}})}length(e,t){return new n({...this._def,exactLength:{value:e,message:N.toString(t)}})}nonempty(e){return this.min(1,e)}};ke.create=(n,e)=>new ke({type:n,minLength:null,maxLength:null,exactLength:null,typeName:F.ZodArray,...O(e)});function ft(n){if(n instanceof se){let e={};for(let t in n.shape){let r=n.shape[t];e[t]=le.create(ft(r))}return new se({...n._def,shape:()=>e})}else return n instanceof ke?new ke({...n._def,type:ft(n.element)}):n instanceof le?le.create(ft(n.unwrap())):n instanceof ve?ve.create(ft(n.unwrap())):n instanceof xe?xe.create(n.items.map(e=>ft(e))):n}var se=class n extends L{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=U.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==S.object){let E=this._getOrReturnCtx(e);return A(E,{code:T.invalid_type,expected:S.object,received:E.parsedType}),B}let{status:r,ctx:a}=this._processInputParams(e),{shape:o,keys:u}=this._getCached(),h=[];if(!(this._def.catchall instanceof me&&this._def.unknownKeys==="strip"))for(let E in a.data)u.includes(E)||h.push(E);let x=[];for(let E of u){let R=o[E],P=a.data[E];x.push({key:{status:"valid",value:E},value:R._parse(new ce(a,P,a.path,E)),alwaysSet:E in a.data})}if(this._def.catchall instanceof me){let E=this._def.unknownKeys;if(E==="passthrough")for(let R of h)x.push({key:{status:"valid",value:R},value:{status:"valid",value:a.data[R]}});else if(E==="strict")h.length>0&&(A(a,{code:T.unrecognized_keys,keys:h}),r.dirty());else if(E!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let E=this._def.catchall;for(let R of h){let P=a.data[R];x.push({key:{status:"valid",value:R},value:E._parse(new ce(a,P,a.path,R)),alwaysSet:R in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let E=[];for(let R of x){let P=await R.key,Y=await R.value;E.push({key:P,value:Y,alwaysSet:R.alwaysSet})}return E}).then(E=>X.mergeObjectSync(r,E)):X.mergeObjectSync(r,x)}get shape(){return this._def.shape()}strict(e){return N.errToObj,new n({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{let a=this._def.errorMap?.(t,r).message??r.defaultError;return t.code==="unrecognized_keys"?{message:N.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new n({...this._def,unknownKeys:"strip"})}passthrough(){return new n({...this._def,unknownKeys:"passthrough"})}extend(e){return new n({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new n({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:F.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new n({...this._def,catchall:e})}pick(e){let t={};for(let r of U.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new n({...this._def,shape:()=>t})}omit(e){let t={};for(let r of U.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new n({...this._def,shape:()=>t})}deepPartial(){return ft(this)}partial(e){let t={};for(let r of U.objectKeys(this.shape)){let a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}return new n({...this._def,shape:()=>t})}required(e){let t={};for(let r of U.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof le;)o=o._def.innerType;t[r]=o}return new n({...this._def,shape:()=>t})}keyof(){return ka(U.objectKeys(this.shape))}};se.create=(n,e)=>new se({shape:()=>n,unknownKeys:"strip",catchall:me.create(),typeName:F.ZodObject,...O(e)});se.strictCreate=(n,e)=>new se({shape:()=>n,unknownKeys:"strict",catchall:me.create(),typeName:F.ZodObject,...O(e)});se.lazycreate=(n,e)=>new se({shape:n,unknownKeys:"strip",catchall:me.create(),typeName:F.ZodObject,...O(e)});var He=class extends L{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function a(o){for(let h of o)if(h.result.status==="valid")return h.result;for(let h of o)if(h.result.status==="dirty")return t.common.issues.push(...h.ctx.common.issues),h.result;let u=o.map(h=>new ae(h.ctx.common.issues));return A(t,{code:T.invalid_union,unionErrors:u}),B}if(t.common.async)return Promise.all(r.map(async o=>{let u={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:u}),ctx:u}})).then(a);{let o,u=[];for(let x of r){let E={...t,common:{...t.common,issues:[]},parent:null},R=x._parseSync({data:t.data,path:t.path,parent:E});if(R.status==="valid")return R;R.status==="dirty"&&!o&&(o={result:R,ctx:E}),E.common.issues.length&&u.push(E.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let h=u.map(x=>new ae(x));return A(t,{code:T.invalid_union,unionErrors:h}),B}}get options(){return this._def.options}};He.create=(n,e)=>new He({options:n,typeName:F.ZodUnion,...O(e)});var Ee=n=>n instanceof Ye?Ee(n.schema):n instanceof pe?Ee(n.innerType()):n instanceof Ke?[n.value]:n instanceof Xe?n.options:n instanceof Qe?U.objectValues(n.enum):n instanceof et?Ee(n._def.innerType):n instanceof Ze?[void 0]:n instanceof Ge?[null]:n instanceof le?[void 0,...Ee(n.unwrap())]:n instanceof ve?[null,...Ee(n.unwrap())]:n instanceof Dt||n instanceof rt?Ee(n.unwrap()):n instanceof tt?Ee(n._def.innerType):[],nr=class n extends L{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.object)return A(t,{code:T.invalid_type,expected:S.object,received:t.parsedType}),B;let r=this.discriminator,a=t.data[r],o=this.optionsMap.get(a);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(A(t,{code:T.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),B)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let a=new Map;for(let o of t){let u=Ee(o.shape[e]);if(!u.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let h of u){if(a.has(h))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(h)}`);a.set(h,o)}}return new n({typeName:F.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...O(r)})}};function Tr(n,e){let t=ge(n),r=ge(e);if(n===e)return{valid:!0,data:n};if(t===S.object&&r===S.object){let a=U.objectKeys(e),o=U.objectKeys(n).filter(h=>a.indexOf(h)!==-1),u={...n,...e};for(let h of o){let x=Tr(n[h],e[h]);if(!x.valid)return{valid:!1};u[h]=x.data}return{valid:!0,data:u}}else if(t===S.array&&r===S.array){if(n.length!==e.length)return{valid:!1};let a=[];for(let o=0;o<n.length;o++){let u=n[o],h=e[o],x=Tr(u,h);if(!x.valid)return{valid:!1};a.push(x.data)}return{valid:!0,data:a}}else return t===S.date&&r===S.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}var Je=class extends L{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),a=(o,u)=>{if(tr(o)||tr(u))return B;let h=Tr(o.value,u.value);return h.valid?((rr(o)||rr(u))&&t.dirty(),{status:t.value,value:h.data}):(A(r,{code:T.invalid_intersection_types}),B)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,u])=>a(o,u)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Je.create=(n,e,t)=>new Je({left:n,right:e,typeName:F.ZodIntersection,...O(t)});var xe=class n extends L{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==S.array)return A(r,{code:T.invalid_type,expected:S.array,received:r.parsedType}),B;if(r.data.length<this._def.items.length)return A(r,{code:T.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),B;!this._def.rest&&r.data.length>this._def.items.length&&(A(r,{code:T.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let o=[...r.data].map((u,h)=>{let x=this._def.items[h]||this._def.rest;return x?x._parse(new ce(r,u,r.path,h)):null}).filter(u=>!!u);return r.common.async?Promise.all(o).then(u=>X.mergeArray(t,u)):X.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new n({...this._def,rest:e})}};xe.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xe({items:n,typeName:F.ZodTuple,rest:null,...O(e)})};var ir=class n extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==S.object)return A(r,{code:T.invalid_type,expected:S.object,received:r.parsedType}),B;let a=[],o=this._def.keyType,u=this._def.valueType;for(let h in r.data)a.push({key:o._parse(new ce(r,h,r.path,h)),value:u._parse(new ce(r,r.data[h],r.path,h)),alwaysSet:h in r.data});return r.common.async?X.mergeObjectAsync(t,a):X.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof L?new n({keyType:e,valueType:t,typeName:F.ZodRecord,...O(r)}):new n({keyType:Be.create(),valueType:e,typeName:F.ZodRecord,...O(t)})}},yt=class extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==S.map)return A(r,{code:T.invalid_type,expected:S.map,received:r.parsedType}),B;let a=this._def.keyType,o=this._def.valueType,u=[...r.data.entries()].map(([h,x],E)=>({key:a._parse(new ce(r,h,r.path,[E,"key"])),value:o._parse(new ce(r,x,r.path,[E,"value"]))}));if(r.common.async){let h=new Map;return Promise.resolve().then(async()=>{for(let x of u){let E=await x.key,R=await x.value;if(E.status==="aborted"||R.status==="aborted")return B;(E.status==="dirty"||R.status==="dirty")&&t.dirty(),h.set(E.value,R.value)}return{status:t.value,value:h}})}else{let h=new Map;for(let x of u){let E=x.key,R=x.value;if(E.status==="aborted"||R.status==="aborted")return B;(E.status==="dirty"||R.status==="dirty")&&t.dirty(),h.set(E.value,R.value)}return{status:t.value,value:h}}}};yt.create=(n,e,t)=>new yt({valueType:e,keyType:n,typeName:F.ZodMap,...O(t)});var gt=class n extends L{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==S.set)return A(r,{code:T.invalid_type,expected:S.set,received:r.parsedType}),B;let a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(A(r,{code:T.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(A(r,{code:T.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());let o=this._def.valueType;function u(x){let E=new Set;for(let R of x){if(R.status==="aborted")return B;R.status==="dirty"&&t.dirty(),E.add(R.value)}return{status:t.value,value:E}}let h=[...r.data.values()].map((x,E)=>o._parse(new ce(r,x,r.path,E)));return r.common.async?Promise.all(h).then(x=>u(x)):u(h)}min(e,t){return new n({...this._def,minSize:{value:e,message:N.toString(t)}})}max(e,t){return new n({...this._def,maxSize:{value:e,message:N.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};gt.create=(n,e)=>new gt({valueType:n,minSize:null,maxSize:null,typeName:F.ZodSet,...O(e)});var ar=class n extends L{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.function)return A(t,{code:T.invalid_type,expected:S.function,received:t.parsedType}),B;function r(h,x){return $t({data:h,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,pt(),Te].filter(E=>!!E),issueData:{code:T.invalid_arguments,argumentsError:x}})}function a(h,x){return $t({data:h,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,pt(),Te].filter(E=>!!E),issueData:{code:T.invalid_return_type,returnTypeError:x}})}let o={errorMap:t.common.contextualErrorMap},u=t.data;if(this._def.returns instanceof Oe){let h=this;return ee(async function(...x){let E=new ae([]),R=await h._def.args.parseAsync(x,o).catch(C=>{throw E.addIssue(r(x,C)),E}),P=await Reflect.apply(u,this,R);return await h._def.returns._def.type.parseAsync(P,o).catch(C=>{throw E.addIssue(a(P,C)),E})})}else{let h=this;return ee(function(...x){let E=h._def.args.safeParse(x,o);if(!E.success)throw new ae([r(x,E.error)]);let R=Reflect.apply(u,this,E.data),P=h._def.returns.safeParse(R,o);if(!P.success)throw new ae([a(R,P.error)]);return P.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new n({...this._def,args:xe.create(e).rest(Ie.create())})}returns(e){return new n({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new n({args:e||xe.create([]).rest(Ie.create()),returns:t||Ie.create(),typeName:F.ZodFunction,...O(r)})}},Ye=class extends L{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Ye.create=(n,e)=>new Ye({getter:n,typeName:F.ZodLazy,...O(e)});var Ke=class extends L{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return A(t,{received:t.data,code:T.invalid_literal,expected:this._def.value}),B}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ke.create=(n,e)=>new Ke({value:n,typeName:F.ZodLiteral,...O(e)});function ka(n,e){return new Xe({values:n,typeName:F.ZodEnum,...O(e)})}var Xe=class n extends L{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return A(t,{expected:U.joinValues(r),received:t.parsedType,code:T.invalid_type}),B}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return A(t,{received:t.data,code:T.invalid_enum_value,options:r}),B}return ee(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return n.create(e,{...this._def,...t})}exclude(e,t=this._def){return n.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}};Xe.create=ka;var Qe=class extends L{_parse(e){let t=U.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==S.string&&r.parsedType!==S.number){let a=U.objectValues(t);return A(r,{expected:U.joinValues(a),received:r.parsedType,code:T.invalid_type}),B}if(this._cache||(this._cache=new Set(U.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let a=U.objectValues(t);return A(r,{received:r.data,code:T.invalid_enum_value,options:a}),B}return ee(e.data)}get enum(){return this._def.values}};Qe.create=(n,e)=>new Qe({values:n,typeName:F.ZodNativeEnum,...O(e)});var Oe=class extends L{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.promise&&t.common.async===!1)return A(t,{code:T.invalid_type,expected:S.promise,received:t.parsedType}),B;let r=t.parsedType===S.promise?t.data:Promise.resolve(t.data);return ee(r.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Oe.create=(n,e)=>new Oe({type:n,typeName:F.ZodPromise,...O(e)});var pe=class extends L{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===F.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,o={addIssue:u=>{A(r,u),u.fatal?t.abort():t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),a.type==="preprocess"){let u=a.transform(r.data,o);if(r.common.async)return Promise.resolve(u).then(async h=>{if(t.value==="aborted")return B;let x=await this._def.schema._parseAsync({data:h,path:r.path,parent:r});return x.status==="aborted"?B:x.status==="dirty"?De(x.value):t.value==="dirty"?De(x.value):x});{if(t.value==="aborted")return B;let h=this._def.schema._parseSync({data:u,path:r.path,parent:r});return h.status==="aborted"?B:h.status==="dirty"?De(h.value):t.value==="dirty"?De(h.value):h}}if(a.type==="refinement"){let u=h=>{let x=a.refinement(h,o);if(r.common.async)return Promise.resolve(x);if(x instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return h};if(r.common.async===!1){let h=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return h.status==="aborted"?B:(h.status==="dirty"&&t.dirty(),u(h.value),{status:t.value,value:h.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(h=>h.status==="aborted"?B:(h.status==="dirty"&&t.dirty(),u(h.value).then(()=>({status:t.value,value:h.value}))))}if(a.type==="transform")if(r.common.async===!1){let u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ce(u))return B;let h=a.transform(u.value,o);if(h instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:h}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>Ce(u)?Promise.resolve(a.transform(u.value,o)).then(h=>({status:t.value,value:h})):B);U.assertNever(a)}};pe.create=(n,e,t)=>new pe({schema:n,typeName:F.ZodEffects,effect:e,...O(t)});pe.createWithPreprocess=(n,e,t)=>new pe({schema:e,effect:{type:"preprocess",transform:n},typeName:F.ZodEffects,...O(t)});var le=class extends L{_parse(e){return this._getType(e)===S.undefined?ee(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};le.create=(n,e)=>new le({innerType:n,typeName:F.ZodOptional,...O(e)});var ve=class extends L{_parse(e){return this._getType(e)===S.null?ee(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ve.create=(n,e)=>new ve({innerType:n,typeName:F.ZodNullable,...O(e)});var et=class extends L{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===S.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};et.create=(n,e)=>new et({innerType:n,typeName:F.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...O(e)});var tt=class extends L{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return dt(a)?a.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ae(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ae(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};tt.create=(n,e)=>new tt({innerType:n,typeName:F.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...O(e)});var xt=class extends L{_parse(e){if(this._getType(e)!==S.nan){let r=this._getOrReturnCtx(e);return A(r,{code:T.invalid_type,expected:S.nan,received:r.parsedType}),B}return{status:"valid",value:e.data}}};xt.create=n=>new xt({typeName:F.ZodNaN,...O(n)});var Mu=Symbol("zod_brand"),Dt=class extends L{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}},Vt=class n extends L{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?B:o.status==="dirty"?(t.dirty(),De(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?B:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,t){return new n({in:e,out:t,typeName:F.ZodPipeline})}},rt=class extends L{_parse(e){let t=this._def.innerType._parse(e),r=a=>(Ce(a)&&(a.value=Object.freeze(a.value)),a);return dt(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}};rt.create=(n,e)=>new rt({innerType:n,typeName:F.ZodReadonly,...O(e)});function _a(n,e){let t=typeof n=="function"?n(e):typeof n=="string"?{message:n}:n;return typeof t=="string"?{message:t}:t}function Aa(n,e={},t){return n?Fe.create().superRefine((r,a)=>{let o=n(r);if(o instanceof Promise)return o.then(u=>{if(!u){let h=_a(e,r),x=h.fatal??t??!0;a.addIssue({code:"custom",...h,fatal:x})}});if(!o){let u=_a(e,r),h=u.fatal??t??!0;a.addIssue({code:"custom",...u,fatal:h})}}):Fe.create()}var Uu={object:se.lazycreate},F;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(F||(F={}));var $u=(n,e={message:`Input not instance of ${n.name}`})=>Aa(t=>t instanceof n,e),Ra=Be.create,Sa=Ve.create,Du=xt.create,Vu=We.create,Na=qe.create,Wu=ze.create,qu=mt.create,zu=Ze.create,Zu=Ge.create,Gu=Fe.create,Hu=Ie.create,Ju=me.create,Yu=ht.create,Ku=ke.create,Xu=se.create,Qu=se.strictCreate,el=He.create,tl=nr.create,rl=Je.create,nl=xe.create,il=ir.create,al=yt.create,sl=gt.create,ol=ar.create,ul=Ye.create,ll=Ke.create,cl=Xe.create,pl=Qe.create,dl=Oe.create,fl=pe.create,ml=le.create,hl=ve.create,yl=pe.createWithPreprocess,gl=Vt.create,xl=()=>Ra().optional(),vl=()=>Sa().optional(),bl=()=>Na().optional(),wl={string:(n=>Be.create({...n,coerce:!0})),number:(n=>Ve.create({...n,coerce:!0})),boolean:(n=>qe.create({...n,coerce:!0})),bigint:(n=>We.create({...n,coerce:!0})),date:(n=>ze.create({...n,coerce:!0}))};var _l=B;p();f();d();var Ca=m.strictObject({title:m.string(),content:m.string()});var Tl=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,Ba=m.string().refine(n=>Tl.test(n),{message:"Must be a valid JavaScript identifier (e.g., 'acme', 'MySDK')"}),Fa=m.strictObject({namespace:m.optional(Ba),client:m.optional(m.string()),error:m.optional(m.string()),timeoutError:m.optional(m.string()),environment:m.optional(m.string()),environmentUrls:m.optional(m.string()),version:m.optional(m.string())}),Oa=m.union([Ba,Fa]),El=m.strictObject({neverThrowErrors:m.optional(m.boolean()),outputEsm:m.optional(m.boolean()),outputSourceFiles:m.optional(m.boolean()),outputSrcOnly:m.optional(m.boolean()),includeCredentialsOnCrossOriginRequests:m.optional(m.boolean()),bundle:m.optional(m.boolean()),allowCustomFetcher:m.optional(m.boolean()),generateWebSocketClients:m.optional(m.boolean()),defaultTimeout:m.optional(m.union([m.literal("infinity"),m.number()])),skipResponseValidation:m.optional(m.boolean()),extraDependencies:m.optional(m.record(m.string())),extraDevDependencies:m.optional(m.record(m.string())),extraPeerDependencies:m.optional(m.record(m.string())),extraPeerDependenciesMeta:m.optional(m.record(m.any())),treatUnknownAsAny:m.optional(m.boolean()),noOptionalProperties:m.optional(m.boolean()),tolerateRepublish:m.optional(m.boolean()),packageJson:m.optional(m.record(m.any())),publishToJsr:m.optional(m.boolean()),omitUndefined:m.optional(m.boolean()),useLegacyExports:m.optional(m.boolean()),streamType:m.optional(m.enum(["wrapper","web"])),fileResponseType:m.optional(m.enum(["stream","binary-response"])),formDataSupport:m.optional(m.enum(["Node16","Node18"])),fetchSupport:m.optional(m.enum(["node-fetch","native"])),packagePath:m.optional(m.string()),omitFernHeaders:m.optional(m.boolean()),includePlatformHeaders:m.optional(m.boolean()),allowUserAgentAppInfo:m.optional(m.boolean()),useDefaultRequestParameterValues:m.optional(m.boolean()),packageManager:m.optional(m.enum(["pnpm","yarn"])),flattenRequestParameters:m.optional(m.boolean()),respectOptionalRequestBody:m.optional(m.boolean()),exportAllRequestsAtRoot:m.optional(m.boolean()),customReadmeSections:m.optional(m.array(Ca)),testFramework:m.optional(m.enum(["jest","vitest"])),consolidateTypeFiles:m.optional(m.boolean()),generateEndpointMetadata:m.optional(m.boolean()),wireTestsFallbackToAutoGeneratedErrorExamples:m.boolean().optional(),linter:m.optional(m.enum(["biome","oxlint","none"])),formatter:m.optional(m.enum(["prettier","biome","oxfmt","none"])),enableForwardCompatibleEnums:m.optional(m.boolean()),parameterNaming:m.optional(m.enum(["originalName","wireValue","camelCase","snakeCase","default"])),generateSubpackageExports:m.optional(m.boolean()),allowExtraFields:m.optional(m.boolean()),enableInlineTypes:m.optional(m.boolean()),inlineFileProperties:m.optional(m.boolean()),inlinePathParameters:m.optional(m.boolean()),naming:m.optional(Oa),namespaceExport:m.optional(m.string()),noSerdeLayer:m.optional(m.boolean()),serdeLayer:m.optional(m.boolean()),private:m.optional(m.boolean()),requireDefaultEnvironment:m.optional(m.boolean()),requireBaseUrl:m.optional(m.boolean()),retainOriginalCasing:m.optional(m.boolean()),useBigInt:m.optional(m.boolean()),useBrandedStringAliases:m.optional(m.boolean()),offsetSemantics:m.optional(m.enum(["item-index","page-index"])),customPagerName:m.optional(m.string()),resolveQueryParameterNameConflicts:m.optional(m.boolean()),alwaysSendAuth:m.optional(m.boolean()),"optional-auth":m.optional(m.boolean()),guardProcessEnvAccess:m.optional(m.boolean()),generateReactQueryHooks:m.optional(m.boolean()),includeContentHeadersOnFileDownloadResponse:m.optional(m.boolean()),includeUtilsOnUnionMembers:m.optional(m.boolean()),includeOtherInUnionTypes:m.optional(m.boolean()),writeUnitTests:m.optional(m.boolean()),generateWireTests:m.optional(m.boolean()),noScripts:m.optional(m.boolean()),skipNpmPkgFix:m.optional(m.boolean()),experimentalGenerateReadWriteOnlyTypes:m.optional(m.boolean()),defaultTimeoutInSeconds:m.optional(m.union([m.literal("infinity"),m.number()])),timeoutInSeconds:m.optional(m.union([m.literal("infinity"),m.number()])),includeApiReference:m.optional(m.boolean()),shouldGenerateWebsocketClients:m.optional(m.boolean()),_fernLicenseName:m.optional(m.string()),maxRetries:m.optional(m.number().int().min(0)),retryStatusCodes:m.optional(m.enum(["legacy","recommended"]))});function Wt(n){return n?.serdeLayer!=null?!n.serdeLayer:!!n?.noSerdeLayer}var k={};ue(k,{AstNode:()=>W,ClassInstantiation:()=>vt,CodeBlock:()=>bt,Comment:()=>Le,Function:()=>wt,FunctionInvocation:()=>_t,MethodInvocation:()=>Tt,Parameter:()=>Et,Reference:()=>it,Type:()=>nt,TypeLiteral:()=>Ae,Types:()=>nt,Variable:()=>It,Writer:()=>ct,codeblock:()=>Sl,function_:()=>Nl,instantiateClass:()=>Cl,invokeFunction:()=>Bl,invokeMethod:()=>Fl,parameter:()=>Ol,reference:()=>Ll,variable:()=>Pl});p();f();d();p();f();d();p();f();d();var vt=class extends W{constructor({class_:t,arguments_:r}){super();I(this,"class_");I(this,"arguments_");this.class_=t,this.arguments_=r}write(t){t.write("new "),t.writeNode(this.class_),t.write("("),t.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:r=>r.write(t)}),t.write(")")}};p();f();d();var bt=class extends W{constructor(t){super();I(this,"args");this.args=t}write(t){return new de(this.args).write(t)}};p();f();d();var Le=class extends W{constructor({docs:t}={docs:void 0}){super();I(this,"docs");this.docs=t}write(t){this.docs!=null&&(t.writeLine("/**"),this.docs.split(`
|
|
20
20
|
`).forEach(r=>{t.writeLine(` * ${r}`)}),t.writeLine("*/"))}};p();f();d();p();f();d();var nt=class extends W{constructor(t){super();I(this,"internalType");this.internalType=t}write(t){switch(this.internalType.type){case"string":t.write("string");break;case"number":t.write("number");break;case"bigint":t.write("bigint");break;case"boolean":t.write("boolean");break;case"array":this.internalType.valueType.write(t),t.write("[]");break;case"map":t.write("Record<"),this.internalType.keyType.write(t),t.write(", "),this.internalType.valueType.write(t),t.write(">");break;case"object":t.write("{"),t.indent();for(let[r,a]of Object.entries(this.internalType.fields))t.write(`${r}: `),a.write(t),t.writeLine(",");t.dedent(),t.write("}");break;case"enum":t.write("enum");break;case"any":t.write("any");break;case"promise":t.write("Promise<"),this.internalType.value.write(t),t.write(">");break;case"unknown":t.write("unknown");break;case"void":t.write("void");break;case"undefined":t.write("undefined");break;case"null":t.write("null");break;case"never":t.write("never");break;case"nop":break;default:q(this.internalType)}}static string(){return new this({type:"string"})}static number(){return new this({type:"number"})}static bigint(){return new this({type:"bigint"})}static boolean(){return new this({type:"boolean"})}static array(t){return new this({type:"array",valueType:t})}static object(t){return new this({type:"object",fields:t})}static enum(t){return new this({type:"enum",values:t})}static any(){return new this({type:"any"})}static promise(t){return t.internalType.type==="promise"?t:new this({type:"promise",value:t})}static unknown(){return new this({type:"unknown"})}static void(){return new this({type:"void"})}static undefined(){return new this({type:"undefined"})}static null(){return new this({type:"null"})}static never(){return new this({type:"never"})}static nop(){return new this({type:"nop"})}};var wt=class extends W{constructor({name:t,parameters:r,async:a,body:o,return_:u,docs:h}){super();I(this,"name");I(this,"parameters");I(this,"async");I(this,"body");I(this,"return_");I(this,"docs");this.name=t,this.parameters=r,this.async=a??!1,this.body=o,this.return_=u,this.docs=h}write(t){t.writeNode(new Le({docs:this.docs})),this.async&&t.write("async "),t.write("function "),t.write(`${this.name}`),this.writeParameters(t),this.return_!=null&&(t.write(": "),t.writeNode(this.async?nt.promise(this.return_):this.return_)),t.writeLine(" {"),t.indent(),this.body?.write(t),t.dedent(),t.writeNewLineIfLastLineNot(),t.writeLine("}")}writeParameters(t){if(this.parameters.length===0){t.write("()");return}t.indent(),t.writeLine("(");for(let r of this.parameters)t.writeNode(r),t.writeLine(",");t.dedent(),t.write(")")}};p();f();d();var _t=class extends W{constructor({function_:t,arguments_:r}){super();I(this,"function_");I(this,"arguments_");this.function_=t,this.arguments_=r}write(t){t.writeNode(this.function_),t.write("("),t.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:r=>r.write(t)}),t.write(")")}};p();f();d();var Tt=class extends W{constructor({on:t,method:r,arguments_:a,async:o}){super();I(this,"on");I(this,"method");I(this,"arguments_");I(this,"async");this.on=t,this.method=r,this.arguments_=a,this.async=o}write(t){this.async&&t.write("await "),this.on.write(t),t.write("."),t.write(this.method),t.write("("),t.delimit({nodes:this.arguments_,delimiter:", ",writeFunction:r=>r.write(t)}),t.write(")")}};p();f();d();var Et=class extends W{constructor({name:t,type:r,docs:a}){super();I(this,"name");I(this,"type");I(this,"docs");this.name=t,this.type=r,this.docs=a}write(t){this.docs!=null&&t.writeNode(new Le({docs:this.docs})),t.write(`${this.name}: `),this.type.write(t)}};p();f();d();var it=class extends W{constructor({name:t,importFrom:r,memberName:a}){super();I(this,"name");I(this,"importFrom");I(this,"memberName");this.name=t,this.importFrom=r,this.memberName=a}write(t){this.importFrom!=null&&t.addImport(this);let r=this.importFrom?.type==="star"?`${this.importFrom.starImportAlias}.`:"",a=this.memberName!=null?`.${this.memberName}`:"";t.write(`${r}${this.name}${a}`)}};p();f();d();var Ae=class n extends W{constructor(t){super();I(this,"internalType");this.internalType=t}write(t){let r=Wt(t.customConfig),a=!!t.customConfig?.useBigInt;switch(this.internalType.type){case"array":{this.writeIterable({writer:t,iterable:this.internalType});break}case"blob":{if(r){t.writeNode(n.string(this.internalType.value));return}t.write("new Blob(["),t.writeNode(n.string(this.internalType.value)),t.write("])");break}case"boolean":{t.write(this.internalType.value.toString());break}case"bigint":{if(a){t.write(`BigInt("${this.internalType.value.toString()}")`);return}t.write(`"${this.internalType.value.toString()}"`);return}case"datetime":{if(r){t.writeNode(n.string(this.internalType.value));return}t.write("new Date("),t.writeNode(n.string(this.internalType.value)),t.write(")");break}case"number":{t.write(this.internalType.value.toString());break}case"object":{this.writeObject({writer:t,object:this.internalType});break}case"record":{this.writeRecord({writer:t,record:this.internalType});break}case"reference":{t.writeNode(this.internalType.value);break}case"set":{if(r||this.isSetOfObjects()){t.writeNode(n.array({values:this.internalType.values}));return}t.write("new Set("),this.writeIterable({writer:t,iterable:this.internalType}),t.write(")");break}case"string":{this.internalType.value.includes(`
|
|
21
21
|
`)?this.writeStringWithBackticks({writer:t,value:this.internalType.value}):t.write(`"${this.internalType.value.replaceAll('"','\\"')}"`);break}case"tuple":{this.writeIterable({writer:t,iterable:this.internalType});break}case"unknown":{this.writeUnknown({writer:t,value:this.internalType.value});break}case"null":{t.write("null");break}case"nop":break;default:q(this.internalType)}}isObject(){return this.internalType.type==="object"}asObjectOrThrow(){if(this.isObject())return this.internalType;throw new Error("Internal error; ts.TypeLiteral is not an object")}isSet(){return this.internalType.type==="set"}asSetOrThrow(){if(this.isSet())return this.internalType;throw new Error("Internal error; ts.TypeLiteral is not a set")}isSetOfObjects(){return this.isSet()&&this.asSetOrThrow().values.every(t=>t.isObject())}writeStringWithBackticks({writer:t,value:r}){t.write("`");let a=r.split(`
|
|
22
22
|
`),o=a[0]+`
|