turbo-ignore 2.5.6 → 2.5.7

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.
Files changed (2) hide show
  1. package/dist/cli.js +1 -1
  2. package/package.json +4 -4
package/dist/cli.js CHANGED
@@ -84,7 +84,7 @@ Please report this to https://github.com/szmarczak/http2-wrapper/`);m(E)}return}
84
84
  `+t.slice(i,s),i=s+1),o=a;return c+=`
85
85
  `,t.length-i>e&&o>i?c+=t.slice(i,o)+`
86
86
  `+t.slice(o+1):c+=t.slice(i),c.slice(1)}function EM(t){for(var e="",r=0,n,i=0;i<t.length;r>=65536?i+=2:i++)r=Po(t,i),n=it[r],!n&&Do(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||hM(r);return e}function wM(t,e,r){var n="",i=t.tag,s,o,a;for(s=0,o=r.length;s<o;s+=1)a=r[s],t.replacer&&(a=t.replacer.call(r,String(s),a)),(Hr(t,e,a,!1,!1)||typeof a>"u"&&Hr(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}function Db(t,e,r,n){var i="",s=t.tag,o,a,c;for(o=0,a=r.length;o<a;o+=1)c=r[o],t.replacer&&(c=t.replacer.call(r,String(o),c)),(Hr(t,e+1,c,!0,!0,!1,!0)||typeof c>"u"&&Hr(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=ph(t,e)),t.dump&&Lo===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=s,t.dump=i||"[]"}function xM(t,e,r){var n="",i=t.tag,s=Object.keys(r),o,a,c,u,f;for(o=0,a=s.length;o<a;o+=1)f="",n!==""&&(f+=", "),t.condenseFlow&&(f+='"'),c=s[o],u=r[c],t.replacer&&(u=t.replacer.call(r,c,u)),Hr(t,e,c,!1,!1)&&(t.dump.length>1024&&(f+="? "),f+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Hr(t,e,u,!1,!1)&&(f+=t.dump,n+=f));t.tag=i,t.dump="{"+n+"}"}function SM(t,e,r,n){var i="",s=t.tag,o=Object.keys(r),a,c,u,f,h,d;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new Et("sortKeys must be a boolean or a function");for(a=0,c=o.length;a<c;a+=1)d="",(!n||i!=="")&&(d+=ph(t,e)),u=o[a],f=r[u],t.replacer&&(f=t.replacer.call(r,u,f)),Hr(t,e+1,u,!0,!0,!0)&&(h=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,h&&(t.dump&&Lo===t.dump.charCodeAt(0)?d+="?":d+="? "),d+=t.dump,h&&(d+=ph(t,e)),Hr(t,e+1,f,!0,h)&&(t.dump&&Lo===t.dump.charCodeAt(0)?d+=":":d+=": ",d+=t.dump,i+=d));t.tag=s,t.dump=i||"{}"}function Mb(t,e,r){var n,i,s,o,a,c;for(i=r?t.explicitTypes:t.implicitTypes,s=0,o=i.length;s<o;s+=1)if(a=i[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(r?a.multi&&a.representName?t.tag=a.representName(e):t.tag=a.tag:t.tag="?",a.represent){if(c=t.styleMap[a.tag]||a.defaultStyle,Jb.call(a.represent)==="[object Function]")n=a.represent(e,c);else if(Xb.call(a.represent,c))n=a.represent[c](e,c);else throw new Et("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');t.dump=n}return!0}return!1}function Hr(t,e,r,n,i,s,o){t.tag=null,t.dump=r,Mb(t,r,!1)||Mb(t,r,!0);var a=Jb.call(t.dump),c=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var f=a==="[object Object]"||a==="[object Array]",h,d;if(f&&(h=t.duplicates.indexOf(r),d=h!==-1),(t.tag!==null&&t.tag!=="?"||d||t.indent!==2&&e>0)&&(i=!1),d&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(f&&d&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),a==="[object Object]")n&&Object.keys(t.dump).length!==0?(SM(t,e,t.dump,i),d&&(t.dump="&ref_"+h+t.dump)):(xM(t,e,t.dump),d&&(t.dump="&ref_"+h+" "+t.dump));else if(a==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?Db(t,e-1,t.dump,i):Db(t,e,t.dump,i),d&&(t.dump="&ref_"+h+t.dump)):(wM(t,e,t.dump),d&&(t.dump="&ref_"+h+" "+t.dump));else if(a==="[object String]")t.tag!=="?"&&vM(t,t.dump,e,s,c);else{if(a==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Et("unacceptable kind of an object to dump "+a)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}function AM(t,e){var r=[],n=[],i,s;for(gh(t,r,n),i=0,s=n.length;i<s;i+=1)e.duplicates.push(r[n[i]]);e.usedDuplicates=new Array(s)}function gh(t,e,r){var n,i,s;if(t!==null&&typeof t=="object")if(i=e.indexOf(t),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(e.push(t),Array.isArray(t))for(i=0,s=t.length;i<s;i+=1)gh(t[i],e,r);else for(n=Object.keys(t),i=0,s=n.length;i<s;i+=1)gh(t[n[i]],e,r)}function RM(t,e){e=e||{};var r=new pM(e);r.noRefs||AM(t,r);var n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Hr(r,0,n,!0,!0)?r.dump+`
87
- `:""}var CM=RM,OM={dump:CM};function Eh(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var Uz=Zb.load,Gz=Zb.loadAll,Vz=OM.dump;var Wz=Eh("safeLoad","load"),zz=Eh("safeLoadAll","loadAll"),Yz=Eh("safeDump","dump");var RH=le(Yx()),CH=le(require("json5"));var Se={};_I(Se,{bold:()=>_H,dimmed:()=>bH,error:()=>$p,grey:()=>EH,info:()=>yH,item:()=>wH,log:()=>An,turboBlue:()=>ps,turboGradient:()=>gH,turboLoader:()=>mA,turboRed:()=>dA,underline:()=>vH,warn:()=>gA,yellow:()=>pA});l();var St=le(Bc()),uA=le(DS()),lA=le(cA()),fA="#0099F7",hA="#F11712",mH="#FFFF00",Hp=t=>{let e=xH(t);return r=>`\x1B[38;5;${e}m${r}${(0,St.reset)("")}`},gH=(0,lA.default)(fA,hA),ps=Hp(fA),dA=Hp(hA),pA=Hp(mH),mA=t=>(0,uA.default)({text:t,spinner:{frames:[" ",ps("> "),ps(">> "),ps(">>>")]}}),yH=(...t)=>{An(ps((0,St.bold)(">>>")),t.join(" "))},_H=(...t)=>{An((0,St.bold)(t.join(" ")))},vH=(...t)=>{An((0,St.underline)(t.join(" ")))},bH=(...t)=>{An((0,St.dim)(t.join(" ")))},EH=(...t)=>{An((0,St.gray)(t.join(" ")))},wH=(...t)=>{An(ps((0,St.bold)(" \u2022")),t.join(" "))},An=(...t)=>{console.log(...t)},gA=(...t)=>{console.error(pA((0,St.bold)(">>>")),t.join(" "))},$p=(...t)=>{console.error(dA((0,St.bold)(">>>")),t.join(" "))};function xH(t){let e=parseInt(t.slice(1),16),r=Math.floor(e/(256*256))%256,n=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)}l();var b6=le(require("os")),E6=le(UR());l();l();var w6=le(require("path"));l();var hP=require("stream"),dP=require("util"),oV=require("path"),aV=require("os"),pP=require("fs"),cV=le(HT());var GX=(0,dP.promisify)(hP.Stream.pipeline);l();l();var _V=le(require("path")),vV=le(EP());l();l();var $P=le(Bc());l();var me;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let s={};for(let o of i)s[o]=o;return s},t.getValidEnumValues=i=>{let s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(let o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(me||(me={}));var Qy;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Qy||(Qy={}));var U=me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Un=t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}},N=me.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"]),bV=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Bt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,c=0;for(;c<o.path.length;){let u=o.path[c];c===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(o))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Bt.create=t=>new Bt(t);var ka=(t,e)=>{let r;switch(t.code){case N.invalid_type:t.received===U.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,me.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${me.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${me.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${me.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:me.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case N.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case N.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=e.defaultError,me.assertNever(t)}return{message:r}},SP=ka;function EV(t){SP=t}function rf(){return SP}var nf=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],o={...i,path:s},a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},wV=[];function G(t,e){let r=nf({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,rf(),ka].filter(n=>!!n)});t.common.issues.push(r)}var Xe=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return oe;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r)n.push({key:await i.key,value:await i.value});return Xe.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return oe;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}},oe=Object.freeze({status:"aborted"}),AP=t=>({status:"dirty",value:t}),_t=t=>({status:"valid",value:t}),e0=t=>t.status==="aborted",t0=t=>t.status==="dirty",Pa=t=>t.status==="valid",sf=t=>typeof Promise<"u"&&t instanceof Promise,X;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(X||(X={}));var ir=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},wP=(t,e)=>{if(Pa(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Bt(t.common.issues);return this._error=r,this._error}}};function ae(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:n!=null?n:a.defaultError}:{message:r!=null?r:a.defaultError},description:i}}var ce=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Un(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Un(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Xe,ctx:{common:e.parent.common,data:e.data,parsedType:Un(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(sf(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Un(e)},s=this._parseSync({data:e,path:i.path,parent:i});return wP(i,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Un(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(sf(i)?i:Promise.resolve(i));return wP(n,s)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let o=e(i),a=()=>s.addIssue({code:N.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Ht({schema:this,typeName:te.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return pr.create(this,this._def)}nullable(){return fn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jt.create(this,this._def)}promise(){return Wn.create(this,this._def)}or(e){return Ri.create([this,e],this._def)}and(e){return Ci.create(this,e,this._def)}transform(e){return new Ht({...ae(this._def),schema:this,typeName:te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ii({...ae(this._def),innerType:this,defaultValue:r,typeName:te.ZodDefault})}brand(){return new of({typeName:te.ZodBranded,type:this,...ae(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new so({...ae(this._def),innerType:this,catchValue:r,typeName:te.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Li.create(this,e)}readonly(){return ao.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},xV=/^c[^\s-]{8,}$/i,SV=/^[a-z][a-z0-9]*$/,AV=/^[0-9A-HJKMNP-TV-Z]{26}$/,RV=/^[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,CV=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,OV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Xy,TV=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,kV=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,PV=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function IV(t,e){return!!((e==="v4"||!e)&&TV.test(t)||(e==="v6"||!e)&&kV.test(t))}var qt=class extends ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.string,received:s.parsedType}),oe}let n=new Xe,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?G(i,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&G(i,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")CV.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"email",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Xy||(Xy=new RegExp(OV,"u")),Xy.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"emoji",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")RV.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"uuid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")xV.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"cuid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")SV.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"cuid2",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")AV.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"ulid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),G(i,{validation:"url",code:N.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"regex",code:N.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?PV(s).test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?IV(e.data,s.version)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"ip",code:N.invalid_string,message:s.message}),n.dirty()):me.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:N.invalid_string,...X.errToObj(n)})}_addCheck(e){return new qt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...X.errToObj(e)})}url(e){return this._addCheck({kind:"url",...X.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...X.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...X.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...X.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...X.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...X.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...X.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...X.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...X.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...X.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...X.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...X.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...X.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...X.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...X.errToObj(r)})}nonempty(e){return this.min(1,X.errToObj(e))}trim(){return new qt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new qt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new qt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}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 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 minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};qt.create=t=>{var e;return new qt({checks:[],typeName:te.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ae(t)})};function LV(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}var Ir=class extends ce{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)!==U.number){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.number,received:s.parsedType}),oe}let n,i=new Xe;for(let s of this._def.checks)s.kind==="int"?me.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:N.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?LV(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:N.not_finite,message:s.message}),i.dirty()):me.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,X.toString(r))}gt(e,r){return this.setLimit("min",e,!1,X.toString(r))}lte(e,r){return this.setLimit("max",e,!0,X.toString(r))}lt(e,r){return this.setLimit("max",e,!1,X.toString(r))}setLimit(e,r,n,i){return new Ir({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:X.toString(i)}]})}_addCheck(e){return new Ir({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:X.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:X.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:X.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:X.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:X.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:X.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:X.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&me.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Ir.create=t=>new Ir({checks:[],typeName:te.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...ae(t)});var Lr=class extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==U.bigint){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.bigint,received:s.parsedType}),oe}let n,i=new Xe;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):me.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,X.toString(r))}gt(e,r){return this.setLimit("min",e,!1,X.toString(r))}lte(e,r){return this.setLimit("max",e,!0,X.toString(r))}lt(e,r){return this.setLimit("max",e,!1,X.toString(r))}setLimit(e,r,n,i){return new Lr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:X.toString(i)}]})}_addCheck(e){return new Lr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:X.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:X.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:X.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Lr.create=t=>{var e;return new Lr({checks:[],typeName:te.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ae(t)})};var xi=class extends ce{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==U.boolean){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.boolean,received:n.parsedType}),oe}return _t(e.data)}};xi.create=t=>new xi({typeName:te.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...ae(t)});var un=class extends ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.date,received:s.parsedType}),oe}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_date}),oe}let n=new Xe,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):me.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new un({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:X.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:X.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};un.create=t=>new un({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:te.ZodDate,...ae(t)});var to=class extends ce{_parse(e){if(this._getType(e)!==U.symbol){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.symbol,received:n.parsedType}),oe}return _t(e.data)}};to.create=t=>new to({typeName:te.ZodSymbol,...ae(t)});var Si=class extends ce{_parse(e){if(this._getType(e)!==U.undefined){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.undefined,received:n.parsedType}),oe}return _t(e.data)}};Si.create=t=>new Si({typeName:te.ZodUndefined,...ae(t)});var Ai=class extends ce{_parse(e){if(this._getType(e)!==U.null){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.null,received:n.parsedType}),oe}return _t(e.data)}};Ai.create=t=>new Ai({typeName:te.ZodNull,...ae(t)});var Vn=class extends ce{constructor(){super(...arguments),this._any=!0}_parse(e){return _t(e.data)}};Vn.create=t=>new Vn({typeName:te.ZodAny,...ae(t)});var cn=class extends ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _t(e.data)}};cn.create=t=>new cn({typeName:te.ZodUnknown,...ae(t)});var mr=class extends ce{_parse(e){let r=this._getOrReturnCtx(e);return G(r,{code:N.invalid_type,expected:U.never,received:r.parsedType}),oe}};mr.create=t=>new mr({typeName:te.ZodNever,...ae(t)});var ro=class extends ce{_parse(e){if(this._getType(e)!==U.undefined){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.void,received:n.parsedType}),oe}return _t(e.data)}};ro.create=t=>new ro({typeName:te.ZodVoid,...ae(t)});var jt=class extends ce{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==U.array)return G(r,{code:N.invalid_type,expected:U.array,received:r.parsedType}),oe;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(o||a)&&(G(r,{code:o?N.too_big:N.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(G(r,{code:N.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(G(r,{code:N.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>i.type._parseAsync(new ir(r,o,r.path,a)))).then(o=>Xe.mergeArray(n,o));let s=[...r.data].map((o,a)=>i.type._parseSync(new ir(r,o,r.path,a)));return Xe.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new jt({...this._def,minLength:{value:e,message:X.toString(r)}})}max(e,r){return new jt({...this._def,maxLength:{value:e,message:X.toString(r)}})}length(e,r){return new jt({...this._def,exactLength:{value:e,message:X.toString(r)}})}nonempty(e){return this.min(1,e)}};jt.create=(t,e)=>new jt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:te.ZodArray,...ae(e)});function eo(t){if(t instanceof Oe){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=pr.create(eo(n))}return new Oe({...t._def,shape:()=>e})}else return t instanceof jt?new jt({...t._def,type:eo(t.element)}):t instanceof pr?pr.create(eo(t.unwrap())):t instanceof fn?fn.create(eo(t.unwrap())):t instanceof sr?sr.create(t.items.map(e=>eo(e))):t}var Oe=class extends ce{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(),r=me.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==U.object){let u=this._getOrReturnCtx(e);return G(u,{code:N.invalid_type,expected:U.object,received:u.parsedType}),oe}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof mr&&this._def.unknownKeys==="strip"))for(let u in i.data)o.includes(u)||a.push(u);let c=[];for(let u of o){let f=s[u],h=i.data[u];c.push({key:{status:"valid",value:u},value:f._parse(new ir(i,h,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof mr){let u=this._def.unknownKeys;if(u==="passthrough")for(let f of a)c.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")a.length>0&&(G(i,{code:N.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let f of a){let h=i.data[f];c.push({key:{status:"valid",value:f},value:u._parse(new ir(i,h,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let f of c){let h=await f.key;u.push({key:h,value:await f.value,alwaysSet:f.alwaysSet})}return u}).then(u=>Xe.mergeObjectSync(n,u)):Xe.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return X.errToObj,new Oe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,s,o,a;let c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=X.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new Oe({...this._def,unknownKeys:"strip"})}passthrough(){return new Oe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Oe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Oe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:te.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Oe({...this._def,catchall:e})}pick(e){let r={};return me.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Oe({...this._def,shape:()=>r})}omit(e){let r={};return me.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new Oe({...this._def,shape:()=>r})}deepPartial(){return eo(this)}partial(e){let r={};return me.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new Oe({...this._def,shape:()=>r})}required(e){let r={};return me.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof pr;)s=s._def.innerType;r[n]=s}}),new Oe({...this._def,shape:()=>r})}keyof(){return RP(me.objectKeys(this.shape))}};Oe.create=(t,e)=>new Oe({shape:()=>t,unknownKeys:"strip",catchall:mr.create(),typeName:te.ZodObject,...ae(e)});Oe.strictCreate=(t,e)=>new Oe({shape:()=>t,unknownKeys:"strict",catchall:mr.create(),typeName:te.ZodObject,...ae(e)});Oe.lazycreate=(t,e)=>new Oe({shape:t,unknownKeys:"strip",catchall:mr.create(),typeName:te.ZodObject,...ae(e)});var Ri=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(a=>new Bt(a.ctx.common.issues));return G(r,{code:N.invalid_union,unionErrors:o}),oe}if(r.common.async)return Promise.all(n.map(async s=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},f=c._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(c=>new Bt(c));return G(r,{code:N.invalid_union,unionErrors:a}),oe}}get options(){return this._def.options}};Ri.create=(t,e)=>new Ri({options:t,typeName:te.ZodUnion,...ae(e)});var tf=t=>t instanceof Ti?tf(t.schema):t instanceof Ht?tf(t.innerType()):t instanceof ki?[t.value]:t instanceof Nr?t.options:t instanceof Pi?Object.keys(t.enum):t instanceof Ii?tf(t._def.innerType):t instanceof Si?[void 0]:t instanceof Ai?[null]:null,no=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.object)return G(r,{code:N.invalid_type,expected:U.object,received:r.parsedType}),oe;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(G(r,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let s of r){let o=tf(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new no({typeName:te.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...ae(n)})}};function r0(t,e){let r=Un(t),n=Un(e);if(t===e)return{valid:!0,data:t};if(r===U.object&&n===U.object){let i=me.objectKeys(e),s=me.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(let a of s){let c=r0(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(r===U.array&&n===U.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<t.length;s++){let o=t[s],a=e[s],c=r0(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===U.date&&n===U.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ci=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,o)=>{if(e0(s)||e0(o))return oe;let a=r0(s.value,o.value);return a.valid?((t0(s)||t0(o))&&r.dirty(),{status:r.value,value:a.data}):(G(n,{code:N.invalid_intersection_types}),oe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ci.create=(t,e,r)=>new Ci({left:t,right:e,typeName:te.ZodIntersection,...ae(r)});var sr=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.array)return G(n,{code:N.invalid_type,expected:U.array,received:n.parsedType}),oe;if(n.data.length<this._def.items.length)return G(n,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),oe;!this._def.rest&&n.data.length>this._def.items.length&&(G(n,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((o,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new ir(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>Xe.mergeArray(r,o)):Xe.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new sr({...this._def,rest:e})}};sr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new sr({items:t,typeName:te.ZodTuple,rest:null,...ae(e)})};var Oi=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.object)return G(n,{code:N.invalid_type,expected:U.object,received:n.parsedType}),oe;let i=[],s=this._def.keyType,o=this._def.valueType;for(let a in n.data)i.push({key:s._parse(new ir(n,a,n.path,a)),value:o._parse(new ir(n,n.data[a],n.path,a))});return n.common.async?Xe.mergeObjectAsync(r,i):Xe.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ce?new Oi({keyType:e,valueType:r,typeName:te.ZodRecord,...ae(n)}):new Oi({keyType:qt.create(),valueType:e,typeName:te.ZodRecord,...ae(r)})}},io=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.map)return G(n,{code:N.invalid_type,expected:U.map,received:n.parsedType}),oe;let i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,c],u)=>({key:i._parse(new ir(n,a,n.path,[u,"key"])),value:s._parse(new ir(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of o){let u=await c.key,f=await c.value;if(u.status==="aborted"||f.status==="aborted")return oe;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(u.value,f.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of o){let u=c.key,f=c.value;if(u.status==="aborted"||f.status==="aborted")return oe;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(u.value,f.value)}return{status:r.value,value:a}}}};io.create=(t,e,r)=>new io({valueType:e,keyType:t,typeName:te.ZodMap,...ae(r)});var ln=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.set)return G(n,{code:N.invalid_type,expected:U.set,received:n.parsedType}),oe;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(G(n,{code:N.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(G(n,{code:N.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function o(c){let u=new Set;for(let f of c){if(f.status==="aborted")return oe;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>s._parse(new ir(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,r){return new ln({...this._def,minSize:{value:e,message:X.toString(r)}})}max(e,r){return new ln({...this._def,maxSize:{value:e,message:X.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};ln.create=(t,e)=>new ln({valueType:t,minSize:null,maxSize:null,typeName:te.ZodSet,...ae(e)});var Gn=class extends ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.function)return G(r,{code:N.invalid_type,expected:U.function,received:r.parsedType}),oe;function n(a,c){return nf({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,rf(),ka].filter(u=>!!u),issueData:{code:N.invalid_arguments,argumentsError:c}})}function i(a,c){return nf({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,rf(),ka].filter(u=>!!u),issueData:{code:N.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Wn){let a=this;return _t(async function(...c){let u=new Bt([]),f=await a._def.args.parseAsync(c,s).catch(g=>{throw u.addIssue(n(c,g)),u}),h=await Reflect.apply(o,this,f);return await a._def.returns._def.type.parseAsync(h,s).catch(g=>{throw u.addIssue(i(h,g)),u})})}else{let a=this;return _t(function(...c){let u=a._def.args.safeParse(c,s);if(!u.success)throw new Bt([n(c,u.error)]);let f=Reflect.apply(o,this,u.data),h=a._def.returns.safeParse(f,s);if(!h.success)throw new Bt([i(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Gn({...this._def,args:sr.create(e).rest(cn.create())})}returns(e){return new Gn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Gn({args:e||sr.create([]).rest(cn.create()),returns:r||cn.create(),typeName:te.ZodFunction,...ae(n)})}},Ti=class extends ce{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ti.create=(t,e)=>new Ti({getter:t,typeName:te.ZodLazy,...ae(e)});var ki=class extends ce{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return G(r,{received:r.data,code:N.invalid_literal,expected:this._def.value}),oe}return{status:"valid",value:e.data}}get value(){return this._def.value}};ki.create=(t,e)=>new ki({value:t,typeName:te.ZodLiteral,...ae(e)});function RP(t,e){return new Nr({values:t,typeName:te.ZodEnum,...ae(e)})}var Nr=class extends ce{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return G(r,{expected:me.joinValues(n),received:r.parsedType,code:N.invalid_type}),oe}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return G(r,{received:r.data,code:N.invalid_enum_value,options:n}),oe}return _t(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return Nr.create(e)}exclude(e){return Nr.create(this.options.filter(r=>!e.includes(r)))}};Nr.create=RP;var Pi=class extends ce{_parse(e){let r=me.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==U.string&&n.parsedType!==U.number){let i=me.objectValues(r);return G(n,{expected:me.joinValues(i),received:n.parsedType,code:N.invalid_type}),oe}if(r.indexOf(e.data)===-1){let i=me.objectValues(r);return G(n,{received:n.data,code:N.invalid_enum_value,options:i}),oe}return _t(e.data)}get enum(){return this._def.values}};Pi.create=(t,e)=>new Pi({values:t,typeName:te.ZodNativeEnum,...ae(e)});var Wn=class extends ce{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.promise&&r.common.async===!1)return G(r,{code:N.invalid_type,expected:U.promise,received:r.parsedType}),oe;let n=r.parsedType===U.promise?r.data:Promise.resolve(r.data);return _t(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Wn.create=(t,e)=>new Wn({type:t,typeName:te.ZodPromise,...ae(e)});var Ht=class extends ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{G(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){let o=a=>{let c=i.refinement(a,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?oe:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?oe:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Pa(o))return o;let a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Pa(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);me.assertNever(i)}};Ht.create=(t,e,r)=>new Ht({schema:t,typeName:te.ZodEffects,effect:e,...ae(r)});Ht.createWithPreprocess=(t,e,r)=>new Ht({schema:e,effect:{type:"preprocess",transform:t},typeName:te.ZodEffects,...ae(r)});var pr=class extends ce{_parse(e){return this._getType(e)===U.undefined?_t(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};pr.create=(t,e)=>new pr({innerType:t,typeName:te.ZodOptional,...ae(e)});var fn=class extends ce{_parse(e){return this._getType(e)===U.null?_t(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};fn.create=(t,e)=>new fn({innerType:t,typeName:te.ZodNullable,...ae(e)});var Ii=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===U.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ii.create=(t,e)=>new Ii({innerType:t,typeName:te.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ae(e)});var so=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return sf(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};so.create=(t,e)=>new so({innerType:t,typeName:te.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ae(e)});var oo=class extends ce{_parse(e){if(this._getType(e)!==U.nan){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.nan,received:n.parsedType}),oe}return{status:"valid",value:e.data}}};oo.create=t=>new oo({typeName:te.ZodNaN,...ae(t)});var NV=Symbol("zod_brand"),of=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Li=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?oe:s.status==="dirty"?(r.dirty(),AP(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?oe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new Li({in:e,out:r,typeName:te.ZodPipeline})}},ao=class extends ce{_parse(e){let r=this._def.innerType._parse(e);return Pa(r)&&(r.value=Object.freeze(r.value)),r}};ao.create=(t,e)=>new ao({innerType:t,typeName:te.ZodReadonly,...ae(e)});var CP=(t,e={},r)=>t?Vn.create().superRefine((n,i)=>{var s,o;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:c})}}):Vn.create(),DV={object:Oe.lazycreate},te;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(te||(te={}));var MV=(t,e={message:`Input not instance of ${t.name}`})=>CP(r=>r instanceof t,e),OP=qt.create,TP=Ir.create,FV=oo.create,qV=Lr.create,kP=xi.create,BV=un.create,jV=to.create,HV=Si.create,$V=Ai.create,UV=Vn.create,GV=cn.create,VV=mr.create,WV=ro.create,zV=jt.create,YV=Oe.create,KV=Oe.strictCreate,ZV=Ri.create,JV=no.create,XV=Ci.create,QV=sr.create,e7=Oi.create,t7=io.create,r7=ln.create,n7=Gn.create,i7=Ti.create,s7=ki.create,o7=Nr.create,a7=Pi.create,c7=Wn.create,xP=Ht.create,u7=pr.create,l7=fn.create,f7=Ht.createWithPreprocess,h7=Li.create,d7=()=>OP().optional(),p7=()=>TP().optional(),m7=()=>kP().optional(),g7={string:t=>qt.create({...t,coerce:!0}),number:t=>Ir.create({...t,coerce:!0}),boolean:t=>xi.create({...t,coerce:!0}),bigint:t=>Lr.create({...t,coerce:!0}),date:t=>un.create({...t,coerce:!0})},y7=oe,co=Object.freeze({__proto__:null,defaultErrorMap:ka,setErrorMap:EV,getErrorMap:rf,makeIssue:nf,EMPTY_PATH:wV,addIssueToContext:G,ParseStatus:Xe,INVALID:oe,DIRTY:AP,OK:_t,isAborted:e0,isDirty:t0,isValid:Pa,isAsync:sf,get util(){return me},get objectUtil(){return Qy},ZodParsedType:U,getParsedType:Un,ZodType:ce,ZodString:qt,ZodNumber:Ir,ZodBigInt:Lr,ZodBoolean:xi,ZodDate:un,ZodSymbol:to,ZodUndefined:Si,ZodNull:Ai,ZodAny:Vn,ZodUnknown:cn,ZodNever:mr,ZodVoid:ro,ZodArray:jt,ZodObject:Oe,ZodUnion:Ri,ZodDiscriminatedUnion:no,ZodIntersection:Ci,ZodTuple:sr,ZodRecord:Oi,ZodMap:io,ZodSet:ln,ZodFunction:Gn,ZodLazy:Ti,ZodLiteral:ki,ZodEnum:Nr,ZodNativeEnum:Pi,ZodPromise:Wn,ZodEffects:Ht,ZodTransformer:Ht,ZodOptional:pr,ZodNullable:fn,ZodDefault:Ii,ZodCatch:so,ZodNaN:oo,BRAND:NV,ZodBranded:of,ZodPipeline:Li,ZodReadonly:ao,custom:CP,Schema:ce,ZodSchema:ce,late:DV,get ZodFirstPartyTypeKind(){return te},coerce:g7,any:UV,array:zV,bigint:qV,boolean:kP,date:BV,discriminatedUnion:JV,effect:xP,enum:o7,function:n7,instanceof:MV,intersection:XV,lazy:i7,literal:s7,map:t7,nan:FV,nativeEnum:a7,never:VV,null:$V,nullable:l7,number:TP,object:YV,oboolean:m7,onumber:p7,optional:u7,ostring:d7,pipeline:h7,preprocess:f7,promise:c7,record:e7,set:r7,strictObject:KV,string:OP,symbol:jV,transformer:xP,tuple:QV,undefined:HV,union:ZV,unknown:GV,void:WV,NEVER:y7,ZodIssueCode:N,quotelessJson:bV,ZodError:Bt});l();var c0=le(require("os")),BP=le(require("crypto")),jP=le(require("path")),HP=le(qP());function C7(t){let e=process.version,r=c0.default.type(),n=c0.default.arch();return`${t.name} ${t.version} ${e} ${r} ${n}`}async function O7(){let t=process.env.TURBO_CONFIG_DIR_PATH?process.env.TURBO_CONFIG_DIR_PATH:await(0,HP.configDir)();if(!t)throw new Error("Could not find telemetry config directory");return jP.default.join(t,"turborepo","telemetry.json")}function T7({input:t,salt:e}){return BP.default.createHash("sha256").update(`${e}${t}`).digest("hex")}var uo={buildUserAgent:C7,oneWayHashWithSalt:T7,defaultConfigPath:O7};var k7="TURBO_TELEMETRY_DEBUG",P7="TURBO_TELEMETRY_DISABLED",I7="TURBO_TELEMETRY_MESSAGE_DISABLED",L7="DO_NOT_TRACK",N7=co.object({telemetry_enabled:co.boolean(),telemetry_id:co.string(),telemetry_salt:co.string(),telemetry_alerted:co.string().optional()}),Tt=class{constructor({configPath:e,config:r}){this.config=r,this.configPath=e}static fromConfigPath(e){try{let r=(0,lo.readFileSync)(e,"utf-8"),n=JSON.parse(r),i=Tt.validateConfig(n);return new Tt({configPath:e,config:i})}catch{return Tt.tryRemove({configPath:e})?Tt.create({configPath:e}):void 0}}static async fromDefaultConfig(){try{let e=await uo.defaultConfigPath();return Tt.fromConfigPath(e)}catch{return}}static validateConfig(e){try{return N7.parse(e)}catch{throw new Error("Config is invalid.")}}static create({configPath:e}){let r=(0,u0.randomUUID)(),n=(0,u0.randomUUID)(),i=uo.oneWayHashWithSalt({input:r,salt:n}),s=new Tt({configPath:e,config:{telemetry_enabled:!0,telemetry_id:i,telemetry_salt:n}});if(s.tryWrite())return s}tryWrite(){try{let e=JSON.stringify(this.config,null,2);return(0,lo.writeFileSync)(this.configPath,e),!0}catch{return!1}}static tryRemove({configPath:e}){try{return(0,lo.rmSync)(e,{force:!0}),!0}catch{return!1}}hasSeenAlert(){return this.config.telemetry_alerted!==void 0}isEnabled(){let e=process.env[L7]||"0",r=process.env[P7]||"0";return e==="1"||e.toLowerCase()==="true"||r==="1"||r.toLowerCase()==="true"?!1:this.config.telemetry_enabled}isTelemetryWarningEnabled(){let e=process.env[I7]||"0";return!(e==="1"||e.toLowerCase()==="true")}get id(){return this.config.telemetry_id}showAlert(){!this.hasSeenAlert()&&this.isEnabled()&&this.isTelemetryWarningEnabled()&&(Se.log(),Se.bold("Attention:"),Se.grey("Turborepo now collects completely anonymous telemetry regarding usage."),Se.grey("This information is used to shape the Turborepo roadmap and prioritize features."),Se.grey("You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:"),Se.underline($P.default.gray("https://turborepo.com/docs/telemetry"))),this.alertShown()}enable(){this.config.telemetry_enabled=!0,this.tryWrite()}disable(){this.config.telemetry_enabled=!1,this.tryWrite()}alertShown(){return this.hasSeenAlert()||(this.config.telemetry_alerted=new Date().toISOString(),this.tryWrite()),!0}oneWayHash(e){return uo.oneWayHashWithSalt({input:e,salt:this.config.telemetry_salt})}static isDebug(){let e=process.env[k7]||"0";return e==="1"||e.toLowerCase()==="true"}};l();l();var l0=require("crypto"),UP=le(fP());var D7=20,M7="/api/turborepo/v1/events",Ni=class{constructor({api:e,packageInfo:r,config:n,opts:i}){this.batchSize=D7;this.timeout=250;this.sessionId=(0,l0.randomUUID)();this.eventBatches=[];this.events=[];let s=new URL(M7,e);this.api=s.toString(),this.packageInfo=r,this.config=n,i!=null&&i.timeout&&(this.timeout=i.timeout),i!=null&&i.batchSize&&(this.batchSize=i.batchSize)}hasPendingEvents(){return this.events.length!==0}async waitForFlush(){await Promise.all(this.eventBatches)}flushEvents(){let e=this.events.splice(0,this.batchSize);this.config.isEnabled()&&this.eventBatches.push(UP.default.post(this.api,{timeout:this.timeout,json:e,headers:{"x-turbo-telemetry-id":this.config.id,"x-turbo-session-id":this.sessionId,"User-Agent":uo.buildUserAgent(this.packageInfo)}}))}track({key:e,value:r,parentId:n,isSensitive:i}){let s={id:(0,l0.randomUUID)(),key:e,value:i?this.config.oneWayHash(r):r,package_name:this.packageInfo.name,package_version:this.packageInfo.version,parent_id:n};return Tt.isDebug()&&(Se.log(),Se.bold("[telemetry event]"),Se.dimmed(JSON.stringify(s,null,2)),Se.log()),this.config.isEnabled()&&(this.events.push({package:s}),this.events.length>=this.batchSize&&this.flushEvents()),s}async close(){for(;this.hasPendingEvents();)this.flushEvents();try{await this.waitForFlush()}catch{}}trackCliOption({option:e,value:r}){return this.track({key:`option:${e}`,value:r})}trackCliArgument({argument:e,value:r}){return this.track({key:`argument:${e}`,value:r})}trackCliCommand({command:e,value:r}){return this.track({key:`command:${e}`,value:r})}trackCommandStatus({command:e,status:r}){return this.trackCliCommand({command:e,value:r})}trackCommandWarning(e){return this.track({key:"warning",value:e})}trackCommandError(e){return this.track({key:"error",value:e})}};var Ia=class extends Ni{trackOptionExample(e){if(e)return this.trackCliOption({option:"example",value:e})}trackOptionPackageManager(e){if(e)return this.trackCliOption({option:"package_manager",value:e})}trackOptionSkipInstall(e){if(e)return this.trackCliOption({option:"skip_install",value:e.toString()})}trackOptionSkipTransforms(e){if(e)return this.trackCliOption({option:"skip_transforms",value:e.toString()})}trackOptionTurboVersion(e){if(e)return this.trackCliOption({option:"turbo_version",value:e})}trackOptionExamplePath(e){if(e)return this.trackCliOption({option:"example_path",value:e})}trackArgumentDirectory(e){if(e)return this.trackCliArgument({argument:"project_directory",value:"provided"})}trackArgumentPackageManager(e){if(e)return this.trackCliArgument({argument:"package_manager",value:e})}};l();var YP=le(zP());var q7=["build","test","lint","typecheck","checktypes","check-types","type-check","check"],La=class extends Ni{trackCI(){var e;return this.track({key:"ci",value:(e=YP.name)!=null?e:"unknown"})}trackArgumentWorkspace(e){if(e)return this.trackCliArgument({argument:"workspace",value:"provided"})}trackOptionTask(e){if(e)return this.trackCliOption({option:"task",value:q7.includes(e)?e:"other"})}trackOptionFallback(e){if(e)return this.trackCliOption({option:"fallback",value:e})}trackOptionDirectory(e){if(e)return this.trackCliOption({option:"directory",value:"custom"})}trackOptionMaxBuffer(e){if(e!==void 0)return this.trackCliOption({option:"max_buffer",value:e.toString()})}};var B7={"create-turbo":Ia,"turbo-ignore":La},j7="https://telemetry.vercel.com";async function f0({packageInfo:t,opts:e}){let r=B7[t.name],n=await Tt.fromDefaultConfig();return n?(n.showAlert(),{telemetry:new r({api:j7,packageInfo:t,config:n,opts:e})}):{telemetry:void 0}}l();var Na=le(Bc());var KP="status",H7=["enable","disable",KP];function $7(t){var r;let e=(r=t.telemetry)==null?void 0:r.config.isEnabled();Se.log(`Status: ${e?Na.default.bold(Na.default.green("Enabled")):Na.default.bold(Na.default.red("Disabled"))}`),Se.log(),e?Se.log("Turborepo telemetry is completely anonymous. Thank you for participating!"):Se.log("You have opted-out of Turborepo anonymous telemetry. No data will be collected from your machine."),Se.log("Learn more: https://turborepo.com/docs/telemetry")}function U7(t,e){if(!e.telemetry){Se.error("Telemetry could not be initialized");return}t==="enable"?(e.telemetry.config.enable(),Se.bold("Success!")):t==="disable"&&(e.telemetry.config.disable(),Se.bold("Success!")),Se.log(),$7(e)}function h0(t){t.command("telemetry").description("Manage telemetry settings").addArgument(new M0("[action]","Action to perform").choices(H7).default(KP)).action(U7)}var cf={name:"turbo-ignore",version:"2.5.6",description:"",homepage:"https://turborepo.com",keywords:[],author:"Jared Palmer",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turborepo",directory:"packages/turbo-ignore"},bugs:{url:"https://github.com/vercel/turborepo/issues"},files:["dist"],bin:"dist/cli.js",scripts:{build:"tsup",test:"jest",lint:"eslint src __tests__","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{json5:"^2.2.3"},devDependencies:{"@jest/globals":"^29.7.0","@turbo/eslint-config":"workspace:*","@turbo/telemetry":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/types":"workspace:*","@turbo/utils":"workspace:*","@types/node":"^18.17.2",commander:"^11.0.0",jest:"^29.7.0","ts-jest":"^29.2.5",tsup:"^5.12.1",typescript:"5.5.4"}};l();var cI=require("child_process"),uI=le(require("path")),lI=require("fs");l();var ZP=require("child_process");l();var d0="\u226B ";function xe(...t){console.log(d0,...t)}function or(...t){console.error(d0,...t)}function Da(...t){console.warn(d0,...t)}function p0(...t){console.log(...t)}function V7(t){try{return(0,ZP.execSync)(`git cat-file -t ${t}`,{stdio:"ignore"}),!0}catch{return!1}}function m0(t){return t.fallback?(xe(`Falling back to ref ${t.fallback}`),{ref:t.fallback,type:"customFallback"}):null}function JP(t){let{workspace:e}=t;return process.env.VERCEL==="1"?process.env.VERCEL_GIT_PREVIOUS_SHA?V7(process.env.VERCEL_GIT_PREVIOUS_SHA)?(xe(`Found previous deployment ("${process.env.VERCEL_GIT_PREVIOUS_SHA}") for "${e}"${process.env.VERCEL_GIT_COMMIT_REF?` on branch "${process.env.VERCEL_GIT_COMMIT_REF}"`:""}`),{ref:process.env.VERCEL_GIT_PREVIOUS_SHA,type:"previousDeploy"}):(xe(`Previous deployment ("${process.env.VERCEL_GIT_PREVIOUS_SHA}") for "${e}"${process.env.VERCEL_GIT_COMMIT_REF?` on branch "${process.env.VERCEL_GIT_COMMIT_REF}"`:""} is unreachable.`),m0(t)):(xe(`No previous deployments found for "${e}"${process.env.VERCEL_GIT_COMMIT_REF?` on branch "${process.env.VERCEL_GIT_COMMIT_REF}"`:""}`),m0(t)):t.fallback?m0(t):{ref:"HEAD^",type:"headRelative"}}l();function XP(t){return t.task?(xe(`Using "${t.task}" as the task from the arguments`),`"${t.task}"`):(xe('Using "build" as the task as it was unspecified'),"build")}l();var QP=le(require("fs")),eI=le(require("path"));function tI(t){let{directory:e=process.cwd(),workspace:r}=t;if(r)return xe(`Using "${r}" as workspace from arguments`),r;let n=eI.default.join(e,"package.json");try{let i=QP.default.readFileSync(n,"utf8"),s=JSON.parse(i);return s.name?(xe(`Inferred "${s.name}" as workspace from "package.json"`),s.name):(or(`"${n}" is missing the "name" field (required).`),null)}catch{return or(`"${n}" could not be found. turbo-ignore inferencing failed`),null}}l();var g0=le(require("fs")),y0=le(require("path")),rI=require("json5");function nI(t,e){var s,o;let{turboVersion:r}=t;if(r)return xe(`Using turbo version "${r}" from arguments`),r;let n=y0.default.join(e,"package.json");try{let a=g0.default.readFileSync(n,"utf8"),c=JSON.parse(a),u=(s=c.dependencies)==null?void 0:s.turbo,f=(o=c.devDependencies)==null?void 0:o.turbo;if(r=u||f,r!==void 0){if(!r.startsWith("catalog:"))return xe(`Inferred turbo version "${r}" from "package.json"`),r;Da("Cannot infer turbo version due to use of `catalog` protocol. Remove `turbo` from your PNPM catalog to ensure correct turbo version is used")}}catch{return or(`"${n}" could not be read. turbo-ignore turbo version inference failed`),null}let i=y0.default.join(e,"turbo.json");try{let a=g0.default.readFileSync(i,"utf8"),c=(0,rI.parse)(a);return"tasks"in c?(xe('Inferred turbo version ^2 based on "tasks" in "turbo.json"'),"^2"):"pipeline"in c?(xe('Inferred turbo version ^1 based on "pipeline" in "turbo.json"'),"^1"):null}catch{return or(`"${i}" could not be read. turbo-ignore turbo version inference failed`),null}}l();var _0={MISSING_LOCKFILE:{regex:[/reading (?:yarn.lock|package-lock.json|pnpm-lock.yaml):.*?no such file or directory/i],message:"turbo-ignore could not complete - no lockfile found, please commit one to your repository"},NO_PACKAGE_MANAGER:{regex:[/run failed: We did not detect an in-use package manager for your project/i],message:'turbo-ignore could not complete - no package manager detected, please commit a lockfile, or set "packageManager" in your root "package.json"'},UNREACHABLE_PARENT:{regex:[/failed to resolve packages to run: commit HEAD\^ does not exist/i],message:"turbo-ignore could not complete - parent commit does not exist or is unreachable"},INVALID_COMPARISON:{regex:[/commit \S+ does not exist/i,/unknown revision/i,/invalid symmetric difference expression/i],message:"turbo-ignore could not complete - a ref or SHA is invalid. It could have been removed from the branch history via a force push, or this could be a shallow clone with insufficient history"}};function iI({err:t}){let e=Object.keys(_0).find(r=>{let{regex:n}=_0[r];return n.some(i=>i.test(t))});return e?{level:"warn",message:_0[e].message,code:e}:{level:"error",message:t,code:"UNKNOWN_ERROR"}}l();var sI=require("child_process"),W7=["[skip ci]","[ci skip]","[no ci]","[skip vercel]","[vercel skip]"],z7=["[vercel deploy]","[vercel build]"];function Y7({workspace:t}){return[`[vercel skip ${t}]`]}function K7({workspace:t}){return[`[vercel deploy ${t}]`,`[vercel build ${t}]`]}var Z7=/\[vercel only .+\]/;function J7({workspace:t}){return[`[vercel only ${t}]`]}function X7(){return process.env.VERCEL==="1"&&process.env.VERCEL_GIT_COMMIT_MESSAGE?process.env.VERCEL_GIT_COMMIT_MESSAGE:(0,sI.execSync)("git show -s --format=%B").toString()}function oI({workspace:t}){var c;let e=X7(),r=u=>e.includes(u),n=(c=Z7.exec(e))==null?void 0:c[0];if(n)return J7({workspace:t}).find(u=>u===n)?{result:"deploy",scope:"workspace",reason:`Found commit message: ${n}`}:{result:"skip",scope:"workspace",reason:`Found commit message: ${n}`};let i=K7({workspace:t}).find(r),s=Y7({workspace:t}).find(r);if(i&&s)return{result:"conflict",scope:"workspace",reason:`Conflicting commit messages found: ${i} and ${s}`};if(i)return{result:"deploy",scope:"workspace",reason:`Found commit message: ${i}`};if(s)return{result:"skip",scope:"workspace",reason:`Found commit message: ${s}`};let o=z7.find(r),a=W7.find(r);return o&&a?{result:"conflict",scope:"global",reason:`Conflicting commit messages found: ${o} and ${a}`}:o?{result:"deploy",scope:"global",reason:`Found commit message: ${o}`}:a?{result:"skip",scope:"global",reason:`Found commit message: ${a}`}:{result:"continue",scope:"global",reason:"No deploy or skip string found in commit message."}}function Q7(t){var e,r,n,i;(e=t.telemetry)==null||e.trackOptionTask(t.task),(r=t.telemetry)==null||r.trackOptionFallback(t.fallback),(n=t.telemetry)==null||n.trackOptionDirectory(t.directory),(i=t.telemetry)==null||i.trackOptionMaxBuffer(t.maxBuffer)}function aI(){return p0("\u23ED Ignoring the change"),process.exit(0)}function Mr(){return p0("\u2713 Proceeding with deployment"),process.exit(1)}function fI(t,e){var d,g;(d=e.telemetry)==null||d.trackCommandStatus({command:"ignore",status:"start"}),(g=e.telemetry)==null||g.trackArgumentWorkspace(t!==void 0),Q7(e);let r={workspace:t,...e};if(xe(`Using Turborepo to determine if this project is affected by the commit...
87
+ `:""}var CM=RM,OM={dump:CM};function Eh(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var Uz=Zb.load,Gz=Zb.loadAll,Vz=OM.dump;var Wz=Eh("safeLoad","load"),zz=Eh("safeLoadAll","loadAll"),Yz=Eh("safeDump","dump");var RH=le(Yx()),CH=le(require("json5"));var Se={};_I(Se,{bold:()=>_H,dimmed:()=>bH,error:()=>$p,grey:()=>EH,info:()=>yH,item:()=>wH,log:()=>An,turboBlue:()=>ps,turboGradient:()=>gH,turboLoader:()=>mA,turboRed:()=>dA,underline:()=>vH,warn:()=>gA,yellow:()=>pA});l();var St=le(Bc()),uA=le(DS()),lA=le(cA()),fA="#0099F7",hA="#F11712",mH="#FFFF00",Hp=t=>{let e=xH(t);return r=>`\x1B[38;5;${e}m${r}${(0,St.reset)("")}`},gH=(0,lA.default)(fA,hA),ps=Hp(fA),dA=Hp(hA),pA=Hp(mH),mA=t=>(0,uA.default)({text:t,spinner:{frames:[" ",ps("> "),ps(">> "),ps(">>>")]}}),yH=(...t)=>{An(ps((0,St.bold)(">>>")),t.join(" "))},_H=(...t)=>{An((0,St.bold)(t.join(" ")))},vH=(...t)=>{An((0,St.underline)(t.join(" ")))},bH=(...t)=>{An((0,St.dim)(t.join(" ")))},EH=(...t)=>{An((0,St.gray)(t.join(" ")))},wH=(...t)=>{An(ps((0,St.bold)(" \u2022")),t.join(" "))},An=(...t)=>{console.log(...t)},gA=(...t)=>{console.error(pA((0,St.bold)(">>>")),t.join(" "))},$p=(...t)=>{console.error(dA((0,St.bold)(">>>")),t.join(" "))};function xH(t){let e=parseInt(t.slice(1),16),r=Math.floor(e/(256*256))%256,n=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)}l();var b6=le(require("os")),E6=le(UR());l();l();var w6=le(require("path"));l();var hP=require("stream"),dP=require("util"),oV=require("path"),aV=require("os"),pP=require("fs"),cV=le(HT());var GX=(0,dP.promisify)(hP.Stream.pipeline);l();l();var _V=le(require("path")),vV=le(EP());l();l();var $P=le(Bc());l();var me;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let s={};for(let o of i)s[o]=o;return s},t.getValidEnumValues=i=>{let s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(let o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(me||(me={}));var Qy;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Qy||(Qy={}));var U=me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Un=t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}},N=me.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"]),bV=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Bt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,c=0;for(;c<o.path.length;){let u=o.path[c];c===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(o))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Bt.create=t=>new Bt(t);var ka=(t,e)=>{let r;switch(t.code){case N.invalid_type:t.received===U.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,me.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${me.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${me.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${me.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:me.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case N.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case N.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=e.defaultError,me.assertNever(t)}return{message:r}},SP=ka;function EV(t){SP=t}function rf(){return SP}var nf=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],o={...i,path:s},a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},wV=[];function G(t,e){let r=nf({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,rf(),ka].filter(n=>!!n)});t.common.issues.push(r)}var Xe=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return oe;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r)n.push({key:await i.key,value:await i.value});return Xe.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return oe;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}},oe=Object.freeze({status:"aborted"}),AP=t=>({status:"dirty",value:t}),_t=t=>({status:"valid",value:t}),e0=t=>t.status==="aborted",t0=t=>t.status==="dirty",Pa=t=>t.status==="valid",sf=t=>typeof Promise<"u"&&t instanceof Promise,X;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(X||(X={}));var ir=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},wP=(t,e)=>{if(Pa(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Bt(t.common.issues);return this._error=r,this._error}}};function ae(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:n!=null?n:a.defaultError}:{message:r!=null?r:a.defaultError},description:i}}var ce=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Un(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Un(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Xe,ctx:{common:e.parent.common,data:e.data,parsedType:Un(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(sf(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Un(e)},s=this._parseSync({data:e,path:i.path,parent:i});return wP(i,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Un(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(sf(i)?i:Promise.resolve(i));return wP(n,s)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let o=e(i),a=()=>s.addIssue({code:N.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Ht({schema:this,typeName:te.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return pr.create(this,this._def)}nullable(){return fn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jt.create(this,this._def)}promise(){return Wn.create(this,this._def)}or(e){return Ri.create([this,e],this._def)}and(e){return Ci.create(this,e,this._def)}transform(e){return new Ht({...ae(this._def),schema:this,typeName:te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ii({...ae(this._def),innerType:this,defaultValue:r,typeName:te.ZodDefault})}brand(){return new of({typeName:te.ZodBranded,type:this,...ae(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new so({...ae(this._def),innerType:this,catchValue:r,typeName:te.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Li.create(this,e)}readonly(){return ao.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},xV=/^c[^\s-]{8,}$/i,SV=/^[a-z][a-z0-9]*$/,AV=/^[0-9A-HJKMNP-TV-Z]{26}$/,RV=/^[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,CV=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,OV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Xy,TV=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,kV=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,PV=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function IV(t,e){return!!((e==="v4"||!e)&&TV.test(t)||(e==="v6"||!e)&&kV.test(t))}var qt=class extends ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.string,received:s.parsedType}),oe}let n=new Xe,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?G(i,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&G(i,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")CV.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"email",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Xy||(Xy=new RegExp(OV,"u")),Xy.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"emoji",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")RV.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"uuid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")xV.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"cuid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")SV.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"cuid2",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")AV.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"ulid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),G(i,{validation:"url",code:N.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"regex",code:N.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?PV(s).test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?IV(e.data,s.version)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"ip",code:N.invalid_string,message:s.message}),n.dirty()):me.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:N.invalid_string,...X.errToObj(n)})}_addCheck(e){return new qt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...X.errToObj(e)})}url(e){return this._addCheck({kind:"url",...X.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...X.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...X.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...X.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...X.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...X.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...X.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...X.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...X.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...X.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...X.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...X.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...X.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...X.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...X.errToObj(r)})}nonempty(e){return this.min(1,X.errToObj(e))}trim(){return new qt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new qt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new qt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}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 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 minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};qt.create=t=>{var e;return new qt({checks:[],typeName:te.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ae(t)})};function LV(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}var Ir=class extends ce{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)!==U.number){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.number,received:s.parsedType}),oe}let n,i=new Xe;for(let s of this._def.checks)s.kind==="int"?me.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:N.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?LV(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:N.not_finite,message:s.message}),i.dirty()):me.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,X.toString(r))}gt(e,r){return this.setLimit("min",e,!1,X.toString(r))}lte(e,r){return this.setLimit("max",e,!0,X.toString(r))}lt(e,r){return this.setLimit("max",e,!1,X.toString(r))}setLimit(e,r,n,i){return new Ir({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:X.toString(i)}]})}_addCheck(e){return new Ir({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:X.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:X.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:X.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:X.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:X.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:X.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:X.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&me.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Ir.create=t=>new Ir({checks:[],typeName:te.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...ae(t)});var Lr=class extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==U.bigint){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.bigint,received:s.parsedType}),oe}let n,i=new Xe;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):me.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,X.toString(r))}gt(e,r){return this.setLimit("min",e,!1,X.toString(r))}lte(e,r){return this.setLimit("max",e,!0,X.toString(r))}lt(e,r){return this.setLimit("max",e,!1,X.toString(r))}setLimit(e,r,n,i){return new Lr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:X.toString(i)}]})}_addCheck(e){return new Lr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:X.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:X.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:X.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Lr.create=t=>{var e;return new Lr({checks:[],typeName:te.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ae(t)})};var xi=class extends ce{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==U.boolean){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.boolean,received:n.parsedType}),oe}return _t(e.data)}};xi.create=t=>new xi({typeName:te.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...ae(t)});var un=class extends ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.date,received:s.parsedType}),oe}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_date}),oe}let n=new Xe,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):me.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new un({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:X.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:X.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};un.create=t=>new un({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:te.ZodDate,...ae(t)});var to=class extends ce{_parse(e){if(this._getType(e)!==U.symbol){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.symbol,received:n.parsedType}),oe}return _t(e.data)}};to.create=t=>new to({typeName:te.ZodSymbol,...ae(t)});var Si=class extends ce{_parse(e){if(this._getType(e)!==U.undefined){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.undefined,received:n.parsedType}),oe}return _t(e.data)}};Si.create=t=>new Si({typeName:te.ZodUndefined,...ae(t)});var Ai=class extends ce{_parse(e){if(this._getType(e)!==U.null){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.null,received:n.parsedType}),oe}return _t(e.data)}};Ai.create=t=>new Ai({typeName:te.ZodNull,...ae(t)});var Vn=class extends ce{constructor(){super(...arguments),this._any=!0}_parse(e){return _t(e.data)}};Vn.create=t=>new Vn({typeName:te.ZodAny,...ae(t)});var cn=class extends ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _t(e.data)}};cn.create=t=>new cn({typeName:te.ZodUnknown,...ae(t)});var mr=class extends ce{_parse(e){let r=this._getOrReturnCtx(e);return G(r,{code:N.invalid_type,expected:U.never,received:r.parsedType}),oe}};mr.create=t=>new mr({typeName:te.ZodNever,...ae(t)});var ro=class extends ce{_parse(e){if(this._getType(e)!==U.undefined){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.void,received:n.parsedType}),oe}return _t(e.data)}};ro.create=t=>new ro({typeName:te.ZodVoid,...ae(t)});var jt=class extends ce{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==U.array)return G(r,{code:N.invalid_type,expected:U.array,received:r.parsedType}),oe;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(o||a)&&(G(r,{code:o?N.too_big:N.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(G(r,{code:N.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(G(r,{code:N.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>i.type._parseAsync(new ir(r,o,r.path,a)))).then(o=>Xe.mergeArray(n,o));let s=[...r.data].map((o,a)=>i.type._parseSync(new ir(r,o,r.path,a)));return Xe.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new jt({...this._def,minLength:{value:e,message:X.toString(r)}})}max(e,r){return new jt({...this._def,maxLength:{value:e,message:X.toString(r)}})}length(e,r){return new jt({...this._def,exactLength:{value:e,message:X.toString(r)}})}nonempty(e){return this.min(1,e)}};jt.create=(t,e)=>new jt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:te.ZodArray,...ae(e)});function eo(t){if(t instanceof Oe){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=pr.create(eo(n))}return new Oe({...t._def,shape:()=>e})}else return t instanceof jt?new jt({...t._def,type:eo(t.element)}):t instanceof pr?pr.create(eo(t.unwrap())):t instanceof fn?fn.create(eo(t.unwrap())):t instanceof sr?sr.create(t.items.map(e=>eo(e))):t}var Oe=class extends ce{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(),r=me.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==U.object){let u=this._getOrReturnCtx(e);return G(u,{code:N.invalid_type,expected:U.object,received:u.parsedType}),oe}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof mr&&this._def.unknownKeys==="strip"))for(let u in i.data)o.includes(u)||a.push(u);let c=[];for(let u of o){let f=s[u],h=i.data[u];c.push({key:{status:"valid",value:u},value:f._parse(new ir(i,h,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof mr){let u=this._def.unknownKeys;if(u==="passthrough")for(let f of a)c.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")a.length>0&&(G(i,{code:N.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let f of a){let h=i.data[f];c.push({key:{status:"valid",value:f},value:u._parse(new ir(i,h,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let f of c){let h=await f.key;u.push({key:h,value:await f.value,alwaysSet:f.alwaysSet})}return u}).then(u=>Xe.mergeObjectSync(n,u)):Xe.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return X.errToObj,new Oe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,s,o,a;let c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=X.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new Oe({...this._def,unknownKeys:"strip"})}passthrough(){return new Oe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Oe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Oe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:te.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Oe({...this._def,catchall:e})}pick(e){let r={};return me.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Oe({...this._def,shape:()=>r})}omit(e){let r={};return me.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new Oe({...this._def,shape:()=>r})}deepPartial(){return eo(this)}partial(e){let r={};return me.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new Oe({...this._def,shape:()=>r})}required(e){let r={};return me.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof pr;)s=s._def.innerType;r[n]=s}}),new Oe({...this._def,shape:()=>r})}keyof(){return RP(me.objectKeys(this.shape))}};Oe.create=(t,e)=>new Oe({shape:()=>t,unknownKeys:"strip",catchall:mr.create(),typeName:te.ZodObject,...ae(e)});Oe.strictCreate=(t,e)=>new Oe({shape:()=>t,unknownKeys:"strict",catchall:mr.create(),typeName:te.ZodObject,...ae(e)});Oe.lazycreate=(t,e)=>new Oe({shape:t,unknownKeys:"strip",catchall:mr.create(),typeName:te.ZodObject,...ae(e)});var Ri=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(a=>new Bt(a.ctx.common.issues));return G(r,{code:N.invalid_union,unionErrors:o}),oe}if(r.common.async)return Promise.all(n.map(async s=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},f=c._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(c=>new Bt(c));return G(r,{code:N.invalid_union,unionErrors:a}),oe}}get options(){return this._def.options}};Ri.create=(t,e)=>new Ri({options:t,typeName:te.ZodUnion,...ae(e)});var tf=t=>t instanceof Ti?tf(t.schema):t instanceof Ht?tf(t.innerType()):t instanceof ki?[t.value]:t instanceof Nr?t.options:t instanceof Pi?Object.keys(t.enum):t instanceof Ii?tf(t._def.innerType):t instanceof Si?[void 0]:t instanceof Ai?[null]:null,no=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.object)return G(r,{code:N.invalid_type,expected:U.object,received:r.parsedType}),oe;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(G(r,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let s of r){let o=tf(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new no({typeName:te.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...ae(n)})}};function r0(t,e){let r=Un(t),n=Un(e);if(t===e)return{valid:!0,data:t};if(r===U.object&&n===U.object){let i=me.objectKeys(e),s=me.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(let a of s){let c=r0(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(r===U.array&&n===U.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<t.length;s++){let o=t[s],a=e[s],c=r0(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===U.date&&n===U.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ci=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,o)=>{if(e0(s)||e0(o))return oe;let a=r0(s.value,o.value);return a.valid?((t0(s)||t0(o))&&r.dirty(),{status:r.value,value:a.data}):(G(n,{code:N.invalid_intersection_types}),oe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ci.create=(t,e,r)=>new Ci({left:t,right:e,typeName:te.ZodIntersection,...ae(r)});var sr=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.array)return G(n,{code:N.invalid_type,expected:U.array,received:n.parsedType}),oe;if(n.data.length<this._def.items.length)return G(n,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),oe;!this._def.rest&&n.data.length>this._def.items.length&&(G(n,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((o,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new ir(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>Xe.mergeArray(r,o)):Xe.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new sr({...this._def,rest:e})}};sr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new sr({items:t,typeName:te.ZodTuple,rest:null,...ae(e)})};var Oi=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.object)return G(n,{code:N.invalid_type,expected:U.object,received:n.parsedType}),oe;let i=[],s=this._def.keyType,o=this._def.valueType;for(let a in n.data)i.push({key:s._parse(new ir(n,a,n.path,a)),value:o._parse(new ir(n,n.data[a],n.path,a))});return n.common.async?Xe.mergeObjectAsync(r,i):Xe.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ce?new Oi({keyType:e,valueType:r,typeName:te.ZodRecord,...ae(n)}):new Oi({keyType:qt.create(),valueType:e,typeName:te.ZodRecord,...ae(r)})}},io=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.map)return G(n,{code:N.invalid_type,expected:U.map,received:n.parsedType}),oe;let i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,c],u)=>({key:i._parse(new ir(n,a,n.path,[u,"key"])),value:s._parse(new ir(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of o){let u=await c.key,f=await c.value;if(u.status==="aborted"||f.status==="aborted")return oe;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(u.value,f.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of o){let u=c.key,f=c.value;if(u.status==="aborted"||f.status==="aborted")return oe;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(u.value,f.value)}return{status:r.value,value:a}}}};io.create=(t,e,r)=>new io({valueType:e,keyType:t,typeName:te.ZodMap,...ae(r)});var ln=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.set)return G(n,{code:N.invalid_type,expected:U.set,received:n.parsedType}),oe;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(G(n,{code:N.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(G(n,{code:N.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function o(c){let u=new Set;for(let f of c){if(f.status==="aborted")return oe;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>s._parse(new ir(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,r){return new ln({...this._def,minSize:{value:e,message:X.toString(r)}})}max(e,r){return new ln({...this._def,maxSize:{value:e,message:X.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};ln.create=(t,e)=>new ln({valueType:t,minSize:null,maxSize:null,typeName:te.ZodSet,...ae(e)});var Gn=class extends ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.function)return G(r,{code:N.invalid_type,expected:U.function,received:r.parsedType}),oe;function n(a,c){return nf({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,rf(),ka].filter(u=>!!u),issueData:{code:N.invalid_arguments,argumentsError:c}})}function i(a,c){return nf({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,rf(),ka].filter(u=>!!u),issueData:{code:N.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Wn){let a=this;return _t(async function(...c){let u=new Bt([]),f=await a._def.args.parseAsync(c,s).catch(g=>{throw u.addIssue(n(c,g)),u}),h=await Reflect.apply(o,this,f);return await a._def.returns._def.type.parseAsync(h,s).catch(g=>{throw u.addIssue(i(h,g)),u})})}else{let a=this;return _t(function(...c){let u=a._def.args.safeParse(c,s);if(!u.success)throw new Bt([n(c,u.error)]);let f=Reflect.apply(o,this,u.data),h=a._def.returns.safeParse(f,s);if(!h.success)throw new Bt([i(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Gn({...this._def,args:sr.create(e).rest(cn.create())})}returns(e){return new Gn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Gn({args:e||sr.create([]).rest(cn.create()),returns:r||cn.create(),typeName:te.ZodFunction,...ae(n)})}},Ti=class extends ce{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ti.create=(t,e)=>new Ti({getter:t,typeName:te.ZodLazy,...ae(e)});var ki=class extends ce{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return G(r,{received:r.data,code:N.invalid_literal,expected:this._def.value}),oe}return{status:"valid",value:e.data}}get value(){return this._def.value}};ki.create=(t,e)=>new ki({value:t,typeName:te.ZodLiteral,...ae(e)});function RP(t,e){return new Nr({values:t,typeName:te.ZodEnum,...ae(e)})}var Nr=class extends ce{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return G(r,{expected:me.joinValues(n),received:r.parsedType,code:N.invalid_type}),oe}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return G(r,{received:r.data,code:N.invalid_enum_value,options:n}),oe}return _t(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return Nr.create(e)}exclude(e){return Nr.create(this.options.filter(r=>!e.includes(r)))}};Nr.create=RP;var Pi=class extends ce{_parse(e){let r=me.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==U.string&&n.parsedType!==U.number){let i=me.objectValues(r);return G(n,{expected:me.joinValues(i),received:n.parsedType,code:N.invalid_type}),oe}if(r.indexOf(e.data)===-1){let i=me.objectValues(r);return G(n,{received:n.data,code:N.invalid_enum_value,options:i}),oe}return _t(e.data)}get enum(){return this._def.values}};Pi.create=(t,e)=>new Pi({values:t,typeName:te.ZodNativeEnum,...ae(e)});var Wn=class extends ce{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.promise&&r.common.async===!1)return G(r,{code:N.invalid_type,expected:U.promise,received:r.parsedType}),oe;let n=r.parsedType===U.promise?r.data:Promise.resolve(r.data);return _t(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Wn.create=(t,e)=>new Wn({type:t,typeName:te.ZodPromise,...ae(e)});var Ht=class extends ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{G(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){let o=a=>{let c=i.refinement(a,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?oe:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?oe:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Pa(o))return o;let a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Pa(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);me.assertNever(i)}};Ht.create=(t,e,r)=>new Ht({schema:t,typeName:te.ZodEffects,effect:e,...ae(r)});Ht.createWithPreprocess=(t,e,r)=>new Ht({schema:e,effect:{type:"preprocess",transform:t},typeName:te.ZodEffects,...ae(r)});var pr=class extends ce{_parse(e){return this._getType(e)===U.undefined?_t(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};pr.create=(t,e)=>new pr({innerType:t,typeName:te.ZodOptional,...ae(e)});var fn=class extends ce{_parse(e){return this._getType(e)===U.null?_t(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};fn.create=(t,e)=>new fn({innerType:t,typeName:te.ZodNullable,...ae(e)});var Ii=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===U.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ii.create=(t,e)=>new Ii({innerType:t,typeName:te.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ae(e)});var so=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return sf(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};so.create=(t,e)=>new so({innerType:t,typeName:te.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ae(e)});var oo=class extends ce{_parse(e){if(this._getType(e)!==U.nan){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.nan,received:n.parsedType}),oe}return{status:"valid",value:e.data}}};oo.create=t=>new oo({typeName:te.ZodNaN,...ae(t)});var NV=Symbol("zod_brand"),of=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Li=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?oe:s.status==="dirty"?(r.dirty(),AP(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?oe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new Li({in:e,out:r,typeName:te.ZodPipeline})}},ao=class extends ce{_parse(e){let r=this._def.innerType._parse(e);return Pa(r)&&(r.value=Object.freeze(r.value)),r}};ao.create=(t,e)=>new ao({innerType:t,typeName:te.ZodReadonly,...ae(e)});var CP=(t,e={},r)=>t?Vn.create().superRefine((n,i)=>{var s,o;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:c})}}):Vn.create(),DV={object:Oe.lazycreate},te;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(te||(te={}));var MV=(t,e={message:`Input not instance of ${t.name}`})=>CP(r=>r instanceof t,e),OP=qt.create,TP=Ir.create,FV=oo.create,qV=Lr.create,kP=xi.create,BV=un.create,jV=to.create,HV=Si.create,$V=Ai.create,UV=Vn.create,GV=cn.create,VV=mr.create,WV=ro.create,zV=jt.create,YV=Oe.create,KV=Oe.strictCreate,ZV=Ri.create,JV=no.create,XV=Ci.create,QV=sr.create,e7=Oi.create,t7=io.create,r7=ln.create,n7=Gn.create,i7=Ti.create,s7=ki.create,o7=Nr.create,a7=Pi.create,c7=Wn.create,xP=Ht.create,u7=pr.create,l7=fn.create,f7=Ht.createWithPreprocess,h7=Li.create,d7=()=>OP().optional(),p7=()=>TP().optional(),m7=()=>kP().optional(),g7={string:t=>qt.create({...t,coerce:!0}),number:t=>Ir.create({...t,coerce:!0}),boolean:t=>xi.create({...t,coerce:!0}),bigint:t=>Lr.create({...t,coerce:!0}),date:t=>un.create({...t,coerce:!0})},y7=oe,co=Object.freeze({__proto__:null,defaultErrorMap:ka,setErrorMap:EV,getErrorMap:rf,makeIssue:nf,EMPTY_PATH:wV,addIssueToContext:G,ParseStatus:Xe,INVALID:oe,DIRTY:AP,OK:_t,isAborted:e0,isDirty:t0,isValid:Pa,isAsync:sf,get util(){return me},get objectUtil(){return Qy},ZodParsedType:U,getParsedType:Un,ZodType:ce,ZodString:qt,ZodNumber:Ir,ZodBigInt:Lr,ZodBoolean:xi,ZodDate:un,ZodSymbol:to,ZodUndefined:Si,ZodNull:Ai,ZodAny:Vn,ZodUnknown:cn,ZodNever:mr,ZodVoid:ro,ZodArray:jt,ZodObject:Oe,ZodUnion:Ri,ZodDiscriminatedUnion:no,ZodIntersection:Ci,ZodTuple:sr,ZodRecord:Oi,ZodMap:io,ZodSet:ln,ZodFunction:Gn,ZodLazy:Ti,ZodLiteral:ki,ZodEnum:Nr,ZodNativeEnum:Pi,ZodPromise:Wn,ZodEffects:Ht,ZodTransformer:Ht,ZodOptional:pr,ZodNullable:fn,ZodDefault:Ii,ZodCatch:so,ZodNaN:oo,BRAND:NV,ZodBranded:of,ZodPipeline:Li,ZodReadonly:ao,custom:CP,Schema:ce,ZodSchema:ce,late:DV,get ZodFirstPartyTypeKind(){return te},coerce:g7,any:UV,array:zV,bigint:qV,boolean:kP,date:BV,discriminatedUnion:JV,effect:xP,enum:o7,function:n7,instanceof:MV,intersection:XV,lazy:i7,literal:s7,map:t7,nan:FV,nativeEnum:a7,never:VV,null:$V,nullable:l7,number:TP,object:YV,oboolean:m7,onumber:p7,optional:u7,ostring:d7,pipeline:h7,preprocess:f7,promise:c7,record:e7,set:r7,strictObject:KV,string:OP,symbol:jV,transformer:xP,tuple:QV,undefined:HV,union:ZV,unknown:GV,void:WV,NEVER:y7,ZodIssueCode:N,quotelessJson:bV,ZodError:Bt});l();var c0=le(require("os")),BP=le(require("crypto")),jP=le(require("path")),HP=le(qP());function C7(t){let e=process.version,r=c0.default.type(),n=c0.default.arch();return`${t.name} ${t.version} ${e} ${r} ${n}`}async function O7(){let t=process.env.TURBO_CONFIG_DIR_PATH?process.env.TURBO_CONFIG_DIR_PATH:await(0,HP.configDir)();if(!t)throw new Error("Could not find telemetry config directory");return jP.default.join(t,"turborepo","telemetry.json")}function T7({input:t,salt:e}){return BP.default.createHash("sha256").update(`${e}${t}`).digest("hex")}var uo={buildUserAgent:C7,oneWayHashWithSalt:T7,defaultConfigPath:O7};var k7="TURBO_TELEMETRY_DEBUG",P7="TURBO_TELEMETRY_DISABLED",I7="TURBO_TELEMETRY_MESSAGE_DISABLED",L7="DO_NOT_TRACK",N7=co.object({telemetry_enabled:co.boolean(),telemetry_id:co.string(),telemetry_salt:co.string(),telemetry_alerted:co.string().optional()}),Tt=class{constructor({configPath:e,config:r}){this.config=r,this.configPath=e}static fromConfigPath(e){try{let r=(0,lo.readFileSync)(e,"utf-8"),n=JSON.parse(r),i=Tt.validateConfig(n);return new Tt({configPath:e,config:i})}catch{return Tt.tryRemove({configPath:e})?Tt.create({configPath:e}):void 0}}static async fromDefaultConfig(){try{let e=await uo.defaultConfigPath();return Tt.fromConfigPath(e)}catch{return}}static validateConfig(e){try{return N7.parse(e)}catch{throw new Error("Config is invalid.")}}static create({configPath:e}){let r=(0,u0.randomUUID)(),n=(0,u0.randomUUID)(),i=uo.oneWayHashWithSalt({input:r,salt:n}),s=new Tt({configPath:e,config:{telemetry_enabled:!0,telemetry_id:i,telemetry_salt:n}});if(s.tryWrite())return s}tryWrite(){try{let e=JSON.stringify(this.config,null,2);return(0,lo.writeFileSync)(this.configPath,e),!0}catch{return!1}}static tryRemove({configPath:e}){try{return(0,lo.rmSync)(e,{force:!0}),!0}catch{return!1}}hasSeenAlert(){return this.config.telemetry_alerted!==void 0}isEnabled(){let e=process.env[L7]||"0",r=process.env[P7]||"0";return e==="1"||e.toLowerCase()==="true"||r==="1"||r.toLowerCase()==="true"?!1:this.config.telemetry_enabled}isTelemetryWarningEnabled(){let e=process.env[I7]||"0";return!(e==="1"||e.toLowerCase()==="true")}get id(){return this.config.telemetry_id}showAlert(){!this.hasSeenAlert()&&this.isEnabled()&&this.isTelemetryWarningEnabled()&&(Se.log(),Se.bold("Attention:"),Se.grey("Turborepo now collects completely anonymous telemetry regarding usage."),Se.grey("This information is used to shape the Turborepo roadmap and prioritize features."),Se.grey("You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:"),Se.underline($P.default.gray("https://turborepo.com/docs/telemetry"))),this.alertShown()}enable(){this.config.telemetry_enabled=!0,this.tryWrite()}disable(){this.config.telemetry_enabled=!1,this.tryWrite()}alertShown(){return this.hasSeenAlert()||(this.config.telemetry_alerted=new Date().toISOString(),this.tryWrite()),!0}oneWayHash(e){return uo.oneWayHashWithSalt({input:e,salt:this.config.telemetry_salt})}static isDebug(){let e=process.env[k7]||"0";return e==="1"||e.toLowerCase()==="true"}};l();l();var l0=require("crypto"),UP=le(fP());var D7=20,M7="/api/turborepo/v1/events",Ni=class{constructor({api:e,packageInfo:r,config:n,opts:i}){this.batchSize=D7;this.timeout=250;this.sessionId=(0,l0.randomUUID)();this.eventBatches=[];this.events=[];let s=new URL(M7,e);this.api=s.toString(),this.packageInfo=r,this.config=n,i!=null&&i.timeout&&(this.timeout=i.timeout),i!=null&&i.batchSize&&(this.batchSize=i.batchSize)}hasPendingEvents(){return this.events.length!==0}async waitForFlush(){await Promise.all(this.eventBatches)}flushEvents(){let e=this.events.splice(0,this.batchSize);this.config.isEnabled()&&this.eventBatches.push(UP.default.post(this.api,{timeout:this.timeout,json:e,headers:{"x-turbo-telemetry-id":this.config.id,"x-turbo-session-id":this.sessionId,"User-Agent":uo.buildUserAgent(this.packageInfo)}}))}track({key:e,value:r,parentId:n,isSensitive:i}){let s={id:(0,l0.randomUUID)(),key:e,value:i?this.config.oneWayHash(r):r,package_name:this.packageInfo.name,package_version:this.packageInfo.version,parent_id:n};return Tt.isDebug()&&(Se.log(),Se.bold("[telemetry event]"),Se.dimmed(JSON.stringify(s,null,2)),Se.log()),this.config.isEnabled()&&(this.events.push({package:s}),this.events.length>=this.batchSize&&this.flushEvents()),s}async close(){for(;this.hasPendingEvents();)this.flushEvents();try{await this.waitForFlush()}catch{}}trackCliOption({option:e,value:r}){return this.track({key:`option:${e}`,value:r})}trackCliArgument({argument:e,value:r}){return this.track({key:`argument:${e}`,value:r})}trackCliCommand({command:e,value:r}){return this.track({key:`command:${e}`,value:r})}trackCommandStatus({command:e,status:r}){return this.trackCliCommand({command:e,value:r})}trackCommandWarning(e){return this.track({key:"warning",value:e})}trackCommandError(e){return this.track({key:"error",value:e})}};var Ia=class extends Ni{trackOptionExample(e){if(e)return this.trackCliOption({option:"example",value:e})}trackOptionPackageManager(e){if(e)return this.trackCliOption({option:"package_manager",value:e})}trackOptionSkipInstall(e){if(e)return this.trackCliOption({option:"skip_install",value:e.toString()})}trackOptionSkipTransforms(e){if(e)return this.trackCliOption({option:"skip_transforms",value:e.toString()})}trackOptionTurboVersion(e){if(e)return this.trackCliOption({option:"turbo_version",value:e})}trackOptionExamplePath(e){if(e)return this.trackCliOption({option:"example_path",value:e})}trackArgumentDirectory(e){if(e)return this.trackCliArgument({argument:"project_directory",value:"provided"})}trackArgumentPackageManager(e){if(e)return this.trackCliArgument({argument:"package_manager",value:e})}};l();var YP=le(zP());var q7=["build","test","lint","typecheck","checktypes","check-types","type-check","check"],La=class extends Ni{trackCI(){var e;return this.track({key:"ci",value:(e=YP.name)!=null?e:"unknown"})}trackArgumentWorkspace(e){if(e)return this.trackCliArgument({argument:"workspace",value:"provided"})}trackOptionTask(e){if(e)return this.trackCliOption({option:"task",value:q7.includes(e)?e:"other"})}trackOptionFallback(e){if(e)return this.trackCliOption({option:"fallback",value:e})}trackOptionDirectory(e){if(e)return this.trackCliOption({option:"directory",value:"custom"})}trackOptionMaxBuffer(e){if(e!==void 0)return this.trackCliOption({option:"max_buffer",value:e.toString()})}};var B7={"create-turbo":Ia,"turbo-ignore":La},j7="https://telemetry.vercel.com";async function f0({packageInfo:t,opts:e}){let r=B7[t.name],n=await Tt.fromDefaultConfig();return n?(n.showAlert(),{telemetry:new r({api:j7,packageInfo:t,config:n,opts:e})}):{telemetry:void 0}}l();var Na=le(Bc());var KP="status",H7=["enable","disable",KP];function $7(t){var r;let e=(r=t.telemetry)==null?void 0:r.config.isEnabled();Se.log(`Status: ${e?Na.default.bold(Na.default.green("Enabled")):Na.default.bold(Na.default.red("Disabled"))}`),Se.log(),e?Se.log("Turborepo telemetry is completely anonymous. Thank you for participating!"):Se.log("You have opted-out of Turborepo anonymous telemetry. No data will be collected from your machine."),Se.log("Learn more: https://turborepo.com/docs/telemetry")}function U7(t,e){if(!e.telemetry){Se.error("Telemetry could not be initialized");return}t==="enable"?(e.telemetry.config.enable(),Se.bold("Success!")):t==="disable"&&(e.telemetry.config.disable(),Se.bold("Success!")),Se.log(),$7(e)}function h0(t){t.command("telemetry").description("Manage telemetry settings").addArgument(new M0("[action]","Action to perform").choices(H7).default(KP)).action(U7)}var cf={name:"turbo-ignore",version:"2.5.7",description:"",homepage:"https://turborepo.com",keywords:[],author:"Jared Palmer",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turborepo",directory:"packages/turbo-ignore"},bugs:{url:"https://github.com/vercel/turborepo/issues"},files:["dist"],bin:"dist/cli.js",scripts:{build:"tsup",test:"jest",lint:"eslint src __tests__","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{json5:"^2.2.3"},devDependencies:{"@jest/globals":"^29.7.0","@turbo/eslint-config":"workspace:*","@turbo/telemetry":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/types":"workspace:*","@turbo/utils":"workspace:*","@types/node":"^18.17.2",commander:"^11.0.0",jest:"^29.7.0","ts-jest":"^29.2.5",tsup:"^5.12.1",typescript:"5.5.4"}};l();var cI=require("child_process"),uI=le(require("path")),lI=require("fs");l();var ZP=require("child_process");l();var d0="\u226B ";function xe(...t){console.log(d0,...t)}function or(...t){console.error(d0,...t)}function Da(...t){console.warn(d0,...t)}function p0(...t){console.log(...t)}function V7(t){try{return(0,ZP.execSync)(`git cat-file -t ${t}`,{stdio:"ignore"}),!0}catch{return!1}}function m0(t){return t.fallback?(xe(`Falling back to ref ${t.fallback}`),{ref:t.fallback,type:"customFallback"}):null}function JP(t){let{workspace:e}=t;return process.env.VERCEL==="1"?process.env.VERCEL_GIT_PREVIOUS_SHA?V7(process.env.VERCEL_GIT_PREVIOUS_SHA)?(xe(`Found previous deployment ("${process.env.VERCEL_GIT_PREVIOUS_SHA}") for "${e}"${process.env.VERCEL_GIT_COMMIT_REF?` on branch "${process.env.VERCEL_GIT_COMMIT_REF}"`:""}`),{ref:process.env.VERCEL_GIT_PREVIOUS_SHA,type:"previousDeploy"}):(xe(`Previous deployment ("${process.env.VERCEL_GIT_PREVIOUS_SHA}") for "${e}"${process.env.VERCEL_GIT_COMMIT_REF?` on branch "${process.env.VERCEL_GIT_COMMIT_REF}"`:""} is unreachable.`),m0(t)):(xe(`No previous deployments found for "${e}"${process.env.VERCEL_GIT_COMMIT_REF?` on branch "${process.env.VERCEL_GIT_COMMIT_REF}"`:""}`),m0(t)):t.fallback?m0(t):{ref:"HEAD^",type:"headRelative"}}l();function XP(t){return t.task?(xe(`Using "${t.task}" as the task from the arguments`),`"${t.task}"`):(xe('Using "build" as the task as it was unspecified'),"build")}l();var QP=le(require("fs")),eI=le(require("path"));function tI(t){let{directory:e=process.cwd(),workspace:r}=t;if(r)return xe(`Using "${r}" as workspace from arguments`),r;let n=eI.default.join(e,"package.json");try{let i=QP.default.readFileSync(n,"utf8"),s=JSON.parse(i);return s.name?(xe(`Inferred "${s.name}" as workspace from "package.json"`),s.name):(or(`"${n}" is missing the "name" field (required).`),null)}catch{return or(`"${n}" could not be found. turbo-ignore inferencing failed`),null}}l();var g0=le(require("fs")),y0=le(require("path")),rI=require("json5");function nI(t,e){var s,o;let{turboVersion:r}=t;if(r)return xe(`Using turbo version "${r}" from arguments`),r;let n=y0.default.join(e,"package.json");try{let a=g0.default.readFileSync(n,"utf8"),c=JSON.parse(a),u=(s=c.dependencies)==null?void 0:s.turbo,f=(o=c.devDependencies)==null?void 0:o.turbo;if(r=u||f,r!==void 0){if(!r.startsWith("catalog:"))return xe(`Inferred turbo version "${r}" from "package.json"`),r;Da("Cannot infer turbo version due to use of `catalog` protocol. Remove `turbo` from your PNPM catalog to ensure correct turbo version is used")}}catch{return or(`"${n}" could not be read. turbo-ignore turbo version inference failed`),null}let i=y0.default.join(e,"turbo.json");try{let a=g0.default.readFileSync(i,"utf8"),c=(0,rI.parse)(a);return"tasks"in c?(xe('Inferred turbo version ^2 based on "tasks" in "turbo.json"'),"^2"):"pipeline"in c?(xe('Inferred turbo version ^1 based on "pipeline" in "turbo.json"'),"^1"):null}catch{return or(`"${i}" could not be read. turbo-ignore turbo version inference failed`),null}}l();var _0={MISSING_LOCKFILE:{regex:[/reading (?:yarn.lock|package-lock.json|pnpm-lock.yaml):.*?no such file or directory/i],message:"turbo-ignore could not complete - no lockfile found, please commit one to your repository"},NO_PACKAGE_MANAGER:{regex:[/run failed: We did not detect an in-use package manager for your project/i],message:'turbo-ignore could not complete - no package manager detected, please commit a lockfile, or set "packageManager" in your root "package.json"'},UNREACHABLE_PARENT:{regex:[/failed to resolve packages to run: commit HEAD\^ does not exist/i],message:"turbo-ignore could not complete - parent commit does not exist or is unreachable"},INVALID_COMPARISON:{regex:[/commit \S+ does not exist/i,/unknown revision/i,/invalid symmetric difference expression/i],message:"turbo-ignore could not complete - a ref or SHA is invalid. It could have been removed from the branch history via a force push, or this could be a shallow clone with insufficient history"}};function iI({err:t}){let e=Object.keys(_0).find(r=>{let{regex:n}=_0[r];return n.some(i=>i.test(t))});return e?{level:"warn",message:_0[e].message,code:e}:{level:"error",message:t,code:"UNKNOWN_ERROR"}}l();var sI=require("child_process"),W7=["[skip ci]","[ci skip]","[no ci]","[skip vercel]","[vercel skip]"],z7=["[vercel deploy]","[vercel build]"];function Y7({workspace:t}){return[`[vercel skip ${t}]`]}function K7({workspace:t}){return[`[vercel deploy ${t}]`,`[vercel build ${t}]`]}var Z7=/\[vercel only .+\]/;function J7({workspace:t}){return[`[vercel only ${t}]`]}function X7(){return process.env.VERCEL==="1"&&process.env.VERCEL_GIT_COMMIT_MESSAGE?process.env.VERCEL_GIT_COMMIT_MESSAGE:(0,sI.execSync)("git show -s --format=%B").toString()}function oI({workspace:t}){var c;let e=X7(),r=u=>e.includes(u),n=(c=Z7.exec(e))==null?void 0:c[0];if(n)return J7({workspace:t}).find(u=>u===n)?{result:"deploy",scope:"workspace",reason:`Found commit message: ${n}`}:{result:"skip",scope:"workspace",reason:`Found commit message: ${n}`};let i=K7({workspace:t}).find(r),s=Y7({workspace:t}).find(r);if(i&&s)return{result:"conflict",scope:"workspace",reason:`Conflicting commit messages found: ${i} and ${s}`};if(i)return{result:"deploy",scope:"workspace",reason:`Found commit message: ${i}`};if(s)return{result:"skip",scope:"workspace",reason:`Found commit message: ${s}`};let o=z7.find(r),a=W7.find(r);return o&&a?{result:"conflict",scope:"global",reason:`Conflicting commit messages found: ${o} and ${a}`}:o?{result:"deploy",scope:"global",reason:`Found commit message: ${o}`}:a?{result:"skip",scope:"global",reason:`Found commit message: ${a}`}:{result:"continue",scope:"global",reason:"No deploy or skip string found in commit message."}}function Q7(t){var e,r,n,i;(e=t.telemetry)==null||e.trackOptionTask(t.task),(r=t.telemetry)==null||r.trackOptionFallback(t.fallback),(n=t.telemetry)==null||n.trackOptionDirectory(t.directory),(i=t.telemetry)==null||i.trackOptionMaxBuffer(t.maxBuffer)}function aI(){return p0("\u23ED Ignoring the change"),process.exit(0)}function Mr(){return p0("\u2713 Proceeding with deployment"),process.exit(1)}function fI(t,e){var d,g;(d=e.telemetry)==null||d.trackCommandStatus({command:"ignore",status:"start"}),(g=e.telemetry)==null||g.trackArgumentWorkspace(t!==void 0),Q7(e);let r={workspace:t,...e};if(xe(`Using Turborepo to determine if this project is affected by the commit...
88
88
  `),e.directory){let m=uI.default.resolve(e.directory);(0,lI.existsSync)(m)?r.directory=m:(Da(`Directory "${e.directory}" does not exist, using current directory`),r.directory=process.cwd())}else r.directory=process.cwd();if(process.env.TURBO_FORCE==="true")return xe("`TURBO_FORCE` detected"),Mr();let n=nc(r.directory);if(!n)return or("Monorepo root not found. turbo-ignore inferencing failed"),Mr();let i=tI(r);if(!i)return Mr();let s=nI(r,n),o=XP(r),a=oI({workspace:i});if(a.result==="skip")return xe(a.reason),aI();if(a.result==="deploy")return xe(a.reason),Mr();a.result==="conflict"&&xe(a.reason);let c=JP({workspace:i,fallback:r.fallback});if(!c)return Mr();let f=`npx -y ${s?`turbo@${s}`:"turbo"} run ${o} --filter="${i}...[${c.ref}]" --dry=json`;xe(`Analyzing results of \`${f}\``);let h={cwd:n};e.maxBuffer&&(h.maxBuffer=e.maxBuffer),(0,cI.exec)(f,h,(m,E)=>{var v,A;if(m){let{level:P,code:D,message:ie}=iI({err:m.message});return P==="warn"?((v=e.telemetry)==null||v.trackCommandWarning(ie),Da(ie)):or(`${D}: ${m.message}`),Mr()}try{let P=JSON.parse(E);if(P===null)return or(`Failed to parse JSON output from \`${f}\`.`),Mr();let{packages:D}=P;return D?D.length>0?(D.length===1?xe(`This commit affects "${i}"`):xe(`This commit affects "${i}" and ${D.length-1} ${D.length-1===1?"dependency":"dependencies"} (${D.slice(1).join(", ")})`),Mr()):(xe("This project and its dependencies are not affected"),aI()):(xe("Detected single package repo"),Mr())}catch(P){return or(`Failed to parse JSON output from \`${f}\`.`),or(P),Mr()}finally{(A=e.telemetry)==null||A.trackCommandStatus({command:"ignore",status:"end"})}})}var uf,v0=new D0;v0.name(cf.name).description("Only proceed with deployment if the workspace or any of its dependencies have changed").hook("preAction",async(t,e)=>{let{telemetry:r}=await f0({packageInfo:{name:"turbo-ignore",version:cf.version}});e.addOption(new zn("--telemetry").default(r).hideHelp()),uf=r}).hook("postAction",async()=>{await(uf==null?void 0:uf.close())}).argument("[workspace]",'The workspace being deployed. If [workspace] is not provided, it will be inferred from the "name" field of the "package.json" located at the current working directory.').addOption(new zn("-t, --task <name>","The task to execute").default("build")).addOption(new zn("-f, --fallback <ref>","On Vercel, if no previously deployed SHA is available to compare against, fallback to comparing against the provided ref")).addOption(new zn("-d, --directory <path>","The directory to run in (default: cwd)")).addOption(new zn("--turbo-version <version>","Explicitly set which version of turbo to invoke")).addOption(new zn("-b, --max-buffer <number>","maxBuffer for the child process in KB (default: 1024 KB)").argParser(t=>parseInt(t,10)*1024)).version(cf.version,"-v, --version","Output the current version").helpOption("-h, --help","Display help for command").showHelpAfterError(!1).action(fI);h0(v0);v0.parse();
89
89
  /*!
90
90
  * fill-range <https://github.com/jonschlinkert/fill-range>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turbo-ignore",
3
- "version": "2.5.6",
3
+ "version": "2.5.7",
4
4
  "description": "",
5
5
  "homepage": "https://turborepo.com",
6
6
  "keywords": [],
@@ -30,10 +30,10 @@
30
30
  "tsup": "^5.12.1",
31
31
  "typescript": "5.5.4",
32
32
  "@turbo/eslint-config": "0.0.0",
33
- "@turbo/test-utils": "0.0.0",
34
- "@turbo/tsconfig": "0.0.0",
35
- "@turbo/types": "2.5.6",
36
33
  "@turbo/telemetry": "0.0.0",
34
+ "@turbo/tsconfig": "0.0.0",
35
+ "@turbo/types": "2.5.7",
36
+ "@turbo/test-utils": "0.0.0",
37
37
  "@turbo/utils": "0.0.0"
38
38
  },
39
39
  "scripts": {