@tsctl/cli 0.2.0 → 0.2.1

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.mjs ADDED
@@ -0,0 +1 @@
1
+ var s$=Object.defineProperty;var e$=($)=>$;function $q($,q){this[$]=e$.bind(null,q)}var qq=($,q)=>{for(var _ in q)s$($,_,{get:q[_],enumerable:!0,configurable:!0,set:$q.bind(q,_)})};var H={};qq(H,{void:()=>xq,util:()=>V,unknown:()=>lq,union:()=>cq,undefined:()=>Pq,tuple:()=>iq,transformer:()=>__,symbol:()=>Iq,string:()=>z$,strictObject:()=>nq,setErrorMap:()=>Gq,set:()=>dq,record:()=>oq,quotelessJson:()=>_q,promise:()=>q_,preprocess:()=>H_,pipeline:()=>J_,ostring:()=>X_,optional:()=>W_,onumber:()=>Q_,oboolean:()=>Y_,objectUtil:()=>V$,object:()=>Zq,number:()=>g$,nullable:()=>G_,null:()=>hq,never:()=>mq,nativeEnum:()=>$_,nan:()=>kq,map:()=>rq,makeIssue:()=>X$,literal:()=>sq,lazy:()=>tq,late:()=>Kq,isValid:()=>T,isDirty:()=>b$,isAsync:()=>o,isAborted:()=>S$,intersection:()=>pq,instanceof:()=>Cq,getParsedType:()=>k,getErrorMap:()=>i,function:()=>aq,enum:()=>eq,effect:()=>__,discriminatedUnion:()=>uq,defaultErrorMap:()=>I,datetimeRegex:()=>K$,date:()=>gq,custom:()=>k$,coerce:()=>M_,boolean:()=>I$,bigint:()=>zq,array:()=>yq,any:()=>Tq,addIssueToContext:()=>w,ZodVoid:()=>Y$,ZodUnknown:()=>l,ZodUnion:()=>e,ZodUndefined:()=>t,ZodType:()=>E,ZodTuple:()=>g,ZodTransformer:()=>C,ZodSymbol:()=>Q$,ZodString:()=>N,ZodSet:()=>u,ZodSchema:()=>E,ZodRecord:()=>M$,ZodReadonly:()=>J$,ZodPromise:()=>p,ZodPipeline:()=>j$,ZodParsedType:()=>Y,ZodOptional:()=>F,ZodObject:()=>f,ZodNumber:()=>m,ZodNullable:()=>h,ZodNull:()=>s,ZodNever:()=>z,ZodNativeEnum:()=>W$,ZodNaN:()=>w$,ZodMap:()=>B$,ZodLiteral:()=>_$,ZodLazy:()=>q$,ZodIssueCode:()=>Q,ZodIntersection:()=>$$,ZodFunction:()=>d,ZodFirstPartyTypeKind:()=>b,ZodError:()=>v,ZodEnum:()=>y,ZodEffects:()=>C,ZodDiscriminatedUnion:()=>O$,ZodDefault:()=>G$,ZodDate:()=>n,ZodCatch:()=>H$,ZodBranded:()=>R$,ZodBoolean:()=>a,ZodBigInt:()=>x,ZodArray:()=>D,ZodAny:()=>c,Schema:()=>E,ParseStatus:()=>A,OK:()=>U,NEVER:()=>B_,INVALID:()=>S,EMPTY_PATH:()=>Hq,DIRTY:()=>Z,BRAND:()=>Fq});var V;(function($){$.assertEqual=(W)=>{};function q(W){}$.assertIs=q;function _(W){throw Error()}$.assertNever=_,$.arrayToEnum=(W)=>{let X={};for(let J of W)X[J]=J;return X},$.getValidEnumValues=(W)=>{let X=$.objectKeys(W).filter((M)=>typeof W[W[M]]!=="number"),J={};for(let M of X)J[M]=W[M];return $.objectValues(J)},$.objectValues=(W)=>{return $.objectKeys(W).map(function(X){return W[X]})},$.objectKeys=typeof Object.keys==="function"?(W)=>Object.keys(W):(W)=>{let X=[];for(let J in W)if(Object.prototype.hasOwnProperty.call(W,J))X.push(J);return X},$.find=(W,X)=>{for(let J of W)if(X(J))return J;return},$.isInteger=typeof Number.isInteger==="function"?(W)=>Number.isInteger(W):(W)=>typeof W==="number"&&Number.isFinite(W)&&Math.floor(W)===W;function G(W,X=" | "){return W.map((J)=>typeof J==="string"?`'${J}'`:J).join(X)}$.joinValues=G,$.jsonStringifyReplacer=(W,X)=>{if(typeof X==="bigint")return X.toString();return X}})(V||(V={}));var V$;(function($){$.mergeShapes=(q,_)=>{return{...q,..._}}})(V$||(V$={}));var Y=V.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),k=($)=>{switch(typeof $){case"undefined":return Y.undefined;case"string":return Y.string;case"number":return Number.isNaN($)?Y.nan:Y.number;case"boolean":return Y.boolean;case"function":return Y.function;case"bigint":return Y.bigint;case"symbol":return Y.symbol;case"object":if(Array.isArray($))return Y.array;if($===null)return Y.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return Y.promise;if(typeof Map<"u"&&$ instanceof Map)return Y.map;if(typeof Set<"u"&&$ instanceof Set)return Y.set;if(typeof Date<"u"&&$ instanceof Date)return Y.date;return Y.object;default:return Y.unknown}};var Q=V.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"]),_q=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class v extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(_)=>{this.issues=[...this.issues,_]},this.addIssues=(_=[])=>{this.issues=[...this.issues,..._]};let q=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,q);else this.__proto__=q;this.name="ZodError",this.issues=$}format($){let q=$||function(W){return W.message},_={_errors:[]},G=(W)=>{for(let X of W.issues)if(X.code==="invalid_union")X.unionErrors.map(G);else if(X.code==="invalid_return_type")G(X.returnTypeError);else if(X.code==="invalid_arguments")G(X.argumentsError);else if(X.path.length===0)_._errors.push(q(X));else{let J=_,M=0;while(M<X.path.length){let B=X.path[M];if(M!==X.path.length-1)J[B]=J[B]||{_errors:[]};else J[B]=J[B]||{_errors:[]},J[B]._errors.push(q(X));J=J[B],M++}}};return G(this),_}static assert($){if(!($ instanceof v))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,V.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(q)=>q.message){let q={},_=[];for(let G of this.issues)if(G.path.length>0){let W=G.path[0];q[W]=q[W]||[],q[W].push($(G))}else _.push($(G));return{formErrors:_,fieldErrors:q}}get formErrors(){return this.flatten()}}v.create=($)=>{return new v($)};var Wq=($,q)=>{let _;switch($.code){case Q.invalid_type:if($.received===Y.undefined)_="Required";else _=`Expected ${$.expected}, received ${$.received}`;break;case Q.invalid_literal:_=`Invalid literal value, expected ${JSON.stringify($.expected,V.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:_=`Unrecognized key(s) in object: ${V.joinValues($.keys,", ")}`;break;case Q.invalid_union:_="Invalid input";break;case Q.invalid_union_discriminator:_=`Invalid discriminator value. Expected ${V.joinValues($.options)}`;break;case Q.invalid_enum_value:_=`Invalid enum value. Expected ${V.joinValues($.options)}, received '${$.received}'`;break;case Q.invalid_arguments:_="Invalid function arguments";break;case Q.invalid_return_type:_="Invalid function return type";break;case Q.invalid_date:_="Invalid date";break;case Q.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(_=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")_=`${_} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)_=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)_=`Invalid input: must end with "${$.validation.endsWith}"`;else V.assertNever($.validation);else if($.validation!=="regex")_=`Invalid ${$.validation}`;else _="Invalid";break;case Q.too_small:if($.type==="array")_=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")_=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")_=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")_=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")_=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else _="Invalid input";break;case Q.too_big:if($.type==="array")_=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")_=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")_=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")_=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")_=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else _="Invalid input";break;case Q.custom:_="Invalid input";break;case Q.invalid_intersection_types:_="Intersection results could not be merged";break;case Q.not_multiple_of:_=`Number must be a multiple of ${$.multipleOf}`;break;case Q.not_finite:_="Number must be finite";break;default:_=q.defaultError,V.assertNever($)}return{message:_}},I=Wq;var v$=I;function Gq($){v$=$}function i(){return v$}var X$=($)=>{let{data:q,path:_,errorMaps:G,issueData:W}=$,X=[..._,...W.path||[]],J={...W,path:X};if(W.message!==void 0)return{...W,path:X,message:W.message};let M="",B=G.filter((R)=>!!R).slice().reverse();for(let R of B)M=R(J,{data:q,defaultError:M}).message;return{...W,path:X,message:M}},Hq=[];function w($,q){let _=i(),G=X$({issueData:q,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,_,_===I?void 0:I].filter((W)=>!!W)});$.common.issues.push(G)}class A{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,q){let _=[];for(let G of q){if(G.status==="aborted")return S;if(G.status==="dirty")$.dirty();_.push(G.value)}return{status:$.value,value:_}}static async mergeObjectAsync($,q){let _=[];for(let G of q){let W=await G.key,X=await G.value;_.push({key:W,value:X})}return A.mergeObjectSync($,_)}static mergeObjectSync($,q){let _={};for(let G of q){let{key:W,value:X}=G;if(W.status==="aborted")return S;if(X.status==="aborted")return S;if(W.status==="dirty")$.dirty();if(X.status==="dirty")$.dirty();if(W.value!=="__proto__"&&(typeof X.value<"u"||G.alwaysSet))_[W.value]=X.value}return{status:$.value,value:_}}}var S=Object.freeze({status:"aborted"}),Z=($)=>({status:"dirty",value:$}),U=($)=>({status:"valid",value:$}),S$=($)=>$.status==="aborted",b$=($)=>$.status==="dirty",T=($)=>$.status==="valid",o=($)=>typeof Promise<"u"&&$ instanceof Promise;var j;(function($){$.errToObj=(q)=>typeof q==="string"?{message:q}:q||{},$.toString=(q)=>typeof q==="string"?q:q?.message})(j||(j={}));class K{constructor($,q,_,G){this._cachedPath=[],this.parent=$,this.data=q,this._path=_,this._key=G}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var L$=($,q)=>{if(T(q))return{success:!0,data:q.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let _=new v($.common.issues);return this._error=_,this._error}}}};function O($){if(!$)return{};let{errorMap:q,invalid_type_error:_,required_error:G,description:W}=$;if(q&&(_||G))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(q)return{errorMap:q,description:W};return{errorMap:(J,M)=>{let{message:B}=$;if(J.code==="invalid_enum_value")return{message:B??M.defaultError};if(typeof M.data>"u")return{message:B??G??M.defaultError};if(J.code!=="invalid_type")return{message:M.defaultError};return{message:B??_??M.defaultError}},description:W}}class E{get description(){return this._def.description}_getType($){return k($.data)}_getOrReturnCtx($,q){return q||{common:$.parent.common,data:$.data,parsedType:k($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new A,ctx:{common:$.parent.common,data:$.data,parsedType:k($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let q=this._parse($);if(o(q))throw Error("Synchronous parse encountered promise.");return q}_parseAsync($){let q=this._parse($);return Promise.resolve(q)}parse($,q){let _=this.safeParse($,q);if(_.success)return _.data;throw _.error}safeParse($,q){let _={common:{issues:[],async:q?.async??!1,contextualErrorMap:q?.errorMap},path:q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:k($)},G=this._parseSync({data:$,path:_.path,parent:_});return L$(_,G)}"~validate"($){let q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:k($)};if(!this["~standard"].async)try{let _=this._parseSync({data:$,path:[],parent:q});return T(_)?{value:_.value}:{issues:q.common.issues}}catch(_){if(_?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;q.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:q}).then((_)=>T(_)?{value:_.value}:{issues:q.common.issues})}async parseAsync($,q){let _=await this.safeParseAsync($,q);if(_.success)return _.data;throw _.error}async safeParseAsync($,q){let _={common:{issues:[],contextualErrorMap:q?.errorMap,async:!0},path:q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:k($)},G=this._parse({data:$,path:_.path,parent:_}),W=await(o(G)?G:Promise.resolve(G));return L$(_,W)}refine($,q){let _=(G)=>{if(typeof q==="string"||typeof q>"u")return{message:q};else if(typeof q==="function")return q(G);else return q};return this._refinement((G,W)=>{let X=$(G),J=()=>W.addIssue({code:Q.custom,..._(G)});if(typeof Promise<"u"&&X instanceof Promise)return X.then((M)=>{if(!M)return J(),!1;else return!0});if(!X)return J(),!1;else return!0})}refinement($,q){return this._refinement((_,G)=>{if(!$(_))return G.addIssue(typeof q==="function"?q(_,G):q),!1;else return!0})}_refinement($){return new C({schema:this,typeName:b.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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:(q)=>this["~validate"](q)}}optional(){return F.create(this,this._def)}nullable(){return h.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return D.create(this)}promise(){return p.create(this,this._def)}or($){return e.create([this,$],this._def)}and($){return $$.create(this,$,this._def)}transform($){return new C({...O(this._def),schema:this,typeName:b.ZodEffects,effect:{type:"transform",transform:$}})}default($){let q=typeof $==="function"?$:()=>$;return new G$({...O(this._def),innerType:this,defaultValue:q,typeName:b.ZodDefault})}brand(){return new R$({typeName:b.ZodBranded,type:this,...O(this._def)})}catch($){let q=typeof $==="function"?$:()=>$;return new H$({...O(this._def),innerType:this,catchValue:q,typeName:b.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return j$.create(this,$)}readonly(){return J$.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var Jq=/^c[^\s-]{8,}$/i,Xq=/^[0-9a-z]+$/,Qq=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Yq=/^[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,Mq=/^[a-z0-9_-]{21}$/i,Bq=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,wq=/^[-+]?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)?)??$/,jq=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Sq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",f$,bq=/^(?:(?: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])$/,Oq=/^(?:(?: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])$/,Rq=/^(([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]))$/,Eq=/^(([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])$/,Vq=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,fq=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,D$="((\\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])))",Aq=new RegExp(`^${D$}$`);function F$($){let q="[0-5]\\d";if($.precision)q=`${q}\\.\\d{${$.precision}}`;else if($.precision==null)q=`${q}(\\.\\d+)?`;let _=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${q})${_}`}function Uq($){return new RegExp(`^${F$($)}$`)}function K$($){let q=`${D$}T${F$($)}`,_=[];if(_.push($.local?"Z?":"Z"),$.offset)_.push("([+-]\\d{2}:?\\d{2})");return q=`${q}(${_.join("|")})`,new RegExp(`^${q}$`)}function vq($,q){if((q==="v4"||!q)&&bq.test($))return!0;if((q==="v6"||!q)&&Rq.test($))return!0;return!1}function Lq($,q){if(!Bq.test($))return!1;try{let[_]=$.split(".");if(!_)return!1;let G=_.replace(/-/g,"+").replace(/_/g,"/").padEnd(_.length+(4-_.length%4)%4,"="),W=JSON.parse(atob(G));if(typeof W!=="object"||W===null)return!1;if("typ"in W&&W?.typ!=="JWT")return!1;if(!W.alg)return!1;if(q&&W.alg!==q)return!1;return!0}catch{return!1}}function Nq($,q){if((q==="v4"||!q)&&Oq.test($))return!0;if((q==="v6"||!q)&&Eq.test($))return!0;return!1}class N extends E{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==Y.string){let W=this._getOrReturnCtx($);return w(W,{code:Q.invalid_type,expected:Y.string,received:W.parsedType}),S}let _=new A,G=void 0;for(let W of this._def.checks)if(W.kind==="min"){if($.data.length<W.value)G=this._getOrReturnCtx($,G),w(G,{code:Q.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),_.dirty()}else if(W.kind==="max"){if($.data.length>W.value)G=this._getOrReturnCtx($,G),w(G,{code:Q.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),_.dirty()}else if(W.kind==="length"){let X=$.data.length>W.value,J=$.data.length<W.value;if(X||J){if(G=this._getOrReturnCtx($,G),X)w(G,{code:Q.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});else if(J)w(G,{code:Q.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});_.dirty()}}else if(W.kind==="email"){if(!jq.test($.data))G=this._getOrReturnCtx($,G),w(G,{validation:"email",code:Q.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="emoji"){if(!f$)f$=new RegExp(Sq,"u");if(!f$.test($.data))G=this._getOrReturnCtx($,G),w(G,{validation:"emoji",code:Q.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="uuid"){if(!Yq.test($.data))G=this._getOrReturnCtx($,G),w(G,{validation:"uuid",code:Q.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="nanoid"){if(!Mq.test($.data))G=this._getOrReturnCtx($,G),w(G,{validation:"nanoid",code:Q.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="cuid"){if(!Jq.test($.data))G=this._getOrReturnCtx($,G),w(G,{validation:"cuid",code:Q.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="cuid2"){if(!Xq.test($.data))G=this._getOrReturnCtx($,G),w(G,{validation:"cuid2",code:Q.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="ulid"){if(!Qq.test($.data))G=this._getOrReturnCtx($,G),w(G,{validation:"ulid",code:Q.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="url")try{new URL($.data)}catch{G=this._getOrReturnCtx($,G),w(G,{validation:"url",code:Q.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="regex"){if(W.regex.lastIndex=0,!W.regex.test($.data))G=this._getOrReturnCtx($,G),w(G,{validation:"regex",code:Q.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="trim")$.data=$.data.trim();else if(W.kind==="includes"){if(!$.data.includes(W.value,W.position))G=this._getOrReturnCtx($,G),w(G,{code:Q.invalid_string,validation:{includes:W.value,position:W.position},message:W.message}),_.dirty()}else if(W.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(W.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(W.kind==="startsWith"){if(!$.data.startsWith(W.value))G=this._getOrReturnCtx($,G),w(G,{code:Q.invalid_string,validation:{startsWith:W.value},message:W.message}),_.dirty()}else if(W.kind==="endsWith"){if(!$.data.endsWith(W.value))G=this._getOrReturnCtx($,G),w(G,{code:Q.invalid_string,validation:{endsWith:W.value},message:W.message}),_.dirty()}else if(W.kind==="datetime"){if(!K$(W).test($.data))G=this._getOrReturnCtx($,G),w(G,{code:Q.invalid_string,validation:"datetime",message:W.message}),_.dirty()}else if(W.kind==="date"){if(!Aq.test($.data))G=this._getOrReturnCtx($,G),w(G,{code:Q.invalid_string,validation:"date",message:W.message}),_.dirty()}else if(W.kind==="time"){if(!Uq(W).test($.data))G=this._getOrReturnCtx($,G),w(G,{code:Q.invalid_string,validation:"time",message:W.message}),_.dirty()}else if(W.kind==="duration"){if(!wq.test($.data))G=this._getOrReturnCtx($,G),w(G,{validation:"duration",code:Q.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="ip"){if(!vq($.data,W.version))G=this._getOrReturnCtx($,G),w(G,{validation:"ip",code:Q.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="jwt"){if(!Lq($.data,W.alg))G=this._getOrReturnCtx($,G),w(G,{validation:"jwt",code:Q.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="cidr"){if(!Nq($.data,W.version))G=this._getOrReturnCtx($,G),w(G,{validation:"cidr",code:Q.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="base64"){if(!Vq.test($.data))G=this._getOrReturnCtx($,G),w(G,{validation:"base64",code:Q.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="base64url"){if(!fq.test($.data))G=this._getOrReturnCtx($,G),w(G,{validation:"base64url",code:Q.invalid_string,message:W.message}),_.dirty()}else V.assertNever(W);return{status:_.value,value:$.data}}_regex($,q,_){return this.refinement((G)=>$.test(G),{validation:q,code:Q.invalid_string,...j.errToObj(_)})}_addCheck($){return new N({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...j.errToObj($)})}url($){return this._addCheck({kind:"url",...j.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...j.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...j.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...j.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...j.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...j.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...j.errToObj($)})}base64($){return this._addCheck({kind:"base64",...j.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...j.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...j.errToObj($)})}ip($){return this._addCheck({kind:"ip",...j.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...j.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision>"u"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...j.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision>"u"?null:$?.precision,...j.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...j.errToObj($)})}regex($,q){return this._addCheck({kind:"regex",regex:$,...j.errToObj(q)})}includes($,q){return this._addCheck({kind:"includes",value:$,position:q?.position,...j.errToObj(q?.message)})}startsWith($,q){return this._addCheck({kind:"startsWith",value:$,...j.errToObj(q)})}endsWith($,q){return this._addCheck({kind:"endsWith",value:$,...j.errToObj(q)})}min($,q){return this._addCheck({kind:"min",value:$,...j.errToObj(q)})}max($,q){return this._addCheck({kind:"max",value:$,...j.errToObj(q)})}length($,q){return this._addCheck({kind:"length",value:$,...j.errToObj(q)})}nonempty($){return this.min(1,j.errToObj($))}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(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $}get maxLength(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $}}N.create=($)=>{return new N({checks:[],typeName:b.ZodString,coerce:$?.coerce??!1,...O($)})};function Dq($,q){let _=($.toString().split(".")[1]||"").length,G=(q.toString().split(".")[1]||"").length,W=_>G?_:G,X=Number.parseInt($.toFixed(W).replace(".","")),J=Number.parseInt(q.toFixed(W).replace(".",""));return X%J/10**W}class m extends E{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==Y.number){let W=this._getOrReturnCtx($);return w(W,{code:Q.invalid_type,expected:Y.number,received:W.parsedType}),S}let _=void 0,G=new A;for(let W of this._def.checks)if(W.kind==="int"){if(!V.isInteger($.data))_=this._getOrReturnCtx($,_),w(_,{code:Q.invalid_type,expected:"integer",received:"float",message:W.message}),G.dirty()}else if(W.kind==="min"){if(W.inclusive?$.data<W.value:$.data<=W.value)_=this._getOrReturnCtx($,_),w(_,{code:Q.too_small,minimum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),G.dirty()}else if(W.kind==="max"){if(W.inclusive?$.data>W.value:$.data>=W.value)_=this._getOrReturnCtx($,_),w(_,{code:Q.too_big,maximum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),G.dirty()}else if(W.kind==="multipleOf"){if(Dq($.data,W.value)!==0)_=this._getOrReturnCtx($,_),w(_,{code:Q.not_multiple_of,multipleOf:W.value,message:W.message}),G.dirty()}else if(W.kind==="finite"){if(!Number.isFinite($.data))_=this._getOrReturnCtx($,_),w(_,{code:Q.not_finite,message:W.message}),G.dirty()}else V.assertNever(W);return{status:G.value,value:$.data}}gte($,q){return this.setLimit("min",$,!0,j.toString(q))}gt($,q){return this.setLimit("min",$,!1,j.toString(q))}lte($,q){return this.setLimit("max",$,!0,j.toString(q))}lt($,q){return this.setLimit("max",$,!1,j.toString(q))}setLimit($,q,_,G){return new m({...this._def,checks:[...this._def.checks,{kind:$,value:q,inclusive:_,message:j.toString(G)}]})}_addCheck($){return new m({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:j.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:j.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:j.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:j.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:j.toString($)})}multipleOf($,q){return this._addCheck({kind:"multipleOf",value:$,message:j.toString(q)})}finite($){return this._addCheck({kind:"finite",message:j.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:j.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:j.toString($)})}get minValue(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $}get maxValue(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&V.isInteger($.value))}get isFinite(){let $=null,q=null;for(let _ of this._def.checks)if(_.kind==="finite"||_.kind==="int"||_.kind==="multipleOf")return!0;else if(_.kind==="min"){if(q===null||_.value>q)q=_.value}else if(_.kind==="max"){if($===null||_.value<$)$=_.value}return Number.isFinite(q)&&Number.isFinite($)}}m.create=($)=>{return new m({checks:[],typeName:b.ZodNumber,coerce:$?.coerce||!1,...O($)})};class x extends E{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==Y.bigint)return this._getInvalidInput($);let _=void 0,G=new A;for(let W of this._def.checks)if(W.kind==="min"){if(W.inclusive?$.data<W.value:$.data<=W.value)_=this._getOrReturnCtx($,_),w(_,{code:Q.too_small,type:"bigint",minimum:W.value,inclusive:W.inclusive,message:W.message}),G.dirty()}else if(W.kind==="max"){if(W.inclusive?$.data>W.value:$.data>=W.value)_=this._getOrReturnCtx($,_),w(_,{code:Q.too_big,type:"bigint",maximum:W.value,inclusive:W.inclusive,message:W.message}),G.dirty()}else if(W.kind==="multipleOf"){if($.data%W.value!==BigInt(0))_=this._getOrReturnCtx($,_),w(_,{code:Q.not_multiple_of,multipleOf:W.value,message:W.message}),G.dirty()}else V.assertNever(W);return{status:G.value,value:$.data}}_getInvalidInput($){let q=this._getOrReturnCtx($);return w(q,{code:Q.invalid_type,expected:Y.bigint,received:q.parsedType}),S}gte($,q){return this.setLimit("min",$,!0,j.toString(q))}gt($,q){return this.setLimit("min",$,!1,j.toString(q))}lte($,q){return this.setLimit("max",$,!0,j.toString(q))}lt($,q){return this.setLimit("max",$,!1,j.toString(q))}setLimit($,q,_,G){return new x({...this._def,checks:[...this._def.checks,{kind:$,value:q,inclusive:_,message:j.toString(G)}]})}_addCheck($){return new x({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:j.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:j.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:j.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:j.toString($)})}multipleOf($,q){return this._addCheck({kind:"multipleOf",value:$,message:j.toString(q)})}get minValue(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $}get maxValue(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $}}x.create=($)=>{return new x({checks:[],typeName:b.ZodBigInt,coerce:$?.coerce??!1,...O($)})};class a extends E{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==Y.boolean){let _=this._getOrReturnCtx($);return w(_,{code:Q.invalid_type,expected:Y.boolean,received:_.parsedType}),S}return U($.data)}}a.create=($)=>{return new a({typeName:b.ZodBoolean,coerce:$?.coerce||!1,...O($)})};class n extends E{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==Y.date){let W=this._getOrReturnCtx($);return w(W,{code:Q.invalid_type,expected:Y.date,received:W.parsedType}),S}if(Number.isNaN($.data.getTime())){let W=this._getOrReturnCtx($);return w(W,{code:Q.invalid_date}),S}let _=new A,G=void 0;for(let W of this._def.checks)if(W.kind==="min"){if($.data.getTime()<W.value)G=this._getOrReturnCtx($,G),w(G,{code:Q.too_small,message:W.message,inclusive:!0,exact:!1,minimum:W.value,type:"date"}),_.dirty()}else if(W.kind==="max"){if($.data.getTime()>W.value)G=this._getOrReturnCtx($,G),w(G,{code:Q.too_big,message:W.message,inclusive:!0,exact:!1,maximum:W.value,type:"date"}),_.dirty()}else V.assertNever(W);return{status:_.value,value:new Date($.data.getTime())}}_addCheck($){return new n({...this._def,checks:[...this._def.checks,$]})}min($,q){return this._addCheck({kind:"min",value:$.getTime(),message:j.toString(q)})}max($,q){return this._addCheck({kind:"max",value:$.getTime(),message:j.toString(q)})}get minDate(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $!=null?new Date($):null}}n.create=($)=>{return new n({checks:[],coerce:$?.coerce||!1,typeName:b.ZodDate,...O($)})};class Q$ extends E{_parse($){if(this._getType($)!==Y.symbol){let _=this._getOrReturnCtx($);return w(_,{code:Q.invalid_type,expected:Y.symbol,received:_.parsedType}),S}return U($.data)}}Q$.create=($)=>{return new Q$({typeName:b.ZodSymbol,...O($)})};class t extends E{_parse($){if(this._getType($)!==Y.undefined){let _=this._getOrReturnCtx($);return w(_,{code:Q.invalid_type,expected:Y.undefined,received:_.parsedType}),S}return U($.data)}}t.create=($)=>{return new t({typeName:b.ZodUndefined,...O($)})};class s extends E{_parse($){if(this._getType($)!==Y.null){let _=this._getOrReturnCtx($);return w(_,{code:Q.invalid_type,expected:Y.null,received:_.parsedType}),S}return U($.data)}}s.create=($)=>{return new s({typeName:b.ZodNull,...O($)})};class c extends E{constructor(){super(...arguments);this._any=!0}_parse($){return U($.data)}}c.create=($)=>{return new c({typeName:b.ZodAny,...O($)})};class l extends E{constructor(){super(...arguments);this._unknown=!0}_parse($){return U($.data)}}l.create=($)=>{return new l({typeName:b.ZodUnknown,...O($)})};class z extends E{_parse($){let q=this._getOrReturnCtx($);return w(q,{code:Q.invalid_type,expected:Y.never,received:q.parsedType}),S}}z.create=($)=>{return new z({typeName:b.ZodNever,...O($)})};class Y$ extends E{_parse($){if(this._getType($)!==Y.undefined){let _=this._getOrReturnCtx($);return w(_,{code:Q.invalid_type,expected:Y.void,received:_.parsedType}),S}return U($.data)}}Y$.create=($)=>{return new Y$({typeName:b.ZodVoid,...O($)})};class D extends E{_parse($){let{ctx:q,status:_}=this._processInputParams($),G=this._def;if(q.parsedType!==Y.array)return w(q,{code:Q.invalid_type,expected:Y.array,received:q.parsedType}),S;if(G.exactLength!==null){let X=q.data.length>G.exactLength.value,J=q.data.length<G.exactLength.value;if(X||J)w(q,{code:X?Q.too_big:Q.too_small,minimum:J?G.exactLength.value:void 0,maximum:X?G.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:G.exactLength.message}),_.dirty()}if(G.minLength!==null){if(q.data.length<G.minLength.value)w(q,{code:Q.too_small,minimum:G.minLength.value,type:"array",inclusive:!0,exact:!1,message:G.minLength.message}),_.dirty()}if(G.maxLength!==null){if(q.data.length>G.maxLength.value)w(q,{code:Q.too_big,maximum:G.maxLength.value,type:"array",inclusive:!0,exact:!1,message:G.maxLength.message}),_.dirty()}if(q.common.async)return Promise.all([...q.data].map((X,J)=>{return G.type._parseAsync(new K(q,X,q.path,J))})).then((X)=>{return A.mergeArray(_,X)});let W=[...q.data].map((X,J)=>{return G.type._parseSync(new K(q,X,q.path,J))});return A.mergeArray(_,W)}get element(){return this._def.type}min($,q){return new D({...this._def,minLength:{value:$,message:j.toString(q)}})}max($,q){return new D({...this._def,maxLength:{value:$,message:j.toString(q)}})}length($,q){return new D({...this._def,exactLength:{value:$,message:j.toString(q)}})}nonempty($){return this.min(1,$)}}D.create=($,q)=>{return new D({type:$,minLength:null,maxLength:null,exactLength:null,typeName:b.ZodArray,...O(q)})};function r($){if($ instanceof f){let q={};for(let _ in $.shape){let G=$.shape[_];q[_]=F.create(r(G))}return new f({...$._def,shape:()=>q})}else if($ instanceof D)return new D({...$._def,type:r($.element)});else if($ instanceof F)return F.create(r($.unwrap()));else if($ instanceof h)return h.create(r($.unwrap()));else if($ instanceof g)return g.create($.items.map((q)=>r(q)));else return $}class f extends E{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),q=V.objectKeys($);return this._cached={shape:$,keys:q},this._cached}_parse($){if(this._getType($)!==Y.object){let B=this._getOrReturnCtx($);return w(B,{code:Q.invalid_type,expected:Y.object,received:B.parsedType}),S}let{status:_,ctx:G}=this._processInputParams($),{shape:W,keys:X}=this._getCached(),J=[];if(!(this._def.catchall instanceof z&&this._def.unknownKeys==="strip")){for(let B in G.data)if(!X.includes(B))J.push(B)}let M=[];for(let B of X){let R=W[B],L=G.data[B];M.push({key:{status:"valid",value:B},value:R._parse(new K(G,L,G.path,B)),alwaysSet:B in G.data})}if(this._def.catchall instanceof z){let B=this._def.unknownKeys;if(B==="passthrough")for(let R of J)M.push({key:{status:"valid",value:R},value:{status:"valid",value:G.data[R]}});else if(B==="strict"){if(J.length>0)w(G,{code:Q.unrecognized_keys,keys:J}),_.dirty()}else if(B==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let B=this._def.catchall;for(let R of J){let L=G.data[R];M.push({key:{status:"valid",value:R},value:B._parse(new K(G,L,G.path,R)),alwaysSet:R in G.data})}}if(G.common.async)return Promise.resolve().then(async()=>{let B=[];for(let R of M){let L=await R.key,U$=await R.value;B.push({key:L,value:U$,alwaysSet:R.alwaysSet})}return B}).then((B)=>{return A.mergeObjectSync(_,B)});else return A.mergeObjectSync(_,M)}get shape(){return this._def.shape()}strict($){return j.errToObj,new f({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(q,_)=>{let G=this._def.errorMap?.(q,_).message??_.defaultError;if(q.code==="unrecognized_keys")return{message:j.errToObj($).message??G};return{message:G}}}:{}})}strip(){return new f({...this._def,unknownKeys:"strip"})}passthrough(){return new f({...this._def,unknownKeys:"passthrough"})}extend($){return new f({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new f({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:b.ZodObject})}setKey($,q){return this.augment({[$]:q})}catchall($){return new f({...this._def,catchall:$})}pick($){let q={};for(let _ of V.objectKeys($))if($[_]&&this.shape[_])q[_]=this.shape[_];return new f({...this._def,shape:()=>q})}omit($){let q={};for(let _ of V.objectKeys(this.shape))if(!$[_])q[_]=this.shape[_];return new f({...this._def,shape:()=>q})}deepPartial(){return r(this)}partial($){let q={};for(let _ of V.objectKeys(this.shape)){let G=this.shape[_];if($&&!$[_])q[_]=G;else q[_]=G.optional()}return new f({...this._def,shape:()=>q})}required($){let q={};for(let _ of V.objectKeys(this.shape))if($&&!$[_])q[_]=this.shape[_];else{let W=this.shape[_];while(W instanceof F)W=W._def.innerType;q[_]=W}return new f({...this._def,shape:()=>q})}keyof(){return C$(V.objectKeys(this.shape))}}f.create=($,q)=>{return new f({shape:()=>$,unknownKeys:"strip",catchall:z.create(),typeName:b.ZodObject,...O(q)})};f.strictCreate=($,q)=>{return new f({shape:()=>$,unknownKeys:"strict",catchall:z.create(),typeName:b.ZodObject,...O(q)})};f.lazycreate=($,q)=>{return new f({shape:$,unknownKeys:"strip",catchall:z.create(),typeName:b.ZodObject,...O(q)})};class e extends E{_parse($){let{ctx:q}=this._processInputParams($),_=this._def.options;function G(W){for(let J of W)if(J.result.status==="valid")return J.result;for(let J of W)if(J.result.status==="dirty")return q.common.issues.push(...J.ctx.common.issues),J.result;let X=W.map((J)=>new v(J.ctx.common.issues));return w(q,{code:Q.invalid_union,unionErrors:X}),S}if(q.common.async)return Promise.all(_.map(async(W)=>{let X={...q,common:{...q.common,issues:[]},parent:null};return{result:await W._parseAsync({data:q.data,path:q.path,parent:X}),ctx:X}})).then(G);else{let W=void 0,X=[];for(let M of _){let B={...q,common:{...q.common,issues:[]},parent:null},R=M._parseSync({data:q.data,path:q.path,parent:B});if(R.status==="valid")return R;else if(R.status==="dirty"&&!W)W={result:R,ctx:B};if(B.common.issues.length)X.push(B.common.issues)}if(W)return q.common.issues.push(...W.ctx.common.issues),W.result;let J=X.map((M)=>new v(M));return w(q,{code:Q.invalid_union,unionErrors:J}),S}}get options(){return this._def.options}}e.create=($,q)=>{return new e({options:$,typeName:b.ZodUnion,...O(q)})};var P=($)=>{if($ instanceof q$)return P($.schema);else if($ instanceof C)return P($.innerType());else if($ instanceof _$)return[$.value];else if($ instanceof y)return $.options;else if($ instanceof W$)return V.objectValues($.enum);else if($ instanceof G$)return P($._def.innerType);else if($ instanceof t)return[void 0];else if($ instanceof s)return[null];else if($ instanceof F)return[void 0,...P($.unwrap())];else if($ instanceof h)return[null,...P($.unwrap())];else if($ instanceof R$)return P($.unwrap());else if($ instanceof J$)return P($.unwrap());else if($ instanceof H$)return P($._def.innerType);else return[]};class O$ extends E{_parse($){let{ctx:q}=this._processInputParams($);if(q.parsedType!==Y.object)return w(q,{code:Q.invalid_type,expected:Y.object,received:q.parsedType}),S;let _=this.discriminator,G=q.data[_],W=this.optionsMap.get(G);if(!W)return w(q,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[_]}),S;if(q.common.async)return W._parseAsync({data:q.data,path:q.path,parent:q});else return W._parseSync({data:q.data,path:q.path,parent:q})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,q,_){let G=new Map;for(let W of q){let X=P(W.shape[$]);if(!X.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let J of X){if(G.has(J))throw Error(`Discriminator property ${String($)} has duplicate value ${String(J)}`);G.set(J,W)}}return new O$({typeName:b.ZodDiscriminatedUnion,discriminator:$,options:q,optionsMap:G,...O(_)})}}function A$($,q){let _=k($),G=k(q);if($===q)return{valid:!0,data:$};else if(_===Y.object&&G===Y.object){let W=V.objectKeys(q),X=V.objectKeys($).filter((M)=>W.indexOf(M)!==-1),J={...$,...q};for(let M of X){let B=A$($[M],q[M]);if(!B.valid)return{valid:!1};J[M]=B.data}return{valid:!0,data:J}}else if(_===Y.array&&G===Y.array){if($.length!==q.length)return{valid:!1};let W=[];for(let X=0;X<$.length;X++){let J=$[X],M=q[X],B=A$(J,M);if(!B.valid)return{valid:!1};W.push(B.data)}return{valid:!0,data:W}}else if(_===Y.date&&G===Y.date&&+$===+q)return{valid:!0,data:$};else return{valid:!1}}class $$ extends E{_parse($){let{status:q,ctx:_}=this._processInputParams($),G=(W,X)=>{if(S$(W)||S$(X))return S;let J=A$(W.value,X.value);if(!J.valid)return w(_,{code:Q.invalid_intersection_types}),S;if(b$(W)||b$(X))q.dirty();return{status:q.value,value:J.data}};if(_.common.async)return Promise.all([this._def.left._parseAsync({data:_.data,path:_.path,parent:_}),this._def.right._parseAsync({data:_.data,path:_.path,parent:_})]).then(([W,X])=>G(W,X));else return G(this._def.left._parseSync({data:_.data,path:_.path,parent:_}),this._def.right._parseSync({data:_.data,path:_.path,parent:_}))}}$$.create=($,q,_)=>{return new $$({left:$,right:q,typeName:b.ZodIntersection,...O(_)})};class g extends E{_parse($){let{status:q,ctx:_}=this._processInputParams($);if(_.parsedType!==Y.array)return w(_,{code:Q.invalid_type,expected:Y.array,received:_.parsedType}),S;if(_.data.length<this._def.items.length)return w(_,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S;if(!this._def.rest&&_.data.length>this._def.items.length)w(_,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q.dirty();let W=[..._.data].map((X,J)=>{let M=this._def.items[J]||this._def.rest;if(!M)return null;return M._parse(new K(_,X,_.path,J))}).filter((X)=>!!X);if(_.common.async)return Promise.all(W).then((X)=>{return A.mergeArray(q,X)});else return A.mergeArray(q,W)}get items(){return this._def.items}rest($){return new g({...this._def,rest:$})}}g.create=($,q)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new g({items:$,typeName:b.ZodTuple,rest:null,...O(q)})};class M$ extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:q,ctx:_}=this._processInputParams($);if(_.parsedType!==Y.object)return w(_,{code:Q.invalid_type,expected:Y.object,received:_.parsedType}),S;let G=[],W=this._def.keyType,X=this._def.valueType;for(let J in _.data)G.push({key:W._parse(new K(_,J,_.path,J)),value:X._parse(new K(_,_.data[J],_.path,J)),alwaysSet:J in _.data});if(_.common.async)return A.mergeObjectAsync(q,G);else return A.mergeObjectSync(q,G)}get element(){return this._def.valueType}static create($,q,_){if(q instanceof E)return new M$({keyType:$,valueType:q,typeName:b.ZodRecord,...O(_)});return new M$({keyType:N.create(),valueType:$,typeName:b.ZodRecord,...O(q)})}}class B$ extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:q,ctx:_}=this._processInputParams($);if(_.parsedType!==Y.map)return w(_,{code:Q.invalid_type,expected:Y.map,received:_.parsedType}),S;let G=this._def.keyType,W=this._def.valueType,X=[..._.data.entries()].map(([J,M],B)=>{return{key:G._parse(new K(_,J,_.path,[B,"key"])),value:W._parse(new K(_,M,_.path,[B,"value"]))}});if(_.common.async){let J=new Map;return Promise.resolve().then(async()=>{for(let M of X){let B=await M.key,R=await M.value;if(B.status==="aborted"||R.status==="aborted")return S;if(B.status==="dirty"||R.status==="dirty")q.dirty();J.set(B.value,R.value)}return{status:q.value,value:J}})}else{let J=new Map;for(let M of X){let{key:B,value:R}=M;if(B.status==="aborted"||R.status==="aborted")return S;if(B.status==="dirty"||R.status==="dirty")q.dirty();J.set(B.value,R.value)}return{status:q.value,value:J}}}}B$.create=($,q,_)=>{return new B$({valueType:q,keyType:$,typeName:b.ZodMap,...O(_)})};class u extends E{_parse($){let{status:q,ctx:_}=this._processInputParams($);if(_.parsedType!==Y.set)return w(_,{code:Q.invalid_type,expected:Y.set,received:_.parsedType}),S;let G=this._def;if(G.minSize!==null){if(_.data.size<G.minSize.value)w(_,{code:Q.too_small,minimum:G.minSize.value,type:"set",inclusive:!0,exact:!1,message:G.minSize.message}),q.dirty()}if(G.maxSize!==null){if(_.data.size>G.maxSize.value)w(_,{code:Q.too_big,maximum:G.maxSize.value,type:"set",inclusive:!0,exact:!1,message:G.maxSize.message}),q.dirty()}let W=this._def.valueType;function X(M){let B=new Set;for(let R of M){if(R.status==="aborted")return S;if(R.status==="dirty")q.dirty();B.add(R.value)}return{status:q.value,value:B}}let J=[..._.data.values()].map((M,B)=>W._parse(new K(_,M,_.path,B)));if(_.common.async)return Promise.all(J).then((M)=>X(M));else return X(J)}min($,q){return new u({...this._def,minSize:{value:$,message:j.toString(q)}})}max($,q){return new u({...this._def,maxSize:{value:$,message:j.toString(q)}})}size($,q){return this.min($,q).max($,q)}nonempty($){return this.min(1,$)}}u.create=($,q)=>{return new u({valueType:$,minSize:null,maxSize:null,typeName:b.ZodSet,...O(q)})};class d extends E{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:q}=this._processInputParams($);if(q.parsedType!==Y.function)return w(q,{code:Q.invalid_type,expected:Y.function,received:q.parsedType}),S;function _(J,M){return X$({data:J,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,i(),I].filter((B)=>!!B),issueData:{code:Q.invalid_arguments,argumentsError:M}})}function G(J,M){return X$({data:J,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,i(),I].filter((B)=>!!B),issueData:{code:Q.invalid_return_type,returnTypeError:M}})}let W={errorMap:q.common.contextualErrorMap},X=q.data;if(this._def.returns instanceof p){let J=this;return U(async function(...M){let B=new v([]),R=await J._def.args.parseAsync(M,W).catch((E$)=>{throw B.addIssue(_(M,E$)),B}),L=await Reflect.apply(X,this,R);return await J._def.returns._def.type.parseAsync(L,W).catch((E$)=>{throw B.addIssue(G(L,E$)),B})})}else{let J=this;return U(function(...M){let B=J._def.args.safeParse(M,W);if(!B.success)throw new v([_(M,B.error)]);let R=Reflect.apply(X,this,B.data),L=J._def.returns.safeParse(R,W);if(!L.success)throw new v([G(R,L.error)]);return L.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new d({...this._def,args:g.create($).rest(l.create())})}returns($){return new d({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,q,_){return new d({args:$?$:g.create([]).rest(l.create()),returns:q||l.create(),typeName:b.ZodFunction,...O(_)})}}class q$ extends E{get schema(){return this._def.getter()}_parse($){let{ctx:q}=this._processInputParams($);return this._def.getter()._parse({data:q.data,path:q.path,parent:q})}}q$.create=($,q)=>{return new q$({getter:$,typeName:b.ZodLazy,...O(q)})};class _$ extends E{_parse($){if($.data!==this._def.value){let q=this._getOrReturnCtx($);return w(q,{received:q.data,code:Q.invalid_literal,expected:this._def.value}),S}return{status:"valid",value:$.data}}get value(){return this._def.value}}_$.create=($,q)=>{return new _$({value:$,typeName:b.ZodLiteral,...O(q)})};function C$($,q){return new y({values:$,typeName:b.ZodEnum,...O(q)})}class y extends E{_parse($){if(typeof $.data!=="string"){let q=this._getOrReturnCtx($),_=this._def.values;return w(q,{expected:V.joinValues(_),received:q.parsedType,code:Q.invalid_type}),S}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let q=this._getOrReturnCtx($),_=this._def.values;return w(q,{received:q.data,code:Q.invalid_enum_value,options:_}),S}return U($.data)}get options(){return this._def.values}get enum(){let $={};for(let q of this._def.values)$[q]=q;return $}get Values(){let $={};for(let q of this._def.values)$[q]=q;return $}get Enum(){let $={};for(let q of this._def.values)$[q]=q;return $}extract($,q=this._def){return y.create($,{...this._def,...q})}exclude($,q=this._def){return y.create(this.options.filter((_)=>!$.includes(_)),{...this._def,...q})}}y.create=C$;class W$ extends E{_parse($){let q=V.getValidEnumValues(this._def.values),_=this._getOrReturnCtx($);if(_.parsedType!==Y.string&&_.parsedType!==Y.number){let G=V.objectValues(q);return w(_,{expected:V.joinValues(G),received:_.parsedType,code:Q.invalid_type}),S}if(!this._cache)this._cache=new Set(V.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let G=V.objectValues(q);return w(_,{received:_.data,code:Q.invalid_enum_value,options:G}),S}return U($.data)}get enum(){return this._def.values}}W$.create=($,q)=>{return new W$({values:$,typeName:b.ZodNativeEnum,...O(q)})};class p extends E{unwrap(){return this._def.type}_parse($){let{ctx:q}=this._processInputParams($);if(q.parsedType!==Y.promise&&q.common.async===!1)return w(q,{code:Q.invalid_type,expected:Y.promise,received:q.parsedType}),S;let _=q.parsedType===Y.promise?q.data:Promise.resolve(q.data);return U(_.then((G)=>{return this._def.type.parseAsync(G,{path:q.path,errorMap:q.common.contextualErrorMap})}))}}p.create=($,q)=>{return new p({type:$,typeName:b.ZodPromise,...O(q)})};class C extends E{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===b.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:q,ctx:_}=this._processInputParams($),G=this._def.effect||null,W={addIssue:(X)=>{if(w(_,X),X.fatal)q.abort();else q.dirty()},get path(){return _.path}};if(W.addIssue=W.addIssue.bind(W),G.type==="preprocess"){let X=G.transform(_.data,W);if(_.common.async)return Promise.resolve(X).then(async(J)=>{if(q.value==="aborted")return S;let M=await this._def.schema._parseAsync({data:J,path:_.path,parent:_});if(M.status==="aborted")return S;if(M.status==="dirty")return Z(M.value);if(q.value==="dirty")return Z(M.value);return M});else{if(q.value==="aborted")return S;let J=this._def.schema._parseSync({data:X,path:_.path,parent:_});if(J.status==="aborted")return S;if(J.status==="dirty")return Z(J.value);if(q.value==="dirty")return Z(J.value);return J}}if(G.type==="refinement"){let X=(J)=>{let M=G.refinement(J,W);if(_.common.async)return Promise.resolve(M);if(M instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return J};if(_.common.async===!1){let J=this._def.schema._parseSync({data:_.data,path:_.path,parent:_});if(J.status==="aborted")return S;if(J.status==="dirty")q.dirty();return X(J.value),{status:q.value,value:J.value}}else return this._def.schema._parseAsync({data:_.data,path:_.path,parent:_}).then((J)=>{if(J.status==="aborted")return S;if(J.status==="dirty")q.dirty();return X(J.value).then(()=>{return{status:q.value,value:J.value}})})}if(G.type==="transform")if(_.common.async===!1){let X=this._def.schema._parseSync({data:_.data,path:_.path,parent:_});if(!T(X))return S;let J=G.transform(X.value,W);if(J instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:q.value,value:J}}else return this._def.schema._parseAsync({data:_.data,path:_.path,parent:_}).then((X)=>{if(!T(X))return S;return Promise.resolve(G.transform(X.value,W)).then((J)=>({status:q.value,value:J}))});V.assertNever(G)}}C.create=($,q,_)=>{return new C({schema:$,typeName:b.ZodEffects,effect:q,...O(_)})};C.createWithPreprocess=($,q,_)=>{return new C({schema:q,effect:{type:"preprocess",transform:$},typeName:b.ZodEffects,...O(_)})};class F extends E{_parse($){if(this._getType($)===Y.undefined)return U(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}F.create=($,q)=>{return new F({innerType:$,typeName:b.ZodOptional,...O(q)})};class h extends E{_parse($){if(this._getType($)===Y.null)return U(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}h.create=($,q)=>{return new h({innerType:$,typeName:b.ZodNullable,...O(q)})};class G$ extends E{_parse($){let{ctx:q}=this._processInputParams($),_=q.data;if(q.parsedType===Y.undefined)_=this._def.defaultValue();return this._def.innerType._parse({data:_,path:q.path,parent:q})}removeDefault(){return this._def.innerType}}G$.create=($,q)=>{return new G$({innerType:$,typeName:b.ZodDefault,defaultValue:typeof q.default==="function"?q.default:()=>q.default,...O(q)})};class H$ extends E{_parse($){let{ctx:q}=this._processInputParams($),_={...q,common:{...q.common,issues:[]}},G=this._def.innerType._parse({data:_.data,path:_.path,parent:{..._}});if(o(G))return G.then((W)=>{return{status:"valid",value:W.status==="valid"?W.value:this._def.catchValue({get error(){return new v(_.common.issues)},input:_.data})}});else return{status:"valid",value:G.status==="valid"?G.value:this._def.catchValue({get error(){return new v(_.common.issues)},input:_.data})}}removeCatch(){return this._def.innerType}}H$.create=($,q)=>{return new H$({innerType:$,typeName:b.ZodCatch,catchValue:typeof q.catch==="function"?q.catch:()=>q.catch,...O(q)})};class w$ extends E{_parse($){if(this._getType($)!==Y.nan){let _=this._getOrReturnCtx($);return w(_,{code:Q.invalid_type,expected:Y.nan,received:_.parsedType}),S}return{status:"valid",value:$.data}}}w$.create=($)=>{return new w$({typeName:b.ZodNaN,...O($)})};var Fq=Symbol("zod_brand");class R$ extends E{_parse($){let{ctx:q}=this._processInputParams($),_=q.data;return this._def.type._parse({data:_,path:q.path,parent:q})}unwrap(){return this._def.type}}class j$ extends E{_parse($){let{status:q,ctx:_}=this._processInputParams($);if(_.common.async)return(async()=>{let W=await this._def.in._parseAsync({data:_.data,path:_.path,parent:_});if(W.status==="aborted")return S;if(W.status==="dirty")return q.dirty(),Z(W.value);else return this._def.out._parseAsync({data:W.value,path:_.path,parent:_})})();else{let G=this._def.in._parseSync({data:_.data,path:_.path,parent:_});if(G.status==="aborted")return S;if(G.status==="dirty")return q.dirty(),{status:"dirty",value:G.value};else return this._def.out._parseSync({data:G.value,path:_.path,parent:_})}}static create($,q){return new j$({in:$,out:q,typeName:b.ZodPipeline})}}class J$ extends E{_parse($){let q=this._def.innerType._parse($),_=(G)=>{if(T(G))G.value=Object.freeze(G.value);return G};return o(q)?q.then((G)=>_(G)):_(q)}unwrap(){return this._def.innerType}}J$.create=($,q)=>{return new J$({innerType:$,typeName:b.ZodReadonly,...O(q)})};function N$($,q){let _=typeof $==="function"?$(q):typeof $==="string"?{message:$}:$;return typeof _==="string"?{message:_}:_}function k$($,q={},_){if($)return c.create().superRefine((G,W)=>{let X=$(G);if(X instanceof Promise)return X.then((J)=>{if(!J){let M=N$(q,G),B=M.fatal??_??!0;W.addIssue({code:"custom",...M,fatal:B})}});if(!X){let J=N$(q,G),M=J.fatal??_??!0;W.addIssue({code:"custom",...J,fatal:M})}return});return c.create()}var Kq={object:f.lazycreate},b;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(b||(b={}));var Cq=($,q={message:`Input not instance of ${$.name}`})=>k$((_)=>_ instanceof $,q),z$=N.create,g$=m.create,kq=w$.create,zq=x.create,I$=a.create,gq=n.create,Iq=Q$.create,Pq=t.create,hq=s.create,Tq=c.create,lq=l.create,mq=z.create,xq=Y$.create,yq=D.create,Zq=f.create,nq=f.strictCreate,cq=e.create,uq=O$.create,pq=$$.create,iq=g.create,oq=M$.create,rq=B$.create,dq=u.create,aq=d.create,tq=q$.create,sq=_$.create,eq=y.create,$_=W$.create,q_=p.create,__=C.create,W_=F.create,G_=h.create,H_=C.createWithPreprocess,J_=j$.create,X_=()=>z$().optional(),Q_=()=>g$().optional(),Y_=()=>I$().optional(),M_={string:($)=>N.create({...$,coerce:!0}),number:($)=>m.create({...$,coerce:!0}),boolean:($)=>a.create({...$,coerce:!0}),bigint:($)=>x.create({...$,coerce:!0}),date:($)=>n.create({...$,coerce:!0})};var B_=S;var P$=H.enum(["string","string[]","int32","int32[]","int64","int64[]","float","float[]","bool","bool[]","geopoint","geopoint[]","geopolygon","object","object[]","auto","string*","image"]),h$=H.object({name:H.string(),type:P$,optional:H.boolean().optional(),facet:H.boolean().optional(),index:H.boolean().optional(),sort:H.boolean().optional(),infix:H.boolean().optional(),locale:H.string().optional(),stem:H.boolean().optional(),store:H.boolean().optional(),num_dim:H.number().optional(),vec_dist:H.enum(["cosine","ip"]).optional(),reference:H.string().optional(),range_index:H.boolean().optional(),stem_dictionary:H.string().optional(),truncate_len:H.number().optional(),token_separators:H.array(H.string()).optional(),symbols_to_index:H.array(H.string()).optional(),embed:H.object({from:H.array(H.string()),model_config:H.object({model_name:H.string(),api_key:H.string().optional(),indexing_prefix:H.string().optional(),query_prefix:H.string().optional(),project_id:H.string().optional(),service_account:H.object({client_email:H.string(),private_key:H.string()}).optional(),access_token:H.string().optional(),refresh_token:H.string().optional(),client_id:H.string().optional(),client_secret:H.string().optional()})}).optional()}),T$=H.object({name:H.string(),fields:H.array(h$),default_sorting_field:H.string().optional(),token_separators:H.array(H.string()).optional(),symbols_to_index:H.array(H.string()).optional(),enable_nested_fields:H.boolean().optional(),synonym_sets:H.array(H.string()).optional(),curation_sets:H.array(H.string()).optional(),metadata:H.record(H.unknown()).optional()}),l$=H.object({name:H.string(),collection:H.string()}),m$=H.object({id:H.string(),collection:H.string(),synonyms:H.array(H.string()).optional(),root:H.string().optional(),symbols_to_index:H.array(H.string()).optional(),locale:H.string().optional()}),x$=H.object({id:H.string(),synonyms:H.array(H.string()).optional(),root:H.string().optional(),symbols_to_index:H.array(H.string()).optional(),locale:H.string().optional()}),y$=H.object({name:H.string(),items:H.array(x$)}),w_=H.object({query:H.string().optional(),match:H.enum(["exact","contains"]).optional(),filter_by:H.string().optional(),tags:H.array(H.string()).optional()}),Z$=H.object({id:H.string(),collection:H.string(),rule:w_,includes:H.array(H.object({id:H.string(),position:H.number()})).optional(),excludes:H.array(H.object({id:H.string()})).optional(),filter_by:H.string().optional(),sort_by:H.string().optional(),replace_query:H.string().optional(),remove_matched_tokens:H.boolean().optional(),filter_curated_hits:H.boolean().optional(),effective_from_ts:H.number().optional(),effective_to_ts:H.number().optional(),stop_processing:H.boolean().optional()}),j_=H.object({destination_collection:H.string().optional(),source:H.object({collections:H.array(H.string()).optional(),events:H.array(H.object({type:H.string(),name:H.string(),weight:H.number().optional()})).optional()}).optional(),destination:H.object({collection:H.string()}).optional(),limit:H.number().optional(),capture_search_requests:H.boolean().optional(),meta_fields:H.array(H.string()).optional(),expand_query:H.boolean().optional(),counter_field:H.string().optional(),weight:H.number().optional()}),n$=H.object({name:H.string(),type:H.enum(["popular_queries","nohits_queries","counter","log"]),collection:H.string(),event_type:H.enum(["search","click","conversion","visit","custom"]),rule_tag:H.string().optional(),params:j_.optional()}),c$=H.object({description:H.string(),actions:H.array(H.string()),collections:H.array(H.string()),value:H.string().optional(),expires_at:H.number().optional(),autodelete:H.boolean().optional()}),u$=H.object({id:H.string(),stopwords:H.array(H.string()),locale:H.string().optional()}),p$=H.object({name:H.string(),value:H.record(H.unknown())}),i$=H.object({query:H.string().optional(),match:H.enum(["exact","contains"]).optional(),filter_by:H.string().optional(),tags:H.array(H.string()).optional()}),o$=H.object({id:H.string(),rule:i$.optional(),includes:H.array(H.object({id:H.string(),position:H.number()})).optional(),excludes:H.array(H.object({id:H.string()})).optional(),filter_by:H.string().optional(),sort_by:H.string().optional(),replace_query:H.string().optional(),remove_matched_tokens:H.boolean().optional(),filter_curated_hits:H.boolean().optional(),stop_processing:H.boolean().optional(),metadata:H.record(H.unknown()).optional(),effective_from_ts:H.number().optional(),effective_to_ts:H.number().optional(),diversity:H.object({similarity_metric:H.array(H.object({field:H.string(),method:H.enum(["jaccard","equality","vector_distance"]),weight:H.number().optional()}))}).optional()}),r$=H.object({name:H.string(),items:H.array(o$)}),d$=H.object({word:H.string(),root:H.string()}),a$=H.object({id:H.string(),words:H.array(d$)}),t$=H.object({collections:H.array(T$).optional(),aliases:H.array(l$).optional(),synonyms:H.array(m$).optional(),synonymSets:H.array(y$).optional(),overrides:H.array(Z$).optional(),curationSets:H.array(r$).optional(),analyticsRules:H.array(n$).optional(),apiKeys:H.array(c$).optional(),stopwords:H.array(u$).optional(),presets:H.array(p$).optional(),stemmingDictionaries:H.array(a$).optional()}),S_=H.object({nodes:H.array(H.object({host:H.string(),port:H.number(),protocol:H.enum(["http","https"])})),apiKey:H.string(),connectionTimeoutSeconds:H.number().optional(),retryIntervalSeconds:H.number().optional(),numRetries:H.number().optional()});function b_($){return t$.parse($)}export{b_ as defineConfig,t$ as TypesenseConfigSchema,x$ as SynonymSetItemSchema,y$ as SynonymSetConfigSchema,m$ as SynonymConfigSchema,u$ as StopwordSetConfigSchema,d$ as StemmingWordSchema,a$ as StemmingDictionaryConfigSchema,p$ as PresetConfigSchema,Z$ as OverrideConfigSchema,P$ as FieldTypeSchema,h$ as FieldSchema,r$ as CurationSetConfigSchema,i$ as CurationRuleSchema,o$ as CurationItemSchema,S_ as ConnectionConfigSchema,T$ as CollectionConfigSchema,c$ as ApiKeyConfigSchema,n$ as AnalyticsRuleConfigSchema,l$ as AliasConfigSchema};
package/package.json CHANGED
@@ -1,32 +1,37 @@
1
1
  {
2
2
  "name": "@tsctl/cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Terraform-like CLI for managing Typesense collections, aliases, synonyms, and curations",
5
5
  "type": "module",
6
- "main": "./src/index.ts",
6
+ "main": "./dist/index.mjs",
7
7
  "types": "./src/index.ts",
8
8
  "exports": {
9
9
  ".": {
10
- "import": "./src/index.ts",
10
+ "import": "./dist/index.mjs",
11
+ "bun": "./src/index.ts",
11
12
  "types": "./src/index.ts"
12
13
  }
13
14
  },
14
15
  "bin": {
15
- "tsctl": "bin/tsctl.js"
16
+ "tsctl": "bin/tsctl-node.js"
16
17
  },
17
18
  "files": [
18
19
  "bin/tsctl.js",
20
+ "bin/tsctl-node.js",
21
+ "dist",
19
22
  "src",
20
23
  "README.md"
21
24
  ],
22
25
  "scripts": {
23
26
  "build": "bun build src/cli/index.ts --compile --outfile bin/tsctl",
27
+ "build:npm": "bun build src/cli/index.ts --outfile dist/cli.mjs --target node --minify && bun build src/index.ts --outfile dist/index.mjs --target node --minify",
24
28
  "build:all": "bun run build:linux && bun run build:macos && bun run build:windows",
25
29
  "build:linux": "bun build src/cli/index.ts --compile --target=bun-linux-x64 --outfile bin/tsctl-linux-x64",
26
30
  "build:macos": "bun build src/cli/index.ts --compile --target=bun-darwin-arm64 --outfile bin/tsctl-darwin-arm64",
27
31
  "build:windows": "bun build src/cli/index.ts --compile --target=bun-windows-x64 --outfile bin/tsctl-windows-x64.exe",
28
32
  "dev": "bun run src/cli/index.ts",
29
33
  "start": "bun run src/cli/index.ts",
34
+ "prepublishOnly": "bun run build:npm",
30
35
  "typecheck": "bun x tsc --noEmit",
31
36
  "test": "bun test"
32
37
  },