turbo-ignore 2.7.0 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -89,7 +89,7 @@ Please report this to https://github.com/szmarczak/http2-wrapper/`);g(v)}return}
|
|
|
89
89
|
`+t.slice(i,s),i=s+1),o=a;return c+=`
|
|
90
90
|
`,t.length-i>e&&o>i?c+=t.slice(i,o)+`
|
|
91
91
|
`+t.slice(o+1):c+=t.slice(i),c.slice(1)}function OF(t){for(var e="",r=0,n,i=0;i<t.length;r>=65536?i+=2:i++)r=Fo(t,i),n=it[r],!n&&Ho(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||vF(r);return e}function TF(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)),($r(t,e,a,!1,!1)||typeof a>"u"&&$r(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}function tE(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)),($r(t,e+1,c,!0,!0,!1,!0)||typeof c>"u"&&$r(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=Oh(t,e)),t.dump&&Bo===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=s,t.dump=i||"[]"}function kF(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)),$r(t,e,c,!1,!1)&&(t.dump.length>1024&&(f+="? "),f+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),$r(t,e,u,!1,!1)&&(f+=t.dump,n+=f));t.tag=i,t.dump="{"+n+"}"}function PF(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+=Oh(t,e)),u=o[a],f=r[u],t.replacer&&(f=t.replacer.call(r,u,f)),$r(t,e+1,u,!0,!0,!0)&&(h=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,h&&(t.dump&&Bo===t.dump.charCodeAt(0)?d+="?":d+="? "),d+=t.dump,h&&(d+=Oh(t,e)),$r(t,e+1,f,!0,h)&&(t.dump&&Bo===t.dump.charCodeAt(0)?d+=":":d+=": ",d+=t.dump,i+=d));t.tag=s,t.dump=i||"{}"}function rE(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,yE.call(a.represent)==="[object Function]")n=a.represent(e,c);else if(_E.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 $r(t,e,r,n,i,s,o){t.tag=null,t.dump=r,rE(t,r,!1)||rE(t,r,!0);var a=yE.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?(PF(t,e,t.dump,i),d&&(t.dump="&ref_"+h+t.dump)):(kF(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?tE(t,e-1,t.dump,i):tE(t,e,t.dump,i),d&&(t.dump="&ref_"+h+t.dump)):(TF(t,e,t.dump),d&&(t.dump="&ref_"+h+" "+t.dump));else if(a==="[object String]")t.tag!=="?"&&CF(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 IF(t,e){var r=[],n=[],i,s;for(kh(t,r,n),i=0,s=n.length;i<s;i+=1)e.duplicates.push(r[n[i]]);e.usedDuplicates=new Array(s)}function kh(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)kh(t[i],e,r);else for(n=Object.keys(t),i=0,s=n.length;i<s;i+=1)kh(t[n[i]],e,r)}function LF(t,e){e=e||{};var r=new EF(e);r.noRefs||IF(t,r);var n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),$r(r,0,n,!0,!0)?r.dump+`
|
|
92
|
-
`:""}var NF=LF,DF={dump:NF};function Dh(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 kK=gE.load,PK=gE.loadAll,IK=DF.dump;var LK=Dh("safeLoad","load"),NK=Dh("safeLoadAll","loadAll"),DK=Dh("safeDump","dump");var N$=le(p1()),D$=le(require("json5"));var we={};AL(we,{bold:()=>A$,dimmed:()=>R$,error:()=>Ru,grey:()=>O$,info:()=>S$,item:()=>T$,log:()=>Wr,turboBlue:()=>ys,turboGradient:()=>x$,turboLoader:()=>DA,turboRed:()=>LA,underline:()=>C$,warn:()=>MA,yellow:()=>NA});l();var St=le(Zc()),TA=le(tA()),kA=le(OA()),PA="#0099F7",IA="#F11712",w$="#FFFF00",tm=t=>{let e=k$(t);return r=>`\x1B[38;5;${e}m${r}${(0,St.reset)("")}`},x$=(0,kA.default)(PA,IA),ys=tm(PA),LA=tm(IA),NA=tm(w$),DA=t=>(0,TA.default)({text:t,spinner:{frames:[" ",ys("> "),ys(">> "),ys(">>>")]}}),S$=(...t)=>{Wr(ys((0,St.bold)(">>>")),t.join(" "))},A$=(...t)=>{Wr((0,St.bold)(t.join(" ")))},C$=(...t)=>{Wr((0,St.underline)(t.join(" ")))},R$=(...t)=>{Wr((0,St.dim)(t.join(" ")))},O$=(...t)=>{Wr((0,St.gray)(t.join(" ")))},T$=(...t)=>{Wr(ys((0,St.bold)(" \u2022")),t.join(" "))},Wr=(...t)=>{console.log(...t)},MA=(...t)=>{console.error(NA((0,St.bold)(">>>")),t.join(" "))},Ru=(...t)=>{console.error(LA((0,St.bold)(">>>")),t.join(" "))};function k$(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 OU=le(require("os")),TU=le(uR());l();l();var kU=le(require("path"));l();var IP=require("stream"),LP=require("util"),p7=require("path"),m7=require("os"),NP=require("fs"),g7=le(a2());var Pee=(0,LP.promisify)(IP.Stream.pipeline);l();l();var C7=le(require("path")),R7=le(HP());l();l();var oW=le(OI());l();var KI=le(Zc());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 v0;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(v0||(v0={}));var W=me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Gn=t=>{switch(typeof t){case"undefined":return W.undefined;case"string":return W.string;case"number":return isNaN(t)?W.nan:W.number;case"boolean":return W.boolean;case"function":return W.function;case"bigint":return W.bigint;case"symbol":return W.symbol;case"object":return Array.isArray(t)?W.array:t===null?W.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?W.promise:typeof Map<"u"&&t instanceof Map?W.map:typeof Set<"u"&&t instanceof Set?W.set:typeof Date<"u"&&t instanceof Date?W.date:W.object;default:return W.unknown}},q=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"]),aW=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 ja=(t,e)=>{let r;switch(t.code){case q.invalid_type:t.received===W.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case q.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,me.jsonStringifyReplacer)}`;break;case q.unrecognized_keys:r=`Unrecognized key(s) in object: ${me.joinValues(t.keys,", ")}`;break;case q.invalid_union:r="Invalid input";break;case q.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${me.joinValues(t.options)}`;break;case q.invalid_enum_value:r=`Invalid enum value. Expected ${me.joinValues(t.options)}, received '${t.received}'`;break;case q.invalid_arguments:r="Invalid function arguments";break;case q.invalid_return_type:r="Invalid function return type";break;case q.invalid_date:r="Invalid date";break;case q.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 q.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 q.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 q.custom:r="Invalid input";break;case q.invalid_intersection_types:r="Intersection results could not be merged";break;case q.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case q.not_finite:r="Number must be finite";break;default:r=e.defaultError,me.assertNever(t)}return{message:r}},PI=ja;function cW(t){PI=t}function yf(){return PI}var _f=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}},uW=[];function z(t,e){let r=_f({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,yf(),ja].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 ae;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 ae;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}}},ae=Object.freeze({status:"aborted"}),II=t=>({status:"dirty",value:t}),_t=t=>({status:"valid",value:t}),b0=t=>t.status==="aborted",E0=t=>t.status==="dirty",Ha=t=>t.status==="valid",vf=t=>typeof Promise<"u"&&t instanceof Promise,te;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(te||(te={}));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}},TI=(t,e)=>{if(Ha(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 ce(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 ue=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 Gn(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Gn(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:Gn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(vf(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:Gn(e)},s=this._parseSync({data:e,path:i.path,parent:i});return TI(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:Gn(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(vf(i)?i:Promise.resolve(i));return TI(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:q.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:ne.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return pr.create(this,this._def)}nullable(){return dn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jt.create(this,this._def)}promise(){return zn.create(this,this._def)}or(e){return Ti.create([this,e],this._def)}and(e){return ki.create(this,e,this._def)}transform(e){return new Ht({...ce(this._def),schema:this,typeName:ne.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Di({...ce(this._def),innerType:this,defaultValue:r,typeName:ne.ZodDefault})}brand(){return new bf({typeName:ne.ZodBranded,type:this,...ce(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new fo({...ce(this._def),innerType:this,catchValue:r,typeName:ne.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Mi.create(this,e)}readonly(){return po.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},lW=/^c[^\s-]{8,}$/i,fW=/^[a-z][a-z0-9]*$/,hW=/^[0-9A-HJKMNP-TV-Z]{26}$/,dW=/^[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,pW=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,mW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",_0,gW=/^(((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}))$/,yW=/^(([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})))$/,_W=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 vW(t,e){return!!((e==="v4"||!e)&&gW.test(t)||(e==="v6"||!e)&&yW.test(t))}var qt=class extends ue{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==W.string){let s=this._getOrReturnCtx(e);return z(s,{code:q.invalid_type,expected:W.string,received:s.parsedType}),ae}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),z(i,{code:q.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),z(i,{code:q.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?z(i,{code:q.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&z(i,{code:q.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")pW.test(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{validation:"email",code:q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")_0||(_0=new RegExp(mW,"u")),_0.test(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{validation:"emoji",code:q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")dW.test(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{validation:"uuid",code:q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")lW.test(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{validation:"cuid",code:q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")fW.test(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{validation:"cuid2",code:q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")hW.test(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{validation:"ulid",code:q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),z(i,{validation:"url",code:q.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),z(i,{validation:"regex",code:q.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),z(i,{code:q.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),z(i,{code:q.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),z(i,{code:q.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?_W(s).test(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{code:q.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?vW(e.data,s.version)||(i=this._getOrReturnCtx(e,i),z(i,{validation:"ip",code:q.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:q.invalid_string,...te.errToObj(n)})}_addCheck(e){return new qt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...te.errToObj(e)})}url(e){return this._addCheck({kind:"url",...te.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...te.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...te.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...te.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...te.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...te.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...te.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,...te.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...te.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...te.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...te.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...te.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...te.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...te.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...te.errToObj(r)})}nonempty(e){return this.min(1,te.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:ne.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ce(t)})};function bW(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 Lr=class extends ue{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)!==W.number){let s=this._getOrReturnCtx(e);return z(s,{code:q.invalid_type,expected:W.number,received:s.parsedType}),ae}let n,i=new Xe;for(let s of this._def.checks)s.kind==="int"?me.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),z(n,{code:q.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),z(n,{code:q.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),z(n,{code:q.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?bW(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),z(n,{code:q.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),z(n,{code:q.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,te.toString(r))}gt(e,r){return this.setLimit("min",e,!1,te.toString(r))}lte(e,r){return this.setLimit("max",e,!0,te.toString(r))}lt(e,r){return this.setLimit("max",e,!1,te.toString(r))}setLimit(e,r,n,i){return new Lr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:te.toString(i)}]})}_addCheck(e){return new Lr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:te.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:te.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:te.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:te.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:te.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:te.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)}};Lr.create=t=>new Lr({checks:[],typeName:ne.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...ce(t)});var Nr=class extends ue{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)!==W.bigint){let s=this._getOrReturnCtx(e);return z(s,{code:q.invalid_type,expected:W.bigint,received:s.parsedType}),ae}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),z(n,{code:q.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),z(n,{code:q.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),z(n,{code:q.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,te.toString(r))}gt(e,r){return this.setLimit("min",e,!1,te.toString(r))}lte(e,r){return this.setLimit("max",e,!0,te.toString(r))}lt(e,r){return this.setLimit("max",e,!1,te.toString(r))}setLimit(e,r,n,i){return new Nr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:te.toString(i)}]})}_addCheck(e){return new Nr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:te.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:te.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}};Nr.create=t=>{var e;return new Nr({checks:[],typeName:ne.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ce(t)})};var Ci=class extends ue{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==W.boolean){let n=this._getOrReturnCtx(e);return z(n,{code:q.invalid_type,expected:W.boolean,received:n.parsedType}),ae}return _t(e.data)}};Ci.create=t=>new Ci({typeName:ne.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...ce(t)});var fn=class extends ue{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==W.date){let s=this._getOrReturnCtx(e);return z(s,{code:q.invalid_type,expected:W.date,received:s.parsedType}),ae}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return z(s,{code:q.invalid_date}),ae}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),z(i,{code:q.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),z(i,{code:q.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 fn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:te.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:te.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}};fn.create=t=>new fn({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ne.ZodDate,...ce(t)});var ao=class extends ue{_parse(e){if(this._getType(e)!==W.symbol){let n=this._getOrReturnCtx(e);return z(n,{code:q.invalid_type,expected:W.symbol,received:n.parsedType}),ae}return _t(e.data)}};ao.create=t=>new ao({typeName:ne.ZodSymbol,...ce(t)});var Ri=class extends ue{_parse(e){if(this._getType(e)!==W.undefined){let n=this._getOrReturnCtx(e);return z(n,{code:q.invalid_type,expected:W.undefined,received:n.parsedType}),ae}return _t(e.data)}};Ri.create=t=>new Ri({typeName:ne.ZodUndefined,...ce(t)});var Oi=class extends ue{_parse(e){if(this._getType(e)!==W.null){let n=this._getOrReturnCtx(e);return z(n,{code:q.invalid_type,expected:W.null,received:n.parsedType}),ae}return _t(e.data)}};Oi.create=t=>new Oi({typeName:ne.ZodNull,...ce(t)});var Wn=class extends ue{constructor(){super(...arguments),this._any=!0}_parse(e){return _t(e.data)}};Wn.create=t=>new Wn({typeName:ne.ZodAny,...ce(t)});var ln=class extends ue{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _t(e.data)}};ln.create=t=>new ln({typeName:ne.ZodUnknown,...ce(t)});var mr=class extends ue{_parse(e){let r=this._getOrReturnCtx(e);return z(r,{code:q.invalid_type,expected:W.never,received:r.parsedType}),ae}};mr.create=t=>new mr({typeName:ne.ZodNever,...ce(t)});var co=class extends ue{_parse(e){if(this._getType(e)!==W.undefined){let n=this._getOrReturnCtx(e);return z(n,{code:q.invalid_type,expected:W.void,received:n.parsedType}),ae}return _t(e.data)}};co.create=t=>new co({typeName:ne.ZodVoid,...ce(t)});var jt=class extends ue{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==W.array)return z(r,{code:q.invalid_type,expected:W.array,received:r.parsedType}),ae;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(o||a)&&(z(r,{code:o?q.too_big:q.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&&(z(r,{code:q.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&&(z(r,{code:q.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:te.toString(r)}})}max(e,r){return new jt({...this._def,maxLength:{value:e,message:te.toString(r)}})}length(e,r){return new jt({...this._def,exactLength:{value:e,message:te.toString(r)}})}nonempty(e){return this.min(1,e)}};jt.create=(t,e)=>new jt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ne.ZodArray,...ce(e)});function oo(t){if(t instanceof Te){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=pr.create(oo(n))}return new Te({...t._def,shape:()=>e})}else return t instanceof jt?new jt({...t._def,type:oo(t.element)}):t instanceof pr?pr.create(oo(t.unwrap())):t instanceof dn?dn.create(oo(t.unwrap())):t instanceof sr?sr.create(t.items.map(e=>oo(e))):t}var Te=class extends ue{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)!==W.object){let u=this._getOrReturnCtx(e);return z(u,{code:q.invalid_type,expected:W.object,received:u.parsedType}),ae}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&&(z(i,{code:q.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 te.errToObj,new Te({...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=te.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new Te({...this._def,unknownKeys:"strip"})}passthrough(){return new Te({...this._def,unknownKeys:"passthrough"})}extend(e){return new Te({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Te({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ne.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Te({...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 Te({...this._def,shape:()=>r})}omit(e){let r={};return me.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new Te({...this._def,shape:()=>r})}deepPartial(){return oo(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 Te({...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 Te({...this._def,shape:()=>r})}keyof(){return LI(me.objectKeys(this.shape))}};Te.create=(t,e)=>new Te({shape:()=>t,unknownKeys:"strip",catchall:mr.create(),typeName:ne.ZodObject,...ce(e)});Te.strictCreate=(t,e)=>new Te({shape:()=>t,unknownKeys:"strict",catchall:mr.create(),typeName:ne.ZodObject,...ce(e)});Te.lazycreate=(t,e)=>new Te({shape:t,unknownKeys:"strip",catchall:mr.create(),typeName:ne.ZodObject,...ce(e)});var Ti=class extends ue{_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 z(r,{code:q.invalid_union,unionErrors:o}),ae}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 z(r,{code:q.invalid_union,unionErrors:a}),ae}}get options(){return this._def.options}};Ti.create=(t,e)=>new Ti({options:t,typeName:ne.ZodUnion,...ce(e)});var gf=t=>t instanceof Ii?gf(t.schema):t instanceof Ht?gf(t.innerType()):t instanceof Li?[t.value]:t instanceof Dr?t.options:t instanceof Ni?Object.keys(t.enum):t instanceof Di?gf(t._def.innerType):t instanceof Ri?[void 0]:t instanceof Oi?[null]:null,uo=class extends ue{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==W.object)return z(r,{code:q.invalid_type,expected:W.object,received:r.parsedType}),ae;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}):(z(r,{code:q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ae)}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=gf(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 uo({typeName:ne.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...ce(n)})}};function w0(t,e){let r=Gn(t),n=Gn(e);if(t===e)return{valid:!0,data:t};if(r===W.object&&n===W.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=w0(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(r===W.array&&n===W.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=w0(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===W.date&&n===W.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ki=class extends ue{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,o)=>{if(b0(s)||b0(o))return ae;let a=w0(s.value,o.value);return a.valid?((E0(s)||E0(o))&&r.dirty(),{status:r.value,value:a.data}):(z(n,{code:q.invalid_intersection_types}),ae)};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}))}};ki.create=(t,e,r)=>new ki({left:t,right:e,typeName:ne.ZodIntersection,...ce(r)});var sr=class extends ue{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==W.array)return z(n,{code:q.invalid_type,expected:W.array,received:n.parsedType}),ae;if(n.data.length<this._def.items.length)return z(n,{code:q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ae;!this._def.rest&&n.data.length>this._def.items.length&&(z(n,{code:q.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:ne.ZodTuple,rest:null,...ce(e)})};var Pi=class extends ue{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!==W.object)return z(n,{code:q.invalid_type,expected:W.object,received:n.parsedType}),ae;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 ue?new Pi({keyType:e,valueType:r,typeName:ne.ZodRecord,...ce(n)}):new Pi({keyType:qt.create(),valueType:e,typeName:ne.ZodRecord,...ce(r)})}},lo=class extends ue{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!==W.map)return z(n,{code:q.invalid_type,expected:W.map,received:n.parsedType}),ae;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 ae;(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 ae;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(u.value,f.value)}return{status:r.value,value:a}}}};lo.create=(t,e,r)=>new lo({valueType:e,keyType:t,typeName:ne.ZodMap,...ce(r)});var hn=class extends ue{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==W.set)return z(n,{code:q.invalid_type,expected:W.set,received:n.parsedType}),ae;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(z(n,{code:q.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&&(z(n,{code:q.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 ae;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 hn({...this._def,minSize:{value:e,message:te.toString(r)}})}max(e,r){return new hn({...this._def,maxSize:{value:e,message:te.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};hn.create=(t,e)=>new hn({valueType:t,minSize:null,maxSize:null,typeName:ne.ZodSet,...ce(e)});var Vn=class extends ue{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==W.function)return z(r,{code:q.invalid_type,expected:W.function,received:r.parsedType}),ae;function n(a,c){return _f({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,yf(),ja].filter(u=>!!u),issueData:{code:q.invalid_arguments,argumentsError:c}})}function i(a,c){return _f({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,yf(),ja].filter(u=>!!u),issueData:{code:q.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof zn){let a=this;return _t(async function(...c){let u=new Bt([]),f=await a._def.args.parseAsync(c,s).catch(m=>{throw u.addIssue(n(c,m)),u}),h=await Reflect.apply(o,this,f);return await a._def.returns._def.type.parseAsync(h,s).catch(m=>{throw u.addIssue(i(h,m)),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 Vn({...this._def,args:sr.create(e).rest(ln.create())})}returns(e){return new Vn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Vn({args:e||sr.create([]).rest(ln.create()),returns:r||ln.create(),typeName:ne.ZodFunction,...ce(n)})}},Ii=class extends ue{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})}};Ii.create=(t,e)=>new Ii({getter:t,typeName:ne.ZodLazy,...ce(e)});var Li=class extends ue{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return z(r,{received:r.data,code:q.invalid_literal,expected:this._def.value}),ae}return{status:"valid",value:e.data}}get value(){return this._def.value}};Li.create=(t,e)=>new Li({value:t,typeName:ne.ZodLiteral,...ce(e)});function LI(t,e){return new Dr({values:t,typeName:ne.ZodEnum,...ce(e)})}var Dr=class extends ue{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return z(r,{expected:me.joinValues(n),received:r.parsedType,code:q.invalid_type}),ae}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return z(r,{received:r.data,code:q.invalid_enum_value,options:n}),ae}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 Dr.create(e)}exclude(e){return Dr.create(this.options.filter(r=>!e.includes(r)))}};Dr.create=LI;var Ni=class extends ue{_parse(e){let r=me.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==W.string&&n.parsedType!==W.number){let i=me.objectValues(r);return z(n,{expected:me.joinValues(i),received:n.parsedType,code:q.invalid_type}),ae}if(r.indexOf(e.data)===-1){let i=me.objectValues(r);return z(n,{received:n.data,code:q.invalid_enum_value,options:i}),ae}return _t(e.data)}get enum(){return this._def.values}};Ni.create=(t,e)=>new Ni({values:t,typeName:ne.ZodNativeEnum,...ce(e)});var zn=class extends ue{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==W.promise&&r.common.async===!1)return z(r,{code:q.invalid_type,expected:W.promise,received:r.parsedType}),ae;let n=r.parsedType===W.promise?r.data:Promise.resolve(r.data);return _t(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};zn.create=(t,e)=>new zn({type:t,typeName:ne.ZodPromise,...ce(e)});var Ht=class extends ue{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ne.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=>{z(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"?ae:(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"?ae:(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(!Ha(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=>Ha(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:ne.ZodEffects,effect:e,...ce(r)});Ht.createWithPreprocess=(t,e,r)=>new Ht({schema:e,effect:{type:"preprocess",transform:t},typeName:ne.ZodEffects,...ce(r)});var pr=class extends ue{_parse(e){return this._getType(e)===W.undefined?_t(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};pr.create=(t,e)=>new pr({innerType:t,typeName:ne.ZodOptional,...ce(e)});var dn=class extends ue{_parse(e){return this._getType(e)===W.null?_t(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};dn.create=(t,e)=>new dn({innerType:t,typeName:ne.ZodNullable,...ce(e)});var Di=class extends ue{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===W.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Di.create=(t,e)=>new Di({innerType:t,typeName:ne.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ce(e)});var fo=class extends ue{_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 vf(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}};fo.create=(t,e)=>new fo({innerType:t,typeName:ne.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ce(e)});var ho=class extends ue{_parse(e){if(this._getType(e)!==W.nan){let n=this._getOrReturnCtx(e);return z(n,{code:q.invalid_type,expected:W.nan,received:n.parsedType}),ae}return{status:"valid",value:e.data}}};ho.create=t=>new ho({typeName:ne.ZodNaN,...ce(t)});var EW=Symbol("zod_brand"),bf=class extends ue{_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}},Mi=class extends ue{_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"?ae:s.status==="dirty"?(r.dirty(),II(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"?ae: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 Mi({in:e,out:r,typeName:ne.ZodPipeline})}},po=class extends ue{_parse(e){let r=this._def.innerType._parse(e);return Ha(r)&&(r.value=Object.freeze(r.value)),r}};po.create=(t,e)=>new po({innerType:t,typeName:ne.ZodReadonly,...ce(e)});var NI=(t,e={},r)=>t?Wn.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})}}):Wn.create(),wW={object:Te.lazycreate},ne;(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"})(ne||(ne={}));var xW=(t,e={message:`Input not instance of ${t.name}`})=>NI(r=>r instanceof t,e),DI=qt.create,MI=Lr.create,SW=ho.create,AW=Nr.create,FI=Ci.create,CW=fn.create,RW=ao.create,OW=Ri.create,TW=Oi.create,kW=Wn.create,PW=ln.create,IW=mr.create,LW=co.create,NW=jt.create,DW=Te.create,MW=Te.strictCreate,FW=Ti.create,qW=uo.create,BW=ki.create,jW=sr.create,HW=Pi.create,$W=lo.create,UW=hn.create,GW=Vn.create,VW=Ii.create,WW=Li.create,zW=Dr.create,YW=Ni.create,KW=zn.create,kI=Ht.create,ZW=pr.create,JW=dn.create,XW=Ht.createWithPreprocess,QW=Mi.create,ez=()=>DI().optional(),tz=()=>MI().optional(),rz=()=>FI().optional(),nz={string:t=>qt.create({...t,coerce:!0}),number:t=>Lr.create({...t,coerce:!0}),boolean:t=>Ci.create({...t,coerce:!0}),bigint:t=>Nr.create({...t,coerce:!0}),date:t=>fn.create({...t,coerce:!0})},iz=ae,mo=Object.freeze({__proto__:null,defaultErrorMap:ja,setErrorMap:cW,getErrorMap:yf,makeIssue:_f,EMPTY_PATH:uW,addIssueToContext:z,ParseStatus:Xe,INVALID:ae,DIRTY:II,OK:_t,isAborted:b0,isDirty:E0,isValid:Ha,isAsync:vf,get util(){return me},get objectUtil(){return v0},ZodParsedType:W,getParsedType:Gn,ZodType:ue,ZodString:qt,ZodNumber:Lr,ZodBigInt:Nr,ZodBoolean:Ci,ZodDate:fn,ZodSymbol:ao,ZodUndefined:Ri,ZodNull:Oi,ZodAny:Wn,ZodUnknown:ln,ZodNever:mr,ZodVoid:co,ZodArray:jt,ZodObject:Te,ZodUnion:Ti,ZodDiscriminatedUnion:uo,ZodIntersection:ki,ZodTuple:sr,ZodRecord:Pi,ZodMap:lo,ZodSet:hn,ZodFunction:Vn,ZodLazy:Ii,ZodLiteral:Li,ZodEnum:Dr,ZodNativeEnum:Ni,ZodPromise:zn,ZodEffects:Ht,ZodTransformer:Ht,ZodOptional:pr,ZodNullable:dn,ZodDefault:Di,ZodCatch:fo,ZodNaN:ho,BRAND:EW,ZodBranded:bf,ZodPipeline:Mi,ZodReadonly:po,custom:NI,Schema:ue,ZodSchema:ue,late:wW,get ZodFirstPartyTypeKind(){return ne},coerce:nz,any:kW,array:NW,bigint:AW,boolean:FI,date:CW,discriminatedUnion:qW,effect:kI,enum:zW,function:GW,instanceof:xW,intersection:BW,lazy:VW,literal:WW,map:$W,nan:SW,nativeEnum:YW,never:IW,null:TW,nullable:JW,number:MI,object:DW,oboolean:rz,onumber:tz,optional:ZW,ostring:ez,pipeline:QW,preprocess:XW,promise:KW,record:HW,set:UW,strictObject:MW,string:DI,symbol:RW,transformer:kI,tuple:jW,undefined:OW,union:FW,unknown:PW,void:LW,NEVER:iz,ZodIssueCode:q,quotelessJson:aW,ZodError:Bt});l();var O0=le(require("os")),WI=le(require("crypto")),zI=le(require("path")),YI=le(VI());function pz(t){let e=process.version,r=O0.default.type(),n=O0.default.arch();return`${t.name} ${t.version} ${e} ${r} ${n}`}async function mz(){let t=process.env.TURBO_CONFIG_DIR_PATH?process.env.TURBO_CONFIG_DIR_PATH:await(0,YI.configDir)();if(!t)throw new Error("Could not find telemetry config directory");return zI.default.join(t,"turborepo","telemetry.json")}function gz({input:t,salt:e}){return WI.default.createHash("sha256").update(`${e}${t}`).digest("hex")}var go={buildUserAgent:pz,oneWayHashWithSalt:gz,defaultConfigPath:mz};var yz="TURBO_TELEMETRY_DEBUG",_z="TURBO_TELEMETRY_DISABLED",vz="TURBO_TELEMETRY_MESSAGE_DISABLED",bz="DO_NOT_TRACK",Ez=mo.object({telemetry_enabled:mo.boolean(),telemetry_id:mo.string(),telemetry_salt:mo.string(),telemetry_alerted:mo.string().optional()}),Tt=class{constructor({configPath:e,config:r}){this.config=r,this.configPath=e}static fromConfigPath(e){try{let r=(0,yo.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 go.defaultConfigPath();return Tt.fromConfigPath(e)}catch{return}}static validateConfig(e){try{return Ez.parse(e)}catch{throw new Error("Config is invalid.")}}static create({configPath:e}){let r=(0,T0.randomUUID)(),n=(0,T0.randomUUID)(),i=go.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,yo.writeFileSync)(this.configPath,e),!0}catch{return!1}}static tryRemove({configPath:e}){try{return(0,yo.rmSync)(e,{force:!0}),!0}catch{return!1}}hasSeenAlert(){return this.config.telemetry_alerted!==void 0}isEnabled(){let e=process.env[bz]||"0",r=process.env[_z]||"0";return e==="1"||e.toLowerCase()==="true"||r==="1"||r.toLowerCase()==="true"?!1:this.config.telemetry_enabled}isTelemetryWarningEnabled(){let e=process.env[vz]||"0";return!(e==="1"||e.toLowerCase()==="true")}get id(){return this.config.telemetry_id}showAlert(){!this.hasSeenAlert()&&this.isEnabled()&&this.isTelemetryWarningEnabled()&&(we.log(),we.bold("Attention:"),we.grey("Turborepo now collects completely anonymous telemetry regarding usage."),we.grey("This information is used to shape the Turborepo roadmap and prioritize features."),we.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:"),we.underline(KI.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 go.oneWayHashWithSalt({input:e,salt:this.config.telemetry_salt})}static isDebug(){let e=process.env[yz]||"0";return e==="1"||e.toLowerCase()==="true"}};l();l();var k0=require("crypto"),ZI=le(PP());var wz=20,xz="/api/turborepo/v1/events",Fi=class{constructor({api:e,packageInfo:r,config:n,opts:i}){this.batchSize=wz;this.timeout=250;this.sessionId=(0,k0.randomUUID)();this.eventBatches=[];this.events=[];let s=new URL(xz,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(ZI.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":go.buildUserAgent(this.packageInfo)}}))}track({key:e,value:r,parentId:n,isSensitive:i}){let s={id:(0,k0.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()&&(we.log(),we.bold("[telemetry event]"),we.dimmed(JSON.stringify(s,null,2)),we.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 $a=class extends Fi{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 tL=le(eL());var Az=["build","test","lint","typecheck","checktypes","check-types","type-check","check"],Ua=class extends Fi{trackCI(){var e;return this.track({key:"ci",value:(e=tL.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:Az.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 Cz={"create-turbo":$a,"turbo-ignore":Ua},Rz="https://telemetry.vercel.com";async function P0({packageInfo:t,opts:e}){let r=Cz[t.name],n=await Tt.fromDefaultConfig();return n?(n.showAlert(),{telemetry:new r({api:Rz,packageInfo:t,config:n,opts:e})}):{telemetry:void 0}}l();var Ga=le(Zc());var rL="status",Oz=["enable","disable",rL];function Tz(t){var r;let e=(r=t.telemetry)==null?void 0:r.config.isEnabled();we.log(`Status: ${e?Ga.default.bold(Ga.default.green("Enabled")):Ga.default.bold(Ga.default.red("Disabled"))}`),we.log(),e?we.log("Turborepo telemetry is completely anonymous. Thank you for participating!"):we.log("You have opted-out of Turborepo anonymous telemetry. No data will be collected from your machine."),we.log("Learn more: https://turborepo.com/docs/telemetry")}function kz(t,e){if(!e.telemetry){we.error("Telemetry could not be initialized");return}t==="enable"?(e.telemetry.config.enable(),we.bold("Success!")):t==="disable"&&(e.telemetry.config.disable(),we.bold("Success!")),we.log(),Tz(e)}function I0(t){t.command("telemetry").description("Manage telemetry settings").addArgument(new r_("[action]","Action to perform").choices(Oz).default(rL)).action(kz)}var wf={name:"turbo-ignore",version:"2.7.0",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.4",commander:"11.0.0",jest:"29.7.0","ts-jest":"29.2.5",tsup:"5.12.9",typescript:"5.5.4"}};l();var mL=require("child_process"),gL=le(require("path")),yL=require("fs");l();var nL=require("child_process");l();var L0="\u226B ";function Se(...t){console.log(L0,...t)}function or(...t){console.error(L0,...t)}function Va(...t){console.warn(L0,...t)}function N0(...t){console.log(...t)}function Iz(t){try{return(0,nL.execFileSync)("git",["cat-file","-t",t],{stdio:"ignore"}),!0}catch{return!1}}function D0(t){return t.fallback?(Se(`Falling back to ref ${t.fallback}`),{ref:t.fallback,type:"customFallback"}):null}function iL(t){let{workspace:e}=t;return process.env.VERCEL==="1"?process.env.VERCEL_GIT_PREVIOUS_SHA?Iz(process.env.VERCEL_GIT_PREVIOUS_SHA)?(Se(`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"}):(Se(`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.`),D0(t)):(Se(`No previous deployments found for "${e}"${process.env.VERCEL_GIT_COMMIT_REF?` on branch "${process.env.VERCEL_GIT_COMMIT_REF}"`:""}`),D0(t)):t.fallback?D0(t):{ref:"HEAD^",type:"headRelative"}}l();function sL(t){return t.task?(Se(`Using "${t.task}" as the task from the arguments`),t.task):(Se('Using "build" as the task as it was unspecified'),"build")}l();var oL=le(require("fs")),aL=le(require("path"));function cL(t){let{directory:e=process.cwd(),workspace:r}=t;if(r)return Se(`Using "${r}" as workspace from arguments`),r;let n=aL.default.join(e,"package.json");try{let i=oL.default.readFileSync(n,"utf8"),s=JSON.parse(i);return s.name?(Se(`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 M0=le(require("fs")),F0=le(require("path")),uL=require("json5");function lL(t,e){var s,o;let{turboVersion:r}=t;if(r)return Se(`Using turbo version "${r}" from arguments`),r;let n=F0.default.join(e,"package.json");try{let a=M0.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 Se(`Inferred turbo version "${r}" from "package.json"`),r;Va("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=F0.default.join(e,"turbo.json");try{let a=M0.default.readFileSync(i,"utf8"),c=(0,uL.parse)(a);return"tasks"in c?(Se('Inferred turbo version ^2 based on "tasks" in "turbo.json"'),"^2"):"pipeline"in c?(Se('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 q0={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 fL({err:t}){let e=Object.keys(q0).find(r=>{let{regex:n}=q0[r];return n.some(i=>i.test(t))});return e?{level:"warn",message:q0[e].message,code:e}:{level:"error",message:t,code:"UNKNOWN_ERROR"}}l();var hL=require("child_process"),Lz=["[skip ci]","[ci skip]","[no ci]","[skip vercel]","[vercel skip]"],Nz=["[vercel deploy]","[vercel build]"];function Dz({workspace:t}){return[`[vercel skip ${t}]`]}function Mz({workspace:t}){return[`[vercel deploy ${t}]`,`[vercel build ${t}]`]}var Fz=/\[vercel only .+\]/;function qz({workspace:t}){return[`[vercel only ${t}]`]}function Bz(){return process.env.VERCEL==="1"&&process.env.VERCEL_GIT_COMMIT_MESSAGE?process.env.VERCEL_GIT_COMMIT_MESSAGE:(0,hL.execSync)("git show -s --format=%B").toString()}function dL({workspace:t}){var c;let e=Bz(),r=u=>e.includes(u),n=(c=Fz.exec(e))==null?void 0:c[0];if(n)return qz({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=Mz({workspace:t}).find(r),s=Dz({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=Nz.find(r),a=Lz.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 jz(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 pL(){return N0("\u23ED Ignoring the change"),process.exit(0)}function Fr(){return N0("\u2713 Proceeding with deployment"),process.exit(1)}function _L(t,e){var v,E;(v=e.telemetry)==null||v.trackCommandStatus({command:"ignore",status:"start"}),(E=e.telemetry)==null||E.trackArgumentWorkspace(t!==void 0),jz(e);let r={workspace:t,...e};if(Se(`Using Turborepo to determine if this project is affected by the commit...
|
|
92
|
+
`:""}var NF=LF,DF={dump:NF};function Dh(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 kK=gE.load,PK=gE.loadAll,IK=DF.dump;var LK=Dh("safeLoad","load"),NK=Dh("safeLoadAll","loadAll"),DK=Dh("safeDump","dump");var N$=le(p1()),D$=le(require("json5"));var we={};AL(we,{bold:()=>A$,dimmed:()=>R$,error:()=>Ru,grey:()=>O$,info:()=>S$,item:()=>T$,log:()=>Wr,turboBlue:()=>ys,turboGradient:()=>x$,turboLoader:()=>DA,turboRed:()=>LA,underline:()=>C$,warn:()=>MA,yellow:()=>NA});l();var St=le(Zc()),TA=le(tA()),kA=le(OA()),PA="#0099F7",IA="#F11712",w$="#FFFF00",tm=t=>{let e=k$(t);return r=>`\x1B[38;5;${e}m${r}${(0,St.reset)("")}`},x$=(0,kA.default)(PA,IA),ys=tm(PA),LA=tm(IA),NA=tm(w$),DA=t=>(0,TA.default)({text:t,spinner:{frames:[" ",ys("> "),ys(">> "),ys(">>>")]}}),S$=(...t)=>{Wr(ys((0,St.bold)(">>>")),t.join(" "))},A$=(...t)=>{Wr((0,St.bold)(t.join(" ")))},C$=(...t)=>{Wr((0,St.underline)(t.join(" ")))},R$=(...t)=>{Wr((0,St.dim)(t.join(" ")))},O$=(...t)=>{Wr((0,St.gray)(t.join(" ")))},T$=(...t)=>{Wr(ys((0,St.bold)(" \u2022")),t.join(" "))},Wr=(...t)=>{console.log(...t)},MA=(...t)=>{console.error(NA((0,St.bold)(">>>")),t.join(" "))},Ru=(...t)=>{console.error(LA((0,St.bold)(">>>")),t.join(" "))};function k$(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 OU=le(require("os")),TU=le(uR());l();l();var kU=le(require("path"));l();var IP=require("stream"),LP=require("util"),p7=require("path"),m7=require("os"),NP=require("fs"),g7=le(a2());var Pee=(0,LP.promisify)(IP.Stream.pipeline);l();l();var C7=le(require("path")),R7=le(HP());l();l();var oW=le(OI());l();var KI=le(Zc());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 v0;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(v0||(v0={}));var W=me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Gn=t=>{switch(typeof t){case"undefined":return W.undefined;case"string":return W.string;case"number":return isNaN(t)?W.nan:W.number;case"boolean":return W.boolean;case"function":return W.function;case"bigint":return W.bigint;case"symbol":return W.symbol;case"object":return Array.isArray(t)?W.array:t===null?W.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?W.promise:typeof Map<"u"&&t instanceof Map?W.map:typeof Set<"u"&&t instanceof Set?W.set:typeof Date<"u"&&t instanceof Date?W.date:W.object;default:return W.unknown}},q=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"]),aW=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 ja=(t,e)=>{let r;switch(t.code){case q.invalid_type:t.received===W.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case q.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,me.jsonStringifyReplacer)}`;break;case q.unrecognized_keys:r=`Unrecognized key(s) in object: ${me.joinValues(t.keys,", ")}`;break;case q.invalid_union:r="Invalid input";break;case q.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${me.joinValues(t.options)}`;break;case q.invalid_enum_value:r=`Invalid enum value. Expected ${me.joinValues(t.options)}, received '${t.received}'`;break;case q.invalid_arguments:r="Invalid function arguments";break;case q.invalid_return_type:r="Invalid function return type";break;case q.invalid_date:r="Invalid date";break;case q.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 q.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 q.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 q.custom:r="Invalid input";break;case q.invalid_intersection_types:r="Intersection results could not be merged";break;case q.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case q.not_finite:r="Number must be finite";break;default:r=e.defaultError,me.assertNever(t)}return{message:r}},PI=ja;function cW(t){PI=t}function yf(){return PI}var _f=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}},uW=[];function z(t,e){let r=_f({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,yf(),ja].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 ae;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 ae;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}}},ae=Object.freeze({status:"aborted"}),II=t=>({status:"dirty",value:t}),_t=t=>({status:"valid",value:t}),b0=t=>t.status==="aborted",E0=t=>t.status==="dirty",Ha=t=>t.status==="valid",vf=t=>typeof Promise<"u"&&t instanceof Promise,te;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(te||(te={}));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}},TI=(t,e)=>{if(Ha(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 ce(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 ue=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 Gn(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Gn(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:Gn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(vf(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:Gn(e)},s=this._parseSync({data:e,path:i.path,parent:i});return TI(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:Gn(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(vf(i)?i:Promise.resolve(i));return TI(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:q.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:ne.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return pr.create(this,this._def)}nullable(){return dn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jt.create(this,this._def)}promise(){return zn.create(this,this._def)}or(e){return Ti.create([this,e],this._def)}and(e){return ki.create(this,e,this._def)}transform(e){return new Ht({...ce(this._def),schema:this,typeName:ne.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Di({...ce(this._def),innerType:this,defaultValue:r,typeName:ne.ZodDefault})}brand(){return new bf({typeName:ne.ZodBranded,type:this,...ce(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new fo({...ce(this._def),innerType:this,catchValue:r,typeName:ne.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Mi.create(this,e)}readonly(){return po.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},lW=/^c[^\s-]{8,}$/i,fW=/^[a-z][a-z0-9]*$/,hW=/^[0-9A-HJKMNP-TV-Z]{26}$/,dW=/^[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,pW=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,mW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",_0,gW=/^(((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}))$/,yW=/^(([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})))$/,_W=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 vW(t,e){return!!((e==="v4"||!e)&&gW.test(t)||(e==="v6"||!e)&&yW.test(t))}var qt=class extends ue{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==W.string){let s=this._getOrReturnCtx(e);return z(s,{code:q.invalid_type,expected:W.string,received:s.parsedType}),ae}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),z(i,{code:q.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),z(i,{code:q.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?z(i,{code:q.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&z(i,{code:q.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")pW.test(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{validation:"email",code:q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")_0||(_0=new RegExp(mW,"u")),_0.test(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{validation:"emoji",code:q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")dW.test(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{validation:"uuid",code:q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")lW.test(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{validation:"cuid",code:q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")fW.test(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{validation:"cuid2",code:q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")hW.test(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{validation:"ulid",code:q.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),z(i,{validation:"url",code:q.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),z(i,{validation:"regex",code:q.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),z(i,{code:q.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),z(i,{code:q.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),z(i,{code:q.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?_W(s).test(e.data)||(i=this._getOrReturnCtx(e,i),z(i,{code:q.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?vW(e.data,s.version)||(i=this._getOrReturnCtx(e,i),z(i,{validation:"ip",code:q.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:q.invalid_string,...te.errToObj(n)})}_addCheck(e){return new qt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...te.errToObj(e)})}url(e){return this._addCheck({kind:"url",...te.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...te.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...te.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...te.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...te.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...te.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...te.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,...te.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...te.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...te.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...te.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...te.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...te.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...te.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...te.errToObj(r)})}nonempty(e){return this.min(1,te.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:ne.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ce(t)})};function bW(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 Lr=class extends ue{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)!==W.number){let s=this._getOrReturnCtx(e);return z(s,{code:q.invalid_type,expected:W.number,received:s.parsedType}),ae}let n,i=new Xe;for(let s of this._def.checks)s.kind==="int"?me.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),z(n,{code:q.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),z(n,{code:q.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),z(n,{code:q.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?bW(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),z(n,{code:q.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),z(n,{code:q.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,te.toString(r))}gt(e,r){return this.setLimit("min",e,!1,te.toString(r))}lte(e,r){return this.setLimit("max",e,!0,te.toString(r))}lt(e,r){return this.setLimit("max",e,!1,te.toString(r))}setLimit(e,r,n,i){return new Lr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:te.toString(i)}]})}_addCheck(e){return new Lr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:te.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:te.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:te.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:te.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:te.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:te.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)}};Lr.create=t=>new Lr({checks:[],typeName:ne.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...ce(t)});var Nr=class extends ue{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)!==W.bigint){let s=this._getOrReturnCtx(e);return z(s,{code:q.invalid_type,expected:W.bigint,received:s.parsedType}),ae}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),z(n,{code:q.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),z(n,{code:q.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),z(n,{code:q.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,te.toString(r))}gt(e,r){return this.setLimit("min",e,!1,te.toString(r))}lte(e,r){return this.setLimit("max",e,!0,te.toString(r))}lt(e,r){return this.setLimit("max",e,!1,te.toString(r))}setLimit(e,r,n,i){return new Nr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:te.toString(i)}]})}_addCheck(e){return new Nr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:te.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:te.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}};Nr.create=t=>{var e;return new Nr({checks:[],typeName:ne.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ce(t)})};var Ci=class extends ue{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==W.boolean){let n=this._getOrReturnCtx(e);return z(n,{code:q.invalid_type,expected:W.boolean,received:n.parsedType}),ae}return _t(e.data)}};Ci.create=t=>new Ci({typeName:ne.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...ce(t)});var fn=class extends ue{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==W.date){let s=this._getOrReturnCtx(e);return z(s,{code:q.invalid_type,expected:W.date,received:s.parsedType}),ae}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return z(s,{code:q.invalid_date}),ae}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),z(i,{code:q.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),z(i,{code:q.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 fn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:te.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:te.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}};fn.create=t=>new fn({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ne.ZodDate,...ce(t)});var ao=class extends ue{_parse(e){if(this._getType(e)!==W.symbol){let n=this._getOrReturnCtx(e);return z(n,{code:q.invalid_type,expected:W.symbol,received:n.parsedType}),ae}return _t(e.data)}};ao.create=t=>new ao({typeName:ne.ZodSymbol,...ce(t)});var Ri=class extends ue{_parse(e){if(this._getType(e)!==W.undefined){let n=this._getOrReturnCtx(e);return z(n,{code:q.invalid_type,expected:W.undefined,received:n.parsedType}),ae}return _t(e.data)}};Ri.create=t=>new Ri({typeName:ne.ZodUndefined,...ce(t)});var Oi=class extends ue{_parse(e){if(this._getType(e)!==W.null){let n=this._getOrReturnCtx(e);return z(n,{code:q.invalid_type,expected:W.null,received:n.parsedType}),ae}return _t(e.data)}};Oi.create=t=>new Oi({typeName:ne.ZodNull,...ce(t)});var Wn=class extends ue{constructor(){super(...arguments),this._any=!0}_parse(e){return _t(e.data)}};Wn.create=t=>new Wn({typeName:ne.ZodAny,...ce(t)});var ln=class extends ue{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _t(e.data)}};ln.create=t=>new ln({typeName:ne.ZodUnknown,...ce(t)});var mr=class extends ue{_parse(e){let r=this._getOrReturnCtx(e);return z(r,{code:q.invalid_type,expected:W.never,received:r.parsedType}),ae}};mr.create=t=>new mr({typeName:ne.ZodNever,...ce(t)});var co=class extends ue{_parse(e){if(this._getType(e)!==W.undefined){let n=this._getOrReturnCtx(e);return z(n,{code:q.invalid_type,expected:W.void,received:n.parsedType}),ae}return _t(e.data)}};co.create=t=>new co({typeName:ne.ZodVoid,...ce(t)});var jt=class extends ue{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==W.array)return z(r,{code:q.invalid_type,expected:W.array,received:r.parsedType}),ae;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(o||a)&&(z(r,{code:o?q.too_big:q.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&&(z(r,{code:q.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&&(z(r,{code:q.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:te.toString(r)}})}max(e,r){return new jt({...this._def,maxLength:{value:e,message:te.toString(r)}})}length(e,r){return new jt({...this._def,exactLength:{value:e,message:te.toString(r)}})}nonempty(e){return this.min(1,e)}};jt.create=(t,e)=>new jt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ne.ZodArray,...ce(e)});function oo(t){if(t instanceof Te){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=pr.create(oo(n))}return new Te({...t._def,shape:()=>e})}else return t instanceof jt?new jt({...t._def,type:oo(t.element)}):t instanceof pr?pr.create(oo(t.unwrap())):t instanceof dn?dn.create(oo(t.unwrap())):t instanceof sr?sr.create(t.items.map(e=>oo(e))):t}var Te=class extends ue{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)!==W.object){let u=this._getOrReturnCtx(e);return z(u,{code:q.invalid_type,expected:W.object,received:u.parsedType}),ae}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&&(z(i,{code:q.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 te.errToObj,new Te({...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=te.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new Te({...this._def,unknownKeys:"strip"})}passthrough(){return new Te({...this._def,unknownKeys:"passthrough"})}extend(e){return new Te({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Te({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ne.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Te({...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 Te({...this._def,shape:()=>r})}omit(e){let r={};return me.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new Te({...this._def,shape:()=>r})}deepPartial(){return oo(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 Te({...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 Te({...this._def,shape:()=>r})}keyof(){return LI(me.objectKeys(this.shape))}};Te.create=(t,e)=>new Te({shape:()=>t,unknownKeys:"strip",catchall:mr.create(),typeName:ne.ZodObject,...ce(e)});Te.strictCreate=(t,e)=>new Te({shape:()=>t,unknownKeys:"strict",catchall:mr.create(),typeName:ne.ZodObject,...ce(e)});Te.lazycreate=(t,e)=>new Te({shape:t,unknownKeys:"strip",catchall:mr.create(),typeName:ne.ZodObject,...ce(e)});var Ti=class extends ue{_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 z(r,{code:q.invalid_union,unionErrors:o}),ae}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 z(r,{code:q.invalid_union,unionErrors:a}),ae}}get options(){return this._def.options}};Ti.create=(t,e)=>new Ti({options:t,typeName:ne.ZodUnion,...ce(e)});var gf=t=>t instanceof Ii?gf(t.schema):t instanceof Ht?gf(t.innerType()):t instanceof Li?[t.value]:t instanceof Dr?t.options:t instanceof Ni?Object.keys(t.enum):t instanceof Di?gf(t._def.innerType):t instanceof Ri?[void 0]:t instanceof Oi?[null]:null,uo=class extends ue{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==W.object)return z(r,{code:q.invalid_type,expected:W.object,received:r.parsedType}),ae;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}):(z(r,{code:q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ae)}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=gf(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 uo({typeName:ne.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...ce(n)})}};function w0(t,e){let r=Gn(t),n=Gn(e);if(t===e)return{valid:!0,data:t};if(r===W.object&&n===W.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=w0(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(r===W.array&&n===W.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=w0(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===W.date&&n===W.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ki=class extends ue{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,o)=>{if(b0(s)||b0(o))return ae;let a=w0(s.value,o.value);return a.valid?((E0(s)||E0(o))&&r.dirty(),{status:r.value,value:a.data}):(z(n,{code:q.invalid_intersection_types}),ae)};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}))}};ki.create=(t,e,r)=>new ki({left:t,right:e,typeName:ne.ZodIntersection,...ce(r)});var sr=class extends ue{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==W.array)return z(n,{code:q.invalid_type,expected:W.array,received:n.parsedType}),ae;if(n.data.length<this._def.items.length)return z(n,{code:q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ae;!this._def.rest&&n.data.length>this._def.items.length&&(z(n,{code:q.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:ne.ZodTuple,rest:null,...ce(e)})};var Pi=class extends ue{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!==W.object)return z(n,{code:q.invalid_type,expected:W.object,received:n.parsedType}),ae;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 ue?new Pi({keyType:e,valueType:r,typeName:ne.ZodRecord,...ce(n)}):new Pi({keyType:qt.create(),valueType:e,typeName:ne.ZodRecord,...ce(r)})}},lo=class extends ue{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!==W.map)return z(n,{code:q.invalid_type,expected:W.map,received:n.parsedType}),ae;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 ae;(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 ae;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(u.value,f.value)}return{status:r.value,value:a}}}};lo.create=(t,e,r)=>new lo({valueType:e,keyType:t,typeName:ne.ZodMap,...ce(r)});var hn=class extends ue{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==W.set)return z(n,{code:q.invalid_type,expected:W.set,received:n.parsedType}),ae;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(z(n,{code:q.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&&(z(n,{code:q.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 ae;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 hn({...this._def,minSize:{value:e,message:te.toString(r)}})}max(e,r){return new hn({...this._def,maxSize:{value:e,message:te.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};hn.create=(t,e)=>new hn({valueType:t,minSize:null,maxSize:null,typeName:ne.ZodSet,...ce(e)});var Vn=class extends ue{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==W.function)return z(r,{code:q.invalid_type,expected:W.function,received:r.parsedType}),ae;function n(a,c){return _f({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,yf(),ja].filter(u=>!!u),issueData:{code:q.invalid_arguments,argumentsError:c}})}function i(a,c){return _f({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,yf(),ja].filter(u=>!!u),issueData:{code:q.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof zn){let a=this;return _t(async function(...c){let u=new Bt([]),f=await a._def.args.parseAsync(c,s).catch(m=>{throw u.addIssue(n(c,m)),u}),h=await Reflect.apply(o,this,f);return await a._def.returns._def.type.parseAsync(h,s).catch(m=>{throw u.addIssue(i(h,m)),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 Vn({...this._def,args:sr.create(e).rest(ln.create())})}returns(e){return new Vn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Vn({args:e||sr.create([]).rest(ln.create()),returns:r||ln.create(),typeName:ne.ZodFunction,...ce(n)})}},Ii=class extends ue{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})}};Ii.create=(t,e)=>new Ii({getter:t,typeName:ne.ZodLazy,...ce(e)});var Li=class extends ue{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return z(r,{received:r.data,code:q.invalid_literal,expected:this._def.value}),ae}return{status:"valid",value:e.data}}get value(){return this._def.value}};Li.create=(t,e)=>new Li({value:t,typeName:ne.ZodLiteral,...ce(e)});function LI(t,e){return new Dr({values:t,typeName:ne.ZodEnum,...ce(e)})}var Dr=class extends ue{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return z(r,{expected:me.joinValues(n),received:r.parsedType,code:q.invalid_type}),ae}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return z(r,{received:r.data,code:q.invalid_enum_value,options:n}),ae}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 Dr.create(e)}exclude(e){return Dr.create(this.options.filter(r=>!e.includes(r)))}};Dr.create=LI;var Ni=class extends ue{_parse(e){let r=me.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==W.string&&n.parsedType!==W.number){let i=me.objectValues(r);return z(n,{expected:me.joinValues(i),received:n.parsedType,code:q.invalid_type}),ae}if(r.indexOf(e.data)===-1){let i=me.objectValues(r);return z(n,{received:n.data,code:q.invalid_enum_value,options:i}),ae}return _t(e.data)}get enum(){return this._def.values}};Ni.create=(t,e)=>new Ni({values:t,typeName:ne.ZodNativeEnum,...ce(e)});var zn=class extends ue{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==W.promise&&r.common.async===!1)return z(r,{code:q.invalid_type,expected:W.promise,received:r.parsedType}),ae;let n=r.parsedType===W.promise?r.data:Promise.resolve(r.data);return _t(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};zn.create=(t,e)=>new zn({type:t,typeName:ne.ZodPromise,...ce(e)});var Ht=class extends ue{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ne.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=>{z(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"?ae:(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"?ae:(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(!Ha(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=>Ha(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:ne.ZodEffects,effect:e,...ce(r)});Ht.createWithPreprocess=(t,e,r)=>new Ht({schema:e,effect:{type:"preprocess",transform:t},typeName:ne.ZodEffects,...ce(r)});var pr=class extends ue{_parse(e){return this._getType(e)===W.undefined?_t(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};pr.create=(t,e)=>new pr({innerType:t,typeName:ne.ZodOptional,...ce(e)});var dn=class extends ue{_parse(e){return this._getType(e)===W.null?_t(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};dn.create=(t,e)=>new dn({innerType:t,typeName:ne.ZodNullable,...ce(e)});var Di=class extends ue{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===W.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Di.create=(t,e)=>new Di({innerType:t,typeName:ne.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ce(e)});var fo=class extends ue{_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 vf(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}};fo.create=(t,e)=>new fo({innerType:t,typeName:ne.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ce(e)});var ho=class extends ue{_parse(e){if(this._getType(e)!==W.nan){let n=this._getOrReturnCtx(e);return z(n,{code:q.invalid_type,expected:W.nan,received:n.parsedType}),ae}return{status:"valid",value:e.data}}};ho.create=t=>new ho({typeName:ne.ZodNaN,...ce(t)});var EW=Symbol("zod_brand"),bf=class extends ue{_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}},Mi=class extends ue{_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"?ae:s.status==="dirty"?(r.dirty(),II(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"?ae: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 Mi({in:e,out:r,typeName:ne.ZodPipeline})}},po=class extends ue{_parse(e){let r=this._def.innerType._parse(e);return Ha(r)&&(r.value=Object.freeze(r.value)),r}};po.create=(t,e)=>new po({innerType:t,typeName:ne.ZodReadonly,...ce(e)});var NI=(t,e={},r)=>t?Wn.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})}}):Wn.create(),wW={object:Te.lazycreate},ne;(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"})(ne||(ne={}));var xW=(t,e={message:`Input not instance of ${t.name}`})=>NI(r=>r instanceof t,e),DI=qt.create,MI=Lr.create,SW=ho.create,AW=Nr.create,FI=Ci.create,CW=fn.create,RW=ao.create,OW=Ri.create,TW=Oi.create,kW=Wn.create,PW=ln.create,IW=mr.create,LW=co.create,NW=jt.create,DW=Te.create,MW=Te.strictCreate,FW=Ti.create,qW=uo.create,BW=ki.create,jW=sr.create,HW=Pi.create,$W=lo.create,UW=hn.create,GW=Vn.create,VW=Ii.create,WW=Li.create,zW=Dr.create,YW=Ni.create,KW=zn.create,kI=Ht.create,ZW=pr.create,JW=dn.create,XW=Ht.createWithPreprocess,QW=Mi.create,ez=()=>DI().optional(),tz=()=>MI().optional(),rz=()=>FI().optional(),nz={string:t=>qt.create({...t,coerce:!0}),number:t=>Lr.create({...t,coerce:!0}),boolean:t=>Ci.create({...t,coerce:!0}),bigint:t=>Nr.create({...t,coerce:!0}),date:t=>fn.create({...t,coerce:!0})},iz=ae,mo=Object.freeze({__proto__:null,defaultErrorMap:ja,setErrorMap:cW,getErrorMap:yf,makeIssue:_f,EMPTY_PATH:uW,addIssueToContext:z,ParseStatus:Xe,INVALID:ae,DIRTY:II,OK:_t,isAborted:b0,isDirty:E0,isValid:Ha,isAsync:vf,get util(){return me},get objectUtil(){return v0},ZodParsedType:W,getParsedType:Gn,ZodType:ue,ZodString:qt,ZodNumber:Lr,ZodBigInt:Nr,ZodBoolean:Ci,ZodDate:fn,ZodSymbol:ao,ZodUndefined:Ri,ZodNull:Oi,ZodAny:Wn,ZodUnknown:ln,ZodNever:mr,ZodVoid:co,ZodArray:jt,ZodObject:Te,ZodUnion:Ti,ZodDiscriminatedUnion:uo,ZodIntersection:ki,ZodTuple:sr,ZodRecord:Pi,ZodMap:lo,ZodSet:hn,ZodFunction:Vn,ZodLazy:Ii,ZodLiteral:Li,ZodEnum:Dr,ZodNativeEnum:Ni,ZodPromise:zn,ZodEffects:Ht,ZodTransformer:Ht,ZodOptional:pr,ZodNullable:dn,ZodDefault:Di,ZodCatch:fo,ZodNaN:ho,BRAND:EW,ZodBranded:bf,ZodPipeline:Mi,ZodReadonly:po,custom:NI,Schema:ue,ZodSchema:ue,late:wW,get ZodFirstPartyTypeKind(){return ne},coerce:nz,any:kW,array:NW,bigint:AW,boolean:FI,date:CW,discriminatedUnion:qW,effect:kI,enum:zW,function:GW,instanceof:xW,intersection:BW,lazy:VW,literal:WW,map:$W,nan:SW,nativeEnum:YW,never:IW,null:TW,nullable:JW,number:MI,object:DW,oboolean:rz,onumber:tz,optional:ZW,ostring:ez,pipeline:QW,preprocess:XW,promise:KW,record:HW,set:UW,strictObject:MW,string:DI,symbol:RW,transformer:kI,tuple:jW,undefined:OW,union:FW,unknown:PW,void:LW,NEVER:iz,ZodIssueCode:q,quotelessJson:aW,ZodError:Bt});l();var O0=le(require("os")),WI=le(require("crypto")),zI=le(require("path")),YI=le(VI());function pz(t){let e=process.version,r=O0.default.type(),n=O0.default.arch();return`${t.name} ${t.version} ${e} ${r} ${n}`}async function mz(){let t=process.env.TURBO_CONFIG_DIR_PATH?process.env.TURBO_CONFIG_DIR_PATH:await(0,YI.configDir)();if(!t)throw new Error("Could not find telemetry config directory");return zI.default.join(t,"turborepo","telemetry.json")}function gz({input:t,salt:e}){return WI.default.createHash("sha256").update(`${e}${t}`).digest("hex")}var go={buildUserAgent:pz,oneWayHashWithSalt:gz,defaultConfigPath:mz};var yz="TURBO_TELEMETRY_DEBUG",_z="TURBO_TELEMETRY_DISABLED",vz="TURBO_TELEMETRY_MESSAGE_DISABLED",bz="DO_NOT_TRACK",Ez=mo.object({telemetry_enabled:mo.boolean(),telemetry_id:mo.string(),telemetry_salt:mo.string(),telemetry_alerted:mo.string().optional()}),Tt=class{constructor({configPath:e,config:r}){this.config=r,this.configPath=e}static fromConfigPath(e){try{let r=(0,yo.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 go.defaultConfigPath();return Tt.fromConfigPath(e)}catch{return}}static validateConfig(e){try{return Ez.parse(e)}catch{throw new Error("Config is invalid.")}}static create({configPath:e}){let r=(0,T0.randomUUID)(),n=(0,T0.randomUUID)(),i=go.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,yo.writeFileSync)(this.configPath,e),!0}catch{return!1}}static tryRemove({configPath:e}){try{return(0,yo.rmSync)(e,{force:!0}),!0}catch{return!1}}hasSeenAlert(){return this.config.telemetry_alerted!==void 0}isEnabled(){let e=process.env[bz]||"0",r=process.env[_z]||"0";return e==="1"||e.toLowerCase()==="true"||r==="1"||r.toLowerCase()==="true"?!1:this.config.telemetry_enabled}isTelemetryWarningEnabled(){let e=process.env[vz]||"0";return!(e==="1"||e.toLowerCase()==="true")}get id(){return this.config.telemetry_id}showAlert(){!this.hasSeenAlert()&&this.isEnabled()&&this.isTelemetryWarningEnabled()&&(we.log(),we.bold("Attention:"),we.grey("Turborepo now collects completely anonymous telemetry regarding usage."),we.grey("This information is used to shape the Turborepo roadmap and prioritize features."),we.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:"),we.underline(KI.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 go.oneWayHashWithSalt({input:e,salt:this.config.telemetry_salt})}static isDebug(){let e=process.env[yz]||"0";return e==="1"||e.toLowerCase()==="true"}};l();l();var k0=require("crypto"),ZI=le(PP());var wz=20,xz="/api/turborepo/v1/events",Fi=class{constructor({api:e,packageInfo:r,config:n,opts:i}){this.batchSize=wz;this.timeout=250;this.sessionId=(0,k0.randomUUID)();this.eventBatches=[];this.events=[];let s=new URL(xz,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(ZI.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":go.buildUserAgent(this.packageInfo)}}))}track({key:e,value:r,parentId:n,isSensitive:i}){let s={id:(0,k0.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()&&(we.log(),we.bold("[telemetry event]"),we.dimmed(JSON.stringify(s,null,2)),we.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 $a=class extends Fi{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 tL=le(eL());var Az=["build","test","lint","typecheck","checktypes","check-types","type-check","check"],Ua=class extends Fi{trackCI(){var e;return this.track({key:"ci",value:(e=tL.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:Az.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 Cz={"create-turbo":$a,"turbo-ignore":Ua},Rz="https://telemetry.vercel.com";async function P0({packageInfo:t,opts:e}){let r=Cz[t.name],n=await Tt.fromDefaultConfig();return n?(n.showAlert(),{telemetry:new r({api:Rz,packageInfo:t,config:n,opts:e})}):{telemetry:void 0}}l();var Ga=le(Zc());var rL="status",Oz=["enable","disable",rL];function Tz(t){var r;let e=(r=t.telemetry)==null?void 0:r.config.isEnabled();we.log(`Status: ${e?Ga.default.bold(Ga.default.green("Enabled")):Ga.default.bold(Ga.default.red("Disabled"))}`),we.log(),e?we.log("Turborepo telemetry is completely anonymous. Thank you for participating!"):we.log("You have opted-out of Turborepo anonymous telemetry. No data will be collected from your machine."),we.log("Learn more: https://turborepo.com/docs/telemetry")}function kz(t,e){if(!e.telemetry){we.error("Telemetry could not be initialized");return}t==="enable"?(e.telemetry.config.enable(),we.bold("Success!")):t==="disable"&&(e.telemetry.config.disable(),we.bold("Success!")),we.log(),Tz(e)}function I0(t){t.command("telemetry").description("Manage telemetry settings").addArgument(new r_("[action]","Action to perform").choices(Oz).default(rL)).action(kz)}var wf={name:"turbo-ignore",version:"2.7.1",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.4",commander:"11.0.0",jest:"29.7.0","ts-jest":"29.2.5",tsup:"5.12.9",typescript:"5.5.4"}};l();var mL=require("child_process"),gL=le(require("path")),yL=require("fs");l();var nL=require("child_process");l();var L0="\u226B ";function Se(...t){console.log(L0,...t)}function or(...t){console.error(L0,...t)}function Va(...t){console.warn(L0,...t)}function N0(...t){console.log(...t)}function Iz(t){try{return(0,nL.execFileSync)("git",["cat-file","-t",t],{stdio:"ignore"}),!0}catch{return!1}}function D0(t){return t.fallback?(Se(`Falling back to ref ${t.fallback}`),{ref:t.fallback,type:"customFallback"}):null}function iL(t){let{workspace:e}=t;return process.env.VERCEL==="1"?process.env.VERCEL_GIT_PREVIOUS_SHA?Iz(process.env.VERCEL_GIT_PREVIOUS_SHA)?(Se(`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"}):(Se(`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.`),D0(t)):(Se(`No previous deployments found for "${e}"${process.env.VERCEL_GIT_COMMIT_REF?` on branch "${process.env.VERCEL_GIT_COMMIT_REF}"`:""}`),D0(t)):t.fallback?D0(t):{ref:"HEAD^",type:"headRelative"}}l();function sL(t){return t.task?(Se(`Using "${t.task}" as the task from the arguments`),t.task):(Se('Using "build" as the task as it was unspecified'),"build")}l();var oL=le(require("fs")),aL=le(require("path"));function cL(t){let{directory:e=process.cwd(),workspace:r}=t;if(r)return Se(`Using "${r}" as workspace from arguments`),r;let n=aL.default.join(e,"package.json");try{let i=oL.default.readFileSync(n,"utf8"),s=JSON.parse(i);return s.name?(Se(`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 M0=le(require("fs")),F0=le(require("path")),uL=require("json5");function lL(t,e){var s,o;let{turboVersion:r}=t;if(r)return Se(`Using turbo version "${r}" from arguments`),r;let n=F0.default.join(e,"package.json");try{let a=M0.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 Se(`Inferred turbo version "${r}" from "package.json"`),r;Va("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=F0.default.join(e,"turbo.json");try{let a=M0.default.readFileSync(i,"utf8"),c=(0,uL.parse)(a);return"tasks"in c?(Se('Inferred turbo version ^2 based on "tasks" in "turbo.json"'),"^2"):"pipeline"in c?(Se('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 q0={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 fL({err:t}){let e=Object.keys(q0).find(r=>{let{regex:n}=q0[r];return n.some(i=>i.test(t))});return e?{level:"warn",message:q0[e].message,code:e}:{level:"error",message:t,code:"UNKNOWN_ERROR"}}l();var hL=require("child_process"),Lz=["[skip ci]","[ci skip]","[no ci]","[skip vercel]","[vercel skip]"],Nz=["[vercel deploy]","[vercel build]"];function Dz({workspace:t}){return[`[vercel skip ${t}]`]}function Mz({workspace:t}){return[`[vercel deploy ${t}]`,`[vercel build ${t}]`]}var Fz=/\[vercel only .+\]/;function qz({workspace:t}){return[`[vercel only ${t}]`]}function Bz(){return process.env.VERCEL==="1"&&process.env.VERCEL_GIT_COMMIT_MESSAGE?process.env.VERCEL_GIT_COMMIT_MESSAGE:(0,hL.execSync)("git show -s --format=%B").toString()}function dL({workspace:t}){var c;let e=Bz(),r=u=>e.includes(u),n=(c=Fz.exec(e))==null?void 0:c[0];if(n)return qz({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=Mz({workspace:t}).find(r),s=Dz({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=Nz.find(r),a=Lz.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 jz(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 pL(){return N0("\u23ED Ignoring the change"),process.exit(0)}function Fr(){return N0("\u2713 Proceeding with deployment"),process.exit(1)}function _L(t,e){var v,E;(v=e.telemetry)==null||v.trackCommandStatus({command:"ignore",status:"start"}),(E=e.telemetry)==null||E.trackArgumentWorkspace(t!==void 0),jz(e);let r={workspace:t,...e};if(Se(`Using Turborepo to determine if this project is affected by the commit...
|
|
93
93
|
`),e.directory){let A=gL.default.resolve(e.directory);(0,yL.existsSync)(A)?r.directory=A:(Va(`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 Se("`TURBO_FORCE` detected"),Fr();let n=dc(r.directory);if(!n)return or("Monorepo root not found. turbo-ignore inferencing failed"),Fr();let i=cL(r);if(!i)return Fr();let s=lL(r,n),o=sL(r),a=dL({workspace:i});if(a.result==="skip")return Se(a.reason),pL();if(a.result==="deploy")return Se(a.reason),Fr();a.result==="conflict"&&Se(a.reason);let c=iL({workspace:i,fallback:r.fallback});if(!c)return Fr();let u=s?`turbo@${s}`:"turbo",f=`${i}...[${c.ref}]`,h=["-y",u,"run",o,`--filter=${f}`,"--dry=json"],d=o.includes("#")?`"${o}"`:o,m=`npx -y ${u} run ${d} --filter="${f}" --dry=json`;Se(`Analyzing results of \`${m}\``);let g={cwd:n};e.maxBuffer&&(g.maxBuffer=e.maxBuffer),(0,mL.execFile)("npx",h,g,(A,P)=>{var D,j;if(A){let{level:F,code:X,message:M}=fL({err:A.message});return F==="warn"?((D=e.telemetry)==null||D.trackCommandWarning(M),Va(M)):or(`${X}: ${A.message}`),Fr()}try{let F=JSON.parse(P);if(F===null)return or(`Failed to parse JSON output from \`${m}\`.`),Fr();let{packages:X}=F;return X?X.length>0?(X.length===1?Se(`This commit affects "${i}"`):Se(`This commit affects "${i}" and ${X.length-1} ${X.length-1===1?"dependency":"dependencies"} (${X.slice(1).join(", ")})`),Fr()):(Se("This project and its dependencies are not affected"),pL()):(Se("Detected single package repo"),Fr())}catch(F){return or(`Failed to parse JSON output from \`${m}\`.`),or(F),Fr()}finally{(j=e.telemetry)==null||j.trackCommandStatus({command:"ignore",status:"end"})}})}var xf,B0=new t_;B0.name(wf.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 P0({packageInfo:{name:"turbo-ignore",version:wf.version}});e.addOption(new Yn("--telemetry").default(r).hideHelp()),xf=r}).hook("postAction",async()=>{await(xf==null?void 0:xf.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 Yn("-t, --task <name>","The task to execute").default("build")).addOption(new Yn("-f, --fallback <ref>","On Vercel, if no previously deployed SHA is available to compare against, fallback to comparing against the provided ref")).addOption(new Yn("-d, --directory <path>","The directory to run in (default: cwd)")).addOption(new Yn("--turbo-version <version>","Explicitly set which version of turbo to invoke")).addOption(new Yn("-b, --max-buffer <number>","maxBuffer for the child process in KB (default: 1024 KB)").argParser(t=>parseInt(t,10)*1024)).version(wf.version,"-v, --version","Output the current version").helpOption("-h, --help","Display help for command").showHelpAfterError(!1).action(_L);I0(B0);B0.parse();
|
|
94
94
|
/*!
|
|
95
95
|
* @description Recursive object extending
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "turbo-ignore",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://turborepo.com",
|
|
6
6
|
"keywords": [],
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"tsup": "5.12.9",
|
|
31
31
|
"typescript": "5.5.4",
|
|
32
32
|
"@turbo/eslint-config": "0.0.0",
|
|
33
|
-
"@turbo/tsconfig": "0.0.0",
|
|
34
|
-
"@turbo/test-utils": "0.0.0",
|
|
35
33
|
"@turbo/telemetry": "0.0.0",
|
|
36
|
-
"@turbo/types": "2.7.
|
|
34
|
+
"@turbo/types": "2.7.1",
|
|
35
|
+
"@turbo/test-utils": "0.0.0",
|
|
36
|
+
"@turbo/tsconfig": "0.0.0",
|
|
37
37
|
"@turbo/utils": "0.0.0"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|