@skyramp/testbot-core 0.13.0-v3.421 → 0.13.0-v3.422
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 +375 -375
- package/dist/post.js +1 -1
- package/dist/runner-client.cjs +41 -41
- package/package.json +1 -1
|
@@ -43,7 +43,7 @@ ${i.count} ${i.noun} ${i.is} pending:
|
|
|
43
43
|
|
|
44
44
|
${t.format(n)}
|
|
45
45
|
`.trim())}};Ix.exports=Jp});var za=k((O5,Qx)=>{"use strict";var Cx=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:E2}=ue(),C2=zo();Bx()===void 0&&yx(new C2);function yx(e){if(!e||typeof e.dispatch!="function")throw new E2("Argument agent must implement Agent");Object.defineProperty(globalThis,Cx,{value:e,writable:!0,enumerable:!1,configurable:!1})}function Bx(){return globalThis[Cx]}Qx.exports={setGlobalDispatcher:yx,getGlobalDispatcher:Bx}});var xu=k((G5,vx)=>{"use strict";vx.exports=class{#e;constructor(t){if(typeof t!="object"||t===null)throw new TypeError("handler must be an object");this.#e=t}onConnect(...t){return this.#e.onConnect?.(...t)}onError(...t){return this.#e.onError?.(...t)}onUpgrade(...t){return this.#e.onUpgrade?.(...t)}onResponseStarted(...t){return this.#e.onResponseStarted?.(...t)}onHeaders(...t){return this.#e.onHeaders?.(...t)}onData(...t){return this.#e.onData?.(...t)}onComplete(...t){return this.#e.onComplete?.(...t)}onBodySent(...t){return this.#e.onBodySent?.(...t)}}});var bx=k((V5,wx)=>{"use strict";var y2=Au();wx.exports=e=>{let t=e?.maxRedirections;return n=>function(r,o){let{maxRedirections:s=t,...a}=r;if(!s)return n(r,o);let A=new y2(n,s,r,o);return n(a,A)}}});var Sx=k((J5,kx)=>{"use strict";var B2=Eu();kx.exports=e=>t=>function(i,r){return t(i,new B2({...i,retryOptions:{...e,...i.retryOptions}},{handler:r,dispatch:t}))}});var Dx=k((Y5,xx)=>{"use strict";var Q2=ie(),{InvalidArgumentError:v2,RequestAbortedError:w2}=ue(),b2=xu(),Yp=class extends b2{#e=1024*1024;#t=null;#r=!1;#i=!1;#o=0;#n=null;#s=null;constructor({maxSize:t},n){if(super(n),t!=null&&(!Number.isFinite(t)||t<1))throw new v2("maxSize must be a number greater than 0");this.#e=t??this.#e,this.#s=n}onConnect(t){this.#t=t,this.#s.onConnect(this.#a.bind(this))}#a(t){this.#i=!0,this.#n=t}onHeaders(t,n,i,r){let s=Q2.parseHeaders(n)["content-length"];if(s!=null&&s>this.#e)throw new w2(`Response size (${s}) larger than maxSize (${this.#e})`);return this.#i?!0:this.#s.onHeaders(t,n,i,r)}onError(t){this.#r||(t=this.#n??t,this.#s.onError(t))}onData(t){return this.#o=this.#o+t.length,this.#o>=this.#e&&(this.#r=!0,this.#i?this.#s.onError(this.#n):this.#s.onComplete([])),!0}onComplete(t){if(!this.#r){if(this.#i){this.#s.onError(this.reason);return}this.#s.onComplete(t)}}};function k2({maxSize:e}={maxSize:1024*1024}){return t=>function(i,r){let{dumpMaxSize:o=e}=i,s=new Yp({maxSize:o},r);return t(i,s)}}xx.exports=k2});var Nx=k((H5,_x)=>{"use strict";var{isIP:S2}=require("node:net"),{lookup:x2}=require("node:dns"),D2=xu(),{InvalidArgumentError:Zo,InformationalError:R2}=ue(),Rx=Math.pow(2,31)-1,Hp=class{#e=0;#t=0;#r=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(t){this.#e=t.maxTTL,this.#t=t.maxItems,this.dualStack=t.dualStack,this.affinity=t.affinity,this.lookup=t.lookup??this.#i,this.pick=t.pick??this.#o}get full(){return this.#r.size===this.#t}runLookup(t,n,i){let r=this.#r.get(t.hostname);if(r==null&&this.full){i(null,t.origin);return}let o={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...n.dns,maxTTL:this.#e,maxItems:this.#t};if(r==null)this.lookup(t,o,(s,a)=>{if(s||a==null||a.length===0){i(s??new R2("No DNS entries found"));return}this.setRecords(t,a);let A=this.#r.get(t.hostname),c=this.pick(t,A,o.affinity),l;typeof c.port=="number"?l=`:${c.port}`:t.port!==""?l=`:${t.port}`:l="",i(null,`${t.protocol}//${c.family===6?`[${c.address}]`:c.address}${l}`)});else{let s=this.pick(t,r,o.affinity);if(s==null){this.#r.delete(t.hostname),this.runLookup(t,n,i);return}let a;typeof s.port=="number"?a=`:${s.port}`:t.port!==""?a=`:${t.port}`:a="",i(null,`${t.protocol}//${s.family===6?`[${s.address}]`:s.address}${a}`)}}#i(t,n,i){x2(t.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(r,o)=>{if(r)return i(r);let s=new Map;for(let a of o)s.set(`${a.address}:${a.family}`,a);i(null,s.values())})}#o(t,n,i){let r=null,{records:o,offset:s}=n,a;if(this.dualStack?(i==null&&(s==null||s===Rx?(n.offset=0,i=4):(n.offset++,i=(n.offset&1)===1?6:4)),o[i]!=null&&o[i].ips.length>0?a=o[i]:a=o[i===4?6:4]):a=o[i],a==null||a.ips.length===0)return r;a.offset==null||a.offset===Rx?a.offset=0:a.offset++;let A=a.offset%a.ips.length;return r=a.ips[A]??null,r==null?r:Date.now()-r.timestamp>r.ttl?(a.ips.splice(A,1),this.pick(t,n,i)):r}setRecords(t,n){let i=Date.now(),r={records:{4:null,6:null}};for(let o of n){o.timestamp=i,typeof o.ttl=="number"?o.ttl=Math.min(o.ttl,this.#e):o.ttl=this.#e;let s=r.records[o.family]??{ips:[]};s.ips.push(o),r.records[o.family]=s}this.#r.set(t.hostname,r)}getHandler(t,n){return new jp(this,t,n)}},jp=class extends D2{#e=null;#t=null;#r=null;#i=null;#o=null;constructor(t,{origin:n,handler:i,dispatch:r},o){super(i),this.#o=n,this.#i=i,this.#t={...o},this.#e=t,this.#r=r}onError(t){switch(t.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){this.#e.runLookup(this.#o,this.#t,(n,i)=>{if(n)return this.#i.onError(n);let r={...this.#t,origin:i};this.#r(r,this)});return}this.#i.onError(t);return}case"ENOTFOUND":this.#e.deleteRecord(this.#o);default:this.#i.onError(t);break}}};_x.exports=e=>{if(e?.maxTTL!=null&&(typeof e?.maxTTL!="number"||e?.maxTTL<0))throw new Zo("Invalid maxTTL. Must be a positive number");if(e?.maxItems!=null&&(typeof e?.maxItems!="number"||e?.maxItems<1))throw new Zo("Invalid maxItems. Must be a positive number and greater than zero");if(e?.affinity!=null&&e?.affinity!==4&&e?.affinity!==6)throw new Zo("Invalid affinity. Must be either 4 or 6");if(e?.dualStack!=null&&typeof e?.dualStack!="boolean")throw new Zo("Invalid dualStack. Must be a boolean");if(e?.lookup!=null&&typeof e?.lookup!="function")throw new Zo("Invalid lookup. Must be a function");if(e?.pick!=null&&typeof e?.pick!="function")throw new Zo("Invalid pick. Must be a function");let t=e?.dualStack??!0,n;t?n=e?.affinity??null:n=e?.affinity??4;let i={maxTTL:e?.maxTTL??1e4,lookup:e?.lookup??null,pick:e?.pick??null,dualStack:t,affinity:n,maxItems:e?.maxItems??1/0},r=new Hp(i);return o=>function(a,A){let c=a.origin.constructor===URL?a.origin:new URL(a.origin);return S2(c.hostname)!==0?o(a,A):(r.runLookup(c,a,(l,d)=>{if(l)return A.onError(l);let g=null;g={...a,servername:c.hostname,origin:d,headers:{host:c.hostname,...a.headers}},o(g,r.getHandler({origin:c,dispatch:o,handler:A},a))}),!0)}}});var $i=k((j5,Px)=>{"use strict";var{kConstruct:_2}=ve(),{kEnumerableProperty:Ko}=ie(),{iteratorMixin:N2,isValidHeaderName:Ga,isValidHeaderValue:$x}=bt(),{webidl:ce}=Je(),qp=require("node:assert"),Du=require("node:util"),$e=Symbol("headers map"),Dt=Symbol("headers map sorted");function Ux(e){return e===10||e===13||e===9||e===32}function Tx(e){let t=0,n=e.length;for(;n>t&&Ux(e.charCodeAt(n-1));)--n;for(;n>t&&Ux(e.charCodeAt(t));)++t;return t===0&&n===e.length?e:e.substring(t,n)}function Fx(e,t){if(Array.isArray(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.length!==2)throw ce.errors.exception({header:"Headers constructor",message:`expected name/value pair to be length 2, found ${i.length}.`});Wp(e,i[0],i[1])}else if(typeof t=="object"&&t!==null){let n=Object.keys(t);for(let i=0;i<n.length;++i)Wp(e,n[i],t[n[i]])}else throw ce.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})}function Wp(e,t,n){if(n=Tx(n),Ga(t)){if(!$x(n))throw ce.errors.invalidArgument({prefix:"Headers.append",value:n,type:"header value"})}else throw ce.errors.invalidArgument({prefix:"Headers.append",value:t,type:"header name"});if(Lx(e)==="immutable")throw new TypeError("immutable");return Zp(e).append(t,n,!1)}function Mx(e,t){return e[0]<t[0]?-1:1}var Ru=class e{cookies=null;constructor(t){t instanceof e?(this[$e]=new Map(t[$e]),this[Dt]=t[Dt],this.cookies=t.cookies===null?null:[...t.cookies]):(this[$e]=new Map(t),this[Dt]=null)}contains(t,n){return this[$e].has(n?t:t.toLowerCase())}clear(){this[$e].clear(),this[Dt]=null,this.cookies=null}append(t,n,i){this[Dt]=null;let r=i?t:t.toLowerCase(),o=this[$e].get(r);if(o){let s=r==="cookie"?"; ":", ";this[$e].set(r,{name:o.name,value:`${o.value}${s}${n}`})}else this[$e].set(r,{name:t,value:n});r==="set-cookie"&&(this.cookies??=[]).push(n)}set(t,n,i){this[Dt]=null;let r=i?t:t.toLowerCase();r==="set-cookie"&&(this.cookies=[n]),this[$e].set(r,{name:t,value:n})}delete(t,n){this[Dt]=null,n||(t=t.toLowerCase()),t==="set-cookie"&&(this.cookies=null),this[$e].delete(t)}get(t,n){return this[$e].get(n?t:t.toLowerCase())?.value??null}*[Symbol.iterator](){for(let{0:t,1:{value:n}}of this[$e])yield[t,n]}get entries(){let t={};if(this[$e].size!==0)for(let{name:n,value:i}of this[$e].values())t[n]=i;return t}rawValues(){return this[$e].values()}get entriesList(){let t=[];if(this[$e].size!==0)for(let{0:n,1:{name:i,value:r}}of this[$e])if(n==="set-cookie")for(let o of this.cookies)t.push([i,o]);else t.push([i,r]);return t}toSortedArray(){let t=this[$e].size,n=new Array(t);if(t<=32){if(t===0)return n;let i=this[$e][Symbol.iterator](),r=i.next().value;n[0]=[r[0],r[1].value],qp(r[1].value!==null);for(let o=1,s=0,a=0,A=0,c=0,l,d;o<t;++o){for(d=i.next().value,l=n[o]=[d[0],d[1].value],qp(l[1]!==null),A=0,a=o;A<a;)c=A+(a-A>>1),n[c][0]<=l[0]?A=c+1:a=c;if(o!==c){for(s=o;s>A;)n[s]=n[--s];n[A]=l}}if(!i.next().done)throw new TypeError("Unreachable");return n}else{let i=0;for(let{0:r,1:{value:o}}of this[$e])n[i++]=[r,o],qp(o!==null);return n.sort(Mx)}}},Ar=class e{#e;#t;constructor(t=void 0){ce.util.markAsUncloneable(this),t!==_2&&(this.#t=new Ru,this.#e="none",t!==void 0&&(t=ce.converters.HeadersInit(t,"Headers contructor","init"),Fx(this,t)))}append(t,n){ce.brandCheck(this,e),ce.argumentLengthCheck(arguments,2,"Headers.append");let i="Headers.append";return t=ce.converters.ByteString(t,i,"name"),n=ce.converters.ByteString(n,i,"value"),Wp(this,t,n)}delete(t){if(ce.brandCheck(this,e),ce.argumentLengthCheck(arguments,1,"Headers.delete"),t=ce.converters.ByteString(t,"Headers.delete","name"),!Ga(t))throw ce.errors.invalidArgument({prefix:"Headers.delete",value:t,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(t,!1)&&this.#t.delete(t,!1)}get(t){ce.brandCheck(this,e),ce.argumentLengthCheck(arguments,1,"Headers.get");let n="Headers.get";if(t=ce.converters.ByteString(t,n,"name"),!Ga(t))throw ce.errors.invalidArgument({prefix:n,value:t,type:"header name"});return this.#t.get(t,!1)}has(t){ce.brandCheck(this,e),ce.argumentLengthCheck(arguments,1,"Headers.has");let n="Headers.has";if(t=ce.converters.ByteString(t,n,"name"),!Ga(t))throw ce.errors.invalidArgument({prefix:n,value:t,type:"header name"});return this.#t.contains(t,!1)}set(t,n){ce.brandCheck(this,e),ce.argumentLengthCheck(arguments,2,"Headers.set");let i="Headers.set";if(t=ce.converters.ByteString(t,i,"name"),n=ce.converters.ByteString(n,i,"value"),n=Tx(n),Ga(t)){if(!$x(n))throw ce.errors.invalidArgument({prefix:i,value:n,type:"header value"})}else throw ce.errors.invalidArgument({prefix:i,value:t,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(t,n,!1)}getSetCookie(){ce.brandCheck(this,e);let t=this.#t.cookies;return t?[...t]:[]}get[Dt](){if(this.#t[Dt])return this.#t[Dt];let t=[],n=this.#t.toSortedArray(),i=this.#t.cookies;if(i===null||i.length===1)return this.#t[Dt]=n;for(let r=0;r<n.length;++r){let{0:o,1:s}=n[r];if(o==="set-cookie")for(let a=0;a<i.length;++a)t.push([o,i[a]]);else t.push([o,s])}return this.#t[Dt]=t}[Du.inspect.custom](t,n){return n.depth??=t,`Headers ${Du.formatWithOptions(n,this.#t.entries)}`}static getHeadersGuard(t){return t.#e}static setHeadersGuard(t,n){t.#e=n}static getHeadersList(t){return t.#t}static setHeadersList(t,n){t.#t=n}},{getHeadersGuard:Lx,setHeadersGuard:U2,getHeadersList:Zp,setHeadersList:$2}=Ar;Reflect.deleteProperty(Ar,"getHeadersGuard");Reflect.deleteProperty(Ar,"setHeadersGuard");Reflect.deleteProperty(Ar,"getHeadersList");Reflect.deleteProperty(Ar,"setHeadersList");N2("Headers",Ar,Dt,0,1);Object.defineProperties(Ar.prototype,{append:Ko,delete:Ko,get:Ko,has:Ko,set:Ko,getSetCookie:Ko,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[Du.inspect.custom]:{enumerable:!1}});ce.converters.HeadersInit=function(e,t,n){if(ce.util.Type(e)==="Object"){let i=Reflect.get(e,Symbol.iterator);if(!Du.types.isProxy(e)&&i===Ar.prototype.entries)try{return Zp(e).entriesList}catch{}return typeof i=="function"?ce.converters["sequence<sequence<ByteString>>"](e,t,n,i.bind(e)):ce.converters["record<ByteString, ByteString>"](e,t,n)}throw ce.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})};Px.exports={fill:Fx,compareHeaderName:Mx,Headers:Ar,HeadersList:Ru,getHeadersGuard:Lx,setHeadersGuard:U2,setHeadersList:$2,getHeadersList:Zp}});var Ja=k((q5,Kx)=>{"use strict";var{Headers:Yx,HeadersList:Ox,fill:T2,getHeadersGuard:F2,setHeadersGuard:Hx,setHeadersList:jx}=$i(),{extractBody:zx,cloneBody:M2,mixinBody:L2,hasFinalizationRegistry:qx,streamRegistry:Wx,bodyUnusable:P2}=No(),Kp=ie(),Gx=require("node:util"),{kEnumerableProperty:Rt}=Kp,{isValidReasonPhrase:O2,isCancelled:z2,isAborted:G2,isBlobLike:V2,serializeJavascriptValueToJSONString:J2,isErrorLike:Y2,isomorphicEncode:H2,environmentSettingsObject:j2}=bt(),{redirectStatusSet:q2,nullBodyStatus:W2}=ga(),{kState:be,kHeaders:rn}=In(),{webidl:te}=Je(),{FormData:Z2}=Ea(),{URLSerializer:Vx}=ft(),{kConstruct:Nu}=ve(),Xp=require("node:assert"),{types:K2}=require("node:util"),X2=new TextEncoder("utf-8"),Ti=class e{static error(){return Va(Uu(),"immutable")}static json(t,n={}){te.argumentLengthCheck(arguments,1,"Response.json"),n!==null&&(n=te.converters.ResponseInit(n));let i=X2.encode(J2(t)),r=zx(i),o=Va(Xo({}),"response");return Jx(o,n,{body:r[0],type:"application/json"}),o}static redirect(t,n=302){te.argumentLengthCheck(arguments,1,"Response.redirect"),t=te.converters.USVString(t),n=te.converters["unsigned short"](n);let i;try{i=new URL(t,j2.settingsObject.baseUrl)}catch(s){throw new TypeError(`Failed to parse URL from ${t}`,{cause:s})}if(!q2.has(n))throw new RangeError(`Invalid status code ${n}`);let r=Va(Xo({}),"immutable");r[be].status=n;let o=H2(Vx(i));return r[be].headersList.append("location",o,!0),r}constructor(t=null,n={}){if(te.util.markAsUncloneable(this),t===Nu)return;t!==null&&(t=te.converters.BodyInit(t)),n=te.converters.ResponseInit(n),this[be]=Xo({}),this[rn]=new Yx(Nu),Hx(this[rn],"response"),jx(this[rn],this[be].headersList);let i=null;if(t!=null){let[r,o]=zx(t);i={body:r,type:o}}Jx(this,n,i)}get type(){return te.brandCheck(this,e),this[be].type}get url(){te.brandCheck(this,e);let t=this[be].urlList,n=t[t.length-1]??null;return n===null?"":Vx(n,!0)}get redirected(){return te.brandCheck(this,e),this[be].urlList.length>1}get status(){return te.brandCheck(this,e),this[be].status}get ok(){return te.brandCheck(this,e),this[be].status>=200&&this[be].status<=299}get statusText(){return te.brandCheck(this,e),this[be].statusText}get headers(){return te.brandCheck(this,e),this[rn]}get body(){return te.brandCheck(this,e),this[be].body?this[be].body.stream:null}get bodyUsed(){return te.brandCheck(this,e),!!this[be].body&&Kp.isDisturbed(this[be].body.stream)}clone(){if(te.brandCheck(this,e),P2(this))throw te.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let t=em(this[be]);return qx&&this[be].body?.stream&&Wx.register(this,new WeakRef(this[be].body.stream)),Va(t,F2(this[rn]))}[Gx.inspect.custom](t,n){n.depth===null&&(n.depth=2),n.colors??=!0;let i={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${Gx.formatWithOptions(n,i)}`}};L2(Ti);Object.defineProperties(Ti.prototype,{type:Rt,url:Rt,status:Rt,ok:Rt,redirected:Rt,statusText:Rt,headers:Rt,clone:Rt,body:Rt,bodyUsed:Rt,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(Ti,{json:Rt,redirect:Rt,error:Rt});function em(e){if(e.internalResponse)return Zx(em(e.internalResponse),e.type);let t=Xo({...e,body:null});return e.body!=null&&(t.body=M2(t,e.body)),t}function Xo(e){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...e,headersList:e?.headersList?new Ox(e?.headersList):new Ox,urlList:e?.urlList?[...e.urlList]:[]}}function Uu(e){let t=Y2(e);return Xo({type:"error",status:0,error:t?e:new Error(e&&String(e)),aborted:e&&e.name==="AbortError"})}function eJ(e){return e.type==="error"&&e.status===0}function _u(e,t){return t={internalResponse:e,...t},new Proxy(e,{get(n,i){return i in t?t[i]:n[i]},set(n,i,r){return Xp(!(i in t)),n[i]=r,!0}})}function Zx(e,t){if(t==="basic")return _u(e,{type:"basic",headersList:e.headersList});if(t==="cors")return _u(e,{type:"cors",headersList:e.headersList});if(t==="opaque")return _u(e,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(t==="opaqueredirect")return _u(e,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});Xp(!1)}function tJ(e,t=null){return Xp(z2(e)),G2(e)?Uu(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:t})):Uu(Object.assign(new DOMException("Request was cancelled."),{cause:t}))}function Jx(e,t,n){if(t.status!==null&&(t.status<200||t.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in t&&t.statusText!=null&&!O2(String(t.statusText)))throw new TypeError("Invalid statusText");if("status"in t&&t.status!=null&&(e[be].status=t.status),"statusText"in t&&t.statusText!=null&&(e[be].statusText=t.statusText),"headers"in t&&t.headers!=null&&T2(e[rn],t.headers),n){if(W2.includes(e.status))throw te.errors.exception({header:"Response constructor",message:`Invalid response status code ${e.status}`});e[be].body=n.body,n.type!=null&&!e[be].headersList.contains("content-type",!0)&&e[be].headersList.append("content-type",n.type,!0)}}function Va(e,t){let n=new Ti(Nu);return n[be]=e,n[rn]=new Yx(Nu),jx(n[rn],e.headersList),Hx(n[rn],t),qx&&e.body?.stream&&Wx.register(n,new WeakRef(e.body.stream)),n}te.converters.ReadableStream=te.interfaceConverter(ReadableStream);te.converters.FormData=te.interfaceConverter(Z2);te.converters.URLSearchParams=te.interfaceConverter(URLSearchParams);te.converters.XMLHttpRequestBodyInit=function(e,t,n){return typeof e=="string"?te.converters.USVString(e,t,n):V2(e)?te.converters.Blob(e,t,n,{strict:!1}):ArrayBuffer.isView(e)||K2.isArrayBuffer(e)?te.converters.BufferSource(e,t,n):Kp.isFormDataLike(e)?te.converters.FormData(e,t,n,{strict:!1}):e instanceof URLSearchParams?te.converters.URLSearchParams(e,t,n):te.converters.DOMString(e,t,n)};te.converters.BodyInit=function(e,t,n){return e instanceof ReadableStream?te.converters.ReadableStream(e,t,n):e?.[Symbol.asyncIterator]?e:te.converters.XMLHttpRequestBodyInit(e,t,n)};te.converters.ResponseInit=te.dictionaryConverter([{key:"status",converter:te.converters["unsigned short"],defaultValue:()=>200},{key:"statusText",converter:te.converters.ByteString,defaultValue:()=>""},{key:"headers",converter:te.converters.HeadersInit}]);Kx.exports={isNetworkError:eJ,makeNetworkError:Uu,makeResponse:Xo,makeAppropriateNetworkError:tJ,filterResponse:Zx,Response:Ti,cloneResponse:em,fromInnerResponse:Va}});var rD=k((W5,tD)=>{"use strict";var{kConnected:Xx,kSize:eD}=ve(),tm=class{constructor(t){this.value=t}deref(){return this.value[Xx]===0&&this.value[eD]===0?void 0:this.value}},rm=class{constructor(t){this.finalizer=t}register(t,n){t.on&&t.on("disconnect",()=>{t[Xx]===0&&t[eD]===0&&this.finalizer(n)})}unregister(t){}};tD.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:tm,FinalizationRegistry:rm}):{WeakRef,FinalizationRegistry}}});var es=k((Z5,mD)=>{"use strict";var{extractBody:rJ,mixinBody:nJ,cloneBody:iJ,bodyUnusable:nD}=No(),{Headers:dD,fill:oJ,HeadersList:Mu,setHeadersGuard:im,getHeadersGuard:sJ,setHeadersList:gD,getHeadersList:iD}=$i(),{FinalizationRegistry:aJ}=rD()(),Tu=ie(),oD=require("node:util"),{isValidHTTPToken:AJ,sameOrigin:sD,environmentSettingsObject:$u}=bt(),{forbiddenMethodsSet:cJ,corsSafeListedMethodsSet:uJ,referrerPolicy:lJ,requestRedirect:dJ,requestMode:gJ,requestCredentials:fJ,requestCache:hJ,requestDuplex:pJ}=ga(),{kEnumerableProperty:Te,normalizedMethodRecordsBase:mJ,normalizedMethodRecords:IJ}=Tu,{kHeaders:_t,kSignal:Fu,kState:Qe,kDispatcher:nm}=In(),{webidl:J}=Je(),{URLSerializer:EJ}=ft(),{kConstruct:Lu}=ve(),CJ=require("node:assert"),{getMaxListeners:aD,setMaxListeners:AD,getEventListeners:yJ,defaultMaxListeners:cD}=require("node:events"),BJ=Symbol("abortController"),fD=new aJ(({signal:e,abort:t})=>{e.removeEventListener("abort",t)}),Pu=new WeakMap;function uD(e){return t;function t(){let n=e.deref();if(n!==void 0){fD.unregister(t),this.removeEventListener("abort",t),n.abort(this.reason);let i=Pu.get(n.signal);if(i!==void 0){if(i.size!==0){for(let r of i){let o=r.deref();o!==void 0&&o.abort(this.reason)}i.clear()}Pu.delete(n.signal)}}}}var lD=!1,xn=class e{constructor(t,n={}){if(J.util.markAsUncloneable(this),t===Lu)return;let i="Request constructor";J.argumentLengthCheck(arguments,1,i),t=J.converters.RequestInfo(t,i,"input"),n=J.converters.RequestInit(n,i,"init");let r=null,o=null,s=$u.settingsObject.baseUrl,a=null;if(typeof t=="string"){this[nm]=n.dispatcher;let m;try{m=new URL(t,s)}catch(y){throw new TypeError("Failed to parse URL from "+t,{cause:y})}if(m.username||m.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+t);r=Ou({urlList:[m]}),o="cors"}else this[nm]=n.dispatcher||t[nm],CJ(t instanceof e),r=t[Qe],a=t[Fu];let A=$u.settingsObject.origin,c="client";if(r.window?.constructor?.name==="EnvironmentSettingsObject"&&sD(r.window,A)&&(c=r.window),n.window!=null)throw new TypeError(`'window' option '${c}' must be null`);"window"in n&&(c="no-window"),r=Ou({method:r.method,headersList:r.headersList,unsafeRequest:r.unsafeRequest,client:$u.settingsObject,window:c,priority:r.priority,origin:r.origin,referrer:r.referrer,referrerPolicy:r.referrerPolicy,mode:r.mode,credentials:r.credentials,cache:r.cache,redirect:r.redirect,integrity:r.integrity,keepalive:r.keepalive,reloadNavigation:r.reloadNavigation,historyNavigation:r.historyNavigation,urlList:[...r.urlList]});let l=Object.keys(n).length!==0;if(l&&(r.mode==="navigate"&&(r.mode="same-origin"),r.reloadNavigation=!1,r.historyNavigation=!1,r.origin="client",r.referrer="client",r.referrerPolicy="",r.url=r.urlList[r.urlList.length-1],r.urlList=[r.url]),n.referrer!==void 0){let m=n.referrer;if(m==="")r.referrer="no-referrer";else{let y;try{y=new URL(m,s)}catch(w){throw new TypeError(`Referrer "${m}" is not a valid URL.`,{cause:w})}y.protocol==="about:"&&y.hostname==="client"||A&&!sD(y,$u.settingsObject.baseUrl)?r.referrer="client":r.referrer=y}}n.referrerPolicy!==void 0&&(r.referrerPolicy=n.referrerPolicy);let d;if(n.mode!==void 0?d=n.mode:d=o,d==="navigate")throw J.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(d!=null&&(r.mode=d),n.credentials!==void 0&&(r.credentials=n.credentials),n.cache!==void 0&&(r.cache=n.cache),r.cache==="only-if-cached"&&r.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(n.redirect!==void 0&&(r.redirect=n.redirect),n.integrity!=null&&(r.integrity=String(n.integrity)),n.keepalive!==void 0&&(r.keepalive=!!n.keepalive),n.method!==void 0){let m=n.method,y=IJ[m];if(y!==void 0)r.method=y;else{if(!AJ(m))throw new TypeError(`'${m}' is not a valid HTTP method.`);let w=m.toUpperCase();if(cJ.has(w))throw new TypeError(`'${m}' HTTP method is unsupported.`);m=mJ[w]??m,r.method=m}!lD&&r.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),lD=!0)}n.signal!==void 0&&(a=n.signal),this[Qe]=r;let g=new AbortController;if(this[Fu]=g.signal,a!=null){if(!a||typeof a.aborted!="boolean"||typeof a.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(a.aborted)g.abort(a.reason);else{this[BJ]=g;let m=new WeakRef(g),y=uD(m);try{(typeof aD=="function"&&aD(a)===cD||yJ(a,"abort").length>=cD)&&AD(1500,a)}catch{}Tu.addAbortListener(a,y),fD.register(g,{signal:a,abort:y},y)}}if(this[_t]=new dD(Lu),gD(this[_t],r.headersList),im(this[_t],"request"),d==="no-cors"){if(!uJ.has(r.method))throw new TypeError(`'${r.method} is unsupported in no-cors mode.`);im(this[_t],"request-no-cors")}if(l){let m=iD(this[_t]),y=n.headers!==void 0?n.headers:new Mu(m);if(m.clear(),y instanceof Mu){for(let{name:w,value:b}of y.rawValues())m.append(w,b,!1);m.cookies=y.cookies}else oJ(this[_t],y)}let f=t instanceof e?t[Qe].body:null;if((n.body!=null||f!=null)&&(r.method==="GET"||r.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let h=null;if(n.body!=null){let[m,y]=rJ(n.body,r.keepalive);h=m,y&&!iD(this[_t]).contains("content-type",!0)&&this[_t].append("content-type",y)}let p=h??f;if(p!=null&&p.source==null){if(h!=null&&n.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(r.mode!=="same-origin"&&r.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');r.useCORSPreflightFlag=!0}let C=p;if(h==null&&f!=null){if(nD(t))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let m=new TransformStream;f.stream.pipeThrough(m),C={source:f.source,length:f.length,stream:m.readable}}this[Qe].body=C}get method(){return J.brandCheck(this,e),this[Qe].method}get url(){return J.brandCheck(this,e),EJ(this[Qe].url)}get headers(){return J.brandCheck(this,e),this[_t]}get destination(){return J.brandCheck(this,e),this[Qe].destination}get referrer(){return J.brandCheck(this,e),this[Qe].referrer==="no-referrer"?"":this[Qe].referrer==="client"?"about:client":this[Qe].referrer.toString()}get referrerPolicy(){return J.brandCheck(this,e),this[Qe].referrerPolicy}get mode(){return J.brandCheck(this,e),this[Qe].mode}get credentials(){return this[Qe].credentials}get cache(){return J.brandCheck(this,e),this[Qe].cache}get redirect(){return J.brandCheck(this,e),this[Qe].redirect}get integrity(){return J.brandCheck(this,e),this[Qe].integrity}get keepalive(){return J.brandCheck(this,e),this[Qe].keepalive}get isReloadNavigation(){return J.brandCheck(this,e),this[Qe].reloadNavigation}get isHistoryNavigation(){return J.brandCheck(this,e),this[Qe].historyNavigation}get signal(){return J.brandCheck(this,e),this[Fu]}get body(){return J.brandCheck(this,e),this[Qe].body?this[Qe].body.stream:null}get bodyUsed(){return J.brandCheck(this,e),!!this[Qe].body&&Tu.isDisturbed(this[Qe].body.stream)}get duplex(){return J.brandCheck(this,e),"half"}clone(){if(J.brandCheck(this,e),nD(this))throw new TypeError("unusable");let t=hD(this[Qe]),n=new AbortController;if(this.signal.aborted)n.abort(this.signal.reason);else{let i=Pu.get(this.signal);i===void 0&&(i=new Set,Pu.set(this.signal,i));let r=new WeakRef(n);i.add(r),Tu.addAbortListener(n.signal,uD(r))}return pD(t,n.signal,sJ(this[_t]))}[oD.inspect.custom](t,n){n.depth===null&&(n.depth=2),n.colors??=!0;let i={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${oD.formatWithOptions(n,i)}`}};nJ(xn);function Ou(e){return{method:e.method??"GET",localURLsOnly:e.localURLsOnly??!1,unsafeRequest:e.unsafeRequest??!1,body:e.body??null,client:e.client??null,reservedClient:e.reservedClient??null,replacesClientId:e.replacesClientId??"",window:e.window??"client",keepalive:e.keepalive??!1,serviceWorkers:e.serviceWorkers??"all",initiator:e.initiator??"",destination:e.destination??"",priority:e.priority??null,origin:e.origin??"client",policyContainer:e.policyContainer??"client",referrer:e.referrer??"client",referrerPolicy:e.referrerPolicy??"",mode:e.mode??"no-cors",useCORSPreflightFlag:e.useCORSPreflightFlag??!1,credentials:e.credentials??"same-origin",useCredentials:e.useCredentials??!1,cache:e.cache??"default",redirect:e.redirect??"follow",integrity:e.integrity??"",cryptoGraphicsNonceMetadata:e.cryptoGraphicsNonceMetadata??"",parserMetadata:e.parserMetadata??"",reloadNavigation:e.reloadNavigation??!1,historyNavigation:e.historyNavigation??!1,userActivation:e.userActivation??!1,taintedOrigin:e.taintedOrigin??!1,redirectCount:e.redirectCount??0,responseTainting:e.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:e.preventNoCacheCacheControlHeaderModification??!1,done:e.done??!1,timingAllowFailed:e.timingAllowFailed??!1,urlList:e.urlList,url:e.urlList[0],headersList:e.headersList?new Mu(e.headersList):new Mu}}function hD(e){let t=Ou({...e,body:null});return e.body!=null&&(t.body=iJ(t,e.body)),t}function pD(e,t,n){let i=new xn(Lu);return i[Qe]=e,i[Fu]=t,i[_t]=new dD(Lu),gD(i[_t],e.headersList),im(i[_t],n),i}Object.defineProperties(xn.prototype,{method:Te,url:Te,headers:Te,redirect:Te,clone:Te,signal:Te,duplex:Te,destination:Te,body:Te,bodyUsed:Te,isHistoryNavigation:Te,isReloadNavigation:Te,keepalive:Te,integrity:Te,cache:Te,credentials:Te,attribute:Te,referrerPolicy:Te,referrer:Te,mode:Te,[Symbol.toStringTag]:{value:"Request",configurable:!0}});J.converters.Request=J.interfaceConverter(xn);J.converters.RequestInfo=function(e,t,n){return typeof e=="string"?J.converters.USVString(e,t,n):e instanceof xn?J.converters.Request(e,t,n):J.converters.USVString(e,t,n)};J.converters.AbortSignal=J.interfaceConverter(AbortSignal);J.converters.RequestInit=J.dictionaryConverter([{key:"method",converter:J.converters.ByteString},{key:"headers",converter:J.converters.HeadersInit},{key:"body",converter:J.nullableConverter(J.converters.BodyInit)},{key:"referrer",converter:J.converters.USVString},{key:"referrerPolicy",converter:J.converters.DOMString,allowedValues:lJ},{key:"mode",converter:J.converters.DOMString,allowedValues:gJ},{key:"credentials",converter:J.converters.DOMString,allowedValues:fJ},{key:"cache",converter:J.converters.DOMString,allowedValues:hJ},{key:"redirect",converter:J.converters.DOMString,allowedValues:dJ},{key:"integrity",converter:J.converters.DOMString},{key:"keepalive",converter:J.converters.boolean},{key:"signal",converter:J.nullableConverter(e=>J.converters.AbortSignal(e,"RequestInit","signal",{strict:!1}))},{key:"window",converter:J.converters.any},{key:"duplex",converter:J.converters.DOMString,allowedValues:pJ},{key:"dispatcher",converter:J.converters.any}]);mD.exports={Request:xn,makeRequest:Ou,fromInnerRequest:pD,cloneRequest:hD}});var Ha=k((K5,_D)=>{"use strict";var{makeNetworkError:pe,makeAppropriateNetworkError:zu,filterResponse:om,makeResponse:Gu,fromInnerResponse:QJ}=Ja(),{HeadersList:ID}=$i(),{Request:vJ,cloneRequest:wJ}=es(),Dn=require("node:zlib"),{bytesMatch:bJ,makePolicyContainer:kJ,clonePolicyContainer:SJ,requestBadPort:xJ,TAOCheck:DJ,appendRequestOriginHeader:RJ,responseLocationURL:_J,requestCurrentURL:Ur,setRequestReferrerPolicyOnRedirect:NJ,tryUpgradeRequestToAPotentiallyTrustworthyURL:UJ,createOpaqueTimingInfo:um,appendFetchMetadata:$J,corsCheck:TJ,crossOriginResourcePolicyCheck:FJ,determineRequestsReferrer:MJ,coarsenedSharedCurrentTime:Ya,createDeferredPromise:LJ,isBlobLike:PJ,sameOrigin:cm,isCancelled:Fi,isAborted:ED,isErrorLike:OJ,fullyReadBody:zJ,readableStreamClose:GJ,isomorphicEncode:Vu,urlIsLocal:VJ,urlIsHttpHttpsScheme:lm,urlHasHttpsScheme:JJ,clampAndCoarsenConnectionTimingInfo:YJ,simpleRangeHeaderValue:HJ,buildContentRange:jJ,createInflate:qJ,extractMimeType:WJ}=bt(),{kState:QD,kDispatcher:ZJ}=In(),Mi=require("node:assert"),{safelyExtractBody:dm,extractBody:CD}=No(),{redirectStatusSet:vD,nullBodyStatus:wD,safeMethodsSet:KJ,requestBodyHeader:XJ,subresourceSet:eY}=ga(),tY=require("node:events"),{Readable:rY,pipeline:nY,finished:iY}=require("node:stream"),{addAbortListener:oY,isErrored:sY,isReadable:Ju,bufferToLowerCasedHeaderName:yD}=ie(),{dataURLProcessor:aY,serializeAMimeType:AY,minimizeSupportedMimeType:cY}=ft(),{getGlobalDispatcher:uY}=za(),{webidl:lY}=Je(),{STATUS_CODES:dY}=require("node:http"),gY=["GET","HEAD"],fY=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",sm,Yu=class extends tY{constructor(t){super(),this.dispatcher=t,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(t){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(t),this.emit("terminated",t))}abort(t){this.state==="ongoing"&&(this.state="aborted",t||(t=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=t,this.connection?.destroy(t),this.emit("terminated",t))}};function hY(e){bD(e,"fetch")}function pY(e,t=void 0){lY.argumentLengthCheck(arguments,1,"globalThis.fetch");let n=LJ(),i;try{i=new vJ(e,t)}catch(l){return n.reject(l),n.promise}let r=i[QD];if(i.signal.aborted)return am(n,r,null,i.signal.reason),n.promise;r.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(r.serviceWorkers="none");let s=null,a=!1,A=null;return oY(i.signal,()=>{a=!0,Mi(A!=null),A.abort(i.signal.reason);let l=s?.deref();am(n,r,l,i.signal.reason)}),A=SD({request:r,processResponseEndOfBody:hY,processResponse:l=>{if(!a){if(l.aborted){am(n,r,s,A.serializedAbortReason);return}if(l.type==="error"){n.reject(new TypeError("fetch failed",{cause:l.error}));return}s=new WeakRef(QJ(l,"immutable")),n.resolve(s.deref()),n=null}},dispatcher:i[ZJ]}),n.promise}function bD(e,t="other"){if(e.type==="error"&&e.aborted||!e.urlList?.length)return;let n=e.urlList[0],i=e.timingInfo,r=e.cacheState;lm(n)&&i!==null&&(e.timingAllowPassed||(i=um({startTime:i.startTime}),r=""),i.endTime=Ya(),e.timingInfo=i,kD(i,n.href,t,globalThis,r))}var kD=performance.markResourceTiming;function am(e,t,n,i){if(e&&e.reject(i),t.body!=null&&Ju(t.body?.stream)&&t.body.stream.cancel(i).catch(o=>{if(o.code!=="ERR_INVALID_STATE")throw o}),n==null)return;let r=n[QD];r.body!=null&&Ju(r.body?.stream)&&r.body.stream.cancel(i).catch(o=>{if(o.code!=="ERR_INVALID_STATE")throw o})}function SD({request:e,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:i,processResponseEndOfBody:r,processResponseConsumeBody:o,useParallelQueue:s=!1,dispatcher:a=uY()}){Mi(a);let A=null,c=!1;e.client!=null&&(A=e.client.globalObject,c=e.client.crossOriginIsolatedCapability);let l=Ya(c),d=um({startTime:l}),g={controller:new Yu(a),request:e,timingInfo:d,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:i,processResponseConsumeBody:o,processResponseEndOfBody:r,taskDestination:A,crossOriginIsolatedCapability:c};return Mi(!e.body||e.body.stream),e.window==="client"&&(e.window=e.client?.globalObject?.constructor?.name==="Window"?e.client:"no-window"),e.origin==="client"&&(e.origin=e.client.origin),e.policyContainer==="client"&&(e.client!=null?e.policyContainer=SJ(e.client.policyContainer):e.policyContainer=kJ()),e.headersList.contains("accept",!0)||e.headersList.append("accept","*/*",!0),e.headersList.contains("accept-language",!0)||e.headersList.append("accept-language","*",!0),e.priority,eY.has(e.destination),xD(g).catch(f=>{g.controller.terminate(f)}),g.controller}async function xD(e,t=!1){let n=e.request,i=null;if(n.localURLsOnly&&!VJ(Ur(n))&&(i=pe("local URLs only")),UJ(n),xJ(n)==="blocked"&&(i=pe("bad port")),n.referrerPolicy===""&&(n.referrerPolicy=n.policyContainer.referrerPolicy),n.referrer!=="no-referrer"&&(n.referrer=MJ(n)),i===null&&(i=await(async()=>{let o=Ur(n);return cm(o,n.url)&&n.responseTainting==="basic"||o.protocol==="data:"||n.mode==="navigate"||n.mode==="websocket"?(n.responseTainting="basic",await BD(e)):n.mode==="same-origin"?pe('request mode cannot be "same-origin"'):n.mode==="no-cors"?n.redirect!=="follow"?pe('redirect mode cannot be "follow" for "no-cors" request'):(n.responseTainting="opaque",await BD(e)):lm(Ur(n))?(n.responseTainting="cors",await DD(e)):pe("URL scheme must be a HTTP(S) scheme")})()),t)return i;i.status!==0&&!i.internalResponse&&(n.responseTainting,n.responseTainting==="basic"?i=om(i,"basic"):n.responseTainting==="cors"?i=om(i,"cors"):n.responseTainting==="opaque"?i=om(i,"opaque"):Mi(!1));let r=i.status===0?i:i.internalResponse;if(r.urlList.length===0&&r.urlList.push(...n.urlList),n.timingAllowFailed||(i.timingAllowPassed=!0),i.type==="opaque"&&r.status===206&&r.rangeRequested&&!n.headers.contains("range",!0)&&(i=r=pe()),i.status!==0&&(n.method==="HEAD"||n.method==="CONNECT"||wD.includes(r.status))&&(r.body=null,e.controller.dump=!0),n.integrity){let o=a=>Am(e,pe(a));if(n.responseTainting==="opaque"||i.body==null){o(i.error);return}let s=a=>{if(!bJ(a,n.integrity)){o("integrity mismatch");return}i.body=dm(a)[0],Am(e,i)};await zJ(i.body,s,o)}else Am(e,i)}function BD(e){if(Fi(e)&&e.request.redirectCount===0)return Promise.resolve(zu(e));let{request:t}=e,{protocol:n}=Ur(t);switch(n){case"about:":return Promise.resolve(pe("about scheme is not supported"));case"blob:":{sm||(sm=require("node:buffer").resolveObjectURL);let i=Ur(t);if(i.search.length!==0)return Promise.resolve(pe("NetworkError when attempting to fetch resource."));let r=sm(i.toString());if(t.method!=="GET"||!PJ(r))return Promise.resolve(pe("invalid method"));let o=Gu(),s=r.size,a=Vu(`${s}`),A=r.type;if(t.headersList.contains("range",!0)){o.rangeRequested=!0;let c=t.headersList.get("range",!0),l=HJ(c,!0);if(l==="failure")return Promise.resolve(pe("failed to fetch the data URL"));let{rangeStartValue:d,rangeEndValue:g}=l;if(d===null)d=s-g,g=d+g-1;else{if(d>=s)return Promise.resolve(pe("Range start is greater than the blob's size."));(g===null||g>=s)&&(g=s-1)}let f=r.slice(d,g,A),h=CD(f);o.body=h[0];let p=Vu(`${f.size}`),C=jJ(d,g,s);o.status=206,o.statusText="Partial Content",o.headersList.set("content-length",p,!0),o.headersList.set("content-type",A,!0),o.headersList.set("content-range",C,!0)}else{let c=CD(r);o.statusText="OK",o.body=c[0],o.headersList.set("content-length",a,!0),o.headersList.set("content-type",A,!0)}return Promise.resolve(o)}case"data:":{let i=Ur(t),r=aY(i);if(r==="failure")return Promise.resolve(pe("failed to fetch the data URL"));let o=AY(r.mimeType);return Promise.resolve(Gu({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:o}]],body:dm(r.body)[0]}))}case"file:":return Promise.resolve(pe("not implemented... yet..."));case"http:":case"https:":return DD(e).catch(i=>pe(i));default:return Promise.resolve(pe("unknown scheme"))}}function mY(e,t){e.request.done=!0,e.processResponseDone!=null&&queueMicrotask(()=>e.processResponseDone(t))}function Am(e,t){let n=e.timingInfo,i=()=>{let o=Date.now();e.request.destination==="document"&&(e.controller.fullTimingInfo=n),e.controller.reportTimingSteps=()=>{if(e.request.url.protocol!=="https:")return;n.endTime=o;let a=t.cacheState,A=t.bodyInfo;t.timingAllowPassed||(n=um(n),a="");let c=0;if(e.request.mode!=="navigator"||!t.hasCrossOriginRedirects){c=t.status;let l=WJ(t.headersList);l!=="failure"&&(A.contentType=cY(l))}e.request.initiatorType!=null&&kD(n,e.request.url.href,e.request.initiatorType,globalThis,a,A,c)};let s=()=>{e.request.done=!0,e.processResponseEndOfBody!=null&&queueMicrotask(()=>e.processResponseEndOfBody(t)),e.request.initiatorType!=null&&e.controller.reportTimingSteps()};queueMicrotask(()=>s())};e.processResponse!=null&&queueMicrotask(()=>{e.processResponse(t),e.processResponse=null});let r=t.type==="error"?t:t.internalResponse??t;r.body==null?i():iY(r.body.stream,()=>{i()})}async function DD(e){let t=e.request,n=null,i=null,r=e.timingInfo;if(t.serviceWorkers,n===null){if(t.redirect==="follow"&&(t.serviceWorkers="none"),i=n=await RD(e),t.responseTainting==="cors"&&TJ(t,n)==="failure")return pe("cors failure");DJ(t,n)==="failure"&&(t.timingAllowFailed=!0)}return(t.responseTainting==="opaque"||n.type==="opaque")&&FJ(t.origin,t.client,t.destination,i)==="blocked"?pe("blocked"):(vD.has(i.status)&&(t.redirect!=="manual"&&e.controller.connection.destroy(void 0,!1),t.redirect==="error"?n=pe("unexpected redirect"):t.redirect==="manual"?n=i:t.redirect==="follow"?n=await IY(e,n):Mi(!1)),n.timingInfo=r,n)}function IY(e,t){let n=e.request,i=t.internalResponse?t.internalResponse:t,r;try{if(r=_J(i,Ur(n).hash),r==null)return t}catch(s){return Promise.resolve(pe(s))}if(!lm(r))return Promise.resolve(pe("URL scheme must be a HTTP(S) scheme"));if(n.redirectCount===20)return Promise.resolve(pe("redirect count exceeded"));if(n.redirectCount+=1,n.mode==="cors"&&(r.username||r.password)&&!cm(n,r))return Promise.resolve(pe('cross origin not allowed for request mode "cors"'));if(n.responseTainting==="cors"&&(r.username||r.password))return Promise.resolve(pe('URL cannot contain credentials for request mode "cors"'));if(i.status!==303&&n.body!=null&&n.body.source==null)return Promise.resolve(pe());if([301,302].includes(i.status)&&n.method==="POST"||i.status===303&&!gY.includes(n.method)){n.method="GET",n.body=null;for(let s of XJ)n.headersList.delete(s)}cm(Ur(n),r)||(n.headersList.delete("authorization",!0),n.headersList.delete("proxy-authorization",!0),n.headersList.delete("cookie",!0),n.headersList.delete("host",!0)),n.body!=null&&(Mi(n.body.source!=null),n.body=dm(n.body.source)[0]);let o=e.timingInfo;return o.redirectEndTime=o.postRedirectStartTime=Ya(e.crossOriginIsolatedCapability),o.redirectStartTime===0&&(o.redirectStartTime=o.startTime),n.urlList.push(r),NJ(n,i),xD(e,!0)}async function RD(e,t=!1,n=!1){let i=e.request,r=null,o=null,s=null,a=null,A=!1;i.window==="no-window"&&i.redirect==="error"?(r=e,o=i):(o=wJ(i),r={...e},r.request=o);let c=i.credentials==="include"||i.credentials==="same-origin"&&i.responseTainting==="basic",l=o.body?o.body.length:null,d=null;if(o.body==null&&["POST","PUT"].includes(o.method)&&(d="0"),l!=null&&(d=Vu(`${l}`)),d!=null&&o.headersList.append("content-length",d,!0),l!=null&&o.keepalive,o.referrer instanceof URL&&o.headersList.append("referer",Vu(o.referrer.href),!0),RJ(o),$J(o),o.headersList.contains("user-agent",!0)||o.headersList.append("user-agent",fY),o.cache==="default"&&(o.headersList.contains("if-modified-since",!0)||o.headersList.contains("if-none-match",!0)||o.headersList.contains("if-unmodified-since",!0)||o.headersList.contains("if-match",!0)||o.headersList.contains("if-range",!0))&&(o.cache="no-store"),o.cache==="no-cache"&&!o.preventNoCacheCacheControlHeaderModification&&!o.headersList.contains("cache-control",!0)&&o.headersList.append("cache-control","max-age=0",!0),(o.cache==="no-store"||o.cache==="reload")&&(o.headersList.contains("pragma",!0)||o.headersList.append("pragma","no-cache",!0),o.headersList.contains("cache-control",!0)||o.headersList.append("cache-control","no-cache",!0)),o.headersList.contains("range",!0)&&o.headersList.append("accept-encoding","identity",!0),o.headersList.contains("accept-encoding",!0)||(JJ(Ur(o))?o.headersList.append("accept-encoding","br, gzip, deflate",!0):o.headersList.append("accept-encoding","gzip, deflate",!0)),o.headersList.delete("host",!0),a==null&&(o.cache="no-store"),o.cache!=="no-store"&&o.cache,s==null){if(o.cache==="only-if-cached")return pe("only if cached");let g=await EY(r,c,n);!KJ.has(o.method)&&g.status>=200&&g.status<=399,A&&g.status,s==null&&(s=g)}if(s.urlList=[...o.urlList],o.headersList.contains("range",!0)&&(s.rangeRequested=!0),s.requestIncludesCredentials=c,s.status===407)return i.window==="no-window"?pe():Fi(e)?zu(e):pe("proxy authentication required");if(s.status===421&&!n&&(i.body==null||i.body.source!=null)){if(Fi(e))return zu(e);e.controller.connection.destroy(),s=await RD(e,t,!0)}return s}async function EY(e,t=!1,n=!1){Mi(!e.controller.connection||e.controller.connection.destroyed),e.controller.connection={abort:null,destroyed:!1,destroy(h,p=!0){this.destroyed||(this.destroyed=!0,p&&this.abort?.(h??new DOMException("The operation was aborted.","AbortError")))}};let i=e.request,r=null,o=e.timingInfo;null==null&&(i.cache="no-store");let a=n?"yes":"no";i.mode;let A=null;if(i.body==null&&e.processRequestEndOfBody)queueMicrotask(()=>e.processRequestEndOfBody());else if(i.body!=null){let h=async function*(m){Fi(e)||(yield m,e.processRequestBodyChunkLength?.(m.byteLength))},p=()=>{Fi(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},C=m=>{Fi(e)||(m.name==="AbortError"?e.controller.abort():e.controller.terminate(m))};A=(async function*(){try{for await(let m of i.body.stream)yield*h(m);p()}catch(m){C(m)}})()}try{let{body:h,status:p,statusText:C,headersList:m,socket:y}=await f({body:A});if(y)r=Gu({status:p,statusText:C,headersList:m,socket:y});else{let w=h[Symbol.asyncIterator]();e.controller.next=()=>w.next(),r=Gu({status:p,statusText:C,headersList:m})}}catch(h){return h.name==="AbortError"?(e.controller.connection.destroy(),zu(e,h)):pe(h)}let c=async()=>{await e.controller.resume()},l=h=>{Fi(e)||e.controller.abort(h)},d=new ReadableStream({async start(h){e.controller.controller=h},async pull(h){await c(h)},async cancel(h){await l(h)},type:"bytes"});r.body={stream:d,source:null,length:null},e.controller.resume||e.controller.on("terminated",g),e.controller.resume=async()=>{for(;;){let h,p;try{let{done:m,value:y}=await e.controller.next();if(ED(e))break;h=m?void 0:y}catch(m){e.controller.ended&&!o.encodedBodySize?h=void 0:(h=m,p=!0)}if(h===void 0){GJ(e.controller.controller),mY(e,r);return}if(o.decodedBodySize+=h?.byteLength??0,p){e.controller.terminate(h);return}let C=new Uint8Array(h);if(C.byteLength&&e.controller.controller.enqueue(C),sY(d)){e.controller.terminate();return}if(e.controller.controller.desiredSize<=0)return}};function g(h){ED(e)?(r.aborted=!0,Ju(d)&&e.controller.controller.error(e.controller.serializedAbortReason)):Ju(d)&&e.controller.controller.error(new TypeError("terminated",{cause:OJ(h)?h:void 0})),e.controller.connection.destroy()}return r;function f({body:h}){let p=Ur(i),C=e.controller.dispatcher;return new Promise((m,y)=>C.dispatch({path:p.pathname+p.search,origin:p.origin,method:i.method,body:C.isMockActive?i.body&&(i.body.source||i.body.stream):h,headers:i.headersList.entries,maxRedirections:0,upgrade:i.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(w){let{connection:b}=e.controller;o.finalConnectionTimingInfo=YJ(void 0,o.postRedirectStartTime,e.crossOriginIsolatedCapability),b.destroyed?w(new DOMException("The operation was aborted.","AbortError")):(e.controller.on("terminated",w),this.abort=b.abort=w),o.finalNetworkRequestStartTime=Ya(e.crossOriginIsolatedCapability)},onResponseStarted(){o.finalNetworkResponseStartTime=Ya(e.crossOriginIsolatedCapability)},onHeaders(w,b,F,T){if(w<200)return;let Z="",Se=new ID;for(let qe=0;qe<b.length;qe+=2)Se.append(yD(b[qe]),b[qe+1].toString("latin1"),!0);Z=Se.get("location",!0);let Pt=[],mr=Z&&i.redirect==="follow"&&vD.has(w);if(i.method!=="HEAD"&&i.method!=="CONNECT"&&!wD.includes(w)&&!mr){let qe=Se.get("content-encoding",!0),dn=qe?qe.toLowerCase().split(","):[],gc=5;if(dn.length>gc)return this.abort(new Error(`too many content-encodings in response: ${dn.length}, maximum allowed is ${gc}`)),!0;for(let Kn=dn.length-1;Kn>=0;--Kn){let fc=dn[Kn].trim();if(fc==="x-gzip"||fc==="gzip")Pt.push(Dn.createGunzip({flush:Dn.constants.Z_SYNC_FLUSH,finishFlush:Dn.constants.Z_SYNC_FLUSH}));else if(fc==="deflate")Pt.push(qJ({flush:Dn.constants.Z_SYNC_FLUSH,finishFlush:Dn.constants.Z_SYNC_FLUSH}));else if(fc==="br")Pt.push(Dn.createBrotliDecompress({flush:Dn.constants.BROTLI_OPERATION_FLUSH,finishFlush:Dn.constants.BROTLI_OPERATION_FLUSH}));else{Pt.length=0;break}}}this.body=new rY({read:F});let er=this.onError.bind(this);return m({status:w,statusText:T,headersList:Se,body:Pt.length?nY(this.body,...Pt,qe=>{qe&&this.onError(qe)}).on("error",er):this.body.on("error",er)}),!0},onData(w){if(e.controller.dump)return;let b=w;return o.encodedBodySize+=b.byteLength,this.body.push(b)},onComplete(){this.abort&&e.controller.off("terminated",this.abort),e.controller.ended=!0,this.body.push(null)},onError(w){this.abort&&e.controller.off("terminated",this.abort),this.body?.destroy(w),e.controller.terminate(w),y(w)},onUpgrade(w,b,F){if(w!==101)return;let T=new ID;for(let Z=0;Z<b.length;Z+=2)T.append(yD(b[Z]),b[Z+1].toString("latin1"),!0);return m({status:w,statusText:dY[w],headersList:T,socket:F}),!0}}))}}_D.exports={fetch:pY,Fetch:Yu,fetching:SD,finalizeAndReportTiming:bD}});var gm=k((X5,ND)=>{"use strict";ND.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var $D=k((e3,UD)=>{"use strict";var{webidl:Nt}=Je(),Hu=Symbol("ProgressEvent state"),fm=class e extends Event{constructor(t,n={}){t=Nt.converters.DOMString(t,"ProgressEvent constructor","type"),n=Nt.converters.ProgressEventInit(n??{}),super(t,n),this[Hu]={lengthComputable:n.lengthComputable,loaded:n.loaded,total:n.total}}get lengthComputable(){return Nt.brandCheck(this,e),this[Hu].lengthComputable}get loaded(){return Nt.brandCheck(this,e),this[Hu].loaded}get total(){return Nt.brandCheck(this,e),this[Hu].total}};Nt.converters.ProgressEventInit=Nt.dictionaryConverter([{key:"lengthComputable",converter:Nt.converters.boolean,defaultValue:()=>!1},{key:"loaded",converter:Nt.converters["unsigned long long"],defaultValue:()=>0},{key:"total",converter:Nt.converters["unsigned long long"],defaultValue:()=>0},{key:"bubbles",converter:Nt.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:Nt.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:Nt.converters.boolean,defaultValue:()=>!1}]);UD.exports={ProgressEvent:fm}});var FD=k((t3,TD)=>{"use strict";function CY(e){if(!e)return"failure";switch(e.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}TD.exports={getEncoding:CY}});var JD=k((r3,VD)=>{"use strict";var{kState:ts,kError:hm,kResult:MD,kAborted:ja,kLastProgressEventFired:pm}=gm(),{ProgressEvent:yY}=$D(),{getEncoding:LD}=FD(),{serializeAMimeType:BY,parseMIMEType:PD}=ft(),{types:QY}=require("node:util"),{StringDecoder:OD}=require("string_decoder"),{btoa:zD}=require("node:buffer"),vY={enumerable:!0,writable:!1,configurable:!1};function wY(e,t,n,i){if(e[ts]==="loading")throw new DOMException("Invalid state","InvalidStateError");e[ts]="loading",e[MD]=null,e[hm]=null;let o=t.stream().getReader(),s=[],a=o.read(),A=!0;(async()=>{for(;!e[ja];)try{let{done:c,value:l}=await a;if(A&&!e[ja]&&queueMicrotask(()=>{Rn("loadstart",e)}),A=!1,!c&&QY.isUint8Array(l))s.push(l),(e[pm]===void 0||Date.now()-e[pm]>=50)&&!e[ja]&&(e[pm]=Date.now(),queueMicrotask(()=>{Rn("progress",e)})),a=o.read();else if(c){queueMicrotask(()=>{e[ts]="done";try{let d=bY(s,n,t.type,i);if(e[ja])return;e[MD]=d,Rn("load",e)}catch(d){e[hm]=d,Rn("error",e)}e[ts]!=="loading"&&Rn("loadend",e)});break}}catch(c){if(e[ja])return;queueMicrotask(()=>{e[ts]="done",e[hm]=c,Rn("error",e),e[ts]!=="loading"&&Rn("loadend",e)});break}})()}function Rn(e,t){let n=new yY(e,{bubbles:!1,cancelable:!1});t.dispatchEvent(n)}function bY(e,t,n,i){switch(t){case"DataURL":{let r="data:",o=PD(n||"application/octet-stream");o!=="failure"&&(r+=BY(o)),r+=";base64,";let s=new OD("latin1");for(let a of e)r+=zD(s.write(a));return r+=zD(s.end()),r}case"Text":{let r="failure";if(i&&(r=LD(i)),r==="failure"&&n){let o=PD(n);o!=="failure"&&(r=LD(o.parameters.get("charset")))}return r==="failure"&&(r="UTF-8"),kY(e,r)}case"ArrayBuffer":return GD(e).buffer;case"BinaryString":{let r="",o=new OD("latin1");for(let s of e)r+=o.write(s);return r+=o.end(),r}}}function kY(e,t){let n=GD(e),i=SY(n),r=0;i!==null&&(t=i,r=i==="UTF-8"?3:2);let o=n.slice(r);return new TextDecoder(t).decode(o)}function SY(e){let[t,n,i]=e;return t===239&&n===187&&i===191?"UTF-8":t===254&&n===255?"UTF-16BE":t===255&&n===254?"UTF-16LE":null}function GD(e){let t=e.reduce((i,r)=>i+r.byteLength,0),n=0;return e.reduce((i,r)=>(i.set(r,n),n+=r.byteLength,i),new Uint8Array(t))}VD.exports={staticPropertyDescriptors:vY,readOperation:wY,fireAProgressEvent:Rn}});var qD=k((n3,jD)=>{"use strict";var{staticPropertyDescriptors:rs,readOperation:ju,fireAProgressEvent:YD}=JD(),{kState:Li,kError:HD,kResult:qu,kEvents:le,kAborted:xY}=gm(),{webidl:Ee}=Je(),{kEnumerableProperty:mt}=ie(),cr=class e extends EventTarget{constructor(){super(),this[Li]="empty",this[qu]=null,this[HD]=null,this[le]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(t){Ee.brandCheck(this,e),Ee.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),t=Ee.converters.Blob(t,{strict:!1}),ju(this,t,"ArrayBuffer")}readAsBinaryString(t){Ee.brandCheck(this,e),Ee.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),t=Ee.converters.Blob(t,{strict:!1}),ju(this,t,"BinaryString")}readAsText(t,n=void 0){Ee.brandCheck(this,e),Ee.argumentLengthCheck(arguments,1,"FileReader.readAsText"),t=Ee.converters.Blob(t,{strict:!1}),n!==void 0&&(n=Ee.converters.DOMString(n,"FileReader.readAsText","encoding")),ju(this,t,"Text",n)}readAsDataURL(t){Ee.brandCheck(this,e),Ee.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),t=Ee.converters.Blob(t,{strict:!1}),ju(this,t,"DataURL")}abort(){if(this[Li]==="empty"||this[Li]==="done"){this[qu]=null;return}this[Li]==="loading"&&(this[Li]="done",this[qu]=null),this[xY]=!0,YD("abort",this),this[Li]!=="loading"&&YD("loadend",this)}get readyState(){switch(Ee.brandCheck(this,e),this[Li]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return Ee.brandCheck(this,e),this[qu]}get error(){return Ee.brandCheck(this,e),this[HD]}get onloadend(){return Ee.brandCheck(this,e),this[le].loadend}set onloadend(t){Ee.brandCheck(this,e),this[le].loadend&&this.removeEventListener("loadend",this[le].loadend),typeof t=="function"?(this[le].loadend=t,this.addEventListener("loadend",t)):this[le].loadend=null}get onerror(){return Ee.brandCheck(this,e),this[le].error}set onerror(t){Ee.brandCheck(this,e),this[le].error&&this.removeEventListener("error",this[le].error),typeof t=="function"?(this[le].error=t,this.addEventListener("error",t)):this[le].error=null}get onloadstart(){return Ee.brandCheck(this,e),this[le].loadstart}set onloadstart(t){Ee.brandCheck(this,e),this[le].loadstart&&this.removeEventListener("loadstart",this[le].loadstart),typeof t=="function"?(this[le].loadstart=t,this.addEventListener("loadstart",t)):this[le].loadstart=null}get onprogress(){return Ee.brandCheck(this,e),this[le].progress}set onprogress(t){Ee.brandCheck(this,e),this[le].progress&&this.removeEventListener("progress",this[le].progress),typeof t=="function"?(this[le].progress=t,this.addEventListener("progress",t)):this[le].progress=null}get onload(){return Ee.brandCheck(this,e),this[le].load}set onload(t){Ee.brandCheck(this,e),this[le].load&&this.removeEventListener("load",this[le].load),typeof t=="function"?(this[le].load=t,this.addEventListener("load",t)):this[le].load=null}get onabort(){return Ee.brandCheck(this,e),this[le].abort}set onabort(t){Ee.brandCheck(this,e),this[le].abort&&this.removeEventListener("abort",this[le].abort),typeof t=="function"?(this[le].abort=t,this.addEventListener("abort",t)):this[le].abort=null}};cr.EMPTY=cr.prototype.EMPTY=0;cr.LOADING=cr.prototype.LOADING=1;cr.DONE=cr.prototype.DONE=2;Object.defineProperties(cr.prototype,{EMPTY:rs,LOADING:rs,DONE:rs,readAsArrayBuffer:mt,readAsBinaryString:mt,readAsText:mt,readAsDataURL:mt,abort:mt,readyState:mt,result:mt,error:mt,onloadstart:mt,onprogress:mt,onload:mt,onabort:mt,onerror:mt,onloadend:mt,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(cr,{EMPTY:rs,LOADING:rs,DONE:rs});jD.exports={FileReader:cr}});var Wu=k((i3,WD)=>{"use strict";WD.exports={kConstruct:ve().kConstruct}});var XD=k((o3,KD)=>{"use strict";var DY=require("node:assert"),{URLSerializer:ZD}=ft(),{isValidHeaderName:RY}=bt();function _Y(e,t,n=!1){let i=ZD(e,n),r=ZD(t,n);return i===r}function NY(e){DY(e!==null);let t=[];for(let n of e.split(","))n=n.trim(),RY(n)&&t.push(n);return t}KD.exports={urlEquals:_Y,getFieldValues:NY}});var rR=k((s3,tR)=>{"use strict";var{kConstruct:UY}=Wu(),{urlEquals:$Y,getFieldValues:mm}=XD(),{kEnumerableProperty:Pi,isDisturbed:TY}=ie(),{webidl:O}=Je(),{Response:FY,cloneResponse:MY,fromInnerResponse:LY}=Ja(),{Request:nn,fromInnerRequest:PY}=es(),{kState:ur}=In(),{fetching:OY}=Ha(),{urlIsHttpHttpsScheme:Zu,createDeferredPromise:ns,readAllBytes:zY}=bt(),Im=require("node:assert"),Ku=class e{#e;constructor(){arguments[0]!==UY&&O.illegalConstructor(),O.util.markAsUncloneable(this),this.#e=arguments[1]}async match(t,n={}){O.brandCheck(this,e);let i="Cache.match";O.argumentLengthCheck(arguments,1,i),t=O.converters.RequestInfo(t,i,"request"),n=O.converters.CacheQueryOptions(n,i,"options");let r=this.#o(t,n,1);if(r.length!==0)return r[0]}async matchAll(t=void 0,n={}){O.brandCheck(this,e);let i="Cache.matchAll";return t!==void 0&&(t=O.converters.RequestInfo(t,i,"request")),n=O.converters.CacheQueryOptions(n,i,"options"),this.#o(t,n)}async add(t){O.brandCheck(this,e);let n="Cache.add";O.argumentLengthCheck(arguments,1,n),t=O.converters.RequestInfo(t,n,"request");let i=[t];return await this.addAll(i)}async addAll(t){O.brandCheck(this,e);let n="Cache.addAll";O.argumentLengthCheck(arguments,1,n);let i=[],r=[];for(let g of t){if(g===void 0)throw O.errors.conversionFailed({prefix:n,argument:"Argument 1",types:["undefined is not allowed"]});if(g=O.converters.RequestInfo(g),typeof g=="string")continue;let f=g[ur];if(!Zu(f.url)||f.method!=="GET")throw O.errors.exception({header:n,message:"Expected http/s scheme when method is not GET."})}let o=[];for(let g of t){let f=new nn(g)[ur];if(!Zu(f.url))throw O.errors.exception({header:n,message:"Expected http/s scheme."});f.initiator="fetch",f.destination="subresource",r.push(f);let h=ns();o.push(OY({request:f,processResponse(p){if(p.type==="error"||p.status===206||p.status<200||p.status>299)h.reject(O.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(p.headersList.contains("vary")){let C=mm(p.headersList.get("vary"));for(let m of C)if(m==="*"){h.reject(O.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let y of o)y.abort();return}}},processResponseEndOfBody(p){if(p.aborted){h.reject(new DOMException("aborted","AbortError"));return}h.resolve(p)}})),i.push(h.promise)}let a=await Promise.all(i),A=[],c=0;for(let g of a){let f={type:"put",request:r[c],response:g};A.push(f),c++}let l=ns(),d=null;try{this.#t(A)}catch(g){d=g}return queueMicrotask(()=>{d===null?l.resolve(void 0):l.reject(d)}),l.promise}async put(t,n){O.brandCheck(this,e);let i="Cache.put";O.argumentLengthCheck(arguments,2,i),t=O.converters.RequestInfo(t,i,"request"),n=O.converters.Response(n,i,"response");let r=null;if(t instanceof nn?r=t[ur]:r=new nn(t)[ur],!Zu(r.url)||r.method!=="GET")throw O.errors.exception({header:i,message:"Expected an http/s scheme when method is not GET"});let o=n[ur];if(o.status===206)throw O.errors.exception({header:i,message:"Got 206 status"});if(o.headersList.contains("vary")){let f=mm(o.headersList.get("vary"));for(let h of f)if(h==="*")throw O.errors.exception({header:i,message:"Got * vary field value"})}if(o.body&&(TY(o.body.stream)||o.body.stream.locked))throw O.errors.exception({header:i,message:"Response body is locked or disturbed"});let s=MY(o),a=ns();if(o.body!=null){let h=o.body.stream.getReader();zY(h).then(a.resolve,a.reject)}else a.resolve(void 0);let A=[],c={type:"put",request:r,response:s};A.push(c);let l=await a.promise;s.body!=null&&(s.body.source=l);let d=ns(),g=null;try{this.#t(A)}catch(f){g=f}return queueMicrotask(()=>{g===null?d.resolve():d.reject(g)}),d.promise}async delete(t,n={}){O.brandCheck(this,e);let i="Cache.delete";O.argumentLengthCheck(arguments,1,i),t=O.converters.RequestInfo(t,i,"request"),n=O.converters.CacheQueryOptions(n,i,"options");let r=null;if(t instanceof nn){if(r=t[ur],r.method!=="GET"&&!n.ignoreMethod)return!1}else Im(typeof t=="string"),r=new nn(t)[ur];let o=[],s={type:"delete",request:r,options:n};o.push(s);let a=ns(),A=null,c;try{c=this.#t(o)}catch(l){A=l}return queueMicrotask(()=>{A===null?a.resolve(!!c?.length):a.reject(A)}),a.promise}async keys(t=void 0,n={}){O.brandCheck(this,e);let i="Cache.keys";t!==void 0&&(t=O.converters.RequestInfo(t,i,"request")),n=O.converters.CacheQueryOptions(n,i,"options");let r=null;if(t!==void 0)if(t instanceof nn){if(r=t[ur],r.method!=="GET"&&!n.ignoreMethod)return[]}else typeof t=="string"&&(r=new nn(t)[ur]);let o=ns(),s=[];if(t===void 0)for(let a of this.#e)s.push(a[0]);else{let a=this.#r(r,n);for(let A of a)s.push(A[0])}return queueMicrotask(()=>{let a=[];for(let A of s){let c=PY(A,new AbortController().signal,"immutable");a.push(c)}o.resolve(Object.freeze(a))}),o.promise}#t(t){let n=this.#e,i=[...n],r=[],o=[];try{for(let s of t){if(s.type!=="delete"&&s.type!=="put")throw O.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(s.type==="delete"&&s.response!=null)throw O.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(s.request,s.options,r).length)throw new DOMException("???","InvalidStateError");let a;if(s.type==="delete"){if(a=this.#r(s.request,s.options),a.length===0)return[];for(let A of a){let c=n.indexOf(A);Im(c!==-1),n.splice(c,1)}}else if(s.type==="put"){if(s.response==null)throw O.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let A=s.request;if(!Zu(A.url))throw O.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(A.method!=="GET")throw O.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(s.options!=null)throw O.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});a=this.#r(s.request);for(let c of a){let l=n.indexOf(c);Im(l!==-1),n.splice(l,1)}n.push([s.request,s.response]),r.push([s.request,s.response])}o.push([s.request,s.response])}return o}catch(s){throw this.#e.length=0,this.#e=i,s}}#r(t,n,i){let r=[],o=i??this.#e;for(let s of o){let[a,A]=s;this.#i(t,a,A,n)&&r.push(s)}return r}#i(t,n,i=null,r){let o=new URL(t.url),s=new URL(n.url);if(r?.ignoreSearch&&(s.search="",o.search=""),!$Y(o,s,!0))return!1;if(i==null||r?.ignoreVary||!i.headersList.contains("vary"))return!0;let a=mm(i.headersList.get("vary"));for(let A of a){if(A==="*")return!1;let c=n.headersList.get(A),l=t.headersList.get(A);if(c!==l)return!1}return!0}#o(t,n,i=1/0){let r=null;if(t!==void 0)if(t instanceof nn){if(r=t[ur],r.method!=="GET"&&!n.ignoreMethod)return[]}else typeof t=="string"&&(r=new nn(t)[ur]);let o=[];if(t===void 0)for(let a of this.#e)o.push(a[1]);else{let a=this.#r(r,n);for(let A of a)o.push(A[1])}let s=[];for(let a of o){let A=LY(a,"immutable");if(s.push(A.clone()),s.length>=i)break}return Object.freeze(s)}};Object.defineProperties(Ku.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:Pi,matchAll:Pi,add:Pi,addAll:Pi,put:Pi,delete:Pi,keys:Pi});var eR=[{key:"ignoreSearch",converter:O.converters.boolean,defaultValue:()=>!1},{key:"ignoreMethod",converter:O.converters.boolean,defaultValue:()=>!1},{key:"ignoreVary",converter:O.converters.boolean,defaultValue:()=>!1}];O.converters.CacheQueryOptions=O.dictionaryConverter(eR);O.converters.MultiCacheQueryOptions=O.dictionaryConverter([...eR,{key:"cacheName",converter:O.converters.DOMString}]);O.converters.Response=O.interfaceConverter(FY);O.converters["sequence<RequestInfo>"]=O.sequenceConverter(O.converters.RequestInfo);tR.exports={Cache:Ku}});var iR=k((a3,nR)=>{"use strict";var{kConstruct:qa}=Wu(),{Cache:Xu}=rR(),{webidl:Ke}=Je(),{kEnumerableProperty:Wa}=ie(),el=class e{#e=new Map;constructor(){arguments[0]!==qa&&Ke.illegalConstructor(),Ke.util.markAsUncloneable(this)}async match(t,n={}){if(Ke.brandCheck(this,e),Ke.argumentLengthCheck(arguments,1,"CacheStorage.match"),t=Ke.converters.RequestInfo(t),n=Ke.converters.MultiCacheQueryOptions(n),n.cacheName!=null){if(this.#e.has(n.cacheName)){let i=this.#e.get(n.cacheName);return await new Xu(qa,i).match(t,n)}}else for(let i of this.#e.values()){let o=await new Xu(qa,i).match(t,n);if(o!==void 0)return o}}async has(t){Ke.brandCheck(this,e);let n="CacheStorage.has";return Ke.argumentLengthCheck(arguments,1,n),t=Ke.converters.DOMString(t,n,"cacheName"),this.#e.has(t)}async open(t){Ke.brandCheck(this,e);let n="CacheStorage.open";if(Ke.argumentLengthCheck(arguments,1,n),t=Ke.converters.DOMString(t,n,"cacheName"),this.#e.has(t)){let r=this.#e.get(t);return new Xu(qa,r)}let i=[];return this.#e.set(t,i),new Xu(qa,i)}async delete(t){Ke.brandCheck(this,e);let n="CacheStorage.delete";return Ke.argumentLengthCheck(arguments,1,n),t=Ke.converters.DOMString(t,n,"cacheName"),this.#e.delete(t)}async keys(){return Ke.brandCheck(this,e),[...this.#e.keys()]}};Object.defineProperties(el.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:Wa,has:Wa,open:Wa,delete:Wa,keys:Wa});nR.exports={CacheStorage:el}});var sR=k((A3,oR)=>{"use strict";oR.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var ym=k((c3,uR)=>{"use strict";function GY(e){for(let t=0;t<e.length;++t){let n=e.charCodeAt(t);if(n>=0&&n<=8||n>=10&&n<=31||n===127)return!0}return!1}function Em(e){for(let t=0;t<e.length;++t){let n=e.charCodeAt(t);if(n<33||n>126||n===34||n===40||n===41||n===60||n===62||n===64||n===44||n===59||n===58||n===92||n===47||n===91||n===93||n===63||n===61||n===123||n===125)throw new Error("Invalid cookie name")}}function Cm(e){let t=e.length,n=0;if(e[0]==='"'){if(t===1||e[t-1]!=='"')throw new Error("Invalid cookie value");--t,++n}for(;n<t;){let i=e.charCodeAt(n++);if(i<33||i>126||i===34||i===44||i===59||i===92)throw new Error("Invalid cookie value")}}function AR(e){for(let t=0;t<e.length;++t){let n=e.charCodeAt(t);if(n<32||n>126||n===59)throw new Error("Invalid cookie path")}}function aR(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function VY(e){if(e===" ")return;if(e.length>255)throw new Error("Invalid cookie domain");let t=0;for(let n=0;n<e.length;++n){let i=e.charCodeAt(n);if(i===46){if(t===0)throw new Error("Invalid cookie domain");if(e.charCodeAt(n-1)===45)throw new Error("Invalid cookie domain");t=0;continue}if(t===0&&!aR(i))throw new Error("Invalid cookie domain");if(!aR(i)&&i!==45)throw new Error("Invalid cookie domain");if(++t>63)throw new Error("Invalid cookie domain")}if(t===0||e.charCodeAt(e.length-1)===45)throw new Error("Invalid cookie domain")}var JY=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],YY=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tl=Array(61).fill(0).map((e,t)=>t.toString().padStart(2,"0"));function cR(e){return typeof e=="number"&&(e=new Date(e)),`${JY[e.getUTCDay()]}, ${tl[e.getUTCDate()]} ${YY[e.getUTCMonth()]} ${e.getUTCFullYear()} ${tl[e.getUTCHours()]}:${tl[e.getUTCMinutes()]}:${tl[e.getUTCSeconds()]} GMT`}function HY(e){if(e<0)throw new Error("Invalid cookie max-age")}function jY(e){if(e.name.length===0)return null;Em(e.name),Cm(e.value);let t=[`${e.name}=${e.value}`];e.name.startsWith("__Secure-")&&(e.secure=!0),e.name.startsWith("__Host-")&&(e.secure=!0,e.domain=null,e.path="/"),e.secure&&t.push("Secure"),e.httpOnly&&t.push("HttpOnly"),typeof e.maxAge=="number"&&(HY(e.maxAge),t.push(`Max-Age=${e.maxAge}`)),e.domain&&(VY(e.domain),t.push(`Domain=${e.domain}`)),e.path&&(AR(e.path),t.push(`Path=${e.path}`)),e.expires&&e.expires.toString()!=="Invalid Date"&&t.push(`Expires=${cR(e.expires)}`),e.sameSite&&t.push(`SameSite=${e.sameSite}`);for(let n of e.unparsed){if(!n.includes("="))throw new Error("Invalid unparsed");let[i,...r]=n.split("="),o=i.trim(),s=r.join("=");Em(o),Cm(s),t.push(`${o}=${s}`)}return t.join("; ")}uR.exports={isCTLExcludingHtab:GY,validateCookieName:Em,validateCookiePath:AR,validateCookieValue:Cm,toIMFDate:cR,stringify:jY}});var dR=k((u3,lR)=>{"use strict";var{maxNameValuePairSize:qY,maxAttributeValueSize:WY}=sR(),{isCTLExcludingHtab:ZY}=ym(),{collectASequenceOfCodePointsFast:rl}=ft(),KY=require("node:assert");function XY(e){if(ZY(e))return null;let t="",n="",i="",r="";if(e.includes(";")){let o={position:0};t=rl(";",e,o),n=e.slice(o.position)}else t=e;if(!t.includes("="))r=t;else{let o={position:0};i=rl("=",t,o),r=t.slice(o.position+1)}return i=i.trim(),r=r.trim(),i.length+r.length>qY?null:{name:i,value:r,...is(n)}}function is(e,t={}){if(e.length===0)return t;KY(e[0]===";"),e=e.slice(1);let n="";e.includes(";")?(n=rl(";",e,{position:0}),e=e.slice(n.length)):(n=e,e="");let i="",r="";if(n.includes("=")){let s={position:0};i=rl("=",n,s),r=n.slice(s.position+1)}else i=n;if(i=i.trim(),r=r.trim(),r.length>WY)return is(e,t);let o=i.toLowerCase();if(o==="expires"){let s=new Date(r);t.expires=s}else if(o==="max-age"){let s=r.charCodeAt(0);if((s<48||s>57)&&r[0]!=="-"||!/^\d+$/.test(r))return is(e,t);let a=Number(r);t.maxAge=a}else if(o==="domain"){let s=r;s[0]==="."&&(s=s.slice(1)),s=s.toLowerCase(),t.domain=s}else if(o==="path"){let s="";r.length===0||r[0]!=="/"?s="/":s=r,t.path=s}else if(o==="secure")t.secure=!0;else if(o==="httponly")t.httpOnly=!0;else if(o==="samesite"){let s=r.toLowerCase();s==="none"?t.sameSite="None":s==="strict"?t.sameSite="Strict":s==="lax"&&(t.sameSite="Lax")}else t.unparsed??=[],t.unparsed.push(`${i}=${r}`);return is(e,t)}lR.exports={parseSetCookie:XY,parseUnparsedAttributes:is}});var hR=k((l3,fR)=>{"use strict";var{parseSetCookie:eH}=dR(),{stringify:tH}=ym(),{webidl:Ae}=Je(),{Headers:nl}=$i();function rH(e){Ae.argumentLengthCheck(arguments,1,"getCookies"),Ae.brandCheck(e,nl,{strict:!1});let t=e.get("cookie"),n={};if(!t)return n;for(let i of t.split(";")){let[r,...o]=i.split("=");n[r.trim()]=o.join("=")}return n}function nH(e,t,n){Ae.brandCheck(e,nl,{strict:!1});let i="deleteCookie";Ae.argumentLengthCheck(arguments,2,i),t=Ae.converters.DOMString(t,i,"name"),n=Ae.converters.DeleteCookieAttributes(n),gR(e,{name:t,value:"",expires:new Date(0),...n})}function iH(e){Ae.argumentLengthCheck(arguments,1,"getSetCookies"),Ae.brandCheck(e,nl,{strict:!1});let t=e.getSetCookie();return t?t.map(n=>eH(n)):[]}function gR(e,t){Ae.argumentLengthCheck(arguments,2,"setCookie"),Ae.brandCheck(e,nl,{strict:!1}),t=Ae.converters.Cookie(t);let n=tH(t);n&&e.append("Set-Cookie",n)}Ae.converters.DeleteCookieAttributes=Ae.dictionaryConverter([{converter:Ae.nullableConverter(Ae.converters.DOMString),key:"path",defaultValue:()=>null},{converter:Ae.nullableConverter(Ae.converters.DOMString),key:"domain",defaultValue:()=>null}]);Ae.converters.Cookie=Ae.dictionaryConverter([{converter:Ae.converters.DOMString,key:"name"},{converter:Ae.converters.DOMString,key:"value"},{converter:Ae.nullableConverter(e=>typeof e=="number"?Ae.converters["unsigned long long"](e):new Date(e)),key:"expires",defaultValue:()=>null},{converter:Ae.nullableConverter(Ae.converters["long long"]),key:"maxAge",defaultValue:()=>null},{converter:Ae.nullableConverter(Ae.converters.DOMString),key:"domain",defaultValue:()=>null},{converter:Ae.nullableConverter(Ae.converters.DOMString),key:"path",defaultValue:()=>null},{converter:Ae.nullableConverter(Ae.converters.boolean),key:"secure",defaultValue:()=>null},{converter:Ae.nullableConverter(Ae.converters.boolean),key:"httpOnly",defaultValue:()=>null},{converter:Ae.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Ae.sequenceConverter(Ae.converters.DOMString),key:"unparsed",defaultValue:()=>new Array(0)}]);fR.exports={getCookies:rH,deleteCookie:nH,getSetCookies:iH,setCookie:gR}});var ss=k((d3,mR)=>{"use strict";var{webidl:M}=Je(),{kEnumerableProperty:It}=ie(),{kConstruct:pR}=ve(),{MessagePort:oH}=require("node:worker_threads"),os=class e extends Event{#e;constructor(t,n={}){if(t===pR){super(arguments[1],arguments[2]),M.util.markAsUncloneable(this);return}let i="MessageEvent constructor";M.argumentLengthCheck(arguments,1,i),t=M.converters.DOMString(t,i,"type"),n=M.converters.MessageEventInit(n,i,"eventInitDict"),super(t,n),this.#e=n,M.util.markAsUncloneable(this)}get data(){return M.brandCheck(this,e),this.#e.data}get origin(){return M.brandCheck(this,e),this.#e.origin}get lastEventId(){return M.brandCheck(this,e),this.#e.lastEventId}get source(){return M.brandCheck(this,e),this.#e.source}get ports(){return M.brandCheck(this,e),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(t,n=!1,i=!1,r=null,o="",s="",a=null,A=[]){return M.brandCheck(this,e),M.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new e(t,{bubbles:n,cancelable:i,data:r,origin:o,lastEventId:s,source:a,ports:A})}static createFastMessageEvent(t,n){let i=new e(pR,t,n);return i.#e=n,i.#e.data??=null,i.#e.origin??="",i.#e.lastEventId??="",i.#e.source??=null,i.#e.ports??=[],i}},{createFastMessageEvent:sH}=os;delete os.createFastMessageEvent;var il=class e extends Event{#e;constructor(t,n={}){let i="CloseEvent constructor";M.argumentLengthCheck(arguments,1,i),t=M.converters.DOMString(t,i,"type"),n=M.converters.CloseEventInit(n),super(t,n),this.#e=n,M.util.markAsUncloneable(this)}get wasClean(){return M.brandCheck(this,e),this.#e.wasClean}get code(){return M.brandCheck(this,e),this.#e.code}get reason(){return M.brandCheck(this,e),this.#e.reason}},ol=class e extends Event{#e;constructor(t,n){let i="ErrorEvent constructor";M.argumentLengthCheck(arguments,1,i),super(t,n),M.util.markAsUncloneable(this),t=M.converters.DOMString(t,i,"type"),n=M.converters.ErrorEventInit(n??{}),this.#e=n}get message(){return M.brandCheck(this,e),this.#e.message}get filename(){return M.brandCheck(this,e),this.#e.filename}get lineno(){return M.brandCheck(this,e),this.#e.lineno}get colno(){return M.brandCheck(this,e),this.#e.colno}get error(){return M.brandCheck(this,e),this.#e.error}};Object.defineProperties(os.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:It,origin:It,lastEventId:It,source:It,ports:It,initMessageEvent:It});Object.defineProperties(il.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:It,code:It,wasClean:It});Object.defineProperties(ol.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:It,filename:It,lineno:It,colno:It,error:It});M.converters.MessagePort=M.interfaceConverter(oH);M.converters["sequence<MessagePort>"]=M.sequenceConverter(M.converters.MessagePort);var Bm=[{key:"bubbles",converter:M.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:M.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:M.converters.boolean,defaultValue:()=>!1}];M.converters.MessageEventInit=M.dictionaryConverter([...Bm,{key:"data",converter:M.converters.any,defaultValue:()=>null},{key:"origin",converter:M.converters.USVString,defaultValue:()=>""},{key:"lastEventId",converter:M.converters.DOMString,defaultValue:()=>""},{key:"source",converter:M.nullableConverter(M.converters.MessagePort),defaultValue:()=>null},{key:"ports",converter:M.converters["sequence<MessagePort>"],defaultValue:()=>new Array(0)}]);M.converters.CloseEventInit=M.dictionaryConverter([...Bm,{key:"wasClean",converter:M.converters.boolean,defaultValue:()=>!1},{key:"code",converter:M.converters["unsigned short"],defaultValue:()=>0},{key:"reason",converter:M.converters.USVString,defaultValue:()=>""}]);M.converters.ErrorEventInit=M.dictionaryConverter([...Bm,{key:"message",converter:M.converters.DOMString,defaultValue:()=>""},{key:"filename",converter:M.converters.USVString,defaultValue:()=>""},{key:"lineno",converter:M.converters["unsigned long"],defaultValue:()=>0},{key:"colno",converter:M.converters["unsigned long"],defaultValue:()=>0},{key:"error",converter:M.converters.any}]);mR.exports={MessageEvent:os,CloseEvent:il,ErrorEvent:ol,createFastMessageEvent:sH}});var Oi=k((g3,IR)=>{"use strict";var aH="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",AH={enumerable:!0,writable:!1,configurable:!1},cH={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},uH={NOT_SENT:0,PROCESSING:1,SENT:2},lH={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},dH=2**16-1,gH={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},fH=Buffer.allocUnsafe(0),hH={string:1,typedArray:2,arrayBuffer:3,blob:4};IR.exports={uid:aH,sentCloseFrameState:uH,staticPropertyDescriptors:AH,states:cH,opcodes:lH,maxUnsigned16Bit:dH,parserStates:gH,emptyBuffer:fH,sendHints:hH}});var Za=k((f3,ER)=>{"use strict";ER.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var eA=k((h3,SR)=>{"use strict";var{kReadyState:Ka,kController:pH,kResponse:mH,kBinaryType:IH,kWebSocketURL:EH}=Za(),{states:Xa,opcodes:_n}=Oi(),{ErrorEvent:CH,createFastMessageEvent:yH}=ss(),{isUtf8:BH}=require("node:buffer"),{collectASequenceOfCodePointsFast:QH,removeHTTPWhitespace:CR}=ft();function vH(e){return e[Ka]===Xa.CONNECTING}function wH(e){return e[Ka]===Xa.OPEN}function bH(e){return e[Ka]===Xa.CLOSING}function kH(e){return e[Ka]===Xa.CLOSED}function Qm(e,t,n=(r,o)=>new Event(r,o),i={}){let r=n(e,i);t.dispatchEvent(r)}function SH(e,t,n){if(e[Ka]!==Xa.OPEN)return;let i;if(t===_n.TEXT)try{i=kR(n)}catch{BR(e,"Received invalid UTF-8 in text frame.");return}else t===_n.BINARY&&(e[IH]==="blob"?i=new Blob([n]):i=xH(n));Qm("message",e,yH,{origin:e[EH].origin,data:i})}function xH(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function DH(e){if(e.length===0)return!1;for(let t=0;t<e.length;++t){let n=e.charCodeAt(t);if(n<33||n>126||n===34||n===40||n===41||n===44||n===47||n===58||n===59||n===60||n===61||n===62||n===63||n===64||n===91||n===92||n===93||n===123||n===125)return!1}return!0}function RH(e){return e>=1e3&&e<1015?e!==1004&&e!==1005&&e!==1006:e>=3e3&&e<=4999}function BR(e,t){let{[pH]:n,[mH]:i}=e;n.abort(),i?.socket&&!i.socket.destroyed&&i.socket.destroy(),t&&Qm("error",e,(r,o)=>new CH(r,o),{error:new Error(t),message:t})}function QR(e){return e===_n.CLOSE||e===_n.PING||e===_n.PONG}function vR(e){return e===_n.CONTINUATION}function wR(e){return e===_n.TEXT||e===_n.BINARY}function _H(e){return wR(e)||vR(e)||QR(e)}function NH(e){let t={position:0},n=new Map;for(;t.position<e.length;){let i=QH(";",e,t),[r,o=""]=i.split("=");n.set(CR(r,!0,!1),CR(o,!1,!0)),t.position++}return n}function UH(e){if(e.length===0)return!1;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);if(i<48||i>57)return!1}let t=Number.parseInt(e,10);return t>=8&&t<=15}var bR=typeof process.versions.icu=="string",yR=bR?new TextDecoder("utf-8",{fatal:!0}):void 0,kR=bR?yR.decode.bind(yR):function(e){if(BH(e))return e.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};SR.exports={isConnecting:vH,isEstablished:wH,isClosing:bH,isClosed:kH,fireEvent:Qm,isValidSubprotocol:DH,isValidStatusCode:RH,failWebsocketConnection:BR,websocketMessageReceived:SH,utf8Decode:kR,isControlFrame:QR,isContinuationFrame:vR,isTextBinaryFrame:wR,isValidOpcode:_H,parseExtensions:NH,isValidClientWindowBits:UH}});var al=k((p3,xR)=>{"use strict";var{maxUnsigned16Bit:$H}=Oi(),sl=16386,vm,tA=null,as=sl;try{vm=require("node:crypto")}catch{vm={randomFillSync:function(t,n,i){for(let r=0;r<t.length;++r)t[r]=Math.random()*255|0;return t}}}function TH(){return as===sl&&(as=0,vm.randomFillSync(tA??=Buffer.allocUnsafe(sl),0,sl)),[tA[as++],tA[as++],tA[as++],tA[as++]]}var wm=class{constructor(t){this.frameData=t}createFrame(t){let n=this.frameData,i=TH(),r=n?.byteLength??0,o=r,s=6;r>$H?(s+=8,o=127):r>125&&(s+=2,o=126);let a=Buffer.allocUnsafe(r+s);a[0]=a[1]=0,a[0]|=128,a[0]=(a[0]&240)+t;a[s-4]=i[0],a[s-3]=i[1],a[s-2]=i[2],a[s-1]=i[3],a[1]=o,o===126?a.writeUInt16BE(r,2):o===127&&(a[2]=a[3]=0,a.writeUIntBE(r,4,6)),a[1]|=128;for(let A=0;A<r;++A)a[s+A]=n[A]^i[A&3];return a}};xR.exports={WebsocketFrameSend:wm}});var km=k((m3,TR)=>{"use strict";var{uid:FH,states:rA,sentCloseFrameState:Al,emptyBuffer:MH,opcodes:LH}=Oi(),{kReadyState:nA,kSentClose:cl,kByteParser:RR,kReceivedClose:DR,kResponse:_R}=Za(),{fireEvent:PH,failWebsocketConnection:Nn,isClosing:OH,isClosed:zH,isEstablished:GH,parseExtensions:VH}=eA(),{channels:As}=Co(),{CloseEvent:JH}=ss(),{makeRequest:YH}=es(),{fetching:HH}=Ha(),{Headers:jH,getHeadersList:qH}=$i(),{getDecodeSplit:WH}=bt(),{WebsocketFrameSend:ZH}=al(),bm;try{bm=require("node:crypto")}catch{}function KH(e,t,n,i,r,o){let s=e;s.protocol=e.protocol==="ws:"?"http:":"https:";let a=YH({urlList:[s],client:n,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(o.headers){let d=qH(new jH(o.headers));a.headersList=d}let A=bm.randomBytes(16).toString("base64");a.headersList.append("sec-websocket-key",A),a.headersList.append("sec-websocket-version","13");for(let d of t)a.headersList.append("sec-websocket-protocol",d);return a.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits"),HH({request:a,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(d){if(d.type==="error"||d.status!==101){Nn(i,"Received network error or non-101 status code.");return}if(t.length!==0&&!d.headersList.get("Sec-WebSocket-Protocol")){Nn(i,"Server did not respond with sent protocols.");return}if(d.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){Nn(i,'Server did not set Upgrade header to "websocket".');return}if(d.headersList.get("Connection")?.toLowerCase()!=="upgrade"){Nn(i,'Server did not set Connection header to "upgrade".');return}let g=d.headersList.get("Sec-WebSocket-Accept"),f=bm.createHash("sha1").update(A+FH).digest("base64");if(g!==f){Nn(i,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let h=d.headersList.get("Sec-WebSocket-Extensions"),p;if(h!==null&&(p=VH(h),!p.has("permessage-deflate"))){Nn(i,"Sec-WebSocket-Extensions header does not match.");return}let C=d.headersList.get("Sec-WebSocket-Protocol");if(C!==null){let m=WH("sec-websocket-protocol",a.headersList);if(m===null||!m.includes(C)){Nn(i,"Protocol was not set in the opening handshake.");return}}d.socket.on("data",NR),d.socket.on("close",UR),d.socket.on("error",$R),As.open.hasSubscribers&&As.open.publish({address:d.socket.address(),protocol:C,extensions:h}),r(d,p)}})}function XH(e,t,n,i){if(!(OH(e)||zH(e)))if(!GH(e))Nn(e,"Connection was closed before it was established."),e[nA]=rA.CLOSING;else if(e[cl]===Al.NOT_SENT){e[cl]=Al.PROCESSING;let r=new ZH;t!==void 0&&n===void 0?(r.frameData=Buffer.allocUnsafe(2),r.frameData.writeUInt16BE(t,0)):t!==void 0&&n!==void 0?(r.frameData=Buffer.allocUnsafe(2+i),r.frameData.writeUInt16BE(t,0),r.frameData.write(n,2,"utf-8")):r.frameData=MH,e[_R].socket.write(r.createFrame(LH.CLOSE)),e[cl]=Al.SENT,e[nA]=rA.CLOSING}else e[nA]=rA.CLOSING}function NR(e){this.ws[RR].write(e)||this.pause()}function UR(){let{ws:e}=this,{[_R]:t}=e;t.socket.off("data",NR),t.socket.off("close",UR),t.socket.off("error",$R);let n=e[cl]===Al.SENT&&e[DR],i=1005,r="",o=e[RR].closingInfo;o&&!o.error?(i=o.code??1005,r=o.reason):e[DR]||(i=1006),e[nA]=rA.CLOSED,PH("close",e,(s,a)=>new JH(s,a),{wasClean:n,code:i,reason:r}),As.close.hasSubscribers&&As.close.publish({websocket:e,code:i,reason:r})}function $R(e){let{ws:t}=this;t[nA]=rA.CLOSING,As.socketError.hasSubscribers&&As.socketError.publish(e),this.destroy()}TR.exports={establishWebSocketConnection:KH,closeWebSocketConnection:XH}});var MR=k((I3,FR)=>{"use strict";var{createInflateRaw:ej,Z_DEFAULT_WINDOWBITS:tj}=require("node:zlib"),{isValidClientWindowBits:rj}=eA(),{MessageSizeExceededError:nj}=ue(),ij=Buffer.from([0,0,255,255]),ul=Symbol("kBuffer"),iA=Symbol("kLength"),Sm=class{#e;#t={};#r=0;constructor(t,n){this.#t.serverNoContextTakeover=t.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=t.get("server_max_window_bits"),this.#r=n.maxPayloadSize}decompress(t,n,i){if(!this.#e){let r=tj;if(this.#t.serverMaxWindowBits){if(!rj(this.#t.serverMaxWindowBits)){i(new Error("Invalid server_max_window_bits"));return}r=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=ej({windowBits:r})}catch(o){i(o);return}this.#e[ul]=[],this.#e[iA]=0,this.#e.on("data",o=>{if(this.#e[iA]+=o.length,this.#r>0&&this.#e[iA]>this.#r){i(new nj),this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null;return}this.#e[ul].push(o)}),this.#e.on("error",o=>{this.#e=null,i(o)})}this.#e.write(t),n&&this.#e.write(ij),this.#e.flush(()=>{if(!this.#e)return;let r=Buffer.concat(this.#e[ul],this.#e[iA]);this.#e[ul].length=0,this.#e[iA]=0,i(null,r)})}};FR.exports={PerMessageDeflate:Sm}});var HR=k((E3,YR)=>{"use strict";var{Writable:oj}=require("node:stream"),sj=require("node:assert"),{parserStates:Et,opcodes:cs,states:aj,emptyBuffer:LR,sentCloseFrameState:PR}=Oi(),{kReadyState:Aj,kSentClose:OR,kResponse:xm,kReceivedClose:zR}=Za(),{channels:ll}=Co(),{isValidStatusCode:cj,isValidOpcode:uj,failWebsocketConnection:Ut,websocketMessageReceived:GR,utf8Decode:lj,isControlFrame:Dm,isTextBinaryFrame:Rm,isContinuationFrame:dj}=eA(),{WebsocketFrameSend:VR}=al(),{closeWebSocketConnection:JR}=km(),{PerMessageDeflate:gj}=MR(),{MessageSizeExceededError:_m}=ue();function oA(e,t,n){JR(e,t,n,Buffer.byteLength(n)),Ut(e,n)}var Nm=class extends oj{#e=[];#t=0;#r=0;#i=!1;#o=Et.INFO;#n={};#s=[];#a;#c;#A;constructor(t,n,i={}){super(),this.ws=t,this.#a=n??new Map,this.#c=i.maxFragments??0,this.#A=i.maxPayloadSize??0,this.#a.has("permessage-deflate")&&this.#a.set("permessage-deflate",new gj(n,i))}_write(t,n,i){this.#e.push(t),this.#r+=t.length,this.#i=!0,this.run(i)}#u(){return this.#A>0&&!Dm(this.#n.opcode)&&this.#n.payloadLength+this.#t>this.#A?(oA(this.ws,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(t){for(;this.#i;)if(this.#o===Et.INFO){if(this.#r<2)return t();let n=this.consume(2),i=(n[0]&128)!==0,r=n[0]&15,o=(n[1]&128)===128,s=!i&&r!==cs.CONTINUATION,a=n[1]&127,A=n[0]&64,c=n[0]&32,l=n[0]&16;if(!uj(r))return Ut(this.ws,"Invalid opcode received"),t();if(o)return Ut(this.ws,"Frame cannot be masked"),t();if(A!==0&&!this.#a.has("permessage-deflate")){Ut(this.ws,"Expected RSV1 to be clear.");return}if(c!==0||l!==0){Ut(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(s&&!Rm(r)){Ut(this.ws,"Invalid frame type was fragmented.");return}if(Rm(r)&&this.#s.length>0){Ut(this.ws,"Expected continuation frame");return}if(this.#n.fragmented&&s){Ut(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((a>125||s)&&Dm(r)){Ut(this.ws,"Control frame either too large or fragmented");return}if(dj(r)&&this.#s.length===0&&!this.#n.compressed){Ut(this.ws,"Unexpected continuation frame");return}if(a<=125){if(this.#n.payloadLength=a,this.#o=Et.READ_DATA,!this.#u())return}else a===126?this.#o=Et.PAYLOADLENGTH_16:a===127&&(this.#o=Et.PAYLOADLENGTH_64);Rm(r)&&(this.#n.binaryType=r,this.#n.compressed=A!==0),this.#n.opcode=r,this.#n.masked=o,this.#n.fin=i,this.#n.fragmented=s}else if(this.#o===Et.PAYLOADLENGTH_16){if(this.#r<2)return t();let n=this.consume(2);if(this.#n.payloadLength=n.readUInt16BE(0),this.#o=Et.READ_DATA,!this.#u())return}else if(this.#o===Et.PAYLOADLENGTH_64){if(this.#r<8)return t();let n=this.consume(8),i=n.readUInt32BE(0),r=n.readUInt32BE(4);if(i!==0||r>2**31-1){Ut(this.ws,"Received payload length > 2^31 bytes.");return}if(this.#n.payloadLength=r,this.#o=Et.READ_DATA,!this.#u())return}else if(this.#o===Et.READ_DATA){if(this.#r<this.#n.payloadLength)return t();let n=this.consume(this.#n.payloadLength);if(Dm(this.#n.opcode)){this.#i=this.parseControlFrame(n),this.#o=Et.INFO;let i=this.ws[xm].socket;if(this.#i&&i.writableNeedDrain){this.#i=!1,i.once("drain",()=>{this.destroyed||(this.#i=!0,this.run(t))});return}}else if(this.#n.compressed){this.#a.get("permessage-deflate").decompress(n,this.#n.fin,(i,r)=>{if(i){let o=i instanceof _m?1009:1007;oA(this.ws,o,i.message);return}if(this.writeFragments(r)){if(this.#A>0&&this.#t>this.#A){oA(this.ws,1009,new _m().message);return}if(!this.#n.fin){this.#o=Et.INFO,this.#i=!0,this.run(t);return}GR(this.ws,this.#n.binaryType,this.consumeFragments()),this.#i=!0,this.#o=Et.INFO,this.run(t)}}),this.#i=!1;break}else{if(!this.writeFragments(n))return;if(this.#A>0&&this.#t>this.#A){oA(this.ws,1009,new _m().message);return}!this.#n.fragmented&&this.#n.fin&&GR(this.ws,this.#n.binaryType,this.consumeFragments()),this.#o=Et.INFO}}}consume(t){if(t>this.#r)throw new Error("Called consume() before buffers satiated.");if(t===0)return LR;if(this.#e[0].length===t)return this.#r-=this.#e[0].length,this.#e.shift();let n=Buffer.allocUnsafe(t),i=0;for(;i!==t;){let r=this.#e[0],{length:o}=r;if(o+i===t){n.set(this.#e.shift(),i);break}else if(o+i>t){n.set(r.subarray(0,t-i),i),this.#e[0]=r.subarray(t-i);break}else n.set(this.#e.shift(),i),i+=r.length}return this.#r-=t,n}writeFragments(t){return this.#c>0&&this.#s.length===this.#c?(oA(this.ws,1008,"Too many message fragments"),!1):(this.#t+=t.length,this.#s.push(t),!0)}consumeFragments(){let t=this.#s;if(t.length===1)return this.#t=0,t.shift();let n=Buffer.concat(t,this.#t);return this.#s=[],this.#t=0,n}parseCloseBody(t){sj(t.length!==1);let n;if(t.length>=2&&(n=t.readUInt16BE(0)),n!==void 0&&!cj(n))return{code:1002,reason:"Invalid status code",error:!0};let i=t.subarray(2);i[0]===239&&i[1]===187&&i[2]===191&&(i=i.subarray(3));try{i=lj(i)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:n,reason:i,error:!1}}parseControlFrame(t){let{opcode:n,payloadLength:i}=this.#n;if(n===cs.CLOSE){if(i===1)return Ut(this.ws,"Received close frame with a 1-byte body."),!1;if(this.#n.closeInfo=this.parseCloseBody(t),this.#n.closeInfo.error){let{code:r,reason:o}=this.#n.closeInfo;return JR(this.ws,r,o,o.length),Ut(this.ws,o),!1}if(this.ws[OR]!==PR.SENT){let r=LR;this.#n.closeInfo.code&&(r=Buffer.allocUnsafe(2),r.writeUInt16BE(this.#n.closeInfo.code,0));let o=new VR(r);this.ws[xm].socket.write(o.createFrame(cs.CLOSE),s=>{s||(this.ws[OR]=PR.SENT)})}return this.ws[Aj]=aj.CLOSING,this.ws[zR]=!0,!1}else if(n===cs.PING){if(!this.ws[zR]){let r=new VR(t);this.ws[xm].socket.write(r.createFrame(cs.PONG)),ll.ping.hasSubscribers&&ll.ping.publish({payload:t})}}else n===cs.PONG&&ll.pong.hasSubscribers&&ll.pong.publish({payload:t});return!0}get closingInfo(){return this.#n.closeInfo}};YR.exports={ByteParser:Nm}});var KR=k((C3,ZR)=>{"use strict";var{WebsocketFrameSend:fj}=al(),{opcodes:jR,sendHints:us}=Oi(),hj=Mh(),qR=Buffer[Symbol.species],Um=class{#e=new hj;#t=!1;#r;constructor(t){this.#r=t}add(t,n,i){if(i!==us.blob){let o=WR(t,i);if(!this.#t)this.#r.write(o,n);else{let s={promise:null,callback:n,frame:o};this.#e.push(s)}return}let r={promise:t.arrayBuffer().then(o=>{r.promise=null,r.frame=WR(o,i)}),callback:n,frame:null};this.#e.push(r),this.#t||this.#i()}async#i(){this.#t=!0;let t=this.#e;for(;!t.isEmpty();){let n=t.shift();n.promise!==null&&await n.promise,this.#r.write(n.frame,n.callback),n.callback=n.frame=null}this.#t=!1}};function WR(e,t){return new fj(pj(e,t)).createFrame(t===us.string?jR.TEXT:jR.BINARY)}function pj(e,t){switch(t){case us.string:return Buffer.from(e);case us.arrayBuffer:case us.blob:return new qR(e);case us.typedArray:return new qR(e.buffer,e.byteOffset,e.byteLength)}}ZR.exports={SendQueue:Um}});var A0=k((y3,a0)=>{"use strict";var{webidl:q}=Je(),{URLSerializer:mj}=ft(),{environmentSettingsObject:XR}=bt(),{staticPropertyDescriptors:Un,states:sA,sentCloseFrameState:Ij,sendHints:dl}=Oi(),{kWebSocketURL:e0,kReadyState:$m,kController:t0,kBinaryType:gl,kResponse:r0,kSentClose:Ej,kByteParser:Cj}=Za(),{isConnecting:yj,isEstablished:Bj,isClosing:Qj,isValidSubprotocol:vj,fireEvent:n0}=eA(),{establishWebSocketConnection:wj,closeWebSocketConnection:i0}=km(),{ByteParser:bj}=HR(),{kEnumerableProperty:jt,isBlobLike:o0}=ie(),{getGlobalDispatcher:kj}=za(),{types:s0}=require("node:util"),{ErrorEvent:Sj,CloseEvent:xj}=ss(),{SendQueue:Dj}=KR(),$t=class e extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#r="";#i="";#o;constructor(t,n=[]){super(),q.util.markAsUncloneable(this);let i="WebSocket constructor";q.argumentLengthCheck(arguments,1,i);let r=q.converters["DOMString or sequence<DOMString> or WebSocketInit"](n,i,"options");t=q.converters.USVString(t,i,"url"),n=r.protocols;let o=XR.settingsObject.baseUrl,s;try{s=new URL(t,o)}catch(A){throw new DOMException(A,"SyntaxError")}if(s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),s.protocol!=="ws:"&&s.protocol!=="wss:")throw new DOMException(`Expected a ws: or wss: protocol, got ${s.protocol}`,"SyntaxError");if(s.hash||s.href.endsWith("#"))throw new DOMException("Got fragment","SyntaxError");if(typeof n=="string"&&(n=[n]),n.length!==new Set(n.map(A=>A.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(n.length>0&&!n.every(A=>vj(A)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[e0]=new URL(s.href);let a=XR.settingsObject;this[t0]=wj(s,n,a,this,(A,c)=>this.#n(A,c),r),this[$m]=e.CONNECTING,this[Ej]=Ij.NOT_SENT,this[gl]="blob"}close(t=void 0,n=void 0){q.brandCheck(this,e);let i="WebSocket.close";if(t!==void 0&&(t=q.converters["unsigned short"](t,i,"code",{clamp:!0})),n!==void 0&&(n=q.converters.USVString(n,i,"reason")),t!==void 0&&t!==1e3&&(t<3e3||t>4999))throw new DOMException("invalid code","InvalidAccessError");let r=0;if(n!==void 0&&(r=Buffer.byteLength(n),r>123))throw new DOMException(`Reason must be less than 123 bytes; received ${r}`,"SyntaxError");i0(this,t,n,r)}send(t){q.brandCheck(this,e);let n="WebSocket.send";if(q.argumentLengthCheck(arguments,1,n),t=q.converters.WebSocketSendData(t,n,"data"),yj(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!Bj(this)||Qj(this)))if(typeof t=="string"){let i=Buffer.byteLength(t);this.#t+=i,this.#o.add(t,()=>{this.#t-=i},dl.string)}else s0.isArrayBuffer(t)?(this.#t+=t.byteLength,this.#o.add(t,()=>{this.#t-=t.byteLength},dl.arrayBuffer)):ArrayBuffer.isView(t)?(this.#t+=t.byteLength,this.#o.add(t,()=>{this.#t-=t.byteLength},dl.typedArray)):o0(t)&&(this.#t+=t.size,this.#o.add(t,()=>{this.#t-=t.size},dl.blob))}get readyState(){return q.brandCheck(this,e),this[$m]}get bufferedAmount(){return q.brandCheck(this,e),this.#t}get url(){return q.brandCheck(this,e),mj(this[e0])}get extensions(){return q.brandCheck(this,e),this.#i}get protocol(){return q.brandCheck(this,e),this.#r}get onopen(){return q.brandCheck(this,e),this.#e.open}set onopen(t){q.brandCheck(this,e),this.#e.open&&this.removeEventListener("open",this.#e.open),typeof t=="function"?(this.#e.open=t,this.addEventListener("open",t)):this.#e.open=null}get onerror(){return q.brandCheck(this,e),this.#e.error}set onerror(t){q.brandCheck(this,e),this.#e.error&&this.removeEventListener("error",this.#e.error),typeof t=="function"?(this.#e.error=t,this.addEventListener("error",t)):this.#e.error=null}get onclose(){return q.brandCheck(this,e),this.#e.close}set onclose(t){q.brandCheck(this,e),this.#e.close&&this.removeEventListener("close",this.#e.close),typeof t=="function"?(this.#e.close=t,this.addEventListener("close",t)):this.#e.close=null}get onmessage(){return q.brandCheck(this,e),this.#e.message}set onmessage(t){q.brandCheck(this,e),this.#e.message&&this.removeEventListener("message",this.#e.message),typeof t=="function"?(this.#e.message=t,this.addEventListener("message",t)):this.#e.message=null}get binaryType(){return q.brandCheck(this,e),this[gl]}set binaryType(t){q.brandCheck(this,e),t!=="blob"&&t!=="arraybuffer"?this[gl]="blob":this[gl]=t}#n(t,n){this[r0]=t;let i=this[t0]?.dispatcher?.webSocketOptions,r=i?.maxFragments,o=i?.maxPayloadSize,s=new bj(this,n,{maxFragments:r,maxPayloadSize:o});s.on("drain",Rj),s.on("error",_j.bind(this)),t.socket.ws=this,this[Cj]=s,this.#o=new Dj(t.socket),this[$m]=sA.OPEN;let a=t.headersList.get("sec-websocket-extensions");a!==null&&(this.#i=a);let A=t.headersList.get("sec-websocket-protocol");A!==null&&(this.#r=A),n0("open",this)}};$t.CONNECTING=$t.prototype.CONNECTING=sA.CONNECTING;$t.OPEN=$t.prototype.OPEN=sA.OPEN;$t.CLOSING=$t.prototype.CLOSING=sA.CLOSING;$t.CLOSED=$t.prototype.CLOSED=sA.CLOSED;Object.defineProperties($t.prototype,{CONNECTING:Un,OPEN:Un,CLOSING:Un,CLOSED:Un,url:jt,readyState:jt,bufferedAmount:jt,onopen:jt,onerror:jt,onclose:jt,close:jt,onmessage:jt,binaryType:jt,send:jt,extensions:jt,protocol:jt,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties($t,{CONNECTING:Un,OPEN:Un,CLOSING:Un,CLOSED:Un});q.converters["sequence<DOMString>"]=q.sequenceConverter(q.converters.DOMString);q.converters["DOMString or sequence<DOMString>"]=function(e,t,n){return q.util.Type(e)==="Object"&&Symbol.iterator in e?q.converters["sequence<DOMString>"](e):q.converters.DOMString(e,t,n)};q.converters.WebSocketInit=q.dictionaryConverter([{key:"protocols",converter:q.converters["DOMString or sequence<DOMString>"],defaultValue:()=>new Array(0)},{key:"dispatcher",converter:q.converters.any,defaultValue:()=>kj()},{key:"headers",converter:q.nullableConverter(q.converters.HeadersInit)}]);q.converters["DOMString or sequence<DOMString> or WebSocketInit"]=function(e){return q.util.Type(e)==="Object"&&!(Symbol.iterator in e)?q.converters.WebSocketInit(e):{protocols:q.converters["DOMString or sequence<DOMString>"](e)}};q.converters.WebSocketSendData=function(e){if(q.util.Type(e)==="Object"){if(o0(e))return q.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||s0.isArrayBuffer(e))return q.converters.BufferSource(e)}return q.converters.USVString(e)};function Rj(){this.ws[r0].socket.resume()}function _j(e){let t,n;e instanceof xj?(t=e.reason,n=e.code):t=e.message,n0("error",this,()=>new Sj("error",{error:e,message:t})),i0(this,n)}a0.exports={WebSocket:$t}});var Tm=k((B3,c0)=>{"use strict";function Nj(e){return e.indexOf("\0")===-1}function Uj(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)<48||e.charCodeAt(t)>57)return!1;return!0}function $j(e){return new Promise(t=>{setTimeout(t,e).unref()})}c0.exports={isValidLastEventId:Nj,isASCIINumber:Uj,delay:$j}});var l0=k((Q3,u0)=>{"use strict";var Tj=require("node:buffer"),{Transform:Fj}=require("node:stream"),{isASCIINumber:Mj,isValidLastEventId:Lj}=Tm(),ls=[239,187,191],fl=10,aA=13,Pj=58,Oj=32,zj=Tj.kStringMaxLength,Gj=Buffer.from("data"),Vj=Buffer.from("event"),Jj=Buffer.from("id"),Yj=Buffer.from("retry"),Hj=1024,jj=131072,qj=128;function Wj(e,t){if(t>=e.length)return!1;for(let n=t;n<e.length;n++)if(e[n]<48||e[n]>57)return!1;return!0}function Zj(e,t){for(let n=t;n<e.length;n++)if(e[n]===0)return!1;return!0}function hl(e,t,n){if(t!==n.length)return!1;for(let i=0;i<t;i++)if(e[i]!==n[i])return!1;return!0}function pl(){let e=new Error("EventSource message size exceeded");return e.aborted=!1,e}var Fm=class extends Fj{state=null;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;chunks=[];chunkIndex=0;pos=0;lineChunkIndex=0;linePos=0;lineLength=0;eventSize=0;eventFieldSizes={data:0,event:0,id:0,retry:0};dataLineCount=0;maxEventSize;maxDataLines;maxBufferedChunks;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(t={}){t.readableObjectMode=!0,super(t),this.state=t.eventSourceSettings||{},this.maxEventSize=t.maxEventSize??zj;let n=this.maxEventSize>0?Math.min(jj,Math.max(Hj,Math.floor(this.maxEventSize/qj))):0;this.maxDataLines=n,this.maxBufferedChunks=n,t.push&&(this.push=t.push)}_transform(t,n,i){if(t.length===0){i();return}if(this.maxEventSize>0&&this.chunks.length>=this.maxBufferedChunks&&t[0]!==fl&&t[0]!==aA){i(pl());return}if(this.chunks.push(t),this.checkBOM&&this.handleBOM()){i();return}for(;this.hasCurrentByte();){let r=this.currentByte();if(this.eventEndCheck){if(this.crlfCheck){if(r===fl){this.crlfCheck=!1,this.consumeCurrentByte();continue}this.crlfCheck=!1}if(r===fl||r===aA){r===aA&&(this.crlfCheck=!0),this.consumeCurrentByte(),this.hasPendingEvent()&&this.processEvent(this.event),this.clearEvent();continue}this.eventEndCheck=!1;continue}if(r===fl||r===aA){r===aA&&(this.crlfCheck=!0);try{this.parseLine(this.readLine(),this.event)}catch(o){i(o);return}this.consumeCurrentByte(),this.eventEndCheck=!0;continue}if(this.maxEventSize>0&&++this.lineLength>this.maxEventSize+7){i(pl());return}this.advanceCursor()}i()}_destroy(t,n){this.chunks.length=0,this.clearEvent(),super._destroy(t,n)}parseLine(t,n){if(t.length===0)return;let i=t.indexOf(Pj);if(i===0)return;let r=t.length,o=t.length;if(i!==-1&&(r=i,o=i+1,t[o]===Oj&&++o),hl(t,r,Gj)){if(this.maxEventSize>0&&this.dataLineCount>=this.maxDataLines)throw pl();let s=t.length-o,a=this.eventFieldSizes.data+(n.data===void 0?0:1)+s;this.setEventFieldSize("data",a);let A=t.toString("utf8",o);n.data===void 0?n.data=A:n.data+=`
|
|
46
|
-
${A}`,this.dataLineCount++;return}if(hl(t,r,Yj)){Wj(t,o)&&(this.setEventFieldSize("retry",t.length-o),n.retry=t.toString("utf8",o));return}if(hl(t,r,Jj)){Zj(t,o)&&(this.setEventFieldSize("id",t.length-o),n.id=t.toString("utf8",o));return}hl(t,r,Vj)&&o<t.length&&(this.setEventFieldSize("event",t.length-o),n.event=t.toString("utf8",o))}setEventFieldSize(t,n){let i=this.eventSize-this.eventFieldSizes[t]+n;if(this.maxEventSize>0&&i>this.maxEventSize)throw pl();this.eventSize=i,this.eventFieldSizes[t]=n}processEvent(t){t.retry&&Mj(t.retry)&&(this.state.reconnectionTime=parseInt(t.retry,10)),t.id&&Lj(t.id)&&(this.state.lastEventId=t.id),t.data!==void 0&&this.push({type:t.event||"message",options:{data:t.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event.data=void 0,this.event.event=void 0,this.event.id=void 0,this.event.retry=void 0,this.eventSize=0,this.dataLineCount=0,this.eventFieldSizes.data=0,this.eventFieldSizes.event=0,this.eventFieldSizes.id=0,this.eventFieldSizes.retry=0}hasPendingEvent(){return this.event.data!==void 0||this.event.event!==void 0||this.event.id!==void 0||this.event.retry!==void 0}hasCurrentByte(){return this.chunkIndex<this.chunks.length&&this.pos<this.chunks[this.chunkIndex].length}currentByte(){return this.chunks[this.chunkIndex][this.pos]}consumeCurrentByte(){this.advanceCursor(),this.syncLineStartToCursor()}advanceCursor(){for(this.pos++;this.chunkIndex<this.chunks.length&&this.pos>=this.chunks[this.chunkIndex].length;)this.chunkIndex++,this.pos=0}syncLineStartToCursor(){this.lineChunkIndex=this.chunkIndex,this.linePos=this.pos,this.lineLength=0,this.dropConsumedChunks()}dropConsumedChunks(){if(this.lineChunkIndex>0){let t=this.lineChunkIndex;this.chunks.splice(0,t),this.lineChunkIndex=0,this.chunkIndex-=t}this.chunkIndex===this.chunks.length&&(this.chunks.length=0,this.chunkIndex=0,this.pos=0,this.lineChunkIndex=0,this.linePos=0)}readLine(){if(this.lineChunkIndex===this.chunkIndex)return this.chunks[this.chunkIndex].subarray(this.linePos,this.pos);let t=[],n=0;for(let i=this.lineChunkIndex;i<=this.chunkIndex;i++){let r=this.chunks[i],o=i===this.lineChunkIndex?this.linePos:0,s=i===this.chunkIndex?this.pos:r.length,a=r.subarray(o,s);n+=a.length,t.push(a)}return Buffer.concat(t,n)}peekBufferedByte(t){let n=this.lineChunkIndex,i=this.linePos;for(;n<this.chunks.length;){let r=this.chunks[n],o=r.length-i;if(t<o)return r[i+t];t-=o,n++,i=0}}discardLeadingBytes(t){for(;t>0&&this.lineChunkIndex<this.chunks.length;){let i=this.chunks[this.lineChunkIndex].length-this.linePos;t<i?(this.linePos+=t,t=0):(t-=i,this.lineChunkIndex++,this.linePos=0)}this.chunkIndex=this.lineChunkIndex,this.pos=this.linePos,this.dropConsumedChunks()}handleBOM(){let t=this.peekBufferedByte(0),n=this.peekBufferedByte(1),i=this.peekBufferedByte(2);return n===void 0?(t===ls[0]||(this.checkBOM=!1),!0):i===void 0?t===ls[0]&&n===ls[1]?!0:(this.checkBOM=!1,!1):(t===ls[0]&&n===ls[1]&&i===ls[2]&&this.discardLeadingBytes(3),this.checkBOM=!1,!this.hasCurrentByte())}};u0.exports={EventSourceStream:Fm}});var E0=k((v3,I0)=>{"use strict";var{pipeline:Kj}=require("node:stream"),{fetching:Xj}=Ha(),{makeRequest:e4}=es(),{webidl:on}=Je(),{EventSourceStream:t4}=l0(),{parseMIMEType:r4}=ft(),{createFastMessageEvent:n4}=ss(),{isNetworkError:d0}=Ja(),{delay:i4}=Tm(),{kEnumerableProperty:zi}=ie(),{environmentSettingsObject:g0}=bt(),{getGlobalDispatcher:o4}=za(),f0=!1,h0=3e3,AA=0,p0=1,cA=2,s4="anonymous",a4="use-credentials",ds=class e extends EventTarget{#e={open:null,error:null,message:null};#t=null;#r=!1;#i=AA;#o=null;#n=null;#s;#a;constructor(t,n={}){super(),on.util.markAsUncloneable(this);let i="EventSource constructor";on.argumentLengthCheck(arguments,1,i),f0||(f0=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),t=on.converters.USVString(t,i,"url"),n=on.converters.EventSourceInitDict(n,i,"eventSourceInitDict"),this.#s=n.dispatcher,this.#a={lastEventId:"",reconnectionTime:h0};let r=g0,o;try{o=new URL(t,r.settingsObject.baseUrl),this.#a.origin=o.origin}catch(A){throw new DOMException(A,"SyntaxError")}this.#t=o.href;let s=s4;n.withCredentials&&(s=a4,this.#r=!0);let a={redirect:"follow",keepalive:!0,mode:"cors",credentials:s==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};a.client=g0.settingsObject,a.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],a.cache="no-store",a.initiator="other",a.urlList=[new URL(this.#t)],this.#o=e4(a),this.#c()}get readyState(){return this.#i}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#i===cA)return;this.#i=AA;let t={request:this.#o,dispatcher:this.#s},n=i=>{d0(i)&&(this.dispatchEvent(new Event("error")),this.close()),this.#A()};t.processResponseEndOfBody=n,t.processResponse=i=>{if(d0(i))if(i.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#A();return}let r=i.headersList.get("content-type",!0),o=r!==null?r4(r):"failure",s=o!=="failure"&&o.essence==="text/event-stream";if(i.status!==200||s===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#i=p0,this.dispatchEvent(new Event("open")),this.#a.origin=i.urlList[i.urlList.length-1].origin;let a=new t4({eventSourceSettings:this.#a,maxEventSize:this.#s.eventSourceOptions?.maxEventSize,push:A=>{this.dispatchEvent(n4(A.type,A.options))}});Kj(i.body.stream,a,A=>{A?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#n=Xj(t)}async#A(){this.#i!==cA&&(this.#i=AA,this.dispatchEvent(new Event("error")),await i4(this.#a.reconnectionTime),this.#i===AA&&(this.#a.lastEventId.length&&this.#o.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){on.brandCheck(this,e),this.#i!==cA&&(this.#i=cA,this.#n.abort(),this.#o=null)}get onopen(){return this.#e.open}set onopen(t){this.#e.open&&this.removeEventListener("open",this.#e.open),typeof t=="function"?(this.#e.open=t,this.addEventListener("open",t)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(t){this.#e.message&&this.removeEventListener("message",this.#e.message),typeof t=="function"?(this.#e.message=t,this.addEventListener("message",t)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(t){this.#e.error&&this.removeEventListener("error",this.#e.error),typeof t=="function"?(this.#e.error=t,this.addEventListener("error",t)):this.#e.error=null}},m0={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:AA,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:p0,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:cA,writable:!1}};Object.defineProperties(ds,m0);Object.defineProperties(ds.prototype,m0);Object.defineProperties(ds.prototype,{close:zi,onerror:zi,onmessage:zi,onopen:zi,readyState:zi,url:zi,withCredentials:zi});on.converters.EventSourceInitDict=on.dictionaryConverter([{key:"withCredentials",converter:on.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:on.converters.any,defaultValue:()=>o4()}]);I0.exports={EventSource:ds,defaultReconnectionTime:h0}});var Q0=k((w3,H)=>{"use strict";var A4=Po(),C0=ua(),c4=Oo(),u4=Ck(),l4=zo(),d4=ip(),g4=Vk(),f4=Zk(),y0=ue(),Il=ie(),{InvalidArgumentError:ml}=y0,gs=FS(),h4=da(),p4=Lp(),m4=Ex(),I4=zp(),E4=bp(),C4=Eu(),{getGlobalDispatcher:B0,setGlobalDispatcher:y4}=za(),B4=xu(),Q4=Au(),v4=cu();Object.assign(C0.prototype,gs);H.exports.Dispatcher=C0;H.exports.Client=A4;H.exports.Pool=c4;H.exports.BalancedPool=u4;H.exports.Agent=l4;H.exports.ProxyAgent=d4;H.exports.EnvHttpProxyAgent=g4;H.exports.RetryAgent=f4;H.exports.RetryHandler=C4;H.exports.DecoratorHandler=B4;H.exports.RedirectHandler=Q4;H.exports.createRedirectInterceptor=v4;H.exports.interceptors={redirect:bx(),retry:Sx(),dump:Dx(),dns:Nx()};H.exports.buildConnector=h4;H.exports.errors=y0;H.exports.util={parseHeaders:Il.parseHeaders,headerNameToString:Il.headerNameToString};function uA(e){return(t,n,i)=>{if(typeof n=="function"&&(i=n,n=null),!t||typeof t!="string"&&typeof t!="object"&&!(t instanceof URL))throw new ml("invalid url");if(n!=null&&typeof n!="object")throw new ml("invalid opts");if(n&&n.path!=null){if(typeof n.path!="string")throw new ml("invalid opts.path");let s=n.path;n.path.startsWith("/")||(s=`/${s}`),t=new URL(Il.parseOrigin(t).origin+s)}else n||(n=typeof t=="object"?t:{}),t=Il.parseURL(t);let{agent:r,dispatcher:o=B0()}=n;if(r)throw new ml("unsupported opts.agent. Did you mean opts.client?");return e.call(o,{...n,origin:t.origin,path:t.search?`${t.pathname}${t.search}`:t.pathname,method:n.method||(n.body?"PUT":"GET")},i)}}H.exports.setGlobalDispatcher=y4;H.exports.getGlobalDispatcher=B0;var w4=Ha().fetch;H.exports.fetch=async function(t,n=void 0){try{return await w4(t,n)}catch(i){throw i&&typeof i=="object"&&Error.captureStackTrace(i),i}};H.exports.Headers=$i().Headers;H.exports.Response=Ja().Response;H.exports.Request=es().Request;H.exports.FormData=Ea().FormData;H.exports.File=globalThis.File??require("node:buffer").File;H.exports.FileReader=qD().FileReader;var{setGlobalOrigin:b4,getGlobalOrigin:k4}=nh();H.exports.setGlobalOrigin=b4;H.exports.getGlobalOrigin=k4;var{CacheStorage:S4}=iR(),{kConstruct:x4}=Wu();H.exports.caches=new S4(x4);var{deleteCookie:D4,getCookies:R4,getSetCookies:_4,setCookie:N4}=hR();H.exports.deleteCookie=D4;H.exports.getCookies=R4;H.exports.getSetCookies=_4;H.exports.setCookie=N4;var{parseMIMEType:U4,serializeAMimeType:$4}=ft();H.exports.parseMIMEType=U4;H.exports.serializeAMimeType=$4;var{CloseEvent:T4,ErrorEvent:F4,MessageEvent:M4}=ss();H.exports.WebSocket=A0().WebSocket;H.exports.CloseEvent=T4;H.exports.ErrorEvent=F4;H.exports.MessageEvent=M4;H.exports.request=uA(gs.request);H.exports.stream=uA(gs.stream);H.exports.pipeline=uA(gs.pipeline);H.exports.connect=uA(gs.connect);H.exports.upgrade=uA(gs.upgrade);H.exports.MockClient=p4;H.exports.MockPool=I4;H.exports.MockAgent=m4;H.exports.mockErrors=E4;var{EventSource:L4}=E0();H.exports.EventSource=L4});var ln=ut(require("fs")),dc=ut(require("path")),NT=require("crypto");var u={};Ir(u,{BRAND:()=>lF,DIRTY:()=>Xn,EMPTY_PATH:()=>GT,INVALID:()=>V,NEVER:()=>qF,OK:()=>We,ParseStatus:()=>Ge,Schema:()=>ne,ZodAny:()=>hn,ZodArray:()=>Jr,ZodBigInt:()=>ti,ZodBoolean:()=>ri,ZodBranded:()=>na,ZodCatch:()=>gi,ZodDate:()=>ni,ZodDefault:()=>di,ZodDiscriminatedUnion:()=>mc,ZodEffects:()=>Gt,ZodEnum:()=>ui,ZodError:()=>lt,ZodFirstPartyTypeKind:()=>Y,ZodFunction:()=>Ec,ZodIntersection:()=>ai,ZodIssueCode:()=>S,ZodLazy:()=>Ai,ZodLiteral:()=>ci,ZodMap:()=>fo,ZodNaN:()=>po,ZodNativeEnum:()=>li,ZodNever:()=>tr,ZodNull:()=>oi,ZodNullable:()=>yr,ZodNumber:()=>ei,ZodObject:()=>dt,ZodOptional:()=>Ot,ZodParsedType:()=>U,ZodPipeline:()=>ia,ZodPromise:()=>pn,ZodReadonly:()=>fi,ZodRecord:()=>Ic,ZodSchema:()=>ne,ZodSet:()=>ho,ZodString:()=>fn,ZodSymbol:()=>lo,ZodTransformer:()=>Gt,ZodTuple:()=>Cr,ZodType:()=>ne,ZodUndefined:()=>ii,ZodUnion:()=>si,ZodUnknown:()=>Vr,ZodVoid:()=>go,addIssueToContext:()=>_,any:()=>CF,array:()=>vF,bigint:()=>hF,boolean:()=>MQ,coerce:()=>jF,custom:()=>$Q,date:()=>pF,datetimeRegex:()=>NQ,defaultErrorMap:()=>zr,discriminatedUnion:()=>SF,effect:()=>PF,enum:()=>FF,function:()=>UF,getErrorMap:()=>Ao,getParsedType:()=>Er,instanceof:()=>gF,intersection:()=>xF,isAborted:()=>hc,isAsync:()=>co,isDirty:()=>pc,isValid:()=>gn,late:()=>dF,lazy:()=>$F,literal:()=>TF,makeIssue:()=>ra,map:()=>_F,nan:()=>fF,nativeEnum:()=>MF,never:()=>BF,null:()=>EF,nullable:()=>zF,number:()=>FQ,object:()=>wF,objectUtil:()=>Gg,oboolean:()=>HF,onumber:()=>YF,optional:()=>OF,ostring:()=>JF,pipeline:()=>VF,preprocess:()=>GF,promise:()=>LF,quotelessJson:()=>PT,record:()=>RF,set:()=>NF,setErrorMap:()=>zT,strictObject:()=>bF,string:()=>TQ,symbol:()=>mF,transformer:()=>PF,tuple:()=>DF,undefined:()=>IF,union:()=>kF,unknown:()=>yF,util:()=>se,void:()=>QF});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 Gg;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Gg||(Gg={}));var U=se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Er=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"]),PT=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),lt=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,A=0;for(;A<s.path.length;){let c=s.path[A],l=A===s.path.length-1;if(c==="_errors"){l&&a._errors.push(n(s)),A++;continue}Object.prototype.hasOwnProperty.call(a,c)||(c==="__proto__"?Object.defineProperty(a,c,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):a[c]={_errors:[]}),a=a[c],l&&a._errors.push(n(s)),A++}}};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()}};lt.create=e=>new lt(e);var OT=(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}},zr=OT;var SQ=zr;function zT(e){SQ=e}function Ao(){return SQ}var ra=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="",A=i.filter(c=>!!c).slice().reverse();for(let c of A)a=c(s,{data:t,defaultError:a}).message;return{...r,path:o,message:a}},GT=[];function _(e,t){let n=Ao(),i=ra({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===zr?void 0:zr].filter(r=>!!r)});e.common.issues.push(i)}var Ge=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 V;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 V;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}}},V=Object.freeze({status:"aborted"}),Xn=e=>({status:"dirty",value:e}),We=e=>({status:"valid",value:e}),hc=e=>e.status==="aborted",pc=e=>e.status==="dirty",gn=e=>e.status==="valid",co=e=>typeof Promise<"u"&&e instanceof Promise;var $;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})($||($={}));var zt=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}},xQ=(e,t)=>{if(gn(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 lt(e.common.issues);return this._error=n,this._error}}};function K(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:A}=e;return s.code==="invalid_enum_value"?{message:A??a.defaultError}:typeof a.data>"u"?{message:A??i??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:A??n??a.defaultError}},description:r}}var ne=class{get description(){return this._def.description}_getType(t){return Er(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ge,ctx:{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(co(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:Er(t)},r=this._parseSync({data:t,path:i.path,parent:i});return xQ(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return gn(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=>gn(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:Er(t)},r=this._parse({data:t,path:i.path,parent:i}),o=await(co(r)?r:Promise.resolve(r));return xQ(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(A=>A?!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 Gt({schema:this,typeName:Y.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 Ot.create(this,this._def)}nullable(){return yr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Jr.create(this)}promise(){return pn.create(this,this._def)}or(t){return si.create([this,t],this._def)}and(t){return ai.create(this,t,this._def)}transform(t){return new Gt({...K(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new di({...K(this._def),innerType:this,defaultValue:n,typeName:Y.ZodDefault})}brand(){return new na({typeName:Y.ZodBranded,type:this,...K(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new gi({...K(this._def),innerType:this,catchValue:n,typeName:Y.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return ia.create(this,t)}readonly(){return fi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},VT=/^c[^\s-]{8,}$/i,JT=/^[0-9a-z]+$/,YT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,HT=/^[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,jT=/^[a-z0-9_-]{21}$/i,qT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,WT=/^[-+]?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)?)??$/,ZT=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,KT="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",Vg,XT=/^(?:(?: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])$/,eF=/^(?:(?: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])$/,tF=/^(([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]))$/,rF=/^(([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])$/,nF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,RQ="((\\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])))",oF=new RegExp(`^${RQ}$`);function _Q(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 sF(e){return new RegExp(`^${_Q(e)}$`)}function NQ(e){let t=`${RQ}T${_Q(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 aF(e,t){return!!((t==="v4"||!t)&&XT.test(e)||(t==="v6"||!t)&&tF.test(e))}function AF(e,t){if(!qT.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 cF(e,t){return!!((t==="v4"||!t)&&eF.test(e)||(t==="v6"||!t)&&rF.test(e))}var fn=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}),V}let i=new Ge,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")ZT.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")Vg||(Vg=new RegExp(KT,"u")),Vg.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")HT.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")jT.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")VT.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")JT.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")YT.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"?NQ(o).test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?oF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?sF(o).test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?WT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"duration",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?aF(t.data,o.version)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"ip",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?AF(t.data,o.alg)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"jwt",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?cF(t.data,o.version)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"cidr",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?nF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"base64",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?iF.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,...$.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...$.errToObj(t)})}url(t){return this._addCheck({kind:"url",...$.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...$.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...$.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...$.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...$.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...$.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...$.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...$.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...$.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...$.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...$.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...$.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,...$.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,...$.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...$.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...$.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...$.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...$.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...$.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...$.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...$.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...$.errToObj(n)})}nonempty(t){return this.min(1,$.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}};fn.create=e=>new fn({checks:[],typeName:Y.ZodString,coerce:e?.coerce??!1,...K(e)});function uF(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 ei=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}),V}let i,r=new Ge;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"?uF(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,$.toString(n))}gt(t,n){return this.setLimit("min",t,!1,$.toString(n))}lte(t,n){return this.setLimit("max",t,!0,$.toString(n))}lt(t,n){return this.setLimit("max",t,!1,$.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:$.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:$.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:$.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:$.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$.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)}};ei.create=e=>new ei({checks:[],typeName:Y.ZodNumber,coerce:e?.coerce||!1,...K(e)});var ti=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 Ge;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}),V}gte(t,n){return this.setLimit("min",t,!0,$.toString(n))}gt(t,n){return this.setLimit("min",t,!1,$.toString(n))}lte(t,n){return this.setLimit("max",t,!0,$.toString(n))}lt(t,n){return this.setLimit("max",t,!1,$.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:$.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:$.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:$.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}};ti.create=e=>new ti({checks:[],typeName:Y.ZodBigInt,coerce:e?.coerce??!1,...K(e)});var ri=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}),V}return We(t.data)}};ri.create=e=>new ri({typeName:Y.ZodBoolean,coerce:e?.coerce||!1,...K(e)});var ni=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}),V}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_date}),V}let i=new Ge,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:$.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:$.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}};ni.create=e=>new ni({checks:[],coerce:e?.coerce||!1,typeName:Y.ZodDate,...K(e)});var lo=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}),V}return We(t.data)}};lo.create=e=>new lo({typeName:Y.ZodSymbol,...K(e)});var ii=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}),V}return We(t.data)}};ii.create=e=>new ii({typeName:Y.ZodUndefined,...K(e)});var oi=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}),V}return We(t.data)}};oi.create=e=>new oi({typeName:Y.ZodNull,...K(e)});var hn=class extends ne{constructor(){super(...arguments),this._any=!0}_parse(t){return We(t.data)}};hn.create=e=>new hn({typeName:Y.ZodAny,...K(e)});var Vr=class extends ne{constructor(){super(...arguments),this._unknown=!0}_parse(t){return We(t.data)}};Vr.create=e=>new Vr({typeName:Y.ZodUnknown,...K(e)});var tr=class extends ne{_parse(t){let n=this._getOrReturnCtx(t);return _(n,{code:S.invalid_type,expected:U.never,received:n.parsedType}),V}};tr.create=e=>new tr({typeName:Y.ZodNever,...K(e)});var go=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}),V}return We(t.data)}};go.create=e=>new go({typeName:Y.ZodVoid,...K(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}),V;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 zt(n,s,n.path,a)))).then(s=>Ge.mergeArray(i,s));let o=[...n.data].map((s,a)=>r.type._parseSync(new zt(n,s,n.path,a)));return Ge.mergeArray(i,o)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:$.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:$.toString(n)}})}nonempty(t){return this.min(1,t)}};Jr.create=(e,t)=>new Jr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...K(t)});function uo(e){if(e instanceof dt){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=Ot.create(uo(i))}return new dt({...e._def,shape:()=>t})}else return e instanceof Jr?new Jr({...e._def,type:uo(e.element)}):e instanceof Ot?Ot.create(uo(e.unwrap())):e instanceof yr?yr.create(uo(e.unwrap())):e instanceof Cr?Cr.create(e.items.map(t=>uo(t))):e}var dt=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 c=this._getOrReturnCtx(t);return _(c,{code:S.invalid_type,expected:U.object,received:c.parsedType}),V}let{status:i,ctx:r}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof tr&&this._def.unknownKeys==="strip"))for(let c in r.data)s.includes(c)||a.push(c);let A=[];for(let c of s){let l=o[c],d=r.data[c];A.push({key:{status:"valid",value:c},value:l._parse(new zt(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof tr){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)A.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(c==="strict")a.length>0&&(_(r,{code:S.unrecognized_keys,keys:a}),i.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of a){let d=r.data[l];A.push({key:{status:"valid",value:l},value:c._parse(new zt(r,d,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of A){let d=await l.key,g=await l.value;c.push({key:d,value:g,alwaysSet:l.alwaysSet})}return c}).then(c=>Ge.mergeObjectSync(i,c)):Ge.mergeObjectSync(i,A)}get shape(){return this._def.shape()}strict(t){return $.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:$.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:Y.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 uo(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 Ot;)o=o._def.innerType;n[i]=o}return new e({...this._def,shape:()=>n})}keyof(){return UQ(se.objectKeys(this.shape))}};dt.create=(e,t)=>new dt({shape:()=>e,unknownKeys:"strip",catchall:tr.create(),typeName:Y.ZodObject,...K(t)});dt.strictCreate=(e,t)=>new dt({shape:()=>e,unknownKeys:"strict",catchall:tr.create(),typeName:Y.ZodObject,...K(t)});dt.lazycreate=(e,t)=>new dt({shape:e,unknownKeys:"strip",catchall:tr.create(),typeName:Y.ZodObject,...K(t)});var si=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 lt(a.ctx.common.issues));return _(n,{code:S.invalid_union,unionErrors:s}),V}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 A of i){let c={...n,common:{...n.common,issues:[]},parent:null},l=A._parseSync({data:n.data,path:n.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(A=>new lt(A));return _(n,{code:S.invalid_union,unionErrors:a}),V}}get options(){return this._def.options}};si.create=(e,t)=>new si({options:e,typeName:Y.ZodUnion,...K(t)});var Gr=e=>e instanceof Ai?Gr(e.schema):e instanceof Gt?Gr(e.innerType()):e instanceof ci?[e.value]:e instanceof ui?e.options:e instanceof li?se.objectValues(e.enum):e instanceof di?Gr(e._def.innerType):e instanceof ii?[void 0]:e instanceof oi?[null]:e instanceof Ot?[void 0,...Gr(e.unwrap())]:e instanceof yr?[null,...Gr(e.unwrap())]:e instanceof na||e instanceof fi?Gr(e.unwrap()):e instanceof gi?Gr(e._def.innerType):[],mc=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}),V;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]}),V)}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=Gr(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:Y.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...K(i)})}};function Jg(e,t){let n=Er(e),i=Er(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 A=Jg(e[a],t[a]);if(!A.valid)return{valid:!1};s[a]=A.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],A=Jg(s,a);if(!A.valid)return{valid:!1};r.push(A.data)}return{valid:!0,data:r}}else return n===U.date&&i===U.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var ai=class extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=(o,s)=>{if(hc(o)||hc(s))return V;let a=Jg(o.value,s.value);return a.valid?((pc(o)||pc(s))&&n.dirty(),{status:n.value,value:a.data}):(_(i,{code:S.invalid_intersection_types}),V)};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}))}};ai.create=(e,t,n)=>new ai({left:e,right:t,typeName:Y.ZodIntersection,...K(n)});var Cr=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}),V;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"}),V;!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 A=this._def.items[a]||this._def.rest;return A?A._parse(new zt(i,s,i.path,a)):null}).filter(s=>!!s);return i.common.async?Promise.all(o).then(s=>Ge.mergeArray(n,s)):Ge.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Cr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Cr({items:e,typeName:Y.ZodTuple,rest:null,...K(t)})};var Ic=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}),V;let r=[],o=this._def.keyType,s=this._def.valueType;for(let a in i.data)r.push({key:o._parse(new zt(i,a,i.path,a)),value:s._parse(new zt(i,i.data[a],i.path,a)),alwaysSet:a in i.data});return i.common.async?Ge.mergeObjectAsync(n,r):Ge.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:Y.ZodRecord,...K(i)}):new e({keyType:fn.create(),valueType:t,typeName:Y.ZodRecord,...K(n)})}},fo=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}),V;let r=this._def.keyType,o=this._def.valueType,s=[...i.data.entries()].map(([a,A],c)=>({key:r._parse(new zt(i,a,i.path,[c,"key"])),value:o._parse(new zt(i,A,i.path,[c,"value"]))}));if(i.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let A of s){let c=await A.key,l=await A.value;if(c.status==="aborted"||l.status==="aborted")return V;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(c.value,l.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let A of s){let c=A.key,l=A.value;if(c.status==="aborted"||l.status==="aborted")return V;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(c.value,l.value)}return{status:n.value,value:a}}}};fo.create=(e,t,n)=>new fo({valueType:t,keyType:e,typeName:Y.ZodMap,...K(n)});var ho=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}),V;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(A){let c=new Set;for(let l of A){if(l.status==="aborted")return V;l.status==="dirty"&&n.dirty(),c.add(l.value)}return{status:n.value,value:c}}let a=[...i.data.values()].map((A,c)=>o._parse(new zt(i,A,i.path,c)));return i.common.async?Promise.all(a).then(A=>s(A)):s(a)}min(t,n){return new e({...this._def,minSize:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:$.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};ho.create=(e,t)=>new ho({valueType:e,minSize:null,maxSize:null,typeName:Y.ZodSet,...K(t)});var Ec=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}),V;function i(a,A){return ra({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ao(),zr].filter(c=>!!c),issueData:{code:S.invalid_arguments,argumentsError:A}})}function r(a,A){return ra({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ao(),zr].filter(c=>!!c),issueData:{code:S.invalid_return_type,returnTypeError:A}})}let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof pn){let a=this;return We(async function(...A){let c=new lt([]),l=await a._def.args.parseAsync(A,o).catch(f=>{throw c.addIssue(i(A,f)),c}),d=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(d,o).catch(f=>{throw c.addIssue(r(d,f)),c})})}else{let a=this;return We(function(...A){let c=a._def.args.safeParse(A,o);if(!c.success)throw new lt([i(A,c.error)]);let l=Reflect.apply(s,this,c.data),d=a._def.returns.safeParse(l,o);if(!d.success)throw new lt([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:Cr.create(t).rest(Vr.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||Cr.create([]).rest(Vr.create()),returns:n||Vr.create(),typeName:Y.ZodFunction,...K(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:Y.ZodLazy,...K(t)});var ci=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}),V}return{status:"valid",value:t.data}}get value(){return this._def.value}};ci.create=(e,t)=>new ci({value:e,typeName:Y.ZodLiteral,...K(t)});function UQ(e,t){return new ui({values:e,typeName:Y.ZodEnum,...K(t)})}var ui=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}),V}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}),V}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})}};ui.create=UQ;var li=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}),V}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}),V}return We(t.data)}get enum(){return this._def.values}};li.create=(e,t)=>new li({values:e,typeName:Y.ZodNativeEnum,...K(t)});var pn=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}),V;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})))}};pn.create=(e,t)=>new pn({type:e,typeName:Y.ZodPromise,...K(t)});var Gt=class extends ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.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 V;let A=await this._def.schema._parseAsync({data:a,path:i.path,parent:i});return A.status==="aborted"?V:A.status==="dirty"?Xn(A.value):n.value==="dirty"?Xn(A.value):A});{if(n.value==="aborted")return V;let a=this._def.schema._parseSync({data:s,path:i.path,parent:i});return a.status==="aborted"?V:a.status==="dirty"?Xn(a.value):n.value==="dirty"?Xn(a.value):a}}if(r.type==="refinement"){let s=a=>{let A=r.refinement(a,o);if(i.common.async)return Promise.resolve(A);if(A 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"?V:(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"?V:(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(!gn(s))return V;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=>gn(s)?Promise.resolve(r.transform(s.value,o)).then(a=>({status:n.value,value:a})):V);se.assertNever(r)}};Gt.create=(e,t,n)=>new Gt({schema:e,typeName:Y.ZodEffects,effect:t,...K(n)});Gt.createWithPreprocess=(e,t,n)=>new Gt({schema:t,effect:{type:"preprocess",transform:e},typeName:Y.ZodEffects,...K(n)});var Ot=class extends ne{_parse(t){return this._getType(t)===U.undefined?We(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ot.create=(e,t)=>new Ot({innerType:e,typeName:Y.ZodOptional,...K(t)});var yr=class extends ne{_parse(t){return this._getType(t)===U.null?We(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};yr.create=(e,t)=>new yr({innerType:e,typeName:Y.ZodNullable,...K(t)});var di=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}};di.create=(e,t)=>new di({innerType:e,typeName:Y.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...K(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 co(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new lt(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new lt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};gi.create=(e,t)=>new gi({innerType:e,typeName:Y.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...K(t)});var po=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}),V}return{status:"valid",value:t.data}}};po.create=e=>new po({typeName:Y.ZodNaN,...K(e)});var lF=Symbol("zod_brand"),na=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}},ia=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"?V:o.status==="dirty"?(n.dirty(),Xn(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"?V: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:Y.ZodPipeline})}},fi=class extends ne{_parse(t){let n=this._def.innerType._parse(t),i=r=>(gn(r)&&(r.value=Object.freeze(r.value)),r);return co(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};fi.create=(e,t)=>new fi({innerType:e,typeName:Y.ZodReadonly,...K(t)});function DQ(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function $Q(e,t={},n){return e?hn.create().superRefine((i,r)=>{let o=e(i);if(o instanceof Promise)return o.then(s=>{if(!s){let a=DQ(t,i),A=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:A})}});if(!o){let s=DQ(t,i),a=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:a})}}):hn.create()}var dF={object:dt.lazycreate},Y;(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"})(Y||(Y={}));var gF=(e,t={message:`Input not instance of ${e.name}`})=>$Q(n=>n instanceof e,t),TQ=fn.create,FQ=ei.create,fF=po.create,hF=ti.create,MQ=ri.create,pF=ni.create,mF=lo.create,IF=ii.create,EF=oi.create,CF=hn.create,yF=Vr.create,BF=tr.create,QF=go.create,vF=Jr.create,wF=dt.create,bF=dt.strictCreate,kF=si.create,SF=mc.create,xF=ai.create,DF=Cr.create,RF=Ic.create,_F=fo.create,NF=ho.create,UF=Ec.create,$F=Ai.create,TF=ci.create,FF=ui.create,MF=li.create,LF=pn.create,PF=Gt.create,OF=Ot.create,zF=yr.create,GF=Gt.createWithPreprocess,VF=ia.create,JF=()=>TQ().optional(),YF=()=>FQ().optional(),HF=()=>MQ().optional(),jF={string:(e=>fn.create({...e,coerce:!0})),number:(e=>ei.create({...e,coerce:!0})),boolean:(e=>ri.create({...e,coerce:!0})),bigint:(e=>ti.create({...e,coerce:!0})),date:(e=>ni.create({...e,coerce:!0}))};var qF=V;var Yg=(r=>(r.ModelProvider="model_provider",r.SutAccess="sut_access",r.Skyramp="skyramp",r.Other="other",r))(Yg||{}),Hg=(i=>(i.Ready="ready",i.Blocked="blocked",i.NeedsInputs="needs_inputs",i))(Hg||{});var jg=300,xe=u.string().trim().min(1),WF=u.object({action:u.enum(["start","run","wait"]),text:xe,source:u.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:xe.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"}),qg=/^[A-Za-z_][A-Za-z0-9_]*$/,Br=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,oa=(s=>(s.VersionEndpoint="version_endpoint",s.DeployWorkflow="deploy_workflow",s.KubernetesLabels="kubernetes_labels",s.Command="command",s.Api="api",s.NotTracked="not_tracked",s))(oa||{}),Yr="shared",ZF=xe.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"),mo=u.object({address:ZF,readyWhen:xe.nullable(),credentials:u.array(u.string().regex(Br)).max(50),revisionSources:u.array(u.object({method:u.nativeEnum(oa),detail:xe.describe("what Testbot reads, such as GET /version or the deploy workflow's name; for not_tracked, why nothing shows it"),components:u.array(xe).min(1).describe("the components it tells the revision of, by name")}).strict()).max(50)}).strict(),Wg={steps:u.array(WF).max(20).optional().describe("how it starts, in order"),kind:u.enum(["web_app","service","database","external_service"]).optional(),from:u.object({file:xe,service:xe.nullable()}).strict().optional(),credentials:u.array(u.string().max(100).regex(qg)).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")},KF=u.object({name:xe,repository:xe.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(),...Wg,deployed:xe.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')}),XF=u.object({name:u.string().regex(Br).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:xe.max(jg).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')}),eM=u.object({component:xe,problem:xe,evidence:xe.describe("the exact command and output that shows it"),fix:xe.describe("what the user must provide, and where")}),tM=u.object({framework:xe,file:xe.describe("the test file run, relative to its repository root"),result:u.enum(["pass","fail","error"])}),rM=u.object({input:xe.describe("the part of the user's SUT input, as given"),reason:xe}),aX=u.object({schemaVersion:u.literal(1),status:u.nativeEnum(Hg).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(KF),suites:u.array(tM).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:u.array(xe).default([]).describe("the parts of the user's SUT input the recipe used as given"),inputsUsedHow:u.array(u.object({input:xe.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:xe.describe("what the recipe did with it")})).optional(),inputsNotUsed:u.array(rM).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(eM).describe("required (non-empty) when status is blocked"),inputs:u.array(XF).max(50).optional().describe("required (non-empty) when status is needs_inputs, else left out: each credential the candidate recipe needs a value for"),environment:mo.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, proxy or client certificate)")});var Zg=64*1024,Kg=512*1024,LQ=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var dX=new TextDecoder("utf-8",{fatal:!0});var sa=(o=>(o.NotFound="not_found",o.NoAccess="no_access",o.Unavailable="unavailable",o.AccessLost="access_lost",o.CannotOpen="cannot_open",o))(sa||{});var PQ=e=>`${e.source}:${e.site??""}:${e.key}`;var Cc=/^pasted-[0-9a-f]{16}$/,yc=/^file-[0-9a-f]{16}$/,Bc=(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))(Bc||{});var Xg=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(Xg||{}),ef=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(ef||{}),tf=(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))(tf||{}),aa=(o=>(o.CiCheck="ci_check",o.TestReport="test_report",o.StaticAnalysis="static_analysis",o.CodeReview="code_review",o.Other="other",o))(aa||{}),rf=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(rf||{}),nf=(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))(nf||{});var of=(n=>(n.Probe="probe",n.Agent="agent",n))(of||{}),sf=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(sf||{}),af=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(af||{});var OQ=(n=>(n.Skyramp="skyramp",n.Llm="llm",n))(OQ||{}),Qr=u.string().trim().min(1),nM=u.object({case:Qr.describe("recommend id this assertion enforces"),evidence:Qr.describe("the exact assertion line from the file that checks that case's observable")}),Af=u.object({kind:u.nativeEnum(sf).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:Qr.describe("the dependency, endpoint or data it affects"),mechanism:u.nativeEnum(af).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:Qr.describe("what it sets up"),worker:Qr.optional().describe("skyramp_mocker: host:port of the worker the test applies the mock to (default localhost:35142)"),cleanup:Qr.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:Qr.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"]}),iM=u.object({file:Qr.describe("staged path under .skyramp/staged/"),source:u.nativeEnum(OQ),language:Qr,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(nM).min(1,"must be a non-empty array").describe("one per case covered, citing the real line"),context:u.array(Af).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")}),mX=u.object({schemaVersion:u.literal(1),tests:u.array(iM),deferredUi:u.array(u.string()).describe("recommend ui ids left for the UI stage (generate) \u2014 [] for generate-ui"),summary:Qr.describe("one paragraph")});var zQ=(s=>(s.Place="place",s.Update="update",s.Regenerate="regenerate",s.Delete="delete",s.Verify="verify",s.None="none",s))(zQ||{}),GQ=(i=>(i.Pass="pass",i.Fail="fail",i.Skip="skip",i))(GQ||{}),gt=u.string().trim().min(1),VQ=(r=>(r.Setup="setup",r.Expectation="expectation",r.Locator="locator",r.Other="other",r))(VQ||{}),oM=u.object({kind:u.nativeEnum(VQ),reason:gt.describe("what in the test is wrong, with the evidence: the setup error it raised, or the requirement or changed line its expectation contradicts")}),cf=u.array(u.string().url().max(2048).regex(/^https?:\/\//i)).max(50),sM=u.object({case:gt.describe("a covers id \u2014 the recommend case this test realizes"),status:u.nativeEnum(GQ),runtimeTargets:cf.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"),fromJourney:u.boolean().optional(),testProblem:oM.optional().describe("[derived] write's reading of a failing case: the test, not the app, is at fault")}),aM=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(sM).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")}),AM=u.object({context:u.array(Af).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:gt.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:gt.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),action:u.nativeEnum(zQ),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:gt.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:gt.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:aM,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(gt).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:[]}),JQ=(n=>(n.Junit="junit",n.Converter="converter",n))(JQ||{}),cM=gt.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),uM=u.object({results:gt.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:u.nativeEnum(JQ),run:gt.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:u.array(gt).min(1).describe("the items[].file paths this run covered"),cases:u.array(u.object({test:gt.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:gt.describe("the covers id it realizes"),file:cM})).describe("map each reported test name to the case it covers")}),lM=u.object({suites:u.array(uM).min(1)}),yX=u.object({schemaVersion:u.literal(1),items:u.array(AM),runnerResults:lM.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:gt.describe("one paragraph")});var El=ut(KQ(),1),P4=ut(Q0(),1);var $r;(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"})($r||($r={}));var v0;(function(e){e.Accept="accept",e.ContentType="content-type"})(v0||(v0={}));var w0;(function(e){e.ApplicationJson="application/json"})(w0||(w0={}));var k3=[$r.MovedPermanently,$r.ResourceMoved,$r.SeeOther,$r.TemporaryRedirect,$r.PermanentRedirect],S3=[$r.BadGateway,$r.ServiceUnavailable,$r.GatewayTimeout];var k0=require("os"),lA=require("fs"),Mm=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{c(i.next(l))}catch(d){s(d)}}function A(l){try{c(i.throw(l))}catch(d){s(d)}}function c(l){l.done?o(l.value):r(l.value).then(a,A)}c((i=i.apply(e,t||[])).next())})},{access:z4,appendFile:G4,writeFile:V4}=lA.promises,b0="GITHUB_STEP_SUMMARY";var Lm=class{constructor(){this._buffer=""}filePath(){return Mm(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let t=process.env[b0];if(!t)throw new Error(`Unable to find environment variable for $${b0}. Check if your runtime environment supports job summaries.`);try{yield z4(t,lA.constants.R_OK|lA.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 Mm(this,void 0,void 0,function*(){let n=!!t?.overwrite,i=yield this.filePath();return yield(n?V4:G4)(i,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return Mm(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(k0.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:A,colspan:c,rowspan:l}=s,d=a?"th":"td",g=Object.assign(Object.assign({},c&&{colspan:c}),l&&{rowspan:l});return this.wrap(d,A,g)}).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()}},M3=new Lm;var Pm=ut(require("os"),1);var Cl=ut(require("fs"),1);var{chmod:J4,copyFile:Y4,lstat:H4,mkdir:j4,open:O3,readdir:q4,rename:W4,rm:Z4,rmdir:z3,stat:K4,symlink:X4,unlink:eq}=Cl.promises,tq=process.platform==="win32";var G3=Cl.constants.O_RDONLY;var j3=process.platform==="win32";var K3=Pm.default.platform(),X3=Pm.default.arch();var D0;(function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure"})(D0||(D0={}));function _0(e){return e.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}var N0=ut(require("path"));var Om=(r=>(r.Clean="clean",r.RecipeDrift="recipe-drift",r.ChangeBrokeBringup="change-broke-bringup",r.BringupFailed="bringup-failed",r))(Om||{}),lr=u.string().trim().min(1),aq=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:lr.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),Aq=u.array(u.object({component:lr.describe("a shared component listed above"),url:lr.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:lr.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"),cq=u.object({name:lr.describe("the credential's environment variable name, as listed above; never its value"),component:lr.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:lr.describe("the request or command you tested it with and what came back, never the value")}),w7=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:aq.optional(),teardown:lr.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(Om).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:lr,output:lr}).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:lr.describe("ISO timestamp"),revisions:Aq.optional(),missingSecrets:u.array(u.string().regex(qg)).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(cq).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 Ye=u.string().trim().min(1),yl=Ye,zm=(n=>(n.TestbotManaged="testbot_managed",n.CustomerDeployed="customer_deployed",n))(zm||{}),Gm=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],U0=u.object({schemaVersion:u.literal(1),type:u.nativeEnum(zm).optional(),repository:yl.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:mo.optional(),components:u.array(u.object({name:Ye,repository:Ye.describe(`owner/repo, or "${Yr}" for a customer-deployed component no repository builds`),healthy:u.boolean(),url:u.string().min(1).nullable(),...Wg,credentials:u.array(u.string().regex(Br)).max(50).optional(),deployed:Ye.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:Ye,file:Ye,result:u.enum(["pass","fail","error"])}).strict()),inputsUsed:u.array(Ye),inputsUsedHow:u.array(u.object({input:Ye,how:Ye}).strict()).optional(),inputsNotUsed:u.array(u.object({input:Ye,reason:Ye}).strict()),blockers:u.array(u.object({component:Ye,problem:Ye,evidence:Ye,fix:Ye}).strict()),replay:u.object({outcome:Ye,durationSeconds:u.number().nonnegative().nullable()}).strict().nullable(),files:u.array(u.object({path:Ye,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===Yr&&!n&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"repository"],message:`only a customer_deployed component is ${Yr}`})}),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)=>{Gm.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!==Yr&&!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 R7=["clean","recipe-drift"];function Bl(e){let t=N0.posix.normalize(e);return t===e&&(t===".skyramp/workspace.yml"||t.startsWith(".skyramp/sut/")&&t.length>13)}var dA=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(dA||{}),Hm=(o=>(o.Trigger="TRIGGER",o.Baseline="BASELINE",o.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",o.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",o.ManualOverride="MANUAL_OVERRIDE",o))(Hm||{}),j0=(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))(j0||{}),dq=["sut_setup"],gq=["sut_setup","schedule","revision_read"];var q0=(t=>(t.PullRequest="pull_request",t))(q0||{}),W0=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))(W0||{}),$0=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var Z0=(o=>(o.ReportUploaded="report_uploaded",o.NoReport="no_report",o.Cancelled="cancelled",o.RecipeUploaded="recipe_uploaded",o.RevisionsUploaded="revisions_uploaded",o))(Z0||{}),K0=(n=>(n.Running="running",n.Ended="ended",n))(K0||{}),X0=(d=>(d.TimedOut="timed_out",d.AgentFailed="agent_failed",d.SetupFailed="setup_failed",d.CredentialMissing="credential_missing",d.RunnerLost="runner_lost",d.CheckoutFailed="checkout_failed",d.EnvironmentUnverified="environment_unverified",d.ModelProviderDenied="model_provider_denied",d.ModelProviderUnavailable="model_provider_unavailable",d.RunnerProviderNotReady="runner_provider_not_ready",d.MergeConflict="merge_conflict",d))(X0||{}),e_=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(e_||{}),jm=(n=>(n.Started="started",n.Finished="finished",n))(jm||{}),t_=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(t_||{});var r_=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(r_||{});var n_=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(n_||{}),qm=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(qm||{}),Jm=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(Jm||{});var Wm=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(Wm||{}),qt=u.string().regex(/^[1-9][0-9]{0,18}$/),Wt=u.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),Ym=u.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),i_=/^[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(i_),it=u.string().regex(/^[0-9a-f]{64}$/),wl=u.object({id:Xe,revision:qt}).strict(),kl={provider:u.literal("github"),providerAccountId:qt,providerRepositoryId:qt},Sl={provider:u.literal("azure-devops"),providerAccountId:Xe,providerRepositoryId:Xe},dr=u.discriminatedUnion("provider",[u.object(kl).strict(),u.object(Sl).strict()]),P7=u.discriminatedUnion("provider",[u.object(kl).passthrough(),u.object(Sl).passthrough()]),bl=e=>`${e.provider}:${e.providerRepositoryId}`,T0={namespace:u.string().min(1),name:u.string().min(1)},o_=u.discriminatedUnion("provider",[u.object({...kl,...T0}).strict(),u.object({...Sl,...T0}).strict()]),F0=u.object({ref:u.string().min(1),revision:Wt}).strict(),fq=u.object({kind:u.nativeEnum(W0),number:qt.optional(),ref:u.string().min(1),revision:Wt,reason:u.nativeEnum(Hm)}).strict(),hq=u.object({repository:o_,revision:Wt,ref:u.string().nullable(),reason:u.nativeEnum(Hm),change:u.object({kind:u.nativeEnum(q0),number:qt,base:F0.optional()}).strict().nullable(),compareWith:F0.optional(),merge:u.array(fq).min(2).optional()}).strict();function pq(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(!$0.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=$0.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 mq(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(c=>c!=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(c=>bl(c.repository))),a=new Set(r.map(c=>bl(c.repository)));return a.size===r.length&&a.size===s.size&&[...a].every(c=>s.has(c))?null:"names every source of the snapshot, once"}var s_=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,a_=/^[1-9][0-9]{0,18}$/,M0=new RegExp(`${s_.source}|${a_.source}`),L0=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,Iq=u.union([u.object({source:u.literal("jira"),site:u.string().regex(L0),key:u.string().regex(s_),updated:u.string().datetime(),contentHash:it}).strict(),u.object({source:u.literal("confluence"),site:u.string().regex(L0),key:u.string().regex(a_),version:u.number().int().positive(),contentHash:it}).strict(),u.object({source:u.literal("other"),key:u.string().regex(Cc),contentHash:it}).strict(),u.object({source:u.literal("other"),key:u.string().regex(yc),contentHash:it,fileName:u.string().min(1).max(255),mediaType:u.nativeEnum(Bc)}).strict()]),P0=u.union([u.literal("jira"),u.literal("confluence")]),O7=u.object({schemaVersion:u.literal(1),items:u.array(u.union([u.object({source:P0,site:u.string(),key:u.string().regex(M0),state:u.literal("read"),text:u.string(),version:u.string().min(1),contentMatches:u.boolean()}).strict(),u.object({source:P0,site:u.string(),key:u.string().regex(M0),state:u.literal("not_read"),reason:u.nativeEnum(sa)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(Cc),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(Cc),state:u.literal("not_read"),reason:u.nativeEnum(sa)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(yc),state:u.literal("read"),version:it,fileName:u.string().min(1).max(255),mediaType:u.nativeEnum(Bc)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(yc),state:u.literal("not_read"),reason:u.nativeEnum(sa)}).strict()])),instructions:u.array(u.string()).optional()}).strict(),Eq=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(),Cq=u.object({schemaVersion:u.literal(1),runId:Xe,skyrampOrgId:Xe,target:wl,policy:wl.nullable(),trigger:u.object({kind:u.nativeEnum(j0),requestedAt:u.string().datetime()}).strict(),configuration:u.object({captureId:Xe,revision:qt.nullable(),hash:it}).strict(),baseline:u.object({confirmedRunId:Xe.nullable(),initialBaselineId:Xe.optional(),comparisonBaselineId:Xe.optional(),knownFailures:u.array(Eq).optional(),sources:u.array(u.object({repository:dr,revision:Wt}).strict()).optional()}).strict().optional(),sources:u.array(hq).min(1).max(1e3),execution:u.object({provider:u.nativeEnum(dA),repository:o_,workflowPath:u.string(),ref:u.string()}).strict(),credentials:u.array(u.object({name:u.string(),purpose:u.nativeEnum(Yg),required:u.boolean()}).strict()),requirements:u.array(Iq).min(1).optional(),instructions:u.object({contentHash:it}).strict().optional(),deployedRevisions:u.array(u.object({repository:dr,revision:Wt}).strict()).min(1).optional()}).strict().superRefine((e,t)=>{let n=new Set;(e.requirements??[]).forEach((A,c)=>{let l="fileName"in A?"file":"pasted";A.source==="other"&&A.key!==`${l}-${A.contentHash.slice(0,16)}`&&t.addIssue({code:u.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",c,"key"]});let d=PQ({source:A.source,key:A.key});n.has(d)&&t.addIssue({code:u.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",c,"key"]}),n.add(d)});let i=e.trigger.kind,r=dq.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=mq(e);o&&t.addIssue({code:u.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:o}),gq.includes(i)&&e.sources.forEach((A,c)=>{A.reason!=="BASELINE"&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c,"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(A=>bl(A.repository))),a=new Set;(e.deployedRevisions??[]).forEach((A,c)=>{let l=bl(A.repository);s.has(l)?a.has(l)&&t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions",c,"repository"],message:"repository appears twice"}):t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions",c,"repository"],message:"names a repository outside the snapshot"}),a.add(l)}),e.sources.forEach((A,c)=>{A.compareWith&&(A.reason!=="MANUAL_OVERRIDE"||A.change)&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"}),e.baseline?.comparisonBaselineId&&(A.change?.base||A.compareWith||A.merge)&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c],message:"a chosen checkpoint cannot be combined with a source comparison base or merge"});let l=pq(A);l&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c,...l.path],message:l.message})})});var A_=(n=>(n.Person="person",n.Policy="policy",n))(A_||{}),yq=u.object({kind:u.nativeEnum(A_),name:u.string().min(1).max(256)}).strict(),Bq=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(),z7=u.object({schemaVersion:u.literal(1),attempt:u.object({id:Xe,number:u.number().int().positive(),deadlineAt:u.string().datetime()}).strict(),manifest:Cq,manifestHash:it,entitlements:u.array(u.string()).optional(),runToken:u.string().min(1).optional(),requestedBy:yq.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:dr,revision:Wt}).strict()).optional(),statedRevisions:u.array(u.object({repository:dr,revision:Wt}).strict()).optional(),runSettings:Bq.optional()}).strict(),O0={providerRunAttempt:u.number().int().positive(),workflowRef:u.string().min(1)},Qq=u.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),G7=u.object({schemaVersion:u.literal(1),runId:Xe,execution:u.discriminatedUnion("provider",[u.object({...O0,provider:u.literal("github"),repository:u.object(kl).strict(),providerRunId:qt}).strict(),u.object({...O0,provider:u.literal("azure-devops"),repository:u.object(Sl).strict(),providerRunId:Qq}).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()}).strict(),z0=u.object({repository:dr,number:qt,commitSha:Wt.optional()}).strict(),Ql=u.array(u.object({repository:dr,reason:u.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),vq=u.object({branch:Ym.optional(),commitSha:Wt.optional()}).strict(),G0=u.object({repository:dr,message:u.string(),...vq.shape}).strict(),wq=u.discriminatedUnion("status",[u.object({status:u.literal("none"),noTests:Ql}).strict(),u.object({status:u.literal("delivered"),noTests:Ql,pullRequests:u.array(z0).min(1)}).strict(),u.object({status:u.literal("partial"),noTests:Ql,pullRequests:u.array(z0).min(1),failures:u.array(G0).min(1)}).strict(),u.object({status:u.literal("failed"),message:u.string(),noTests:Ql,failures:u.array(G0).min(1).optional()}).strict()]),V7=1024*1024,J7=16*1024*1024,vl=e=>u.array(u.object({[e]:u.string()}).strict()).optional(),bq=u.object({language:u.custom(e=>e==="ja","Invalid"),businessCaseAnalysis:u.string(),validation:u.object({rationale:u.string(),gaps:u.array(u.string())}).strict().optional(),changes:u.array(u.object({id:u.string(),text:u.string()}).strict()).optional(),issuesFound:vl("description"),newTestsCreated:vl("description"),testResults:vl("details"),caveats:vl("text")}).strict(),kq=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(ef),rationale:u.string().min(1),gaps:u.array(u.string().min(1)),acceptedEvidence:u.array(u.object({kind:u.nativeEnum(aa),repository:u.string().min(1),revision:Wt,reference:u.string().min(1),summary:u.string().min(1)}).strict()),actionRequired:u.array(u.nativeEnum(tf))}).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"})}),Vm=500,Sq=2048,xq=1e3,Dq=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,V0=e=>e.length>0&&e.length<=64&&e===e.trim()&&!Dq.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),c_=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)&&V0(n)&&V0(i)},Rq=u.object({testResults:u.array(u.object({resultId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:u.string().refine(c_,"Invalid"),testType:u.string(),runtimeTargets:cf.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(rf),family:u.nativeEnum(nf).optional()}).strict().optional(),origin:u.nativeEnum(Xg).optional()}).strict()),validation:kq,changes:u.array(u.object({id:u.string().min(1).max(512),text:u.string().max(16384),source:u.string().max(Sq),testedBy:u.array(u.string().min(1).max(1024)).max(Vm),writtenBy:u.array(u.string().min(1).max(1024)).max(Vm),maintainedBy:u.array(u.string().min(1).max(1024)).max(Vm)}).strict()).max(xq).optional(),traceVersion:u.literal(1),display:bq.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 A=["testResults",s,"resultId"],c=o.resultId.slice(`${o.repository}:${o.testType}:`.length);(!o.resultId.startsWith(`${o.repository}:${o.testType}:`)||c===""||c.startsWith("/")||c.startsWith("#"))&&t.addIssue({code:u.ZodIssueCode.custom,path:A,message:"is not repository:testType:path for this result"}),r.has(o.resultId)&&t.addIssue({code:u.ZodIssueCode.custom,path:A,message:"stable identity repeated"}),r.add(o.resultId)})});var _q=50,Nq=u.discriminatedUnion("kind",[u.object({kind:u.literal("branch_pushed"),repository:dr,branch:Ym,commit:Wt}).strict(),u.object({kind:u.enum(["pull_request_opened","pull_request_edited"]),repository:dr,number:qt,branch:Ym}).strict()]),Uq=u.object({schemaVersion:u.literal(1),run:u.object({runId:Xe,attemptNumber:u.number().int().positive(),manifestHash:it}).strict(),target:wl,policy:wl,provenance:u.object({sources:u.array(u.object({repository:dr,revision:Wt}).strict()),firstQualification:u.literal(!0).optional()}).strict(),delivery:u.object({generatedTests:wq}).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:Rq,githubWrites:u.array(Nq).max(_q).optional()}).strict(),u_=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))(u_||{}),$q=200,Tq=u.object({cause:u.nativeEnum(u_),credential:u.string().regex(Br).optional(),reason:u.string().trim().min(1).max($q).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"}),Fq=u.object({name:u.string().regex(Br),purpose:u.enum(["sut_access","other"]),required:u.boolean(),how:u.string().trim().min(1).max(jg)}).strict(),Y7=Uq.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:U0,check:Tq.optional(),inputs:u.array(Fq).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)=>{Bl(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),LQ.test(o.content)&&n(["files",s,"content"],"is not text");let a=Buffer.byteLength(o.content,"utf8");r+=a,a>Zg&&n(["files",s,"content"],`larger than ${Zg} bytes`)}),r>Kg&&n(["files"],`recipe text over ${Kg} bytes in total`)}),H7=u.object({components:u.array(u.object({name:u.string().min(1),repository:u.string().refine(c_,"Invalid"),observedRevision:u.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:u.nativeEnum(of),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 j7=u.object({schemaVersion:u.literal(1),stage:u.nativeEnum(e_),event:u.nativeEnum(jm),status:u.nativeEnum(t_).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),xl=100,Mq=5e3,Gi=2e3,J0=100,l_=/^[A-Za-z0-9_-]{1,64}$/,Lq=20,Pq=200,Oq=100,zq=100,Gq=200,Y0="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",Vq=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${Y0}/${Y0})$`),Jq=500,Yq=50,Hq=10,jq=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,d_=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,Tt=e=>u.string().max(e).refine(t=>t.trim().length>0&&!d_.test(t),"blank, or not text"),Tr={sequence:u.number().int().min(1).max(Mq),at:u.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},g_=u.object({...Tr,kind:u.literal("reply"),to:u.string().uuid(),outcome:u.nativeEnum(n_),accepted:u.boolean(),text:Tt(Gi),note:u.object({source:u.enum(["target","environment"]),quote:Tt(Gi)}).strict().optional(),kept:Tt(Gi).optional()}).strict();function f_(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 qq=u.discriminatedUnion("kind",[u.object({...Tr,kind:u.literal("log"),phase:u.nativeEnum(qm),text:Tt(Gi)}).strict(),u.object({...Tr,kind:u.literal("component"),name:Tt(J0),repository:Tt(Gq).refine(e=>Vq.test(e)||e===Yr,"not owner/name"),file:Tt(Jq).nullable(),status:u.nativeEnum(Wm),version:Tt(zq).optional()}).strict(),g_,u.object({...Tr,kind:u.literal("question"),id:u.string().regex(l_),type:u.nativeEnum(r_),text:Tt(Gi),component:Tt(J0).nullable(),choices:u.array(Tt(Pq)).max(Lq),placeholder:Tt(Oq).optional()}).strict(),u.object({...Tr,kind:u.literal("delivered"),ids:u.array(u.string().uuid()).max(xl)}).strict(),u.object({...Tr,kind:u.literal("credentials"),names:u.array(u.string().regex(Br)).min(1).max(Yq),logins:u.array(u.object({key:u.string().regex(jq),usernameVariable:u.string().regex(Br),passwordVariable:u.string().regex(Br)}).strict()).min(1).max(Hq).optional()}).strict()]).superRefine((e,t)=>{if(f_(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=>_0(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==="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"}))}),q7=u.object({schemaVersion:u.literal(1),events:u.array(qq).max(xl)}).strict(),Wq=u.discriminatedUnion("kind",[u.object({...Tr,kind:u.literal("log"),stage:u.nativeEnum(Jm),text:Tt(Gi)}).strict(),g_,u.object({...Tr,kind:u.literal("delivered"),ids:u.array(u.string().uuid()).max(xl)}).strict(),u.object({...Tr,kind:u.literal("stage"),stage:u.nativeEnum(Jm),event:u.nativeEnum(jm)}).strict(),u.object({...Tr,kind:u.literal("test"),resultId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/),status:u.enum(["Pass","Fail","Skipped"]),details:u.string().max(Gi).refine(e=>!d_.test(e),"not text")}).strict()]).superRefine(f_),W7=u.object({schemaVersion:u.literal(1),events:u.array(Wq).max(xl)}).strict(),H0={id:u.string().uuid(),text:u.string(),by:u.string().nullable(),at:u.string(),replied:u.literal(!0).optional()},h_=u.discriminatedUnion("kind",[u.object({...H0,kind:u.literal("instruction"),question:u.null()}),u.object({...H0,kind:u.literal("answer"),question:u.string().regex(l_)})]),p_=u.string().regex(/^[A-Za-z0-9+/]{43}=$/),Zq=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()}),Z7=u.object({schemaVersion:u.literal(1),leftOut:u.array(u.string()),messages:u.array(h_).optional(),stop:u.object({key:p_}).optional(),notes:Zq.optional()}),K7=u.object({schemaVersion:u.literal(1),messages:u.array(h_).optional()});var Kq=500*1024*1024,m_=u.object({id:qt,name:u.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:qt,expiresAt:u.string().datetime()}).strict(),X7=u.object({schemaVersion:u.literal(1),artifact:m_,sessionId:Xe,contentHash:it,bytes:u.number().int().min(1).max(Kq)}).strict(),eee=u.object({schemaVersion:u.literal(1),checkpoint:u.object({artifact:m_,repository:u.object({namespace:u.string().min(1),name:u.string().min(1)}).strict(),sessionId:Xe,contentHash:it,key:p_}).strict().nullable()}).strict(),Xq=200,fs=100,I_=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(I_||{}),eW=u.object({kind:u.nativeEnum(I_),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(Wm)}).strict()).max(fs),credentials:u.array(u.string().min(1)).max(fs),answers:u.array(u.object({question:u.string(),answer:u.string().nullable()}).strict()).max(fs),instructions:u.array(u.object({text:u.string(),reply:u.string().nullable()}).strict()).max(fs),log:u.array(u.object({phase:u.nativeEnum(qm),text:u.string()}).strict()).max(Xq),recipe:u.object({files:u.array(u.object({path:u.string().min(1),content:u.string()}).strict()).max(fs),blockers:u.array(u.object({component:u.string(),problem:u.string(),evidence:u.string(),fix:u.string()}).strict()).max(fs)}).strict().optional()}).strict(),tee=u.object({schemaVersion:u.literal(1),context:eW.nullable()}).strict(),ree=u.object({schemaVersion:u.literal(1),configuration:u.object({captureId:Xe,revision:qt.nullable(),hash:it}).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()}).passthrough().optional()}).passthrough(),provenance:u.object({}).passthrough(),hash:it}).strict()}).strict(),tW=mo.extend({version:u.number().int().positive(),components:u.array(u.object({name:u.string().min(1),repository:u.string().min(1)}).strict()),contentHash:it.optional(),files:u.array(u.object({path:u.string().refine(e=>Bl(e)&&!Gm.includes(e),"not a file of a customer_deployed plan"),content:u.string()}).strict()).optional()}).strict(),nee=u.object({schemaVersion:u.literal(1),testEnvironment:tW.nullable().optional(),runtimePlan:u.object({version:u.number().int().positive(),contentHash:it,files:u.array(u.object({path:u.string().refine(Bl,"not a recipe file path"),content:u.string()}).strict()).min(1),repository:yl.optional(),recipeRepository:yl.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"]}),iee=u.object({schemaVersion:u.literal(1),state:u.nativeEnum(K0),ending:u.nativeEnum(Z0).nullable(),cause:u.nativeEnum(X0).nullable(),deadlineAt:u.string().datetime()}).strict();var rW=50,oee=u.object({repository:dr,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(rW)}).strict();var iW=".skyramp/sut/deployed-revisions.sh",E_=(n=>(n.Running="running",n.Requested="requested",n))(E_||{});var fee=new Set(Object.values(E_));var hee=`Fix ${iW} so it prints the full commit each component runs, then set it up again.`;var qn=ut(require("fs")),jn=ut(require("http")),l8=ut(require("https")),Mg=ut(require("dns")),xT=require("module"),Le=ut(require("net"));var Lg=ut(require("path")),Pg=require("stream"),DT=require("stream/promises"),RT=require("timers/promises"),Wn=ut(require("tls"));var ee={};Ir(ee,{$brand:()=>uI,$input:()=>TC,$output:()=>$C,INVALID:()=>at,NEVER:()=>cI,TimePrecision:()=>jC,ZodAny:()=>$B,ZodArray:()=>LB,ZodBase64:()=>wg,ZodBase64URL:()=>bg,ZodBigInt:()=>Ks,ZodBigIntFormat:()=>xg,ZodBoolean:()=>Zs,ZodCIDRv4:()=>Qg,ZodCIDRv6:()=>vg,ZodCUID:()=>pg,ZodCUID2:()=>mg,ZodCatch:()=>sQ,ZodCodec:()=>ac,ZodCompileAsyncError:()=>fr,ZodCompileUnsupportedError:()=>oe,ZodCreditCard:()=>kB,ZodCustom:()=>Ac,ZodCustomStringFormat:()=>so,ZodDate:()=>tc,ZodDefault:()=>eQ,ZodDiscriminatedUnion:()=>OB,ZodE164:()=>kg,ZodEmail:()=>dg,ZodEmoji:()=>fg,ZodEnum:()=>js,ZodError:()=>vK,ZodExactOptional:()=>Ng,ZodFile:()=>WB,ZodFirstPartyTypeKind:()=>CQ,ZodFunction:()=>pQ,ZodGUID:()=>gg,ZodIBAN:()=>SB,ZodIPv4:()=>yg,ZodIPv6:()=>Bg,ZodISODate:()=>Jn,ZodISODateTime:()=>Vn,ZodISODuration:()=>Hn,ZodISOTime:()=>Yn,ZodInstanceOf:()=>EQ,ZodIntersection:()=>zB,ZodIssueCode:()=>kK,ZodJWT:()=>Sg,ZodKSUID:()=>Cg,ZodLazy:()=>gQ,ZodLiteral:()=>qB,ZodMAC:()=>bB,ZodMap:()=>HB,ZodNaN:()=>AQ,ZodNanoID:()=>hg,ZodNever:()=>FB,ZodNonOptional:()=>Ug,ZodNull:()=>NB,ZodNullable:()=>XB,ZodNumber:()=>Ws,ZodNumberFormat:()=>ao,ZodObject:()=>nc,ZodOptional:()=>oc,ZodPipe:()=>sc,ZodPrefault:()=>rQ,ZodPreprocess:()=>cQ,ZodPromise:()=>hQ,ZodReadonly:()=>uQ,ZodRealError:()=>vt,ZodRecord:()=>Hs,ZodSet:()=>jB,ZodString:()=>qs,ZodStringFormat:()=>me,ZodSuccess:()=>oQ,ZodSymbol:()=>RB,ZodTemplateLiteral:()=>dQ,ZodTransform:()=>ZB,ZodTuple:()=>VB,ZodType:()=>X,ZodULID:()=>Ig,ZodURL:()=>ec,ZodUUID:()=>Pr,ZodUndefined:()=>_B,ZodUnion:()=>ic,ZodUnknown:()=>TB,ZodVoid:()=>MB,ZodXID:()=>Eg,ZodXor:()=>PB,_ZodString:()=>lg,_default:()=>tQ,_function:()=>tT,any:()=>_$,array:()=>rc,base64:()=>d$,base64url:()=>g$,bigint:()=>k$,boolean:()=>DB,catch:()=>aQ,check:()=>rT,cidrv4:()=>u$,cidrv6:()=>l$,clone:()=>ge,codec:()=>Z$,coerce:()=>BQ,compile:()=>PC,config:()=>Re,core:()=>un,creditCard:()=>h$,cuid:()=>r$,cuid2:()=>n$,currencyCode:()=>y$,custom:()=>nT,date:()=>U$,decode:()=>EB,decodeAsync:()=>yB,deepPartial:()=>pT,describe:()=>iT,discriminatedUnion:()=>P$,e164:()=>f$,email:()=>YU,emoji:()=>e$,encode:()=>IB,encodeAsync:()=>CB,endsWith:()=>Ts,enum:()=>Rg,exactOptional:()=>KB,file:()=>H$,flattenError:()=>QA,float32:()=>Q$,float64:()=>v$,formatError:()=>vA,fromJSONSchema:()=>fT,function:()=>tT,getDiscriminatedOption:()=>cC,getErrorMap:()=>xK,globalRegistry:()=>je,gt:()=>Mr,gte:()=>Mt,guid:()=>HU,hash:()=>B$,hex:()=>C$,hostname:()=>E$,httpUrl:()=>XU,iban:()=>p$,includes:()=>Us,input:()=>IT,instanceof:()=>sT,int:()=>cg,int32:()=>w$,int64:()=>S$,intersection:()=>GB,invertCodec:()=>K$,ipv4:()=>a$,ipv6:()=>c$,iso:()=>cc,json:()=>AT,jwt:()=>m$,keyof:()=>$$,ksuid:()=>s$,lazy:()=>fQ,length:()=>to,literal:()=>Y$,locales:()=>VA,looseObject:()=>M$,looseRecord:()=>z$,lowercase:()=>_s,lt:()=>Fr,lte:()=>Ft,mac:()=>A$,map:()=>G$,maxLength:()=>eo,maxSize:()=>Pn,memoizer:()=>zA,meta:()=>oT,mime:()=>Ms,minLength:()=>cn,minSize:()=>Lr,multipleOf:()=>Ln,nan:()=>W$,nanoid:()=>t$,nativeEnum:()=>J$,negative:()=>Kd,never:()=>Dg,nonnegative:()=>eg,nonoptional:()=>iQ,nonpositive:()=>Xd,normalize:()=>Ls,null:()=>UB,nullable:()=>XA,nullish:()=>j$,number:()=>xB,object:()=>T$,optional:()=>io,output:()=>ET,overwrite:()=>hr,parse:()=>fB,parseAsync:()=>hB,partialRecord:()=>O$,pipe:()=>ug,positive:()=>Zd,prefault:()=>nQ,preprocess:()=>cT,prettifyError:()=>hI,promise:()=>eT,properties:()=>Fs,property:()=>tg,readonly:()=>lQ,record:()=>YB,refine:()=>mQ,regex:()=>Rs,regexes:()=>Xt,registry:()=>bd,safeDecode:()=>QB,safeDecodeAsync:()=>wB,safeEncode:()=>BB,safeEncodeAsync:()=>vB,safeParse:()=>pB,safeParseAsync:()=>mB,set:()=>V$,setErrorMap:()=>SK,size:()=>Xi,slugify:()=>Gs,startsWith:()=>$s,strictObject:()=>F$,string:()=>KA,stringFormat:()=>I$,stringbool:()=>aT,success:()=>q$,superRefine:()=>IQ,symbol:()=>D$,templateLiteral:()=>X$,toJSONSchema:()=>og,toLowerCase:()=>Os,toUpperCase:()=>zs,toZod:()=>gA,transform:()=>_g,treeifyError:()=>fI,trim:()=>Ps,tuple:()=>JB,uint32:()=>b$,uint64:()=>x$,ulid:()=>i$,undefined:()=>R$,union:()=>Xs,unknown:()=>no,uppercase:()=>Ns,url:()=>KU,util:()=>B,uuid:()=>jU,uuidv4:()=>qU,uuidv6:()=>WU,uuidv7:()=>ZU,validate:()=>wA,validateAsync:()=>bA,void:()=>N$,withParser:()=>kd,xid:()=>o$,xor:()=>L$});var un={};Ir(un,{$ZodAny:()=>eC,$ZodArray:()=>sC,$ZodAsyncError:()=>Bt,$ZodBase64:()=>zE,$ZodBase64URL:()=>GE,$ZodBigInt:()=>dd,$ZodBigIntFormat:()=>WE,$ZodBoolean:()=>TA,$ZodCIDRv4:()=>PE,$ZodCIDRv6:()=>OE,$ZodCUID:()=>SE,$ZodCUID2:()=>xE,$ZodCatch:()=>wC,$ZodCheck:()=>Ce,$ZodCheckBigIntFormat:()=>tE,$ZodCheckEndsWith:()=>gE,$ZodCheckGreaterThan:()=>Wl,$ZodCheckIncludes:()=>lE,$ZodCheckLengthEquals:()=>aE,$ZodCheckLessThan:()=>ql,$ZodCheckLowerCase:()=>cE,$ZodCheckMaxLength:()=>oE,$ZodCheckMaxSize:()=>rE,$ZodCheckMimeType:()=>pE,$ZodCheckMinLength:()=>sE,$ZodCheckMinSize:()=>nE,$ZodCheckMultipleOf:()=>XI,$ZodCheckNumberFormat:()=>eE,$ZodCheckOverwrite:()=>mE,$ZodCheckProperties:()=>hE,$ZodCheckProperty:()=>fE,$ZodCheckRegex:()=>AE,$ZodCheckSizeEquals:()=>iE,$ZodCheckStartsWith:()=>dE,$ZodCheckStringFormat:()=>bs,$ZodCheckUpperCase:()=>uE,$ZodCodec:()=>MA,$ZodCreditCard:()=>JE,$ZodCustom:()=>_C,$ZodCustomStringFormat:()=>jE,$ZodCyclicError:()=>Ed,$ZodDate:()=>iC,$ZodDefault:()=>yC,$ZodDiscriminatedUnion:()=>uC,$ZodE164:()=>VE,$ZodEmail:()=>BE,$ZodEmoji:()=>bE,$ZodEncodeError:()=>Fn,$ZodEnum:()=>hC,$ZodError:()=>gI,$ZodExactOptional:()=>EC,$ZodFile:()=>mC,$ZodFunction:()=>DC,$ZodGUID:()=>CE,$ZodIBAN:()=>YE,$ZodIPv4:()=>FE,$ZodIPv6:()=>ME,$ZodISODate:()=>UE,$ZodISODateTime:()=>NE,$ZodISODuration:()=>TE,$ZodISOTime:()=>$E,$ZodIntersection:()=>lC,$ZodJWT:()=>HE,$ZodKSUID:()=>_E,$ZodLazy:()=>LA,$ZodLiteral:()=>pC,$ZodMAC:()=>LE,$ZodMap:()=>gC,$ZodNaN:()=>bC,$ZodNanoID:()=>kE,$ZodNever:()=>rC,$ZodNonOptional:()=>QC,$ZodNull:()=>XE,$ZodNullable:()=>CC,$ZodNumber:()=>ld,$ZodNumberFormat:()=>qE,$ZodObject:()=>rN,$ZodObjectJIT:()=>aC,$ZodOptional:()=>fd,$ZodPipe:()=>hd,$ZodPrefault:()=>BC,$ZodPreprocess:()=>kC,$ZodPromise:()=>RC,$ZodReadonly:()=>SC,$ZodRealError:()=>Qt,$ZodRecord:()=>dC,$ZodRegistry:()=>wd,$ZodSet:()=>fC,$ZodString:()=>qi,$ZodStringFormat:()=>fe,$ZodSuccess:()=>vC,$ZodSymbol:()=>ZE,$ZodTemplateLiteral:()=>xC,$ZodTransform:()=>IC,$ZodTuple:()=>gd,$ZodType:()=>W,$ZodULID:()=>DE,$ZodURL:()=>wE,$ZodUUID:()=>yE,$ZodUndefined:()=>KE,$ZodUnion:()=>FA,$ZodUnknown:()=>tC,$ZodVoid:()=>nC,$ZodXID:()=>RE,$ZodXor:()=>AC,$brand:()=>uI,$constructor:()=>I,$input:()=>TC,$output:()=>$C,Doc:()=>ji,INVALID:()=>at,JSONSchema:()=>GU,JSONSchemaGenerator:()=>sg,NEVER:()=>cI,TimePrecision:()=>jC,URL_BAD_FORMAT:()=>QE,URL_UNPARSEABLE:()=>RA,ZodCompileAsyncError:()=>fr,ZodCompileUnsupportedError:()=>oe,_any:()=>ly,_array:()=>Iy,_base64:()=>Hd,_base64url:()=>jd,_bigint:()=>iy,_boolean:()=>ry,_catch:()=>dK,_check:()=>kU,_cidrv4:()=>Jd,_cidrv6:()=>Yd,_coercedBigint:()=>oy,_coercedBoolean:()=>ny,_coercedDate:()=>py,_coercedNumber:()=>WC,_coercedString:()=>VC,_creditCard:()=>YC,_cuid:()=>Md,_cuid2:()=>Ld,_custom:()=>Cy,_date:()=>hy,_decode:()=>Ml,_decodeAsync:()=>Pl,_default:()=>cK,_discriminatedUnion:()=>Z9,_e164:()=>qd,_email:()=>Dd,_emoji:()=>Td,_encode:()=>Fl,_encodeAsync:()=>Ll,_endsWith:()=>Ts,_enum:()=>nK,_file:()=>Ey,_float32:()=>KC,_float64:()=>XC,_gt:()=>Mr,_gte:()=>Mt,_guid:()=>Rd,_iban:()=>HC,_includes:()=>Us,_int:()=>ZC,_int32:()=>ey,_int64:()=>sy,_intersection:()=>K9,_ipv4:()=>Gd,_ipv6:()=>Vd,_isoDate:()=>HA,_isoDateTime:()=>YA,_isoDuration:()=>qA,_isoTime:()=>jA,_jwt:()=>Wd,_ksuid:()=>zd,_lazy:()=>pK,_length:()=>to,_literal:()=>oK,_lowercase:()=>_s,_lt:()=>Fr,_lte:()=>Ft,_mac:()=>JC,_map:()=>tK,_max:()=>Ft,_maxLength:()=>eo,_maxSize:()=>Pn,_mime:()=>Ms,_min:()=>Mt,_minLength:()=>cn,_minSize:()=>Lr,_multipleOf:()=>Ln,_nan:()=>my,_nanoid:()=>Fd,_nativeEnum:()=>iK,_negative:()=>Kd,_never:()=>gy,_nonnegative:()=>eg,_nonoptional:()=>uK,_nonpositive:()=>Xd,_normalize:()=>Ls,_null:()=>uy,_nullable:()=>AK,_number:()=>qC,_optional:()=>aK,_overwrite:()=>hr,_parse:()=>Bs,_parseAsync:()=>Qs,_pipe:()=>gK,_positive:()=>Zd,_promise:()=>mK,_properties:()=>Fs,_property:()=>tg,_readonly:()=>fK,_record:()=>eK,_refine:()=>yy,_regex:()=>Rs,_safeDecode:()=>zl,_safeDecodeAsync:()=>Vl,_safeEncode:()=>Ol,_safeEncodeAsync:()=>Gl,_safeParse:()=>vs,_safeParseAsync:()=>ws,_set:()=>rK,_size:()=>Xi,_slugify:()=>Gs,_startsWith:()=>$s,_string:()=>GC,_stringFormat:()=>ro,_stringbool:()=>wy,_success:()=>lK,_superRefine:()=>By,_symbol:()=>Ay,_templateLiteral:()=>hK,_toLowerCase:()=>Os,_toUpperCase:()=>zs,_transform:()=>sK,_trim:()=>Ps,_tuple:()=>X9,_uint32:()=>ty,_uint64:()=>ay,_ulid:()=>Pd,_undefined:()=>cy,_union:()=>q9,_unknown:()=>dy,_uppercase:()=>Ns,_url:()=>JA,_uuid:()=>_d,_uuidv4:()=>Nd,_uuidv6:()=>Ud,_uuidv7:()=>$d,_void:()=>fy,_xid:()=>Od,_xor:()=>W9,base64Charset:()=>sd,base64urlCharset:()=>$A,canParseURL:()=>vE,clone:()=>ge,compile:()=>PC,compileFn:()=>Sd,config:()=>Re,createStandardJSONSchemaMethod:()=>Vs,createToJSONSchemaMethod:()=>ky,decode:()=>WW,decodeAsync:()=>KW,describe:()=>Qy,encode:()=>qW,encodeAsync:()=>ZW,extractDefs:()=>zn,finalize:()=>Gn,flattenError:()=>QA,formatError:()=>vA,getDiscriminatedOption:()=>cC,globalConfig:()=>ze,globalRegistry:()=>je,handleUnrepresentable:()=>Fe,initializeContext:()=>On,isBackEdge:()=>yd,isRecursiveSchema:()=>Cd,isValidBase64:()=>UA,isValidBase64URL:()=>ad,isValidCIDRv6:()=>od,isValidCreditCard:()=>Ad,isValidIBAN:()=>cd,isValidIPv6:()=>NA,isValidJWT:()=>ud,locales:()=>VA,memoizer:()=>zA,mergeValues:()=>ks,meta:()=>vy,parse:()=>$l,parseAsync:()=>Tl,parseURLObject:()=>X_,prettifyError:()=>hI,process:()=>he,processSchema:()=>he,regexes:()=>Xt,registry:()=>bd,safeDecode:()=>eZ,safeDecodeAsync:()=>rZ,safeEncode:()=>XW,safeEncodeAsync:()=>tZ,safeParse:()=>VW,safeParseAsync:()=>JW,standardProps:()=>td,stripTabAndNewline:()=>_A,toDotPath:()=>__,toJSONSchema:()=>og,toZod:()=>gA,treeifyError:()=>fI,urlHostnameOk:()=>nd,urlProtocolOk:()=>id,util:()=>B,validate:()=>wA,validateAsync:()=>bA,validateURL:()=>rd,version:()=>IE,withParser:()=>kd});var B={};Ir(B,{BIGINT_FORMAT_RANGES:()=>IA,CONSTANT_CATCH:()=>Nl,Class:()=>Xm,NUMBER_FORMAT_RANGES:()=>mA,aborted:()=>st,allowsEval:()=>rI,assert:()=>uW,assertEqual:()=>sW,assertIs:()=>AW,assertNever:()=>cW,assertNotEqual:()=>aW,assignProp:()=>He,attachSchema:()=>EA,base64ToUint8Array:()=>b_,base64urlToUint8Array:()=>xW,cached:()=>Is,captureStackTrace:()=>Rl,cleanEnum:()=>SW,cleanRegex:()=>an,clone:()=>ge,cloneDef:()=>gW,codePointLength:()=>Yi,constantCatch:()=>aI,createTransparentProxy:()=>EW,defineLazy:()=>eI,defineLazyInternal:()=>re,derived:()=>NW,esc:()=>ot,escapeRegex:()=>Kt,explicitlyAborted:()=>oI,extend:()=>BW,finalizeIssue:()=>yt,floatSafeRemainder:()=>fA,getElementAtPath:()=>fW,getEnumValues:()=>ps,getLengthableOrigin:()=>yA,getParsedType:()=>IW,getSizableOrigin:()=>CA,hexToUint8Array:()=>RW,hide:()=>BA,installLazyProp:()=>FW,isObject:()=>Ji,isPlainObject:()=>Zt,issue:()=>ys,joinValues:()=>E,jsonStringifyReplacer:()=>ms,members:()=>sI,merge:()=>vW,mergeDefs:()=>gr,normalizeParams:()=>x,nullish:()=>Dl,numKeys:()=>mW,objectClone:()=>lW,omit:()=>yW,optionalKeys:()=>iI,own:()=>Tn,parsedType:()=>v,partial:()=>wW,pick:()=>CW,prefixIssues:()=>Ct,primitiveTypes:()=>nI,promiseAllObject:()=>hW,propertyKeyTypes:()=>pA,randomString:()=>pW,rawShape:()=>Es,required:()=>bW,safeExtend:()=>QW,shallowClone:()=>hA,sizeCaps:()=>Cs,slugify:()=>tI,stringifyPrimitive:()=>Q,toZod:()=>gA,uint8ArrayToBase64:()=>k_,uint8ArrayToBase64url:()=>DW,uint8ArrayToHex:()=>_W,unwrapMessage:()=>hs});function sW(e){return e}function aW(e){return e}function gA(){return e=>e}function AW(e){}function cW(e){throw new Error("Unexpected value in exhaustive check")}function uW(e){}function ps(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 E(e,t="|"){return e.map(n=>Q(n)).join(t)}function ms(e,t){return typeof t=="bigint"?t.toString():t}var Km=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 Is(e){return new Km(e)}function Dl(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 fA(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 B_=Symbol("evaluating");function eI(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==B_)return i===void 0&&(i=B_,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function lW(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function He(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Es(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function sn(e){return Es(e._zod.def)??e._zod.def.shape}function Q_(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return He(this,t,i),i},enumerable:!0,configurable:!0})}function v_(e,t,n){t in e?He(e,t,n):e[t]=n}function Vi(e,t,n,i){let r=sn(t);for(let o of n){let s=Object.getOwnPropertyDescriptor(r,o);s.enumerable&&(s.get?Q_(e,o,()=>{let a=t._zod.def.shape[o];return i?i(a,o):a}):v_(e,o,i?i(s.value,o):s.value))}}function dW(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?Q_(e,n,()=>t[n]):v_(e,n,i.value))}}function gr(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function gW(e){return gr(e._zod.def)}function fW(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function hW(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 pW(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function ot(e){return JSON.stringify(e)}function tI(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Rl="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ji(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var rI=Is(()=>{if(ze.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Zt(e){if(Ji(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Ji(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function hA(e){return Zt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function mW(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var IW=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}`)}},pA=new Set(["string","number","symbol"]),nI=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Kt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ge(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 EW(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 iI(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var mA={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]},IA={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function CW(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 Vi(o,e,_l(e,t)),ge(e,gr(n,{shape:o,checks:[]}))}function _l(e,t){let n=sn(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 yW(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(_l(e,t)),s={};return Vi(s,e,Reflect.ownKeys(sn(e)).filter(a=>!o.has(a))),ge(e,gr(n,{shape:s,checks:[]}))}function BW(e,t){if(!Zt(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=sn(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 ge(e,gr(e._zod.def,{shape:w_(e,t)}))}function w_(e,t){let n={};return Vi(n,e,Reflect.ownKeys(sn(e))),dW(n,t),n}function QW(e,t){if(!Zt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ge(e,gr(e._zod.def,{shape:w_(e,t)}))}function vW(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={};Vi(n,e,Reflect.ownKeys(sn(e))),Vi(n,t,Reflect.ownKeys(sn(t)));let i=gr(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ge(e,i)}function wW(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(_l(t,n)):void 0,A={};return Vi(A,t,Reflect.ownKeys(sn(t)),e&&((c,l)=>a&&!a.has(l)?c:new e({type:"optional",innerType:c}))),ge(t,gr(t._zod.def,{shape:A,checks:[]}))}function bW(e,t,n){let i=n?new Set(_l(t,n)):void 0,r={};return Vi(r,t,Reflect.ownKeys(sn(t)),(o,s)=>i&&!i.has(s)?o:new e({type:"nonoptional",innerType:o})),ge(t,gr(t._zod.def,{shape:r}))}function st(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 oI(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 Ct(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function hs(e){return typeof e=="string"?e:e?.message}function Cs(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 EA(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}function yt(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:hs(e.inst?._zod.def?.error?.(e))??hs(o?.(e))??hs(t?.error?.(e))??hs(n.customError?.(e))??hs(n.localeError?.(e))??"Invalid input",a={};for(let A of Object.keys(e))A==="inst"||A==="schema"||A==="continue"||A==="input"||A==="__proto__"||(a[A]=e[A]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function CA(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var kW=/[\uD800-\uDBFF]/;function Yi(e){let t=e.length;if(!kW.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 yA(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function v(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 ys(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function SW(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function b_(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 k_(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function xW(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return b_(t+n)}function DW(e){return k_(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function RW(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 _W(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Xm=class{constructor(...t){}};function sI(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):UW(e,n,i.value)}}function Tn(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function BA(e,t,n){return Tn(e,t,n,!1)}function NW(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Tn(this,n,i(this))},set(r){Tn(this,n,r)}})}return t}function UW(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Tn(this,t,n.bind(this))},set(i){Tn(this,t,i)}})}function $W(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Zm,$n=!1,TW={configurable:!0,get(){$n=!0}};function re(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&Zm!==e._zod){Zm=void 0;return}Zm=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,TW);let r=$n;$n=!1;try{let o=n(this);return $n?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),$n=$n||r,o}catch(o){throw delete this[t],$n=$n||r,o}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}function FW(e,t,n,i){let r=$W(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 Nl="~constantCatch";function aI(e){let t=()=>e;return t[Nl]=!0,t}var S_,cI=Object.freeze({status:"aborted"}),AI={value:void 0,enumerable:!1},x_="captureStackTrace"in Error?Error:null;function MW(e){let t=x_;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return x_=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function I(e,t,n,i){let r={};function o(g){this.def=g,this.constr=d,this.traits=new Set}o.prototype=r;let s=n,a=s&&new WeakSet;function A(g,f){if(g._zod){if(g._zod.traits.has(e))return}else{AI.value=new o(f);try{Object.defineProperty(g,"_zod",AI)}finally{AI.value=void 0}}if(g._zod.traits.add(e),t(g,f),a){let p=Object.getPrototypeOf(g),C=g._zod.constr.prototype,m=p;for(;m&&m!==C;)m=Object.getPrototypeOf(m);let y=m??p;a.has(y)||(a.add(y),sI(y,s))}let h=d.prototype;for(let p in h)Object.prototype.hasOwnProperty.call(h,p)&&(p in g||(g[p]=h[p].bind(g)))}let c=i?.Parent??Object;class l extends c{}Object.defineProperty(l,"name",{value:e});function d(g){let f=i?.Parent?MW(l):this;A(f,g);let h=f._zod.deferred;if(h){for(let C of h)C();f._zod.deferred=void 0}let p=globalThis.__zod_globalConfig?.postProcessor;return p&&p(f),f}return Object.defineProperty(d,"init",{value:A}),Object.defineProperty(d,Symbol.hasInstance,{value:g=>i?.Parent&&g instanceof i.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var uI=Symbol("zod_brand"),Bt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Fn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(S_=globalThis).__zod_globalConfig??(S_.__zod_globalConfig={});var ze=globalThis.__zod_globalConfig;function Re(e){return e&&Object.assign(ze,e),ze}function LW(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,ms,2)),e.message}function PW(e){this._zod.message=e}var OW={get:LW,set:PW,enumerable:!0,configurable:!0},dI={value:void 0,enumerable:!1},D_=new WeakSet([Object.prototype,Error.prototype]),R_=(e,t)=>{e.name="$ZodError",dI.value=t,Object.defineProperty(e,"issues",dI),dI.value=void 0,Object.defineProperty(e,"message",OW);let n=Object.getPrototypeOf(e);D_.has(n)||(D_.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})}}))},gI=I("$ZodError",R_),Qt=I("$ZodError",R_,void 0,{Parent:Error});function zW(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 QA(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?zW(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}function vA(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 A=n,c=0;for(;c<a.length;){let l=a[c],d=c===a.length-1;if(l==="_errors"){d&&A._errors.push(t(s)),c++;continue}Object.prototype.hasOwnProperty.call(A,l)||Object.defineProperty(A,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let g=A[l];d&&g._errors.push(t(s)),A=g,c++}}}};return i(e),n}function fI(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(A=>i({issues:A},[...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 A=[...o,...a.path];if(A.length===0){n.errors.push(t(a));continue}let c=n,l=0;for(;l<A.length;){let d=A[l],g=l===A.length-1;typeof d=="string"?(c.properties??(c.properties={}),Object.prototype.hasOwnProperty.call(c.properties,d)||Object.defineProperty(c.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),c=c.properties[d]):(c.items??(c.items=[]),(s=c.items)[d]??(s[d]={errors:[]}),c=c.items[d]),g&&c.errors.push(t(a)),l++}}};return i(e),n}function __(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 hI(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 ${__(i.path)}`);return t.join(`
|
|
46
|
+
${A}`,this.dataLineCount++;return}if(hl(t,r,Yj)){Wj(t,o)&&(this.setEventFieldSize("retry",t.length-o),n.retry=t.toString("utf8",o));return}if(hl(t,r,Jj)){Zj(t,o)&&(this.setEventFieldSize("id",t.length-o),n.id=t.toString("utf8",o));return}hl(t,r,Vj)&&o<t.length&&(this.setEventFieldSize("event",t.length-o),n.event=t.toString("utf8",o))}setEventFieldSize(t,n){let i=this.eventSize-this.eventFieldSizes[t]+n;if(this.maxEventSize>0&&i>this.maxEventSize)throw pl();this.eventSize=i,this.eventFieldSizes[t]=n}processEvent(t){t.retry&&Mj(t.retry)&&(this.state.reconnectionTime=parseInt(t.retry,10)),t.id&&Lj(t.id)&&(this.state.lastEventId=t.id),t.data!==void 0&&this.push({type:t.event||"message",options:{data:t.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event.data=void 0,this.event.event=void 0,this.event.id=void 0,this.event.retry=void 0,this.eventSize=0,this.dataLineCount=0,this.eventFieldSizes.data=0,this.eventFieldSizes.event=0,this.eventFieldSizes.id=0,this.eventFieldSizes.retry=0}hasPendingEvent(){return this.event.data!==void 0||this.event.event!==void 0||this.event.id!==void 0||this.event.retry!==void 0}hasCurrentByte(){return this.chunkIndex<this.chunks.length&&this.pos<this.chunks[this.chunkIndex].length}currentByte(){return this.chunks[this.chunkIndex][this.pos]}consumeCurrentByte(){this.advanceCursor(),this.syncLineStartToCursor()}advanceCursor(){for(this.pos++;this.chunkIndex<this.chunks.length&&this.pos>=this.chunks[this.chunkIndex].length;)this.chunkIndex++,this.pos=0}syncLineStartToCursor(){this.lineChunkIndex=this.chunkIndex,this.linePos=this.pos,this.lineLength=0,this.dropConsumedChunks()}dropConsumedChunks(){if(this.lineChunkIndex>0){let t=this.lineChunkIndex;this.chunks.splice(0,t),this.lineChunkIndex=0,this.chunkIndex-=t}this.chunkIndex===this.chunks.length&&(this.chunks.length=0,this.chunkIndex=0,this.pos=0,this.lineChunkIndex=0,this.linePos=0)}readLine(){if(this.lineChunkIndex===this.chunkIndex)return this.chunks[this.chunkIndex].subarray(this.linePos,this.pos);let t=[],n=0;for(let i=this.lineChunkIndex;i<=this.chunkIndex;i++){let r=this.chunks[i],o=i===this.lineChunkIndex?this.linePos:0,s=i===this.chunkIndex?this.pos:r.length,a=r.subarray(o,s);n+=a.length,t.push(a)}return Buffer.concat(t,n)}peekBufferedByte(t){let n=this.lineChunkIndex,i=this.linePos;for(;n<this.chunks.length;){let r=this.chunks[n],o=r.length-i;if(t<o)return r[i+t];t-=o,n++,i=0}}discardLeadingBytes(t){for(;t>0&&this.lineChunkIndex<this.chunks.length;){let i=this.chunks[this.lineChunkIndex].length-this.linePos;t<i?(this.linePos+=t,t=0):(t-=i,this.lineChunkIndex++,this.linePos=0)}this.chunkIndex=this.lineChunkIndex,this.pos=this.linePos,this.dropConsumedChunks()}handleBOM(){let t=this.peekBufferedByte(0),n=this.peekBufferedByte(1),i=this.peekBufferedByte(2);return n===void 0?(t===ls[0]||(this.checkBOM=!1),!0):i===void 0?t===ls[0]&&n===ls[1]?!0:(this.checkBOM=!1,!1):(t===ls[0]&&n===ls[1]&&i===ls[2]&&this.discardLeadingBytes(3),this.checkBOM=!1,!this.hasCurrentByte())}};u0.exports={EventSourceStream:Fm}});var E0=k((v3,I0)=>{"use strict";var{pipeline:Kj}=require("node:stream"),{fetching:Xj}=Ha(),{makeRequest:e4}=es(),{webidl:on}=Je(),{EventSourceStream:t4}=l0(),{parseMIMEType:r4}=ft(),{createFastMessageEvent:n4}=ss(),{isNetworkError:d0}=Ja(),{delay:i4}=Tm(),{kEnumerableProperty:zi}=ie(),{environmentSettingsObject:g0}=bt(),{getGlobalDispatcher:o4}=za(),f0=!1,h0=3e3,AA=0,p0=1,cA=2,s4="anonymous",a4="use-credentials",ds=class e extends EventTarget{#e={open:null,error:null,message:null};#t=null;#r=!1;#i=AA;#o=null;#n=null;#s;#a;constructor(t,n={}){super(),on.util.markAsUncloneable(this);let i="EventSource constructor";on.argumentLengthCheck(arguments,1,i),f0||(f0=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),t=on.converters.USVString(t,i,"url"),n=on.converters.EventSourceInitDict(n,i,"eventSourceInitDict"),this.#s=n.dispatcher,this.#a={lastEventId:"",reconnectionTime:h0};let r=g0,o;try{o=new URL(t,r.settingsObject.baseUrl),this.#a.origin=o.origin}catch(A){throw new DOMException(A,"SyntaxError")}this.#t=o.href;let s=s4;n.withCredentials&&(s=a4,this.#r=!0);let a={redirect:"follow",keepalive:!0,mode:"cors",credentials:s==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};a.client=g0.settingsObject,a.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],a.cache="no-store",a.initiator="other",a.urlList=[new URL(this.#t)],this.#o=e4(a),this.#c()}get readyState(){return this.#i}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#i===cA)return;this.#i=AA;let t={request:this.#o,dispatcher:this.#s},n=i=>{d0(i)&&(this.dispatchEvent(new Event("error")),this.close()),this.#A()};t.processResponseEndOfBody=n,t.processResponse=i=>{if(d0(i))if(i.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#A();return}let r=i.headersList.get("content-type",!0),o=r!==null?r4(r):"failure",s=o!=="failure"&&o.essence==="text/event-stream";if(i.status!==200||s===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#i=p0,this.dispatchEvent(new Event("open")),this.#a.origin=i.urlList[i.urlList.length-1].origin;let a=new t4({eventSourceSettings:this.#a,maxEventSize:this.#s.eventSourceOptions?.maxEventSize,push:A=>{this.dispatchEvent(n4(A.type,A.options))}});Kj(i.body.stream,a,A=>{A?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#n=Xj(t)}async#A(){this.#i!==cA&&(this.#i=AA,this.dispatchEvent(new Event("error")),await i4(this.#a.reconnectionTime),this.#i===AA&&(this.#a.lastEventId.length&&this.#o.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){on.brandCheck(this,e),this.#i!==cA&&(this.#i=cA,this.#n.abort(),this.#o=null)}get onopen(){return this.#e.open}set onopen(t){this.#e.open&&this.removeEventListener("open",this.#e.open),typeof t=="function"?(this.#e.open=t,this.addEventListener("open",t)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(t){this.#e.message&&this.removeEventListener("message",this.#e.message),typeof t=="function"?(this.#e.message=t,this.addEventListener("message",t)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(t){this.#e.error&&this.removeEventListener("error",this.#e.error),typeof t=="function"?(this.#e.error=t,this.addEventListener("error",t)):this.#e.error=null}},m0={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:AA,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:p0,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:cA,writable:!1}};Object.defineProperties(ds,m0);Object.defineProperties(ds.prototype,m0);Object.defineProperties(ds.prototype,{close:zi,onerror:zi,onmessage:zi,onopen:zi,readyState:zi,url:zi,withCredentials:zi});on.converters.EventSourceInitDict=on.dictionaryConverter([{key:"withCredentials",converter:on.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:on.converters.any,defaultValue:()=>o4()}]);I0.exports={EventSource:ds,defaultReconnectionTime:h0}});var Q0=k((w3,H)=>{"use strict";var A4=Po(),C0=ua(),c4=Oo(),u4=Ck(),l4=zo(),d4=ip(),g4=Vk(),f4=Zk(),y0=ue(),Il=ie(),{InvalidArgumentError:ml}=y0,gs=FS(),h4=da(),p4=Lp(),m4=Ex(),I4=zp(),E4=bp(),C4=Eu(),{getGlobalDispatcher:B0,setGlobalDispatcher:y4}=za(),B4=xu(),Q4=Au(),v4=cu();Object.assign(C0.prototype,gs);H.exports.Dispatcher=C0;H.exports.Client=A4;H.exports.Pool=c4;H.exports.BalancedPool=u4;H.exports.Agent=l4;H.exports.ProxyAgent=d4;H.exports.EnvHttpProxyAgent=g4;H.exports.RetryAgent=f4;H.exports.RetryHandler=C4;H.exports.DecoratorHandler=B4;H.exports.RedirectHandler=Q4;H.exports.createRedirectInterceptor=v4;H.exports.interceptors={redirect:bx(),retry:Sx(),dump:Dx(),dns:Nx()};H.exports.buildConnector=h4;H.exports.errors=y0;H.exports.util={parseHeaders:Il.parseHeaders,headerNameToString:Il.headerNameToString};function uA(e){return(t,n,i)=>{if(typeof n=="function"&&(i=n,n=null),!t||typeof t!="string"&&typeof t!="object"&&!(t instanceof URL))throw new ml("invalid url");if(n!=null&&typeof n!="object")throw new ml("invalid opts");if(n&&n.path!=null){if(typeof n.path!="string")throw new ml("invalid opts.path");let s=n.path;n.path.startsWith("/")||(s=`/${s}`),t=new URL(Il.parseOrigin(t).origin+s)}else n||(n=typeof t=="object"?t:{}),t=Il.parseURL(t);let{agent:r,dispatcher:o=B0()}=n;if(r)throw new ml("unsupported opts.agent. Did you mean opts.client?");return e.call(o,{...n,origin:t.origin,path:t.search?`${t.pathname}${t.search}`:t.pathname,method:n.method||(n.body?"PUT":"GET")},i)}}H.exports.setGlobalDispatcher=y4;H.exports.getGlobalDispatcher=B0;var w4=Ha().fetch;H.exports.fetch=async function(t,n=void 0){try{return await w4(t,n)}catch(i){throw i&&typeof i=="object"&&Error.captureStackTrace(i),i}};H.exports.Headers=$i().Headers;H.exports.Response=Ja().Response;H.exports.Request=es().Request;H.exports.FormData=Ea().FormData;H.exports.File=globalThis.File??require("node:buffer").File;H.exports.FileReader=qD().FileReader;var{setGlobalOrigin:b4,getGlobalOrigin:k4}=nh();H.exports.setGlobalOrigin=b4;H.exports.getGlobalOrigin=k4;var{CacheStorage:S4}=iR(),{kConstruct:x4}=Wu();H.exports.caches=new S4(x4);var{deleteCookie:D4,getCookies:R4,getSetCookies:_4,setCookie:N4}=hR();H.exports.deleteCookie=D4;H.exports.getCookies=R4;H.exports.getSetCookies=_4;H.exports.setCookie=N4;var{parseMIMEType:U4,serializeAMimeType:$4}=ft();H.exports.parseMIMEType=U4;H.exports.serializeAMimeType=$4;var{CloseEvent:T4,ErrorEvent:F4,MessageEvent:M4}=ss();H.exports.WebSocket=A0().WebSocket;H.exports.CloseEvent=T4;H.exports.ErrorEvent=F4;H.exports.MessageEvent=M4;H.exports.request=uA(gs.request);H.exports.stream=uA(gs.stream);H.exports.pipeline=uA(gs.pipeline);H.exports.connect=uA(gs.connect);H.exports.upgrade=uA(gs.upgrade);H.exports.MockClient=p4;H.exports.MockPool=I4;H.exports.MockAgent=m4;H.exports.mockErrors=E4;var{EventSource:L4}=E0();H.exports.EventSource=L4});var ln=ut(require("fs")),dc=ut(require("path")),NT=require("crypto");var u={};Ir(u,{BRAND:()=>lF,DIRTY:()=>Xn,EMPTY_PATH:()=>GT,INVALID:()=>V,NEVER:()=>qF,OK:()=>We,ParseStatus:()=>Ge,Schema:()=>ne,ZodAny:()=>hn,ZodArray:()=>Jr,ZodBigInt:()=>ti,ZodBoolean:()=>ri,ZodBranded:()=>na,ZodCatch:()=>gi,ZodDate:()=>ni,ZodDefault:()=>di,ZodDiscriminatedUnion:()=>mc,ZodEffects:()=>Gt,ZodEnum:()=>ui,ZodError:()=>lt,ZodFirstPartyTypeKind:()=>Y,ZodFunction:()=>Ec,ZodIntersection:()=>ai,ZodIssueCode:()=>S,ZodLazy:()=>Ai,ZodLiteral:()=>ci,ZodMap:()=>fo,ZodNaN:()=>po,ZodNativeEnum:()=>li,ZodNever:()=>tr,ZodNull:()=>oi,ZodNullable:()=>yr,ZodNumber:()=>ei,ZodObject:()=>dt,ZodOptional:()=>Ot,ZodParsedType:()=>U,ZodPipeline:()=>ia,ZodPromise:()=>pn,ZodReadonly:()=>fi,ZodRecord:()=>Ic,ZodSchema:()=>ne,ZodSet:()=>ho,ZodString:()=>fn,ZodSymbol:()=>lo,ZodTransformer:()=>Gt,ZodTuple:()=>Cr,ZodType:()=>ne,ZodUndefined:()=>ii,ZodUnion:()=>si,ZodUnknown:()=>Vr,ZodVoid:()=>go,addIssueToContext:()=>_,any:()=>CF,array:()=>vF,bigint:()=>hF,boolean:()=>MQ,coerce:()=>jF,custom:()=>$Q,date:()=>pF,datetimeRegex:()=>NQ,defaultErrorMap:()=>zr,discriminatedUnion:()=>SF,effect:()=>PF,enum:()=>FF,function:()=>UF,getErrorMap:()=>Ao,getParsedType:()=>Er,instanceof:()=>gF,intersection:()=>xF,isAborted:()=>hc,isAsync:()=>co,isDirty:()=>pc,isValid:()=>gn,late:()=>dF,lazy:()=>$F,literal:()=>TF,makeIssue:()=>ra,map:()=>_F,nan:()=>fF,nativeEnum:()=>MF,never:()=>BF,null:()=>EF,nullable:()=>zF,number:()=>FQ,object:()=>wF,objectUtil:()=>Gg,oboolean:()=>HF,onumber:()=>YF,optional:()=>OF,ostring:()=>JF,pipeline:()=>VF,preprocess:()=>GF,promise:()=>LF,quotelessJson:()=>PT,record:()=>RF,set:()=>NF,setErrorMap:()=>zT,strictObject:()=>bF,string:()=>TQ,symbol:()=>mF,transformer:()=>PF,tuple:()=>DF,undefined:()=>IF,union:()=>kF,unknown:()=>yF,util:()=>se,void:()=>QF});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 Gg;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Gg||(Gg={}));var U=se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Er=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"]),PT=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),lt=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,A=0;for(;A<s.path.length;){let c=s.path[A],l=A===s.path.length-1;if(c==="_errors"){l&&a._errors.push(n(s)),A++;continue}Object.prototype.hasOwnProperty.call(a,c)||(c==="__proto__"?Object.defineProperty(a,c,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):a[c]={_errors:[]}),a=a[c],l&&a._errors.push(n(s)),A++}}};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()}};lt.create=e=>new lt(e);var OT=(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}},zr=OT;var SQ=zr;function zT(e){SQ=e}function Ao(){return SQ}var ra=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="",A=i.filter(c=>!!c).slice().reverse();for(let c of A)a=c(s,{data:t,defaultError:a}).message;return{...r,path:o,message:a}},GT=[];function _(e,t){let n=Ao(),i=ra({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===zr?void 0:zr].filter(r=>!!r)});e.common.issues.push(i)}var Ge=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 V;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 V;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}}},V=Object.freeze({status:"aborted"}),Xn=e=>({status:"dirty",value:e}),We=e=>({status:"valid",value:e}),hc=e=>e.status==="aborted",pc=e=>e.status==="dirty",gn=e=>e.status==="valid",co=e=>typeof Promise<"u"&&e instanceof Promise;var $;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})($||($={}));var zt=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}},xQ=(e,t)=>{if(gn(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 lt(e.common.issues);return this._error=n,this._error}}};function K(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:A}=e;return s.code==="invalid_enum_value"?{message:A??a.defaultError}:typeof a.data>"u"?{message:A??i??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:A??n??a.defaultError}},description:r}}var ne=class{get description(){return this._def.description}_getType(t){return Er(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ge,ctx:{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(co(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:Er(t)},r=this._parseSync({data:t,path:i.path,parent:i});return xQ(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return gn(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=>gn(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:Er(t)},r=this._parse({data:t,path:i.path,parent:i}),o=await(co(r)?r:Promise.resolve(r));return xQ(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(A=>A?!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 Gt({schema:this,typeName:Y.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 Ot.create(this,this._def)}nullable(){return yr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Jr.create(this)}promise(){return pn.create(this,this._def)}or(t){return si.create([this,t],this._def)}and(t){return ai.create(this,t,this._def)}transform(t){return new Gt({...K(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new di({...K(this._def),innerType:this,defaultValue:n,typeName:Y.ZodDefault})}brand(){return new na({typeName:Y.ZodBranded,type:this,...K(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new gi({...K(this._def),innerType:this,catchValue:n,typeName:Y.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return ia.create(this,t)}readonly(){return fi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},VT=/^c[^\s-]{8,}$/i,JT=/^[0-9a-z]+$/,YT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,HT=/^[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,jT=/^[a-z0-9_-]{21}$/i,qT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,WT=/^[-+]?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)?)??$/,ZT=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,KT="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",Vg,XT=/^(?:(?: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])$/,eF=/^(?:(?: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])$/,tF=/^(([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]))$/,rF=/^(([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])$/,nF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,RQ="((\\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])))",oF=new RegExp(`^${RQ}$`);function _Q(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 sF(e){return new RegExp(`^${_Q(e)}$`)}function NQ(e){let t=`${RQ}T${_Q(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 aF(e,t){return!!((t==="v4"||!t)&&XT.test(e)||(t==="v6"||!t)&&tF.test(e))}function AF(e,t){if(!qT.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 cF(e,t){return!!((t==="v4"||!t)&&eF.test(e)||(t==="v6"||!t)&&rF.test(e))}var fn=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}),V}let i=new Ge,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")ZT.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")Vg||(Vg=new RegExp(KT,"u")),Vg.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")HT.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")jT.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")VT.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")JT.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")YT.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"?NQ(o).test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?oF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?sF(o).test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?WT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"duration",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?aF(t.data,o.version)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"ip",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?AF(t.data,o.alg)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"jwt",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?cF(t.data,o.version)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"cidr",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?nF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"base64",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?iF.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,...$.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...$.errToObj(t)})}url(t){return this._addCheck({kind:"url",...$.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...$.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...$.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...$.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...$.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...$.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...$.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...$.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...$.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...$.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...$.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...$.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,...$.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,...$.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...$.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...$.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...$.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...$.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...$.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...$.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...$.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...$.errToObj(n)})}nonempty(t){return this.min(1,$.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}};fn.create=e=>new fn({checks:[],typeName:Y.ZodString,coerce:e?.coerce??!1,...K(e)});function uF(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 ei=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}),V}let i,r=new Ge;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"?uF(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,$.toString(n))}gt(t,n){return this.setLimit("min",t,!1,$.toString(n))}lte(t,n){return this.setLimit("max",t,!0,$.toString(n))}lt(t,n){return this.setLimit("max",t,!1,$.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:$.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:$.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:$.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:$.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$.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)}};ei.create=e=>new ei({checks:[],typeName:Y.ZodNumber,coerce:e?.coerce||!1,...K(e)});var ti=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 Ge;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}),V}gte(t,n){return this.setLimit("min",t,!0,$.toString(n))}gt(t,n){return this.setLimit("min",t,!1,$.toString(n))}lte(t,n){return this.setLimit("max",t,!0,$.toString(n))}lt(t,n){return this.setLimit("max",t,!1,$.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:$.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:$.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:$.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}};ti.create=e=>new ti({checks:[],typeName:Y.ZodBigInt,coerce:e?.coerce??!1,...K(e)});var ri=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}),V}return We(t.data)}};ri.create=e=>new ri({typeName:Y.ZodBoolean,coerce:e?.coerce||!1,...K(e)});var ni=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}),V}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_date}),V}let i=new Ge,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:$.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:$.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}};ni.create=e=>new ni({checks:[],coerce:e?.coerce||!1,typeName:Y.ZodDate,...K(e)});var lo=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}),V}return We(t.data)}};lo.create=e=>new lo({typeName:Y.ZodSymbol,...K(e)});var ii=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}),V}return We(t.data)}};ii.create=e=>new ii({typeName:Y.ZodUndefined,...K(e)});var oi=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}),V}return We(t.data)}};oi.create=e=>new oi({typeName:Y.ZodNull,...K(e)});var hn=class extends ne{constructor(){super(...arguments),this._any=!0}_parse(t){return We(t.data)}};hn.create=e=>new hn({typeName:Y.ZodAny,...K(e)});var Vr=class extends ne{constructor(){super(...arguments),this._unknown=!0}_parse(t){return We(t.data)}};Vr.create=e=>new Vr({typeName:Y.ZodUnknown,...K(e)});var tr=class extends ne{_parse(t){let n=this._getOrReturnCtx(t);return _(n,{code:S.invalid_type,expected:U.never,received:n.parsedType}),V}};tr.create=e=>new tr({typeName:Y.ZodNever,...K(e)});var go=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}),V}return We(t.data)}};go.create=e=>new go({typeName:Y.ZodVoid,...K(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}),V;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 zt(n,s,n.path,a)))).then(s=>Ge.mergeArray(i,s));let o=[...n.data].map((s,a)=>r.type._parseSync(new zt(n,s,n.path,a)));return Ge.mergeArray(i,o)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:$.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:$.toString(n)}})}nonempty(t){return this.min(1,t)}};Jr.create=(e,t)=>new Jr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...K(t)});function uo(e){if(e instanceof dt){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=Ot.create(uo(i))}return new dt({...e._def,shape:()=>t})}else return e instanceof Jr?new Jr({...e._def,type:uo(e.element)}):e instanceof Ot?Ot.create(uo(e.unwrap())):e instanceof yr?yr.create(uo(e.unwrap())):e instanceof Cr?Cr.create(e.items.map(t=>uo(t))):e}var dt=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 c=this._getOrReturnCtx(t);return _(c,{code:S.invalid_type,expected:U.object,received:c.parsedType}),V}let{status:i,ctx:r}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof tr&&this._def.unknownKeys==="strip"))for(let c in r.data)s.includes(c)||a.push(c);let A=[];for(let c of s){let l=o[c],d=r.data[c];A.push({key:{status:"valid",value:c},value:l._parse(new zt(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof tr){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)A.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(c==="strict")a.length>0&&(_(r,{code:S.unrecognized_keys,keys:a}),i.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of a){let d=r.data[l];A.push({key:{status:"valid",value:l},value:c._parse(new zt(r,d,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of A){let d=await l.key,g=await l.value;c.push({key:d,value:g,alwaysSet:l.alwaysSet})}return c}).then(c=>Ge.mergeObjectSync(i,c)):Ge.mergeObjectSync(i,A)}get shape(){return this._def.shape()}strict(t){return $.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:$.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:Y.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 uo(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 Ot;)o=o._def.innerType;n[i]=o}return new e({...this._def,shape:()=>n})}keyof(){return UQ(se.objectKeys(this.shape))}};dt.create=(e,t)=>new dt({shape:()=>e,unknownKeys:"strip",catchall:tr.create(),typeName:Y.ZodObject,...K(t)});dt.strictCreate=(e,t)=>new dt({shape:()=>e,unknownKeys:"strict",catchall:tr.create(),typeName:Y.ZodObject,...K(t)});dt.lazycreate=(e,t)=>new dt({shape:e,unknownKeys:"strip",catchall:tr.create(),typeName:Y.ZodObject,...K(t)});var si=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 lt(a.ctx.common.issues));return _(n,{code:S.invalid_union,unionErrors:s}),V}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 A of i){let c={...n,common:{...n.common,issues:[]},parent:null},l=A._parseSync({data:n.data,path:n.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(A=>new lt(A));return _(n,{code:S.invalid_union,unionErrors:a}),V}}get options(){return this._def.options}};si.create=(e,t)=>new si({options:e,typeName:Y.ZodUnion,...K(t)});var Gr=e=>e instanceof Ai?Gr(e.schema):e instanceof Gt?Gr(e.innerType()):e instanceof ci?[e.value]:e instanceof ui?e.options:e instanceof li?se.objectValues(e.enum):e instanceof di?Gr(e._def.innerType):e instanceof ii?[void 0]:e instanceof oi?[null]:e instanceof Ot?[void 0,...Gr(e.unwrap())]:e instanceof yr?[null,...Gr(e.unwrap())]:e instanceof na||e instanceof fi?Gr(e.unwrap()):e instanceof gi?Gr(e._def.innerType):[],mc=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}),V;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]}),V)}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=Gr(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:Y.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...K(i)})}};function Jg(e,t){let n=Er(e),i=Er(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 A=Jg(e[a],t[a]);if(!A.valid)return{valid:!1};s[a]=A.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],A=Jg(s,a);if(!A.valid)return{valid:!1};r.push(A.data)}return{valid:!0,data:r}}else return n===U.date&&i===U.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var ai=class extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=(o,s)=>{if(hc(o)||hc(s))return V;let a=Jg(o.value,s.value);return a.valid?((pc(o)||pc(s))&&n.dirty(),{status:n.value,value:a.data}):(_(i,{code:S.invalid_intersection_types}),V)};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}))}};ai.create=(e,t,n)=>new ai({left:e,right:t,typeName:Y.ZodIntersection,...K(n)});var Cr=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}),V;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"}),V;!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 A=this._def.items[a]||this._def.rest;return A?A._parse(new zt(i,s,i.path,a)):null}).filter(s=>!!s);return i.common.async?Promise.all(o).then(s=>Ge.mergeArray(n,s)):Ge.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Cr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Cr({items:e,typeName:Y.ZodTuple,rest:null,...K(t)})};var Ic=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}),V;let r=[],o=this._def.keyType,s=this._def.valueType;for(let a in i.data)r.push({key:o._parse(new zt(i,a,i.path,a)),value:s._parse(new zt(i,i.data[a],i.path,a)),alwaysSet:a in i.data});return i.common.async?Ge.mergeObjectAsync(n,r):Ge.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:Y.ZodRecord,...K(i)}):new e({keyType:fn.create(),valueType:t,typeName:Y.ZodRecord,...K(n)})}},fo=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}),V;let r=this._def.keyType,o=this._def.valueType,s=[...i.data.entries()].map(([a,A],c)=>({key:r._parse(new zt(i,a,i.path,[c,"key"])),value:o._parse(new zt(i,A,i.path,[c,"value"]))}));if(i.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let A of s){let c=await A.key,l=await A.value;if(c.status==="aborted"||l.status==="aborted")return V;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(c.value,l.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let A of s){let c=A.key,l=A.value;if(c.status==="aborted"||l.status==="aborted")return V;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(c.value,l.value)}return{status:n.value,value:a}}}};fo.create=(e,t,n)=>new fo({valueType:t,keyType:e,typeName:Y.ZodMap,...K(n)});var ho=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}),V;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(A){let c=new Set;for(let l of A){if(l.status==="aborted")return V;l.status==="dirty"&&n.dirty(),c.add(l.value)}return{status:n.value,value:c}}let a=[...i.data.values()].map((A,c)=>o._parse(new zt(i,A,i.path,c)));return i.common.async?Promise.all(a).then(A=>s(A)):s(a)}min(t,n){return new e({...this._def,minSize:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:$.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};ho.create=(e,t)=>new ho({valueType:e,minSize:null,maxSize:null,typeName:Y.ZodSet,...K(t)});var Ec=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}),V;function i(a,A){return ra({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ao(),zr].filter(c=>!!c),issueData:{code:S.invalid_arguments,argumentsError:A}})}function r(a,A){return ra({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ao(),zr].filter(c=>!!c),issueData:{code:S.invalid_return_type,returnTypeError:A}})}let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof pn){let a=this;return We(async function(...A){let c=new lt([]),l=await a._def.args.parseAsync(A,o).catch(f=>{throw c.addIssue(i(A,f)),c}),d=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(d,o).catch(f=>{throw c.addIssue(r(d,f)),c})})}else{let a=this;return We(function(...A){let c=a._def.args.safeParse(A,o);if(!c.success)throw new lt([i(A,c.error)]);let l=Reflect.apply(s,this,c.data),d=a._def.returns.safeParse(l,o);if(!d.success)throw new lt([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:Cr.create(t).rest(Vr.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||Cr.create([]).rest(Vr.create()),returns:n||Vr.create(),typeName:Y.ZodFunction,...K(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:Y.ZodLazy,...K(t)});var ci=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}),V}return{status:"valid",value:t.data}}get value(){return this._def.value}};ci.create=(e,t)=>new ci({value:e,typeName:Y.ZodLiteral,...K(t)});function UQ(e,t){return new ui({values:e,typeName:Y.ZodEnum,...K(t)})}var ui=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}),V}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}),V}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})}};ui.create=UQ;var li=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}),V}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}),V}return We(t.data)}get enum(){return this._def.values}};li.create=(e,t)=>new li({values:e,typeName:Y.ZodNativeEnum,...K(t)});var pn=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}),V;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})))}};pn.create=(e,t)=>new pn({type:e,typeName:Y.ZodPromise,...K(t)});var Gt=class extends ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.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 V;let A=await this._def.schema._parseAsync({data:a,path:i.path,parent:i});return A.status==="aborted"?V:A.status==="dirty"?Xn(A.value):n.value==="dirty"?Xn(A.value):A});{if(n.value==="aborted")return V;let a=this._def.schema._parseSync({data:s,path:i.path,parent:i});return a.status==="aborted"?V:a.status==="dirty"?Xn(a.value):n.value==="dirty"?Xn(a.value):a}}if(r.type==="refinement"){let s=a=>{let A=r.refinement(a,o);if(i.common.async)return Promise.resolve(A);if(A 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"?V:(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"?V:(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(!gn(s))return V;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=>gn(s)?Promise.resolve(r.transform(s.value,o)).then(a=>({status:n.value,value:a})):V);se.assertNever(r)}};Gt.create=(e,t,n)=>new Gt({schema:e,typeName:Y.ZodEffects,effect:t,...K(n)});Gt.createWithPreprocess=(e,t,n)=>new Gt({schema:t,effect:{type:"preprocess",transform:e},typeName:Y.ZodEffects,...K(n)});var Ot=class extends ne{_parse(t){return this._getType(t)===U.undefined?We(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ot.create=(e,t)=>new Ot({innerType:e,typeName:Y.ZodOptional,...K(t)});var yr=class extends ne{_parse(t){return this._getType(t)===U.null?We(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};yr.create=(e,t)=>new yr({innerType:e,typeName:Y.ZodNullable,...K(t)});var di=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}};di.create=(e,t)=>new di({innerType:e,typeName:Y.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...K(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 co(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new lt(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new lt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};gi.create=(e,t)=>new gi({innerType:e,typeName:Y.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...K(t)});var po=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}),V}return{status:"valid",value:t.data}}};po.create=e=>new po({typeName:Y.ZodNaN,...K(e)});var lF=Symbol("zod_brand"),na=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}},ia=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"?V:o.status==="dirty"?(n.dirty(),Xn(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"?V: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:Y.ZodPipeline})}},fi=class extends ne{_parse(t){let n=this._def.innerType._parse(t),i=r=>(gn(r)&&(r.value=Object.freeze(r.value)),r);return co(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};fi.create=(e,t)=>new fi({innerType:e,typeName:Y.ZodReadonly,...K(t)});function DQ(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function $Q(e,t={},n){return e?hn.create().superRefine((i,r)=>{let o=e(i);if(o instanceof Promise)return o.then(s=>{if(!s){let a=DQ(t,i),A=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:A})}});if(!o){let s=DQ(t,i),a=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:a})}}):hn.create()}var dF={object:dt.lazycreate},Y;(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"})(Y||(Y={}));var gF=(e,t={message:`Input not instance of ${e.name}`})=>$Q(n=>n instanceof e,t),TQ=fn.create,FQ=ei.create,fF=po.create,hF=ti.create,MQ=ri.create,pF=ni.create,mF=lo.create,IF=ii.create,EF=oi.create,CF=hn.create,yF=Vr.create,BF=tr.create,QF=go.create,vF=Jr.create,wF=dt.create,bF=dt.strictCreate,kF=si.create,SF=mc.create,xF=ai.create,DF=Cr.create,RF=Ic.create,_F=fo.create,NF=ho.create,UF=Ec.create,$F=Ai.create,TF=ci.create,FF=ui.create,MF=li.create,LF=pn.create,PF=Gt.create,OF=Ot.create,zF=yr.create,GF=Gt.createWithPreprocess,VF=ia.create,JF=()=>TQ().optional(),YF=()=>FQ().optional(),HF=()=>MQ().optional(),jF={string:(e=>fn.create({...e,coerce:!0})),number:(e=>ei.create({...e,coerce:!0})),boolean:(e=>ri.create({...e,coerce:!0})),bigint:(e=>ti.create({...e,coerce:!0})),date:(e=>ni.create({...e,coerce:!0}))};var qF=V;var Yg=(r=>(r.ModelProvider="model_provider",r.SutAccess="sut_access",r.Skyramp="skyramp",r.Other="other",r))(Yg||{}),Hg=(i=>(i.Ready="ready",i.Blocked="blocked",i.NeedsInputs="needs_inputs",i))(Hg||{});var jg=300,xe=u.string().trim().min(1),WF=u.object({action:u.enum(["start","run","wait"]),text:xe,source:u.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:xe.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"}),qg=/^[A-Za-z_][A-Za-z0-9_]*$/,Br=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,oa=(s=>(s.VersionEndpoint="version_endpoint",s.DeployWorkflow="deploy_workflow",s.KubernetesLabels="kubernetes_labels",s.Command="command",s.Api="api",s.NotTracked="not_tracked",s))(oa||{}),Yr="shared",ZF=xe.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"),mo=u.object({address:ZF,readyWhen:xe.nullable(),credentials:u.array(u.string().regex(Br)).max(50),revisionSources:u.array(u.object({method:u.nativeEnum(oa),detail:xe.describe("what Testbot reads, such as GET /version or the deploy workflow's name; for not_tracked, why nothing shows it"),components:u.array(xe).min(1).describe("the components it tells the revision of, by name")}).strict()).max(50)}).strict(),Wg={steps:u.array(WF).max(20).optional().describe("how it starts, in order"),kind:u.enum(["web_app","service","database","external_service"]).optional(),from:u.object({file:xe,service:xe.nullable()}).strict().optional(),credentials:u.array(u.string().max(100).regex(qg)).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")},KF=u.object({name:xe,repository:xe.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(),...Wg,deployed:xe.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')}),XF=u.object({name:u.string().regex(Br).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:xe.max(jg).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')}),eM=u.object({component:xe,problem:xe,evidence:xe.describe("the exact command and output that shows it"),fix:xe.describe("what the user must provide, and where")}),tM=u.object({framework:xe,file:xe.describe("the test file run, relative to its repository root"),result:u.enum(["pass","fail","error"])}),rM=u.object({input:xe.describe("the part of the user's SUT input, as given"),reason:xe}),aX=u.object({schemaVersion:u.literal(1),status:u.nativeEnum(Hg).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(KF),suites:u.array(tM).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:u.array(xe).default([]).describe("the parts of the user's SUT input the recipe used as given"),inputsUsedHow:u.array(u.object({input:xe.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:xe.describe("what the recipe did with it")})).optional(),inputsNotUsed:u.array(rM).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(eM).describe("required (non-empty) when status is blocked"),inputs:u.array(XF).max(50).optional().describe("required (non-empty) when status is needs_inputs, else left out: each credential the candidate recipe needs a value for"),environment:mo.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, proxy or client certificate)")});var Zg=64*1024,Kg=512*1024,LQ=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var dX=new TextDecoder("utf-8",{fatal:!0});var sa=(o=>(o.NotFound="not_found",o.NoAccess="no_access",o.Unavailable="unavailable",o.AccessLost="access_lost",o.CannotOpen="cannot_open",o))(sa||{});var PQ=e=>`${e.source}:${e.site??""}:${e.key}`;var Cc=/^pasted-[0-9a-f]{16}$/,yc=/^file-[0-9a-f]{16}$/,Bc=(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))(Bc||{});var Xg=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(Xg||{}),ef=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(ef||{}),tf=(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))(tf||{}),aa=(o=>(o.CiCheck="ci_check",o.TestReport="test_report",o.StaticAnalysis="static_analysis",o.CodeReview="code_review",o.Other="other",o))(aa||{}),rf=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(rf||{}),nf=(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))(nf||{});var of=(n=>(n.Probe="probe",n.Agent="agent",n))(of||{}),sf=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(sf||{}),af=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(af||{});var OQ=(n=>(n.Skyramp="skyramp",n.Llm="llm",n))(OQ||{}),Qr=u.string().trim().min(1),nM=u.object({case:Qr.describe("recommend id this assertion enforces"),evidence:Qr.describe("the exact assertion line from the file that checks that case's observable")}),Af=u.object({kind:u.nativeEnum(sf).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:Qr.describe("the dependency, endpoint or data it affects"),mechanism:u.nativeEnum(af).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:Qr.describe("what it sets up"),worker:Qr.optional().describe("skyramp_mocker: host:port of the worker the test applies the mock to (default localhost:35142)"),cleanup:Qr.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:Qr.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"]}),iM=u.object({file:Qr.describe("staged path under .skyramp/staged/"),source:u.nativeEnum(OQ),language:Qr,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(nM).min(1,"must be a non-empty array").describe("one per case covered, citing the real line"),context:u.array(Af).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")}),mX=u.object({schemaVersion:u.literal(1),tests:u.array(iM),deferredUi:u.array(u.string()).describe("recommend ui ids left for the UI stage (generate) \u2014 [] for generate-ui"),summary:Qr.describe("one paragraph")});var zQ=(s=>(s.Place="place",s.Update="update",s.Regenerate="regenerate",s.Delete="delete",s.Verify="verify",s.None="none",s))(zQ||{}),GQ=(i=>(i.Pass="pass",i.Fail="fail",i.Skip="skip",i))(GQ||{}),gt=u.string().trim().min(1),VQ=(r=>(r.Setup="setup",r.Expectation="expectation",r.Locator="locator",r.Other="other",r))(VQ||{}),oM=u.object({kind:u.nativeEnum(VQ),reason:gt.describe("what in the test is wrong, with the evidence: the setup error it raised, or the requirement or changed line its expectation contradicts")}),cf=u.array(u.string().url().max(2048).regex(/^https?:\/\//i)).max(50),sM=u.object({case:gt.describe("a covers id \u2014 the recommend case this test realizes"),status:u.nativeEnum(GQ),runtimeTargets:cf.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"),fromJourney:u.boolean().optional(),testProblem:oM.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")}),aM=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(sM).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")}),AM=u.object({context:u.array(Af).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:gt.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:gt.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),action:u.nativeEnum(zQ),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:gt.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:gt.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:aM,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(gt).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:[]}),JQ=(n=>(n.Junit="junit",n.Converter="converter",n))(JQ||{}),cM=gt.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),uM=u.object({results:gt.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:u.nativeEnum(JQ),run:gt.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:u.array(gt).min(1).describe("the items[].file paths this run covered"),cases:u.array(u.object({test:gt.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:gt.describe("the covers id it realizes"),file:cM})).describe("map each reported test name to the case it covers")}),lM=u.object({suites:u.array(uM).min(1)}),yX=u.object({schemaVersion:u.literal(1),items:u.array(AM),runnerResults:lM.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:gt.describe("one paragraph")});var El=ut(KQ(),1),P4=ut(Q0(),1);var $r;(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"})($r||($r={}));var v0;(function(e){e.Accept="accept",e.ContentType="content-type"})(v0||(v0={}));var w0;(function(e){e.ApplicationJson="application/json"})(w0||(w0={}));var k3=[$r.MovedPermanently,$r.ResourceMoved,$r.SeeOther,$r.TemporaryRedirect,$r.PermanentRedirect],S3=[$r.BadGateway,$r.ServiceUnavailable,$r.GatewayTimeout];var k0=require("os"),lA=require("fs"),Mm=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{c(i.next(l))}catch(d){s(d)}}function A(l){try{c(i.throw(l))}catch(d){s(d)}}function c(l){l.done?o(l.value):r(l.value).then(a,A)}c((i=i.apply(e,t||[])).next())})},{access:z4,appendFile:G4,writeFile:V4}=lA.promises,b0="GITHUB_STEP_SUMMARY";var Lm=class{constructor(){this._buffer=""}filePath(){return Mm(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let t=process.env[b0];if(!t)throw new Error(`Unable to find environment variable for $${b0}. Check if your runtime environment supports job summaries.`);try{yield z4(t,lA.constants.R_OK|lA.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 Mm(this,void 0,void 0,function*(){let n=!!t?.overwrite,i=yield this.filePath();return yield(n?V4:G4)(i,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return Mm(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(k0.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:A,colspan:c,rowspan:l}=s,d=a?"th":"td",g=Object.assign(Object.assign({},c&&{colspan:c}),l&&{rowspan:l});return this.wrap(d,A,g)}).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()}},M3=new Lm;var Pm=ut(require("os"),1);var Cl=ut(require("fs"),1);var{chmod:J4,copyFile:Y4,lstat:H4,mkdir:j4,open:O3,readdir:q4,rename:W4,rm:Z4,rmdir:z3,stat:K4,symlink:X4,unlink:eq}=Cl.promises,tq=process.platform==="win32";var G3=Cl.constants.O_RDONLY;var j3=process.platform==="win32";var K3=Pm.default.platform(),X3=Pm.default.arch();var D0;(function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure"})(D0||(D0={}));function _0(e){return e.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}var N0=ut(require("path"));var Om=(r=>(r.Clean="clean",r.RecipeDrift="recipe-drift",r.ChangeBrokeBringup="change-broke-bringup",r.BringupFailed="bringup-failed",r))(Om||{}),lr=u.string().trim().min(1),aq=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:lr.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),Aq=u.array(u.object({component:lr.describe("a shared component listed above"),url:lr.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:lr.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"),cq=u.object({name:lr.describe("the credential's environment variable name, as listed above; never its value"),component:lr.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:lr.describe("the request or command you tested it with and what came back, never the value")}),w7=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:aq.optional(),teardown:lr.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(Om).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:lr,output:lr}).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:lr.describe("ISO timestamp"),revisions:Aq.optional(),missingSecrets:u.array(u.string().regex(qg)).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(cq).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 Ye=u.string().trim().min(1),yl=Ye,zm=(n=>(n.TestbotManaged="testbot_managed",n.CustomerDeployed="customer_deployed",n))(zm||{}),Gm=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],U0=u.object({schemaVersion:u.literal(1),type:u.nativeEnum(zm).optional(),repository:yl.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:mo.optional(),components:u.array(u.object({name:Ye,repository:Ye.describe(`owner/repo, or "${Yr}" for a customer-deployed component no repository builds`),healthy:u.boolean(),url:u.string().min(1).nullable(),...Wg,credentials:u.array(u.string().regex(Br)).max(50).optional(),deployed:Ye.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:Ye,file:Ye,result:u.enum(["pass","fail","error"])}).strict()),inputsUsed:u.array(Ye),inputsUsedHow:u.array(u.object({input:Ye,how:Ye}).strict()).optional(),inputsNotUsed:u.array(u.object({input:Ye,reason:Ye}).strict()),blockers:u.array(u.object({component:Ye,problem:Ye,evidence:Ye,fix:Ye}).strict()),replay:u.object({outcome:Ye,durationSeconds:u.number().nonnegative().nullable()}).strict().nullable(),files:u.array(u.object({path:Ye,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===Yr&&!n&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"repository"],message:`only a customer_deployed component is ${Yr}`})}),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)=>{Gm.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!==Yr&&!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 R7=["clean","recipe-drift"];function Bl(e){let t=N0.posix.normalize(e);return t===e&&(t===".skyramp/workspace.yml"||t.startsWith(".skyramp/sut/")&&t.length>13)}var dA=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(dA||{}),Hm=(o=>(o.Trigger="TRIGGER",o.Baseline="BASELINE",o.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",o.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",o.ManualOverride="MANUAL_OVERRIDE",o))(Hm||{}),j0=(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))(j0||{}),dq=["sut_setup"],gq=["sut_setup","schedule","revision_read"];var q0=(t=>(t.PullRequest="pull_request",t))(q0||{}),W0=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))(W0||{}),$0=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var Z0=(o=>(o.ReportUploaded="report_uploaded",o.NoReport="no_report",o.Cancelled="cancelled",o.RecipeUploaded="recipe_uploaded",o.RevisionsUploaded="revisions_uploaded",o))(Z0||{}),K0=(n=>(n.Running="running",n.Ended="ended",n))(K0||{}),X0=(d=>(d.TimedOut="timed_out",d.AgentFailed="agent_failed",d.SetupFailed="setup_failed",d.CredentialMissing="credential_missing",d.RunnerLost="runner_lost",d.CheckoutFailed="checkout_failed",d.EnvironmentUnverified="environment_unverified",d.ModelProviderDenied="model_provider_denied",d.ModelProviderUnavailable="model_provider_unavailable",d.RunnerProviderNotReady="runner_provider_not_ready",d.MergeConflict="merge_conflict",d))(X0||{}),e_=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(e_||{}),jm=(n=>(n.Started="started",n.Finished="finished",n))(jm||{}),t_=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(t_||{});var r_=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(r_||{});var n_=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(n_||{}),qm=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(qm||{}),Jm=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(Jm||{});var Wm=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(Wm||{}),qt=u.string().regex(/^[1-9][0-9]{0,18}$/),Wt=u.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),Ym=u.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),i_=/^[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(i_),it=u.string().regex(/^[0-9a-f]{64}$/),wl=u.object({id:Xe,revision:qt}).strict(),kl={provider:u.literal("github"),providerAccountId:qt,providerRepositoryId:qt},Sl={provider:u.literal("azure-devops"),providerAccountId:Xe,providerRepositoryId:Xe},dr=u.discriminatedUnion("provider",[u.object(kl).strict(),u.object(Sl).strict()]),P7=u.discriminatedUnion("provider",[u.object(kl).passthrough(),u.object(Sl).passthrough()]),bl=e=>`${e.provider}:${e.providerRepositoryId}`,T0={namespace:u.string().min(1),name:u.string().min(1)},o_=u.discriminatedUnion("provider",[u.object({...kl,...T0}).strict(),u.object({...Sl,...T0}).strict()]),F0=u.object({ref:u.string().min(1),revision:Wt}).strict(),fq=u.object({kind:u.nativeEnum(W0),number:qt.optional(),ref:u.string().min(1),revision:Wt,reason:u.nativeEnum(Hm)}).strict(),hq=u.object({repository:o_,revision:Wt,ref:u.string().nullable(),reason:u.nativeEnum(Hm),change:u.object({kind:u.nativeEnum(q0),number:qt,base:F0.optional()}).strict().nullable(),compareWith:F0.optional(),merge:u.array(fq).min(2).optional()}).strict();function pq(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(!$0.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=$0.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 mq(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(c=>c!=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(c=>bl(c.repository))),a=new Set(r.map(c=>bl(c.repository)));return a.size===r.length&&a.size===s.size&&[...a].every(c=>s.has(c))?null:"names every source of the snapshot, once"}var s_=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,a_=/^[1-9][0-9]{0,18}$/,M0=new RegExp(`${s_.source}|${a_.source}`),L0=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,Iq=u.union([u.object({source:u.literal("jira"),site:u.string().regex(L0),key:u.string().regex(s_),updated:u.string().datetime(),contentHash:it}).strict(),u.object({source:u.literal("confluence"),site:u.string().regex(L0),key:u.string().regex(a_),version:u.number().int().positive(),contentHash:it}).strict(),u.object({source:u.literal("other"),key:u.string().regex(Cc),contentHash:it}).strict(),u.object({source:u.literal("other"),key:u.string().regex(yc),contentHash:it,fileName:u.string().min(1).max(255),mediaType:u.nativeEnum(Bc)}).strict()]),P0=u.union([u.literal("jira"),u.literal("confluence")]),O7=u.object({schemaVersion:u.literal(1),items:u.array(u.union([u.object({source:P0,site:u.string(),key:u.string().regex(M0),state:u.literal("read"),text:u.string(),version:u.string().min(1),contentMatches:u.boolean()}).strict(),u.object({source:P0,site:u.string(),key:u.string().regex(M0),state:u.literal("not_read"),reason:u.nativeEnum(sa)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(Cc),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(Cc),state:u.literal("not_read"),reason:u.nativeEnum(sa)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(yc),state:u.literal("read"),version:it,fileName:u.string().min(1).max(255),mediaType:u.nativeEnum(Bc)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(yc),state:u.literal("not_read"),reason:u.nativeEnum(sa)}).strict()])),instructions:u.array(u.string()).optional()}).strict(),Eq=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(),Cq=u.object({schemaVersion:u.literal(1),runId:Xe,skyrampOrgId:Xe,target:wl,policy:wl.nullable(),trigger:u.object({kind:u.nativeEnum(j0),requestedAt:u.string().datetime()}).strict(),configuration:u.object({captureId:Xe,revision:qt.nullable(),hash:it}).strict(),baseline:u.object({confirmedRunId:Xe.nullable(),initialBaselineId:Xe.optional(),comparisonBaselineId:Xe.optional(),knownFailures:u.array(Eq).optional(),sources:u.array(u.object({repository:dr,revision:Wt}).strict()).optional()}).strict().optional(),sources:u.array(hq).min(1).max(1e3),execution:u.object({provider:u.nativeEnum(dA),repository:o_,workflowPath:u.string(),ref:u.string()}).strict(),credentials:u.array(u.object({name:u.string(),purpose:u.nativeEnum(Yg),required:u.boolean()}).strict()),requirements:u.array(Iq).min(1).optional(),instructions:u.object({contentHash:it}).strict().optional(),deployedRevisions:u.array(u.object({repository:dr,revision:Wt}).strict()).min(1).optional()}).strict().superRefine((e,t)=>{let n=new Set;(e.requirements??[]).forEach((A,c)=>{let l="fileName"in A?"file":"pasted";A.source==="other"&&A.key!==`${l}-${A.contentHash.slice(0,16)}`&&t.addIssue({code:u.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",c,"key"]});let d=PQ({source:A.source,key:A.key});n.has(d)&&t.addIssue({code:u.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",c,"key"]}),n.add(d)});let i=e.trigger.kind,r=dq.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=mq(e);o&&t.addIssue({code:u.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:o}),gq.includes(i)&&e.sources.forEach((A,c)=>{A.reason!=="BASELINE"&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c,"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(A=>bl(A.repository))),a=new Set;(e.deployedRevisions??[]).forEach((A,c)=>{let l=bl(A.repository);s.has(l)?a.has(l)&&t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions",c,"repository"],message:"repository appears twice"}):t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions",c,"repository"],message:"names a repository outside the snapshot"}),a.add(l)}),e.sources.forEach((A,c)=>{A.compareWith&&(A.reason!=="MANUAL_OVERRIDE"||A.change)&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"}),e.baseline?.comparisonBaselineId&&(A.change?.base||A.compareWith||A.merge)&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c],message:"a chosen checkpoint cannot be combined with a source comparison base or merge"});let l=pq(A);l&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c,...l.path],message:l.message})})});var A_=(n=>(n.Person="person",n.Policy="policy",n))(A_||{}),yq=u.object({kind:u.nativeEnum(A_),name:u.string().min(1).max(256)}).strict(),Bq=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(),z7=u.object({schemaVersion:u.literal(1),attempt:u.object({id:Xe,number:u.number().int().positive(),deadlineAt:u.string().datetime()}).strict(),manifest:Cq,manifestHash:it,entitlements:u.array(u.string()).optional(),runToken:u.string().min(1).optional(),requestedBy:yq.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:dr,revision:Wt}).strict()).optional(),statedRevisions:u.array(u.object({repository:dr,revision:Wt}).strict()).optional(),runSettings:Bq.optional()}).strict(),O0={providerRunAttempt:u.number().int().positive(),workflowRef:u.string().min(1)},Qq=u.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),G7=u.object({schemaVersion:u.literal(1),runId:Xe,execution:u.discriminatedUnion("provider",[u.object({...O0,provider:u.literal("github"),repository:u.object(kl).strict(),providerRunId:qt}).strict(),u.object({...O0,provider:u.literal("azure-devops"),repository:u.object(Sl).strict(),providerRunId:Qq}).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()}).strict(),z0=u.object({repository:dr,number:qt,commitSha:Wt.optional()}).strict(),Ql=u.array(u.object({repository:dr,reason:u.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),vq=u.object({branch:Ym.optional(),commitSha:Wt.optional()}).strict(),G0=u.object({repository:dr,message:u.string(),...vq.shape}).strict(),wq=u.discriminatedUnion("status",[u.object({status:u.literal("none"),noTests:Ql}).strict(),u.object({status:u.literal("delivered"),noTests:Ql,pullRequests:u.array(z0).min(1)}).strict(),u.object({status:u.literal("partial"),noTests:Ql,pullRequests:u.array(z0).min(1),failures:u.array(G0).min(1)}).strict(),u.object({status:u.literal("failed"),message:u.string(),noTests:Ql,failures:u.array(G0).min(1).optional()}).strict()]),V7=1024*1024,J7=16*1024*1024,vl=e=>u.array(u.object({[e]:u.string()}).strict()).optional(),bq=u.object({language:u.custom(e=>e==="ja","Invalid"),businessCaseAnalysis:u.string(),validation:u.object({rationale:u.string(),gaps:u.array(u.string())}).strict().optional(),changes:u.array(u.object({id:u.string(),text:u.string()}).strict()).optional(),issuesFound:vl("description"),newTestsCreated:vl("description"),testResults:vl("details"),caveats:vl("text")}).strict(),kq=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(ef),rationale:u.string().min(1),gaps:u.array(u.string().min(1)),acceptedEvidence:u.array(u.object({kind:u.nativeEnum(aa),repository:u.string().min(1),revision:Wt,reference:u.string().min(1),summary:u.string().min(1)}).strict()),actionRequired:u.array(u.nativeEnum(tf))}).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"})}),Vm=500,Sq=2048,xq=1e3,Dq=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,V0=e=>e.length>0&&e.length<=64&&e===e.trim()&&!Dq.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),c_=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)&&V0(n)&&V0(i)},Rq=u.object({testResults:u.array(u.object({resultId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:u.string().refine(c_,"Invalid"),testType:u.string(),runtimeTargets:cf.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(rf),family:u.nativeEnum(nf).optional()}).strict().optional(),origin:u.nativeEnum(Xg).optional()}).strict()),validation:kq,changes:u.array(u.object({id:u.string().min(1).max(512),text:u.string().max(16384),source:u.string().max(Sq),testedBy:u.array(u.string().min(1).max(1024)).max(Vm),writtenBy:u.array(u.string().min(1).max(1024)).max(Vm),maintainedBy:u.array(u.string().min(1).max(1024)).max(Vm)}).strict()).max(xq).optional(),traceVersion:u.literal(1),display:bq.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 A=["testResults",s,"resultId"],c=o.resultId.slice(`${o.repository}:${o.testType}:`.length);(!o.resultId.startsWith(`${o.repository}:${o.testType}:`)||c===""||c.startsWith("/")||c.startsWith("#"))&&t.addIssue({code:u.ZodIssueCode.custom,path:A,message:"is not repository:testType:path for this result"}),r.has(o.resultId)&&t.addIssue({code:u.ZodIssueCode.custom,path:A,message:"stable identity repeated"}),r.add(o.resultId)})});var _q=50,Nq=u.discriminatedUnion("kind",[u.object({kind:u.literal("branch_pushed"),repository:dr,branch:Ym,commit:Wt}).strict(),u.object({kind:u.enum(["pull_request_opened","pull_request_edited"]),repository:dr,number:qt,branch:Ym}).strict()]),Uq=u.object({schemaVersion:u.literal(1),run:u.object({runId:Xe,attemptNumber:u.number().int().positive(),manifestHash:it}).strict(),target:wl,policy:wl,provenance:u.object({sources:u.array(u.object({repository:dr,revision:Wt}).strict()),firstQualification:u.literal(!0).optional()}).strict(),delivery:u.object({generatedTests:wq}).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:Rq,githubWrites:u.array(Nq).max(_q).optional()}).strict(),u_=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))(u_||{}),$q=200,Tq=u.object({cause:u.nativeEnum(u_),credential:u.string().regex(Br).optional(),reason:u.string().trim().min(1).max($q).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"}),Fq=u.object({name:u.string().regex(Br),purpose:u.enum(["sut_access","other"]),required:u.boolean(),how:u.string().trim().min(1).max(jg)}).strict(),Y7=Uq.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:U0,check:Tq.optional(),inputs:u.array(Fq).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)=>{Bl(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),LQ.test(o.content)&&n(["files",s,"content"],"is not text");let a=Buffer.byteLength(o.content,"utf8");r+=a,a>Zg&&n(["files",s,"content"],`larger than ${Zg} bytes`)}),r>Kg&&n(["files"],`recipe text over ${Kg} bytes in total`)}),H7=u.object({components:u.array(u.object({name:u.string().min(1),repository:u.string().refine(c_,"Invalid"),observedRevision:u.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:u.nativeEnum(of),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 j7=u.object({schemaVersion:u.literal(1),stage:u.nativeEnum(e_),event:u.nativeEnum(jm),status:u.nativeEnum(t_).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),xl=100,Mq=5e3,Gi=2e3,J0=100,l_=/^[A-Za-z0-9_-]{1,64}$/,Lq=20,Pq=200,Oq=100,zq=100,Gq=200,Y0="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",Vq=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${Y0}/${Y0})$`),Jq=500,Yq=50,Hq=10,jq=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,d_=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,Tt=e=>u.string().max(e).refine(t=>t.trim().length>0&&!d_.test(t),"blank, or not text"),Tr={sequence:u.number().int().min(1).max(Mq),at:u.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},g_=u.object({...Tr,kind:u.literal("reply"),to:u.string().uuid(),outcome:u.nativeEnum(n_),accepted:u.boolean(),text:Tt(Gi),note:u.object({source:u.enum(["target","environment"]),quote:Tt(Gi)}).strict().optional(),kept:Tt(Gi).optional()}).strict();function f_(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 qq=u.discriminatedUnion("kind",[u.object({...Tr,kind:u.literal("log"),phase:u.nativeEnum(qm),text:Tt(Gi)}).strict(),u.object({...Tr,kind:u.literal("component"),name:Tt(J0),repository:Tt(Gq).refine(e=>Vq.test(e)||e===Yr,"not owner/name"),file:Tt(Jq).nullable(),status:u.nativeEnum(Wm),version:Tt(zq).optional()}).strict(),g_,u.object({...Tr,kind:u.literal("question"),id:u.string().regex(l_),type:u.nativeEnum(r_),text:Tt(Gi),component:Tt(J0).nullable(),choices:u.array(Tt(Pq)).max(Lq),placeholder:Tt(Oq).optional()}).strict(),u.object({...Tr,kind:u.literal("delivered"),ids:u.array(u.string().uuid()).max(xl)}).strict(),u.object({...Tr,kind:u.literal("credentials"),names:u.array(u.string().regex(Br)).min(1).max(Yq),logins:u.array(u.object({key:u.string().regex(jq),usernameVariable:u.string().regex(Br),passwordVariable:u.string().regex(Br)}).strict()).min(1).max(Hq).optional()}).strict()]).superRefine((e,t)=>{if(f_(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=>_0(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==="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"}))}),q7=u.object({schemaVersion:u.literal(1),events:u.array(qq).max(xl)}).strict(),Wq=u.discriminatedUnion("kind",[u.object({...Tr,kind:u.literal("log"),stage:u.nativeEnum(Jm),text:Tt(Gi)}).strict(),g_,u.object({...Tr,kind:u.literal("delivered"),ids:u.array(u.string().uuid()).max(xl)}).strict(),u.object({...Tr,kind:u.literal("stage"),stage:u.nativeEnum(Jm),event:u.nativeEnum(jm)}).strict(),u.object({...Tr,kind:u.literal("test"),resultId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/),status:u.enum(["Pass","Fail","Skipped"]),details:u.string().max(Gi).refine(e=>!d_.test(e),"not text")}).strict()]).superRefine(f_),W7=u.object({schemaVersion:u.literal(1),events:u.array(Wq).max(xl)}).strict(),H0={id:u.string().uuid(),text:u.string(),by:u.string().nullable(),at:u.string(),replied:u.literal(!0).optional()},h_=u.discriminatedUnion("kind",[u.object({...H0,kind:u.literal("instruction"),question:u.null()}),u.object({...H0,kind:u.literal("answer"),question:u.string().regex(l_)})]),p_=u.string().regex(/^[A-Za-z0-9+/]{43}=$/),Zq=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()}),Z7=u.object({schemaVersion:u.literal(1),leftOut:u.array(u.string()),messages:u.array(h_).optional(),stop:u.object({key:p_}).optional(),notes:Zq.optional()}),K7=u.object({schemaVersion:u.literal(1),messages:u.array(h_).optional()});var Kq=500*1024*1024,m_=u.object({id:qt,name:u.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:qt,expiresAt:u.string().datetime()}).strict(),X7=u.object({schemaVersion:u.literal(1),artifact:m_,sessionId:Xe,contentHash:it,bytes:u.number().int().min(1).max(Kq)}).strict(),eee=u.object({schemaVersion:u.literal(1),checkpoint:u.object({artifact:m_,repository:u.object({namespace:u.string().min(1),name:u.string().min(1)}).strict(),sessionId:Xe,contentHash:it,key:p_}).strict().nullable()}).strict(),Xq=200,fs=100,I_=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(I_||{}),eW=u.object({kind:u.nativeEnum(I_),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(Wm)}).strict()).max(fs),credentials:u.array(u.string().min(1)).max(fs),answers:u.array(u.object({question:u.string(),answer:u.string().nullable()}).strict()).max(fs),instructions:u.array(u.object({text:u.string(),reply:u.string().nullable()}).strict()).max(fs),log:u.array(u.object({phase:u.nativeEnum(qm),text:u.string()}).strict()).max(Xq),recipe:u.object({files:u.array(u.object({path:u.string().min(1),content:u.string()}).strict()).max(fs),blockers:u.array(u.object({component:u.string(),problem:u.string(),evidence:u.string(),fix:u.string()}).strict()).max(fs)}).strict().optional()}).strict(),tee=u.object({schemaVersion:u.literal(1),context:eW.nullable()}).strict(),ree=u.object({schemaVersion:u.literal(1),configuration:u.object({captureId:Xe,revision:qt.nullable(),hash:it}).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()}).passthrough().optional()}).passthrough(),provenance:u.object({}).passthrough(),hash:it}).strict()}).strict(),tW=mo.extend({version:u.number().int().positive(),components:u.array(u.object({name:u.string().min(1),repository:u.string().min(1)}).strict()),contentHash:it.optional(),files:u.array(u.object({path:u.string().refine(e=>Bl(e)&&!Gm.includes(e),"not a file of a customer_deployed plan"),content:u.string()}).strict()).optional()}).strict(),nee=u.object({schemaVersion:u.literal(1),testEnvironment:tW.nullable().optional(),runtimePlan:u.object({version:u.number().int().positive(),contentHash:it,files:u.array(u.object({path:u.string().refine(Bl,"not a recipe file path"),content:u.string()}).strict()).min(1),repository:yl.optional(),recipeRepository:yl.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"]}),iee=u.object({schemaVersion:u.literal(1),state:u.nativeEnum(K0),ending:u.nativeEnum(Z0).nullable(),cause:u.nativeEnum(X0).nullable(),deadlineAt:u.string().datetime()}).strict();var rW=50,oee=u.object({repository:dr,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(rW)}).strict();var iW=".skyramp/sut/deployed-revisions.sh",E_=(n=>(n.Running="running",n.Requested="requested",n))(E_||{});var fee=new Set(Object.values(E_));var hee=`Fix ${iW} so it prints the full commit each component runs, then set it up again.`;var qn=ut(require("fs")),jn=ut(require("http")),l8=ut(require("https")),Mg=ut(require("dns")),xT=require("module"),Le=ut(require("net"));var Lg=ut(require("path")),Pg=require("stream"),DT=require("stream/promises"),RT=require("timers/promises"),Wn=ut(require("tls"));var ee={};Ir(ee,{$brand:()=>uI,$input:()=>TC,$output:()=>$C,INVALID:()=>at,NEVER:()=>cI,TimePrecision:()=>jC,ZodAny:()=>$B,ZodArray:()=>LB,ZodBase64:()=>wg,ZodBase64URL:()=>bg,ZodBigInt:()=>Ks,ZodBigIntFormat:()=>xg,ZodBoolean:()=>Zs,ZodCIDRv4:()=>Qg,ZodCIDRv6:()=>vg,ZodCUID:()=>pg,ZodCUID2:()=>mg,ZodCatch:()=>sQ,ZodCodec:()=>ac,ZodCompileAsyncError:()=>fr,ZodCompileUnsupportedError:()=>oe,ZodCreditCard:()=>kB,ZodCustom:()=>Ac,ZodCustomStringFormat:()=>so,ZodDate:()=>tc,ZodDefault:()=>eQ,ZodDiscriminatedUnion:()=>OB,ZodE164:()=>kg,ZodEmail:()=>dg,ZodEmoji:()=>fg,ZodEnum:()=>js,ZodError:()=>vK,ZodExactOptional:()=>Ng,ZodFile:()=>WB,ZodFirstPartyTypeKind:()=>CQ,ZodFunction:()=>pQ,ZodGUID:()=>gg,ZodIBAN:()=>SB,ZodIPv4:()=>yg,ZodIPv6:()=>Bg,ZodISODate:()=>Jn,ZodISODateTime:()=>Vn,ZodISODuration:()=>Hn,ZodISOTime:()=>Yn,ZodInstanceOf:()=>EQ,ZodIntersection:()=>zB,ZodIssueCode:()=>kK,ZodJWT:()=>Sg,ZodKSUID:()=>Cg,ZodLazy:()=>gQ,ZodLiteral:()=>qB,ZodMAC:()=>bB,ZodMap:()=>HB,ZodNaN:()=>AQ,ZodNanoID:()=>hg,ZodNever:()=>FB,ZodNonOptional:()=>Ug,ZodNull:()=>NB,ZodNullable:()=>XB,ZodNumber:()=>Ws,ZodNumberFormat:()=>ao,ZodObject:()=>nc,ZodOptional:()=>oc,ZodPipe:()=>sc,ZodPrefault:()=>rQ,ZodPreprocess:()=>cQ,ZodPromise:()=>hQ,ZodReadonly:()=>uQ,ZodRealError:()=>vt,ZodRecord:()=>Hs,ZodSet:()=>jB,ZodString:()=>qs,ZodStringFormat:()=>me,ZodSuccess:()=>oQ,ZodSymbol:()=>RB,ZodTemplateLiteral:()=>dQ,ZodTransform:()=>ZB,ZodTuple:()=>VB,ZodType:()=>X,ZodULID:()=>Ig,ZodURL:()=>ec,ZodUUID:()=>Pr,ZodUndefined:()=>_B,ZodUnion:()=>ic,ZodUnknown:()=>TB,ZodVoid:()=>MB,ZodXID:()=>Eg,ZodXor:()=>PB,_ZodString:()=>lg,_default:()=>tQ,_function:()=>tT,any:()=>_$,array:()=>rc,base64:()=>d$,base64url:()=>g$,bigint:()=>k$,boolean:()=>DB,catch:()=>aQ,check:()=>rT,cidrv4:()=>u$,cidrv6:()=>l$,clone:()=>ge,codec:()=>Z$,coerce:()=>BQ,compile:()=>PC,config:()=>Re,core:()=>un,creditCard:()=>h$,cuid:()=>r$,cuid2:()=>n$,currencyCode:()=>y$,custom:()=>nT,date:()=>U$,decode:()=>EB,decodeAsync:()=>yB,deepPartial:()=>pT,describe:()=>iT,discriminatedUnion:()=>P$,e164:()=>f$,email:()=>YU,emoji:()=>e$,encode:()=>IB,encodeAsync:()=>CB,endsWith:()=>Ts,enum:()=>Rg,exactOptional:()=>KB,file:()=>H$,flattenError:()=>QA,float32:()=>Q$,float64:()=>v$,formatError:()=>vA,fromJSONSchema:()=>fT,function:()=>tT,getDiscriminatedOption:()=>cC,getErrorMap:()=>xK,globalRegistry:()=>je,gt:()=>Mr,gte:()=>Mt,guid:()=>HU,hash:()=>B$,hex:()=>C$,hostname:()=>E$,httpUrl:()=>XU,iban:()=>p$,includes:()=>Us,input:()=>IT,instanceof:()=>sT,int:()=>cg,int32:()=>w$,int64:()=>S$,intersection:()=>GB,invertCodec:()=>K$,ipv4:()=>a$,ipv6:()=>c$,iso:()=>cc,json:()=>AT,jwt:()=>m$,keyof:()=>$$,ksuid:()=>s$,lazy:()=>fQ,length:()=>to,literal:()=>Y$,locales:()=>VA,looseObject:()=>M$,looseRecord:()=>z$,lowercase:()=>_s,lt:()=>Fr,lte:()=>Ft,mac:()=>A$,map:()=>G$,maxLength:()=>eo,maxSize:()=>Pn,memoizer:()=>zA,meta:()=>oT,mime:()=>Ms,minLength:()=>cn,minSize:()=>Lr,multipleOf:()=>Ln,nan:()=>W$,nanoid:()=>t$,nativeEnum:()=>J$,negative:()=>Kd,never:()=>Dg,nonnegative:()=>eg,nonoptional:()=>iQ,nonpositive:()=>Xd,normalize:()=>Ls,null:()=>UB,nullable:()=>XA,nullish:()=>j$,number:()=>xB,object:()=>T$,optional:()=>io,output:()=>ET,overwrite:()=>hr,parse:()=>fB,parseAsync:()=>hB,partialRecord:()=>O$,pipe:()=>ug,positive:()=>Zd,prefault:()=>nQ,preprocess:()=>cT,prettifyError:()=>hI,promise:()=>eT,properties:()=>Fs,property:()=>tg,readonly:()=>lQ,record:()=>YB,refine:()=>mQ,regex:()=>Rs,regexes:()=>Xt,registry:()=>bd,safeDecode:()=>QB,safeDecodeAsync:()=>wB,safeEncode:()=>BB,safeEncodeAsync:()=>vB,safeParse:()=>pB,safeParseAsync:()=>mB,set:()=>V$,setErrorMap:()=>SK,size:()=>Xi,slugify:()=>Gs,startsWith:()=>$s,strictObject:()=>F$,string:()=>KA,stringFormat:()=>I$,stringbool:()=>aT,success:()=>q$,superRefine:()=>IQ,symbol:()=>D$,templateLiteral:()=>X$,toJSONSchema:()=>og,toLowerCase:()=>Os,toUpperCase:()=>zs,toZod:()=>gA,transform:()=>_g,treeifyError:()=>fI,trim:()=>Ps,tuple:()=>JB,uint32:()=>b$,uint64:()=>x$,ulid:()=>i$,undefined:()=>R$,union:()=>Xs,unknown:()=>no,uppercase:()=>Ns,url:()=>KU,util:()=>B,uuid:()=>jU,uuidv4:()=>qU,uuidv6:()=>WU,uuidv7:()=>ZU,validate:()=>wA,validateAsync:()=>bA,void:()=>N$,withParser:()=>kd,xid:()=>o$,xor:()=>L$});var un={};Ir(un,{$ZodAny:()=>eC,$ZodArray:()=>sC,$ZodAsyncError:()=>Bt,$ZodBase64:()=>zE,$ZodBase64URL:()=>GE,$ZodBigInt:()=>dd,$ZodBigIntFormat:()=>WE,$ZodBoolean:()=>TA,$ZodCIDRv4:()=>PE,$ZodCIDRv6:()=>OE,$ZodCUID:()=>SE,$ZodCUID2:()=>xE,$ZodCatch:()=>wC,$ZodCheck:()=>Ce,$ZodCheckBigIntFormat:()=>tE,$ZodCheckEndsWith:()=>gE,$ZodCheckGreaterThan:()=>Wl,$ZodCheckIncludes:()=>lE,$ZodCheckLengthEquals:()=>aE,$ZodCheckLessThan:()=>ql,$ZodCheckLowerCase:()=>cE,$ZodCheckMaxLength:()=>oE,$ZodCheckMaxSize:()=>rE,$ZodCheckMimeType:()=>pE,$ZodCheckMinLength:()=>sE,$ZodCheckMinSize:()=>nE,$ZodCheckMultipleOf:()=>XI,$ZodCheckNumberFormat:()=>eE,$ZodCheckOverwrite:()=>mE,$ZodCheckProperties:()=>hE,$ZodCheckProperty:()=>fE,$ZodCheckRegex:()=>AE,$ZodCheckSizeEquals:()=>iE,$ZodCheckStartsWith:()=>dE,$ZodCheckStringFormat:()=>bs,$ZodCheckUpperCase:()=>uE,$ZodCodec:()=>MA,$ZodCreditCard:()=>JE,$ZodCustom:()=>_C,$ZodCustomStringFormat:()=>jE,$ZodCyclicError:()=>Ed,$ZodDate:()=>iC,$ZodDefault:()=>yC,$ZodDiscriminatedUnion:()=>uC,$ZodE164:()=>VE,$ZodEmail:()=>BE,$ZodEmoji:()=>bE,$ZodEncodeError:()=>Fn,$ZodEnum:()=>hC,$ZodError:()=>gI,$ZodExactOptional:()=>EC,$ZodFile:()=>mC,$ZodFunction:()=>DC,$ZodGUID:()=>CE,$ZodIBAN:()=>YE,$ZodIPv4:()=>FE,$ZodIPv6:()=>ME,$ZodISODate:()=>UE,$ZodISODateTime:()=>NE,$ZodISODuration:()=>TE,$ZodISOTime:()=>$E,$ZodIntersection:()=>lC,$ZodJWT:()=>HE,$ZodKSUID:()=>_E,$ZodLazy:()=>LA,$ZodLiteral:()=>pC,$ZodMAC:()=>LE,$ZodMap:()=>gC,$ZodNaN:()=>bC,$ZodNanoID:()=>kE,$ZodNever:()=>rC,$ZodNonOptional:()=>QC,$ZodNull:()=>XE,$ZodNullable:()=>CC,$ZodNumber:()=>ld,$ZodNumberFormat:()=>qE,$ZodObject:()=>rN,$ZodObjectJIT:()=>aC,$ZodOptional:()=>fd,$ZodPipe:()=>hd,$ZodPrefault:()=>BC,$ZodPreprocess:()=>kC,$ZodPromise:()=>RC,$ZodReadonly:()=>SC,$ZodRealError:()=>Qt,$ZodRecord:()=>dC,$ZodRegistry:()=>wd,$ZodSet:()=>fC,$ZodString:()=>qi,$ZodStringFormat:()=>fe,$ZodSuccess:()=>vC,$ZodSymbol:()=>ZE,$ZodTemplateLiteral:()=>xC,$ZodTransform:()=>IC,$ZodTuple:()=>gd,$ZodType:()=>W,$ZodULID:()=>DE,$ZodURL:()=>wE,$ZodUUID:()=>yE,$ZodUndefined:()=>KE,$ZodUnion:()=>FA,$ZodUnknown:()=>tC,$ZodVoid:()=>nC,$ZodXID:()=>RE,$ZodXor:()=>AC,$brand:()=>uI,$constructor:()=>I,$input:()=>TC,$output:()=>$C,Doc:()=>ji,INVALID:()=>at,JSONSchema:()=>GU,JSONSchemaGenerator:()=>sg,NEVER:()=>cI,TimePrecision:()=>jC,URL_BAD_FORMAT:()=>QE,URL_UNPARSEABLE:()=>RA,ZodCompileAsyncError:()=>fr,ZodCompileUnsupportedError:()=>oe,_any:()=>ly,_array:()=>Iy,_base64:()=>Hd,_base64url:()=>jd,_bigint:()=>iy,_boolean:()=>ry,_catch:()=>dK,_check:()=>kU,_cidrv4:()=>Jd,_cidrv6:()=>Yd,_coercedBigint:()=>oy,_coercedBoolean:()=>ny,_coercedDate:()=>py,_coercedNumber:()=>WC,_coercedString:()=>VC,_creditCard:()=>YC,_cuid:()=>Md,_cuid2:()=>Ld,_custom:()=>Cy,_date:()=>hy,_decode:()=>Ml,_decodeAsync:()=>Pl,_default:()=>cK,_discriminatedUnion:()=>Z9,_e164:()=>qd,_email:()=>Dd,_emoji:()=>Td,_encode:()=>Fl,_encodeAsync:()=>Ll,_endsWith:()=>Ts,_enum:()=>nK,_file:()=>Ey,_float32:()=>KC,_float64:()=>XC,_gt:()=>Mr,_gte:()=>Mt,_guid:()=>Rd,_iban:()=>HC,_includes:()=>Us,_int:()=>ZC,_int32:()=>ey,_int64:()=>sy,_intersection:()=>K9,_ipv4:()=>Gd,_ipv6:()=>Vd,_isoDate:()=>HA,_isoDateTime:()=>YA,_isoDuration:()=>qA,_isoTime:()=>jA,_jwt:()=>Wd,_ksuid:()=>zd,_lazy:()=>pK,_length:()=>to,_literal:()=>oK,_lowercase:()=>_s,_lt:()=>Fr,_lte:()=>Ft,_mac:()=>JC,_map:()=>tK,_max:()=>Ft,_maxLength:()=>eo,_maxSize:()=>Pn,_mime:()=>Ms,_min:()=>Mt,_minLength:()=>cn,_minSize:()=>Lr,_multipleOf:()=>Ln,_nan:()=>my,_nanoid:()=>Fd,_nativeEnum:()=>iK,_negative:()=>Kd,_never:()=>gy,_nonnegative:()=>eg,_nonoptional:()=>uK,_nonpositive:()=>Xd,_normalize:()=>Ls,_null:()=>uy,_nullable:()=>AK,_number:()=>qC,_optional:()=>aK,_overwrite:()=>hr,_parse:()=>Bs,_parseAsync:()=>Qs,_pipe:()=>gK,_positive:()=>Zd,_promise:()=>mK,_properties:()=>Fs,_property:()=>tg,_readonly:()=>fK,_record:()=>eK,_refine:()=>yy,_regex:()=>Rs,_safeDecode:()=>zl,_safeDecodeAsync:()=>Vl,_safeEncode:()=>Ol,_safeEncodeAsync:()=>Gl,_safeParse:()=>vs,_safeParseAsync:()=>ws,_set:()=>rK,_size:()=>Xi,_slugify:()=>Gs,_startsWith:()=>$s,_string:()=>GC,_stringFormat:()=>ro,_stringbool:()=>wy,_success:()=>lK,_superRefine:()=>By,_symbol:()=>Ay,_templateLiteral:()=>hK,_toLowerCase:()=>Os,_toUpperCase:()=>zs,_transform:()=>sK,_trim:()=>Ps,_tuple:()=>X9,_uint32:()=>ty,_uint64:()=>ay,_ulid:()=>Pd,_undefined:()=>cy,_union:()=>q9,_unknown:()=>dy,_uppercase:()=>Ns,_url:()=>JA,_uuid:()=>_d,_uuidv4:()=>Nd,_uuidv6:()=>Ud,_uuidv7:()=>$d,_void:()=>fy,_xid:()=>Od,_xor:()=>W9,base64Charset:()=>sd,base64urlCharset:()=>$A,canParseURL:()=>vE,clone:()=>ge,compile:()=>PC,compileFn:()=>Sd,config:()=>Re,createStandardJSONSchemaMethod:()=>Vs,createToJSONSchemaMethod:()=>ky,decode:()=>WW,decodeAsync:()=>KW,describe:()=>Qy,encode:()=>qW,encodeAsync:()=>ZW,extractDefs:()=>zn,finalize:()=>Gn,flattenError:()=>QA,formatError:()=>vA,getDiscriminatedOption:()=>cC,globalConfig:()=>ze,globalRegistry:()=>je,handleUnrepresentable:()=>Fe,initializeContext:()=>On,isBackEdge:()=>yd,isRecursiveSchema:()=>Cd,isValidBase64:()=>UA,isValidBase64URL:()=>ad,isValidCIDRv6:()=>od,isValidCreditCard:()=>Ad,isValidIBAN:()=>cd,isValidIPv6:()=>NA,isValidJWT:()=>ud,locales:()=>VA,memoizer:()=>zA,mergeValues:()=>ks,meta:()=>vy,parse:()=>$l,parseAsync:()=>Tl,parseURLObject:()=>X_,prettifyError:()=>hI,process:()=>he,processSchema:()=>he,regexes:()=>Xt,registry:()=>bd,safeDecode:()=>eZ,safeDecodeAsync:()=>rZ,safeEncode:()=>XW,safeEncodeAsync:()=>tZ,safeParse:()=>VW,safeParseAsync:()=>JW,standardProps:()=>td,stripTabAndNewline:()=>_A,toDotPath:()=>__,toJSONSchema:()=>og,toZod:()=>gA,treeifyError:()=>fI,urlHostnameOk:()=>nd,urlProtocolOk:()=>id,util:()=>B,validate:()=>wA,validateAsync:()=>bA,validateURL:()=>rd,version:()=>IE,withParser:()=>kd});var B={};Ir(B,{BIGINT_FORMAT_RANGES:()=>IA,CONSTANT_CATCH:()=>Nl,Class:()=>Xm,NUMBER_FORMAT_RANGES:()=>mA,aborted:()=>st,allowsEval:()=>rI,assert:()=>uW,assertEqual:()=>sW,assertIs:()=>AW,assertNever:()=>cW,assertNotEqual:()=>aW,assignProp:()=>He,attachSchema:()=>EA,base64ToUint8Array:()=>b_,base64urlToUint8Array:()=>xW,cached:()=>Is,captureStackTrace:()=>Rl,cleanEnum:()=>SW,cleanRegex:()=>an,clone:()=>ge,cloneDef:()=>gW,codePointLength:()=>Yi,constantCatch:()=>aI,createTransparentProxy:()=>EW,defineLazy:()=>eI,defineLazyInternal:()=>re,derived:()=>NW,esc:()=>ot,escapeRegex:()=>Kt,explicitlyAborted:()=>oI,extend:()=>BW,finalizeIssue:()=>yt,floatSafeRemainder:()=>fA,getElementAtPath:()=>fW,getEnumValues:()=>ps,getLengthableOrigin:()=>yA,getParsedType:()=>IW,getSizableOrigin:()=>CA,hexToUint8Array:()=>RW,hide:()=>BA,installLazyProp:()=>FW,isObject:()=>Ji,isPlainObject:()=>Zt,issue:()=>ys,joinValues:()=>E,jsonStringifyReplacer:()=>ms,members:()=>sI,merge:()=>vW,mergeDefs:()=>gr,normalizeParams:()=>x,nullish:()=>Dl,numKeys:()=>mW,objectClone:()=>lW,omit:()=>yW,optionalKeys:()=>iI,own:()=>Tn,parsedType:()=>v,partial:()=>wW,pick:()=>CW,prefixIssues:()=>Ct,primitiveTypes:()=>nI,promiseAllObject:()=>hW,propertyKeyTypes:()=>pA,randomString:()=>pW,rawShape:()=>Es,required:()=>bW,safeExtend:()=>QW,shallowClone:()=>hA,sizeCaps:()=>Cs,slugify:()=>tI,stringifyPrimitive:()=>Q,toZod:()=>gA,uint8ArrayToBase64:()=>k_,uint8ArrayToBase64url:()=>DW,uint8ArrayToHex:()=>_W,unwrapMessage:()=>hs});function sW(e){return e}function aW(e){return e}function gA(){return e=>e}function AW(e){}function cW(e){throw new Error("Unexpected value in exhaustive check")}function uW(e){}function ps(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 E(e,t="|"){return e.map(n=>Q(n)).join(t)}function ms(e,t){return typeof t=="bigint"?t.toString():t}var Km=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 Is(e){return new Km(e)}function Dl(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 fA(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 B_=Symbol("evaluating");function eI(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==B_)return i===void 0&&(i=B_,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function lW(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function He(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Es(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function sn(e){return Es(e._zod.def)??e._zod.def.shape}function Q_(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return He(this,t,i),i},enumerable:!0,configurable:!0})}function v_(e,t,n){t in e?He(e,t,n):e[t]=n}function Vi(e,t,n,i){let r=sn(t);for(let o of n){let s=Object.getOwnPropertyDescriptor(r,o);s.enumerable&&(s.get?Q_(e,o,()=>{let a=t._zod.def.shape[o];return i?i(a,o):a}):v_(e,o,i?i(s.value,o):s.value))}}function dW(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?Q_(e,n,()=>t[n]):v_(e,n,i.value))}}function gr(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function gW(e){return gr(e._zod.def)}function fW(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function hW(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 pW(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function ot(e){return JSON.stringify(e)}function tI(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Rl="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ji(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var rI=Is(()=>{if(ze.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Zt(e){if(Ji(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Ji(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function hA(e){return Zt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function mW(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var IW=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}`)}},pA=new Set(["string","number","symbol"]),nI=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Kt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ge(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 EW(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 iI(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var mA={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]},IA={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function CW(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 Vi(o,e,_l(e,t)),ge(e,gr(n,{shape:o,checks:[]}))}function _l(e,t){let n=sn(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 yW(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(_l(e,t)),s={};return Vi(s,e,Reflect.ownKeys(sn(e)).filter(a=>!o.has(a))),ge(e,gr(n,{shape:s,checks:[]}))}function BW(e,t){if(!Zt(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=sn(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 ge(e,gr(e._zod.def,{shape:w_(e,t)}))}function w_(e,t){let n={};return Vi(n,e,Reflect.ownKeys(sn(e))),dW(n,t),n}function QW(e,t){if(!Zt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ge(e,gr(e._zod.def,{shape:w_(e,t)}))}function vW(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={};Vi(n,e,Reflect.ownKeys(sn(e))),Vi(n,t,Reflect.ownKeys(sn(t)));let i=gr(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ge(e,i)}function wW(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(_l(t,n)):void 0,A={};return Vi(A,t,Reflect.ownKeys(sn(t)),e&&((c,l)=>a&&!a.has(l)?c:new e({type:"optional",innerType:c}))),ge(t,gr(t._zod.def,{shape:A,checks:[]}))}function bW(e,t,n){let i=n?new Set(_l(t,n)):void 0,r={};return Vi(r,t,Reflect.ownKeys(sn(t)),(o,s)=>i&&!i.has(s)?o:new e({type:"nonoptional",innerType:o})),ge(t,gr(t._zod.def,{shape:r}))}function st(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 oI(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 Ct(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function hs(e){return typeof e=="string"?e:e?.message}function Cs(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 EA(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}function yt(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:hs(e.inst?._zod.def?.error?.(e))??hs(o?.(e))??hs(t?.error?.(e))??hs(n.customError?.(e))??hs(n.localeError?.(e))??"Invalid input",a={};for(let A of Object.keys(e))A==="inst"||A==="schema"||A==="continue"||A==="input"||A==="__proto__"||(a[A]=e[A]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function CA(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var kW=/[\uD800-\uDBFF]/;function Yi(e){let t=e.length;if(!kW.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 yA(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function v(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 ys(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function SW(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function b_(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 k_(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function xW(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return b_(t+n)}function DW(e){return k_(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function RW(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 _W(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Xm=class{constructor(...t){}};function sI(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):UW(e,n,i.value)}}function Tn(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function BA(e,t,n){return Tn(e,t,n,!1)}function NW(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Tn(this,n,i(this))},set(r){Tn(this,n,r)}})}return t}function UW(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Tn(this,t,n.bind(this))},set(i){Tn(this,t,i)}})}function $W(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Zm,$n=!1,TW={configurable:!0,get(){$n=!0}};function re(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&Zm!==e._zod){Zm=void 0;return}Zm=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,TW);let r=$n;$n=!1;try{let o=n(this);return $n?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),$n=$n||r,o}catch(o){throw delete this[t],$n=$n||r,o}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}function FW(e,t,n,i){let r=$W(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 Nl="~constantCatch";function aI(e){let t=()=>e;return t[Nl]=!0,t}var S_,cI=Object.freeze({status:"aborted"}),AI={value:void 0,enumerable:!1},x_="captureStackTrace"in Error?Error:null;function MW(e){let t=x_;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return x_=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function I(e,t,n,i){let r={};function o(g){this.def=g,this.constr=d,this.traits=new Set}o.prototype=r;let s=n,a=s&&new WeakSet;function A(g,f){if(g._zod){if(g._zod.traits.has(e))return}else{AI.value=new o(f);try{Object.defineProperty(g,"_zod",AI)}finally{AI.value=void 0}}if(g._zod.traits.add(e),t(g,f),a){let p=Object.getPrototypeOf(g),C=g._zod.constr.prototype,m=p;for(;m&&m!==C;)m=Object.getPrototypeOf(m);let y=m??p;a.has(y)||(a.add(y),sI(y,s))}let h=d.prototype;for(let p in h)Object.prototype.hasOwnProperty.call(h,p)&&(p in g||(g[p]=h[p].bind(g)))}let c=i?.Parent??Object;class l extends c{}Object.defineProperty(l,"name",{value:e});function d(g){let f=i?.Parent?MW(l):this;A(f,g);let h=f._zod.deferred;if(h){for(let C of h)C();f._zod.deferred=void 0}let p=globalThis.__zod_globalConfig?.postProcessor;return p&&p(f),f}return Object.defineProperty(d,"init",{value:A}),Object.defineProperty(d,Symbol.hasInstance,{value:g=>i?.Parent&&g instanceof i.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var uI=Symbol("zod_brand"),Bt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Fn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(S_=globalThis).__zod_globalConfig??(S_.__zod_globalConfig={});var ze=globalThis.__zod_globalConfig;function Re(e){return e&&Object.assign(ze,e),ze}function LW(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,ms,2)),e.message}function PW(e){this._zod.message=e}var OW={get:LW,set:PW,enumerable:!0,configurable:!0},dI={value:void 0,enumerable:!1},D_=new WeakSet([Object.prototype,Error.prototype]),R_=(e,t)=>{e.name="$ZodError",dI.value=t,Object.defineProperty(e,"issues",dI),dI.value=void 0,Object.defineProperty(e,"message",OW);let n=Object.getPrototypeOf(e);D_.has(n)||(D_.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})}}))},gI=I("$ZodError",R_),Qt=I("$ZodError",R_,void 0,{Parent:Error});function zW(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 QA(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?zW(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}function vA(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 A=n,c=0;for(;c<a.length;){let l=a[c],d=c===a.length-1;if(l==="_errors"){d&&A._errors.push(t(s)),c++;continue}Object.prototype.hasOwnProperty.call(A,l)||Object.defineProperty(A,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let g=A[l];d&&g._errors.push(t(s)),A=g,c++}}}};return i(e),n}function fI(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(A=>i({issues:A},[...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 A=[...o,...a.path];if(A.length===0){n.errors.push(t(a));continue}let c=n,l=0;for(;l<A.length;){let d=A[l],g=l===A.length-1;typeof d=="string"?(c.properties??(c.properties={}),Object.prototype.hasOwnProperty.call(c.properties,d)||Object.defineProperty(c.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),c=c.properties[d]):(c.items??(c.items=[]),(s=c.items)[d]??(s[d]={errors:[]}),c=c.items[d]),g&&c.errors.push(t(a)),l++}}};return i(e),n}function __(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 hI(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 ${__(i.path)}`);return t.join(`
|
|
47
47
|
`)}function Ul(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Bs=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 Bt;if(a.issues.length){let A=new(o?.Err??e)(a.issues.map(c=>yt(c,s,Re())));throw Rl(A,o?.callee??t),A}return a.value};return t},$l=Bs(Qt),Qs=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 A=new(o?.Err??e)(a.issues.map(c=>yt(c,s,Re())));throw Rl(A,o?.callee??t),A}return a.value};return t},Tl=Qs(Qt),vs=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 Bt;return o.issues.length?N_(e,o.issues,r):{success:!0,data:o.value}},VW=vs(Qt);function N_(e,t,n){let i;return{success:!1,get error(){return i||(i=new e(t.map(r=>yt(r,n,Re()))),t=void 0,n=void 0),i},set error(r){i=r,t=void 0,n=void 0}}}var ws=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?N_(e,o.issues,r):{success:!0,data:o.value}},JW=ws(Qt),YW=Symbol.for("zod.compile.invalid"),HW=Symbol.for("zod.compile.fallback"),wA=((e,t,n)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==YW)return!0;if(i.definite===!0&&n===void 0)return!1}return jW(e,t,n)});function jW(e,t,n){let i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},r=e._zod.bag.fallbackRun,o;if(r?(i[HW]=!0,o=r({value:t,issues:[]},i)):o=e._zod.run({value:t,issues:[]},i),o instanceof Promise)throw new Bt;return o.issues.length===0}var bA=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},Fl=e=>{let t=Bs(e),n=(i,r,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return t(i,r,a,Ul(n,s))};return n},qW=Fl(Qt),Ml=e=>{let t=Bs(e),n=(i,r,o,s)=>t(i,r,o,Ul(n,s));return n},WW=Ml(Qt),Ll=e=>{let t=Qs(e),n=async(i,r,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return await t(i,r,a,Ul(n,s))};return n},ZW=Ll(Qt),Pl=e=>{let t=Qs(e),n=async(i,r,o,s)=>await t(i,r,o,Ul(n,s));return n},KW=Pl(Qt),Ol=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return vs(e)(t,n,r)},XW=Ol(Qt),zl=e=>(t,n,i)=>vs(e)(t,n,i),eZ=zl(Qt),Gl=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return ws(e)(t,n,r)},tZ=Gl(Qt),Vl=e=>async(t,n,i)=>ws(e)(t,n,i),rZ=Vl(Qt);var Xt={};Ir(Xt,{anyString:()=>zI,base64:()=>NI,base64url:()=>UI,bigint:()=>VI,boolean:()=>JI,browserEmail:()=>uZ,cidrv4:()=>RI,cidrv6:()=>_I,creditCard:()=>Jl,cuid:()=>mI,cuid2:()=>II,currencyCode:()=>MI,date:()=>LI,datetime:()=>OI,domain:()=>TI,duration:()=>vI,e164:()=>FI,email:()=>bI,emoji:()=>kI,extendedDuration:()=>nZ,guid:()=>wI,hex:()=>WI,hostname:()=>$I,html5Email:()=>aZ,httpProtocol:()=>kA,iban:()=>Yl,idnEmail:()=>cZ,integer:()=>SA,ipv4:()=>SI,ipv6:()=>xI,ksuid:()=>yI,lowercase:()=>jI,mac:()=>DI,md5_base64:()=>fZ,md5_base64url:()=>hZ,md5_hex:()=>gZ,nanoid:()=>BI,nanoidOfLength:()=>QI,null:()=>YI,number:()=>An,rfc5322Email:()=>AZ,sha1_base64:()=>mZ,sha1_base64url:()=>IZ,sha1_hex:()=>pZ,sha256_base64:()=>CZ,sha256_base64url:()=>yZ,sha256_hex:()=>EZ,sha384_base64:()=>QZ,sha384_base64url:()=>vZ,sha384_hex:()=>BZ,sha512_base64:()=>bZ,sha512_base64url:()=>kZ,sha512_hex:()=>wZ,string:()=>GI,time:()=>PI,ulid:()=>EI,undefined:()=>HI,unicodeEmail:()=>U_,uppercase:()=>qI,uuid:()=>Hi,uuid4:()=>iZ,uuid6:()=>oZ,uuid7:()=>sZ,xid:()=>CI});var mI=/^[cC][0-9a-z]{6,}$/,II=/^[0-9a-z]+$/,EI=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,CI=/^[0-9a-vA-V]{20}$/,yI=/^[A-Za-z0-9]{27}$/,BI=/^[a-zA-Z0-9_-]{21}$/;function QI(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var vI=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nZ=/^[-+]?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)?)??$/,wI=/^([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)$/,iZ=Hi(4),oZ=Hi(6),sZ=Hi(7),bI=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,aZ=/^[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])?)*$/,AZ=/^(([^<>()\[\]\\.,;:\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,}))$/,U_=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,cZ=U_,uZ=/^[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])?)*$/,lZ="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function kI(){return new RegExp(lZ,"u")}var SI=/^(?:(?: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])$/,xI=/^(([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}|:))$/,DI=e=>{let t=Kt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},RI=/^((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])$/,_I=/^(([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])$/,NI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,UI=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,$I=/^(?=.{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])?)*\.?$/,TI=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,kA=/^https?$/,FI=/^\+[1-9]\d{6,14}$/,Jl=/^\d(?:[ -]?\d){11,18}$/,MI=/^(?: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)$/,Yl=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,$_="(?:(?:\\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 dZ(e){return new RegExp(`^${e}$`)}var LI=dZ($_);function pI(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 PI(e){return new RegExp(`^${pI(e)}$`)}function OI(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${pI({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${n}|${pI({precision:e.precision})}`:n;return new RegExp(`^${$_}T(?:${i})$`)}var zI=/^[\s\S]{0,}$/,GI=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},VI=/^-?\d+n?$/,SA=/^-?\d+$/,An=/^-?\d+(?:\.\d+)?$/,JI=/^(?:true|false)$/i,YI=/^null$/i;var HI=/^undefined$/i;var jI=/^[^A-Z]*$/,qI=/^[^a-z]*$/,WI=/^[0-9a-fA-F]*$/;function xA(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function DA(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var gZ=/^[0-9a-fA-F]{32}$/,fZ=xA(22,"=="),hZ=DA(22),pZ=/^[0-9a-fA-F]{40}$/,mZ=xA(27,"="),IZ=DA(27),EZ=/^[0-9a-fA-F]{64}$/,CZ=xA(43,"="),yZ=DA(43),BZ=/^[0-9a-fA-F]{96}$/,QZ=xA(64,""),vZ=DA(64),wZ=/^[0-9a-fA-F]{128}$/,bZ=xA(86,"=="),kZ=DA(86);var Ce=I("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ZI=e=>{let t=e.value;return!Dl(t)&&t.size!==void 0},KI=e=>{let t=e.value;return!Dl(t)&&t.length!==void 0},Hl={number:"number",bigint:"bigint",object:"date"},ql=I("$ZodCheckLessThan",(e,t)=>{Ce.init(e,t);let n=Hl[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:Hl[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})}}),Wl=I("$ZodCheckGreaterThan",(e,t)=>{Ce.init(e,t);let n=Hl[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:Hl[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})}}),XI=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):fA(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})}}),eE=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]=mA[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})}}),tE=I("$ZodCheckBigIntFormat",(e,t)=>{Ce.init(e,t);let[n,i]=IA[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})}}),rE=I("$ZodCheckMaxSize",(e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=ZI),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:CA(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),nE=I("$ZodCheckMinSize",(e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=ZI),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:CA(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),iE=I("$ZodCheckSizeEquals",(e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=ZI),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:CA(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})}}),oE=I("$ZodCheckMaxLength",(e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=KI),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>t.maximum?Yi(r):o)<=t.maximum)return;let a=yA(r);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),sE=I("$ZodCheckMinLength",(e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=KI),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>=t.minimum&&o<t.minimum*2?Yi(r):o)>=t.minimum)return;let a=yA(r);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),aE=I("$ZodCheckLengthEquals",(e,t)=>{var n;Ce.init(e,t),(n=e._zod.def).when??(n.when=KI),e._zod.check=i=>{let r=i.value,o=r.length,s=typeof r=="string"&&o>=t.length&&o<=t.length*2?Yi(r):o;if(s===t.length)return;let a=yA(r),A=s>t.length;i.issues.push({origin:a,...A?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),bs=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=()=>{})}),AE=I("$ZodCheckRegex",(e,t)=>{bs.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})}}),cE=I("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=jI),bs.init(e,t)}),uE=I("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=qI),bs.init(e,t)}),lE=I("$ZodCheckIncludes",(e,t)=>{Ce.init(e,t);let n=Kt(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})}}),dE=I("$ZodCheckStartsWith",(e,t)=>{Ce.init(e,t);let n=new RegExp(`^${Kt(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})}}),gE=I("$ZodCheckEndsWith",(e,t)=>{Ce.init(e,t);let n=new RegExp(`.*${Kt(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 jl(e,t,n){e.issues.length&&t.issues.push(...Ct(n,e.issues))}var fE=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=>jl(r,n,t.property));jl(i,n,t.property)}}),hE=I("$ZodCheckProperties",(e,t)=>{Ce.init(e,t),BA(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 A=a._zod.run({value:r[s],issues:[]},{});A instanceof Promise?(o??(o=[]),o.push(A.then(c=>jl(c,i,s)))):jl(A,i,s)}if(o)return Promise.all(o).then(()=>{})}}),pE=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})}}),mE=I("$ZodCheckOverwrite",(e,t)=>{Ce.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var ji=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(`
|
|
48
48
|
`).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(", ")}) {
|
|
49
49
|
${n.join(`
|