@skyramp/testbot-core 0.13.3-v3.554 → 0.13.3-v3.556
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/VERSION.json +1 -1
- package/dist/data-safety-worker.js +1 -1
- package/dist/main.js +515 -515
- package/dist/post.js +68 -68
- package/dist/runner-client.cjs +5 -5
- package/package.json +1 -1
|
@@ -124,7 +124,7 @@ ${c}`,this.dataLineCount++;return}if(Cl(t,r,L4)){G4(t,o)&&(this.setEventFieldSiz
|
|
|
124
124
|
};
|
|
125
125
|
} catch { /* never break the command */ }
|
|
126
126
|
})();
|
|
127
|
-
`;var GX=`${zQ} up to, not including, ${GQ}`;var XX=new TextDecoder("utf-8",{fatal:!0});var SF=yA.join(".skyramp","sut");var JQ=yA.join(SF,"client-cert.json");var n5=64*1024;var u={};Br(u,{BRAND:()=>eM,DIRTY:()=>ei,EMPTY_PATH:()=>_F,INVALID:()=>J,NEVER:()=>MM,OK:()=>We,ParseStatus:()=>Ve,Schema:()=>ne,ZodAny:()=>mn,ZodArray:()=>jr,ZodBigInt:()=>ri,ZodBoolean:()=>ni,ZodBranded:()=>ia,ZodCatch:()=>gi,ZodDate:()=>ii,ZodDefault:()=>fi,ZodDiscriminatedUnion:()=>QA,ZodEffects:()=>Yt,ZodEnum:()=>li,ZodError:()=>ft,ZodFirstPartyTypeKind:()=>j,ZodFunction:()=>wA,ZodIntersection:()=>ci,ZodIssueCode:()=>S,ZodLazy:()=>Ai,ZodLiteral:()=>ui,ZodMap:()=>ho,ZodNaN:()=>Io,ZodNativeEnum:()=>di,ZodNever:()=>ar,ZodNull:()=>si,ZodNullable:()=>wr,ZodNumber:()=>ti,ZodObject:()=>gt,ZodOptional:()=>Vt,ZodParsedType:()=>U,ZodPipeline:()=>oa,ZodPromise:()=>In,ZodReadonly:()=>pi,ZodRecord:()=>vA,ZodSchema:()=>ne,ZodSet:()=>mo,ZodString:()=>hn,ZodSymbol:()=>go,ZodTransformer:()=>Yt,ZodTuple:()=>vr,ZodType:()=>ne,ZodUndefined:()=>oi,ZodUnion:()=>ai,ZodUnknown:()=>Yr,ZodVoid:()=>po,addIssueToContext:()=>_,any:()=>AM,array:()=>fM,bigint:()=>iM,boolean:()=>rv,coerce:()=>FM,custom:()=>XQ,date:()=>oM,datetimeRegex:()=>ZQ,defaultErrorMap:()=>Vr,discriminatedUnion:()=>mM,effect:()=>xM,enum:()=>bM,function:()=>QM,getErrorMap:()=>uo,getParsedType:()=>Qr,instanceof:()=>rM,intersection:()=>IM,isAborted:()=>CA,isAsync:()=>lo,isDirty:()=>BA,isValid:()=>pn,late:()=>tM,lazy:()=>vM,literal:()=>wM,makeIssue:()=>na,map:()=>CM,nan:()=>nM,nativeEnum:()=>kM,never:()=>lM,null:()=>cM,nullable:()=>DM,number:()=>tv,object:()=>gM,objectUtil:()=>Kf,oboolean:()=>$M,onumber:()=>TM,optional:()=>RM,ostring:()=>UM,pipeline:()=>NM,preprocess:()=>_M,promise:()=>SM,quotelessJson:()=>xF,record:()=>yM,set:()=>BM,setErrorMap:()=>DF,strictObject:()=>pM,string:()=>ev,symbol:()=>sM,transformer:()=>xM,tuple:()=>EM,undefined:()=>aM,union:()=>hM,unknown:()=>uM,util:()=>se,void:()=>dM});var se;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function n(r){throw new Error}e.assertNever=n,e.arrayToEnum=r=>{let o={};for(let s of r)o[s]=s;return o},e.getValidEnumValues=r=>{let o=e.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),s={};for(let a of o)s[a]=r[a];return e.objectValues(s)},e.objectValues=r=>e.objectKeys(r).map(function(o){return r[o]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&o.push(s);return o},e.find=(r,o)=>{for(let s of r)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(se||(se={}));var Kf;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Kf||(Kf={}));var U=se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Qr=e=>{switch(typeof e){case"undefined":return U.undefined;case"string":return U.string;case"number":return Number.isNaN(e)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(e)?U.array:e===null?U.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?U.promise:typeof Map<"u"&&e instanceof Map?U.map:typeof Set<"u"&&e instanceof Set?U.set:typeof Date<"u"&&e instanceof Date?U.date:U.object;default:return U.unknown}};var S=se.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"]),xF=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ft=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(o){return o.message},i={_errors:[]},r=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)i._errors.push(n(s));else{let a=i,c=0;for(;c<s.path.length;){let A=s.path[c],l=c===s.path.length-1;if(A==="_errors"){l&&a._errors.push(n(s)),c++;continue}Object.prototype.hasOwnProperty.call(a,A)||(A==="__proto__"?Object.defineProperty(a,A,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):a[A]={_errors:[]}),a=a[A],l&&a._errors.push(n(s)),c++}}};return r(this),i}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,se.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];n[o]=n[o]||[],n[o].push(t(r))}else i.push(t(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};ft.create=e=>new ft(e);var RF=(e,t)=>{let n;switch(e.code){case S.invalid_type:e.received===U.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case S.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,se.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:n=`Unrecognized key(s) in object: ${se.joinValues(e.keys,", ")}`;break;case S.invalid_union:n="Invalid input";break;case S.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${se.joinValues(e.options)}`;break;case S.invalid_enum_value:n=`Invalid enum value. Expected ${se.joinValues(e.options)}, received '${e.received}'`;break;case S.invalid_arguments:n="Invalid function arguments";break;case S.invalid_return_type:n="Invalid function return type";break;case S.invalid_date:n="Invalid date";break;case S.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:se.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case S.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case S.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case S.custom:n="Invalid input";break;case S.invalid_intersection_types:n="Intersection results could not be merged";break;case S.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case S.not_finite:n="Number must be finite";break;default:n=t.defaultError,se.assertNever(e)}return{message:n}},Vr=RF;var YQ=Vr;function DF(e){YQ=e}function uo(){return YQ}var na=e=>{let{data:t,path:n,errorMaps:i,issueData:r}=e,o=[...n,...r.path||[]],s={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let a="",c=i.filter(A=>!!A).slice().reverse();for(let A of c)a=A(s,{data:t,defaultError:a}).message;return{...r,path:o,message:a}},_F=[];function _(e,t){let n=uo(),i=na({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Vr?void 0:Vr].filter(r=>!!r)});e.common.issues.push(i)}var Ve=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let i=[];for(let r of n){if(r.status==="aborted")return J;r.status==="dirty"&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,n){let i=[];for(let r of n){let o=await r.key,s=await r.value;i.push({key:o,value:s})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,n){let i={};for(let r of n){let{key:o,value:s}=r;if(o.status==="aborted"||s.status==="aborted")return J;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet)&&(i[o.value]=s.value)}return{status:t.value,value:i}}},J=Object.freeze({status:"aborted"}),ei=e=>({status:"dirty",value:e}),We=e=>({status:"valid",value:e}),CA=e=>e.status==="aborted",BA=e=>e.status==="dirty",pn=e=>e.status==="valid",lo=e=>typeof Promise<"u"&&e instanceof Promise;var F;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(F||(F={}));var Jt=class{constructor(t,n,i,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},jQ=(e,t)=>{if(pn(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new ft(e.common.issues);return this._error=n,this._error}}};function X(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(s,a)=>{let{message:c}=e;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??i??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:r}}var ne=class{get description(){return this._def.description}_getType(t){return Qr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Qr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ve,ctx:{common:t.parent.common,data:t.data,parsedType:Qr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(lo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let i=this.safeParse(t,n);if(i.success)return i.data;throw i.error}safeParse(t,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Qr(t)},r=this._parseSync({data:t,path:i.path,parent:i});return jQ(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Qr(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return pn(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>pn(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){let i=await this.safeParseAsync(t,n);if(i.success)return i.data;throw i.error}async safeParseAsync(t,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Qr(t)},r=this._parse({data:t,path:i.path,parent:i}),o=await(lo(r)?r:Promise.resolve(r));return jQ(i,o)}refine(t,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,o)=>{let s=t(r),a=()=>o.addIssue({code:S.custom,...i(r)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((i,r)=>t(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(t){return new Yt({schema:this,typeName:j.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Vt.create(this,this._def)}nullable(){return wr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jr.create(this)}promise(){return In.create(this,this._def)}or(t){return ai.create([this,t],this._def)}and(t){return ci.create(this,t,this._def)}transform(t){return new Yt({...X(this._def),schema:this,typeName:j.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new fi({...X(this._def),innerType:this,defaultValue:n,typeName:j.ZodDefault})}brand(){return new ia({typeName:j.ZodBranded,type:this,...X(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new gi({...X(this._def),innerType:this,catchValue:n,typeName:j.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return oa.create(this,t)}readonly(){return pi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},NF=/^c[^\s-]{8,}$/i,UF=/^[0-9a-z]+$/,TF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$F=/^[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,FF=/^[a-z0-9_-]{21}$/i,MF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,LF=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,PF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,OF="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",Xf,zF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,GF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,VF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,JF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,YF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,jF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,qQ="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",HF=new RegExp(`^${qQ}$`);function WQ(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function qF(e){return new RegExp(`^${WQ(e)}$`)}function ZQ(e){let t=`${qQ}T${WQ(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function WF(e,t){return!!((t==="v4"||!t)&&zF.test(e)||(t==="v6"||!t)&&VF.test(e))}function ZF(e,t){if(!MF.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function KF(e,t){return!!((t==="v4"||!t)&&GF.test(e)||(t==="v6"||!t)&&JF.test(e))}var hn=class e extends ne{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==U.string){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_type,expected:U.string,received:o.parsedType}),J}let i=new Ve,r;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(r=this._getOrReturnCtx(t,r),s?_(r,{code:S.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&_(r,{code:S.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")PF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"email",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")Xf||(Xf=new RegExp(OF,"u")),Xf.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"emoji",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")$F.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"uuid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")FF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"nanoid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")NF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"cuid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")UF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"cuid2",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")TF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"ulid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),_(r,{validation:"url",code:S.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"regex",code:S.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?ZQ(o).test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?HF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?qF(o).test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?LF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"duration",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?WF(t.data,o.version)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"ip",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?ZF(t.data,o.alg)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"jwt",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?KF(t.data,o.version)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"cidr",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?YF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"base64",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?jF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"base64url",code:S.invalid_string,message:o.message}),i.dirty()):se.assertNever(o);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:S.invalid_string,...F.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...F.errToObj(t)})}url(t){return this._addCheck({kind:"url",...F.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...F.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...F.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...F.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...F.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...F.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...F.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...F.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...F.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...F.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...F.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...F.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...F.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...F.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...F.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...F.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...F.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...F.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...F.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...F.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...F.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...F.errToObj(n)})}nonempty(t){return this.min(1,F.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};hn.create=e=>new hn({checks:[],typeName:j.ZodString,coerce:e?.coerce??!1,...X(e)});function XF(e,t){let n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(e.toFixed(r).replace(".","")),s=Number.parseInt(t.toFixed(r).replace(".",""));return o%s/10**r}var ti=class e extends ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==U.number){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_type,expected:U.number,received:o.parsedType}),J}let i,r=new Ve;for(let o of this._def.checks)o.kind==="int"?se.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),_(i,{code:S.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?XF(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),_(i,{code:S.not_finite,message:o.message}),r.dirty()):se.assertNever(o);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,F.toString(n))}gt(t,n){return this.setLimit("min",t,!1,F.toString(n))}lte(t,n){return this.setLimit("max",t,!0,F.toString(n))}lt(t,n){return this.setLimit("max",t,!1,F.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:F.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:F.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:F.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:F.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:F.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:F.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:F.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:F.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:F.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:F.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&se.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(n)&&Number.isFinite(t)}};ti.create=e=>new ti({checks:[],typeName:j.ZodNumber,coerce:e?.coerce||!1,...X(e)});var ri=class e extends ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==U.bigint)return this._getInvalidInput(t);let i,r=new Ve;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):se.assertNever(o);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return _(n,{code:S.invalid_type,expected:U.bigint,received:n.parsedType}),J}gte(t,n){return this.setLimit("min",t,!0,F.toString(n))}gt(t,n){return this.setLimit("min",t,!1,F.toString(n))}lte(t,n){return this.setLimit("max",t,!0,F.toString(n))}lt(t,n){return this.setLimit("max",t,!1,F.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:F.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:F.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:F.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:F.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:F.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:F.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};ri.create=e=>new ri({checks:[],typeName:j.ZodBigInt,coerce:e?.coerce??!1,...X(e)});var ni=class extends ne{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==U.boolean){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.boolean,received:i.parsedType}),J}return We(t.data)}};ni.create=e=>new ni({typeName:j.ZodBoolean,coerce:e?.coerce||!1,...X(e)});var ii=class e extends ne{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==U.date){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_type,expected:U.date,received:o.parsedType}),J}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_date}),J}let i=new Ve,r;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):se.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:F.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:F.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};ii.create=e=>new ii({checks:[],coerce:e?.coerce||!1,typeName:j.ZodDate,...X(e)});var go=class extends ne{_parse(t){if(this._getType(t)!==U.symbol){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.symbol,received:i.parsedType}),J}return We(t.data)}};go.create=e=>new go({typeName:j.ZodSymbol,...X(e)});var oi=class extends ne{_parse(t){if(this._getType(t)!==U.undefined){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.undefined,received:i.parsedType}),J}return We(t.data)}};oi.create=e=>new oi({typeName:j.ZodUndefined,...X(e)});var si=class extends ne{_parse(t){if(this._getType(t)!==U.null){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.null,received:i.parsedType}),J}return We(t.data)}};si.create=e=>new si({typeName:j.ZodNull,...X(e)});var mn=class extends ne{constructor(){super(...arguments),this._any=!0}_parse(t){return We(t.data)}};mn.create=e=>new mn({typeName:j.ZodAny,...X(e)});var Yr=class extends ne{constructor(){super(...arguments),this._unknown=!0}_parse(t){return We(t.data)}};Yr.create=e=>new Yr({typeName:j.ZodUnknown,...X(e)});var ar=class extends ne{_parse(t){let n=this._getOrReturnCtx(t);return _(n,{code:S.invalid_type,expected:U.never,received:n.parsedType}),J}};ar.create=e=>new ar({typeName:j.ZodNever,...X(e)});var po=class extends ne{_parse(t){if(this._getType(t)!==U.undefined){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.void,received:i.parsedType}),J}return We(t.data)}};po.create=e=>new po({typeName:j.ZodVoid,...X(e)});var jr=class e extends ne{_parse(t){let{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==U.array)return _(n,{code:S.invalid_type,expected:U.array,received:n.parsedType}),J;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,a=n.data.length<r.exactLength.value;(s||a)&&(_(n,{code:s?S.too_big:S.too_small,minimum:a?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(_(n,{code:S.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(_(n,{code:S.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>r.type._parseAsync(new Jt(n,s,n.path,a)))).then(s=>Ve.mergeArray(i,s));let o=[...n.data].map((s,a)=>r.type._parseSync(new Jt(n,s,n.path,a)));return Ve.mergeArray(i,o)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:F.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:F.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:F.toString(n)}})}nonempty(t){return this.min(1,t)}};jr.create=(e,t)=>new jr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:j.ZodArray,...X(t)});function fo(e){if(e instanceof gt){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=Vt.create(fo(i))}return new gt({...e._def,shape:()=>t})}else return e instanceof jr?new jr({...e._def,type:fo(e.element)}):e instanceof Vt?Vt.create(fo(e.unwrap())):e instanceof wr?wr.create(fo(e.unwrap())):e instanceof vr?vr.create(e.items.map(t=>fo(t))):e}var gt=class e extends ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=se.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==U.object){let A=this._getOrReturnCtx(t);return _(A,{code:S.invalid_type,expected:U.object,received:A.parsedType}),J}let{status:i,ctx:r}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof ar&&this._def.unknownKeys==="strip"))for(let A in r.data)s.includes(A)||a.push(A);let c=[];for(let A of s){let l=o[A],d=r.data[A];c.push({key:{status:"valid",value:A},value:l._parse(new Jt(r,d,r.path,A)),alwaysSet:A in r.data})}if(this._def.catchall instanceof ar){let A=this._def.unknownKeys;if(A==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(A==="strict")a.length>0&&(_(r,{code:S.unrecognized_keys,keys:a}),i.dirty());else if(A!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let A=this._def.catchall;for(let l of a){let d=r.data[l];c.push({key:{status:"valid",value:l},value:A._parse(new Jt(r,d,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let A=[];for(let l of c){let d=await l.key,f=await l.value;A.push({key:d,value:f,alwaysSet:l.alwaysSet})}return A}).then(A=>Ve.mergeObjectSync(i,A)):Ve.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(t){return F.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:F.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:j.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let i of se.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let i of se.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}deepPartial(){return fo(this)}partial(t){let n={};for(let i of se.objectKeys(this.shape)){let r=this.shape[i];t&&!t[i]?n[i]=r:n[i]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let i of se.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Vt;)o=o._def.innerType;n[i]=o}return new e({...this._def,shape:()=>n})}keyof(){return KQ(se.objectKeys(this.shape))}};gt.create=(e,t)=>new gt({shape:()=>e,unknownKeys:"strip",catchall:ar.create(),typeName:j.ZodObject,...X(t)});gt.strictCreate=(e,t)=>new gt({shape:()=>e,unknownKeys:"strict",catchall:ar.create(),typeName:j.ZodObject,...X(t)});gt.lazycreate=(e,t)=>new gt({shape:e,unknownKeys:"strip",catchall:ar.create(),typeName:j.ZodObject,...X(t)});var ai=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i=this._def.options;function r(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new ft(a.ctx.common.issues));return _(n,{code:S.invalid_union,unionErrors:s}),J}if(n.common.async)return Promise.all(i.map(async o=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(r);{let o,s=[];for(let c of i){let A={...n,common:{...n.common,issues:[]},parent:null},l=c._parseSync({data:n.data,path:n.path,parent:A});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:A}),A.common.issues.length&&s.push(A.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(c=>new ft(c));return _(n,{code:S.invalid_union,unionErrors:a}),J}}get options(){return this._def.options}};ai.create=(e,t)=>new ai({options:e,typeName:j.ZodUnion,...X(t)});var Jr=e=>e instanceof Ai?Jr(e.schema):e instanceof Yt?Jr(e.innerType()):e instanceof ui?[e.value]:e instanceof li?e.options:e instanceof di?se.objectValues(e.enum):e instanceof fi?Jr(e._def.innerType):e instanceof oi?[void 0]:e instanceof si?[null]:e instanceof Vt?[void 0,...Jr(e.unwrap())]:e instanceof wr?[null,...Jr(e.unwrap())]:e instanceof ia||e instanceof pi?Jr(e.unwrap()):e instanceof gi?Jr(e._def.innerType):[],QA=class e extends ne{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==U.object)return _(n,{code:S.invalid_type,expected:U.object,received:n.parsedType}),J;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(_(n,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),J)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){let r=new Map;for(let o of n){let s=Jr(o.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(r.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);r.set(a,o)}}return new e({typeName:j.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...X(i)})}};function eg(e,t){let n=Qr(e),i=Qr(t);if(e===t)return{valid:!0,data:e};if(n===U.object&&i===U.object){let r=se.objectKeys(t),o=se.objectKeys(e).filter(a=>r.indexOf(a)!==-1),s={...e,...t};Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__;for(let a of o){if(a==="__proto__")continue;let c=eg(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(n===U.array&&i===U.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let o=0;o<e.length;o++){let s=e[o],a=t[o],c=eg(s,a);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return n===U.date&&i===U.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var ci=class extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=(o,s)=>{if(CA(o)||CA(s))return J;let a=eg(o.value,s.value);return a.valid?((BA(o)||BA(s))&&n.dirty(),{status:n.value,value:a.data}):(_(i,{code:S.invalid_intersection_types}),J)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,s])=>r(o,s)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};ci.create=(e,t,n)=>new ci({left:e,right:t,typeName:j.ZodIntersection,...X(n)});var vr=class e extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.array)return _(i,{code:S.invalid_type,expected:U.array,received:i.parsedType}),J;if(i.data.length<this._def.items.length)return _(i,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),J;!this._def.rest&&i.data.length>this._def.items.length&&(_(i,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Jt(i,s,i.path,a)):null}).filter(s=>!!s);return i.common.async?Promise.all(o).then(s=>Ve.mergeArray(n,s)):Ve.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};vr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vr({items:e,typeName:j.ZodTuple,rest:null,...X(t)})};var vA=class e extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.object)return _(i,{code:S.invalid_type,expected:U.object,received:i.parsedType}),J;let r=[],o=this._def.keyType,s=this._def.valueType;for(let a in i.data)r.push({key:o._parse(new Jt(i,a,i.path,a)),value:s._parse(new Jt(i,i.data[a],i.path,a)),alwaysSet:a in i.data});return i.common.async?Ve.mergeObjectAsync(n,r):Ve.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof ne?new e({keyType:t,valueType:n,typeName:j.ZodRecord,...X(i)}):new e({keyType:hn.create(),valueType:t,typeName:j.ZodRecord,...X(n)})}},ho=class extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.map)return _(i,{code:S.invalid_type,expected:U.map,received:i.parsedType}),J;let r=this._def.keyType,o=this._def.valueType,s=[...i.data.entries()].map(([a,c],A)=>({key:r._parse(new Jt(i,a,i.path,[A,"key"])),value:o._parse(new Jt(i,c,i.path,[A,"value"]))}));if(i.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let A=await c.key,l=await c.value;if(A.status==="aborted"||l.status==="aborted")return J;(A.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(A.value,l.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let c of s){let A=c.key,l=c.value;if(A.status==="aborted"||l.status==="aborted")return J;(A.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(A.value,l.value)}return{status:n.value,value:a}}}};ho.create=(e,t,n)=>new ho({valueType:t,keyType:e,typeName:j.ZodMap,...X(n)});var mo=class e extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.set)return _(i,{code:S.invalid_type,expected:U.set,received:i.parsedType}),J;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(_(i,{code:S.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(_(i,{code:S.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function s(c){let A=new Set;for(let l of c){if(l.status==="aborted")return J;l.status==="dirty"&&n.dirty(),A.add(l.value)}return{status:n.value,value:A}}let a=[...i.data.values()].map((c,A)=>o._parse(new Jt(i,c,i.path,A)));return i.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,n){return new e({...this._def,minSize:{value:t,message:F.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:F.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};mo.create=(e,t)=>new mo({valueType:e,minSize:null,maxSize:null,typeName:j.ZodSet,...X(t)});var wA=class e extends ne{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==U.function)return _(n,{code:S.invalid_type,expected:U.function,received:n.parsedType}),J;function i(a,c){return na({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,uo(),Vr].filter(A=>!!A),issueData:{code:S.invalid_arguments,argumentsError:c}})}function r(a,c){return na({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,uo(),Vr].filter(A=>!!A),issueData:{code:S.invalid_return_type,returnTypeError:c}})}let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof In){let a=this;return We(async function(...c){let A=new ft([]),l=await a._def.args.parseAsync(c,o).catch(g=>{throw A.addIssue(i(c,g)),A}),d=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(d,o).catch(g=>{throw A.addIssue(r(d,g)),A})})}else{let a=this;return We(function(...c){let A=a._def.args.safeParse(c,o);if(!A.success)throw new ft([i(c,A.error)]);let l=Reflect.apply(s,this,A.data),d=a._def.returns.safeParse(l,o);if(!d.success)throw new ft([r(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:vr.create(t).rest(Yr.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,i){return new e({args:t||vr.create([]).rest(Yr.create()),returns:n||Yr.create(),typeName:j.ZodFunction,...X(i)})}},Ai=class extends ne{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Ai.create=(e,t)=>new Ai({getter:e,typeName:j.ZodLazy,...X(t)});var ui=class extends ne{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return _(n,{received:n.data,code:S.invalid_literal,expected:this._def.value}),J}return{status:"valid",value:t.data}}get value(){return this._def.value}};ui.create=(e,t)=>new ui({value:e,typeName:j.ZodLiteral,...X(t)});function KQ(e,t){return new li({values:e,typeName:j.ZodEnum,...X(t)})}var li=class e extends ne{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),i=this._def.values;return _(n,{expected:se.joinValues(i),received:n.parsedType,code:S.invalid_type}),J}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),i=this._def.values;return _(n,{received:n.data,code:S.invalid_enum_value,options:i}),J}return We(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}};li.create=KQ;var di=class extends ne{_parse(t){let n=se.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==U.string&&i.parsedType!==U.number){let r=se.objectValues(n);return _(i,{expected:se.joinValues(r),received:i.parsedType,code:S.invalid_type}),J}if(this._cache||(this._cache=new Set(se.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=se.objectValues(n);return _(i,{received:i.data,code:S.invalid_enum_value,options:r}),J}return We(t.data)}get enum(){return this._def.values}};di.create=(e,t)=>new di({values:e,typeName:j.ZodNativeEnum,...X(t)});var In=class extends ne{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==U.promise&&n.common.async===!1)return _(n,{code:S.invalid_type,expected:U.promise,received:n.parsedType}),J;let i=n.parsedType===U.promise?n.data:Promise.resolve(n.data);return We(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};In.create=(e,t)=>new In({type:e,typeName:j.ZodPromise,...X(t)});var Yt=class extends ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===j.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=this._def.effect||null,o={addIssue:s=>{_(i,s),s.fatal?n.abort():n.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let s=r.transform(i.data,o);if(i.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return J;let c=await this._def.schema._parseAsync({data:a,path:i.path,parent:i});return c.status==="aborted"?J:c.status==="dirty"?ei(c.value):n.value==="dirty"?ei(c.value):c});{if(n.value==="aborted")return J;let a=this._def.schema._parseSync({data:s,path:i.path,parent:i});return a.status==="aborted"?J:a.status==="dirty"?ei(a.value):n.value==="dirty"?ei(a.value):a}}if(r.type==="refinement"){let s=a=>{let c=r.refinement(a,o);if(i.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(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?J:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?J:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(r.type==="transform")if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!pn(s))return J;let a=r.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>pn(s)?Promise.resolve(r.transform(s.value,o)).then(a=>({status:n.value,value:a})):J);se.assertNever(r)}};Yt.create=(e,t,n)=>new Yt({schema:e,typeName:j.ZodEffects,effect:t,...X(n)});Yt.createWithPreprocess=(e,t,n)=>new Yt({schema:t,effect:{type:"preprocess",transform:e},typeName:j.ZodEffects,...X(n)});var Vt=class extends ne{_parse(t){return this._getType(t)===U.undefined?We(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Vt.create=(e,t)=>new Vt({innerType:e,typeName:j.ZodOptional,...X(t)});var wr=class extends ne{_parse(t){return this._getType(t)===U.null?We(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};wr.create=(e,t)=>new wr({innerType:e,typeName:j.ZodNullable,...X(t)});var fi=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return n.parsedType===U.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};fi.create=(e,t)=>new fi({innerType:e,typeName:j.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...X(t)});var gi=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return lo(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ft(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new ft(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};gi.create=(e,t)=>new gi({innerType:e,typeName:j.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...X(t)});var Io=class extends ne{_parse(t){if(this._getType(t)!==U.nan){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.nan,received:i.parsedType}),J}return{status:"valid",value:t.data}}};Io.create=e=>new Io({typeName:j.ZodNaN,...X(e)});var eM=Symbol("zod_brand"),ia=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},oa=class e extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?J:o.status==="dirty"?(n.dirty(),ei(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?J:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new e({in:t,out:n,typeName:j.ZodPipeline})}},pi=class extends ne{_parse(t){let n=this._def.innerType._parse(t),i=r=>(pn(r)&&(r.value=Object.freeze(r.value)),r);return lo(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};pi.create=(e,t)=>new pi({innerType:e,typeName:j.ZodReadonly,...X(t)});function HQ(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function XQ(e,t={},n){return e?mn.create().superRefine((i,r)=>{let o=e(i);if(o instanceof Promise)return o.then(s=>{if(!s){let a=HQ(t,i),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}});if(!o){let s=HQ(t,i),a=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:a})}}):mn.create()}var tM={object:gt.lazycreate},j;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(j||(j={}));var rM=(e,t={message:`Input not instance of ${e.name}`})=>XQ(n=>n instanceof e,t),ev=hn.create,tv=ti.create,nM=Io.create,iM=ri.create,rv=ni.create,oM=ii.create,sM=go.create,aM=oi.create,cM=si.create,AM=mn.create,uM=Yr.create,lM=ar.create,dM=po.create,fM=jr.create,gM=gt.create,pM=gt.strictCreate,hM=ai.create,mM=QA.create,IM=ci.create,EM=vr.create,yM=vA.create,CM=ho.create,BM=mo.create,QM=wA.create,vM=Ai.create,wM=ui.create,bM=li.create,kM=di.create,SM=In.create,xM=Yt.create,RM=Vt.create,DM=wr.create,_M=Yt.createWithPreprocess,NM=oa.create,UM=()=>ev().optional(),TM=()=>tv().optional(),$M=()=>rv().optional(),FM={string:(e=>hn.create({...e,coerce:!0})),number:(e=>ti.create({...e,coerce:!0})),boolean:(e=>ni.create({...e,coerce:!0})),bigint:(e=>ri.create({...e,coerce:!0})),date:(e=>ii.create({...e,coerce:!0}))};var MM=J;var tg=(r=>(r.ModelProvider="model_provider",r.SutAccess="sut_access",r.Skyramp="skyramp",r.Other="other",r))(tg||{}),rg=(i=>(i.Ready="ready",i.Blocked="blocked",i.NeedsInputs="needs_inputs",i))(rg||{});var ng=300,he=u.string().trim().min(1),LM=u.object({action:u.enum(["start","run","wait"]),text:he,source:u.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:he.nullable().describe("the file the step came from, relative to the component's repository; null unless source is file")}).strict().refine(e=>e.source==="file"==(e.file!==null),{path:["file"],message:"a file exactly when the step came from one"}),ig=/^[A-Za-z_][A-Za-z0-9_]*$/,pt=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,sa=(s=>(s.VersionEndpoint="version_endpoint",s.DeployWorkflow="deploy_workflow",s.KubernetesLabels="kubernetes_labels",s.Command="command",s.Api="api",s.NotTracked="not_tracked",s))(sa||{}),Hr="shared",PM=he.refine(e=>{try{let t=new URL(e);return["http:","https:"].includes(t.protocol)&&!t.username&&!t.password}catch{return!1}},"an http(s) URL with no login in it"),Eo=u.object({address:PM,readyWhen:he.nullable(),credentials:u.array(u.string().regex(pt)).max(50),revisionSources:u.array(u.object({method:u.nativeEnum(sa),detail:he.describe("what Testbot reads, such as GET /version or the deploy workflow's name; for not_tracked, why nothing shows it"),components:u.array(he).min(1).describe("the components it tells the revision of, by name")}).strict()).max(50)}).strict(),og={steps:u.array(LM).max(20).optional().describe("how it starts, in order"),kind:u.enum(["web_app","service","database","external_service"]).optional(),from:u.object({file:he,service:he.nullable()}).strict().optional(),credentials:u.array(u.string().max(100).regex(ig)).max(50).optional().describe("the Target's credentials this component's recipe uses: a sign-in (a test user, password or token) or an API key, which the workflow supplies from a GitHub Actions secret as the environment variable of the credential's name; give each name exactly as the recipe reads it. Names only, never a value, and not a secret the recipe generates itself")},OM=u.object({name:he,repository:he.describe("owner/repo of the Target repository the component is built or started from, such as the one whose compose file starts its database"),healthy:u.boolean(),...og,deployed:he.nullable().optional().describe('only with "environment": the revision the component runs, as you read it from its revision source, or null when you could not tell')}),zM=u.object({name:u.string().regex(pt).describe("the credential's environment variable name, as the recipe reads it and the credentials event names it"),purpose:u.enum(["sut_access","other"]).describe("sut_access: it signs in to or calls the SUT or a service it needs; other: anything else"),required:u.boolean().describe("false only when the SUT starts without it, with less working"),how:he.max(ng).describe('one short sentence: what the value is and where a person gets it, such as "A Mattermost Enterprise licence key, from the customer portal"; never a value')}),sg=u.object({name:he.describe("the credential's environment variable name, as listed above; never its value"),component:he.describe("the component that refused it"),status:u.number().int().min(400).max(599).optional().describe("the HTTP status it got, such as 401 or 403; leave it out when the refusal was not an HTTP answer"),evidence:he.describe("the request or command you tested it with and what came back, never the value")}),GM=400,nv=(e,t)=>he.max(GM).optional().describe(`one or two plain sentences: ${e}, such as "${t}"; never the value`),VM=sg.extend({name:u.string().regex(pt).describe("the credential's environment variable name, as the SUT input lists it; never its value"),explanation:nv("what the component did with the value and why it is wrong","The app checks the licence key at startup and exits: the value this run has does not match the licence it expects.")}),JM=u.object({name:u.string().regex(pt).describe("the credential's environment variable name, as the SUT input lists it"),component:he.describe("the component that cannot come up or work without it"),evidence:he.describe("the command you ran and what came back that shows it needs a value, never a value"),explanation:nv("what the component needs the value for and what it does without one","The app reads the licence key at startup and exits when it is empty.")}),YM=u.object({component:he,problem:he,evidence:he.describe("the exact command and output that shows it"),fix:he.describe("what the user must provide, and where")}),jM=u.object({framework:he,file:he.describe("the test file run, relative to its repository root"),result:u.enum(["pass","fail","error"])}),HM=u.object({input:he.describe("the part of the user's SUT input, as given"),reason:he}),T5=u.object({schemaVersion:u.literal(1),status:u.nativeEnum(rg).describe("ready only if every component came up healthy and the recipe is written; needs_inputs when the recipe is written but a component cannot start without a credential this run has no value for"),components:u.array(OM),suites:u.array(jM).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:u.array(he).default([]).describe("the parts of the user's SUT input the recipe used as given"),inputsUsedHow:u.array(u.object({input:he.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:he.describe("what the recipe did with it")})).optional(),inputsNotUsed:u.array(HM).default([]).describe("the parts it did not use, and why. A part that is wrong goes here, with what was wrong, even when the recipe does something like it instead: one the repositories or the app show is wrong, such as a file, command, port, route or setting that is not there. Something outside them that does not answer is not one: that is a blocker"),blockers:u.array(YM).describe("required (non-empty) when status is blocked, unless credentialsRefused or credentialsWithoutValue says why; never one for a credential either of them names"),inputs:u.array(zM).max(50).optional().describe("required (non-empty) when status is needs_inputs, else left out: each credential the candidate recipe needs a value for"),credentialsRefused:u.array(VM).max(50).optional().describe("only with status blocked: each credential the SUT input lists that the SUT still refused after a person confirmed it, or when no other credential worked. Testbot writes its blocker"),credentialsWithoutValue:u.array(JM).max(50).optional().describe("only with status blocked: each credential the SUT input lists as empty in this run that a component cannot come up or work without. Testbot writes its blocker"),environment:Eo.optional().describe("only when the whole SUT is an existing deployment you tested where it runs, building and starting nothing: its address, what says it is ready, the credentials that reach it, and how to read what each component runs. Leave it out when any part was built or started on the runner, or reaching it needed something there (a tunnel, port-forward or proxy; a client certificate is named in .skyramp/sut/client-cert.json instead)")});var ag=64*1024,cg=512*1024,iv=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var aa=(o=>(o.NotFound="not_found",o.NoAccess="no_access",o.Unavailable="unavailable",o.AccessLost="access_lost",o.CannotOpen="cannot_open",o))(aa||{});var ov=e=>`${e.source}:${e.site??""}:${e.key}`;var bA=/^pasted-[0-9a-f]{16}$/,kA=/^file-[0-9a-f]{16}$/,SA=(r=>(r.Pdf="application/pdf",r.Csv="text/csv",r.Docx="application/vnd.openxmlformats-officedocument.wordprocessingml.document",r.Xlsx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",r))(SA||{});var Ag=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(Ag||{}),ug=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(ug||{}),lg=(m=>(m.RelatedChangeConflict="related_change_conflict",m.ReferenceOutsideTarget="reference_outside_target",m.SourceAccessLost="source_access_lost",m.ConfigurationIncomplete="configuration_incomplete",m.CredentialUnavailable="credential_unavailable",m.WorkflowBindingUnverified="workflow_binding_unverified",m.WorkflowRefUnprotected="workflow_ref_unprotected",m.BedrockWorkflowRequired="bedrock_workflow_required",m.DeploymentReview="deployment_review",m.SutRevisionMismatch="sut_revision_mismatch",m.IsolationUnavailable="isolation_unavailable",m.EvidenceInsufficient="evidence_insufficient",m.ConfigurationUnresolved="configuration_unresolved",m.ModelProviderDenied="model_provider_denied",m.ModelProviderUnavailable="model_provider_unavailable",m.RunnerProviderNotReady="runner_provider_not_ready",m.MergeConflict="merge_conflict",m))(lg||{}),ca=(o=>(o.CiCheck="ci_check",o.TestReport="test_report",o.StaticAnalysis="static_analysis",o.CodeReview="code_review",o.Other="other",o))(ca||{}),dg=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(dg||{}),fg=(a=>(a.AuthToken="auth_token",a.Secret="secret",a.DataConnection="data_connection",a.AppNotStarted="app_not_started",a.Login="login",a.ExternalDependency="external_dependency",a.RecordingReplay="recording_replay",a))(fg||{});var gg=(n=>(n.Probe="probe",n.Agent="agent",n))(gg||{}),pg=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(pg||{}),hg=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(hg||{});var sv=(n=>(n.Skyramp="skyramp",n.Llm="llm",n))(sv||{}),br=u.string().trim().min(1),qM=u.object({case:br.describe("recommend id this assertion enforces"),evidence:br.describe("the exact assertion line from the file that checks that case's observable")});var WM=u.object({route:u.literal("persistence"),url:u.string().url()}).strict(),mg=u.object({kind:u.nativeEnum(pg).describe("seed: data the test creates in the app; runtime_mock: a mock on a Skyramp worker, which other tests reach too; env_override: an env value the app runs with. A stub inside the test's own process, such as a browser page's route, is none of these"),target:br.describe("the dependency, endpoint or data it affects"),mechanism:u.nativeEnum(hg).describe("test_code: the test applies and undoes it; skyramp_mocker: a mock the test applies on a Skyramp worker; recipe_override: the mocker cannot reach the dependency (its URL is fixed in the build)"),detail:br.describe("what it sets up"),worker:br.optional().describe("skyramp_mocker: host:port of the worker the test applies the mock to (default localhost:35142)"),safety:WM.optional().describe("shared seed that keeps its data only because the environment permits it: the persistence route and the exact endpoint; Testbot checks the current permission just before it runs the test"),cleanup:br.optional().describe("seed: when its data can be removed, a command that removes it if the test does not; otherwise declare leftBehind instead. Run as written and without a shell: give real values, not a placeholder such as <id>, single-quote an argument that holds shell syntax, or put the logic in a script in the repository and run that"),leftBehind:br.optional().describe("seed: the records the test creates and cannot remove from the app, and how to find them")}).refine(e=>!e.leftBehind||e.kind==="seed",{message:"leftBehind is for a seed only: a runtime mock or an env override creates no records",path:["leftBehind"]}),ZM=u.object({file:br.describe("staged path under .skyramp/staged/"),source:u.nativeEnum(sv),language:br,covers:u.array(u.string()).min(1,"must be a non-empty array of recommend ids").describe("recommend ids this test covers"),assertions:u.array(qM).min(1,"must be a non-empty array").describe("one per case covered, citing the real line"),context:u.array(mg).optional().describe("what the test sets up against the running app, in order: data it seeds, Skyramp mocks it applies, env overrides; omit when none")}),P5=u.object({schemaVersion:u.literal(1),tests:u.array(ZM),deferredUi:u.array(u.string()).describe("recommend ui ids left for the UI stage (generate) \u2014 [] for generate-ui"),summary:br.describe("one paragraph")});var av=(s=>(s.Place="place",s.Update="update",s.Regenerate="regenerate",s.Delete="delete",s.Verify="verify",s.None="none",s))(av||{}),cv=(i=>(i.Pass="pass",i.Fail="fail",i.Skip="skip",i))(cv||{}),nt=u.string().trim().min(1),Av=(r=>(r.Setup="setup",r.Expectation="expectation",r.Locator="locator",r.Other="other",r))(Av||{}),KM=u.object({kind:u.nativeEnum(Av),reason:nt.describe("what in the test is wrong, with the evidence: the setup error it raised, or the requirement or changed line its expectation contradicts")}),Ig=u.array(u.string().url().max(2048).regex(/^https?:\/\//i)).max(50),XM=u.object({case:nt.describe("a covers id \u2014 the recommend case this test realizes"),status:u.nativeEnum(cv),runtimeTargets:Ig.optional().describe("HTTP(S) URLs this case actually exercised in its current run; omit for in-process or mocked checks, never infer from test type"),environmentRestriction:nt.optional().describe("for a skipped case: what this run lacks to execute it; the test is still written"),fromJourney:u.boolean().optional(),testProblem:KM.optional().describe("[derived] write's reading of a failing case: the test, not the app, is at fault"),defect:u.boolean().optional().describe("[derived] write's reading of a failing case: true when the app is wrong and the test is right"),failure:u.string().optional().describe("[derived] for a failing case: the runner's failure for it, as printed")}).refine(e=>!e.environmentRestriction||e.status==="skip"&&!e.runtimeTargets?.length,{message:"an environment-restricted case must be skipped and have no runtimeTargets"}),eL=u.object({started:u.boolean().optional().describe("with exit null: true if the test command started (it was interrupted or timed out), false if it never started. Left out, Testbot counts it as possibly started, with its cleanup unknown"),exit:u.number({invalid_type_error:"must be a number or null"}).nullable().describe("process exit of the re-run; null when no SUT was available"),details:u.string().optional().describe("what failed, or why a file was not run \u2014 required on any non-zero exit"),tests:u.array(XM).optional().describe("ONE ENTRY PER CASE the file covers, its own result; must agree with exit (0 \u2192 no fail; non-zero \u2192 at least one, or the non-test reason in details). The report reads the file by these where they are given")}),tL=u.object({context:u.array(mg).optional().describe("[derived] setup declarations retained for every executed test, including maintained tests"),from:u.string().optional().describe("staged path \u2014 required for placements"),file:nt.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:nt.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),action:u.nativeEnum(av),covers:u.array(u.string()).optional().describe("recommend ids a placed test covers"),repro:u.boolean().optional().describe("this test is MEANT to fail \u2014 it reproduces a reported bug"),finding:u.boolean().optional().describe("a non-repro test that failed on a REAL product bug"),placementBroken:u.boolean().optional().describe('placement/harness problem one repair could not fix \u2014 every reran.tests entry is then "skip"'),keptReason:nt.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:nt.optional().describe('only for a test marked "runs alone": the command, from its checkout root and without a shell, that runs only this file and writes its JUnit XML into $SKYRAMP_RESULTS_DIR (named by its path: no shell expands it) \u2014 the harness runs it, so leave reran.exit null'),reran:eL,assertionCount:u.number().int().nonnegative().optional().describe("[derived] assertions reachable from the file, counted at write time"),addedOnly:u.boolean().optional().describe("[derived] an existing test file the run only added to: every line it had is still there"),added:u.array(nt).optional().describe("[derived] the cases of the test functions the run added to an existing file: functions it did not have"),staleOnBase:u.boolean().optional().describe("[derived] an existing test that fails the same way on the base branch: its failure is the test's own")}).refine(e=>e.action!=="place"||typeof e.from=="string"&&e.from.trim().length>0,{message:'is a place but has no "from" staged path',path:[]}),uv=(n=>(n.Junit="junit",n.Converter="converter",n))(uv||{}),rL=nt.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),nL=u.object({results:nt.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:u.nativeEnum(uv),run:nt.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:u.array(nt).min(1).describe("the items[].file paths this run covered"),cases:u.array(u.object({test:nt.describe("the test's name as the runner reports it, qualified by its class or file (e.g. tests/test_a.py::test_x) when the bare name repeats"),case:nt.describe("the covers id it realizes"),file:rL})).describe("map each reported test name to the case it covers")}),iL=u.object({suites:u.array(nL).min(1)}),V5=u.object({schemaVersion:u.literal(1),items:u.array(tL),runnerResults:iL.optional().describe("the JUnit XML your test runs wrote into $SKYRAMP_RESULTS_DIR, so the harness reads each test's result from the runner \u2014 omit only when no SUT is available"),ignored:u.array(u.string()).describe("existing tests assessed and deliberately left untouched"),summary:nt.describe("one paragraph")});var wl=rt(mv(),1),Nq=rt(z0(),1);var Mr;(function(e){e[e.OK=200]="OK",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.ResourceMoved=302]="ResourceMoved",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.TooManyRequests=429]="TooManyRequests",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout"})(Mr||(Mr={}));var G0;(function(e){e.Accept="accept",e.ContentType="content-type"})(G0||(G0={}));var V0;(function(e){e.ApplicationJson="application/json"})(V0||(V0={}));var W7=[Mr.MovedPermanently,Mr.ResourceMoved,Mr.SeeOther,Mr.TemporaryRedirect,Mr.PermanentRedirect],Z7=[Mr.BadGateway,Mr.ServiceUnavailable,Mr.GatewayTimeout];var Y0=require("os"),dc=require("fs"),jm=function(e,t,n,i){function r(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(l){try{A(i.next(l))}catch(d){s(d)}}function c(l){try{A(i.throw(l))}catch(d){s(d)}}function A(l){l.done?o(l.value):r(l.value).then(a,c)}A((i=i.apply(e,t||[])).next())})},{access:Tq,appendFile:$q,writeFile:Fq}=dc.promises,J0="GITHUB_STEP_SUMMARY";var Hm=class{constructor(){this._buffer=""}filePath(){return jm(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let t=process.env[J0];if(!t)throw new Error(`Unable to find environment variable for $${J0}. Check if your runtime environment supports job summaries.`);try{yield Tq(t,dc.constants.R_OK|dc.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${t}'. Check if the file has correct read/write permissions.`)}return this._filePath=t,this._filePath})}wrap(t,n,i={}){let r=Object.entries(i).map(([o,s])=>` ${o}="${s}"`).join("");return n?`<${t}${r}>${n}</${t}>`:`<${t}${r}>`}write(t){return jm(this,void 0,void 0,function*(){let n=!!t?.overwrite,i=yield this.filePath();return yield(n?Fq:$q)(i,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return jm(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(t,n=!1){return this._buffer+=t,n?this.addEOL():this}addEOL(){return this.addRaw(Y0.EOL)}addCodeBlock(t,n){let i=Object.assign({},n&&{lang:n}),r=this.wrap("pre",this.wrap("code",t),i);return this.addRaw(r).addEOL()}addList(t,n=!1){let i=n?"ol":"ul",r=t.map(s=>this.wrap("li",s)).join(""),o=this.wrap(i,r);return this.addRaw(o).addEOL()}addTable(t){let n=t.map(r=>{let o=r.map(s=>{if(typeof s=="string")return this.wrap("td",s);let{header:a,data:c,colspan:A,rowspan:l}=s,d=a?"th":"td",f=Object.assign(Object.assign({},A&&{colspan:A}),l&&{rowspan:l});return this.wrap(d,c,f)}).join("");return this.wrap("tr",o)}).join(""),i=this.wrap("table",n);return this.addRaw(i).addEOL()}addDetails(t,n){let i=this.wrap("details",this.wrap("summary",t)+n);return this.addRaw(i).addEOL()}addImage(t,n,i){let{width:r,height:o}=i||{},s=Object.assign(Object.assign({},r&&{width:r}),o&&{height:o}),a=this.wrap("img",null,Object.assign({src:t,alt:n},s));return this.addRaw(a).addEOL()}addHeading(t,n){let i=`h${n}`,r=["h1","h2","h3","h4","h5","h6"].includes(i)?i:"h1",o=this.wrap(r,t);return this.addRaw(o).addEOL()}addSeparator(){let t=this.wrap("hr",null);return this.addRaw(t).addEOL()}addBreak(){let t=this.wrap("br",null);return this.addRaw(t).addEOL()}addQuote(t,n){let i=Object.assign({},n&&{cite:n}),r=this.wrap("blockquote",t,i);return this.addRaw(r).addEOL()}addLink(t,n){let i=this.wrap("a",t,{href:n});return this.addRaw(i).addEOL()}},aee=new Hm;var qm=rt(require("os"),1);var bl=rt(require("fs"),1);var{chmod:Mq,copyFile:Lq,lstat:Pq,mkdir:Oq,open:uee,readdir:zq,rename:Gq,rm:Vq,rmdir:lee,stat:Jq,symlink:Yq,unlink:jq}=bl.promises,Hq=process.platform==="win32";var dee=bl.constants.O_RDONLY;var mee=process.platform==="win32";var Cee=qm.default.platform(),Bee=qm.default.arch();var q0;(function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure"})(q0||(q0={}));function Z0(e){return e.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}var K0=rt(require("path"));var Wm=(r=>(r.Clean="clean",r.RecipeDrift="recipe-drift",r.ChangeBrokeBringup="change-broke-bringup",r.BringupFailed="bringup-failed",r))(Wm||{}),Fn=u.string().trim().min(1),eW=u.object({url:u.string().optional().describe("the URL probed, if the check is an HTTP request"),command:u.string().optional().describe("the command run, if the check is a script \u2014 preferred when auth is needed"),headers:u.record(u.string()).optional(),status:u.union([u.number(),u.string()]).optional().describe("expected HTTP status for a url check (default 200)"),output:Fn.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),tW=u.array(u.object({component:Fn.describe("a shared component listed above"),url:Fn.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:Fn.describe("what the URL returned, VERBATIM; this gate FETCHES each url")})).describe("only when shared components are listed above: one check per component whose deployed commit you found"),Hee=u.object({schemaVersion:u.literal(1),baseUrls:u.record(u.string()).optional().describe("service \u2192 base URL of the running app; omit on a failed bring-up, never invent one"),health:eW.optional(),teardown:Fn.describe("command that tears the SUT down"),dependencies:u.record(u.boolean()).optional().describe("EVERY backing service: true = really deployed, false = mocked; REQUIRED when the app came up"),outcome:u.nativeEnum(Wm).describe("clean | recipe-drift (you corrected the recipe) | change-broke-bringup (the PR broke it) | bringup-failed (environment, not the PR)"),recipeFixes:u.array(u.string()).optional().describe("required when outcome is recipe-drift: what was corrected"),bringupError:u.object({command:Fn,output:Fn}).optional().describe("required when bring-up failed: the exact failing command and what it printed"),suspectFiles:u.array(u.string()).optional().describe("required for change-broke-bringup: files THIS PR changed that the failure points at, relative to your working directory (a file in another checkout of the run: its absolute path)"),seeded:u.boolean(),startedAt:Fn.describe("ISO timestamp"),revisions:tW.optional(),missingSecrets:u.array(u.string().regex(ig)).optional().describe("bringup-failed only: each secret the app cannot start without that this run has no value for, by its environment variable name; never a value"),credentialsRefused:u.array(sg).optional().describe("only for credentials the prompt lists to test: each that was refused when you tested it, such as with a 401 or 403; leave it out when none was, or when none is listed"),recipeRecorded:u.boolean().optional().describe("[derived] whether the checkout had a recorded recipe before bring-up")});var ze=u.string().trim().min(1),kl=ze,Zm=(n=>(n.TestbotManaged="testbot_managed",n.CustomerDeployed="customer_deployed",n))(Zm||{}),Km=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],X0=(n=>(n.Refused="refused",n.NoValue="no_value",n))(X0||{}),rW=u.object({name:u.string().regex(pt),kind:u.nativeEnum(X0),explanation:ze.optional()}).strict(),e_=u.object({schemaVersion:u.literal(1),type:u.nativeEnum(Zm).optional(),repository:kl.optional().describe("namespace/name of the source whose checkout the recipe was written and proven in (SKYR-5380); a run replays it from there. Never on a customer_deployed plan"),status:u.enum(["ready","blocked"]),environment:Eo.optional(),components:u.array(u.object({name:ze,repository:ze.describe(`owner/repo, or "${Hr}" for a customer-deployed component no repository builds`),healthy:u.boolean(),url:u.string().min(1).nullable(),...og,credentials:u.array(u.string().regex(pt)).max(50).optional(),deployed:ze.nullable().optional().describe("customer_deployed only: the revision the component runs, as setup read it (WF-SETUP-22's Deployed now), or null when it could not tell")}).strict()),suites:u.array(u.object({framework:ze,file:ze,result:u.enum(["pass","fail","error"])}).strict()),inputsUsed:u.array(ze),inputsUsedHow:u.array(u.object({input:ze,how:ze}).strict()).optional(),inputsNotUsed:u.array(u.object({input:ze,reason:ze}).strict()),blockers:u.array(u.object({component:ze,problem:ze,evidence:ze,fix:ze,credential:rW.optional()}).strict()),replay:u.object({outcome:ze,durationSeconds:u.number().nonnegative().nullable()}).strict().nullable(),files:u.array(u.object({path:ze,content:u.string()}).strict())}).strict().superRefine((e,t)=>{e.inputsUsedHow?.forEach((r,o)=>{e.inputsUsed.includes(r.input)||t.addIssue({code:u.ZodIssueCode.custom,path:["inputsUsedHow",o,"input"],message:"not one of inputsUsed"})}),e.components.forEach((r,o)=>{r.credentials&&new Set(r.credentials).size!==r.credentials.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"credentials"],message:"names a credential twice"})});let n=e.type==="customer_deployed";n!==(e.environment!==void 0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["environment"],message:"an environment exactly when the plan's type is customer_deployed"}),n&&e.repository!==void 0&&t.addIssue({code:u.ZodIssueCode.custom,path:["repository"],message:"a customer_deployed plan names no repository"}),e.environment&&new Set(e.environment.credentials).size!==e.environment.credentials.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["environment","credentials"],message:"names a credential twice"});let i=new Set(e.components.map(r=>r.name));if(e.environment?.revisionSources.forEach((r,o)=>{r.components.forEach((s,a)=>{i.has(s)||t.addIssue({code:u.ZodIssueCode.custom,path:["environment","revisionSources",o,"components",a],message:"not one of components"})})}),e.components.forEach((r,o)=>{r.deployed!==void 0!==n&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"deployed"],message:"what a component runs exactly when the plan is customer_deployed"}),r.repository===Hr&&!n&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"repository"],message:`only a customer_deployed component is ${Hr}`})}),n&&(e.components.forEach((r,o)=>{e.components.findIndex(s=>s.name===r.name)!==o&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"name"],message:"names a component twice"})}),e.replay!==null&&t.addIssue({code:u.ZodIssueCode.custom,path:["replay"],message:"a customer_deployed plan is never replayed"}),e.files.forEach((r,o)=>{Km.includes(r.path)&&t.addIssue({code:u.ZodIssueCode.custom,path:["files",o,"path"],message:"a customer_deployed plan has no script that starts or stops the system"})})),n&&e.status==="ready"){let r=new Set(e.environment?.revisionSources.flatMap(o=>o.components));e.components.forEach((o,s)=>{o.repository!==Hr&&!r.has(o.name)&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",s,"name"],message:"a ready customer_deployed plan reads what every component a repository builds runs"})})}});var ete=["clean","recipe-drift"];function Sl(e){let t=K0.posix.normalize(e);return t===e&&(t===".skyramp/workspace.yml"||t.startsWith(".skyramp/sut/")&&t.length>13)}var t_=u.string().uuid(),xl=u.object({environmentId:u.string().uuid(),allowed:u.boolean(),revision:t_,updatedAt:u.string().datetime(),updatedBy:u.string().uuid()}).strict();var r_=(s=>(s.NoEnvironment="no_environment",s.NoRecordedGrant="no_recorded_grant",s.Unavailable="unavailable",s.Changed="changed",s.Denied="denied",s.OutOfScope="out_of_scope",s))(r_||{});var ite=u.object({environmentId:u.string().uuid(),environmentAddress:u.string().url(),revision:t_}).strict(),ote=u.object({refusal:u.nativeEnum(r_)}).strict();var I_=u.unknown().optional();var gc=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(gc||{}),rI=(o=>(o.Trigger="TRIGGER",o.Baseline="BASELINE",o.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",o.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",o.ManualOverride="MANUAL_OVERRIDE",o))(rI||{}),E_=(s=>(s.PullRequest="pull_request",s.ReadyForReview="ready_for_review",s.Schedule="schedule",s.Manual="manual",s.SutSetup="sut_setup",s.RevisionRead="revision_read",s))(E_||{}),oW=["sut_setup"],sW=["sut_setup","schedule","revision_read"];var y_=(t=>(t.PullRequest="pull_request",t))(y_||{}),C_=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))(C_||{}),n_=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var B_=(o=>(o.ReportUploaded="report_uploaded",o.NoReport="no_report",o.Cancelled="cancelled",o.RecipeUploaded="recipe_uploaded",o.RevisionsUploaded="revisions_uploaded",o))(B_||{}),Q_=(n=>(n.Running="running",n.Ended="ended",n))(Q_||{}),v_=(f=>(f.TimedOut="timed_out",f.AgentFailed="agent_failed",f.SetupFailed="setup_failed",f.CredentialMissing="credential_missing",f.RunnerLost="runner_lost",f.CheckoutFailed="checkout_failed",f.EnvironmentUnverified="environment_unverified",f.ModelProviderDenied="model_provider_denied",f.ModelProviderUnavailable="model_provider_unavailable",f.RunnerProviderNotReady="runner_provider_not_ready",f.MergeConflict="merge_conflict",f.EnvironmentUnavailable="environment_unavailable",f))(v_||{}),w_=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(w_||{}),nI=(n=>(n.Started="started",n.Finished="finished",n))(nI||{}),b_=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(b_||{});var k_=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(k_||{});var S_=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(S_||{}),iI=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(iI||{}),eI=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(eI||{});var oI=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(oI||{}),Kt=u.string().regex(/^[1-9][0-9]{0,18}$/),Xt=u.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),tI=u.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),x_=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;var Xe=u.string().regex(x_),at=u.string().regex(/^[0-9a-f]{64}$/),Nl=u.object({id:Xe,revision:Kt}).strict(),Tl={provider:u.literal("github"),providerAccountId:Kt,providerRepositoryId:Kt},$l={provider:u.literal("azure-devops"),providerAccountId:Xe,providerRepositoryId:Xe},mr=u.discriminatedUnion("provider",[u.object(Tl).strict(),u.object($l).strict()]),gte=u.discriminatedUnion("provider",[u.object(Tl).passthrough(),u.object($l).passthrough()]),Ul=e=>`${e.provider}:${e.providerRepositoryId}`,i_={namespace:u.string().min(1),name:u.string().min(1)},R_=u.discriminatedUnion("provider",[u.object({...Tl,...i_}).strict(),u.object({...$l,...i_}).strict()]),o_=u.object({ref:u.string().min(1),revision:Xt}).strict(),aW=u.object({kind:u.nativeEnum(C_),number:Kt.optional(),ref:u.string().min(1),revision:Xt,reason:u.nativeEnum(rI)}).strict(),cW=u.object({repository:R_,revision:Xt,ref:u.string().nullable(),reason:u.nativeEnum(rI),change:u.object({kind:u.nativeEnum(y_),number:Kt,base:o_.optional()}).strict().nullable(),compareWith:o_.optional(),merge:u.array(aW).min(2).optional()}).strict();function AW(e){let t=e.merge;if(!t)return null;if(e.change||e.compareWith)return{path:["merge"],message:"a merged source names no change and no compareWith"};if(e.ref===null)return{path:["ref"],message:"a merged source names its baseline branch"};let n=new Set,i=new Set;for(let[o,s]of t.entries()){if(s.kind==="pull_request"!=(s.number!==void 0))return{path:["merge",o,"number"],message:"a pull request names its number, and a branch none"};if(!n_.includes(s.reason))return{path:["merge",o,"reason"],message:`${s.reason} does not select a merged revision`};if(s.kind==="branch"&&s.reason!=="MANUAL_OVERRIDE")return{path:["merge",o,"reason"],message:"only a person chooses a branch to merge"};if(s.ref===e.ref)return{path:["merge",o,"ref"],message:"the baseline branch is what the source merges onto"};if(s.number!==void 0&&n.has(s.number)||i.has(s.ref))return{path:["merge",o],message:"names a revision the source already merges"};s.number!==void 0&&n.add(s.number),i.add(s.ref)}let r=n_.find(o=>t.some(s=>s.reason===o));return e.reason!==r?{path:["reason"],message:`a source that merges these revisions is ${r}`}:null}function uW(e){if(e.trigger.kind==="revision_read"!=!e.baseline)return e.baseline?"a revision_read run names no baseline":"names its baseline";if(!e.baseline)return null;let{confirmedRunId:t,initialBaselineId:n,comparisonBaselineId:i,sources:r}=e.baseline;if([t,n,i].filter(A=>A!=null).length>1)return"a run compares with one baseline";let o=e.trigger.kind==="schedule"&&t!==null||n!==void 0||i!==void 0;if(!r)return o?"names every source of the snapshot, once":null;if(t===null&&n===void 0&&i===void 0)return"a run with no Confirmed Baseline names no baseline sources";let s=new Set(e.sources.map(A=>Ul(A.repository))),a=new Set(r.map(A=>Ul(A.repository)));return a.size===r.length&&a.size===s.size&&[...a].every(A=>s.has(A))?null:"names every source of the snapshot, once"}var D_=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,__=/^[1-9][0-9]{0,18}$/,s_=new RegExp(`${D_.source}|${__.source}`),a_=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,lW=u.union([u.object({source:u.literal("jira"),site:u.string().regex(a_),key:u.string().regex(D_),updated:u.string().datetime(),contentHash:at}).strict(),u.object({source:u.literal("confluence"),site:u.string().regex(a_),key:u.string().regex(__),version:u.number().int().positive(),contentHash:at}).strict(),u.object({source:u.literal("other"),key:u.string().regex(bA),contentHash:at}).strict(),u.object({source:u.literal("other"),key:u.string().regex(kA),contentHash:at,fileName:u.string().min(1).max(255),mediaType:u.nativeEnum(SA)}).strict()]),c_=u.union([u.literal("jira"),u.literal("confluence")]),pte=u.object({schemaVersion:u.literal(1),items:u.array(u.union([u.object({source:c_,site:u.string(),key:u.string().regex(s_),state:u.literal("read"),text:u.string(),version:u.string().min(1),contentMatches:u.boolean()}).strict(),u.object({source:c_,site:u.string(),key:u.string().regex(s_),state:u.literal("not_read"),reason:u.nativeEnum(aa)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(bA),state:u.literal("read"),text:u.string(),version:u.string().min(1),contentMatches:u.boolean()}).strict(),u.object({source:u.literal("other"),key:u.string().regex(bA),state:u.literal("not_read"),reason:u.nativeEnum(aa)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(kA),state:u.literal("read"),version:at,fileName:u.string().min(1).max(255),mediaType:u.nativeEnum(SA)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(kA),state:u.literal("not_read"),reason:u.nativeEnum(aa)}).strict()])),instructions:u.array(u.string()).optional()}).strict(),dW=u.object({resultId:u.string().min(1),repository:u.string().min(1),testType:u.string().min(1),path:u.string(),finding:u.string().min(1)}).strict(),fW=u.object({schemaVersion:u.literal(1),runId:Xe,skyrampOrgId:Xe,target:Nl,policy:Nl.nullable(),trigger:u.object({kind:u.nativeEnum(E_),requestedAt:u.string().datetime()}).strict(),configuration:u.object({captureId:Xe,revision:Kt.nullable(),hash:at}).strict(),baseline:u.object({confirmedRunId:Xe.nullable(),initialBaselineId:Xe.optional(),comparisonBaselineId:Xe.optional(),knownFailures:u.array(dW).optional(),sources:u.array(u.object({repository:mr,revision:Xt}).strict()).optional()}).strict().optional(),sources:u.array(cW).min(1).max(1e3),execution:u.object({provider:u.nativeEnum(gc),repository:R_,workflowPath:u.string(),ref:u.string()}).strict(),credentials:u.array(u.object({name:u.string(),purpose:u.nativeEnum(tg),required:u.boolean()}).strict()),requirements:u.array(lW).min(1).optional(),instructions:u.object({contentHash:at}).strict().optional(),deployedRevisions:u.array(u.object({repository:mr,revision:Xt}).strict()).min(1).optional()}).strict().superRefine((e,t)=>{let n=new Set;(e.requirements??[]).forEach((c,A)=>{let l="fileName"in c?"file":"pasted";c.source==="other"&&c.key!==`${l}-${c.contentHash.slice(0,16)}`&&t.addIssue({code:u.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",A,"key"]});let d=ov({source:c.source,key:c.key});n.has(d)&&t.addIssue({code:u.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",A,"key"]}),n.add(d)});let i=e.trigger.kind,r=oW.includes(i);r!==(e.policy===null)&&t.addIssue({code:u.ZodIssueCode.custom,path:["policy"],message:r?`a ${i} run has no policy`:"names the policy revision"}),e.baseline?.knownFailures&&!e.baseline.comparisonBaselineId&&t.addIssue({code:u.ZodIssueCode.custom,path:["baseline","knownFailures"],message:"known failures require a chosen comparison checkpoint"});let o=uW(e);o&&t.addIssue({code:u.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:o}),sW.includes(i)&&e.sources.forEach((c,A)=>{c.reason!=="BASELINE"&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",A,"reason"],message:`a ${i} run selects only BASELINE sources`})}),e.deployedRevisions&&i!=="manual"&&t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions"],message:"only a manual run pins deployed revisions"});let s=new Set(e.sources.map(c=>Ul(c.repository))),a=new Set;(e.deployedRevisions??[]).forEach((c,A)=>{let l=Ul(c.repository);s.has(l)?a.has(l)&&t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions",A,"repository"],message:"repository appears twice"}):t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions",A,"repository"],message:"names a repository outside the snapshot"}),a.add(l)}),e.sources.forEach((c,A)=>{c.compareWith&&(c.reason!=="MANUAL_OVERRIDE"||c.change)&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",A,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"}),e.baseline?.comparisonBaselineId&&(c.change?.base||c.compareWith||c.merge)&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",A],message:"a chosen checkpoint cannot be combined with a source comparison base or merge"});let l=AW(c);l&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",A,...l.path],message:l.message})})});var N_=(n=>(n.Person="person",n.Policy="policy",n))(N_||{}),gW=u.object({kind:u.nativeEnum(N_),name:u.string().min(1).max(256)}).strict(),pW=u.object({mcp:u.discriminatedUnion("source",[u.object({source:u.literal("npm"),version:u.string().regex(/^[A-Za-z0-9][A-Za-z0-9.+_-]{0,63}$/).nullable()}).strict(),u.object({source:u.literal("github"),ref:u.string().regex(/^[A-Za-z0-9._/-]{1,255}$/)}).strict()]),bedrock:u.object({region:u.string().regex(/^[a-z]{2}(-[a-z]+)+-[0-9]$/),roleArn:u.string().regex(/^arn:aws(-[a-z]+)*:iam::[0-9]{12}:role\/[\w+=,.@/-]{1,512}$/)}).strict().nullable()}).strict(),hte=u.object({schemaVersion:u.literal(1),attempt:u.object({id:Xe,number:u.number().int().positive(),deadlineAt:u.string().datetime()}).strict(),manifest:fW,manifestHash:at,entitlements:u.array(u.string()).optional(),runToken:u.string().min(1).optional(),requestedBy:gW.nullable().optional(),writeAllowed:u.boolean().optional(),claudeCodeVersion:u.string().regex(/^[0-9]+\.[0-9]+\.[0-9]+$/,"an exact version, such as 2.1.290").nullable().optional(),deployedRevisions:u.array(u.object({repository:mr,revision:Xt}).strict()).optional(),statedRevisions:u.array(u.object({repository:mr,revision:Xt}).strict()).optional(),runSettings:pW.optional()}).strict(),A_={providerRunAttempt:u.number().int().positive(),workflowRef:u.string().min(1)},hW=u.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),mte=u.object({schemaVersion:u.literal(1),runId:Xe,execution:u.discriminatedUnion("provider",[u.object({...A_,provider:u.literal("github"),repository:u.object(Tl).strict(),providerRunId:Kt}).strict(),u.object({...A_,provider:u.literal("azure-devops"),repository:u.object($l).strict(),providerRunId:hW}).strict()]),requester:u.literal(!0).optional(),writeCheck:u.literal(!0).optional(),claudeCodePin:u.literal(!0).optional(),deployedPins:u.literal(!0).optional(),statedPins:u.literal(!0).optional(),runSettings:u.literal(!0).optional(),credentialKinds:u.literal(!0).optional(),credentialBlockers:u.literal(!0).optional()}).strict(),u_=u.object({repository:mr,number:Kt,commitSha:Xt.optional()}).strict(),Rl=u.array(u.object({repository:mr,reason:u.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),mW=u.object({branch:tI.optional(),commitSha:Xt.optional()}).strict(),U_=4096,IW=u.array(u.object({file:u.string().max(4096).regex(/\S/),dependsOn:u.array(u.string().max(2048).regex(/\S/)).max(100)}).strict()).min(1).max(500),l_=u.object({repository:mr,message:u.string().max(U_),...mW.shape,heldBack:IW.optional()}).strict(),EW=u.discriminatedUnion("status",[u.object({status:u.literal("none"),noTests:Rl}).strict(),u.object({status:u.literal("delivered"),noTests:Rl,pullRequests:u.array(u_).min(1)}).strict(),u.object({status:u.literal("partial"),noTests:Rl,pullRequests:u.array(u_).min(1),failures:u.array(l_).min(1)}).strict(),u.object({status:u.literal("failed"),message:u.string().max(U_),noTests:Rl,failures:u.array(l_).min(1).optional()}).strict()]),Ite=1024*1024,Ete=16*1024*1024,fc={id:4096,text:16384,businessCase:65536},yW={id:fc.id,statement:fc.text,rows:1e3},d_=u.string().min(1).max(fc.id),_l=u.string().max(fc.text),Dl=(e,t)=>u.array(u.object({[e]:_l}).strict()).max(t).optional(),CW=u.object({language:u.custom(e=>e==="ja","Invalid"),businessCaseAnalysis:u.string().max(fc.businessCase),validation:u.object({rationale:_l.min(1),gaps:u.array(u.string().min(1).max(4096)).max(200)}).strict().optional(),changes:u.array(u.object({id:d_,text:_l}).strict()).max(1e3).optional(),requirements:u.array(u.object({id:d_,statement:_l}).strict()).max(yW.rows).optional(),issuesFound:Dl("description",5e3),newTestsCreated:Dl("description",5e3),testResults:Dl("details",5e3),caveats:Dl("text",100)}).strict(),BW=u.object({blockedPreflight:u.object({file:u.string().min(1),repository:u.string().min(1).optional(),reason:u.string().min(1).max(300),evidence:u.string().min(1).max(400)}).strict().optional(),sufficiency:u.nativeEnum(ug),rationale:u.string().min(1),gaps:u.array(u.string().min(1)),acceptedEvidence:u.array(u.object({kind:u.nativeEnum(ca),repository:u.string().min(1),revision:Xt,reference:u.string().min(1),summary:u.string().min(1)}).strict()),actionRequired:u.array(u.nativeEnum(lg))}).strict().superRefine((e,t)=>{e.sufficiency==="insufficient"!=e.gaps.length>0&&t.addIssue({code:u.ZodIssueCode.custom,path:["gaps"],message:"only insufficient evidence names gaps, and it names at least one"}),new Set(e.actionRequired).size!==e.actionRequired.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),Xm=500,QW=2048,vW=1e3,wW=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,f_=e=>e.length>0&&e.length<=64&&e===e.trim()&&!wW.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),T_=e=>{if(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/.test(e))return!0;let[t,n,i,...r]=e.split("/");return e.length<=201&&r.length===0&&i!==void 0&&/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,48}[A-Za-z0-9])?$/.test(t)&&f_(n)&&f_(i)},bW=u.object({testResults:u.array(u.object({resultId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:u.string().refine(T_,"Invalid"),testType:u.string(),runtimeTargets:Ig.optional(),endpoint:u.string(),status:u.enum(["Pass","Fail","Skipped"]),details:u.string(),fileName:u.string().optional(),testId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:u.object({kind:u.nativeEnum(dg),family:u.nativeEnum(fg).optional()}).strict().optional(),origin:u.nativeEnum(Ag).optional()}).strict()),validation:BW,changes:u.array(u.object({id:u.string().min(1).max(512),text:u.string().max(16384),source:u.string().max(QW),testedBy:u.array(u.string().min(1).max(1024)).max(Xm),writtenBy:u.array(u.string().min(1).max(1024)).max(Xm),maintainedBy:u.array(u.string().min(1).max(1024)).max(Xm)}).strict()).max(vW).optional(),traceVersion:u.literal(1),display:CW.optional()}).passthrough().superRefine((e,t)=>{let n=e.display,i={issuesFound:e.issuesFound,newTestsCreated:e.newTestsCreated,testResults:e.testResults,caveats:e.caveats};for(let o of["issuesFound","newTestsCreated","testResults","caveats"]){let s=n?.[o];s&&s.length!==(Array.isArray(i[o])?i[o].length:0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["display",o],message:`has not one row per ${o} row`})}n?.validation&&n.validation.gaps.length!==e.validation.gaps.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["display","validation","gaps"],message:"has not one gap per validation gap"});let r=new Set;e.testResults.forEach((o,s)=>{let a=o.failureCause;a&&o.status==="Pass"&&t.addIssue({code:u.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"a passing result has no failure cause"}),a&&a.kind==="environment"!=(a.family!==void 0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"an environment cause names its family, and no other cause does"});let c=["testResults",s,"resultId"],A=o.resultId.slice(`${o.repository}:${o.testType}:`.length);(!o.resultId.startsWith(`${o.repository}:${o.testType}:`)||A===""||A.startsWith("/")||A.startsWith("#"))&&t.addIssue({code:u.ZodIssueCode.custom,path:c,message:"is not repository:testType:path for this result"}),r.has(o.resultId)&&t.addIssue({code:u.ZodIssueCode.custom,path:c,message:"stable identity repeated"}),r.add(o.resultId)})});var kW=50,SW=u.discriminatedUnion("kind",[u.object({kind:u.literal("branch_pushed"),repository:mr,branch:tI,commit:Xt}).strict(),u.object({kind:u.enum(["pull_request_opened","pull_request_edited"]),repository:mr,number:Kt,branch:tI}).strict()]),xW=100,RW=2048,yte=u.object({records:u.array(u.string().regex(/^https?:\/\/[^\s/?#@]+(\/[^\s?#]*)?$/).max(RW)).max(xW),unlisted:u.number().int().nonnegative()}).strict().refine(e=>e.records.length+e.unlisted>0,"names at least one create"),DW=u.object({schemaVersion:u.literal(1),run:u.object({runId:Xe,attemptNumber:u.number().int().positive(),manifestHash:at}).strict(),target:Nl,policy:Nl,provenance:u.object({sources:u.array(u.object({repository:mr,revision:Xt}).strict()),firstQualification:u.literal(!0).optional()}).strict(),delivery:u.object({generatedTests:EW}).strict(),producer:u.object({testbot:u.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:u.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:bW,githubWrites:u.array(SW).max(kW).optional()}).strict(),$_=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))($_||{}),_W=200,NW=u.object({cause:u.nativeEnum($_),credential:u.string().regex(pt).optional(),reason:u.string().trim().min(1).max(_W).optional()}).strict().refine(e=>e.cause==="credential_rejected"==(e.credential!==void 0&&e.reason!==void 0),{message:"a credential_rejected check, and only one, names the credential and why"}),UW=u.object({name:u.string().regex(pt),purpose:u.enum(["sut_access","other"]),required:u.boolean(),how:u.string().trim().min(1).max(ng)}).strict(),Cte=DW.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:e_,check:NW.optional(),inputs:u.array(UW).min(1).max(50).optional()}).strict().superRefine(({recipe:e},t)=>{let n=(o,s)=>t.addIssue({code:u.ZodIssueCode.custom,path:["recipe",...o],message:s});e.status==="blocked"&&e.blockers.length===0&&n(["blockers"],"a blocked recipe names at least one blocker");let i=new Set,r=0;e.files.forEach((o,s)=>{Sl(o.path)||n(["files",s,"path"],"is not a file under .skyramp/sut/, or the .skyramp/workspace.yml a recipe stored before SKYR-5829 carries"),i.has(o.path)&&n(["files",s,"path"],"file repeated"),i.add(o.path),iv.test(o.content)&&n(["files",s,"content"],"is not text");let a=Buffer.byteLength(o.content,"utf8");r+=a,a>ag&&n(["files",s,"content"],`larger than ${ag} bytes`)}),r>cg&&n(["files"],`recipe text over ${cg} bytes in total`)}),Bte=u.object({components:u.array(u.object({name:u.string().min(1),repository:u.string().refine(T_,"Invalid"),observedRevision:u.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:u.nativeEnum(gg),evidence:u.string()}).strict().refine(e=>e.source!=="agent"||e.observedRevision===null,{path:["observedRevision"],message:"a component only an agent session can read names no revision"}))}).strict();var Qte=u.object({schemaVersion:u.literal(1),stage:u.nativeEnum(w_),event:u.nativeEnum(nI),status:u.nativeEnum(b_).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),Fl=100,TW=5e3,Vi=2e3,g_=100,F_=/^[A-Za-z0-9_-]{1,64}$/,$W=20,FW=200,MW=100,LW=100,PW=200,p_="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",OW=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${p_}/${p_})$`),zW=500,h_=50,GW=10,VW=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,M_=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,Mt=e=>u.string().max(e).refine(t=>t.trim().length>0&&!M_.test(t),"blank, or not text"),Lr={sequence:u.number().int().min(1).max(TW),at:u.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},L_=u.object({...Lr,kind:u.literal("reply"),to:u.string().uuid(),outcome:u.nativeEnum(S_),accepted:u.boolean(),text:Mt(Vi),note:u.object({source:u.enum(["target","environment"]),quote:Mt(Vi)}).strict().optional(),kept:Mt(Vi).optional()}).strict();function P_(e,t){if(e.kind!=="reply")return;let n=e;n.accepted!==(n.outcome==="answered"||n.outcome==="followed")&&t.addIssue({code:u.ZodIssueCode.custom,path:["accepted"],message:"accepted exactly when answered or followed"}),n.note&&n.outcome!=="not_followed"&&t.addIssue({code:u.ZodIssueCode.custom,path:["note"],message:"a note only when not_followed"}),n.kept&&n.outcome!=="followed"&&t.addIssue({code:u.ZodIssueCode.custom,path:["kept"],message:"kept only when followed"})}var JW=u.discriminatedUnion("kind",[u.object({...Lr,kind:u.literal("log"),phase:u.nativeEnum(iI),text:Mt(Vi)}).strict(),u.object({...Lr,kind:u.literal("component"),name:Mt(g_),repository:Mt(PW).refine(e=>OW.test(e)||e===Hr,"not owner/name"),file:Mt(zW).nullable(),status:u.nativeEnum(oI),version:Mt(LW).optional()}).strict(),L_,u.object({...Lr,kind:u.literal("question"),id:u.string().regex(F_),type:u.nativeEnum(k_),text:Mt(Vi),component:Mt(g_).nullable(),choices:u.array(Mt(FW)).max($W),placeholder:Mt(MW).optional()}).strict(),u.object({...Lr,kind:u.literal("delivered"),ids:u.array(u.string().uuid()).max(Fl)}).strict(),u.object({...Lr,kind:u.literal("credentials"),names:u.array(u.string().regex(pt)).min(1).max(h_),logins:u.array(u.object({key:u.string().regex(VW),usernameVariable:u.string().regex(pt),passwordVariable:u.string().regex(pt)}).strict()).min(1).max(GW).optional(),variables:u.array(u.string().regex(pt)).min(1).max(h_).optional()}).strict()]).superRefine((e,t)=>{if(P_(e,t),e.kind==="credentials"&&new Set(e.names).size!==e.names.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["names"],message:"a name twice"}),e.kind==="credentials"&&e.logins){let n=e.logins.map(i=>Z0(i.key));new Set(n).size!==n.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["logins"],message:"a key twice"}),e.logins.forEach((i,r)=>{for(let o of["usernameVariable","passwordVariable"])e.names.includes(i[o])||t.addIssue({code:u.ZodIssueCode.custom,path:["logins",r,o],message:"not one of the names"})})}e.kind==="credentials"&&e.variables&&(new Set(e.variables).size!==e.variables.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["variables"],message:"a name twice"}),e.variables.forEach((n,i)=>{e.names.includes(n)||t.addIssue({code:u.ZodIssueCode.custom,path:["variables",i],message:"not one of the names"})})),e.kind==="question"&&(e.type==="free_text"!=(e.choices.length===0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(e.choices).size!==e.choices.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),vte=u.object({schemaVersion:u.literal(1),events:u.array(JW).max(Fl)}).strict(),YW=u.discriminatedUnion("kind",[u.object({...Lr,kind:u.literal("log"),stage:u.nativeEnum(eI),text:Mt(Vi)}).strict(),L_,u.object({...Lr,kind:u.literal("delivered"),ids:u.array(u.string().uuid()).max(Fl)}).strict(),u.object({...Lr,kind:u.literal("stage"),stage:u.nativeEnum(eI),event:u.nativeEnum(nI)}).strict(),u.object({...Lr,kind:u.literal("test"),resultId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/),status:u.enum(["Pass","Fail","Skipped"]),details:u.string().max(Vi).refine(e=>!M_.test(e),"not text")}).strict()]).superRefine(P_),wte=u.object({schemaVersion:u.literal(1),events:u.array(YW).max(Fl)}).strict(),m_={id:u.string().uuid(),text:u.string(),by:u.string().nullable(),at:u.string(),replied:u.literal(!0).optional()},O_=u.discriminatedUnion("kind",[u.object({...m_,kind:u.literal("instruction"),question:u.null()}),u.object({...m_,kind:u.literal("answer"),question:u.string().regex(F_)})]),z_=u.string().regex(/^[A-Za-z0-9+/]{43}=$/),jW=u.object({id:u.string().uuid(),revision:u.string(),by:u.string().nullable(),at:u.string(),target:u.string(),own:u.object({source:u.enum(["policy","test_environment"]),text:u.string()}).nullable()}),bte=u.object({schemaVersion:u.literal(1),leftOut:u.array(u.string()),messages:u.array(O_).optional(),stop:u.object({key:z_}).optional(),notes:jW.optional()}),kte=u.object({schemaVersion:u.literal(1),messages:u.array(O_).optional()});var HW=500*1024*1024,G_=u.object({id:Kt,name:u.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:Kt,expiresAt:u.string().datetime()}).strict(),Ste=u.object({schemaVersion:u.literal(1),artifact:G_,sessionId:Xe,contentHash:at,bytes:u.number().int().min(1).max(HW)}).strict(),xte=u.object({schemaVersion:u.literal(1),checkpoint:u.object({artifact:G_,repository:u.object({namespace:u.string().min(1),name:u.string().min(1)}).strict(),sessionId:Xe,contentHash:at,key:z_}).strict().nullable()}).strict(),qW=200,hs=100,V_=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(V_||{}),WW=u.object({kind:u.nativeEnum(V_),setup:u.object({runId:Xe,endedAt:u.string().nullable(),outcome:u.string().nullable()}).strict(),components:u.array(u.object({name:u.string().min(1),repository:u.string().min(1),status:u.nativeEnum(oI)}).strict()).max(hs),credentials:u.array(u.string().min(1)).max(hs),answers:u.array(u.object({question:u.string(),answer:u.string().nullable()}).strict()).max(hs),instructions:u.array(u.object({text:u.string(),reply:u.string().nullable()}).strict()).max(hs),log:u.array(u.object({phase:u.nativeEnum(iI),text:u.string()}).strict()).max(qW),recipe:u.object({files:u.array(u.object({path:u.string().min(1),content:u.string()}).strict()).max(hs),blockers:u.array(u.object({component:u.string(),problem:u.string(),evidence:u.string(),fix:u.string()}).strict()).max(hs)}).strict().optional()}).strict(),Rte=u.object({schemaVersion:u.literal(1),context:WW.nullable()}).strict(),Dte=u.object({schemaVersion:u.literal(1),configuration:u.object({captureId:Xe,revision:Kt.nullable(),hash:at}).strict(),capture:u.object({schemaVersion:u.literal(1),settings:u.object({target:u.object({environment:u.unknown()}).passthrough(),timeoutMinutes:u.number().int().positive(),answerWaitMinutes:u.number().int().positive().optional(),testEnvironment:u.object({name:u.string().min(1),address:u.string().min(1).optional(),readyWhen:u.string().min(1).optional(),environmentId:u.string().uuid().optional(),persistentDataPolicy:I_}).passthrough().optional()}).passthrough(),provenance:u.object({}).passthrough(),hash:at}).strict()}).strict(),_te=u.object({schemaVersion:u.literal(1),environmentId:u.string().uuid().nullable(),environmentAddress:u.string().url().nullable(),persistentDataPolicy:xl.nullable()}).strict(),ZW=Eo.extend({environmentId:u.string().uuid().optional(),persistentDataPolicy:I_,version:u.number().int().positive(),components:u.array(u.object({name:u.string().min(1),repository:u.string().min(1)}).strict()),contentHash:at.optional(),files:u.array(u.object({path:u.string().refine(e=>Sl(e)&&!Km.includes(e),"not a file of a customer_deployed plan"),content:u.string()}).strict()).optional()}).strict(),Nte=u.object({schemaVersion:u.literal(1),testEnvironment:ZW.nullable().optional(),runtimePlan:u.object({version:u.number().int().positive(),contentHash:at,files:u.array(u.object({path:u.string().refine(Sl,"not a recipe file path"),content:u.string()}).strict()).min(1),repository:kl.optional(),recipeRepository:kl.optional(),recipe:u.record(u.unknown()).optional()}).strict().nullable()}).strict().refine(e=>!(e.runtimePlan&&e.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),Ute=u.object({schemaVersion:u.literal(1),state:u.nativeEnum(Q_),ending:u.nativeEnum(B_).nullable(),cause:u.nativeEnum(v_).nullable(),deadlineAt:u.string().datetime()}).strict();var KW=50,Tte=u.object({repository:mr,revisions:u.array(u.number().int().nonnegative()).min(1).max(2).refine(e=>e.length<2||e[0]<e[1],"two revisions name the earlier first"),files:u.array(u.string().min(1)).min(1).max(KW)}).strict();var XW=".skyramp/sut/deployed-revisions.sh",J_=(n=>(n.Running="running",n.Requested="requested",n))(J_||{});var Vte=new Set(Object.values(J_));var Jte=`Fix ${XW} so it prints the full commit each component runs, then set it up again.`;var tZ=/^(login|logout|signin|sign-in|signup|sign-up|auth|oauth|token|session)$/i,rZ=/^(login|logout|signin|sign-in|signup|sign-up|auth|oauth|token|sessions?)$/i,nZ=/(^|\/)(graphql(\.json)?|gql)(\/|$)/i,iZ=["id","uuid","_id","pk"],oZ=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,sZ=/^[0-9a-f]{24}$/i,H_=/^\d+$/,aZ=/^(token|jwt|(access|refresh|id|session)[-_]?token)$/i;function sI(e,t){if(e.toUpperCase()!=="POST")return!1;let n;try{n=new URL(t)}catch{return!1}let i=n.pathname.split("/").filter(Boolean),r=i.pop();return!!r&&!tZ.test(r)&&!i.some(o=>rZ.test(o))&&!nZ.test(n.pathname)}function q_(e){if(typeof e=="number")return Number.isSafeInteger(e)&&e>=0?e:void 0;if(typeof e=="string"&&(H_.test(e)||oZ.test(e)||sZ.test(e)))return e}function cZ(e,t){let n=String(e).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`(^|[^A-Za-z0-9])${n}($|[^A-Za-z0-9])`,"i");for(let[r,o]of Object.entries(t)){let s=r.toLowerCase();if(s==="location"||s==="content-location"||o===void 0)continue;let a=s==="set-cookie";if(!(!a&&H_.test(String(e))))for(let c of Array.isArray(o)?o:[o]){let A=a?c.split(";")[0].split("=").slice(1).join("="):c;if(i.test(A))return!0}}return!1}function W_(e,t,n,i,r){if(!sI(e,t)||n!==201)return{kind:"not-a-create"};let o={};try{let f=r===null||r.trim()===""?{}:JSON.parse(r);f&&typeof f=="object"&&!Array.isArray(f)&&(o=f)}catch{}if(Object.keys(o).some(f=>aZ.test(f)))return{kind:"sign-in"};let s=new URL(t);s.search="",s.hash="";let a=s.toString().replace(/\/+$/,""),c=typeof i.location=="string"?AZ(a,i.location):void 0,A=iZ.find(f=>o[f]!==void 0),l=A?q_(o[A]):void 0,d=c??(l===void 0?void 0:{entityUrl:`${a}/${l}`,id:l});return d?cZ(d.id,i)?{kind:"sign-in"}:{kind:"record",record:d}:i["set-cookie"]===void 0?{kind:"unnamed"}:{kind:"sign-in"}}function AZ(e,t){let n;try{n=new URL(t,`${e}/`)}catch{return}let i=new URL(e);if(n.origin!==i.origin)return;let r=n.pathname.replace(/\/+$/,"");if(!r.startsWith(`${i.pathname}/`))return;let o=r.slice(i.pathname.length+1),s=o.includes("/")?void 0:q_(o);return s===void 0?void 0:{entityUrl:`${e}/${s}`,id:s}}function Ml(e){try{let t=new URL(e);return t.origin+t.pathname.replace(/\/+$/,"")}catch{return}}function Z_(e,t){let n=Ml(t);return!!n&&e.some(i=>n===i||n.startsWith(`${i}/`))}var AF=require("crypto"),tt=rt(require("fs")),Zn=rt(require("http")),pX=rt(require("https")),Hf=rt(require("dns")),uF=require("module"),Le=rt(require("net"));var hA=rt(require("path")),qf=require("stream"),lF=require("stream/promises"),MQ=require("timers/promises"),Kn=rt(require("tls"));var M={};Br(M,{$brand:()=>yI,$input:()=>Yy,$output:()=>Jy,INVALID:()=>ut,NEVER:()=>EI,TimePrecision:()=>iC,ZodAny:()=>JB,ZodArray:()=>qB,ZodBase64:()=>Tf,ZodBase64URL:()=>$f,ZodBigInt:()=>ea,ZodBigIntFormat:()=>Lf,ZodBoolean:()=>Xs,ZodCIDRv4:()=>Nf,ZodCIDRv6:()=>Uf,ZodCUID:()=>bf,ZodCUID2:()=>kf,ZodCatch:()=>hQ,ZodCodec:()=>AA,ZodCompileAsyncError:()=>Er,ZodCompileUnsupportedError:()=>oe,ZodCreditCard:()=>FB,ZodCustom:()=>uA,ZodCustomStringFormat:()=>ao,ZodDate:()=>nA,ZodDefault:()=>uQ,ZodDiscriminatedUnion:()=>ZB,ZodE164:()=>Ff,ZodEmail:()=>Bf,ZodEmoji:()=>vf,ZodEnum:()=>Ws,ZodError:()=>S8,ZodExactOptional:()=>Gf,ZodFile:()=>sQ,ZodFirstPartyTypeKind:()=>RQ,ZodFunction:()=>bQ,ZodGUID:()=>Qf,ZodIBAN:()=>MB,ZodIPv4:()=>Df,ZodIPv6:()=>_f,ZodISODate:()=>Hn,ZodISODateTime:()=>jn,ZodISODuration:()=>Wn,ZodISOTime:()=>qn,ZodInstanceOf:()=>xQ,ZodIntersection:()=>KB,ZodIssueCode:()=>D8,ZodJWT:()=>Mf,ZodKSUID:()=>Rf,ZodLazy:()=>QQ,ZodLiteral:()=>oQ,ZodMAC:()=>$B,ZodMap:()=>nQ,ZodNaN:()=>IQ,ZodNanoID:()=>wf,ZodNever:()=>jB,ZodNonOptional:()=>Vf,ZodNull:()=>GB,ZodNullable:()=>AQ,ZodNumber:()=>Ks,ZodNumberFormat:()=>co,ZodObject:()=>oA,ZodOptional:()=>aA,ZodPipe:()=>cA,ZodPrefault:()=>dQ,ZodPreprocess:()=>EQ,ZodPromise:()=>wQ,ZodReadonly:()=>yQ,ZodRealError:()=>bt,ZodRecord:()=>qs,ZodSet:()=>iQ,ZodString:()=>Zs,ZodStringFormat:()=>Ie,ZodSuccess:()=>pQ,ZodSymbol:()=>OB,ZodTemplateLiteral:()=>BQ,ZodTransform:()=>aQ,ZodTuple:()=>eQ,ZodType:()=>ee,ZodULID:()=>Sf,ZodURL:()=>rA,ZodUUID:()=>Gr,ZodUndefined:()=>zB,ZodUnion:()=>sA,ZodUnknown:()=>YB,ZodVoid:()=>HB,ZodXID:()=>xf,ZodXor:()=>WB,_ZodString:()=>Cf,_default:()=>lQ,_function:()=>D$,any:()=>c$,array:()=>iA,base64:()=>zT,base64url:()=>GT,bigint:()=>n$,boolean:()=>PB,catch:()=>mQ,check:()=>_$,cidrv4:()=>PT,cidrv6:()=>OT,clone:()=>fe,codec:()=>k$,coerce:()=>_Q,compile:()=>Wy,config:()=>De,core:()=>dn,creditCard:()=>JT,cuid:()=>_T,cuid2:()=>NT,currencyCode:()=>ZT,custom:()=>N$,date:()=>u$,decode:()=>xB,decodeAsync:()=>DB,deepPartial:()=>Y$,describe:()=>U$,discriminatedUnion:()=>h$,e164:()=>VT,email:()=>BT,emoji:()=>RT,encode:()=>SB,encodeAsync:()=>RB,endsWith:()=>Ms,enum:()=>Of,exactOptional:()=>cQ,file:()=>Q$,flattenError:()=>wc,float32:()=>XT,float64:()=>e$,formatError:()=>bc,fromJSONSchema:()=>V$,function:()=>D$,getDiscriminatedOption:()=>Ey,getErrorMap:()=>N8,globalRegistry:()=>He,gt:()=>Or,gte:()=>Pt,guid:()=>QT,hash:()=>KT,hex:()=>WT,hostname:()=>qT,httpUrl:()=>xT,iban:()=>YT,includes:()=>$s,input:()=>H$,instanceof:()=>$$,int:()=>Ef,int32:()=>t$,int64:()=>i$,intersection:()=>XB,invertCodec:()=>S$,ipv4:()=>FT,ipv6:()=>LT,iso:()=>lA,json:()=>M$,jwt:()=>jT,keyof:()=>l$,ksuid:()=>$T,lazy:()=>vQ,length:()=>ro,literal:()=>B$,locales:()=>Yc,looseObject:()=>g$,looseRecord:()=>I$,lowercase:()=>Us,lt:()=>Pr,lte:()=>Lt,mac:()=>MT,map:()=>E$,maxLength:()=>to,maxSize:()=>Gn,memoizer:()=>Vc,meta:()=>T$,mime:()=>Ps,minLength:()=>ln,minSize:()=>zr,multipleOf:()=>zn,nan:()=>b$,nanoid:()=>DT,nativeEnum:()=>C$,negative:()=>cf,never:()=>Pf,nonnegative:()=>uf,nonoptional:()=>gQ,nonpositive:()=>Af,normalize:()=>Os,null:()=>VB,nullable:()=>tA,nullish:()=>v$,number:()=>LB,object:()=>d$,optional:()=>oo,output:()=>q$,overwrite:()=>yr,parse:()=>vB,parseAsync:()=>wB,partialRecord:()=>m$,pipe:()=>yf,positive:()=>af,prefault:()=>fQ,preprocess:()=>L$,prettifyError:()=>wI,promise:()=>R$,properties:()=>Ls,property:()=>lf,readonly:()=>CQ,record:()=>rQ,refine:()=>kQ,regex:()=>Ns,regexes:()=>rr,registry:()=>Td,safeDecode:()=>NB,safeDecodeAsync:()=>TB,safeEncode:()=>_B,safeEncodeAsync:()=>UB,safeParse:()=>bB,safeParseAsync:()=>kB,set:()=>y$,setErrorMap:()=>_8,size:()=>eo,slugify:()=>Js,startsWith:()=>Fs,strictObject:()=>f$,string:()=>eA,stringFormat:()=>HT,stringbool:()=>F$,success:()=>w$,superRefine:()=>SQ,symbol:()=>s$,templateLiteral:()=>x$,toJSONSchema:()=>pf,toLowerCase:()=>Gs,toUpperCase:()=>Vs,toZod:()=>pc,transform:()=>zf,treeifyError:()=>vI,trim:()=>zs,tuple:()=>tQ,uint32:()=>r$,uint64:()=>o$,ulid:()=>UT,undefined:()=>a$,union:()=>ta,unknown:()=>io,uppercase:()=>Ts,url:()=>ST,util:()=>B,uuid:()=>vT,uuidv4:()=>wT,uuidv6:()=>bT,uuidv7:()=>kT,validate:()=>kc,validateAsync:()=>Sc,void:()=>A$,withParser:()=>$d,xid:()=>TT,xor:()=>p$});var dn={};Br(dn,{$ZodAny:()=>uy,$ZodArray:()=>hy,$ZodAsyncError:()=>vt,$ZodBase64:()=>KE,$ZodBase64URL:()=>XE,$ZodBigInt:()=>Cd,$ZodBigIntFormat:()=>sy,$ZodBoolean:()=>Mc,$ZodCIDRv4:()=>WE,$ZodCIDRv6:()=>ZE,$ZodCUID:()=>ME,$ZodCUID2:()=>LE,$ZodCatch:()=>Ty,$ZodCheck:()=>Ce,$ZodCheckBigIntFormat:()=>lE,$ZodCheckEndsWith:()=>QE,$ZodCheckGreaterThan:()=>od,$ZodCheckIncludes:()=>CE,$ZodCheckLengthEquals:()=>mE,$ZodCheckLessThan:()=>id,$ZodCheckLowerCase:()=>EE,$ZodCheckMaxLength:()=>pE,$ZodCheckMaxSize:()=>dE,$ZodCheckMimeType:()=>bE,$ZodCheckMinLength:()=>hE,$ZodCheckMinSize:()=>fE,$ZodCheckMultipleOf:()=>AE,$ZodCheckNumberFormat:()=>uE,$ZodCheckOverwrite:()=>kE,$ZodCheckProperties:()=>wE,$ZodCheckProperty:()=>vE,$ZodCheckRegex:()=>IE,$ZodCheckSizeEquals:()=>gE,$ZodCheckStartsWith:()=>BE,$ZodCheckStringFormat:()=>Ss,$ZodCheckUpperCase:()=>yE,$ZodCodec:()=>Pc,$ZodCreditCard:()=>ty,$ZodCustom:()=>zy,$ZodCustomStringFormat:()=>iy,$ZodCyclicError:()=>Sd,$ZodDate:()=>gy,$ZodDefault:()=>Dy,$ZodDiscriminatedUnion:()=>yy,$ZodE164:()=>ey,$ZodEmail:()=>_E,$ZodEmoji:()=>$E,$ZodEncodeError:()=>Pn,$ZodEnum:()=>wy,$ZodError:()=>QI,$ZodExactOptional:()=>xy,$ZodFile:()=>ky,$ZodFunction:()=>Py,$ZodGUID:()=>RE,$ZodIBAN:()=>ry,$ZodIPv4:()=>jE,$ZodIPv6:()=>HE,$ZodISODate:()=>VE,$ZodISODateTime:()=>GE,$ZodISODuration:()=>YE,$ZodISOTime:()=>JE,$ZodIntersection:()=>Cy,$ZodJWT:()=>ny,$ZodKSUID:()=>zE,$ZodLazy:()=>Oc,$ZodLiteral:()=>by,$ZodMAC:()=>qE,$ZodMap:()=>Qy,$ZodNaN:()=>$y,$ZodNanoID:()=>FE,$ZodNever:()=>dy,$ZodNonOptional:()=>Ny,$ZodNull:()=>Ay,$ZodNullable:()=>Ry,$ZodNumber:()=>yd,$ZodNumberFormat:()=>oy,$ZodObject:()=>_N,$ZodObjectJIT:()=>my,$ZodOptional:()=>Qd,$ZodPipe:()=>vd,$ZodPrefault:()=>_y,$ZodPreprocess:()=>Fy,$ZodPromise:()=>Oy,$ZodReadonly:()=>My,$ZodRealError:()=>wt,$ZodRecord:()=>By,$ZodRegistry:()=>Ud,$ZodSet:()=>vy,$ZodString:()=>Wi,$ZodStringFormat:()=>ge,$ZodSuccess:()=>Uy,$ZodSymbol:()=>ay,$ZodTemplateLiteral:()=>Ly,$ZodTransform:()=>Sy,$ZodTuple:()=>Bd,$ZodType:()=>Z,$ZodULID:()=>PE,$ZodURL:()=>TE,$ZodUUID:()=>DE,$ZodUndefined:()=>cy,$ZodUnion:()=>Lc,$ZodUnknown:()=>ly,$ZodVoid:()=>fy,$ZodXID:()=>OE,$ZodXor:()=>Iy,$brand:()=>yI,$constructor:()=>I,$input:()=>Yy,$output:()=>Jy,Doc:()=>qi,INVALID:()=>ut,JSONSchema:()=>ET,JSONSchemaGenerator:()=>hf,NEVER:()=>EI,TimePrecision:()=>iC,URL_BAD_FORMAT:()=>NE,URL_UNPARSEABLE:()=>Nc,ZodCompileAsyncError:()=>Er,ZodCompileUnsupportedError:()=>oe,_any:()=>CC,_array:()=>SC,_base64:()=>rf,_base64url:()=>nf,_bigint:()=>gC,_boolean:()=>dC,_catch:()=>h8,_check:()=>nT,_cidrv4:()=>ef,_cidrv6:()=>tf,_coercedBigint:()=>pC,_coercedBoolean:()=>fC,_coercedDate:()=>bC,_coercedNumber:()=>sC,_coercedString:()=>eC,_creditCard:()=>rC,_cuid:()=>jd,_cuid2:()=>Hd,_custom:()=>RC,_date:()=>wC,_decode:()=>jl,_decodeAsync:()=>ql,_default:()=>f8,_discriminatedUnion:()=>t8,_e164:()=>of,_email:()=>Ld,_emoji:()=>Jd,_encode:()=>Yl,_encodeAsync:()=>Hl,_endsWith:()=>Ms,_enum:()=>a8,_file:()=>xC,_float32:()=>cC,_float64:()=>AC,_gt:()=>Or,_gte:()=>Pt,_guid:()=>Pd,_iban:()=>nC,_includes:()=>$s,_int:()=>aC,_int32:()=>uC,_int64:()=>hC,_intersection:()=>r8,_ipv4:()=>Kd,_ipv6:()=>Xd,_isoDate:()=>qc,_isoDateTime:()=>Hc,_isoDuration:()=>Zc,_isoTime:()=>Wc,_jwt:()=>sf,_ksuid:()=>Zd,_lazy:()=>y8,_length:()=>ro,_literal:()=>A8,_lowercase:()=>Us,_lt:()=>Pr,_lte:()=>Lt,_mac:()=>tC,_map:()=>o8,_max:()=>Lt,_maxLength:()=>to,_maxSize:()=>Gn,_mime:()=>Ps,_min:()=>Pt,_minLength:()=>ln,_minSize:()=>zr,_multipleOf:()=>zn,_nan:()=>kC,_nanoid:()=>Yd,_nativeEnum:()=>c8,_negative:()=>cf,_never:()=>QC,_nonnegative:()=>uf,_nonoptional:()=>g8,_nonpositive:()=>Af,_normalize:()=>Os,_null:()=>yC,_nullable:()=>d8,_number:()=>oC,_optional:()=>l8,_overwrite:()=>yr,_parse:()=>vs,_parseAsync:()=>ws,_pipe:()=>m8,_positive:()=>af,_promise:()=>C8,_properties:()=>Ls,_property:()=>lf,_readonly:()=>I8,_record:()=>i8,_refine:()=>DC,_regex:()=>Ns,_safeDecode:()=>Zl,_safeDecodeAsync:()=>Xl,_safeEncode:()=>Wl,_safeEncodeAsync:()=>Kl,_safeParse:()=>bs,_safeParseAsync:()=>ks,_set:()=>s8,_size:()=>eo,_slugify:()=>Js,_startsWith:()=>Fs,_string:()=>Xy,_stringFormat:()=>no,_stringbool:()=>TC,_success:()=>p8,_superRefine:()=>_C,_symbol:()=>IC,_templateLiteral:()=>E8,_toLowerCase:()=>Gs,_toUpperCase:()=>Vs,_transform:()=>u8,_trim:()=>zs,_tuple:()=>n8,_uint32:()=>lC,_uint64:()=>mC,_ulid:()=>qd,_undefined:()=>EC,_union:()=>XK,_unknown:()=>BC,_uppercase:()=>Ts,_url:()=>jc,_uuid:()=>Od,_uuidv4:()=>zd,_uuidv6:()=>Gd,_uuidv7:()=>Vd,_void:()=>vC,_xid:()=>Wd,_xor:()=>e8,base64Charset:()=>pd,base64urlCharset:()=>Fc,canParseURL:()=>UE,clone:()=>fe,compile:()=>Wy,compileFn:()=>Fd,config:()=>De,createStandardJSONSchemaMethod:()=>Ys,createToJSONSchemaMethod:()=>FC,decode:()=>e6,decodeAsync:()=>r6,describe:()=>NC,encode:()=>XZ,encodeAsync:()=>t6,extractDefs:()=>Jn,finalize:()=>Yn,flattenError:()=>wc,formatError:()=>bc,getDiscriminatedOption:()=>Ey,globalConfig:()=>Ge,globalRegistry:()=>He,handleUnrepresentable:()=>Fe,initializeContext:()=>Vn,isBackEdge:()=>Rd,isRecursiveSchema:()=>xd,isValidBase64:()=>$c,isValidBase64URL:()=>hd,isValidCIDRv6:()=>gd,isValidCreditCard:()=>md,isValidIBAN:()=>Id,isValidIPv6:()=>Tc,isValidJWT:()=>Ed,locales:()=>Yc,memoizer:()=>Vc,mergeValues:()=>xs,meta:()=>UC,parse:()=>Vl,parseAsync:()=>Jl,parseURLObject:()=>xN,prettifyError:()=>wI,process:()=>pe,processSchema:()=>pe,regexes:()=>rr,registry:()=>Td,safeDecode:()=>i6,safeDecodeAsync:()=>s6,safeEncode:()=>n6,safeEncodeAsync:()=>o6,safeParse:()=>HZ,safeParseAsync:()=>qZ,standardProps:()=>ud,stripTabAndNewline:()=>Uc,toDotPath:()=>cN,toJSONSchema:()=>pf,toZod:()=>pc,treeifyError:()=>vI,urlHostnameOk:()=>dd,urlProtocolOk:()=>fd,util:()=>B,validate:()=>kc,validateAsync:()=>Sc,validateURL:()=>ld,version:()=>SE,withParser:()=>$d});var B={};Br(B,{BIGINT_FORMAT_RANGES:()=>yc,CONSTANT_CATCH:()=>zl,Class:()=>AI,NUMBER_FORMAT_RANGES:()=>Ec,aborted:()=>At,allowsEval:()=>dI,assert:()=>gZ,assertEqual:()=>uZ,assertIs:()=>dZ,assertNever:()=>fZ,assertNotEqual:()=>lZ,assignProp:()=>je,attachSchema:()=>Cc,base64ToUint8Array:()=>rN,base64urlToUint8Array:()=>NZ,cached:()=>ys,captureStackTrace:()=>Pl,cleanEnum:()=>_Z,cleanRegex:()=>An,clone:()=>fe,cloneDef:()=>mZ,codePointLength:()=>ji,constantCatch:()=>mI,createTransparentProxy:()=>QZ,defineLazy:()=>uI,defineLazyInternal:()=>re,derived:()=>FZ,esc:()=>ct,escapeRegex:()=>tr,explicitlyAborted:()=>pI,extend:()=>bZ,finalizeIssue:()=>Qt,floatSafeRemainder:()=>hc,getElementAtPath:()=>IZ,getEnumValues:()=>Is,getLengthableOrigin:()=>Qc,getParsedType:()=>BZ,getSizableOrigin:()=>Bc,hexToUint8Array:()=>TZ,hide:()=>vc,installLazyProp:()=>OZ,isObject:()=>Yi,isPlainObject:()=>er,issue:()=>Qs,joinValues:()=>y,jsonStringifyReplacer:()=>Es,members:()=>hI,merge:()=>SZ,mergeDefs:()=>Ir,normalizeParams:()=>x,nullish:()=>Ll,numKeys:()=>CZ,objectClone:()=>pZ,omit:()=>wZ,optionalKeys:()=>gI,own:()=>Ln,parsedType:()=>w,partial:()=>xZ,pick:()=>vZ,prefixIssues:()=>Bt,primitiveTypes:()=>fI,promiseAllObject:()=>EZ,propertyKeyTypes:()=>Ic,randomString:()=>yZ,rawShape:()=>Cs,required:()=>RZ,safeExtend:()=>kZ,shallowClone:()=>mc,sizeCaps:()=>Bs,slugify:()=>lI,stringifyPrimitive:()=>Q,toZod:()=>pc,uint8ArrayToBase64:()=>nN,uint8ArrayToBase64url:()=>UZ,uint8ArrayToHex:()=>$Z,unwrapMessage:()=>ms});function uZ(e){return e}function lZ(e){return e}function pc(){return e=>e}function dZ(e){}function fZ(e){throw new Error("Unexpected value in exhaustive check")}function gZ(e){}function Is(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function y(e,t="|"){return e.map(n=>Q(n)).join(t)}function Es(e,t){return typeof t=="bigint"?t.toString():t}var cI=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function ys(e){return new cI(e)}function Ll(e){return e==null}function An(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function hc(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var K_=Symbol("evaluating");function uI(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==K_)return i===void 0&&(i=K_,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function pZ(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function je(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Cs(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function cn(e){return Cs(e._zod.def)??e._zod.def.shape}function X_(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return je(this,t,i),i},enumerable:!0,configurable:!0})}function eN(e,t,n){t in e?je(e,t,n):e[t]=n}function Ji(e,t,n,i){let r=cn(t);for(let o of n){let s=Object.getOwnPropertyDescriptor(r,o);s.enumerable&&(s.get?X_(e,o,()=>{let a=t._zod.def.shape[o];return i?i(a,o):a}):eN(e,o,i?i(s.value,o):s.value))}}function hZ(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?X_(e,n,()=>t[n]):eN(e,n,i.value))}}function Ir(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function mZ(e){return Ir(e._zod.def)}function IZ(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function EZ(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<t.length;o++)r[t[o]]=i[o];return r})}function yZ(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function ct(e){return JSON.stringify(e)}function lI(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Pl="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var dI=ys(()=>{if(Ge.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function er(e){if(Yi(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Yi(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function mc(e){return er(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function CZ(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var BZ=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Ic=new Set(["string","number","symbol"]),fI=new Set(["string","number","bigint","boolean","symbol","undefined"]);function tr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fe(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function x(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function QZ(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function Q(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function gI(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Ec={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},yc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function vZ(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return Ji(o,e,Ol(e,t)),fe(e,Ir(n,{shape:o,checks:[]}))}function Ol(e,t){let n=cn(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}function wZ(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(Ol(e,t)),s={};return Ji(s,e,Reflect.ownKeys(cn(e)).filter(a=>!o.has(a))),fe(e,Ir(n,{shape:s,checks:[]}))}function bZ(e,t){if(!er(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=cn(e);for(let o of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return fe(e,Ir(e._zod.def,{shape:tN(e,t)}))}function tN(e,t){let n={};return Ji(n,e,Reflect.ownKeys(cn(e))),hZ(n,t),n}function kZ(e,t){if(!er(t))throw new Error("Invalid input to safeExtend: expected a plain object");return fe(e,Ir(e._zod.def,{shape:tN(e,t)}))}function SZ(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};Ji(n,e,Reflect.ownKeys(cn(e))),Ji(n,t,Reflect.ownKeys(cn(t)));let i=Ir(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return fe(e,i)}function xZ(e,t,n,i="partial"){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let a=n?new Set(Ol(t,n)):void 0,c={};return Ji(c,t,Reflect.ownKeys(cn(t)),e&&((A,l)=>a&&!a.has(l)?A:new e({type:"optional",innerType:A}))),fe(t,Ir(t._zod.def,{shape:c,checks:[]}))}function RZ(e,t,n){let i=n?new Set(Ol(t,n)):void 0,r={};return Ji(r,t,Reflect.ownKeys(cn(t)),(o,s)=>i&&!i.has(s)?o:new e({type:"nonoptional",innerType:o})),fe(t,Ir(t._zod.def,{shape:r}))}function At(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function pI(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Bt(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function ms(e){return typeof e=="string"?e:e?.message}function Bs(e){let t=[];for(let n of e??[]){let i=n._zod.def;if(!/_(length|size)$|_equals$/.test(i.check))break;let r=i.maximum??i.length??i.size;r>=0&&t.push([r,n])}return t}function Cc(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}function Qt(e,t,n){var i;let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?(i=e).schema??(i.schema=e.inst):e.schema=e.inst);let o=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ms(e.inst?._zod.def?.error?.(e))??ms(o?.(e))??ms(t?.error?.(e))??ms(n.customError?.(e))??ms(n.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function Bc(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var DZ=/[\uD800-\uDBFF]/;function ji(e){let t=e.length;if(!DZ.test(e))return t;let n=t;for(let i=0;i<t-1;i++)(e.charCodeAt(i)&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320&&(n--,i++);return n}function Qc(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function w(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Qs(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function _Z(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function rN(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function nN(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function NZ(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return rN(t+n)}function UZ(e){return nN(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function TZ(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}function $Z(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var AI=class{constructor(...t){}};function hI(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):MZ(e,n,i.value)}}function Ln(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function vc(e,t,n){return Ln(e,t,n,!1)}function FZ(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Ln(this,n,i(this))},set(r){Ln(this,n,r)}})}return t}function MZ(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Ln(this,t,n.bind(this))},set(i){Ln(this,t,i)}})}function LZ(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var aI,Mn=!1,PZ={configurable:!0,get(){Mn=!0}};function re(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&aI!==e._zod){aI=void 0;return}aI=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,PZ);let r=Mn;Mn=!1;try{let o=n(this);return Mn?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),Mn=Mn||r,o}catch(o){throw delete this[t],Mn=Mn||r,o}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}function OZ(e,t,n,i){let r=LZ(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,o),o.value=n(this),Object.defineProperty(this,t,o),o.value},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:o})}})}var zl="~constantCatch";function mI(e){let t=()=>e;return t[zl]=!0,t}var iN,EI=Object.freeze({status:"aborted"}),II={value:void 0,enumerable:!1},oN="captureStackTrace"in Error?Error:null;function zZ(e){let t=oN;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return oN=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function I(e,t,n,i){let r={};function o(f){this.def=f,this.constr=d,this.traits=new Set}o.prototype=r;let s=n,a=s&&new WeakSet;function c(f,g){if(f._zod){if(f._zod.traits.has(e))return}else{II.value=new o(g);try{Object.defineProperty(f,"_zod",II)}finally{II.value=void 0}}if(f._zod.traits.add(e),t(f,g),a){let h=Object.getPrototypeOf(f),E=f._zod.constr.prototype,m=h;for(;m&&m!==E;)m=Object.getPrototypeOf(m);let C=m??h;a.has(C)||(a.add(C),hI(C,s))}let p=d.prototype;for(let h in p)Object.prototype.hasOwnProperty.call(p,h)&&(h in f||(f[h]=p[h].bind(f)))}let A=i?.Parent??Object;class l extends A{}Object.defineProperty(l,"name",{value:e});function d(f){let g=i?.Parent?zZ(l):this;c(g,f);let p=g._zod.deferred;if(p){for(let E of p)E();g._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;return h&&h(g),g}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>i?.Parent&&f instanceof i.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var yI=Symbol("zod_brand"),vt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Pn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(iN=globalThis).__zod_globalConfig??(iN.__zod_globalConfig={});var Ge=globalThis.__zod_globalConfig;function De(e){return e&&Object.assign(Ge,e),Ge}function GZ(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Es,2)),e.message}function VZ(e){this._zod.message=e}var JZ={get:GZ,set:VZ,enumerable:!0,configurable:!0},BI={value:void 0,enumerable:!1},sN=new WeakSet([Object.prototype,Error.prototype]),aN=(e,t)=>{e.name="$ZodError",BI.value=t,Object.defineProperty(e,"issues",BI),BI.value=void 0,Object.defineProperty(e,"message",JZ);let n=Object.getPrototypeOf(e);sN.has(n)||(sN.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},QI=I("$ZodError",aN),wt=I("$ZodError",aN,void 0,{Parent:Error});function YZ(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function wc(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?YZ(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}function bc(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)n._errors.push(t(s));else{let c=n,A=0;for(;A<a.length;){let l=a[A],d=A===a.length-1;if(l==="_errors"){d&&c._errors.push(t(s)),A++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=c[l];d&&f._errors.push(t(s)),c=f,A++}}}};return i(e),n}function vI(e,t=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var s;for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>i({issues:c},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let c=[...o,...a.path];if(c.length===0){n.errors.push(t(a));continue}let A=n,l=0;for(;l<c.length;){let d=c[l],f=l===c.length-1;typeof d=="string"?(A.properties??(A.properties={}),Object.prototype.hasOwnProperty.call(A.properties,d)||Object.defineProperty(A.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),A=A.properties[d]):(A.items??(A.items=[]),(s=A.items)[d]??(s[d]={errors:[]}),A=A.items[d]),f&&A.errors.push(t(a)),l++}}};return i(e),n}function cN(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function wI(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${cN(i.path)}`);return t.join(`
|
|
127
|
+
`;var GX=`${zQ} up to, not including, ${GQ}`;var XX=new TextDecoder("utf-8",{fatal:!0});var SF=yA.join(".skyramp","sut");var JQ=yA.join(SF,"client-cert.json");var n5=64*1024;var u={};Br(u,{BRAND:()=>eM,DIRTY:()=>ei,EMPTY_PATH:()=>_F,INVALID:()=>J,NEVER:()=>MM,OK:()=>We,ParseStatus:()=>Ve,Schema:()=>ne,ZodAny:()=>mn,ZodArray:()=>jr,ZodBigInt:()=>ri,ZodBoolean:()=>ni,ZodBranded:()=>ia,ZodCatch:()=>gi,ZodDate:()=>ii,ZodDefault:()=>fi,ZodDiscriminatedUnion:()=>QA,ZodEffects:()=>Yt,ZodEnum:()=>li,ZodError:()=>ft,ZodFirstPartyTypeKind:()=>j,ZodFunction:()=>wA,ZodIntersection:()=>ci,ZodIssueCode:()=>S,ZodLazy:()=>Ai,ZodLiteral:()=>ui,ZodMap:()=>ho,ZodNaN:()=>Io,ZodNativeEnum:()=>di,ZodNever:()=>ar,ZodNull:()=>si,ZodNullable:()=>wr,ZodNumber:()=>ti,ZodObject:()=>gt,ZodOptional:()=>Vt,ZodParsedType:()=>U,ZodPipeline:()=>oa,ZodPromise:()=>In,ZodReadonly:()=>pi,ZodRecord:()=>vA,ZodSchema:()=>ne,ZodSet:()=>mo,ZodString:()=>hn,ZodSymbol:()=>go,ZodTransformer:()=>Yt,ZodTuple:()=>vr,ZodType:()=>ne,ZodUndefined:()=>oi,ZodUnion:()=>ai,ZodUnknown:()=>Yr,ZodVoid:()=>po,addIssueToContext:()=>_,any:()=>AM,array:()=>fM,bigint:()=>iM,boolean:()=>rv,coerce:()=>FM,custom:()=>XQ,date:()=>oM,datetimeRegex:()=>ZQ,defaultErrorMap:()=>Vr,discriminatedUnion:()=>mM,effect:()=>xM,enum:()=>bM,function:()=>QM,getErrorMap:()=>uo,getParsedType:()=>Qr,instanceof:()=>rM,intersection:()=>IM,isAborted:()=>CA,isAsync:()=>lo,isDirty:()=>BA,isValid:()=>pn,late:()=>tM,lazy:()=>vM,literal:()=>wM,makeIssue:()=>na,map:()=>CM,nan:()=>nM,nativeEnum:()=>kM,never:()=>lM,null:()=>cM,nullable:()=>DM,number:()=>tv,object:()=>gM,objectUtil:()=>Kf,oboolean:()=>$M,onumber:()=>TM,optional:()=>RM,ostring:()=>UM,pipeline:()=>NM,preprocess:()=>_M,promise:()=>SM,quotelessJson:()=>xF,record:()=>yM,set:()=>BM,setErrorMap:()=>DF,strictObject:()=>pM,string:()=>ev,symbol:()=>sM,transformer:()=>xM,tuple:()=>EM,undefined:()=>aM,union:()=>hM,unknown:()=>uM,util:()=>se,void:()=>dM});var se;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function n(r){throw new Error}e.assertNever=n,e.arrayToEnum=r=>{let o={};for(let s of r)o[s]=s;return o},e.getValidEnumValues=r=>{let o=e.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),s={};for(let a of o)s[a]=r[a];return e.objectValues(s)},e.objectValues=r=>e.objectKeys(r).map(function(o){return r[o]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&o.push(s);return o},e.find=(r,o)=>{for(let s of r)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(se||(se={}));var Kf;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Kf||(Kf={}));var U=se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Qr=e=>{switch(typeof e){case"undefined":return U.undefined;case"string":return U.string;case"number":return Number.isNaN(e)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(e)?U.array:e===null?U.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?U.promise:typeof Map<"u"&&e instanceof Map?U.map:typeof Set<"u"&&e instanceof Set?U.set:typeof Date<"u"&&e instanceof Date?U.date:U.object;default:return U.unknown}};var S=se.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"]),xF=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ft=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(o){return o.message},i={_errors:[]},r=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)i._errors.push(n(s));else{let a=i,c=0;for(;c<s.path.length;){let A=s.path[c],l=c===s.path.length-1;if(A==="_errors"){l&&a._errors.push(n(s)),c++;continue}Object.prototype.hasOwnProperty.call(a,A)||(A==="__proto__"?Object.defineProperty(a,A,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):a[A]={_errors:[]}),a=a[A],l&&a._errors.push(n(s)),c++}}};return r(this),i}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,se.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];n[o]=n[o]||[],n[o].push(t(r))}else i.push(t(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};ft.create=e=>new ft(e);var RF=(e,t)=>{let n;switch(e.code){case S.invalid_type:e.received===U.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case S.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,se.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:n=`Unrecognized key(s) in object: ${se.joinValues(e.keys,", ")}`;break;case S.invalid_union:n="Invalid input";break;case S.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${se.joinValues(e.options)}`;break;case S.invalid_enum_value:n=`Invalid enum value. Expected ${se.joinValues(e.options)}, received '${e.received}'`;break;case S.invalid_arguments:n="Invalid function arguments";break;case S.invalid_return_type:n="Invalid function return type";break;case S.invalid_date:n="Invalid date";break;case S.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:se.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case S.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case S.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case S.custom:n="Invalid input";break;case S.invalid_intersection_types:n="Intersection results could not be merged";break;case S.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case S.not_finite:n="Number must be finite";break;default:n=t.defaultError,se.assertNever(e)}return{message:n}},Vr=RF;var YQ=Vr;function DF(e){YQ=e}function uo(){return YQ}var na=e=>{let{data:t,path:n,errorMaps:i,issueData:r}=e,o=[...n,...r.path||[]],s={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let a="",c=i.filter(A=>!!A).slice().reverse();for(let A of c)a=A(s,{data:t,defaultError:a}).message;return{...r,path:o,message:a}},_F=[];function _(e,t){let n=uo(),i=na({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Vr?void 0:Vr].filter(r=>!!r)});e.common.issues.push(i)}var Ve=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let i=[];for(let r of n){if(r.status==="aborted")return J;r.status==="dirty"&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,n){let i=[];for(let r of n){let o=await r.key,s=await r.value;i.push({key:o,value:s})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,n){let i={};for(let r of n){let{key:o,value:s}=r;if(o.status==="aborted"||s.status==="aborted")return J;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet)&&(i[o.value]=s.value)}return{status:t.value,value:i}}},J=Object.freeze({status:"aborted"}),ei=e=>({status:"dirty",value:e}),We=e=>({status:"valid",value:e}),CA=e=>e.status==="aborted",BA=e=>e.status==="dirty",pn=e=>e.status==="valid",lo=e=>typeof Promise<"u"&&e instanceof Promise;var F;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(F||(F={}));var Jt=class{constructor(t,n,i,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},jQ=(e,t)=>{if(pn(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new ft(e.common.issues);return this._error=n,this._error}}};function X(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(s,a)=>{let{message:c}=e;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??i??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:r}}var ne=class{get description(){return this._def.description}_getType(t){return Qr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Qr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ve,ctx:{common:t.parent.common,data:t.data,parsedType:Qr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(lo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let i=this.safeParse(t,n);if(i.success)return i.data;throw i.error}safeParse(t,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Qr(t)},r=this._parseSync({data:t,path:i.path,parent:i});return jQ(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Qr(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return pn(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>pn(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){let i=await this.safeParseAsync(t,n);if(i.success)return i.data;throw i.error}async safeParseAsync(t,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Qr(t)},r=this._parse({data:t,path:i.path,parent:i}),o=await(lo(r)?r:Promise.resolve(r));return jQ(i,o)}refine(t,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,o)=>{let s=t(r),a=()=>o.addIssue({code:S.custom,...i(r)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((i,r)=>t(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(t){return new Yt({schema:this,typeName:j.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Vt.create(this,this._def)}nullable(){return wr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jr.create(this)}promise(){return In.create(this,this._def)}or(t){return ai.create([this,t],this._def)}and(t){return ci.create(this,t,this._def)}transform(t){return new Yt({...X(this._def),schema:this,typeName:j.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new fi({...X(this._def),innerType:this,defaultValue:n,typeName:j.ZodDefault})}brand(){return new ia({typeName:j.ZodBranded,type:this,...X(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new gi({...X(this._def),innerType:this,catchValue:n,typeName:j.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return oa.create(this,t)}readonly(){return pi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},NF=/^c[^\s-]{8,}$/i,UF=/^[0-9a-z]+$/,TF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$F=/^[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,FF=/^[a-z0-9_-]{21}$/i,MF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,LF=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,PF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,OF="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",Xf,zF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,GF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,VF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,JF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,YF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,jF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,qQ="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",HF=new RegExp(`^${qQ}$`);function WQ(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function qF(e){return new RegExp(`^${WQ(e)}$`)}function ZQ(e){let t=`${qQ}T${WQ(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function WF(e,t){return!!((t==="v4"||!t)&&zF.test(e)||(t==="v6"||!t)&&VF.test(e))}function ZF(e,t){if(!MF.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function KF(e,t){return!!((t==="v4"||!t)&&GF.test(e)||(t==="v6"||!t)&&JF.test(e))}var hn=class e extends ne{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==U.string){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_type,expected:U.string,received:o.parsedType}),J}let i=new Ve,r;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(r=this._getOrReturnCtx(t,r),s?_(r,{code:S.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&_(r,{code:S.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")PF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"email",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")Xf||(Xf=new RegExp(OF,"u")),Xf.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"emoji",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")$F.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"uuid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")FF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"nanoid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")NF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"cuid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")UF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"cuid2",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")TF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"ulid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),_(r,{validation:"url",code:S.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"regex",code:S.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?ZQ(o).test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?HF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?qF(o).test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?LF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"duration",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?WF(t.data,o.version)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"ip",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?ZF(t.data,o.alg)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"jwt",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?KF(t.data,o.version)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"cidr",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?YF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"base64",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?jF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"base64url",code:S.invalid_string,message:o.message}),i.dirty()):se.assertNever(o);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:S.invalid_string,...F.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...F.errToObj(t)})}url(t){return this._addCheck({kind:"url",...F.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...F.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...F.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...F.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...F.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...F.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...F.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...F.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...F.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...F.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...F.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...F.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...F.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...F.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...F.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...F.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...F.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...F.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...F.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...F.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...F.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...F.errToObj(n)})}nonempty(t){return this.min(1,F.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};hn.create=e=>new hn({checks:[],typeName:j.ZodString,coerce:e?.coerce??!1,...X(e)});function XF(e,t){let n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(e.toFixed(r).replace(".","")),s=Number.parseInt(t.toFixed(r).replace(".",""));return o%s/10**r}var ti=class e extends ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==U.number){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_type,expected:U.number,received:o.parsedType}),J}let i,r=new Ve;for(let o of this._def.checks)o.kind==="int"?se.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),_(i,{code:S.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?XF(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),_(i,{code:S.not_finite,message:o.message}),r.dirty()):se.assertNever(o);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,F.toString(n))}gt(t,n){return this.setLimit("min",t,!1,F.toString(n))}lte(t,n){return this.setLimit("max",t,!0,F.toString(n))}lt(t,n){return this.setLimit("max",t,!1,F.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:F.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:F.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:F.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:F.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:F.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:F.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:F.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:F.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:F.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:F.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&se.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(n)&&Number.isFinite(t)}};ti.create=e=>new ti({checks:[],typeName:j.ZodNumber,coerce:e?.coerce||!1,...X(e)});var ri=class e extends ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==U.bigint)return this._getInvalidInput(t);let i,r=new Ve;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):se.assertNever(o);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return _(n,{code:S.invalid_type,expected:U.bigint,received:n.parsedType}),J}gte(t,n){return this.setLimit("min",t,!0,F.toString(n))}gt(t,n){return this.setLimit("min",t,!1,F.toString(n))}lte(t,n){return this.setLimit("max",t,!0,F.toString(n))}lt(t,n){return this.setLimit("max",t,!1,F.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:F.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:F.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:F.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:F.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:F.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:F.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};ri.create=e=>new ri({checks:[],typeName:j.ZodBigInt,coerce:e?.coerce??!1,...X(e)});var ni=class extends ne{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==U.boolean){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.boolean,received:i.parsedType}),J}return We(t.data)}};ni.create=e=>new ni({typeName:j.ZodBoolean,coerce:e?.coerce||!1,...X(e)});var ii=class e extends ne{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==U.date){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_type,expected:U.date,received:o.parsedType}),J}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_date}),J}let i=new Ve,r;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):se.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:F.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:F.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};ii.create=e=>new ii({checks:[],coerce:e?.coerce||!1,typeName:j.ZodDate,...X(e)});var go=class extends ne{_parse(t){if(this._getType(t)!==U.symbol){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.symbol,received:i.parsedType}),J}return We(t.data)}};go.create=e=>new go({typeName:j.ZodSymbol,...X(e)});var oi=class extends ne{_parse(t){if(this._getType(t)!==U.undefined){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.undefined,received:i.parsedType}),J}return We(t.data)}};oi.create=e=>new oi({typeName:j.ZodUndefined,...X(e)});var si=class extends ne{_parse(t){if(this._getType(t)!==U.null){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.null,received:i.parsedType}),J}return We(t.data)}};si.create=e=>new si({typeName:j.ZodNull,...X(e)});var mn=class extends ne{constructor(){super(...arguments),this._any=!0}_parse(t){return We(t.data)}};mn.create=e=>new mn({typeName:j.ZodAny,...X(e)});var Yr=class extends ne{constructor(){super(...arguments),this._unknown=!0}_parse(t){return We(t.data)}};Yr.create=e=>new Yr({typeName:j.ZodUnknown,...X(e)});var ar=class extends ne{_parse(t){let n=this._getOrReturnCtx(t);return _(n,{code:S.invalid_type,expected:U.never,received:n.parsedType}),J}};ar.create=e=>new ar({typeName:j.ZodNever,...X(e)});var po=class extends ne{_parse(t){if(this._getType(t)!==U.undefined){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.void,received:i.parsedType}),J}return We(t.data)}};po.create=e=>new po({typeName:j.ZodVoid,...X(e)});var jr=class e extends ne{_parse(t){let{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==U.array)return _(n,{code:S.invalid_type,expected:U.array,received:n.parsedType}),J;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,a=n.data.length<r.exactLength.value;(s||a)&&(_(n,{code:s?S.too_big:S.too_small,minimum:a?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(_(n,{code:S.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(_(n,{code:S.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>r.type._parseAsync(new Jt(n,s,n.path,a)))).then(s=>Ve.mergeArray(i,s));let o=[...n.data].map((s,a)=>r.type._parseSync(new Jt(n,s,n.path,a)));return Ve.mergeArray(i,o)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:F.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:F.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:F.toString(n)}})}nonempty(t){return this.min(1,t)}};jr.create=(e,t)=>new jr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:j.ZodArray,...X(t)});function fo(e){if(e instanceof gt){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=Vt.create(fo(i))}return new gt({...e._def,shape:()=>t})}else return e instanceof jr?new jr({...e._def,type:fo(e.element)}):e instanceof Vt?Vt.create(fo(e.unwrap())):e instanceof wr?wr.create(fo(e.unwrap())):e instanceof vr?vr.create(e.items.map(t=>fo(t))):e}var gt=class e extends ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=se.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==U.object){let A=this._getOrReturnCtx(t);return _(A,{code:S.invalid_type,expected:U.object,received:A.parsedType}),J}let{status:i,ctx:r}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof ar&&this._def.unknownKeys==="strip"))for(let A in r.data)s.includes(A)||a.push(A);let c=[];for(let A of s){let l=o[A],d=r.data[A];c.push({key:{status:"valid",value:A},value:l._parse(new Jt(r,d,r.path,A)),alwaysSet:A in r.data})}if(this._def.catchall instanceof ar){let A=this._def.unknownKeys;if(A==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(A==="strict")a.length>0&&(_(r,{code:S.unrecognized_keys,keys:a}),i.dirty());else if(A!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let A=this._def.catchall;for(let l of a){let d=r.data[l];c.push({key:{status:"valid",value:l},value:A._parse(new Jt(r,d,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let A=[];for(let l of c){let d=await l.key,f=await l.value;A.push({key:d,value:f,alwaysSet:l.alwaysSet})}return A}).then(A=>Ve.mergeObjectSync(i,A)):Ve.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(t){return F.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:F.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:j.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let i of se.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let i of se.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}deepPartial(){return fo(this)}partial(t){let n={};for(let i of se.objectKeys(this.shape)){let r=this.shape[i];t&&!t[i]?n[i]=r:n[i]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let i of se.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Vt;)o=o._def.innerType;n[i]=o}return new e({...this._def,shape:()=>n})}keyof(){return KQ(se.objectKeys(this.shape))}};gt.create=(e,t)=>new gt({shape:()=>e,unknownKeys:"strip",catchall:ar.create(),typeName:j.ZodObject,...X(t)});gt.strictCreate=(e,t)=>new gt({shape:()=>e,unknownKeys:"strict",catchall:ar.create(),typeName:j.ZodObject,...X(t)});gt.lazycreate=(e,t)=>new gt({shape:e,unknownKeys:"strip",catchall:ar.create(),typeName:j.ZodObject,...X(t)});var ai=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i=this._def.options;function r(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new ft(a.ctx.common.issues));return _(n,{code:S.invalid_union,unionErrors:s}),J}if(n.common.async)return Promise.all(i.map(async o=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(r);{let o,s=[];for(let c of i){let A={...n,common:{...n.common,issues:[]},parent:null},l=c._parseSync({data:n.data,path:n.path,parent:A});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:A}),A.common.issues.length&&s.push(A.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(c=>new ft(c));return _(n,{code:S.invalid_union,unionErrors:a}),J}}get options(){return this._def.options}};ai.create=(e,t)=>new ai({options:e,typeName:j.ZodUnion,...X(t)});var Jr=e=>e instanceof Ai?Jr(e.schema):e instanceof Yt?Jr(e.innerType()):e instanceof ui?[e.value]:e instanceof li?e.options:e instanceof di?se.objectValues(e.enum):e instanceof fi?Jr(e._def.innerType):e instanceof oi?[void 0]:e instanceof si?[null]:e instanceof Vt?[void 0,...Jr(e.unwrap())]:e instanceof wr?[null,...Jr(e.unwrap())]:e instanceof ia||e instanceof pi?Jr(e.unwrap()):e instanceof gi?Jr(e._def.innerType):[],QA=class e extends ne{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==U.object)return _(n,{code:S.invalid_type,expected:U.object,received:n.parsedType}),J;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(_(n,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),J)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){let r=new Map;for(let o of n){let s=Jr(o.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(r.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);r.set(a,o)}}return new e({typeName:j.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...X(i)})}};function eg(e,t){let n=Qr(e),i=Qr(t);if(e===t)return{valid:!0,data:e};if(n===U.object&&i===U.object){let r=se.objectKeys(t),o=se.objectKeys(e).filter(a=>r.indexOf(a)!==-1),s={...e,...t};Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__;for(let a of o){if(a==="__proto__")continue;let c=eg(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(n===U.array&&i===U.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let o=0;o<e.length;o++){let s=e[o],a=t[o],c=eg(s,a);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return n===U.date&&i===U.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var ci=class extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=(o,s)=>{if(CA(o)||CA(s))return J;let a=eg(o.value,s.value);return a.valid?((BA(o)||BA(s))&&n.dirty(),{status:n.value,value:a.data}):(_(i,{code:S.invalid_intersection_types}),J)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,s])=>r(o,s)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};ci.create=(e,t,n)=>new ci({left:e,right:t,typeName:j.ZodIntersection,...X(n)});var vr=class e extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.array)return _(i,{code:S.invalid_type,expected:U.array,received:i.parsedType}),J;if(i.data.length<this._def.items.length)return _(i,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),J;!this._def.rest&&i.data.length>this._def.items.length&&(_(i,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Jt(i,s,i.path,a)):null}).filter(s=>!!s);return i.common.async?Promise.all(o).then(s=>Ve.mergeArray(n,s)):Ve.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};vr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vr({items:e,typeName:j.ZodTuple,rest:null,...X(t)})};var vA=class e extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.object)return _(i,{code:S.invalid_type,expected:U.object,received:i.parsedType}),J;let r=[],o=this._def.keyType,s=this._def.valueType;for(let a in i.data)r.push({key:o._parse(new Jt(i,a,i.path,a)),value:s._parse(new Jt(i,i.data[a],i.path,a)),alwaysSet:a in i.data});return i.common.async?Ve.mergeObjectAsync(n,r):Ve.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof ne?new e({keyType:t,valueType:n,typeName:j.ZodRecord,...X(i)}):new e({keyType:hn.create(),valueType:t,typeName:j.ZodRecord,...X(n)})}},ho=class extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.map)return _(i,{code:S.invalid_type,expected:U.map,received:i.parsedType}),J;let r=this._def.keyType,o=this._def.valueType,s=[...i.data.entries()].map(([a,c],A)=>({key:r._parse(new Jt(i,a,i.path,[A,"key"])),value:o._parse(new Jt(i,c,i.path,[A,"value"]))}));if(i.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let A=await c.key,l=await c.value;if(A.status==="aborted"||l.status==="aborted")return J;(A.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(A.value,l.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let c of s){let A=c.key,l=c.value;if(A.status==="aborted"||l.status==="aborted")return J;(A.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(A.value,l.value)}return{status:n.value,value:a}}}};ho.create=(e,t,n)=>new ho({valueType:t,keyType:e,typeName:j.ZodMap,...X(n)});var mo=class e extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.set)return _(i,{code:S.invalid_type,expected:U.set,received:i.parsedType}),J;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(_(i,{code:S.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(_(i,{code:S.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function s(c){let A=new Set;for(let l of c){if(l.status==="aborted")return J;l.status==="dirty"&&n.dirty(),A.add(l.value)}return{status:n.value,value:A}}let a=[...i.data.values()].map((c,A)=>o._parse(new Jt(i,c,i.path,A)));return i.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,n){return new e({...this._def,minSize:{value:t,message:F.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:F.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};mo.create=(e,t)=>new mo({valueType:e,minSize:null,maxSize:null,typeName:j.ZodSet,...X(t)});var wA=class e extends ne{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==U.function)return _(n,{code:S.invalid_type,expected:U.function,received:n.parsedType}),J;function i(a,c){return na({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,uo(),Vr].filter(A=>!!A),issueData:{code:S.invalid_arguments,argumentsError:c}})}function r(a,c){return na({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,uo(),Vr].filter(A=>!!A),issueData:{code:S.invalid_return_type,returnTypeError:c}})}let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof In){let a=this;return We(async function(...c){let A=new ft([]),l=await a._def.args.parseAsync(c,o).catch(g=>{throw A.addIssue(i(c,g)),A}),d=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(d,o).catch(g=>{throw A.addIssue(r(d,g)),A})})}else{let a=this;return We(function(...c){let A=a._def.args.safeParse(c,o);if(!A.success)throw new ft([i(c,A.error)]);let l=Reflect.apply(s,this,A.data),d=a._def.returns.safeParse(l,o);if(!d.success)throw new ft([r(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:vr.create(t).rest(Yr.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,i){return new e({args:t||vr.create([]).rest(Yr.create()),returns:n||Yr.create(),typeName:j.ZodFunction,...X(i)})}},Ai=class extends ne{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Ai.create=(e,t)=>new Ai({getter:e,typeName:j.ZodLazy,...X(t)});var ui=class extends ne{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return _(n,{received:n.data,code:S.invalid_literal,expected:this._def.value}),J}return{status:"valid",value:t.data}}get value(){return this._def.value}};ui.create=(e,t)=>new ui({value:e,typeName:j.ZodLiteral,...X(t)});function KQ(e,t){return new li({values:e,typeName:j.ZodEnum,...X(t)})}var li=class e extends ne{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),i=this._def.values;return _(n,{expected:se.joinValues(i),received:n.parsedType,code:S.invalid_type}),J}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),i=this._def.values;return _(n,{received:n.data,code:S.invalid_enum_value,options:i}),J}return We(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}};li.create=KQ;var di=class extends ne{_parse(t){let n=se.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==U.string&&i.parsedType!==U.number){let r=se.objectValues(n);return _(i,{expected:se.joinValues(r),received:i.parsedType,code:S.invalid_type}),J}if(this._cache||(this._cache=new Set(se.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=se.objectValues(n);return _(i,{received:i.data,code:S.invalid_enum_value,options:r}),J}return We(t.data)}get enum(){return this._def.values}};di.create=(e,t)=>new di({values:e,typeName:j.ZodNativeEnum,...X(t)});var In=class extends ne{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==U.promise&&n.common.async===!1)return _(n,{code:S.invalid_type,expected:U.promise,received:n.parsedType}),J;let i=n.parsedType===U.promise?n.data:Promise.resolve(n.data);return We(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};In.create=(e,t)=>new In({type:e,typeName:j.ZodPromise,...X(t)});var Yt=class extends ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===j.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=this._def.effect||null,o={addIssue:s=>{_(i,s),s.fatal?n.abort():n.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let s=r.transform(i.data,o);if(i.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return J;let c=await this._def.schema._parseAsync({data:a,path:i.path,parent:i});return c.status==="aborted"?J:c.status==="dirty"?ei(c.value):n.value==="dirty"?ei(c.value):c});{if(n.value==="aborted")return J;let a=this._def.schema._parseSync({data:s,path:i.path,parent:i});return a.status==="aborted"?J:a.status==="dirty"?ei(a.value):n.value==="dirty"?ei(a.value):a}}if(r.type==="refinement"){let s=a=>{let c=r.refinement(a,o);if(i.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(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?J:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?J:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(r.type==="transform")if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!pn(s))return J;let a=r.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>pn(s)?Promise.resolve(r.transform(s.value,o)).then(a=>({status:n.value,value:a})):J);se.assertNever(r)}};Yt.create=(e,t,n)=>new Yt({schema:e,typeName:j.ZodEffects,effect:t,...X(n)});Yt.createWithPreprocess=(e,t,n)=>new Yt({schema:t,effect:{type:"preprocess",transform:e},typeName:j.ZodEffects,...X(n)});var Vt=class extends ne{_parse(t){return this._getType(t)===U.undefined?We(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Vt.create=(e,t)=>new Vt({innerType:e,typeName:j.ZodOptional,...X(t)});var wr=class extends ne{_parse(t){return this._getType(t)===U.null?We(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};wr.create=(e,t)=>new wr({innerType:e,typeName:j.ZodNullable,...X(t)});var fi=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return n.parsedType===U.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};fi.create=(e,t)=>new fi({innerType:e,typeName:j.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...X(t)});var gi=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return lo(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ft(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new ft(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};gi.create=(e,t)=>new gi({innerType:e,typeName:j.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...X(t)});var Io=class extends ne{_parse(t){if(this._getType(t)!==U.nan){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.nan,received:i.parsedType}),J}return{status:"valid",value:t.data}}};Io.create=e=>new Io({typeName:j.ZodNaN,...X(e)});var eM=Symbol("zod_brand"),ia=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},oa=class e extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?J:o.status==="dirty"?(n.dirty(),ei(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?J:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new e({in:t,out:n,typeName:j.ZodPipeline})}},pi=class extends ne{_parse(t){let n=this._def.innerType._parse(t),i=r=>(pn(r)&&(r.value=Object.freeze(r.value)),r);return lo(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};pi.create=(e,t)=>new pi({innerType:e,typeName:j.ZodReadonly,...X(t)});function HQ(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function XQ(e,t={},n){return e?mn.create().superRefine((i,r)=>{let o=e(i);if(o instanceof Promise)return o.then(s=>{if(!s){let a=HQ(t,i),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}});if(!o){let s=HQ(t,i),a=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:a})}}):mn.create()}var tM={object:gt.lazycreate},j;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(j||(j={}));var rM=(e,t={message:`Input not instance of ${e.name}`})=>XQ(n=>n instanceof e,t),ev=hn.create,tv=ti.create,nM=Io.create,iM=ri.create,rv=ni.create,oM=ii.create,sM=go.create,aM=oi.create,cM=si.create,AM=mn.create,uM=Yr.create,lM=ar.create,dM=po.create,fM=jr.create,gM=gt.create,pM=gt.strictCreate,hM=ai.create,mM=QA.create,IM=ci.create,EM=vr.create,yM=vA.create,CM=ho.create,BM=mo.create,QM=wA.create,vM=Ai.create,wM=ui.create,bM=li.create,kM=di.create,SM=In.create,xM=Yt.create,RM=Vt.create,DM=wr.create,_M=Yt.createWithPreprocess,NM=oa.create,UM=()=>ev().optional(),TM=()=>tv().optional(),$M=()=>rv().optional(),FM={string:(e=>hn.create({...e,coerce:!0})),number:(e=>ti.create({...e,coerce:!0})),boolean:(e=>ni.create({...e,coerce:!0})),bigint:(e=>ri.create({...e,coerce:!0})),date:(e=>ii.create({...e,coerce:!0}))};var MM=J;var tg=(r=>(r.ModelProvider="model_provider",r.SutAccess="sut_access",r.Skyramp="skyramp",r.Other="other",r))(tg||{}),rg=(i=>(i.Ready="ready",i.Blocked="blocked",i.NeedsInputs="needs_inputs",i))(rg||{});var ng=300,he=u.string().trim().min(1),LM=u.object({action:u.enum(["start","run","wait"]),text:he,source:u.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:he.nullable().describe("the file the step came from, relative to the component's repository; null unless source is file")}).strict().refine(e=>e.source==="file"==(e.file!==null),{path:["file"],message:"a file exactly when the step came from one"}),ig=/^[A-Za-z_][A-Za-z0-9_]*$/,pt=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,sa=(s=>(s.VersionEndpoint="version_endpoint",s.DeployWorkflow="deploy_workflow",s.KubernetesLabels="kubernetes_labels",s.Command="command",s.Api="api",s.NotTracked="not_tracked",s))(sa||{}),Hr="shared",PM=he.refine(e=>{try{let t=new URL(e);return["http:","https:"].includes(t.protocol)&&!t.username&&!t.password}catch{return!1}},"an http(s) URL with no login in it"),Eo=u.object({address:PM,readyWhen:he.nullable(),credentials:u.array(u.string().regex(pt)).max(50),revisionSources:u.array(u.object({method:u.nativeEnum(sa),detail:he.describe("what Testbot reads, such as GET /version or the deploy workflow's name; for not_tracked, why nothing shows it"),components:u.array(he).min(1).describe("the components it tells the revision of, by name")}).strict()).max(50)}).strict(),og={steps:u.array(LM).max(20).optional().describe("how it starts, in order"),kind:u.enum(["web_app","service","database","external_service"]).optional(),from:u.object({file:he,service:he.nullable()}).strict().optional(),credentials:u.array(u.string().max(100).regex(ig)).max(50).optional().describe("the Target's credentials this component's recipe uses: a sign-in (a test user, password or token) or an API key, which the workflow supplies from a GitHub Actions secret as the environment variable of the credential's name; give each name exactly as the recipe reads it. Names only, never a value, and not a secret the recipe generates itself")},OM=u.object({name:he,repository:he.describe("owner/repo of the Target repository the component is built or started from, such as the one whose compose file starts its database"),healthy:u.boolean(),...og,deployed:he.nullable().optional().describe('only with "environment": the revision the component runs, as you read it from its revision source, or null when you could not tell')}),zM=u.object({name:u.string().regex(pt).describe("the credential's environment variable name, as the recipe reads it and the credentials event names it"),purpose:u.enum(["sut_access","other"]).describe("sut_access: it signs in to or calls the SUT or a service it needs; other: anything else"),required:u.boolean().describe("false only when the SUT starts without it, with less working"),how:he.max(ng).describe('one short sentence: what the value is and where a person gets it, such as "A Mattermost Enterprise licence key, from the customer portal"; never a value')}),sg=u.object({name:he.describe("the credential's environment variable name, as listed above; never its value"),component:he.describe("the component that refused it"),status:u.number().int().min(400).max(599).optional().describe("the HTTP status it got, such as 401 or 403; leave it out when the refusal was not an HTTP answer"),evidence:he.describe("the request or command you tested it with and what came back, never the value")}),GM=400,nv=(e,t)=>he.max(GM).optional().describe(`one or two plain sentences: ${e}, such as "${t}"; never the value`),VM=sg.extend({name:u.string().regex(pt).describe("the credential's environment variable name, as the SUT input lists it; never its value"),explanation:nv("what the component did with the value and why it is wrong","The app checks the licence key at startup and exits: the value this run has does not match the licence it expects.")}),JM=u.object({name:u.string().regex(pt).describe("the credential's environment variable name, as the SUT input lists it"),component:he.describe("the component that cannot come up or work without it"),evidence:he.describe("the command you ran and what came back that shows it needs a value, never a value"),explanation:nv("what the component needs the value for and what it does without one","The app reads the licence key at startup and exits when it is empty.")}),YM=u.object({component:he,problem:he,evidence:he.describe("the exact command and output that shows it"),fix:he.describe("what the user must provide, and where; never a change to a file under .skyramp/sut/")}),jM=u.object({framework:he,file:he.describe("the test file run, relative to its repository root"),result:u.enum(["pass","fail","error"])}),HM=u.object({input:he.describe("the part of the user's SUT input, as given"),reason:he}),T5=u.object({schemaVersion:u.literal(1),status:u.nativeEnum(rg).describe("ready only if every component came up healthy and the recipe is written; needs_inputs when the recipe is written but a component cannot start without a credential this run has no value for"),components:u.array(OM),suites:u.array(jM).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:u.array(he).default([]).describe("the parts of the user's SUT input the recipe used as given"),inputsUsedHow:u.array(u.object({input:he.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:he.describe("what the recipe did with it")})).optional(),inputsNotUsed:u.array(HM).default([]).describe("the parts it did not use, and why. A part that is wrong goes here, with what was wrong, even when the recipe does something like it instead: one the repositories or the app show is wrong, such as a file, command, port, route or setting that is not there. Something outside them that does not answer is not one: that is a blocker"),blockers:u.array(YM).describe("required (non-empty) when status is blocked, unless credentialsRefused or credentialsWithoutValue says why; never one for a credential either of them names"),inputs:u.array(zM).max(50).optional().describe("required (non-empty) when status is needs_inputs, else left out: each credential the candidate recipe needs a value for"),credentialsRefused:u.array(VM).max(50).optional().describe("only with status blocked: each credential the SUT input lists that the SUT still refused after a person confirmed it, or when no other credential worked. Testbot writes its blocker"),credentialsWithoutValue:u.array(JM).max(50).optional().describe("only with status blocked: each credential the SUT input lists as empty in this run that a component cannot come up or work without. Testbot writes its blocker"),environment:Eo.optional().describe("only when the whole SUT is an existing deployment you tested where it runs, building and starting nothing: its address, what says it is ready, the credentials that reach it, and how to read what each component runs. Leave it out when any part was built or started on the runner, or reaching it needed something there (a tunnel, port-forward or proxy; a client certificate is named in .skyramp/sut/client-cert.json instead)")});var ag=64*1024,cg=512*1024,iv=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var aa=(o=>(o.NotFound="not_found",o.NoAccess="no_access",o.Unavailable="unavailable",o.AccessLost="access_lost",o.CannotOpen="cannot_open",o))(aa||{});var ov=e=>`${e.source}:${e.site??""}:${e.key}`;var bA=/^pasted-[0-9a-f]{16}$/,kA=/^file-[0-9a-f]{16}$/,SA=(r=>(r.Pdf="application/pdf",r.Csv="text/csv",r.Docx="application/vnd.openxmlformats-officedocument.wordprocessingml.document",r.Xlsx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",r))(SA||{});var Ag=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(Ag||{}),ug=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(ug||{}),lg=(m=>(m.RelatedChangeConflict="related_change_conflict",m.ReferenceOutsideTarget="reference_outside_target",m.SourceAccessLost="source_access_lost",m.ConfigurationIncomplete="configuration_incomplete",m.CredentialUnavailable="credential_unavailable",m.WorkflowBindingUnverified="workflow_binding_unverified",m.WorkflowRefUnprotected="workflow_ref_unprotected",m.BedrockWorkflowRequired="bedrock_workflow_required",m.DeploymentReview="deployment_review",m.SutRevisionMismatch="sut_revision_mismatch",m.IsolationUnavailable="isolation_unavailable",m.EvidenceInsufficient="evidence_insufficient",m.ConfigurationUnresolved="configuration_unresolved",m.ModelProviderDenied="model_provider_denied",m.ModelProviderUnavailable="model_provider_unavailable",m.RunnerProviderNotReady="runner_provider_not_ready",m.MergeConflict="merge_conflict",m))(lg||{}),ca=(o=>(o.CiCheck="ci_check",o.TestReport="test_report",o.StaticAnalysis="static_analysis",o.CodeReview="code_review",o.Other="other",o))(ca||{}),dg=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(dg||{}),fg=(a=>(a.AuthToken="auth_token",a.Secret="secret",a.DataConnection="data_connection",a.AppNotStarted="app_not_started",a.Login="login",a.ExternalDependency="external_dependency",a.RecordingReplay="recording_replay",a))(fg||{});var gg=(n=>(n.Probe="probe",n.Agent="agent",n))(gg||{}),pg=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(pg||{}),hg=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(hg||{});var sv=(n=>(n.Skyramp="skyramp",n.Llm="llm",n))(sv||{}),br=u.string().trim().min(1),qM=u.object({case:br.describe("recommend id this assertion enforces"),evidence:br.describe("the exact assertion line from the file that checks that case's observable")});var WM=u.object({route:u.literal("persistence"),url:u.string().url()}).strict(),mg=u.object({kind:u.nativeEnum(pg).describe("seed: data the test creates in the app; runtime_mock: a mock on a Skyramp worker, which other tests reach too; env_override: an env value the app runs with. A stub inside the test's own process, such as a browser page's route, is none of these"),target:br.describe("the dependency, endpoint or data it affects"),mechanism:u.nativeEnum(hg).describe("test_code: the test applies and undoes it; skyramp_mocker: a mock the test applies on a Skyramp worker; recipe_override: the mocker cannot reach the dependency (its URL is fixed in the build)"),detail:br.describe("what it sets up"),worker:br.optional().describe("skyramp_mocker: host:port of the worker the test applies the mock to (default localhost:35142)"),safety:WM.optional().describe("shared seed that keeps its data only because the environment permits it: the persistence route and the exact endpoint; Testbot checks the current permission just before it runs the test"),cleanup:br.optional().describe("seed: when its data can be removed, a command that removes it if the test does not; otherwise declare leftBehind instead. Run as written and without a shell: give real values, not a placeholder such as <id>, single-quote an argument that holds shell syntax, or put the logic in a script in the repository and run that"),leftBehind:br.optional().describe("seed: the records the test creates and cannot remove from the app, and how to find them")}).refine(e=>!e.leftBehind||e.kind==="seed",{message:"leftBehind is for a seed only: a runtime mock or an env override creates no records",path:["leftBehind"]}),ZM=u.object({file:br.describe("staged path under .skyramp/staged/"),source:u.nativeEnum(sv),language:br,covers:u.array(u.string()).min(1,"must be a non-empty array of recommend ids").describe("recommend ids this test covers"),assertions:u.array(qM).min(1,"must be a non-empty array").describe("one per case covered, citing the real line"),context:u.array(mg).optional().describe("what the test sets up against the running app, in order: data it seeds, Skyramp mocks it applies, env overrides; omit when none")}),P5=u.object({schemaVersion:u.literal(1),tests:u.array(ZM),deferredUi:u.array(u.string()).describe("recommend ui ids left for the UI stage (generate) \u2014 [] for generate-ui"),summary:br.describe("one paragraph")});var av=(s=>(s.Place="place",s.Update="update",s.Regenerate="regenerate",s.Delete="delete",s.Verify="verify",s.None="none",s))(av||{}),cv=(i=>(i.Pass="pass",i.Fail="fail",i.Skip="skip",i))(cv||{}),nt=u.string().trim().min(1),Av=(r=>(r.Setup="setup",r.Expectation="expectation",r.Locator="locator",r.Other="other",r))(Av||{}),KM=u.object({kind:u.nativeEnum(Av),reason:nt.describe("what in the test is wrong, with the evidence: the setup error it raised, or the requirement or changed line its expectation contradicts")}),Ig=u.array(u.string().url().max(2048).regex(/^https?:\/\//i)).max(50),XM=u.object({case:nt.describe("a covers id \u2014 the recommend case this test realizes"),status:u.nativeEnum(cv),runtimeTargets:Ig.optional().describe("HTTP(S) URLs this case actually exercised in its current run; omit for in-process or mocked checks, never infer from test type"),environmentRestriction:nt.optional().describe("for a skipped case: what this run lacks to execute it; the test is still written"),fromJourney:u.boolean().optional(),testProblem:KM.optional().describe("[derived] write's reading of a failing case: the test, not the app, is at fault"),defect:u.boolean().optional().describe("[derived] write's reading of a failing case: true when the app is wrong and the test is right"),failure:u.string().optional().describe("[derived] for a failing case: the runner's failure for it, as printed")}).refine(e=>!e.environmentRestriction||e.status==="skip"&&!e.runtimeTargets?.length,{message:"an environment-restricted case must be skipped and have no runtimeTargets"}),eL=u.object({started:u.boolean().optional().describe("with exit null: true if the test command started (it was interrupted or timed out), false if it never started. Left out, Testbot counts it as possibly started, with its cleanup unknown"),exit:u.number({invalid_type_error:"must be a number or null"}).nullable().describe("process exit of the re-run; null when no SUT was available"),details:u.string().optional().describe("what failed, or why a file was not run \u2014 required on any non-zero exit"),tests:u.array(XM).optional().describe("ONE ENTRY PER CASE the file covers, its own result; must agree with exit (0 \u2192 no fail; non-zero \u2192 at least one, or the non-test reason in details). The report reads the file by these where they are given")}),tL=u.object({context:u.array(mg).optional().describe("[derived] setup declarations retained for every executed test, including maintained tests"),from:u.string().optional().describe("staged path \u2014 required for placements"),file:nt.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:nt.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),action:u.nativeEnum(av),covers:u.array(u.string()).optional().describe("recommend ids a placed test covers"),repro:u.boolean().optional().describe("this test is MEANT to fail \u2014 it reproduces a reported bug"),finding:u.boolean().optional().describe("a non-repro test that failed on a REAL product bug"),placementBroken:u.boolean().optional().describe('placement/harness problem one repair could not fix \u2014 every reran.tests entry is then "skip"'),keptReason:nt.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:nt.optional().describe('only for a test marked "runs alone": the command, from its checkout root and without a shell, that runs only this file and writes its JUnit XML into $SKYRAMP_RESULTS_DIR (named by its path: no shell expands it) \u2014 the harness runs it, so leave reran.exit null'),reran:eL,assertionCount:u.number().int().nonnegative().optional().describe("[derived] assertions reachable from the file, counted at write time"),addedOnly:u.boolean().optional().describe("[derived] an existing test file the run only added to: every line it had is still there"),added:u.array(nt).optional().describe("[derived] the cases of the test functions the run added to an existing file: functions it did not have"),staleOnBase:u.boolean().optional().describe("[derived] an existing test that fails the same way on the base branch: its failure is the test's own")}).refine(e=>e.action!=="place"||typeof e.from=="string"&&e.from.trim().length>0,{message:'is a place but has no "from" staged path',path:[]}),uv=(n=>(n.Junit="junit",n.Converter="converter",n))(uv||{}),rL=nt.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),nL=u.object({results:nt.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:u.nativeEnum(uv),run:nt.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:u.array(nt).min(1).describe("the items[].file paths this run covered"),cases:u.array(u.object({test:nt.describe("the test's name as the runner reports it, qualified by its class or file (e.g. tests/test_a.py::test_x) when the bare name repeats"),case:nt.describe("the covers id it realizes"),file:rL})).describe("map each reported test name to the case it covers")}),iL=u.object({suites:u.array(nL).min(1)}),V5=u.object({schemaVersion:u.literal(1),items:u.array(tL),runnerResults:iL.optional().describe("the JUnit XML your test runs wrote into $SKYRAMP_RESULTS_DIR, so the harness reads each test's result from the runner \u2014 omit only when no SUT is available"),ignored:u.array(u.string()).describe("existing tests assessed and deliberately left untouched"),summary:nt.describe("one paragraph")});var wl=rt(mv(),1),Nq=rt(z0(),1);var Mr;(function(e){e[e.OK=200]="OK",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.ResourceMoved=302]="ResourceMoved",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.TooManyRequests=429]="TooManyRequests",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout"})(Mr||(Mr={}));var G0;(function(e){e.Accept="accept",e.ContentType="content-type"})(G0||(G0={}));var V0;(function(e){e.ApplicationJson="application/json"})(V0||(V0={}));var W7=[Mr.MovedPermanently,Mr.ResourceMoved,Mr.SeeOther,Mr.TemporaryRedirect,Mr.PermanentRedirect],Z7=[Mr.BadGateway,Mr.ServiceUnavailable,Mr.GatewayTimeout];var Y0=require("os"),dc=require("fs"),jm=function(e,t,n,i){function r(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(l){try{A(i.next(l))}catch(d){s(d)}}function c(l){try{A(i.throw(l))}catch(d){s(d)}}function A(l){l.done?o(l.value):r(l.value).then(a,c)}A((i=i.apply(e,t||[])).next())})},{access:Tq,appendFile:$q,writeFile:Fq}=dc.promises,J0="GITHUB_STEP_SUMMARY";var Hm=class{constructor(){this._buffer=""}filePath(){return jm(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let t=process.env[J0];if(!t)throw new Error(`Unable to find environment variable for $${J0}. Check if your runtime environment supports job summaries.`);try{yield Tq(t,dc.constants.R_OK|dc.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${t}'. Check if the file has correct read/write permissions.`)}return this._filePath=t,this._filePath})}wrap(t,n,i={}){let r=Object.entries(i).map(([o,s])=>` ${o}="${s}"`).join("");return n?`<${t}${r}>${n}</${t}>`:`<${t}${r}>`}write(t){return jm(this,void 0,void 0,function*(){let n=!!t?.overwrite,i=yield this.filePath();return yield(n?Fq:$q)(i,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return jm(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(t,n=!1){return this._buffer+=t,n?this.addEOL():this}addEOL(){return this.addRaw(Y0.EOL)}addCodeBlock(t,n){let i=Object.assign({},n&&{lang:n}),r=this.wrap("pre",this.wrap("code",t),i);return this.addRaw(r).addEOL()}addList(t,n=!1){let i=n?"ol":"ul",r=t.map(s=>this.wrap("li",s)).join(""),o=this.wrap(i,r);return this.addRaw(o).addEOL()}addTable(t){let n=t.map(r=>{let o=r.map(s=>{if(typeof s=="string")return this.wrap("td",s);let{header:a,data:c,colspan:A,rowspan:l}=s,d=a?"th":"td",f=Object.assign(Object.assign({},A&&{colspan:A}),l&&{rowspan:l});return this.wrap(d,c,f)}).join("");return this.wrap("tr",o)}).join(""),i=this.wrap("table",n);return this.addRaw(i).addEOL()}addDetails(t,n){let i=this.wrap("details",this.wrap("summary",t)+n);return this.addRaw(i).addEOL()}addImage(t,n,i){let{width:r,height:o}=i||{},s=Object.assign(Object.assign({},r&&{width:r}),o&&{height:o}),a=this.wrap("img",null,Object.assign({src:t,alt:n},s));return this.addRaw(a).addEOL()}addHeading(t,n){let i=`h${n}`,r=["h1","h2","h3","h4","h5","h6"].includes(i)?i:"h1",o=this.wrap(r,t);return this.addRaw(o).addEOL()}addSeparator(){let t=this.wrap("hr",null);return this.addRaw(t).addEOL()}addBreak(){let t=this.wrap("br",null);return this.addRaw(t).addEOL()}addQuote(t,n){let i=Object.assign({},n&&{cite:n}),r=this.wrap("blockquote",t,i);return this.addRaw(r).addEOL()}addLink(t,n){let i=this.wrap("a",t,{href:n});return this.addRaw(i).addEOL()}},aee=new Hm;var qm=rt(require("os"),1);var bl=rt(require("fs"),1);var{chmod:Mq,copyFile:Lq,lstat:Pq,mkdir:Oq,open:uee,readdir:zq,rename:Gq,rm:Vq,rmdir:lee,stat:Jq,symlink:Yq,unlink:jq}=bl.promises,Hq=process.platform==="win32";var dee=bl.constants.O_RDONLY;var mee=process.platform==="win32";var Cee=qm.default.platform(),Bee=qm.default.arch();var q0;(function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure"})(q0||(q0={}));function Z0(e){return e.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}var K0=rt(require("path"));var Wm=(r=>(r.Clean="clean",r.RecipeDrift="recipe-drift",r.ChangeBrokeBringup="change-broke-bringup",r.BringupFailed="bringup-failed",r))(Wm||{}),Fn=u.string().trim().min(1),eW=u.object({url:u.string().optional().describe("the URL probed, if the check is an HTTP request"),command:u.string().optional().describe("the command run, if the check is a script \u2014 preferred when auth is needed"),headers:u.record(u.string()).optional(),status:u.union([u.number(),u.string()]).optional().describe("expected HTTP status for a url check (default 200)"),output:Fn.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),tW=u.array(u.object({component:Fn.describe("a shared component listed above"),url:Fn.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:Fn.describe("what the URL returned, VERBATIM; this gate FETCHES each url")})).describe("only when shared components are listed above: one check per component whose deployed commit you found"),Hee=u.object({schemaVersion:u.literal(1),baseUrls:u.record(u.string()).optional().describe("service \u2192 base URL of the running app; omit on a failed bring-up, never invent one"),health:eW.optional(),teardown:Fn.describe("command that tears the SUT down"),dependencies:u.record(u.boolean()).optional().describe("EVERY backing service: true = really deployed, false = mocked; REQUIRED when the app came up"),outcome:u.nativeEnum(Wm).describe("clean | recipe-drift (you corrected the recipe) | change-broke-bringup (the PR broke it) | bringup-failed (environment, not the PR)"),recipeFixes:u.array(u.string()).optional().describe("required when outcome is recipe-drift: what was corrected"),bringupError:u.object({command:Fn,output:Fn}).optional().describe("required when bring-up failed: the exact failing command and what it printed"),suspectFiles:u.array(u.string()).optional().describe("required for change-broke-bringup: files THIS PR changed that the failure points at, relative to your working directory (a file in another checkout of the run: its absolute path)"),seeded:u.boolean(),startedAt:Fn.describe("ISO timestamp"),revisions:tW.optional(),missingSecrets:u.array(u.string().regex(ig)).optional().describe("bringup-failed only: each secret the app cannot start without that this run has no value for, by its environment variable name; never a value"),credentialsRefused:u.array(sg).optional().describe("only for credentials the prompt lists to test: each that was refused when you tested it, such as with a 401 or 403; leave it out when none was, or when none is listed"),recipeRecorded:u.boolean().optional().describe("[derived] whether the checkout had a recorded recipe before bring-up")});var ze=u.string().trim().min(1),kl=ze,Zm=(n=>(n.TestbotManaged="testbot_managed",n.CustomerDeployed="customer_deployed",n))(Zm||{}),Km=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],X0=(n=>(n.Refused="refused",n.NoValue="no_value",n))(X0||{}),rW=u.object({name:u.string().regex(pt),kind:u.nativeEnum(X0),explanation:ze.optional()}).strict(),e_=u.object({schemaVersion:u.literal(1),type:u.nativeEnum(Zm).optional(),repository:kl.optional().describe("namespace/name of the source whose checkout the recipe was written and proven in (SKYR-5380); a run replays it from there. Never on a customer_deployed plan"),status:u.enum(["ready","blocked"]),environment:Eo.optional(),components:u.array(u.object({name:ze,repository:ze.describe(`owner/repo, or "${Hr}" for a customer-deployed component no repository builds`),healthy:u.boolean(),url:u.string().min(1).nullable(),...og,credentials:u.array(u.string().regex(pt)).max(50).optional(),deployed:ze.nullable().optional().describe("customer_deployed only: the revision the component runs, as setup read it (WF-SETUP-22's Deployed now), or null when it could not tell")}).strict()),suites:u.array(u.object({framework:ze,file:ze,result:u.enum(["pass","fail","error"])}).strict()),inputsUsed:u.array(ze),inputsUsedHow:u.array(u.object({input:ze,how:ze}).strict()).optional(),inputsNotUsed:u.array(u.object({input:ze,reason:ze}).strict()),blockers:u.array(u.object({component:ze,problem:ze,evidence:ze,fix:ze,credential:rW.optional()}).strict()),replay:u.object({outcome:ze,durationSeconds:u.number().nonnegative().nullable()}).strict().nullable(),files:u.array(u.object({path:ze,content:u.string()}).strict())}).strict().superRefine((e,t)=>{e.inputsUsedHow?.forEach((r,o)=>{e.inputsUsed.includes(r.input)||t.addIssue({code:u.ZodIssueCode.custom,path:["inputsUsedHow",o,"input"],message:"not one of inputsUsed"})}),e.components.forEach((r,o)=>{r.credentials&&new Set(r.credentials).size!==r.credentials.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"credentials"],message:"names a credential twice"})});let n=e.type==="customer_deployed";n!==(e.environment!==void 0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["environment"],message:"an environment exactly when the plan's type is customer_deployed"}),n&&e.repository!==void 0&&t.addIssue({code:u.ZodIssueCode.custom,path:["repository"],message:"a customer_deployed plan names no repository"}),e.environment&&new Set(e.environment.credentials).size!==e.environment.credentials.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["environment","credentials"],message:"names a credential twice"});let i=new Set(e.components.map(r=>r.name));if(e.environment?.revisionSources.forEach((r,o)=>{r.components.forEach((s,a)=>{i.has(s)||t.addIssue({code:u.ZodIssueCode.custom,path:["environment","revisionSources",o,"components",a],message:"not one of components"})})}),e.components.forEach((r,o)=>{r.deployed!==void 0!==n&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"deployed"],message:"what a component runs exactly when the plan is customer_deployed"}),r.repository===Hr&&!n&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"repository"],message:`only a customer_deployed component is ${Hr}`})}),n&&(e.components.forEach((r,o)=>{e.components.findIndex(s=>s.name===r.name)!==o&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"name"],message:"names a component twice"})}),e.replay!==null&&t.addIssue({code:u.ZodIssueCode.custom,path:["replay"],message:"a customer_deployed plan is never replayed"}),e.files.forEach((r,o)=>{Km.includes(r.path)&&t.addIssue({code:u.ZodIssueCode.custom,path:["files",o,"path"],message:"a customer_deployed plan has no script that starts or stops the system"})})),n&&e.status==="ready"){let r=new Set(e.environment?.revisionSources.flatMap(o=>o.components));e.components.forEach((o,s)=>{o.repository!==Hr&&!r.has(o.name)&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",s,"name"],message:"a ready customer_deployed plan reads what every component a repository builds runs"})})}});var ete=["clean","recipe-drift"];function Sl(e){let t=K0.posix.normalize(e);return t===e&&(t===".skyramp/workspace.yml"||t.startsWith(".skyramp/sut/")&&t.length>13)}var t_=u.string().uuid(),xl=u.object({environmentId:u.string().uuid(),allowed:u.boolean(),revision:t_,updatedAt:u.string().datetime(),updatedBy:u.string().uuid()}).strict();var r_=(s=>(s.NoEnvironment="no_environment",s.NoRecordedGrant="no_recorded_grant",s.Unavailable="unavailable",s.Changed="changed",s.Denied="denied",s.OutOfScope="out_of_scope",s))(r_||{});var ite=u.object({environmentId:u.string().uuid(),environmentAddress:u.string().url(),revision:t_}).strict(),ote=u.object({refusal:u.nativeEnum(r_)}).strict();var I_=u.unknown().optional();var gc=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(gc||{}),rI=(o=>(o.Trigger="TRIGGER",o.Baseline="BASELINE",o.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",o.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",o.ManualOverride="MANUAL_OVERRIDE",o))(rI||{}),E_=(s=>(s.PullRequest="pull_request",s.ReadyForReview="ready_for_review",s.Schedule="schedule",s.Manual="manual",s.SutSetup="sut_setup",s.RevisionRead="revision_read",s))(E_||{}),oW=["sut_setup"],sW=["sut_setup","schedule","revision_read"];var y_=(t=>(t.PullRequest="pull_request",t))(y_||{}),C_=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))(C_||{}),n_=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var B_=(o=>(o.ReportUploaded="report_uploaded",o.NoReport="no_report",o.Cancelled="cancelled",o.RecipeUploaded="recipe_uploaded",o.RevisionsUploaded="revisions_uploaded",o))(B_||{}),Q_=(n=>(n.Running="running",n.Ended="ended",n))(Q_||{}),v_=(f=>(f.TimedOut="timed_out",f.AgentFailed="agent_failed",f.SetupFailed="setup_failed",f.CredentialMissing="credential_missing",f.RunnerLost="runner_lost",f.CheckoutFailed="checkout_failed",f.EnvironmentUnverified="environment_unverified",f.ModelProviderDenied="model_provider_denied",f.ModelProviderUnavailable="model_provider_unavailable",f.RunnerProviderNotReady="runner_provider_not_ready",f.MergeConflict="merge_conflict",f.EnvironmentUnavailable="environment_unavailable",f))(v_||{}),w_=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(w_||{}),nI=(n=>(n.Started="started",n.Finished="finished",n))(nI||{}),b_=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(b_||{});var k_=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(k_||{});var S_=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(S_||{}),iI=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(iI||{}),eI=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(eI||{});var oI=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(oI||{}),Kt=u.string().regex(/^[1-9][0-9]{0,18}$/),Xt=u.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),tI=u.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),x_=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;var Xe=u.string().regex(x_),at=u.string().regex(/^[0-9a-f]{64}$/),Nl=u.object({id:Xe,revision:Kt}).strict(),Tl={provider:u.literal("github"),providerAccountId:Kt,providerRepositoryId:Kt},$l={provider:u.literal("azure-devops"),providerAccountId:Xe,providerRepositoryId:Xe},mr=u.discriminatedUnion("provider",[u.object(Tl).strict(),u.object($l).strict()]),gte=u.discriminatedUnion("provider",[u.object(Tl).passthrough(),u.object($l).passthrough()]),Ul=e=>`${e.provider}:${e.providerRepositoryId}`,i_={namespace:u.string().min(1),name:u.string().min(1)},R_=u.discriminatedUnion("provider",[u.object({...Tl,...i_}).strict(),u.object({...$l,...i_}).strict()]),o_=u.object({ref:u.string().min(1),revision:Xt}).strict(),aW=u.object({kind:u.nativeEnum(C_),number:Kt.optional(),ref:u.string().min(1),revision:Xt,reason:u.nativeEnum(rI)}).strict(),cW=u.object({repository:R_,revision:Xt,ref:u.string().nullable(),reason:u.nativeEnum(rI),change:u.object({kind:u.nativeEnum(y_),number:Kt,base:o_.optional()}).strict().nullable(),compareWith:o_.optional(),merge:u.array(aW).min(2).optional()}).strict();function AW(e){let t=e.merge;if(!t)return null;if(e.change||e.compareWith)return{path:["merge"],message:"a merged source names no change and no compareWith"};if(e.ref===null)return{path:["ref"],message:"a merged source names its baseline branch"};let n=new Set,i=new Set;for(let[o,s]of t.entries()){if(s.kind==="pull_request"!=(s.number!==void 0))return{path:["merge",o,"number"],message:"a pull request names its number, and a branch none"};if(!n_.includes(s.reason))return{path:["merge",o,"reason"],message:`${s.reason} does not select a merged revision`};if(s.kind==="branch"&&s.reason!=="MANUAL_OVERRIDE")return{path:["merge",o,"reason"],message:"only a person chooses a branch to merge"};if(s.ref===e.ref)return{path:["merge",o,"ref"],message:"the baseline branch is what the source merges onto"};if(s.number!==void 0&&n.has(s.number)||i.has(s.ref))return{path:["merge",o],message:"names a revision the source already merges"};s.number!==void 0&&n.add(s.number),i.add(s.ref)}let r=n_.find(o=>t.some(s=>s.reason===o));return e.reason!==r?{path:["reason"],message:`a source that merges these revisions is ${r}`}:null}function uW(e){if(e.trigger.kind==="revision_read"!=!e.baseline)return e.baseline?"a revision_read run names no baseline":"names its baseline";if(!e.baseline)return null;let{confirmedRunId:t,initialBaselineId:n,comparisonBaselineId:i,sources:r}=e.baseline;if([t,n,i].filter(A=>A!=null).length>1)return"a run compares with one baseline";let o=e.trigger.kind==="schedule"&&t!==null||n!==void 0||i!==void 0;if(!r)return o?"names every source of the snapshot, once":null;if(t===null&&n===void 0&&i===void 0)return"a run with no Confirmed Baseline names no baseline sources";let s=new Set(e.sources.map(A=>Ul(A.repository))),a=new Set(r.map(A=>Ul(A.repository)));return a.size===r.length&&a.size===s.size&&[...a].every(A=>s.has(A))?null:"names every source of the snapshot, once"}var D_=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,__=/^[1-9][0-9]{0,18}$/,s_=new RegExp(`${D_.source}|${__.source}`),a_=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,lW=u.union([u.object({source:u.literal("jira"),site:u.string().regex(a_),key:u.string().regex(D_),updated:u.string().datetime(),contentHash:at}).strict(),u.object({source:u.literal("confluence"),site:u.string().regex(a_),key:u.string().regex(__),version:u.number().int().positive(),contentHash:at}).strict(),u.object({source:u.literal("other"),key:u.string().regex(bA),contentHash:at}).strict(),u.object({source:u.literal("other"),key:u.string().regex(kA),contentHash:at,fileName:u.string().min(1).max(255),mediaType:u.nativeEnum(SA)}).strict()]),c_=u.union([u.literal("jira"),u.literal("confluence")]),pte=u.object({schemaVersion:u.literal(1),items:u.array(u.union([u.object({source:c_,site:u.string(),key:u.string().regex(s_),state:u.literal("read"),text:u.string(),version:u.string().min(1),contentMatches:u.boolean()}).strict(),u.object({source:c_,site:u.string(),key:u.string().regex(s_),state:u.literal("not_read"),reason:u.nativeEnum(aa)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(bA),state:u.literal("read"),text:u.string(),version:u.string().min(1),contentMatches:u.boolean()}).strict(),u.object({source:u.literal("other"),key:u.string().regex(bA),state:u.literal("not_read"),reason:u.nativeEnum(aa)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(kA),state:u.literal("read"),version:at,fileName:u.string().min(1).max(255),mediaType:u.nativeEnum(SA)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(kA),state:u.literal("not_read"),reason:u.nativeEnum(aa)}).strict()])),instructions:u.array(u.string()).optional()}).strict(),dW=u.object({resultId:u.string().min(1),repository:u.string().min(1),testType:u.string().min(1),path:u.string(),finding:u.string().min(1)}).strict(),fW=u.object({schemaVersion:u.literal(1),runId:Xe,skyrampOrgId:Xe,target:Nl,policy:Nl.nullable(),trigger:u.object({kind:u.nativeEnum(E_),requestedAt:u.string().datetime()}).strict(),configuration:u.object({captureId:Xe,revision:Kt.nullable(),hash:at}).strict(),baseline:u.object({confirmedRunId:Xe.nullable(),initialBaselineId:Xe.optional(),comparisonBaselineId:Xe.optional(),knownFailures:u.array(dW).optional(),sources:u.array(u.object({repository:mr,revision:Xt}).strict()).optional()}).strict().optional(),sources:u.array(cW).min(1).max(1e3),execution:u.object({provider:u.nativeEnum(gc),repository:R_,workflowPath:u.string(),ref:u.string()}).strict(),credentials:u.array(u.object({name:u.string(),purpose:u.nativeEnum(tg),required:u.boolean()}).strict()),requirements:u.array(lW).min(1).optional(),instructions:u.object({contentHash:at}).strict().optional(),deployedRevisions:u.array(u.object({repository:mr,revision:Xt}).strict()).min(1).optional()}).strict().superRefine((e,t)=>{let n=new Set;(e.requirements??[]).forEach((c,A)=>{let l="fileName"in c?"file":"pasted";c.source==="other"&&c.key!==`${l}-${c.contentHash.slice(0,16)}`&&t.addIssue({code:u.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",A,"key"]});let d=ov({source:c.source,key:c.key});n.has(d)&&t.addIssue({code:u.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",A,"key"]}),n.add(d)});let i=e.trigger.kind,r=oW.includes(i);r!==(e.policy===null)&&t.addIssue({code:u.ZodIssueCode.custom,path:["policy"],message:r?`a ${i} run has no policy`:"names the policy revision"}),e.baseline?.knownFailures&&!e.baseline.comparisonBaselineId&&t.addIssue({code:u.ZodIssueCode.custom,path:["baseline","knownFailures"],message:"known failures require a chosen comparison checkpoint"});let o=uW(e);o&&t.addIssue({code:u.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:o}),sW.includes(i)&&e.sources.forEach((c,A)=>{c.reason!=="BASELINE"&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",A,"reason"],message:`a ${i} run selects only BASELINE sources`})}),e.deployedRevisions&&i!=="manual"&&t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions"],message:"only a manual run pins deployed revisions"});let s=new Set(e.sources.map(c=>Ul(c.repository))),a=new Set;(e.deployedRevisions??[]).forEach((c,A)=>{let l=Ul(c.repository);s.has(l)?a.has(l)&&t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions",A,"repository"],message:"repository appears twice"}):t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions",A,"repository"],message:"names a repository outside the snapshot"}),a.add(l)}),e.sources.forEach((c,A)=>{c.compareWith&&(c.reason!=="MANUAL_OVERRIDE"||c.change)&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",A,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"}),e.baseline?.comparisonBaselineId&&(c.change?.base||c.compareWith||c.merge)&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",A],message:"a chosen checkpoint cannot be combined with a source comparison base or merge"});let l=AW(c);l&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",A,...l.path],message:l.message})})});var N_=(n=>(n.Person="person",n.Policy="policy",n))(N_||{}),gW=u.object({kind:u.nativeEnum(N_),name:u.string().min(1).max(256)}).strict(),pW=u.object({mcp:u.discriminatedUnion("source",[u.object({source:u.literal("npm"),version:u.string().regex(/^[A-Za-z0-9][A-Za-z0-9.+_-]{0,63}$/).nullable()}).strict(),u.object({source:u.literal("github"),ref:u.string().regex(/^[A-Za-z0-9._/-]{1,255}$/)}).strict()]),bedrock:u.object({region:u.string().regex(/^[a-z]{2}(-[a-z]+)+-[0-9]$/),roleArn:u.string().regex(/^arn:aws(-[a-z]+)*:iam::[0-9]{12}:role\/[\w+=,.@/-]{1,512}$/)}).strict().nullable()}).strict(),hte=u.object({schemaVersion:u.literal(1),attempt:u.object({id:Xe,number:u.number().int().positive(),deadlineAt:u.string().datetime()}).strict(),manifest:fW,manifestHash:at,entitlements:u.array(u.string()).optional(),runToken:u.string().min(1).optional(),requestedBy:gW.nullable().optional(),writeAllowed:u.boolean().optional(),claudeCodeVersion:u.string().regex(/^[0-9]+\.[0-9]+\.[0-9]+$/,"an exact version, such as 2.1.290").nullable().optional(),deployedRevisions:u.array(u.object({repository:mr,revision:Xt}).strict()).optional(),statedRevisions:u.array(u.object({repository:mr,revision:Xt}).strict()).optional(),runSettings:pW.optional()}).strict(),A_={providerRunAttempt:u.number().int().positive(),workflowRef:u.string().min(1)},hW=u.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),mte=u.object({schemaVersion:u.literal(1),runId:Xe,execution:u.discriminatedUnion("provider",[u.object({...A_,provider:u.literal("github"),repository:u.object(Tl).strict(),providerRunId:Kt}).strict(),u.object({...A_,provider:u.literal("azure-devops"),repository:u.object($l).strict(),providerRunId:hW}).strict()]),requester:u.literal(!0).optional(),writeCheck:u.literal(!0).optional(),claudeCodePin:u.literal(!0).optional(),deployedPins:u.literal(!0).optional(),statedPins:u.literal(!0).optional(),runSettings:u.literal(!0).optional(),credentialKinds:u.literal(!0).optional(),credentialBlockers:u.literal(!0).optional()}).strict(),u_=u.object({repository:mr,number:Kt,commitSha:Xt.optional()}).strict(),Rl=u.array(u.object({repository:mr,reason:u.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),mW=u.object({branch:tI.optional(),commitSha:Xt.optional()}).strict(),U_=4096,IW=u.array(u.object({file:u.string().max(4096).regex(/\S/),dependsOn:u.array(u.string().max(2048).regex(/\S/)).max(100)}).strict()).min(1).max(500),l_=u.object({repository:mr,message:u.string().max(U_),...mW.shape,heldBack:IW.optional()}).strict(),EW=u.discriminatedUnion("status",[u.object({status:u.literal("none"),noTests:Rl}).strict(),u.object({status:u.literal("delivered"),noTests:Rl,pullRequests:u.array(u_).min(1)}).strict(),u.object({status:u.literal("partial"),noTests:Rl,pullRequests:u.array(u_).min(1),failures:u.array(l_).min(1)}).strict(),u.object({status:u.literal("failed"),message:u.string().max(U_),noTests:Rl,failures:u.array(l_).min(1).optional()}).strict()]),Ite=1024*1024,Ete=16*1024*1024,fc={id:4096,text:16384,businessCase:65536},yW={id:fc.id,statement:fc.text,rows:1e3},d_=u.string().min(1).max(fc.id),_l=u.string().max(fc.text),Dl=(e,t)=>u.array(u.object({[e]:_l}).strict()).max(t).optional(),CW=u.object({language:u.custom(e=>e==="ja","Invalid"),businessCaseAnalysis:u.string().max(fc.businessCase),validation:u.object({rationale:_l.min(1),gaps:u.array(u.string().min(1).max(4096)).max(200)}).strict().optional(),changes:u.array(u.object({id:d_,text:_l}).strict()).max(1e3).optional(),requirements:u.array(u.object({id:d_,statement:_l}).strict()).max(yW.rows).optional(),issuesFound:Dl("description",5e3),newTestsCreated:Dl("description",5e3),testResults:Dl("details",5e3),caveats:Dl("text",100)}).strict(),BW=u.object({blockedPreflight:u.object({file:u.string().min(1),repository:u.string().min(1).optional(),reason:u.string().min(1).max(300),evidence:u.string().min(1).max(400)}).strict().optional(),sufficiency:u.nativeEnum(ug),rationale:u.string().min(1),gaps:u.array(u.string().min(1)),acceptedEvidence:u.array(u.object({kind:u.nativeEnum(ca),repository:u.string().min(1),revision:Xt,reference:u.string().min(1),summary:u.string().min(1)}).strict()),actionRequired:u.array(u.nativeEnum(lg))}).strict().superRefine((e,t)=>{e.sufficiency==="insufficient"!=e.gaps.length>0&&t.addIssue({code:u.ZodIssueCode.custom,path:["gaps"],message:"only insufficient evidence names gaps, and it names at least one"}),new Set(e.actionRequired).size!==e.actionRequired.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),Xm=500,QW=2048,vW=1e3,wW=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,f_=e=>e.length>0&&e.length<=64&&e===e.trim()&&!wW.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),T_=e=>{if(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/.test(e))return!0;let[t,n,i,...r]=e.split("/");return e.length<=201&&r.length===0&&i!==void 0&&/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,48}[A-Za-z0-9])?$/.test(t)&&f_(n)&&f_(i)},bW=u.object({testResults:u.array(u.object({resultId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:u.string().refine(T_,"Invalid"),testType:u.string(),runtimeTargets:Ig.optional(),endpoint:u.string(),status:u.enum(["Pass","Fail","Skipped"]),details:u.string(),fileName:u.string().optional(),testId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:u.object({kind:u.nativeEnum(dg),family:u.nativeEnum(fg).optional()}).strict().optional(),origin:u.nativeEnum(Ag).optional()}).strict()),validation:BW,changes:u.array(u.object({id:u.string().min(1).max(512),text:u.string().max(16384),source:u.string().max(QW),testedBy:u.array(u.string().min(1).max(1024)).max(Xm),writtenBy:u.array(u.string().min(1).max(1024)).max(Xm),maintainedBy:u.array(u.string().min(1).max(1024)).max(Xm)}).strict()).max(vW).optional(),traceVersion:u.literal(1),display:CW.optional()}).passthrough().superRefine((e,t)=>{let n=e.display,i={issuesFound:e.issuesFound,newTestsCreated:e.newTestsCreated,testResults:e.testResults,caveats:e.caveats};for(let o of["issuesFound","newTestsCreated","testResults","caveats"]){let s=n?.[o];s&&s.length!==(Array.isArray(i[o])?i[o].length:0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["display",o],message:`has not one row per ${o} row`})}n?.validation&&n.validation.gaps.length!==e.validation.gaps.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["display","validation","gaps"],message:"has not one gap per validation gap"});let r=new Set;e.testResults.forEach((o,s)=>{let a=o.failureCause;a&&o.status==="Pass"&&t.addIssue({code:u.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"a passing result has no failure cause"}),a&&a.kind==="environment"!=(a.family!==void 0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"an environment cause names its family, and no other cause does"});let c=["testResults",s,"resultId"],A=o.resultId.slice(`${o.repository}:${o.testType}:`.length);(!o.resultId.startsWith(`${o.repository}:${o.testType}:`)||A===""||A.startsWith("/")||A.startsWith("#"))&&t.addIssue({code:u.ZodIssueCode.custom,path:c,message:"is not repository:testType:path for this result"}),r.has(o.resultId)&&t.addIssue({code:u.ZodIssueCode.custom,path:c,message:"stable identity repeated"}),r.add(o.resultId)})});var kW=50,SW=u.discriminatedUnion("kind",[u.object({kind:u.literal("branch_pushed"),repository:mr,branch:tI,commit:Xt}).strict(),u.object({kind:u.enum(["pull_request_opened","pull_request_edited"]),repository:mr,number:Kt,branch:tI}).strict()]),xW=100,RW=2048,yte=u.object({records:u.array(u.string().regex(/^https?:\/\/[^\s/?#@]+(\/[^\s?#]*)?$/).max(RW)).max(xW),unlisted:u.number().int().nonnegative()}).strict().refine(e=>e.records.length+e.unlisted>0,"names at least one create"),DW=u.object({schemaVersion:u.literal(1),run:u.object({runId:Xe,attemptNumber:u.number().int().positive(),manifestHash:at}).strict(),target:Nl,policy:Nl,provenance:u.object({sources:u.array(u.object({repository:mr,revision:Xt}).strict()),firstQualification:u.literal(!0).optional()}).strict(),delivery:u.object({generatedTests:EW}).strict(),producer:u.object({testbot:u.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:u.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:bW,githubWrites:u.array(SW).max(kW).optional()}).strict(),$_=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))($_||{}),_W=200,NW=u.object({cause:u.nativeEnum($_),credential:u.string().regex(pt).optional(),reason:u.string().trim().min(1).max(_W).optional()}).strict().refine(e=>e.cause==="credential_rejected"==(e.credential!==void 0&&e.reason!==void 0),{message:"a credential_rejected check, and only one, names the credential and why"}),UW=u.object({name:u.string().regex(pt),purpose:u.enum(["sut_access","other"]),required:u.boolean(),how:u.string().trim().min(1).max(ng)}).strict(),Cte=DW.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:e_,check:NW.optional(),inputs:u.array(UW).min(1).max(50).optional()}).strict().superRefine(({recipe:e},t)=>{let n=(o,s)=>t.addIssue({code:u.ZodIssueCode.custom,path:["recipe",...o],message:s});e.status==="blocked"&&e.blockers.length===0&&n(["blockers"],"a blocked recipe names at least one blocker");let i=new Set,r=0;e.files.forEach((o,s)=>{Sl(o.path)||n(["files",s,"path"],"is not a file under .skyramp/sut/, or the .skyramp/workspace.yml a recipe stored before SKYR-5829 carries"),i.has(o.path)&&n(["files",s,"path"],"file repeated"),i.add(o.path),iv.test(o.content)&&n(["files",s,"content"],"is not text");let a=Buffer.byteLength(o.content,"utf8");r+=a,a>ag&&n(["files",s,"content"],`larger than ${ag} bytes`)}),r>cg&&n(["files"],`recipe text over ${cg} bytes in total`)}),Bte=u.object({components:u.array(u.object({name:u.string().min(1),repository:u.string().refine(T_,"Invalid"),observedRevision:u.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:u.nativeEnum(gg),evidence:u.string()}).strict().refine(e=>e.source!=="agent"||e.observedRevision===null,{path:["observedRevision"],message:"a component only an agent session can read names no revision"}))}).strict();var Qte=u.object({schemaVersion:u.literal(1),stage:u.nativeEnum(w_),event:u.nativeEnum(nI),status:u.nativeEnum(b_).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),Fl=100,TW=5e3,Vi=2e3,g_=100,F_=/^[A-Za-z0-9_-]{1,64}$/,$W=20,FW=200,MW=100,LW=100,PW=200,p_="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",OW=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${p_}/${p_})$`),zW=500,h_=50,GW=10,VW=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,M_=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,Mt=e=>u.string().max(e).refine(t=>t.trim().length>0&&!M_.test(t),"blank, or not text"),Lr={sequence:u.number().int().min(1).max(TW),at:u.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},L_=u.object({...Lr,kind:u.literal("reply"),to:u.string().uuid(),outcome:u.nativeEnum(S_),accepted:u.boolean(),text:Mt(Vi),note:u.object({source:u.enum(["target","environment"]),quote:Mt(Vi)}).strict().optional(),kept:Mt(Vi).optional()}).strict();function P_(e,t){if(e.kind!=="reply")return;let n=e;n.accepted!==(n.outcome==="answered"||n.outcome==="followed")&&t.addIssue({code:u.ZodIssueCode.custom,path:["accepted"],message:"accepted exactly when answered or followed"}),n.note&&n.outcome!=="not_followed"&&t.addIssue({code:u.ZodIssueCode.custom,path:["note"],message:"a note only when not_followed"}),n.kept&&n.outcome!=="followed"&&t.addIssue({code:u.ZodIssueCode.custom,path:["kept"],message:"kept only when followed"})}var JW=u.discriminatedUnion("kind",[u.object({...Lr,kind:u.literal("log"),phase:u.nativeEnum(iI),text:Mt(Vi)}).strict(),u.object({...Lr,kind:u.literal("component"),name:Mt(g_),repository:Mt(PW).refine(e=>OW.test(e)||e===Hr,"not owner/name"),file:Mt(zW).nullable(),status:u.nativeEnum(oI),version:Mt(LW).optional()}).strict(),L_,u.object({...Lr,kind:u.literal("question"),id:u.string().regex(F_),type:u.nativeEnum(k_),text:Mt(Vi),component:Mt(g_).nullable(),choices:u.array(Mt(FW)).max($W),placeholder:Mt(MW).optional()}).strict(),u.object({...Lr,kind:u.literal("delivered"),ids:u.array(u.string().uuid()).max(Fl)}).strict(),u.object({...Lr,kind:u.literal("credentials"),names:u.array(u.string().regex(pt)).min(1).max(h_),logins:u.array(u.object({key:u.string().regex(VW),usernameVariable:u.string().regex(pt),passwordVariable:u.string().regex(pt)}).strict()).min(1).max(GW).optional(),variables:u.array(u.string().regex(pt)).min(1).max(h_).optional()}).strict()]).superRefine((e,t)=>{if(P_(e,t),e.kind==="credentials"&&new Set(e.names).size!==e.names.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["names"],message:"a name twice"}),e.kind==="credentials"&&e.logins){let n=e.logins.map(i=>Z0(i.key));new Set(n).size!==n.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["logins"],message:"a key twice"}),e.logins.forEach((i,r)=>{for(let o of["usernameVariable","passwordVariable"])e.names.includes(i[o])||t.addIssue({code:u.ZodIssueCode.custom,path:["logins",r,o],message:"not one of the names"})})}e.kind==="credentials"&&e.variables&&(new Set(e.variables).size!==e.variables.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["variables"],message:"a name twice"}),e.variables.forEach((n,i)=>{e.names.includes(n)||t.addIssue({code:u.ZodIssueCode.custom,path:["variables",i],message:"not one of the names"})})),e.kind==="question"&&(e.type==="free_text"!=(e.choices.length===0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(e.choices).size!==e.choices.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),vte=u.object({schemaVersion:u.literal(1),events:u.array(JW).max(Fl)}).strict(),YW=u.discriminatedUnion("kind",[u.object({...Lr,kind:u.literal("log"),stage:u.nativeEnum(eI),text:Mt(Vi)}).strict(),L_,u.object({...Lr,kind:u.literal("delivered"),ids:u.array(u.string().uuid()).max(Fl)}).strict(),u.object({...Lr,kind:u.literal("stage"),stage:u.nativeEnum(eI),event:u.nativeEnum(nI)}).strict(),u.object({...Lr,kind:u.literal("test"),resultId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/),status:u.enum(["Pass","Fail","Skipped"]),details:u.string().max(Vi).refine(e=>!M_.test(e),"not text")}).strict()]).superRefine(P_),wte=u.object({schemaVersion:u.literal(1),events:u.array(YW).max(Fl)}).strict(),m_={id:u.string().uuid(),text:u.string(),by:u.string().nullable(),at:u.string(),replied:u.literal(!0).optional()},O_=u.discriminatedUnion("kind",[u.object({...m_,kind:u.literal("instruction"),question:u.null()}),u.object({...m_,kind:u.literal("answer"),question:u.string().regex(F_)})]),z_=u.string().regex(/^[A-Za-z0-9+/]{43}=$/),jW=u.object({id:u.string().uuid(),revision:u.string(),by:u.string().nullable(),at:u.string(),target:u.string(),own:u.object({source:u.enum(["policy","test_environment"]),text:u.string()}).nullable()}),bte=u.object({schemaVersion:u.literal(1),leftOut:u.array(u.string()),messages:u.array(O_).optional(),stop:u.object({key:z_}).optional(),notes:jW.optional()}),kte=u.object({schemaVersion:u.literal(1),messages:u.array(O_).optional()});var HW=500*1024*1024,G_=u.object({id:Kt,name:u.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:Kt,expiresAt:u.string().datetime()}).strict(),Ste=u.object({schemaVersion:u.literal(1),artifact:G_,sessionId:Xe,contentHash:at,bytes:u.number().int().min(1).max(HW)}).strict(),xte=u.object({schemaVersion:u.literal(1),checkpoint:u.object({artifact:G_,repository:u.object({namespace:u.string().min(1),name:u.string().min(1)}).strict(),sessionId:Xe,contentHash:at,key:z_}).strict().nullable()}).strict(),qW=200,hs=100,V_=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(V_||{}),WW=u.object({kind:u.nativeEnum(V_),setup:u.object({runId:Xe,endedAt:u.string().nullable(),outcome:u.string().nullable()}).strict(),components:u.array(u.object({name:u.string().min(1),repository:u.string().min(1),status:u.nativeEnum(oI)}).strict()).max(hs),credentials:u.array(u.string().min(1)).max(hs),answers:u.array(u.object({question:u.string(),answer:u.string().nullable()}).strict()).max(hs),instructions:u.array(u.object({text:u.string(),reply:u.string().nullable()}).strict()).max(hs),log:u.array(u.object({phase:u.nativeEnum(iI),text:u.string()}).strict()).max(qW),recipe:u.object({files:u.array(u.object({path:u.string().min(1),content:u.string()}).strict()).max(hs),blockers:u.array(u.object({component:u.string(),problem:u.string(),evidence:u.string(),fix:u.string()}).strict()).max(hs)}).strict().optional()}).strict(),Rte=u.object({schemaVersion:u.literal(1),context:WW.nullable()}).strict(),Dte=u.object({schemaVersion:u.literal(1),configuration:u.object({captureId:Xe,revision:Kt.nullable(),hash:at}).strict(),capture:u.object({schemaVersion:u.literal(1),settings:u.object({target:u.object({environment:u.unknown()}).passthrough(),timeoutMinutes:u.number().int().positive(),answerWaitMinutes:u.number().int().positive().optional(),testEnvironment:u.object({name:u.string().min(1),address:u.string().min(1).optional(),readyWhen:u.string().min(1).optional(),environmentId:u.string().uuid().optional(),persistentDataPolicy:I_}).passthrough().optional()}).passthrough(),provenance:u.object({}).passthrough(),hash:at}).strict()}).strict(),_te=u.object({schemaVersion:u.literal(1),environmentId:u.string().uuid().nullable(),environmentAddress:u.string().url().nullable(),persistentDataPolicy:xl.nullable()}).strict(),ZW=Eo.extend({environmentId:u.string().uuid().optional(),persistentDataPolicy:I_,version:u.number().int().positive(),components:u.array(u.object({name:u.string().min(1),repository:u.string().min(1)}).strict()),contentHash:at.optional(),files:u.array(u.object({path:u.string().refine(e=>Sl(e)&&!Km.includes(e),"not a file of a customer_deployed plan"),content:u.string()}).strict()).optional()}).strict(),Nte=u.object({schemaVersion:u.literal(1),testEnvironment:ZW.nullable().optional(),runtimePlan:u.object({version:u.number().int().positive(),contentHash:at,files:u.array(u.object({path:u.string().refine(Sl,"not a recipe file path"),content:u.string()}).strict()).min(1),repository:kl.optional(),recipeRepository:kl.optional(),recipe:u.record(u.unknown()).optional()}).strict().nullable()}).strict().refine(e=>!(e.runtimePlan&&e.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),Ute=u.object({schemaVersion:u.literal(1),state:u.nativeEnum(Q_),ending:u.nativeEnum(B_).nullable(),cause:u.nativeEnum(v_).nullable(),deadlineAt:u.string().datetime()}).strict();var KW=50,Tte=u.object({repository:mr,revisions:u.array(u.number().int().nonnegative()).min(1).max(2).refine(e=>e.length<2||e[0]<e[1],"two revisions name the earlier first"),files:u.array(u.string().min(1)).min(1).max(KW)}).strict();var XW=".skyramp/sut/deployed-revisions.sh",J_=(n=>(n.Running="running",n.Requested="requested",n))(J_||{});var Vte=new Set(Object.values(J_));var Jte=`Fix ${XW} so it prints the full commit each component runs, then set it up again.`;var tZ=/^(login|logout|signin|sign-in|signup|sign-up|auth|oauth|token|session)$/i,rZ=/^(login|logout|signin|sign-in|signup|sign-up|auth|oauth|token|sessions?)$/i,nZ=/(^|\/)(graphql(\.json)?|gql)(\/|$)/i,iZ=["id","uuid","_id","pk"],oZ=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,sZ=/^[0-9a-f]{24}$/i,H_=/^\d+$/,aZ=/^(token|jwt|(access|refresh|id|session)[-_]?token)$/i;function sI(e,t){if(e.toUpperCase()!=="POST")return!1;let n;try{n=new URL(t)}catch{return!1}let i=n.pathname.split("/").filter(Boolean),r=i.pop();return!!r&&!tZ.test(r)&&!i.some(o=>rZ.test(o))&&!nZ.test(n.pathname)}function q_(e){if(typeof e=="number")return Number.isSafeInteger(e)&&e>=0?e:void 0;if(typeof e=="string"&&(H_.test(e)||oZ.test(e)||sZ.test(e)))return e}function cZ(e,t){let n=String(e).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`(^|[^A-Za-z0-9])${n}($|[^A-Za-z0-9])`,"i");for(let[r,o]of Object.entries(t)){let s=r.toLowerCase();if(s==="location"||s==="content-location"||o===void 0)continue;let a=s==="set-cookie";if(!(!a&&H_.test(String(e))))for(let c of Array.isArray(o)?o:[o]){let A=a?c.split(";")[0].split("=").slice(1).join("="):c;if(i.test(A))return!0}}return!1}function W_(e,t,n,i,r){if(!sI(e,t)||n!==201)return{kind:"not-a-create"};let o={};try{let f=r===null||r.trim()===""?{}:JSON.parse(r);f&&typeof f=="object"&&!Array.isArray(f)&&(o=f)}catch{}if(Object.keys(o).some(f=>aZ.test(f)))return{kind:"sign-in"};let s=new URL(t);s.search="",s.hash="";let a=s.toString().replace(/\/+$/,""),c=typeof i.location=="string"?AZ(a,i.location):void 0,A=iZ.find(f=>o[f]!==void 0),l=A?q_(o[A]):void 0,d=c??(l===void 0?void 0:{entityUrl:`${a}/${l}`,id:l});return d?cZ(d.id,i)?{kind:"sign-in"}:{kind:"record",record:d}:i["set-cookie"]===void 0?{kind:"unnamed"}:{kind:"sign-in"}}function AZ(e,t){let n;try{n=new URL(t,`${e}/`)}catch{return}let i=new URL(e);if(n.origin!==i.origin)return;let r=n.pathname.replace(/\/+$/,"");if(!r.startsWith(`${i.pathname}/`))return;let o=r.slice(i.pathname.length+1),s=o.includes("/")?void 0:q_(o);return s===void 0?void 0:{entityUrl:`${e}/${s}`,id:s}}function Ml(e){try{let t=new URL(e);return t.origin+t.pathname.replace(/\/+$/,"")}catch{return}}function Z_(e,t){let n=Ml(t);return!!n&&e.some(i=>n===i||n.startsWith(`${i}/`))}var AF=require("crypto"),tt=rt(require("fs")),Zn=rt(require("http")),pX=rt(require("https")),Hf=rt(require("dns")),uF=require("module"),Le=rt(require("net"));var hA=rt(require("path")),qf=require("stream"),lF=require("stream/promises"),MQ=require("timers/promises"),Kn=rt(require("tls"));var M={};Br(M,{$brand:()=>yI,$input:()=>Yy,$output:()=>Jy,INVALID:()=>ut,NEVER:()=>EI,TimePrecision:()=>iC,ZodAny:()=>JB,ZodArray:()=>qB,ZodBase64:()=>Tf,ZodBase64URL:()=>$f,ZodBigInt:()=>ea,ZodBigIntFormat:()=>Lf,ZodBoolean:()=>Xs,ZodCIDRv4:()=>Nf,ZodCIDRv6:()=>Uf,ZodCUID:()=>bf,ZodCUID2:()=>kf,ZodCatch:()=>hQ,ZodCodec:()=>AA,ZodCompileAsyncError:()=>Er,ZodCompileUnsupportedError:()=>oe,ZodCreditCard:()=>FB,ZodCustom:()=>uA,ZodCustomStringFormat:()=>ao,ZodDate:()=>nA,ZodDefault:()=>uQ,ZodDiscriminatedUnion:()=>ZB,ZodE164:()=>Ff,ZodEmail:()=>Bf,ZodEmoji:()=>vf,ZodEnum:()=>Ws,ZodError:()=>S8,ZodExactOptional:()=>Gf,ZodFile:()=>sQ,ZodFirstPartyTypeKind:()=>RQ,ZodFunction:()=>bQ,ZodGUID:()=>Qf,ZodIBAN:()=>MB,ZodIPv4:()=>Df,ZodIPv6:()=>_f,ZodISODate:()=>Hn,ZodISODateTime:()=>jn,ZodISODuration:()=>Wn,ZodISOTime:()=>qn,ZodInstanceOf:()=>xQ,ZodIntersection:()=>KB,ZodIssueCode:()=>D8,ZodJWT:()=>Mf,ZodKSUID:()=>Rf,ZodLazy:()=>QQ,ZodLiteral:()=>oQ,ZodMAC:()=>$B,ZodMap:()=>nQ,ZodNaN:()=>IQ,ZodNanoID:()=>wf,ZodNever:()=>jB,ZodNonOptional:()=>Vf,ZodNull:()=>GB,ZodNullable:()=>AQ,ZodNumber:()=>Ks,ZodNumberFormat:()=>co,ZodObject:()=>oA,ZodOptional:()=>aA,ZodPipe:()=>cA,ZodPrefault:()=>dQ,ZodPreprocess:()=>EQ,ZodPromise:()=>wQ,ZodReadonly:()=>yQ,ZodRealError:()=>bt,ZodRecord:()=>qs,ZodSet:()=>iQ,ZodString:()=>Zs,ZodStringFormat:()=>Ie,ZodSuccess:()=>pQ,ZodSymbol:()=>OB,ZodTemplateLiteral:()=>BQ,ZodTransform:()=>aQ,ZodTuple:()=>eQ,ZodType:()=>ee,ZodULID:()=>Sf,ZodURL:()=>rA,ZodUUID:()=>Gr,ZodUndefined:()=>zB,ZodUnion:()=>sA,ZodUnknown:()=>YB,ZodVoid:()=>HB,ZodXID:()=>xf,ZodXor:()=>WB,_ZodString:()=>Cf,_default:()=>lQ,_function:()=>D$,any:()=>c$,array:()=>iA,base64:()=>zT,base64url:()=>GT,bigint:()=>n$,boolean:()=>PB,catch:()=>mQ,check:()=>_$,cidrv4:()=>PT,cidrv6:()=>OT,clone:()=>fe,codec:()=>k$,coerce:()=>_Q,compile:()=>Wy,config:()=>De,core:()=>dn,creditCard:()=>JT,cuid:()=>_T,cuid2:()=>NT,currencyCode:()=>ZT,custom:()=>N$,date:()=>u$,decode:()=>xB,decodeAsync:()=>DB,deepPartial:()=>Y$,describe:()=>U$,discriminatedUnion:()=>h$,e164:()=>VT,email:()=>BT,emoji:()=>RT,encode:()=>SB,encodeAsync:()=>RB,endsWith:()=>Ms,enum:()=>Of,exactOptional:()=>cQ,file:()=>Q$,flattenError:()=>wc,float32:()=>XT,float64:()=>e$,formatError:()=>bc,fromJSONSchema:()=>V$,function:()=>D$,getDiscriminatedOption:()=>Ey,getErrorMap:()=>N8,globalRegistry:()=>He,gt:()=>Or,gte:()=>Pt,guid:()=>QT,hash:()=>KT,hex:()=>WT,hostname:()=>qT,httpUrl:()=>xT,iban:()=>YT,includes:()=>$s,input:()=>H$,instanceof:()=>$$,int:()=>Ef,int32:()=>t$,int64:()=>i$,intersection:()=>XB,invertCodec:()=>S$,ipv4:()=>FT,ipv6:()=>LT,iso:()=>lA,json:()=>M$,jwt:()=>jT,keyof:()=>l$,ksuid:()=>$T,lazy:()=>vQ,length:()=>ro,literal:()=>B$,locales:()=>Yc,looseObject:()=>g$,looseRecord:()=>I$,lowercase:()=>Us,lt:()=>Pr,lte:()=>Lt,mac:()=>MT,map:()=>E$,maxLength:()=>to,maxSize:()=>Gn,memoizer:()=>Vc,meta:()=>T$,mime:()=>Ps,minLength:()=>ln,minSize:()=>zr,multipleOf:()=>zn,nan:()=>b$,nanoid:()=>DT,nativeEnum:()=>C$,negative:()=>cf,never:()=>Pf,nonnegative:()=>uf,nonoptional:()=>gQ,nonpositive:()=>Af,normalize:()=>Os,null:()=>VB,nullable:()=>tA,nullish:()=>v$,number:()=>LB,object:()=>d$,optional:()=>oo,output:()=>q$,overwrite:()=>yr,parse:()=>vB,parseAsync:()=>wB,partialRecord:()=>m$,pipe:()=>yf,positive:()=>af,prefault:()=>fQ,preprocess:()=>L$,prettifyError:()=>wI,promise:()=>R$,properties:()=>Ls,property:()=>lf,readonly:()=>CQ,record:()=>rQ,refine:()=>kQ,regex:()=>Ns,regexes:()=>rr,registry:()=>Td,safeDecode:()=>NB,safeDecodeAsync:()=>TB,safeEncode:()=>_B,safeEncodeAsync:()=>UB,safeParse:()=>bB,safeParseAsync:()=>kB,set:()=>y$,setErrorMap:()=>_8,size:()=>eo,slugify:()=>Js,startsWith:()=>Fs,strictObject:()=>f$,string:()=>eA,stringFormat:()=>HT,stringbool:()=>F$,success:()=>w$,superRefine:()=>SQ,symbol:()=>s$,templateLiteral:()=>x$,toJSONSchema:()=>pf,toLowerCase:()=>Gs,toUpperCase:()=>Vs,toZod:()=>pc,transform:()=>zf,treeifyError:()=>vI,trim:()=>zs,tuple:()=>tQ,uint32:()=>r$,uint64:()=>o$,ulid:()=>UT,undefined:()=>a$,union:()=>ta,unknown:()=>io,uppercase:()=>Ts,url:()=>ST,util:()=>B,uuid:()=>vT,uuidv4:()=>wT,uuidv6:()=>bT,uuidv7:()=>kT,validate:()=>kc,validateAsync:()=>Sc,void:()=>A$,withParser:()=>$d,xid:()=>TT,xor:()=>p$});var dn={};Br(dn,{$ZodAny:()=>uy,$ZodArray:()=>hy,$ZodAsyncError:()=>vt,$ZodBase64:()=>KE,$ZodBase64URL:()=>XE,$ZodBigInt:()=>Cd,$ZodBigIntFormat:()=>sy,$ZodBoolean:()=>Mc,$ZodCIDRv4:()=>WE,$ZodCIDRv6:()=>ZE,$ZodCUID:()=>ME,$ZodCUID2:()=>LE,$ZodCatch:()=>Ty,$ZodCheck:()=>Ce,$ZodCheckBigIntFormat:()=>lE,$ZodCheckEndsWith:()=>QE,$ZodCheckGreaterThan:()=>od,$ZodCheckIncludes:()=>CE,$ZodCheckLengthEquals:()=>mE,$ZodCheckLessThan:()=>id,$ZodCheckLowerCase:()=>EE,$ZodCheckMaxLength:()=>pE,$ZodCheckMaxSize:()=>dE,$ZodCheckMimeType:()=>bE,$ZodCheckMinLength:()=>hE,$ZodCheckMinSize:()=>fE,$ZodCheckMultipleOf:()=>AE,$ZodCheckNumberFormat:()=>uE,$ZodCheckOverwrite:()=>kE,$ZodCheckProperties:()=>wE,$ZodCheckProperty:()=>vE,$ZodCheckRegex:()=>IE,$ZodCheckSizeEquals:()=>gE,$ZodCheckStartsWith:()=>BE,$ZodCheckStringFormat:()=>Ss,$ZodCheckUpperCase:()=>yE,$ZodCodec:()=>Pc,$ZodCreditCard:()=>ty,$ZodCustom:()=>zy,$ZodCustomStringFormat:()=>iy,$ZodCyclicError:()=>Sd,$ZodDate:()=>gy,$ZodDefault:()=>Dy,$ZodDiscriminatedUnion:()=>yy,$ZodE164:()=>ey,$ZodEmail:()=>_E,$ZodEmoji:()=>$E,$ZodEncodeError:()=>Pn,$ZodEnum:()=>wy,$ZodError:()=>QI,$ZodExactOptional:()=>xy,$ZodFile:()=>ky,$ZodFunction:()=>Py,$ZodGUID:()=>RE,$ZodIBAN:()=>ry,$ZodIPv4:()=>jE,$ZodIPv6:()=>HE,$ZodISODate:()=>VE,$ZodISODateTime:()=>GE,$ZodISODuration:()=>YE,$ZodISOTime:()=>JE,$ZodIntersection:()=>Cy,$ZodJWT:()=>ny,$ZodKSUID:()=>zE,$ZodLazy:()=>Oc,$ZodLiteral:()=>by,$ZodMAC:()=>qE,$ZodMap:()=>Qy,$ZodNaN:()=>$y,$ZodNanoID:()=>FE,$ZodNever:()=>dy,$ZodNonOptional:()=>Ny,$ZodNull:()=>Ay,$ZodNullable:()=>Ry,$ZodNumber:()=>yd,$ZodNumberFormat:()=>oy,$ZodObject:()=>_N,$ZodObjectJIT:()=>my,$ZodOptional:()=>Qd,$ZodPipe:()=>vd,$ZodPrefault:()=>_y,$ZodPreprocess:()=>Fy,$ZodPromise:()=>Oy,$ZodReadonly:()=>My,$ZodRealError:()=>wt,$ZodRecord:()=>By,$ZodRegistry:()=>Ud,$ZodSet:()=>vy,$ZodString:()=>Wi,$ZodStringFormat:()=>ge,$ZodSuccess:()=>Uy,$ZodSymbol:()=>ay,$ZodTemplateLiteral:()=>Ly,$ZodTransform:()=>Sy,$ZodTuple:()=>Bd,$ZodType:()=>Z,$ZodULID:()=>PE,$ZodURL:()=>TE,$ZodUUID:()=>DE,$ZodUndefined:()=>cy,$ZodUnion:()=>Lc,$ZodUnknown:()=>ly,$ZodVoid:()=>fy,$ZodXID:()=>OE,$ZodXor:()=>Iy,$brand:()=>yI,$constructor:()=>I,$input:()=>Yy,$output:()=>Jy,Doc:()=>qi,INVALID:()=>ut,JSONSchema:()=>ET,JSONSchemaGenerator:()=>hf,NEVER:()=>EI,TimePrecision:()=>iC,URL_BAD_FORMAT:()=>NE,URL_UNPARSEABLE:()=>Nc,ZodCompileAsyncError:()=>Er,ZodCompileUnsupportedError:()=>oe,_any:()=>CC,_array:()=>SC,_base64:()=>rf,_base64url:()=>nf,_bigint:()=>gC,_boolean:()=>dC,_catch:()=>h8,_check:()=>nT,_cidrv4:()=>ef,_cidrv6:()=>tf,_coercedBigint:()=>pC,_coercedBoolean:()=>fC,_coercedDate:()=>bC,_coercedNumber:()=>sC,_coercedString:()=>eC,_creditCard:()=>rC,_cuid:()=>jd,_cuid2:()=>Hd,_custom:()=>RC,_date:()=>wC,_decode:()=>jl,_decodeAsync:()=>ql,_default:()=>f8,_discriminatedUnion:()=>t8,_e164:()=>of,_email:()=>Ld,_emoji:()=>Jd,_encode:()=>Yl,_encodeAsync:()=>Hl,_endsWith:()=>Ms,_enum:()=>a8,_file:()=>xC,_float32:()=>cC,_float64:()=>AC,_gt:()=>Or,_gte:()=>Pt,_guid:()=>Pd,_iban:()=>nC,_includes:()=>$s,_int:()=>aC,_int32:()=>uC,_int64:()=>hC,_intersection:()=>r8,_ipv4:()=>Kd,_ipv6:()=>Xd,_isoDate:()=>qc,_isoDateTime:()=>Hc,_isoDuration:()=>Zc,_isoTime:()=>Wc,_jwt:()=>sf,_ksuid:()=>Zd,_lazy:()=>y8,_length:()=>ro,_literal:()=>A8,_lowercase:()=>Us,_lt:()=>Pr,_lte:()=>Lt,_mac:()=>tC,_map:()=>o8,_max:()=>Lt,_maxLength:()=>to,_maxSize:()=>Gn,_mime:()=>Ps,_min:()=>Pt,_minLength:()=>ln,_minSize:()=>zr,_multipleOf:()=>zn,_nan:()=>kC,_nanoid:()=>Yd,_nativeEnum:()=>c8,_negative:()=>cf,_never:()=>QC,_nonnegative:()=>uf,_nonoptional:()=>g8,_nonpositive:()=>Af,_normalize:()=>Os,_null:()=>yC,_nullable:()=>d8,_number:()=>oC,_optional:()=>l8,_overwrite:()=>yr,_parse:()=>vs,_parseAsync:()=>ws,_pipe:()=>m8,_positive:()=>af,_promise:()=>C8,_properties:()=>Ls,_property:()=>lf,_readonly:()=>I8,_record:()=>i8,_refine:()=>DC,_regex:()=>Ns,_safeDecode:()=>Zl,_safeDecodeAsync:()=>Xl,_safeEncode:()=>Wl,_safeEncodeAsync:()=>Kl,_safeParse:()=>bs,_safeParseAsync:()=>ks,_set:()=>s8,_size:()=>eo,_slugify:()=>Js,_startsWith:()=>Fs,_string:()=>Xy,_stringFormat:()=>no,_stringbool:()=>TC,_success:()=>p8,_superRefine:()=>_C,_symbol:()=>IC,_templateLiteral:()=>E8,_toLowerCase:()=>Gs,_toUpperCase:()=>Vs,_transform:()=>u8,_trim:()=>zs,_tuple:()=>n8,_uint32:()=>lC,_uint64:()=>mC,_ulid:()=>qd,_undefined:()=>EC,_union:()=>XK,_unknown:()=>BC,_uppercase:()=>Ts,_url:()=>jc,_uuid:()=>Od,_uuidv4:()=>zd,_uuidv6:()=>Gd,_uuidv7:()=>Vd,_void:()=>vC,_xid:()=>Wd,_xor:()=>e8,base64Charset:()=>pd,base64urlCharset:()=>Fc,canParseURL:()=>UE,clone:()=>fe,compile:()=>Wy,compileFn:()=>Fd,config:()=>De,createStandardJSONSchemaMethod:()=>Ys,createToJSONSchemaMethod:()=>FC,decode:()=>e6,decodeAsync:()=>r6,describe:()=>NC,encode:()=>XZ,encodeAsync:()=>t6,extractDefs:()=>Jn,finalize:()=>Yn,flattenError:()=>wc,formatError:()=>bc,getDiscriminatedOption:()=>Ey,globalConfig:()=>Ge,globalRegistry:()=>He,handleUnrepresentable:()=>Fe,initializeContext:()=>Vn,isBackEdge:()=>Rd,isRecursiveSchema:()=>xd,isValidBase64:()=>$c,isValidBase64URL:()=>hd,isValidCIDRv6:()=>gd,isValidCreditCard:()=>md,isValidIBAN:()=>Id,isValidIPv6:()=>Tc,isValidJWT:()=>Ed,locales:()=>Yc,memoizer:()=>Vc,mergeValues:()=>xs,meta:()=>UC,parse:()=>Vl,parseAsync:()=>Jl,parseURLObject:()=>xN,prettifyError:()=>wI,process:()=>pe,processSchema:()=>pe,regexes:()=>rr,registry:()=>Td,safeDecode:()=>i6,safeDecodeAsync:()=>s6,safeEncode:()=>n6,safeEncodeAsync:()=>o6,safeParse:()=>HZ,safeParseAsync:()=>qZ,standardProps:()=>ud,stripTabAndNewline:()=>Uc,toDotPath:()=>cN,toJSONSchema:()=>pf,toZod:()=>pc,treeifyError:()=>vI,urlHostnameOk:()=>dd,urlProtocolOk:()=>fd,util:()=>B,validate:()=>kc,validateAsync:()=>Sc,validateURL:()=>ld,version:()=>SE,withParser:()=>$d});var B={};Br(B,{BIGINT_FORMAT_RANGES:()=>yc,CONSTANT_CATCH:()=>zl,Class:()=>AI,NUMBER_FORMAT_RANGES:()=>Ec,aborted:()=>At,allowsEval:()=>dI,assert:()=>gZ,assertEqual:()=>uZ,assertIs:()=>dZ,assertNever:()=>fZ,assertNotEqual:()=>lZ,assignProp:()=>je,attachSchema:()=>Cc,base64ToUint8Array:()=>rN,base64urlToUint8Array:()=>NZ,cached:()=>ys,captureStackTrace:()=>Pl,cleanEnum:()=>_Z,cleanRegex:()=>An,clone:()=>fe,cloneDef:()=>mZ,codePointLength:()=>ji,constantCatch:()=>mI,createTransparentProxy:()=>QZ,defineLazy:()=>uI,defineLazyInternal:()=>re,derived:()=>FZ,esc:()=>ct,escapeRegex:()=>tr,explicitlyAborted:()=>pI,extend:()=>bZ,finalizeIssue:()=>Qt,floatSafeRemainder:()=>hc,getElementAtPath:()=>IZ,getEnumValues:()=>Is,getLengthableOrigin:()=>Qc,getParsedType:()=>BZ,getSizableOrigin:()=>Bc,hexToUint8Array:()=>TZ,hide:()=>vc,installLazyProp:()=>OZ,isObject:()=>Yi,isPlainObject:()=>er,issue:()=>Qs,joinValues:()=>y,jsonStringifyReplacer:()=>Es,members:()=>hI,merge:()=>SZ,mergeDefs:()=>Ir,normalizeParams:()=>x,nullish:()=>Ll,numKeys:()=>CZ,objectClone:()=>pZ,omit:()=>wZ,optionalKeys:()=>gI,own:()=>Ln,parsedType:()=>w,partial:()=>xZ,pick:()=>vZ,prefixIssues:()=>Bt,primitiveTypes:()=>fI,promiseAllObject:()=>EZ,propertyKeyTypes:()=>Ic,randomString:()=>yZ,rawShape:()=>Cs,required:()=>RZ,safeExtend:()=>kZ,shallowClone:()=>mc,sizeCaps:()=>Bs,slugify:()=>lI,stringifyPrimitive:()=>Q,toZod:()=>pc,uint8ArrayToBase64:()=>nN,uint8ArrayToBase64url:()=>UZ,uint8ArrayToHex:()=>$Z,unwrapMessage:()=>ms});function uZ(e){return e}function lZ(e){return e}function pc(){return e=>e}function dZ(e){}function fZ(e){throw new Error("Unexpected value in exhaustive check")}function gZ(e){}function Is(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function y(e,t="|"){return e.map(n=>Q(n)).join(t)}function Es(e,t){return typeof t=="bigint"?t.toString():t}var cI=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function ys(e){return new cI(e)}function Ll(e){return e==null}function An(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function hc(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var K_=Symbol("evaluating");function uI(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==K_)return i===void 0&&(i=K_,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function pZ(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function je(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Cs(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function cn(e){return Cs(e._zod.def)??e._zod.def.shape}function X_(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return je(this,t,i),i},enumerable:!0,configurable:!0})}function eN(e,t,n){t in e?je(e,t,n):e[t]=n}function Ji(e,t,n,i){let r=cn(t);for(let o of n){let s=Object.getOwnPropertyDescriptor(r,o);s.enumerable&&(s.get?X_(e,o,()=>{let a=t._zod.def.shape[o];return i?i(a,o):a}):eN(e,o,i?i(s.value,o):s.value))}}function hZ(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?X_(e,n,()=>t[n]):eN(e,n,i.value))}}function Ir(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function mZ(e){return Ir(e._zod.def)}function IZ(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function EZ(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<t.length;o++)r[t[o]]=i[o];return r})}function yZ(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function ct(e){return JSON.stringify(e)}function lI(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Pl="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var dI=ys(()=>{if(Ge.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function er(e){if(Yi(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Yi(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function mc(e){return er(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function CZ(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var BZ=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Ic=new Set(["string","number","symbol"]),fI=new Set(["string","number","bigint","boolean","symbol","undefined"]);function tr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fe(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function x(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function QZ(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function Q(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function gI(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Ec={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},yc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function vZ(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return Ji(o,e,Ol(e,t)),fe(e,Ir(n,{shape:o,checks:[]}))}function Ol(e,t){let n=cn(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}function wZ(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(Ol(e,t)),s={};return Ji(s,e,Reflect.ownKeys(cn(e)).filter(a=>!o.has(a))),fe(e,Ir(n,{shape:s,checks:[]}))}function bZ(e,t){if(!er(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=cn(e);for(let o of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return fe(e,Ir(e._zod.def,{shape:tN(e,t)}))}function tN(e,t){let n={};return Ji(n,e,Reflect.ownKeys(cn(e))),hZ(n,t),n}function kZ(e,t){if(!er(t))throw new Error("Invalid input to safeExtend: expected a plain object");return fe(e,Ir(e._zod.def,{shape:tN(e,t)}))}function SZ(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};Ji(n,e,Reflect.ownKeys(cn(e))),Ji(n,t,Reflect.ownKeys(cn(t)));let i=Ir(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return fe(e,i)}function xZ(e,t,n,i="partial"){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let a=n?new Set(Ol(t,n)):void 0,c={};return Ji(c,t,Reflect.ownKeys(cn(t)),e&&((A,l)=>a&&!a.has(l)?A:new e({type:"optional",innerType:A}))),fe(t,Ir(t._zod.def,{shape:c,checks:[]}))}function RZ(e,t,n){let i=n?new Set(Ol(t,n)):void 0,r={};return Ji(r,t,Reflect.ownKeys(cn(t)),(o,s)=>i&&!i.has(s)?o:new e({type:"nonoptional",innerType:o})),fe(t,Ir(t._zod.def,{shape:r}))}function At(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function pI(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Bt(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function ms(e){return typeof e=="string"?e:e?.message}function Bs(e){let t=[];for(let n of e??[]){let i=n._zod.def;if(!/_(length|size)$|_equals$/.test(i.check))break;let r=i.maximum??i.length??i.size;r>=0&&t.push([r,n])}return t}function Cc(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}function Qt(e,t,n){var i;let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?(i=e).schema??(i.schema=e.inst):e.schema=e.inst);let o=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ms(e.inst?._zod.def?.error?.(e))??ms(o?.(e))??ms(t?.error?.(e))??ms(n.customError?.(e))??ms(n.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function Bc(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var DZ=/[\uD800-\uDBFF]/;function ji(e){let t=e.length;if(!DZ.test(e))return t;let n=t;for(let i=0;i<t-1;i++)(e.charCodeAt(i)&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320&&(n--,i++);return n}function Qc(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function w(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Qs(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function _Z(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function rN(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function nN(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function NZ(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return rN(t+n)}function UZ(e){return nN(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function TZ(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}function $Z(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var AI=class{constructor(...t){}};function hI(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):MZ(e,n,i.value)}}function Ln(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function vc(e,t,n){return Ln(e,t,n,!1)}function FZ(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Ln(this,n,i(this))},set(r){Ln(this,n,r)}})}return t}function MZ(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Ln(this,t,n.bind(this))},set(i){Ln(this,t,i)}})}function LZ(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var aI,Mn=!1,PZ={configurable:!0,get(){Mn=!0}};function re(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&aI!==e._zod){aI=void 0;return}aI=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,PZ);let r=Mn;Mn=!1;try{let o=n(this);return Mn?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),Mn=Mn||r,o}catch(o){throw delete this[t],Mn=Mn||r,o}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}function OZ(e,t,n,i){let r=LZ(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,o),o.value=n(this),Object.defineProperty(this,t,o),o.value},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:o})}})}var zl="~constantCatch";function mI(e){let t=()=>e;return t[zl]=!0,t}var iN,EI=Object.freeze({status:"aborted"}),II={value:void 0,enumerable:!1},oN="captureStackTrace"in Error?Error:null;function zZ(e){let t=oN;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return oN=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function I(e,t,n,i){let r={};function o(f){this.def=f,this.constr=d,this.traits=new Set}o.prototype=r;let s=n,a=s&&new WeakSet;function c(f,g){if(f._zod){if(f._zod.traits.has(e))return}else{II.value=new o(g);try{Object.defineProperty(f,"_zod",II)}finally{II.value=void 0}}if(f._zod.traits.add(e),t(f,g),a){let h=Object.getPrototypeOf(f),E=f._zod.constr.prototype,m=h;for(;m&&m!==E;)m=Object.getPrototypeOf(m);let C=m??h;a.has(C)||(a.add(C),hI(C,s))}let p=d.prototype;for(let h in p)Object.prototype.hasOwnProperty.call(p,h)&&(h in f||(f[h]=p[h].bind(f)))}let A=i?.Parent??Object;class l extends A{}Object.defineProperty(l,"name",{value:e});function d(f){let g=i?.Parent?zZ(l):this;c(g,f);let p=g._zod.deferred;if(p){for(let E of p)E();g._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;return h&&h(g),g}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>i?.Parent&&f instanceof i.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var yI=Symbol("zod_brand"),vt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Pn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(iN=globalThis).__zod_globalConfig??(iN.__zod_globalConfig={});var Ge=globalThis.__zod_globalConfig;function De(e){return e&&Object.assign(Ge,e),Ge}function GZ(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Es,2)),e.message}function VZ(e){this._zod.message=e}var JZ={get:GZ,set:VZ,enumerable:!0,configurable:!0},BI={value:void 0,enumerable:!1},sN=new WeakSet([Object.prototype,Error.prototype]),aN=(e,t)=>{e.name="$ZodError",BI.value=t,Object.defineProperty(e,"issues",BI),BI.value=void 0,Object.defineProperty(e,"message",JZ);let n=Object.getPrototypeOf(e);sN.has(n)||(sN.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},QI=I("$ZodError",aN),wt=I("$ZodError",aN,void 0,{Parent:Error});function YZ(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function wc(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?YZ(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}function bc(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)n._errors.push(t(s));else{let c=n,A=0;for(;A<a.length;){let l=a[A],d=A===a.length-1;if(l==="_errors"){d&&c._errors.push(t(s)),A++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=c[l];d&&f._errors.push(t(s)),c=f,A++}}}};return i(e),n}function vI(e,t=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var s;for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>i({issues:c},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let c=[...o,...a.path];if(c.length===0){n.errors.push(t(a));continue}let A=n,l=0;for(;l<c.length;){let d=c[l],f=l===c.length-1;typeof d=="string"?(A.properties??(A.properties={}),Object.prototype.hasOwnProperty.call(A.properties,d)||Object.defineProperty(A.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),A=A.properties[d]):(A.items??(A.items=[]),(s=A.items)[d]??(s[d]={errors:[]}),A=A.items[d]),f&&A.errors.push(t(a)),l++}}};return i(e),n}function cN(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function wI(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${cN(i.path)}`);return t.join(`
|
|
128
128
|
`)}function Gl(e,t){return{callee:t?.callee??e,Err:t?.Err}}var vs=e=>{let t=(n,i,r,o)=>{let s=r?{...r,async:!1}:{async:!1},a=n._zod.run({value:i,issues:[]},s);if(a instanceof Promise)throw new vt;if(a.issues.length){let c=new(o?.Err??e)(a.issues.map(A=>Qt(A,s,De())));throw Pl(c,o?.callee??t),c}return a.value};return t},Vl=vs(wt),ws=e=>{let t=async(n,i,r,o)=>{let s=r?{...r,async:!0}:{async:!0},a=n._zod.run({value:i,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(o?.Err??e)(a.issues.map(A=>Qt(A,s,De())));throw Pl(c,o?.callee??t),c}return a.value};return t},Jl=ws(wt),bs=e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new vt;return o.issues.length?AN(e,o.issues,r):{success:!0,data:o.value}},HZ=bs(wt);function AN(e,t,n){let i;return{success:!1,get error(){return i||(i=new e(t.map(r=>Qt(r,n,De()))),t=void 0,n=void 0),i},set error(r){i=r,t=void 0,n=void 0}}}var ks=e=>async(t,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?AN(e,o.issues,r):{success:!0,data:o.value}},qZ=ks(wt),WZ=Symbol.for("zod.compile.invalid"),ZZ=Symbol.for("zod.compile.fallback"),kc=((e,t,n)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==WZ)return!0;if(i.definite===!0&&n===void 0)return!1}return KZ(e,t,n)});function KZ(e,t,n){let i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},r=e._zod.bag.fallbackRun,o;if(r?(i[ZZ]=!0,o=r({value:t,issues:[]},i)):o=e._zod.run({value:t,issues:[]},i),o instanceof Promise)throw new vt;return o.issues.length===0}var Sc=async(e,t,n)=>{let i=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},r=e._zod.run({value:t,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length===0},Yl=e=>{let t=vs(e),n=(i,r,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return t(i,r,a,Gl(n,s))};return n},XZ=Yl(wt),jl=e=>{let t=vs(e),n=(i,r,o,s)=>t(i,r,o,Gl(n,s));return n},e6=jl(wt),Hl=e=>{let t=ws(e),n=async(i,r,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return await t(i,r,a,Gl(n,s))};return n},t6=Hl(wt),ql=e=>{let t=ws(e),n=async(i,r,o,s)=>await t(i,r,o,Gl(n,s));return n},r6=ql(wt),Wl=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return bs(e)(t,n,r)},n6=Wl(wt),Zl=e=>(t,n,i)=>bs(e)(t,n,i),i6=Zl(wt),Kl=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return ks(e)(t,n,r)},o6=Kl(wt),Xl=e=>async(t,n,i)=>ks(e)(t,n,i),s6=Xl(wt);var rr={};Br(rr,{anyString:()=>KI,base64:()=>GI,base64url:()=>VI,bigint:()=>eE,boolean:()=>tE,browserEmail:()=>g6,cidrv4:()=>OI,cidrv6:()=>zI,creditCard:()=>ed,cuid:()=>kI,cuid2:()=>SI,currencyCode:()=>HI,date:()=>qI,datetime:()=>ZI,domain:()=>YI,duration:()=>UI,e164:()=>jI,email:()=>$I,emoji:()=>FI,extendedDuration:()=>a6,guid:()=>TI,hex:()=>sE,hostname:()=>JI,html5Email:()=>l6,httpProtocol:()=>xc,iban:()=>td,idnEmail:()=>f6,integer:()=>Rc,ipv4:()=>MI,ipv6:()=>LI,ksuid:()=>DI,lowercase:()=>iE,mac:()=>PI,md5_base64:()=>I6,md5_base64url:()=>E6,md5_hex:()=>m6,nanoid:()=>_I,nanoidOfLength:()=>NI,null:()=>rE,number:()=>un,rfc5322Email:()=>d6,sha1_base64:()=>C6,sha1_base64url:()=>B6,sha1_hex:()=>y6,sha256_base64:()=>v6,sha256_base64url:()=>w6,sha256_hex:()=>Q6,sha384_base64:()=>k6,sha384_base64url:()=>S6,sha384_hex:()=>b6,sha512_base64:()=>R6,sha512_base64url:()=>D6,sha512_hex:()=>x6,string:()=>XI,time:()=>WI,ulid:()=>xI,undefined:()=>nE,unicodeEmail:()=>uN,uppercase:()=>oE,uuid:()=>Hi,uuid4:()=>c6,uuid6:()=>A6,uuid7:()=>u6,xid:()=>RI});var kI=/^[cC][0-9a-z]{6,}$/,SI=/^[0-9a-z]+$/,xI=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,RI=/^[0-9a-vA-V]{20}$/,DI=/^[A-Za-z0-9]{27}$/,_I=/^[a-zA-Z0-9_-]{21}$/;function NI(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var UI=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,a6=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,TI=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Hi=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,c6=Hi(4),A6=Hi(6),u6=Hi(7),$I=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,l6=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,d6=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,uN=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,f6=uN,g6=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,p6="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function FI(){return new RegExp(p6,"u")}var MI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,LI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,PI=e=>{let t=tr(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},OI=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,zI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,GI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,VI=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,JI=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,YI=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,xc=/^https?$/,jI=/^\+[1-9]\d{6,14}$/,ed=/^\d(?:[ -]?\d){11,18}$/,HI=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,td=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,lN="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function h6(e){return new RegExp(`^${e}$`)}var qI=h6(lN);function bI(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function WI(e){return new RegExp(`^${bI(e)}$`)}function ZI(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${bI({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${n}|${bI({precision:e.precision})}`:n;return new RegExp(`^${lN}T(?:${i})$`)}var KI=/^[\s\S]{0,}$/,XI=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},eE=/^-?\d+n?$/,Rc=/^-?\d+$/,un=/^-?\d+(?:\.\d+)?$/,tE=/^(?:true|false)$/i,rE=/^null$/i;var nE=/^undefined$/i;var iE=/^[^A-Z]*$/,oE=/^[^a-z]*$/,sE=/^[0-9a-fA-F]*$/;function Dc(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function _c(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var m6=/^[0-9a-fA-F]{32}$/,I6=Dc(22,"=="),E6=_c(22),y6=/^[0-9a-fA-F]{40}$/,C6=Dc(27,"="),B6=_c(27),Q6=/^[0-9a-fA-F]{64}$/,v6=Dc(43,"="),w6=_c(43),b6=/^[0-9a-fA-F]{96}$/,k6=Dc(64,""),S6=_c(64),x6=/^[0-9a-fA-F]{128}$/,R6=Dc(86,"=="),D6=_c(86);var Ce=I("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),aE=e=>{let t=e.value;return!Ll(t)&&t.size!==void 0},cE=e=>{let t=e.value;return!Ll(t)&&t.length!==void 0},rd={number:"number",bigint:"bigint",object:"date"},id=I("$ZodCheckLessThan",(e,t)=>{Ce.init(e,t);let n=rd[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:rd[typeof i.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),od=I("$ZodCheckGreaterThan",(e,t)=>{Ce.init(e,t);let n=rd[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:rd[typeof i.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),AE=I("$ZodCheckMultipleOf",(e,t)=>{Ce.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):hc(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),uE=I("$ZodCheckNumberFormat",(e,t)=>{Ce.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,o]=Ec[t.format];e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}a<r&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),lE=I("$ZodCheckBigIntFormat",(e,t)=>{Ce.init(e,t);let[n,i]=yc[t.format];e._zod.check=r=>{let o=r.value;o<n&&r.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),o>i&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),dE=I("$ZodCheckMaxSize",(e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=aE),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:Bc(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fE=I("$ZodCheckMinSize",(e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=aE),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:Bc(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),gE=I("$ZodCheckSizeEquals",(e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=aE),e._zod.check=i=>{let r=i.value,o=r.size;if(o===t.size)return;let s=o>t.size;i.issues.push({origin:Bc(r),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),pE=I("$ZodCheckMaxLength",(e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=cE),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>t.maximum?ji(r):o)<=t.maximum)return;let a=Qc(r);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),hE=I("$ZodCheckMinLength",(e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=cE),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>=t.minimum&&o<t.minimum*2?ji(r):o)>=t.minimum)return;let a=Qc(r);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),mE=I("$ZodCheckLengthEquals",(e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=cE),e._zod.check=i=>{let r=i.value,o=r.length,s=typeof r=="string"&&o>=t.length&&o<=t.length*2?ji(r):o;if(s===t.length)return;let a=Qc(r),c=s>t.length;i.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Ss=I("$ZodCheckStringFormat",(e,t)=>{var n,i;Ce.init(e,t),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),IE=I("$ZodCheckRegex",(e,t)=>{Ss.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),EE=I("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=iE),Ss.init(e,t)}),yE=I("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=oE),Ss.init(e,t)}),CE=I("$ZodCheckIncludes",(e,t)=>{Ce.init(e,t);let n=tr(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=i,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),BE=I("$ZodCheckStartsWith",(e,t)=>{Ce.init(e,t);let n=new RegExp(`^${tr(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),QE=I("$ZodCheckEndsWith",(e,t)=>{Ce.init(e,t);let n=new RegExp(`.*${tr(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function nd(e,t,n){e.issues.length&&t.issues.push(...Bt(n,e.issues))}var vE=I("$ZodCheckProperty",(e,t)=>{Ce.init(e,t),e._zod.check=n=>{let i=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>nd(r,n,t.property));nd(i,n,t.property)}}),wE=I("$ZodCheckProperties",(e,t)=>{Ce.init(e,t),vc(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=i=>{if(i.value==null){i.issues.push({expected:"object",code:"invalid_type",input:i.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(s=>[s,t.shape[s]]));let r=i.value,o;for(let[s,a]of n){let c=a._zod.run({value:r[s],issues:[]},{});c instanceof Promise?(o??(o=[]),o.push(c.then(A=>nd(A,i,s)))):nd(c,i,s)}if(o)return Promise.all(o).then(()=>{})}}),bE=I("$ZodCheckMimeType",(e,t)=>{Ce.init(e,t);let n=new Set(t.mime);e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),kE=I("$ZodCheckOverwrite",(e,t)=>{Ce.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var qi=class{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
|
|
129
129
|
`).filter(s=>s),r=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
130
130
|
${n.join(`
|