@botpress/sdk 4.15.12 → 4.17.0
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/.turbo/turbo-build.log +5 -5
- package/dist/bot/definition.d.ts +1 -0
- package/dist/consts.d.ts +9 -0
- package/dist/index.cjs +11 -11
- package/dist/index.cjs.map +4 -4
- package/dist/index.mjs +36 -36
- package/dist/index.mjs.map +4 -4
- package/dist/integration/server/types.d.ts +1 -0
- package/dist/public-consts.d.ts +0 -8
- package/dist/utils/error-utils.d.ts +4 -0
- package/package.json +5 -2
package/dist/index.mjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var Yo=Object.defineProperty;var Nv=Object.getOwnPropertyDescriptor;var Dv=Object.getOwnPropertyNames;var Hv=Object.prototype.hasOwnProperty;var at=(t,e)=>()=>(t&&(e=t(t=0)),e);var Kn=(t,e)=>{for(var n in e)Yo(t,n,{get:e[n],enumerable:!0})},Uv=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Dv(e))!Hv.call(t,o)&&o!==n&&Yo(t,o,{get:()=>e[o],enumerable:!(r=Nv(e,o))||r.enumerable});return t};var Zv=t=>Uv(Yo({},"__esModule",{value:!0}),t);var C=at(()=>{});var J={};Kn(J,{_debugEnd:()=>Mu,_debugProcess:()=>Ru,_events:()=>Ju,_eventsCount:()=>Xu,_exiting:()=>gu,_fatalExceptions:()=>Iu,_getActiveHandles:()=>vu,_getActiveRequests:()=>hu,_kill:()=>_u,_linkedBinding:()=>du,_maxListeners:()=>Vu,_preload_modules:()=>zu,_rawDebug:()=>cu,_startProfilerIdleNotifier:()=>Nu,_stopProfilerIdleNotifier:()=>Du,_tickCallback:()=>Ou,abort:()=>$u,addListener:()=>Yu,allowedNodeEnvironmentFlags:()=>Su,arch:()=>Jl,argv:()=>Ql,argv0:()=>Wu,assert:()=>Eu,binding:()=>iu,browser:()=>uu,chdir:()=>su,config:()=>yu,cpuUsage:()=>ui,cwd:()=>au,debugPort:()=>Fu,default:()=>sc,dlopen:()=>mu,domain:()=>pu,emit:()=>rc,emitWarning:()=>ru,env:()=>Yl,execArgv:()=>eu,execPath:()=>Lu,exit:()=>Pu,features:()=>ku,hasUncaughtExceptionCaptureCallback:()=>Cu,hrtime:()=>li,kill:()=>xu,listeners:()=>ac,memoryUsage:()=>wu,moduleLoadList:()=>fu,nextTick:()=>ql,off:()=>ec,on:()=>jt,once:()=>Qu,openStdin:()=>Bu,pid:()=>ju,platform:()=>Xl,ppid:()=>Ku,prependListener:()=>ic,prependOnceListener:()=>oc,reallyExit:()=>Tu,release:()=>lu,removeAllListeners:()=>nc,removeListener:()=>tc,resourceUsage:()=>bu,setSourceMapsEnabled:()=>qu,setUncaughtExceptionCaptureCallback:()=>Au,stderr:()=>Uu,stdin:()=>Zu,stdout:()=>Hu,title:()=>Vl,umask:()=>ou,uptime:()=>Gu,version:()=>tu,versions:()=>nu});function ta(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function $v(){!Ln||!yn||(Ln=!1,yn.length?$t=yn.concat($t):si=-1,$t.length&&zl())}function zl(){if(!Ln){var t=setTimeout($v,0);Ln=!0;for(var e=$t.length;e;){for(yn=$t,$t=[];++si<e;)yn&&yn[si].run();si=-1,e=$t.length}yn=null,Ln=!1,clearTimeout(t)}}function ql(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];$t.push(new Gl(t,e)),$t.length===1&&!Ln&&setTimeout(zl,0)}function Gl(t,e){this.fun=t,this.array=e}function lt(){}function du(t){ta("_linkedBinding")}function mu(t){ta("dlopen")}function hu(){return[]}function vu(){return[]}function Eu(t,e){if(!t)throw new Error(e||"assertion error")}function Cu(){return!1}function Gu(){return rn.now()/1e3}function li(t){var e=Math.floor((Date.now()-rn.now())*.001),n=rn.now()*.001,r=Math.floor(n)+e,o=Math.floor(n%1*1e9);return t&&(r=r-t[0],o=o-t[1],o<0&&(r--,o+=ea)),[r,o]}function jt(){return sc}function ac(t){return[]}var $t,Ln,yn,si,Vl,Jl,Xl,Yl,Ql,eu,tu,nu,ru,iu,ou,au,su,lu,uu,cu,fu,pu,gu,yu,Tu,_u,ui,bu,wu,xu,Pu,Bu,Su,ku,Iu,Au,Ou,Ru,Mu,Nu,Du,Hu,Uu,Zu,$u,ju,Ku,Lu,Fu,Wu,zu,qu,rn,Qo,ea,Vu,Ju,Xu,Yu,Qu,ec,tc,nc,rc,ic,oc,sc,lc=at(()=>{C();R();O();$t=[],Ln=!1,si=-1;Gl.prototype.run=function(){this.fun.apply(null,this.array)};Vl="browser",Jl="x64",Xl="browser",Yl={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},Ql=["/usr/bin/node"],eu=[],tu="v16.8.0",nu={},ru=function(t,e){console.warn((e?e+": ":"")+t)},iu=function(t){ta("binding")},ou=function(t){return 0},au=function(){return"/"},su=function(t){},lu={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};uu=!0,cu=lt,fu=[];pu={},gu=!1,yu={};Tu=lt,_u=lt,ui=function(){return{}},bu=ui,wu=ui,xu=lt,Pu=lt,Bu=lt,Su={};ku={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Iu=lt,Au=lt;Ou=lt,Ru=lt,Mu=lt,Nu=lt,Du=lt,Hu=void 0,Uu=void 0,Zu=void 0,$u=lt,ju=2,Ku=1,Lu="/bin/usr/node",Fu=9229,Wu="node",zu=[],qu=lt,rn={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};rn.now===void 0&&(Qo=Date.now(),rn.timing&&rn.timing.navigationStart&&(Qo=rn.timing.navigationStart),rn.now=()=>Date.now()-Qo);ea=1e9;li.bigint=function(t){var e=li(t);return typeof BigInt>"u"?e[0]*ea+e[1]:BigInt(e[0]*ea)+BigInt(e[1])};Vu=10,Ju={},Xu=0;Yu=jt,Qu=jt,ec=jt,tc=jt,nc=jt,rc=lt,ic=jt,oc=jt;sc={version:tu,versions:nu,arch:Jl,platform:Xl,browser:uu,release:lu,_rawDebug:cu,moduleLoadList:fu,binding:iu,_linkedBinding:du,_events:Ju,_eventsCount:Xu,_maxListeners:Vu,on:jt,addListener:Yu,once:Qu,off:ec,removeListener:tc,removeAllListeners:nc,emit:rc,prependListener:ic,prependOnceListener:oc,listeners:ac,domain:pu,_exiting:gu,config:yu,dlopen:mu,uptime:Gu,_getActiveRequests:hu,_getActiveHandles:vu,reallyExit:Tu,_kill:_u,cpuUsage:ui,resourceUsage:bu,memoryUsage:wu,kill:xu,exit:Pu,openStdin:Bu,allowedNodeEnvironmentFlags:Su,assert:Eu,features:ku,_fatalExceptions:Iu,setUncaughtExceptionCaptureCallback:Au,hasUncaughtExceptionCaptureCallback:Cu,emitWarning:ru,nextTick:ql,_tickCallback:Ou,_debugProcess:Ru,_debugEnd:Mu,_startProfilerIdleNotifier:Nu,_stopProfilerIdleNotifier:Du,stdout:Hu,stdin:Zu,stderr:Uu,abort:$u,umask:ou,chdir:su,cwd:au,env:Yl,title:Vl,argv:Ql,execArgv:eu,pid:ju,ppid:Ku,execPath:Lu,debugPort:Fu,hrtime:li,argv0:Wu,_preload_modules:zu,setSourceMapsEnabled:qu}});var O=at(()=>{lc()});function jv(){if(uc)return hr;uc=!0,hr.byteLength=s,hr.toByteArray=f,hr.fromByteArray=g;for(var t=[],e=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=r.length;o<a;++o)t[o]=r[o],e[r.charCodeAt(o)]=o;e[45]=62,e[95]=63;function i(h){var w=h.length;if(w%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=h.indexOf("=");P===-1&&(P=w);var B=P===w?0:4-P%4;return[P,B]}function s(h){var w=i(h),P=w[0],B=w[1];return(P+B)*3/4-B}function l(h,w,P){return(w+P)*3/4-P}function f(h){var w,P=i(h),B=P[0],v=P[1],E=new n(l(h,B,v)),S=0,H=v>0?B-4:B,K;for(K=0;K<H;K+=4)w=e[h.charCodeAt(K)]<<18|e[h.charCodeAt(K+1)]<<12|e[h.charCodeAt(K+2)]<<6|e[h.charCodeAt(K+3)],E[S++]=w>>16&255,E[S++]=w>>8&255,E[S++]=w&255;return v===2&&(w=e[h.charCodeAt(K)]<<2|e[h.charCodeAt(K+1)]>>4,E[S++]=w&255),v===1&&(w=e[h.charCodeAt(K)]<<10|e[h.charCodeAt(K+1)]<<4|e[h.charCodeAt(K+2)]>>2,E[S++]=w>>8&255,E[S++]=w&255),E}function p(h){return t[h>>18&63]+t[h>>12&63]+t[h>>6&63]+t[h&63]}function y(h,w,P){for(var B,v=[],E=w;E<P;E+=3)B=(h[E]<<16&16711680)+(h[E+1]<<8&65280)+(h[E+2]&255),v.push(p(B));return v.join("")}function g(h){for(var w,P=h.length,B=P%3,v=[],E=16383,S=0,H=P-B;S<H;S+=E)v.push(y(h,S,S+E>H?H:S+E));return B===1?(w=h[P-1],v.push(t[w>>2]+t[w<<4&63]+"==")):B===2&&(w=(h[P-2]<<8)+h[P-1],v.push(t[w>>10]+t[w>>4&63]+t[w<<2&63]+"=")),v.join("")}return hr}function Kv(){if(cc)return ci;cc=!0;return ci.read=function(t,e,n,r,o){var a,i,s=o*8-r-1,l=(1<<s)-1,f=l>>1,p=-7,y=n?o-1:0,g=n?-1:1,h=t[e+y];for(y+=g,a=h&(1<<-p)-1,h>>=-p,p+=s;p>0;a=a*256+t[e+y],y+=g,p-=8);for(i=a&(1<<-p)-1,a>>=-p,p+=r;p>0;i=i*256+t[e+y],y+=g,p-=8);if(a===0)a=1-f;else{if(a===l)return i?NaN:(h?-1:1)*(1/0);i=i+Math.pow(2,r),a=a-f}return(h?-1:1)*i*Math.pow(2,a-r)},ci.write=function(t,e,n,r,o,a){var i,s,l,f=a*8-o-1,p=(1<<f)-1,y=p>>1,g=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,w=r?1:-1,P=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,i=p):(i=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+y>=1?e+=g/l:e+=g*Math.pow(2,1-y),e*l>=2&&(i++,l/=2),i+y>=p?(s=0,i=p):i+y>=1?(s=(e*l-1)*Math.pow(2,o),i=i+y):(s=e*Math.pow(2,y-1)*Math.pow(2,o),i=0));o>=8;t[n+h]=s&255,h+=w,s/=256,o-=8);for(i=i<<o|s,f+=o;f>0;t[n+h]=i&255,h+=w,i/=256,f-=8);t[n+h-w]|=P*128},ci}function Nt(){if(fc)return mn;fc=!0;let t=jv(),e=Kv(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;mn.Buffer=i,mn.SlowBuffer=v,mn.INSPECT_MAX_BYTES=50;let r=2147483647;mn.kMaxLength=r,i.TYPED_ARRAY_SUPPORT=o(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{let m=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(m,u),m.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function a(m){if(m>r)throw new RangeError('The value "'+m+'" is invalid for option "size"');let u=new Uint8Array(m);return Object.setPrototypeOf(u,i.prototype),u}function i(m,u,c){if(typeof m=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(m)}return s(m,u,c)}i.poolSize=8192;function s(m,u,c){if(typeof m=="string")return y(m,u);if(ArrayBuffer.isView(m))return h(m);if(m==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m);if(xt(m,ArrayBuffer)||m&&xt(m.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(xt(m,SharedArrayBuffer)||m&&xt(m.buffer,SharedArrayBuffer)))return w(m,u,c);if(typeof m=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let T=m.valueOf&&m.valueOf();if(T!=null&&T!==m)return i.from(T,u,c);let I=P(m);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof m[Symbol.toPrimitive]=="function")return i.from(m[Symbol.toPrimitive]("string"),u,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m)}i.from=function(m,u,c){return s(m,u,c)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function l(m){if(typeof m!="number")throw new TypeError('"size" argument must be of type number');if(m<0)throw new RangeError('The value "'+m+'" is invalid for option "size"')}function f(m,u,c){return l(m),m<=0?a(m):u!==void 0?typeof c=="string"?a(m).fill(u,c):a(m).fill(u):a(m)}i.alloc=function(m,u,c){return f(m,u,c)};function p(m){return l(m),a(m<0?0:B(m)|0)}i.allocUnsafe=function(m){return p(m)},i.allocUnsafeSlow=function(m){return p(m)};function y(m,u){if((typeof u!="string"||u==="")&&(u="utf8"),!i.isEncoding(u))throw new TypeError("Unknown encoding: "+u);let c=E(m,u)|0,T=a(c),I=T.write(m,u);return I!==c&&(T=T.slice(0,I)),T}function g(m){let u=m.length<0?0:B(m.length)|0,c=a(u);for(let T=0;T<u;T+=1)c[T]=m[T]&255;return c}function h(m){if(xt(m,Uint8Array)){let u=new Uint8Array(m);return w(u.buffer,u.byteOffset,u.byteLength)}return g(m)}function w(m,u,c){if(u<0||m.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(m.byteLength<u+(c||0))throw new RangeError('"length" is outside of buffer bounds');let T;return u===void 0&&c===void 0?T=new Uint8Array(m):c===void 0?T=new Uint8Array(m,u):T=new Uint8Array(m,u,c),Object.setPrototypeOf(T,i.prototype),T}function P(m){if(i.isBuffer(m)){let u=B(m.length)|0,c=a(u);return c.length===0||m.copy(c,0,0,u),c}if(m.length!==void 0)return typeof m.length!="number"||yr(m.length)?a(0):g(m);if(m.type==="Buffer"&&Array.isArray(m.data))return g(m.data)}function B(m){if(m>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return m|0}function v(m){return+m!=m&&(m=0),i.alloc(+m)}i.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==i.prototype},i.compare=function(u,c){if(xt(u,Uint8Array)&&(u=i.from(u,u.offset,u.byteLength)),xt(c,Uint8Array)&&(c=i.from(c,c.offset,c.byteLength)),!i.isBuffer(u)||!i.isBuffer(c))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===c)return 0;let T=u.length,I=c.length;for(let U=0,W=Math.min(T,I);U<W;++U)if(u[U]!==c[U]){T=u[U],I=c[U];break}return T<I?-1:I<T?1:0},i.isEncoding=function(u){switch(String(u).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(u,c){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return i.alloc(0);let T;if(c===void 0)for(c=0,T=0;T<u.length;++T)c+=u[T].length;let I=i.allocUnsafe(c),U=0;for(T=0;T<u.length;++T){let W=u[T];if(xt(W,Uint8Array))U+W.length>I.length?(i.isBuffer(W)||(W=i.from(W)),W.copy(I,U)):Uint8Array.prototype.set.call(I,W,U);else if(i.isBuffer(W))W.copy(I,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=W.length}return I};function E(m,u){if(i.isBuffer(m))return m.length;if(ArrayBuffer.isView(m)||xt(m,ArrayBuffer))return m.byteLength;if(typeof m!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof m);let c=m.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&c===0)return 0;let I=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return Me(m).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c*2;case"hex":return c>>>1;case"base64":return At(m).length;default:if(I)return T?-1:Me(m).length;u=(""+u).toLowerCase(),I=!0}}i.byteLength=E;function S(m,u,c){let T=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((c===void 0||c>this.length)&&(c=this.length),c<=0)||(c>>>=0,u>>>=0,c<=u))return"";for(m||(m="utf8");;)switch(m){case"hex":return Pe(this,u,c);case"utf8":case"utf-8":return tt(this,u,c);case"ascii":return ht(this,u,c);case"latin1":case"binary":return Ue(this,u,c);case"base64":return ze(this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ee(this,u,c);default:if(T)throw new TypeError("Unknown encoding: "+m);m=(m+"").toLowerCase(),T=!0}}i.prototype._isBuffer=!0;function H(m,u,c){let T=m[u];m[u]=m[c],m[c]=T}i.prototype.swap16=function(){let u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let c=0;c<u;c+=2)H(this,c,c+1);return this},i.prototype.swap32=function(){let u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let c=0;c<u;c+=4)H(this,c,c+3),H(this,c+1,c+2);return this},i.prototype.swap64=function(){let u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let c=0;c<u;c+=8)H(this,c,c+7),H(this,c+1,c+6),H(this,c+2,c+5),H(this,c+3,c+4);return this},i.prototype.toString=function(){let u=this.length;return u===0?"":arguments.length===0?tt(this,0,u):S.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(u){if(!i.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:i.compare(this,u)===0},i.prototype.inspect=function(){let u="",c=mn.INSPECT_MAX_BYTES;return u=this.toString("hex",0,c).replace(/(.{2})/g,"$1 ").trim(),this.length>c&&(u+=" ... "),"<Buffer "+u+">"},n&&(i.prototype[n]=i.prototype.inspect),i.prototype.compare=function(u,c,T,I,U){if(xt(u,Uint8Array)&&(u=i.from(u,u.offset,u.byteLength)),!i.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(c===void 0&&(c=0),T===void 0&&(T=u?u.length:0),I===void 0&&(I=0),U===void 0&&(U=this.length),c<0||T>u.length||I<0||U>this.length)throw new RangeError("out of range index");if(I>=U&&c>=T)return 0;if(I>=U)return-1;if(c>=T)return 1;if(c>>>=0,T>>>=0,I>>>=0,U>>>=0,this===u)return 0;let W=U-I,Be=T-c,qe=Math.min(W,Be),$e=this.slice(I,U),Ge=u.slice(c,T);for(let He=0;He<qe;++He)if($e[He]!==Ge[He]){W=$e[He],Be=Ge[He];break}return W<Be?-1:Be<W?1:0};function K(m,u,c,T,I){if(m.length===0)return-1;if(typeof c=="string"?(T=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,yr(c)&&(c=I?0:m.length-1),c<0&&(c=m.length+c),c>=m.length){if(I)return-1;c=m.length-1}else if(c<0)if(I)c=0;else return-1;if(typeof u=="string"&&(u=i.from(u,T)),i.isBuffer(u))return u.length===0?-1:oe(m,u,c,T,I);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?I?Uint8Array.prototype.indexOf.call(m,u,c):Uint8Array.prototype.lastIndexOf.call(m,u,c):oe(m,[u],c,T,I);throw new TypeError("val must be string, number or Buffer")}function oe(m,u,c,T,I){let U=1,W=m.length,Be=u.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(m.length<2||u.length<2)return-1;U=2,W/=2,Be/=2,c/=2}function qe(Ge,He){return U===1?Ge[He]:Ge.readUInt16BE(He*U)}let $e;if(I){let Ge=-1;for($e=c;$e<W;$e++)if(qe(m,$e)===qe(u,Ge===-1?0:$e-Ge)){if(Ge===-1&&(Ge=$e),$e-Ge+1===Be)return Ge*U}else Ge!==-1&&($e-=$e-Ge),Ge=-1}else for(c+Be>W&&(c=W-Be),$e=c;$e>=0;$e--){let Ge=!0;for(let He=0;He<Be;He++)if(qe(m,$e+He)!==qe(u,He)){Ge=!1;break}if(Ge)return $e}return-1}i.prototype.includes=function(u,c,T){return this.indexOf(u,c,T)!==-1},i.prototype.indexOf=function(u,c,T){return K(this,u,c,T,!0)},i.prototype.lastIndexOf=function(u,c,T){return K(this,u,c,T,!1)};function ee(m,u,c,T){c=Number(c)||0;let I=m.length-c;T?(T=Number(T),T>I&&(T=I)):T=I;let U=u.length;T>U/2&&(T=U/2);let W;for(W=0;W<T;++W){let Be=parseInt(u.substr(W*2,2),16);if(yr(Be))return W;m[c+W]=Be}return W}function ge(m,u,c,T){return Mt(Me(u,m.length-c),m,c,T)}function ae(m,u,c,T){return Mt(_e(u),m,c,T)}function re(m,u,c,T){return Mt(At(u),m,c,T)}function Oe(m,u,c,T){return Mt(Z(u,m.length-c),m,c,T)}i.prototype.write=function(u,c,T,I){if(c===void 0)I="utf8",T=this.length,c=0;else if(T===void 0&&typeof c=="string")I=c,T=this.length,c=0;else if(isFinite(c))c=c>>>0,isFinite(T)?(T=T>>>0,I===void 0&&(I="utf8")):(I=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let U=this.length-c;if((T===void 0||T>U)&&(T=U),u.length>0&&(T<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");I||(I="utf8");let W=!1;for(;;)switch(I){case"hex":return ee(this,u,c,T);case"utf8":case"utf-8":return ge(this,u,c,T);case"ascii":case"latin1":case"binary":return ae(this,u,c,T);case"base64":return re(this,u,c,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Oe(this,u,c,T);default:if(W)throw new TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),W=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ze(m,u,c){return u===0&&c===m.length?t.fromByteArray(m):t.fromByteArray(m.slice(u,c))}function tt(m,u,c){c=Math.min(m.length,c);let T=[],I=u;for(;I<c;){let U=m[I],W=null,Be=U>239?4:U>223?3:U>191?2:1;if(I+Be<=c){let qe,$e,Ge,He;switch(Be){case 1:U<128&&(W=U);break;case 2:qe=m[I+1],(qe&192)===128&&(He=(U&31)<<6|qe&63,He>127&&(W=He));break;case 3:qe=m[I+1],$e=m[I+2],(qe&192)===128&&($e&192)===128&&(He=(U&15)<<12|(qe&63)<<6|$e&63,He>2047&&(He<55296||He>57343)&&(W=He));break;case 4:qe=m[I+1],$e=m[I+2],Ge=m[I+3],(qe&192)===128&&($e&192)===128&&(Ge&192)===128&&(He=(U&15)<<18|(qe&63)<<12|($e&63)<<6|Ge&63,He>65535&&He<1114112&&(W=He))}}W===null?(W=65533,Be=1):W>65535&&(W-=65536,T.push(W>>>10&1023|55296),W=56320|W&1023),T.push(W),I+=Be}return Je(T)}let Ve=4096;function Je(m){let u=m.length;if(u<=Ve)return String.fromCharCode.apply(String,m);let c="",T=0;for(;T<u;)c+=String.fromCharCode.apply(String,m.slice(T,T+=Ve));return c}function ht(m,u,c){let T="";c=Math.min(m.length,c);for(let I=u;I<c;++I)T+=String.fromCharCode(m[I]&127);return T}function Ue(m,u,c){let T="";c=Math.min(m.length,c);for(let I=u;I<c;++I)T+=String.fromCharCode(m[I]);return T}function Pe(m,u,c){let T=m.length;(!u||u<0)&&(u=0),(!c||c<0||c>T)&&(c=T);let I="";for(let U=u;U<c;++U)I+=ai[m[U]];return I}function Ee(m,u,c){let T=m.slice(u,c),I="";for(let U=0;U<T.length-1;U+=2)I+=String.fromCharCode(T[U]+T[U+1]*256);return I}i.prototype.slice=function(u,c){let T=this.length;u=~~u,c=c===void 0?T:~~c,u<0?(u+=T,u<0&&(u=0)):u>T&&(u=T),c<0?(c+=T,c<0&&(c=0)):c>T&&(c=T),c<u&&(c=u);let I=this.subarray(u,c);return Object.setPrototypeOf(I,i.prototype),I};function fe(m,u,c){if(m%1!==0||m<0)throw new RangeError("offset is not uint");if(m+u>c)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(u,c,T){u=u>>>0,c=c>>>0,T||fe(u,c,this.length);let I=this[u],U=1,W=0;for(;++W<c&&(U*=256);)I+=this[u+W]*U;return I},i.prototype.readUintBE=i.prototype.readUIntBE=function(u,c,T){u=u>>>0,c=c>>>0,T||fe(u,c,this.length);let I=this[u+--c],U=1;for(;c>0&&(U*=256);)I+=this[u+--c]*U;return I},i.prototype.readUint8=i.prototype.readUInt8=function(u,c){return u=u>>>0,c||fe(u,1,this.length),this[u]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(u,c){return u=u>>>0,c||fe(u,2,this.length),this[u]|this[u+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(u,c){return u=u>>>0,c||fe(u,2,this.length),this[u]<<8|this[u+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},i.prototype.readBigUInt64LE=St(function(u){u=u>>>0,b(u,"offset");let c=this[u],T=this[u+7];(c===void 0||T===void 0)&&x(u,this.length-8);let I=c+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,U=this[++u]+this[++u]*2**8+this[++u]*2**16+T*2**24;return BigInt(I)+(BigInt(U)<<BigInt(32))}),i.prototype.readBigUInt64BE=St(function(u){u=u>>>0,b(u,"offset");let c=this[u],T=this[u+7];(c===void 0||T===void 0)&&x(u,this.length-8);let I=c*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],U=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+T;return(BigInt(I)<<BigInt(32))+BigInt(U)}),i.prototype.readIntLE=function(u,c,T){u=u>>>0,c=c>>>0,T||fe(u,c,this.length);let I=this[u],U=1,W=0;for(;++W<c&&(U*=256);)I+=this[u+W]*U;return U*=128,I>=U&&(I-=Math.pow(2,8*c)),I},i.prototype.readIntBE=function(u,c,T){u=u>>>0,c=c>>>0,T||fe(u,c,this.length);let I=c,U=1,W=this[u+--I];for(;I>0&&(U*=256);)W+=this[u+--I]*U;return U*=128,W>=U&&(W-=Math.pow(2,8*c)),W},i.prototype.readInt8=function(u,c){return u=u>>>0,c||fe(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},i.prototype.readInt16LE=function(u,c){u=u>>>0,c||fe(u,2,this.length);let T=this[u]|this[u+1]<<8;return T&32768?T|4294901760:T},i.prototype.readInt16BE=function(u,c){u=u>>>0,c||fe(u,2,this.length);let T=this[u+1]|this[u]<<8;return T&32768?T|4294901760:T},i.prototype.readInt32LE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},i.prototype.readInt32BE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},i.prototype.readBigInt64LE=St(function(u){u=u>>>0,b(u,"offset");let c=this[u],T=this[u+7];(c===void 0||T===void 0)&&x(u,this.length-8);let I=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(T<<24);return(BigInt(I)<<BigInt(32))+BigInt(c+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),i.prototype.readBigInt64BE=St(function(u){u=u>>>0,b(u,"offset");let c=this[u],T=this[u+7];(c===void 0||T===void 0)&&x(u,this.length-8);let I=(c<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(I)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+T)}),i.prototype.readFloatLE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),e.read(this,u,!0,23,4)},i.prototype.readFloatBE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),e.read(this,u,!1,23,4)},i.prototype.readDoubleLE=function(u,c){return u=u>>>0,c||fe(u,8,this.length),e.read(this,u,!0,52,8)},i.prototype.readDoubleBE=function(u,c){return u=u>>>0,c||fe(u,8,this.length),e.read(this,u,!1,52,8)};function ve(m,u,c,T,I,U){if(!i.isBuffer(m))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>I||u<U)throw new RangeError('"value" argument is out of bounds');if(c+T>m.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(u,c,T,I){if(u=+u,c=c>>>0,T=T>>>0,!I){let Be=Math.pow(2,8*T)-1;ve(this,u,c,T,Be,0)}let U=1,W=0;for(this[c]=u&255;++W<T&&(U*=256);)this[c+W]=u/U&255;return c+T},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(u,c,T,I){if(u=+u,c=c>>>0,T=T>>>0,!I){let Be=Math.pow(2,8*T)-1;ve(this,u,c,T,Be,0)}let U=T-1,W=1;for(this[c+U]=u&255;--U>=0&&(W*=256);)this[c+U]=u/W&255;return c+T},i.prototype.writeUint8=i.prototype.writeUInt8=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,1,255,0),this[c]=u&255,c+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,2,65535,0),this[c]=u&255,this[c+1]=u>>>8,c+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,2,65535,0),this[c]=u>>>8,this[c+1]=u&255,c+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,4,4294967295,0),this[c+3]=u>>>24,this[c+2]=u>>>16,this[c+1]=u>>>8,this[c]=u&255,c+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,4,4294967295,0),this[c]=u>>>24,this[c+1]=u>>>16,this[c+2]=u>>>8,this[c+3]=u&255,c+4};function D(m,u,c,T,I){ie(u,T,I,m,c,7);let U=Number(u&BigInt(4294967295));m[c++]=U,U=U>>8,m[c++]=U,U=U>>8,m[c++]=U,U=U>>8,m[c++]=U;let W=Number(u>>BigInt(32)&BigInt(4294967295));return m[c++]=W,W=W>>8,m[c++]=W,W=W>>8,m[c++]=W,W=W>>8,m[c++]=W,c}function j(m,u,c,T,I){ie(u,T,I,m,c,7);let U=Number(u&BigInt(4294967295));m[c+7]=U,U=U>>8,m[c+6]=U,U=U>>8,m[c+5]=U,U=U>>8,m[c+4]=U;let W=Number(u>>BigInt(32)&BigInt(4294967295));return m[c+3]=W,W=W>>8,m[c+2]=W,W=W>>8,m[c+1]=W,W=W>>8,m[c]=W,c+8}i.prototype.writeBigUInt64LE=St(function(u,c=0){return D(this,u,c,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=St(function(u,c=0){return j(this,u,c,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(u,c,T,I){if(u=+u,c=c>>>0,!I){let qe=Math.pow(2,8*T-1);ve(this,u,c,T,qe-1,-qe)}let U=0,W=1,Be=0;for(this[c]=u&255;++U<T&&(W*=256);)u<0&&Be===0&&this[c+U-1]!==0&&(Be=1),this[c+U]=(u/W>>0)-Be&255;return c+T},i.prototype.writeIntBE=function(u,c,T,I){if(u=+u,c=c>>>0,!I){let qe=Math.pow(2,8*T-1);ve(this,u,c,T,qe-1,-qe)}let U=T-1,W=1,Be=0;for(this[c+U]=u&255;--U>=0&&(W*=256);)u<0&&Be===0&&this[c+U+1]!==0&&(Be=1),this[c+U]=(u/W>>0)-Be&255;return c+T},i.prototype.writeInt8=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,1,127,-128),u<0&&(u=255+u+1),this[c]=u&255,c+1},i.prototype.writeInt16LE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,2,32767,-32768),this[c]=u&255,this[c+1]=u>>>8,c+2},i.prototype.writeInt16BE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,2,32767,-32768),this[c]=u>>>8,this[c+1]=u&255,c+2},i.prototype.writeInt32LE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,4,2147483647,-2147483648),this[c]=u&255,this[c+1]=u>>>8,this[c+2]=u>>>16,this[c+3]=u>>>24,c+4},i.prototype.writeInt32BE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[c]=u>>>24,this[c+1]=u>>>16,this[c+2]=u>>>8,this[c+3]=u&255,c+4},i.prototype.writeBigInt64LE=St(function(u,c=0){return D(this,u,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=St(function(u,c=0){return j(this,u,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(m,u,c,T,I,U){if(c+T>m.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function de(m,u,c,T,I){return u=+u,c=c>>>0,I||F(m,u,c,4),e.write(m,u,c,T,23,4),c+4}i.prototype.writeFloatLE=function(u,c,T){return de(this,u,c,!0,T)},i.prototype.writeFloatBE=function(u,c,T){return de(this,u,c,!1,T)};function Te(m,u,c,T,I){return u=+u,c=c>>>0,I||F(m,u,c,8),e.write(m,u,c,T,52,8),c+8}i.prototype.writeDoubleLE=function(u,c,T){return Te(this,u,c,!0,T)},i.prototype.writeDoubleBE=function(u,c,T){return Te(this,u,c,!1,T)},i.prototype.copy=function(u,c,T,I){if(!i.isBuffer(u))throw new TypeError("argument should be a Buffer");if(T||(T=0),!I&&I!==0&&(I=this.length),c>=u.length&&(c=u.length),c||(c=0),I>0&&I<T&&(I=T),I===T||u.length===0||this.length===0)return 0;if(c<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=this.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("sourceEnd out of bounds");I>this.length&&(I=this.length),u.length-c<I-T&&(I=u.length-c+T);let U=I-T;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(c,T,I):Uint8Array.prototype.set.call(u,this.subarray(T,I),c),U},i.prototype.fill=function(u,c,T,I){if(typeof u=="string"){if(typeof c=="string"?(I=c,c=0,T=this.length):typeof T=="string"&&(I=T,T=this.length),I!==void 0&&typeof I!="string")throw new TypeError("encoding must be a string");if(typeof I=="string"&&!i.isEncoding(I))throw new TypeError("Unknown encoding: "+I);if(u.length===1){let W=u.charCodeAt(0);(I==="utf8"&&W<128||I==="latin1")&&(u=W)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(c<0||this.length<c||this.length<T)throw new RangeError("Out of range index");if(T<=c)return this;c=c>>>0,T=T===void 0?this.length:T>>>0,u||(u=0);let U;if(typeof u=="number")for(U=c;U<T;++U)this[U]=u;else{let W=i.isBuffer(u)?u:i.from(u,I),Be=W.length;if(Be===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(U=0;U<T-c;++U)this[U+c]=W[U%Be]}return this};let A={};function k(m,u,c){A[m]=class extends c{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${m}]`,this.stack,delete this.name}get code(){return m}set code(I){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:I,writable:!0})}toString(){return`${this.name} [${m}]: ${this.message}`}}}k("ERR_BUFFER_OUT_OF_BOUNDS",function(m){return m?`${m} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),k("ERR_INVALID_ARG_TYPE",function(m,u){return`The "${m}" argument must be of type number. Received type ${typeof u}`},TypeError),k("ERR_OUT_OF_RANGE",function(m,u,c){let T=`The value of "${m}" is out of range.`,I=c;return Number.isInteger(c)&&Math.abs(c)>2**32?I=$(String(c)):typeof c=="bigint"&&(I=String(c),(c>BigInt(2)**BigInt(32)||c<-(BigInt(2)**BigInt(32)))&&(I=$(I)),I+="n"),T+=` It must be ${u}. Received ${I}`,T},RangeError);function $(m){let u="",c=m.length,T=m[0]==="-"?1:0;for(;c>=T+4;c-=3)u=`_${m.slice(c-3,c)}${u}`;return`${m.slice(0,c)}${u}`}function X(m,u,c){b(u,"offset"),(m[u]===void 0||m[u+c]===void 0)&&x(u,m.length-(c+1))}function ie(m,u,c,T,I,U){if(m>c||m<u){let W=typeof u=="bigint"?"n":"",Be;throw u===0||u===BigInt(0)?Be=`>= 0${W} and < 2${W} ** ${(U+1)*8}${W}`:Be=`>= -(2${W} ** ${(U+1)*8-1}${W}) and < 2 ** ${(U+1)*8-1}${W}`,new A.ERR_OUT_OF_RANGE("value",Be,m)}X(T,I,U)}function b(m,u){if(typeof m!="number")throw new A.ERR_INVALID_ARG_TYPE(u,"number",m)}function x(m,u,c){throw Math.floor(m)!==m?(b(m,c),new A.ERR_OUT_OF_RANGE("offset","an integer",m)):u<0?new A.ERR_BUFFER_OUT_OF_BOUNDS:new A.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${u}`,m)}let z=/[^+/0-9A-Za-z-_]/g;function Q(m){if(m=m.split("=")[0],m=m.trim().replace(z,""),m.length<2)return"";for(;m.length%4!==0;)m=m+"=";return m}function Me(m,u){u=u||1/0;let c,T=m.length,I=null,U=[];for(let W=0;W<T;++W){if(c=m.charCodeAt(W),c>55295&&c<57344){if(!I){if(c>56319){(u-=3)>-1&&U.push(239,191,189);continue}else if(W+1===T){(u-=3)>-1&&U.push(239,191,189);continue}I=c;continue}if(c<56320){(u-=3)>-1&&U.push(239,191,189),I=c;continue}c=(I-55296<<10|c-56320)+65536}else I&&(u-=3)>-1&&U.push(239,191,189);if(I=null,c<128){if((u-=1)<0)break;U.push(c)}else if(c<2048){if((u-=2)<0)break;U.push(c>>6|192,c&63|128)}else if(c<65536){if((u-=3)<0)break;U.push(c>>12|224,c>>6&63|128,c&63|128)}else if(c<1114112){if((u-=4)<0)break;U.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw new Error("Invalid code point")}return U}function _e(m){let u=[];for(let c=0;c<m.length;++c)u.push(m.charCodeAt(c)&255);return u}function Z(m,u){let c,T,I,U=[];for(let W=0;W<m.length&&!((u-=2)<0);++W)c=m.charCodeAt(W),T=c>>8,I=c%256,U.push(I),U.push(T);return U}function At(m){return t.toByteArray(Q(m))}function Mt(m,u,c,T){let I;for(I=0;I<T&&!(I+c>=u.length||I>=m.length);++I)u[I+c]=m[I];return I}function xt(m,u){return m instanceof u||m!=null&&m.constructor!=null&&m.constructor.name!=null&&m.constructor.name===u.name}function yr(m){return m!==m}let ai=(function(){let m="0123456789abcdef",u=new Array(256);for(let c=0;c<16;++c){let T=c*16;for(let I=0;I<16;++I)u[T+I]=m[c]+m[I]}return u})();function St(m){return typeof BigInt>"u"?mr:m}function mr(){throw new Error("BigInt not supported")}return mn}var hr,uc,ci,cc,mn,fc,fi=at(()=>{C();R();O();hr={},uc=!1;ci={},cc=!1;mn={},fc=!1});var hn,q,lA,uA,dc=at(()=>{C();R();O();fi();hn=Nt();hn.Buffer;hn.SlowBuffer;hn.INSPECT_MAX_BYTES;hn.kMaxLength;q=hn.Buffer,lA=hn.INSPECT_MAX_BYTES,uA=hn.kMaxLength});var R=at(()=>{dc()});function Dt(){return Dy||(Dy=!0,typeof Object.create=="function"?Po=function(e,n){n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Po=function(e,n){if(n){e.super_=n;var r=function(){};r.prototype=n.prototype,e.prototype=new r,e.prototype.constructor=e}}),Po}var Po,Dy,ns=at(()=>{C();R();O();Po={},Dy=!1});function Ne(){Ne.init.call(this)}function Bo(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function zy(t){return t._maxListeners===void 0?Ne.defaultMaxListeners:t._maxListeners}function $y(t,e,n,r){var o,a,i,s;if(Bo(n),(a=t._events)===void 0?(a=t._events=Object.create(null),t._eventsCount=0):(a.newListener!==void 0&&(t.emit("newListener",e,n.listener?n.listener:n),a=t._events),i=a[e]),i===void 0)i=a[e]=n,++t._eventsCount;else if(typeof i=="function"?i=a[e]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),(o=zy(t))>0&&i.length>o&&!i.warned){i.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=i.length,s=l,console&&console.warn&&console.warn(s)}return t}function MB(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function jy(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},o=MB.bind(r);return o.listener=n,r.wrapFn=o,o}function Ky(t,e,n){var r=t._events;if(r===void 0)return[];var o=r[e];return o===void 0?[]:typeof o=="function"?n?[o.listener||o]:[o]:n?(function(a){for(var i=new Array(a.length),s=0;s<i.length;++s)i[s]=a[s].listener||a[s];return i})(o):qy(o,o.length)}function Ly(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}function qy(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}var Fy,Wy,ir,Hy,Uy,Zy,_t,rs=at(()=>{C();R();O();ir=typeof Reflect=="object"?Reflect:null,Hy=ir&&typeof ir.apply=="function"?ir.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};Wy=ir&&typeof ir.ownKeys=="function"?ir.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};Uy=Number.isNaN||function(t){return t!=t};Fy=Ne,Ne.EventEmitter=Ne,Ne.prototype._events=void 0,Ne.prototype._eventsCount=0,Ne.prototype._maxListeners=void 0;Zy=10;Object.defineProperty(Ne,"defaultMaxListeners",{enumerable:!0,get:function(){return Zy},set:function(t){if(typeof t!="number"||t<0||Uy(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Zy=t}}),Ne.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ne.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Uy(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},Ne.prototype.getMaxListeners=function(){return zy(this)},Ne.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r=t==="error",o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;if(r){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var i=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw i.context=a,i}var s=o[t];if(s===void 0)return!1;if(typeof s=="function")Hy(s,this,e);else{var l=s.length,f=qy(s,l);for(n=0;n<l;++n)Hy(f[n],this,e)}return!0},Ne.prototype.addListener=function(t,e){return $y(this,t,e,!1)},Ne.prototype.on=Ne.prototype.addListener,Ne.prototype.prependListener=function(t,e){return $y(this,t,e,!0)},Ne.prototype.once=function(t,e){return Bo(e),this.on(t,jy(this,t,e)),this},Ne.prototype.prependOnceListener=function(t,e){return Bo(e),this.prependListener(t,jy(this,t,e)),this},Ne.prototype.removeListener=function(t,e){var n,r,o,a,i;if(Bo(e),(r=this._events)===void 0)return this;if((n=r[t])===void 0)return this;if(n===e||n.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===e||n[a].listener===e){i=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():(function(s,l){for(;l+1<s.length;l++)s[l]=s[l+1];s.pop()})(n,o),n.length===1&&(r[t]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",t,i||e)}return this},Ne.prototype.off=Ne.prototype.removeListener,Ne.prototype.removeAllListeners=function(t){var e,n,r;if((n=this._events)===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var o,a=Object.keys(n);for(r=0;r<a.length;++r)(o=a[r])!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=n[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},Ne.prototype.listeners=function(t){return Ky(this,t,!0)},Ne.prototype.rawListeners=function(t){return Ky(this,t,!1)},Ne.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Ly.call(t,e)},Ne.prototype.listenerCount=Ly,Ne.prototype.eventNames=function(){return this._eventsCount>0?Wy(this._events):[]};_t=Fy;_t.EventEmitter;_t.defaultMaxListeners;_t.init;_t.listenerCount;_t.EventEmitter;_t.defaultMaxListeners;_t.init;_t.listenerCount});var Gy=at(()=>{C();R();O();rs();_t.once=function(t,e){return new Promise((n,r)=>{function o(...i){a!==void 0&&t.removeListener("error",a),n(i)}let a;e!=="error"&&(a=i=>{t.removeListener(name,o),r(i)},t.once("error",a)),t.once(e,o)})};_t.on=function(t,e){let n=[],r=[],o=null,a=!1,i={async next(){let f=n.shift();if(f)return createIterResult(f,!1);if(o){let p=Promise.reject(o);return o=null,p}return a?createIterResult(void 0,!0):new Promise((p,y)=>r.push({resolve:p,reject:y}))},async return(){t.removeListener(e,s),t.removeListener("error",l),a=!0;for(let f of r)f.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(f){o=f,t.removeListener(e,s),t.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return t.on(e,s),t.on("error",l),i;function s(...f){let p=r.shift();p?p.resolve(createIterResult(f,!1)):n.push(f)}function l(f){a=!0;let p=r.shift();p?p.reject(f):o=f,i.return()}}});function ls(){throw new Error("setTimeout has not been defined")}function us(){throw new Error("clearTimeout has not been defined")}function lm(t){if(Vt===setTimeout)return setTimeout(t,0);if((Vt===ls||!Vt)&&setTimeout)return Vt=setTimeout,setTimeout(t,0);try{return Vt(t,0)}catch{try{return Vt.call(null,t,0)}catch{return Vt.call(this||ar,t,0)}}}function NB(){or&&Nn&&(or=!1,Nn.length?Xt=Nn.concat(Xt):Co=-1,Xt.length&&um())}function um(){if(!or){var t=lm(NB);or=!0;for(var e=Xt.length;e;){for(Nn=Xt,Xt=[];++Co<e;)Nn&&Nn[Co].run();Co=-1,e=Xt.length}Nn=null,or=!1,(function(n){if(Jt===clearTimeout)return clearTimeout(n);if((Jt===us||!Jt)&&clearTimeout)return Jt=clearTimeout,clearTimeout(n);try{Jt(n)}catch{try{return Jt.call(null,n)}catch{return Jt.call(this||ar,n)}}})(t)}}function Vy(t,e){(this||ar).fun=t,(this||ar).array=e}function Gt(){}function Hn(t){return t.call.bind(t)}function Vr(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}function Xy(t){return bt&&Pt?Et(t)!==void 0:ym(t)||mm(t)||hm(t)||vm(t)||Tm(t)||_m(t)||bm(t)||wm(t)||xm(t)||Pm(t)||Bm(t)}function ym(t){return bt&&Pt?Et(t)==="Uint8Array":We(t)==="[object Uint8Array]"||WB(t)&&t.buffer!==void 0}function mm(t){return bt&&Pt?Et(t)==="Uint8ClampedArray":We(t)==="[object Uint8ClampedArray]"}function hm(t){return bt&&Pt?Et(t)==="Uint16Array":We(t)==="[object Uint16Array]"}function vm(t){return bt&&Pt?Et(t)==="Uint32Array":We(t)==="[object Uint32Array]"}function Tm(t){return bt&&Pt?Et(t)==="Int8Array":We(t)==="[object Int8Array]"}function _m(t){return bt&&Pt?Et(t)==="Int16Array":We(t)==="[object Int16Array]"}function bm(t){return bt&&Pt?Et(t)==="Int32Array":We(t)==="[object Int32Array]"}function wm(t){return bt&&Pt?Et(t)==="Float32Array":We(t)==="[object Float32Array]"}function xm(t){return bt&&Pt?Et(t)==="Float64Array":We(t)==="[object Float64Array]"}function Pm(t){return bt&&Pt?Et(t)==="BigInt64Array":We(t)==="[object BigInt64Array]"}function Bm(t){return bt&&Pt?Et(t)==="BigUint64Array":We(t)==="[object BigUint64Array]"}function So(t){return We(t)==="[object Map]"}function Eo(t){return We(t)==="[object Set]"}function ko(t){return We(t)==="[object WeakMap]"}function is(t){return We(t)==="[object WeakSet]"}function Ro(t){return We(t)==="[object ArrayBuffer]"}function Yy(t){return typeof ArrayBuffer<"u"&&(Ro.working?Ro(t):t instanceof ArrayBuffer)}function Mo(t){return We(t)==="[object DataView]"}function Qy(t){return typeof DataView<"u"&&(Mo.working?Mo(t):t instanceof DataView)}function No(t){return We(t)==="[object SharedArrayBuffer]"}function em(t){return typeof SharedArrayBuffer<"u"&&(No.working?No(t):t instanceof SharedArrayBuffer)}function tm(t){return Vr(t,JB)}function nm(t){return Vr(t,XB)}function rm(t){return Vr(t,YB)}function im(t){return gm&&Vr(t,QB)}function om(t){return fs&&Vr(t,eS)}function cn(t,e){var n={seen:[],stylize:rS};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),ds(e)?n.showHidden=e:e&&L._extend(n,e),Dn(n.showHidden)&&(n.showHidden=!1),Dn(n.depth)&&(n.depth=2),Dn(n.colors)&&(n.colors=!1),Dn(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=nS),Do(n,t,n.depth)}function nS(t,e){var n=cn.styles[e];return n?"\x1B["+cn.colors[n][0]+"m"+t+"\x1B["+cn.colors[n][1]+"m":t}function rS(t,e){return t}function Do(t,e,n){if(t.customInspect&&e&&Oo(e.inspect)&&e.inspect!==L.inspect&&(!e.constructor||e.constructor.prototype!==e)){var r=e.inspect(n,t);return Ho(r)||(r=Do(t,r,n)),r}var o=(function(g,h){if(Dn(h))return g.stylize("undefined","undefined");if(Ho(h)){var w="'"+JSON.stringify(h).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return g.stylize(w,"string")}if(km(h))return g.stylize(""+h,"number");if(ds(h))return g.stylize(""+h,"boolean");if($o(h))return g.stylize("null","null")})(t,e);if(o)return o;var a=Object.keys(e),i=(function(g){var h={};return g.forEach((function(w,P){h[w]=!0})),h})(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),Gr(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return os(e);if(a.length===0){if(Oo(e)){var s=e.name?": "+e.name:"";return t.stylize("[Function"+s+"]","special")}if(qr(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Uo(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Gr(e))return os(e)}var l,f="",p=!1,y=["{","}"];return Em(e)&&(p=!0,y=["[","]"]),Oo(e)&&(f=" [Function"+(e.name?": "+e.name:"")+"]"),qr(e)&&(f=" "+RegExp.prototype.toString.call(e)),Uo(e)&&(f=" "+Date.prototype.toUTCString.call(e)),Gr(e)&&(f=" "+os(e)),a.length!==0||p&&e.length!=0?n<0?qr(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),l=p?(function(g,h,w,P,B){for(var v=[],E=0,S=h.length;E<S;++E)Im(h,String(E))?v.push(as(g,h,w,P,String(E),!0)):v.push("");return B.forEach((function(H){H.match(/^\d+$/)||v.push(as(g,h,w,P,H,!0))})),v})(t,e,n,i,a):a.map((function(g){return as(t,e,n,i,g,p)})),t.seen.pop(),(function(g,h,w){var P=0;return g.reduce((function(B,v){return P++,v.indexOf(`
|
|
1
|
+
var Xa=Object.defineProperty;var Hv=Object.getOwnPropertyDescriptor;var Uv=Object.getOwnPropertyNames;var Zv=Object.prototype.hasOwnProperty;var ot=(t,e)=>()=>(t&&(e=t(t=0)),e);var Ln=(t,e)=>{for(var n in e)Xa(t,n,{get:e[n],enumerable:!0})},$v=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Uv(e))!Zv.call(t,a)&&a!==n&&Xa(t,a,{get:()=>e[a],enumerable:!(r=Hv(e,a))||r.enumerable});return t};var jv=t=>$v(Xa({},"__esModule",{value:!0}),t);var C=ot(()=>{});var J={};Ln(J,{_debugEnd:()=>Nu,_debugProcess:()=>Mu,_events:()=>Yu,_eventsCount:()=>Xu,_exiting:()=>yu,_fatalExceptions:()=>Au,_getActiveHandles:()=>Tu,_getActiveRequests:()=>vu,_kill:()=>bu,_linkedBinding:()=>pu,_maxListeners:()=>Ju,_preload_modules:()=>qu,_rawDebug:()=>fu,_startProfilerIdleNotifier:()=>Du,_stopProfilerIdleNotifier:()=>Hu,_tickCallback:()=>Ru,abort:()=>ju,addListener:()=>Qu,allowedNodeEnvironmentFlags:()=>Su,arch:()=>Yl,argv:()=>eu,argv0:()=>zu,assert:()=>ku,binding:()=>au,browser:()=>cu,chdir:()=>lu,config:()=>mu,cpuUsage:()=>ci,cwd:()=>su,debugPort:()=>Wu,default:()=>lc,dlopen:()=>hu,domain:()=>gu,emit:()=>ic,emitWarning:()=>iu,env:()=>Ql,execArgv:()=>tu,execPath:()=>Fu,exit:()=>Bu,features:()=>Iu,hasUncaughtExceptionCaptureCallback:()=>Ou,hrtime:()=>ui,kill:()=>Pu,listeners:()=>sc,memoryUsage:()=>xu,moduleLoadList:()=>du,nextTick:()=>Gl,off:()=>tc,on:()=>Kt,once:()=>ec,openStdin:()=>Eu,pid:()=>Ku,platform:()=>Xl,ppid:()=>Lu,prependListener:()=>ac,prependOnceListener:()=>oc,reallyExit:()=>_u,release:()=>uu,removeAllListeners:()=>rc,removeListener:()=>nc,resourceUsage:()=>wu,setSourceMapsEnabled:()=>Gu,setUncaughtExceptionCaptureCallback:()=>Cu,stderr:()=>Zu,stdin:()=>$u,stdout:()=>Uu,title:()=>Jl,umask:()=>ou,uptime:()=>Vu,version:()=>nu,versions:()=>ru});function to(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function Kv(){!Fn||!mn||(Fn=!1,mn.length?jt=mn.concat(jt):li=-1,jt.length&&ql())}function ql(){if(!Fn){var t=setTimeout(Kv,0);Fn=!0;for(var e=jt.length;e;){for(mn=jt,jt=[];++li<e;)mn&&mn[li].run();li=-1,e=jt.length}mn=null,Fn=!1,clearTimeout(t)}}function Gl(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];jt.push(new Vl(t,e)),jt.length===1&&!Fn&&setTimeout(ql,0)}function Vl(t,e){this.fun=t,this.array=e}function lt(){}function pu(t){to("_linkedBinding")}function hu(t){to("dlopen")}function vu(){return[]}function Tu(){return[]}function ku(t,e){if(!t)throw new Error(e||"assertion error")}function Ou(){return!1}function Vu(){return an.now()/1e3}function ui(t){var e=Math.floor((Date.now()-an.now())*.001),n=an.now()*.001,r=Math.floor(n)+e,a=Math.floor(n%1*1e9);return t&&(r=r-t[0],a=a-t[1],a<0&&(r--,a+=eo)),[r,a]}function Kt(){return lc}function sc(t){return[]}var jt,Fn,mn,li,Jl,Yl,Xl,Ql,eu,tu,nu,ru,iu,au,ou,su,lu,uu,cu,fu,du,gu,yu,mu,_u,bu,ci,wu,xu,Pu,Bu,Eu,Su,Iu,Au,Cu,Ru,Mu,Nu,Du,Hu,Uu,Zu,$u,ju,Ku,Lu,Fu,Wu,zu,qu,Gu,an,Qa,eo,Ju,Yu,Xu,Qu,ec,tc,nc,rc,ic,ac,oc,lc,uc=ot(()=>{C();R();O();jt=[],Fn=!1,li=-1;Vl.prototype.run=function(){this.fun.apply(null,this.array)};Jl="browser",Yl="x64",Xl="browser",Ql={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},eu=["/usr/bin/node"],tu=[],nu="v16.8.0",ru={},iu=function(t,e){console.warn((e?e+": ":"")+t)},au=function(t){to("binding")},ou=function(t){return 0},su=function(){return"/"},lu=function(t){},uu={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};cu=!0,fu=lt,du=[];gu={},yu=!1,mu={};_u=lt,bu=lt,ci=function(){return{}},wu=ci,xu=ci,Pu=lt,Bu=lt,Eu=lt,Su={};Iu={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Au=lt,Cu=lt;Ru=lt,Mu=lt,Nu=lt,Du=lt,Hu=lt,Uu=void 0,Zu=void 0,$u=void 0,ju=lt,Ku=2,Lu=1,Fu="/bin/usr/node",Wu=9229,zu="node",qu=[],Gu=lt,an={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};an.now===void 0&&(Qa=Date.now(),an.timing&&an.timing.navigationStart&&(Qa=an.timing.navigationStart),an.now=()=>Date.now()-Qa);eo=1e9;ui.bigint=function(t){var e=ui(t);return typeof BigInt>"u"?e[0]*eo+e[1]:BigInt(e[0]*eo)+BigInt(e[1])};Ju=10,Yu={},Xu=0;Qu=Kt,ec=Kt,tc=Kt,nc=Kt,rc=Kt,ic=lt,ac=Kt,oc=Kt;lc={version:nu,versions:ru,arch:Yl,platform:Xl,browser:cu,release:uu,_rawDebug:fu,moduleLoadList:du,binding:au,_linkedBinding:pu,_events:Yu,_eventsCount:Xu,_maxListeners:Ju,on:Kt,addListener:Qu,once:ec,off:tc,removeListener:nc,removeAllListeners:rc,emit:ic,prependListener:ac,prependOnceListener:oc,listeners:sc,domain:gu,_exiting:yu,config:mu,dlopen:hu,uptime:Vu,_getActiveRequests:vu,_getActiveHandles:Tu,reallyExit:_u,_kill:bu,cpuUsage:ci,resourceUsage:wu,memoryUsage:xu,kill:Pu,exit:Bu,openStdin:Eu,allowedNodeEnvironmentFlags:Su,assert:ku,features:Iu,_fatalExceptions:Au,setUncaughtExceptionCaptureCallback:Cu,hasUncaughtExceptionCaptureCallback:Ou,emitWarning:iu,nextTick:Gl,_tickCallback:Ru,_debugProcess:Mu,_debugEnd:Nu,_startProfilerIdleNotifier:Du,_stopProfilerIdleNotifier:Hu,stdout:Uu,stdin:$u,stderr:Zu,abort:ju,umask:ou,chdir:lu,cwd:su,env:Ql,title:Jl,argv:eu,execArgv:tu,pid:Ku,ppid:Lu,execPath:Fu,debugPort:Wu,hrtime:ui,argv0:zu,_preload_modules:qu,setSourceMapsEnabled:Gu}});var O=ot(()=>{uc()});function Lv(){if(cc)return vr;cc=!0,vr.byteLength=s,vr.toByteArray=f,vr.fromByteArray=g;for(var t=[],e=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,o=r.length;a<o;++a)t[a]=r[a],e[r.charCodeAt(a)]=a;e[45]=62,e[95]=63;function i(h){var w=h.length;if(w%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=h.indexOf("=");P===-1&&(P=w);var B=P===w?0:4-P%4;return[P,B]}function s(h){var w=i(h),P=w[0],B=w[1];return(P+B)*3/4-B}function l(h,w,P){return(w+P)*3/4-P}function f(h){var w,P=i(h),B=P[0],v=P[1],S=new n(l(h,B,v)),E=0,H=v>0?B-4:B,K;for(K=0;K<H;K+=4)w=e[h.charCodeAt(K)]<<18|e[h.charCodeAt(K+1)]<<12|e[h.charCodeAt(K+2)]<<6|e[h.charCodeAt(K+3)],S[E++]=w>>16&255,S[E++]=w>>8&255,S[E++]=w&255;return v===2&&(w=e[h.charCodeAt(K)]<<2|e[h.charCodeAt(K+1)]>>4,S[E++]=w&255),v===1&&(w=e[h.charCodeAt(K)]<<10|e[h.charCodeAt(K+1)]<<4|e[h.charCodeAt(K+2)]>>2,S[E++]=w>>8&255,S[E++]=w&255),S}function p(h){return t[h>>18&63]+t[h>>12&63]+t[h>>6&63]+t[h&63]}function y(h,w,P){for(var B,v=[],S=w;S<P;S+=3)B=(h[S]<<16&16711680)+(h[S+1]<<8&65280)+(h[S+2]&255),v.push(p(B));return v.join("")}function g(h){for(var w,P=h.length,B=P%3,v=[],S=16383,E=0,H=P-B;E<H;E+=S)v.push(y(h,E,E+S>H?H:E+S));return B===1?(w=h[P-1],v.push(t[w>>2]+t[w<<4&63]+"==")):B===2&&(w=(h[P-2]<<8)+h[P-1],v.push(t[w>>10]+t[w>>4&63]+t[w<<2&63]+"=")),v.join("")}return vr}function Fv(){if(fc)return fi;fc=!0;return fi.read=function(t,e,n,r,a){var o,i,s=a*8-r-1,l=(1<<s)-1,f=l>>1,p=-7,y=n?a-1:0,g=n?-1:1,h=t[e+y];for(y+=g,o=h&(1<<-p)-1,h>>=-p,p+=s;p>0;o=o*256+t[e+y],y+=g,p-=8);for(i=o&(1<<-p)-1,o>>=-p,p+=r;p>0;i=i*256+t[e+y],y+=g,p-=8);if(o===0)o=1-f;else{if(o===l)return i?NaN:(h?-1:1)*(1/0);i=i+Math.pow(2,r),o=o-f}return(h?-1:1)*i*Math.pow(2,o-r)},fi.write=function(t,e,n,r,a,o){var i,s,l,f=o*8-a-1,p=(1<<f)-1,y=p>>1,g=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,w=r?1:-1,P=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,i=p):(i=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+y>=1?e+=g/l:e+=g*Math.pow(2,1-y),e*l>=2&&(i++,l/=2),i+y>=p?(s=0,i=p):i+y>=1?(s=(e*l-1)*Math.pow(2,a),i=i+y):(s=e*Math.pow(2,y-1)*Math.pow(2,a),i=0));a>=8;t[n+h]=s&255,h+=w,s/=256,a-=8);for(i=i<<a|s,f+=a;f>0;t[n+h]=i&255,h+=w,i/=256,f-=8);t[n+h-w]|=P*128},fi}function Dt(){if(dc)return hn;dc=!0;let t=Lv(),e=Fv(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;hn.Buffer=i,hn.SlowBuffer=v,hn.INSPECT_MAX_BYTES=50;let r=2147483647;hn.kMaxLength=r,i.TYPED_ARRAY_SUPPORT=a(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let m=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(m,u),m.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function o(m){if(m>r)throw new RangeError('The value "'+m+'" is invalid for option "size"');let u=new Uint8Array(m);return Object.setPrototypeOf(u,i.prototype),u}function i(m,u,c){if(typeof m=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(m)}return s(m,u,c)}i.poolSize=8192;function s(m,u,c){if(typeof m=="string")return y(m,u);if(ArrayBuffer.isView(m))return h(m);if(m==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m);if(xt(m,ArrayBuffer)||m&&xt(m.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(xt(m,SharedArrayBuffer)||m&&xt(m.buffer,SharedArrayBuffer)))return w(m,u,c);if(typeof m=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let T=m.valueOf&&m.valueOf();if(T!=null&&T!==m)return i.from(T,u,c);let I=P(m);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof m[Symbol.toPrimitive]=="function")return i.from(m[Symbol.toPrimitive]("string"),u,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m)}i.from=function(m,u,c){return s(m,u,c)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function l(m){if(typeof m!="number")throw new TypeError('"size" argument must be of type number');if(m<0)throw new RangeError('The value "'+m+'" is invalid for option "size"')}function f(m,u,c){return l(m),m<=0?o(m):u!==void 0?typeof c=="string"?o(m).fill(u,c):o(m).fill(u):o(m)}i.alloc=function(m,u,c){return f(m,u,c)};function p(m){return l(m),o(m<0?0:B(m)|0)}i.allocUnsafe=function(m){return p(m)},i.allocUnsafeSlow=function(m){return p(m)};function y(m,u){if((typeof u!="string"||u==="")&&(u="utf8"),!i.isEncoding(u))throw new TypeError("Unknown encoding: "+u);let c=S(m,u)|0,T=o(c),I=T.write(m,u);return I!==c&&(T=T.slice(0,I)),T}function g(m){let u=m.length<0?0:B(m.length)|0,c=o(u);for(let T=0;T<u;T+=1)c[T]=m[T]&255;return c}function h(m){if(xt(m,Uint8Array)){let u=new Uint8Array(m);return w(u.buffer,u.byteOffset,u.byteLength)}return g(m)}function w(m,u,c){if(u<0||m.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(m.byteLength<u+(c||0))throw new RangeError('"length" is outside of buffer bounds');let T;return u===void 0&&c===void 0?T=new Uint8Array(m):c===void 0?T=new Uint8Array(m,u):T=new Uint8Array(m,u,c),Object.setPrototypeOf(T,i.prototype),T}function P(m){if(i.isBuffer(m)){let u=B(m.length)|0,c=o(u);return c.length===0||m.copy(c,0,0,u),c}if(m.length!==void 0)return typeof m.length!="number"||mr(m.length)?o(0):g(m);if(m.type==="Buffer"&&Array.isArray(m.data))return g(m.data)}function B(m){if(m>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return m|0}function v(m){return+m!=m&&(m=0),i.alloc(+m)}i.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==i.prototype},i.compare=function(u,c){if(xt(u,Uint8Array)&&(u=i.from(u,u.offset,u.byteLength)),xt(c,Uint8Array)&&(c=i.from(c,c.offset,c.byteLength)),!i.isBuffer(u)||!i.isBuffer(c))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===c)return 0;let T=u.length,I=c.length;for(let U=0,W=Math.min(T,I);U<W;++U)if(u[U]!==c[U]){T=u[U],I=c[U];break}return T<I?-1:I<T?1:0},i.isEncoding=function(u){switch(String(u).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(u,c){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return i.alloc(0);let T;if(c===void 0)for(c=0,T=0;T<u.length;++T)c+=u[T].length;let I=i.allocUnsafe(c),U=0;for(T=0;T<u.length;++T){let W=u[T];if(xt(W,Uint8Array))U+W.length>I.length?(i.isBuffer(W)||(W=i.from(W)),W.copy(I,U)):Uint8Array.prototype.set.call(I,W,U);else if(i.isBuffer(W))W.copy(I,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=W.length}return I};function S(m,u){if(i.isBuffer(m))return m.length;if(ArrayBuffer.isView(m)||xt(m,ArrayBuffer))return m.byteLength;if(typeof m!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof m);let c=m.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&c===0)return 0;let I=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return Me(m).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c*2;case"hex":return c>>>1;case"base64":return Ct(m).length;default:if(I)return T?-1:Me(m).length;u=(""+u).toLowerCase(),I=!0}}i.byteLength=S;function E(m,u,c){let T=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((c===void 0||c>this.length)&&(c=this.length),c<=0)||(c>>>=0,u>>>=0,c<=u))return"";for(m||(m="utf8");;)switch(m){case"hex":return Pe(this,u,c);case"utf8":case"utf-8":return tt(this,u,c);case"ascii":return ht(this,u,c);case"latin1":case"binary":return Ue(this,u,c);case"base64":return ze(this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Se(this,u,c);default:if(T)throw new TypeError("Unknown encoding: "+m);m=(m+"").toLowerCase(),T=!0}}i.prototype._isBuffer=!0;function H(m,u,c){let T=m[u];m[u]=m[c],m[c]=T}i.prototype.swap16=function(){let u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let c=0;c<u;c+=2)H(this,c,c+1);return this},i.prototype.swap32=function(){let u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let c=0;c<u;c+=4)H(this,c,c+3),H(this,c+1,c+2);return this},i.prototype.swap64=function(){let u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let c=0;c<u;c+=8)H(this,c,c+7),H(this,c+1,c+6),H(this,c+2,c+5),H(this,c+3,c+4);return this},i.prototype.toString=function(){let u=this.length;return u===0?"":arguments.length===0?tt(this,0,u):E.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(u){if(!i.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:i.compare(this,u)===0},i.prototype.inspect=function(){let u="",c=hn.INSPECT_MAX_BYTES;return u=this.toString("hex",0,c).replace(/(.{2})/g,"$1 ").trim(),this.length>c&&(u+=" ... "),"<Buffer "+u+">"},n&&(i.prototype[n]=i.prototype.inspect),i.prototype.compare=function(u,c,T,I,U){if(xt(u,Uint8Array)&&(u=i.from(u,u.offset,u.byteLength)),!i.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(c===void 0&&(c=0),T===void 0&&(T=u?u.length:0),I===void 0&&(I=0),U===void 0&&(U=this.length),c<0||T>u.length||I<0||U>this.length)throw new RangeError("out of range index");if(I>=U&&c>=T)return 0;if(I>=U)return-1;if(c>=T)return 1;if(c>>>=0,T>>>=0,I>>>=0,U>>>=0,this===u)return 0;let W=U-I,Be=T-c,qe=Math.min(W,Be),$e=this.slice(I,U),Ge=u.slice(c,T);for(let He=0;He<qe;++He)if($e[He]!==Ge[He]){W=$e[He],Be=Ge[He];break}return W<Be?-1:Be<W?1:0};function K(m,u,c,T,I){if(m.length===0)return-1;if(typeof c=="string"?(T=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,mr(c)&&(c=I?0:m.length-1),c<0&&(c=m.length+c),c>=m.length){if(I)return-1;c=m.length-1}else if(c<0)if(I)c=0;else return-1;if(typeof u=="string"&&(u=i.from(u,T)),i.isBuffer(u))return u.length===0?-1:ae(m,u,c,T,I);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?I?Uint8Array.prototype.indexOf.call(m,u,c):Uint8Array.prototype.lastIndexOf.call(m,u,c):ae(m,[u],c,T,I);throw new TypeError("val must be string, number or Buffer")}function ae(m,u,c,T,I){let U=1,W=m.length,Be=u.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(m.length<2||u.length<2)return-1;U=2,W/=2,Be/=2,c/=2}function qe(Ge,He){return U===1?Ge[He]:Ge.readUInt16BE(He*U)}let $e;if(I){let Ge=-1;for($e=c;$e<W;$e++)if(qe(m,$e)===qe(u,Ge===-1?0:$e-Ge)){if(Ge===-1&&(Ge=$e),$e-Ge+1===Be)return Ge*U}else Ge!==-1&&($e-=$e-Ge),Ge=-1}else for(c+Be>W&&(c=W-Be),$e=c;$e>=0;$e--){let Ge=!0;for(let He=0;He<Be;He++)if(qe(m,$e+He)!==qe(u,He)){Ge=!1;break}if(Ge)return $e}return-1}i.prototype.includes=function(u,c,T){return this.indexOf(u,c,T)!==-1},i.prototype.indexOf=function(u,c,T){return K(this,u,c,T,!0)},i.prototype.lastIndexOf=function(u,c,T){return K(this,u,c,T,!1)};function ee(m,u,c,T){c=Number(c)||0;let I=m.length-c;T?(T=Number(T),T>I&&(T=I)):T=I;let U=u.length;T>U/2&&(T=U/2);let W;for(W=0;W<T;++W){let Be=parseInt(u.substr(W*2,2),16);if(mr(Be))return W;m[c+W]=Be}return W}function ge(m,u,c,T){return Nt(Me(u,m.length-c),m,c,T)}function oe(m,u,c,T){return Nt(_e(u),m,c,T)}function re(m,u,c,T){return Nt(Ct(u),m,c,T)}function Oe(m,u,c,T){return Nt(Z(u,m.length-c),m,c,T)}i.prototype.write=function(u,c,T,I){if(c===void 0)I="utf8",T=this.length,c=0;else if(T===void 0&&typeof c=="string")I=c,T=this.length,c=0;else if(isFinite(c))c=c>>>0,isFinite(T)?(T=T>>>0,I===void 0&&(I="utf8")):(I=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let U=this.length-c;if((T===void 0||T>U)&&(T=U),u.length>0&&(T<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");I||(I="utf8");let W=!1;for(;;)switch(I){case"hex":return ee(this,u,c,T);case"utf8":case"utf-8":return ge(this,u,c,T);case"ascii":case"latin1":case"binary":return oe(this,u,c,T);case"base64":return re(this,u,c,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Oe(this,u,c,T);default:if(W)throw new TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),W=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ze(m,u,c){return u===0&&c===m.length?t.fromByteArray(m):t.fromByteArray(m.slice(u,c))}function tt(m,u,c){c=Math.min(m.length,c);let T=[],I=u;for(;I<c;){let U=m[I],W=null,Be=U>239?4:U>223?3:U>191?2:1;if(I+Be<=c){let qe,$e,Ge,He;switch(Be){case 1:U<128&&(W=U);break;case 2:qe=m[I+1],(qe&192)===128&&(He=(U&31)<<6|qe&63,He>127&&(W=He));break;case 3:qe=m[I+1],$e=m[I+2],(qe&192)===128&&($e&192)===128&&(He=(U&15)<<12|(qe&63)<<6|$e&63,He>2047&&(He<55296||He>57343)&&(W=He));break;case 4:qe=m[I+1],$e=m[I+2],Ge=m[I+3],(qe&192)===128&&($e&192)===128&&(Ge&192)===128&&(He=(U&15)<<18|(qe&63)<<12|($e&63)<<6|Ge&63,He>65535&&He<1114112&&(W=He))}}W===null?(W=65533,Be=1):W>65535&&(W-=65536,T.push(W>>>10&1023|55296),W=56320|W&1023),T.push(W),I+=Be}return Je(T)}let Ve=4096;function Je(m){let u=m.length;if(u<=Ve)return String.fromCharCode.apply(String,m);let c="",T=0;for(;T<u;)c+=String.fromCharCode.apply(String,m.slice(T,T+=Ve));return c}function ht(m,u,c){let T="";c=Math.min(m.length,c);for(let I=u;I<c;++I)T+=String.fromCharCode(m[I]&127);return T}function Ue(m,u,c){let T="";c=Math.min(m.length,c);for(let I=u;I<c;++I)T+=String.fromCharCode(m[I]);return T}function Pe(m,u,c){let T=m.length;(!u||u<0)&&(u=0),(!c||c<0||c>T)&&(c=T);let I="";for(let U=u;U<c;++U)I+=si[m[U]];return I}function Se(m,u,c){let T=m.slice(u,c),I="";for(let U=0;U<T.length-1;U+=2)I+=String.fromCharCode(T[U]+T[U+1]*256);return I}i.prototype.slice=function(u,c){let T=this.length;u=~~u,c=c===void 0?T:~~c,u<0?(u+=T,u<0&&(u=0)):u>T&&(u=T),c<0?(c+=T,c<0&&(c=0)):c>T&&(c=T),c<u&&(c=u);let I=this.subarray(u,c);return Object.setPrototypeOf(I,i.prototype),I};function fe(m,u,c){if(m%1!==0||m<0)throw new RangeError("offset is not uint");if(m+u>c)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(u,c,T){u=u>>>0,c=c>>>0,T||fe(u,c,this.length);let I=this[u],U=1,W=0;for(;++W<c&&(U*=256);)I+=this[u+W]*U;return I},i.prototype.readUintBE=i.prototype.readUIntBE=function(u,c,T){u=u>>>0,c=c>>>0,T||fe(u,c,this.length);let I=this[u+--c],U=1;for(;c>0&&(U*=256);)I+=this[u+--c]*U;return I},i.prototype.readUint8=i.prototype.readUInt8=function(u,c){return u=u>>>0,c||fe(u,1,this.length),this[u]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(u,c){return u=u>>>0,c||fe(u,2,this.length),this[u]|this[u+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(u,c){return u=u>>>0,c||fe(u,2,this.length),this[u]<<8|this[u+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},i.prototype.readBigUInt64LE=Et(function(u){u=u>>>0,b(u,"offset");let c=this[u],T=this[u+7];(c===void 0||T===void 0)&&x(u,this.length-8);let I=c+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,U=this[++u]+this[++u]*2**8+this[++u]*2**16+T*2**24;return BigInt(I)+(BigInt(U)<<BigInt(32))}),i.prototype.readBigUInt64BE=Et(function(u){u=u>>>0,b(u,"offset");let c=this[u],T=this[u+7];(c===void 0||T===void 0)&&x(u,this.length-8);let I=c*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],U=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+T;return(BigInt(I)<<BigInt(32))+BigInt(U)}),i.prototype.readIntLE=function(u,c,T){u=u>>>0,c=c>>>0,T||fe(u,c,this.length);let I=this[u],U=1,W=0;for(;++W<c&&(U*=256);)I+=this[u+W]*U;return U*=128,I>=U&&(I-=Math.pow(2,8*c)),I},i.prototype.readIntBE=function(u,c,T){u=u>>>0,c=c>>>0,T||fe(u,c,this.length);let I=c,U=1,W=this[u+--I];for(;I>0&&(U*=256);)W+=this[u+--I]*U;return U*=128,W>=U&&(W-=Math.pow(2,8*c)),W},i.prototype.readInt8=function(u,c){return u=u>>>0,c||fe(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},i.prototype.readInt16LE=function(u,c){u=u>>>0,c||fe(u,2,this.length);let T=this[u]|this[u+1]<<8;return T&32768?T|4294901760:T},i.prototype.readInt16BE=function(u,c){u=u>>>0,c||fe(u,2,this.length);let T=this[u+1]|this[u]<<8;return T&32768?T|4294901760:T},i.prototype.readInt32LE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},i.prototype.readInt32BE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},i.prototype.readBigInt64LE=Et(function(u){u=u>>>0,b(u,"offset");let c=this[u],T=this[u+7];(c===void 0||T===void 0)&&x(u,this.length-8);let I=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(T<<24);return(BigInt(I)<<BigInt(32))+BigInt(c+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),i.prototype.readBigInt64BE=Et(function(u){u=u>>>0,b(u,"offset");let c=this[u],T=this[u+7];(c===void 0||T===void 0)&&x(u,this.length-8);let I=(c<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(I)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+T)}),i.prototype.readFloatLE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),e.read(this,u,!0,23,4)},i.prototype.readFloatBE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),e.read(this,u,!1,23,4)},i.prototype.readDoubleLE=function(u,c){return u=u>>>0,c||fe(u,8,this.length),e.read(this,u,!0,52,8)},i.prototype.readDoubleBE=function(u,c){return u=u>>>0,c||fe(u,8,this.length),e.read(this,u,!1,52,8)};function ve(m,u,c,T,I,U){if(!i.isBuffer(m))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>I||u<U)throw new RangeError('"value" argument is out of bounds');if(c+T>m.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(u,c,T,I){if(u=+u,c=c>>>0,T=T>>>0,!I){let Be=Math.pow(2,8*T)-1;ve(this,u,c,T,Be,0)}let U=1,W=0;for(this[c]=u&255;++W<T&&(U*=256);)this[c+W]=u/U&255;return c+T},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(u,c,T,I){if(u=+u,c=c>>>0,T=T>>>0,!I){let Be=Math.pow(2,8*T)-1;ve(this,u,c,T,Be,0)}let U=T-1,W=1;for(this[c+U]=u&255;--U>=0&&(W*=256);)this[c+U]=u/W&255;return c+T},i.prototype.writeUint8=i.prototype.writeUInt8=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,1,255,0),this[c]=u&255,c+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,2,65535,0),this[c]=u&255,this[c+1]=u>>>8,c+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,2,65535,0),this[c]=u>>>8,this[c+1]=u&255,c+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,4,4294967295,0),this[c+3]=u>>>24,this[c+2]=u>>>16,this[c+1]=u>>>8,this[c]=u&255,c+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,4,4294967295,0),this[c]=u>>>24,this[c+1]=u>>>16,this[c+2]=u>>>8,this[c+3]=u&255,c+4};function D(m,u,c,T,I){ie(u,T,I,m,c,7);let U=Number(u&BigInt(4294967295));m[c++]=U,U=U>>8,m[c++]=U,U=U>>8,m[c++]=U,U=U>>8,m[c++]=U;let W=Number(u>>BigInt(32)&BigInt(4294967295));return m[c++]=W,W=W>>8,m[c++]=W,W=W>>8,m[c++]=W,W=W>>8,m[c++]=W,c}function j(m,u,c,T,I){ie(u,T,I,m,c,7);let U=Number(u&BigInt(4294967295));m[c+7]=U,U=U>>8,m[c+6]=U,U=U>>8,m[c+5]=U,U=U>>8,m[c+4]=U;let W=Number(u>>BigInt(32)&BigInt(4294967295));return m[c+3]=W,W=W>>8,m[c+2]=W,W=W>>8,m[c+1]=W,W=W>>8,m[c]=W,c+8}i.prototype.writeBigUInt64LE=Et(function(u,c=0){return D(this,u,c,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=Et(function(u,c=0){return j(this,u,c,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(u,c,T,I){if(u=+u,c=c>>>0,!I){let qe=Math.pow(2,8*T-1);ve(this,u,c,T,qe-1,-qe)}let U=0,W=1,Be=0;for(this[c]=u&255;++U<T&&(W*=256);)u<0&&Be===0&&this[c+U-1]!==0&&(Be=1),this[c+U]=(u/W>>0)-Be&255;return c+T},i.prototype.writeIntBE=function(u,c,T,I){if(u=+u,c=c>>>0,!I){let qe=Math.pow(2,8*T-1);ve(this,u,c,T,qe-1,-qe)}let U=T-1,W=1,Be=0;for(this[c+U]=u&255;--U>=0&&(W*=256);)u<0&&Be===0&&this[c+U+1]!==0&&(Be=1),this[c+U]=(u/W>>0)-Be&255;return c+T},i.prototype.writeInt8=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,1,127,-128),u<0&&(u=255+u+1),this[c]=u&255,c+1},i.prototype.writeInt16LE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,2,32767,-32768),this[c]=u&255,this[c+1]=u>>>8,c+2},i.prototype.writeInt16BE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,2,32767,-32768),this[c]=u>>>8,this[c+1]=u&255,c+2},i.prototype.writeInt32LE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,4,2147483647,-2147483648),this[c]=u&255,this[c+1]=u>>>8,this[c+2]=u>>>16,this[c+3]=u>>>24,c+4},i.prototype.writeInt32BE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[c]=u>>>24,this[c+1]=u>>>16,this[c+2]=u>>>8,this[c+3]=u&255,c+4},i.prototype.writeBigInt64LE=Et(function(u,c=0){return D(this,u,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=Et(function(u,c=0){return j(this,u,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(m,u,c,T,I,U){if(c+T>m.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function de(m,u,c,T,I){return u=+u,c=c>>>0,I||F(m,u,c,4),e.write(m,u,c,T,23,4),c+4}i.prototype.writeFloatLE=function(u,c,T){return de(this,u,c,!0,T)},i.prototype.writeFloatBE=function(u,c,T){return de(this,u,c,!1,T)};function Te(m,u,c,T,I){return u=+u,c=c>>>0,I||F(m,u,c,8),e.write(m,u,c,T,52,8),c+8}i.prototype.writeDoubleLE=function(u,c,T){return Te(this,u,c,!0,T)},i.prototype.writeDoubleBE=function(u,c,T){return Te(this,u,c,!1,T)},i.prototype.copy=function(u,c,T,I){if(!i.isBuffer(u))throw new TypeError("argument should be a Buffer");if(T||(T=0),!I&&I!==0&&(I=this.length),c>=u.length&&(c=u.length),c||(c=0),I>0&&I<T&&(I=T),I===T||u.length===0||this.length===0)return 0;if(c<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=this.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("sourceEnd out of bounds");I>this.length&&(I=this.length),u.length-c<I-T&&(I=u.length-c+T);let U=I-T;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(c,T,I):Uint8Array.prototype.set.call(u,this.subarray(T,I),c),U},i.prototype.fill=function(u,c,T,I){if(typeof u=="string"){if(typeof c=="string"?(I=c,c=0,T=this.length):typeof T=="string"&&(I=T,T=this.length),I!==void 0&&typeof I!="string")throw new TypeError("encoding must be a string");if(typeof I=="string"&&!i.isEncoding(I))throw new TypeError("Unknown encoding: "+I);if(u.length===1){let W=u.charCodeAt(0);(I==="utf8"&&W<128||I==="latin1")&&(u=W)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(c<0||this.length<c||this.length<T)throw new RangeError("Out of range index");if(T<=c)return this;c=c>>>0,T=T===void 0?this.length:T>>>0,u||(u=0);let U;if(typeof u=="number")for(U=c;U<T;++U)this[U]=u;else{let W=i.isBuffer(u)?u:i.from(u,I),Be=W.length;if(Be===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(U=0;U<T-c;++U)this[U+c]=W[U%Be]}return this};let A={};function k(m,u,c){A[m]=class extends c{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${m}]`,this.stack,delete this.name}get code(){return m}set code(I){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:I,writable:!0})}toString(){return`${this.name} [${m}]: ${this.message}`}}}k("ERR_BUFFER_OUT_OF_BOUNDS",function(m){return m?`${m} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),k("ERR_INVALID_ARG_TYPE",function(m,u){return`The "${m}" argument must be of type number. Received type ${typeof u}`},TypeError),k("ERR_OUT_OF_RANGE",function(m,u,c){let T=`The value of "${m}" is out of range.`,I=c;return Number.isInteger(c)&&Math.abs(c)>2**32?I=$(String(c)):typeof c=="bigint"&&(I=String(c),(c>BigInt(2)**BigInt(32)||c<-(BigInt(2)**BigInt(32)))&&(I=$(I)),I+="n"),T+=` It must be ${u}. Received ${I}`,T},RangeError);function $(m){let u="",c=m.length,T=m[0]==="-"?1:0;for(;c>=T+4;c-=3)u=`_${m.slice(c-3,c)}${u}`;return`${m.slice(0,c)}${u}`}function Y(m,u,c){b(u,"offset"),(m[u]===void 0||m[u+c]===void 0)&&x(u,m.length-(c+1))}function ie(m,u,c,T,I,U){if(m>c||m<u){let W=typeof u=="bigint"?"n":"",Be;throw u===0||u===BigInt(0)?Be=`>= 0${W} and < 2${W} ** ${(U+1)*8}${W}`:Be=`>= -(2${W} ** ${(U+1)*8-1}${W}) and < 2 ** ${(U+1)*8-1}${W}`,new A.ERR_OUT_OF_RANGE("value",Be,m)}Y(T,I,U)}function b(m,u){if(typeof m!="number")throw new A.ERR_INVALID_ARG_TYPE(u,"number",m)}function x(m,u,c){throw Math.floor(m)!==m?(b(m,c),new A.ERR_OUT_OF_RANGE("offset","an integer",m)):u<0?new A.ERR_BUFFER_OUT_OF_BOUNDS:new A.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${u}`,m)}let z=/[^+/0-9A-Za-z-_]/g;function Q(m){if(m=m.split("=")[0],m=m.trim().replace(z,""),m.length<2)return"";for(;m.length%4!==0;)m=m+"=";return m}function Me(m,u){u=u||1/0;let c,T=m.length,I=null,U=[];for(let W=0;W<T;++W){if(c=m.charCodeAt(W),c>55295&&c<57344){if(!I){if(c>56319){(u-=3)>-1&&U.push(239,191,189);continue}else if(W+1===T){(u-=3)>-1&&U.push(239,191,189);continue}I=c;continue}if(c<56320){(u-=3)>-1&&U.push(239,191,189),I=c;continue}c=(I-55296<<10|c-56320)+65536}else I&&(u-=3)>-1&&U.push(239,191,189);if(I=null,c<128){if((u-=1)<0)break;U.push(c)}else if(c<2048){if((u-=2)<0)break;U.push(c>>6|192,c&63|128)}else if(c<65536){if((u-=3)<0)break;U.push(c>>12|224,c>>6&63|128,c&63|128)}else if(c<1114112){if((u-=4)<0)break;U.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw new Error("Invalid code point")}return U}function _e(m){let u=[];for(let c=0;c<m.length;++c)u.push(m.charCodeAt(c)&255);return u}function Z(m,u){let c,T,I,U=[];for(let W=0;W<m.length&&!((u-=2)<0);++W)c=m.charCodeAt(W),T=c>>8,I=c%256,U.push(I),U.push(T);return U}function Ct(m){return t.toByteArray(Q(m))}function Nt(m,u,c,T){let I;for(I=0;I<T&&!(I+c>=u.length||I>=m.length);++I)u[I+c]=m[I];return I}function xt(m,u){return m instanceof u||m!=null&&m.constructor!=null&&m.constructor.name!=null&&m.constructor.name===u.name}function mr(m){return m!==m}let si=(function(){let m="0123456789abcdef",u=new Array(256);for(let c=0;c<16;++c){let T=c*16;for(let I=0;I<16;++I)u[T+I]=m[c]+m[I]}return u})();function Et(m){return typeof BigInt>"u"?hr:m}function hr(){throw new Error("BigInt not supported")}return hn}var vr,cc,fi,fc,hn,dc,di=ot(()=>{C();R();O();vr={},cc=!1;fi={},fc=!1;hn={},dc=!1});var vn,q,cA,fA,pc=ot(()=>{C();R();O();di();vn=Dt();vn.Buffer;vn.SlowBuffer;vn.INSPECT_MAX_BYTES;vn.kMaxLength;q=vn.Buffer,cA=vn.INSPECT_MAX_BYTES,fA=vn.kMaxLength});var R=ot(()=>{pc()});function Ht(){return Oy||(Oy=!0,typeof Object.create=="function"?ba=function(e,n){n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ba=function(e,n){if(n){e.super_=n;var r=function(){};r.prototype=n.prototype,e.prototype=new r,e.prototype.constructor=e}}),ba}var ba,Oy,rs=ot(()=>{C();R();O();ba={},Oy=!1});function Ne(){Ne.init.call(this)}function wa(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function Ky(t){return t._maxListeners===void 0?Ne.defaultMaxListeners:t._maxListeners}function Dy(t,e,n,r){var a,o,i,s;if(wa(n),(o=t._events)===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),i=o[e]),i===void 0)i=o[e]=n,++t._eventsCount;else if(typeof i=="function"?i=o[e]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),(a=Ky(t))>0&&i.length>a&&!i.warned){i.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=i.length,s=l,console&&console.warn&&console.warn(s)}return t}function DB(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Hy(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},a=DB.bind(r);return a.listener=n,r.wrapFn=a,a}function Uy(t,e,n){var r=t._events;if(r===void 0)return[];var a=r[e];return a===void 0?[]:typeof a=="function"?n?[a.listener||a]:[a]:n?(function(o){for(var i=new Array(o.length),s=0;s<i.length;++s)i[s]=o[s].listener||o[s];return i})(a):Ly(a,a.length)}function Zy(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}function Ly(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}var $y,jy,ar,Ry,My,Ny,_t,is=ot(()=>{C();R();O();ar=typeof Reflect=="object"?Reflect:null,Ry=ar&&typeof ar.apply=="function"?ar.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};jy=ar&&typeof ar.ownKeys=="function"?ar.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};My=Number.isNaN||function(t){return t!=t};$y=Ne,Ne.EventEmitter=Ne,Ne.prototype._events=void 0,Ne.prototype._eventsCount=0,Ne.prototype._maxListeners=void 0;Ny=10;Object.defineProperty(Ne,"defaultMaxListeners",{enumerable:!0,get:function(){return Ny},set:function(t){if(typeof t!="number"||t<0||My(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Ny=t}}),Ne.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ne.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||My(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},Ne.prototype.getMaxListeners=function(){return Ky(this)},Ne.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r=t==="error",a=this._events;if(a!==void 0)r=r&&a.error===void 0;else if(!r)return!1;if(r){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var i=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw i.context=o,i}var s=a[t];if(s===void 0)return!1;if(typeof s=="function")Ry(s,this,e);else{var l=s.length,f=Ly(s,l);for(n=0;n<l;++n)Ry(f[n],this,e)}return!0},Ne.prototype.addListener=function(t,e){return Dy(this,t,e,!1)},Ne.prototype.on=Ne.prototype.addListener,Ne.prototype.prependListener=function(t,e){return Dy(this,t,e,!0)},Ne.prototype.once=function(t,e){return wa(e),this.on(t,Hy(this,t,e)),this},Ne.prototype.prependOnceListener=function(t,e){return wa(e),this.prependListener(t,Hy(this,t,e)),this},Ne.prototype.removeListener=function(t,e){var n,r,a,o,i;if(wa(e),(r=this._events)===void 0)return this;if((n=r[t])===void 0)return this;if(n===e||n.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if(typeof n!="function"){for(a=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){i=n[o].listener,a=o;break}if(a<0)return this;a===0?n.shift():(function(s,l){for(;l+1<s.length;l++)s[l]=s[l+1];s.pop()})(n,a),n.length===1&&(r[t]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",t,i||e)}return this},Ne.prototype.off=Ne.prototype.removeListener,Ne.prototype.removeAllListeners=function(t){var e,n,r;if((n=this._events)===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var a,o=Object.keys(n);for(r=0;r<o.length;++r)(a=o[r])!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=n[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},Ne.prototype.listeners=function(t){return Uy(this,t,!0)},Ne.prototype.rawListeners=function(t){return Uy(this,t,!1)},Ne.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Zy.call(t,e)},Ne.prototype.listenerCount=Zy,Ne.prototype.eventNames=function(){return this._eventsCount>0?jy(this._events):[]};_t=$y;_t.EventEmitter;_t.defaultMaxListeners;_t.init;_t.listenerCount;_t.EventEmitter;_t.defaultMaxListeners;_t.init;_t.listenerCount});var Fy=ot(()=>{C();R();O();is();_t.once=function(t,e){return new Promise((n,r)=>{function a(...i){o!==void 0&&t.removeListener("error",o),n(i)}let o;e!=="error"&&(o=i=>{t.removeListener(name,a),r(i)},t.once("error",o)),t.once(e,a)})};_t.on=function(t,e){let n=[],r=[],a=null,o=!1,i={async next(){let f=n.shift();if(f)return createIterResult(f,!1);if(a){let p=Promise.reject(a);return a=null,p}return o?createIterResult(void 0,!0):new Promise((p,y)=>r.push({resolve:p,reject:y}))},async return(){t.removeListener(e,s),t.removeListener("error",l),o=!0;for(let f of r)f.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(f){a=f,t.removeListener(e,s),t.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return t.on(e,s),t.on("error",l),i;function s(...f){let p=r.shift();p?p.resolve(createIterResult(f,!1)):n.push(f)}function l(f){o=!0;let p=r.shift();p?p.reject(f):a=f,i.return()}}});function us(){throw new Error("setTimeout has not been defined")}function cs(){throw new Error("clearTimeout has not been defined")}function im(t){if(Jt===setTimeout)return setTimeout(t,0);if((Jt===us||!Jt)&&setTimeout)return Jt=setTimeout,setTimeout(t,0);try{return Jt(t,0)}catch{try{return Jt.call(null,t,0)}catch{return Jt.call(this||sr,t,0)}}}function HB(){or&&Dn&&(or=!1,Dn.length?Xt=Dn.concat(Xt):ka=-1,Xt.length&&am())}function am(){if(!or){var t=im(HB);or=!0;for(var e=Xt.length;e;){for(Dn=Xt,Xt=[];++ka<e;)Dn&&Dn[ka].run();ka=-1,e=Xt.length}Dn=null,or=!1,(function(n){if(Yt===clearTimeout)return clearTimeout(n);if((Yt===cs||!Yt)&&clearTimeout)return Yt=clearTimeout,clearTimeout(n);try{Yt(n)}catch{try{return Yt.call(null,n)}catch{return Yt.call(this||sr,n)}}})(t)}}function Wy(t,e){(this||sr).fun=t,(this||sr).array=e}function Vt(){}function Un(t){return t.call.bind(t)}function Jr(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}function qy(t){return bt&&Pt?St(t)!==void 0:fm(t)||dm(t)||pm(t)||gm(t)||ym(t)||mm(t)||hm(t)||vm(t)||Tm(t)||_m(t)||bm(t)}function fm(t){return bt&&Pt?St(t)==="Uint8Array":We(t)==="[object Uint8Array]"||qB(t)&&t.buffer!==void 0}function dm(t){return bt&&Pt?St(t)==="Uint8ClampedArray":We(t)==="[object Uint8ClampedArray]"}function pm(t){return bt&&Pt?St(t)==="Uint16Array":We(t)==="[object Uint16Array]"}function gm(t){return bt&&Pt?St(t)==="Uint32Array":We(t)==="[object Uint32Array]"}function ym(t){return bt&&Pt?St(t)==="Int8Array":We(t)==="[object Int8Array]"}function mm(t){return bt&&Pt?St(t)==="Int16Array":We(t)==="[object Int16Array]"}function hm(t){return bt&&Pt?St(t)==="Int32Array":We(t)==="[object Int32Array]"}function vm(t){return bt&&Pt?St(t)==="Float32Array":We(t)==="[object Float32Array]"}function Tm(t){return bt&&Pt?St(t)==="Float64Array":We(t)==="[object Float64Array]"}function _m(t){return bt&&Pt?St(t)==="BigInt64Array":We(t)==="[object BigInt64Array]"}function bm(t){return bt&&Pt?St(t)==="BigUint64Array":We(t)==="[object BigUint64Array]"}function xa(t){return We(t)==="[object Map]"}function Pa(t){return We(t)==="[object Set]"}function Ba(t){return We(t)==="[object WeakMap]"}function as(t){return We(t)==="[object WeakSet]"}function Aa(t){return We(t)==="[object ArrayBuffer]"}function Gy(t){return typeof ArrayBuffer<"u"&&(Aa.working?Aa(t):t instanceof ArrayBuffer)}function Ca(t){return We(t)==="[object DataView]"}function Vy(t){return typeof DataView<"u"&&(Ca.working?Ca(t):t instanceof DataView)}function Oa(t){return We(t)==="[object SharedArrayBuffer]"}function Jy(t){return typeof SharedArrayBuffer<"u"&&(Oa.working?Oa(t):t instanceof SharedArrayBuffer)}function Yy(t){return Jr(t,XB)}function Xy(t){return Jr(t,QB)}function Qy(t){return Jr(t,eE)}function em(t){return cm&&Jr(t,tE)}function tm(t){return ds&&Jr(t,nE)}function fn(t,e){var n={seen:[],stylize:aE};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),ps(e)?n.showHidden=e:e&&L._extend(n,e),Hn(n.showHidden)&&(n.showHidden=!1),Hn(n.depth)&&(n.depth=2),Hn(n.colors)&&(n.colors=!1),Hn(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=iE),Ra(n,t,n.depth)}function iE(t,e){var n=fn.styles[e];return n?"\x1B["+fn.colors[n][0]+"m"+t+"\x1B["+fn.colors[n][1]+"m":t}function aE(t,e){return t}function Ra(t,e,n){if(t.customInspect&&e&&Ia(e.inspect)&&e.inspect!==L.inspect&&(!e.constructor||e.constructor.prototype!==e)){var r=e.inspect(n,t);return Ma(r)||(r=Ra(t,r,n)),r}var a=(function(g,h){if(Hn(h))return g.stylize("undefined","undefined");if(Ma(h)){var w="'"+JSON.stringify(h).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return g.stylize(w,"string")}if(Pm(h))return g.stylize(""+h,"number");if(ps(h))return g.stylize(""+h,"boolean");if(Ha(h))return g.stylize("null","null")})(t,e);if(a)return a;var o=Object.keys(e),i=(function(g){var h={};return g.forEach((function(w,P){h[w]=!0})),h})(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),Vr(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return os(e);if(o.length===0){if(Ia(e)){var s=e.name?": "+e.name:"";return t.stylize("[Function"+s+"]","special")}if(Gr(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Na(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Vr(e))return os(e)}var l,f="",p=!1,y=["{","}"];return xm(e)&&(p=!0,y=["[","]"]),Ia(e)&&(f=" [Function"+(e.name?": "+e.name:"")+"]"),Gr(e)&&(f=" "+RegExp.prototype.toString.call(e)),Na(e)&&(f=" "+Date.prototype.toUTCString.call(e)),Vr(e)&&(f=" "+os(e)),o.length!==0||p&&e.length!=0?n<0?Gr(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),l=p?(function(g,h,w,P,B){for(var v=[],S=0,E=h.length;S<E;++S)Bm(h,String(S))?v.push(ss(g,h,w,P,String(S),!0)):v.push("");return B.forEach((function(H){H.match(/^\d+$/)||v.push(ss(g,h,w,P,H,!0))})),v})(t,e,n,i,o):o.map((function(g){return ss(t,e,n,i,g,p)})),t.seen.pop(),(function(g,h,w){var P=0;return g.reduce((function(B,v){return P++,v.indexOf(`
|
|
2
2
|
`)>=0&&P++,B+v.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?w[0]+(h===""?"":h+`
|
|
3
3
|
`)+" "+g.join(`,
|
|
4
|
-
`)+" "+w[1]:w[0]+h+" "+g.join(", ")+" "+w[1]})(l,f,y)):y[0]+f+y[1]}function os(t){return"["+Error.prototype.toString.call(t)+"]"}function
|
|
5
|
-
`)>-1&&(s=
|
|
4
|
+
`)+" "+w[1]:w[0]+h+" "+g.join(", ")+" "+w[1]})(l,f,y)):y[0]+f+y[1]}function os(t){return"["+Error.prototype.toString.call(t)+"]"}function ss(t,e,n,r,a,o){var i,s,l;if((l=Object.getOwnPropertyDescriptor(e,a)||{value:e[a]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),Bm(r,a)||(i="["+a+"]"),s||(t.seen.indexOf(l.value)<0?(s=Ha(n)?Ra(t,l.value,null):Ra(t,l.value,n-1)).indexOf(`
|
|
5
|
+
`)>-1&&(s=o?s.split(`
|
|
6
6
|
`).map((function(f){return" "+f})).join(`
|
|
7
7
|
`).substr(2):`
|
|
8
8
|
`+s.split(`
|
|
9
9
|
`).map((function(f){return" "+f})).join(`
|
|
10
|
-
`)):s=t.stylize("[Circular]","special")),Dn(i)){if(a&&o.match(/^\d+$/))return s;(i=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2),i=t.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=t.stylize(i,"string"))}return i+": "+s}function Em(t){return Array.isArray(t)}function ds(t){return typeof t=="boolean"}function $o(t){return t===null}function km(t){return typeof t=="number"}function Ho(t){return typeof t=="string"}function Dn(t){return t===void 0}function qr(t){return sr(t)&&ps(t)==="[object RegExp]"}function sr(t){return typeof t=="object"&&t!==null}function Uo(t){return sr(t)&&ps(t)==="[object Date]"}function Gr(t){return sr(t)&&(ps(t)==="[object Error]"||t instanceof Error)}function Oo(t){return typeof t=="function"}function ps(t){return Object.prototype.toString.call(t)}function ss(t){return t<10?"0"+t.toString(10):t.toString(10)}function oS(){var t=new Date,e=[ss(t.getHours()),ss(t.getMinutes()),ss(t.getSeconds())].join(":");return[t.getDate(),iS[t.getMonth()],e].join(" ")}function Im(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function aS(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}var sm,Vt,Jt,ar,Qe,Nn,Xt,or,Co,je,DB,cs,Zo,cm,HB,UB,ZB,$B,jB,fm,dm,Jy,KB,LB,FB,pm,Se,WB,zB,qB,gm,fs,Pt,bt,GB,We,JB,XB,YB,zr,L,Ht,am,tS,Io,Sm,Ao,iS,Mn,vC,jo=at(()=>{C();R();O();ar=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Qe=sm={};(function(){try{Vt=typeof setTimeout=="function"?setTimeout:ls}catch{Vt=ls}try{Jt=typeof clearTimeout=="function"?clearTimeout:us}catch{Jt=us}})();Xt=[],or=!1,Co=-1;Qe.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Xt.push(new Vy(t,e)),Xt.length!==1||or||lm(um)},Vy.prototype.run=function(){(this||ar).fun.apply(null,(this||ar).array)},Qe.title="browser",Qe.browser=!0,Qe.env={},Qe.argv=[],Qe.version="",Qe.versions={},Qe.on=Gt,Qe.addListener=Gt,Qe.once=Gt,Qe.off=Gt,Qe.removeListener=Gt,Qe.removeAllListeners=Gt,Qe.emit=Gt,Qe.prependListener=Gt,Qe.prependOnceListener=Gt,Qe.listeners=function(t){return[]},Qe.binding=function(t){throw new Error("process.binding is not supported")},Qe.cwd=function(){return"/"},Qe.chdir=function(t){throw new Error("process.chdir is not supported")},Qe.umask=function(){return 0};je=sm;je.addListener;je.argv;je.binding;je.browser;je.chdir;je.cwd;je.emit;je.env;je.listeners;je.nextTick;je.off;je.on;je.once;je.prependListener;je.prependOnceListener;je.removeAllListeners;je.removeListener;je.title;je.umask;je.version;je.versions;DB=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",cs=Object.prototype.toString,Zo=function(t){return!(DB&&t&&typeof t=="object"&&Symbol.toStringTag in t)&&cs.call(t)==="[object Arguments]"},cm=function(t){return!!Zo(t)||t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&cs.call(t)!=="[object Array]"&&cs.call(t.callee)==="[object Function]"},HB=(function(){return Zo(arguments)})();Zo.isLegacyArguments=cm;UB=HB?Zo:cm,ZB=Object.prototype.toString,$B=Function.prototype.toString,jB=/^\s*(?:function)?\*/,fm=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",dm=Object.getPrototypeOf,Jy=(function(){if(!fm)return!1;try{return Function("return function*() {}")()}catch{}})(),KB=Jy?dm(Jy):{},LB=function(t){return typeof t=="function"&&(!!jB.test($B.call(t))||(fm?dm(t)===KB:ZB.call(t)==="[object GeneratorFunction]"))},FB=typeof Object.create=="function"?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},pm=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"},Se={},WB=pm,zB=UB,qB=LB;gm=typeof BigInt<"u",fs=typeof Symbol<"u",Pt=fs&&Symbol.toStringTag!==void 0,bt=typeof Uint8Array<"u",GB=typeof ArrayBuffer<"u";if(bt&&Pt)var VB=Object.getPrototypeOf(Uint8Array.prototype),Et=Hn(Object.getOwnPropertyDescriptor(VB,Symbol.toStringTag).get);We=Hn(Object.prototype.toString),JB=Hn(Number.prototype.valueOf),XB=Hn(String.prototype.valueOf),YB=Hn(Boolean.prototype.valueOf);if(gm)var QB=Hn(BigInt.prototype.valueOf);if(fs)var eS=Hn(Symbol.prototype.valueOf);Se.isArgumentsObject=zB,Se.isGeneratorFunction=qB,Se.isPromise=function(t){return typeof Promise<"u"&&t instanceof Promise||t!==null&&typeof t=="object"&&typeof t.then=="function"&&typeof t.catch=="function"},Se.isArrayBufferView=function(t){return GB&&ArrayBuffer.isView?ArrayBuffer.isView(t):Xy(t)||Qy(t)},Se.isTypedArray=Xy,Se.isUint8Array=ym,Se.isUint8ClampedArray=mm,Se.isUint16Array=hm,Se.isUint32Array=vm,Se.isInt8Array=Tm,Se.isInt16Array=_m,Se.isInt32Array=bm,Se.isFloat32Array=wm,Se.isFloat64Array=xm,Se.isBigInt64Array=Pm,Se.isBigUint64Array=Bm,So.working=typeof Map<"u"&&So(new Map),Se.isMap=function(t){return typeof Map<"u"&&(So.working?So(t):t instanceof Map)},Eo.working=typeof Set<"u"&&Eo(new Set),Se.isSet=function(t){return typeof Set<"u"&&(Eo.working?Eo(t):t instanceof Set)},ko.working=typeof WeakMap<"u"&&ko(new WeakMap),Se.isWeakMap=function(t){return typeof WeakMap<"u"&&(ko.working?ko(t):t instanceof WeakMap)},is.working=typeof WeakSet<"u"&&is(new WeakSet),Se.isWeakSet=function(t){return is(t)},Ro.working=typeof ArrayBuffer<"u"&&Ro(new ArrayBuffer),Se.isArrayBuffer=Yy,Mo.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Mo(new DataView(new ArrayBuffer(1),0,1)),Se.isDataView=Qy,No.working=typeof SharedArrayBuffer<"u"&&No(new SharedArrayBuffer),Se.isSharedArrayBuffer=em,Se.isAsyncFunction=function(t){return We(t)==="[object AsyncFunction]"},Se.isMapIterator=function(t){return We(t)==="[object Map Iterator]"},Se.isSetIterator=function(t){return We(t)==="[object Set Iterator]"},Se.isGeneratorObject=function(t){return We(t)==="[object Generator]"},Se.isWebAssemblyCompiledModule=function(t){return We(t)==="[object WebAssembly.Module]"},Se.isNumberObject=tm,Se.isStringObject=nm,Se.isBooleanObject=rm,Se.isBigIntObject=im,Se.isSymbolObject=om,Se.isBoxedPrimitive=function(t){return tm(t)||nm(t)||rm(t)||im(t)||om(t)},Se.isAnyArrayBuffer=function(t){return bt&&(Yy(t)||em(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(Se,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}));zr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,L={},Ht=je,am=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++)n[e[r]]=Object.getOwnPropertyDescriptor(t,e[r]);return n},tS=/%[sdj%]/g;L.format=function(t){if(!Ho(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(cn(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,o=r.length,a=String(t).replace(tS,(function(s){if(s==="%%")return"%";if(n>=o)return s;switch(s){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch{return"[Circular]"}default:return s}})),i=r[n];n<o;i=r[++n])$o(i)||!sr(i)?a+=" "+i:a+=" "+cn(i);return a},L.deprecate=function(t,e){if(Ht!==void 0&&Ht.noDeprecation===!0)return t;if(Ht===void 0)return function(){return L.deprecate(t,e).apply(this||zr,arguments)};var n=!1;return function(){if(!n){if(Ht.throwDeprecation)throw new Error(e);Ht.traceDeprecation?console.trace(e):console.error(e),n=!0}return t.apply(this||zr,arguments)}};Io={},Sm=/^$/;Ht.env.NODE_DEBUG&&(Ao=Ht.env.NODE_DEBUG,Ao=Ao.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),Sm=new RegExp("^"+Ao+"$","i"));L.debuglog=function(t){if(t=t.toUpperCase(),!Io[t])if(Sm.test(t)){var e=Ht.pid;Io[t]=function(){var n=L.format.apply(L,arguments);console.error("%s %d: %s",t,e,n)}}else Io[t]=function(){};return Io[t]},L.inspect=cn,cn.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},cn.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},L.types=Se,L.isArray=Em,L.isBoolean=ds,L.isNull=$o,L.isNullOrUndefined=function(t){return t==null},L.isNumber=km,L.isString=Ho,L.isSymbol=function(t){return typeof t=="symbol"},L.isUndefined=Dn,L.isRegExp=qr,L.types.isRegExp=qr,L.isObject=sr,L.isDate=Uo,L.types.isDate=Uo,L.isError=Gr,L.types.isNativeError=Gr,L.isFunction=Oo,L.isPrimitive=function(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||t===void 0},L.isBuffer=pm;iS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];L.log=function(){console.log("%s - %s",oS(),L.format.apply(L,arguments))},L.inherits=FB,L._extend=function(t,e){if(!e||!sr(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t};Mn=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;L.promisify=function(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');if(Mn&&t[Mn]){var e;if(typeof(e=t[Mn])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Mn,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var n,r,o=new Promise((function(s,l){n=s,r=l})),a=[],i=0;i<arguments.length;i++)a.push(arguments[i]);a.push((function(s,l){s?r(s):n(l)}));try{t.apply(this||zr,a)}catch(s){r(s)}return o}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Mn&&Object.defineProperty(e,Mn,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,am(t))},L.promisify.custom=Mn,L.callbackify=function(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var o=n.pop();if(typeof o!="function")throw new TypeError("The last argument must be of type Function");var a=this||zr,i=function(){return o.apply(a,arguments)};t.apply(this||zr,n).then((function(s){Ht.nextTick(i.bind(null,null,s))}),(function(s){Ht.nextTick(aS.bind(null,s,i))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,am(t)),e};L._extend;L.callbackify;L.debuglog;L.deprecate;L.format;L.inherits;L.inspect;L.isArray;L.isBoolean;L.isBuffer;L.isDate;L.isError;L.isFunction;L.isNull;L.isNullOrUndefined;L.isNumber;L.isObject;L.isPrimitive;L.isRegExp;L.isString;L.isSymbol;L.isUndefined;L.log;L.promisify;L._extend;L.callbackify;L.debuglog;L.deprecate;L.format;L.inherits;L.inspect;L.isArray;L.isBoolean;L.isBuffer;L.isDate;L.isError;L.isFunction;L.isNull;L.isNullOrUndefined;L.isNumber;L.isObject;L.isPrimitive;L.isRegExp;L.isString;L.isSymbol;L.isUndefined;L.log;vC=L.promisify;L.types});var PC,Am=at(()=>{C();R();O();jo();L._extend;L.callbackify;L.debuglog;L.deprecate;L.format;L.inherits;L.inspect;L.isArray;L.isBoolean;L.isBuffer;L.isDate;L.isError;L.isFunction;L.isNull;L.isNullOrUndefined;L.isNumber;L.isObject;L.isPrimitive;L.isRegExp;L.isString;L.isSymbol;L.isUndefined;L.log;PC=L.promisify;L.types;L.TextEncoder=globalThis.TextEncoder;L.TextDecoder=globalThis.TextDecoder});function hs(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function sS(){!lr||!Un||(lr=!1,Un.length?Yt=Un.concat(Yt):Ko=-1,Yt.length&&Cm())}function Cm(){if(!lr){var t=setTimeout(sS,0);lr=!0;for(var e=Yt.length;e;){for(Un=Yt,Yt=[];++Ko<e;)Un&&Un[Ko].run();Ko=-1,e=Yt.length}Un=null,lr=!1,clearTimeout(t)}}function lS(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Yt.push(new Om(t,e)),Yt.length===1&&!lr&&setTimeout(Cm,0)}function Om(t,e){this.fun=t,this.array=e}function ct(){}function BS(t){hs("_linkedBinding")}function IS(t){hs("dlopen")}function AS(){return[]}function CS(){return[]}function $S(t,e){if(!t)throw new Error(e||"assertion error")}function FS(){return!1}function sE(){return fn.now()/1e3}function ms(t){var e=Math.floor((Date.now()-fn.now())*.001),n=fn.now()*.001,r=Math.floor(n)+e,o=Math.floor(n%1*1e9);return t&&(r=r-t[0],o=o-t[1],o<0&&(r--,o+=ys)),[r,o]}function dn(){return Ot}function TE(t){return[]}var Yt,lr,Un,Ko,uS,cS,fS,dS,pS,gS,yS,mS,hS,vS,TS,_S,bS,wS,xS,PS,SS,ES,kS,OS,RS,vs,MS,NS,DS,HS,US,ZS,jS,KS,LS,WS,zS,qS,GS,VS,JS,XS,YS,QS,eE,tE,nE,rE,iE,oE,aE,fn,gs,ys,lE,uE,cE,fE,dE,pE,gE,yE,mE,hE,vE,Ot,Ts=at(()=>{C();R();O();Yt=[],lr=!1,Ko=-1;Om.prototype.run=function(){this.fun.apply(null,this.array)};uS="browser",cS="x64",fS="browser",dS={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},pS=["/usr/bin/node"],gS=[],yS="v16.8.0",mS={},hS=function(t,e){console.warn((e?e+": ":"")+t)},vS=function(t){hs("binding")},TS=function(t){return 0},_S=function(){return"/"},bS=function(t){},wS={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};xS=ct,PS=[];SS={},ES=!1,kS={};OS=ct,RS=ct,vs=function(){return{}},MS=vs,NS=vs,DS=ct,HS=ct,US=ct,ZS={};jS={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},KS=ct,LS=ct;WS=ct,zS=ct,qS=ct,GS=ct,VS=ct,JS=void 0,XS=void 0,YS=void 0,QS=ct,eE=2,tE=1,nE="/bin/usr/node",rE=9229,iE="node",oE=[],aE=ct,fn={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};fn.now===void 0&&(gs=Date.now(),fn.timing&&fn.timing.navigationStart&&(gs=fn.timing.navigationStart),fn.now=()=>Date.now()-gs);ys=1e9;ms.bigint=function(t){var e=ms(t);return typeof BigInt>"u"?e[0]*ys+e[1]:BigInt(e[0]*ys)+BigInt(e[1])};lE=10,uE={},cE=0;fE=dn,dE=dn,pE=dn,gE=dn,yE=dn,mE=ct,hE=dn,vE=dn;Ot={version:yS,versions:mS,arch:cS,platform:fS,release:wS,_rawDebug:xS,moduleLoadList:PS,binding:vS,_linkedBinding:BS,_events:uE,_eventsCount:cE,_maxListeners:lE,on:dn,addListener:fE,once:dE,off:pE,removeListener:gE,removeAllListeners:yE,emit:mE,prependListener:hE,prependOnceListener:vE,listeners:TE,domain:SS,_exiting:ES,config:kS,dlopen:IS,uptime:sE,_getActiveRequests:AS,_getActiveHandles:CS,reallyExit:OS,_kill:RS,cpuUsage:vs,resourceUsage:MS,memoryUsage:NS,kill:DS,exit:HS,openStdin:US,allowedNodeEnvironmentFlags:ZS,assert:$S,features:jS,_fatalExceptions:KS,setUncaughtExceptionCaptureCallback:LS,hasUncaughtExceptionCaptureCallback:FS,emitWarning:hS,nextTick:lS,_tickCallback:WS,_debugProcess:zS,_debugEnd:qS,_startProfilerIdleNotifier:GS,_stopProfilerIdleNotifier:VS,stdout:JS,stdin:YS,stderr:XS,abort:QS,umask:TS,chdir:bS,cwd:_S,env:dS,title:uS,argv:pS,execArgv:gS,pid:eE,ppid:tE,execPath:nE,debugPort:rE,hrtime:ms,argv0:iE,_preload_modules:oE,setSourceMapsEnabled:aE}});function Mm(){if(Rm)return _s;Rm=!0,_s=t;function t(n,r){if(e("noDeprecation"))return n;var o=!1;function a(){if(!o){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),o=!0}return n.apply(this||bs,arguments)}return a}function e(n){try{if(!bs.localStorage)return!1}catch{return!1}var r=bs.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return _s}var _s,Rm,bs,Nm=at(()=>{C();R();O();_s={},Rm=!1,bs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global});function _E(){if(Dm)return Jr;Dm=!0;var t=Nt(),e=t.Buffer;function n(o,a){for(var i in o)a[i]=o[i]}e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?Jr=t:(n(t,Jr),Jr.Buffer=r);function r(o,a,i){return e(o,a,i)}return r.prototype=Object.create(e.prototype),n(e,r),r.from=function(o,a,i){if(typeof o=="number")throw new TypeError("Argument must not be a number");return e(o,a,i)},r.alloc=function(o,a,i){if(typeof o!="number")throw new TypeError("Argument must be a number");var s=e(o);return a!==void 0?typeof i=="string"?s.fill(a,i):s.fill(a):s.fill(0),s},r.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return e(o)},r.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(o)},Jr}function bE(){if(Hm)return ws;Hm=!0;var t=_E().Buffer,e=t.isEncoding||function(v){switch(v=""+v,v&&v.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(v){if(!v)return"utf8";for(var E;;)switch(v){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return v;default:if(E)return;v=(""+v).toLowerCase(),E=!0}}function r(v){var E=n(v);if(typeof E!="string"&&(t.isEncoding===e||!e(v)))throw new Error("Unknown encoding: "+v);return E||v}ws.StringDecoder=o;function o(v){this.encoding=r(v);var E;switch(this.encoding){case"utf16le":this.text=y,this.end=g,E=4;break;case"utf8":this.fillLast=l,E=4;break;case"base64":this.text=h,this.end=w,E=3;break;default:this.write=P,this.end=B;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(E)}o.prototype.write=function(v){if(v.length===0)return"";var E,S;if(this.lastNeed){if(E=this.fillLast(v),E===void 0)return"";S=this.lastNeed,this.lastNeed=0}else S=0;return S<v.length?E?E+this.text(v,S):this.text(v,S):E||""},o.prototype.end=p,o.prototype.text=f,o.prototype.fillLast=function(v){if(this.lastNeed<=v.length)return v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,v.length),this.lastNeed-=v.length};function a(v){return v<=127?0:v>>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function i(v,E,S){var H=E.length-1;if(H<S)return 0;var K=a(E[H]);return K>=0?(K>0&&(v.lastNeed=K-1),K):--H<S||K===-2?0:(K=a(E[H]),K>=0?(K>0&&(v.lastNeed=K-2),K):--H<S||K===-2?0:(K=a(E[H]),K>=0?(K>0&&(K===2?K=0:v.lastNeed=K-3),K):0))}function s(v,E,S){if((E[0]&192)!==128)return v.lastNeed=0,"\uFFFD";if(v.lastNeed>1&&E.length>1){if((E[1]&192)!==128)return v.lastNeed=1,"\uFFFD";if(v.lastNeed>2&&E.length>2&&(E[2]&192)!==128)return v.lastNeed=2,"\uFFFD"}}function l(v){var E=this.lastTotal-this.lastNeed,S=s(this,v);if(S!==void 0)return S;if(this.lastNeed<=v.length)return v.copy(this.lastChar,E,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,E,0,v.length),this.lastNeed-=v.length}function f(v,E){var S=i(this,v,E);if(!this.lastNeed)return v.toString("utf8",E);this.lastTotal=S;var H=v.length-(S-this.lastNeed);return v.copy(this.lastChar,0,H),v.toString("utf8",E,H)}function p(v){var E=v&&v.length?this.write(v):"";return this.lastNeed?E+"\uFFFD":E}function y(v,E){if((v.length-E)%2===0){var S=v.toString("utf16le",E);if(S){var H=S.charCodeAt(S.length-1);if(H>=55296&&H<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],S.slice(0,-1)}return S}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",E,v.length-1)}function g(v){var E=v&&v.length?this.write(v):"";if(this.lastNeed){var S=this.lastTotal-this.lastNeed;return E+this.lastChar.toString("utf16le",0,S)}return E}function h(v,E){var S=(v.length-E)%3;return S===0?v.toString("base64",E):(this.lastNeed=3-S,this.lastTotal=3,S===1?this.lastChar[0]=v[v.length-1]:(this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1]),v.toString("base64",E,v.length-S))}function w(v){var E=v&&v.length?this.write(v):"";return this.lastNeed?E+this.lastChar.toString("base64",0,3-this.lastNeed):E}function P(v){return v.toString(this.encoding)}function B(v){return v&&v.length?this.write(v):""}return ws}var Jr,Dm,ws,Hm,Xr,UC,Um=at(()=>{C();R();O();fi();Jr={},Dm=!1;ws={},Hm=!1;Xr=bE();Xr.StringDecoder;UC=Xr.StringDecoder});function wE(){if(Zm)return xs;Zm=!0;var t=xs={},e,n;function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?n=clearTimeout:n=o}catch{n=o}})();function a(P){if(e===setTimeout)return setTimeout(P,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(P,0);try{return e(P,0)}catch{try{return e.call(null,P,0)}catch{return e.call(this||ur,P,0)}}}function i(P){if(n===clearTimeout)return clearTimeout(P);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(P);try{return n(P)}catch{try{return n.call(null,P)}catch{return n.call(this||ur,P)}}}var s=[],l=!1,f,p=-1;function y(){!l||!f||(l=!1,f.length?s=f.concat(s):p=-1,s.length&&g())}function g(){if(!l){var P=a(y);l=!0;for(var B=s.length;B;){for(f=s,s=[];++p<B;)f&&f[p].run();p=-1,B=s.length}f=null,l=!1,i(P)}}t.nextTick=function(P){var B=new Array(arguments.length-1);if(arguments.length>1)for(var v=1;v<arguments.length;v++)B[v-1]=arguments[v];s.push(new h(P,B)),s.length===1&&!l&&a(g)};function h(P,B){(this||ur).fun=P,(this||ur).array=B}h.prototype.run=function(){(this||ur).fun.apply(null,(this||ur).array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function w(){}return t.on=w,t.addListener=w,t.once=w,t.off=w,t.removeListener=w,t.removeAllListeners=w,t.emit=w,t.prependListener=w,t.prependOnceListener=w,t.listeners=function(P){return[]},t.binding=function(P){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(P){throw new Error("process.chdir is not supported")},t.umask=function(){return 0},xs}var xs,Zm,ur,Ke,Ps=at(()=>{C();R();O();xs={},Zm=!1,ur=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ke=wE();Ke.platform="browser";Ke.addListener;Ke.argv;Ke.binding;Ke.browser;Ke.chdir;Ke.cwd;Ke.emit;Ke.env;Ke.listeners;Ke.nextTick;Ke.off;Ke.on;Ke.once;Ke.prependListener;Ke.prependOnceListener;Ke.removeAllListeners;Ke.removeListener;Ke.title;Ke.umask;Ke.version;Ke.versions});function xE(){if($m)return Bs;$m=!0;var t=Ke;function e(a){if(typeof a!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(a))}function n(a,i){for(var s="",l=0,f=-1,p=0,y,g=0;g<=a.length;++g){if(g<a.length)y=a.charCodeAt(g);else{if(y===47)break;y=47}if(y===47){if(!(f===g-1||p===1))if(f!==g-1&&p===2){if(s.length<2||l!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var h=s.lastIndexOf("/");if(h!==s.length-1){h===-1?(s="",l=0):(s=s.slice(0,h),l=s.length-1-s.lastIndexOf("/")),f=g,p=0;continue}}else if(s.length===2||s.length===1){s="",l=0,f=g,p=0;continue}}i&&(s.length>0?s+="/..":s="..",l=2)}else s.length>0?s+="/"+a.slice(f+1,g):s=a.slice(f+1,g),l=g-f-1;f=g,p=0}else y===46&&p!==-1?++p:p=-1}return s}function r(a,i){var s=i.dir||i.root,l=i.base||(i.name||"")+(i.ext||"");return s?s===i.root?s+l:s+a+l:l}var o={resolve:function(){for(var i="",s=!1,l,f=arguments.length-1;f>=-1&&!s;f--){var p;f>=0?p=arguments[f]:(l===void 0&&(l=t.cwd()),p=l),e(p),p.length!==0&&(i=p+"/"+i,s=p.charCodeAt(0)===47)}return i=n(i,!s),s?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var s=i.charCodeAt(0)===47,l=i.charCodeAt(i.length-1)===47;return i=n(i,!s),i.length===0&&!s&&(i="."),i.length>0&&l&&(i+="/"),s?"/"+i:i},isAbsolute:function(i){return e(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,s=0;s<arguments.length;++s){var l=arguments[s];e(l),l.length>0&&(i===void 0?i=l:i+="/"+l)}return i===void 0?".":o.normalize(i)},relative:function(i,s){if(e(i),e(s),i===s||(i=o.resolve(i),s=o.resolve(s),i===s))return"";for(var l=1;l<i.length&&i.charCodeAt(l)===47;++l);for(var f=i.length,p=f-l,y=1;y<s.length&&s.charCodeAt(y)===47;++y);for(var g=s.length,h=g-y,w=p<h?p:h,P=-1,B=0;B<=w;++B){if(B===w){if(h>w){if(s.charCodeAt(y+B)===47)return s.slice(y+B+1);if(B===0)return s.slice(y+B)}else p>w&&(i.charCodeAt(l+B)===47?P=B:B===0&&(P=0));break}var v=i.charCodeAt(l+B),E=s.charCodeAt(y+B);if(v!==E)break;v===47&&(P=B)}var S="";for(B=l+P+1;B<=f;++B)(B===f||i.charCodeAt(B)===47)&&(S.length===0?S+="..":S+="/..");return S.length>0?S+s.slice(y+P):(y+=P,s.charCodeAt(y)===47&&++y,s.slice(y))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var s=i.charCodeAt(0),l=s===47,f=-1,p=!0,y=i.length-1;y>=1;--y)if(s=i.charCodeAt(y),s===47){if(!p){f=y;break}}else p=!1;return f===-1?l?"/":".":l&&f===1?"//":i.slice(0,f)},basename:function(i,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');e(i);var l=0,f=-1,p=!0,y;if(s!==void 0&&s.length>0&&s.length<=i.length){if(s.length===i.length&&s===i)return"";var g=s.length-1,h=-1;for(y=i.length-1;y>=0;--y){var w=i.charCodeAt(y);if(w===47){if(!p){l=y+1;break}}else h===-1&&(p=!1,h=y+1),g>=0&&(w===s.charCodeAt(g)?--g===-1&&(f=y):(g=-1,f=h))}return l===f?f=h:f===-1&&(f=i.length),i.slice(l,f)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!p){l=y+1;break}}else f===-1&&(p=!1,f=y+1);return f===-1?"":i.slice(l,f)}},extname:function(i){e(i);for(var s=-1,l=0,f=-1,p=!0,y=0,g=i.length-1;g>=0;--g){var h=i.charCodeAt(g);if(h===47){if(!p){l=g+1;break}continue}f===-1&&(p=!1,f=g+1),h===46?s===-1?s=g:y!==1&&(y=1):s!==-1&&(y=-1)}return s===-1||f===-1||y===0||y===1&&s===f-1&&s===l+1?"":i.slice(s,f)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return r("/",i)},parse:function(i){e(i);var s={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return s;var l=i.charCodeAt(0),f=l===47,p;f?(s.root="/",p=1):p=0;for(var y=-1,g=0,h=-1,w=!0,P=i.length-1,B=0;P>=p;--P){if(l=i.charCodeAt(P),l===47){if(!w){g=P+1;break}continue}h===-1&&(w=!1,h=P+1),l===46?y===-1?y=P:B!==1&&(B=1):y!==-1&&(B=-1)}return y===-1||h===-1||B===0||B===1&&y===h-1&&y===g+1?h!==-1&&(g===0&&f?s.base=s.name=i.slice(1,h):s.base=s.name=i.slice(g,h)):(g===0&&f?(s.name=i.slice(1,y),s.base=i.slice(1,h)):(s.name=i.slice(g,y),s.base=i.slice(g,h)),s.ext=i.slice(y,h)),g>0?s.dir=i.slice(0,g-1):f&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return o.posix=o,Bs=o,Bs}function Zn(t){throw new RangeError(EE[t])}function Km(t,e){let n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]);let o=(function(a,i){let s=[],l=a.length;for(;l--;)s[l]=i(a[l]);return s})((t=t.replace(SE,".")).split("."),e).join(".");return r+o}function Xm(t){let e=[],n=0,r=t.length;for(;n<r;){let o=t.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){let a=t.charCodeAt(n++);(64512&a)==56320?e.push(((1023&o)<<10)+(1023&a)+65536):(e.push(o),n--)}else e.push(o)}return e}function IE(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function kt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function Qr(t,e,n){if(t&&Ut.isObject(t)&&t instanceof kt)return t;var r=new kt;return r.parse(t,e,n),r}function ZE(){if(Vm)return Is;Vm=!0;var t=je;function e(a){if(typeof a!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(a))}function n(a,i){for(var s="",l=0,f=-1,p=0,y,g=0;g<=a.length;++g){if(g<a.length)y=a.charCodeAt(g);else{if(y===47)break;y=47}if(y===47){if(!(f===g-1||p===1))if(f!==g-1&&p===2){if(s.length<2||l!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var h=s.lastIndexOf("/");if(h!==s.length-1){h===-1?(s="",l=0):(s=s.slice(0,h),l=s.length-1-s.lastIndexOf("/")),f=g,p=0;continue}}else if(s.length===2||s.length===1){s="",l=0,f=g,p=0;continue}}i&&(s.length>0?s+="/..":s="..",l=2)}else s.length>0?s+="/"+a.slice(f+1,g):s=a.slice(f+1,g),l=g-f-1;f=g,p=0}else y===46&&p!==-1?++p:p=-1}return s}function r(a,i){var s=i.dir||i.root,l=i.base||(i.name||"")+(i.ext||"");return s?s===i.root?s+l:s+a+l:l}var o={resolve:function(){for(var i="",s=!1,l,f=arguments.length-1;f>=-1&&!s;f--){var p;f>=0?p=arguments[f]:(l===void 0&&(l=t.cwd()),p=l),e(p),p.length!==0&&(i=p+"/"+i,s=p.charCodeAt(0)===47)}return i=n(i,!s),s?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var s=i.charCodeAt(0)===47,l=i.charCodeAt(i.length-1)===47;return i=n(i,!s),i.length===0&&!s&&(i="."),i.length>0&&l&&(i+="/"),s?"/"+i:i},isAbsolute:function(i){return e(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,s=0;s<arguments.length;++s){var l=arguments[s];e(l),l.length>0&&(i===void 0?i=l:i+="/"+l)}return i===void 0?".":o.normalize(i)},relative:function(i,s){if(e(i),e(s),i===s||(i=o.resolve(i),s=o.resolve(s),i===s))return"";for(var l=1;l<i.length&&i.charCodeAt(l)===47;++l);for(var f=i.length,p=f-l,y=1;y<s.length&&s.charCodeAt(y)===47;++y);for(var g=s.length,h=g-y,w=p<h?p:h,P=-1,B=0;B<=w;++B){if(B===w){if(h>w){if(s.charCodeAt(y+B)===47)return s.slice(y+B+1);if(B===0)return s.slice(y+B)}else p>w&&(i.charCodeAt(l+B)===47?P=B:B===0&&(P=0));break}var v=i.charCodeAt(l+B),E=s.charCodeAt(y+B);if(v!==E)break;v===47&&(P=B)}var S="";for(B=l+P+1;B<=f;++B)(B===f||i.charCodeAt(B)===47)&&(S.length===0?S+="..":S+="/..");return S.length>0?S+s.slice(y+P):(y+=P,s.charCodeAt(y)===47&&++y,s.slice(y))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var s=i.charCodeAt(0),l=s===47,f=-1,p=!0,y=i.length-1;y>=1;--y)if(s=i.charCodeAt(y),s===47){if(!p){f=y;break}}else p=!1;return f===-1?l?"/":".":l&&f===1?"//":i.slice(0,f)},basename:function(i,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');e(i);var l=0,f=-1,p=!0,y;if(s!==void 0&&s.length>0&&s.length<=i.length){if(s.length===i.length&&s===i)return"";var g=s.length-1,h=-1;for(y=i.length-1;y>=0;--y){var w=i.charCodeAt(y);if(w===47){if(!p){l=y+1;break}}else h===-1&&(p=!1,h=y+1),g>=0&&(w===s.charCodeAt(g)?--g===-1&&(f=y):(g=-1,f=h))}return l===f?f=h:f===-1&&(f=i.length),i.slice(l,f)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!p){l=y+1;break}}else f===-1&&(p=!1,f=y+1);return f===-1?"":i.slice(l,f)}},extname:function(i){e(i);for(var s=-1,l=0,f=-1,p=!0,y=0,g=i.length-1;g>=0;--g){var h=i.charCodeAt(g);if(h===47){if(!p){l=g+1;break}continue}f===-1&&(p=!1,f=g+1),h===46?s===-1?s=g:y!==1&&(y=1):s!==-1&&(y=-1)}return s===-1||f===-1||y===0||y===1&&s===f-1&&s===l+1?"":i.slice(s,f)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return r("/",i)},parse:function(i){e(i);var s={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return s;var l=i.charCodeAt(0),f=l===47,p;f?(s.root="/",p=1):p=0;for(var y=-1,g=0,h=-1,w=!0,P=i.length-1,B=0;P>=p;--P){if(l=i.charCodeAt(P),l===47){if(!w){g=P+1;break}continue}h===-1&&(w=!1,h=P+1),l===46?y===-1?y=P:B!==1&&(B=1):y!==-1&&(B=-1)}return y===-1||h===-1||B===0||B===1&&y===h-1&&y===g+1?h!==-1&&(g===0&&f?s.base=s.name=i.slice(1,h):s.base=s.name=i.slice(g,h)):(g===0&&f?(s.name=i.slice(1,y),s.base=i.slice(1,h)):(s.name=i.slice(g,y),s.base=i.slice(g,h)),s.ext=i.slice(y,h)),g>0?s.dir=i.slice(0,g-1):f&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return o.posix=o,Is=o,Is}function XE(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Cs?YE(t):QE(t)}function YE(t){let e=t.hostname,n=t.pathname;for(let r=0;r<n.length;r++)if(n[r]==="%"){let o=n.codePointAt(r+2)||32;if(n[r+1]==="2"&&o===102||n[r+1]==="5"&&o===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(n=n.replace(WE,"\\"),n=decodeURIComponent(n),e!=="")return`\\\\${e}${n}`;{let r=n.codePointAt(1)|32,o=n[2];if(r<LE||r>FE||o!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return n.slice(1)}}function QE(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let n=0;n<e.length;n++)if(e[n]==="%"){let r=e.codePointAt(n+2)||32;if(e[n+1]==="2"&&r===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function ek(t){let e=Jm.resolve(t),n=t.charCodeAt(t.length-1);(n===KE||Cs&&n===jE)&&e[e.length-1]!==Jm.sep&&(e+="/");let r=new URL("file://");return e.includes("%")&&(e=e.replace(zE,"%25")),!Cs&&e.includes("\\")&&(e=e.replace(qE,"%5C")),e.includes(`
|
|
11
|
-
`)&&(e=e.replace(
|
|
12
|
-
`)&&(e=e.replace(
|
|
13
|
-
`," "]),As=["'"].concat(DE),zm=["%","/","?",";","#"].concat(As),qm=["/","?","#"],Gm=/^[+a-z0-9A-Z_-]{0,63}$/,HE=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,UE={javascript:!0,"javascript:":!0},Es={javascript:!0,"javascript:":!0},cr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},ks=Qt;kt.prototype.parse=function(t,e,n){if(!Ut.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),o=r!==-1&&r<t.indexOf("#")?"?":"#",a=t.split(o);a[0]=a[0].replace(/\\/g,"/");var i=t=a.join(o);if(i=i.trim(),!n&&t.split("#").length===1){var s=NE.exec(i);if(s)return this.path=i,this.href=i,this.pathname=s[1],s[2]?(this.search=s[2],this.query=e?ks.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var l=RE.exec(i);if(l){var f=(l=l[0]).toLowerCase();this.protocol=f,i=i.substr(l.length)}if(n||l||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var p=i.substr(0,2)==="//";!p||l&&Es[l]||(i=i.substr(2),this.slashes=!0)}if(!Es[l]&&(p||l&&!cr[l])){for(var y,g,h=-1,w=0;w<qm.length;w++)(P=i.indexOf(qm[w]))!==-1&&(h===-1||P<h)&&(h=P);for((g=h===-1?i.lastIndexOf("@"):i.lastIndexOf("@",h))!==-1&&(y=i.slice(0,g),i=i.slice(g+1),this.auth=decodeURIComponent(y)),h=-1,w=0;w<zm.length;w++){var P;(P=i.indexOf(zm[w]))!==-1&&(h===-1||P<h)&&(h=P)}h===-1&&(h=i.length),this.host=i.slice(0,h),i=i.slice(h),this.parseHost(),this.hostname=this.hostname||"";var B=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!B)for(var v=this.hostname.split(/\./),E=(w=0,v.length);w<E;w++){var S=v[w];if(S&&!S.match(Gm)){for(var H="",K=0,oe=S.length;K<oe;K++)S.charCodeAt(K)>127?H+="x":H+=S[K];if(!H.match(Gm)){var ee=v.slice(0,w),ge=v.slice(w+1),ae=S.match(HE);ae&&(ee.push(ae[1]),ge.unshift(ae[2])),ge.length&&(i="/"+ge.join(".")+i),this.hostname=ee.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=OE.toASCII(this.hostname));var re=this.port?":"+this.port:"",Oe=this.hostname||"";this.host=Oe+re,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),i[0]!=="/"&&(i="/"+i))}if(!UE[f])for(w=0,E=As.length;w<E;w++){var ze=As[w];if(i.indexOf(ze)!==-1){var tt=encodeURIComponent(ze);tt===ze&&(tt=escape(ze)),i=i.split(ze).join(tt)}}var Ve=i.indexOf("#");Ve!==-1&&(this.hash=i.substr(Ve),i=i.slice(0,Ve));var Je=i.indexOf("?");if(Je!==-1?(this.search=i.substr(Je),this.query=i.substr(Je+1),e&&(this.query=ks.parse(this.query)),i=i.slice(0,Je)):e&&(this.search="",this.query={}),i&&(this.pathname=i),cr[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){re=this.pathname||"";var ht=this.search||"";this.path=re+ht}return this.href=this.format(),this},kt.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,a="";this.host?o=t+this.host:this.hostname&&(o=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&Ut.isObject(this.query)&&Object.keys(this.query).length&&(a=ks.stringify(this.query));var i=this.search||a&&"?"+a||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||cr[e])&&o!==!1?(o="//"+(o||""),n&&n.charAt(0)!=="/"&&(n="/"+n)):o||(o=""),r&&r.charAt(0)!=="#"&&(r="#"+r),i&&i.charAt(0)!=="?"&&(i="?"+i),e+o+(n=n.replace(/[?#]/g,(function(s){return encodeURIComponent(s)})))+(i=i.replace("#","%23"))+r},kt.prototype.resolve=function(t){return this.resolveObject(Qr(t,!1,!0)).format()},kt.prototype.resolveObject=function(t){if(Ut.isString(t)){var e=new kt;e.parse(t,!1,!0),t=e}for(var n=new kt,r=Object.keys(this),o=0;o<r.length;o++){var a=r[o];n[a]=this[a]}if(n.hash=t.hash,t.href==="")return n.href=n.format(),n;if(t.slashes&&!t.protocol){for(var i=Object.keys(t),s=0;s<i.length;s++){var l=i[s];l!=="protocol"&&(n[l]=t[l])}return cr[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!cr[t.protocol]){for(var f=Object.keys(t),p=0;p<f.length;p++){var y=f[p];n[y]=t[y]}return n.href=n.format(),n}if(n.protocol=t.protocol,t.host||Es[t.protocol])n.pathname=t.pathname;else{for(var g=(t.pathname||"").split("/");g.length&&!(t.host=g.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),g[0]!==""&&g.unshift(""),g.length<2&&g.unshift(""),n.pathname=g.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var h=n.pathname||"",w=n.search||"";n.path=h+w}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var P=n.pathname&&n.pathname.charAt(0)==="/",B=t.host||t.pathname&&t.pathname.charAt(0)==="/",v=B||P||n.host&&t.pathname,E=v,S=n.pathname&&n.pathname.split("/")||[],H=(g=t.pathname&&t.pathname.split("/")||[],n.protocol&&!cr[n.protocol]);if(H&&(n.hostname="",n.port=null,n.host&&(S[0]===""?S[0]=n.host:S.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(g[0]===""?g[0]=t.host:g.unshift(t.host)),t.host=null),v=v&&(g[0]===""||S[0]==="")),B)n.host=t.host||t.host===""?t.host:n.host,n.hostname=t.hostname||t.hostname===""?t.hostname:n.hostname,n.search=t.search,n.query=t.query,S=g;else if(g.length)S||(S=[]),S.pop(),S=S.concat(g),n.search=t.search,n.query=t.query;else if(!Ut.isNullOrUndefined(t.search))return H&&(n.hostname=n.host=S.shift(),(ae=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=ae.shift(),n.host=n.hostname=ae.shift())),n.search=t.search,n.query=t.query,Ut.isNull(n.pathname)&&Ut.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!S.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var K=S.slice(-1)[0],oe=(n.host||t.host||S.length>1)&&(K==="."||K==="..")||K==="",ee=0,ge=S.length;ge>=0;ge--)(K=S[ge])==="."?S.splice(ge,1):K===".."?(S.splice(ge,1),ee++):ee&&(S.splice(ge,1),ee--);if(!v&&!E)for(;ee--;ee)S.unshift("..");!v||S[0]===""||S[0]&&S[0].charAt(0)==="/"||S.unshift(""),oe&&S.join("/").substr(-1)!=="/"&&S.push("");var ae,re=S[0]===""||S[0]&&S[0].charAt(0)==="/";return H&&(n.hostname=n.host=re?"":S.length?S.shift():"",(ae=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=ae.shift(),n.host=n.hostname=ae.shift())),(v=v||n.host&&S.length)&&!re&&S.unshift(""),S.length?n.pathname=S.join("/"):(n.pathname=null,n.path=null),Ut.isNull(n.pathname)&&Ut.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},kt.prototype.parseHost=function(){var t=this.host,e=ME.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};De.Url;De.format;De.resolve;De.resolveObject;Is={},Vm=!1;Jm=ZE(),$E=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;De.URL=typeof URL<"u"?URL:null;De.pathToFileURL=ek;De.fileURLToPath=XE;De.Url;De.format;De.resolve;De.resolveObject;De.URL;jE=92,KE=47,LE=97,FE=122,Cs=$E==="win32",WE=/\//g,zE=/%/g,qE=/\\/g,GE=/\n/g,VE=/\r/g,JE=/\t/g;tk=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;De.URL=typeof URL<"u"?URL:null;De.pathToFileURL=yk;De.fileURLToPath=dk;De.Url;De.format;De.resolve;De.resolveObject;De.parse;De.URL;nk=92,rk=47,ik=97,ok=122,Os=tk==="win32",ak=/\//g,sk=/%/g,lk=/\\/g,uk=/\n/g,ck=/\r/g,fk=/\t/g});var Oh={};Kn(Oh,{Agent:()=>Sk,ClientRequest:()=>Ek,IncomingMessage:()=>kk,METHODS:()=>Ik,STATUS_CODES:()=>Ak,default:()=>en,get:()=>Ck,globalAgent:()=>Ok,request:()=>Rk});function xh(){if(eh)return Bt;eh=!0,Bt.fetch=r($n.fetch)&&r($n.ReadableStream),Bt.writableStream=r($n.WritableStream),Bt.abortController=r($n.AbortController);var t;function e(){if(t!==void 0)return t;if($n.XMLHttpRequest){t=new $n.XMLHttpRequest;try{t.open("GET",$n.XDomainRequest?"/":"https://example.com")}catch{t=null}}else t=null;return t}function n(o){var a=e();if(!a)return!1;try{return a.responseType=o,a.responseType===o}catch{}return!1}Bt.arraybuffer=Bt.fetch||n("arraybuffer"),Bt.msstream=!Bt.fetch&&n("ms-stream"),Bt.mozchunkedarraybuffer=!Bt.fetch&&n("moz-chunked-arraybuffer"),Bt.overrideMimeType=Bt.fetch||(e()?r(e().overrideMimeType):!1);function r(o){return typeof o=="function"}return t=null,Bt}function Ph(){return th||(th=!0,Rs=_t.EventEmitter),Rs}function mk(){if(nh)return Ms;nh=!0;function t(w,P){var B=Object.keys(w);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(w);P&&(v=v.filter(function(E){return Object.getOwnPropertyDescriptor(w,E).enumerable})),B.push.apply(B,v)}return B}function e(w){for(var P=1;P<arguments.length;P++){var B=arguments[P]!=null?arguments[P]:{};P%2?t(Object(B),!0).forEach(function(v){n(w,v,B[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(B)):t(Object(B)).forEach(function(v){Object.defineProperty(w,v,Object.getOwnPropertyDescriptor(B,v))})}return w}function n(w,P,B){return P=i(P),P in w?Object.defineProperty(w,P,{value:B,enumerable:!0,configurable:!0,writable:!0}):w[P]=B,w}function r(w,P){if(!(w instanceof P))throw new TypeError("Cannot call a class as a function")}function o(w,P){for(var B=0;B<P.length;B++){var v=P[B];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(w,i(v.key),v)}}function a(w,P,B){return P&&o(w.prototype,P),Object.defineProperty(w,"prototype",{writable:!1}),w}function i(w){var P=s(w,"string");return typeof P=="symbol"?P:String(P)}function s(w,P){if(typeof w!="object"||w===null)return w;var B=w[Symbol.toPrimitive];if(B!==void 0){var v=B.call(w,P||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(w)}var l=Nt(),f=l.Buffer,p=L,y=p.inspect,g=y&&y.custom||"inspect";function h(w,P,B){f.prototype.copy.call(w,P,B)}return Ms=(function(){function w(){r(this,w),this.head=null,this.tail=null,this.length=0}return a(w,[{key:"push",value:function(B){var v={data:B,next:null};this.length>0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(B){var v={data:B,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var B=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,B}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(B){if(this.length===0)return"";for(var v=this.head,E=""+v.data;v=v.next;)E+=B+v.data;return E}},{key:"concat",value:function(B){if(this.length===0)return f.alloc(0);for(var v=f.allocUnsafe(B>>>0),E=this.head,S=0;E;)h(E.data,v,S),S+=E.data.length,E=E.next;return v}},{key:"consume",value:function(B,v){var E;return B<this.head.data.length?(E=this.head.data.slice(0,B),this.head.data=this.head.data.slice(B)):B===this.head.data.length?E=this.shift():E=v?this._getString(B):this._getBuffer(B),E}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(B){var v=this.head,E=1,S=v.data;for(B-=S.length;v=v.next;){var H=v.data,K=B>H.length?H.length:B;if(K===H.length?S+=H:S+=H.slice(0,B),B-=K,B===0){K===H.length?(++E,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=H.slice(K));break}++E}return this.length-=E,S}},{key:"_getBuffer",value:function(B){var v=f.allocUnsafe(B),E=this.head,S=1;for(E.data.copy(v),B-=E.data.length;E=E.next;){var H=E.data,K=B>H.length?H.length:B;if(H.copy(v,v.length-B,0,K),B-=K,B===0){K===H.length?(++S,E.next?this.head=E.next:this.head=this.tail=null):(this.head=E,E.data=H.slice(K));break}++S}return this.length-=S,v}},{key:g,value:function(B,v){return y(this,e(e({},v),{},{depth:0,customInspect:!1}))}}]),w})(),Ms}function Bh(){if(rh)return Ns;rh=!0;var t=Ot;function e(s,l){var f=this,p=this._readableState&&this._readableState.destroyed,y=this._writableState&&this._writableState.destroyed;return p||y?(l?l(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(a,this,s)):t.nextTick(a,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(g){!l&&g?f._writableState?f._writableState.errorEmitted?t.nextTick(r,f):(f._writableState.errorEmitted=!0,t.nextTick(n,f,g)):t.nextTick(n,f,g):l?(t.nextTick(r,f),l(g)):t.nextTick(r,f)}),this)}function n(s,l){a(s,l),r(s)}function r(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function o(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function a(s,l){s.emit("error",l)}function i(s,l){var f=s._readableState,p=s._writableState;f&&f.autoDestroy||p&&p.autoDestroy?s.destroy(l):s.emit("error",l)}return Ns={destroy:e,undestroy:o,errorOrDestroy:i},Ns}function pr(){if(ih)return Ds;ih=!0;let t={};function e(i,s,l){l||(l=Error);function f(y,g,h){return typeof s=="string"?s:s(y,g,h)}class p extends l{constructor(g,h,w){super(f(g,h,w))}}p.prototype.name=l.name,p.prototype.code=i,t[i]=p}function n(i,s){if(Array.isArray(i)){let l=i.length;return i=i.map(f=>String(f)),l>2?`one of ${s} ${i.slice(0,l-1).join(", ")}, or `+i[l-1]:l===2?`one of ${s} ${i[0]} or ${i[1]}`:`of ${s} ${i[0]}`}else return`of ${s} ${String(i)}`}function r(i,s,l){return i.substr(0,s.length)===s}function o(i,s,l){return(l===void 0||l>i.length)&&(l=i.length),i.substring(l-s.length,l)===s}function a(i,s,l){return typeof l!="number"&&(l=0),l+s.length>i.length?!1:i.indexOf(s,l)!==-1}return e("ERR_INVALID_OPT_VALUE",function(i,s){return'The value "'+s+'" is invalid for option "'+i+'"'},TypeError),e("ERR_INVALID_ARG_TYPE",function(i,s,l){let f;typeof s=="string"&&r(s,"not ")?(f="must not be",s=s.replace(/^not /,"")):f="must be";let p;if(o(i," argument"))p=`The ${i} ${f} ${n(s,"type")}`;else{let y=a(i,".")?"property":"argument";p=`The "${i}" ${y} ${f} ${n(s,"type")}`}return p+=`. Received type ${typeof l}`,p},TypeError),e("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),e("ERR_METHOD_NOT_IMPLEMENTED",function(i){return"The "+i+" method is not implemented"}),e("ERR_STREAM_PREMATURE_CLOSE","Premature close"),e("ERR_STREAM_DESTROYED",function(i){return"Cannot call "+i+" after a stream was destroyed"}),e("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),e("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),e("ERR_STREAM_WRITE_AFTER_END","write after end"),e("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),e("ERR_UNKNOWN_ENCODING",function(i){return"Unknown encoding: "+i},TypeError),e("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ds.codes=t,Ds}function Sh(){if(oh)return Hs;oh=!0;var t=pr().codes.ERR_INVALID_OPT_VALUE;function e(r,o,a){return r.highWaterMark!=null?r.highWaterMark:o?r[a]:null}function n(r,o,a,i){var s=e(o,i,a);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var l=i?a:"highWaterMark";throw new t(l,s)}return Math.floor(s)}return r.objectMode?16:16*1024}return Hs={getHighWaterMark:n},Hs}function Eh(){if(ah)return Us;ah=!0;var t=Ot;Us=ae;function e(A){var k=this;this.next=null,this.entry=null,this.finish=function(){Te(k,A)}}var n;ae.WritableState=ee;var r={deprecate:Mm()},o=Ph(),a=Nt().Buffer,i=(typeof sh<"u"?sh:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(A){return a.from(A)}function l(A){return a.isBuffer(A)||A instanceof i}var f=Bh(),p=Sh(),y=p.getHighWaterMark,g=pr().codes,h=g.ERR_INVALID_ARG_TYPE,w=g.ERR_METHOD_NOT_IMPLEMENTED,P=g.ERR_MULTIPLE_CALLBACK,B=g.ERR_STREAM_CANNOT_PIPE,v=g.ERR_STREAM_DESTROYED,E=g.ERR_STREAM_NULL_VALUES,S=g.ERR_STREAM_WRITE_AFTER_END,H=g.ERR_UNKNOWN_ENCODING,K=f.errorOrDestroy;Dt()(ae,o);function oe(){}function ee(A,k,$){n=n||dr(),A=A||{},typeof $!="boolean"&&($=k instanceof n),this.objectMode=!!A.objectMode,$&&(this.objectMode=this.objectMode||!!A.writableObjectMode),this.highWaterMark=y(this,A,"writableHighWaterMark",$),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var X=A.decodeStrings===!1;this.decodeStrings=!X,this.defaultEncoding=A.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ie){Ue(k,ie)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=A.emitClose!==!1,this.autoDestroy=!!A.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}ee.prototype.getBuffer=function(){for(var k=this.bufferedRequest,$=[];k;)$.push(k),k=k.next;return $},(function(){try{Object.defineProperty(ee.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var ge;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ge=Function.prototype[Symbol.hasInstance],Object.defineProperty(ae,Symbol.hasInstance,{value:function(k){return ge.call(this,k)?!0:this!==ae?!1:k&&k._writableState instanceof ee}})):ge=function(k){return k instanceof this};function ae(A){n=n||dr();var k=this instanceof n;if(!k&&!ge.call(ae,this))return new ae(A);this._writableState=new ee(A,this,k),this.writable=!0,A&&(typeof A.write=="function"&&(this._write=A.write),typeof A.writev=="function"&&(this._writev=A.writev),typeof A.destroy=="function"&&(this._destroy=A.destroy),typeof A.final=="function"&&(this._final=A.final)),o.call(this)}ae.prototype.pipe=function(){K(this,new B)};function re(A,k){var $=new S;K(A,$),t.nextTick(k,$)}function Oe(A,k,$,X){var ie;return $===null?ie=new E:typeof $!="string"&&!k.objectMode&&(ie=new h("chunk",["string","Buffer"],$)),ie?(K(A,ie),t.nextTick(X,ie),!1):!0}ae.prototype.write=function(A,k,$){var X=this._writableState,ie=!1,b=!X.objectMode&&l(A);return b&&!a.isBuffer(A)&&(A=s(A)),typeof k=="function"&&($=k,k=null),b?k="buffer":k||(k=X.defaultEncoding),typeof $!="function"&&($=oe),X.ending?re(this,$):(b||Oe(this,X,A,$))&&(X.pendingcb++,ie=tt(this,X,b,A,k,$)),ie},ae.prototype.cork=function(){this._writableState.corked++},ae.prototype.uncork=function(){var A=this._writableState;A.corked&&(A.corked--,!A.writing&&!A.corked&&!A.bufferProcessing&&A.bufferedRequest&&fe(this,A))},ae.prototype.setDefaultEncoding=function(k){if(typeof k=="string"&&(k=k.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((k+"").toLowerCase())>-1))throw new H(k);return this._writableState.defaultEncoding=k,this},Object.defineProperty(ae.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ze(A,k,$){return!A.objectMode&&A.decodeStrings!==!1&&typeof k=="string"&&(k=a.from(k,$)),k}Object.defineProperty(ae.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function tt(A,k,$,X,ie,b){if(!$){var x=ze(k,X,ie);X!==x&&($=!0,ie="buffer",X=x)}var z=k.objectMode?1:X.length;k.length+=z;var Q=k.length<k.highWaterMark;if(Q||(k.needDrain=!0),k.writing||k.corked){var Me=k.lastBufferedRequest;k.lastBufferedRequest={chunk:X,encoding:ie,isBuf:$,callback:b,next:null},Me?Me.next=k.lastBufferedRequest:k.bufferedRequest=k.lastBufferedRequest,k.bufferedRequestCount+=1}else Ve(A,k,!1,z,X,ie,b);return Q}function Ve(A,k,$,X,ie,b,x){k.writelen=X,k.writecb=x,k.writing=!0,k.sync=!0,k.destroyed?k.onwrite(new v("write")):$?A._writev(ie,k.onwrite):A._write(ie,b,k.onwrite),k.sync=!1}function Je(A,k,$,X,ie){--k.pendingcb,$?(t.nextTick(ie,X),t.nextTick(F,A,k),A._writableState.errorEmitted=!0,K(A,X)):(ie(X),A._writableState.errorEmitted=!0,K(A,X),F(A,k))}function ht(A){A.writing=!1,A.writecb=null,A.length-=A.writelen,A.writelen=0}function Ue(A,k){var $=A._writableState,X=$.sync,ie=$.writecb;if(typeof ie!="function")throw new P;if(ht($),k)Je(A,$,X,k,ie);else{var b=ve($)||A.destroyed;!b&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest&&fe(A,$),X?t.nextTick(Pe,A,$,b,ie):Pe(A,$,b,ie)}}function Pe(A,k,$,X){$||Ee(A,k),k.pendingcb--,X(),F(A,k)}function Ee(A,k){k.length===0&&k.needDrain&&(k.needDrain=!1,A.emit("drain"))}function fe(A,k){k.bufferProcessing=!0;var $=k.bufferedRequest;if(A._writev&&$&&$.next){var X=k.bufferedRequestCount,ie=new Array(X),b=k.corkedRequestsFree;b.entry=$;for(var x=0,z=!0;$;)ie[x]=$,$.isBuf||(z=!1),$=$.next,x+=1;ie.allBuffers=z,Ve(A,k,!0,k.length,ie,"",b.finish),k.pendingcb++,k.lastBufferedRequest=null,b.next?(k.corkedRequestsFree=b.next,b.next=null):k.corkedRequestsFree=new e(k),k.bufferedRequestCount=0}else{for(;$;){var Q=$.chunk,Me=$.encoding,_e=$.callback,Z=k.objectMode?1:Q.length;if(Ve(A,k,!1,Z,Q,Me,_e),$=$.next,k.bufferedRequestCount--,k.writing)break}$===null&&(k.lastBufferedRequest=null)}k.bufferedRequest=$,k.bufferProcessing=!1}ae.prototype._write=function(A,k,$){$(new w("_write()"))},ae.prototype._writev=null,ae.prototype.end=function(A,k,$){var X=this._writableState;return typeof A=="function"?($=A,A=null,k=null):typeof k=="function"&&($=k,k=null),A!=null&&this.write(A,k),X.corked&&(X.corked=1,this.uncork()),X.ending||de(this,X,$),this},Object.defineProperty(ae.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ve(A){return A.ending&&A.length===0&&A.bufferedRequest===null&&!A.finished&&!A.writing}function D(A,k){A._final(function($){k.pendingcb--,$&&K(A,$),k.prefinished=!0,A.emit("prefinish"),F(A,k)})}function j(A,k){!k.prefinished&&!k.finalCalled&&(typeof A._final=="function"&&!k.destroyed?(k.pendingcb++,k.finalCalled=!0,t.nextTick(D,A,k)):(k.prefinished=!0,A.emit("prefinish")))}function F(A,k){var $=ve(k);if($&&(j(A,k),k.pendingcb===0&&(k.finished=!0,A.emit("finish"),k.autoDestroy))){var X=A._readableState;(!X||X.autoDestroy&&X.endEmitted)&&A.destroy()}return $}function de(A,k,$){k.ending=!0,F(A,k),$&&(k.finished?t.nextTick($):A.once("finish",$)),k.ended=!0,A.writable=!1}function Te(A,k,$){var X=A.entry;for(A.entry=null;X;){var ie=X.callback;k.pendingcb--,ie($),X=X.next}k.corkedRequestsFree.next=A}return Object.defineProperty(ae.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(k){this._writableState&&(this._writableState.destroyed=k)}}),ae.prototype.destroy=f.destroy,ae.prototype._undestroy=f.undestroy,ae.prototype._destroy=function(A,k){k(A)},Us}function dr(){if(lh)return Zs;lh=!0;var t=Ot,e=Object.keys||function(p){var y=[];for(var g in p)y.push(g);return y};Zs=s;var n=kh(),r=Eh();Dt()(s,n);for(var o=e(r.prototype),a=0;a<o.length;a++){var i=o[a];s.prototype[i]||(s.prototype[i]=r.prototype[i])}function s(p){if(!(this instanceof s))return new s(p);n.call(this,p),r.call(this,p),this.allowHalfOpen=!0,p&&(p.readable===!1&&(this.readable=!1),p.writable===!1&&(this.writable=!1),p.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",l)))}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function l(){this._writableState.ended||t.nextTick(f,this)}function f(p){p.end()}return Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(y){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=y,this._writableState.destroyed=y)}}),Zs}function Xs(){if(uh)return $s;uh=!0;var t=pr().codes.ERR_STREAM_PREMATURE_CLOSE;function e(a){var i=!1;return function(){if(!i){i=!0;for(var s=arguments.length,l=new Array(s),f=0;f<s;f++)l[f]=arguments[f];a.apply(this,l)}}}function n(){}function r(a){return a.setHeader&&typeof a.abort=="function"}function o(a,i,s){if(typeof i=="function")return o(a,null,i);i||(i={}),s=e(s||n);var l=i.readable||i.readable!==!1&&a.readable,f=i.writable||i.writable!==!1&&a.writable,p=function(){a.writable||g()},y=a._writableState&&a._writableState.finished,g=function(){f=!1,y=!0,l||s.call(a)},h=a._readableState&&a._readableState.endEmitted,w=function(){l=!1,h=!0,f||s.call(a)},P=function(S){s.call(a,S)},B=function(){var S;if(l&&!h)return(!a._readableState||!a._readableState.ended)&&(S=new t),s.call(a,S);if(f&&!y)return(!a._writableState||!a._writableState.ended)&&(S=new t),s.call(a,S)},v=function(){a.req.on("finish",g)};return r(a)?(a.on("complete",g),a.on("abort",B),a.req?v():a.on("request",v)):f&&!a._writableState&&(a.on("end",p),a.on("close",p)),a.on("end",w),a.on("finish",g),i.error!==!1&&a.on("error",P),a.on("close",B),function(){a.removeListener("complete",g),a.removeListener("abort",B),a.removeListener("request",v),a.req&&a.req.removeListener("finish",g),a.removeListener("end",p),a.removeListener("close",p),a.removeListener("finish",g),a.removeListener("end",w),a.removeListener("error",P),a.removeListener("close",B)}}return $s=o,$s}function hk(){if(ch)return js;ch=!0;var t=Ot,e;function n(H,K,oe){return K=r(K),K in H?Object.defineProperty(H,K,{value:oe,enumerable:!0,configurable:!0,writable:!0}):H[K]=oe,H}function r(H){var K=o(H,"string");return typeof K=="symbol"?K:String(K)}function o(H,K){if(typeof H!="object"||H===null)return H;var oe=H[Symbol.toPrimitive];if(oe!==void 0){var ee=oe.call(H,K||"default");if(typeof ee!="object")return ee;throw new TypeError("@@toPrimitive must return a primitive value.")}return(K==="string"?String:Number)(H)}var a=Xs(),i=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),f=Symbol("ended"),p=Symbol("lastPromise"),y=Symbol("handlePromise"),g=Symbol("stream");function h(H,K){return{value:H,done:K}}function w(H){var K=H[i];if(K!==null){var oe=H[g].read();oe!==null&&(H[p]=null,H[i]=null,H[s]=null,K(h(oe,!1)))}}function P(H){t.nextTick(w,H)}function B(H,K){return function(oe,ee){H.then(function(){if(K[f]){oe(h(void 0,!0));return}K[y](oe,ee)},ee)}}var v=Object.getPrototypeOf(function(){}),E=Object.setPrototypeOf((e={get stream(){return this[g]},next:function(){var K=this,oe=this[l];if(oe!==null)return Promise.reject(oe);if(this[f])return Promise.resolve(h(void 0,!0));if(this[g].destroyed)return new Promise(function(re,Oe){t.nextTick(function(){K[l]?Oe(K[l]):re(h(void 0,!0))})});var ee=this[p],ge;if(ee)ge=new Promise(B(ee,this));else{var ae=this[g].read();if(ae!==null)return Promise.resolve(h(ae,!1));ge=new Promise(this[y])}return this[p]=ge,ge}},n(e,Symbol.asyncIterator,function(){return this}),n(e,"return",function(){var K=this;return new Promise(function(oe,ee){K[g].destroy(null,function(ge){if(ge){ee(ge);return}oe(h(void 0,!0))})})}),e),v),S=function(K){var oe,ee=Object.create(E,(oe={},n(oe,g,{value:K,writable:!0}),n(oe,i,{value:null,writable:!0}),n(oe,s,{value:null,writable:!0}),n(oe,l,{value:null,writable:!0}),n(oe,f,{value:K._readableState.endEmitted,writable:!0}),n(oe,y,{value:function(ae,re){var Oe=ee[g].read();Oe?(ee[p]=null,ee[i]=null,ee[s]=null,ae(h(Oe,!1))):(ee[i]=ae,ee[s]=re)},writable:!0}),oe));return ee[p]=null,a(K,function(ge){if(ge&&ge.code!=="ERR_STREAM_PREMATURE_CLOSE"){var ae=ee[s];ae!==null&&(ee[p]=null,ee[i]=null,ee[s]=null,ae(ge)),ee[l]=ge;return}var re=ee[i];re!==null&&(ee[p]=null,ee[i]=null,ee[s]=null,re(h(void 0,!0))),ee[f]=!0}),K.on("readable",P.bind(null,ee)),ee};return js=S,js}function vk(){return fh||(fh=!0,Ks=function(){throw new Error("Readable.from is not available in the browser")}),Ks}function kh(){if(dh)return Ls;dh=!0;var t=Ot;Ls=re;var e;re.ReadableState=ae,_t.EventEmitter;var n=function(x,z){return x.listeners(z).length},r=Ph(),o=Nt().Buffer,a=(typeof ph<"u"?ph:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(b){return o.from(b)}function s(b){return o.isBuffer(b)||b instanceof a}var l=L,f;l&&l.debuglog?f=l.debuglog("stream"):f=function(){};var p=mk(),y=Bh(),g=Sh(),h=g.getHighWaterMark,w=pr().codes,P=w.ERR_INVALID_ARG_TYPE,B=w.ERR_STREAM_PUSH_AFTER_EOF,v=w.ERR_METHOD_NOT_IMPLEMENTED,E=w.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,S,H,K;Dt()(re,r);var oe=y.errorOrDestroy,ee=["error","close","destroy","pause","resume"];function ge(b,x,z){if(typeof b.prependListener=="function")return b.prependListener(x,z);!b._events||!b._events[x]?b.on(x,z):Array.isArray(b._events[x])?b._events[x].unshift(z):b._events[x]=[z,b._events[x]]}function ae(b,x,z){e=e||dr(),b=b||{},typeof z!="boolean"&&(z=x instanceof e),this.objectMode=!!b.objectMode,z&&(this.objectMode=this.objectMode||!!b.readableObjectMode),this.highWaterMark=h(this,b,"readableHighWaterMark",z),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=b.emitClose!==!1,this.autoDestroy=!!b.autoDestroy,this.destroyed=!1,this.defaultEncoding=b.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,b.encoding&&(S||(S=Xr.StringDecoder),this.decoder=new S(b.encoding),this.encoding=b.encoding)}function re(b){if(e=e||dr(),!(this instanceof re))return new re(b);var x=this instanceof e;this._readableState=new ae(b,this,x),this.readable=!0,b&&(typeof b.read=="function"&&(this._read=b.read),typeof b.destroy=="function"&&(this._destroy=b.destroy)),r.call(this)}Object.defineProperty(re.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(x){this._readableState&&(this._readableState.destroyed=x)}}),re.prototype.destroy=y.destroy,re.prototype._undestroy=y.undestroy,re.prototype._destroy=function(b,x){x(b)},re.prototype.push=function(b,x){var z=this._readableState,Q;return z.objectMode?Q=!0:typeof b=="string"&&(x=x||z.defaultEncoding,x!==z.encoding&&(b=o.from(b,x),x=""),Q=!0),Oe(this,b,x,!1,Q)},re.prototype.unshift=function(b){return Oe(this,b,null,!0,!1)};function Oe(b,x,z,Q,Me){f("readableAddChunk",x);var _e=b._readableState;if(x===null)_e.reading=!1,Ue(b,_e);else{var Z;if(Me||(Z=tt(_e,x)),Z)oe(b,Z);else if(_e.objectMode||x&&x.length>0)if(typeof x!="string"&&!_e.objectMode&&Object.getPrototypeOf(x)!==o.prototype&&(x=i(x)),Q)_e.endEmitted?oe(b,new E):ze(b,_e,x,!0);else if(_e.ended)oe(b,new B);else{if(_e.destroyed)return!1;_e.reading=!1,_e.decoder&&!z?(x=_e.decoder.write(x),_e.objectMode||x.length!==0?ze(b,_e,x,!1):fe(b,_e)):ze(b,_e,x,!1)}else Q||(_e.reading=!1,fe(b,_e))}return!_e.ended&&(_e.length<_e.highWaterMark||_e.length===0)}function ze(b,x,z,Q){x.flowing&&x.length===0&&!x.sync?(x.awaitDrain=0,b.emit("data",z)):(x.length+=x.objectMode?1:z.length,Q?x.buffer.unshift(z):x.buffer.push(z),x.needReadable&&Pe(b)),fe(b,x)}function tt(b,x){var z;return!s(x)&&typeof x!="string"&&x!==void 0&&!b.objectMode&&(z=new P("chunk",["string","Buffer","Uint8Array"],x)),z}re.prototype.isPaused=function(){return this._readableState.flowing===!1},re.prototype.setEncoding=function(b){S||(S=Xr.StringDecoder);var x=new S(b);this._readableState.decoder=x,this._readableState.encoding=this._readableState.decoder.encoding;for(var z=this._readableState.buffer.head,Q="";z!==null;)Q+=x.write(z.data),z=z.next;return this._readableState.buffer.clear(),Q!==""&&this._readableState.buffer.push(Q),this._readableState.length=Q.length,this};var Ve=1073741824;function Je(b){return b>=Ve?b=Ve:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}function ht(b,x){return b<=0||x.length===0&&x.ended?0:x.objectMode?1:b!==b?x.flowing&&x.length?x.buffer.head.data.length:x.length:(b>x.highWaterMark&&(x.highWaterMark=Je(b)),b<=x.length?b:x.ended?x.length:(x.needReadable=!0,0))}re.prototype.read=function(b){f("read",b),b=parseInt(b,10);var x=this._readableState,z=b;if(b!==0&&(x.emittedReadable=!1),b===0&&x.needReadable&&((x.highWaterMark!==0?x.length>=x.highWaterMark:x.length>0)||x.ended))return f("read: emitReadable",x.length,x.ended),x.length===0&&x.ended?$(this):Pe(this),null;if(b=ht(b,x),b===0&&x.ended)return x.length===0&&$(this),null;var Q=x.needReadable;f("need readable",Q),(x.length===0||x.length-b<x.highWaterMark)&&(Q=!0,f("length less than watermark",Q)),x.ended||x.reading?(Q=!1,f("reading or ended",Q)):Q&&(f("do read"),x.reading=!0,x.sync=!0,x.length===0&&(x.needReadable=!0),this._read(x.highWaterMark),x.sync=!1,x.reading||(b=ht(z,x)));var Me;return b>0?Me=k(b,x):Me=null,Me===null?(x.needReadable=x.length<=x.highWaterMark,b=0):(x.length-=b,x.awaitDrain=0),x.length===0&&(x.ended||(x.needReadable=!0),z!==b&&x.ended&&$(this)),Me!==null&&this.emit("data",Me),Me};function Ue(b,x){if(f("onEofChunk"),!x.ended){if(x.decoder){var z=x.decoder.end();z&&z.length&&(x.buffer.push(z),x.length+=x.objectMode?1:z.length)}x.ended=!0,x.sync?Pe(b):(x.needReadable=!1,x.emittedReadable||(x.emittedReadable=!0,Ee(b)))}}function Pe(b){var x=b._readableState;f("emitReadable",x.needReadable,x.emittedReadable),x.needReadable=!1,x.emittedReadable||(f("emitReadable",x.flowing),x.emittedReadable=!0,t.nextTick(Ee,b))}function Ee(b){var x=b._readableState;f("emitReadable_",x.destroyed,x.length,x.ended),!x.destroyed&&(x.length||x.ended)&&(b.emit("readable"),x.emittedReadable=!1),x.needReadable=!x.flowing&&!x.ended&&x.length<=x.highWaterMark,A(b)}function fe(b,x){x.readingMore||(x.readingMore=!0,t.nextTick(ve,b,x))}function ve(b,x){for(;!x.reading&&!x.ended&&(x.length<x.highWaterMark||x.flowing&&x.length===0);){var z=x.length;if(f("maybeReadMore read 0"),b.read(0),z===x.length)break}x.readingMore=!1}re.prototype._read=function(b){oe(this,new v("_read()"))},re.prototype.pipe=function(b,x){var z=this,Q=this._readableState;switch(Q.pipesCount){case 0:Q.pipes=b;break;case 1:Q.pipes=[Q.pipes,b];break;default:Q.pipes.push(b);break}Q.pipesCount+=1,f("pipe count=%d opts=%j",Q.pipesCount,x);var Me=(!x||x.end!==!1)&&b!==t.stdout&&b!==t.stderr,_e=Me?At:u;Q.endEmitted?t.nextTick(_e):z.once("end",_e),b.on("unpipe",Z);function Z(c,T){f("onunpipe"),c===z&&T&&T.hasUnpiped===!1&&(T.hasUnpiped=!0,yr())}function At(){f("onend"),b.end()}var Mt=D(z);b.on("drain",Mt);var xt=!1;function yr(){f("cleanup"),b.removeListener("close",mr),b.removeListener("finish",m),b.removeListener("drain",Mt),b.removeListener("error",St),b.removeListener("unpipe",Z),z.removeListener("end",At),z.removeListener("end",u),z.removeListener("data",ai),xt=!0,Q.awaitDrain&&(!b._writableState||b._writableState.needDrain)&&Mt()}z.on("data",ai);function ai(c){f("ondata");var T=b.write(c);f("dest.write",T),T===!1&&((Q.pipesCount===1&&Q.pipes===b||Q.pipesCount>1&&ie(Q.pipes,b)!==-1)&&!xt&&(f("false write response, pause",Q.awaitDrain),Q.awaitDrain++),z.pause())}function St(c){f("onerror",c),u(),b.removeListener("error",St),n(b,"error")===0&&oe(b,c)}ge(b,"error",St);function mr(){b.removeListener("finish",m),u()}b.once("close",mr);function m(){f("onfinish"),b.removeListener("close",mr),u()}b.once("finish",m);function u(){f("unpipe"),z.unpipe(b)}return b.emit("pipe",z),Q.flowing||(f("pipe resume"),z.resume()),b};function D(b){return function(){var z=b._readableState;f("pipeOnDrain",z.awaitDrain),z.awaitDrain&&z.awaitDrain--,z.awaitDrain===0&&n(b,"data")&&(z.flowing=!0,A(b))}}re.prototype.unpipe=function(b){var x=this._readableState,z={hasUnpiped:!1};if(x.pipesCount===0)return this;if(x.pipesCount===1)return b&&b!==x.pipes?this:(b||(b=x.pipes),x.pipes=null,x.pipesCount=0,x.flowing=!1,b&&b.emit("unpipe",this,z),this);if(!b){var Q=x.pipes,Me=x.pipesCount;x.pipes=null,x.pipesCount=0,x.flowing=!1;for(var _e=0;_e<Me;_e++)Q[_e].emit("unpipe",this,{hasUnpiped:!1});return this}var Z=ie(x.pipes,b);return Z===-1?this:(x.pipes.splice(Z,1),x.pipesCount-=1,x.pipesCount===1&&(x.pipes=x.pipes[0]),b.emit("unpipe",this,z),this)},re.prototype.on=function(b,x){var z=r.prototype.on.call(this,b,x),Q=this._readableState;return b==="data"?(Q.readableListening=this.listenerCount("readable")>0,Q.flowing!==!1&&this.resume()):b==="readable"&&!Q.endEmitted&&!Q.readableListening&&(Q.readableListening=Q.needReadable=!0,Q.flowing=!1,Q.emittedReadable=!1,f("on readable",Q.length,Q.reading),Q.length?Pe(this):Q.reading||t.nextTick(F,this)),z},re.prototype.addListener=re.prototype.on,re.prototype.removeListener=function(b,x){var z=r.prototype.removeListener.call(this,b,x);return b==="readable"&&t.nextTick(j,this),z},re.prototype.removeAllListeners=function(b){var x=r.prototype.removeAllListeners.apply(this,arguments);return(b==="readable"||b===void 0)&&t.nextTick(j,this),x};function j(b){var x=b._readableState;x.readableListening=b.listenerCount("readable")>0,x.resumeScheduled&&!x.paused?x.flowing=!0:b.listenerCount("data")>0&&b.resume()}function F(b){f("readable nexttick read 0"),b.read(0)}re.prototype.resume=function(){var b=this._readableState;return b.flowing||(f("resume"),b.flowing=!b.readableListening,de(this,b)),b.paused=!1,this};function de(b,x){x.resumeScheduled||(x.resumeScheduled=!0,t.nextTick(Te,b,x))}function Te(b,x){f("resume",x.reading),x.reading||b.read(0),x.resumeScheduled=!1,b.emit("resume"),A(b),x.flowing&&!x.reading&&b.read(0)}re.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function A(b){var x=b._readableState;for(f("flow",x.flowing);x.flowing&&b.read()!==null;);}re.prototype.wrap=function(b){var x=this,z=this._readableState,Q=!1;b.on("end",function(){if(f("wrapped end"),z.decoder&&!z.ended){var Z=z.decoder.end();Z&&Z.length&&x.push(Z)}x.push(null)}),b.on("data",function(Z){if(f("wrapped data"),z.decoder&&(Z=z.decoder.write(Z)),!(z.objectMode&&Z==null)&&!(!z.objectMode&&(!Z||!Z.length))){var At=x.push(Z);At||(Q=!0,b.pause())}});for(var Me in b)this[Me]===void 0&&typeof b[Me]=="function"&&(this[Me]=(function(At){return function(){return b[At].apply(b,arguments)}})(Me));for(var _e=0;_e<ee.length;_e++)b.on(ee[_e],this.emit.bind(this,ee[_e]));return this._read=function(Z){f("wrapped _read",Z),Q&&(Q=!1,b.resume())},this},typeof Symbol=="function"&&(re.prototype[Symbol.asyncIterator]=function(){return H===void 0&&(H=hk()),H(this)}),Object.defineProperty(re.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(re.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(re.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(x){this._readableState&&(this._readableState.flowing=x)}}),re._fromList=k,Object.defineProperty(re.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function k(b,x){if(x.length===0)return null;var z;return x.objectMode?z=x.buffer.shift():!b||b>=x.length?(x.decoder?z=x.buffer.join(""):x.buffer.length===1?z=x.buffer.first():z=x.buffer.concat(x.length),x.buffer.clear()):z=x.buffer.consume(b,x.decoder),z}function $(b){var x=b._readableState;f("endReadable",x.endEmitted),x.endEmitted||(x.ended=!0,t.nextTick(X,x,b))}function X(b,x){if(f("endReadableNT",b.endEmitted,b.length),!b.endEmitted&&b.length===0&&(b.endEmitted=!0,x.readable=!1,x.emit("end"),b.autoDestroy)){var z=x._writableState;(!z||z.autoDestroy&&z.finished)&&x.destroy()}}typeof Symbol=="function"&&(re.from=function(b,x){return K===void 0&&(K=vk()),K(re,b,x)});function ie(b,x){for(var z=0,Q=b.length;z<Q;z++)if(b[z]===x)return z;return-1}return Ls}function Ih(){if(gh)return Fs;gh=!0,Fs=s;var t=pr().codes,e=t.ERR_METHOD_NOT_IMPLEMENTED,n=t.ERR_MULTIPLE_CALLBACK,r=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=t.ERR_TRANSFORM_WITH_LENGTH_0,a=dr();Dt()(s,a);function i(p,y){var g=this._transformState;g.transforming=!1;var h=g.writecb;if(h===null)return this.emit("error",new n);g.writechunk=null,g.writecb=null,y!=null&&this.push(y),h(p);var w=this._readableState;w.reading=!1,(w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}function s(p){if(!(this instanceof s))return new s(p);a.call(this,p),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,p&&(typeof p.transform=="function"&&(this._transform=p.transform),typeof p.flush=="function"&&(this._flush=p.flush)),this.on("prefinish",l)}function l(){var p=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(y,g){f(p,y,g)}):f(this,null,null)}s.prototype.push=function(p,y){return this._transformState.needTransform=!1,a.prototype.push.call(this,p,y)},s.prototype._transform=function(p,y,g){g(new e("_transform()"))},s.prototype._write=function(p,y,g){var h=this._transformState;if(h.writecb=g,h.writechunk=p,h.writeencoding=y,!h.transforming){var w=this._readableState;(h.needTransform||w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}},s.prototype._read=function(p){var y=this._transformState;y.writechunk!==null&&!y.transforming?(y.transforming=!0,this._transform(y.writechunk,y.writeencoding,y.afterTransform)):y.needTransform=!0},s.prototype._destroy=function(p,y){a.prototype._destroy.call(this,p,function(g){y(g)})};function f(p,y,g){if(y)return p.emit("error",y);if(g!=null&&p.push(g),p._writableState.length)throw new o;if(p._transformState.transforming)throw new r;return p.push(null)}return Fs}function Tk(){if(yh)return Ws;yh=!0,Ws=e;var t=Ih();Dt()(e,t);function e(n){if(!(this instanceof e))return new e(n);t.call(this,n)}return e.prototype._transform=function(n,r,o){o(null,n)},Ws}function _k(){if(mh)return zs;mh=!0;var t;function e(g){var h=!1;return function(){h||(h=!0,g.apply(void 0,arguments))}}var n=pr().codes,r=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function a(g){if(g)throw g}function i(g){return g.setHeader&&typeof g.abort=="function"}function s(g,h,w,P){P=e(P);var B=!1;g.on("close",function(){B=!0}),t===void 0&&(t=Xs()),t(g,{readable:h,writable:w},function(E){if(E)return P(E);B=!0,P()});var v=!1;return function(E){if(!B&&!v){if(v=!0,i(g))return g.abort();if(typeof g.destroy=="function")return g.destroy();P(E||new o("pipe"))}}}function l(g){g()}function f(g,h){return g.pipe(h)}function p(g){return!g.length||typeof g[g.length-1]!="function"?a:g.pop()}function y(){for(var g=arguments.length,h=new Array(g),w=0;w<g;w++)h[w]=arguments[w];var P=p(h);if(Array.isArray(h[0])&&(h=h[0]),h.length<2)throw new r("streams");var B,v=h.map(function(E,S){var H=S<h.length-1,K=S>0;return s(E,H,K,function(oe){B||(B=oe),oe&&v.forEach(l),!H&&(v.forEach(l),P(B))})});return h.reduce(f)}return zs=y,zs}function Ah(){return hh||(hh=!0,wt=wt=kh(),wt.Stream=wt,wt.Readable=wt,wt.Writable=Eh(),wt.Duplex=dr(),wt.Transform=Ih(),wt.PassThrough=Tk(),wt.finished=Xs(),wt.pipeline=_k()),wt}function Ch(){if(vh)return Lo;vh=!0;var t=Nt().Buffer,e=Ot,n=xh(),r=Dt(),o=Ah(),a=Lo.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i=Lo.IncomingMessage=function(s,l,f,p){var y=this||Fo;if(o.Readable.call(y),y._mode=f,y.headers={},y.rawHeaders=[],y.trailers={},y.rawTrailers=[],y.on("end",function(){e.nextTick(function(){y.emit("close")})}),f==="fetch"){let v=function(){h.read().then(function(E){if(!y._destroyed){if(p(E.done),E.done){y.push(null);return}y.push(t.from(E.value)),v()}}).catch(function(E){p(!0),y._destroyed||y.emit("error",E)})};if(y._fetchResponse=l,y.url=l.url,y.statusCode=l.status,y.statusMessage=l.statusText,l.headers.forEach(function(E,S){y.headers[S.toLowerCase()]=E,y.rawHeaders.push(S,E)}),n.writableStream){var g=new WritableStream({write:function(E){return p(!1),new Promise(function(S,H){y._destroyed?H():y.push(t.from(E))?S():y._resumeFetch=S})},close:function(){p(!0),y._destroyed||y.push(null)},abort:function(E){p(!0),y._destroyed||y.emit("error",E)}});try{l.body.pipeTo(g).catch(function(E){p(!0),y._destroyed||y.emit("error",E)});return}catch{}}var h=l.body.getReader();v()}else{y._xhr=s,y._pos=0,y.url=s.responseURL,y.statusCode=s.status,y.statusMessage=s.statusText;var w=s.getAllResponseHeaders().split(/\r?\n/);if(w.forEach(function(v){var E=v.match(/^([^:]+):\s*(.*)/);if(E){var S=E[1].toLowerCase();S==="set-cookie"?(y.headers[S]===void 0&&(y.headers[S]=[]),y.headers[S].push(E[2])):y.headers[S]!==void 0?y.headers[S]+=", "+E[2]:y.headers[S]=E[2],y.rawHeaders.push(E[1],E[2])}}),y._charset="x-user-defined",!n.overrideMimeType){var P=y.rawHeaders["mime-type"];if(P){var B=P.match(/;\s*charset=([^;])(;|$)/);B&&(y._charset=B[1].toLowerCase())}y._charset||(y._charset="utf-8")}}};return r(i,o.Readable),i.prototype._read=function(){var s=this||Fo,l=s._resumeFetch;l&&(s._resumeFetch=null,l())},i.prototype._onXHRProgress=function(s){var l=this||Fo,f=l._xhr,p=null;switch(l._mode){case"text":if(p=f.responseText,p.length>l._pos){var y=p.substr(l._pos);if(l._charset==="x-user-defined"){for(var g=t.alloc(y.length),h=0;h<y.length;h++)g[h]=y.charCodeAt(h)&255;l.push(g)}else l.push(y,l._charset);l._pos=p.length}break;case"arraybuffer":if(f.readyState!==a.DONE||!f.response)break;p=f.response,l.push(t.from(new Uint8Array(p)));break;case"moz-chunked-arraybuffer":if(p=f.response,f.readyState!==a.LOADING||!p)break;l.push(t.from(new Uint8Array(p)));break;case"ms-stream":if(p=f.response,f.readyState!==a.LOADING)break;var w=new Fo.MSStreamReader;w.onprogress=function(){w.result.byteLength>l._pos&&(l.push(t.from(new Uint8Array(w.result.slice(l._pos)))),l._pos=w.result.byteLength)},w.onload=function(){s(!0),l.push(null)},w.readAsArrayBuffer(p);break}l._xhr.readyState===a.DONE&&l._mode!=="ms-stream"&&(s(!0),l.push(null))},Lo}function bk(){if(Th)return qs;Th=!0;var t=Nt().Buffer,e=Ot,n=xh(),r=Dt(),o=Ch(),a=Ah(),i=o.IncomingMessage,s=o.readyStates;function l(g,h){return n.fetch&&h?"fetch":n.mozchunkedarraybuffer?"moz-chunked-arraybuffer":n.msstream?"ms-stream":n.arraybuffer&&g?"arraybuffer":"text"}var f=qs=function(g){var h=this||ot;a.Writable.call(h),h._opts=g,h._body=[],h._headers={},g.auth&&h.setHeader("Authorization","Basic "+t.from(g.auth).toString("base64")),Object.keys(g.headers).forEach(function(B){h.setHeader(B,g.headers[B])});var w,P=!0;if(g.mode==="disable-fetch"||"requestTimeout"in g&&!n.abortController)P=!1,w=!0;else if(g.mode==="prefer-streaming")w=!1;else if(g.mode==="allow-wrong-content-type")w=!n.overrideMimeType;else if(!g.mode||g.mode==="default"||g.mode==="prefer-fast")w=!0;else throw new Error("Invalid value for opts.mode");h._mode=l(w,P),h._fetchTimer=null,h._socketTimeout=null,h._socketTimer=null,h.on("finish",function(){h._onFinish()})};r(f,a.Writable),f.prototype.setHeader=function(g,h){var w=this||ot,P=g.toLowerCase();y.indexOf(P)===-1&&(w._headers[P]={name:g,value:h})},f.prototype.getHeader=function(g){var h=(this||ot)._headers[g.toLowerCase()];return h?h.value:null},f.prototype.removeHeader=function(g){var h=this||ot;delete h._headers[g.toLowerCase()]},f.prototype._onFinish=function(){var g=this||ot;if(!g._destroyed){var h=g._opts;"timeout"in h&&h.timeout!==0&&g.setTimeout(h.timeout);var w=g._headers,P=null;h.method!=="GET"&&h.method!=="HEAD"&&(P=new Blob(g._body,{type:(w["content-type"]||{}).value||""}));var B=[];if(Object.keys(w).forEach(function(H){var K=w[H].name,oe=w[H].value;Array.isArray(oe)?oe.forEach(function(ee){B.push([K,ee])}):B.push([K,oe])}),g._mode==="fetch"){var v=null;if(n.abortController){var E=new AbortController;v=E.signal,g._fetchAbortController=E,"requestTimeout"in h&&h.requestTimeout!==0&&(g._fetchTimer=ot.setTimeout(function(){g.emit("requestTimeout"),g._fetchAbortController&&g._fetchAbortController.abort()},h.requestTimeout))}ot.fetch(g._opts.url,{method:g._opts.method,headers:B,body:P||void 0,mode:"cors",credentials:h.withCredentials?"include":"same-origin",signal:v}).then(function(H){g._fetchResponse=H,g._resetTimers(!1),g._connect()},function(H){g._resetTimers(!0),g._destroyed||g.emit("error",H)})}else{var S=g._xhr=new ot.XMLHttpRequest;try{S.open(g._opts.method,g._opts.url,!0)}catch(H){e.nextTick(function(){g.emit("error",H)});return}"responseType"in S&&(S.responseType=g._mode),"withCredentials"in S&&(S.withCredentials=!!h.withCredentials),g._mode==="text"&&"overrideMimeType"in S&&S.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in h&&(S.timeout=h.requestTimeout,S.ontimeout=function(){g.emit("requestTimeout")}),B.forEach(function(H){S.setRequestHeader(H[0],H[1])}),g._response=null,S.onreadystatechange=function(){switch(S.readyState){case s.LOADING:case s.DONE:g._onXHRProgress();break}},g._mode==="moz-chunked-arraybuffer"&&(S.onprogress=function(){g._onXHRProgress()}),S.onerror=function(){g._destroyed||(g._resetTimers(!0),g.emit("error",new Error("XHR error")))};try{S.send(P)}catch(H){e.nextTick(function(){g.emit("error",H)});return}}}};function p(g){try{var h=g.status;return h!==null&&h!==0}catch{return!1}}f.prototype._onXHRProgress=function(){var g=this||ot;g._resetTimers(!1),!(!p(g._xhr)||g._destroyed)&&(g._response||g._connect(),g._response._onXHRProgress(g._resetTimers.bind(g)))},f.prototype._connect=function(){var g=this||ot;g._destroyed||(g._response=new i(g._xhr,g._fetchResponse,g._mode,g._resetTimers.bind(g)),g._response.on("error",function(h){g.emit("error",h)}),g.emit("response",g._response))},f.prototype._write=function(g,h,w){var P=this||ot;P._body.push(g),w()},f.prototype._resetTimers=function(g){var h=this||ot;ot.clearTimeout(h._socketTimer),h._socketTimer=null,g?(ot.clearTimeout(h._fetchTimer),h._fetchTimer=null):h._socketTimeout&&(h._socketTimer=ot.setTimeout(function(){h.emit("timeout")},h._socketTimeout))},f.prototype.abort=f.prototype.destroy=function(g){var h=this||ot;h._destroyed=!0,h._resetTimers(!0),h._response&&(h._response._destroyed=!0),h._xhr?h._xhr.abort():h._fetchAbortController&&h._fetchAbortController.abort(),g&&h.emit("error",g)},f.prototype.end=function(g,h,w){var P=this||ot;typeof g=="function"&&(w=g,g=void 0),a.Writable.prototype.end.call(P,g,h,w)},f.prototype.setTimeout=function(g,h){var w=this||ot;h&&w.once("timeout",h),w._socketTimeout=g,w._resetTimers(!1)},f.prototype.flushHeaders=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};var y=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return qs}function wk(){if(_h)return Gs;_h=!0,Gs=e;var t=Object.prototype.hasOwnProperty;function e(){for(var n={},r=0;r<arguments.length;r++){var o=arguments[r];for(var a in o)t.call(o,a)&&(n[a]=o[a])}return n}return Gs}function xk(){return bh||(bh=!0,Vs={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}),Vs}function Bk(){if(wh)return Js;wh=!0;var t=bk(),e=Ch(),n=wk(),r=xk(),o=De,a=Js;return a.request=function(i,s){typeof i=="string"?i=o.parse(i):i=n(i);var l=Pk.location.protocol.search(/^https?:$/)===-1?"http:":"",f=i.protocol||l,p=i.hostname||i.host,y=i.port,g=i.path||"/";p&&p.indexOf(":")!==-1&&(p="["+p+"]"),i.url=(p?f+"//"+p:"")+(y?":"+y:"")+g,i.method=(i.method||"GET").toUpperCase(),i.headers=i.headers||{};var h=new t(i);return s&&h.on("response",s),h},a.get=function(s,l){var f=a.request(s,l);return f.end(),f},a.ClientRequest=t,a.IncomingMessage=e.IncomingMessage,a.Agent=function(){},a.Agent.defaultMaxSockets=4,a.globalAgent=new a.Agent,a.STATUS_CODES=r,a.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],Js}var Bt,eh,$n,Rs,th,Ms,nh,Ns,rh,Ds,ih,Hs,oh,Us,ah,sh,Zs,lh,$s,uh,js,ch,Ks,fh,Ls,dh,ph,Fs,gh,Ws,yh,zs,mh,wt,hh,Lo,vh,Fo,qs,Th,ot,Gs,_h,Vs,bh,Js,wh,Pk,en,Sk,Ek,kk,Ik,Ak,Ck,Ok,Rk,Rh=at(()=>{C();R();O();ns();Gy();rs();fi();Am();jo();Ts();Nm();Um();Qm();Ps();Bt={},eh=!1,$n=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Rs={},th=!1;Ms={},nh=!1;Ns={},rh=!1;Ds={},ih=!1;Hs={},oh=!1;Us={},ah=!1,sh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Zs={},lh=!1;$s={},uh=!1;js={},ch=!1;Ks={},fh=!1;Ls={},dh=!1,ph=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Fs={},gh=!1;Ws={},yh=!1;zs={},mh=!1;wt={},hh=!1;Lo={},vh=!1,Fo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;qs={},Th=!1,ot=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Gs={},_h=!1;Vs={},bh=!1;Js={},wh=!1,Pk=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;en=Bk(),Sk=en.Agent,Ek=en.ClientRequest,kk=en.IncomingMessage,Ik=en.METHODS,Ak=en.STATUS_CODES,Ck=en.get,Ok=en.globalAgent,Rk=en.request});C();R();O();var Ay={};Kn(Ay,{defaults:()=>RB,markdown:()=>OB});C();R();O();C();R();O();C();R();O();var xa=Object.defineProperty,Lv=Object.defineProperties,Fv=Object.getOwnPropertyDescriptors,xi=Object.getOwnPropertySymbols,Jc=Object.prototype.hasOwnProperty,Xc=Object.prototype.propertyIsEnumerable,pc=(t,e,n)=>e in t?xa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,_=(t,e)=>{for(var n in e||(e={}))Jc.call(e,n)&&pc(t,n,e[n]);if(xi)for(var n of xi(e))Xc.call(e,n)&&pc(t,n,e[n]);return t},N=(t,e)=>Lv(t,Fv(e)),d=(t,e)=>xa(t,"name",{value:e,configurable:!0}),Yc=(t,e)=>{var n={};for(var r in t)Jc.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&xi)for(var r of xi(t))e.indexOf(r)<0&&Xc.call(t,r)&&(n[r]=t[r]);return n},io=(t,e)=>{for(var n in e)xa(t,n,{get:e[n],enumerable:!0})},Wv={};io(Wv,{errors:()=>nf,fromJSONSchema:()=>Gg,fromJSONSchemaLegacy:()=>nB,fromObject:()=>ba,toJSONSchema:()=>st,toJSONSchemaLegacy:()=>kB,toTypescriptSchema:()=>Na,toTypescriptType:()=>Pa});var Y={};io(Y,{BRAND:()=>Ox,DIRTY:()=>Gn,EMPTY_PATH:()=>kx,INVALID:()=>pe,NEVER:()=>OP,OK:()=>gt,ParseInputLazyPath:()=>Ct,ParseStatus:()=>Tt,Schema:()=>he,ZodAny:()=>$r,ZodArray:()=>jr,ZodBigInt:()=>Za,ZodBoolean:()=>$a,ZodBranded:()=>ja,ZodCatch:()=>Ka,ZodDate:()=>La,ZodDefault:()=>mo,ZodDiscriminatedUnion:()=>cg,ZodEffects:()=>Sn,ZodEnum:()=>rr,ZodError:()=>Ft,ZodFirstPartyTypeKind:()=>Xp,ZodFunction:()=>dg,ZodIntersection:()=>Wa,ZodIssueCode:()=>G,ZodLazy:()=>za,ZodLiteral:()=>qa,ZodMap:()=>gg,ZodNaN:()=>mg,ZodNativeEnum:()=>Ga,ZodNever:()=>Fr,ZodNull:()=>Va,ZodNullable:()=>Yn,ZodNumber:()=>Ja,ZodObject:()=>Qn,ZodOptional:()=>sn,ZodParsedType:()=>ne,ZodPipeline:()=>Xa,ZodPromise:()=>vo,ZodReadonly:()=>To,ZodRecord:()=>xg,ZodRef:()=>Bg,ZodSchema:()=>he,ZodSet:()=>Sg,ZodString:()=>yt,ZodSymbol:()=>Hg,ZodTransformer:()=>Sn,ZodTuple:()=>tr,ZodType:()=>he,ZodUndefined:()=>_o,ZodUnion:()=>Ya,ZodUnknown:()=>Mr,ZodVoid:()=>jg,addIssueToContext:()=>te,agent:()=>Zx,aimodel:()=>Fx,any:()=>tP,array:()=>oP,bigint:()=>Jx,boolean:()=>Fg,coerce:()=>CP,conversation:()=>Dx,createZodEnum:()=>ho,cuid2Regex:()=>kg,cuidRegex:()=>Eg,custom:()=>lg,datasource:()=>Wx,date:()=>Xx,default:()=>BP,discriminatedUnion:()=>uP,effect:()=>qc,emailRegex:()=>Cg,enum:()=>_P,errorUtil:()=>ue,event:()=>$x,function:()=>hP,getErrorMap:()=>Ur,getParsedType:()=>an,instanceof:()=>Gx,intent:()=>Lx,intersection:()=>cP,ipv4Regex:()=>Rg,ipv6Regex:()=>Mg,isAborted:()=>va,isAsync:()=>Si,isDirty:()=>Ta,isEmojiRegex:()=>Rx,isValid:()=>Zr,knowledgebase:()=>zx,late:()=>qx,lazy:()=>vP,literal:()=>TP,makeIssue:()=>Bi,map:()=>yP,message:()=>Ux,nan:()=>Vx,nativeEnum:()=>bP,never:()=>rP,null:()=>eP,nullable:()=>PP,number:()=>Lg,object:()=>aP,objectUtil:()=>ha,oboolean:()=>AP,onumber:()=>IP,optional:()=>xP,ostring:()=>kP,pipeline:()=>EP,preprocess:()=>SP,processCreateParams:()=>me,promise:()=>wP,quotelessJson:()=>Ex,readonly:()=>gP,record:()=>dP,ref:()=>pP,set:()=>mP,setErrorMap:()=>eg,strictObject:()=>sP,string:()=>Kg,symbol:()=>Yx,table:()=>jx,tablerow:()=>Kx,transformer:()=>qc,tuple:()=>fP,ulidRegex:()=>Ig,undefined:()=>Qx,union:()=>lP,unknown:()=>nP,user:()=>Hx,util:()=>be,uuidRegex:()=>Ag,variable:()=>Nx,void:()=>iP});var le="x-zui";function Qc(t){return typeof t=="symbol"?"symbol":typeof t=="bigint"?`${t.toString()}n`:se(t)}d(Qc,"primitiveToTypscriptLiteralType");function se(t){return typeof t>"u"?"undefined":typeof t=="symbol"?t.description?`Symbol(${se(t.description)})`:"Symbol()":typeof t=="bigint"?`BigInt(${t.toString()})`:JSON.stringify(t)}d(se,"primitiveToTypescriptValue");function Vn(t){return typeof t>"u"?"undefined":JSON.stringify(t)}d(Vn,"unknownToTypescriptValue");var ef=d((t,e)=>{let n=Object.entries(t),r=e?" as const":"";return`{ ${n.map(([o,a])=>`${la(o)}: ${Vn(a)}`).join(", ")} }${r}`},"recordOfUnknownToTypescriptRecord"),la=d(t=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)?t:se(t),"toPropertyKey"),zv=d(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalize"),tf=d(t=>{let e=/[^a-zA-Z0-9_]/g;return t.split(e).map(zv).filter(r=>!!r).join("")},"toTypeArgumentName"),nt=d(t=>{let e=(t??"").split(`
|
|
10
|
+
`)):s=t.stylize("[Circular]","special")),Hn(i)){if(o&&a.match(/^\d+$/))return s;(i=JSON.stringify(""+a)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2),i=t.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=t.stylize(i,"string"))}return i+": "+s}function xm(t){return Array.isArray(t)}function ps(t){return typeof t=="boolean"}function Ha(t){return t===null}function Pm(t){return typeof t=="number"}function Ma(t){return typeof t=="string"}function Hn(t){return t===void 0}function Gr(t){return lr(t)&&gs(t)==="[object RegExp]"}function lr(t){return typeof t=="object"&&t!==null}function Na(t){return lr(t)&&gs(t)==="[object Date]"}function Vr(t){return lr(t)&&(gs(t)==="[object Error]"||t instanceof Error)}function Ia(t){return typeof t=="function"}function gs(t){return Object.prototype.toString.call(t)}function ls(t){return t<10?"0"+t.toString(10):t.toString(10)}function sE(){var t=new Date,e=[ls(t.getHours()),ls(t.getMinutes()),ls(t.getSeconds())].join(":");return[t.getDate(),oE[t.getMonth()],e].join(" ")}function Bm(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function lE(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}var rm,Jt,Yt,sr,Qe,Dn,Xt,or,ka,je,UB,fs,Da,om,ZB,$B,jB,KB,LB,sm,lm,zy,FB,WB,zB,um,Ee,qB,GB,VB,cm,ds,Pt,bt,JB,We,XB,QB,eE,qr,L,Ut,nm,rE,Ea,wm,Sa,oE,Nn,_C,Ua=ot(()=>{C();R();O();sr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Qe=rm={};(function(){try{Jt=typeof setTimeout=="function"?setTimeout:us}catch{Jt=us}try{Yt=typeof clearTimeout=="function"?clearTimeout:cs}catch{Yt=cs}})();Xt=[],or=!1,ka=-1;Qe.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Xt.push(new Wy(t,e)),Xt.length!==1||or||im(am)},Wy.prototype.run=function(){(this||sr).fun.apply(null,(this||sr).array)},Qe.title="browser",Qe.browser=!0,Qe.env={},Qe.argv=[],Qe.version="",Qe.versions={},Qe.on=Vt,Qe.addListener=Vt,Qe.once=Vt,Qe.off=Vt,Qe.removeListener=Vt,Qe.removeAllListeners=Vt,Qe.emit=Vt,Qe.prependListener=Vt,Qe.prependOnceListener=Vt,Qe.listeners=function(t){return[]},Qe.binding=function(t){throw new Error("process.binding is not supported")},Qe.cwd=function(){return"/"},Qe.chdir=function(t){throw new Error("process.chdir is not supported")},Qe.umask=function(){return 0};je=rm;je.addListener;je.argv;je.binding;je.browser;je.chdir;je.cwd;je.emit;je.env;je.listeners;je.nextTick;je.off;je.on;je.once;je.prependListener;je.prependOnceListener;je.removeAllListeners;je.removeListener;je.title;je.umask;je.version;je.versions;UB=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",fs=Object.prototype.toString,Da=function(t){return!(UB&&t&&typeof t=="object"&&Symbol.toStringTag in t)&&fs.call(t)==="[object Arguments]"},om=function(t){return!!Da(t)||t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&fs.call(t)!=="[object Array]"&&fs.call(t.callee)==="[object Function]"},ZB=(function(){return Da(arguments)})();Da.isLegacyArguments=om;$B=ZB?Da:om,jB=Object.prototype.toString,KB=Function.prototype.toString,LB=/^\s*(?:function)?\*/,sm=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",lm=Object.getPrototypeOf,zy=(function(){if(!sm)return!1;try{return Function("return function*() {}")()}catch{}})(),FB=zy?lm(zy):{},WB=function(t){return typeof t=="function"&&(!!LB.test(KB.call(t))||(sm?lm(t)===FB:jB.call(t)==="[object GeneratorFunction]"))},zB=typeof Object.create=="function"?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},um=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"},Ee={},qB=um,GB=$B,VB=WB;cm=typeof BigInt<"u",ds=typeof Symbol<"u",Pt=ds&&Symbol.toStringTag!==void 0,bt=typeof Uint8Array<"u",JB=typeof ArrayBuffer<"u";if(bt&&Pt)var YB=Object.getPrototypeOf(Uint8Array.prototype),St=Un(Object.getOwnPropertyDescriptor(YB,Symbol.toStringTag).get);We=Un(Object.prototype.toString),XB=Un(Number.prototype.valueOf),QB=Un(String.prototype.valueOf),eE=Un(Boolean.prototype.valueOf);if(cm)var tE=Un(BigInt.prototype.valueOf);if(ds)var nE=Un(Symbol.prototype.valueOf);Ee.isArgumentsObject=GB,Ee.isGeneratorFunction=VB,Ee.isPromise=function(t){return typeof Promise<"u"&&t instanceof Promise||t!==null&&typeof t=="object"&&typeof t.then=="function"&&typeof t.catch=="function"},Ee.isArrayBufferView=function(t){return JB&&ArrayBuffer.isView?ArrayBuffer.isView(t):qy(t)||Vy(t)},Ee.isTypedArray=qy,Ee.isUint8Array=fm,Ee.isUint8ClampedArray=dm,Ee.isUint16Array=pm,Ee.isUint32Array=gm,Ee.isInt8Array=ym,Ee.isInt16Array=mm,Ee.isInt32Array=hm,Ee.isFloat32Array=vm,Ee.isFloat64Array=Tm,Ee.isBigInt64Array=_m,Ee.isBigUint64Array=bm,xa.working=typeof Map<"u"&&xa(new Map),Ee.isMap=function(t){return typeof Map<"u"&&(xa.working?xa(t):t instanceof Map)},Pa.working=typeof Set<"u"&&Pa(new Set),Ee.isSet=function(t){return typeof Set<"u"&&(Pa.working?Pa(t):t instanceof Set)},Ba.working=typeof WeakMap<"u"&&Ba(new WeakMap),Ee.isWeakMap=function(t){return typeof WeakMap<"u"&&(Ba.working?Ba(t):t instanceof WeakMap)},as.working=typeof WeakSet<"u"&&as(new WeakSet),Ee.isWeakSet=function(t){return as(t)},Aa.working=typeof ArrayBuffer<"u"&&Aa(new ArrayBuffer),Ee.isArrayBuffer=Gy,Ca.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Ca(new DataView(new ArrayBuffer(1),0,1)),Ee.isDataView=Vy,Oa.working=typeof SharedArrayBuffer<"u"&&Oa(new SharedArrayBuffer),Ee.isSharedArrayBuffer=Jy,Ee.isAsyncFunction=function(t){return We(t)==="[object AsyncFunction]"},Ee.isMapIterator=function(t){return We(t)==="[object Map Iterator]"},Ee.isSetIterator=function(t){return We(t)==="[object Set Iterator]"},Ee.isGeneratorObject=function(t){return We(t)==="[object Generator]"},Ee.isWebAssemblyCompiledModule=function(t){return We(t)==="[object WebAssembly.Module]"},Ee.isNumberObject=Yy,Ee.isStringObject=Xy,Ee.isBooleanObject=Qy,Ee.isBigIntObject=em,Ee.isSymbolObject=tm,Ee.isBoxedPrimitive=function(t){return Yy(t)||Xy(t)||Qy(t)||em(t)||tm(t)},Ee.isAnyArrayBuffer=function(t){return bt&&(Gy(t)||Jy(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(Ee,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}));qr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,L={},Ut=je,nm=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++)n[e[r]]=Object.getOwnPropertyDescriptor(t,e[r]);return n},rE=/%[sdj%]/g;L.format=function(t){if(!Ma(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(fn(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,a=r.length,o=String(t).replace(rE,(function(s){if(s==="%%")return"%";if(n>=a)return s;switch(s){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch{return"[Circular]"}default:return s}})),i=r[n];n<a;i=r[++n])Ha(i)||!lr(i)?o+=" "+i:o+=" "+fn(i);return o},L.deprecate=function(t,e){if(Ut!==void 0&&Ut.noDeprecation===!0)return t;if(Ut===void 0)return function(){return L.deprecate(t,e).apply(this||qr,arguments)};var n=!1;return function(){if(!n){if(Ut.throwDeprecation)throw new Error(e);Ut.traceDeprecation?console.trace(e):console.error(e),n=!0}return t.apply(this||qr,arguments)}};Ea={},wm=/^$/;Ut.env.NODE_DEBUG&&(Sa=Ut.env.NODE_DEBUG,Sa=Sa.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),wm=new RegExp("^"+Sa+"$","i"));L.debuglog=function(t){if(t=t.toUpperCase(),!Ea[t])if(wm.test(t)){var e=Ut.pid;Ea[t]=function(){var n=L.format.apply(L,arguments);console.error("%s %d: %s",t,e,n)}}else Ea[t]=function(){};return Ea[t]},L.inspect=fn,fn.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},fn.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},L.types=Ee,L.isArray=xm,L.isBoolean=ps,L.isNull=Ha,L.isNullOrUndefined=function(t){return t==null},L.isNumber=Pm,L.isString=Ma,L.isSymbol=function(t){return typeof t=="symbol"},L.isUndefined=Hn,L.isRegExp=Gr,L.types.isRegExp=Gr,L.isObject=lr,L.isDate=Na,L.types.isDate=Na,L.isError=Vr,L.types.isNativeError=Vr,L.isFunction=Ia,L.isPrimitive=function(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||t===void 0},L.isBuffer=um;oE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];L.log=function(){console.log("%s - %s",sE(),L.format.apply(L,arguments))},L.inherits=zB,L._extend=function(t,e){if(!e||!lr(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t};Nn=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;L.promisify=function(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');if(Nn&&t[Nn]){var e;if(typeof(e=t[Nn])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Nn,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var n,r,a=new Promise((function(s,l){n=s,r=l})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(s,l){s?r(s):n(l)}));try{t.apply(this||qr,o)}catch(s){r(s)}return a}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Nn&&Object.defineProperty(e,Nn,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,nm(t))},L.promisify.custom=Nn,L.callbackify=function(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var a=n.pop();if(typeof a!="function")throw new TypeError("The last argument must be of type Function");var o=this||qr,i=function(){return a.apply(o,arguments)};t.apply(this||qr,n).then((function(s){Ut.nextTick(i.bind(null,null,s))}),(function(s){Ut.nextTick(lE.bind(null,s,i))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,nm(t)),e};L._extend;L.callbackify;L.debuglog;L.deprecate;L.format;L.inherits;L.inspect;L.isArray;L.isBoolean;L.isBuffer;L.isDate;L.isError;L.isFunction;L.isNull;L.isNullOrUndefined;L.isNumber;L.isObject;L.isPrimitive;L.isRegExp;L.isString;L.isSymbol;L.isUndefined;L.log;L.promisify;L._extend;L.callbackify;L.debuglog;L.deprecate;L.format;L.inherits;L.inspect;L.isArray;L.isBoolean;L.isBuffer;L.isDate;L.isError;L.isFunction;L.isNull;L.isNullOrUndefined;L.isNumber;L.isObject;L.isPrimitive;L.isRegExp;L.isString;L.isSymbol;L.isUndefined;L.log;_C=L.promisify;L.types});var EC,Em=ot(()=>{C();R();O();Ua();L._extend;L.callbackify;L.debuglog;L.deprecate;L.format;L.inherits;L.inspect;L.isArray;L.isBoolean;L.isBuffer;L.isDate;L.isError;L.isFunction;L.isNull;L.isNullOrUndefined;L.isNumber;L.isObject;L.isPrimitive;L.isRegExp;L.isString;L.isSymbol;L.isUndefined;L.log;EC=L.promisify;L.types;L.TextEncoder=globalThis.TextEncoder;L.TextDecoder=globalThis.TextDecoder});function vs(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function uE(){!ur||!Zn||(ur=!1,Zn.length?Qt=Zn.concat(Qt):Za=-1,Qt.length&&Sm())}function Sm(){if(!ur){var t=setTimeout(uE,0);ur=!0;for(var e=Qt.length;e;){for(Zn=Qt,Qt=[];++Za<e;)Zn&&Zn[Za].run();Za=-1,e=Qt.length}Zn=null,ur=!1,clearTimeout(t)}}function cE(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Qt.push(new km(t,e)),Qt.length===1&&!ur&&setTimeout(Sm,0)}function km(t,e){this.fun=t,this.array=e}function ct(){}function SE(t){vs("_linkedBinding")}function CE(t){vs("dlopen")}function OE(){return[]}function RE(){return[]}function KE(t,e){if(!t)throw new Error(e||"assertion error")}function zE(){return!1}function uS(){return dn.now()/1e3}function hs(t){var e=Math.floor((Date.now()-dn.now())*.001),n=dn.now()*.001,r=Math.floor(n)+e,a=Math.floor(n%1*1e9);return t&&(r=r-t[0],a=a-t[1],a<0&&(r--,a+=ms)),[r,a]}function pn(){return Rt}function bS(t){return[]}var Qt,ur,Zn,Za,fE,dE,pE,gE,yE,mE,hE,vE,TE,_E,bE,wE,xE,PE,BE,EE,kE,IE,AE,ME,NE,Ts,DE,HE,UE,ZE,$E,jE,LE,FE,WE,qE,GE,VE,JE,YE,XE,QE,eS,tS,nS,rS,iS,aS,oS,sS,lS,dn,ys,ms,cS,fS,dS,pS,gS,yS,mS,hS,vS,TS,_S,Rt,_s=ot(()=>{C();R();O();Qt=[],ur=!1,Za=-1;km.prototype.run=function(){this.fun.apply(null,this.array)};fE="browser",dE="x64",pE="browser",gE={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},yE=["/usr/bin/node"],mE=[],hE="v16.8.0",vE={},TE=function(t,e){console.warn((e?e+": ":"")+t)},_E=function(t){vs("binding")},bE=function(t){return 0},wE=function(){return"/"},xE=function(t){},PE={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};BE=ct,EE=[];kE={},IE=!1,AE={};ME=ct,NE=ct,Ts=function(){return{}},DE=Ts,HE=Ts,UE=ct,ZE=ct,$E=ct,jE={};LE={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},FE=ct,WE=ct;qE=ct,GE=ct,VE=ct,JE=ct,YE=ct,XE=void 0,QE=void 0,eS=void 0,tS=ct,nS=2,rS=1,iS="/bin/usr/node",aS=9229,oS="node",sS=[],lS=ct,dn={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};dn.now===void 0&&(ys=Date.now(),dn.timing&&dn.timing.navigationStart&&(ys=dn.timing.navigationStart),dn.now=()=>Date.now()-ys);ms=1e9;hs.bigint=function(t){var e=hs(t);return typeof BigInt>"u"?e[0]*ms+e[1]:BigInt(e[0]*ms)+BigInt(e[1])};cS=10,fS={},dS=0;pS=pn,gS=pn,yS=pn,mS=pn,hS=pn,vS=ct,TS=pn,_S=pn;Rt={version:hE,versions:vE,arch:dE,platform:pE,release:PE,_rawDebug:BE,moduleLoadList:EE,binding:_E,_linkedBinding:SE,_events:fS,_eventsCount:dS,_maxListeners:cS,on:pn,addListener:pS,once:gS,off:yS,removeListener:mS,removeAllListeners:hS,emit:vS,prependListener:TS,prependOnceListener:_S,listeners:bS,domain:kE,_exiting:IE,config:AE,dlopen:CE,uptime:uS,_getActiveRequests:OE,_getActiveHandles:RE,reallyExit:ME,_kill:NE,cpuUsage:Ts,resourceUsage:DE,memoryUsage:HE,kill:UE,exit:ZE,openStdin:$E,allowedNodeEnvironmentFlags:jE,assert:KE,features:LE,_fatalExceptions:FE,setUncaughtExceptionCaptureCallback:WE,hasUncaughtExceptionCaptureCallback:zE,emitWarning:TE,nextTick:cE,_tickCallback:qE,_debugProcess:GE,_debugEnd:VE,_startProfilerIdleNotifier:JE,_stopProfilerIdleNotifier:YE,stdout:XE,stdin:eS,stderr:QE,abort:tS,umask:bE,chdir:xE,cwd:wE,env:gE,title:fE,argv:yE,execArgv:mE,pid:nS,ppid:rS,execPath:iS,debugPort:aS,hrtime:hs,argv0:oS,_preload_modules:sS,setSourceMapsEnabled:lS}});function Am(){if(Im)return bs;Im=!0,bs=t;function t(n,r){if(e("noDeprecation"))return n;var a=!1;function o(){if(!a){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),a=!0}return n.apply(this||ws,arguments)}return o}function e(n){try{if(!ws.localStorage)return!1}catch{return!1}var r=ws.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return bs}var bs,Im,ws,Cm=ot(()=>{C();R();O();bs={},Im=!1,ws=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global});function wS(){if(Om)return Yr;Om=!0;var t=Dt(),e=t.Buffer;function n(a,o){for(var i in a)o[i]=a[i]}e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?Yr=t:(n(t,Yr),Yr.Buffer=r);function r(a,o,i){return e(a,o,i)}return r.prototype=Object.create(e.prototype),n(e,r),r.from=function(a,o,i){if(typeof a=="number")throw new TypeError("Argument must not be a number");return e(a,o,i)},r.alloc=function(a,o,i){if(typeof a!="number")throw new TypeError("Argument must be a number");var s=e(a);return o!==void 0?typeof i=="string"?s.fill(o,i):s.fill(o):s.fill(0),s},r.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return e(a)},r.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(a)},Yr}function xS(){if(Rm)return xs;Rm=!0;var t=wS().Buffer,e=t.isEncoding||function(v){switch(v=""+v,v&&v.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(v){if(!v)return"utf8";for(var S;;)switch(v){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return v;default:if(S)return;v=(""+v).toLowerCase(),S=!0}}function r(v){var S=n(v);if(typeof S!="string"&&(t.isEncoding===e||!e(v)))throw new Error("Unknown encoding: "+v);return S||v}xs.StringDecoder=a;function a(v){this.encoding=r(v);var S;switch(this.encoding){case"utf16le":this.text=y,this.end=g,S=4;break;case"utf8":this.fillLast=l,S=4;break;case"base64":this.text=h,this.end=w,S=3;break;default:this.write=P,this.end=B;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(S)}a.prototype.write=function(v){if(v.length===0)return"";var S,E;if(this.lastNeed){if(S=this.fillLast(v),S===void 0)return"";E=this.lastNeed,this.lastNeed=0}else E=0;return E<v.length?S?S+this.text(v,E):this.text(v,E):S||""},a.prototype.end=p,a.prototype.text=f,a.prototype.fillLast=function(v){if(this.lastNeed<=v.length)return v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,v.length),this.lastNeed-=v.length};function o(v){return v<=127?0:v>>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function i(v,S,E){var H=S.length-1;if(H<E)return 0;var K=o(S[H]);return K>=0?(K>0&&(v.lastNeed=K-1),K):--H<E||K===-2?0:(K=o(S[H]),K>=0?(K>0&&(v.lastNeed=K-2),K):--H<E||K===-2?0:(K=o(S[H]),K>=0?(K>0&&(K===2?K=0:v.lastNeed=K-3),K):0))}function s(v,S,E){if((S[0]&192)!==128)return v.lastNeed=0,"\uFFFD";if(v.lastNeed>1&&S.length>1){if((S[1]&192)!==128)return v.lastNeed=1,"\uFFFD";if(v.lastNeed>2&&S.length>2&&(S[2]&192)!==128)return v.lastNeed=2,"\uFFFD"}}function l(v){var S=this.lastTotal-this.lastNeed,E=s(this,v);if(E!==void 0)return E;if(this.lastNeed<=v.length)return v.copy(this.lastChar,S,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,S,0,v.length),this.lastNeed-=v.length}function f(v,S){var E=i(this,v,S);if(!this.lastNeed)return v.toString("utf8",S);this.lastTotal=E;var H=v.length-(E-this.lastNeed);return v.copy(this.lastChar,0,H),v.toString("utf8",S,H)}function p(v){var S=v&&v.length?this.write(v):"";return this.lastNeed?S+"\uFFFD":S}function y(v,S){if((v.length-S)%2===0){var E=v.toString("utf16le",S);if(E){var H=E.charCodeAt(E.length-1);if(H>=55296&&H<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],E.slice(0,-1)}return E}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",S,v.length-1)}function g(v){var S=v&&v.length?this.write(v):"";if(this.lastNeed){var E=this.lastTotal-this.lastNeed;return S+this.lastChar.toString("utf16le",0,E)}return S}function h(v,S){var E=(v.length-S)%3;return E===0?v.toString("base64",S):(this.lastNeed=3-E,this.lastTotal=3,E===1?this.lastChar[0]=v[v.length-1]:(this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1]),v.toString("base64",S,v.length-E))}function w(v){var S=v&&v.length?this.write(v):"";return this.lastNeed?S+this.lastChar.toString("base64",0,3-this.lastNeed):S}function P(v){return v.toString(this.encoding)}function B(v){return v&&v.length?this.write(v):""}return xs}var Yr,Om,xs,Rm,Xr,$C,Mm=ot(()=>{C();R();O();di();Yr={},Om=!1;xs={},Rm=!1;Xr=xS();Xr.StringDecoder;$C=Xr.StringDecoder});function PS(){if(Nm)return Ps;Nm=!0;var t=Ps={},e,n;function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?n=clearTimeout:n=a}catch{n=a}})();function o(P){if(e===setTimeout)return setTimeout(P,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(P,0);try{return e(P,0)}catch{try{return e.call(null,P,0)}catch{return e.call(this||cr,P,0)}}}function i(P){if(n===clearTimeout)return clearTimeout(P);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(P);try{return n(P)}catch{try{return n.call(null,P)}catch{return n.call(this||cr,P)}}}var s=[],l=!1,f,p=-1;function y(){!l||!f||(l=!1,f.length?s=f.concat(s):p=-1,s.length&&g())}function g(){if(!l){var P=o(y);l=!0;for(var B=s.length;B;){for(f=s,s=[];++p<B;)f&&f[p].run();p=-1,B=s.length}f=null,l=!1,i(P)}}t.nextTick=function(P){var B=new Array(arguments.length-1);if(arguments.length>1)for(var v=1;v<arguments.length;v++)B[v-1]=arguments[v];s.push(new h(P,B)),s.length===1&&!l&&o(g)};function h(P,B){(this||cr).fun=P,(this||cr).array=B}h.prototype.run=function(){(this||cr).fun.apply(null,(this||cr).array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function w(){}return t.on=w,t.addListener=w,t.once=w,t.off=w,t.removeListener=w,t.removeAllListeners=w,t.emit=w,t.prependListener=w,t.prependOnceListener=w,t.listeners=function(P){return[]},t.binding=function(P){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(P){throw new Error("process.chdir is not supported")},t.umask=function(){return 0},Ps}var Ps,Nm,cr,Ke,Bs=ot(()=>{C();R();O();Ps={},Nm=!1,cr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ke=PS();Ke.platform="browser";Ke.addListener;Ke.argv;Ke.binding;Ke.browser;Ke.chdir;Ke.cwd;Ke.emit;Ke.env;Ke.listeners;Ke.nextTick;Ke.off;Ke.on;Ke.once;Ke.prependListener;Ke.prependOnceListener;Ke.removeAllListeners;Ke.removeListener;Ke.title;Ke.umask;Ke.version;Ke.versions});function BS(){if(Dm)return Es;Dm=!0;var t=Ke;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function n(o,i){for(var s="",l=0,f=-1,p=0,y,g=0;g<=o.length;++g){if(g<o.length)y=o.charCodeAt(g);else{if(y===47)break;y=47}if(y===47){if(!(f===g-1||p===1))if(f!==g-1&&p===2){if(s.length<2||l!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var h=s.lastIndexOf("/");if(h!==s.length-1){h===-1?(s="",l=0):(s=s.slice(0,h),l=s.length-1-s.lastIndexOf("/")),f=g,p=0;continue}}else if(s.length===2||s.length===1){s="",l=0,f=g,p=0;continue}}i&&(s.length>0?s+="/..":s="..",l=2)}else s.length>0?s+="/"+o.slice(f+1,g):s=o.slice(f+1,g),l=g-f-1;f=g,p=0}else y===46&&p!==-1?++p:p=-1}return s}function r(o,i){var s=i.dir||i.root,l=i.base||(i.name||"")+(i.ext||"");return s?s===i.root?s+l:s+o+l:l}var a={resolve:function(){for(var i="",s=!1,l,f=arguments.length-1;f>=-1&&!s;f--){var p;f>=0?p=arguments[f]:(l===void 0&&(l=t.cwd()),p=l),e(p),p.length!==0&&(i=p+"/"+i,s=p.charCodeAt(0)===47)}return i=n(i,!s),s?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var s=i.charCodeAt(0)===47,l=i.charCodeAt(i.length-1)===47;return i=n(i,!s),i.length===0&&!s&&(i="."),i.length>0&&l&&(i+="/"),s?"/"+i:i},isAbsolute:function(i){return e(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,s=0;s<arguments.length;++s){var l=arguments[s];e(l),l.length>0&&(i===void 0?i=l:i+="/"+l)}return i===void 0?".":a.normalize(i)},relative:function(i,s){if(e(i),e(s),i===s||(i=a.resolve(i),s=a.resolve(s),i===s))return"";for(var l=1;l<i.length&&i.charCodeAt(l)===47;++l);for(var f=i.length,p=f-l,y=1;y<s.length&&s.charCodeAt(y)===47;++y);for(var g=s.length,h=g-y,w=p<h?p:h,P=-1,B=0;B<=w;++B){if(B===w){if(h>w){if(s.charCodeAt(y+B)===47)return s.slice(y+B+1);if(B===0)return s.slice(y+B)}else p>w&&(i.charCodeAt(l+B)===47?P=B:B===0&&(P=0));break}var v=i.charCodeAt(l+B),S=s.charCodeAt(y+B);if(v!==S)break;v===47&&(P=B)}var E="";for(B=l+P+1;B<=f;++B)(B===f||i.charCodeAt(B)===47)&&(E.length===0?E+="..":E+="/..");return E.length>0?E+s.slice(y+P):(y+=P,s.charCodeAt(y)===47&&++y,s.slice(y))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var s=i.charCodeAt(0),l=s===47,f=-1,p=!0,y=i.length-1;y>=1;--y)if(s=i.charCodeAt(y),s===47){if(!p){f=y;break}}else p=!1;return f===-1?l?"/":".":l&&f===1?"//":i.slice(0,f)},basename:function(i,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');e(i);var l=0,f=-1,p=!0,y;if(s!==void 0&&s.length>0&&s.length<=i.length){if(s.length===i.length&&s===i)return"";var g=s.length-1,h=-1;for(y=i.length-1;y>=0;--y){var w=i.charCodeAt(y);if(w===47){if(!p){l=y+1;break}}else h===-1&&(p=!1,h=y+1),g>=0&&(w===s.charCodeAt(g)?--g===-1&&(f=y):(g=-1,f=h))}return l===f?f=h:f===-1&&(f=i.length),i.slice(l,f)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!p){l=y+1;break}}else f===-1&&(p=!1,f=y+1);return f===-1?"":i.slice(l,f)}},extname:function(i){e(i);for(var s=-1,l=0,f=-1,p=!0,y=0,g=i.length-1;g>=0;--g){var h=i.charCodeAt(g);if(h===47){if(!p){l=g+1;break}continue}f===-1&&(p=!1,f=g+1),h===46?s===-1?s=g:y!==1&&(y=1):s!==-1&&(y=-1)}return s===-1||f===-1||y===0||y===1&&s===f-1&&s===l+1?"":i.slice(s,f)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return r("/",i)},parse:function(i){e(i);var s={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return s;var l=i.charCodeAt(0),f=l===47,p;f?(s.root="/",p=1):p=0;for(var y=-1,g=0,h=-1,w=!0,P=i.length-1,B=0;P>=p;--P){if(l=i.charCodeAt(P),l===47){if(!w){g=P+1;break}continue}h===-1&&(w=!1,h=P+1),l===46?y===-1?y=P:B!==1&&(B=1):y!==-1&&(B=-1)}return y===-1||h===-1||B===0||B===1&&y===h-1&&y===g+1?h!==-1&&(g===0&&f?s.base=s.name=i.slice(1,h):s.base=s.name=i.slice(g,h)):(g===0&&f?(s.name=i.slice(1,y),s.base=i.slice(1,h)):(s.name=i.slice(g,y),s.base=i.slice(g,h)),s.ext=i.slice(y,h)),g>0?s.dir=i.slice(0,g-1):f&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return a.posix=a,Es=a,Es}function $n(t){throw new RangeError(IS[t])}function Um(t,e){let n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]);let a=(function(o,i){let s=[],l=o.length;for(;l--;)s[l]=i(o[l]);return s})((t=t.replace(kS,".")).split("."),e).join(".");return r+a}function qm(t){let e=[],n=0,r=t.length;for(;n<r;){let a=t.charCodeAt(n++);if(a>=55296&&a<=56319&&n<r){let o=t.charCodeAt(n++);(64512&o)==56320?e.push(((1023&a)<<10)+(1023&o)+65536):(e.push(a),n--)}else e.push(a)}return e}function CS(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function kt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function ei(t,e,n){if(t&&Zt.isObject(t)&&t instanceof kt)return t;var r=new kt;return r.parse(t,e,n),r}function jS(){if(Wm)return As;Wm=!0;var t=je;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function n(o,i){for(var s="",l=0,f=-1,p=0,y,g=0;g<=o.length;++g){if(g<o.length)y=o.charCodeAt(g);else{if(y===47)break;y=47}if(y===47){if(!(f===g-1||p===1))if(f!==g-1&&p===2){if(s.length<2||l!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var h=s.lastIndexOf("/");if(h!==s.length-1){h===-1?(s="",l=0):(s=s.slice(0,h),l=s.length-1-s.lastIndexOf("/")),f=g,p=0;continue}}else if(s.length===2||s.length===1){s="",l=0,f=g,p=0;continue}}i&&(s.length>0?s+="/..":s="..",l=2)}else s.length>0?s+="/"+o.slice(f+1,g):s=o.slice(f+1,g),l=g-f-1;f=g,p=0}else y===46&&p!==-1?++p:p=-1}return s}function r(o,i){var s=i.dir||i.root,l=i.base||(i.name||"")+(i.ext||"");return s?s===i.root?s+l:s+o+l:l}var a={resolve:function(){for(var i="",s=!1,l,f=arguments.length-1;f>=-1&&!s;f--){var p;f>=0?p=arguments[f]:(l===void 0&&(l=t.cwd()),p=l),e(p),p.length!==0&&(i=p+"/"+i,s=p.charCodeAt(0)===47)}return i=n(i,!s),s?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var s=i.charCodeAt(0)===47,l=i.charCodeAt(i.length-1)===47;return i=n(i,!s),i.length===0&&!s&&(i="."),i.length>0&&l&&(i+="/"),s?"/"+i:i},isAbsolute:function(i){return e(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,s=0;s<arguments.length;++s){var l=arguments[s];e(l),l.length>0&&(i===void 0?i=l:i+="/"+l)}return i===void 0?".":a.normalize(i)},relative:function(i,s){if(e(i),e(s),i===s||(i=a.resolve(i),s=a.resolve(s),i===s))return"";for(var l=1;l<i.length&&i.charCodeAt(l)===47;++l);for(var f=i.length,p=f-l,y=1;y<s.length&&s.charCodeAt(y)===47;++y);for(var g=s.length,h=g-y,w=p<h?p:h,P=-1,B=0;B<=w;++B){if(B===w){if(h>w){if(s.charCodeAt(y+B)===47)return s.slice(y+B+1);if(B===0)return s.slice(y+B)}else p>w&&(i.charCodeAt(l+B)===47?P=B:B===0&&(P=0));break}var v=i.charCodeAt(l+B),S=s.charCodeAt(y+B);if(v!==S)break;v===47&&(P=B)}var E="";for(B=l+P+1;B<=f;++B)(B===f||i.charCodeAt(B)===47)&&(E.length===0?E+="..":E+="/..");return E.length>0?E+s.slice(y+P):(y+=P,s.charCodeAt(y)===47&&++y,s.slice(y))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var s=i.charCodeAt(0),l=s===47,f=-1,p=!0,y=i.length-1;y>=1;--y)if(s=i.charCodeAt(y),s===47){if(!p){f=y;break}}else p=!1;return f===-1?l?"/":".":l&&f===1?"//":i.slice(0,f)},basename:function(i,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');e(i);var l=0,f=-1,p=!0,y;if(s!==void 0&&s.length>0&&s.length<=i.length){if(s.length===i.length&&s===i)return"";var g=s.length-1,h=-1;for(y=i.length-1;y>=0;--y){var w=i.charCodeAt(y);if(w===47){if(!p){l=y+1;break}}else h===-1&&(p=!1,h=y+1),g>=0&&(w===s.charCodeAt(g)?--g===-1&&(f=y):(g=-1,f=h))}return l===f?f=h:f===-1&&(f=i.length),i.slice(l,f)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!p){l=y+1;break}}else f===-1&&(p=!1,f=y+1);return f===-1?"":i.slice(l,f)}},extname:function(i){e(i);for(var s=-1,l=0,f=-1,p=!0,y=0,g=i.length-1;g>=0;--g){var h=i.charCodeAt(g);if(h===47){if(!p){l=g+1;break}continue}f===-1&&(p=!1,f=g+1),h===46?s===-1?s=g:y!==1&&(y=1):s!==-1&&(y=-1)}return s===-1||f===-1||y===0||y===1&&s===f-1&&s===l+1?"":i.slice(s,f)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return r("/",i)},parse:function(i){e(i);var s={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return s;var l=i.charCodeAt(0),f=l===47,p;f?(s.root="/",p=1):p=0;for(var y=-1,g=0,h=-1,w=!0,P=i.length-1,B=0;P>=p;--P){if(l=i.charCodeAt(P),l===47){if(!w){g=P+1;break}continue}h===-1&&(w=!1,h=P+1),l===46?y===-1?y=P:B!==1&&(B=1):y!==-1&&(B=-1)}return y===-1||h===-1||B===0||B===1&&y===h-1&&y===g+1?h!==-1&&(g===0&&f?s.base=s.name=i.slice(1,h):s.base=s.name=i.slice(g,h)):(g===0&&f?(s.name=i.slice(1,y),s.base=i.slice(1,h)):(s.name=i.slice(g,y),s.base=i.slice(g,h)),s.ext=i.slice(y,h)),g>0?s.dir=i.slice(0,g-1):f&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return a.posix=a,As=a,As}function QS(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Os?ek(t):tk(t)}function ek(t){let e=t.hostname,n=t.pathname;for(let r=0;r<n.length;r++)if(n[r]==="%"){let a=n.codePointAt(r+2)||32;if(n[r+1]==="2"&&a===102||n[r+1]==="5"&&a===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(n=n.replace(qS,"\\"),n=decodeURIComponent(n),e!=="")return`\\\\${e}${n}`;{let r=n.codePointAt(1)|32,a=n[2];if(r<WS||r>zS||a!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return n.slice(1)}}function tk(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let n=0;n<e.length;n++)if(e[n]==="%"){let r=e.codePointAt(n+2)||32;if(e[n+1]==="2"&&r===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function nk(t){let e=zm.resolve(t),n=t.charCodeAt(t.length-1);(n===FS||Os&&n===LS)&&e[e.length-1]!==zm.sep&&(e+="/");let r=new URL("file://");return e.includes("%")&&(e=e.replace(GS,"%25")),!Os&&e.includes("\\")&&(e=e.replace(VS,"%5C")),e.includes(`
|
|
11
|
+
`)&&(e=e.replace(JS,"%0A")),e.includes("\r")&&(e=e.replace(YS,"%0D")),e.includes(" ")&&(e=e.replace(XS,"%09")),r.pathname=e,r}function gk(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Rs?yk(t):mk(t)}function yk(t){let e=t.hostname,n=t.pathname;for(let r=0;r<n.length;r++)if(n[r]==="%"){let a=n.codePointAt(r+2)||32;if(n[r+1]==="2"&&a===102||n[r+1]==="5"&&a===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(n=n.replace(lk,"\\"),n=decodeURIComponent(n),e!=="")return`\\\\${e}${n}`;{let r=n.codePointAt(1)|32,a=n[2];if(r<ok||r>sk||a!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return n.slice(1)}}function mk(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let n=0;n<e.length;n++)if(e[n]==="%"){let r=e.codePointAt(n+2)||32;if(e[n+1]==="2"&&r===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function hk(t){let e=Hm.resolve(t),n=t.charCodeAt(t.length-1);(n===ak||Rs&&n===ik)&&e[e.length-1]!==Hm.sep&&(e+="/");let r=new URL("file://");return e.includes("%")&&(e=e.replace(uk,"%25")),!Rs&&e.includes("\\")&&(e=e.replace(ck,"%5C")),e.includes(`
|
|
12
|
+
`)&&(e=e.replace(fk,"%0A")),e.includes("\r")&&(e=e.replace(dk,"%0D")),e.includes(" ")&&(e=e.replace(pk,"%09")),r.pathname=e,r}var Es,Dm,Hm,dr,ES,SS,kS,IS,$t,Ss,Zm,Gm,$m,jm,AS,OS,Qr,RS,en,De,MS,Zt,NS,DS,HS,US,Cs,Km,Lm,Fm,ZS,$S,ks,fr,Is,As,Wm,zm,KS,LS,FS,WS,zS,Os,qS,GS,VS,JS,YS,XS,rk,ik,ak,ok,sk,Rs,lk,uk,ck,fk,dk,pk,Vm=ot(()=>{C();R();O();Ua();Bs();Es={},Dm=!1;Hm=BS(),dr=2147483647,ES=/^xn--/,SS=/[^\0-\x7E]/,kS=/[\x2E\u3002\uFF0E\uFF61]/g,IS={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},$t=Math.floor,Ss=String.fromCharCode;Zm=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Gm=function(t,e,n){let r=0;for(t=n?$t(t/700):t>>1,t+=$t(t/e);t>455;r+=36)t=$t(t/35);return $t(r+36*t/(t+38))},$m=function(t){let e=[],n=t.length,r=0,a=128,o=72,i=t.lastIndexOf("-");i<0&&(i=0);for(let l=0;l<i;++l)t.charCodeAt(l)>=128&&$n("not-basic"),e.push(t.charCodeAt(l));for(let l=i>0?i+1:0;l<n;){let f=r;for(let y=1,g=36;;g+=36){l>=n&&$n("invalid-input");let h=(s=t.charCodeAt(l++))-48<10?s-22:s-65<26?s-65:s-97<26?s-97:36;(h>=36||h>$t((dr-r)/y))&&$n("overflow"),r+=h*y;let w=g<=o?1:g>=o+26?26:g-o;if(h<w)break;let P=36-w;y>$t(dr/P)&&$n("overflow"),y*=P}let p=e.length+1;o=Gm(r-f,p,f==0),$t(r/p)>dr-a&&$n("overflow"),a+=$t(r/p),r%=p,e.splice(r++,0,a)}var s;return String.fromCodePoint(...e)},jm=function(t){let e=[],n=(t=qm(t)).length,r=128,a=0,o=72;for(let l of t)l<128&&e.push(Ss(l));let i=e.length,s=i;for(i&&e.push("-");s<n;){let l=dr;for(let p of t)p>=r&&p<l&&(l=p);let f=s+1;l-r>$t((dr-a)/f)&&$n("overflow"),a+=(l-r)*f,r=l;for(let p of t)if(p<r&&++a>dr&&$n("overflow"),p==r){let y=a;for(let g=36;;g+=36){let h=g<=o?1:g>=o+26?26:g-o;if(y<h)break;let w=y-h,P=36-h;e.push(Ss(Zm(h+w%P,0))),y=$t(w/P)}e.push(Ss(Zm(y,0))),o=Gm(a,f,s==i),a=0,++s}++a,++r}return e.join("")},AS={version:"2.1.0",ucs2:{decode:qm,encode:t=>String.fromCodePoint(...t)},decode:$m,encode:jm,toASCII:function(t){return Um(t,(function(e){return SS.test(e)?"xn--"+jm(e):e}))},toUnicode:function(t){return Um(t,(function(e){return ES.test(e)?$m(e.slice(4).toLowerCase()):e}))}};OS=function(t,e,n,r){e=e||"&",n=n||"=";var a={};if(typeof t!="string"||t.length===0)return a;var o=/\+/g;t=t.split(e);var i=1e3;r&&typeof r.maxKeys=="number"&&(i=r.maxKeys);var s=t.length;i>0&&s>i&&(s=i);for(var l=0;l<s;++l){var f,p,y,g,h=t[l].replace(o,"%20"),w=h.indexOf(n);w>=0?(f=h.substr(0,w),p=h.substr(w+1)):(f=h,p=""),y=decodeURIComponent(f),g=decodeURIComponent(p),CS(a,y)?Array.isArray(a[y])?a[y].push(g):a[y]=[a[y],g]:a[y]=g}return a},Qr=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},RS=function(t,e,n,r){return e=e||"&",n=n||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map((function(a){var o=encodeURIComponent(Qr(a))+n;return Array.isArray(t[a])?t[a].map((function(i){return o+encodeURIComponent(Qr(i))})).join(e):o+encodeURIComponent(Qr(t[a]))})).join(e):r?encodeURIComponent(Qr(r))+n+encodeURIComponent(Qr(t)):""},en={};en.decode=en.parse=OS,en.encode=en.stringify=RS;en.decode;en.encode;en.parse;en.stringify;De={},MS=AS,Zt={isString:function(t){return typeof t=="string"},isObject:function(t){return typeof t=="object"&&t!==null},isNull:function(t){return t===null},isNullOrUndefined:function(t){return t==null}};De.parse=ei,De.resolve=function(t,e){return ei(t,!1,!0).resolve(e)},De.resolveObject=function(t,e){return t?ei(t,!1,!0).resolveObject(e):e},De.format=function(t){return Zt.isString(t)&&(t=ei(t)),t instanceof kt?t.format():kt.prototype.format.call(t)},De.Url=kt;NS=/^([a-z0-9.+-]+:)/i,DS=/:[0-9]*$/,HS=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,US=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
|
|
13
|
+
`," "]),Cs=["'"].concat(US),Km=["%","/","?",";","#"].concat(Cs),Lm=["/","?","#"],Fm=/^[+a-z0-9A-Z_-]{0,63}$/,ZS=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,$S={javascript:!0,"javascript:":!0},ks={javascript:!0,"javascript:":!0},fr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Is=en;kt.prototype.parse=function(t,e,n){if(!Zt.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),a=r!==-1&&r<t.indexOf("#")?"?":"#",o=t.split(a);o[0]=o[0].replace(/\\/g,"/");var i=t=o.join(a);if(i=i.trim(),!n&&t.split("#").length===1){var s=HS.exec(i);if(s)return this.path=i,this.href=i,this.pathname=s[1],s[2]?(this.search=s[2],this.query=e?Is.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var l=NS.exec(i);if(l){var f=(l=l[0]).toLowerCase();this.protocol=f,i=i.substr(l.length)}if(n||l||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var p=i.substr(0,2)==="//";!p||l&&ks[l]||(i=i.substr(2),this.slashes=!0)}if(!ks[l]&&(p||l&&!fr[l])){for(var y,g,h=-1,w=0;w<Lm.length;w++)(P=i.indexOf(Lm[w]))!==-1&&(h===-1||P<h)&&(h=P);for((g=h===-1?i.lastIndexOf("@"):i.lastIndexOf("@",h))!==-1&&(y=i.slice(0,g),i=i.slice(g+1),this.auth=decodeURIComponent(y)),h=-1,w=0;w<Km.length;w++){var P;(P=i.indexOf(Km[w]))!==-1&&(h===-1||P<h)&&(h=P)}h===-1&&(h=i.length),this.host=i.slice(0,h),i=i.slice(h),this.parseHost(),this.hostname=this.hostname||"";var B=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!B)for(var v=this.hostname.split(/\./),S=(w=0,v.length);w<S;w++){var E=v[w];if(E&&!E.match(Fm)){for(var H="",K=0,ae=E.length;K<ae;K++)E.charCodeAt(K)>127?H+="x":H+=E[K];if(!H.match(Fm)){var ee=v.slice(0,w),ge=v.slice(w+1),oe=E.match(ZS);oe&&(ee.push(oe[1]),ge.unshift(oe[2])),ge.length&&(i="/"+ge.join(".")+i),this.hostname=ee.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=MS.toASCII(this.hostname));var re=this.port?":"+this.port:"",Oe=this.hostname||"";this.host=Oe+re,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),i[0]!=="/"&&(i="/"+i))}if(!$S[f])for(w=0,S=Cs.length;w<S;w++){var ze=Cs[w];if(i.indexOf(ze)!==-1){var tt=encodeURIComponent(ze);tt===ze&&(tt=escape(ze)),i=i.split(ze).join(tt)}}var Ve=i.indexOf("#");Ve!==-1&&(this.hash=i.substr(Ve),i=i.slice(0,Ve));var Je=i.indexOf("?");if(Je!==-1?(this.search=i.substr(Je),this.query=i.substr(Je+1),e&&(this.query=Is.parse(this.query)),i=i.slice(0,Je)):e&&(this.search="",this.query={}),i&&(this.pathname=i),fr[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){re=this.pathname||"";var ht=this.search||"";this.path=re+ht}return this.href=this.format(),this},kt.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",n=this.pathname||"",r=this.hash||"",a=!1,o="";this.host?a=t+this.host:this.hostname&&(a=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(a+=":"+this.port)),this.query&&Zt.isObject(this.query)&&Object.keys(this.query).length&&(o=Is.stringify(this.query));var i=this.search||o&&"?"+o||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||fr[e])&&a!==!1?(a="//"+(a||""),n&&n.charAt(0)!=="/"&&(n="/"+n)):a||(a=""),r&&r.charAt(0)!=="#"&&(r="#"+r),i&&i.charAt(0)!=="?"&&(i="?"+i),e+a+(n=n.replace(/[?#]/g,(function(s){return encodeURIComponent(s)})))+(i=i.replace("#","%23"))+r},kt.prototype.resolve=function(t){return this.resolveObject(ei(t,!1,!0)).format()},kt.prototype.resolveObject=function(t){if(Zt.isString(t)){var e=new kt;e.parse(t,!1,!0),t=e}for(var n=new kt,r=Object.keys(this),a=0;a<r.length;a++){var o=r[a];n[o]=this[o]}if(n.hash=t.hash,t.href==="")return n.href=n.format(),n;if(t.slashes&&!t.protocol){for(var i=Object.keys(t),s=0;s<i.length;s++){var l=i[s];l!=="protocol"&&(n[l]=t[l])}return fr[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!fr[t.protocol]){for(var f=Object.keys(t),p=0;p<f.length;p++){var y=f[p];n[y]=t[y]}return n.href=n.format(),n}if(n.protocol=t.protocol,t.host||ks[t.protocol])n.pathname=t.pathname;else{for(var g=(t.pathname||"").split("/");g.length&&!(t.host=g.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),g[0]!==""&&g.unshift(""),g.length<2&&g.unshift(""),n.pathname=g.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var h=n.pathname||"",w=n.search||"";n.path=h+w}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var P=n.pathname&&n.pathname.charAt(0)==="/",B=t.host||t.pathname&&t.pathname.charAt(0)==="/",v=B||P||n.host&&t.pathname,S=v,E=n.pathname&&n.pathname.split("/")||[],H=(g=t.pathname&&t.pathname.split("/")||[],n.protocol&&!fr[n.protocol]);if(H&&(n.hostname="",n.port=null,n.host&&(E[0]===""?E[0]=n.host:E.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(g[0]===""?g[0]=t.host:g.unshift(t.host)),t.host=null),v=v&&(g[0]===""||E[0]==="")),B)n.host=t.host||t.host===""?t.host:n.host,n.hostname=t.hostname||t.hostname===""?t.hostname:n.hostname,n.search=t.search,n.query=t.query,E=g;else if(g.length)E||(E=[]),E.pop(),E=E.concat(g),n.search=t.search,n.query=t.query;else if(!Zt.isNullOrUndefined(t.search))return H&&(n.hostname=n.host=E.shift(),(oe=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=oe.shift(),n.host=n.hostname=oe.shift())),n.search=t.search,n.query=t.query,Zt.isNull(n.pathname)&&Zt.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!E.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var K=E.slice(-1)[0],ae=(n.host||t.host||E.length>1)&&(K==="."||K==="..")||K==="",ee=0,ge=E.length;ge>=0;ge--)(K=E[ge])==="."?E.splice(ge,1):K===".."?(E.splice(ge,1),ee++):ee&&(E.splice(ge,1),ee--);if(!v&&!S)for(;ee--;ee)E.unshift("..");!v||E[0]===""||E[0]&&E[0].charAt(0)==="/"||E.unshift(""),ae&&E.join("/").substr(-1)!=="/"&&E.push("");var oe,re=E[0]===""||E[0]&&E[0].charAt(0)==="/";return H&&(n.hostname=n.host=re?"":E.length?E.shift():"",(oe=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=oe.shift(),n.host=n.hostname=oe.shift())),(v=v||n.host&&E.length)&&!re&&E.unshift(""),E.length?n.pathname=E.join("/"):(n.pathname=null,n.path=null),Zt.isNull(n.pathname)&&Zt.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},kt.prototype.parseHost=function(){var t=this.host,e=DS.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};De.Url;De.format;De.resolve;De.resolveObject;As={},Wm=!1;zm=jS(),KS=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;De.URL=typeof URL<"u"?URL:null;De.pathToFileURL=nk;De.fileURLToPath=QS;De.Url;De.format;De.resolve;De.resolveObject;De.URL;LS=92,FS=47,WS=97,zS=122,Os=KS==="win32",qS=/\//g,GS=/%/g,VS=/\\/g,JS=/\n/g,YS=/\r/g,XS=/\t/g;rk=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;De.URL=typeof URL<"u"?URL:null;De.pathToFileURL=hk;De.fileURLToPath=gk;De.Url;De.format;De.resolve;De.resolveObject;De.parse;De.URL;ik=92,ak=47,ok=97,sk=122,Rs=rk==="win32",lk=/\//g,uk=/%/g,ck=/\\/g,fk=/\n/g,dk=/\r/g,pk=/\t/g});var kh={};Ln(kh,{Agent:()=>kk,ClientRequest:()=>Ik,IncomingMessage:()=>Ak,METHODS:()=>Ck,STATUS_CODES:()=>Ok,default:()=>tn,get:()=>Rk,globalAgent:()=>Mk,request:()=>Nk});function Th(){if(Jm)return Bt;Jm=!0,Bt.fetch=r(jn.fetch)&&r(jn.ReadableStream),Bt.writableStream=r(jn.WritableStream),Bt.abortController=r(jn.AbortController);var t;function e(){if(t!==void 0)return t;if(jn.XMLHttpRequest){t=new jn.XMLHttpRequest;try{t.open("GET",jn.XDomainRequest?"/":"https://example.com")}catch{t=null}}else t=null;return t}function n(a){var o=e();if(!o)return!1;try{return o.responseType=a,o.responseType===a}catch{}return!1}Bt.arraybuffer=Bt.fetch||n("arraybuffer"),Bt.msstream=!Bt.fetch&&n("ms-stream"),Bt.mozchunkedarraybuffer=!Bt.fetch&&n("moz-chunked-arraybuffer"),Bt.overrideMimeType=Bt.fetch||(e()?r(e().overrideMimeType):!1);function r(a){return typeof a=="function"}return t=null,Bt}function _h(){return Ym||(Ym=!0,Ms=_t.EventEmitter),Ms}function vk(){if(Xm)return Ns;Xm=!0;function t(w,P){var B=Object.keys(w);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(w);P&&(v=v.filter(function(S){return Object.getOwnPropertyDescriptor(w,S).enumerable})),B.push.apply(B,v)}return B}function e(w){for(var P=1;P<arguments.length;P++){var B=arguments[P]!=null?arguments[P]:{};P%2?t(Object(B),!0).forEach(function(v){n(w,v,B[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(B)):t(Object(B)).forEach(function(v){Object.defineProperty(w,v,Object.getOwnPropertyDescriptor(B,v))})}return w}function n(w,P,B){return P=i(P),P in w?Object.defineProperty(w,P,{value:B,enumerable:!0,configurable:!0,writable:!0}):w[P]=B,w}function r(w,P){if(!(w instanceof P))throw new TypeError("Cannot call a class as a function")}function a(w,P){for(var B=0;B<P.length;B++){var v=P[B];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(w,i(v.key),v)}}function o(w,P,B){return P&&a(w.prototype,P),Object.defineProperty(w,"prototype",{writable:!1}),w}function i(w){var P=s(w,"string");return typeof P=="symbol"?P:String(P)}function s(w,P){if(typeof w!="object"||w===null)return w;var B=w[Symbol.toPrimitive];if(B!==void 0){var v=B.call(w,P||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(w)}var l=Dt(),f=l.Buffer,p=L,y=p.inspect,g=y&&y.custom||"inspect";function h(w,P,B){f.prototype.copy.call(w,P,B)}return Ns=(function(){function w(){r(this,w),this.head=null,this.tail=null,this.length=0}return o(w,[{key:"push",value:function(B){var v={data:B,next:null};this.length>0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(B){var v={data:B,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var B=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,B}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(B){if(this.length===0)return"";for(var v=this.head,S=""+v.data;v=v.next;)S+=B+v.data;return S}},{key:"concat",value:function(B){if(this.length===0)return f.alloc(0);for(var v=f.allocUnsafe(B>>>0),S=this.head,E=0;S;)h(S.data,v,E),E+=S.data.length,S=S.next;return v}},{key:"consume",value:function(B,v){var S;return B<this.head.data.length?(S=this.head.data.slice(0,B),this.head.data=this.head.data.slice(B)):B===this.head.data.length?S=this.shift():S=v?this._getString(B):this._getBuffer(B),S}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(B){var v=this.head,S=1,E=v.data;for(B-=E.length;v=v.next;){var H=v.data,K=B>H.length?H.length:B;if(K===H.length?E+=H:E+=H.slice(0,B),B-=K,B===0){K===H.length?(++S,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=H.slice(K));break}++S}return this.length-=S,E}},{key:"_getBuffer",value:function(B){var v=f.allocUnsafe(B),S=this.head,E=1;for(S.data.copy(v),B-=S.data.length;S=S.next;){var H=S.data,K=B>H.length?H.length:B;if(H.copy(v,v.length-B,0,K),B-=K,B===0){K===H.length?(++E,S.next?this.head=S.next:this.head=this.tail=null):(this.head=S,S.data=H.slice(K));break}++E}return this.length-=E,v}},{key:g,value:function(B,v){return y(this,e(e({},v),{},{depth:0,customInspect:!1}))}}]),w})(),Ns}function bh(){if(Qm)return Ds;Qm=!0;var t=Rt;function e(s,l){var f=this,p=this._readableState&&this._readableState.destroyed,y=this._writableState&&this._writableState.destroyed;return p||y?(l?l(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(o,this,s)):t.nextTick(o,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(g){!l&&g?f._writableState?f._writableState.errorEmitted?t.nextTick(r,f):(f._writableState.errorEmitted=!0,t.nextTick(n,f,g)):t.nextTick(n,f,g):l?(t.nextTick(r,f),l(g)):t.nextTick(r,f)}),this)}function n(s,l){o(s,l),r(s)}function r(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function a(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(s,l){s.emit("error",l)}function i(s,l){var f=s._readableState,p=s._writableState;f&&f.autoDestroy||p&&p.autoDestroy?s.destroy(l):s.emit("error",l)}return Ds={destroy:e,undestroy:a,errorOrDestroy:i},Ds}function gr(){if(eh)return Hs;eh=!0;let t={};function e(i,s,l){l||(l=Error);function f(y,g,h){return typeof s=="string"?s:s(y,g,h)}class p extends l{constructor(g,h,w){super(f(g,h,w))}}p.prototype.name=l.name,p.prototype.code=i,t[i]=p}function n(i,s){if(Array.isArray(i)){let l=i.length;return i=i.map(f=>String(f)),l>2?`one of ${s} ${i.slice(0,l-1).join(", ")}, or `+i[l-1]:l===2?`one of ${s} ${i[0]} or ${i[1]}`:`of ${s} ${i[0]}`}else return`of ${s} ${String(i)}`}function r(i,s,l){return i.substr(0,s.length)===s}function a(i,s,l){return(l===void 0||l>i.length)&&(l=i.length),i.substring(l-s.length,l)===s}function o(i,s,l){return typeof l!="number"&&(l=0),l+s.length>i.length?!1:i.indexOf(s,l)!==-1}return e("ERR_INVALID_OPT_VALUE",function(i,s){return'The value "'+s+'" is invalid for option "'+i+'"'},TypeError),e("ERR_INVALID_ARG_TYPE",function(i,s,l){let f;typeof s=="string"&&r(s,"not ")?(f="must not be",s=s.replace(/^not /,"")):f="must be";let p;if(a(i," argument"))p=`The ${i} ${f} ${n(s,"type")}`;else{let y=o(i,".")?"property":"argument";p=`The "${i}" ${y} ${f} ${n(s,"type")}`}return p+=`. Received type ${typeof l}`,p},TypeError),e("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),e("ERR_METHOD_NOT_IMPLEMENTED",function(i){return"The "+i+" method is not implemented"}),e("ERR_STREAM_PREMATURE_CLOSE","Premature close"),e("ERR_STREAM_DESTROYED",function(i){return"Cannot call "+i+" after a stream was destroyed"}),e("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),e("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),e("ERR_STREAM_WRITE_AFTER_END","write after end"),e("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),e("ERR_UNKNOWN_ENCODING",function(i){return"Unknown encoding: "+i},TypeError),e("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Hs.codes=t,Hs}function wh(){if(th)return Us;th=!0;var t=gr().codes.ERR_INVALID_OPT_VALUE;function e(r,a,o){return r.highWaterMark!=null?r.highWaterMark:a?r[o]:null}function n(r,a,o,i){var s=e(a,i,o);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var l=i?o:"highWaterMark";throw new t(l,s)}return Math.floor(s)}return r.objectMode?16:16*1024}return Us={getHighWaterMark:n},Us}function xh(){if(nh)return Zs;nh=!0;var t=Rt;Zs=oe;function e(A){var k=this;this.next=null,this.entry=null,this.finish=function(){Te(k,A)}}var n;oe.WritableState=ee;var r={deprecate:Am()},a=_h(),o=Dt().Buffer,i=(typeof rh<"u"?rh:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(A){return o.from(A)}function l(A){return o.isBuffer(A)||A instanceof i}var f=bh(),p=wh(),y=p.getHighWaterMark,g=gr().codes,h=g.ERR_INVALID_ARG_TYPE,w=g.ERR_METHOD_NOT_IMPLEMENTED,P=g.ERR_MULTIPLE_CALLBACK,B=g.ERR_STREAM_CANNOT_PIPE,v=g.ERR_STREAM_DESTROYED,S=g.ERR_STREAM_NULL_VALUES,E=g.ERR_STREAM_WRITE_AFTER_END,H=g.ERR_UNKNOWN_ENCODING,K=f.errorOrDestroy;Ht()(oe,a);function ae(){}function ee(A,k,$){n=n||pr(),A=A||{},typeof $!="boolean"&&($=k instanceof n),this.objectMode=!!A.objectMode,$&&(this.objectMode=this.objectMode||!!A.writableObjectMode),this.highWaterMark=y(this,A,"writableHighWaterMark",$),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Y=A.decodeStrings===!1;this.decodeStrings=!Y,this.defaultEncoding=A.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ie){Ue(k,ie)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=A.emitClose!==!1,this.autoDestroy=!!A.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}ee.prototype.getBuffer=function(){for(var k=this.bufferedRequest,$=[];k;)$.push(k),k=k.next;return $},(function(){try{Object.defineProperty(ee.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var ge;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ge=Function.prototype[Symbol.hasInstance],Object.defineProperty(oe,Symbol.hasInstance,{value:function(k){return ge.call(this,k)?!0:this!==oe?!1:k&&k._writableState instanceof ee}})):ge=function(k){return k instanceof this};function oe(A){n=n||pr();var k=this instanceof n;if(!k&&!ge.call(oe,this))return new oe(A);this._writableState=new ee(A,this,k),this.writable=!0,A&&(typeof A.write=="function"&&(this._write=A.write),typeof A.writev=="function"&&(this._writev=A.writev),typeof A.destroy=="function"&&(this._destroy=A.destroy),typeof A.final=="function"&&(this._final=A.final)),a.call(this)}oe.prototype.pipe=function(){K(this,new B)};function re(A,k){var $=new E;K(A,$),t.nextTick(k,$)}function Oe(A,k,$,Y){var ie;return $===null?ie=new S:typeof $!="string"&&!k.objectMode&&(ie=new h("chunk",["string","Buffer"],$)),ie?(K(A,ie),t.nextTick(Y,ie),!1):!0}oe.prototype.write=function(A,k,$){var Y=this._writableState,ie=!1,b=!Y.objectMode&&l(A);return b&&!o.isBuffer(A)&&(A=s(A)),typeof k=="function"&&($=k,k=null),b?k="buffer":k||(k=Y.defaultEncoding),typeof $!="function"&&($=ae),Y.ending?re(this,$):(b||Oe(this,Y,A,$))&&(Y.pendingcb++,ie=tt(this,Y,b,A,k,$)),ie},oe.prototype.cork=function(){this._writableState.corked++},oe.prototype.uncork=function(){var A=this._writableState;A.corked&&(A.corked--,!A.writing&&!A.corked&&!A.bufferProcessing&&A.bufferedRequest&&fe(this,A))},oe.prototype.setDefaultEncoding=function(k){if(typeof k=="string"&&(k=k.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((k+"").toLowerCase())>-1))throw new H(k);return this._writableState.defaultEncoding=k,this},Object.defineProperty(oe.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ze(A,k,$){return!A.objectMode&&A.decodeStrings!==!1&&typeof k=="string"&&(k=o.from(k,$)),k}Object.defineProperty(oe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function tt(A,k,$,Y,ie,b){if(!$){var x=ze(k,Y,ie);Y!==x&&($=!0,ie="buffer",Y=x)}var z=k.objectMode?1:Y.length;k.length+=z;var Q=k.length<k.highWaterMark;if(Q||(k.needDrain=!0),k.writing||k.corked){var Me=k.lastBufferedRequest;k.lastBufferedRequest={chunk:Y,encoding:ie,isBuf:$,callback:b,next:null},Me?Me.next=k.lastBufferedRequest:k.bufferedRequest=k.lastBufferedRequest,k.bufferedRequestCount+=1}else Ve(A,k,!1,z,Y,ie,b);return Q}function Ve(A,k,$,Y,ie,b,x){k.writelen=Y,k.writecb=x,k.writing=!0,k.sync=!0,k.destroyed?k.onwrite(new v("write")):$?A._writev(ie,k.onwrite):A._write(ie,b,k.onwrite),k.sync=!1}function Je(A,k,$,Y,ie){--k.pendingcb,$?(t.nextTick(ie,Y),t.nextTick(F,A,k),A._writableState.errorEmitted=!0,K(A,Y)):(ie(Y),A._writableState.errorEmitted=!0,K(A,Y),F(A,k))}function ht(A){A.writing=!1,A.writecb=null,A.length-=A.writelen,A.writelen=0}function Ue(A,k){var $=A._writableState,Y=$.sync,ie=$.writecb;if(typeof ie!="function")throw new P;if(ht($),k)Je(A,$,Y,k,ie);else{var b=ve($)||A.destroyed;!b&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest&&fe(A,$),Y?t.nextTick(Pe,A,$,b,ie):Pe(A,$,b,ie)}}function Pe(A,k,$,Y){$||Se(A,k),k.pendingcb--,Y(),F(A,k)}function Se(A,k){k.length===0&&k.needDrain&&(k.needDrain=!1,A.emit("drain"))}function fe(A,k){k.bufferProcessing=!0;var $=k.bufferedRequest;if(A._writev&&$&&$.next){var Y=k.bufferedRequestCount,ie=new Array(Y),b=k.corkedRequestsFree;b.entry=$;for(var x=0,z=!0;$;)ie[x]=$,$.isBuf||(z=!1),$=$.next,x+=1;ie.allBuffers=z,Ve(A,k,!0,k.length,ie,"",b.finish),k.pendingcb++,k.lastBufferedRequest=null,b.next?(k.corkedRequestsFree=b.next,b.next=null):k.corkedRequestsFree=new e(k),k.bufferedRequestCount=0}else{for(;$;){var Q=$.chunk,Me=$.encoding,_e=$.callback,Z=k.objectMode?1:Q.length;if(Ve(A,k,!1,Z,Q,Me,_e),$=$.next,k.bufferedRequestCount--,k.writing)break}$===null&&(k.lastBufferedRequest=null)}k.bufferedRequest=$,k.bufferProcessing=!1}oe.prototype._write=function(A,k,$){$(new w("_write()"))},oe.prototype._writev=null,oe.prototype.end=function(A,k,$){var Y=this._writableState;return typeof A=="function"?($=A,A=null,k=null):typeof k=="function"&&($=k,k=null),A!=null&&this.write(A,k),Y.corked&&(Y.corked=1,this.uncork()),Y.ending||de(this,Y,$),this},Object.defineProperty(oe.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ve(A){return A.ending&&A.length===0&&A.bufferedRequest===null&&!A.finished&&!A.writing}function D(A,k){A._final(function($){k.pendingcb--,$&&K(A,$),k.prefinished=!0,A.emit("prefinish"),F(A,k)})}function j(A,k){!k.prefinished&&!k.finalCalled&&(typeof A._final=="function"&&!k.destroyed?(k.pendingcb++,k.finalCalled=!0,t.nextTick(D,A,k)):(k.prefinished=!0,A.emit("prefinish")))}function F(A,k){var $=ve(k);if($&&(j(A,k),k.pendingcb===0&&(k.finished=!0,A.emit("finish"),k.autoDestroy))){var Y=A._readableState;(!Y||Y.autoDestroy&&Y.endEmitted)&&A.destroy()}return $}function de(A,k,$){k.ending=!0,F(A,k),$&&(k.finished?t.nextTick($):A.once("finish",$)),k.ended=!0,A.writable=!1}function Te(A,k,$){var Y=A.entry;for(A.entry=null;Y;){var ie=Y.callback;k.pendingcb--,ie($),Y=Y.next}k.corkedRequestsFree.next=A}return Object.defineProperty(oe.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(k){this._writableState&&(this._writableState.destroyed=k)}}),oe.prototype.destroy=f.destroy,oe.prototype._undestroy=f.undestroy,oe.prototype._destroy=function(A,k){k(A)},Zs}function pr(){if(ih)return $s;ih=!0;var t=Rt,e=Object.keys||function(p){var y=[];for(var g in p)y.push(g);return y};$s=s;var n=Ph(),r=xh();Ht()(s,n);for(var a=e(r.prototype),o=0;o<a.length;o++){var i=a[o];s.prototype[i]||(s.prototype[i]=r.prototype[i])}function s(p){if(!(this instanceof s))return new s(p);n.call(this,p),r.call(this,p),this.allowHalfOpen=!0,p&&(p.readable===!1&&(this.readable=!1),p.writable===!1&&(this.writable=!1),p.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",l)))}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function l(){this._writableState.ended||t.nextTick(f,this)}function f(p){p.end()}return Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(y){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=y,this._writableState.destroyed=y)}}),$s}function Xs(){if(ah)return js;ah=!0;var t=gr().codes.ERR_STREAM_PREMATURE_CLOSE;function e(o){var i=!1;return function(){if(!i){i=!0;for(var s=arguments.length,l=new Array(s),f=0;f<s;f++)l[f]=arguments[f];o.apply(this,l)}}}function n(){}function r(o){return o.setHeader&&typeof o.abort=="function"}function a(o,i,s){if(typeof i=="function")return a(o,null,i);i||(i={}),s=e(s||n);var l=i.readable||i.readable!==!1&&o.readable,f=i.writable||i.writable!==!1&&o.writable,p=function(){o.writable||g()},y=o._writableState&&o._writableState.finished,g=function(){f=!1,y=!0,l||s.call(o)},h=o._readableState&&o._readableState.endEmitted,w=function(){l=!1,h=!0,f||s.call(o)},P=function(E){s.call(o,E)},B=function(){var E;if(l&&!h)return(!o._readableState||!o._readableState.ended)&&(E=new t),s.call(o,E);if(f&&!y)return(!o._writableState||!o._writableState.ended)&&(E=new t),s.call(o,E)},v=function(){o.req.on("finish",g)};return r(o)?(o.on("complete",g),o.on("abort",B),o.req?v():o.on("request",v)):f&&!o._writableState&&(o.on("end",p),o.on("close",p)),o.on("end",w),o.on("finish",g),i.error!==!1&&o.on("error",P),o.on("close",B),function(){o.removeListener("complete",g),o.removeListener("abort",B),o.removeListener("request",v),o.req&&o.req.removeListener("finish",g),o.removeListener("end",p),o.removeListener("close",p),o.removeListener("finish",g),o.removeListener("end",w),o.removeListener("error",P),o.removeListener("close",B)}}return js=a,js}function Tk(){if(oh)return Ks;oh=!0;var t=Rt,e;function n(H,K,ae){return K=r(K),K in H?Object.defineProperty(H,K,{value:ae,enumerable:!0,configurable:!0,writable:!0}):H[K]=ae,H}function r(H){var K=a(H,"string");return typeof K=="symbol"?K:String(K)}function a(H,K){if(typeof H!="object"||H===null)return H;var ae=H[Symbol.toPrimitive];if(ae!==void 0){var ee=ae.call(H,K||"default");if(typeof ee!="object")return ee;throw new TypeError("@@toPrimitive must return a primitive value.")}return(K==="string"?String:Number)(H)}var o=Xs(),i=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),f=Symbol("ended"),p=Symbol("lastPromise"),y=Symbol("handlePromise"),g=Symbol("stream");function h(H,K){return{value:H,done:K}}function w(H){var K=H[i];if(K!==null){var ae=H[g].read();ae!==null&&(H[p]=null,H[i]=null,H[s]=null,K(h(ae,!1)))}}function P(H){t.nextTick(w,H)}function B(H,K){return function(ae,ee){H.then(function(){if(K[f]){ae(h(void 0,!0));return}K[y](ae,ee)},ee)}}var v=Object.getPrototypeOf(function(){}),S=Object.setPrototypeOf((e={get stream(){return this[g]},next:function(){var K=this,ae=this[l];if(ae!==null)return Promise.reject(ae);if(this[f])return Promise.resolve(h(void 0,!0));if(this[g].destroyed)return new Promise(function(re,Oe){t.nextTick(function(){K[l]?Oe(K[l]):re(h(void 0,!0))})});var ee=this[p],ge;if(ee)ge=new Promise(B(ee,this));else{var oe=this[g].read();if(oe!==null)return Promise.resolve(h(oe,!1));ge=new Promise(this[y])}return this[p]=ge,ge}},n(e,Symbol.asyncIterator,function(){return this}),n(e,"return",function(){var K=this;return new Promise(function(ae,ee){K[g].destroy(null,function(ge){if(ge){ee(ge);return}ae(h(void 0,!0))})})}),e),v),E=function(K){var ae,ee=Object.create(S,(ae={},n(ae,g,{value:K,writable:!0}),n(ae,i,{value:null,writable:!0}),n(ae,s,{value:null,writable:!0}),n(ae,l,{value:null,writable:!0}),n(ae,f,{value:K._readableState.endEmitted,writable:!0}),n(ae,y,{value:function(oe,re){var Oe=ee[g].read();Oe?(ee[p]=null,ee[i]=null,ee[s]=null,oe(h(Oe,!1))):(ee[i]=oe,ee[s]=re)},writable:!0}),ae));return ee[p]=null,o(K,function(ge){if(ge&&ge.code!=="ERR_STREAM_PREMATURE_CLOSE"){var oe=ee[s];oe!==null&&(ee[p]=null,ee[i]=null,ee[s]=null,oe(ge)),ee[l]=ge;return}var re=ee[i];re!==null&&(ee[p]=null,ee[i]=null,ee[s]=null,re(h(void 0,!0))),ee[f]=!0}),K.on("readable",P.bind(null,ee)),ee};return Ks=E,Ks}function _k(){return sh||(sh=!0,Ls=function(){throw new Error("Readable.from is not available in the browser")}),Ls}function Ph(){if(lh)return Fs;lh=!0;var t=Rt;Fs=re;var e;re.ReadableState=oe,_t.EventEmitter;var n=function(x,z){return x.listeners(z).length},r=_h(),a=Dt().Buffer,o=(typeof uh<"u"?uh:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(b){return a.from(b)}function s(b){return a.isBuffer(b)||b instanceof o}var l=L,f;l&&l.debuglog?f=l.debuglog("stream"):f=function(){};var p=vk(),y=bh(),g=wh(),h=g.getHighWaterMark,w=gr().codes,P=w.ERR_INVALID_ARG_TYPE,B=w.ERR_STREAM_PUSH_AFTER_EOF,v=w.ERR_METHOD_NOT_IMPLEMENTED,S=w.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,E,H,K;Ht()(re,r);var ae=y.errorOrDestroy,ee=["error","close","destroy","pause","resume"];function ge(b,x,z){if(typeof b.prependListener=="function")return b.prependListener(x,z);!b._events||!b._events[x]?b.on(x,z):Array.isArray(b._events[x])?b._events[x].unshift(z):b._events[x]=[z,b._events[x]]}function oe(b,x,z){e=e||pr(),b=b||{},typeof z!="boolean"&&(z=x instanceof e),this.objectMode=!!b.objectMode,z&&(this.objectMode=this.objectMode||!!b.readableObjectMode),this.highWaterMark=h(this,b,"readableHighWaterMark",z),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=b.emitClose!==!1,this.autoDestroy=!!b.autoDestroy,this.destroyed=!1,this.defaultEncoding=b.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,b.encoding&&(E||(E=Xr.StringDecoder),this.decoder=new E(b.encoding),this.encoding=b.encoding)}function re(b){if(e=e||pr(),!(this instanceof re))return new re(b);var x=this instanceof e;this._readableState=new oe(b,this,x),this.readable=!0,b&&(typeof b.read=="function"&&(this._read=b.read),typeof b.destroy=="function"&&(this._destroy=b.destroy)),r.call(this)}Object.defineProperty(re.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(x){this._readableState&&(this._readableState.destroyed=x)}}),re.prototype.destroy=y.destroy,re.prototype._undestroy=y.undestroy,re.prototype._destroy=function(b,x){x(b)},re.prototype.push=function(b,x){var z=this._readableState,Q;return z.objectMode?Q=!0:typeof b=="string"&&(x=x||z.defaultEncoding,x!==z.encoding&&(b=a.from(b,x),x=""),Q=!0),Oe(this,b,x,!1,Q)},re.prototype.unshift=function(b){return Oe(this,b,null,!0,!1)};function Oe(b,x,z,Q,Me){f("readableAddChunk",x);var _e=b._readableState;if(x===null)_e.reading=!1,Ue(b,_e);else{var Z;if(Me||(Z=tt(_e,x)),Z)ae(b,Z);else if(_e.objectMode||x&&x.length>0)if(typeof x!="string"&&!_e.objectMode&&Object.getPrototypeOf(x)!==a.prototype&&(x=i(x)),Q)_e.endEmitted?ae(b,new S):ze(b,_e,x,!0);else if(_e.ended)ae(b,new B);else{if(_e.destroyed)return!1;_e.reading=!1,_e.decoder&&!z?(x=_e.decoder.write(x),_e.objectMode||x.length!==0?ze(b,_e,x,!1):fe(b,_e)):ze(b,_e,x,!1)}else Q||(_e.reading=!1,fe(b,_e))}return!_e.ended&&(_e.length<_e.highWaterMark||_e.length===0)}function ze(b,x,z,Q){x.flowing&&x.length===0&&!x.sync?(x.awaitDrain=0,b.emit("data",z)):(x.length+=x.objectMode?1:z.length,Q?x.buffer.unshift(z):x.buffer.push(z),x.needReadable&&Pe(b)),fe(b,x)}function tt(b,x){var z;return!s(x)&&typeof x!="string"&&x!==void 0&&!b.objectMode&&(z=new P("chunk",["string","Buffer","Uint8Array"],x)),z}re.prototype.isPaused=function(){return this._readableState.flowing===!1},re.prototype.setEncoding=function(b){E||(E=Xr.StringDecoder);var x=new E(b);this._readableState.decoder=x,this._readableState.encoding=this._readableState.decoder.encoding;for(var z=this._readableState.buffer.head,Q="";z!==null;)Q+=x.write(z.data),z=z.next;return this._readableState.buffer.clear(),Q!==""&&this._readableState.buffer.push(Q),this._readableState.length=Q.length,this};var Ve=1073741824;function Je(b){return b>=Ve?b=Ve:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}function ht(b,x){return b<=0||x.length===0&&x.ended?0:x.objectMode?1:b!==b?x.flowing&&x.length?x.buffer.head.data.length:x.length:(b>x.highWaterMark&&(x.highWaterMark=Je(b)),b<=x.length?b:x.ended?x.length:(x.needReadable=!0,0))}re.prototype.read=function(b){f("read",b),b=parseInt(b,10);var x=this._readableState,z=b;if(b!==0&&(x.emittedReadable=!1),b===0&&x.needReadable&&((x.highWaterMark!==0?x.length>=x.highWaterMark:x.length>0)||x.ended))return f("read: emitReadable",x.length,x.ended),x.length===0&&x.ended?$(this):Pe(this),null;if(b=ht(b,x),b===0&&x.ended)return x.length===0&&$(this),null;var Q=x.needReadable;f("need readable",Q),(x.length===0||x.length-b<x.highWaterMark)&&(Q=!0,f("length less than watermark",Q)),x.ended||x.reading?(Q=!1,f("reading or ended",Q)):Q&&(f("do read"),x.reading=!0,x.sync=!0,x.length===0&&(x.needReadable=!0),this._read(x.highWaterMark),x.sync=!1,x.reading||(b=ht(z,x)));var Me;return b>0?Me=k(b,x):Me=null,Me===null?(x.needReadable=x.length<=x.highWaterMark,b=0):(x.length-=b,x.awaitDrain=0),x.length===0&&(x.ended||(x.needReadable=!0),z!==b&&x.ended&&$(this)),Me!==null&&this.emit("data",Me),Me};function Ue(b,x){if(f("onEofChunk"),!x.ended){if(x.decoder){var z=x.decoder.end();z&&z.length&&(x.buffer.push(z),x.length+=x.objectMode?1:z.length)}x.ended=!0,x.sync?Pe(b):(x.needReadable=!1,x.emittedReadable||(x.emittedReadable=!0,Se(b)))}}function Pe(b){var x=b._readableState;f("emitReadable",x.needReadable,x.emittedReadable),x.needReadable=!1,x.emittedReadable||(f("emitReadable",x.flowing),x.emittedReadable=!0,t.nextTick(Se,b))}function Se(b){var x=b._readableState;f("emitReadable_",x.destroyed,x.length,x.ended),!x.destroyed&&(x.length||x.ended)&&(b.emit("readable"),x.emittedReadable=!1),x.needReadable=!x.flowing&&!x.ended&&x.length<=x.highWaterMark,A(b)}function fe(b,x){x.readingMore||(x.readingMore=!0,t.nextTick(ve,b,x))}function ve(b,x){for(;!x.reading&&!x.ended&&(x.length<x.highWaterMark||x.flowing&&x.length===0);){var z=x.length;if(f("maybeReadMore read 0"),b.read(0),z===x.length)break}x.readingMore=!1}re.prototype._read=function(b){ae(this,new v("_read()"))},re.prototype.pipe=function(b,x){var z=this,Q=this._readableState;switch(Q.pipesCount){case 0:Q.pipes=b;break;case 1:Q.pipes=[Q.pipes,b];break;default:Q.pipes.push(b);break}Q.pipesCount+=1,f("pipe count=%d opts=%j",Q.pipesCount,x);var Me=(!x||x.end!==!1)&&b!==t.stdout&&b!==t.stderr,_e=Me?Ct:u;Q.endEmitted?t.nextTick(_e):z.once("end",_e),b.on("unpipe",Z);function Z(c,T){f("onunpipe"),c===z&&T&&T.hasUnpiped===!1&&(T.hasUnpiped=!0,mr())}function Ct(){f("onend"),b.end()}var Nt=D(z);b.on("drain",Nt);var xt=!1;function mr(){f("cleanup"),b.removeListener("close",hr),b.removeListener("finish",m),b.removeListener("drain",Nt),b.removeListener("error",Et),b.removeListener("unpipe",Z),z.removeListener("end",Ct),z.removeListener("end",u),z.removeListener("data",si),xt=!0,Q.awaitDrain&&(!b._writableState||b._writableState.needDrain)&&Nt()}z.on("data",si);function si(c){f("ondata");var T=b.write(c);f("dest.write",T),T===!1&&((Q.pipesCount===1&&Q.pipes===b||Q.pipesCount>1&&ie(Q.pipes,b)!==-1)&&!xt&&(f("false write response, pause",Q.awaitDrain),Q.awaitDrain++),z.pause())}function Et(c){f("onerror",c),u(),b.removeListener("error",Et),n(b,"error")===0&&ae(b,c)}ge(b,"error",Et);function hr(){b.removeListener("finish",m),u()}b.once("close",hr);function m(){f("onfinish"),b.removeListener("close",hr),u()}b.once("finish",m);function u(){f("unpipe"),z.unpipe(b)}return b.emit("pipe",z),Q.flowing||(f("pipe resume"),z.resume()),b};function D(b){return function(){var z=b._readableState;f("pipeOnDrain",z.awaitDrain),z.awaitDrain&&z.awaitDrain--,z.awaitDrain===0&&n(b,"data")&&(z.flowing=!0,A(b))}}re.prototype.unpipe=function(b){var x=this._readableState,z={hasUnpiped:!1};if(x.pipesCount===0)return this;if(x.pipesCount===1)return b&&b!==x.pipes?this:(b||(b=x.pipes),x.pipes=null,x.pipesCount=0,x.flowing=!1,b&&b.emit("unpipe",this,z),this);if(!b){var Q=x.pipes,Me=x.pipesCount;x.pipes=null,x.pipesCount=0,x.flowing=!1;for(var _e=0;_e<Me;_e++)Q[_e].emit("unpipe",this,{hasUnpiped:!1});return this}var Z=ie(x.pipes,b);return Z===-1?this:(x.pipes.splice(Z,1),x.pipesCount-=1,x.pipesCount===1&&(x.pipes=x.pipes[0]),b.emit("unpipe",this,z),this)},re.prototype.on=function(b,x){var z=r.prototype.on.call(this,b,x),Q=this._readableState;return b==="data"?(Q.readableListening=this.listenerCount("readable")>0,Q.flowing!==!1&&this.resume()):b==="readable"&&!Q.endEmitted&&!Q.readableListening&&(Q.readableListening=Q.needReadable=!0,Q.flowing=!1,Q.emittedReadable=!1,f("on readable",Q.length,Q.reading),Q.length?Pe(this):Q.reading||t.nextTick(F,this)),z},re.prototype.addListener=re.prototype.on,re.prototype.removeListener=function(b,x){var z=r.prototype.removeListener.call(this,b,x);return b==="readable"&&t.nextTick(j,this),z},re.prototype.removeAllListeners=function(b){var x=r.prototype.removeAllListeners.apply(this,arguments);return(b==="readable"||b===void 0)&&t.nextTick(j,this),x};function j(b){var x=b._readableState;x.readableListening=b.listenerCount("readable")>0,x.resumeScheduled&&!x.paused?x.flowing=!0:b.listenerCount("data")>0&&b.resume()}function F(b){f("readable nexttick read 0"),b.read(0)}re.prototype.resume=function(){var b=this._readableState;return b.flowing||(f("resume"),b.flowing=!b.readableListening,de(this,b)),b.paused=!1,this};function de(b,x){x.resumeScheduled||(x.resumeScheduled=!0,t.nextTick(Te,b,x))}function Te(b,x){f("resume",x.reading),x.reading||b.read(0),x.resumeScheduled=!1,b.emit("resume"),A(b),x.flowing&&!x.reading&&b.read(0)}re.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function A(b){var x=b._readableState;for(f("flow",x.flowing);x.flowing&&b.read()!==null;);}re.prototype.wrap=function(b){var x=this,z=this._readableState,Q=!1;b.on("end",function(){if(f("wrapped end"),z.decoder&&!z.ended){var Z=z.decoder.end();Z&&Z.length&&x.push(Z)}x.push(null)}),b.on("data",function(Z){if(f("wrapped data"),z.decoder&&(Z=z.decoder.write(Z)),!(z.objectMode&&Z==null)&&!(!z.objectMode&&(!Z||!Z.length))){var Ct=x.push(Z);Ct||(Q=!0,b.pause())}});for(var Me in b)this[Me]===void 0&&typeof b[Me]=="function"&&(this[Me]=(function(Ct){return function(){return b[Ct].apply(b,arguments)}})(Me));for(var _e=0;_e<ee.length;_e++)b.on(ee[_e],this.emit.bind(this,ee[_e]));return this._read=function(Z){f("wrapped _read",Z),Q&&(Q=!1,b.resume())},this},typeof Symbol=="function"&&(re.prototype[Symbol.asyncIterator]=function(){return H===void 0&&(H=Tk()),H(this)}),Object.defineProperty(re.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(re.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(re.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(x){this._readableState&&(this._readableState.flowing=x)}}),re._fromList=k,Object.defineProperty(re.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function k(b,x){if(x.length===0)return null;var z;return x.objectMode?z=x.buffer.shift():!b||b>=x.length?(x.decoder?z=x.buffer.join(""):x.buffer.length===1?z=x.buffer.first():z=x.buffer.concat(x.length),x.buffer.clear()):z=x.buffer.consume(b,x.decoder),z}function $(b){var x=b._readableState;f("endReadable",x.endEmitted),x.endEmitted||(x.ended=!0,t.nextTick(Y,x,b))}function Y(b,x){if(f("endReadableNT",b.endEmitted,b.length),!b.endEmitted&&b.length===0&&(b.endEmitted=!0,x.readable=!1,x.emit("end"),b.autoDestroy)){var z=x._writableState;(!z||z.autoDestroy&&z.finished)&&x.destroy()}}typeof Symbol=="function"&&(re.from=function(b,x){return K===void 0&&(K=_k()),K(re,b,x)});function ie(b,x){for(var z=0,Q=b.length;z<Q;z++)if(b[z]===x)return z;return-1}return Fs}function Bh(){if(ch)return Ws;ch=!0,Ws=s;var t=gr().codes,e=t.ERR_METHOD_NOT_IMPLEMENTED,n=t.ERR_MULTIPLE_CALLBACK,r=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=t.ERR_TRANSFORM_WITH_LENGTH_0,o=pr();Ht()(s,o);function i(p,y){var g=this._transformState;g.transforming=!1;var h=g.writecb;if(h===null)return this.emit("error",new n);g.writechunk=null,g.writecb=null,y!=null&&this.push(y),h(p);var w=this._readableState;w.reading=!1,(w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}function s(p){if(!(this instanceof s))return new s(p);o.call(this,p),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,p&&(typeof p.transform=="function"&&(this._transform=p.transform),typeof p.flush=="function"&&(this._flush=p.flush)),this.on("prefinish",l)}function l(){var p=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(y,g){f(p,y,g)}):f(this,null,null)}s.prototype.push=function(p,y){return this._transformState.needTransform=!1,o.prototype.push.call(this,p,y)},s.prototype._transform=function(p,y,g){g(new e("_transform()"))},s.prototype._write=function(p,y,g){var h=this._transformState;if(h.writecb=g,h.writechunk=p,h.writeencoding=y,!h.transforming){var w=this._readableState;(h.needTransform||w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}},s.prototype._read=function(p){var y=this._transformState;y.writechunk!==null&&!y.transforming?(y.transforming=!0,this._transform(y.writechunk,y.writeencoding,y.afterTransform)):y.needTransform=!0},s.prototype._destroy=function(p,y){o.prototype._destroy.call(this,p,function(g){y(g)})};function f(p,y,g){if(y)return p.emit("error",y);if(g!=null&&p.push(g),p._writableState.length)throw new a;if(p._transformState.transforming)throw new r;return p.push(null)}return Ws}function bk(){if(fh)return zs;fh=!0,zs=e;var t=Bh();Ht()(e,t);function e(n){if(!(this instanceof e))return new e(n);t.call(this,n)}return e.prototype._transform=function(n,r,a){a(null,n)},zs}function wk(){if(dh)return qs;dh=!0;var t;function e(g){var h=!1;return function(){h||(h=!0,g.apply(void 0,arguments))}}var n=gr().codes,r=n.ERR_MISSING_ARGS,a=n.ERR_STREAM_DESTROYED;function o(g){if(g)throw g}function i(g){return g.setHeader&&typeof g.abort=="function"}function s(g,h,w,P){P=e(P);var B=!1;g.on("close",function(){B=!0}),t===void 0&&(t=Xs()),t(g,{readable:h,writable:w},function(S){if(S)return P(S);B=!0,P()});var v=!1;return function(S){if(!B&&!v){if(v=!0,i(g))return g.abort();if(typeof g.destroy=="function")return g.destroy();P(S||new a("pipe"))}}}function l(g){g()}function f(g,h){return g.pipe(h)}function p(g){return!g.length||typeof g[g.length-1]!="function"?o:g.pop()}function y(){for(var g=arguments.length,h=new Array(g),w=0;w<g;w++)h[w]=arguments[w];var P=p(h);if(Array.isArray(h[0])&&(h=h[0]),h.length<2)throw new r("streams");var B,v=h.map(function(S,E){var H=E<h.length-1,K=E>0;return s(S,H,K,function(ae){B||(B=ae),ae&&v.forEach(l),!H&&(v.forEach(l),P(B))})});return h.reduce(f)}return qs=y,qs}function Eh(){return ph||(ph=!0,wt=wt=Ph(),wt.Stream=wt,wt.Readable=wt,wt.Writable=xh(),wt.Duplex=pr(),wt.Transform=Bh(),wt.PassThrough=bk(),wt.finished=Xs(),wt.pipeline=wk()),wt}function Sh(){if(gh)return $a;gh=!0;var t=Dt().Buffer,e=Rt,n=Th(),r=Ht(),a=Eh(),o=$a.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i=$a.IncomingMessage=function(s,l,f,p){var y=this||ja;if(a.Readable.call(y),y._mode=f,y.headers={},y.rawHeaders=[],y.trailers={},y.rawTrailers=[],y.on("end",function(){e.nextTick(function(){y.emit("close")})}),f==="fetch"){let v=function(){h.read().then(function(S){if(!y._destroyed){if(p(S.done),S.done){y.push(null);return}y.push(t.from(S.value)),v()}}).catch(function(S){p(!0),y._destroyed||y.emit("error",S)})};if(y._fetchResponse=l,y.url=l.url,y.statusCode=l.status,y.statusMessage=l.statusText,l.headers.forEach(function(S,E){y.headers[E.toLowerCase()]=S,y.rawHeaders.push(E,S)}),n.writableStream){var g=new WritableStream({write:function(S){return p(!1),new Promise(function(E,H){y._destroyed?H():y.push(t.from(S))?E():y._resumeFetch=E})},close:function(){p(!0),y._destroyed||y.push(null)},abort:function(S){p(!0),y._destroyed||y.emit("error",S)}});try{l.body.pipeTo(g).catch(function(S){p(!0),y._destroyed||y.emit("error",S)});return}catch{}}var h=l.body.getReader();v()}else{y._xhr=s,y._pos=0,y.url=s.responseURL,y.statusCode=s.status,y.statusMessage=s.statusText;var w=s.getAllResponseHeaders().split(/\r?\n/);if(w.forEach(function(v){var S=v.match(/^([^:]+):\s*(.*)/);if(S){var E=S[1].toLowerCase();E==="set-cookie"?(y.headers[E]===void 0&&(y.headers[E]=[]),y.headers[E].push(S[2])):y.headers[E]!==void 0?y.headers[E]+=", "+S[2]:y.headers[E]=S[2],y.rawHeaders.push(S[1],S[2])}}),y._charset="x-user-defined",!n.overrideMimeType){var P=y.rawHeaders["mime-type"];if(P){var B=P.match(/;\s*charset=([^;])(;|$)/);B&&(y._charset=B[1].toLowerCase())}y._charset||(y._charset="utf-8")}}};return r(i,a.Readable),i.prototype._read=function(){var s=this||ja,l=s._resumeFetch;l&&(s._resumeFetch=null,l())},i.prototype._onXHRProgress=function(s){var l=this||ja,f=l._xhr,p=null;switch(l._mode){case"text":if(p=f.responseText,p.length>l._pos){var y=p.substr(l._pos);if(l._charset==="x-user-defined"){for(var g=t.alloc(y.length),h=0;h<y.length;h++)g[h]=y.charCodeAt(h)&255;l.push(g)}else l.push(y,l._charset);l._pos=p.length}break;case"arraybuffer":if(f.readyState!==o.DONE||!f.response)break;p=f.response,l.push(t.from(new Uint8Array(p)));break;case"moz-chunked-arraybuffer":if(p=f.response,f.readyState!==o.LOADING||!p)break;l.push(t.from(new Uint8Array(p)));break;case"ms-stream":if(p=f.response,f.readyState!==o.LOADING)break;var w=new ja.MSStreamReader;w.onprogress=function(){w.result.byteLength>l._pos&&(l.push(t.from(new Uint8Array(w.result.slice(l._pos)))),l._pos=w.result.byteLength)},w.onload=function(){s(!0),l.push(null)},w.readAsArrayBuffer(p);break}l._xhr.readyState===o.DONE&&l._mode!=="ms-stream"&&(s(!0),l.push(null))},$a}function xk(){if(yh)return Gs;yh=!0;var t=Dt().Buffer,e=Rt,n=Th(),r=Ht(),a=Sh(),o=Eh(),i=a.IncomingMessage,s=a.readyStates;function l(g,h){return n.fetch&&h?"fetch":n.mozchunkedarraybuffer?"moz-chunked-arraybuffer":n.msstream?"ms-stream":n.arraybuffer&&g?"arraybuffer":"text"}var f=Gs=function(g){var h=this||at;o.Writable.call(h),h._opts=g,h._body=[],h._headers={},g.auth&&h.setHeader("Authorization","Basic "+t.from(g.auth).toString("base64")),Object.keys(g.headers).forEach(function(B){h.setHeader(B,g.headers[B])});var w,P=!0;if(g.mode==="disable-fetch"||"requestTimeout"in g&&!n.abortController)P=!1,w=!0;else if(g.mode==="prefer-streaming")w=!1;else if(g.mode==="allow-wrong-content-type")w=!n.overrideMimeType;else if(!g.mode||g.mode==="default"||g.mode==="prefer-fast")w=!0;else throw new Error("Invalid value for opts.mode");h._mode=l(w,P),h._fetchTimer=null,h._socketTimeout=null,h._socketTimer=null,h.on("finish",function(){h._onFinish()})};r(f,o.Writable),f.prototype.setHeader=function(g,h){var w=this||at,P=g.toLowerCase();y.indexOf(P)===-1&&(w._headers[P]={name:g,value:h})},f.prototype.getHeader=function(g){var h=(this||at)._headers[g.toLowerCase()];return h?h.value:null},f.prototype.removeHeader=function(g){var h=this||at;delete h._headers[g.toLowerCase()]},f.prototype._onFinish=function(){var g=this||at;if(!g._destroyed){var h=g._opts;"timeout"in h&&h.timeout!==0&&g.setTimeout(h.timeout);var w=g._headers,P=null;h.method!=="GET"&&h.method!=="HEAD"&&(P=new Blob(g._body,{type:(w["content-type"]||{}).value||""}));var B=[];if(Object.keys(w).forEach(function(H){var K=w[H].name,ae=w[H].value;Array.isArray(ae)?ae.forEach(function(ee){B.push([K,ee])}):B.push([K,ae])}),g._mode==="fetch"){var v=null;if(n.abortController){var S=new AbortController;v=S.signal,g._fetchAbortController=S,"requestTimeout"in h&&h.requestTimeout!==0&&(g._fetchTimer=at.setTimeout(function(){g.emit("requestTimeout"),g._fetchAbortController&&g._fetchAbortController.abort()},h.requestTimeout))}at.fetch(g._opts.url,{method:g._opts.method,headers:B,body:P||void 0,mode:"cors",credentials:h.withCredentials?"include":"same-origin",signal:v}).then(function(H){g._fetchResponse=H,g._resetTimers(!1),g._connect()},function(H){g._resetTimers(!0),g._destroyed||g.emit("error",H)})}else{var E=g._xhr=new at.XMLHttpRequest;try{E.open(g._opts.method,g._opts.url,!0)}catch(H){e.nextTick(function(){g.emit("error",H)});return}"responseType"in E&&(E.responseType=g._mode),"withCredentials"in E&&(E.withCredentials=!!h.withCredentials),g._mode==="text"&&"overrideMimeType"in E&&E.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in h&&(E.timeout=h.requestTimeout,E.ontimeout=function(){g.emit("requestTimeout")}),B.forEach(function(H){E.setRequestHeader(H[0],H[1])}),g._response=null,E.onreadystatechange=function(){switch(E.readyState){case s.LOADING:case s.DONE:g._onXHRProgress();break}},g._mode==="moz-chunked-arraybuffer"&&(E.onprogress=function(){g._onXHRProgress()}),E.onerror=function(){g._destroyed||(g._resetTimers(!0),g.emit("error",new Error("XHR error")))};try{E.send(P)}catch(H){e.nextTick(function(){g.emit("error",H)});return}}}};function p(g){try{var h=g.status;return h!==null&&h!==0}catch{return!1}}f.prototype._onXHRProgress=function(){var g=this||at;g._resetTimers(!1),!(!p(g._xhr)||g._destroyed)&&(g._response||g._connect(),g._response._onXHRProgress(g._resetTimers.bind(g)))},f.prototype._connect=function(){var g=this||at;g._destroyed||(g._response=new i(g._xhr,g._fetchResponse,g._mode,g._resetTimers.bind(g)),g._response.on("error",function(h){g.emit("error",h)}),g.emit("response",g._response))},f.prototype._write=function(g,h,w){var P=this||at;P._body.push(g),w()},f.prototype._resetTimers=function(g){var h=this||at;at.clearTimeout(h._socketTimer),h._socketTimer=null,g?(at.clearTimeout(h._fetchTimer),h._fetchTimer=null):h._socketTimeout&&(h._socketTimer=at.setTimeout(function(){h.emit("timeout")},h._socketTimeout))},f.prototype.abort=f.prototype.destroy=function(g){var h=this||at;h._destroyed=!0,h._resetTimers(!0),h._response&&(h._response._destroyed=!0),h._xhr?h._xhr.abort():h._fetchAbortController&&h._fetchAbortController.abort(),g&&h.emit("error",g)},f.prototype.end=function(g,h,w){var P=this||at;typeof g=="function"&&(w=g,g=void 0),o.Writable.prototype.end.call(P,g,h,w)},f.prototype.setTimeout=function(g,h){var w=this||at;h&&w.once("timeout",h),w._socketTimeout=g,w._resetTimers(!1)},f.prototype.flushHeaders=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};var y=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return Gs}function Pk(){if(mh)return Vs;mh=!0,Vs=e;var t=Object.prototype.hasOwnProperty;function e(){for(var n={},r=0;r<arguments.length;r++){var a=arguments[r];for(var o in a)t.call(a,o)&&(n[o]=a[o])}return n}return Vs}function Bk(){return hh||(hh=!0,Js={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}),Js}function Sk(){if(vh)return Ys;vh=!0;var t=xk(),e=Sh(),n=Pk(),r=Bk(),a=De,o=Ys;return o.request=function(i,s){typeof i=="string"?i=a.parse(i):i=n(i);var l=Ek.location.protocol.search(/^https?:$/)===-1?"http:":"",f=i.protocol||l,p=i.hostname||i.host,y=i.port,g=i.path||"/";p&&p.indexOf(":")!==-1&&(p="["+p+"]"),i.url=(p?f+"//"+p:"")+(y?":"+y:"")+g,i.method=(i.method||"GET").toUpperCase(),i.headers=i.headers||{};var h=new t(i);return s&&h.on("response",s),h},o.get=function(s,l){var f=o.request(s,l);return f.end(),f},o.ClientRequest=t,o.IncomingMessage=e.IncomingMessage,o.Agent=function(){},o.Agent.defaultMaxSockets=4,o.globalAgent=new o.Agent,o.STATUS_CODES=r,o.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],Ys}var Bt,Jm,jn,Ms,Ym,Ns,Xm,Ds,Qm,Hs,eh,Us,th,Zs,nh,rh,$s,ih,js,ah,Ks,oh,Ls,sh,Fs,lh,uh,Ws,ch,zs,fh,qs,dh,wt,ph,$a,gh,ja,Gs,yh,at,Vs,mh,Js,hh,Ys,vh,Ek,tn,kk,Ik,Ak,Ck,Ok,Rk,Mk,Nk,Ih=ot(()=>{C();R();O();rs();Fy();is();di();Em();Ua();_s();Cm();Mm();Vm();Bs();Bt={},Jm=!1,jn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ms={},Ym=!1;Ns={},Xm=!1;Ds={},Qm=!1;Hs={},eh=!1;Us={},th=!1;Zs={},nh=!1,rh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;$s={},ih=!1;js={},ah=!1;Ks={},oh=!1;Ls={},sh=!1;Fs={},lh=!1,uh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ws={},ch=!1;zs={},fh=!1;qs={},dh=!1;wt={},ph=!1;$a={},gh=!1,ja=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Gs={},yh=!1,at=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Vs={},mh=!1;Js={},hh=!1;Ys={},vh=!1,Ek=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;tn=Sk(),kk=tn.Agent,Ik=tn.ClientRequest,Ak=tn.IncomingMessage,Ck=tn.METHODS,Ok=tn.STATUS_CODES,Rk=tn.get,Mk=tn.globalAgent,Nk=tn.request});C();R();O();var Cy={};Ln(Cy,{defaults:()=>NB,markdown:()=>MB});C();R();O();C();R();O();C();R();O();var Po=Object.defineProperty,Wv=Object.defineProperties,zv=Object.getOwnPropertyDescriptors,Pi=Object.getOwnPropertySymbols,Yc=Object.prototype.hasOwnProperty,Xc=Object.prototype.propertyIsEnumerable,gc=(t,e,n)=>e in t?Po(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,_=(t,e)=>{for(var n in e||(e={}))Yc.call(e,n)&&gc(t,n,e[n]);if(Pi)for(var n of Pi(e))Xc.call(e,n)&&gc(t,n,e[n]);return t},N=(t,e)=>Wv(t,zv(e)),d=(t,e)=>Po(t,"name",{value:e,configurable:!0}),Qc=(t,e)=>{var n={};for(var r in t)Yc.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Pi)for(var r of Pi(t))e.indexOf(r)<0&&Xc.call(t,r)&&(n[r]=t[r]);return n},aa=(t,e)=>{for(var n in e)Po(t,n,{get:e[n],enumerable:!0})},qv={};aa(qv,{errors:()=>rf,fromJSONSchema:()=>Vg,fromJSONSchemaLegacy:()=>iB,fromObject:()=>wo,toJSONSchema:()=>st,toJSONSchemaLegacy:()=>AB,toTypescriptSchema:()=>Do,toTypescriptType:()=>Bo});var X={};aa(X,{BRAND:()=>Mx,DIRTY:()=>Vn,EMPTY_PATH:()=>Ax,INVALID:()=>pe,NEVER:()=>MP,OK:()=>gt,ParseInputLazyPath:()=>Ot,ParseStatus:()=>Tt,Schema:()=>he,ZodAny:()=>jr,ZodArray:()=>Kr,ZodBigInt:()=>$o,ZodBoolean:()=>jo,ZodBranded:()=>Ko,ZodCatch:()=>Lo,ZodDate:()=>Fo,ZodDefault:()=>ma,ZodDiscriminatedUnion:()=>fg,ZodEffects:()=>Sn,ZodEnum:()=>ir,ZodError:()=>Wt,ZodFirstPartyTypeKind:()=>Xp,ZodFunction:()=>pg,ZodIntersection:()=>zo,ZodIssueCode:()=>G,ZodLazy:()=>qo,ZodLiteral:()=>Go,ZodMap:()=>yg,ZodNaN:()=>hg,ZodNativeEnum:()=>Vo,ZodNever:()=>Wr,ZodNull:()=>Jo,ZodNullable:()=>Qn,ZodNumber:()=>Yo,ZodObject:()=>er,ZodOptional:()=>ln,ZodParsedType:()=>ne,ZodPipeline:()=>Xo,ZodPromise:()=>va,ZodReadonly:()=>Ta,ZodRecord:()=>Pg,ZodRef:()=>Eg,ZodSchema:()=>he,ZodSet:()=>Sg,ZodString:()=>yt,ZodSymbol:()=>Ug,ZodTransformer:()=>Sn,ZodTuple:()=>nr,ZodType:()=>he,ZodUndefined:()=>_a,ZodUnion:()=>Qo,ZodUnknown:()=>Nr,ZodVoid:()=>Kg,addIssueToContext:()=>te,agent:()=>jx,aimodel:()=>zx,any:()=>rP,array:()=>sP,bigint:()=>Xx,boolean:()=>Wg,coerce:()=>RP,conversation:()=>Ux,createZodEnum:()=>ha,cuid2Regex:()=>Ig,cuidRegex:()=>kg,custom:()=>ug,datasource:()=>qx,date:()=>Qx,default:()=>SP,discriminatedUnion:()=>fP,effect:()=>Gc,emailRegex:()=>Og,enum:()=>wP,errorUtil:()=>ue,event:()=>Kx,function:()=>TP,getErrorMap:()=>Zr,getParsedType:()=>sn,instanceof:()=>Jx,intent:()=>Wx,intersection:()=>dP,ipv4Regex:()=>Mg,ipv6Regex:()=>Ng,isAborted:()=>To,isAsync:()=>Si,isDirty:()=>_o,isEmojiRegex:()=>Nx,isValid:()=>$r,knowledgebase:()=>Gx,late:()=>Vx,lazy:()=>_P,literal:()=>bP,makeIssue:()=>Ei,map:()=>hP,message:()=>$x,nan:()=>Yx,nativeEnum:()=>xP,never:()=>aP,null:()=>nP,nullable:()=>EP,number:()=>Fg,object:()=>lP,objectUtil:()=>vo,oboolean:()=>OP,onumber:()=>CP,optional:()=>BP,ostring:()=>AP,pipeline:()=>IP,preprocess:()=>kP,processCreateParams:()=>me,promise:()=>PP,quotelessJson:()=>Ix,readonly:()=>mP,record:()=>gP,ref:()=>yP,set:()=>vP,setErrorMap:()=>tg,strictObject:()=>uP,string:()=>Lg,symbol:()=>eP,table:()=>Lx,tablerow:()=>Fx,transformer:()=>Gc,tuple:()=>pP,ulidRegex:()=>Ag,undefined:()=>tP,union:()=>cP,unknown:()=>iP,user:()=>Zx,util:()=>be,uuidRegex:()=>Cg,variable:()=>Hx,void:()=>oP});var le="x-zui";function ef(t){return typeof t=="symbol"?"symbol":typeof t=="bigint"?`${t.toString()}n`:se(t)}d(ef,"primitiveToTypscriptLiteralType");function se(t){return typeof t>"u"?"undefined":typeof t=="symbol"?t.description?`Symbol(${se(t.description)})`:"Symbol()":typeof t=="bigint"?`BigInt(${t.toString()})`:JSON.stringify(t)}d(se,"primitiveToTypescriptValue");function Jn(t){return typeof t>"u"?"undefined":JSON.stringify(t)}d(Jn,"unknownToTypescriptValue");var tf=d((t,e)=>{let n=Object.entries(t),r=e?" as const":"";return`{ ${n.map(([a,o])=>`${lo(a)}: ${Jn(o)}`).join(", ")} }${r}`},"recordOfUnknownToTypescriptRecord"),lo=d(t=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)?t:se(t),"toPropertyKey"),Gv=d(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalize"),nf=d(t=>{let e=/[^a-zA-Z0-9_]/g;return t.split(e).map(Gv).filter(r=>!!r).join("")},"toTypeArgumentName"),nt=d(t=>{let e=(t??"").split(`
|
|
14
14
|
`).filter(n=>n.trim().length>0);return e.length===0?"":e.length===1?`/** ${e[0]} */`:`/**
|
|
15
15
|
* ${e.join(`
|
|
16
16
|
* `)}
|
|
17
|
-
*/`},"getMultilineComment"),
|
|
18
|
-
`:"",p=t.value.describe(""),g=t.optional||t.value.isOptional()?"?":"";return`${f}${l}${f}${t.key}${g}: ${ke(p,
|
|
19
|
-
${p.join(" | ")}`;case M.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let y=s.options.map(
|
|
20
|
-
${y.join(" | ")}`;case M.ZodFirstPartyTypeKind.ZodIntersection:return`${ke(s.left,
|
|
21
|
-
(${P}) => ${B}`;case M.ZodFirstPartyTypeKind.ZodLazy:return ke(s.getter(),
|
|
22
|
-
${v}`.trim();case M.ZodFirstPartyTypeKind.ZodEnum:return s.values.map(se).join(" | ");case M.ZodFirstPartyTypeKind.ZodEffects:return ke(s.schema,a);case M.ZodFirstPartyTypeKind.ZodNativeEnum:throw new hf(M.ZodFirstPartyTypeKind.ZodNativeEnum);case M.ZodFirstPartyTypeKind.ZodOptional:return`${ke(s.innerType,a)} | undefined`;case M.ZodFirstPartyTypeKind.ZodNullable:return`${ke(s.innerType,a)} | null`;case M.ZodFirstPartyTypeKind.ZodDefault:return ke(s.innerType,a);case M.ZodFirstPartyTypeKind.ZodCatch:return ke(s.innerType,a);case M.ZodFirstPartyTypeKind.ZodPromise:return`Promise<${ke(s.type,a)}>`;case M.ZodFirstPartyTypeKind.ZodBranded:return ke(s.type,a);case M.ZodFirstPartyTypeKind.ZodPipeline:return ke(s.in,a);case M.ZodFirstPartyTypeKind.ZodSymbol:return`${nt(i.description)} symbol`.trim();case M.ZodFirstPartyTypeKind.ZodReadonly:return`Readonly<${ke(s.innerType,a)}>`;case M.ZodFirstPartyTypeKind.ZodRef:return tf(s.uri);default:be.assertNever(s)}}d(ke,"sUnwrapZod");var Vv=d((t,e)=>{if(t.props.type==="none")return ke(t.props.schema,e);let n=nt(t.props.schema.description),r=t.props.schema.describe(""),o=ke(r,e);if(t.props.type==="variable")return gc(`${n}declare const ${t.props.identifier}: ${o};`);let a=t.props.args.length>0?`<${t.props.args.map(tf).join(", ")}>`:"";return gc(`${n}type ${t.props.identifier}${a} = ${o};`)},"unwrapDeclaration"),Jv=d(t=>t.declaration?t.declaration===!0?"variable":t.declaration:"none","getDeclarationType"),Xv=d((t,e)=>{let n=Jv(e),r=t.getReferences();if(n==="none"){if(r.length>0)throw new ca;return new gi({type:"none",schema:t})}let o="title"in t.ui?t.ui.title:null;if(!o)throw new Tf;if(n==="variable"){if(r.length>0)throw new ca;return new gi({type:"variable",identifier:o,schema:t})}return new gi({type:"type",identifier:o,schema:t,args:r})},"getDeclarationProps"),Yv=typeof global=="object"&&global&&global.Object===Object&&global,Sf=Yv,Qv=typeof self=="object"&&self&&self.Object===Object&&self,eT=Sf||Qv||Function("return this")(),zt=eT,tT=zt.Symbol,ln=tT,Ef=Object.prototype,nT=Ef.hasOwnProperty,rT=Ef.toString,vr=ln?ln.toStringTag:void 0;function kf(t){var e=nT.call(t,vr),n=t[vr];try{t[vr]=void 0;var r=!0}catch{}var o=rT.call(t);return r&&(e?t[vr]=n:delete t[vr]),o}d(kf,"getRawTag");var iT=kf,oT=Object.prototype,aT=oT.toString;function If(t){return aT.call(t)}d(If,"objectToString");var sT=If,lT="[object Null]",uT="[object Undefined]",hc=ln?ln.toStringTag:void 0;function Af(t){return t==null?t===void 0?uT:lT:hc&&hc in Object(t)?iT(t):sT(t)}d(Af,"baseGetTag");var En=Af;function Cf(t){return t!=null&&typeof t=="object"}d(Cf,"isObjectLike");var Bn=Cf,cT="[object Symbol]";function Of(t){return typeof t=="symbol"||Bn(t)&&En(t)==cT}d(Of,"isSymbol");var Ba=Of;function Rf(t,e){for(var n=-1,r=t==null?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}d(Rf,"arrayMap");var Mf=Rf,fT=Array.isArray,Wt=fT,dT=1/0,vc=ln?ln.prototype:void 0,Tc=vc?vc.toString:void 0;function Sa(t){if(typeof t=="string")return t;if(Wt(t))return Mf(t,Sa)+"";if(Ba(t))return Tc?Tc.call(t):"";var e=t+"";return e=="0"&&1/t==-dT?"-0":e}d(Sa,"baseToString");var pT=Sa;function Nf(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}d(Nf,"isObject");var Xn=Nf;function Df(t){return t}d(Df,"identity");var gT=Df,yT="[object AsyncFunction]",mT="[object Function]",hT="[object GeneratorFunction]",vT="[object Proxy]";function Hf(t){if(!Xn(t))return!1;var e=En(t);return e==mT||e==hT||e==yT||e==vT}d(Hf,"isFunction");var Uf=Hf,TT=zt["__core-js_shared__"],na=TT,_c=(function(){var t=/[^.]+$/.exec(na&&na.keys&&na.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function Zf(t){return!!_c&&_c in t}d(Zf,"isMasked");var _T=Zf,bT=Function.prototype,wT=bT.toString;function $f(t){if(t!=null){try{return wT.call(t)}catch{}try{return t+""}catch{}}return""}d($f,"toSource");var kn=$f,xT=/[\\^$.*+?()[\]{}|]/g,PT=/^\[object .+?Constructor\]$/,BT=Function.prototype,ST=Object.prototype,ET=BT.toString,kT=ST.hasOwnProperty,IT=RegExp("^"+ET.call(kT).replace(xT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function jf(t){if(!Xn(t)||_T(t))return!1;var e=Uf(t)?IT:PT;return e.test(kn(t))}d(jf,"baseIsNative");var AT=jf;function Kf(t,e){return t?.[e]}d(Kf,"getValue");var CT=Kf;function Lf(t,e){var n=CT(t,e);return AT(n)?n:void 0}d(Lf,"getNative");var In=Lf,OT=In(zt,"WeakMap"),fa=OT,RT=(function(){try{var t=In(Object,"defineProperty");return t({},"",{}),t}catch{}})(),bc=RT,MT=9007199254740991,NT=/^(?:0|[1-9]\d*)$/;function Ff(t,e){var n=typeof t;return e=e??MT,!!e&&(n=="number"||n!="symbol"&&NT.test(t))&&t>-1&&t%1==0&&t<e}d(Ff,"isIndex");var Ea=Ff;function Wf(t,e,n){e=="__proto__"&&bc?bc(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}d(Wf,"baseAssignValue");var zf=Wf;function qf(t,e){return t===e||t!==t&&e!==e}d(qf,"eq");var ka=qf,DT=Object.prototype,HT=DT.hasOwnProperty;function Gf(t,e,n){var r=t[e];(!(HT.call(t,e)&&ka(r,n))||n===void 0&&!(e in t))&&zf(t,e,n)}d(Gf,"assignValue");var UT=Gf,ZT=9007199254740991;function Vf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ZT}d(Vf,"isLength");var Ia=Vf;function Jf(t){return t!=null&&Ia(t.length)&&!Uf(t)}d(Jf,"isArrayLike");var Xf=Jf,$T=Object.prototype;function Yf(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||$T;return t===n}d(Yf,"isPrototype");var Qf=Yf;function ed(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}d(ed,"baseTimes");var jT=ed,KT="[object Arguments]";function td(t){return Bn(t)&&En(t)==KT}d(td,"baseIsArguments");var wc=td,nd=Object.prototype,LT=nd.hasOwnProperty,FT=nd.propertyIsEnumerable,WT=wc((function(){return arguments})())?wc:function(t){return Bn(t)&<.call(t,"callee")&&!FT.call(t,"callee")},rd=WT;function id(){return!1}d(id,"stubFalse");var zT=id,od=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xc=od&&typeof module=="object"&&module&&!module.nodeType&&module,qT=xc&&xc.exports===od,Pc=qT?zt.Buffer:void 0,GT=Pc?Pc.isBuffer:void 0,VT=GT||zT,da=VT,JT="[object Arguments]",XT="[object Array]",YT="[object Boolean]",QT="[object Date]",e_="[object Error]",t_="[object Function]",n_="[object Map]",r_="[object Number]",i_="[object Object]",o_="[object RegExp]",a_="[object Set]",s_="[object String]",l_="[object WeakMap]",u_="[object ArrayBuffer]",c_="[object DataView]",f_="[object Float32Array]",d_="[object Float64Array]",p_="[object Int8Array]",g_="[object Int16Array]",y_="[object Int32Array]",m_="[object Uint8Array]",h_="[object Uint8ClampedArray]",v_="[object Uint16Array]",T_="[object Uint32Array]",Ze={};Ze[f_]=Ze[d_]=Ze[p_]=Ze[g_]=Ze[y_]=Ze[m_]=Ze[h_]=Ze[v_]=Ze[T_]=!0;Ze[JT]=Ze[XT]=Ze[u_]=Ze[YT]=Ze[c_]=Ze[QT]=Ze[e_]=Ze[t_]=Ze[n_]=Ze[r_]=Ze[i_]=Ze[o_]=Ze[a_]=Ze[s_]=Ze[l_]=!1;function ad(t){return Bn(t)&&Ia(t.length)&&!!Ze[En(t)]}d(ad,"baseIsTypedArray");var __=ad;function sd(t){return function(e){return t(e)}}d(sd,"baseUnary");var b_=sd,ld=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Or=ld&&typeof module=="object"&&module&&!module.nodeType&&module,w_=Or&&Or.exports===ld,ra=w_&&Sf.process,x_=(function(){try{var t=Or&&Or.require&&Or.require("util").types;return t||ra&&ra.binding&&ra.binding("util")}catch{}})(),Bc=x_,Sc=Bc&&Bc.isTypedArray,P_=Sc?b_(Sc):__,ud=P_,B_=Object.prototype,S_=B_.hasOwnProperty;function cd(t,e){var n=Wt(t),r=!n&&rd(t),o=!n&&!r&&da(t),a=!n&&!r&&!o&&ud(t),i=n||r||o||a,s=i?jT(t.length,String):[],l=s.length;for(var f in t)(e||S_.call(t,f))&&!(i&&(f=="length"||o&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Ea(f,l)))&&s.push(f);return s}d(cd,"arrayLikeKeys");var fd=cd;function dd(t,e){return function(n){return t(e(n))}}d(dd,"overArg");var pd=dd,E_=pd(Object.keys,Object),k_=E_,I_=Object.prototype,A_=I_.hasOwnProperty;function gd(t){if(!Qf(t))return k_(t);var e=[];for(var n in Object(t))A_.call(t,n)&&n!="constructor"&&e.push(n);return e}d(gd,"baseKeys");var C_=gd;function yd(t){return Xf(t)?fd(t):C_(t)}d(yd,"keys");var Aa=yd;function md(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}d(md,"nativeKeysIn");var O_=md,R_=Object.prototype,M_=R_.hasOwnProperty;function hd(t){if(!Xn(t))return O_(t);var e=Qf(t),n=[];for(var r in t)r=="constructor"&&(e||!M_.call(t,r))||n.push(r);return n}d(hd,"baseKeysIn");var N_=hd;function vd(t){return Xf(t)?fd(t,!0):N_(t)}d(vd,"keysIn");var D_=vd,H_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,U_=/^\w*$/;function Td(t,e){if(Wt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Ba(t)?!0:U_.test(t)||!H_.test(t)||e!=null&&t in Object(e)}d(Td,"isKey");var Ca=Td,Z_=In(Object,"create"),Nr=Z_;function _d(){this.__data__=Nr?Nr(null):{},this.size=0}d(_d,"hashClear");var $_=_d;function bd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}d(bd,"hashDelete");var j_=bd,K_="__lodash_hash_undefined__",L_=Object.prototype,F_=L_.hasOwnProperty;function wd(t){var e=this.__data__;if(Nr){var n=e[t];return n===K_?void 0:n}return F_.call(e,t)?e[t]:void 0}d(wd,"hashGet");var W_=wd,z_=Object.prototype,q_=z_.hasOwnProperty;function xd(t){var e=this.__data__;return Nr?e[t]!==void 0:q_.call(e,t)}d(xd,"hashHas");var G_=xd,V_="__lodash_hash_undefined__";function Pd(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Nr&&e===void 0?V_:e,this}d(Pd,"hashSet");var J_=Pd;function An(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}d(An,"Hash");An.prototype.clear=$_;An.prototype.delete=j_;An.prototype.get=W_;An.prototype.has=G_;An.prototype.set=J_;var Ec=An;function Bd(){this.__data__=[],this.size=0}d(Bd,"listCacheClear");var X_=Bd;function Sd(t,e){for(var n=t.length;n--;)if(ka(t[n][0],e))return n;return-1}d(Sd,"assocIndexOf");var lo=Sd,Y_=Array.prototype,Q_=Y_.splice;function Ed(t){var e=this.__data__,n=lo(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():Q_.call(e,n,1),--this.size,!0}d(Ed,"listCacheDelete");var eb=Ed;function kd(t){var e=this.__data__,n=lo(e,t);return n<0?void 0:e[n][1]}d(kd,"listCacheGet");var tb=kd;function Id(t){return lo(this.__data__,t)>-1}d(Id,"listCacheHas");var nb=Id;function Ad(t,e){var n=this.__data__,r=lo(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}d(Ad,"listCacheSet");var rb=Ad;function Cn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}d(Cn,"ListCache");Cn.prototype.clear=X_;Cn.prototype.delete=eb;Cn.prototype.get=tb;Cn.prototype.has=nb;Cn.prototype.set=rb;var uo=Cn,ib=In(zt,"Map"),Dr=ib;function Cd(){this.size=0,this.__data__={hash:new Ec,map:new(Dr||uo),string:new Ec}}d(Cd,"mapCacheClear");var ob=Cd;function Od(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}d(Od,"isKeyable");var ab=Od;function Rd(t,e){var n=t.__data__;return ab(e)?n[typeof e=="string"?"string":"hash"]:n.map}d(Rd,"getMapData");var co=Rd;function Md(t){var e=co(this,t).delete(t);return this.size-=e?1:0,e}d(Md,"mapCacheDelete");var sb=Md;function Nd(t){return co(this,t).get(t)}d(Nd,"mapCacheGet");var lb=Nd;function Dd(t){return co(this,t).has(t)}d(Dd,"mapCacheHas");var ub=Dd;function Hd(t,e){var n=co(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}d(Hd,"mapCacheSet");var cb=Hd;function On(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}d(On,"MapCache");On.prototype.clear=ob;On.prototype.delete=sb;On.prototype.get=lb;On.prototype.has=ub;On.prototype.set=cb;var fo=On,fb="Expected a function";function po(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(fb);var n=d(function(){var r=arguments,o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=t.apply(this,r);return n.cache=a.set(o,i)||a,i},"memoized");return n.cache=new(po.Cache||fo),n}d(po,"memoize");po.Cache=fo;var db=po,pb=500;function Ud(t){var e=db(t,function(r){return n.size===pb&&n.clear(),r}),n=e.cache;return e}d(Ud,"memoizeCapped");var gb=Ud,yb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mb=/\\(\\)?/g,hb=gb(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(yb,function(n,r,o,a){e.push(o?a.replace(mb,"$1"):r||n)}),e}),vb=hb;function Zd(t){return t==null?"":pT(t)}d(Zd,"toString");var Tb=Zd;function $d(t,e){return Wt(t)?t:Ca(t,e)?[t]:vb(Tb(t))}d($d,"castPath");var go=$d,_b=1/0;function jd(t){if(typeof t=="string"||Ba(t))return t;var e=t+"";return e=="0"&&1/t==-_b?"-0":e}d(jd,"toKey");var Lr=jd;function Kd(t,e){e=go(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Lr(e[n++])];return n&&n==r?t:void 0}d(Kd,"baseGet");var Oa=Kd;function Ld(t,e,n){var r=t==null?void 0:Oa(t,e);return r===void 0?n:r}d(Ld,"get");var bb=Ld;function Fd(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}d(Fd,"arrayPush");var Wd=Fd,wb=pd(Object.getPrototypeOf,Object),zd=wb,xb="[object Object]",Pb=Function.prototype,Bb=Object.prototype,qd=Pb.toString,Sb=Bb.hasOwnProperty,Eb=qd.call(Object);function Gd(t){if(!Bn(t)||En(t)!=xb)return!1;var e=zd(t);if(e===null)return!0;var n=Sb.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&qd.call(n)==Eb}d(Gd,"isPlainObject");var kc=Gd;function Vd(){this.__data__=new uo,this.size=0}d(Vd,"stackClear");var kb=Vd;function Jd(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}d(Jd,"stackDelete");var Ib=Jd;function Xd(t){return this.__data__.get(t)}d(Xd,"stackGet");var Ab=Xd;function Yd(t){return this.__data__.has(t)}d(Yd,"stackHas");var Cb=Yd,Ob=200;function Qd(t,e){var n=this.__data__;if(n instanceof uo){var r=n.__data__;if(!Dr||r.length<Ob-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new fo(r)}return n.set(t,e),this.size=n.size,this}d(Qd,"stackSet");var Rb=Qd;function Rn(t){var e=this.__data__=new uo(t);this.size=e.size}d(Rn,"Stack");Rn.prototype.clear=kb;Rn.prototype.delete=Ib;Rn.prototype.get=Ab;Rn.prototype.has=Cb;Rn.prototype.set=Rb;var yi=Rn;function ep(t,e){for(var n=-1,r=t==null?0:t.length,o=0,a=[];++n<r;){var i=t[n];e(i,n,t)&&(a[o++]=i)}return a}d(ep,"arrayFilter");var Mb=ep;function tp(){return[]}d(tp,"stubArray");var np=tp,Nb=Object.prototype,Db=Nb.propertyIsEnumerable,Ic=Object.getOwnPropertySymbols,Hb=Ic?function(t){return t==null?[]:(t=Object(t),Mb(Ic(t),function(e){return Db.call(t,e)}))}:np,rp=Hb,Ub=Object.getOwnPropertySymbols,Zb=Ub?function(t){for(var e=[];t;)Wd(e,rp(t)),t=zd(t);return e}:np,$b=Zb;function ip(t,e,n){var r=e(t);return Wt(t)?r:Wd(r,n(t))}d(ip,"baseGetAllKeys");var op=ip;function ap(t){return op(t,Aa,rp)}d(ap,"getAllKeys");var Ac=ap;function sp(t){return op(t,D_,$b)}d(sp,"getAllKeysIn");var jb=sp,Kb=In(zt,"DataView"),pa=Kb,Lb=In(zt,"Promise"),ga=Lb,Fb=In(zt,"Set"),ya=Fb,Cc="[object Map]",Wb="[object Object]",Oc="[object Promise]",Rc="[object Set]",Mc="[object WeakMap]",Nc="[object DataView]",zb=kn(pa),qb=kn(Dr),Gb=kn(ga),Vb=kn(ya),Jb=kn(fa),_n=En;(pa&&_n(new pa(new ArrayBuffer(1)))!=Nc||Dr&&_n(new Dr)!=Cc||ga&&_n(ga.resolve())!=Oc||ya&&_n(new ya)!=Rc||fa&&_n(new fa)!=Mc)&&(_n=d(function(t){var e=En(t),n=e==Wb?t.constructor:void 0,r=n?kn(n):"";if(r)switch(r){case zb:return Nc;case qb:return Cc;case Gb:return Oc;case Vb:return Rc;case Jb:return Mc}return e},"getTag"));var Dc=_n,Xb=zt.Uint8Array,Hc=Xb,Yb="__lodash_hash_undefined__";function lp(t){return this.__data__.set(t,Yb),this}d(lp,"setCacheAdd");var Qb=lp;function up(t){return this.__data__.has(t)}d(up,"setCacheHas");var ew=up;function Hr(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new fo;++e<n;)this.add(t[e])}d(Hr,"SetCache");Hr.prototype.add=Hr.prototype.push=Qb;Hr.prototype.has=ew;var tw=Hr;function cp(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}d(cp,"arraySome");var nw=cp;function fp(t,e){return t.has(e)}d(fp,"cacheHas");var rw=fp,iw=1,ow=2;function dp(t,e,n,r,o,a){var i=n&iw,s=t.length,l=e.length;if(s!=l&&!(i&&l>s))return!1;var f=a.get(t),p=a.get(e);if(f&&p)return f==e&&p==t;var y=-1,g=!0,h=n&ow?new tw:void 0;for(a.set(t,e),a.set(e,t);++y<s;){var w=t[y],P=e[y];if(r)var B=i?r(P,w,y,e,t,a):r(w,P,y,t,e,a);if(B!==void 0){if(B)continue;g=!1;break}if(h){if(!nw(e,function(v,E){if(!rw(h,E)&&(w===v||o(w,v,n,r,a)))return h.push(E)})){g=!1;break}}else if(!(w===P||o(w,P,n,r,a))){g=!1;break}}return a.delete(t),a.delete(e),g}d(dp,"equalArrays");var pp=dp;function gp(t){var e=-1,n=Array(t.size);return t.forEach(function(r,o){n[++e]=[o,r]}),n}d(gp,"mapToArray");var aw=gp;function yp(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}d(yp,"setToArray");var sw=yp,lw=1,uw=2,cw="[object Boolean]",fw="[object Date]",dw="[object Error]",pw="[object Map]",gw="[object Number]",yw="[object RegExp]",mw="[object Set]",hw="[object String]",vw="[object Symbol]",Tw="[object ArrayBuffer]",_w="[object DataView]",Uc=ln?ln.prototype:void 0,ia=Uc?Uc.valueOf:void 0;function mp(t,e,n,r,o,a,i){switch(n){case _w:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Tw:return!(t.byteLength!=e.byteLength||!a(new Hc(t),new Hc(e)));case cw:case fw:case gw:return ka(+t,+e);case dw:return t.name==e.name&&t.message==e.message;case yw:case hw:return t==e+"";case pw:var s=aw;case mw:var l=r&lw;if(s||(s=sw),t.size!=e.size&&!l)return!1;var f=i.get(t);if(f)return f==e;r|=uw,i.set(t,e);var p=pp(s(t),s(e),r,o,a,i);return i.delete(t),p;case vw:if(ia)return ia.call(t)==ia.call(e)}return!1}d(mp,"equalByTag");var bw=mp,ww=1,xw=Object.prototype,Pw=xw.hasOwnProperty;function hp(t,e,n,r,o,a){var i=n&ww,s=Ac(t),l=s.length,f=Ac(e),p=f.length;if(l!=p&&!i)return!1;for(var y=l;y--;){var g=s[y];if(!(i?g in e:Pw.call(e,g)))return!1}var h=a.get(t),w=a.get(e);if(h&&w)return h==e&&w==t;var P=!0;a.set(t,e),a.set(e,t);for(var B=i;++y<l;){g=s[y];var v=t[g],E=e[g];if(r)var S=i?r(E,v,g,e,t,a):r(v,E,g,t,e,a);if(!(S===void 0?v===E||o(v,E,n,r,a):S)){P=!1;break}B||(B=g=="constructor")}if(P&&!B){var H=t.constructor,K=e.constructor;H!=K&&"constructor"in t&&"constructor"in e&&!(typeof H=="function"&&H instanceof H&&typeof K=="function"&&K instanceof K)&&(P=!1)}return a.delete(t),a.delete(e),P}d(hp,"equalObjects");var Bw=hp,Sw=1,Zc="[object Arguments]",$c="[object Array]",pi="[object Object]",Ew=Object.prototype,jc=Ew.hasOwnProperty;function vp(t,e,n,r,o,a){var i=Wt(t),s=Wt(e),l=i?$c:Dc(t),f=s?$c:Dc(e);l=l==Zc?pi:l,f=f==Zc?pi:f;var p=l==pi,y=f==pi,g=l==f;if(g&&da(t)){if(!da(e))return!1;i=!0,p=!1}if(g&&!p)return a||(a=new yi),i||ud(t)?pp(t,e,n,r,o,a):bw(t,e,l,n,r,o,a);if(!(n&Sw)){var h=p&&jc.call(t,"__wrapped__"),w=y&&jc.call(e,"__wrapped__");if(h||w){var P=h?t.value():t,B=w?e.value():e;return a||(a=new yi),o(P,B,n,r,a)}}return g?(a||(a=new yi),Bw(t,e,n,r,o,a)):!1}d(vp,"baseIsEqualDeep");var kw=vp;function Ra(t,e,n,r,o){return t===e?!0:t==null||e==null||!Bn(t)&&!Bn(e)?t!==t&&e!==e:kw(t,e,n,r,Ra,o)}d(Ra,"baseIsEqual");var yo=Ra,Iw=1,Aw=2;function Tp(t,e,n,r){var o=n.length,a=o,i=!r;if(t==null)return!a;for(t=Object(t);o--;){var s=n[o];if(i&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<a;){s=n[o];var l=s[0],f=t[l],p=s[1];if(i&&s[2]){if(f===void 0&&!(l in t))return!1}else{var y=new yi;if(r)var g=r(f,p,l,t,e,y);if(!(g===void 0?yo(p,f,Iw|Aw,r,y):g))return!1}}return!0}d(Tp,"baseIsMatch");var Cw=Tp;function _p(t){return t===t&&!Xn(t)}d(_p,"isStrictComparable");var bp=_p;function wp(t){for(var e=Aa(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,bp(o)]}return e}d(wp,"getMatchData");var Ow=wp;function xp(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}d(xp,"matchesStrictComparable");var Pp=xp;function Bp(t){var e=Ow(t);return e.length==1&&e[0][2]?Pp(e[0][0],e[0][1]):function(n){return n===t||Cw(n,t,e)}}d(Bp,"baseMatches");var Rw=Bp;function Sp(t,e){return t!=null&&e in Object(t)}d(Sp,"baseHasIn");var Mw=Sp;function Ep(t,e,n){e=go(e,t);for(var r=-1,o=e.length,a=!1;++r<o;){var i=Lr(e[r]);if(!(a=t!=null&&n(t,i)))break;t=t[i]}return a||++r!=o?a:(o=t==null?0:t.length,!!o&&Ia(o)&&Ea(i,o)&&(Wt(t)||rd(t)))}d(Ep,"hasPath");var Nw=Ep;function kp(t,e){return t!=null&&Nw(t,e,Mw)}d(kp,"hasIn");var Dw=kp,Hw=1,Uw=2;function Ip(t,e){return Ca(t)&&bp(e)?Pp(Lr(t),e):function(n){var r=bb(n,t);return r===void 0&&r===e?Dw(n,t):yo(e,r,Hw|Uw)}}d(Ip,"baseMatchesProperty");var Zw=Ip;function Ap(t){return function(e){return e?.[t]}}d(Ap,"baseProperty");var $w=Ap;function Cp(t){return function(e){return Oa(e,t)}}d(Cp,"basePropertyDeep");var jw=Cp;function Op(t){return Ca(t)?$w(Lr(t)):jw(t)}d(Op,"property");var Kw=Op;function Rp(t){return typeof t=="function"?t:t==null?gT:typeof t=="object"?Wt(t)?Zw(t[0],t[1]):Rw(t):Kw(t)}d(Rp,"baseIteratee");var Ma=Rp;function Mp(t){return function(e,n,r){for(var o=-1,a=Object(e),i=r(e),s=i.length;s--;){var l=i[t?s:++o];if(n(a[l],l,a)===!1)break}return e}}d(Mp,"createBaseFor");var Lw=Mp,Fw=Lw(),Ww=Fw;function Np(t,e){return t&&Ww(t,e,Aa)}d(Np,"baseForOwn");var zw=Np;function Dp(t,e){return yo(t,e)}d(Dp,"isEqual");var Jn=Dp;function Hp(t,e,n){n=typeof n=="function"?n:void 0;var r=n?n(t,e):void 0;return r===void 0?yo(t,e,void 0,n):!!r}d(Hp,"isEqualWith");var qw=Hp;function Up(t){return t===void 0}d(Up,"isUndefined");var Kc=Up;function Zp(t,e){var n={};return e=Ma(e,3),zw(t,function(r,o,a){zf(n,o,e(r,o,a))}),n}d(Zp,"mapValues");var Gw=Zp,Vw="Expected a function";function $p(t){if(typeof t!="function")throw new TypeError(Vw);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}d($p,"negate");var Jw=$p;function jp(t,e,n,r){if(!Xn(t))return t;e=go(e,t);for(var o=-1,a=e.length,i=a-1,s=t;s!=null&&++o<a;){var l=Lr(e[o]),f=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(o!=i){var p=s[l];f=r?r(p,l,s):void 0,f===void 0&&(f=Xn(p)?p:Ea(e[o+1])?[]:{})}UT(s,l,f),s=s[l]}return t}d(jp,"baseSet");var Xw=jp;function Kp(t,e,n){for(var r=-1,o=e.length,a={};++r<o;){var i=e[r],s=Oa(t,i);n(s,i)&&Xw(a,go(i,t),s)}return a}d(Kp,"basePickBy");var Yw=Kp;function Lp(t,e){if(t==null)return{};var n=Mf(jb(t),function(r){return[r]});return e=Ma(e),Yw(t,n,function(r,o){return e(r,o[0])})}d(Lp,"pickBy");var Qw=Lp;function Fp(t,e){return Qw(t,Jw(Ma(e)))}d(Fp,"omitBy");var Lc=Fp,ex=d(t=>{let e=t.checks;return e.length===0?"":e.map(tx).join("")},"generateStringChecks"),tx=d(t=>{switch(t.kind){case"min":return`.min(${se(t.value)}, ${se(t.message)})`;case"max":return`.max(${se(t.value)}, ${se(t.message)})`;case"length":return`.length(${se(t.value)}, ${se(t.message)})`;case"email":return`.email(${se(t.message)})`;case"url":return`.url(${se(t.message)})`;case"emoji":return`.emoji(${se(t.message)})`;case"uuid":return`.uuid(${se(t.message)})`;case"cuid":return`.cuid(${se(t.message)})`;case"cuid2":return`.cuid2(${se(t.message)})`;case"ulid":return`.ulid(${se(t.message)})`;case"includes":let e=Vn({message:t.message,position:t.position});return`.includes(${se(t.value)}, ${e})`;case"startsWith":return`.startsWith(${se(t.value)}, ${se(t.message)})`;case"endsWith":return`.endsWith(${se(t.value)}, ${se(t.message)})`;case"regex":return`.regex(${String(t.regex)}, ${se(t.message)})`;case"trim":return".trim()";case"toLowerCase":return".toLowerCase()";case"toUpperCase":return".toUpperCase()";case"datetime":let r=t.precision===null?void 0:t.precision;return`.datetime(${Vn({message:t.message,precision:r,offset:t.offset})})`;case"ip":return`.ip(${Vn({message:t.message,version:t.version})})`;default:return""}},"_generateStringCheck"),nx=d(t=>{let e=t.checks;return e.length===0?"":e.map(rx).join("")},"generateNumberChecks"),rx=d(t=>{switch(t.kind){case"min":return`.min(${se(t.value)}, ${se(t.message)})`;case"max":return`.max(${se(t.value)}, ${se(t.message)})`;case"int":return`.int(${se(t.message)})`;case"multipleOf":return`.multipleOf(${se(t.value)}, ${se(t.message)})`;case"finite":return`.finite(${se(t.message)})`;default:return""}},"_generateNumberCheck"),ix=d(t=>{let e=t.checks;return e.length===0?"":e.map(ox).join("")},"generateBigIntChecks"),ox=d(t=>{switch(t.kind){case"min":return`.min(${se(t.value)}, ${se(t.message)})`;case"max":return`.max(${se(t.value)}, ${se(t.message)})`;case"multipleOf":return`.multipleOf(${se(t.value)}, ${se(t.message)})`;default:return""}},"_generateBigIntCheck"),ax=d(t=>{let e=t.checks;return e.length===0?"":e.map(sx).join("")},"generateDateChecks"),sx=d(t=>{switch(t.kind){case"min":return`.min(${Fc(t.value)}, ${se(t.message)})`;case"max":return`.max(${Fc(t.value)}, ${se(t.message)})`;default:return""}},"_generateDateCheck"),Fc=d(t=>`new Date(${t})`,"dateTs"),lx=d(t=>{let e=[];if(t.exactLength){let{value:n,message:r}=t.exactLength;e.push(`.length(${se(n)}, ${se(r)})`)}if(t.minLength){let{value:n,message:r}=t.minLength;e.push(`.min(${se(n)}, ${se(r)})`)}if(t.maxLength){let{value:n,message:r}=t.maxLength;e.push(`.max(${se(n)}, ${se(r)})`)}return e.join("")},"generateArrayChecks"),ux=d(t=>{let e=[];if(t.minSize){let{value:n,message:r}=t.minSize;e.push(`.min(${se(n)}, ${se(r)})`)}if(t.maxSize){let{value:n,message:r}=t.maxSize;e.push(`.max(${se(n)}, ${se(r)})`)}return e.join("")},"generateSetChecks");function Na(t){return Fe(t)}d(Na,"toTypescriptSchema");function Fe(t){let n=t._def;switch(n.typeName){case M.ZodFirstPartyTypeKind.ZodString:return`z.string()${ex(n)}${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodNumber:return`z.number()${nx(n)}${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodNaN:return`z.nan()${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodBigInt:return`z.bigint()${ix(n)}${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodBoolean:return`z.boolean()${Ce(n)}${Ae(t._def)}`.trim();case M.ZodFirstPartyTypeKind.ZodDate:return`z.date()${ax(n)}${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodUndefined:return`z.undefined()${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodNull:return`z.null()${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodAny:return`z.any()${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodUnknown:return`z.unknown()${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodNever:return`z.never()${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodVoid:return`z.void()${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodArray:return`z.array(${Fe(n.type)})${lx(n)}${Ce(n)}${Ae(n)}`;case M.ZodFirstPartyTypeKind.ZodObject:let r=Gw(n.shape(),Fe),o=t.additionalProperties(),a=o?`.catchall(${Fe(o)})`:"";return["z.object({",...Object.entries(r).map(([ee,ge])=>` ${ee}: ${ge},`),`})${a}${Ce(n)}${Ae(n)}`].join(`
|
|
23
|
-
`).trim();case M.ZodFirstPartyTypeKind.ZodUnion:return`z.union([${n.options.map(Fe).join(", ")}])${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let s=n.options.map(Fe);return`z.discriminatedUnion(${se(n.discriminator)}, [${s.join(", ")}])${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodIntersection:let f=Fe(n.left),p=Fe(n.right);return`z.intersection(${f}, ${p})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodTuple:return`z.tuple([${n.items.map(Fe).join(", ")}])${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodRecord:let g=Fe(n.keyType),h=Fe(n.valueType);return`z.record(${g}, ${h})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodMap:let w=Fe(n.keyType),P=Fe(n.valueType);return`z.map(${w}, ${P})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodSet:return`z.set(${Fe(n.valueType)})${ux(n)}${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodFunction:let B=n.args.items.map(Fe),v=B.length?`.args(${B.join(", ")})`:"",E=Fe(n.returns);return`z.function()${v}.returns(${E})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodLazy:return`z.lazy(() => ${Fe(n.getter())})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodLiteral:return`z.literal(${se(n.value)})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodEnum:return`z.enum([${n.values.map(se).join(", ")}])${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodEffects:throw new Tn(M.ZodFirstPartyTypeKind.ZodEffects);case M.ZodFirstPartyTypeKind.ZodNativeEnum:throw new Tn(M.ZodFirstPartyTypeKind.ZodNativeEnum);case M.ZodFirstPartyTypeKind.ZodOptional:return`z.optional(${Fe(n.innerType)})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodNullable:return`z.nullable(${Fe(n.innerType)})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodDefault:let K=Vn(n.defaultValue());return`z.default(${Fe(n.innerType)}, ${K})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodCatch:throw new Tn(M.ZodFirstPartyTypeKind.ZodCatch);case M.ZodFirstPartyTypeKind.ZodPromise:return`z.promise(${Fe(n.type)})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodBranded:throw new Tn(M.ZodFirstPartyTypeKind.ZodBranded);case M.ZodFirstPartyTypeKind.ZodPipeline:throw new Tn(M.ZodFirstPartyTypeKind.ZodPipeline);case M.ZodFirstPartyTypeKind.ZodSymbol:throw new Tn(M.ZodFirstPartyTypeKind.ZodSymbol);case M.ZodFirstPartyTypeKind.ZodReadonly:return`z.readonly(${Fe(n.innerType)})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodRef:return`z.ref(${se(n.uri)})${Ce(n)}${Ae(n)}`.trim();default:be.assertNever(n)}}d(Fe,"sUnwrapZod");var Ae=d(t=>t.description?`.describe(${se(t.description)})`:"","_maybeDescribe"),Ce=d(t=>`${cx(t)}${fx(t)}${dx(t)}${px(t)}${gx(t)}${yx(t)}${mx(t)}`,"_addZuiExtensions"),cx=d(t=>{var e;return(e=t[le])!=null&&e.title?`.title(${se(t[le].title)})`:""},"_maybeTitle"),fx=d(t=>{var e;return(e=t[le])!=null&&e.displayAs?`.displayAs(${ef({id:t[le].displayAs[0],params:t[le].displayAs[1]})})`:""},"_maybeDisplayAs"),dx=d(t=>{var e;return(e=t[le])!=null&&e.disabled?`.disabled(${t[le].disabled})`:""},"_maybeDisabled"),px=d(t=>{var e;return(e=t[le])!=null&&e.hidden?`.hidden(${t[le].hidden})`:""},"_maybeHidden"),gx=d(t=>{var e;return(e=t[le])!=null&&e.placeholder?`.placeholder(${se(t[le].placeholder)})`:""},"_maybePlaceholder"),yx=d(t=>{var e;return(e=t[le])!=null&&e.secret?".secret()":""},"_maybeSecret"),mx=d(t=>{var e;let n=["title","tooltip","displayAs","disabled","hidden","placeholder","secret","coerce"],r=Object.entries((e=t[le])!=null?e:{}).filter(([o])=>!n.includes(o));return r.length>0?`.metadata(${ef(Object.fromEntries(r))})`:""},"_maybeSetMetadata"),hx=d(t=>{let e={type:"number",description:t.description,"x-zui":t._def["x-zui"]};t._def[le]&&(e[le]=t._def[le]);for(let n of t._def.checks)switch(n.kind){case"min":{let r=n.inclusive?"minimum":"exclusiveMinimum",o=n.inclusive?"exclusiveMinimum":"minimum";e[r]=n.value,delete e[o];break}case"max":{let r=n.inclusive?"maximum":"exclusiveMaximum",o=n.inclusive?"exclusiveMaximum":"maximum";e[r]=n.value,delete e[o];break}case"int":e.type="integer";break;case"finite":{e.format="finite";break}case"multipleOf":e.multipleOf=n.value;break;default:}return e},"zodNumberToJsonNumber"),Wp="\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}",zp="(([+-]\\d{2}(:?\\d{2})?)|Z)",vx="Z",qp="(\\.\\d+)?",ma="\\.\\d{",Tx="}",Gp=d(t=>{let e=t.precision?ma+t.precision+Tx:t.precision===0?"":qp,n=t.offset?zp:vx;return new RegExp(`^${Wp}${e}${n}$`)},"generateDatetimeRegex"),_x=d(t=>({precision:bx(t),offset:t.endsWith(`${zp}$`)}),"extractPrecisionAndOffset"),bx=d(t=>{let e=t.slice(1+Wp.length);return e.startsWith(qp)?null:e.startsWith(ma)?parseInt(e.slice(ma.length)):0},"_extractPrecision"),Rr={};io(Rr,{escapeSpecialChars:()=>wx});var wx=d(t=>t.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeSpecialChars");function Da(t,e,n,r){r?.errorMessages&&n&&(t.errorMessage=N(_({},t.errorMessage),{[e]:n}))}d(Da,"addErrorMessage");function Re(t,e,n,r,o){t[e]=n,Da(t,e,r,o)}d(Re,"setResponseValueAndErrors");var Ye={cuid:"^[cC][^\\s-]{8,}$",cuid2:"^[a-z][a-z0-9]*$",ulid:"^[0-9A-HJKMNP-TV-Z]{26}$",email:"^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_+-\\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\\-]*\\.)+[a-zA-Z]{2,}$",emoji:"^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uuid:"^[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}$",ipv4:"^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$",ipv6:"^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$"};function Ha(t,e){let n=_({type:"string"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{});function r(o){return e.patternStrategy==="escape"?Rr.escapeSpecialChars(o):o}if(d(r,"processPattern"),t.checks)for(let o of t.checks)switch(o.kind){case"min":Re(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,o.message,e);break;case"max":Re(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value,o.message,e);break;case"email":switch(e.emailStrategy){case"format:email":vn(n,"email",o.message,e);break;case"format:idn-email":vn(n,"idn-email",o.message,e);break;case"pattern:zod":Kt(n,Ye.email,o.message,e);break}break;case"url":vn(n,"uri",o.message,e);break;case"uuid":vn(n,"uuid",o.message,e);break;case"regex":Kt(n,o.regex.source,o.message,e);break;case"cuid":Kt(n,Ye.cuid,o.message,e);break;case"cuid2":Kt(n,Ye.cuid2,o.message,e);break;case"startsWith":Kt(n,"^"+r(o.value),o.message,e);break;case"endsWith":Kt(n,r(o.value)+"$",o.message,e);break;case"datetime":vn(n,"date-time",o.message,e);break;case"length":Re(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,o.message,e),Re(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value,o.message,e);break;case"includes":{Kt(n,r(o.value),o.message,e);break}case"ip":{o.version!=="v6"&&vn(n,"ipv4",o.message,e),o.version!=="v4"&&vn(n,"ipv6",o.message,e);break}case"emoji":Kt(n,Ye.emoji,o.message,e);break;case"ulid":{Kt(n,Ye.ulid,o.message,e);break}case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}d(Ha,"parseStringDef");var vn=d((t,e,n,r)=>{var o;t.format||(o=t.anyOf)!=null&&o.some(a=>a.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push(_({format:t.format},t.errorMessage&&r.errorMessages&&{errorMessage:{format:t.errorMessage.format}})),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push(_({format:e},n&&r.errorMessages&&{errorMessage:{format:n}}))):Re(t,"format",e,n,r)},"addFormat"),Kt=d((t,e,n,r)=>{var o;t.pattern||(o=t.allOf)!=null&&o.some(a=>a.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push(_({pattern:t.pattern},t.errorMessage&&r.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}})),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push(_({pattern:e},n&&r.errorMessages&&{errorMessage:{pattern:n}}))):Re(t,"pattern",e,n,r)},"addPattern"),xx=d(t=>{let e={type:"string",description:t.description,"x-zui":t._def["x-zui"]};t._def[le]&&(e[le]=t._def[le]);for(let n of t._def.checks)switch(n.kind){case"cuid":e.format="cuid",e.pattern=Ye.cuid;break;case"cuid2":e.format="cuid2",e.pattern=Ye.cuid2;break;case"ulid":e.format="ulid",e.pattern=Ye.ulid;break;case"uuid":e.format="uuid",e.pattern=Ye.uuid;break;case"emoji":e.format="emoji",e.pattern=Ye.emoji;break;case"email":e.format="email",e.pattern=Ye.email;break;case"ip":e.format=n.version==="v6"?"ipv6":"ipv4",e.pattern=n.version==="v6"?Ye.ipv6:Ye.ipv4;break;case"datetime":e.format="date-time",e.pattern=Gp(n).source,e[le]=N(_({},e[le]),{precision:n.precision,offset:n.offset});break;case"url":e.format="uri";break;case"endsWith":e.pattern=`${Rr.escapeSpecialChars(n.value)}$`;break;case"startsWith":e.pattern=`^${Rr.escapeSpecialChars(n.value)}`;break;case"includes":let r=n.position&&n.position>=1?`^(?:.{${n.position}}).*`:"";e.pattern=`${r}${Rr.escapeSpecialChars(n.value)}`;break;case"regex":e.pattern=n.regex.source;break;case"length":e.minLength=e.maxLength=Math.max(0,n.value);break;case"min":e.minLength=Math.max(0,n.value);break;case"max":e.maxLength=Math.max(0,n.value);break;default:throw new cf({zodType:M.ZodFirstPartyTypeKind.ZodString,checkKind:n.kind})}return e},"zodStringToJsonString"),Px=d((t,e)=>{let n={type:"array",description:t.description,items:e(t._def.type),"x-zui":t._def["x-zui"]};return t._def[le]&&(n[le]=t._def[le]),t._def.minLength&&(n.minItems=t._def.minLength.value),t._def.maxLength&&(n.maxItems=t._def.maxLength.value),t._def.exactLength&&(n.minItems=t._def.exactLength.value,n.maxItems=t._def.exactLength.value),n},"zodArrayToJsonArray"),Bx=d((t,e)=>{let n={type:"array",description:t.description,uniqueItems:!0,items:e(t._def.valueType),"x-zui":t._def["x-zui"]};return t._def[le]&&(n[le]=t._def[le]),t._def.minSize&&(n.minItems=t._def.minSize.value),t._def.maxSize&&(n.maxItems=t._def.maxSize.value),n},"zodSetToJsonSet"),Sx=d((t,e)=>{let n={type:"array",description:t.description,items:t._def.items.map(r=>e(r))};return t._def[le]&&(n[le]=t._def[le]),t._def.rest&&(n.additionalItems=e(t._def.rest)),n},"zodTupleToJsonTuple");function st(t){let e=t,n=e._def;switch(n.typeName){case M.ZodFirstPartyTypeKind.ZodString:return xx(e);case M.ZodFirstPartyTypeKind.ZodNumber:return hx(e);case M.ZodFirstPartyTypeKind.ZodNaN:throw new pt(M.ZodFirstPartyTypeKind.ZodNaN);case M.ZodFirstPartyTypeKind.ZodBigInt:throw new pt(M.ZodFirstPartyTypeKind.ZodBigInt,{suggestedAlternative:"serialize bigint to string"});case M.ZodFirstPartyTypeKind.ZodBoolean:return{type:"boolean",description:n.description,"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodDate:throw new pt(M.ZodFirstPartyTypeKind.ZodDate,{suggestedAlternative:"use z.string().datetime() instead"});case M.ZodFirstPartyTypeKind.ZodUndefined:return oa(n);case M.ZodFirstPartyTypeKind.ZodNull:return aa(n);case M.ZodFirstPartyTypeKind.ZodAny:return{description:n.description,"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodUnknown:return{description:n.description,"x-zui":N(_({},n["x-zui"]),{def:{typeName:M.ZodFirstPartyTypeKind.ZodUnknown}})};case M.ZodFirstPartyTypeKind.ZodNever:return{not:!0,description:n.description,"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodVoid:throw new pt(M.ZodFirstPartyTypeKind.ZodVoid);case M.ZodFirstPartyTypeKind.ZodArray:return Px(e,st);case M.ZodFirstPartyTypeKind.ZodObject:let r=Object.entries(n.shape()),o=r.filter(([p,y])=>!y.isOptional()),a=o.length?o.map(([p])=>p):void 0,i=r.map(([p,y])=>[p,y.mandatory()]).map(([p,y])=>[p,st(y)]),s=!1;return n.unknownKeys instanceof M.ZodType?s=st(n.unknownKeys):n.unknownKeys==="passthrough"&&(s=!0),{type:"object",description:n.description,properties:Object.fromEntries(i),required:a,additionalProperties:s,"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodUnion:return{description:n.description,anyOf:n.options.map(p=>st(p)),"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return{description:n.description,anyOf:n.options.map(p=>st(p)),"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodIntersection:let l=st(n.left),f=st(n.right);return"additionalProperties"in l&&delete l.additionalProperties,"additionalProperties"in f&&delete f.additionalProperties,{description:n.description,allOf:[l,f],"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodTuple:return Sx(e,st);case M.ZodFirstPartyTypeKind.ZodRecord:return{type:"object",description:n.description,additionalProperties:st(n.valueType),"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodMap:throw new pt(M.ZodFirstPartyTypeKind.ZodMap);case M.ZodFirstPartyTypeKind.ZodSet:return Bx(e,st);case M.ZodFirstPartyTypeKind.ZodFunction:throw new pt(M.ZodFirstPartyTypeKind.ZodFunction);case M.ZodFirstPartyTypeKind.ZodLazy:throw new pt(M.ZodFirstPartyTypeKind.ZodLazy);case M.ZodFirstPartyTypeKind.ZodLiteral:if(typeof n.value=="string")return{type:"string",description:n.description,const:n.value,"x-zui":n["x-zui"]};if(typeof n.value=="number")return{type:"number",description:n.description,const:n.value,"x-zui":n["x-zui"]};if(typeof n.value=="boolean")return{type:"boolean",description:n.description,const:n.value,"x-zui":n["x-zui"]};if(n.value===null)return aa(n);if(n.value===void 0)return oa(n);{M.util.assertEqual(!0);let p=typeof n.value;throw new ao(`Unsupported literal type: "${p}"`)}case M.ZodFirstPartyTypeKind.ZodEnum:return{type:"string",description:n.description,enum:n.values,"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodEffects:throw new pt(M.ZodFirstPartyTypeKind.ZodEffects);case M.ZodFirstPartyTypeKind.ZodNativeEnum:throw new pt(M.ZodFirstPartyTypeKind.ZodNativeEnum);case M.ZodFirstPartyTypeKind.ZodOptional:return{description:n.description,anyOf:[st(n.innerType),oa()],"x-zui":N(_({},n["x-zui"]),{def:{typeName:M.ZodFirstPartyTypeKind.ZodOptional}})};case M.ZodFirstPartyTypeKind.ZodNullable:return{anyOf:[st(n.innerType),aa()],"x-zui":N(_({},n["x-zui"]),{def:{typeName:M.ZodFirstPartyTypeKind.ZodNullable}})};case M.ZodFirstPartyTypeKind.ZodDefault:return N(_({},st(n.innerType)),{default:n.defaultValue()});case M.ZodFirstPartyTypeKind.ZodCatch:throw new pt(M.ZodFirstPartyTypeKind.ZodCatch);case M.ZodFirstPartyTypeKind.ZodPromise:throw new pt(M.ZodFirstPartyTypeKind.ZodPromise);case M.ZodFirstPartyTypeKind.ZodBranded:throw new pt(M.ZodFirstPartyTypeKind.ZodBranded);case M.ZodFirstPartyTypeKind.ZodPipeline:throw new pt(M.ZodFirstPartyTypeKind.ZodPipeline);case M.ZodFirstPartyTypeKind.ZodSymbol:throw new pt(M.ZodFirstPartyTypeKind.ZodPipeline);case M.ZodFirstPartyTypeKind.ZodReadonly:return N(_({},st(n.innerType)),{readOnly:!0});case M.ZodFirstPartyTypeKind.ZodRef:return{$ref:n.uri,description:n.description,"x-zui":n["x-zui"]};default:M.util.assertNever(n)}}d(st,"toJSONSchema");var oa=d(t=>({not:!0,description:t?.description,"x-zui":N(_({},t?.["x-zui"]),{def:{typeName:M.ZodFirstPartyTypeKind.ZodUndefined}})}),"undefinedSchema"),aa=d(t=>({type:"null",description:t?.description,"x-zui":t?.["x-zui"]}),"nullSchema"),Vp=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};d(Vp,"ParseInputLazyPath");var Ct=Vp,Wc=d((t,e)=>{if(Zr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Ft(t.common.issues);return this._error=n,this._error}}},"handleResult"),Jp=class{constructor(e){this.__type__="ZuiType",this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._metadataRoot._def.description}dereference(e){return this}getReferences(){return[]}clone(){let e=this.constructor;return new e(_({},this._def))}_getType(e){return an(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:an(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Tt,ctx:{common:e.parent.common,data:e.data,parsedType:an(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Si(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;let o={common:{issues:[],async:(r=n?.async)!=null?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:an(e)},a=this._parseSync({data:e,path:o.path,parent:o});return Wc(o,a)}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:an(e)},o=this._parse({data:e,path:r.path,parent:r}),a=await(Si(o)?o:Promise.resolve(o));return Wc(r,a)}refine(e,n){let r=d(o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n,"getIssueProperties");return this._refinement((o,a)=>{let i=e(o),s=d(()=>a.addIssue(_({code:G.custom},r(o))),"setError");return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(s(),!1)):i?!0:(s(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new Sn({schema:this,typeName:"ZodEffects",effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return sn.create(this,this._def)}nullable(){return Yn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jr.create(this,this._def)}promise(){return vo.create(this,this._def)}mandatory(){return this}or(e){return Ya.create([this,e],this._def)}and(e){return Wa.create(this,e,this._def)}transform(e){return new Sn(N(_({},me(this._def)),{schema:this,typeName:"ZodEffects",effect:{type:"transform",transform:e}}))}default(e){let n=typeof e=="function"?e:()=>e;return new mo(N(_({},me(this._def)),{innerType:this,defaultValue:n,typeName:"ZodDefault"}))}brand(){return new ja(_({typeName:"ZodBranded",type:this},me(this._def)))}catch(e){let n=typeof e=="function"?e:()=>e;return new Ka(N(_({},me(this._def)),{innerType:this,catchValue:n,typeName:"ZodCatch"}))}describe(e){let n=this.clone();return n._metadataRoot._def.description=e,n}pipe(e){return Xa.create(this,e)}readonly(){return To.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}metadata(e){var n,r,o;let a=this.clone(),i=a._metadataRoot;(o=(n=i._def)[r=le])!=null||(n[r]={});for(let[s,l]of Object.entries(e))i._def[le]=N(_({},i._def[le]),{[s]:l});return a}getMetadata(){return _({},this._metadataRoot._def[le])}setMetadata(e){this._metadataRoot._def[le]=_({},e)}get ui(){return _({},this._metadataRoot._def[le])}get _metadataRoot(){return this.naked()}displayAs(e){return this.metadata({displayAs:[e.id,e.params]})}title(e){return this.metadata({title:e})}hidden(e){let n;return e===void 0?n=!0:typeof e=="function"?n=e.toString():n=e,this.metadata({hidden:n})}disabled(e){let n;return e===void 0?n=!0:typeof e=="function"?n=e.toString():n=e,this.metadata({disabled:n})}placeholder(e){return this.metadata({placeholder:e})}toJSONSchema(){return st(this)}toTypescriptType(e){return Pa(this,e)}toTypescriptSchema(){return Na(this)}naked(){return this}};d(Jp,"ZodType");var he=Jp,Xp=(t=>(t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodRef="ZodRef",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly",t))(Xp||{}),be;(t=>{t.assertEqual=d(o=>o,"assertEqual");function e(o){}t.assertIs=e,d(e,"assertIs");function n(o){throw new Error("assertNever called")}t.assertNever=n,d(n,"assertNever"),t.arrayToEnum=d(o=>{let a={};for(let i of o)a[i]=i;return a},"arrayToEnum"),t.getValidEnumValues=d(o=>{let a=(0,t.objectKeys)(o).filter(s=>typeof o[o[s]]!="number"),i={};for(let s of a)i[s]=o[s];return(0,t.objectValues)(i)},"getValidEnumValues"),t.objectValues=d(o=>(0,t.objectKeys)(o).map(function(a){return o[a]}),"objectValues"),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let a=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&a.push(i);return a},t.find=d((o,a)=>{for(let i of o)if(a(i))return i},"find"),t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,a=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=r,d(r,"joinValues"),t.jsonStringifyReplacer=d((o,a)=>typeof a=="bigint"?a.toString():a,"jsonStringifyReplacer"),t.compareFunctions=d((o,a)=>o.toString()===a.toString(),"compareFunctions"),t.mock=d(()=>({}),"mock")})(be||(be={}));var ha;(t=>{t.mergeShapes=d((e,n)=>_(_({},e),n),"mergeShapes")})(ha||(ha={}));var ne=be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),an=d(t=>{switch(typeof t){case"undefined":return ne.undefined;case"string":return ne.string;case"number":return isNaN(t)?ne.nan:ne.number;case"boolean":return ne.boolean;case"function":return ne.function;case"bigint":return ne.bigint;case"symbol":return ne.symbol;case"object":return Array.isArray(t)?ne.array:t===null?ne.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ne.promise:typeof Map<"u"&&t instanceof Map?ne.map:typeof Set<"u"&&t instanceof Set?ne.set:typeof Date<"u"&&t instanceof Date?ne.date:ne.object;default:return ne.unknown}},"getParsedType");function me(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o,supportsExtensions:a,[le]:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);let s=i?Object.fromEntries(Object.entries(i).filter(([f])=>f!=="secret"||a?.includes("secret"))):void 0;return e?{errorMap:e,description:o,[le]:s}:{errorMap:d((f,p)=>f.code!=="invalid_type"?{message:p.defaultError}:typeof p.data>"u"?{message:r??p.defaultError}:{message:n??p.defaultError},"customMap"),description:o,[le]:s}}d(me,"processCreateParams");var Ua=d((t,e)=>{let n;switch(t.code){case G.invalid_type:t.received===ne.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case G.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,be.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:n=`Unrecognized key(s) in object: ${be.joinValues(t.keys,", ")}`;break;case G.invalid_union:n="Invalid input";break;case G.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${be.joinValues(t.options)}`;break;case G.invalid_enum_value:n=`Invalid enum value. Expected ${be.joinValues(t.options)}, received '${t.received}'`;break;case G.invalid_arguments:n="Invalid function arguments";break;case G.invalid_return_type:n="Invalid function return type";break;case G.invalid_date:n="Invalid date";break;case G.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:be.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case G.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case G.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case G.custom:n="Invalid input";break;case G.invalid_intersection_types:n="Intersection results could not be merged";break;case G.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case G.not_finite:n="Number must be finite";break;case G.unresolved_reference:n="Unresolved reference";break;default:n=e.defaultError,be.assertNever(t)}return{message:n}},"errorMap"),zc=Ua,G=be.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","unresolved_reference"]),Ex=d(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Pi=class Yp extends Error{constructor(e){super(),this.issues=[],this.addIssue=d(r=>{this.issues=[...this.issues,r]},"addIssue"),this.addIssues=d((r=[])=>{this.issues=[...this.issues,...r]},"addIssues");let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let n=e||function(a){return a.message},r={_errors:[]},o=d(a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let s=r,l=0;for(;l<i.path.length;){let f=i.path[l];l===i.path.length-1?(s[f]=s[f]||{_errors:[]},s[f]._errors.push(n(i))):s[f]=s[f]||{_errors:[]},s=s[f],l++}}},"processError");return o(this),r}static assert(e){if(!(e instanceof Yp))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,be.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(e(o))):r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};d(Pi,"ZodError");Pi.create=d(t=>new Pi(t),"create");var Ft=Pi,Qp=Ua;function eg(t){Qp=t}d(eg,"setErrorMap");function Ur(){return Qp}d(Ur,"getErrorMap");var Bi=d(t=>{var e;let{data:n,path:r,errorMaps:o,issueData:a}=t,i=[...r,...a.path||[]],s=N(_({},a),{path:i}),l="",f=o.filter(p=>!!p).slice().reverse();for(let p of f)l=p(s,{data:n,defaultError:l}).message;return N(_({},a),{path:i,message:(e=a.message)!=null?e:l})},"makeIssue"),kx=[];function te(t,e){let n=Bi({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ur(),Ua].filter(r=>!!r)});t.common.issues.push(n)}d(te,"addIssueToContext");var tg=class ng{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return pe;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n)r.push({key:await o.key,value:await o.value});return ng.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:a,value:i}=o;if(a.status==="aborted"||i.status==="aborted")return pe;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[a.value]=i.value)}return{status:e.value,value:r}}};d(tg,"ParseStatus");var Tt=tg,pe=Object.freeze({status:"aborted"}),Gn=d(t=>({status:"dirty",value:t}),"DIRTY"),gt=d(t=>({status:"valid",value:t}),"OK"),va=d(t=>t.status==="aborted","isAborted"),Ta=d(t=>t.status==="dirty","isDirty"),Zr=d(t=>t.status==="valid","isValid"),Si=d(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync"),ue;(t=>{t.errToObj=d(e=>typeof e=="string"?{message:e}:e||{},"errToObj"),t.toString=d(e=>typeof e=="string"?e:e?.message,"toString")})(ue||(ue={}));var Ei=class rg extends he{constructor(){super(...arguments),this._any=!0}_parse(e){return gt(e.data)}isEqual(e){return e instanceof rg}};d(Ei,"ZodAny");Ei.create=d(t=>new Ei(_({typeName:"ZodAny"},me(t))),"create");var $r=Ei,ki=class bn extends he{dereference(e){return new bn(N(_({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}clone(){return new bn(N(_({},this._def),{type:this._def.type.clone()}))}isEqual(e){var n,r,o,a,i,s;return e instanceof bn?Jn((n=this._def.exactLength)==null?void 0:n.value,(r=e._def.exactLength)==null?void 0:r.value)&&Jn((o=this._def.maxLength)==null?void 0:o.value,(a=e._def.maxLength)==null?void 0:a.value)&&Jn((i=this._def.minLength)==null?void 0:i.value,(s=e._def.minLength)==null?void 0:s.value)&&this._def.type.isEqual(e._def.type):!1}_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==ne.array)return te(n,{code:G.invalid_type,expected:ne.array,received:n.parsedType}),pe;if(o.exactLength!==null){let i=n.data.length>o.exactLength.value,s=n.data.length<o.exactLength.value;(i||s)&&(te(n,{code:i?G.too_big:G.too_small,minimum:s?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(te(n,{code:G.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(te(n,{code:G.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,s)=>o.type._parseAsync(new Ct(n,i,n.path,s)))).then(i=>Tt.mergeArray(r,i));let a=[...n.data].map((i,s)=>o.type._parseSync(new Ct(n,i,n.path,s)));return Tt.mergeArray(r,a)}get element(){return this._def.type}min(e,n){return new bn(N(_({},this._def),{minLength:{value:e,message:ue.toString(n)}}))}max(e,n){return new bn(N(_({},this._def),{maxLength:{value:e,message:ue.toString(n)}}))}length(e,n){return new bn(N(_({},this._def),{exactLength:{value:e,message:ue.toString(n)}}))}nonempty(e){return this.min(1,e)}};d(ki,"ZodArray");ki.create=d((t,e)=>new ki(_({type:t,minLength:null,maxLength:null,exactLength:null,typeName:"ZodArray"},me(e))),"create");var jr=ki,Ix=d((t,e)=>ig(t,e,new WeakSet),"isEqual"),ig=d((t,e,n)=>qw(t,e,Ax(n)),"_isEqualWithVisitedTracking"),Ax=d(t=>(e,n)=>{if(kc(e)&&!t.has(e)&&kc(n)&&!t.has(n)){let r=Lc(e,Kc),o=Lc(n,Kc);return t.add(r).add(o).add(e).add(n),ig(r,o,t)}},"_customizerWithVisitedTracking"),Cx={compare:Ix},og=class{constructor(e=[],n={}){this._options=_(_({},Cx),n),this._items=[];for(let r of e)this.add(r)}get items(){return[...this._items]}get size(){return this._items.length}has(e){return this._items.some(n=>this._options.compare(n,e))}add(e){this.has(e)||this._items.push(e)}isEqual(e){return this.size!==e.size?!1:this.isSubsetOf(e)&&e.isSubsetOf(this)}isSubsetOf(e){return this.size>e.size?!1:this._items.every(n=>e.has(n))}};d(og,"CustomSet");var et=og,Ii=class mi extends he{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ne.bigint){let a=this._getOrReturnCtx(e);return te(a,{code:G.invalid_type,expected:ne.bigint,received:a.parsedType}),pe}let r,o=new Tt;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):be.assertNever(a);return{status:o.value,value:e.data}}isEqual(e){if(!(e instanceof mi)||this._def.coerce!==e._def.coerce)return!1;let n=new et(this._def.checks),r=new et(e._def.checks);return n.isEqual(r)}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,r,o){return new mi(N(_({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ue.toString(o)}]}))}_addCheck(e){return new mi(N(_({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};d(Ii,"ZodBigInt");Ii.create=d(t=>{var e;return new Ii(_({checks:[],typeName:"ZodBigInt",coerce:(e=t?.coerce)!=null?e:!1},me(t)))},"create");var Za=Ii,Ai=class ag extends he{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ne.boolean){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.boolean,received:r.parsedType}),pe}return gt(e.data)}isEqual(e){return e instanceof ag?this._def.coerce===e._def.coerce:!1}};d(Ai,"ZodBoolean");Ai.create=d(t=>new Ai(_({typeName:"ZodBoolean",coerce:t?.coerce||!1},me(t))),"create");var $a=Ai,Ox=Symbol("zod_brand"),sg=class _r extends he{dereference(e){return new _r(N(_({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}clone(){return new _r(N(_({},this._def),{type:this._def.type.clone()}))}_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}isEqual(e){return e instanceof _r?this._def.type.isEqual(e._def.type):!1}naked(){return this._def.type.naked()}mandatory(){return new _r(N(_({},this._def),{type:this._def.type.mandatory()}))}};d(sg,"ZodBranded");var ja=sg,Ci=class br extends he{_parse(e){let{ctx:n}=this._processInputParams(e),r=N(_({},n),{common:N(_({},n.common),{issues:[]})}),o=this._def.innerType._parse({data:r.data,path:r.path,parent:_({},r)});return Si(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ft(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ft(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}isEqual(e){return e instanceof br?this._def.innerType.isEqual(e._def.innerType)&&be.compareFunctions(this._def.catchValue,e._def.catchValue):!1}dereference(e){return new br(N(_({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new br(N(_({},this._def),{innerType:this._def.innerType.clone()}))}naked(){return this._def.innerType.naked()}mandatory(){return new br(N(_({},this._def),{innerType:this._def.innerType.mandatory()}))}};d(Ci,"ZodCatch");Ci.create=d((t,e)=>new Ci(_({innerType:t,typeName:"ZodCatch",catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},me(e))),"create");var Ka=Ci,lg=d((t,e={},n)=>t?$r.create().superRefine((r,o)=>{var a,i;if(!t(r)){let s=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(i=(a=s.fatal)!=null?a:n)!=null?i:!0,f=typeof s=="string"?{message:s}:s;o.addIssue(N(_({code:"custom"},f),{fatal:l}))}}):$r.create(),"custom"),Oi=class _a extends he{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ne.date){let a=this._getOrReturnCtx(e);return te(a,{code:G.invalid_type,expected:ne.date,received:a.parsedType}),pe}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return te(a,{code:G.invalid_date}),pe}let r=new Tt,o;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(o=this._getOrReturnCtx(e,o),te(o,{code:G.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(o=this._getOrReturnCtx(e,o),te(o,{code:G.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):be.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new _a(N(_({},this._def),{checks:[...this._def.checks,e]}))}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ue.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ue.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}isEqual(e){if(!(e instanceof _a))return!1;let n=new et(this._def.checks),r=new et(e._def.checks);return n.isEqual(r)&&this._def.coerce===e._def.coerce}};d(Oi,"ZodDate");Oi.create=d(t=>new Oi(_({checks:[],coerce:t?.coerce||!1,typeName:"ZodDate"},me(t))),"create");var La=Oi,Ri=class wr extends he{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===ne.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}dereference(e){return new wr(N(_({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new wr(N(_({},this._def),{innerType:this._def.innerType.clone()}))}isEqual(e){return e instanceof wr?this._def.innerType.isEqual(e._def.innerType)&&Jn(this._def.defaultValue(),e._def.defaultValue()):!1}unwrap(){return this._def.innerType}naked(){return this._def.innerType.naked()}mandatory(){return new wr(N(_({},this._def),{innerType:this._def.innerType.mandatory()}))}};d(Ri,"ZodDefault");Ri.create=d((t,e,n)=>new Ri(_({innerType:t,typeName:"ZodDefault",defaultValue:typeof e=="function"?e:()=>e},me(n))),"create");var mo=Ri,qt=d(t=>Array.from(new Set(t)),"unique"),Lt=d(t=>t instanceof za?Lt(t.schema):t instanceof Sn?Lt(t.innerType()):t instanceof qa?[t.value]:t instanceof rr?t.options:t instanceof Ga?be.objectValues(t.enum):t instanceof mo?Lt(t._def.innerType):t instanceof _o?[void 0]:t instanceof Va?[null]:t instanceof sn?[void 0,...Lt(t.unwrap())]:t instanceof Yn?[null,...Lt(t.unwrap())]:t instanceof ja||t instanceof To?Lt(t.unwrap()):t instanceof Ka?Lt(t._def.innerType):[],"getDiscriminator"),ug=class wn extends he{dereference(e){let n=this.options.map(o=>o.dereference(e)),r=wn._getOptionsMap(this.discriminator,n);return new wn(N(_({},this._def),{options:n,optionsMap:r}))}getReferences(){return qt(this.options.flatMap(e=>e.getReferences()))}clone(){let e=this.options.map(n=>n.clone());return new wn(N(_({},this._def),{options:e}))}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.object)return te(n,{code:G.invalid_type,expected:ne.object,received:n.parsedType}),pe;let r=this.discriminator,o=n.data[r],a=this.optionsMap.get(o);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(te(n,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=wn._getOptionsMap(e,n);return new wn(_({typeName:"ZodDiscriminatedUnion",discriminator:e,options:n,optionsMap:o},me(r)))}static _getOptionsMap(e,n){let r=new Map;for(let o of n){let a=Lt(o.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of a){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,o)}}return r}isEqual(e){if(!(e instanceof wn)||this._def.discriminator!==e._def.discriminator)return!1;let n=d((a,i)=>a.isEqual(i),"compare"),r=new et(this._def.options,{compare:n}),o=new et(e._def.options,{compare:n});return r.isEqual(o)}};d(ug,"ZodDiscriminatedUnion");var cg=ug;function ho(t,e){return new rr(_({values:t,typeName:"ZodEnum"},me(e)))}d(ho,"createZodEnum");var Fa=class hi extends he{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return te(n,{expected:be.joinValues(r),received:n.parsedType,code:G.invalid_type}),pe}if(this._def.values.indexOf(e.data)===-1){let n=this._getOrReturnCtx(e),r=this._def.values;return te(n,{received:n.data,code:G.invalid_enum_value,options:r}),pe}return gt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return hi.create(e,_(_({},this._def),n))}exclude(e,n=this._def){return hi.create(this.options.filter(r=>!e.includes(r)),_(_({},this._def),n))}isEqual(e){if(!(e instanceof hi))return!1;let n=new et(this._def.values),r=new et(e._def.values);return n.isEqual(r)}};d(Fa,"ZodEnum");Fa.create=ho;var rr=Fa,fg=class xn extends he{constructor(){super(...arguments),this.validate=this.implement}dereference(e){let n=this._def.args.dereference(e),r=this._def.returns.dereference(e);return new xn(N(_({},this._def),{args:n,returns:r}))}getReferences(){return qt([...this._def.args.getReferences(),...this._def.returns.getReferences()])}clone(){return new xn(N(_({},this._def),{args:this._def.args.clone(),returns:this._def.returns.clone()}))}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.function)return te(n,{code:G.invalid_type,expected:ne.function,received:n.parsedType}),pe;function r(s,l){return Bi({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ur(),zc].filter(f=>!!f),issueData:{code:G.invalid_arguments,argumentsError:l}})}d(r,"makeArgsIssue");function o(s,l){return Bi({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ur(),zc].filter(f=>!!f),issueData:{code:G.invalid_return_type,returnTypeError:l}})}d(o,"makeReturnsIssue");let a={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof vo){let s=this;return gt(async function(...l){let f=new Ft([]),p=await s._def.args.parseAsync(l,a).catch(h=>{throw f.addIssue(r(l,h)),f}),y=await Reflect.apply(i,this,p);return await s._def.returns._def.type.parseAsync(y,a).catch(h=>{throw f.addIssue(o(y,h)),f})})}else{let s=this;return gt(function(...l){let f=s._def.args.safeParse(l,a);if(!f.success)throw new Ft([r(l,f.error)]);let p=Reflect.apply(i,this,f.data),y=s._def.returns.safeParse(p,a);if(!y.success)throw new Ft([o(p,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new xn(N(_({},this._def),{args:tr.create(e).rest(Mr.create())}))}returns(e){return new xn(N(_({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new xn(_({args:e||tr.create([]).rest(Mr.create()),returns:n||Mr.create(),typeName:"ZodFunction"},me(r)))}isEqual(e){return e instanceof xn&&this._def.args.isEqual(e._def.args)&&this._def.returns.isEqual(e._def.returns)}};d(fg,"ZodFunction");var dg=fg;function Mi(t,e){let n=an(t),r=an(e);if(t===e)return{valid:!0,data:t};if(n===ne.object&&r===ne.object){let o=be.objectKeys(e),a=be.objectKeys(t).filter(s=>o.indexOf(s)!==-1),i=_(_({},t),e);for(let s of a){let l=Mi(t[s],e[s]);if(!l.valid)return{valid:!1};i[s]=l.data}return{valid:!0,data:i}}else if(n===ne.array&&r===ne.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let a=0;a<t.length;a++){let i=t[a],s=e[a],l=Mi(i,s);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===ne.date&&r===ne.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}d(Mi,"mergeValues");var Ni=class vi extends he{dereference(e){return new vi(N(_({},this._def),{left:this._def.left.dereference(e),right:this._def.right.dereference(e)}))}getReferences(){return qt([...this._def.left.getReferences(),...this._def.right.getReferences()])}clone(){return new vi(N(_({},this._def),{left:this._def.left.clone(),right:this._def.right.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=d((a,i)=>{if(va(a)||va(i))return pe;let s=Mi(a.value,i.value);return s.valid?((Ta(a)||Ta(i))&&n.dirty(),{status:n.value,value:s.data}):(te(r,{code:G.invalid_intersection_types}),pe)},"handleParsed");return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>o(a,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}isEqual(e){if(!(e instanceof vi))return!1;let n=d((a,i)=>a.isEqual(i),"compare"),r=new et([this._def.left,this._def.right],{compare:n}),o=new et([e._def.left,e._def.right],{compare:n});return r.isEqual(o)}};d(Ni,"ZodIntersection");Ni.create=d((t,e,n)=>new Ni(_({left:t,right:e,typeName:"ZodIntersection"},me(n))),"create");var Wa=Ni,Di=class xr extends he{get schema(){return this._def.getter()}dereference(e){return new xr(N(_({},this._def),{getter:d(()=>this._def.getter().dereference(e),"getter")}))}getReferences(){return this._def.getter().getReferences()}clone(){return new xr(N(_({},this._def),{getter:d(()=>this._def.getter().clone(),"getter")}))}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}isEqual(e){return e instanceof xr?this._def.getter().isEqual(e._def.getter()):!1}naked(){return this._def.getter().naked()}mandatory(){return new xr(N(_({},this._def),{getter:d(()=>this._def.getter().mandatory(),"getter")}))}};d(Di,"ZodLazy");Di.create=d((t,e)=>new Di(_({getter:t,typeName:"ZodLazy"},me(e))),"create");var za=Di,Hi=class pg extends he{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return te(n,{received:n.data,code:G.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:e.data}}get value(){return this._def.value}isEqual(e){return e instanceof pg?Jn(this._def.value,e._def.value):!1}};d(Hi,"ZodLiteral");Hi.create=d((t,e)=>new Hi(_({value:t,typeName:"ZodLiteral"},me(e))),"create");var qa=Hi,Ui=class Ti extends he{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let n=this._def.keyType.dereference(e),r=this._def.valueType.dereference(e);return new Ti(N(_({},this._def),{keyType:n,valueType:r}))}getReferences(){return qt([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}clone(){return new Ti(N(_({},this._def),{keyType:this._def.keyType.clone(),valueType:this._def.valueType.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.map)return te(r,{code:G.invalid_type,expected:ne.map,received:r.parsedType}),pe;let o=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([s,l],f)=>({key:o._parse(new Ct(r,s,r.path,[f,"key"])),value:a._parse(new Ct(r,l,r.path,[f,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of i){let f=await l.key,p=await l.value;if(f.status==="aborted"||p.status==="aborted")return pe;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),s.set(f.value,p.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let l of i){let f=l.key,p=l.value;if(f.status==="aborted"||p.status==="aborted")return pe;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),s.set(f.value,p.value)}return{status:n.value,value:s}}}isEqual(e){return!(!(e instanceof Ti)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};d(Ui,"ZodMap");Ui.create=d((t,e,n)=>new Ui(_({valueType:e,keyType:t,typeName:"ZodMap"},me(n))),"create");var gg=Ui,Zi=class yg extends he{_parse(e){if(this._getType(e)!==ne.nan){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.nan,received:r.parsedType}),pe}return{status:"valid",value:e.data}}isEqual(e){return e instanceof yg}};d(Zi,"ZodNaN");Zi.create=d(t=>new Zi(_({typeName:"ZodNaN"},me(t))),"create");var mg=Zi,$i=class hg extends he{_parse(e){let n=be.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ne.string&&r.parsedType!==ne.number){let o=be.objectValues(n);return te(r,{expected:be.joinValues(o),received:r.parsedType,code:G.invalid_type}),pe}if(n.indexOf(e.data)===-1){let o=be.objectValues(n);return te(r,{received:r.data,code:G.invalid_enum_value,options:o}),pe}return gt(e.data)}get enum(){return this._def.values}isEqual(e){return e instanceof hg?Jn(this._def.values,e._def.values):!1}};d($i,"ZodNativeEnum");$i.create=d((t,e)=>new $i(_({values:t,typeName:"ZodNativeEnum"},me(e))),"create");var Ga=$i,ji=class vg extends he{_parse(e){let n=this._getOrReturnCtx(e);return te(n,{code:G.invalid_type,expected:ne.never,received:n.parsedType}),pe}isEqual(e){return e instanceof vg}};d(ji,"ZodNever");ji.create=d(t=>new ji(_({typeName:"ZodNever"},me(t))),"create");var Fr=ji,Ki=class Tg extends he{_parse(e){if(this._getType(e)!==ne.null){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.null,received:r.parsedType}),pe}return gt(e.data)}isEqual(e){return e instanceof Tg}};d(Ki,"ZodNull");Ki.create=d(t=>new Ki(_({typeName:"ZodNull"},me(t))),"create");var Va=Ki,Li=class Pr extends he{dereference(e){return new Pr(N(_({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new Pr(N(_({},this._def),{innerType:this._def.innerType.clone()}))}_parse(e){return this._getType(e)===ne.null?gt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof Pr?this._def.innerType.isEqual(e._def.innerType):!1}naked(){return this._def.innerType.naked()}mandatory(){return new Pr(N(_({},this._def),{innerType:this._def.innerType.mandatory()}))}};d(Li,"ZodNullable");Li.create=d((t,e)=>new Li(_({innerType:t,typeName:"ZodNullable"},me(e))),"create");var Yn=Li;function _g(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,a=parseInt(t.toFixed(o).replace(".","")),i=parseInt(e.toFixed(o).replace(".",""));return a%i/Math.pow(10,o)}d(_g,"floatSafeRemainder");var Fi=class _i extends he{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ne.number){let a=this._getOrReturnCtx(e);return te(a,{code:G.invalid_type,expected:ne.number,received:a.parsedType}),pe}let r,o=new Tt;for(let a of this._def.checks)a.kind==="int"?be.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),te(r,{code:G.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?_g(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),te(r,{code:G.not_finite,message:a.message}),o.dirty()):be.assertNever(a);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,r,o){return new _i(N(_({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ue.toString(o)}]}))}_addCheck(e){return new _i(N(_({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:ue.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ue.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ue.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ue.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&be.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}isEqual(e){if(!(e instanceof _i))return!1;let n=new et(this._def.checks),r=new et(e._def.checks);return n.isEqual(r)}};d(Fi,"ZodNumber");Fi.create=d(t=>new Fi(_({checks:[],typeName:"ZodNumber",coerce:t?.coerce||!1},me(t))),"create");var Ja=Fi;function Pn(t){if(t instanceof Qn){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=sn.create(Pn(r))}return new Qn(N(_({},t._def),{shape:d(()=>e,"shape")}))}else return t instanceof jr?new jr(N(_({},t._def),{type:Pn(t.element)})):t instanceof sn?sn.create(Pn(t.unwrap())):t instanceof Yn?Yn.create(Pn(t.unwrap())):t instanceof tr?tr.create(t.items.map(e=>Pn(e))):t}d(Pn,"deepPartialify");var un=class vt extends he{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=be.objectKeys(e);return this._cached={shape:e,keys:n}}dereference(e){let n=this._def.shape(),r={};for(let o in n)r[o]=n[o].dereference(e);return new vt(N(_({},this._def),{shape:d(()=>r,"shape")}))}getReferences(){let e=this._def.shape(),n=[];for(let r in e)n.push(...e[r].getReferences());return qt(n)}clone(){let e={},n=this._def.shape();for(let[r,o]of Object.entries(n))e[r]=o.clone();return new vt(N(_({},this._def),{shape:d(()=>e,"shape")}))}_parse(e){if(this._getType(e)!==ne.object){let p=this._getOrReturnCtx(e);return te(p,{code:G.invalid_type,expected:ne.object,received:p.parsedType}),pe}let{status:r,ctx:o}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),s=[];if(this._def.unknownKeys!=="strip")for(let p in o.data)i.includes(p)||s.push(p);let l=[];for(let p of i){let y=a[p],g=o.data[p];l.push({key:{status:"valid",value:p},value:y._parse(new Ct(o,g,o.path,p)),alwaysSet:p in o.data})}let f=this._def.unknownKeys;if(f==="passthrough")for(let p of s)l.push({key:{status:"valid",value:p},value:{status:"valid",value:o.data[p]}});else if(f==="strict")s.length>0&&(te(o,{code:G.unrecognized_keys,keys:s}),r.dirty());else if(f!=="strip")for(let p of s){let y=o.data[p];l.push({key:{status:"valid",value:p},value:f._parse(new Ct(o,y,o.path,p)),alwaysSet:p in o.data})}return o.common.async?Promise.resolve().then(async()=>{let p=[];for(let y of l){let g=await y.key;p.push({key:g,value:await y.value,alwaysSet:y.alwaysSet})}return p}).then(p=>Tt.mergeObjectSync(r,p)):Tt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return ue.errToObj,new vt(_(N(_({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:d((n,r)=>{var o,a,i,s;let l=(i=(a=(o=this._def).errorMap)==null?void 0:a.call(o,n,r).message)!=null?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=ue.errToObj(e).message)!=null?s:l}:{message:l}},"errorMap")}:{}))}strip(){return new vt(N(_({},this._def),{unknownKeys:"strip"}))}passthrough(){return new vt(N(_({},this._def),{unknownKeys:"passthrough"}))}additionalProperties(){if(this._def.unknownKeys instanceof he)return this._def.unknownKeys;if(this._def.unknownKeys==="passthrough")return $r.create();if(this._def.unknownKeys==="strict")return Fr.create()}extend(e){return new vt(N(_({},this._def),{shape:d(()=>_(_({},this._def.shape()),e),"shape")}))}merge(e){return new vt({unknownKeys:e._def.unknownKeys,shape:d(()=>_(_({},this._def.shape()),e._def.shape()),"shape"),typeName:"ZodObject"})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new vt(N(_({},this._def),{unknownKeys:e}))}pick(e){let n={};return be.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new vt(N(_({},this._def),{shape:d(()=>n,"shape")}))}omit(e){let n={};return be.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new vt(N(_({},this._def),{shape:d(()=>n,"shape")}))}deepPartial(){return Pn(this)}partial(e){let n={};return be.objectKeys(this.shape).forEach(r=>{let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o?.optional()}),new vt(N(_({},this._def),{shape:d(()=>n,"shape")}))}required(e){let n={};return be.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof sn;)a=a._def.innerType;n[r]=a}}),new vt(N(_({},this._def),{shape:d(()=>n,"shape")}))}keyof(){return ho(be.objectKeys(this.shape))}isEqual(e){if(!(e instanceof vt)||!this._unknownKeysEqual(e))return!1;let n=this._def.shape(),r=e._def.shape(),o=d((s,l)=>s[0]===l[0]&&s[1].isEqual(l[1]),"compare"),a=new et(Object.entries(n),{compare:o}),i=new et(Object.entries(r),{compare:o});return a.isEqual(i)}_unknownKeysEqual(e){let n=this.additionalProperties(),r=e.additionalProperties();return n===void 0||r===void 0?n===r:n.isEqual(r)}};d(un,"ZodObject");un.create=d((t,e)=>new un(_({shape:d(()=>t,"shape"),unknownKeys:"strip",typeName:"ZodObject"},me(e))),"create");un.strictCreate=d((t,e)=>new un(_({shape:d(()=>t,"shape"),unknownKeys:"strict",typeName:"ZodObject"},me(e))),"strictCreate");un.lazycreate=d((t,e)=>new un(_({shape:t,unknownKeys:"strip",typeName:"ZodObject"},me(e))),"lazycreate");var Qn=un,Wi=class bi extends he{dereference(e){return new bi(N(_({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new bi(N(_({},this._def),{innerType:this._def.innerType.clone()}))}_parse(e){return this._getType(e)===ne.undefined?gt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof bi?this._def.innerType.isEqual(e._def.innerType):!1}naked(){return this._def.innerType.naked()}mandatory(){return this._def.innerType.mandatory()}};d(Wi,"ZodOptional");Wi.create=d((t,e)=>new Wi(_({innerType:t,typeName:"ZodOptional"},me(e))),"create");var sn=Wi,bg=class Br extends he{dereference(e){return new Br(N(_({},this._def),{in:this._def.in.dereference(e),out:this._def.out.dereference(e)}))}getReferences(){return qt([...this._def.in.getReferences(),...this._def.out.getReferences()])}clone(){return new Br(N(_({},this._def),{in:this._def.in.clone(),out:this._def.out.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return d(async()=>{let a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?pe:a.status==="dirty"?(n.dirty(),Gn(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})},"handleAsync")();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?pe:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new Br({in:e,out:n,typeName:"ZodPipeline"})}isEqual(e){return!(!(e instanceof Br)||!this._def.in.isEqual(e._def.in)||!this._def.out.isEqual(e._def.out))}};d(bg,"ZodPipeline");var Xa=bg,zi=class wi extends he{unwrap(){return this._def.type}dereference(e){return new wi(N(_({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}clone(){return new wi(N(_({},this._def),{type:this._def.type.clone()}))}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.promise&&n.common.async===!1)return te(n,{code:G.invalid_type,expected:ne.promise,received:n.parsedType}),pe;let r=n.parsedType===ne.promise?n.data:Promise.resolve(n.data);return gt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}isEqual(e){return e instanceof wi?this._def.type.isEqual(e._def.type):!1}naked(){return this._def.type.naked()}};d(zi,"ZodPromise");zi.create=d((t,e)=>new zi(_({type:t,typeName:"ZodPromise"},me(e))),"create");var vo=zi,qi=class Sr extends he{dereference(e){return new Sr(N(_({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new Sr(N(_({},this._def),{innerType:this._def.innerType.clone()}))}_parse(e){let n=this._def.innerType._parse(e);return Zr(n)&&(n.value=Object.freeze(n.value)),n}unwrap(){return this._def.innerType}isEqual(e){return e instanceof Sr?this._def.innerType.isEqual(e._def.innerType):!1}naked(){return this._def.innerType.naked()}mandatory(){return new Sr(N(_({},this._def),{innerType:this._def.innerType.mandatory()}))}};d(qi,"ZodReadonly");qi.create=d((t,e)=>new qi(_({innerType:t,typeName:"ZodReadonly"},me(e))),"create");var To=qi,wg=class Wn extends he{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let n=this._def.keyType.dereference(e),r=this._def.valueType.dereference(e);return new Wn(N(_({},this._def),{keyType:n,valueType:r}))}getReferences(){return qt([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}clone(){return new Wn(N(_({},this._def),{keyType:this._def.keyType.clone(),valueType:this._def.valueType.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.object)return te(r,{code:G.invalid_type,expected:ne.object,received:r.parsedType}),pe;let o=[],a=this._def.keyType,i=this._def.valueType;for(let s in r.data)o.push({key:a._parse(new Ct(r,s,r.path,s)),value:i._parse(new Ct(r,r.data[s],r.path,s))});return r.common.async?Tt.mergeObjectAsync(n,o):Tt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof he?new Wn(_({keyType:e,valueType:n,typeName:"ZodRecord"},me(r))):new Wn(_({keyType:yt.create(),valueType:e,typeName:"ZodRecord"},me(n)))}isEqual(e){return!(!(e instanceof Wn)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};d(wg,"ZodRecord");var xg=wg,Gi=class Pg extends he{dereference(e){let n=e[this._def.uri];return n||this}getReferences(){return[this._def.uri]}_parse(e){let n=this._getOrReturnCtx(e);return te(n,{code:G.unresolved_reference}),pe}isOptional(){return!1}isNullable(){return!1}isEqual(e){return e instanceof Pg?this._def.uri===e._def.uri:!1}};d(Gi,"ZodRef");Gi.create=d(t=>new Gi({typeName:"ZodRef",uri:t}),"create");var Bg=Gi,Vi=class zn extends he{dereference(e){return new zn(N(_({},this._def),{valueType:this._def.valueType.dereference(e)}))}getReferences(){return this._def.valueType.getReferences()}clone(){return new zn(N(_({},this._def),{valueType:this._def.valueType.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.set)return te(r,{code:G.invalid_type,expected:ne.set,received:r.parsedType}),pe;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(te(r,{code:G.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(te(r,{code:G.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let a=this._def.valueType;function i(l){let f=new Set;for(let p of l){if(p.status==="aborted")return pe;p.status==="dirty"&&n.dirty(),f.add(p.value)}return{status:n.value,value:f}}d(i,"finalizeSet");let s=[...r.data.values()].map((l,f)=>a._parse(new Ct(r,l,r.path,f)));return r.common.async?Promise.all(s).then(l=>i(l)):i(s)}min(e,n){return new zn(N(_({},this._def),{minSize:{value:e,message:ue.toString(n)}}))}max(e,n){return new zn(N(_({},this._def),{maxSize:{value:e,message:ue.toString(n)}}))}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}isEqual(e){var n,r,o,a;if(!(e instanceof zn))return!1;let i=(n=this._def.minSize)==null?void 0:n.value,s=(r=e._def.minSize)==null?void 0:r.value;if(i!==s)return!1;let l=(o=this._def.maxSize)==null?void 0:o.value,f=(a=e._def.maxSize)==null?void 0:a.value;return l!==f?!1:this._def.valueType.isEqual(e._def.valueType)}};d(Vi,"ZodSet");Vi.create=d((t,e)=>new Vi(_({valueType:t,minSize:null,maxSize:null,typeName:"ZodSet"},me(e))),"create");var Sg=Vi,Eg=/^c[^\s-]{8,}$/i,kg=/^[a-z][a-z0-9]*$/,Ig=/^[0-9A-HJKMNP-TV-Z]{26}$/,Ag=/^[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,Cg=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Og="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Rx=d(t=>t===Og,"isEmojiRegex"),sa,Rg=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Mg=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;function Ng(t,e){return!!((e==="v4"||!e)&&Rg.test(t)||(e==="v6"||!e)&&Mg.test(t))}d(Ng,"isValidIP");var Ji=class qn extends he{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ne.string){let a=this._getOrReturnCtx(e);return te(a,{code:G.invalid_type,expected:ne.string,received:a.parsedType}),pe}let r=new Tt,o;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(o=this._getOrReturnCtx(e,o),te(o,{code:G.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(o=this._getOrReturnCtx(e,o),te(o,{code:G.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){let i=e.data.length>a.value,s=e.data.length<a.value;(i||s)&&(o=this._getOrReturnCtx(e,o),i?te(o,{code:G.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&te(o,{code:G.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")Cg.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"email",code:G.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")sa||(sa=new RegExp(Og,"u")),sa.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"emoji",code:G.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")Ag.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"uuid",code:G.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")Eg.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"cuid",code:G.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")kg.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"cuid2",code:G.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")Ig.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"ulid",code:G.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),te(o,{validation:"url",code:G.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"regex",code:G.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(e,o),te(o,{code:G.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(o=this._getOrReturnCtx(e,o),te(o,{code:G.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(o=this._getOrReturnCtx(e,o),te(o,{code:G.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?Gp(a).test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{code:G.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="ip"?Ng(e.data,a.version)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"ip",code:G.invalid_string,message:a.message}),r.dirty()):be.assertNever(a);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),_({validation:n,code:G.invalid_string},ue.errToObj(r)))}_addCheck(e){return new qn(N(_({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(_({kind:"email"},ue.errToObj(e)))}url(e){return this._addCheck(_({kind:"url"},ue.errToObj(e)))}emoji(e){return this._addCheck(_({kind:"emoji"},ue.errToObj(e)))}uuid(e){return this._addCheck(_({kind:"uuid"},ue.errToObj(e)))}cuid(e){return this._addCheck(_({kind:"cuid"},ue.errToObj(e)))}cuid2(e){return this._addCheck(_({kind:"cuid2"},ue.errToObj(e)))}ulid(e){return this._addCheck(_({kind:"ulid"},ue.errToObj(e)))}ip(e){return this._addCheck(_({kind:"ip"},ue.errToObj(e)))}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck(_({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(n=e?.offset)!=null?n:!1},ue.errToObj(e?.message)))}regex(e,n){return this._addCheck(_({kind:"regex",regex:e},ue.errToObj(n)))}includes(e,n){return this._addCheck(_({kind:"includes",value:e,position:n?.position},ue.errToObj(n?.message)))}startsWith(e,n){return this._addCheck(_({kind:"startsWith",value:e},ue.errToObj(n)))}endsWith(e,n){return this._addCheck(_({kind:"endsWith",value:e},ue.errToObj(n)))}min(e,n){return this._addCheck(_({kind:"min",value:e},ue.errToObj(n)))}max(e,n){return this._addCheck(_({kind:"max",value:e},ue.errToObj(n)))}length(e,n){return this._addCheck(_({kind:"length",value:e},ue.errToObj(n)))}nonempty(e){return this.min(1,ue.errToObj(e))}trim(){return new qn(N(_({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}secret(){return this._def[le]=N(_({},this._def[le]),{secret:!0}),this}toLowerCase(){return new qn(N(_({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new qn(N(_({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}isEqual(e){if(!(e instanceof qn))return!1;let n=new et(this._def.checks),r=new et(e._def.checks);return n.isEqual(r)}};d(Ji,"ZodString");Ji.create=d(t=>{var e;return new Ji(_({checks:[],typeName:"ZodString",coerce:(e=t?.coerce)!=null?e:!1},me(N(_({},t),{supportsExtensions:["secret"]}))))},"create");var yt=Ji,Xi=class Dg extends he{_parse(e){if(this._getType(e)!==ne.symbol){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.symbol,received:r.parsedType}),pe}return gt(e.data)}isEqual(e){return e instanceof Dg}};d(Xi,"ZodSymbol");Xi.create=d(t=>new Xi(_({typeName:"ZodSymbol"},me(t))),"create");var Hg=Xi,er=class Er extends he{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName==="ZodEffects"?this._def.schema.sourceType():this._def.schema}dereference(e){return new Er(N(_({},this._def),{schema:this._def.schema.dereference(e)}))}getReferences(){return this._def.schema.getReferences()}clone(){return new Er(N(_({},this._def),{schema:this._def.schema.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,a={addIssue:d(i=>{te(r,i),i.fatal?n.abort():n.dirty()},"addIssue"),get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let i=o.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async s=>{if(n.value==="aborted")return pe;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?pe:l.status==="dirty"||n.value==="dirty"?Gn(l.value):l});{if(n.value==="aborted")return pe;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?pe:s.status==="dirty"||n.value==="dirty"?Gn(s.value):s}}if(o.type==="refinement"){let i=d(s=>{let l=o.refinement(s,a);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s},"executeRefinement");if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?pe:(s.status==="dirty"&&n.dirty(),i(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?pe:(s.status==="dirty"&&n.dirty(),i(s.value).then(()=>({status:n.value,value:s.value}))))}if(o.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Zr(i))return i;let s=o.transform(i.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Zr(i)?Promise.resolve(o.transform(i.value,a)).then(s=>({status:n.value,value:s})):i);be.assertNever(o)}isEqual(e){return!(e instanceof Er)||!this._def.schema.isEqual(e._def.schema)?!1:this._def.effect.type==="refinement"?e._def.effect.type!=="refinement"?!1:be.compareFunctions(this._def.effect.refinement,e._def.effect.refinement):this._def.effect.type==="transform"?e._def.effect.type!=="transform"?!1:be.compareFunctions(this._def.effect.transform,e._def.effect.transform):this._def.effect.type==="preprocess"?e._def.effect.type!=="preprocess"?!1:be.compareFunctions(this._def.effect.transform,e._def.effect.transform):!1}naked(){return this._def.schema.naked()}mandatory(){return new Er(N(_({},this._def),{schema:this._def.schema.mandatory()}))}};d(er,"ZodEffects");er.create=d((t,e,n)=>new er(_({schema:t,typeName:"ZodEffects",effect:e},me(n))),"create");er.createWithPreprocess=d((t,e,n)=>new er(_({schema:e,effect:{type:"preprocess",transform:t},typeName:"ZodEffects"},me(n))),"createWithPreprocess");var Sn=er,Yi=class kr extends he{dereference(e){let n=this._def.items.map(o=>o.dereference(e)),r=this._def.rest?this._def.rest.dereference(e):null;return new kr(N(_({},this._def),{items:n,rest:r}))}getReferences(){return qt([...this._def.items.flatMap(e=>e.getReferences()),...this._def.rest?this._def.rest.getReferences():[]])}clone(){let e=this._def.items.map(r=>r.clone()),n=this._def.rest?this._def.rest.clone():null;return new kr(N(_({},this._def),{items:e,rest:n}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.array)return te(r,{code:G.invalid_type,expected:ne.array,received:r.parsedType}),pe;if(r.data.length<this._def.items.length)return te(r,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&r.data.length>this._def.items.length&&(te(r,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let a=[...r.data].map((i,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Ct(r,i,r.path,s)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>Tt.mergeArray(n,i)):Tt.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new kr(N(_({},this._def),{rest:e}))}isEqual(e){if(!(e instanceof kr)||!this._restEquals(e))return!1;let n=d((a,i)=>a.isEqual(i),"compare"),r=new et(this._def.items,{compare:n}),o=new et(e._def.items,{compare:n});return r.isEqual(o)}_restEquals(e){return this._def.rest===null?e._def.rest===null:e._def.rest!==null&&this._def.rest.isEqual(e._def.rest)}};d(Yi,"ZodTuple");Yi.create=d((t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Yi(_({items:t,typeName:"ZodTuple",rest:null},me(e)))},"create");var tr=Yi,Qi=class Ug extends he{_parse(e){if(this._getType(e)!==ne.undefined){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.undefined,received:r.parsedType}),pe}return gt(e.data)}isEqual(e){return e instanceof Ug}mandatory(){return Fr.create(_({},this._def))}};d(Qi,"ZodUndefined");Qi.create=d(t=>new Qi(_({typeName:"ZodUndefined"},me(t))),"create");var _o=Qi,eo=class Ir extends he{dereference(e){let n=this._def.options.map(r=>r.dereference(e));return new Ir(N(_({},this._def),{options:n}))}getReferences(){return qt(this._def.options.reduce((e,n)=>[...e,...n.getReferences()],[]))}clone(){let e=this._def.options.map(n=>n.clone());return new Ir(N(_({},this._def),{options:e}))}_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(a){for(let s of a)if(s.result.status==="valid")return s.result;for(let s of a)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let i=a.map(s=>new Ft(s.ctx.common.issues));return te(n,{code:G.invalid_union,unionErrors:i}),pe}if(d(o,"handleResults"),n.common.async)return Promise.all(r.map(async a=>{let i=N(_({},n),{common:N(_({},n.common),{issues:[]}),parent:null});return{result:await a._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let a,i=[];for(let l of r){let f=N(_({},n),{common:N(_({},n.common),{issues:[]}),parent:null}),p=l._parseSync({data:n.data,path:n.path,parent:f});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:f}),f.common.issues.length&&i.push(f.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(l=>new Ft(l));return te(n,{code:G.invalid_union,unionErrors:s}),pe}}get options(){return this._def.options}isEqual(e){if(!(e instanceof Ir))return!1;let n=d((a,i)=>a.isEqual(i),"compare"),r=new et([...this._def.options],{compare:n}),o=new et([...e._def.options],{compare:n});return r.isEqual(o)}mandatory(){let e=this._def.options.filter(a=>!(a instanceof _o)).map(a=>a.mandatory()),[n,r,...o]=e;return n?r?new Ir(N(_({},this._def),{options:[n,r,...o]})):n:Fr.create(_({},this._def))}};d(eo,"ZodUnion");eo.create=d((t,e)=>new eo(_({options:t,typeName:"ZodUnion"},me(e))),"create");var Ya=eo,to=class Zg extends he{constructor(){super(...arguments),this._unknown=!0}_parse(e){return gt(e.data)}isEqual(e){return e instanceof Zg}};d(to,"ZodUnknown");to.create=d(t=>new to(_({typeName:"ZodUnknown"},me(t))),"create");var Mr=to,no=class $g extends he{_parse(e){if(this._getType(e)!==ne.undefined){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.void,received:r.parsedType}),pe}return gt(e.data)}isEqual(e){return e instanceof $g}};d(no,"ZodVoid");no.create=d(t=>new no(_({typeName:"ZodVoid"},me(t))),"create");var jg=no,Mx=["gpt-3.5-turbo","gpt-3.5-turbo-16k","gpt-4","gpt-4-1106-preview","gpt-4-vision-preview","gpt-4-0125-preview","gpt-4-turbo-preview","gpt-4-turbo","gpt-4o","gpt-3.5-turbo-0125","gpt-3.5-turbo-1106"],DA=rr.create(["any","string","number","boolean","object","pattern","date","array","target","time","enum"]),Nx=d(t=>yt.create().displayAs({id:"variable",params:_({type:t?.type||"any"},t?.params)}),"variable"),Dx=d(t=>yt.create().displayAs({id:"conversation",params:_({},t?.params)}),"conversation"),Hx=d(t=>yt.create().displayAs({id:"user",params:_({},t?.params)}),"user"),Ux=d(t=>yt.create().displayAs({id:"message",params:_({},t?.params)}),"message"),Zx=d(t=>yt.create().displayAs({id:"agent",params:_({},t?.params)}),"agent"),$x=d(t=>yt.create().displayAs({id:"event",params:_({},t?.params)}),"event"),jx=d(t=>yt.create().displayAs({id:"table",params:_({},t?.params)}),"table"),Kx=d(t=>yt.create().displayAs({id:"tablerow",params:_({},t?.params)}),"tablerow"),Lx=d(t=>yt.create().displayAs({id:"intent",params:_({},t?.params)}),"intent"),Fx=d(()=>rr.create(Mx).displayAs({id:"dropdown",params:{}}),"aimodel"),Wx=d(t=>yt.create().displayAs({id:"datasource",params:_({},t)}),"datasource"),zx=d(t=>yt.create().displayAs({id:"knowledgebase",params:_({},t)}),"knowledgebase"),qx={object:Qn.lazycreate},Gx=d((t,e={message:`Input not instance of ${t.name}`})=>lg(n=>n instanceof t,e),"instanceOfType"),Kg=yt.create,Lg=Ja.create,Vx=mg.create,Jx=Za.create,Fg=$a.create,Xx=La.create,Yx=Hg.create,Qx=_o.create,eP=Va.create,tP=$r.create,nP=Mr.create,rP=Fr.create,iP=jg.create,oP=jr.create,aP=Qn.create,sP=Qn.strictCreate,lP=Ya.create,uP=cg.create,cP=Wa.create,fP=tr.create,dP=xg.create,pP=Bg.create,gP=To.create,yP=gg.create,mP=Sg.create,hP=dg.create,vP=za.create,TP=qa.create,_P=rr.create,bP=Ga.create,wP=vo.create,qc=Sn.create,xP=sn.create,PP=Yn.create,BP=mo.create,SP=Sn.createWithPreprocess,EP=Xa.create,kP=d(()=>Kg().optional(),"ostring"),IP=d(()=>Lg().optional(),"onumber"),AP=d(()=>Fg().optional(),"oboolean"),CP={string:d(t=>yt.create(N(_({},t),{coerce:!0})),"string"),number:d(t=>Ja.create(N(_({},t),{coerce:!0})),"number"),boolean:d(t=>$a.create(N(_({},t),{coerce:!0})),"boolean"),bigint:d(t=>Za.create(N(_({},t),{coerce:!0})),"bigint"),date:d(t=>La.create(N(_({},t),{coerce:!0})),"date")},OP=pe,M=Y,Wg=d((t,e)=>t.anyOf.length?t.anyOf.length===1?it(t.anyOf[0],N(_({},e),{path:[...e.path,"anyOf",0]})):`z.union([${t.anyOf.map((n,r)=>it(n,N(_({},e),{path:[...e.path,"anyOf",r]}))).join(", ")}])`:"z.any()","parseAnyOf"),RP=d(t=>{var e;return(e=t[le])!=null&&e.coerce?"z.coerce.boolean()":"z.boolean()"},"parseBoolean"),MP=d(t=>"z.any()","parseDefault"),NP=d((t,e)=>`z.union([${t.type.map(n=>it(N(_({},t),{type:n}),e)).join(", ")}])`,"parseMultipleType"),DP=d((t,e)=>`z.any().refine((value) => !${it(t.not,N(_({},e),{path:[...e.path,"not"]}))}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`,"parseNot"),HP=d(t=>"z.null()","parseNull"),UP=d(t=>[t.slice(0,t.length/2),t.slice(t.length/2)],"half"),ZP=d((t,...e)=>Object.keys(t).reduce((n,r)=>(e.includes(r)||(n[r]=t[r]),n),{}),"omit");function ut(t,e,n){var r;let o=t[e],a="";if(o!==void 0){let i=n({value:o,json:JSON.stringify(o)});if(i){let s=i[0],l=i.length===3?i[1]:"",f=i.length===3?i[2]:i[1];a+=s,((r=t.errorMessage)==null?void 0:r[e])!==void 0&&(a+=l+JSON.stringify(t.errorMessage[e])),a+=f}}return a}d(ut,"withMessage");var Ar=Symbol("Original index"),$P=d(t=>{let e=[];for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="boolean")e.push(r?{[Ar]:n}:{[Ar]:n,not:{}});else{if(Ar in r)return t;e.push(N(_({},r),{[Ar]:n}))}}return e},"ensureOriginalIndex");function Kr(t,e){if(t.allOf.length===0)return"z.never()";if(t.allOf.length===1){let n=t.allOf[0];return it(n,N(_({},e),{path:[...e.path,"allOf",n[Ar]]}))}else{let[n,r]=UP($P(t.allOf));return`z.intersection(${Kr({allOf:n},e)}, ${Kr({allOf:r},e)})`}}d(Kr,"parseAllOf");var jP=d((t,e)=>{if(Array.isArray(t.items))return`z.tuple([${t.items.map((r,o)=>it(r,N(_({},e),{path:[...e.path,"items",o]})))}])`;let n=t.items?`z.array(${it(t.items,N(_({},e),{path:[...e.path,"items"]}))})`:"z.array(z.any())";return n+=ut(t,"minItems",({json:r})=>[`.min(${r}`,", ",")"]),n+=ut(t,"maxItems",({json:r})=>[`.max(${r}`,", ",")"]),n},"parseArray"),KP=d(t=>`z.literal(${JSON.stringify(t.const)})`,"parseConst"),LP=d(t=>t.enum.length===0?"z.never()":t.enum.length===1?`z.literal(${JSON.stringify(t.enum[0])})`:t.enum.every(e=>typeof e=="string")?`z.enum([${t.enum.map(e=>JSON.stringify(e))}])`:`z.union([${t.enum.map(e=>`z.literal(${JSON.stringify(e)})`).join(", ")}])`,"parseEnum"),FP=d((t,e)=>{let n=it(t.if,N(_({},e),{path:[...e.path,"if"]})),r=it(t.then,N(_({},e),{path:[...e.path,"then"]})),o=it(t.else,N(_({},e),{path:[...e.path,"else"]}));return`z.union([${r}, ${o}]).superRefine((value,ctx) => {
|
|
17
|
+
*/`},"getMultilineComment"),rf={};aa(rf,{JSONSchemaToZuiError:()=>oa,ObjectToZuiError:()=>uo,UnrepresentableGenericError:()=>co,UnsupportedJSONSchemaToZuiError:()=>on,UnsupportedZuiCheckToJSONSchemaError:()=>ff,UnsupportedZuiToJSONSchemaError:()=>pt,UnsupportedZuiToTypescriptSchemaError:()=>_n,UnsupportedZuiToTypescriptTypeError:()=>vf,UntitledDeclarationError:()=>_f,ZuiToJSONSchemaError:()=>sa,ZuiToTypescriptSchemaError:()=>gf,ZuiToTypescriptTypeError:()=>la,ZuiTransformError:()=>rr});var af=class extends Error{constructor(e,n){super(n),this.transform=e}};d(af,"ZuiTransformError");var rr=af,of=class extends rr{constructor(e){super("json-schema-to-zui",e)}};d(of,"JSONSchemaToZuiError");var oa=of,sf=class extends rr{constructor(e){super("object-to-zui",e)}};d(sf,"ObjectToZuiError");var uo=sf,lf=class extends rr{constructor(e){super("zui-to-json-schema",e)}};d(lf,"ZuiToJSONSchemaError");var sa=lf,uf=class extends sa{constructor(e,{suggestedAlternative:n}={}){super(`Zod type ${e} cannot be transformed to JSON Schema.`+(n?` Suggested alternative: ${n}`:""))}};d(uf,"UnsupportedZuiToJSONSchemaError");var pt=uf,cf=class extends sa{constructor({zodType:e,checkKind:n}){super(`Zod check .${n}() of type ${e} cannot be transformed to JSON Schema.`)}};d(cf,"UnsupportedZuiCheckToJSONSchemaError");var ff=cf,df=class extends oa{constructor(e){super(`JSON Schema ${JSON.stringify(e)} cannot be transformed to ZUI type.`)}};d(df,"UnsupportedJSONSchemaToZuiError");var on=df,pf=class extends rr{constructor(e){super("zui-to-typescript-schema",e)}};d(pf,"ZuiToTypescriptSchemaError");var gf=pf,yf=class extends gf{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript schema.`)}};d(yf,"UnsupportedZuiToTypescriptSchemaError");var _n=yf,mf=class extends rr{constructor(e){super("zui-to-typescript-type",e)}};d(mf,"ZuiToTypescriptTypeError");var la=mf,hf=class extends la{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript type.`)}};d(hf,"UnsupportedZuiToTypescriptTypeError");var vf=hf,Tf=class extends la{constructor(){super("Schema must have a title to be transformed to a TypeScript type with a declaration.")}};d(Tf,"UntitledDeclarationError");var _f=Tf,bf=class extends la{constructor(){super('ZodRef can only be transformed to a TypeScript type with a "type" declaration.')}};d(bf,"UnrepresentableGenericError");var co=bf,wf=["string","number","boolean","unknown","void","any","null","undefined","never","bigint","symbol","object"],Vv=d(t=>wf.includes(t),"isPrimitive"),Jv=d(t=>wf.map(e=>`${e}[]`).includes(t),"isArrayOfPrimitives"),yc=d(t=>t.replace(/ +/g," ").trim(),"stripSpaces"),xf=class{constructor(e,n,r=!1){this.key=e,this.value=n,this.optional=r}};d(xf,"KeyValue");var pi=xf,Pf=class{constructor(e){this.schema=e}};d(Pf,"FnParameters");var mc=Pf,Bf=class{constructor(e){this.schema=e}};d(Bf,"FnReturn");var hc=Bf,Ef=class{constructor(e){this.props=e}};d(Ef,"Declaration");var yi=Ef;function Bo(t,e={}){let n=Qv(t,e),r=ke(n,{});return e.formatter&&(r=e.formatter(r)),r}d(Bo,"toTypescriptType");function ke(t,e){var n,r,a;let o=N(_({},e),{parent:t});if(t===null)return"";if(t instanceof yi)return Yv(t,o);if(t instanceof pi){if(t.value instanceof M.ZodOptional){let h=t.value._def.innerType;return ke(new pi(t.key,h,!0),o)}let l=nt(t.value.description),f=l?.trim().length>0?`
|
|
18
|
+
`:"",p=t.value.describe(""),g=t.optional||t.value.isOptional()?"?":"";return`${f}${l}${f}${t.key}${g}: ${ke(p,o)}${f}`}if(t instanceof mc){if(t.schema instanceof M.ZodTuple){let p="";for(let y=0;y<t.schema.items.length;y++){let g=(a=(r=(n=t.schema.items[y])==null?void 0:n.ui)==null?void 0:r.title)!=null?a:`arg${y}`,h=t.schema.items[y];p+=`${ke(new pi(lo(g),h),o)}${y<t.schema.items.length-1?", ":""} `}return p}let l=ke(t.schema,o);return l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")||l.startsWith("(")&&l.endsWith(")")||l.startsWith("Array<")&&l.endsWith(">")||l.startsWith("Record<")&&l.endsWith(">")||Jv(l)?`args: ${l}`:l}if(t instanceof hc)return t.schema instanceof M.ZodOptional?`${ke(t.schema.unwrap(),o)} | undefined`:ke(t.schema,o);let i=t,s=i._def;switch(s.typeName){case M.ZodFirstPartyTypeKind.ZodString:return`${nt(i.description)} string`.trim();case M.ZodFirstPartyTypeKind.ZodNumber:case M.ZodFirstPartyTypeKind.ZodNaN:case M.ZodFirstPartyTypeKind.ZodBigInt:return`${nt(i.description)} number`.trim();case M.ZodFirstPartyTypeKind.ZodBoolean:return`${nt(i.description)} boolean`.trim();case M.ZodFirstPartyTypeKind.ZodDate:return`${nt(i.description)} Date`.trim();case M.ZodFirstPartyTypeKind.ZodUndefined:return`${nt(i.description)} undefined`.trim();case M.ZodFirstPartyTypeKind.ZodNull:return`${nt(i.description)} null`.trim();case M.ZodFirstPartyTypeKind.ZodAny:return`${nt(i.description)} any`.trim();case M.ZodFirstPartyTypeKind.ZodUnknown:return`${nt(i.description)} unknown`.trim();case M.ZodFirstPartyTypeKind.ZodNever:return`${nt(i.description)} never`.trim();case M.ZodFirstPartyTypeKind.ZodVoid:return`${nt(i.description)} void`.trim();case M.ZodFirstPartyTypeKind.ZodArray:let l=ke(s.type,o);return Vv(l)?`${l}[]`:`Array<${l}>`;case M.ZodFirstPartyTypeKind.ZodObject:return`{ ${Object.entries(s.shape()).map(([E,H])=>ke(new pi(lo(E),H),o)).join("; ")} }`;case M.ZodFirstPartyTypeKind.ZodUnion:let p=s.options.map(E=>ke(E,o));return`${nt(i.description)}
|
|
19
|
+
${p.join(" | ")}`;case M.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let y=s.options.map(E=>ke(E,o));return`${nt(i.description)}
|
|
20
|
+
${y.join(" | ")}`;case M.ZodFirstPartyTypeKind.ZodIntersection:return`${ke(s.left,o)} & ${ke(s.right,o)}`;case M.ZodFirstPartyTypeKind.ZodTuple:return s.items.length===0?"":`[${s.items.map(E=>ke(E,o)).join(", ")}]`;case M.ZodFirstPartyTypeKind.ZodRecord:let h=ke(s.keyType,o),w=ke(s.valueType,o);return`${nt(i.description)} { [key: ${h}]: ${w} }`;case M.ZodFirstPartyTypeKind.ZodMap:return`Map<${ke(s.keyType,o)}, ${ke(s.valueType,o)}>`;case M.ZodFirstPartyTypeKind.ZodSet:return`Set<${ke(s.valueType,o)}>`;case M.ZodFirstPartyTypeKind.ZodFunction:let P=ke(new mc(s.args),o),B=ke(new hc(s.returns),o);return`${nt(i.description)}
|
|
21
|
+
(${P}) => ${B}`;case M.ZodFirstPartyTypeKind.ZodLazy:return ke(s.getter(),o);case M.ZodFirstPartyTypeKind.ZodLiteral:let v=ef(s.value);return`${nt(i.description)}
|
|
22
|
+
${v}`.trim();case M.ZodFirstPartyTypeKind.ZodEnum:return s.values.map(se).join(" | ");case M.ZodFirstPartyTypeKind.ZodEffects:return ke(s.schema,o);case M.ZodFirstPartyTypeKind.ZodNativeEnum:throw new vf(M.ZodFirstPartyTypeKind.ZodNativeEnum);case M.ZodFirstPartyTypeKind.ZodOptional:return`${ke(s.innerType,o)} | undefined`;case M.ZodFirstPartyTypeKind.ZodNullable:return`${ke(s.innerType,o)} | null`;case M.ZodFirstPartyTypeKind.ZodDefault:return ke(s.innerType,o);case M.ZodFirstPartyTypeKind.ZodCatch:return ke(s.innerType,o);case M.ZodFirstPartyTypeKind.ZodPromise:return`Promise<${ke(s.type,o)}>`;case M.ZodFirstPartyTypeKind.ZodBranded:return ke(s.type,o);case M.ZodFirstPartyTypeKind.ZodPipeline:return ke(s.in,o);case M.ZodFirstPartyTypeKind.ZodSymbol:return`${nt(i.description)} symbol`.trim();case M.ZodFirstPartyTypeKind.ZodReadonly:return`Readonly<${ke(s.innerType,o)}>`;case M.ZodFirstPartyTypeKind.ZodRef:return nf(s.uri);default:be.assertNever(s)}}d(ke,"sUnwrapZod");var Yv=d((t,e)=>{if(t.props.type==="none")return ke(t.props.schema,e);let n=nt(t.props.schema.description),r=t.props.schema.describe(""),a=ke(r,e);if(t.props.type==="variable")return yc(`${n}declare const ${t.props.identifier}: ${a};`);let o=t.props.args.length>0?`<${t.props.args.map(nf).join(", ")}>`:"";return yc(`${n}type ${t.props.identifier}${o} = ${a};`)},"unwrapDeclaration"),Xv=d(t=>t.declaration?t.declaration===!0?"variable":t.declaration:"none","getDeclarationType"),Qv=d((t,e)=>{let n=Xv(e),r=t.getReferences();if(n==="none"){if(r.length>0)throw new co;return new yi({type:"none",schema:t})}let a="title"in t.ui?t.ui.title:null;if(!a)throw new _f;if(n==="variable"){if(r.length>0)throw new co;return new yi({type:"variable",identifier:a,schema:t})}return new yi({type:"type",identifier:a,schema:t,args:r})},"getDeclarationProps"),eT=typeof global=="object"&&global&&global.Object===Object&&global,Sf=eT,tT=typeof self=="object"&&self&&self.Object===Object&&self,nT=Sf||tT||Function("return this")(),qt=nT,rT=qt.Symbol,un=rT,kf=Object.prototype,iT=kf.hasOwnProperty,aT=kf.toString,Tr=un?un.toStringTag:void 0;function If(t){var e=iT.call(t,Tr),n=t[Tr];try{t[Tr]=void 0;var r=!0}catch{}var a=aT.call(t);return r&&(e?t[Tr]=n:delete t[Tr]),a}d(If,"getRawTag");var oT=If,sT=Object.prototype,lT=sT.toString;function Af(t){return lT.call(t)}d(Af,"objectToString");var uT=Af,cT="[object Null]",fT="[object Undefined]",vc=un?un.toStringTag:void 0;function Cf(t){return t==null?t===void 0?fT:cT:vc&&vc in Object(t)?oT(t):uT(t)}d(Cf,"baseGetTag");var kn=Cf;function Of(t){return t!=null&&typeof t=="object"}d(Of,"isObjectLike");var En=Of,dT="[object Symbol]";function Rf(t){return typeof t=="symbol"||En(t)&&kn(t)==dT}d(Rf,"isSymbol");var Eo=Rf;function Mf(t,e){for(var n=-1,r=t==null?0:t.length,a=Array(r);++n<r;)a[n]=e(t[n],n,t);return a}d(Mf,"arrayMap");var Nf=Mf,pT=Array.isArray,zt=pT,gT=1/0,Tc=un?un.prototype:void 0,_c=Tc?Tc.toString:void 0;function So(t){if(typeof t=="string")return t;if(zt(t))return Nf(t,So)+"";if(Eo(t))return _c?_c.call(t):"";var e=t+"";return e=="0"&&1/t==-gT?"-0":e}d(So,"baseToString");var yT=So;function Df(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}d(Df,"isObject");var Xn=Df;function Hf(t){return t}d(Hf,"identity");var mT=Hf,hT="[object AsyncFunction]",vT="[object Function]",TT="[object GeneratorFunction]",_T="[object Proxy]";function Uf(t){if(!Xn(t))return!1;var e=kn(t);return e==vT||e==TT||e==hT||e==_T}d(Uf,"isFunction");var Zf=Uf,bT=qt["__core-js_shared__"],no=bT,bc=(function(){var t=/[^.]+$/.exec(no&&no.keys&&no.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function $f(t){return!!bc&&bc in t}d($f,"isMasked");var wT=$f,xT=Function.prototype,PT=xT.toString;function jf(t){if(t!=null){try{return PT.call(t)}catch{}try{return t+""}catch{}}return""}d(jf,"toSource");var In=jf,BT=/[\\^$.*+?()[\]{}|]/g,ET=/^\[object .+?Constructor\]$/,ST=Function.prototype,kT=Object.prototype,IT=ST.toString,AT=kT.hasOwnProperty,CT=RegExp("^"+IT.call(AT).replace(BT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Kf(t){if(!Xn(t)||wT(t))return!1;var e=Zf(t)?CT:ET;return e.test(In(t))}d(Kf,"baseIsNative");var OT=Kf;function Lf(t,e){return t?.[e]}d(Lf,"getValue");var RT=Lf;function Ff(t,e){var n=RT(t,e);return OT(n)?n:void 0}d(Ff,"getNative");var An=Ff,MT=An(qt,"WeakMap"),fo=MT,NT=(function(){try{var t=An(Object,"defineProperty");return t({},"",{}),t}catch{}})(),wc=NT,DT=9007199254740991,HT=/^(?:0|[1-9]\d*)$/;function Wf(t,e){var n=typeof t;return e=e??DT,!!e&&(n=="number"||n!="symbol"&&HT.test(t))&&t>-1&&t%1==0&&t<e}d(Wf,"isIndex");var ko=Wf;function zf(t,e,n){e=="__proto__"&&wc?wc(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}d(zf,"baseAssignValue");var qf=zf;function Gf(t,e){return t===e||t!==t&&e!==e}d(Gf,"eq");var Io=Gf,UT=Object.prototype,ZT=UT.hasOwnProperty;function Vf(t,e,n){var r=t[e];(!(ZT.call(t,e)&&Io(r,n))||n===void 0&&!(e in t))&&qf(t,e,n)}d(Vf,"assignValue");var $T=Vf,jT=9007199254740991;function Jf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=jT}d(Jf,"isLength");var Ao=Jf;function Yf(t){return t!=null&&Ao(t.length)&&!Zf(t)}d(Yf,"isArrayLike");var Xf=Yf,KT=Object.prototype;function Qf(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||KT;return t===n}d(Qf,"isPrototype");var ed=Qf;function td(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}d(td,"baseTimes");var LT=td,FT="[object Arguments]";function nd(t){return En(t)&&kn(t)==FT}d(nd,"baseIsArguments");var xc=nd,rd=Object.prototype,WT=rd.hasOwnProperty,zT=rd.propertyIsEnumerable,qT=xc((function(){return arguments})())?xc:function(t){return En(t)&&WT.call(t,"callee")&&!zT.call(t,"callee")},id=qT;function ad(){return!1}d(ad,"stubFalse");var GT=ad,od=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Pc=od&&typeof module=="object"&&module&&!module.nodeType&&module,VT=Pc&&Pc.exports===od,Bc=VT?qt.Buffer:void 0,JT=Bc?Bc.isBuffer:void 0,YT=JT||GT,po=YT,XT="[object Arguments]",QT="[object Array]",e_="[object Boolean]",t_="[object Date]",n_="[object Error]",r_="[object Function]",i_="[object Map]",a_="[object Number]",o_="[object Object]",s_="[object RegExp]",l_="[object Set]",u_="[object String]",c_="[object WeakMap]",f_="[object ArrayBuffer]",d_="[object DataView]",p_="[object Float32Array]",g_="[object Float64Array]",y_="[object Int8Array]",m_="[object Int16Array]",h_="[object Int32Array]",v_="[object Uint8Array]",T_="[object Uint8ClampedArray]",__="[object Uint16Array]",b_="[object Uint32Array]",Ze={};Ze[p_]=Ze[g_]=Ze[y_]=Ze[m_]=Ze[h_]=Ze[v_]=Ze[T_]=Ze[__]=Ze[b_]=!0;Ze[XT]=Ze[QT]=Ze[f_]=Ze[e_]=Ze[d_]=Ze[t_]=Ze[n_]=Ze[r_]=Ze[i_]=Ze[a_]=Ze[o_]=Ze[s_]=Ze[l_]=Ze[u_]=Ze[c_]=!1;function sd(t){return En(t)&&Ao(t.length)&&!!Ze[kn(t)]}d(sd,"baseIsTypedArray");var w_=sd;function ld(t){return function(e){return t(e)}}d(ld,"baseUnary");var x_=ld,ud=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Rr=ud&&typeof module=="object"&&module&&!module.nodeType&&module,P_=Rr&&Rr.exports===ud,ro=P_&&Sf.process,B_=(function(){try{var t=Rr&&Rr.require&&Rr.require("util").types;return t||ro&&ro.binding&&ro.binding("util")}catch{}})(),Ec=B_,Sc=Ec&&Ec.isTypedArray,E_=Sc?x_(Sc):w_,cd=E_,S_=Object.prototype,k_=S_.hasOwnProperty;function fd(t,e){var n=zt(t),r=!n&&id(t),a=!n&&!r&&po(t),o=!n&&!r&&!a&&cd(t),i=n||r||a||o,s=i?LT(t.length,String):[],l=s.length;for(var f in t)(e||k_.call(t,f))&&!(i&&(f=="length"||a&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||ko(f,l)))&&s.push(f);return s}d(fd,"arrayLikeKeys");var dd=fd;function pd(t,e){return function(n){return t(e(n))}}d(pd,"overArg");var gd=pd,I_=gd(Object.keys,Object),A_=I_,C_=Object.prototype,O_=C_.hasOwnProperty;function yd(t){if(!ed(t))return A_(t);var e=[];for(var n in Object(t))O_.call(t,n)&&n!="constructor"&&e.push(n);return e}d(yd,"baseKeys");var R_=yd;function md(t){return Xf(t)?dd(t):R_(t)}d(md,"keys");var Co=md;function hd(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}d(hd,"nativeKeysIn");var M_=hd,N_=Object.prototype,D_=N_.hasOwnProperty;function vd(t){if(!Xn(t))return M_(t);var e=ed(t),n=[];for(var r in t)r=="constructor"&&(e||!D_.call(t,r))||n.push(r);return n}d(vd,"baseKeysIn");var H_=vd;function Td(t){return Xf(t)?dd(t,!0):H_(t)}d(Td,"keysIn");var U_=Td,Z_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$_=/^\w*$/;function _d(t,e){if(zt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Eo(t)?!0:$_.test(t)||!Z_.test(t)||e!=null&&t in Object(e)}d(_d,"isKey");var Oo=_d,j_=An(Object,"create"),Dr=j_;function bd(){this.__data__=Dr?Dr(null):{},this.size=0}d(bd,"hashClear");var K_=bd;function wd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}d(wd,"hashDelete");var L_=wd,F_="__lodash_hash_undefined__",W_=Object.prototype,z_=W_.hasOwnProperty;function xd(t){var e=this.__data__;if(Dr){var n=e[t];return n===F_?void 0:n}return z_.call(e,t)?e[t]:void 0}d(xd,"hashGet");var q_=xd,G_=Object.prototype,V_=G_.hasOwnProperty;function Pd(t){var e=this.__data__;return Dr?e[t]!==void 0:V_.call(e,t)}d(Pd,"hashHas");var J_=Pd,Y_="__lodash_hash_undefined__";function Bd(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Dr&&e===void 0?Y_:e,this}d(Bd,"hashSet");var X_=Bd;function Cn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}d(Cn,"Hash");Cn.prototype.clear=K_;Cn.prototype.delete=L_;Cn.prototype.get=q_;Cn.prototype.has=J_;Cn.prototype.set=X_;var kc=Cn;function Ed(){this.__data__=[],this.size=0}d(Ed,"listCacheClear");var Q_=Ed;function Sd(t,e){for(var n=t.length;n--;)if(Io(t[n][0],e))return n;return-1}d(Sd,"assocIndexOf");var ua=Sd,eb=Array.prototype,tb=eb.splice;function kd(t){var e=this.__data__,n=ua(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():tb.call(e,n,1),--this.size,!0}d(kd,"listCacheDelete");var nb=kd;function Id(t){var e=this.__data__,n=ua(e,t);return n<0?void 0:e[n][1]}d(Id,"listCacheGet");var rb=Id;function Ad(t){return ua(this.__data__,t)>-1}d(Ad,"listCacheHas");var ib=Ad;function Cd(t,e){var n=this.__data__,r=ua(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}d(Cd,"listCacheSet");var ab=Cd;function On(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}d(On,"ListCache");On.prototype.clear=Q_;On.prototype.delete=nb;On.prototype.get=rb;On.prototype.has=ib;On.prototype.set=ab;var ca=On,ob=An(qt,"Map"),Hr=ob;function Od(){this.size=0,this.__data__={hash:new kc,map:new(Hr||ca),string:new kc}}d(Od,"mapCacheClear");var sb=Od;function Rd(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}d(Rd,"isKeyable");var lb=Rd;function Md(t,e){var n=t.__data__;return lb(e)?n[typeof e=="string"?"string":"hash"]:n.map}d(Md,"getMapData");var fa=Md;function Nd(t){var e=fa(this,t).delete(t);return this.size-=e?1:0,e}d(Nd,"mapCacheDelete");var ub=Nd;function Dd(t){return fa(this,t).get(t)}d(Dd,"mapCacheGet");var cb=Dd;function Hd(t){return fa(this,t).has(t)}d(Hd,"mapCacheHas");var fb=Hd;function Ud(t,e){var n=fa(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}d(Ud,"mapCacheSet");var db=Ud;function Rn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}d(Rn,"MapCache");Rn.prototype.clear=sb;Rn.prototype.delete=ub;Rn.prototype.get=cb;Rn.prototype.has=fb;Rn.prototype.set=db;var da=Rn,pb="Expected a function";function pa(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(pb);var n=d(function(){var r=arguments,a=e?e.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=t.apply(this,r);return n.cache=o.set(a,i)||o,i},"memoized");return n.cache=new(pa.Cache||da),n}d(pa,"memoize");pa.Cache=da;var gb=pa,yb=500;function Zd(t){var e=gb(t,function(r){return n.size===yb&&n.clear(),r}),n=e.cache;return e}d(Zd,"memoizeCapped");var mb=Zd,hb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vb=/\\(\\)?/g,Tb=mb(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(hb,function(n,r,a,o){e.push(a?o.replace(vb,"$1"):r||n)}),e}),_b=Tb;function $d(t){return t==null?"":yT(t)}d($d,"toString");var bb=$d;function jd(t,e){return zt(t)?t:Oo(t,e)?[t]:_b(bb(t))}d(jd,"castPath");var ga=jd,wb=1/0;function Kd(t){if(typeof t=="string"||Eo(t))return t;var e=t+"";return e=="0"&&1/t==-wb?"-0":e}d(Kd,"toKey");var Fr=Kd;function Ld(t,e){e=ga(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Fr(e[n++])];return n&&n==r?t:void 0}d(Ld,"baseGet");var Ro=Ld;function Fd(t,e,n){var r=t==null?void 0:Ro(t,e);return r===void 0?n:r}d(Fd,"get");var xb=Fd;function Wd(t,e){for(var n=-1,r=e.length,a=t.length;++n<r;)t[a+n]=e[n];return t}d(Wd,"arrayPush");var zd=Wd,Pb=gd(Object.getPrototypeOf,Object),qd=Pb,Bb="[object Object]",Eb=Function.prototype,Sb=Object.prototype,Gd=Eb.toString,kb=Sb.hasOwnProperty,Ib=Gd.call(Object);function Vd(t){if(!En(t)||kn(t)!=Bb)return!1;var e=qd(t);if(e===null)return!0;var n=kb.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Gd.call(n)==Ib}d(Vd,"isPlainObject");var Ic=Vd;function Jd(){this.__data__=new ca,this.size=0}d(Jd,"stackClear");var Ab=Jd;function Yd(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}d(Yd,"stackDelete");var Cb=Yd;function Xd(t){return this.__data__.get(t)}d(Xd,"stackGet");var Ob=Xd;function Qd(t){return this.__data__.has(t)}d(Qd,"stackHas");var Rb=Qd,Mb=200;function ep(t,e){var n=this.__data__;if(n instanceof ca){var r=n.__data__;if(!Hr||r.length<Mb-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new da(r)}return n.set(t,e),this.size=n.size,this}d(ep,"stackSet");var Nb=ep;function Mn(t){var e=this.__data__=new ca(t);this.size=e.size}d(Mn,"Stack");Mn.prototype.clear=Ab;Mn.prototype.delete=Cb;Mn.prototype.get=Ob;Mn.prototype.has=Rb;Mn.prototype.set=Nb;var mi=Mn;function tp(t,e){for(var n=-1,r=t==null?0:t.length,a=0,o=[];++n<r;){var i=t[n];e(i,n,t)&&(o[a++]=i)}return o}d(tp,"arrayFilter");var Db=tp;function np(){return[]}d(np,"stubArray");var rp=np,Hb=Object.prototype,Ub=Hb.propertyIsEnumerable,Ac=Object.getOwnPropertySymbols,Zb=Ac?function(t){return t==null?[]:(t=Object(t),Db(Ac(t),function(e){return Ub.call(t,e)}))}:rp,ip=Zb,$b=Object.getOwnPropertySymbols,jb=$b?function(t){for(var e=[];t;)zd(e,ip(t)),t=qd(t);return e}:rp,Kb=jb;function ap(t,e,n){var r=e(t);return zt(t)?r:zd(r,n(t))}d(ap,"baseGetAllKeys");var op=ap;function sp(t){return op(t,Co,ip)}d(sp,"getAllKeys");var Cc=sp;function lp(t){return op(t,U_,Kb)}d(lp,"getAllKeysIn");var Lb=lp,Fb=An(qt,"DataView"),go=Fb,Wb=An(qt,"Promise"),yo=Wb,zb=An(qt,"Set"),mo=zb,Oc="[object Map]",qb="[object Object]",Rc="[object Promise]",Mc="[object Set]",Nc="[object WeakMap]",Dc="[object DataView]",Gb=In(go),Vb=In(Hr),Jb=In(yo),Yb=In(mo),Xb=In(fo),bn=kn;(go&&bn(new go(new ArrayBuffer(1)))!=Dc||Hr&&bn(new Hr)!=Oc||yo&&bn(yo.resolve())!=Rc||mo&&bn(new mo)!=Mc||fo&&bn(new fo)!=Nc)&&(bn=d(function(t){var e=kn(t),n=e==qb?t.constructor:void 0,r=n?In(n):"";if(r)switch(r){case Gb:return Dc;case Vb:return Oc;case Jb:return Rc;case Yb:return Mc;case Xb:return Nc}return e},"getTag"));var Hc=bn,Qb=qt.Uint8Array,Uc=Qb,ew="__lodash_hash_undefined__";function up(t){return this.__data__.set(t,ew),this}d(up,"setCacheAdd");var tw=up;function cp(t){return this.__data__.has(t)}d(cp,"setCacheHas");var nw=cp;function Ur(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new da;++e<n;)this.add(t[e])}d(Ur,"SetCache");Ur.prototype.add=Ur.prototype.push=tw;Ur.prototype.has=nw;var rw=Ur;function fp(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}d(fp,"arraySome");var iw=fp;function dp(t,e){return t.has(e)}d(dp,"cacheHas");var aw=dp,ow=1,sw=2;function pp(t,e,n,r,a,o){var i=n&ow,s=t.length,l=e.length;if(s!=l&&!(i&&l>s))return!1;var f=o.get(t),p=o.get(e);if(f&&p)return f==e&&p==t;var y=-1,g=!0,h=n&sw?new rw:void 0;for(o.set(t,e),o.set(e,t);++y<s;){var w=t[y],P=e[y];if(r)var B=i?r(P,w,y,e,t,o):r(w,P,y,t,e,o);if(B!==void 0){if(B)continue;g=!1;break}if(h){if(!iw(e,function(v,S){if(!aw(h,S)&&(w===v||a(w,v,n,r,o)))return h.push(S)})){g=!1;break}}else if(!(w===P||a(w,P,n,r,o))){g=!1;break}}return o.delete(t),o.delete(e),g}d(pp,"equalArrays");var gp=pp;function yp(t){var e=-1,n=Array(t.size);return t.forEach(function(r,a){n[++e]=[a,r]}),n}d(yp,"mapToArray");var lw=yp;function mp(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}d(mp,"setToArray");var uw=mp,cw=1,fw=2,dw="[object Boolean]",pw="[object Date]",gw="[object Error]",yw="[object Map]",mw="[object Number]",hw="[object RegExp]",vw="[object Set]",Tw="[object String]",_w="[object Symbol]",bw="[object ArrayBuffer]",ww="[object DataView]",Zc=un?un.prototype:void 0,io=Zc?Zc.valueOf:void 0;function hp(t,e,n,r,a,o,i){switch(n){case ww:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case bw:return!(t.byteLength!=e.byteLength||!o(new Uc(t),new Uc(e)));case dw:case pw:case mw:return Io(+t,+e);case gw:return t.name==e.name&&t.message==e.message;case hw:case Tw:return t==e+"";case yw:var s=lw;case vw:var l=r&cw;if(s||(s=uw),t.size!=e.size&&!l)return!1;var f=i.get(t);if(f)return f==e;r|=fw,i.set(t,e);var p=gp(s(t),s(e),r,a,o,i);return i.delete(t),p;case _w:if(io)return io.call(t)==io.call(e)}return!1}d(hp,"equalByTag");var xw=hp,Pw=1,Bw=Object.prototype,Ew=Bw.hasOwnProperty;function vp(t,e,n,r,a,o){var i=n&Pw,s=Cc(t),l=s.length,f=Cc(e),p=f.length;if(l!=p&&!i)return!1;for(var y=l;y--;){var g=s[y];if(!(i?g in e:Ew.call(e,g)))return!1}var h=o.get(t),w=o.get(e);if(h&&w)return h==e&&w==t;var P=!0;o.set(t,e),o.set(e,t);for(var B=i;++y<l;){g=s[y];var v=t[g],S=e[g];if(r)var E=i?r(S,v,g,e,t,o):r(v,S,g,t,e,o);if(!(E===void 0?v===S||a(v,S,n,r,o):E)){P=!1;break}B||(B=g=="constructor")}if(P&&!B){var H=t.constructor,K=e.constructor;H!=K&&"constructor"in t&&"constructor"in e&&!(typeof H=="function"&&H instanceof H&&typeof K=="function"&&K instanceof K)&&(P=!1)}return o.delete(t),o.delete(e),P}d(vp,"equalObjects");var Sw=vp,kw=1,$c="[object Arguments]",jc="[object Array]",gi="[object Object]",Iw=Object.prototype,Kc=Iw.hasOwnProperty;function Tp(t,e,n,r,a,o){var i=zt(t),s=zt(e),l=i?jc:Hc(t),f=s?jc:Hc(e);l=l==$c?gi:l,f=f==$c?gi:f;var p=l==gi,y=f==gi,g=l==f;if(g&&po(t)){if(!po(e))return!1;i=!0,p=!1}if(g&&!p)return o||(o=new mi),i||cd(t)?gp(t,e,n,r,a,o):xw(t,e,l,n,r,a,o);if(!(n&kw)){var h=p&&Kc.call(t,"__wrapped__"),w=y&&Kc.call(e,"__wrapped__");if(h||w){var P=h?t.value():t,B=w?e.value():e;return o||(o=new mi),a(P,B,n,r,o)}}return g?(o||(o=new mi),Sw(t,e,n,r,a,o)):!1}d(Tp,"baseIsEqualDeep");var Aw=Tp;function Mo(t,e,n,r,a){return t===e?!0:t==null||e==null||!En(t)&&!En(e)?t!==t&&e!==e:Aw(t,e,n,r,Mo,a)}d(Mo,"baseIsEqual");var ya=Mo,Cw=1,Ow=2;function _p(t,e,n,r){var a=n.length,o=a,i=!r;if(t==null)return!o;for(t=Object(t);a--;){var s=n[a];if(i&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++a<o;){s=n[a];var l=s[0],f=t[l],p=s[1];if(i&&s[2]){if(f===void 0&&!(l in t))return!1}else{var y=new mi;if(r)var g=r(f,p,l,t,e,y);if(!(g===void 0?ya(p,f,Cw|Ow,r,y):g))return!1}}return!0}d(_p,"baseIsMatch");var Rw=_p;function bp(t){return t===t&&!Xn(t)}d(bp,"isStrictComparable");var wp=bp;function xp(t){for(var e=Co(t),n=e.length;n--;){var r=e[n],a=t[r];e[n]=[r,a,wp(a)]}return e}d(xp,"getMatchData");var Mw=xp;function Pp(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}d(Pp,"matchesStrictComparable");var Bp=Pp;function Ep(t){var e=Mw(t);return e.length==1&&e[0][2]?Bp(e[0][0],e[0][1]):function(n){return n===t||Rw(n,t,e)}}d(Ep,"baseMatches");var Nw=Ep;function Sp(t,e){return t!=null&&e in Object(t)}d(Sp,"baseHasIn");var Dw=Sp;function kp(t,e,n){e=ga(e,t);for(var r=-1,a=e.length,o=!1;++r<a;){var i=Fr(e[r]);if(!(o=t!=null&&n(t,i)))break;t=t[i]}return o||++r!=a?o:(a=t==null?0:t.length,!!a&&Ao(a)&&ko(i,a)&&(zt(t)||id(t)))}d(kp,"hasPath");var Hw=kp;function Ip(t,e){return t!=null&&Hw(t,e,Dw)}d(Ip,"hasIn");var Uw=Ip,Zw=1,$w=2;function Ap(t,e){return Oo(t)&&wp(e)?Bp(Fr(t),e):function(n){var r=xb(n,t);return r===void 0&&r===e?Uw(n,t):ya(e,r,Zw|$w)}}d(Ap,"baseMatchesProperty");var jw=Ap;function Cp(t){return function(e){return e?.[t]}}d(Cp,"baseProperty");var Kw=Cp;function Op(t){return function(e){return Ro(e,t)}}d(Op,"basePropertyDeep");var Lw=Op;function Rp(t){return Oo(t)?Kw(Fr(t)):Lw(t)}d(Rp,"property");var Fw=Rp;function Mp(t){return typeof t=="function"?t:t==null?mT:typeof t=="object"?zt(t)?jw(t[0],t[1]):Nw(t):Fw(t)}d(Mp,"baseIteratee");var No=Mp;function Np(t){return function(e,n,r){for(var a=-1,o=Object(e),i=r(e),s=i.length;s--;){var l=i[t?s:++a];if(n(o[l],l,o)===!1)break}return e}}d(Np,"createBaseFor");var Ww=Np,zw=Ww(),qw=zw;function Dp(t,e){return t&&qw(t,e,Co)}d(Dp,"baseForOwn");var Gw=Dp;function Hp(t,e){return ya(t,e)}d(Hp,"isEqual");var Yn=Hp;function Up(t,e,n){n=typeof n=="function"?n:void 0;var r=n?n(t,e):void 0;return r===void 0?ya(t,e,void 0,n):!!r}d(Up,"isEqualWith");var Vw=Up;function Zp(t){return t===void 0}d(Zp,"isUndefined");var Lc=Zp;function $p(t,e){var n={};return e=No(e,3),Gw(t,function(r,a,o){qf(n,a,e(r,a,o))}),n}d($p,"mapValues");var Jw=$p,Yw="Expected a function";function jp(t){if(typeof t!="function")throw new TypeError(Yw);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}d(jp,"negate");var Xw=jp;function Kp(t,e,n,r){if(!Xn(t))return t;e=ga(e,t);for(var a=-1,o=e.length,i=o-1,s=t;s!=null&&++a<o;){var l=Fr(e[a]),f=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(a!=i){var p=s[l];f=r?r(p,l,s):void 0,f===void 0&&(f=Xn(p)?p:ko(e[a+1])?[]:{})}$T(s,l,f),s=s[l]}return t}d(Kp,"baseSet");var Qw=Kp;function Lp(t,e,n){for(var r=-1,a=e.length,o={};++r<a;){var i=e[r],s=Ro(t,i);n(s,i)&&Qw(o,ga(i,t),s)}return o}d(Lp,"basePickBy");var ex=Lp;function Fp(t,e){if(t==null)return{};var n=Nf(Lb(t),function(r){return[r]});return e=No(e),ex(t,n,function(r,a){return e(r,a[0])})}d(Fp,"pickBy");var tx=Fp;function Wp(t,e){return tx(t,Xw(No(e)))}d(Wp,"omitBy");var Fc=Wp,nx=d(t=>{let e=t.checks;return e.length===0?"":e.map(rx).join("")},"generateStringChecks"),rx=d(t=>{switch(t.kind){case"min":return`.min(${se(t.value)}, ${se(t.message)})`;case"max":return`.max(${se(t.value)}, ${se(t.message)})`;case"length":return`.length(${se(t.value)}, ${se(t.message)})`;case"email":return`.email(${se(t.message)})`;case"url":return`.url(${se(t.message)})`;case"emoji":return`.emoji(${se(t.message)})`;case"uuid":return`.uuid(${se(t.message)})`;case"cuid":return`.cuid(${se(t.message)})`;case"cuid2":return`.cuid2(${se(t.message)})`;case"ulid":return`.ulid(${se(t.message)})`;case"includes":let e=Jn({message:t.message,position:t.position});return`.includes(${se(t.value)}, ${e})`;case"startsWith":return`.startsWith(${se(t.value)}, ${se(t.message)})`;case"endsWith":return`.endsWith(${se(t.value)}, ${se(t.message)})`;case"regex":return`.regex(${String(t.regex)}, ${se(t.message)})`;case"trim":return".trim()";case"toLowerCase":return".toLowerCase()";case"toUpperCase":return".toUpperCase()";case"datetime":let r=t.precision===null?void 0:t.precision;return`.datetime(${Jn({message:t.message,precision:r,offset:t.offset})})`;case"ip":return`.ip(${Jn({message:t.message,version:t.version})})`;default:return""}},"_generateStringCheck"),ix=d(t=>{let e=t.checks;return e.length===0?"":e.map(ax).join("")},"generateNumberChecks"),ax=d(t=>{switch(t.kind){case"min":return`.min(${se(t.value)}, ${se(t.message)})`;case"max":return`.max(${se(t.value)}, ${se(t.message)})`;case"int":return`.int(${se(t.message)})`;case"multipleOf":return`.multipleOf(${se(t.value)}, ${se(t.message)})`;case"finite":return`.finite(${se(t.message)})`;default:return""}},"_generateNumberCheck"),ox=d(t=>{let e=t.checks;return e.length===0?"":e.map(sx).join("")},"generateBigIntChecks"),sx=d(t=>{switch(t.kind){case"min":return`.min(${se(t.value)}, ${se(t.message)})`;case"max":return`.max(${se(t.value)}, ${se(t.message)})`;case"multipleOf":return`.multipleOf(${se(t.value)}, ${se(t.message)})`;default:return""}},"_generateBigIntCheck"),lx=d(t=>{let e=t.checks;return e.length===0?"":e.map(ux).join("")},"generateDateChecks"),ux=d(t=>{switch(t.kind){case"min":return`.min(${Wc(t.value)}, ${se(t.message)})`;case"max":return`.max(${Wc(t.value)}, ${se(t.message)})`;default:return""}},"_generateDateCheck"),Wc=d(t=>`new Date(${t})`,"dateTs"),cx=d(t=>{let e=[];if(t.exactLength){let{value:n,message:r}=t.exactLength;e.push(`.length(${se(n)}, ${se(r)})`)}if(t.minLength){let{value:n,message:r}=t.minLength;e.push(`.min(${se(n)}, ${se(r)})`)}if(t.maxLength){let{value:n,message:r}=t.maxLength;e.push(`.max(${se(n)}, ${se(r)})`)}return e.join("")},"generateArrayChecks"),fx=d(t=>{let e=[];if(t.minSize){let{value:n,message:r}=t.minSize;e.push(`.min(${se(n)}, ${se(r)})`)}if(t.maxSize){let{value:n,message:r}=t.maxSize;e.push(`.max(${se(n)}, ${se(r)})`)}return e.join("")},"generateSetChecks");function Do(t){return Fe(t)}d(Do,"toTypescriptSchema");function Fe(t){let n=t._def;switch(n.typeName){case M.ZodFirstPartyTypeKind.ZodString:return`z.string()${nx(n)}${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodNumber:return`z.number()${ix(n)}${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodNaN:return`z.nan()${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodBigInt:return`z.bigint()${ox(n)}${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodBoolean:return`z.boolean()${Ce(n)}${Ae(t._def)}`.trim();case M.ZodFirstPartyTypeKind.ZodDate:return`z.date()${lx(n)}${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodUndefined:return`z.undefined()${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodNull:return`z.null()${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodAny:return`z.any()${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodUnknown:return`z.unknown()${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodNever:return`z.never()${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodVoid:return`z.void()${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodArray:return`z.array(${Fe(n.type)})${cx(n)}${Ce(n)}${Ae(n)}`;case M.ZodFirstPartyTypeKind.ZodObject:let r=Jw(n.shape(),Fe),a=t.additionalProperties(),o=a?`.catchall(${Fe(a)})`:"";return["z.object({",...Object.entries(r).map(([ee,ge])=>` ${ee}: ${ge},`),`})${o}${Ce(n)}${Ae(n)}`].join(`
|
|
23
|
+
`).trim();case M.ZodFirstPartyTypeKind.ZodUnion:return`z.union([${n.options.map(Fe).join(", ")}])${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let s=n.options.map(Fe);return`z.discriminatedUnion(${se(n.discriminator)}, [${s.join(", ")}])${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodIntersection:let f=Fe(n.left),p=Fe(n.right);return`z.intersection(${f}, ${p})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodTuple:return`z.tuple([${n.items.map(Fe).join(", ")}])${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodRecord:let g=Fe(n.keyType),h=Fe(n.valueType);return`z.record(${g}, ${h})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodMap:let w=Fe(n.keyType),P=Fe(n.valueType);return`z.map(${w}, ${P})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodSet:return`z.set(${Fe(n.valueType)})${fx(n)}${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodFunction:let B=n.args.items.map(Fe),v=B.length?`.args(${B.join(", ")})`:"",S=Fe(n.returns);return`z.function()${v}.returns(${S})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodLazy:return`z.lazy(() => ${Fe(n.getter())})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodLiteral:return`z.literal(${se(n.value)})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodEnum:return`z.enum([${n.values.map(se).join(", ")}])${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodEffects:throw new _n(M.ZodFirstPartyTypeKind.ZodEffects);case M.ZodFirstPartyTypeKind.ZodNativeEnum:throw new _n(M.ZodFirstPartyTypeKind.ZodNativeEnum);case M.ZodFirstPartyTypeKind.ZodOptional:return`z.optional(${Fe(n.innerType)})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodNullable:return`z.nullable(${Fe(n.innerType)})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodDefault:let K=Jn(n.defaultValue());return`z.default(${Fe(n.innerType)}, ${K})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodCatch:throw new _n(M.ZodFirstPartyTypeKind.ZodCatch);case M.ZodFirstPartyTypeKind.ZodPromise:return`z.promise(${Fe(n.type)})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodBranded:throw new _n(M.ZodFirstPartyTypeKind.ZodBranded);case M.ZodFirstPartyTypeKind.ZodPipeline:throw new _n(M.ZodFirstPartyTypeKind.ZodPipeline);case M.ZodFirstPartyTypeKind.ZodSymbol:throw new _n(M.ZodFirstPartyTypeKind.ZodSymbol);case M.ZodFirstPartyTypeKind.ZodReadonly:return`z.readonly(${Fe(n.innerType)})${Ce(n)}${Ae(n)}`.trim();case M.ZodFirstPartyTypeKind.ZodRef:return`z.ref(${se(n.uri)})${Ce(n)}${Ae(n)}`.trim();default:be.assertNever(n)}}d(Fe,"sUnwrapZod");var Ae=d(t=>t.description?`.describe(${se(t.description)})`:"","_maybeDescribe"),Ce=d(t=>`${dx(t)}${px(t)}${gx(t)}${yx(t)}${mx(t)}${hx(t)}${vx(t)}`,"_addZuiExtensions"),dx=d(t=>{var e;return(e=t[le])!=null&&e.title?`.title(${se(t[le].title)})`:""},"_maybeTitle"),px=d(t=>{var e;return(e=t[le])!=null&&e.displayAs?`.displayAs(${tf({id:t[le].displayAs[0],params:t[le].displayAs[1]})})`:""},"_maybeDisplayAs"),gx=d(t=>{var e;return(e=t[le])!=null&&e.disabled?`.disabled(${t[le].disabled})`:""},"_maybeDisabled"),yx=d(t=>{var e;return(e=t[le])!=null&&e.hidden?`.hidden(${t[le].hidden})`:""},"_maybeHidden"),mx=d(t=>{var e;return(e=t[le])!=null&&e.placeholder?`.placeholder(${se(t[le].placeholder)})`:""},"_maybePlaceholder"),hx=d(t=>{var e;return(e=t[le])!=null&&e.secret?".secret()":""},"_maybeSecret"),vx=d(t=>{var e;let n=["title","tooltip","displayAs","disabled","hidden","placeholder","secret","coerce"],r=Object.entries((e=t[le])!=null?e:{}).filter(([a])=>!n.includes(a));return r.length>0?`.metadata(${tf(Object.fromEntries(r))})`:""},"_maybeSetMetadata"),Tx=d(t=>{let e={type:"number",description:t.description,"x-zui":t._def["x-zui"]};t._def[le]&&(e[le]=t._def[le]);for(let n of t._def.checks)switch(n.kind){case"min":{let r=n.inclusive?"minimum":"exclusiveMinimum",a=n.inclusive?"exclusiveMinimum":"minimum";e[r]=n.value,delete e[a];break}case"max":{let r=n.inclusive?"maximum":"exclusiveMaximum",a=n.inclusive?"exclusiveMaximum":"maximum";e[r]=n.value,delete e[a];break}case"int":e.type="integer";break;case"finite":{e.format="finite";break}case"multipleOf":e.multipleOf=n.value;break;default:}return e},"zodNumberToJsonNumber"),zp="\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}",qp="(([+-]\\d{2}(:?\\d{2})?)|Z)",_x="Z",Gp="(\\.\\d+)?",ho="\\.\\d{",bx="}",Vp=d(t=>{let e=t.precision?ho+t.precision+bx:t.precision===0?"":Gp,n=t.offset?qp:_x;return new RegExp(`^${zp}${e}${n}$`)},"generateDatetimeRegex"),wx=d(t=>({precision:xx(t),offset:t.endsWith(`${qp}$`)}),"extractPrecisionAndOffset"),xx=d(t=>{let e=t.slice(1+zp.length);return e.startsWith(Gp)?null:e.startsWith(ho)?parseInt(e.slice(ho.length)):0},"_extractPrecision"),Mr={};aa(Mr,{escapeSpecialChars:()=>Px});var Px=d(t=>t.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeSpecialChars");function Ho(t,e,n,r){r?.errorMessages&&n&&(t.errorMessage=N(_({},t.errorMessage),{[e]:n}))}d(Ho,"addErrorMessage");function Re(t,e,n,r,a){t[e]=n,Ho(t,e,r,a)}d(Re,"setResponseValueAndErrors");var Xe={cuid:"^[cC][^\\s-]{8,}$",cuid2:"^[a-z][a-z0-9]*$",ulid:"^[0-9A-HJKMNP-TV-Z]{26}$",email:"^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_+-\\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\\-]*\\.)+[a-zA-Z]{2,}$",emoji:"^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uuid:"^[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}$",ipv4:"^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$",ipv6:"^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$"};function Uo(t,e){let n=_({type:"string"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{});function r(a){return e.patternStrategy==="escape"?Mr.escapeSpecialChars(a):a}if(d(r,"processPattern"),t.checks)for(let a of t.checks)switch(a.kind){case"min":Re(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,a.value):a.value,a.message,e);break;case"max":Re(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,a.value):a.value,a.message,e);break;case"email":switch(e.emailStrategy){case"format:email":Tn(n,"email",a.message,e);break;case"format:idn-email":Tn(n,"idn-email",a.message,e);break;case"pattern:zod":Lt(n,Xe.email,a.message,e);break}break;case"url":Tn(n,"uri",a.message,e);break;case"uuid":Tn(n,"uuid",a.message,e);break;case"regex":Lt(n,a.regex.source,a.message,e);break;case"cuid":Lt(n,Xe.cuid,a.message,e);break;case"cuid2":Lt(n,Xe.cuid2,a.message,e);break;case"startsWith":Lt(n,"^"+r(a.value),a.message,e);break;case"endsWith":Lt(n,r(a.value)+"$",a.message,e);break;case"datetime":Tn(n,"date-time",a.message,e);break;case"length":Re(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,a.value):a.value,a.message,e),Re(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,a.value):a.value,a.message,e);break;case"includes":{Lt(n,r(a.value),a.message,e);break}case"ip":{a.version!=="v6"&&Tn(n,"ipv4",a.message,e),a.version!=="v4"&&Tn(n,"ipv6",a.message,e);break}case"emoji":Lt(n,Xe.emoji,a.message,e);break;case"ulid":{Lt(n,Xe.ulid,a.message,e);break}case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}d(Uo,"parseStringDef");var Tn=d((t,e,n,r)=>{var a;t.format||(a=t.anyOf)!=null&&a.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push(_({format:t.format},t.errorMessage&&r.errorMessages&&{errorMessage:{format:t.errorMessage.format}})),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push(_({format:e},n&&r.errorMessages&&{errorMessage:{format:n}}))):Re(t,"format",e,n,r)},"addFormat"),Lt=d((t,e,n,r)=>{var a;t.pattern||(a=t.allOf)!=null&&a.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push(_({pattern:t.pattern},t.errorMessage&&r.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}})),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push(_({pattern:e},n&&r.errorMessages&&{errorMessage:{pattern:n}}))):Re(t,"pattern",e,n,r)},"addPattern"),Bx=d(t=>{let e={type:"string",description:t.description,"x-zui":t._def["x-zui"]};t._def[le]&&(e[le]=t._def[le]);for(let n of t._def.checks)switch(n.kind){case"cuid":e.format="cuid",e.pattern=Xe.cuid;break;case"cuid2":e.format="cuid2",e.pattern=Xe.cuid2;break;case"ulid":e.format="ulid",e.pattern=Xe.ulid;break;case"uuid":e.format="uuid",e.pattern=Xe.uuid;break;case"emoji":e.format="emoji",e.pattern=Xe.emoji;break;case"email":e.format="email",e.pattern=Xe.email;break;case"ip":e.format=n.version==="v6"?"ipv6":"ipv4",e.pattern=n.version==="v6"?Xe.ipv6:Xe.ipv4;break;case"datetime":e.format="date-time",e.pattern=Vp(n).source,e[le]=N(_({},e[le]),{precision:n.precision,offset:n.offset});break;case"url":e.format="uri";break;case"endsWith":e.pattern=`${Mr.escapeSpecialChars(n.value)}$`;break;case"startsWith":e.pattern=`^${Mr.escapeSpecialChars(n.value)}`;break;case"includes":let r=n.position&&n.position>=1?`^(?:.{${n.position}}).*`:"";e.pattern=`${r}${Mr.escapeSpecialChars(n.value)}`;break;case"regex":e.pattern=n.regex.source;break;case"length":e.minLength=e.maxLength=Math.max(0,n.value);break;case"min":e.minLength=Math.max(0,n.value);break;case"max":e.maxLength=Math.max(0,n.value);break;default:throw new ff({zodType:M.ZodFirstPartyTypeKind.ZodString,checkKind:n.kind})}return e},"zodStringToJsonString"),Ex=d((t,e)=>{let n={type:"array",description:t.description,items:e(t._def.type),"x-zui":t._def["x-zui"]};return t._def[le]&&(n[le]=t._def[le]),t._def.minLength&&(n.minItems=t._def.minLength.value),t._def.maxLength&&(n.maxItems=t._def.maxLength.value),t._def.exactLength&&(n.minItems=t._def.exactLength.value,n.maxItems=t._def.exactLength.value),n},"zodArrayToJsonArray"),Sx=d((t,e)=>{let n={type:"array",description:t.description,uniqueItems:!0,items:e(t._def.valueType),"x-zui":t._def["x-zui"]};return t._def[le]&&(n[le]=t._def[le]),t._def.minSize&&(n.minItems=t._def.minSize.value),t._def.maxSize&&(n.maxItems=t._def.maxSize.value),n},"zodSetToJsonSet"),kx=d((t,e)=>{let n={type:"array",description:t.description,items:t._def.items.map(r=>e(r))};return t._def[le]&&(n[le]=t._def[le]),t._def.rest&&(n.additionalItems=e(t._def.rest)),n},"zodTupleToJsonTuple");function st(t){let e=t,n=e._def;switch(n.typeName){case M.ZodFirstPartyTypeKind.ZodString:return Bx(e);case M.ZodFirstPartyTypeKind.ZodNumber:return Tx(e);case M.ZodFirstPartyTypeKind.ZodNaN:throw new pt(M.ZodFirstPartyTypeKind.ZodNaN);case M.ZodFirstPartyTypeKind.ZodBigInt:throw new pt(M.ZodFirstPartyTypeKind.ZodBigInt,{suggestedAlternative:"serialize bigint to string"});case M.ZodFirstPartyTypeKind.ZodBoolean:return{type:"boolean",description:n.description,"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodDate:throw new pt(M.ZodFirstPartyTypeKind.ZodDate,{suggestedAlternative:"use z.string().datetime() instead"});case M.ZodFirstPartyTypeKind.ZodUndefined:return ao(n);case M.ZodFirstPartyTypeKind.ZodNull:return oo(n);case M.ZodFirstPartyTypeKind.ZodAny:return{description:n.description,"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodUnknown:return{description:n.description,"x-zui":N(_({},n["x-zui"]),{def:{typeName:M.ZodFirstPartyTypeKind.ZodUnknown}})};case M.ZodFirstPartyTypeKind.ZodNever:return{not:!0,description:n.description,"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodVoid:throw new pt(M.ZodFirstPartyTypeKind.ZodVoid);case M.ZodFirstPartyTypeKind.ZodArray:return Ex(e,st);case M.ZodFirstPartyTypeKind.ZodObject:let r=Object.entries(n.shape()),a=r.filter(([p,y])=>!y.isOptional()),o=a.length?a.map(([p])=>p):void 0,i=r.map(([p,y])=>[p,y.mandatory()]).map(([p,y])=>[p,st(y)]),s=!1;return n.unknownKeys instanceof M.ZodType?s=st(n.unknownKeys):n.unknownKeys==="passthrough"&&(s=!0),{type:"object",description:n.description,properties:Object.fromEntries(i),required:o,additionalProperties:s,"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodUnion:return{description:n.description,anyOf:n.options.map(p=>st(p)),"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return{description:n.description,anyOf:n.options.map(p=>st(p)),"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodIntersection:let l=st(n.left),f=st(n.right);return"additionalProperties"in l&&delete l.additionalProperties,"additionalProperties"in f&&delete f.additionalProperties,{description:n.description,allOf:[l,f],"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodTuple:return kx(e,st);case M.ZodFirstPartyTypeKind.ZodRecord:return{type:"object",description:n.description,additionalProperties:st(n.valueType),"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodMap:throw new pt(M.ZodFirstPartyTypeKind.ZodMap);case M.ZodFirstPartyTypeKind.ZodSet:return Sx(e,st);case M.ZodFirstPartyTypeKind.ZodFunction:throw new pt(M.ZodFirstPartyTypeKind.ZodFunction);case M.ZodFirstPartyTypeKind.ZodLazy:throw new pt(M.ZodFirstPartyTypeKind.ZodLazy);case M.ZodFirstPartyTypeKind.ZodLiteral:if(typeof n.value=="string")return{type:"string",description:n.description,const:n.value,"x-zui":n["x-zui"]};if(typeof n.value=="number")return{type:"number",description:n.description,const:n.value,"x-zui":n["x-zui"]};if(typeof n.value=="boolean")return{type:"boolean",description:n.description,const:n.value,"x-zui":n["x-zui"]};if(n.value===null)return oo(n);if(n.value===void 0)return ao(n);{M.util.assertEqual(!0);let p=typeof n.value;throw new sa(`Unsupported literal type: "${p}"`)}case M.ZodFirstPartyTypeKind.ZodEnum:return{type:"string",description:n.description,enum:n.values,"x-zui":n["x-zui"]};case M.ZodFirstPartyTypeKind.ZodEffects:throw new pt(M.ZodFirstPartyTypeKind.ZodEffects);case M.ZodFirstPartyTypeKind.ZodNativeEnum:throw new pt(M.ZodFirstPartyTypeKind.ZodNativeEnum);case M.ZodFirstPartyTypeKind.ZodOptional:return{description:n.description,anyOf:[st(n.innerType),ao()],"x-zui":N(_({},n["x-zui"]),{def:{typeName:M.ZodFirstPartyTypeKind.ZodOptional}})};case M.ZodFirstPartyTypeKind.ZodNullable:return{anyOf:[st(n.innerType),oo()],"x-zui":N(_({},n["x-zui"]),{def:{typeName:M.ZodFirstPartyTypeKind.ZodNullable}})};case M.ZodFirstPartyTypeKind.ZodDefault:return N(_({},st(n.innerType)),{default:n.defaultValue()});case M.ZodFirstPartyTypeKind.ZodCatch:throw new pt(M.ZodFirstPartyTypeKind.ZodCatch);case M.ZodFirstPartyTypeKind.ZodPromise:throw new pt(M.ZodFirstPartyTypeKind.ZodPromise);case M.ZodFirstPartyTypeKind.ZodBranded:throw new pt(M.ZodFirstPartyTypeKind.ZodBranded);case M.ZodFirstPartyTypeKind.ZodPipeline:throw new pt(M.ZodFirstPartyTypeKind.ZodPipeline);case M.ZodFirstPartyTypeKind.ZodSymbol:throw new pt(M.ZodFirstPartyTypeKind.ZodPipeline);case M.ZodFirstPartyTypeKind.ZodReadonly:return N(_({},st(n.innerType)),{readOnly:!0});case M.ZodFirstPartyTypeKind.ZodRef:return{$ref:n.uri,description:n.description,"x-zui":n["x-zui"]};default:M.util.assertNever(n)}}d(st,"toJSONSchema");var ao=d(t=>({not:!0,description:t?.description,"x-zui":N(_({},t?.["x-zui"]),{def:{typeName:M.ZodFirstPartyTypeKind.ZodUndefined}})}),"undefinedSchema"),oo=d(t=>({type:"null",description:t?.description,"x-zui":t?.["x-zui"]}),"nullSchema"),Jp=class{constructor(e,n,r,a){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};d(Jp,"ParseInputLazyPath");var Ot=Jp,zc=d((t,e)=>{if($r(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Wt(t.common.issues);return this._error=n,this._error}}},"handleResult"),Yp=class{constructor(e){this.__type__="ZuiType",this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._metadataRoot._def.description}dereference(e){return this}getReferences(){return[]}clone(){let e=this.constructor;return new e(_({},this._def))}_getType(e){return sn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:sn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Tt,ctx:{common:e.parent.common,data:e.data,parsedType:sn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Si(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;let a={common:{issues:[],async:(r=n?.async)!=null?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sn(e)},o=this._parseSync({data:e,path:a.path,parent:a});return zc(a,o)}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sn(e)},a=this._parse({data:e,path:r.path,parent:r}),o=await(Si(a)?a:Promise.resolve(a));return zc(r,o)}refine(e,n){let r=d(a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n,"getIssueProperties");return this._refinement((a,o)=>{let i=e(a),s=d(()=>o.addIssue(_({code:G.custom},r(a))),"setError");return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(s(),!1)):i?!0:(s(),!1)})}refinement(e,n){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(e){return new Sn({schema:this,typeName:"ZodEffects",effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ln.create(this,this._def)}nullable(){return Qn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Kr.create(this,this._def)}promise(){return va.create(this,this._def)}mandatory(){return this}or(e){return Qo.create([this,e],this._def)}and(e){return zo.create(this,e,this._def)}transform(e){return new Sn(N(_({},me(this._def)),{schema:this,typeName:"ZodEffects",effect:{type:"transform",transform:e}}))}default(e){let n=typeof e=="function"?e:()=>e;return new ma(N(_({},me(this._def)),{innerType:this,defaultValue:n,typeName:"ZodDefault"}))}brand(){return new Ko(_({typeName:"ZodBranded",type:this},me(this._def)))}catch(e){let n=typeof e=="function"?e:()=>e;return new Lo(N(_({},me(this._def)),{innerType:this,catchValue:n,typeName:"ZodCatch"}))}describe(e){let n=this.clone();return n._metadataRoot._def.description=e,n}pipe(e){return Xo.create(this,e)}readonly(){return Ta.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}metadata(e){var n,r,a;let o=this.clone(),i=o._metadataRoot;(a=(n=i._def)[r=le])!=null||(n[r]={});for(let[s,l]of Object.entries(e))i._def[le]=N(_({},i._def[le]),{[s]:l});return o}getMetadata(){return _({},this._metadataRoot._def[le])}setMetadata(e){this._metadataRoot._def[le]=_({},e)}get ui(){return _({},this._metadataRoot._def[le])}get _metadataRoot(){return this.naked()}displayAs(e){return this.metadata({displayAs:[e.id,e.params]})}title(e){return this.metadata({title:e})}hidden(e){let n;return e===void 0?n=!0:typeof e=="function"?n=e.toString():n=e,this.metadata({hidden:n})}disabled(e){let n;return e===void 0?n=!0:typeof e=="function"?n=e.toString():n=e,this.metadata({disabled:n})}placeholder(e){return this.metadata({placeholder:e})}toJSONSchema(){return st(this)}toTypescriptType(e){return Bo(this,e)}toTypescriptSchema(){return Do(this)}naked(){return this}};d(Yp,"ZodType");var he=Yp,Xp=(t=>(t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodRef="ZodRef",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly",t))(Xp||{}),be;(t=>{t.assertEqual=d(a=>a,"assertEqual");function e(a){}t.assertIs=e,d(e,"assertIs");function n(a){throw new Error("assertNever called")}t.assertNever=n,d(n,"assertNever"),t.arrayToEnum=d(a=>{let o={};for(let i of a)o[i]=i;return o},"arrayToEnum"),t.getValidEnumValues=d(a=>{let o=(0,t.objectKeys)(a).filter(s=>typeof a[a[s]]!="number"),i={};for(let s of o)i[s]=a[s];return(0,t.objectValues)(i)},"getValidEnumValues"),t.objectValues=d(a=>(0,t.objectKeys)(a).map(function(o){return a[o]}),"objectValues"),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let o=[];for(let i in a)Object.prototype.hasOwnProperty.call(a,i)&&o.push(i);return o},t.find=d((a,o)=>{for(let i of a)if(o(i))return i},"find"),t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function r(a,o=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,d(r,"joinValues"),t.jsonStringifyReplacer=d((a,o)=>typeof o=="bigint"?o.toString():o,"jsonStringifyReplacer"),t.compareFunctions=d((a,o)=>a.toString()===o.toString(),"compareFunctions"),t.mock=d(()=>({}),"mock")})(be||(be={}));var vo;(t=>{t.mergeShapes=d((e,n)=>_(_({},e),n),"mergeShapes")})(vo||(vo={}));var ne=be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),sn=d(t=>{switch(typeof t){case"undefined":return ne.undefined;case"string":return ne.string;case"number":return isNaN(t)?ne.nan:ne.number;case"boolean":return ne.boolean;case"function":return ne.function;case"bigint":return ne.bigint;case"symbol":return ne.symbol;case"object":return Array.isArray(t)?ne.array:t===null?ne.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ne.promise:typeof Map<"u"&&t instanceof Map?ne.map:typeof Set<"u"&&t instanceof Set?ne.set:typeof Date<"u"&&t instanceof Date?ne.date:ne.object;default:return ne.unknown}},"getParsedType");function me(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:a,supportsExtensions:o,[le]:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);let s=i?Object.fromEntries(Object.entries(i).filter(([f])=>f!=="secret"||o?.includes("secret"))):void 0;return e?{errorMap:e,description:a,[le]:s}:{errorMap:d((f,p)=>f.code!=="invalid_type"?{message:p.defaultError}:typeof p.data>"u"?{message:r??p.defaultError}:{message:n??p.defaultError},"customMap"),description:a,[le]:s}}d(me,"processCreateParams");var Zo=d((t,e)=>{let n;switch(t.code){case G.invalid_type:t.received===ne.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case G.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,be.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:n=`Unrecognized key(s) in object: ${be.joinValues(t.keys,", ")}`;break;case G.invalid_union:n="Invalid input";break;case G.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${be.joinValues(t.options)}`;break;case G.invalid_enum_value:n=`Invalid enum value. Expected ${be.joinValues(t.options)}, received '${t.received}'`;break;case G.invalid_arguments:n="Invalid function arguments";break;case G.invalid_return_type:n="Invalid function return type";break;case G.invalid_date:n="Invalid date";break;case G.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:be.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case G.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case G.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case G.custom:n="Invalid input";break;case G.invalid_intersection_types:n="Intersection results could not be merged";break;case G.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case G.not_finite:n="Number must be finite";break;case G.unresolved_reference:n="Unresolved reference";break;default:n=e.defaultError,be.assertNever(t)}return{message:n}},"errorMap"),qc=Zo,G=be.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","unresolved_reference"]),Ix=d(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Bi=class Qp extends Error{constructor(e){super(),this.issues=[],this.addIssue=d(r=>{this.issues=[...this.issues,r]},"addIssue"),this.addIssues=d((r=[])=>{this.issues=[...this.issues,...r]},"addIssues");let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let n=e||function(o){return o.message},r={_errors:[]},a=d(o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let s=r,l=0;for(;l<i.path.length;){let f=i.path[l];l===i.path.length-1?(s[f]=s[f]||{_errors:[]},s[f]._errors.push(n(i))):s[f]=s[f]||{_errors:[]},s=s[f],l++}}},"processError");return a(this),r}static assert(e){if(!(e instanceof Qp))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,be.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let a of this.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};d(Bi,"ZodError");Bi.create=d(t=>new Bi(t),"create");var Wt=Bi,eg=Zo;function tg(t){eg=t}d(tg,"setErrorMap");function Zr(){return eg}d(Zr,"getErrorMap");var Ei=d(t=>{var e;let{data:n,path:r,errorMaps:a,issueData:o}=t,i=[...r,...o.path||[]],s=N(_({},o),{path:i}),l="",f=a.filter(p=>!!p).slice().reverse();for(let p of f)l=p(s,{data:n,defaultError:l}).message;return N(_({},o),{path:i,message:(e=o.message)!=null?e:l})},"makeIssue"),Ax=[];function te(t,e){let n=Ei({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Zr(),Zo].filter(r=>!!r)});t.common.issues.push(n)}d(te,"addIssueToContext");var ng=class rg{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let a of n){if(a.status==="aborted")return pe;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let a of n)r.push({key:await a.key,value:await a.value});return rg.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let a of n){let{key:o,value:i}=a;if(o.status==="aborted"||i.status==="aborted")return pe;o.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(r[o.value]=i.value)}return{status:e.value,value:r}}};d(ng,"ParseStatus");var Tt=ng,pe=Object.freeze({status:"aborted"}),Vn=d(t=>({status:"dirty",value:t}),"DIRTY"),gt=d(t=>({status:"valid",value:t}),"OK"),To=d(t=>t.status==="aborted","isAborted"),_o=d(t=>t.status==="dirty","isDirty"),$r=d(t=>t.status==="valid","isValid"),Si=d(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync"),ue;(t=>{t.errToObj=d(e=>typeof e=="string"?{message:e}:e||{},"errToObj"),t.toString=d(e=>typeof e=="string"?e:e?.message,"toString")})(ue||(ue={}));var ki=class ig extends he{constructor(){super(...arguments),this._any=!0}_parse(e){return gt(e.data)}isEqual(e){return e instanceof ig}};d(ki,"ZodAny");ki.create=d(t=>new ki(_({typeName:"ZodAny"},me(t))),"create");var jr=ki,Ii=class wn extends he{dereference(e){return new wn(N(_({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}clone(){return new wn(N(_({},this._def),{type:this._def.type.clone()}))}isEqual(e){var n,r,a,o,i,s;return e instanceof wn?Yn((n=this._def.exactLength)==null?void 0:n.value,(r=e._def.exactLength)==null?void 0:r.value)&&Yn((a=this._def.maxLength)==null?void 0:a.value,(o=e._def.maxLength)==null?void 0:o.value)&&Yn((i=this._def.minLength)==null?void 0:i.value,(s=e._def.minLength)==null?void 0:s.value)&&this._def.type.isEqual(e._def.type):!1}_parse(e){let{ctx:n,status:r}=this._processInputParams(e),a=this._def;if(n.parsedType!==ne.array)return te(n,{code:G.invalid_type,expected:ne.array,received:n.parsedType}),pe;if(a.exactLength!==null){let i=n.data.length>a.exactLength.value,s=n.data.length<a.exactLength.value;(i||s)&&(te(n,{code:i?G.too_big:G.too_small,minimum:s?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(te(n,{code:G.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(te(n,{code:G.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,s)=>a.type._parseAsync(new Ot(n,i,n.path,s)))).then(i=>Tt.mergeArray(r,i));let o=[...n.data].map((i,s)=>a.type._parseSync(new Ot(n,i,n.path,s)));return Tt.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new wn(N(_({},this._def),{minLength:{value:e,message:ue.toString(n)}}))}max(e,n){return new wn(N(_({},this._def),{maxLength:{value:e,message:ue.toString(n)}}))}length(e,n){return new wn(N(_({},this._def),{exactLength:{value:e,message:ue.toString(n)}}))}nonempty(e){return this.min(1,e)}};d(Ii,"ZodArray");Ii.create=d((t,e)=>new Ii(_({type:t,minLength:null,maxLength:null,exactLength:null,typeName:"ZodArray"},me(e))),"create");var Kr=Ii,Cx=d((t,e)=>ag(t,e,new WeakSet),"isEqual"),ag=d((t,e,n)=>Vw(t,e,Ox(n)),"_isEqualWithVisitedTracking"),Ox=d(t=>(e,n)=>{if(Ic(e)&&!t.has(e)&&Ic(n)&&!t.has(n)){let r=Fc(e,Lc),a=Fc(n,Lc);return t.add(r).add(a).add(e).add(n),ag(r,a,t)}},"_customizerWithVisitedTracking"),Rx={compare:Cx},og=class{constructor(e=[],n={}){this._options=_(_({},Rx),n),this._items=[];for(let r of e)this.add(r)}get items(){return[...this._items]}get size(){return this._items.length}has(e){return this._items.some(n=>this._options.compare(n,e))}add(e){this.has(e)||this._items.push(e)}isEqual(e){return this.size!==e.size?!1:this.isSubsetOf(e)&&e.isSubsetOf(this)}isSubsetOf(e){return this.size>e.size?!1:this._items.every(n=>e.has(n))}};d(og,"CustomSet");var et=og,Ai=class hi extends he{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ne.bigint){let o=this._getOrReturnCtx(e);return te(o,{code:G.invalid_type,expected:ne.bigint,received:o.parsedType}),pe}let r,a=new Tt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):be.assertNever(o);return{status:a.value,value:e.data}}isEqual(e){if(!(e instanceof hi)||this._def.coerce!==e._def.coerce)return!1;let n=new et(this._def.checks),r=new et(e._def.checks);return n.isEqual(r)}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,r,a){return new hi(N(_({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ue.toString(a)}]}))}_addCheck(e){return new hi(N(_({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};d(Ai,"ZodBigInt");Ai.create=d(t=>{var e;return new Ai(_({checks:[],typeName:"ZodBigInt",coerce:(e=t?.coerce)!=null?e:!1},me(t)))},"create");var $o=Ai,Ci=class sg extends he{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ne.boolean){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.boolean,received:r.parsedType}),pe}return gt(e.data)}isEqual(e){return e instanceof sg?this._def.coerce===e._def.coerce:!1}};d(Ci,"ZodBoolean");Ci.create=d(t=>new Ci(_({typeName:"ZodBoolean",coerce:t?.coerce||!1},me(t))),"create");var jo=Ci,Mx=Symbol("zod_brand"),lg=class br extends he{dereference(e){return new br(N(_({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}clone(){return new br(N(_({},this._def),{type:this._def.type.clone()}))}_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}isEqual(e){return e instanceof br?this._def.type.isEqual(e._def.type):!1}naked(){return this._def.type.naked()}mandatory(){return new br(N(_({},this._def),{type:this._def.type.mandatory()}))}};d(lg,"ZodBranded");var Ko=lg,Oi=class wr extends he{_parse(e){let{ctx:n}=this._processInputParams(e),r=N(_({},n),{common:N(_({},n.common),{issues:[]})}),a=this._def.innerType._parse({data:r.data,path:r.path,parent:_({},r)});return Si(a)?a.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Wt(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Wt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}isEqual(e){return e instanceof wr?this._def.innerType.isEqual(e._def.innerType)&&be.compareFunctions(this._def.catchValue,e._def.catchValue):!1}dereference(e){return new wr(N(_({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new wr(N(_({},this._def),{innerType:this._def.innerType.clone()}))}naked(){return this._def.innerType.naked()}mandatory(){return new wr(N(_({},this._def),{innerType:this._def.innerType.mandatory()}))}};d(Oi,"ZodCatch");Oi.create=d((t,e)=>new Oi(_({innerType:t,typeName:"ZodCatch",catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},me(e))),"create");var Lo=Oi,ug=d((t,e={},n)=>t?jr.create().superRefine((r,a)=>{var o,i;if(!t(r)){let s=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(i=(o=s.fatal)!=null?o:n)!=null?i:!0,f=typeof s=="string"?{message:s}:s;a.addIssue(N(_({code:"custom"},f),{fatal:l}))}}):jr.create(),"custom"),Ri=class bo extends he{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ne.date){let o=this._getOrReturnCtx(e);return te(o,{code:G.invalid_type,expected:ne.date,received:o.parsedType}),pe}if(isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return te(o,{code:G.invalid_date}),pe}let r=new Tt,a;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(a=this._getOrReturnCtx(e,a),te(a,{code:G.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(a=this._getOrReturnCtx(e,a),te(a,{code:G.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):be.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new bo(N(_({},this._def),{checks:[...this._def.checks,e]}))}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ue.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ue.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}isEqual(e){if(!(e instanceof bo))return!1;let n=new et(this._def.checks),r=new et(e._def.checks);return n.isEqual(r)&&this._def.coerce===e._def.coerce}};d(Ri,"ZodDate");Ri.create=d(t=>new Ri(_({checks:[],coerce:t?.coerce||!1,typeName:"ZodDate"},me(t))),"create");var Fo=Ri,Mi=class xr extends he{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===ne.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}dereference(e){return new xr(N(_({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new xr(N(_({},this._def),{innerType:this._def.innerType.clone()}))}isEqual(e){return e instanceof xr?this._def.innerType.isEqual(e._def.innerType)&&Yn(this._def.defaultValue(),e._def.defaultValue()):!1}unwrap(){return this._def.innerType}naked(){return this._def.innerType.naked()}mandatory(){return new xr(N(_({},this._def),{innerType:this._def.innerType.mandatory()}))}};d(Mi,"ZodDefault");Mi.create=d((t,e,n)=>new Mi(_({innerType:t,typeName:"ZodDefault",defaultValue:typeof e=="function"?e:()=>e},me(n))),"create");var ma=Mi,Gt=d(t=>Array.from(new Set(t)),"unique"),Ft=d(t=>t instanceof qo?Ft(t.schema):t instanceof Sn?Ft(t.innerType()):t instanceof Go?[t.value]:t instanceof ir?t.options:t instanceof Vo?be.objectValues(t.enum):t instanceof ma?Ft(t._def.innerType):t instanceof _a?[void 0]:t instanceof Jo?[null]:t instanceof ln?[void 0,...Ft(t.unwrap())]:t instanceof Qn?[null,...Ft(t.unwrap())]:t instanceof Ko||t instanceof Ta?Ft(t.unwrap()):t instanceof Lo?Ft(t._def.innerType):[],"getDiscriminator"),cg=class xn extends he{dereference(e){let n=this.options.map(a=>a.dereference(e)),r=xn._getOptionsMap(this.discriminator,n);return new xn(N(_({},this._def),{options:n,optionsMap:r}))}getReferences(){return Gt(this.options.flatMap(e=>e.getReferences()))}clone(){let e=this.options.map(n=>n.clone());return new xn(N(_({},this._def),{options:e}))}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.object)return te(n,{code:G.invalid_type,expected:ne.object,received:n.parsedType}),pe;let r=this.discriminator,a=n.data[r],o=this.optionsMap.get(a);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}):(te(n,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let a=xn._getOptionsMap(e,n);return new xn(_({typeName:"ZodDiscriminatedUnion",discriminator:e,options:n,optionsMap:a},me(r)))}static _getOptionsMap(e,n){let r=new Map;for(let a of n){let o=Ft(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of o){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,a)}}return r}isEqual(e){if(!(e instanceof xn)||this._def.discriminator!==e._def.discriminator)return!1;let n=d((o,i)=>o.isEqual(i),"compare"),r=new et(this._def.options,{compare:n}),a=new et(e._def.options,{compare:n});return r.isEqual(a)}};d(cg,"ZodDiscriminatedUnion");var fg=cg;function ha(t,e){return new ir(_({values:t,typeName:"ZodEnum"},me(e)))}d(ha,"createZodEnum");var Wo=class vi extends he{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return te(n,{expected:be.joinValues(r),received:n.parsedType,code:G.invalid_type}),pe}if(this._def.values.indexOf(e.data)===-1){let n=this._getOrReturnCtx(e),r=this._def.values;return te(n,{received:n.data,code:G.invalid_enum_value,options:r}),pe}return gt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return vi.create(e,_(_({},this._def),n))}exclude(e,n=this._def){return vi.create(this.options.filter(r=>!e.includes(r)),_(_({},this._def),n))}isEqual(e){if(!(e instanceof vi))return!1;let n=new et(this._def.values),r=new et(e._def.values);return n.isEqual(r)}};d(Wo,"ZodEnum");Wo.create=ha;var ir=Wo,dg=class Pn extends he{constructor(){super(...arguments),this.validate=this.implement}dereference(e){let n=this._def.args.dereference(e),r=this._def.returns.dereference(e);return new Pn(N(_({},this._def),{args:n,returns:r}))}getReferences(){return Gt([...this._def.args.getReferences(),...this._def.returns.getReferences()])}clone(){return new Pn(N(_({},this._def),{args:this._def.args.clone(),returns:this._def.returns.clone()}))}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.function)return te(n,{code:G.invalid_type,expected:ne.function,received:n.parsedType}),pe;function r(s,l){return Ei({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Zr(),qc].filter(f=>!!f),issueData:{code:G.invalid_arguments,argumentsError:l}})}d(r,"makeArgsIssue");function a(s,l){return Ei({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Zr(),qc].filter(f=>!!f),issueData:{code:G.invalid_return_type,returnTypeError:l}})}d(a,"makeReturnsIssue");let o={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof va){let s=this;return gt(async function(...l){let f=new Wt([]),p=await s._def.args.parseAsync(l,o).catch(h=>{throw f.addIssue(r(l,h)),f}),y=await Reflect.apply(i,this,p);return await s._def.returns._def.type.parseAsync(y,o).catch(h=>{throw f.addIssue(a(y,h)),f})})}else{let s=this;return gt(function(...l){let f=s._def.args.safeParse(l,o);if(!f.success)throw new Wt([r(l,f.error)]);let p=Reflect.apply(i,this,f.data),y=s._def.returns.safeParse(p,o);if(!y.success)throw new Wt([a(p,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Pn(N(_({},this._def),{args:nr.create(e).rest(Nr.create())}))}returns(e){return new Pn(N(_({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Pn(_({args:e||nr.create([]).rest(Nr.create()),returns:n||Nr.create(),typeName:"ZodFunction"},me(r)))}isEqual(e){return e instanceof Pn&&this._def.args.isEqual(e._def.args)&&this._def.returns.isEqual(e._def.returns)}};d(dg,"ZodFunction");var pg=dg;function Ni(t,e){let n=sn(t),r=sn(e);if(t===e)return{valid:!0,data:t};if(n===ne.object&&r===ne.object){let a=be.objectKeys(e),o=be.objectKeys(t).filter(s=>a.indexOf(s)!==-1),i=_(_({},t),e);for(let s of o){let l=Ni(t[s],e[s]);if(!l.valid)return{valid:!1};i[s]=l.data}return{valid:!0,data:i}}else if(n===ne.array&&r===ne.array){if(t.length!==e.length)return{valid:!1};let a=[];for(let o=0;o<t.length;o++){let i=t[o],s=e[o],l=Ni(i,s);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return n===ne.date&&r===ne.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}d(Ni,"mergeValues");var Di=class Ti extends he{dereference(e){return new Ti(N(_({},this._def),{left:this._def.left.dereference(e),right:this._def.right.dereference(e)}))}getReferences(){return Gt([...this._def.left.getReferences(),...this._def.right.getReferences()])}clone(){return new Ti(N(_({},this._def),{left:this._def.left.clone(),right:this._def.right.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),a=d((o,i)=>{if(To(o)||To(i))return pe;let s=Ni(o.value,i.value);return s.valid?((_o(o)||_o(i))&&n.dirty(),{status:n.value,value:s.data}):(te(r,{code:G.invalid_intersection_types}),pe)},"handleParsed");return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,i])=>a(o,i)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}isEqual(e){if(!(e instanceof Ti))return!1;let n=d((o,i)=>o.isEqual(i),"compare"),r=new et([this._def.left,this._def.right],{compare:n}),a=new et([e._def.left,e._def.right],{compare:n});return r.isEqual(a)}};d(Di,"ZodIntersection");Di.create=d((t,e,n)=>new Di(_({left:t,right:e,typeName:"ZodIntersection"},me(n))),"create");var zo=Di,Hi=class Pr extends he{get schema(){return this._def.getter()}dereference(e){return new Pr(N(_({},this._def),{getter:d(()=>this._def.getter().dereference(e),"getter")}))}getReferences(){return this._def.getter().getReferences()}clone(){return new Pr(N(_({},this._def),{getter:d(()=>this._def.getter().clone(),"getter")}))}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}isEqual(e){return e instanceof Pr?this._def.getter().isEqual(e._def.getter()):!1}naked(){return this._def.getter().naked()}mandatory(){return new Pr(N(_({},this._def),{getter:d(()=>this._def.getter().mandatory(),"getter")}))}};d(Hi,"ZodLazy");Hi.create=d((t,e)=>new Hi(_({getter:t,typeName:"ZodLazy"},me(e))),"create");var qo=Hi,Ui=class gg extends he{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return te(n,{received:n.data,code:G.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:e.data}}get value(){return this._def.value}isEqual(e){return e instanceof gg?Yn(this._def.value,e._def.value):!1}};d(Ui,"ZodLiteral");Ui.create=d((t,e)=>new Ui(_({value:t,typeName:"ZodLiteral"},me(e))),"create");var Go=Ui,Zi=class _i extends he{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let n=this._def.keyType.dereference(e),r=this._def.valueType.dereference(e);return new _i(N(_({},this._def),{keyType:n,valueType:r}))}getReferences(){return Gt([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}clone(){return new _i(N(_({},this._def),{keyType:this._def.keyType.clone(),valueType:this._def.valueType.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.map)return te(r,{code:G.invalid_type,expected:ne.map,received:r.parsedType}),pe;let a=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,l],f)=>({key:a._parse(new Ot(r,s,r.path,[f,"key"])),value:o._parse(new Ot(r,l,r.path,[f,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of i){let f=await l.key,p=await l.value;if(f.status==="aborted"||p.status==="aborted")return pe;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),s.set(f.value,p.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let l of i){let f=l.key,p=l.value;if(f.status==="aborted"||p.status==="aborted")return pe;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),s.set(f.value,p.value)}return{status:n.value,value:s}}}isEqual(e){return!(!(e instanceof _i)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};d(Zi,"ZodMap");Zi.create=d((t,e,n)=>new Zi(_({valueType:e,keyType:t,typeName:"ZodMap"},me(n))),"create");var yg=Zi,$i=class mg extends he{_parse(e){if(this._getType(e)!==ne.nan){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.nan,received:r.parsedType}),pe}return{status:"valid",value:e.data}}isEqual(e){return e instanceof mg}};d($i,"ZodNaN");$i.create=d(t=>new $i(_({typeName:"ZodNaN"},me(t))),"create");var hg=$i,ji=class vg extends he{_parse(e){let n=be.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ne.string&&r.parsedType!==ne.number){let a=be.objectValues(n);return te(r,{expected:be.joinValues(a),received:r.parsedType,code:G.invalid_type}),pe}if(n.indexOf(e.data)===-1){let a=be.objectValues(n);return te(r,{received:r.data,code:G.invalid_enum_value,options:a}),pe}return gt(e.data)}get enum(){return this._def.values}isEqual(e){return e instanceof vg?Yn(this._def.values,e._def.values):!1}};d(ji,"ZodNativeEnum");ji.create=d((t,e)=>new ji(_({values:t,typeName:"ZodNativeEnum"},me(e))),"create");var Vo=ji,Ki=class Tg extends he{_parse(e){let n=this._getOrReturnCtx(e);return te(n,{code:G.invalid_type,expected:ne.never,received:n.parsedType}),pe}isEqual(e){return e instanceof Tg}};d(Ki,"ZodNever");Ki.create=d(t=>new Ki(_({typeName:"ZodNever"},me(t))),"create");var Wr=Ki,Li=class _g extends he{_parse(e){if(this._getType(e)!==ne.null){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.null,received:r.parsedType}),pe}return gt(e.data)}isEqual(e){return e instanceof _g}};d(Li,"ZodNull");Li.create=d(t=>new Li(_({typeName:"ZodNull"},me(t))),"create");var Jo=Li,Fi=class Br extends he{dereference(e){return new Br(N(_({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new Br(N(_({},this._def),{innerType:this._def.innerType.clone()}))}_parse(e){return this._getType(e)===ne.null?gt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof Br?this._def.innerType.isEqual(e._def.innerType):!1}naked(){return this._def.innerType.naked()}mandatory(){return new Br(N(_({},this._def),{innerType:this._def.innerType.mandatory()}))}};d(Fi,"ZodNullable");Fi.create=d((t,e)=>new Fi(_({innerType:t,typeName:"ZodNullable"},me(e))),"create");var Qn=Fi;function bg(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=n>r?n:r,o=parseInt(t.toFixed(a).replace(".","")),i=parseInt(e.toFixed(a).replace(".",""));return o%i/Math.pow(10,a)}d(bg,"floatSafeRemainder");var Wi=class bi extends he{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ne.number){let o=this._getOrReturnCtx(e);return te(o,{code:G.invalid_type,expected:ne.number,received:o.parsedType}),pe}let r,a=new Tt;for(let o of this._def.checks)o.kind==="int"?be.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),te(r,{code:G.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="multipleOf"?bg(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),te(r,{code:G.not_finite,message:o.message}),a.dirty()):be.assertNever(o);return{status:a.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,r,a){return new bi(N(_({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ue.toString(a)}]}))}_addCheck(e){return new bi(N(_({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:ue.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ue.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ue.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ue.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&be.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}isEqual(e){if(!(e instanceof bi))return!1;let n=new et(this._def.checks),r=new et(e._def.checks);return n.isEqual(r)}};d(Wi,"ZodNumber");Wi.create=d(t=>new Wi(_({checks:[],typeName:"ZodNumber",coerce:t?.coerce||!1},me(t))),"create");var Yo=Wi;function Bn(t){if(t instanceof er){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=ln.create(Bn(r))}return new er(N(_({},t._def),{shape:d(()=>e,"shape")}))}else return t instanceof Kr?new Kr(N(_({},t._def),{type:Bn(t.element)})):t instanceof ln?ln.create(Bn(t.unwrap())):t instanceof Qn?Qn.create(Bn(t.unwrap())):t instanceof nr?nr.create(t.items.map(e=>Bn(e))):t}d(Bn,"deepPartialify");var cn=class vt extends he{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=be.objectKeys(e);return this._cached={shape:e,keys:n}}dereference(e){let n=this._def.shape(),r={};for(let a in n)r[a]=n[a].dereference(e);return new vt(N(_({},this._def),{shape:d(()=>r,"shape")}))}getReferences(){let e=this._def.shape(),n=[];for(let r in e)n.push(...e[r].getReferences());return Gt(n)}clone(){let e={},n=this._def.shape();for(let[r,a]of Object.entries(n))e[r]=a.clone();return new vt(N(_({},this._def),{shape:d(()=>e,"shape")}))}_parse(e){if(this._getType(e)!==ne.object){let p=this._getOrReturnCtx(e);return te(p,{code:G.invalid_type,expected:ne.object,received:p.parsedType}),pe}let{status:r,ctx:a}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(this._def.unknownKeys!=="strip")for(let p in a.data)i.includes(p)||s.push(p);let l=[];for(let p of i){let y=o[p],g=a.data[p];l.push({key:{status:"valid",value:p},value:y._parse(new Ot(a,g,a.path,p)),alwaysSet:p in a.data})}let f=this._def.unknownKeys;if(f==="passthrough")for(let p of s)l.push({key:{status:"valid",value:p},value:{status:"valid",value:a.data[p]}});else if(f==="strict")s.length>0&&(te(a,{code:G.unrecognized_keys,keys:s}),r.dirty());else if(f!=="strip")for(let p of s){let y=a.data[p];l.push({key:{status:"valid",value:p},value:f._parse(new Ot(a,y,a.path,p)),alwaysSet:p in a.data})}return a.common.async?Promise.resolve().then(async()=>{let p=[];for(let y of l){let g=await y.key;p.push({key:g,value:await y.value,alwaysSet:y.alwaysSet})}return p}).then(p=>Tt.mergeObjectSync(r,p)):Tt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return ue.errToObj,new vt(_(N(_({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:d((n,r)=>{var a,o,i,s;let l=(i=(o=(a=this._def).errorMap)==null?void 0:o.call(a,n,r).message)!=null?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=ue.errToObj(e).message)!=null?s:l}:{message:l}},"errorMap")}:{}))}strip(){return new vt(N(_({},this._def),{unknownKeys:"strip"}))}passthrough(){return new vt(N(_({},this._def),{unknownKeys:"passthrough"}))}additionalProperties(){if(this._def.unknownKeys instanceof he)return this._def.unknownKeys;if(this._def.unknownKeys==="passthrough")return jr.create();if(this._def.unknownKeys==="strict")return Wr.create()}extend(e){return new vt(N(_({},this._def),{shape:d(()=>_(_({},this._def.shape()),e),"shape")}))}merge(e){return new vt({unknownKeys:e._def.unknownKeys,shape:d(()=>_(_({},this._def.shape()),e._def.shape()),"shape"),typeName:"ZodObject"})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new vt(N(_({},this._def),{unknownKeys:e}))}pick(e){let n={};return be.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new vt(N(_({},this._def),{shape:d(()=>n,"shape")}))}omit(e){let n={};return be.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new vt(N(_({},this._def),{shape:d(()=>n,"shape")}))}deepPartial(){return Bn(this)}partial(e){let n={};return be.objectKeys(this.shape).forEach(r=>{let a=this.shape[r];e&&!e[r]?n[r]=a:n[r]=a?.optional()}),new vt(N(_({},this._def),{shape:d(()=>n,"shape")}))}required(e){let n={};return be.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof ln;)o=o._def.innerType;n[r]=o}}),new vt(N(_({},this._def),{shape:d(()=>n,"shape")}))}keyof(){return ha(be.objectKeys(this.shape))}isEqual(e){if(!(e instanceof vt)||!this._unknownKeysEqual(e))return!1;let n=this._def.shape(),r=e._def.shape(),a=d((s,l)=>s[0]===l[0]&&s[1].isEqual(l[1]),"compare"),o=new et(Object.entries(n),{compare:a}),i=new et(Object.entries(r),{compare:a});return o.isEqual(i)}_unknownKeysEqual(e){let n=this.additionalProperties(),r=e.additionalProperties();return n===void 0||r===void 0?n===r:n.isEqual(r)}};d(cn,"ZodObject");cn.create=d((t,e)=>new cn(_({shape:d(()=>t,"shape"),unknownKeys:"strip",typeName:"ZodObject"},me(e))),"create");cn.strictCreate=d((t,e)=>new cn(_({shape:d(()=>t,"shape"),unknownKeys:"strict",typeName:"ZodObject"},me(e))),"strictCreate");cn.lazycreate=d((t,e)=>new cn(_({shape:t,unknownKeys:"strip",typeName:"ZodObject"},me(e))),"lazycreate");var er=cn,zi=class wi extends he{dereference(e){return new wi(N(_({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new wi(N(_({},this._def),{innerType:this._def.innerType.clone()}))}_parse(e){return this._getType(e)===ne.undefined?gt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof wi?this._def.innerType.isEqual(e._def.innerType):!1}naked(){return this._def.innerType.naked()}mandatory(){return this._def.innerType.mandatory()}};d(zi,"ZodOptional");zi.create=d((t,e)=>new zi(_({innerType:t,typeName:"ZodOptional"},me(e))),"create");var ln=zi,wg=class Er extends he{dereference(e){return new Er(N(_({},this._def),{in:this._def.in.dereference(e),out:this._def.out.dereference(e)}))}getReferences(){return Gt([...this._def.in.getReferences(),...this._def.out.getReferences()])}clone(){return new Er(N(_({},this._def),{in:this._def.in.clone(),out:this._def.out.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return d(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?pe:o.status==="dirty"?(n.dirty(),Vn(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})},"handleAsync")();{let a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?pe:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,n){return new Er({in:e,out:n,typeName:"ZodPipeline"})}isEqual(e){return!(!(e instanceof Er)||!this._def.in.isEqual(e._def.in)||!this._def.out.isEqual(e._def.out))}};d(wg,"ZodPipeline");var Xo=wg,qi=class xi extends he{unwrap(){return this._def.type}dereference(e){return new xi(N(_({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}clone(){return new xi(N(_({},this._def),{type:this._def.type.clone()}))}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.promise&&n.common.async===!1)return te(n,{code:G.invalid_type,expected:ne.promise,received:n.parsedType}),pe;let r=n.parsedType===ne.promise?n.data:Promise.resolve(n.data);return gt(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}isEqual(e){return e instanceof xi?this._def.type.isEqual(e._def.type):!1}naked(){return this._def.type.naked()}};d(qi,"ZodPromise");qi.create=d((t,e)=>new qi(_({type:t,typeName:"ZodPromise"},me(e))),"create");var va=qi,Gi=class Sr extends he{dereference(e){return new Sr(N(_({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new Sr(N(_({},this._def),{innerType:this._def.innerType.clone()}))}_parse(e){let n=this._def.innerType._parse(e);return $r(n)&&(n.value=Object.freeze(n.value)),n}unwrap(){return this._def.innerType}isEqual(e){return e instanceof Sr?this._def.innerType.isEqual(e._def.innerType):!1}naked(){return this._def.innerType.naked()}mandatory(){return new Sr(N(_({},this._def),{innerType:this._def.innerType.mandatory()}))}};d(Gi,"ZodReadonly");Gi.create=d((t,e)=>new Gi(_({innerType:t,typeName:"ZodReadonly"},me(e))),"create");var Ta=Gi,xg=class zn extends he{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let n=this._def.keyType.dereference(e),r=this._def.valueType.dereference(e);return new zn(N(_({},this._def),{keyType:n,valueType:r}))}getReferences(){return Gt([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}clone(){return new zn(N(_({},this._def),{keyType:this._def.keyType.clone(),valueType:this._def.valueType.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.object)return te(r,{code:G.invalid_type,expected:ne.object,received:r.parsedType}),pe;let a=[],o=this._def.keyType,i=this._def.valueType;for(let s in r.data)a.push({key:o._parse(new Ot(r,s,r.path,s)),value:i._parse(new Ot(r,r.data[s],r.path,s))});return r.common.async?Tt.mergeObjectAsync(n,a):Tt.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof he?new zn(_({keyType:e,valueType:n,typeName:"ZodRecord"},me(r))):new zn(_({keyType:yt.create(),valueType:e,typeName:"ZodRecord"},me(n)))}isEqual(e){return!(!(e instanceof zn)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};d(xg,"ZodRecord");var Pg=xg,Vi=class Bg extends he{dereference(e){let n=e[this._def.uri];return n||this}getReferences(){return[this._def.uri]}_parse(e){let n=this._getOrReturnCtx(e);return te(n,{code:G.unresolved_reference}),pe}isOptional(){return!1}isNullable(){return!1}isEqual(e){return e instanceof Bg?this._def.uri===e._def.uri:!1}};d(Vi,"ZodRef");Vi.create=d(t=>new Vi({typeName:"ZodRef",uri:t}),"create");var Eg=Vi,Ji=class qn extends he{dereference(e){return new qn(N(_({},this._def),{valueType:this._def.valueType.dereference(e)}))}getReferences(){return this._def.valueType.getReferences()}clone(){return new qn(N(_({},this._def),{valueType:this._def.valueType.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.set)return te(r,{code:G.invalid_type,expected:ne.set,received:r.parsedType}),pe;let a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(te(r,{code:G.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(te(r,{code:G.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());let o=this._def.valueType;function i(l){let f=new Set;for(let p of l){if(p.status==="aborted")return pe;p.status==="dirty"&&n.dirty(),f.add(p.value)}return{status:n.value,value:f}}d(i,"finalizeSet");let s=[...r.data.values()].map((l,f)=>o._parse(new Ot(r,l,r.path,f)));return r.common.async?Promise.all(s).then(l=>i(l)):i(s)}min(e,n){return new qn(N(_({},this._def),{minSize:{value:e,message:ue.toString(n)}}))}max(e,n){return new qn(N(_({},this._def),{maxSize:{value:e,message:ue.toString(n)}}))}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}isEqual(e){var n,r,a,o;if(!(e instanceof qn))return!1;let i=(n=this._def.minSize)==null?void 0:n.value,s=(r=e._def.minSize)==null?void 0:r.value;if(i!==s)return!1;let l=(a=this._def.maxSize)==null?void 0:a.value,f=(o=e._def.maxSize)==null?void 0:o.value;return l!==f?!1:this._def.valueType.isEqual(e._def.valueType)}};d(Ji,"ZodSet");Ji.create=d((t,e)=>new Ji(_({valueType:t,minSize:null,maxSize:null,typeName:"ZodSet"},me(e))),"create");var Sg=Ji,kg=/^c[^\s-]{8,}$/i,Ig=/^[a-z][a-z0-9]*$/,Ag=/^[0-9A-HJKMNP-TV-Z]{26}$/,Cg=/^[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,Og=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Rg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Nx=d(t=>t===Rg,"isEmojiRegex"),so,Mg=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Ng=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;function Dg(t,e){return!!((e==="v4"||!e)&&Mg.test(t)||(e==="v6"||!e)&&Ng.test(t))}d(Dg,"isValidIP");var Yi=class Gn extends he{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ne.string){let o=this._getOrReturnCtx(e);return te(o,{code:G.invalid_type,expected:ne.string,received:o.parsedType}),pe}let r=new Tt,a;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(a=this._getOrReturnCtx(e,a),te(a,{code:G.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(a=this._getOrReturnCtx(e,a),te(a,{code:G.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let i=e.data.length>o.value,s=e.data.length<o.value;(i||s)&&(a=this._getOrReturnCtx(e,a),i?te(a,{code:G.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&te(a,{code:G.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Og.test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"email",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")so||(so=new RegExp(Rg,"u")),so.test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"emoji",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Cg.test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"uuid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")kg.test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"cuid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Ig.test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"cuid2",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Ag.test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"ulid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),te(a,{validation:"url",code:G.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"regex",code:G.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(e,a),te(a,{code:G.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(a=this._getOrReturnCtx(e,a),te(a,{code:G.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(a=this._getOrReturnCtx(e,a),te(a,{code:G.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Vp(o).test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{code:G.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Dg(e.data,o.version)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"ip",code:G.invalid_string,message:o.message}),r.dirty()):be.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(a=>e.test(a),_({validation:n,code:G.invalid_string},ue.errToObj(r)))}_addCheck(e){return new Gn(N(_({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(_({kind:"email"},ue.errToObj(e)))}url(e){return this._addCheck(_({kind:"url"},ue.errToObj(e)))}emoji(e){return this._addCheck(_({kind:"emoji"},ue.errToObj(e)))}uuid(e){return this._addCheck(_({kind:"uuid"},ue.errToObj(e)))}cuid(e){return this._addCheck(_({kind:"cuid"},ue.errToObj(e)))}cuid2(e){return this._addCheck(_({kind:"cuid2"},ue.errToObj(e)))}ulid(e){return this._addCheck(_({kind:"ulid"},ue.errToObj(e)))}ip(e){return this._addCheck(_({kind:"ip"},ue.errToObj(e)))}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck(_({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(n=e?.offset)!=null?n:!1},ue.errToObj(e?.message)))}regex(e,n){return this._addCheck(_({kind:"regex",regex:e},ue.errToObj(n)))}includes(e,n){return this._addCheck(_({kind:"includes",value:e,position:n?.position},ue.errToObj(n?.message)))}startsWith(e,n){return this._addCheck(_({kind:"startsWith",value:e},ue.errToObj(n)))}endsWith(e,n){return this._addCheck(_({kind:"endsWith",value:e},ue.errToObj(n)))}min(e,n){return this._addCheck(_({kind:"min",value:e},ue.errToObj(n)))}max(e,n){return this._addCheck(_({kind:"max",value:e},ue.errToObj(n)))}length(e,n){return this._addCheck(_({kind:"length",value:e},ue.errToObj(n)))}nonempty(e){return this.min(1,ue.errToObj(e))}trim(){return new Gn(N(_({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}secret(){return this._def[le]=N(_({},this._def[le]),{secret:!0}),this}toLowerCase(){return new Gn(N(_({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new Gn(N(_({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}isEqual(e){if(!(e instanceof Gn))return!1;let n=new et(this._def.checks),r=new et(e._def.checks);return n.isEqual(r)}};d(Yi,"ZodString");Yi.create=d(t=>{var e;return new Yi(_({checks:[],typeName:"ZodString",coerce:(e=t?.coerce)!=null?e:!1},me(N(_({},t),{supportsExtensions:["secret"]}))))},"create");var yt=Yi,Xi=class Hg extends he{_parse(e){if(this._getType(e)!==ne.symbol){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.symbol,received:r.parsedType}),pe}return gt(e.data)}isEqual(e){return e instanceof Hg}};d(Xi,"ZodSymbol");Xi.create=d(t=>new Xi(_({typeName:"ZodSymbol"},me(t))),"create");var Ug=Xi,tr=class kr extends he{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName==="ZodEffects"?this._def.schema.sourceType():this._def.schema}dereference(e){return new kr(N(_({},this._def),{schema:this._def.schema.dereference(e)}))}getReferences(){return this._def.schema.getReferences()}clone(){return new kr(N(_({},this._def),{schema:this._def.schema.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),a=this._def.effect||null,o={addIssue:d(i=>{te(r,i),i.fatal?n.abort():n.dirty()},"addIssue"),get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),a.type==="preprocess"){let i=a.transform(r.data,o);if(r.common.async)return Promise.resolve(i).then(async s=>{if(n.value==="aborted")return pe;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?pe:l.status==="dirty"||n.value==="dirty"?Vn(l.value):l});{if(n.value==="aborted")return pe;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?pe:s.status==="dirty"||n.value==="dirty"?Vn(s.value):s}}if(a.type==="refinement"){let i=d(s=>{let l=a.refinement(s,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s},"executeRefinement");if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?pe:(s.status==="dirty"&&n.dirty(),i(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?pe:(s.status==="dirty"&&n.dirty(),i(s.value).then(()=>({status:n.value,value:s.value}))))}if(a.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!$r(i))return i;let s=a.transform(i.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>$r(i)?Promise.resolve(a.transform(i.value,o)).then(s=>({status:n.value,value:s})):i);be.assertNever(a)}isEqual(e){return!(e instanceof kr)||!this._def.schema.isEqual(e._def.schema)?!1:this._def.effect.type==="refinement"?e._def.effect.type!=="refinement"?!1:be.compareFunctions(this._def.effect.refinement,e._def.effect.refinement):this._def.effect.type==="transform"?e._def.effect.type!=="transform"?!1:be.compareFunctions(this._def.effect.transform,e._def.effect.transform):this._def.effect.type==="preprocess"?e._def.effect.type!=="preprocess"?!1:be.compareFunctions(this._def.effect.transform,e._def.effect.transform):!1}naked(){return this._def.schema.naked()}mandatory(){return new kr(N(_({},this._def),{schema:this._def.schema.mandatory()}))}};d(tr,"ZodEffects");tr.create=d((t,e,n)=>new tr(_({schema:t,typeName:"ZodEffects",effect:e},me(n))),"create");tr.createWithPreprocess=d((t,e,n)=>new tr(_({schema:e,effect:{type:"preprocess",transform:t},typeName:"ZodEffects"},me(n))),"createWithPreprocess");var Sn=tr,Qi=class Ir extends he{dereference(e){let n=this._def.items.map(a=>a.dereference(e)),r=this._def.rest?this._def.rest.dereference(e):null;return new Ir(N(_({},this._def),{items:n,rest:r}))}getReferences(){return Gt([...this._def.items.flatMap(e=>e.getReferences()),...this._def.rest?this._def.rest.getReferences():[]])}clone(){let e=this._def.items.map(r=>r.clone()),n=this._def.rest?this._def.rest.clone():null;return new Ir(N(_({},this._def),{items:e,rest:n}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.array)return te(r,{code:G.invalid_type,expected:ne.array,received:r.parsedType}),pe;if(r.data.length<this._def.items.length)return te(r,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&r.data.length>this._def.items.length&&(te(r,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...r.data].map((i,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Ot(r,i,r.path,s)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>Tt.mergeArray(n,i)):Tt.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new Ir(N(_({},this._def),{rest:e}))}isEqual(e){if(!(e instanceof Ir)||!this._restEquals(e))return!1;let n=d((o,i)=>o.isEqual(i),"compare"),r=new et(this._def.items,{compare:n}),a=new et(e._def.items,{compare:n});return r.isEqual(a)}_restEquals(e){return this._def.rest===null?e._def.rest===null:e._def.rest!==null&&this._def.rest.isEqual(e._def.rest)}};d(Qi,"ZodTuple");Qi.create=d((t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Qi(_({items:t,typeName:"ZodTuple",rest:null},me(e)))},"create");var nr=Qi,ea=class Zg extends he{_parse(e){if(this._getType(e)!==ne.undefined){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.undefined,received:r.parsedType}),pe}return gt(e.data)}isEqual(e){return e instanceof Zg}mandatory(){return Wr.create(_({},this._def))}};d(ea,"ZodUndefined");ea.create=d(t=>new ea(_({typeName:"ZodUndefined"},me(t))),"create");var _a=ea,ta=class Ar extends he{dereference(e){let n=this._def.options.map(r=>r.dereference(e));return new Ar(N(_({},this._def),{options:n}))}getReferences(){return Gt(this._def.options.reduce((e,n)=>[...e,...n.getReferences()],[]))}clone(){let e=this._def.options.map(n=>n.clone());return new Ar(N(_({},this._def),{options:e}))}_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function a(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let i=o.map(s=>new Wt(s.ctx.common.issues));return te(n,{code:G.invalid_union,unionErrors:i}),pe}if(d(a,"handleResults"),n.common.async)return Promise.all(r.map(async o=>{let i=N(_({},n),{common:N(_({},n.common),{issues:[]}),parent:null});return{result:await o._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(a);{let o,i=[];for(let l of r){let f=N(_({},n),{common:N(_({},n.common),{issues:[]}),parent:null}),p=l._parseSync({data:n.data,path:n.path,parent:f});if(p.status==="valid")return p;p.status==="dirty"&&!o&&(o={result:p,ctx:f}),f.common.issues.length&&i.push(f.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map(l=>new Wt(l));return te(n,{code:G.invalid_union,unionErrors:s}),pe}}get options(){return this._def.options}isEqual(e){if(!(e instanceof Ar))return!1;let n=d((o,i)=>o.isEqual(i),"compare"),r=new et([...this._def.options],{compare:n}),a=new et([...e._def.options],{compare:n});return r.isEqual(a)}mandatory(){let e=this._def.options.filter(o=>!(o instanceof _a)).map(o=>o.mandatory()),[n,r,...a]=e;return n?r?new Ar(N(_({},this._def),{options:[n,r,...a]})):n:Wr.create(_({},this._def))}};d(ta,"ZodUnion");ta.create=d((t,e)=>new ta(_({options:t,typeName:"ZodUnion"},me(e))),"create");var Qo=ta,na=class $g extends he{constructor(){super(...arguments),this._unknown=!0}_parse(e){return gt(e.data)}isEqual(e){return e instanceof $g}};d(na,"ZodUnknown");na.create=d(t=>new na(_({typeName:"ZodUnknown"},me(t))),"create");var Nr=na,ra=class jg extends he{_parse(e){if(this._getType(e)!==ne.undefined){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.void,received:r.parsedType}),pe}return gt(e.data)}isEqual(e){return e instanceof jg}};d(ra,"ZodVoid");ra.create=d(t=>new ra(_({typeName:"ZodVoid"},me(t))),"create");var Kg=ra,Dx=["gpt-3.5-turbo","gpt-3.5-turbo-16k","gpt-4","gpt-4-1106-preview","gpt-4-vision-preview","gpt-4-0125-preview","gpt-4-turbo-preview","gpt-4-turbo","gpt-4o","gpt-3.5-turbo-0125","gpt-3.5-turbo-1106"],UA=ir.create(["any","string","number","boolean","object","pattern","date","array","target","time","enum"]),Hx=d(t=>yt.create().displayAs({id:"variable",params:_({type:t?.type||"any"},t?.params)}),"variable"),Ux=d(t=>yt.create().displayAs({id:"conversation",params:_({},t?.params)}),"conversation"),Zx=d(t=>yt.create().displayAs({id:"user",params:_({},t?.params)}),"user"),$x=d(t=>yt.create().displayAs({id:"message",params:_({},t?.params)}),"message"),jx=d(t=>yt.create().displayAs({id:"agent",params:_({},t?.params)}),"agent"),Kx=d(t=>yt.create().displayAs({id:"event",params:_({},t?.params)}),"event"),Lx=d(t=>yt.create().displayAs({id:"table",params:_({},t?.params)}),"table"),Fx=d(t=>yt.create().displayAs({id:"tablerow",params:_({},t?.params)}),"tablerow"),Wx=d(t=>yt.create().displayAs({id:"intent",params:_({},t?.params)}),"intent"),zx=d(()=>ir.create(Dx).displayAs({id:"dropdown",params:{}}),"aimodel"),qx=d(t=>yt.create().displayAs({id:"datasource",params:_({},t)}),"datasource"),Gx=d(t=>yt.create().displayAs({id:"knowledgebase",params:_({},t)}),"knowledgebase"),Vx={object:er.lazycreate},Jx=d((t,e={message:`Input not instance of ${t.name}`})=>ug(n=>n instanceof t,e),"instanceOfType"),Lg=yt.create,Fg=Yo.create,Yx=hg.create,Xx=$o.create,Wg=jo.create,Qx=Fo.create,eP=Ug.create,tP=_a.create,nP=Jo.create,rP=jr.create,iP=Nr.create,aP=Wr.create,oP=Kg.create,sP=Kr.create,lP=er.create,uP=er.strictCreate,cP=Qo.create,fP=fg.create,dP=zo.create,pP=nr.create,gP=Pg.create,yP=Eg.create,mP=Ta.create,hP=yg.create,vP=Sg.create,TP=pg.create,_P=qo.create,bP=Go.create,wP=ir.create,xP=Vo.create,PP=va.create,Gc=Sn.create,BP=ln.create,EP=Qn.create,SP=ma.create,kP=Sn.createWithPreprocess,IP=Xo.create,AP=d(()=>Lg().optional(),"ostring"),CP=d(()=>Fg().optional(),"onumber"),OP=d(()=>Wg().optional(),"oboolean"),RP={string:d(t=>yt.create(N(_({},t),{coerce:!0})),"string"),number:d(t=>Yo.create(N(_({},t),{coerce:!0})),"number"),boolean:d(t=>jo.create(N(_({},t),{coerce:!0})),"boolean"),bigint:d(t=>$o.create(N(_({},t),{coerce:!0})),"bigint"),date:d(t=>Fo.create(N(_({},t),{coerce:!0})),"date")},MP=pe,M=X,zg=d((t,e)=>t.anyOf.length?t.anyOf.length===1?it(t.anyOf[0],N(_({},e),{path:[...e.path,"anyOf",0]})):`z.union([${t.anyOf.map((n,r)=>it(n,N(_({},e),{path:[...e.path,"anyOf",r]}))).join(", ")}])`:"z.any()","parseAnyOf"),NP=d(t=>{var e;return(e=t[le])!=null&&e.coerce?"z.coerce.boolean()":"z.boolean()"},"parseBoolean"),DP=d(t=>"z.any()","parseDefault"),HP=d((t,e)=>`z.union([${t.type.map(n=>it(N(_({},t),{type:n}),e)).join(", ")}])`,"parseMultipleType"),UP=d((t,e)=>`z.any().refine((value) => !${it(t.not,N(_({},e),{path:[...e.path,"not"]}))}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`,"parseNot"),ZP=d(t=>"z.null()","parseNull"),$P=d(t=>[t.slice(0,t.length/2),t.slice(t.length/2)],"half"),jP=d((t,...e)=>Object.keys(t).reduce((n,r)=>(e.includes(r)||(n[r]=t[r]),n),{}),"omit");function ut(t,e,n){var r;let a=t[e],o="";if(a!==void 0){let i=n({value:a,json:JSON.stringify(a)});if(i){let s=i[0],l=i.length===3?i[1]:"",f=i.length===3?i[2]:i[1];o+=s,((r=t.errorMessage)==null?void 0:r[e])!==void 0&&(o+=l+JSON.stringify(t.errorMessage[e])),o+=f}}return o}d(ut,"withMessage");var Cr=Symbol("Original index"),KP=d(t=>{let e=[];for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="boolean")e.push(r?{[Cr]:n}:{[Cr]:n,not:{}});else{if(Cr in r)return t;e.push(N(_({},r),{[Cr]:n}))}}return e},"ensureOriginalIndex");function Lr(t,e){if(t.allOf.length===0)return"z.never()";if(t.allOf.length===1){let n=t.allOf[0];return it(n,N(_({},e),{path:[...e.path,"allOf",n[Cr]]}))}else{let[n,r]=$P(KP(t.allOf));return`z.intersection(${Lr({allOf:n},e)}, ${Lr({allOf:r},e)})`}}d(Lr,"parseAllOf");var LP=d((t,e)=>{if(Array.isArray(t.items))return`z.tuple([${t.items.map((r,a)=>it(r,N(_({},e),{path:[...e.path,"items",a]})))}])`;let n=t.items?`z.array(${it(t.items,N(_({},e),{path:[...e.path,"items"]}))})`:"z.array(z.any())";return n+=ut(t,"minItems",({json:r})=>[`.min(${r}`,", ",")"]),n+=ut(t,"maxItems",({json:r})=>[`.max(${r}`,", ",")"]),n},"parseArray"),FP=d(t=>`z.literal(${JSON.stringify(t.const)})`,"parseConst"),WP=d(t=>t.enum.length===0?"z.never()":t.enum.length===1?`z.literal(${JSON.stringify(t.enum[0])})`:t.enum.every(e=>typeof e=="string")?`z.enum([${t.enum.map(e=>JSON.stringify(e))}])`:`z.union([${t.enum.map(e=>`z.literal(${JSON.stringify(e)})`).join(", ")}])`,"parseEnum"),zP=d((t,e)=>{let n=it(t.if,N(_({},e),{path:[...e.path,"if"]})),r=it(t.then,N(_({},e),{path:[...e.path,"then"]})),a=it(t.else,N(_({},e),{path:[...e.path,"else"]}));return`z.union([${r}, ${a}]).superRefine((value,ctx) => {
|
|
24
24
|
const result = ${n}.safeParse(value).success
|
|
25
25
|
? ${r}.safeParse(value)
|
|
26
|
-
: ${
|
|
26
|
+
: ${a}.safeParse(value);
|
|
27
27
|
if (!result.success) {
|
|
28
28
|
result.error.errors.forEach((error) => ctx.addIssue(error))
|
|
29
29
|
}
|
|
30
|
-
})`},"parseIfThenElse"),
|
|
30
|
+
})`},"parseIfThenElse"),qP=d(t=>{var e;let n="z.number()";return(e=t[le])!=null&&e.coerce&&(n="z.coerce.number()"),t.type==="integer"?n+=ut(t,"type",()=>[".int(",")"]):n+=ut(t,"format",({value:r})=>{if(r==="int64")return[".int(",")"]}),n+=ut(t,"multipleOf",({value:r,json:a})=>r===1?n.startsWith("z.number().int(")?void 0:[".int(",")"]:[`.multipleOf(${a}`,", ",")"]),typeof t.minimum=="number"?t.exclusiveMinimum===!0?n+=ut(t,"minimum",({json:r})=>[`.gt(${r}`,", ",")"]):n+=ut(t,"minimum",({json:r})=>[`.gte(${r}`,", ",")"]):typeof t.exclusiveMinimum=="number"&&(n+=ut(t,"exclusiveMinimum",({json:r})=>[`.gt(${r}`,", ",")"])),typeof t.maximum=="number"?t.exclusiveMaximum===!0?n+=ut(t,"maximum",({json:r})=>[`.lt(${r}`,", ",")"]):n+=ut(t,"maximum",({json:r})=>[`.lte(${r}`,", ",")"]):typeof t.exclusiveMaximum=="number"&&(n+=ut(t,"exclusiveMaximum",({json:r})=>[`.lt(${r}`,", ",")"])),n},"parseNumber"),es=d((t,e)=>t.oneOf.length?t.oneOf.length===1?it(t.oneOf[0],N(_({},e),{path:[...e.path,"oneOf",0]})):`z.any().superRefine((x, ctx) => {
|
|
31
31
|
const schemas = [${t.oneOf.map((n,r)=>it(n,N(_({},e),{path:[...e.path,"oneOf",r]}))).join(", ")}];
|
|
32
32
|
const errors = schemas.reduce(
|
|
33
33
|
(errors: z.ZodError[], schema) =>
|
|
@@ -44,15 +44,15 @@ ${v}`.trim();case M.ZodFirstPartyTypeKind.ZodEnum:return s.values.map(se).join("
|
|
|
44
44
|
message: "Invalid input: Should pass single schema",
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
})`:"z.any()","parseOneOf");function
|
|
48
|
-
`,
|
|
49
|
-
`,r&&(t.properties?
|
|
50
|
-
`:
|
|
51
|
-
`);for(let s in t.patternProperties)
|
|
52
|
-
`,r&&(
|
|
53
|
-
`),
|
|
54
|
-
`,
|
|
55
|
-
`,
|
|
47
|
+
})`:"z.any()","parseOneOf");function qg(t,e){let n;t.properties&&(Object.keys(t.properties).length?(n="z.object({ ",n+=Object.keys(t.properties).map(i=>{let s=t.properties[i],l=`${JSON.stringify(i)}: ${it(s,N(_({},e),{path:[...e.path,"properties",i]}))}`,f=typeof s=="object"&&s.default!==void 0||typeof t.default=="object"&&t.default!==null&&i in t.default,p=Array.isArray(t.required)?t.required.includes(i):typeof s=="object"&&s.required===!0;return!f&&!p?`${l}.optional()`:l}).join(", "),n+=" })"):n="z.object({})");let r=t.additionalProperties!==void 0?it(t.additionalProperties,N(_({},e),{path:[...e.path,"additionalProperties"]})):void 0,a;if(t.patternProperties){let i=Object.fromEntries(Object.entries(t.patternProperties).map(([s,l])=>[s,it(l,N(_({},e),{path:[...e.path,"patternProperties",s]}))],{}));a="",n?r?a+=`.catchall(z.union([${[...Object.values(i),r].join(", ")}]))`:Object.keys(i).length>1?a+=`.catchall(z.union([${Object.values(i).join(", ")}]))`:a+=`.catchall(${Object.values(i)})`:r?a+=`z.record(z.union([${[...Object.values(i),r].join(", ")}]))`:Object.keys(i).length>1?a+=`z.record(z.union([${Object.values(i).join(", ")}]))`:a+=`z.record(${Object.values(i)})`,a+=`.superRefine((value, ctx) => {
|
|
48
|
+
`,a+=`for (const key in value) {
|
|
49
|
+
`,r&&(t.properties?a+=`let evaluated = [${Object.keys(t.properties).map(s=>JSON.stringify(s)).join(", ")}].includes(key)
|
|
50
|
+
`:a+=`let evaluated = false
|
|
51
|
+
`);for(let s in t.patternProperties)a+="if (key.match(new RegExp("+JSON.stringify(s)+`))) {
|
|
52
|
+
`,r&&(a+=`evaluated = true
|
|
53
|
+
`),a+="const result = "+i[s]+`.safeParse(value[key])
|
|
54
|
+
`,a+=`if (!result.success) {
|
|
55
|
+
`,a+=`ctx.addIssue({
|
|
56
56
|
path: [...ctx.path, key],
|
|
57
57
|
code: 'custom',
|
|
58
58
|
message: \`Invalid input: Key matching regex /\${key}/ must match schema\`,
|
|
@@ -60,12 +60,12 @@ ${v}`.trim();case M.ZodFirstPartyTypeKind.ZodEnum:return s.values.map(se).join("
|
|
|
60
60
|
issues: result.error.issues
|
|
61
61
|
}
|
|
62
62
|
})
|
|
63
|
-
`,
|
|
64
|
-
`,
|
|
65
|
-
`;r&&(
|
|
66
|
-
`,
|
|
67
|
-
`,
|
|
68
|
-
`,
|
|
63
|
+
`,a+=`}
|
|
64
|
+
`,a+=`}
|
|
65
|
+
`;r&&(a+=`if (!evaluated) {
|
|
66
|
+
`,a+="const result = "+r+`.safeParse(value[key])
|
|
67
|
+
`,a+=`if (!result.success) {
|
|
68
|
+
`,a+=`ctx.addIssue({
|
|
69
69
|
path: [...ctx.path, key],
|
|
70
70
|
code: 'custom',
|
|
71
71
|
message: \`Invalid input: must match catchall schema\`,
|
|
@@ -73,10 +73,10 @@ ${v}`.trim();case M.ZodFirstPartyTypeKind.ZodEnum:return s.values.map(se).join("
|
|
|
73
73
|
issues: result.error.issues
|
|
74
74
|
}
|
|
75
75
|
})
|
|
76
|
-
`,
|
|
77
|
-
`,
|
|
78
|
-
`),
|
|
79
|
-
`,o+="})"}let a=n?o?n+o:r?r==="z.never()"?n+".strict()":n+`.catchall(${r})`:n:o||(r?`z.record(${r})`:"z.record(z.any())");return Xe.an.anyOf(t)&&(a+=`.and(${Wg(N(_({},t),{anyOf:t.anyOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?N(_({},i),{type:"object"}):i)}),e)})`),Xe.a.oneOf(t)&&(a+=`.and(${Qa(N(_({},t),{oneOf:t.oneOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?N(_({},i),{type:"object"}):i)}),e)})`),Xe.an.allOf(t)&&(a+=`.and(${Kr(N(_({},t),{allOf:t.allOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?N(_({},i),{type:"object"}):i)}),e)})`),a}d(zg,"parseObject");var zP=d(t=>{var e;let n="z.string()";if((e=t[le])!=null&&e.coerce){if(t.format==="date-time")return"z.coerce.date()";n="z.coerce.string()"}return n+=ut(t,"format",({value:r})=>{switch(r){case"email":return[".email(",")"];case"ip":return[".ip(",")"];case"ipv4":return['.ip({ version: "v4"',", message: "," })"];case"ipv6":return['.ip({ version: "v6"',", message: "," })"];case"uri":return[".url(",")"];case"uuid":return[".uuid(",")"];case"date-time":return[".datetime(",")"]}}),n+=ut(t,"pattern",({json:r})=>[`.regex(new RegExp(${r})`,", ",")"]),n+=ut(t,"minLength",({json:r})=>[`.min(${r}`,", ",")"]),n+=ut(t,"maxLength",({json:r})=>[`.max(${r}`,", ",")"]),n},"parseString"),qP=d((t,e)=>`${it(ZP(t,"nullable"),e,!0)}.nullable()`,"parseNullable"),GP=d(t=>`z.ref('${t.$ref}')`,"parseRef"),VP=d((t,e)=>{var n,r;if(t.oneOf.length<=1||!((n=t.discriminator)!=null&&n.propertyName))return Qa(t,e);let o=t.oneOf.map((a,i)=>it(a,N(_({},e),{path:[...e.path,"oneOf",i]})));return`z.discriminatedUnion("${(r=t.discriminator)==null?void 0:r.propertyName}", [${o.join(", ")}])`},"parseDiscriminator"),it=d((t,e={seen:new Map,path:[]},n)=>{if(typeof t!="object")return t?"z.any()":"z.never()";if(e.parserOverride){let a=e.parserOverride(t,e);if(typeof a=="string")return a}let r=e.seen.get(t);if(r){if(r.r!==void 0)return r.r;if(e.depth===void 0||r.n>=e.depth)return"z.any()";r.n+=1}else r={r:void 0,n:0},e.seen.set(t,r);let o=YP(t,e);return n||(o=JP(t,o),e.withoutDefaults||(o=XP(t,o))),r.r=o,o},"parseSchema"),JP=d((t,e)=>(t.description&&(e+=`.describe(${JSON.stringify(t.description)})`),e),"addMeta"),XP=d((t,e)=>(t.default!==void 0&&(e+=`.default(${JSON.stringify(t.default)})`),e),"addDefaults"),YP=d((t,e)=>Xe.a.nullable(t)?qP(t,e):Xe.an.object(t)?zg(t,e):Xe.an.array(t)?jP(t,e):Xe.an.anyOf(t)?Wg(t,e):Xe.an.allOf(t)?Kr(t,e):Xe.a.discriminator(t)?VP(t,e):Xe.a.oneOf(t)?Qa(t,e):Xe.a.not(t)?DP(t,e):Xe.an.enum(t)?LP(t):Xe.a.const(t)?KP(t):Xe.a.multipleType(t)?NP(t,e):Xe.a.primitive(t,"string")?zP(t):Xe.a.primitive(t,"number")||Xe.a.primitive(t,"integer")?WP(t):Xe.a.primitive(t,"boolean")?RP(t):Xe.a.primitive(t,"null")?HP(t):Xe.a.conditional(t)?FP(t,e):Xe.a.ref(t)?GP(t):MP(t),"selectParser"),Xe={an:{object:d(t=>t.type==="object","object"),array:d(t=>t.type==="array","array"),anyOf:d(t=>t.anyOf!==void 0,"anyOf"),allOf:d(t=>t.allOf!==void 0,"allOf"),enum:d(t=>t.enum!==void 0,"enum")},a:{nullable:d(t=>t.nullable===!0,"nullable"),multipleType:d(t=>Array.isArray(t.type),"multipleType"),not:d(t=>t.not!==void 0,"not"),const:d(t=>t.const!==void 0,"const"),primitive:d((t,e)=>t.type===e,"primitive"),conditional:d(t=>!!("if"in t&&t.if&&"then"in t&&"else"in t&&t.then&&t.else),"conditional"),discriminator:d(t=>{var e;return t.oneOf!==void 0&&((e=t.discriminator)==null?void 0:e.propertyName)!==void 0},"discriminator"),oneOf:d(t=>t.oneOf!==void 0,"oneOf"),ref:d(t=>t.$ref!==void 0,"ref")}},QP=d(t=>{let e;try{e=new Function("z",`return ${t}`)(M)}catch(n){return{sucess:!1,error:`Failed to evaluate schema: ${(n instanceof Error?n:new Error(String(n))).message}`}}return e instanceof M.ZodType?{sucess:!0,value:e}:{sucess:!1,error:`String "${t}" does not evaluate to a Zod schema`}},"evalZuiString"),eB=d(t=>it(t,{seen:new Map,path:[]}),"jsonSchemaToZodStr"),tB=d(t=>{let e=eB(t);e=e.replaceAll("errors: z.ZodError[]","errors");let n=QP(e);if(!n.sucess)throw new oo(n.error);return n.value},"jsonSchemaToZod"),Cr=d((t,e)=>{var n,r;if(e[le]&&t._def&&(t._def[le]=e[le]),((n=t._def)==null?void 0:n.typeName)==="ZodObject"&&e.type==="object"&&e.properties&&Object.entries(e.properties).forEach(([o,a])=>{let i=typeof t._def.shape=="function"?t._def.shape():t._def.shape;i[o]&&Cr(i[o],a)}),((r=t._def)==null?void 0:r.typeName)==="ZodRecord"&&e.type==="object"&&e.additionalProperties&&Cr(t._def.valueType,e.additionalProperties),e.type==="array"&&e.items){let o=e.items;if(typeof o=="object"&&!Array.isArray(o)){let a=t._def.type;a&&Cr(a,o)}else Array.isArray(o)&&o.forEach((a,i)=>{let s=t._def;s.typeName===Y.ZodFirstPartyTypeKind.ZodTuple&&Cr(s.items[i],a)})}},"applyZuiPropsRecursively"),nB=d(t=>{let e=tB(t);return Cr(e,t),e},"fromJSONSchemaLegacy"),rB=d(t=>{var e,n;return t.anyOf!==void 0&&t.anyOf.length===2&&t.anyOf.some(r=>typeof r!="boolean"&&qg(r))&&((n=(e=t["x-zui"])==null?void 0:e.def)==null?void 0:n.typeName)===M.ZodFirstPartyTypeKind.ZodOptional},"isOptionalSchema"),iB=d(t=>{var e,n;return t.anyOf!==void 0&&t.anyOf.length===2&&t.anyOf.some(r=>typeof r!="boolean"&&r.type==="null")&&((n=(e=t["x-zui"])==null?void 0:e.def)==null?void 0:n.typeName)===M.ZodFirstPartyTypeKind.ZodNullable},"isNullableSchema"),qg=d(t=>{var e,n;return t.not===!0&&((n=(e=t["x-zui"])==null?void 0:e.def)==null?void 0:n.typeName)===M.ZodFirstPartyTypeKind.ZodUndefined},"isUndefinedSchema"),oB=d(t=>{var e,n;return!t.not&&((n=(e=t["x-zui"])==null?void 0:e.def)==null?void 0:n.typeName)===M.ZodFirstPartyTypeKind.ZodUnknown},"isUnknownSchema"),aB=d(({type:t,minimum:e,exclusiveMinimum:n,maximum:r,exclusiveMaximum:o,multipleOf:a,format:i})=>{let s=M.number();return t==="integer"&&(s=s.int()),i==="finite"&&(s=s.finite()),n!==void 0?s=s.gt(n):e!==void 0&&(s=s.gte(e)),o!==void 0?s=s.lt(o):r!==void 0&&(s=s.lte(r)),a!==void 0&&(s=s.multipleOf(a)),s},"numberJSONSchemaToZuiNumber"),sB=d(({format:t,pattern:e,minLength:n,maxLength:r})=>{let o=M.string();if(n&&r&&n===r?o=o.length(n):(n&&(o=o.min(n)),r&&(o=o.max(r))),t==="cuid"||e===Ye.cuid)o=o.cuid();else if(t==="cuid2"||e===Ye.cuid2)o=o.cuid2();else if(t==="emoji"||e===Ye.emoji)o=o.emoji();else if(t==="ulid"||e===Ye.ulid)o=o.ulid();else if(t==="date-time"){let{precision:a,offset:i}=e?_x(e):{};o=o.datetime({precision:a,offset:i})}else t==="email"||e===Ye.email?o=o.email():t==="ipv4"||e===Ye.ipv4?o=o.ip():t==="ipv6"||e===Ye.ipv6?o=o.ip("v6"):t==="uri"?o=o.url():t==="uuid"||e===Ye.uuid?o=o.uuid():e&&(o=o.regex(new RegExp(e)));return o},"stringJSONSchemaToZuiString"),Tr=d((t,e)=>{let n=[];e.enum!==void 0&&n.push(...e.enum),e.const!==void 0&&n.push(e.const);let r=n.filter(i=>typeof i===t),[o]=r;if(!o){if(t==="string"&&e.type==="string")return sB(e);if(t==="number"&&(e.type==="number"||e.type==="integer"))return aB(e);if(t==="boolean")return M.boolean();if(t==="null")return M.null();throw new oo(`Unknown primitive type: "${t}"`)}if(r.length===1)return M.literal(o);let a=r.map(i=>M.literal(i));return M.union(a)},"toZuiPrimitive"),lB=d((t,e)=>uB(t)?fB(t,e):cB(t)?dB(t,e):pB(t,e),"arrayJSONSchemaToZuiArray"),uB=d(t=>Array.isArray(t.items),"_isTuple"),cB=d(t=>t.items!==void 0&&t.uniqueItems,"_isSet"),fB=d(({items:t,additionalItems:e},n)=>{let r=t.map(n),o=M.tuple(r);return e!==void 0&&(o=o.rest(n(e))),o},"_handleTuple"),dB=d(({items:t,minItems:e,maxItems:n},r)=>{let o=M.set(r(t));return e&&(o=o.min(e)),n&&(o=o.max(n)),o},"_handleSet"),pB=d(({minItems:t,maxItems:e,items:n},r)=>{let o=M.array(r(n));return t&&t===e?o.length(t):(t&&(o=o.min(t)),e&&(o=o.max(e)),o)},"_handleArray"),Fn=M.any();function Gg(t){return rt(t)}d(Gg,"fromJSONSchema");function rt(t){var e;if(t===void 0)return Fn;if(t===!0)return M.any();if(t===!1)return M.never();if(t.default!==void 0)return rt(N(_({},t),{default:void 0})).default(t.default);if(t.readOnly)return rt(N(_({},t),{readOnly:void 0})).readonly();if(t.oneOf!==void 0)throw new on({oneOf:t.oneOf});if(t.patternProperties!==void 0)throw new on({patternProperties:t.patternProperties});if(t.propertyNames!==void 0)throw new on({propertyNames:t.propertyNames});if(t.if!==void 0)throw new on({if:t.if});if(t.then!==void 0)throw new on({then:t.then});if(t.else!==void 0)throw new on({else:t.else});if(t.$ref!==void 0)return M.ref(t.$ref);if(t.not!==void 0){if(qg(t))return M.undefined();if(t.not===!0)return M.never();throw new on({not:t.not})}if(Array.isArray(t.type)){if(t.type.length===0)return Fn;if(t.type.length===1)return rt(N(_({},t),{type:t.type[0]}));let n=t,{type:r}=n,o=Yc(n,["type"]),a=t.type.map(i=>rt(N(_({},o),{type:i})));return M.union(a)}if(t.type==="string")return t.enum&&t.enum.length>0?M.enum(t.enum):Tr("string",t);if(t.type==="integer"){let n=Tr("number",t);return n instanceof M.ZodNumber?n.int():n}if(t.type==="number")return Tr("number",t);if(t.type==="boolean")return Tr("boolean",t);if(t.type==="null")return Tr("null",t);if(t.type==="array")return lB(t,rt);if(t.type==="object"){if(t.additionalProperties!==void 0&&t.properties!==void 0){let n=rt(t.additionalProperties);return rt(N(_({},t),{additionalProperties:void 0})).catchall(n)}if(t.properties!==void 0){let n={};for(let[r,o]of Object.entries(t.properties)){let a=rt(o),i=(e=t.required)!=null?e:[];n[r]=i.includes(r)?a:a.optional()}return M.object(n)}if(t.additionalProperties!==void 0){let n=rt(t.additionalProperties);return M.record(n)}return M.record(Fn)}if(t.anyOf!==void 0){if(t.anyOf.length===0)return Fn;if(t.anyOf.length===1)return rt(t.anyOf[0]);if(rB(t))return rt(t.anyOf[0]).optional();if(iB(t))return rt(t.anyOf[0]).nullable();let n=t.anyOf.map(rt);return M.union(n)}if(t.allOf!==void 0){if(t.allOf.length===0)return Fn;if(t.allOf.length===1)return rt(t.allOf[0]);let[n,...r]=t.allOf,o=rt(n),a=rt({allOf:r});return M.intersection(o,a)}return oB(t)?M.unknown():Fn}d(rt,"_fromJSONSchema");var gB=/^\d{4}-\d{2}-\d{2}(T|\s)?((\d{2}:\d{2}:\d{2}(\.\d{1,3})?)|(\d{2}:\d{2}))?(\s?([+-]\d{2}:\d{2}|Z))?$/,ba=d((t,e,n=!0)=>{if(typeof t!="object")throw new ua("Input must be an object");let r=d(i=>{let s=i;return e?.nullable&&(s=s.nullable()),e?.optional&&(s=s.optional()),e?.passtrough&&typeof s.passthrough=="function"&&(s=s.passthrough()),s},"applyOptions"),o=Object.entries(t).reduce((i,[s,l])=>{if(l===null)i[s]=r(Y.null());else switch(typeof l){case"string":i[s]=gB.test(l)?r(Y.string().datetime()):r(Y.string());break;case"number":i[s]=r(Y.number());break;case"boolean":i[s]=r(Y.boolean());break;case"object":Array.isArray(l)?l.length===0?i[s]=r(Y.array(Y.unknown())):typeof l[0]=="object"?i[s]=r(Y.array(ba(l[0],e,!1))):["string","number","boolean"].includes(typeof l[0])&&(i[s]=r(Y.array(Y[typeof l[0]]()))):i[s]=r(ba(l,e,!1));break;default:throw new ua(`Unsupported type for key ${s}`)}return i},{}),a=Object.keys(o).length>0;return e?.passtrough||!n&&!a?Y.object(o).passthrough():Y.object(o)},"fromObject");function Vg(){return{}}d(Vg,"parseAnyDef");function Jg(t,e){var n,r;let o={type:"array"};return((r=(n=t.type)==null?void 0:n._def)==null?void 0:r.typeName)!=="ZodAny"&&(o.items=Ie(t.type._def,N(_({},e),{currentPath:[...e.currentPath,"items"]}))),t.minLength&&Re(o,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&Re(o,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(Re(o,"minItems",t.exactLength.value,t.exactLength.message,e),Re(o,"maxItems",t.exactLength.value,t.exactLength.message,e)),o}d(Jg,"parseArrayDef");function Xg(t,e){let n=_({type:"integer",format:"int64"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return n;for(let r of t.checks)switch(r.kind){case"min":e.target==="jsonSchema7"?r.inclusive?Re(n,"minimum",r.value,r.message,e):Re(n,"exclusiveMinimum",r.value,r.message,e):(r.inclusive||(n.exclusiveMinimum=!0),Re(n,"minimum",r.value,r.message,e));break;case"max":e.target==="jsonSchema7"?r.inclusive?Re(n,"maximum",r.value,r.message,e):Re(n,"exclusiveMaximum",r.value,r.message,e):(r.inclusive||(n.exclusiveMaximum=!0),Re(n,"maximum",r.value,r.message,e));break;case"multipleOf":Re(n,"multipleOf",r.value,r.message,e);break}return n}d(Xg,"parseBigintDef");function Yg(t){return _({type:"boolean"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{})}d(Yg,"parseBooleanDef");function Qg(t,e){return Ie(t.type._def,e)}d(Qg,"parseBrandedDef");var yB=d((t,e)=>Ie(t.innerType._def,e),"parseCatchDef");function ey(t,e){return e.dateStrategy=="integer"?mB(t,e):_({type:"string",format:"date-time"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{})}d(ey,"parseDateDef");var mB=d((t,e)=>{let n=_({type:"integer",format:"unix-time"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{});for(let r of t.checks)switch(r.kind){case"min":e.target==="jsonSchema7"&&Re(n,"minimum",r.value,r.message,e);break;case"max":e.target==="jsonSchema7"&&Re(n,"maximum",r.value,r.message,e);break}return n},"integerDateParser");function ty(t,e){return N(_({},Ie(t.innerType._def,e)),{default:t.defaultValue()})}d(ty,"parseDefaultDef");function ny(t,e){return e.effectStrategy==="input"?Ie(t.schema._def,e):{}}d(ny,"parseEffectsDef");function ry(t){return{type:"string",enum:t.values}}d(ry,"parseEnumDef");var hB=d(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"isJsonSchema7AllOfType");function iy(t,e){let n=[Ie(t.left._def,N(_({},e),{currentPath:[...e.currentPath,"allOf","0"]})),Ie(t.right._def,N(_({},e),{currentPath:[...e.currentPath,"allOf","1"]}))].filter(a=>!!a),r=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return n.forEach(a=>{if(hB(a))o.push(...a.allOf),a.unevaluatedProperties===void 0&&(r=void 0);else{let i=a;if("additionalProperties"in a&&a.additionalProperties===!1){let s=a,{additionalProperties:l}=s;i=Yc(s,["additionalProperties"])}else r=void 0;o.push(i)}}),o.length?_({allOf:o},r):void 0}d(iy,"parseIntersectionDef");function oy(t,e){let n=typeof t.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[t.value]}:{type:n==="bigint"?"integer":n,const:t.value}}d(oy,"parseLiteralDef");function es(t,e){var n,r,o,a,i;if(e.target==="openApi3"&&((n=t.keyType)==null?void 0:n._def.typeName)==="ZodEnum")return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((l,f)=>{var p;return N(_({},l),{[f]:(p=Ie(t.valueType._def,N(_({},e),{currentPath:[...e.currentPath,"properties",f]})))!=null?p:{}})},{}),additionalProperties:!1};let s={type:"object",additionalProperties:(r=Ie(t.valueType._def,N(_({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?r:{}};if(e.target==="openApi3")return s;if(((o=t.keyType)==null?void 0:o._def.typeName)==="ZodString"&&((a=t.keyType._def.checks)!=null&&a.length)){let l=Object.entries(Ha(t.keyType._def,e)).reduce((f,[p,y])=>p==="type"?f:N(_({},f),{[p]:y}),{});return N(_({},s),{propertyNames:l})}else if(((i=t.keyType)==null?void 0:i._def.typeName)==="ZodEnum")return N(_({},s),{propertyNames:{enum:t.keyType._def.values}});return s}d(es,"parseRecordDef");function ay(t,e){if(e.mapStrategy==="record")return es(t,e);let n=Ie(t.keyType._def,N(_({},e),{currentPath:[...e.currentPath,"items","items","0"]}))||{},r=Ie(t.valueType._def,N(_({},e),{currentPath:[...e.currentPath,"items","items","1"]}))||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}d(ay,"parseMapDef");function sy(t){let e=t.values,r=Object.keys(t.values).filter(a=>typeof e[e[a]]!="number").map(a=>e[a]),o=Array.from(new Set(r.map(a=>typeof a)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:r.filter(a=>typeof a=="string"||typeof a=="number")}}d(sy,"parseNativeEnumDef");function ly(){return{not:{}}}d(ly,"parseNeverDef");function uy(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}d(uy,"parseNullDef");var ro={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function cy(t,e){if(e.target==="openApi3")return Gc(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in ro&&(!r._def.checks||!r._def.checks.length))){let r=n.reduce((o,a)=>{let i=ro[a._def.typeName];return i&&!o.includes(i)?[...o,i]:o},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){let r=n.reduce((o,a)=>{let i=typeof a._def.value;switch(i){case"string":case"number":case"boolean":return[...o,i];case"bigint":return[...o,"integer"];case"object":if(a._def.value===null)return[...o,"null"];case"symbol":case"undefined":case"function":default:return o}},[]);if(r.length===n.length){let o=r.filter((a,i,s)=>s.indexOf(a)===i);return{type:o.length>1?o:o[0],enum:n.reduce((a,i)=>a.includes(i._def.value)?a:[...a,i._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,o)=>[...r,...o._def.values.filter(a=>!r.includes(a))],[])};return Gc(t,e)}d(cy,"parseUnionDef");var Gc=d((t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((o,a)=>Ie(o._def,N(_({},e),{currentPath:[...e.currentPath,e.unionStrategy,`${a}`]}))).filter(o=>!!o&&(!e.strictUnions||typeof o=="object"&&Object.keys(o).length>0)),r=e.discriminator&&t.typeName==="ZodDiscriminatedUnion"&&typeof t.discriminator=="string"?{discriminator:{propertyName:t.discriminator}}:{};if(n.length)return e.unionStrategy==="anyOf"?_({anyOf:n},r):_({oneOf:n},r)},"asUnionOf");function fy(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length)){let r=t.innerType;if(e.target==="openApi3"){let a={type:ro[r._def.typeName],nullable:!0};return wa(r._def,e,a)}let o={type:[ro[r._def.typeName],"null"]};return wa(r._def,e,o)}if(e.target==="openApi3"){let r=Ie(t.innerType._def,N(_({},e),{currentPath:[...e.currentPath]}));return r&&N(_({},r),{nullable:!0})}let n=Ie(t.innerType._def,N(_({},e),{currentPath:[...e.currentPath,"anyOf","0"]}));return n&&{anyOf:[n,{type:"null"}]}}d(fy,"parseNullableDef");function dy(t,e){let n=_({type:"number"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return n;for(let r of t.checks)switch(r.kind){case"int":n.type="integer",Da(n,"type",r.message,e);break;case"min":e.target==="jsonSchema7"?r.inclusive?Re(n,"minimum",r.value,r.message,e):Re(n,"exclusiveMinimum",r.value,r.message,e):(r.inclusive||(n.exclusiveMinimum=!0),Re(n,"minimum",r.value,r.message,e));break;case"max":e.target==="jsonSchema7"?r.inclusive?Re(n,"maximum",r.value,r.message,e):Re(n,"exclusiveMaximum",r.value,r.message,e):(r.inclusive||(n.exclusiveMaximum=!0),Re(n,"maximum",r.value,r.message,e));break;case"multipleOf":Re(n,"multipleOf",r.value,r.message,e);break}return n}d(dy,"parseNumberDef");var vB=d((t,e)=>{var n;return t.unknownKeys instanceof he?(n=Ie(t.unknownKeys._def,N(_({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?n:!0:t.unknownKeys==="passthrough"},"getAdditionalProperties");function py(t,e){let n=N(_({type:"object"},Object.entries(t.shape()).reduce((r,[o,a])=>{if(a===void 0||a._def===void 0)return r;let i=Ie(a._def,N(_({},e),{currentPath:[...e.currentPath,"properties",o],propertyPath:[...e.currentPath,"properties",o]}));return i===void 0?r:{properties:N(_({},r.properties),{[o]:i}),required:a.isOptional()?r.required:[...r.required,o]}},{properties:{},required:[]})),{additionalProperties:vB(t,e)});return n.required.length||delete n.required,n}d(py,"parseObjectDef");var TB=d((t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return Ie(t.innerType._def,e);let r=Ie(t.innerType._def,N(_({},e),{currentPath:[...e.currentPath,"anyOf","1"]}));return r?{anyOf:[{not:{}},r]}:{}},"parseOptionalDef"),_B=d((t,e)=>{if(e.pipeStrategy==="input")return Ie(t.in._def,e);if(e.pipeStrategy==="output")return Ie(t.out._def,e);let n=Ie(t.in._def,N(_({},e),{currentPath:[...e.currentPath,"allOf","0"]})),r=Ie(t.out._def,N(_({},e),{currentPath:[...e.currentPath,"allOf",n?"1":"0"]}));return{allOf:[n,r].filter(o=>o!==void 0)}},"parsePipelineDef");function gy(t,e){return Ie(t.type._def,e)}d(gy,"parsePromiseDef");function yy(t,e){let r={type:"array",uniqueItems:!0,items:Ie(t.valueType._def,N(_({},e),{currentPath:[...e.currentPath,"items"]}))};return t.minSize&&Re(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&Re(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}d(yy,"parseSetDef");function my(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>Ie(n._def,N(_({},e),{currentPath:[...e.currentPath,"items",`${r}`]}))).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ie(t.rest._def,N(_({},e),{currentPath:[...e.currentPath,"additionalItems"]}))}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>Ie(n._def,N(_({},e),{currentPath:[...e.currentPath,"items",`${r}`]}))).reduce((n,r)=>r===void 0?n:[...n,r],[])}}d(my,"parseTupleDef");function hy(){return{not:{}}}d(hy,"parseUndefinedDef");function vy(){return{}}d(vy,"parseUnknownDef");var bB=d((t,e)=>Ie(t.innerType._def,e),"parseReadonlyDef");function Ty(t){return{$ref:t.uri}}d(Ty,"parseRefDef");function Ie(t,e,n=!1){let r=e.seen.get(t);if(r&&!n){let i=wB(r,e);if(i!==void 0)return i}let o={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,o);let a=PB(t,t.typeName,e);return a&&wa(t,e,a),o.jsonSchema=a,a}d(Ie,"parseDef");var wB=d((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:xB(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,r)=>e.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},"get$ref"),xB=d((t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")},"getRelativePath"),PB=d((t,e,n)=>{switch(e){case"ZodString":return Ha(t,n);case"ZodNumber":return dy(t,n);case"ZodObject":return py(t,n);case"ZodBigInt":return Xg(t,n);case"ZodBoolean":return Yg(t);case"ZodDate":return ey(t,n);case"ZodUndefined":return hy();case"ZodNull":return uy(n);case"ZodArray":return Jg(t,n);case"ZodUnion":case"ZodDiscriminatedUnion":return cy(t,n);case"ZodIntersection":return iy(t,n);case"ZodTuple":return my(t,n);case"ZodRecord":return es(t,n);case"ZodRef":return Ty(t);case"ZodLiteral":return oy(t,n);case"ZodEnum":return ry(t);case"ZodNativeEnum":return sy(t);case"ZodNullable":return fy(t,n);case"ZodOptional":return TB(t,n);case"ZodMap":return ay(t,n);case"ZodSet":return yy(t,n);case"ZodLazy":return Ie(t.getter()._def,n);case"ZodPromise":return gy(t,n);case"ZodNaN":case"ZodNever":return ly();case"ZodEffects":return ny(t,n);case"ZodAny":return Vg();case"ZodUnknown":return vy();case"ZodDefault":return ty(t,n);case"ZodBranded":return Qg(t,n);case"ZodReadonly":return bB(t,n);case"ZodCatch":return yB(t,n);case"ZodPipeline":return _B(t,n);case"ZodFunction":case"ZodVoid":case"ZodSymbol":return;default:return(r=>{})(e)}},"selectParser"),wa=d((t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),Object.assign(n,{[le]:_(_({},t[le]),n[le])}),n),"addMeta"),Vc={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"string",mapStrategy:"entries",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",emailStrategy:"format:email",discriminator:!1,unionStrategy:"anyOf"},BB=d(t=>typeof t=="string"?N(_({},Vc),{name:t}):_(_({},Vc),t),"getDefaultOptions"),SB=d(t=>{let e=BB(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return N(_({},e),{currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([r,o])=>[o._def,{def:o._def,path:[...e.basePath,e.definitionPath,r],jsonSchema:void 0}]))})},"getRefs"),EB=d((t,e)=>{var n;let r=SB(e),o=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[f,p])=>{var y;return N(_({},l),{[f]:(y=Ie(p._def,N(_({},r),{currentPath:[...r.basePath,r.definitionPath,f]}),!0))!=null?y:{}})},{}):void 0,a=typeof e=="string"?e:e?.name,i=(n=Ie(t._def,a===void 0?r:N(_({},r),{currentPath:[...r.basePath,r.definitionPath,a]}),!1))!=null?n:{},s=a===void 0?o?N(_({},i),{[r.definitionPath]:o}):i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,a].join("/"),[r.definitionPath]:N(_({},o),{[a]:i})};return r.target==="jsonSchema7"?s.$schema="http://json-schema.org/draft-07/schema#":r.target==="jsonSchema2019-09"&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),s},"zodToJsonSchema"),kB=d((t,e={target:"openApi3"})=>{let n=EB(t,e);return e.$schemaUrl===!1?delete n.$schema:typeof e.$schemaUrl=="string"&&(n.$schema=e.$schemaUrl),n},"toJSONSchemaLegacy");var Wr=(t,e)=>{let n=t._def,r=e._def;if(n.typeName===Y.ZodFirstPartyTypeKind.ZodObject&&r.typeName===Y.ZodFirstPartyTypeKind.ZodObject){let o=n.shape(),a=r.shape();return Y.object({...o,...a})}if(n.typeName===Y.ZodFirstPartyTypeKind.ZodRecord&&r.typeName===Y.ZodFirstPartyTypeKind.ZodRecord)return Y.record(Y.intersection(n.valueType,r.valueType));throw new Error("Cannot merge object schemas with record schemas")},_y=Y;var mt=Y.string().min(1),wy=Y.object({text:mt}),xy=Y.object({markdown:mt}),Py=Y.object({imageUrl:mt}),By=Y.object({audioUrl:mt}),Sy=Y.object({videoUrl:mt}),Ey=Y.object({fileUrl:mt,title:mt.optional()}),ky=Y.object({latitude:Y.number(),longitude:Y.number(),address:Y.string().optional(),title:Y.string().optional()}),Iy=Y.object({title:mt,subtitle:mt.optional(),imageUrl:mt.optional(),actions:Y.array(Y.object({action:Y.enum(["postback","url","say"]),label:mt,value:mt}))}),by=Y.object({text:mt,options:Y.array(Y.object({label:mt,value:mt}))}),IB=Y.object({items:Y.array(Iy)}),AB=Y.union([Y.object({type:Y.literal("text"),payload:wy}),Y.object({type:Y.literal("markdown"),payload:xy}),Y.object({type:Y.literal("image"),payload:Py}),Y.object({type:Y.literal("audio"),payload:By}),Y.object({type:Y.literal("video"),payload:Sy}),Y.object({type:Y.literal("file"),payload:Ey}),Y.object({type:Y.literal("location"),payload:ky})]),CB=Y.object({items:Y.array(AB)}),OB={schema:xy},RB={text:{schema:wy},image:{schema:Py},audio:{schema:By},video:{schema:Sy},file:{schema:Ey},location:{schema:ky},carousel:{schema:IB},card:{schema:Iy},dropdown:{schema:by},choice:{schema:by},bloc:{schema:CB}};C();R();O();var bo="x-bot-id",Cy="x-bot-user-id",Oy="x-integration-id",Ry="x-webhook-id",My="x-bp-configuration-type",wo="x-bp-configuration",xo="x-bp-operation",Ny="x-bp-type",XA={HIDDEN_IN_STUDIO:{bpActionHiddenInStudio:"true"},AWAIT_RETURN:{bpActionAwaitReturn:"true"}};C();R();O();import{isNode as Mk}from"browser-or-node";C();R();O();var ts=console;function Rt(t){if(!t.body)throw new Error("Missing body");return JSON.parse(t.body)}async function Wo(t,e=8072,n=Uk){if(!Mk)throw new Error("This function can only be called in Node.js");let o=(Rh(),Zv(Oh)).createServer(async(a,i)=>{try{let s=await Nk(a);if(s.path==="/health"){i.writeHead(200).end("ok");return}let l=await t(s);i.writeHead(l?.status??200,l?.headers??{}).end(l?.body??"{}")}catch(s){ts.error("Error while handling request",{error:s?.message??"Internal error occured"}),i.writeHead(500).end(JSON.stringify({error:s?.message??"Internal error occured"}))}});return o.listen(e,()=>n(e)),o}async function Nk(t){let e=await Hk(t),n={};for(let o=0;o<t.rawHeaders.length;o+=2){let a=t.rawHeaders[o].toLowerCase(),i=t.rawHeaders[o+1];n[a]=i}let r=new URL(t.url??"",t.headers.host?`http://${t.headers.host}`:"http://botpress.cloud");return{body:e,path:r.pathname,query:Dk(r.search,"?"),headers:n,method:t.method?.toUpperCase()??"GET"}}function Dk(t,e){return t.indexOf(e)===0?t.slice(e.length):t}async function Hk(t){return new Promise((e,n)=>{if(t.method!=="POST"&&t.method!=="PUT"&&t.method!=="PATCH")return e(void 0);let r="";t.on("data",o=>r+=o.toString()),t.on("error",o=>n(o)),t.on("end",()=>e(r))})}function Uk(t){ts.info(`Listening on port ${t}`)}import{isApiError as tU,RuntimeError as nU}from"@botpress/client";C();R();O();C();R();O();C();R();O();C();R();O();var Le={};Kn(Le,{mapKeys:()=>jk,mapValues:()=>$k,mergeRecords:()=>Lk,pairs:()=>zo,stripUndefinedProps:()=>Kk,values:()=>Zk});C();R();O();var zo=t=>Object.entries(t),Zk=t=>Object.values(t),$k=(t,e)=>Object.fromEntries(zo(t).map(([n,r])=>[n,e(r,n)])),jk=(t,e)=>Object.fromEntries(zo(t).map(([n,r])=>[e(n),r])),Kk=t=>Object.fromEntries(zo(t).filter(([,e])=>e!==void 0)),Lk=(t,e,n)=>{let r=[...Object.keys(t),...Object.keys(e)],o=[...new Set(r)],a={};for(let i of o){let s=t[i],l=e[i];s&&l?a[i]=n(s,l):s?a[i]=s:l&&(a[i]=l)}return a};var ye={};Kn(ye,{safePush:()=>Fk,unique:()=>Wk});C();R();O();var Fk=(t,...e)=>t?[...t,...e]:[...e],Wk=t=>Array.from(new Set(t));C();R();O();var ft={};Kn(ft,{setName:()=>zk});C();R();O();var zk=(t,e)=>(Object.defineProperty(t,"name",{value:e}),t);var Mh=t=>{let{name:e,version:n}=t,r={actions:{},events:{},channels:{}},o={name:e,version:n,entities:Le.mapValues(t.entities,i=>({name:i.name})),actions:{},events:{},channels:{}},a=Le.mapValues(t.entities,i=>i.schema);for(let[i,s]of Object.entries(t.definition.actions??{})){let l=s.input.schema.dereference(a),f=s.output.schema.dereference(a),p=t.actions?.[i]?.name??i;r.actions[p]={...s,...t.actions?.[i]??{},input:{schema:l},output:{schema:f}},o.actions[i]={name:p}}for(let[i,s]of Object.entries(t.definition.events??{})){let l=s.schema.dereference(a),f=t.events?.[i]?.name??i;r.events[f]={...s,...t.events?.[i]??{},schema:l},o.events[i]={name:f}}for(let[i,s]of Object.entries(t.definition.channels??{})){let l={};for(let[p,y]of Object.entries(s.messages)){let g=y.schema.dereference(a);l[p]={...y,schema:g}}let f=t.channels?.[i]?.name??i;r.channels[f]={...s,...t.channels?.[i]??{},message:{...s.message??{},tags:{...s.message?.tags??{},...t.channels?.[i]?.message?.tags??{}}},conversation:{...s.conversation??{},tags:{...s.conversation?.tags??{},...t.channels?.[i]?.conversation?.tags??{}}},messages:l},o.channels[i]={name:f}}return{resolved:r,statement:o}};C();R();O();var qo=Symbol("schemaName"),Nh=t=>t?Le.mapValues(t,(n,r)=>({...n,[qo]:r})):{},Dh=t=>qo in t&&t[qo]!==void 0,Hh=t=>t[qo];C();R();O();var Ys=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.icon=e.icon,this.readme=e.readme,this.title=e.title,this.identifier=e.identifier,this.description=e.description,this.configuration=e.configuration,this.configurations=e.configurations,this.events=e.events,this.actions=e.actions,this.channels=e.channels,this.states=e.states,this.user=e.user,this.secrets=e.secrets,this.entities=e.entities,this.interfaces=e.interfaces,this.__advanced=e.__advanced,this.attributes=e.attributes}name;version;title;description;icon;readme;configuration;configurations;events;actions;channels;states;user;secrets;identifier;entities;interfaces;__advanced;attributes;extend(e,n){let{entities:r,actions:o,events:a,channels:i}=this._callBuilder(e,n),s=this;s.interfaces??={};let l=Object.values(r).map(g=>g.name),f=l.length===0?e.name:`${e.name}<${l.join(",")}>`,{resolved:p,statement:y}=Mh({...e,entities:r,actions:Le.stripUndefinedProps(o),events:Le.stripUndefinedProps(a),channels:Le.stripUndefinedProps(i)});return s.actions=Le.mergeRecords(s.actions??{},p.actions,this._mergeActions),s.channels=Le.mergeRecords(s.channels??{},p.channels,this._mergeChannels),s.events=Le.mergeRecords(s.events??{},p.events,this._mergeEvents),s.interfaces[f]={id:e.id,...y},this}_callBuilder(e,n){let o={entities:Nh(this.entities)},a=n(o),i=Le.pairs(a.entities).find(([l,f])=>!Dh(f));if(i)throw new Error(`Cannot extend interface "${e.name}" with entity "${i[0]}"; the provided schema is not part of the integration's entities.`);return{entities:Le.mapValues(a.entities,l=>({name:Hh(l),schema:l.schema})),actions:a.actions??{},events:a.events??{},channels:a.channels??{}}}_mergeActions=(e,n)=>({...e,...n,input:{schema:Wr(e.input.schema,n.input.schema)},output:{schema:Wr(e.output.schema,n.output.schema)}});_mergeEvents=(e,n)=>({...e,...n,schema:Wr(e.schema,n.schema)});_mergeChannels=(e,n)=>{let r=Le.mergeRecords(e.messages,n.messages,this._mergeMessage),o;(e.conversation||n.conversation)&&(o={tags:{...e.conversation?.tags,...n.conversation?.tags}});let a;return(e.message||n.message)&&(a={tags:{...e.message?.tags,...n.message?.tags}}),{...e,...n,messages:r,conversation:o,message:a}};_mergeMessage=(e,n)=>({schema:Wr(e.schema,n.schema)})};C();R();O();C();R();O();import{isApiError as wI,Client as xI,RuntimeError as bv,InvalidPayloadError as PI}from"@botpress/client";C();R();O();import*as Uh from"@botpress/client";var Go={retries:3,retryCondition:t=>Uh.axiosRetry.isNetworkOrIdempotentRequestError(t)||[429,502].includes(t.response?.status??0),retryDelay:(t,e)=>(qk(e.response?.headers??{})??t)*1e3},qk=t=>{let e=["RateLimit-Reset","X-RateLimit-Reset","Retry-After","ratelimit-reset","x-ratelimit-reset","retry-after"];for(let n of e){let r=t[n];if(r!==void 0)return Gk(String(r))}},Gk=t=>{let e=Vk(t)?Jk(t):t.length>0?parseInt(t,10):void 0;return e===void 0||isNaN(e)?void 0:e},Vk=t=>t.includes(" "),Jk=t=>{let e=Xk(t);if(!e)return;let n=new Date;return Math.max(0,Math.floor((e.getTime()-n.getTime())/1e3))},Xk=t=>{let e=new Date(t);return isNaN(e.getTime())?void 0:e};C();R();O();C();R();O();var ei=class{constructor(e){this._client=e}get _inner(){return this._client}createConversation=(e=>this._client.createConversation(e));getConversation=(e=>this._client.getConversation(e));listConversations=(e=>this._client.listConversations(e));getOrCreateConversation=(e=>this._client.getOrCreateConversation(e));updateConversation=(e=>this._client.updateConversation(e));deleteConversation=(e=>this._client.deleteConversation(e));listParticipants=(e=>this._client.listParticipants(e));addParticipant=(e=>this._client.addParticipant(e));getParticipant=(e=>this._client.getParticipant(e));removeParticipant=(e=>this._client.removeParticipant(e));createEvent=(e=>this._client.createEvent(e));getEvent=(e=>this._client.getEvent(e));listEvents=(e=>this._client.listEvents(e));createMessage=(e=>this._client.createMessage(e));getOrCreateMessage=(e=>this._client.getOrCreateMessage(e));getMessage=(e=>this._client.getMessage(e).then(n=>n));updateMessage=(e=>this._client.updateMessage(e).then(n=>n));listMessages=(e=>this._client.listMessages(e));deleteMessage=(e=>this._client.deleteMessage(e));createUser=(e=>this._client.createUser(e));getUser=(e=>this._client.getUser(e));listUsers=e=>this._client.listUsers(e);getOrCreateUser=(e=>this._client.getOrCreateUser(e));updateUser=(e=>this._client.updateUser(e));deleteUser=e=>this._client.deleteUser(e);getState=(e=>this._client.getState(e));setState=(e=>this._client.setState(e));getOrSetState=(e=>this._client.getOrSetState(e));patchState=(e=>this._client.patchState(e));configureIntegration=e=>this._client.configureIntegration(e);uploadFile=e=>this._client.uploadFile(e);upsertFile=e=>this._client.upsertFile(e);deleteFile=e=>this._client.deleteFile(e);listFiles=e=>this._client.listFiles(e);getFile=e=>this._client.getFile(e);updateFileMetadata=e=>this._client.updateFileMetadata(e);trackAnalytics=e=>this._client.trackAnalytics(e)};C();R();O();var Vo=class{_cost=0;get cost(){return this._cost}setCost(e){this._cost=e}toJSON(){return{cost:this.cost}}};C();R();O();C();R();O();var pn="#";var BR=Y.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),Zh=t=>{let e=t[bo],n=t[Cy],r=t[Oy],o=t[Ry],a=t[My],i=t[wo],s=t[xo];if(!e)throw new Error("Missing bot headers");if(!n)throw new Error("Missing bot user headers");if(!r)throw new Error("Missing integration headers");if(!o)throw new Error("Missing webhook headers");if(!i)throw new Error("Missing configuration headers");if(!s)throw new Error("Missing operation headers");return{botId:e,botUserId:n,integrationId:r,webhookId:o,operation:s,configurationType:a??null,configuration:i?JSON.parse(q.from(i,"base64").toString("utf-8")):{}}};C();R();O();C();R();O();C();R();O();C();R();O();var el={},$h=!1;function _l(){return $h||($h=!0,el=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var o=42;e[n]=o;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(e,n);if(i.value!==o||i.enumerable!==!0)return!1}return!0}),el}var tl={},jh=!1;function Yk(){return jh||(jh=!0,tl=Error),tl}var nl={},Kh=!1;function Qk(){return Kh||(Kh=!0,nl=EvalError),nl}var rl={},Lh=!1;function eI(){return Lh||(Lh=!0,rl=RangeError),rl}var il={},Fh=!1;function tI(){return Fh||(Fh=!0,il=ReferenceError),il}var ol={},Wh=!1;function sv(){return Wh||(Wh=!0,ol=SyntaxError),ol}var al={},zh=!1;function Jo(){return zh||(zh=!0,al=TypeError),al}var sl={},qh=!1;function nI(){return qh||(qh=!0,sl=URIError),sl}var ll={},Gh=!1;function rI(){if(Gh)return ll;Gh=!0;var t=typeof Symbol<"u"&&Symbol,e=_l();return ll=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},ll}var ul={},Vh=!1;function iI(){if(Vh)return ul;Vh=!0;var t={__proto__:null,foo:{}},e=Object;return ul=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},ul}var cl={},Jh=!1;function oI(){if(Jh)return cl;Jh=!0;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,r="[object Function]",o=function(l,f){for(var p=[],y=0;y<l.length;y+=1)p[y]=l[y];for(var g=0;g<f.length;g+=1)p[g+l.length]=f[g];return p},a=function(l,f){for(var p=[],y=f,g=0;y<l.length;y+=1,g+=1)p[g]=l[y];return p},i=function(s,l){for(var f="",p=0;p<s.length;p+=1)f+=s[p],p+1<s.length&&(f+=l);return f};return cl=function(l){var f=this;if(typeof f!="function"||e.apply(f)!==r)throw new TypeError(t+f);for(var p=a(arguments,1),y,g=function(){if(this instanceof y){var v=f.apply(this,o(p,arguments));return Object(v)===v?v:this}return f.apply(l,o(p,arguments))},h=n(0,f.length-p.length),w=[],P=0;P<h;P++)w[P]="$"+P;if(y=Function("binder","return function ("+i(w,",")+"){ return binder.apply(this,arguments); }")(g),f.prototype){var B=function(){};B.prototype=f.prototype,y.prototype=new B,B.prototype=null}return y},cl}var fl={},Xh=!1;function bl(){if(Xh)return fl;Xh=!0;var t=oI();return fl=Function.prototype.bind||t,fl}var dl={},Yh=!1;function aI(){if(Yh)return dl;Yh=!0;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=bl();return dl=n.call(t,e),dl}var pl={},Qh=!1;function ni(){if(Qh)return pl;Qh=!0;var t,e=Yk(),n=Qk(),r=eI(),o=tI(),a=sv(),i=Jo(),s=nI(),l=Function,f=function(Ue){try{return l('"use strict"; return ('+Ue+").constructor;")()}catch{}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch{p=null}var y=function(){throw new i},g=p?(function(){try{return arguments.callee,y}catch{try{return p(arguments,"callee").get}catch{return y}}})():y,h=rI()(),w=iI()(),P=Object.getPrototypeOf||(w?function(Ue){return Ue.__proto__}:null),B={},v=typeof Uint8Array>"u"||!P?t:P(Uint8Array),E={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":h&&P?P([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":B,"%AsyncGenerator%":B,"%AsyncGeneratorFunction%":B,"%AsyncIteratorPrototype%":B,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":B,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h&&P?P(P([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!h||!P?t:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":r,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!h||!P?t:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&P?P(""[Symbol.iterator]()):t,"%Symbol%":h?Symbol:t,"%SyntaxError%":a,"%ThrowTypeError%":g,"%TypedArray%":v,"%TypeError%":i,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":s,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet};if(P)try{null.error}catch(Ue){var S=P(P(Ue));E["%Error.prototype%"]=S}var H=function Ue(Pe){var Ee;if(Pe==="%AsyncFunction%")Ee=f("async function () {}");else if(Pe==="%GeneratorFunction%")Ee=f("function* () {}");else if(Pe==="%AsyncGeneratorFunction%")Ee=f("async function* () {}");else if(Pe==="%AsyncGenerator%"){var fe=Ue("%AsyncGeneratorFunction%");fe&&(Ee=fe.prototype)}else if(Pe==="%AsyncIteratorPrototype%"){var ve=Ue("%AsyncGenerator%");ve&&P&&(Ee=P(ve.prototype))}return E[Pe]=Ee,Ee},K={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},oe=bl(),ee=aI(),ge=oe.call(Function.call,Array.prototype.concat),ae=oe.call(Function.apply,Array.prototype.splice),re=oe.call(Function.call,String.prototype.replace),Oe=oe.call(Function.call,String.prototype.slice),ze=oe.call(Function.call,RegExp.prototype.exec),tt=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ve=/\\(\\)?/g,Je=function(Pe){var Ee=Oe(Pe,0,1),fe=Oe(Pe,-1);if(Ee==="%"&&fe!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(fe==="%"&&Ee!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var ve=[];return re(Pe,tt,function(D,j,F,de){ve[ve.length]=F?re(de,Ve,"$1"):j||D}),ve},ht=function(Pe,Ee){var fe=Pe,ve;if(ee(K,fe)&&(ve=K[fe],fe="%"+ve[0]+"%"),ee(E,fe)){var D=E[fe];if(D===B&&(D=H(fe)),typeof D>"u"&&!Ee)throw new i("intrinsic "+Pe+" exists, but is not available. Please file an issue!");return{alias:ve,name:fe,value:D}}throw new a("intrinsic "+Pe+" does not exist!")};return pl=function(Pe,Ee){if(typeof Pe!="string"||Pe.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Ee!="boolean")throw new i('"allowMissing" argument must be a boolean');if(ze(/^%?[^%]*%?$/,Pe)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var fe=Je(Pe),ve=fe.length>0?fe[0]:"",D=ht("%"+ve+"%",Ee),j=D.name,F=D.value,de=!1,Te=D.alias;Te&&(ve=Te[0],ae(fe,ge([0,1],Te)));for(var A=1,k=!0;A<fe.length;A+=1){var $=fe[A],X=Oe($,0,1),ie=Oe($,-1);if((X==='"'||X==="'"||X==="`"||ie==='"'||ie==="'"||ie==="`")&&X!==ie)throw new a("property names with quotes must have matching quotes");if(($==="constructor"||!k)&&(de=!0),ve+="."+$,j="%"+ve+"%",ee(E,j))F=E[j];else if(F!=null){if(!($ in F)){if(!Ee)throw new i("base intrinsic for "+Pe+" exists, but the property is not available.");return}if(p&&A+1>=fe.length){var b=p(F,$);k=!!b,k&&"get"in b&&!("originalValue"in b.get)?F=b.get:F=F[$]}else k=ee(F,$),F=F[$];k&&!de&&(E[j]=F)}}return F},pl}var gl={},ev=!1;function wl(){if(ev)return gl;ev=!0;var t=ni(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return gl=e,gl}var yl={},tv=!1;function Xo(){if(tv)return yl;tv=!0;var t=ni(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return yl=e,yl}var ml={},nv=!1;function sI(){if(nv)return ml;nv=!0;var t=wl(),e=sv(),n=Jo(),r=Xo();return ml=function(a,i,s){if(!a||typeof a!="object"&&typeof a!="function")throw new n("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,y=arguments.length>6?arguments[6]:!1,g=!!r&&r(a,i);if(t)t(a,i,{configurable:p===null&&g?g.configurable:!p,enumerable:l===null&&g?g.enumerable:!l,value:s,writable:f===null&&g?g.writable:!f});else if(y||!l&&!f&&!p)a[i]=s;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},ml}var hl={},rv=!1;function lI(){if(rv)return hl;rv=!0;var t=wl(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},hl=e,hl}var vl={},iv=!1;function uI(){if(iv)return vl;iv=!0;var t=ni(),e=sI(),n=lI()(),r=Xo(),o=Jo(),a=t("%Math.floor%");return vl=function(s,l){if(typeof s!="function")throw new o("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||a(l)!==l)throw new o("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],p=!0,y=!0;if("length"in s&&r){var g=r(s,"length");g&&!g.configurable&&(p=!1),g&&!g.writable&&(y=!1)}return(p||y||!f)&&(n?e(s,"length",l,!0,!0):e(s,"length",l)),s},vl}var ti={},ov=!1;function xl(){if(ov)return ti;ov=!0;var t=bl(),e=ni(),n=uI(),r=Jo(),o=e("%Function.prototype.apply%"),a=e("%Function.prototype.call%"),i=e("%Reflect.apply%",!0)||t.call(a,o),s=wl(),l=e("%Math.max%");ti=function(y){if(typeof y!="function")throw new r("a function is required");var g=i(t,a,arguments);return n(g,1+l(0,y.length-(arguments.length-1)),!0)};var f=function(){return i(t,o,arguments)};return s?s(ti,"apply",{value:f}):ti.apply=f,ti}var Tl={},av=!1;function Pl(){if(av)return Tl;av=!0;var t=ni(),e=xl(),n=e(t("String.prototype.indexOf"));return Tl=function(o,a){var i=t(o,!!a);return typeof i=="function"&&n(o,".prototype.")>-1?e(i):i},Tl}ns();Ts();var Bl={},lv=!1;function Nl(){if(lv)return Bl;lv=!0;var t=_l();return Bl=function(){return t()&&!!Symbol.toStringTag},Bl}var Sl={},uv=!1;function cI(){if(uv)return Sl;uv=!0;var t=Nl()(),e=Pl(),n=e("Object.prototype.toString"),r=function(s){return t&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:n(s)==="[object Arguments]"},o=function(s){return r(s)?!0:s!==null&&typeof s=="object"&&typeof s.length=="number"&&s.length>=0&&n(s)!=="[object Array]"&&n(s.callee)==="[object Function]"},a=(function(){return r(arguments)})();return r.isLegacyArguments=o,Sl=a?r:o,Sl}var El={},cv=!1;function fI(){if(cv)return El;cv=!0;var t=Object.prototype.toString,e=Function.prototype.toString,n=/^\s*(?:function)?\*/,r=Nl()(),o=Object.getPrototypeOf,a=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},i;return El=function(l){if(typeof l!="function")return!1;if(n.test(e.call(l)))return!0;if(!r){var f=t.call(l);return f==="[object GeneratorFunction]"}if(!o)return!1;if(typeof i>"u"){var p=a();i=p?o(p):!1}return o(l)===i},El}var kl={},fv=!1;function dI(){if(fv)return kl;fv=!0;var t=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,r;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},e(function(){throw 42},null,n)}catch(E){E!==r&&(e=null)}else e=null;var o=/^\s*class\b/,a=function(S){try{var H=t.call(S);return o.test(H)}catch{return!1}},i=function(S){try{return a(S)?!1:(t.call(S),!0)}catch{return!1}},s=Object.prototype.toString,l="[object Object]",f="[object Function]",p="[object GeneratorFunction]",y="[object HTMLAllCollection]",g="[object HTML document.all class]",h="[object HTMLCollection]",w=typeof Symbol=="function"&&!!Symbol.toStringTag,P=!(0 in[,]),B=function(){return!1};if(typeof document=="object"){var v=document.all;s.call(v)===s.call(document.all)&&(B=function(S){if((P||!S)&&(typeof S>"u"||typeof S=="object"))try{var H=s.call(S);return(H===y||H===g||H===h||H===l)&&S("")==null}catch{}return!1})}return kl=e?function(S){if(B(S))return!0;if(!S||typeof S!="function"&&typeof S!="object")return!1;try{e(S,null,n)}catch(H){if(H!==r)return!1}return!a(S)&&i(S)}:function(S){if(B(S))return!0;if(!S||typeof S!="function"&&typeof S!="object")return!1;if(w)return i(S);if(a(S))return!1;var H=s.call(S);return H!==f&&H!==p&&!/^\[object HTML/.test(H)?!1:i(S)},kl}var Il={},dv=!1;function pI(){if(dv)return Il;dv=!0;var t=dI(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(l,f,p){for(var y=0,g=l.length;y<g;y++)n.call(l,y)&&(p==null?f(l[y],y,l):f.call(p,l[y],y,l))},o=function(l,f,p){for(var y=0,g=l.length;y<g;y++)p==null?f(l.charAt(y),y,l):f.call(p,l.charAt(y),y,l)},a=function(l,f,p){for(var y in l)n.call(l,y)&&(p==null?f(l[y],y,l):f.call(p,l[y],y,l))},i=function(l,f,p){if(!t(f))throw new TypeError("iterator must be a function");var y;arguments.length>=3&&(y=p),e.call(l)==="[object Array]"?r(l,f,y):typeof l=="string"?o(l,f,y):a(l,f,y)};return Il=i,Il}var Al={},pv=!1;function gI(){return pv||(pv=!0,Al=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Al}var Cl={},gv=!1,yI=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function mI(){if(gv)return Cl;gv=!0;var t=gI(),e=typeof globalThis>"u"?yI:globalThis;return Cl=function(){for(var r=[],o=0;o<t.length;o++)typeof e[t[o]]=="function"&&(r[r.length]=t[o]);return r},Cl}var Ol={},yv=!1,hI=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function _v(){if(yv)return Ol;yv=!0;var t=pI(),e=mI(),n=xl(),r=Pl(),o=Xo(),a=r("Object.prototype.toString"),i=Nl()(),s=typeof globalThis>"u"?hI:globalThis,l=e(),f=r("String.prototype.slice"),p=Object.getPrototypeOf,y=r("Array.prototype.indexOf",!0)||function(B,v){for(var E=0;E<B.length;E+=1)if(B[E]===v)return E;return-1},g={__proto__:null};i&&o&&p?t(l,function(P){var B=new s[P];if(Symbol.toStringTag in B){var v=p(B),E=o(v,Symbol.toStringTag);if(!E){var S=p(v);E=o(S,Symbol.toStringTag)}g["$"+P]=n(E.get)}}):t(l,function(P){var B=new s[P],v=B.slice||B.set;v&&(g["$"+P]=n(v))});var h=function(B){var v=!1;return t(g,function(E,S){if(!v)try{"$"+E(B)===S&&(v=f(S,1))}catch{}}),v},w=function(B){var v=!1;return t(g,function(E,S){if(!v)try{E(B),v=f(S,1)}catch{}}),v};return Ol=function(B){if(!B||typeof B!="object")return!1;if(!i){var v=f(a(B),8,-1);return y(l,v)>-1?v:v!=="Object"?!1:w(B)}return o?h(B):null},Ol}var Rl={},mv=!1;function vI(){if(mv)return Rl;mv=!0;var t=_v();return Rl=function(n){return!!t(n)},Rl}var we={},hv=!1;function TI(){if(hv)return we;hv=!0;var t=cI(),e=fI(),n=_v(),r=vI();function o(Z){return Z.call.bind(Z)}var a=typeof BigInt<"u",i=typeof Symbol<"u",s=o(Object.prototype.toString),l=o(Number.prototype.valueOf),f=o(String.prototype.valueOf),p=o(Boolean.prototype.valueOf);if(a)var y=o(BigInt.prototype.valueOf);if(i)var g=o(Symbol.prototype.valueOf);function h(Z,At){if(typeof Z!="object")return!1;try{return At(Z),!0}catch{return!1}}we.isArgumentsObject=t,we.isGeneratorFunction=e,we.isTypedArray=r;function w(Z){return typeof Promise<"u"&&Z instanceof Promise||Z!==null&&typeof Z=="object"&&typeof Z.then=="function"&&typeof Z.catch=="function"}we.isPromise=w;function P(Z){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Z):r(Z)||D(Z)}we.isArrayBufferView=P;function B(Z){return n(Z)==="Uint8Array"}we.isUint8Array=B;function v(Z){return n(Z)==="Uint8ClampedArray"}we.isUint8ClampedArray=v;function E(Z){return n(Z)==="Uint16Array"}we.isUint16Array=E;function S(Z){return n(Z)==="Uint32Array"}we.isUint32Array=S;function H(Z){return n(Z)==="Int8Array"}we.isInt8Array=H;function K(Z){return n(Z)==="Int16Array"}we.isInt16Array=K;function oe(Z){return n(Z)==="Int32Array"}we.isInt32Array=oe;function ee(Z){return n(Z)==="Float32Array"}we.isFloat32Array=ee;function ge(Z){return n(Z)==="Float64Array"}we.isFloat64Array=ge;function ae(Z){return n(Z)==="BigInt64Array"}we.isBigInt64Array=ae;function re(Z){return n(Z)==="BigUint64Array"}we.isBigUint64Array=re;function Oe(Z){return s(Z)==="[object Map]"}Oe.working=typeof Map<"u"&&Oe(new Map);function ze(Z){return typeof Map>"u"?!1:Oe.working?Oe(Z):Z instanceof Map}we.isMap=ze;function tt(Z){return s(Z)==="[object Set]"}tt.working=typeof Set<"u"&&tt(new Set);function Ve(Z){return typeof Set>"u"?!1:tt.working?tt(Z):Z instanceof Set}we.isSet=Ve;function Je(Z){return s(Z)==="[object WeakMap]"}Je.working=typeof WeakMap<"u"&&Je(new WeakMap);function ht(Z){return typeof WeakMap>"u"?!1:Je.working?Je(Z):Z instanceof WeakMap}we.isWeakMap=ht;function Ue(Z){return s(Z)==="[object WeakSet]"}Ue.working=typeof WeakSet<"u"&&Ue(new WeakSet);function Pe(Z){return Ue(Z)}we.isWeakSet=Pe;function Ee(Z){return s(Z)==="[object ArrayBuffer]"}Ee.working=typeof ArrayBuffer<"u"&&Ee(new ArrayBuffer);function fe(Z){return typeof ArrayBuffer>"u"?!1:Ee.working?Ee(Z):Z instanceof ArrayBuffer}we.isArrayBuffer=fe;function ve(Z){return s(Z)==="[object DataView]"}ve.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&ve(new DataView(new ArrayBuffer(1),0,1));function D(Z){return typeof DataView>"u"?!1:ve.working?ve(Z):Z instanceof DataView}we.isDataView=D;var j=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function F(Z){return s(Z)==="[object SharedArrayBuffer]"}function de(Z){return typeof j>"u"?!1:(typeof F.working>"u"&&(F.working=F(new j)),F.working?F(Z):Z instanceof j)}we.isSharedArrayBuffer=de;function Te(Z){return s(Z)==="[object AsyncFunction]"}we.isAsyncFunction=Te;function A(Z){return s(Z)==="[object Map Iterator]"}we.isMapIterator=A;function k(Z){return s(Z)==="[object Set Iterator]"}we.isSetIterator=k;function $(Z){return s(Z)==="[object Generator]"}we.isGeneratorObject=$;function X(Z){return s(Z)==="[object WebAssembly.Module]"}we.isWebAssemblyCompiledModule=X;function ie(Z){return h(Z,l)}we.isNumberObject=ie;function b(Z){return h(Z,f)}we.isStringObject=b;function x(Z){return h(Z,p)}we.isBooleanObject=x;function z(Z){return a&&h(Z,y)}we.isBigIntObject=z;function Q(Z){return i&&h(Z,g)}we.isSymbolObject=Q;function Me(Z){return ie(Z)||b(Z)||x(Z)||z(Z)||Q(Z)}we.isBoxedPrimitive=Me;function _e(Z){return typeof Uint8Array<"u"&&(fe(Z)||de(Z))}return we.isAnyArrayBuffer=_e,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Z){Object.defineProperty(we,Z,{enumerable:!1,value:function(){throw new Error(Z+" is not supported in userland")}})}),we}var Ml={},vv=!1;function _I(){return vv||(vv=!0,Ml=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),Ml}var xe={},Tv=!1,ri=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function bI(){if(Tv)return xe;Tv=!0;var t=Ot,e=Object.getOwnPropertyDescriptors||function(j){for(var F=Object.keys(j),de={},Te=0;Te<F.length;Te++)de[F[Te]]=Object.getOwnPropertyDescriptor(j,F[Te]);return de},n=/%[sdj%]/g;xe.format=function(D){if(!K(D)){for(var j=[],F=0;F<arguments.length;F++)j.push(i(arguments[F]));return j.join(" ")}for(var F=1,de=arguments,Te=de.length,A=String(D).replace(n,function($){if($==="%%")return"%";if(F>=Te)return $;switch($){case"%s":return String(de[F++]);case"%d":return Number(de[F++]);case"%j":try{return JSON.stringify(de[F++])}catch{return"[Circular]"}default:return $}}),k=de[F];F<Te;k=de[++F])E(k)||!ae(k)?A+=" "+k:A+=" "+i(k);return A},xe.deprecate=function(D,j){if(typeof t<"u"&&t.noDeprecation===!0)return D;if(typeof t>"u")return function(){return xe.deprecate(D,j).apply(this||ri,arguments)};var F=!1;function de(){if(!F){if(t.throwDeprecation)throw new Error(j);t.traceDeprecation?console.trace(j):console.error(j),F=!0}return D.apply(this||ri,arguments)}return de};var r={},o=/^$/;if(t.env.NODE_DEBUG){var a=t.env.NODE_DEBUG;a=a.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+a+"$","i")}xe.debuglog=function(D){if(D=D.toUpperCase(),!r[D])if(o.test(D)){var j=t.pid;r[D]=function(){var F=xe.format.apply(xe,arguments);console.error("%s %d: %s",D,j,F)}}else r[D]=function(){};return r[D]};function i(D,j){var F={seen:[],stylize:l};return arguments.length>=3&&(F.depth=arguments[2]),arguments.length>=4&&(F.colors=arguments[3]),v(j)?F.showHidden=j:j&&xe._extend(F,j),ee(F.showHidden)&&(F.showHidden=!1),ee(F.depth)&&(F.depth=2),ee(F.colors)&&(F.colors=!1),ee(F.customInspect)&&(F.customInspect=!0),F.colors&&(F.stylize=s),p(F,D,F.depth)}xe.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function s(D,j){var F=i.styles[j];return F?"\x1B["+i.colors[F][0]+"m"+D+"\x1B["+i.colors[F][1]+"m":D}function l(D,j){return D}function f(D){var j={};return D.forEach(function(F,de){j[F]=!0}),j}function p(D,j,F){if(D.customInspect&&j&&ze(j.inspect)&&j.inspect!==xe.inspect&&!(j.constructor&&j.constructor.prototype===j)){var de=j.inspect(F,D);return K(de)||(de=p(D,de,F)),de}var Te=y(D,j);if(Te)return Te;var A=Object.keys(j),k=f(A);if(D.showHidden&&(A=Object.getOwnPropertyNames(j)),Oe(j)&&(A.indexOf("message")>=0||A.indexOf("description")>=0))return g(j);if(A.length===0){if(ze(j)){var $=j.name?": "+j.name:"";return D.stylize("[Function"+$+"]","special")}if(ge(j))return D.stylize(RegExp.prototype.toString.call(j),"regexp");if(re(j))return D.stylize(Date.prototype.toString.call(j),"date");if(Oe(j))return g(j)}var X="",ie=!1,b=["{","}"];if(B(j)&&(ie=!0,b=["[","]"]),ze(j)){var x=j.name?": "+j.name:"";X=" [Function"+x+"]"}if(ge(j)&&(X=" "+RegExp.prototype.toString.call(j)),re(j)&&(X=" "+Date.prototype.toUTCString.call(j)),Oe(j)&&(X=" "+g(j)),A.length===0&&(!ie||j.length==0))return b[0]+X+b[1];if(F<0)return ge(j)?D.stylize(RegExp.prototype.toString.call(j),"regexp"):D.stylize("[Object]","special");D.seen.push(j);var z;return ie?z=h(D,j,F,k,A):z=A.map(function(Q){return w(D,j,F,k,Q,ie)}),D.seen.pop(),P(z,X,b)}function y(D,j){if(ee(j))return D.stylize("undefined","undefined");if(K(j)){var F="'"+JSON.stringify(j).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return D.stylize(F,"string")}if(H(j))return D.stylize(""+j,"number");if(v(j))return D.stylize(""+j,"boolean");if(E(j))return D.stylize("null","null")}function g(D){return"["+Error.prototype.toString.call(D)+"]"}function h(D,j,F,de,Te){for(var A=[],k=0,$=j.length;k<$;++k)Pe(j,String(k))?A.push(w(D,j,F,de,String(k),!0)):A.push("");return Te.forEach(function(X){X.match(/^\d+$/)||A.push(w(D,j,F,de,X,!0))}),A}function w(D,j,F,de,Te,A){var k,$,X;if(X=Object.getOwnPropertyDescriptor(j,Te)||{value:j[Te]},X.get?X.set?$=D.stylize("[Getter/Setter]","special"):$=D.stylize("[Getter]","special"):X.set&&($=D.stylize("[Setter]","special")),Pe(de,Te)||(k="["+Te+"]"),$||(D.seen.indexOf(X.value)<0?(E(F)?$=p(D,X.value,null):$=p(D,X.value,F-1),$.indexOf(`
|
|
76
|
+
`,a+=`}
|
|
77
|
+
`,a+=`}
|
|
78
|
+
`),a+=`}
|
|
79
|
+
`,a+="})"}let o=n?a?n+a:r?r==="z.never()"?n+".strict()":n+`.catchall(${r})`:n:a||(r?`z.record(${r})`:"z.record(z.any())");return Ye.an.anyOf(t)&&(o+=`.and(${zg(N(_({},t),{anyOf:t.anyOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?N(_({},i),{type:"object"}):i)}),e)})`),Ye.a.oneOf(t)&&(o+=`.and(${es(N(_({},t),{oneOf:t.oneOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?N(_({},i),{type:"object"}):i)}),e)})`),Ye.an.allOf(t)&&(o+=`.and(${Lr(N(_({},t),{allOf:t.allOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?N(_({},i),{type:"object"}):i)}),e)})`),o}d(qg,"parseObject");var GP=d(t=>{var e;let n="z.string()";if((e=t[le])!=null&&e.coerce){if(t.format==="date-time")return"z.coerce.date()";n="z.coerce.string()"}return n+=ut(t,"format",({value:r})=>{switch(r){case"email":return[".email(",")"];case"ip":return[".ip(",")"];case"ipv4":return['.ip({ version: "v4"',", message: "," })"];case"ipv6":return['.ip({ version: "v6"',", message: "," })"];case"uri":return[".url(",")"];case"uuid":return[".uuid(",")"];case"date-time":return[".datetime(",")"]}}),n+=ut(t,"pattern",({json:r})=>[`.regex(new RegExp(${r})`,", ",")"]),n+=ut(t,"minLength",({json:r})=>[`.min(${r}`,", ",")"]),n+=ut(t,"maxLength",({json:r})=>[`.max(${r}`,", ",")"]),n},"parseString"),VP=d((t,e)=>`${it(jP(t,"nullable"),e,!0)}.nullable()`,"parseNullable"),JP=d(t=>`z.ref('${t.$ref}')`,"parseRef"),YP=d((t,e)=>{var n,r;if(t.oneOf.length<=1||!((n=t.discriminator)!=null&&n.propertyName))return es(t,e);let a=t.oneOf.map((o,i)=>it(o,N(_({},e),{path:[...e.path,"oneOf",i]})));return`z.discriminatedUnion("${(r=t.discriminator)==null?void 0:r.propertyName}", [${a.join(", ")}])`},"parseDiscriminator"),it=d((t,e={seen:new Map,path:[]},n)=>{if(typeof t!="object")return t?"z.any()":"z.never()";if(e.parserOverride){let o=e.parserOverride(t,e);if(typeof o=="string")return o}let r=e.seen.get(t);if(r){if(r.r!==void 0)return r.r;if(e.depth===void 0||r.n>=e.depth)return"z.any()";r.n+=1}else r={r:void 0,n:0},e.seen.set(t,r);let a=eB(t,e);return n||(a=XP(t,a),e.withoutDefaults||(a=QP(t,a))),r.r=a,a},"parseSchema"),XP=d((t,e)=>(t.description&&(e+=`.describe(${JSON.stringify(t.description)})`),e),"addMeta"),QP=d((t,e)=>(t.default!==void 0&&(e+=`.default(${JSON.stringify(t.default)})`),e),"addDefaults"),eB=d((t,e)=>Ye.a.nullable(t)?VP(t,e):Ye.an.object(t)?qg(t,e):Ye.an.array(t)?LP(t,e):Ye.an.anyOf(t)?zg(t,e):Ye.an.allOf(t)?Lr(t,e):Ye.a.discriminator(t)?YP(t,e):Ye.a.oneOf(t)?es(t,e):Ye.a.not(t)?UP(t,e):Ye.an.enum(t)?WP(t):Ye.a.const(t)?FP(t):Ye.a.multipleType(t)?HP(t,e):Ye.a.primitive(t,"string")?GP(t):Ye.a.primitive(t,"number")||Ye.a.primitive(t,"integer")?qP(t):Ye.a.primitive(t,"boolean")?NP(t):Ye.a.primitive(t,"null")?ZP(t):Ye.a.conditional(t)?zP(t,e):Ye.a.ref(t)?JP(t):DP(t),"selectParser"),Ye={an:{object:d(t=>t.type==="object","object"),array:d(t=>t.type==="array","array"),anyOf:d(t=>t.anyOf!==void 0,"anyOf"),allOf:d(t=>t.allOf!==void 0,"allOf"),enum:d(t=>t.enum!==void 0,"enum")},a:{nullable:d(t=>t.nullable===!0,"nullable"),multipleType:d(t=>Array.isArray(t.type),"multipleType"),not:d(t=>t.not!==void 0,"not"),const:d(t=>t.const!==void 0,"const"),primitive:d((t,e)=>t.type===e,"primitive"),conditional:d(t=>!!("if"in t&&t.if&&"then"in t&&"else"in t&&t.then&&t.else),"conditional"),discriminator:d(t=>{var e;return t.oneOf!==void 0&&((e=t.discriminator)==null?void 0:e.propertyName)!==void 0},"discriminator"),oneOf:d(t=>t.oneOf!==void 0,"oneOf"),ref:d(t=>t.$ref!==void 0,"ref")}},tB=d(t=>{let e;try{e=new Function("z",`return ${t}`)(M)}catch(n){return{sucess:!1,error:`Failed to evaluate schema: ${(n instanceof Error?n:new Error(String(n))).message}`}}return e instanceof M.ZodType?{sucess:!0,value:e}:{sucess:!1,error:`String "${t}" does not evaluate to a Zod schema`}},"evalZuiString"),nB=d(t=>it(t,{seen:new Map,path:[]}),"jsonSchemaToZodStr"),rB=d(t=>{let e=nB(t);e=e.replaceAll("errors: z.ZodError[]","errors");let n=tB(e);if(!n.sucess)throw new oa(n.error);return n.value},"jsonSchemaToZod"),Or=d((t,e)=>{var n,r;if(e[le]&&t._def&&(t._def[le]=e[le]),((n=t._def)==null?void 0:n.typeName)==="ZodObject"&&e.type==="object"&&e.properties&&Object.entries(e.properties).forEach(([a,o])=>{let i=typeof t._def.shape=="function"?t._def.shape():t._def.shape;i[a]&&Or(i[a],o)}),((r=t._def)==null?void 0:r.typeName)==="ZodRecord"&&e.type==="object"&&e.additionalProperties&&Or(t._def.valueType,e.additionalProperties),e.type==="array"&&e.items){let a=e.items;if(typeof a=="object"&&!Array.isArray(a)){let o=t._def.type;o&&Or(o,a)}else Array.isArray(a)&&a.forEach((o,i)=>{let s=t._def;s.typeName===X.ZodFirstPartyTypeKind.ZodTuple&&Or(s.items[i],o)})}},"applyZuiPropsRecursively"),iB=d(t=>{let e=rB(t);return Or(e,t),e},"fromJSONSchemaLegacy"),aB=d(t=>{var e,n;return t.anyOf!==void 0&&t.anyOf.length===2&&t.anyOf.some(r=>typeof r!="boolean"&&Gg(r))&&((n=(e=t["x-zui"])==null?void 0:e.def)==null?void 0:n.typeName)===M.ZodFirstPartyTypeKind.ZodOptional},"isOptionalSchema"),oB=d(t=>{var e,n;return t.anyOf!==void 0&&t.anyOf.length===2&&t.anyOf.some(r=>typeof r!="boolean"&&r.type==="null")&&((n=(e=t["x-zui"])==null?void 0:e.def)==null?void 0:n.typeName)===M.ZodFirstPartyTypeKind.ZodNullable},"isNullableSchema"),Gg=d(t=>{var e,n;return t.not===!0&&((n=(e=t["x-zui"])==null?void 0:e.def)==null?void 0:n.typeName)===M.ZodFirstPartyTypeKind.ZodUndefined},"isUndefinedSchema"),sB=d(t=>{var e,n;return!t.not&&((n=(e=t["x-zui"])==null?void 0:e.def)==null?void 0:n.typeName)===M.ZodFirstPartyTypeKind.ZodUnknown},"isUnknownSchema"),lB=d(({type:t,minimum:e,exclusiveMinimum:n,maximum:r,exclusiveMaximum:a,multipleOf:o,format:i})=>{let s=M.number();return t==="integer"&&(s=s.int()),i==="finite"&&(s=s.finite()),n!==void 0?s=s.gt(n):e!==void 0&&(s=s.gte(e)),a!==void 0?s=s.lt(a):r!==void 0&&(s=s.lte(r)),o!==void 0&&(s=s.multipleOf(o)),s},"numberJSONSchemaToZuiNumber"),uB=d(({format:t,pattern:e,minLength:n,maxLength:r})=>{let a=M.string();if(n&&r&&n===r?a=a.length(n):(n&&(a=a.min(n)),r&&(a=a.max(r))),t==="cuid"||e===Xe.cuid)a=a.cuid();else if(t==="cuid2"||e===Xe.cuid2)a=a.cuid2();else if(t==="emoji"||e===Xe.emoji)a=a.emoji();else if(t==="ulid"||e===Xe.ulid)a=a.ulid();else if(t==="date-time"){let{precision:o,offset:i}=e?wx(e):{};a=a.datetime({precision:o,offset:i})}else t==="email"||e===Xe.email?a=a.email():t==="ipv4"||e===Xe.ipv4?a=a.ip():t==="ipv6"||e===Xe.ipv6?a=a.ip("v6"):t==="uri"?a=a.url():t==="uuid"||e===Xe.uuid?a=a.uuid():e&&(a=a.regex(new RegExp(e)));return a},"stringJSONSchemaToZuiString"),_r=d((t,e)=>{let n=[];e.enum!==void 0&&n.push(...e.enum),e.const!==void 0&&n.push(e.const);let r=n.filter(i=>typeof i===t),[a]=r;if(!a){if(t==="string"&&e.type==="string")return uB(e);if(t==="number"&&(e.type==="number"||e.type==="integer"))return lB(e);if(t==="boolean")return M.boolean();if(t==="null")return M.null();throw new oa(`Unknown primitive type: "${t}"`)}if(r.length===1)return M.literal(a);let o=r.map(i=>M.literal(i));return M.union(o)},"toZuiPrimitive"),cB=d((t,e)=>fB(t)?pB(t,e):dB(t)?gB(t,e):yB(t,e),"arrayJSONSchemaToZuiArray"),fB=d(t=>Array.isArray(t.items),"_isTuple"),dB=d(t=>t.items!==void 0&&t.uniqueItems,"_isSet"),pB=d(({items:t,additionalItems:e},n)=>{let r=t.map(n),a=M.tuple(r);return e!==void 0&&(a=a.rest(n(e))),a},"_handleTuple"),gB=d(({items:t,minItems:e,maxItems:n},r)=>{let a=M.set(r(t));return e&&(a=a.min(e)),n&&(a=a.max(n)),a},"_handleSet"),yB=d(({minItems:t,maxItems:e,items:n},r)=>{let a=M.array(r(n));return t&&t===e?a.length(t):(t&&(a=a.min(t)),e&&(a=a.max(e)),a)},"_handleArray"),Wn=M.any();function Vg(t){return rt(t)}d(Vg,"fromJSONSchema");function rt(t){var e;if(t===void 0)return Wn;if(t===!0)return M.any();if(t===!1)return M.never();if(t.default!==void 0)return rt(N(_({},t),{default:void 0})).default(t.default);if(t.readOnly)return rt(N(_({},t),{readOnly:void 0})).readonly();if(t.oneOf!==void 0)throw new on({oneOf:t.oneOf});if(t.patternProperties!==void 0)throw new on({patternProperties:t.patternProperties});if(t.propertyNames!==void 0)throw new on({propertyNames:t.propertyNames});if(t.if!==void 0)throw new on({if:t.if});if(t.then!==void 0)throw new on({then:t.then});if(t.else!==void 0)throw new on({else:t.else});if(t.$ref!==void 0)return M.ref(t.$ref);if(t.not!==void 0){if(Gg(t))return M.undefined();if(t.not===!0)return M.never();throw new on({not:t.not})}if(Array.isArray(t.type)){if(t.type.length===0)return Wn;if(t.type.length===1)return rt(N(_({},t),{type:t.type[0]}));let n=t,{type:r}=n,a=Qc(n,["type"]),o=t.type.map(i=>rt(N(_({},a),{type:i})));return M.union(o)}if(t.type==="string")return t.enum&&t.enum.length>0?M.enum(t.enum):_r("string",t);if(t.type==="integer"){let n=_r("number",t);return n instanceof M.ZodNumber?n.int():n}if(t.type==="number")return _r("number",t);if(t.type==="boolean")return _r("boolean",t);if(t.type==="null")return _r("null",t);if(t.type==="array")return cB(t,rt);if(t.type==="object"){if(t.additionalProperties!==void 0&&t.properties!==void 0){let n=rt(t.additionalProperties);return rt(N(_({},t),{additionalProperties:void 0})).catchall(n)}if(t.properties!==void 0){let n={};for(let[r,a]of Object.entries(t.properties)){let o=rt(a),i=(e=t.required)!=null?e:[];n[r]=i.includes(r)?o:o.optional()}return M.object(n)}if(t.additionalProperties!==void 0){let n=rt(t.additionalProperties);return M.record(n)}return M.record(Wn)}if(t.anyOf!==void 0){if(t.anyOf.length===0)return Wn;if(t.anyOf.length===1)return rt(t.anyOf[0]);if(aB(t))return rt(t.anyOf[0]).optional();if(oB(t))return rt(t.anyOf[0]).nullable();let n=t.anyOf.map(rt);return M.union(n)}if(t.allOf!==void 0){if(t.allOf.length===0)return Wn;if(t.allOf.length===1)return rt(t.allOf[0]);let[n,...r]=t.allOf,a=rt(n),o=rt({allOf:r});return M.intersection(a,o)}return sB(t)?M.unknown():Wn}d(rt,"_fromJSONSchema");var mB=/^\d{4}-\d{2}-\d{2}(T|\s)?((\d{2}:\d{2}:\d{2}(\.\d{1,3})?)|(\d{2}:\d{2}))?(\s?([+-]\d{2}:\d{2}|Z))?$/,wo=d((t,e,n=!0)=>{if(typeof t!="object")throw new uo("Input must be an object");let r=d(i=>{let s=i;return e?.nullable&&(s=s.nullable()),e?.optional&&(s=s.optional()),e?.passtrough&&typeof s.passthrough=="function"&&(s=s.passthrough()),s},"applyOptions"),a=Object.entries(t).reduce((i,[s,l])=>{if(l===null)i[s]=r(X.null());else switch(typeof l){case"string":i[s]=mB.test(l)?r(X.string().datetime()):r(X.string());break;case"number":i[s]=r(X.number());break;case"boolean":i[s]=r(X.boolean());break;case"object":Array.isArray(l)?l.length===0?i[s]=r(X.array(X.unknown())):typeof l[0]=="object"?i[s]=r(X.array(wo(l[0],e,!1))):["string","number","boolean"].includes(typeof l[0])&&(i[s]=r(X.array(X[typeof l[0]]()))):i[s]=r(wo(l,e,!1));break;default:throw new uo(`Unsupported type for key ${s}`)}return i},{}),o=Object.keys(a).length>0;return e?.passtrough||!n&&!o?X.object(a).passthrough():X.object(a)},"fromObject");function Jg(){return{}}d(Jg,"parseAnyDef");function Yg(t,e){var n,r;let a={type:"array"};return((r=(n=t.type)==null?void 0:n._def)==null?void 0:r.typeName)!=="ZodAny"&&(a.items=Ie(t.type._def,N(_({},e),{currentPath:[...e.currentPath,"items"]}))),t.minLength&&Re(a,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&Re(a,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(Re(a,"minItems",t.exactLength.value,t.exactLength.message,e),Re(a,"maxItems",t.exactLength.value,t.exactLength.message,e)),a}d(Yg,"parseArrayDef");function Xg(t,e){let n=_({type:"integer",format:"int64"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return n;for(let r of t.checks)switch(r.kind){case"min":e.target==="jsonSchema7"?r.inclusive?Re(n,"minimum",r.value,r.message,e):Re(n,"exclusiveMinimum",r.value,r.message,e):(r.inclusive||(n.exclusiveMinimum=!0),Re(n,"minimum",r.value,r.message,e));break;case"max":e.target==="jsonSchema7"?r.inclusive?Re(n,"maximum",r.value,r.message,e):Re(n,"exclusiveMaximum",r.value,r.message,e):(r.inclusive||(n.exclusiveMaximum=!0),Re(n,"maximum",r.value,r.message,e));break;case"multipleOf":Re(n,"multipleOf",r.value,r.message,e);break}return n}d(Xg,"parseBigintDef");function Qg(t){return _({type:"boolean"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{})}d(Qg,"parseBooleanDef");function ey(t,e){return Ie(t.type._def,e)}d(ey,"parseBrandedDef");var hB=d((t,e)=>Ie(t.innerType._def,e),"parseCatchDef");function ty(t,e){return e.dateStrategy=="integer"?vB(t,e):_({type:"string",format:"date-time"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{})}d(ty,"parseDateDef");var vB=d((t,e)=>{let n=_({type:"integer",format:"unix-time"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{});for(let r of t.checks)switch(r.kind){case"min":e.target==="jsonSchema7"&&Re(n,"minimum",r.value,r.message,e);break;case"max":e.target==="jsonSchema7"&&Re(n,"maximum",r.value,r.message,e);break}return n},"integerDateParser");function ny(t,e){return N(_({},Ie(t.innerType._def,e)),{default:t.defaultValue()})}d(ny,"parseDefaultDef");function ry(t,e){return e.effectStrategy==="input"?Ie(t.schema._def,e):{}}d(ry,"parseEffectsDef");function iy(t){return{type:"string",enum:t.values}}d(iy,"parseEnumDef");var TB=d(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"isJsonSchema7AllOfType");function ay(t,e){let n=[Ie(t.left._def,N(_({},e),{currentPath:[...e.currentPath,"allOf","0"]})),Ie(t.right._def,N(_({},e),{currentPath:[...e.currentPath,"allOf","1"]}))].filter(o=>!!o),r=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,a=[];return n.forEach(o=>{if(TB(o))a.push(...o.allOf),o.unevaluatedProperties===void 0&&(r=void 0);else{let i=o;if("additionalProperties"in o&&o.additionalProperties===!1){let s=o,{additionalProperties:l}=s;i=Qc(s,["additionalProperties"])}else r=void 0;a.push(i)}}),a.length?_({allOf:a},r):void 0}d(ay,"parseIntersectionDef");function oy(t,e){let n=typeof t.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[t.value]}:{type:n==="bigint"?"integer":n,const:t.value}}d(oy,"parseLiteralDef");function ts(t,e){var n,r,a,o,i;if(e.target==="openApi3"&&((n=t.keyType)==null?void 0:n._def.typeName)==="ZodEnum")return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((l,f)=>{var p;return N(_({},l),{[f]:(p=Ie(t.valueType._def,N(_({},e),{currentPath:[...e.currentPath,"properties",f]})))!=null?p:{}})},{}),additionalProperties:!1};let s={type:"object",additionalProperties:(r=Ie(t.valueType._def,N(_({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?r:{}};if(e.target==="openApi3")return s;if(((a=t.keyType)==null?void 0:a._def.typeName)==="ZodString"&&((o=t.keyType._def.checks)!=null&&o.length)){let l=Object.entries(Uo(t.keyType._def,e)).reduce((f,[p,y])=>p==="type"?f:N(_({},f),{[p]:y}),{});return N(_({},s),{propertyNames:l})}else if(((i=t.keyType)==null?void 0:i._def.typeName)==="ZodEnum")return N(_({},s),{propertyNames:{enum:t.keyType._def.values}});return s}d(ts,"parseRecordDef");function sy(t,e){if(e.mapStrategy==="record")return ts(t,e);let n=Ie(t.keyType._def,N(_({},e),{currentPath:[...e.currentPath,"items","items","0"]}))||{},r=Ie(t.valueType._def,N(_({},e),{currentPath:[...e.currentPath,"items","items","1"]}))||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}d(sy,"parseMapDef");function ly(t){let e=t.values,r=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),a=Array.from(new Set(r.map(o=>typeof o)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:r.filter(o=>typeof o=="string"||typeof o=="number")}}d(ly,"parseNativeEnumDef");function uy(){return{not:{}}}d(uy,"parseNeverDef");function cy(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}d(cy,"parseNullDef");var ia={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function fy(t,e){if(e.target==="openApi3")return Vc(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in ia&&(!r._def.checks||!r._def.checks.length))){let r=n.reduce((a,o)=>{let i=ia[o._def.typeName];return i&&!a.includes(i)?[...a,i]:a},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){let r=n.reduce((a,o)=>{let i=typeof o._def.value;switch(i){case"string":case"number":case"boolean":return[...a,i];case"bigint":return[...a,"integer"];case"object":if(o._def.value===null)return[...a,"null"];case"symbol":case"undefined":case"function":default:return a}},[]);if(r.length===n.length){let a=r.filter((o,i,s)=>s.indexOf(o)===i);return{type:a.length>1?a:a[0],enum:n.reduce((o,i)=>o.includes(i._def.value)?o:[...o,i._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,a)=>[...r,...a._def.values.filter(o=>!r.includes(o))],[])};return Vc(t,e)}d(fy,"parseUnionDef");var Vc=d((t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((a,o)=>Ie(a._def,N(_({},e),{currentPath:[...e.currentPath,e.unionStrategy,`${o}`]}))).filter(a=>!!a&&(!e.strictUnions||typeof a=="object"&&Object.keys(a).length>0)),r=e.discriminator&&t.typeName==="ZodDiscriminatedUnion"&&typeof t.discriminator=="string"?{discriminator:{propertyName:t.discriminator}}:{};if(n.length)return e.unionStrategy==="anyOf"?_({anyOf:n},r):_({oneOf:n},r)},"asUnionOf");function dy(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length)){let r=t.innerType;if(e.target==="openApi3"){let o={type:ia[r._def.typeName],nullable:!0};return xo(r._def,e,o)}let a={type:[ia[r._def.typeName],"null"]};return xo(r._def,e,a)}if(e.target==="openApi3"){let r=Ie(t.innerType._def,N(_({},e),{currentPath:[...e.currentPath]}));return r&&N(_({},r),{nullable:!0})}let n=Ie(t.innerType._def,N(_({},e),{currentPath:[...e.currentPath,"anyOf","0"]}));return n&&{anyOf:[n,{type:"null"}]}}d(dy,"parseNullableDef");function py(t,e){let n=_({type:"number"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return n;for(let r of t.checks)switch(r.kind){case"int":n.type="integer",Ho(n,"type",r.message,e);break;case"min":e.target==="jsonSchema7"?r.inclusive?Re(n,"minimum",r.value,r.message,e):Re(n,"exclusiveMinimum",r.value,r.message,e):(r.inclusive||(n.exclusiveMinimum=!0),Re(n,"minimum",r.value,r.message,e));break;case"max":e.target==="jsonSchema7"?r.inclusive?Re(n,"maximum",r.value,r.message,e):Re(n,"exclusiveMaximum",r.value,r.message,e):(r.inclusive||(n.exclusiveMaximum=!0),Re(n,"maximum",r.value,r.message,e));break;case"multipleOf":Re(n,"multipleOf",r.value,r.message,e);break}return n}d(py,"parseNumberDef");var _B=d((t,e)=>{var n;return t.unknownKeys instanceof he?(n=Ie(t.unknownKeys._def,N(_({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?n:!0:t.unknownKeys==="passthrough"},"getAdditionalProperties");function gy(t,e){let n=N(_({type:"object"},Object.entries(t.shape()).reduce((r,[a,o])=>{if(o===void 0||o._def===void 0)return r;let i=Ie(o._def,N(_({},e),{currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]}));return i===void 0?r:{properties:N(_({},r.properties),{[a]:i}),required:o.isOptional()?r.required:[...r.required,a]}},{properties:{},required:[]})),{additionalProperties:_B(t,e)});return n.required.length||delete n.required,n}d(gy,"parseObjectDef");var bB=d((t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return Ie(t.innerType._def,e);let r=Ie(t.innerType._def,N(_({},e),{currentPath:[...e.currentPath,"anyOf","1"]}));return r?{anyOf:[{not:{}},r]}:{}},"parseOptionalDef"),wB=d((t,e)=>{if(e.pipeStrategy==="input")return Ie(t.in._def,e);if(e.pipeStrategy==="output")return Ie(t.out._def,e);let n=Ie(t.in._def,N(_({},e),{currentPath:[...e.currentPath,"allOf","0"]})),r=Ie(t.out._def,N(_({},e),{currentPath:[...e.currentPath,"allOf",n?"1":"0"]}));return{allOf:[n,r].filter(a=>a!==void 0)}},"parsePipelineDef");function yy(t,e){return Ie(t.type._def,e)}d(yy,"parsePromiseDef");function my(t,e){let r={type:"array",uniqueItems:!0,items:Ie(t.valueType._def,N(_({},e),{currentPath:[...e.currentPath,"items"]}))};return t.minSize&&Re(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&Re(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}d(my,"parseSetDef");function hy(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>Ie(n._def,N(_({},e),{currentPath:[...e.currentPath,"items",`${r}`]}))).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ie(t.rest._def,N(_({},e),{currentPath:[...e.currentPath,"additionalItems"]}))}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>Ie(n._def,N(_({},e),{currentPath:[...e.currentPath,"items",`${r}`]}))).reduce((n,r)=>r===void 0?n:[...n,r],[])}}d(hy,"parseTupleDef");function vy(){return{not:{}}}d(vy,"parseUndefinedDef");function Ty(){return{}}d(Ty,"parseUnknownDef");var xB=d((t,e)=>Ie(t.innerType._def,e),"parseReadonlyDef");function _y(t){return{$ref:t.uri}}d(_y,"parseRefDef");function Ie(t,e,n=!1){let r=e.seen.get(t);if(r&&!n){let i=PB(r,e);if(i!==void 0)return i}let a={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,a);let o=EB(t,t.typeName,e);return o&&xo(t,e,o),a.jsonSchema=o,o}d(Ie,"parseDef");var PB=d((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:BB(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,r)=>e.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},"get$ref"),BB=d((t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")},"getRelativePath"),EB=d((t,e,n)=>{switch(e){case"ZodString":return Uo(t,n);case"ZodNumber":return py(t,n);case"ZodObject":return gy(t,n);case"ZodBigInt":return Xg(t,n);case"ZodBoolean":return Qg(t);case"ZodDate":return ty(t,n);case"ZodUndefined":return vy();case"ZodNull":return cy(n);case"ZodArray":return Yg(t,n);case"ZodUnion":case"ZodDiscriminatedUnion":return fy(t,n);case"ZodIntersection":return ay(t,n);case"ZodTuple":return hy(t,n);case"ZodRecord":return ts(t,n);case"ZodRef":return _y(t);case"ZodLiteral":return oy(t,n);case"ZodEnum":return iy(t);case"ZodNativeEnum":return ly(t);case"ZodNullable":return dy(t,n);case"ZodOptional":return bB(t,n);case"ZodMap":return sy(t,n);case"ZodSet":return my(t,n);case"ZodLazy":return Ie(t.getter()._def,n);case"ZodPromise":return yy(t,n);case"ZodNaN":case"ZodNever":return uy();case"ZodEffects":return ry(t,n);case"ZodAny":return Jg();case"ZodUnknown":return Ty();case"ZodDefault":return ny(t,n);case"ZodBranded":return ey(t,n);case"ZodReadonly":return xB(t,n);case"ZodCatch":return hB(t,n);case"ZodPipeline":return wB(t,n);case"ZodFunction":case"ZodVoid":case"ZodSymbol":return;default:return(r=>{})(e)}},"selectParser"),xo=d((t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),Object.assign(n,{[le]:_(_({},t[le]),n[le])}),n),"addMeta"),Jc={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"string",mapStrategy:"entries",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",emailStrategy:"format:email",discriminator:!1,unionStrategy:"anyOf"},SB=d(t=>typeof t=="string"?N(_({},Jc),{name:t}):_(_({},Jc),t),"getDefaultOptions"),kB=d(t=>{let e=SB(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return N(_({},e),{currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([r,a])=>[a._def,{def:a._def,path:[...e.basePath,e.definitionPath,r],jsonSchema:void 0}]))})},"getRefs"),IB=d((t,e)=>{var n;let r=kB(e),a=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[f,p])=>{var y;return N(_({},l),{[f]:(y=Ie(p._def,N(_({},r),{currentPath:[...r.basePath,r.definitionPath,f]}),!0))!=null?y:{}})},{}):void 0,o=typeof e=="string"?e:e?.name,i=(n=Ie(t._def,o===void 0?r:N(_({},r),{currentPath:[...r.basePath,r.definitionPath,o]}),!1))!=null?n:{},s=o===void 0?a?N(_({},i),{[r.definitionPath]:a}):i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:N(_({},a),{[o]:i})};return r.target==="jsonSchema7"?s.$schema="http://json-schema.org/draft-07/schema#":r.target==="jsonSchema2019-09"&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),s},"zodToJsonSchema"),AB=d((t,e={target:"openApi3"})=>{let n=IB(t,e);return e.$schemaUrl===!1?delete n.$schema:typeof e.$schemaUrl=="string"&&(n.$schema=e.$schemaUrl),n},"toJSONSchemaLegacy");var zr=(t,e)=>{let n=t._def,r=e._def;if(n.typeName===X.ZodFirstPartyTypeKind.ZodObject&&r.typeName===X.ZodFirstPartyTypeKind.ZodObject){let a=n.shape(),o=r.shape();return X.object({...a,...o})}if(n.typeName===X.ZodFirstPartyTypeKind.ZodRecord&&r.typeName===X.ZodFirstPartyTypeKind.ZodRecord)return X.record(X.intersection(n.valueType,r.valueType));throw new Error("Cannot merge object schemas with record schemas")},by=X;var mt=X.string().min(1),xy=X.object({text:mt}),Py=X.object({markdown:mt}),By=X.object({imageUrl:mt}),Ey=X.object({audioUrl:mt}),Sy=X.object({videoUrl:mt}),ky=X.object({fileUrl:mt,title:mt.optional()}),Iy=X.object({latitude:X.number(),longitude:X.number(),address:X.string().optional(),title:X.string().optional()}),Ay=X.object({title:mt,subtitle:mt.optional(),imageUrl:mt.optional(),actions:X.array(X.object({action:X.enum(["postback","url","say"]),label:mt,value:mt}))}),wy=X.object({text:mt,options:X.array(X.object({label:mt,value:mt}))}),CB=X.object({items:X.array(Ay)}),OB=X.union([X.object({type:X.literal("text"),payload:xy}),X.object({type:X.literal("markdown"),payload:Py}),X.object({type:X.literal("image"),payload:By}),X.object({type:X.literal("audio"),payload:Ey}),X.object({type:X.literal("video"),payload:Sy}),X.object({type:X.literal("file"),payload:ky}),X.object({type:X.literal("location"),payload:Iy})]),RB=X.object({items:X.array(OB)}),MB={schema:Py},NB={text:{schema:xy},image:{schema:By},audio:{schema:Ey},video:{schema:Sy},file:{schema:ky},location:{schema:Iy},carousel:{schema:CB},card:{schema:Ay},dropdown:{schema:wy},choice:{schema:wy},bloc:{schema:RB}};C();R();O();var QA={HIDDEN_IN_STUDIO:{bpActionHiddenInStudio:"true"},AWAIT_RETURN:{bpActionAwaitReturn:"true"}};C();R();O();import{isNode as Dk}from"browser-or-node";C();R();O();var ns=console;function Mt(t){if(!t.body)throw new Error("Missing body");return JSON.parse(t.body)}async function Ka(t,e=8072,n=$k){if(!Dk)throw new Error("This function can only be called in Node.js");let a=(Ih(),jv(kh)).createServer(async(o,i)=>{try{let s=await Hk(o);if(s.path==="/health"){i.writeHead(200).end("ok");return}let l=await t(s);i.writeHead(l?.status??200,l?.headers??{}).end(l?.body??"{}")}catch(s){ns.error("Error while handling request",{error:s?.message??"Internal error occured"}),i.writeHead(500).end(JSON.stringify({error:s?.message??"Internal error occured"}))}});return a.listen(e,()=>n(e)),a}async function Hk(t){let e=await Zk(t),n={};for(let a=0;a<t.rawHeaders.length;a+=2){let o=t.rawHeaders[a].toLowerCase(),i=t.rawHeaders[a+1];n[o]=i}let r=new URL(t.url??"",t.headers.host?`http://${t.headers.host}`:"http://botpress.cloud");return{body:e,path:r.pathname,query:Uk(r.search,"?"),headers:n,method:t.method?.toUpperCase()??"GET"}}function Uk(t,e){return t.indexOf(e)===0?t.slice(e.length):t}async function Zk(t){return new Promise((e,n)=>{if(t.method!=="POST"&&t.method!=="PUT"&&t.method!=="PATCH")return e(void 0);let r="";t.on("data",a=>r+=a.toString()),t.on("error",a=>n(a)),t.on("end",()=>e(r))})}function $k(t){ns.info(`Listening on port ${t}`)}import{isApiError as uU,RuntimeError as cU}from"@botpress/client";C();R();O();C();R();O();C();R();O();C();R();O();var Le={};Ln(Le,{mapKeys:()=>Lk,mapValues:()=>Kk,mergeRecords:()=>Wk,pairs:()=>La,stripUndefinedProps:()=>Fk,values:()=>jk});C();R();O();var La=t=>Object.entries(t),jk=t=>Object.values(t),Kk=(t,e)=>Object.fromEntries(La(t).map(([n,r])=>[n,e(r,n)])),Lk=(t,e)=>Object.fromEntries(La(t).map(([n,r])=>[e(n),r])),Fk=t=>Object.fromEntries(La(t).filter(([,e])=>e!==void 0)),Wk=(t,e,n)=>{let r=[...Object.keys(t),...Object.keys(e)],a=[...new Set(r)],o={};for(let i of a){let s=t[i],l=e[i];s&&l?o[i]=n(s,l):s?o[i]=s:l&&(o[i]=l)}return o};var ye={};Ln(ye,{safePush:()=>zk,unique:()=>qk});C();R();O();var zk=(t,...e)=>t?[...t,...e]:[...e],qk=t=>Array.from(new Set(t));C();R();O();var ft={};Ln(ft,{setName:()=>Gk});C();R();O();var Gk=(t,e)=>(Object.defineProperty(t,"name",{value:e}),t);var Ah=t=>{let{name:e,version:n}=t,r={actions:{},events:{},channels:{}},a={name:e,version:n,entities:Le.mapValues(t.entities,i=>({name:i.name})),actions:{},events:{},channels:{}},o=Le.mapValues(t.entities,i=>i.schema);for(let[i,s]of Object.entries(t.definition.actions??{})){let l=s.input.schema.dereference(o),f=s.output.schema.dereference(o),p=t.actions?.[i]?.name??i;r.actions[p]={...s,...t.actions?.[i]??{},input:{schema:l},output:{schema:f}},a.actions[i]={name:p}}for(let[i,s]of Object.entries(t.definition.events??{})){let l=s.schema.dereference(o),f=t.events?.[i]?.name??i;r.events[f]={...s,...t.events?.[i]??{},schema:l},a.events[i]={name:f}}for(let[i,s]of Object.entries(t.definition.channels??{})){let l={};for(let[p,y]of Object.entries(s.messages)){let g=y.schema.dereference(o);l[p]={...y,schema:g}}let f=t.channels?.[i]?.name??i;r.channels[f]={...s,...t.channels?.[i]??{},message:{...s.message??{},tags:{...s.message?.tags??{},...t.channels?.[i]?.message?.tags??{}}},conversation:{...s.conversation??{},tags:{...s.conversation?.tags??{},...t.channels?.[i]?.conversation?.tags??{}}},messages:l},a.channels[i]={name:f}}return{resolved:r,statement:a}};C();R();O();var Fa=Symbol("schemaName"),Ch=t=>t?Le.mapValues(t,(n,r)=>({...n,[Fa]:r})):{},Oh=t=>Fa in t&&t[Fa]!==void 0,Rh=t=>t[Fa];C();R();O();var Qs=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.icon=e.icon,this.readme=e.readme,this.title=e.title,this.identifier=e.identifier,this.description=e.description,this.configuration=e.configuration,this.configurations=e.configurations,this.events=e.events,this.actions=e.actions,this.channels=e.channels,this.states=e.states,this.user=e.user,this.secrets=e.secrets,this.entities=e.entities,this.interfaces=e.interfaces,this.__advanced=e.__advanced,this.attributes=e.attributes}name;version;title;description;icon;readme;configuration;configurations;events;actions;channels;states;user;secrets;identifier;entities;interfaces;__advanced;attributes;extend(e,n){let{entities:r,actions:a,events:o,channels:i}=this._callBuilder(e,n),s=this;s.interfaces??={};let l=Object.values(r).map(g=>g.name),f=l.length===0?e.name:`${e.name}<${l.join(",")}>`,{resolved:p,statement:y}=Ah({...e,entities:r,actions:Le.stripUndefinedProps(a),events:Le.stripUndefinedProps(o),channels:Le.stripUndefinedProps(i)});return s.actions=Le.mergeRecords(s.actions??{},p.actions,this._mergeActions),s.channels=Le.mergeRecords(s.channels??{},p.channels,this._mergeChannels),s.events=Le.mergeRecords(s.events??{},p.events,this._mergeEvents),s.interfaces[f]={id:e.id,...y},this}_callBuilder(e,n){let a={entities:Ch(this.entities)},o=n(a),i=Le.pairs(o.entities).find(([l,f])=>!Oh(f));if(i)throw new Error(`Cannot extend interface "${e.name}" with entity "${i[0]}"; the provided schema is not part of the integration's entities.`);return{entities:Le.mapValues(o.entities,l=>({name:Rh(l),schema:l.schema})),actions:o.actions??{},events:o.events??{},channels:o.channels??{}}}_mergeActions=(e,n)=>({...e,...n,input:{schema:zr(e.input.schema,n.input.schema)},output:{schema:zr(e.output.schema,n.output.schema)}});_mergeEvents=(e,n)=>({...e,...n,schema:zr(e.schema,n.schema)});_mergeChannels=(e,n)=>{let r=Le.mergeRecords(e.messages,n.messages,this._mergeMessage),a;(e.conversation||n.conversation)&&(a={tags:{...e.conversation?.tags,...n.conversation?.tags}});let o;return(e.message||n.message)&&(o={tags:{...e.message?.tags,...n.message?.tags}}),{...e,...n,messages:r,conversation:a,message:o}};_mergeMessage=(e,n)=>({schema:zr(e.schema,n.schema)})};C();R();O();C();R();O();import{isApiError as PI,Client as BI,RuntimeError as xv,InvalidPayloadError as EI}from"@botpress/client";C();R();O();import*as Mh from"@botpress/client";var Wa={retries:3,retryCondition:t=>Mh.axiosRetry.isNetworkOrIdempotentRequestError(t)||[429,502].includes(t.response?.status??0),retryDelay:(t,e)=>(Vk(e.response?.headers??{})??t)*1e3},Vk=t=>{let e=["RateLimit-Reset","X-RateLimit-Reset","Retry-After","ratelimit-reset","x-ratelimit-reset","retry-after"];for(let n of e){let r=t[n];if(r!==void 0)return Jk(String(r))}},Jk=t=>{let e=Yk(t)?Xk(t):t.length>0?parseInt(t,10):void 0;return e===void 0||isNaN(e)?void 0:e},Yk=t=>t.includes(" "),Xk=t=>{let e=Qk(t);if(!e)return;let n=new Date;return Math.max(0,Math.floor((e.getTime()-n.getTime())/1e3))},Qk=t=>{let e=new Date(t);return isNaN(e.getTime())?void 0:e};C();R();O();C();R();O();var ti=class{constructor(e){this._client=e}get _inner(){return this._client}createConversation=(e=>this._client.createConversation(e));getConversation=(e=>this._client.getConversation(e));listConversations=(e=>this._client.listConversations(e));getOrCreateConversation=(e=>this._client.getOrCreateConversation(e));updateConversation=(e=>this._client.updateConversation(e));deleteConversation=(e=>this._client.deleteConversation(e));listParticipants=(e=>this._client.listParticipants(e));addParticipant=(e=>this._client.addParticipant(e));getParticipant=(e=>this._client.getParticipant(e));removeParticipant=(e=>this._client.removeParticipant(e));createEvent=(e=>this._client.createEvent(e));getEvent=(e=>this._client.getEvent(e));listEvents=(e=>this._client.listEvents(e));createMessage=(e=>this._client.createMessage(e));getOrCreateMessage=(e=>this._client.getOrCreateMessage(e));getMessage=(e=>this._client.getMessage(e).then(n=>n));updateMessage=(e=>this._client.updateMessage(e).then(n=>n));listMessages=(e=>this._client.listMessages(e));deleteMessage=(e=>this._client.deleteMessage(e));createUser=(e=>this._client.createUser(e));getUser=(e=>this._client.getUser(e));listUsers=e=>this._client.listUsers(e);getOrCreateUser=(e=>this._client.getOrCreateUser(e));updateUser=(e=>this._client.updateUser(e));deleteUser=e=>this._client.deleteUser(e);getState=(e=>this._client.getState(e));setState=(e=>this._client.setState(e));getOrSetState=(e=>this._client.getOrSetState(e));patchState=(e=>this._client.patchState(e));configureIntegration=e=>this._client.configureIntegration(e);uploadFile=e=>this._client.uploadFile(e);upsertFile=e=>this._client.upsertFile(e);deleteFile=e=>this._client.deleteFile(e);listFiles=e=>this._client.listFiles(e);getFile=e=>this._client.getFile(e);updateFileMetadata=e=>this._client.updateFileMetadata(e);trackAnalytics=e=>this._client.trackAnalytics(e)};C();R();O();var za=class{_cost=0;get cost(){return this._cost}setCost(e){this._cost=e}toJSON(){return{cost:this.cost}}};C();R();O();C();R();O();var gn="#",qa="x-bot-id",Nh="x-bot-user-id",Dh="x-integration-id",Hh="x-integration-alias",Uh="x-webhook-id",Zh="x-bp-configuration-type",Ga="x-bp-configuration",Va="x-bp-operation",$h="x-bp-type";C();R();O();var It=t=>{throw t instanceof Error?t:new Error(t)};var OR=X.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),jh=t=>({botId:t[qa]||It("Missing bot header"),botUserId:t[Nh]||It("Missing bot user header"),integrationId:t[Dh]||It("Missing integration header"),integrationAlias:t[Hh]||It("Missing integration alias header"),webhookId:t[Uh]||It("Missing webhook header"),operation:t[Va]||It("Missing operation header"),configurationType:t[Zh]??null,configuration:JSON.parse(q.from(t[Ga]||It("Missing configuration header"),"base64").toString("utf-8"))});C();R();O();C();R();O();C();R();O();C();R();O();var tl={},Kh=!1;function bl(){return Kh||(Kh=!0,tl=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var a=42;e[n]=a;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(e,n);if(i.value!==a||i.enumerable!==!0)return!1}return!0}),tl}var nl={},Lh=!1;function eI(){return Lh||(Lh=!0,nl=Error),nl}var rl={},Fh=!1;function tI(){return Fh||(Fh=!0,rl=EvalError),rl}var il={},Wh=!1;function nI(){return Wh||(Wh=!0,il=RangeError),il}var al={},zh=!1;function rI(){return zh||(zh=!0,al=ReferenceError),al}var ol={},qh=!1;function uv(){return qh||(qh=!0,ol=SyntaxError),ol}var sl={},Gh=!1;function Ja(){return Gh||(Gh=!0,sl=TypeError),sl}var ll={},Vh=!1;function iI(){return Vh||(Vh=!0,ll=URIError),ll}var ul={},Jh=!1;function aI(){if(Jh)return ul;Jh=!0;var t=typeof Symbol<"u"&&Symbol,e=bl();return ul=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},ul}var cl={},Yh=!1;function oI(){if(Yh)return cl;Yh=!0;var t={__proto__:null,foo:{}},e=Object;return cl=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},cl}var fl={},Xh=!1;function sI(){if(Xh)return fl;Xh=!0;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,r="[object Function]",a=function(l,f){for(var p=[],y=0;y<l.length;y+=1)p[y]=l[y];for(var g=0;g<f.length;g+=1)p[g+l.length]=f[g];return p},o=function(l,f){for(var p=[],y=f,g=0;y<l.length;y+=1,g+=1)p[g]=l[y];return p},i=function(s,l){for(var f="",p=0;p<s.length;p+=1)f+=s[p],p+1<s.length&&(f+=l);return f};return fl=function(l){var f=this;if(typeof f!="function"||e.apply(f)!==r)throw new TypeError(t+f);for(var p=o(arguments,1),y,g=function(){if(this instanceof y){var v=f.apply(this,a(p,arguments));return Object(v)===v?v:this}return f.apply(l,a(p,arguments))},h=n(0,f.length-p.length),w=[],P=0;P<h;P++)w[P]="$"+P;if(y=Function("binder","return function ("+i(w,",")+"){ return binder.apply(this,arguments); }")(g),f.prototype){var B=function(){};B.prototype=f.prototype,y.prototype=new B,B.prototype=null}return y},fl}var dl={},Qh=!1;function wl(){if(Qh)return dl;Qh=!0;var t=sI();return dl=Function.prototype.bind||t,dl}var pl={},ev=!1;function lI(){if(ev)return pl;ev=!0;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=wl();return pl=n.call(t,e),pl}var gl={},tv=!1;function ri(){if(tv)return gl;tv=!0;var t,e=eI(),n=tI(),r=nI(),a=rI(),o=uv(),i=Ja(),s=iI(),l=Function,f=function(Ue){try{return l('"use strict"; return ('+Ue+").constructor;")()}catch{}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch{p=null}var y=function(){throw new i},g=p?(function(){try{return arguments.callee,y}catch{try{return p(arguments,"callee").get}catch{return y}}})():y,h=aI()(),w=oI()(),P=Object.getPrototypeOf||(w?function(Ue){return Ue.__proto__}:null),B={},v=typeof Uint8Array>"u"||!P?t:P(Uint8Array),S={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":h&&P?P([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":B,"%AsyncGenerator%":B,"%AsyncGeneratorFunction%":B,"%AsyncIteratorPrototype%":B,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":B,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h&&P?P(P([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!h||!P?t:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":r,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!h||!P?t:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&P?P(""[Symbol.iterator]()):t,"%Symbol%":h?Symbol:t,"%SyntaxError%":o,"%ThrowTypeError%":g,"%TypedArray%":v,"%TypeError%":i,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":s,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet};if(P)try{null.error}catch(Ue){var E=P(P(Ue));S["%Error.prototype%"]=E}var H=function Ue(Pe){var Se;if(Pe==="%AsyncFunction%")Se=f("async function () {}");else if(Pe==="%GeneratorFunction%")Se=f("function* () {}");else if(Pe==="%AsyncGeneratorFunction%")Se=f("async function* () {}");else if(Pe==="%AsyncGenerator%"){var fe=Ue("%AsyncGeneratorFunction%");fe&&(Se=fe.prototype)}else if(Pe==="%AsyncIteratorPrototype%"){var ve=Ue("%AsyncGenerator%");ve&&P&&(Se=P(ve.prototype))}return S[Pe]=Se,Se},K={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ae=wl(),ee=lI(),ge=ae.call(Function.call,Array.prototype.concat),oe=ae.call(Function.apply,Array.prototype.splice),re=ae.call(Function.call,String.prototype.replace),Oe=ae.call(Function.call,String.prototype.slice),ze=ae.call(Function.call,RegExp.prototype.exec),tt=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ve=/\\(\\)?/g,Je=function(Pe){var Se=Oe(Pe,0,1),fe=Oe(Pe,-1);if(Se==="%"&&fe!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(fe==="%"&&Se!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var ve=[];return re(Pe,tt,function(D,j,F,de){ve[ve.length]=F?re(de,Ve,"$1"):j||D}),ve},ht=function(Pe,Se){var fe=Pe,ve;if(ee(K,fe)&&(ve=K[fe],fe="%"+ve[0]+"%"),ee(S,fe)){var D=S[fe];if(D===B&&(D=H(fe)),typeof D>"u"&&!Se)throw new i("intrinsic "+Pe+" exists, but is not available. Please file an issue!");return{alias:ve,name:fe,value:D}}throw new o("intrinsic "+Pe+" does not exist!")};return gl=function(Pe,Se){if(typeof Pe!="string"||Pe.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Se!="boolean")throw new i('"allowMissing" argument must be a boolean');if(ze(/^%?[^%]*%?$/,Pe)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var fe=Je(Pe),ve=fe.length>0?fe[0]:"",D=ht("%"+ve+"%",Se),j=D.name,F=D.value,de=!1,Te=D.alias;Te&&(ve=Te[0],oe(fe,ge([0,1],Te)));for(var A=1,k=!0;A<fe.length;A+=1){var $=fe[A],Y=Oe($,0,1),ie=Oe($,-1);if((Y==='"'||Y==="'"||Y==="`"||ie==='"'||ie==="'"||ie==="`")&&Y!==ie)throw new o("property names with quotes must have matching quotes");if(($==="constructor"||!k)&&(de=!0),ve+="."+$,j="%"+ve+"%",ee(S,j))F=S[j];else if(F!=null){if(!($ in F)){if(!Se)throw new i("base intrinsic for "+Pe+" exists, but the property is not available.");return}if(p&&A+1>=fe.length){var b=p(F,$);k=!!b,k&&"get"in b&&!("originalValue"in b.get)?F=b.get:F=F[$]}else k=ee(F,$),F=F[$];k&&!de&&(S[j]=F)}}return F},gl}var yl={},nv=!1;function xl(){if(nv)return yl;nv=!0;var t=ri(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return yl=e,yl}var ml={},rv=!1;function Ya(){if(rv)return ml;rv=!0;var t=ri(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return ml=e,ml}var hl={},iv=!1;function uI(){if(iv)return hl;iv=!0;var t=xl(),e=uv(),n=Ja(),r=Ya();return hl=function(o,i,s){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,y=arguments.length>6?arguments[6]:!1,g=!!r&&r(o,i);if(t)t(o,i,{configurable:p===null&&g?g.configurable:!p,enumerable:l===null&&g?g.enumerable:!l,value:s,writable:f===null&&g?g.writable:!f});else if(y||!l&&!f&&!p)o[i]=s;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},hl}var vl={},av=!1;function cI(){if(av)return vl;av=!0;var t=xl(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},vl=e,vl}var Tl={},ov=!1;function fI(){if(ov)return Tl;ov=!0;var t=ri(),e=uI(),n=cI()(),r=Ya(),a=Ja(),o=t("%Math.floor%");return Tl=function(s,l){if(typeof s!="function")throw new a("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||o(l)!==l)throw new a("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],p=!0,y=!0;if("length"in s&&r){var g=r(s,"length");g&&!g.configurable&&(p=!1),g&&!g.writable&&(y=!1)}return(p||y||!f)&&(n?e(s,"length",l,!0,!0):e(s,"length",l)),s},Tl}var ni={},sv=!1;function Pl(){if(sv)return ni;sv=!0;var t=wl(),e=ri(),n=fI(),r=Ja(),a=e("%Function.prototype.apply%"),o=e("%Function.prototype.call%"),i=e("%Reflect.apply%",!0)||t.call(o,a),s=xl(),l=e("%Math.max%");ni=function(y){if(typeof y!="function")throw new r("a function is required");var g=i(t,o,arguments);return n(g,1+l(0,y.length-(arguments.length-1)),!0)};var f=function(){return i(t,a,arguments)};return s?s(ni,"apply",{value:f}):ni.apply=f,ni}var _l={},lv=!1;function Bl(){if(lv)return _l;lv=!0;var t=ri(),e=Pl(),n=e(t("String.prototype.indexOf"));return _l=function(a,o){var i=t(a,!!o);return typeof i=="function"&&n(a,".prototype.")>-1?e(i):i},_l}rs();_s();var El={},cv=!1;function Dl(){if(cv)return El;cv=!0;var t=bl();return El=function(){return t()&&!!Symbol.toStringTag},El}var Sl={},fv=!1;function dI(){if(fv)return Sl;fv=!0;var t=Dl()(),e=Bl(),n=e("Object.prototype.toString"),r=function(s){return t&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:n(s)==="[object Arguments]"},a=function(s){return r(s)?!0:s!==null&&typeof s=="object"&&typeof s.length=="number"&&s.length>=0&&n(s)!=="[object Array]"&&n(s.callee)==="[object Function]"},o=(function(){return r(arguments)})();return r.isLegacyArguments=a,Sl=o?r:a,Sl}var kl={},dv=!1;function pI(){if(dv)return kl;dv=!0;var t=Object.prototype.toString,e=Function.prototype.toString,n=/^\s*(?:function)?\*/,r=Dl()(),a=Object.getPrototypeOf,o=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},i;return kl=function(l){if(typeof l!="function")return!1;if(n.test(e.call(l)))return!0;if(!r){var f=t.call(l);return f==="[object GeneratorFunction]"}if(!a)return!1;if(typeof i>"u"){var p=o();i=p?a(p):!1}return a(l)===i},kl}var Il={},pv=!1;function gI(){if(pv)return Il;pv=!0;var t=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,r;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},e(function(){throw 42},null,n)}catch(S){S!==r&&(e=null)}else e=null;var a=/^\s*class\b/,o=function(E){try{var H=t.call(E);return a.test(H)}catch{return!1}},i=function(E){try{return o(E)?!1:(t.call(E),!0)}catch{return!1}},s=Object.prototype.toString,l="[object Object]",f="[object Function]",p="[object GeneratorFunction]",y="[object HTMLAllCollection]",g="[object HTML document.all class]",h="[object HTMLCollection]",w=typeof Symbol=="function"&&!!Symbol.toStringTag,P=!(0 in[,]),B=function(){return!1};if(typeof document=="object"){var v=document.all;s.call(v)===s.call(document.all)&&(B=function(E){if((P||!E)&&(typeof E>"u"||typeof E=="object"))try{var H=s.call(E);return(H===y||H===g||H===h||H===l)&&E("")==null}catch{}return!1})}return Il=e?function(E){if(B(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;try{e(E,null,n)}catch(H){if(H!==r)return!1}return!o(E)&&i(E)}:function(E){if(B(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;if(w)return i(E);if(o(E))return!1;var H=s.call(E);return H!==f&&H!==p&&!/^\[object HTML/.test(H)?!1:i(E)},Il}var Al={},gv=!1;function yI(){if(gv)return Al;gv=!0;var t=gI(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(l,f,p){for(var y=0,g=l.length;y<g;y++)n.call(l,y)&&(p==null?f(l[y],y,l):f.call(p,l[y],y,l))},a=function(l,f,p){for(var y=0,g=l.length;y<g;y++)p==null?f(l.charAt(y),y,l):f.call(p,l.charAt(y),y,l)},o=function(l,f,p){for(var y in l)n.call(l,y)&&(p==null?f(l[y],y,l):f.call(p,l[y],y,l))},i=function(l,f,p){if(!t(f))throw new TypeError("iterator must be a function");var y;arguments.length>=3&&(y=p),e.call(l)==="[object Array]"?r(l,f,y):typeof l=="string"?a(l,f,y):o(l,f,y)};return Al=i,Al}var Cl={},yv=!1;function mI(){return yv||(yv=!0,Cl=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Cl}var Ol={},mv=!1,hI=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function vI(){if(mv)return Ol;mv=!0;var t=mI(),e=typeof globalThis>"u"?hI:globalThis;return Ol=function(){for(var r=[],a=0;a<t.length;a++)typeof e[t[a]]=="function"&&(r[r.length]=t[a]);return r},Ol}var Rl={},hv=!1,TI=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function wv(){if(hv)return Rl;hv=!0;var t=yI(),e=vI(),n=Pl(),r=Bl(),a=Ya(),o=r("Object.prototype.toString"),i=Dl()(),s=typeof globalThis>"u"?TI:globalThis,l=e(),f=r("String.prototype.slice"),p=Object.getPrototypeOf,y=r("Array.prototype.indexOf",!0)||function(B,v){for(var S=0;S<B.length;S+=1)if(B[S]===v)return S;return-1},g={__proto__:null};i&&a&&p?t(l,function(P){var B=new s[P];if(Symbol.toStringTag in B){var v=p(B),S=a(v,Symbol.toStringTag);if(!S){var E=p(v);S=a(E,Symbol.toStringTag)}g["$"+P]=n(S.get)}}):t(l,function(P){var B=new s[P],v=B.slice||B.set;v&&(g["$"+P]=n(v))});var h=function(B){var v=!1;return t(g,function(S,E){if(!v)try{"$"+S(B)===E&&(v=f(E,1))}catch{}}),v},w=function(B){var v=!1;return t(g,function(S,E){if(!v)try{S(B),v=f(E,1)}catch{}}),v};return Rl=function(B){if(!B||typeof B!="object")return!1;if(!i){var v=f(o(B),8,-1);return y(l,v)>-1?v:v!=="Object"?!1:w(B)}return a?h(B):null},Rl}var Ml={},vv=!1;function _I(){if(vv)return Ml;vv=!0;var t=wv();return Ml=function(n){return!!t(n)},Ml}var we={},Tv=!1;function bI(){if(Tv)return we;Tv=!0;var t=dI(),e=pI(),n=wv(),r=_I();function a(Z){return Z.call.bind(Z)}var o=typeof BigInt<"u",i=typeof Symbol<"u",s=a(Object.prototype.toString),l=a(Number.prototype.valueOf),f=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(o)var y=a(BigInt.prototype.valueOf);if(i)var g=a(Symbol.prototype.valueOf);function h(Z,Ct){if(typeof Z!="object")return!1;try{return Ct(Z),!0}catch{return!1}}we.isArgumentsObject=t,we.isGeneratorFunction=e,we.isTypedArray=r;function w(Z){return typeof Promise<"u"&&Z instanceof Promise||Z!==null&&typeof Z=="object"&&typeof Z.then=="function"&&typeof Z.catch=="function"}we.isPromise=w;function P(Z){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Z):r(Z)||D(Z)}we.isArrayBufferView=P;function B(Z){return n(Z)==="Uint8Array"}we.isUint8Array=B;function v(Z){return n(Z)==="Uint8ClampedArray"}we.isUint8ClampedArray=v;function S(Z){return n(Z)==="Uint16Array"}we.isUint16Array=S;function E(Z){return n(Z)==="Uint32Array"}we.isUint32Array=E;function H(Z){return n(Z)==="Int8Array"}we.isInt8Array=H;function K(Z){return n(Z)==="Int16Array"}we.isInt16Array=K;function ae(Z){return n(Z)==="Int32Array"}we.isInt32Array=ae;function ee(Z){return n(Z)==="Float32Array"}we.isFloat32Array=ee;function ge(Z){return n(Z)==="Float64Array"}we.isFloat64Array=ge;function oe(Z){return n(Z)==="BigInt64Array"}we.isBigInt64Array=oe;function re(Z){return n(Z)==="BigUint64Array"}we.isBigUint64Array=re;function Oe(Z){return s(Z)==="[object Map]"}Oe.working=typeof Map<"u"&&Oe(new Map);function ze(Z){return typeof Map>"u"?!1:Oe.working?Oe(Z):Z instanceof Map}we.isMap=ze;function tt(Z){return s(Z)==="[object Set]"}tt.working=typeof Set<"u"&&tt(new Set);function Ve(Z){return typeof Set>"u"?!1:tt.working?tt(Z):Z instanceof Set}we.isSet=Ve;function Je(Z){return s(Z)==="[object WeakMap]"}Je.working=typeof WeakMap<"u"&&Je(new WeakMap);function ht(Z){return typeof WeakMap>"u"?!1:Je.working?Je(Z):Z instanceof WeakMap}we.isWeakMap=ht;function Ue(Z){return s(Z)==="[object WeakSet]"}Ue.working=typeof WeakSet<"u"&&Ue(new WeakSet);function Pe(Z){return Ue(Z)}we.isWeakSet=Pe;function Se(Z){return s(Z)==="[object ArrayBuffer]"}Se.working=typeof ArrayBuffer<"u"&&Se(new ArrayBuffer);function fe(Z){return typeof ArrayBuffer>"u"?!1:Se.working?Se(Z):Z instanceof ArrayBuffer}we.isArrayBuffer=fe;function ve(Z){return s(Z)==="[object DataView]"}ve.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&ve(new DataView(new ArrayBuffer(1),0,1));function D(Z){return typeof DataView>"u"?!1:ve.working?ve(Z):Z instanceof DataView}we.isDataView=D;var j=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function F(Z){return s(Z)==="[object SharedArrayBuffer]"}function de(Z){return typeof j>"u"?!1:(typeof F.working>"u"&&(F.working=F(new j)),F.working?F(Z):Z instanceof j)}we.isSharedArrayBuffer=de;function Te(Z){return s(Z)==="[object AsyncFunction]"}we.isAsyncFunction=Te;function A(Z){return s(Z)==="[object Map Iterator]"}we.isMapIterator=A;function k(Z){return s(Z)==="[object Set Iterator]"}we.isSetIterator=k;function $(Z){return s(Z)==="[object Generator]"}we.isGeneratorObject=$;function Y(Z){return s(Z)==="[object WebAssembly.Module]"}we.isWebAssemblyCompiledModule=Y;function ie(Z){return h(Z,l)}we.isNumberObject=ie;function b(Z){return h(Z,f)}we.isStringObject=b;function x(Z){return h(Z,p)}we.isBooleanObject=x;function z(Z){return o&&h(Z,y)}we.isBigIntObject=z;function Q(Z){return i&&h(Z,g)}we.isSymbolObject=Q;function Me(Z){return ie(Z)||b(Z)||x(Z)||z(Z)||Q(Z)}we.isBoxedPrimitive=Me;function _e(Z){return typeof Uint8Array<"u"&&(fe(Z)||de(Z))}return we.isAnyArrayBuffer=_e,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Z){Object.defineProperty(we,Z,{enumerable:!1,value:function(){throw new Error(Z+" is not supported in userland")}})}),we}var Nl={},_v=!1;function wI(){return _v||(_v=!0,Nl=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),Nl}var xe={},bv=!1,ii=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function xI(){if(bv)return xe;bv=!0;var t=Rt,e=Object.getOwnPropertyDescriptors||function(j){for(var F=Object.keys(j),de={},Te=0;Te<F.length;Te++)de[F[Te]]=Object.getOwnPropertyDescriptor(j,F[Te]);return de},n=/%[sdj%]/g;xe.format=function(D){if(!K(D)){for(var j=[],F=0;F<arguments.length;F++)j.push(i(arguments[F]));return j.join(" ")}for(var F=1,de=arguments,Te=de.length,A=String(D).replace(n,function($){if($==="%%")return"%";if(F>=Te)return $;switch($){case"%s":return String(de[F++]);case"%d":return Number(de[F++]);case"%j":try{return JSON.stringify(de[F++])}catch{return"[Circular]"}default:return $}}),k=de[F];F<Te;k=de[++F])S(k)||!oe(k)?A+=" "+k:A+=" "+i(k);return A},xe.deprecate=function(D,j){if(typeof t<"u"&&t.noDeprecation===!0)return D;if(typeof t>"u")return function(){return xe.deprecate(D,j).apply(this||ii,arguments)};var F=!1;function de(){if(!F){if(t.throwDeprecation)throw new Error(j);t.traceDeprecation?console.trace(j):console.error(j),F=!0}return D.apply(this||ii,arguments)}return de};var r={},a=/^$/;if(t.env.NODE_DEBUG){var o=t.env.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+o+"$","i")}xe.debuglog=function(D){if(D=D.toUpperCase(),!r[D])if(a.test(D)){var j=t.pid;r[D]=function(){var F=xe.format.apply(xe,arguments);console.error("%s %d: %s",D,j,F)}}else r[D]=function(){};return r[D]};function i(D,j){var F={seen:[],stylize:l};return arguments.length>=3&&(F.depth=arguments[2]),arguments.length>=4&&(F.colors=arguments[3]),v(j)?F.showHidden=j:j&&xe._extend(F,j),ee(F.showHidden)&&(F.showHidden=!1),ee(F.depth)&&(F.depth=2),ee(F.colors)&&(F.colors=!1),ee(F.customInspect)&&(F.customInspect=!0),F.colors&&(F.stylize=s),p(F,D,F.depth)}xe.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function s(D,j){var F=i.styles[j];return F?"\x1B["+i.colors[F][0]+"m"+D+"\x1B["+i.colors[F][1]+"m":D}function l(D,j){return D}function f(D){var j={};return D.forEach(function(F,de){j[F]=!0}),j}function p(D,j,F){if(D.customInspect&&j&&ze(j.inspect)&&j.inspect!==xe.inspect&&!(j.constructor&&j.constructor.prototype===j)){var de=j.inspect(F,D);return K(de)||(de=p(D,de,F)),de}var Te=y(D,j);if(Te)return Te;var A=Object.keys(j),k=f(A);if(D.showHidden&&(A=Object.getOwnPropertyNames(j)),Oe(j)&&(A.indexOf("message")>=0||A.indexOf("description")>=0))return g(j);if(A.length===0){if(ze(j)){var $=j.name?": "+j.name:"";return D.stylize("[Function"+$+"]","special")}if(ge(j))return D.stylize(RegExp.prototype.toString.call(j),"regexp");if(re(j))return D.stylize(Date.prototype.toString.call(j),"date");if(Oe(j))return g(j)}var Y="",ie=!1,b=["{","}"];if(B(j)&&(ie=!0,b=["[","]"]),ze(j)){var x=j.name?": "+j.name:"";Y=" [Function"+x+"]"}if(ge(j)&&(Y=" "+RegExp.prototype.toString.call(j)),re(j)&&(Y=" "+Date.prototype.toUTCString.call(j)),Oe(j)&&(Y=" "+g(j)),A.length===0&&(!ie||j.length==0))return b[0]+Y+b[1];if(F<0)return ge(j)?D.stylize(RegExp.prototype.toString.call(j),"regexp"):D.stylize("[Object]","special");D.seen.push(j);var z;return ie?z=h(D,j,F,k,A):z=A.map(function(Q){return w(D,j,F,k,Q,ie)}),D.seen.pop(),P(z,Y,b)}function y(D,j){if(ee(j))return D.stylize("undefined","undefined");if(K(j)){var F="'"+JSON.stringify(j).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return D.stylize(F,"string")}if(H(j))return D.stylize(""+j,"number");if(v(j))return D.stylize(""+j,"boolean");if(S(j))return D.stylize("null","null")}function g(D){return"["+Error.prototype.toString.call(D)+"]"}function h(D,j,F,de,Te){for(var A=[],k=0,$=j.length;k<$;++k)Pe(j,String(k))?A.push(w(D,j,F,de,String(k),!0)):A.push("");return Te.forEach(function(Y){Y.match(/^\d+$/)||A.push(w(D,j,F,de,Y,!0))}),A}function w(D,j,F,de,Te,A){var k,$,Y;if(Y=Object.getOwnPropertyDescriptor(j,Te)||{value:j[Te]},Y.get?Y.set?$=D.stylize("[Getter/Setter]","special"):$=D.stylize("[Getter]","special"):Y.set&&($=D.stylize("[Setter]","special")),Pe(de,Te)||(k="["+Te+"]"),$||(D.seen.indexOf(Y.value)<0?(S(F)?$=p(D,Y.value,null):$=p(D,Y.value,F-1),$.indexOf(`
|
|
80
80
|
`)>-1&&(A?$=$.split(`
|
|
81
81
|
`).map(function(ie){return" "+ie}).join(`
|
|
82
82
|
`).slice(2):$=`
|
|
@@ -85,7 +85,7 @@ ${v}`.trim();case M.ZodFirstPartyTypeKind.ZodEnum:return s.values.map(se).join("
|
|
|
85
85
|
`))):$=D.stylize("[Circular]","special")),ee(k)){if(A&&Te.match(/^\d+$/))return $;k=JSON.stringify(""+Te),k.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(k=k.slice(1,-1),k=D.stylize(k,"name")):(k=k.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),k=D.stylize(k,"string"))}return k+": "+$}function P(D,j,F){var de=D.reduce(function(Te,A){return A.indexOf(`
|
|
86
86
|
`)>=0,Te+A.replace(/\u001b\[\d\d?m/g,"").length+1},0);return de>60?F[0]+(j===""?"":j+`
|
|
87
87
|
`)+" "+D.join(`,
|
|
88
|
-
`)+" "+F[1]:F[0]+j+" "+D.join(", ")+" "+F[1]}xe.types=TI();function B(D){return Array.isArray(D)}xe.isArray=B;function v(D){return typeof D=="boolean"}xe.isBoolean=v;function E(D){return D===null}xe.isNull=E;function S(D){return D==null}xe.isNullOrUndefined=S;function H(D){return typeof D=="number"}xe.isNumber=H;function K(D){return typeof D=="string"}xe.isString=K;function oe(D){return typeof D=="symbol"}xe.isSymbol=oe;function ee(D){return D===void 0}xe.isUndefined=ee;function ge(D){return ae(D)&&Ve(D)==="[object RegExp]"}xe.isRegExp=ge,xe.types.isRegExp=ge;function ae(D){return typeof D=="object"&&D!==null}xe.isObject=ae;function re(D){return ae(D)&&Ve(D)==="[object Date]"}xe.isDate=re,xe.types.isDate=re;function Oe(D){return ae(D)&&(Ve(D)==="[object Error]"||D instanceof Error)}xe.isError=Oe,xe.types.isNativeError=Oe;function ze(D){return typeof D=="function"}xe.isFunction=ze;function tt(D){return D===null||typeof D=="boolean"||typeof D=="number"||typeof D=="string"||typeof D=="symbol"||typeof D>"u"}xe.isPrimitive=tt,xe.isBuffer=_I();function Ve(D){return Object.prototype.toString.call(D)}function Je(D){return D<10?"0"+D.toString(10):D.toString(10)}var ht=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ue(){var D=new Date,j=[Je(D.getHours()),Je(D.getMinutes()),Je(D.getSeconds())].join(":");return[D.getDate(),ht[D.getMonth()],j].join(" ")}xe.log=function(){console.log("%s - %s",Ue(),xe.format.apply(xe,arguments))},xe.inherits=Dt(),xe._extend=function(D,j){if(!j||!ae(j))return D;for(var F=Object.keys(j),de=F.length;de--;)D[F[de]]=j[F[de]];return D};function Pe(D,j){return Object.prototype.hasOwnProperty.call(D,j)}var Ee=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;xe.promisify=function(j){if(typeof j!="function")throw new TypeError('The "original" argument must be of type Function');if(Ee&&j[Ee]){if(F=j[Ee],typeof F!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(F,Ee,{value:F,enumerable:!1,writable:!1,configurable:!0}),F}function F(){for(var de,Te,A=new Promise(function(X,ie){de=X,Te=ie}),k=[],$=0;$<arguments.length;$++)k.push(arguments[$]);k.push(function(X,ie){X?Te(X):de(ie)});try{j.apply(this||ri,k)}catch(X){Te(X)}return A}return Object.setPrototypeOf(F,Object.getPrototypeOf(j)),Ee&&Object.defineProperty(F,Ee,{value:F,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(F,e(j))},xe.promisify.custom=Ee;function fe(D,j){if(!D){var F=new Error("Promise was rejected with a falsy value");F.reason=D,D=F}return j(D)}function ve(D){if(typeof D!="function")throw new TypeError('The "original" argument must be of type Function');function j(){for(var F=[],de=0;de<arguments.length;de++)F.push(arguments[de]);var Te=F.pop();if(typeof Te!="function")throw new TypeError("The last argument must be of type Function");var A=this||ri,k=function(){return Te.apply(A,arguments)};D.apply(this||ri,F).then(function($){t.nextTick(k.bind(null,null,$))},function($){t.nextTick(fe.bind(null,$,k))})}return Object.setPrototypeOf(j,Object.getPrototypeOf(D)),Object.defineProperties(j,e(D)),j}return xe.callbackify=ve,xe}var ce=bI();ce.format;ce.deprecate;ce.debuglog;ce.inspect;ce.types;ce.isArray;ce.isBoolean;ce.isNull;ce.isNullOrUndefined;ce.isNumber;ce.isString;ce.isSymbol;ce.isUndefined;ce.isRegExp;ce.isObject;ce.isDate;ce.isError;ce.isFunction;ce.isPrimitive;ce.isBuffer;ce.log;ce.inherits;ce._extend;ce.promisify;ce.callbackify;var HR=ce._extend,UR=ce.callbackify,ZR=ce.debuglog,$R=ce.deprecate,jR=ce.format,KR=ce.inherits,LR=ce.inspect,FR=ce.isArray,WR=ce.isBoolean,zR=ce.isBuffer,qR=ce.isDate,GR=ce.isError,VR=ce.isFunction,JR=ce.isNull,XR=ce.isNullOrUndefined,YR=ce.isNumber,QR=ce.isObject,e0=ce.isPrimitive,t0=ce.isRegExp,n0=ce.isString,r0=ce.isSymbol,i0=ce.isUndefined,o0=ce.log,a0=ce.promisify,s0=ce.types,l0=ce.TextEncoder=globalThis.TextEncoder,u0=ce.TextDecoder=globalThis.TextDecoder;var gr=class{defaultOptions;constructor(e){this.defaultOptions=e}info(...e){this._log("info",e)}debug(...e){this._log("debug",e)}warn(...e){this._log("warn",e)}error(...e){this._log("error",e)}_log(e,n){this._getConsoleMethod(e)(this._serializeMessage(n))}_serializeMessage(e){let n=ce.format(...e);return J.env.BP_LOG_FORMAT==="json"?this.getJsonMessage(n):n}getJsonMessage(e){return JSON.stringify({msg:e,options:this.defaultOptions})}_getConsoleMethod(e){switch(e){case"debug":return console.debug;case"warn":return console.warn;case"error":return console.error;default:return console.info}}};var ii=class t extends gr{constructor(e){super({visibleToBotOwners:!0,...e})}with(e){return new t({...this.defaultOptions,...e})}withUserId(e){return this.with({userId:e})}withConversationId(e){return this.with({conversationId:e})}withVisibleToBotOwners(e){return this.with({visibleToBotOwners:e})}forBot(){return this.withVisibleToBotOwners(!0)}getJsonMessage(e){return JSON.stringify({msg:e,visible_to_bot_owner:this.defaultOptions.visibleToBotOwners,options:this.defaultOptions})}};C();R();O();var BI=t=>["traceparent","tracestate","sentry-trace"].reduce((e,n)=>(t[n]&&(e[n]=t[n]),e),{}),SI=(t,e,n)=>{let[,r]=(e.headers.traceparent||"").split("-"),o=new xI({botId:t.botId,integrationId:t.integrationId,retry:Go,headers:BI(e.headers)}),a=new ei(o),i=new ii({traceId:r});return{ctx:t,req:e,client:a,logger:i,instance:n}},EI=async t=>{let{ctx:e}=t;switch(e.operation){case"webhook_received":return await II(t);case"register":return await AI(t);case"unregister":return await CI(t);case"message_created":return await MI(t);case"action_triggered":return await NI(t);case"ping":return await kI(t);case"create_user":return await OI(t);case"create_conversation":return await RI(t);default:throw new PI(`Unknown operation ${e.operation}`)}},wv=t=>async e=>{let n=Zh(e.headers),r=SI(n,e,t),{logger:o}=r;try{let a;return a=await DI(r),a?{...a,status:a.status??200}:(a=await EI(r),a?{...a,status:a.status??200}:{status:200})}catch(a){if(wI(a)){let s=a.type==="Runtime"?a:new bv(a.message,a);return o.forBot().error(s.message),{status:s.code,body:JSON.stringify(s.toJSON())}}console.error(a);let i=new bv("An unexpected error occurred in the integration. Bot owners: Check logs for more informations. Integration owners: throw a RuntimeError to return a custom error message instead.");return o.forBot().error(i.message),{status:i.code,body:JSON.stringify(i.toJSON())}}},kI=async t=>{},II=async({client:t,ctx:e,req:n,logger:r,instance:o})=>{let{req:a}=Rt(n);return o.webhook({client:t,ctx:e,req:a,logger:r})},AI=async({client:t,ctx:e,req:n,logger:r,instance:o})=>{if(!o.register)return;let{webhookUrl:a}=Rt(n);await o.register({client:t,ctx:e,webhookUrl:a,logger:r})},CI=async({client:t,ctx:e,req:n,logger:r,instance:o})=>{if(!o.unregister)return;let{webhookUrl:a}=Rt(n);await o.unregister({ctx:e,webhookUrl:a,client:t,logger:r})},OI=async({client:t,ctx:e,req:n,logger:r,instance:o})=>{if(!o.createUser)return;let{tags:a}=Rt(n);return await o.createUser({ctx:e,client:t,tags:a,logger:r})},RI=async({client:t,ctx:e,req:n,logger:r,instance:o})=>{if(!o.createConversation)return;let{channel:a,tags:i}=Rt(n);return await o.createConversation({ctx:e,client:t,channel:a,tags:i,logger:r})},MI=async({ctx:t,req:e,client:n,logger:r,instance:o})=>{let{conversation:a,user:i,type:s,payload:l,message:f}=Rt(e),p=o.channels[a.channel];if(!p)throw new Error(`Channel ${a.channel} not found`);let y=p.messages[s];if(!y)throw new Error(`Message of type ${s} not found in channel ${a.channel}`);await y({ctx:t,conversation:a,message:f,user:i,type:s,client:n,payload:l,ack:async({tags:h})=>{await n.updateMessage({id:f.id,tags:h})},logger:r})},NI=async({req:t,ctx:e,client:n,logger:r,instance:o})=>{let{input:a,type:i}=Rt(t);if(!i)throw new Error("Missing action type");let s=o.actions[i];if(!s)throw new Error(`Action ${i} not found`);let l=new Vo,p={output:await s({ctx:e,input:a,client:n,type:i,logger:r,metadata:l}),meta:l.toJSON()};return{body:JSON.stringify(p)}},DI=async({instance:t,client:e,ctx:n,logger:r,req:o})=>{let a=t.unknownOperationHandler;if(a)return await a({client:e,ctx:n,logger:r,req:o})};var Dl=class{constructor(e){this.props=e;this.actions=e.actions,this.channels=e.channels,this.register=e.register,this.unregister=e.unregister,this.createUser=e.createUser,this.createConversation=e.createConversation,this.webhook=e.handler,this.unknownOperationHandler=e.__advanced?.unknownOperationHandler}actions;channels;register;unregister;createUser;createConversation;webhook;unknownOperationHandler;handler=wv(this);start=e=>Wo(this.handler,e)};C();R();O();C();R();O();C();R();O();C();R();O();C();R();O();var Hl=class{constructor(e){this.props=e;this.integrations=e.integrations,this.plugins=e.plugins,this.user=e.user,this.conversation=e.conversation,this.message=e.message,this.states=e.states,this.configuration=e.configuration,this.events=e.events,this.recurringEvents=e.recurringEvents,this.actions=e.actions,this.tables=e.tables,this.workflows=e.workflows,this.attributes=e.attributes,this.__advanced=e.__advanced,this.withPlugins={user:e.user,conversation:e.conversation,message:e.message,states:e.states,events:e.events,recurringEvents:e.recurringEvents,actions:e.actions,tables:e.tables,workflows:e.workflows}}integrations;plugins;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;workflows;attributes;__advanced;withPlugins;addIntegration(e,n){let r=this;return r.integrations||(r.integrations={}),r.integrations[e.name]={...e,enabled:n?.enabled,configurationType:n?.configurationType,configuration:n?.configuration,disabledChannels:n?.disabledChannels},this}addPlugin(e,n){let r=this;r.plugins||(r.plugins={});let o=n.alias??e.name.replace("/","-");return r.plugins[o]={...e,alias:o,configuration:n.configuration,interfaces:n.interfaces},r.withPlugins.user=this._mergeUser(r.withPlugins.user,e.definition.user),r.withPlugins.conversation=this._mergeConversation(r.withPlugins.conversation,e.definition.conversation),r.withPlugins.message=this._mergeMessage(r.withPlugins.message,e.definition.message),r.withPlugins.recurringEvents=this._mergeRecurringEvents(r.withPlugins.recurringEvents,e.definition.recurringEvents),r.withPlugins.tables=this._mergeTables(r.withPlugins.tables,e.definition.tables),r.withPlugins.workflows=this._mergeWorkflows(r.withPlugins.workflows,e.definition.workflows),r.withPlugins.states=this._mergeStates(r.withPlugins.states,this._prefixKeysWithPluginAlias(e.definition.states,o)),r.withPlugins.events=this._mergeEvents(r.withPlugins.events,this._prefixKeysWithPluginAlias(e.definition.events,o)),r.withPlugins.actions=this._mergeActions(r.withPlugins.actions,this._prefixKeysWithPluginAlias(e.definition.actions,o)),this}_mergeUser=(e,n)=>({tags:{...e?.tags,...n?.tags}});_mergeConversation=(e,n)=>({tags:{...e?.tags,...n?.tags}});_mergeMessage=(e,n)=>({tags:{...e?.tags,...n?.tags}});_mergeStates=(e,n)=>({...e,...n});_mergeEvents=(e,n)=>({...e,...n});_mergeRecurringEvents=(e,n)=>({...e,...n});_mergeActions=(e,n)=>({...e,...n});_mergeTables=(e,n)=>({...e,...n});_mergeWorkflows=(e,n)=>({...e,...n});_prefixKeysWithPluginAlias=(e,n)=>Le.mapKeys(e??{},r=>`${n}${pn}${r}`);dereferencePluginEntities(){let e=this._buildZuiReferenceMap();return{...this,withPlugins:{...this.withPlugins,events:this._dereferenceDefinitionSchemas(this.withPlugins.events,e),states:this._dereferenceDefinitionSchemas(this.withPlugins.states,e),tables:this._dereferenceDefinitionSchemas(this.withPlugins.tables,e),actions:this._dereferenceActionDefinitionSchemas(this.withPlugins.actions,e)},plugins:Object.fromEntries(Object.entries(this.plugins??{}).map(([n,r])=>[n,{...r,definition:{...r.definition,configuration:this._dereferenceDefinitionSchema(r.definition.configuration,e),events:this._dereferenceDefinitionSchemas(r.definition.events,e),states:this._dereferenceDefinitionSchemas(r.definition.states,e),tables:this._dereferenceDefinitionSchemas(r.definition.tables,e),actions:this._dereferenceActionDefinitionSchemas(r.definition.actions,e)}}]))}}_buildZuiReferenceMap(){let e={},n=Object.entries(this.plugins??{});for(let[r,o]of n){let a=Object.entries(o.interfaces??{});for(let[i,s]of a){let l=this.integrations?.[s.name];if(!l)throw new Error(`Interface with alias "${i}" of plugin with alias "${r}" references integration "${s.name}" which is not installed`);let f=Object.entries(s.entities??{});for(let[p,{name:y}]of f){let g=l.definition.entities?.[y]?.schema;if(!g)throw new Error(`Interface entity "${y}" does not exist in integration "${l.name}"`);e[`interface:${i}/entities/${p}`]=g}}}return e}_dereferenceZuiSchema(e,n){return e.dereference(n)}_dereferenceDefinitionSchemas(e,n){return Object.fromEntries(Object.entries(e??{}).map(([r,o])=>[r,this._dereferenceDefinitionSchema(o,n)]))}_dereferenceDefinitionSchema(e,n){return e&&{...e,schema:this._dereferenceZuiSchema(e.schema,n)}}_dereferenceActionDefinitionSchemas(e,n){return Object.fromEntries(Object.entries(e??{}).map(([r,o])=>[r,{...o,input:{schema:this._dereferenceZuiSchema(o.input.schema,n)},output:{schema:this._dereferenceZuiSchema(o.output.schema,n)}}]))}};C();R();O();C();R();O();import{isApiError as KI,Client as LI,RuntimeError as Bv}from"@botpress/client";C();R();O();var oi=class t extends gr{constructor(e){super({...e})}with(e){return new t({...this.defaultOptions,...e})}withUserId(e){return this.with({userId:e})}withConversationId(e){return this.with({conversationId:e})}withWorkflowId(e){return this.with({workflowId:e})}withEventId(e){return this.with({eventId:e})}withMessageId(e){return this.with({messageId:e})}};C();R();O();C();R();O();var tn=class{constructor(e,n={before:{},after:{}}){this._client=e;this._hooks=n}get _inner(){return this._client}getConversation=(e=>this._run("getConversation",e));listConversations=(e=>this._run("listConversations",e));updateConversation=(e=>this._run("updateConversation",e));deleteConversation=(e=>this._run("deleteConversation",e));listParticipants=(e=>this._run("listParticipants",e));addParticipant=(e=>this._run("addParticipant",e));getParticipant=(e=>this._run("getParticipant",e));removeParticipant=(e=>this._run("removeParticipant",e));createEvent=(e=>this._run("createEvent",e));getEvent=(e=>this._run("getEvent",e));listEvents=(e=>this._run("listEvents",e));createMessage=(e=>this._run("createMessage",e));getOrCreateMessage=(e=>this._run("getOrCreateMessage",e));getMessage=(e=>this._run("getMessage",e));updateMessage=(e=>this._run("updateMessage",e));listMessages=(e=>this._run("listMessages",e));deleteMessage=(e=>this._run("deleteMessage",e));getUser=(e=>this._run("getUser",e));listUsers=(e=>this._run("listUsers",e));updateUser=(e=>this._run("updateUser",e));deleteUser=(e=>this._run("deleteUser",e));getState=(e=>this._run("getState",e));setState=(e=>this._run("setState",e));getOrSetState=(e=>this._run("getOrSetState",e));patchState=(e=>this._run("patchState",e));callAction=(e=>this._run("callAction",e));uploadFile=(e=>this._run("uploadFile",e));upsertFile=(e=>this._run("upsertFile",e));deleteFile=(e=>this._run("deleteFile",e));listFiles=(e=>this._run("listFiles",e));getFile=(e=>this._run("getFile",e));updateFileMetadata=(e=>this._run("updateFileMetadata",e));searchFiles=(e=>this._run("searchFiles",e));trackAnalytics=(e=>this._run("trackAnalytics",e));getTableRow=(e=>this._run("getTableRow",e));createTableRows=(e=>this._run("createTableRows",e));findTableRows=(e=>this._run("findTableRows",e));deleteTableRows=(e=>this._run("deleteTableRows",e));updateTableRows=(e=>this._run("updateTableRows",e));upsertTableRows=(e=>this._run("upsertTableRows",e));createWorkflow=(e=>this._run("createWorkflow",e));getWorkflow=(e=>this._run("getWorkflow",e));updateWorkflow=(e=>this._run("updateWorkflow",e));deleteWorkflow=(e=>this._run("deleteWorkflow",e));listWorkflows=(e=>this._run("listWorkflows",e));createConversation=e=>this._client.createConversation(e);getOrCreateConversation=e=>this._client.getOrCreateConversation(e);createUser=e=>this._client.createUser(e);getOrCreateUser=e=>this._client.getOrCreateUser(e);_run=async(e,n)=>{let r=this._hooks.before[e];r&&(n=await r(n));let o=await this._client[e](n),a=this._hooks.after[e];return a&&(o=await a(o,n)),o}};C();R();O();var HI=Y.enum(["event_received","register","unregister","ping","action_triggered"]),xv=t=>{let e=t[bo],n=t[wo],r=t[Ny],o=HI.parse(t[xo]);if(!e)throw new Error("Missing bot headers");if(!r)throw new Error("Missing type headers");if(!n)throw new Error("Missing configuration headers");if(!o)throw new Error("Missing operation headers");return{botId:e,operation:o,type:r,configuration:n?JSON.parse(q.from(n,"base64").toString("utf-8")):{}}};C();R();O();var dt={status:200};C();R();O();C();R();O();var Ul=t=>{switch(t){case"workflow_continued":return"continued";case"workflow_started":return"started";case"workflow_timedout":return"timed_out";default:throw new Error(`Unsupported workflow update type: ${t}`)}};var UI=["child_workflow_deleted","child_workflow_finished","workflow_timedout","workflow_started","workflow_continued"],Pv=async(t,e)=>{if(t.ctx.type!=="workflow_update"||!UI.includes(e.payload.type))throw new Error("Unexpected event type");let n={...t,logger:ZI(t,e)};if(!e.payload.workflow.name)return n.logger.warn("Received workflow update event without a workflow name. Assuming this workflow was not defined by the bot.",e.payload.workflow),dt;switch(e.payload.type){case"child_workflow_deleted":case"child_workflow_finished":n.logger.info(`Received child workflow event "${e.payload.type}", but child workflows are not yet supported`);break;case"workflow_timedout":case"workflow_started":case"workflow_continued":return await $I(n,e);default:e.payload.type}return dt},ZI=(t,e)=>t.logger.with({eventId:e.id,workflowId:e.payload.workflow.id,conversationId:e.payload.conversation?.id,userId:e.payload.user?.id}),$I=async(t,e)=>{let n=Ul(e.payload.type),r=t.self.workflowHandlers[n]?.[e.payload.workflow.name];if(!r||r.length===0)return t.logger.warn(`No ${n} handler found for workflow "${e.payload.workflow.name}"`),dt;let{updatedWorkflow:o}=await jI(t,e);return o.status==="pending"&&t.logger.warn(`Workflow "${e.payload.workflow.name}" is still in pending status after processing "${n}" event. This may indicate that the workflow was not properly acknowledged or terminated by the handler. `),dt},jI=async(t,e)=>{let n=Ul(e.payload.type),r=t.self.workflowHandlers[n]?.[e.payload.workflow.name],o=structuredClone(e.payload.workflow);for(let a of r??[])o=await a({...t,event:e,conversation:e.payload.conversation,user:e.payload.user,workflow:o});return{updatedWorkflow:o}};C();R();O();var Sv=t=>async e=>{let n=xv(e.headers),r=new oi,o=new LI({botId:n.botId,retry:Go}),a=new tn(o,{before:{createMessage:async s=>{let l=t.hookHandlers.before_outgoing_message[s.type]??[];for(let f of l){let p=new tn(o);s=(await f({client:p,ctx:n,logger:r.with({conversationId:s.conversationId,userId:s.userId}),data:s}))?.data??s}return s},callAction:async s=>{let l=t.hookHandlers.before_outgoing_call_action[s.type]??[];for(let f of l){let p=new tn(o);s=(await f({client:p,ctx:n,logger:r,data:s}))?.data??s}return s}},after:{createMessage:async s=>{let l=t.hookHandlers.after_outgoing_message[s.message.type]??[];for(let f of l){let p=new tn(o);s=(await f({client:p,ctx:n,logger:r.with({messageId:s.message.id,conversationId:s.message.conversationId,userId:s.message.userId}),data:s}))?.data??s}return s},callAction:async(s,l)=>{let{type:f}=l,p=t.hookHandlers.after_outgoing_call_action[f]??[];for(let y of p){let g=new tn(o);s=(await y({client:g,ctx:n,logger:r,data:{type:f,...s}}))?.data??s}return s}}}),i={req:e,ctx:n,logger:r,client:a,self:t};try{switch(n.operation){case"action_triggered":return await GI(i);case"event_received":return await qI(i);case"register":return await WI(i);case"unregister":return await zI(i);case"ping":return await FI(i);default:throw new Error(`Unknown operation ${n.operation}`)}}catch(s){let l=s instanceof Error?s:new Error(String(s));if(KI(l)){let p=l.type==="Runtime"?l:new Bv(l.message,l);return r.error(p.message),{status:p.code,body:JSON.stringify(p.toJSON())}}let f=new Bv("An unexpected error occurred in the bot.",l);return r.error(f.message,l),{status:f.code,body:JSON.stringify(f.toJSON())}}},FI=async t=>dt,WI=async t=>dt,zI=async t=>dt,qI=async t=>{let{ctx:e,logger:n,req:r,client:o,self:a}=t,i={client:o,ctx:e,logger:n},s=Rt(r);if(i.logger=i.logger.with({eventId:s.event.id,messageId:s.event.messageId,conversationId:s.event.conversationId,userId:s.event.userId}),e.type==="workflow_update")return await Pv(t,s.event);if(e.type==="message_created"){let h=s.event,w=h.payload.message;i.logger=i.logger.with({messageId:w.id,conversationId:w.conversationId,userId:w.userId});let P=a.hookHandlers.before_incoming_message[w.type]??[];for(let S of P){let H=await S({...i,data:w});if(w=H?.data??w,H?.stop)return dt}let B={...i,user:h.payload.user,conversation:h.payload.conversation,message:w,event:h},v=a.messageHandlers[w.type]??[];for(let S of v)await S(B);let E=a.hookHandlers.after_incoming_message[w.type]??[];for(let S of E){let H=await S({...i,data:w});if(w=H?.data??w,H?.stop)return dt}return dt}if(e.type==="state_expired"){let w=s.event.payload.state,P={...i,state:w},B=a.stateExpiredHandlers[w.name]??[];for(let v of B)await v(P);return dt}let l=s.event,f=a.hookHandlers.before_incoming_event[l.type]??[];for(let h of f){let w=await h({...i,data:l});if(l=w?.data??l,w?.stop)return dt}let p={...i,event:l},y=a.eventHandlers[l.type]??[];for(let h of y)await h(p);let g=a.hookHandlers.after_incoming_event[l.type]??[];for(let h of g){let w=await h({...i,data:l});if(l=w?.data??l,w?.stop)return dt}return dt},GI=async({ctx:t,logger:e,req:n,client:r,self:o})=>{let{input:a,type:i}=Rt(n);if(!i)throw new Error("Missing action type");let s=o.hookHandlers.before_incoming_call_action[i]??[];for(let g of s){let h=await g({ctx:t,logger:e,client:r,data:{type:i,input:a}});a=h?.data?.input??a,i=h?.data?.type??i}let l=o.actionHandlers[i];if(!l)throw new Error(`Action ${i} not found`);let f=await l({ctx:t,logger:e,input:a,client:r,type:i}),p=o.hookHandlers.after_incoming_call_action[i]??[];for(let g of p){let h=await g({ctx:t,logger:e,client:r,data:{type:i,output:f}});i=h?.data?.type??i,f=h?.data?.output??f}return{status:200,body:JSON.stringify({output:f})}};C();R();O();C();R();O();var nn=t=>new Proxy({},{get:(e,n)=>({listInstances:{all:r=>gn({workflowName:n,client:t,input:r}),running:r=>gn({workflowName:n,client:t,input:r,statuses:["in_progress"]}),scheduled:r=>gn({workflowName:n,client:t,input:r,statuses:["pending","listening"]}),allFinished:r=>gn({workflowName:n,client:t,input:r,statuses:["completed","cancelled","failed","timedout"]}),cancelled:r=>gn({workflowName:n,client:t,input:r,statuses:["cancelled"]}),failed:r=>gn({workflowName:n,client:t,input:r,statuses:["failed"]}),succeeded:r=>gn({workflowName:n,client:t,input:r,statuses:["completed"]}),timedOut:r=>gn({workflowName:n,client:t,input:r,statuses:["timedout"]})},startNewInstance:async r=>{let{workflow:o}=await t.createWorkflow({name:n,status:"pending",...r});return{workflow:It({client:t,workflow:o})}}})}),gn=async t=>{let e=await t.client.listWorkflows({name:t.workflowName,statuses:t.statuses,...t.input});return{...e,workflows:e.workflows.map(n=>It({client:t.client,workflow:n}))}},It=t=>{let e=!1;return{...t.workflow,async update(n){let{workflow:r}=await t.client.updateWorkflow({id:t.workflow.id,...n});return await t.onWorkflowUpdate?.(r),{workflow:It({...t,workflow:r})}},async acknowledgeStartOfProcessing(){if(!t.event||t.workflow.status!=="pending"||e)return{workflow:It(t)};let{workflow:n}=await t.client.updateWorkflow({id:t.workflow.id,status:"in_progress",eventId:t.event.id});return e=!0,await t.onWorkflowUpdate?.(n),{workflow:It({...t,workflow:n})}},async setFailed({failureReason:n}){let{workflow:r}=await t.client.updateWorkflow({id:t.workflow.id,status:"failed",failureReason:n});return await t.onWorkflowUpdate?.(r),{workflow:It({...t,workflow:r})}},async setCompleted({output:n}={}){let{workflow:r}=await t.client.updateWorkflow({id:t.workflow.id,status:"completed",output:n});return await t.onWorkflowUpdate?.(r),{workflow:It({...t,workflow:r})}},async cancel(){let{workflow:n}=await t.client.updateWorkflow({id:t.workflow.id,status:"cancelled"});return await t.onWorkflowUpdate?.(n),{workflow:It({...t,workflow:n})}}}};C();R();O();var Zl=class{constructor(e){this.props=e;this._actionHandlers=e.actions,this._plugins=e.plugins}_actionHandlers;_messageHandlers={};_eventHandlers={};_stateExpiredHandlers={};_hookHandlers={before_incoming_event:{},before_incoming_message:{},before_outgoing_message:{},before_outgoing_call_action:{},before_incoming_call_action:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{},after_incoming_call_action:{}};_workflowHandlers={started:{},continued:{},timed_out:{}};_plugins={};_registerOrder=0;get actionHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._actionHandlers[n];if(r)return r;for(let[o,a]of Object.entries(this._plugins)){let[i,s]=n.split(pn);if(!(i!==o||!s)&&(r=a.actionHandlers[s],r))return ft.setName(l=>r({...l,workflows:nn(l.client)}),r.name)}}})}get messageHandlers(){return new Proxy({},{get:(e,n)=>{let r=Object.values(this._plugins).flatMap(s=>s.messageHandlers[n]??[]),o=this._messageHandlers[n]??[],a=this._messageHandlers["*"]??[],i=[...o,...a].sort((s,l)=>s.order-l.order).map(({handler:s})=>s);return ye.unique([...r,...i]).map(s=>ft.setName(l=>s({...l,workflows:nn(l.client)}),s.name))}})}get eventHandlers(){return new Proxy({},{get:(e,n)=>{let r=Object.values(this._plugins).flatMap(s=>s.eventHandlers[n]??[]),o=this._eventHandlers[n]??[],a=this._eventHandlers["*"]??[],i=[...o,...a].sort((s,l)=>s.order-l.order).map(({handler:s})=>s);return ye.unique([...r,...i]).map(s=>ft.setName(l=>s({...l,workflows:nn(l.client)}),s.name))}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,n)=>{let r=Object.values(this._plugins).flatMap(s=>s.stateExpiredHandlers[n]??[]),o=this._stateExpiredHandlers[n]??[],a=this._stateExpiredHandlers["*"]??[],i=[...o,...a].sort((s,l)=>s.order-l.order).map(({handler:s})=>s);return ye.unique([...r,...i]).map(s=>ft.setName(l=>s({...l,workflows:nn(l.client)}),s.name))}})}get hookHandlers(){return new Proxy({},{get:(e,n)=>{if(this._hookHandlers[n])return new Proxy({},{get:(o,a)=>{let i=Object.values(this._plugins).flatMap(y=>y.hookHandlers[n]?.[a]??[]),s=this._hookHandlers[n]??{},l=s[a]??[],f=s["*"]??[],p=[...l,...f].sort((y,g)=>y.order-g.order).map(({handler:y})=>y);return ye.unique([...i,...p]).map(y=>ft.setName(g=>y({...g,workflows:nn(g.client)}),y.name))}})}})}get workflowHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._workflowHandlers[n];if(r)return new Proxy({},{get:(o,a)=>{let i=r[a]?.sort((l,f)=>l.order-f.order).map(({handler:l})=>l)??[],s=Object.values(this._plugins).flatMap(l=>l.workflowHandlers[n]?.[a]??[]);return ye.unique([...i,...s]).map(l=>ft.setName(async f=>{let p=f.workflow;return await l({...f,workflow:It({...f,onWorkflowUpdate(y){p=y}}),workflows:nn(f.client)}),p},l.name))}})}})}on={message:(e,n)=>{this._messageHandlers[e]=ye.safePush(this._messageHandlers[e],{handler:n,order:this._registerOrder++})},event:(e,n)=>{this._eventHandlers[e]=ye.safePush(this._eventHandlers[e],{handler:n,order:this._registerOrder++})},stateExpired:(e,n)=>{this._stateExpiredHandlers[e]=ye.safePush(this._stateExpiredHandlers[e],{handler:n,order:this._registerOrder++})},beforeIncomingEvent:(e,n)=>{this._hookHandlers.before_incoming_event[e]=ye.safePush(this._hookHandlers.before_incoming_event[e],{handler:n,order:this._registerOrder++})},beforeIncomingMessage:(e,n)=>{this._hookHandlers.before_incoming_message[e]=ye.safePush(this._hookHandlers.before_incoming_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingMessage:(e,n)=>{this._hookHandlers.before_outgoing_message[e]=ye.safePush(this._hookHandlers.before_outgoing_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingCallAction:(e,n)=>{this._hookHandlers.before_outgoing_call_action[e]=ye.safePush(this._hookHandlers.before_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},beforeIncomingCallAction:(e,n)=>{this._hookHandlers.before_incoming_call_action[e]=ye.safePush(this._hookHandlers.before_incoming_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingEvent:(e,n)=>{this._hookHandlers.after_incoming_event[e]=ye.safePush(this._hookHandlers.after_incoming_event[e],{handler:n,order:this._registerOrder++})},afterIncomingMessage:(e,n)=>{this._hookHandlers.after_incoming_message[e]=ye.safePush(this._hookHandlers.after_incoming_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingMessage:(e,n)=>{this._hookHandlers.after_outgoing_message[e]=ye.safePush(this._hookHandlers.after_outgoing_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingCallAction:(e,n)=>{this._hookHandlers.after_outgoing_call_action[e]=ye.safePush(this._hookHandlers.after_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingCallAction:(e,n)=>{this._hookHandlers.after_incoming_call_action[e]=ye.safePush(this._hookHandlers.after_incoming_call_action[e],{handler:n,order:this._registerOrder++})},workflowStart:(e,n)=>{this._workflowHandlers.started[e]=ye.safePush(this._workflowHandlers.started[e],{handler:n,order:this._registerOrder++})},workflowContinue:(e,n)=>{this._workflowHandlers.continued[e]=ye.safePush(this._workflowHandlers.continued[e],{handler:n,order:this._registerOrder++})},workflowTimeout:(e,n)=>{this._workflowHandlers.timed_out[e]=ye.safePush(this._workflowHandlers.timed_out[e],{handler:n,order:this._registerOrder++})}};handler=Sv(this);start=e=>Wo(this.handler,e)};C();R();O();C();R();O();C();R();O();C();R();O();C();R();O();var $l=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.icon=e.icon,this.title=e.title,this.description=e.description,this.readme=e.readme,this.entities=e.entities??{},this.attributes=e.attributes,this.__advanced=e.__advanced;let n=this._getEntityReference(this.entities),r=e.events===void 0?{}:Le.mapValues(e.events,i=>({...i,schema:i.schema(n)})),o=e.actions===void 0?{}:Le.mapValues(e.actions,i=>({...i,input:{...i.input,schema:i.input.schema(n)},output:{...i.output,schema:i.output.schema(n)}})),a=e.channels===void 0?{}:Le.mapValues(e.channels,i=>({...i,messages:Le.mapValues(i.messages,s=>({...s,schema:s.schema(n)}))}));this.events=r,this.actions=o,this.channels=a}name;version;title;description;icon;readme;attributes;entities;events;actions;channels;__advanced;_getEntityReference=e=>{let n={};for(let[r,o]of Object.entries(e)){let a=o.schema._def["x-zui"]?.title,i=o.schema._def.description,s=_y.ref(r);a&&s.title(a),i&&s.describe(i),n[r]=s}return n}};C();R();O();C();R();O();C();R();O();C();R();O();var jl=class{constructor(e){this.props=e;let n=Object.fromEntries(Object.entries(e.interfaces??{}).map(([r,o])=>[r,Object.fromEntries(Object.entries(o.definition.entities??{}).map(([a])=>[a,Y.ref(`interface:${r}/entities/${a}`)]))]));this.name=e.name,this.version=e.version,this.icon=e.icon,this.readme=e.readme,this.title=e.title,this.description=e.description,this.integrations=e.integrations,this.interfaces=e.interfaces,this.user=e.user,this.conversation=e.conversation,this.message=e.message,this.recurringEvents=e.recurringEvents,this.workflows=e.workflows,this.attributes=e.attributes,this.__advanced=e.__advanced,this.configuration=e.configuration?{...e.configuration,schema:typeof e.configuration.schema=="object"?e.configuration.schema:e.configuration.schema({entities:n})}:void 0,this.states=Object.fromEntries(Object.entries(e.states??{}).map(([r,o])=>[r,{...o,schema:typeof o.schema=="object"?o.schema:o.schema({entities:n})}])),this.events=Object.fromEntries(Object.entries(e.events??{}).map(([r,o])=>[r,{...o,schema:typeof o.schema=="object"?o.schema:o.schema({entities:n})}])),this.actions=Object.fromEntries(Object.entries(e.actions??{}).map(([r,o])=>[r,{...o,input:{...o.input,schema:typeof o.input.schema=="object"?o.input.schema:o.input.schema({entities:n})},output:{...o.output,schema:typeof o.output.schema=="object"?o.output.schema:o.output.schema({entities:n})}}])),this.tables=Object.fromEntries(Object.entries(e.tables??{}).map(([r,o])=>[r,{...o,schema:typeof o.schema=="object"?o.schema:o.schema({entities:n})}]))}name;version;title;description;icon;readme;attributes;integrations;interfaces;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;workflows;__advanced;dereferenceEntities({intersectWithUnknownRecord:e}={intersectWithUnknownRecord:!0}){let n=this._buildZuiReferenceMap(e);return{...this,configuration:this.configuration?{...this.configuration,schema:this._dereferenceZuiSchema(this.configuration.schema,n)}:void 0,events:this._dereferenceDefinitionSchemas(this.events,n),states:this._dereferenceDefinitionSchemas(this.states,n),tables:this._dereferenceDefinitionSchemas(this.tables,n),actions:this._dereferenceActionDefinitionSchemas(this.actions,n)}}_buildZuiReferenceMap(e){return Object.fromEntries(Object.entries(this.interfaces??{}).flatMap(([n,r])=>Object.entries(r.definition.entities??{}).map(([o,a])=>[`interface:${n}/entities/${o}`,e?a.schema.and(Y.record(Y.string(),Y.unknown())):a.schema])))}_dereferenceZuiSchema(e,n){return e.dereference(n)}_dereferenceDefinitionSchemas(e,n){return Object.fromEntries(Object.entries(e??{}).map(([r,o])=>[r,{...o,schema:this._dereferenceZuiSchema(o.schema,n)}]))}_dereferenceActionDefinitionSchemas(e,n){return Object.fromEntries(Object.entries(e??{}).map(([r,o])=>[r,{...o,input:{schema:this._dereferenceZuiSchema(o.input.schema,n)},output:{schema:this._dereferenceZuiSchema(o.output.schema,n)}}]))}};C();R();O();C();R();O();C();R();O();C();R();O();var Kl=":";var Ev=t=>{let[e,n]=t.split(Kl);return!e||!n?null:{namespace:e,eventName:n}},kv=t=>`${t.namespace}${Kl}${t.actionName}`,Iv=t=>`${t.namespace}${Kl}${t.eventName}`,Av=(t,e)=>{let n=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},r=n.name,o=n.actions[t.actionName]?.name??t.actionName;return{namespace:r,actionName:o}},Cv=(t,e)=>{let n=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},r=n.name,o=n.events[t.eventName]?.name??t.eventName;return{namespace:r,eventName:o}};var Ov=(t,e)=>new Proxy({},{get:(n,r)=>new Proxy({},{get:(o,a)=>i=>VI({client:t,interfaces:e.interfaces,integrationOrInterfaceName:r,methodName:a,input:i})})}),VI=async({client:t,interfaces:e,integrationOrInterfaceName:n,methodName:r,input:o})=>{let a=Av({namespace:n,actionName:r},e),i=kv(a);return(await t.callAction({type:i,input:o})).output};C();R();O();C();R();O();C();R();O();var Ll=class t{constructor(e){this._props=e}async emit(e){let{conversationId:n,userId:r,messageId:o}=this._props;await this._props.client.createEvent({type:this._props.eventName,payload:e,conversationId:n,userId:r,messageId:o})}async schedule(e,n){let{conversationId:r,userId:o,messageId:a}=this._props;await this._props.client.createEvent({type:this._props.eventName,payload:e,conversationId:r,userId:o,messageId:a,schedule:n})}withConversationId(e){return new t({...this._props,conversationId:e})}withUserId(e){return new t({...this._props,userId:e})}withMessageId(e){return new t({...this._props,messageId:e})}},Rv=(t,e)=>new Proxy({},{get:(n,r)=>{let o=e.alias!==void 0?`${e.alias}${pn}${r}`:r;return new Ll({client:t,eventName:o})}});C();R();O();C();R();O();C();R();O();var Fl=class{constructor(e,n,r){this._client=e;this._stateType=n;this._stateName=r}async get(e){return await this._client.getState({type:this._stateType,name:this._stateName,id:e}).then(n=>n.state.payload)}async set(e,n){await this._client.setState({type:this._stateType,name:this._stateName,id:e,payload:n})}async getOrSet(e,n){return await this._client.getOrSetState({type:this._stateType,name:this._stateName,id:e,payload:n}).then(r=>r.state.payload)}async delete(e){await this._client.setState({type:this._stateType,name:this._stateName,id:e,payload:null})}async patch(e,n){await this._client.patchState({type:this._stateType,name:this._stateName,id:e,payload:n})}},Mv=(t,e)=>new Proxy({},{get:(n,r)=>new Proxy({},{get:(o,a)=>{let i=e.alias!==void 0?`${e.alias}${pn}${a}`:a;return new Fl(t,r,i)}})});C();R();O();var Wl=class{constructor(e){this.props=e;this._actionHandlers=e.actions}_runtimeProps;_actionHandlers;_messageHandlers={};_eventHandlers={};_stateExpiredHandlers={};_hookHandlers={before_incoming_event:{},before_incoming_message:{},before_outgoing_message:{},before_outgoing_call_action:{},before_incoming_call_action:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{},after_incoming_call_action:{}};_workflowHandlers={started:{},continued:{},timed_out:{}};_registerOrder=0;initialize(e){return this._runtimeProps=e,this}get _runtime(){if(!this._runtimeProps)throw new Error("Plugin not correctly initialized. This is likely because you access your plugin config outside of an handler.");return this._runtimeProps}_getTools(e){let{configuration:n,interfaces:r,alias:o}=this._runtime,a=Ov(e,this._runtime),i=Mv(e,this._runtime),s=nn(e),l=Rv(e,this._runtime);return{configuration:n,interfaces:r,actions:a,states:i,alias:o,workflows:s,events:l}}get actionHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._actionHandlers[n];if(r)return ft.setName(o=>r({...o,...this._getTools(o.client)}),r.name)}})}get messageHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._messageHandlers[n]??[],o=this._messageHandlers["*"]??[];return ye.unique([...r,...o]).sort((i,s)=>i.order-s.order).map(({handler:i})=>ft.setName(s=>i({...s,message:s.message,...this._getTools(s.client)}),i.name))}})}get eventHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._eventHandlers[n]??[],o=Object.entries(this._eventHandlers).filter(([s])=>this._eventResolvesTo(s,n)).flatMap(([,s])=>s??[]),a=this._eventHandlers["*"]??[];return ye.unique([...r,...o,...a]).sort((s,l)=>s.order-l.order).map(({handler:s})=>ft.setName(l=>s({...l,event:l.event,...this._getTools(l.client)}),s.name))}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._stateExpiredHandlers[n]??[],o=this._stateExpiredHandlers["*"]??[];return ye.unique([...r,...o]).sort((i,s)=>i.order-s.order).map(({handler:i})=>ft.setName(s=>i({...s,state:s.state,...this._getTools(s.client)}),i.name))}})}get hookHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._hookHandlers[n];if(r)return new Proxy({},{get:(o,a)=>{a=this._stripAliasPrefix(a);let i=r[a]??[],s=Object.entries(r).filter(([p])=>this._eventResolvesTo(p,a)).flatMap(([,p])=>p??[]),l=r["*"]??[];return ye.unique([...i,...s,...l]).sort((p,y)=>p.order-y.order).map(({handler:p})=>ft.setName(y=>p({...y,data:y.data,...this._getTools(y.client)}),p.name))}})}})}get workflowHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._workflowHandlers[n];if(r)return new Proxy({},{get:(o,a)=>(r[a]?.sort((s,l)=>s.order-l.order)??[]).map(({handler:s})=>ft.setName(async l=>{let f=l.workflow;return await s({...l,workflow:It({...l,onWorkflowUpdate(p){f=p}}),...this._getTools(l.client)}),f},s.name))})}})}on={message:(e,n)=>{this._messageHandlers[e]=ye.safePush(this._messageHandlers[e],{handler:n,order:this._registerOrder++})},event:(e,n)=>{this._eventHandlers[e]=ye.safePush(this._eventHandlers[e],{handler:n,order:this._registerOrder++})},stateExpired:(e,n)=>{this._stateExpiredHandlers[e]=ye.safePush(this._stateExpiredHandlers[e],{handler:n,order:this._registerOrder++})},beforeIncomingEvent:(e,n)=>{this._hookHandlers.before_incoming_event[e]=ye.safePush(this._hookHandlers.before_incoming_event[e],{handler:n,order:this._registerOrder++})},beforeIncomingMessage:(e,n)=>{this._hookHandlers.before_incoming_message[e]=ye.safePush(this._hookHandlers.before_incoming_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingMessage:(e,n)=>{this._hookHandlers.before_outgoing_message[e]=ye.safePush(this._hookHandlers.before_outgoing_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingCallAction:(e,n)=>{this._hookHandlers.before_outgoing_call_action[e]=ye.safePush(this._hookHandlers.before_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},beforeIncomingCallAction:(e,n)=>{this._hookHandlers.before_incoming_call_action[e]=ye.safePush(this._hookHandlers.before_incoming_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingEvent:(e,n)=>{this._hookHandlers.after_incoming_event[e]=ye.safePush(this._hookHandlers.after_incoming_event[e],{handler:n,order:this._registerOrder++})},afterIncomingMessage:(e,n)=>{this._hookHandlers.after_incoming_message[e]=ye.safePush(this._hookHandlers.after_incoming_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingMessage:(e,n)=>{this._hookHandlers.after_outgoing_message[e]=ye.safePush(this._hookHandlers.after_outgoing_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingCallAction:(e,n)=>{this._hookHandlers.after_outgoing_call_action[e]=ye.safePush(this._hookHandlers.after_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingCallAction:(e,n)=>{this._hookHandlers.after_incoming_call_action[e]=ye.safePush(this._hookHandlers.after_incoming_call_action[e],{handler:n,order:this._registerOrder++})},workflowStart:(e,n)=>{this._workflowHandlers.started[e]=ye.safePush(this._workflowHandlers.started[e],{handler:n,order:this._registerOrder++})},workflowContinue:(e,n)=>{this._workflowHandlers.continued[e]=ye.safePush(this._workflowHandlers.continued[e],{handler:n,order:this._registerOrder++})},workflowTimeout:(e,n)=>{this._workflowHandlers.timed_out[e]=ye.safePush(this._workflowHandlers.timed_out[e],{handler:n,order:this._registerOrder++})}};_eventResolvesTo=(e,n)=>{let r=Ev(e);if(!r)return!1;let o=Cv(r,this._runtime.interfaces);return Iv(o)===n};_stripAliasPrefix=e=>{let{alias:n}=this._runtime;if(!n)return e;let r=`${n}#`;return e.startsWith(r)?e.slice(r.length):e}};C();R();O();C();R();O();C();R();O();C();R();O();C();R();O();C();R();O();export{Ox as BRAND,Zl as Bot,Hl as BotDefinition,oi as BotLogger,tn as BotSpecificClient,Gn as DIRTY,kx as EMPTY_PATH,pe as INVALID,Dl as Integration,Ys as IntegrationDefinition,ii as IntegrationLogger,ei as IntegrationSpecificClient,$l as InterfaceDefinition,OP as NEVER,gt as OK,Ct as ParseInputLazyPath,Tt as ParseStatus,Wl as Plugin,jl as PluginDefinition,nU as RuntimeError,he as Schema,XA as WELL_KNOWN_ATTRIBUTES,$r as ZodAny,jr as ZodArray,Za as ZodBigInt,$a as ZodBoolean,ja as ZodBranded,Ka as ZodCatch,La as ZodDate,mo as ZodDefault,cg as ZodDiscriminatedUnion,Sn as ZodEffects,rr as ZodEnum,Ft as ZodError,Xp as ZodFirstPartyTypeKind,dg as ZodFunction,Wa as ZodIntersection,G as ZodIssueCode,za as ZodLazy,qa as ZodLiteral,gg as ZodMap,mg as ZodNaN,Ga as ZodNativeEnum,Fr as ZodNever,Va as ZodNull,Yn as ZodNullable,Ja as ZodNumber,Qn as ZodObject,sn as ZodOptional,ne as ZodParsedType,Xa as ZodPipeline,vo as ZodPromise,To as ZodReadonly,xg as ZodRecord,Bg as ZodRef,he as ZodSchema,Sg as ZodSet,yt as ZodString,Hg as ZodSymbol,Sn as ZodTransformer,tr as ZodTuple,he as ZodType,_o as ZodUndefined,Ya as ZodUnion,Mr as ZodUnknown,jg as ZodVoid,te as addIssueToContext,Zx as agent,Fx as aimodel,tP as any,oP as array,Jx as bigint,Fg as boolean,bo as botIdHeader,Cy as botUserIdHeader,CP as coerce,wo as configurationHeader,My as configurationTypeHeader,Dx as conversation,ho as createZodEnum,kg as cuid2Regex,Eg as cuidRegex,lg as custom,Wx as datasource,Xx as date,uP as discriminatedUnion,qc as effect,Cg as emailRegex,_P as enum,ue as errorUtil,$x as event,hP as function,Ur as getErrorMap,an as getParsedType,Gx as instanceof,Oy as integrationIdHeader,Lx as intent,cP as intersection,Rg as ipv4Regex,Mg as ipv6Regex,va as isAborted,tU as isApiError,Si as isAsync,Ta as isDirty,Rx as isEmojiRegex,Zr as isValid,zx as knowledgebase,qx as late,vP as lazy,TP as literal,Bi as makeIssue,yP as map,Wr as mergeObjectSchemas,Ux as message,Ay as messages,Vx as nan,bP as nativeEnum,rP as never,eP as null,PP as nullable,Lg as number,aP as object,ha as objectUtil,AP as oboolean,IP as onumber,xo as operationHeader,xP as optional,kP as ostring,Rt as parseBody,EP as pipeline,SP as preprocess,me as processCreateParams,wP as promise,Ex as quotelessJson,gP as readonly,dP as record,pP as ref,Wo as serve,mP as set,eg as setErrorMap,sP as strictObject,Kg as string,Yx as symbol,jx as table,Kx as tablerow,qc as transformer,Wv as transforms,fP as tuple,Ny as typeHeader,Ig as ulidRegex,Qx as undefined,lP as union,nP as unknown,Hx as user,be as util,Ag as uuidRegex,Nx as variable,iP as void,Ry as webhookIdHeader,Y as z};
|
|
88
|
+
`)+" "+F[1]:F[0]+j+" "+D.join(", ")+" "+F[1]}xe.types=bI();function B(D){return Array.isArray(D)}xe.isArray=B;function v(D){return typeof D=="boolean"}xe.isBoolean=v;function S(D){return D===null}xe.isNull=S;function E(D){return D==null}xe.isNullOrUndefined=E;function H(D){return typeof D=="number"}xe.isNumber=H;function K(D){return typeof D=="string"}xe.isString=K;function ae(D){return typeof D=="symbol"}xe.isSymbol=ae;function ee(D){return D===void 0}xe.isUndefined=ee;function ge(D){return oe(D)&&Ve(D)==="[object RegExp]"}xe.isRegExp=ge,xe.types.isRegExp=ge;function oe(D){return typeof D=="object"&&D!==null}xe.isObject=oe;function re(D){return oe(D)&&Ve(D)==="[object Date]"}xe.isDate=re,xe.types.isDate=re;function Oe(D){return oe(D)&&(Ve(D)==="[object Error]"||D instanceof Error)}xe.isError=Oe,xe.types.isNativeError=Oe;function ze(D){return typeof D=="function"}xe.isFunction=ze;function tt(D){return D===null||typeof D=="boolean"||typeof D=="number"||typeof D=="string"||typeof D=="symbol"||typeof D>"u"}xe.isPrimitive=tt,xe.isBuffer=wI();function Ve(D){return Object.prototype.toString.call(D)}function Je(D){return D<10?"0"+D.toString(10):D.toString(10)}var ht=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ue(){var D=new Date,j=[Je(D.getHours()),Je(D.getMinutes()),Je(D.getSeconds())].join(":");return[D.getDate(),ht[D.getMonth()],j].join(" ")}xe.log=function(){console.log("%s - %s",Ue(),xe.format.apply(xe,arguments))},xe.inherits=Ht(),xe._extend=function(D,j){if(!j||!oe(j))return D;for(var F=Object.keys(j),de=F.length;de--;)D[F[de]]=j[F[de]];return D};function Pe(D,j){return Object.prototype.hasOwnProperty.call(D,j)}var Se=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;xe.promisify=function(j){if(typeof j!="function")throw new TypeError('The "original" argument must be of type Function');if(Se&&j[Se]){if(F=j[Se],typeof F!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(F,Se,{value:F,enumerable:!1,writable:!1,configurable:!0}),F}function F(){for(var de,Te,A=new Promise(function(Y,ie){de=Y,Te=ie}),k=[],$=0;$<arguments.length;$++)k.push(arguments[$]);k.push(function(Y,ie){Y?Te(Y):de(ie)});try{j.apply(this||ii,k)}catch(Y){Te(Y)}return A}return Object.setPrototypeOf(F,Object.getPrototypeOf(j)),Se&&Object.defineProperty(F,Se,{value:F,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(F,e(j))},xe.promisify.custom=Se;function fe(D,j){if(!D){var F=new Error("Promise was rejected with a falsy value");F.reason=D,D=F}return j(D)}function ve(D){if(typeof D!="function")throw new TypeError('The "original" argument must be of type Function');function j(){for(var F=[],de=0;de<arguments.length;de++)F.push(arguments[de]);var Te=F.pop();if(typeof Te!="function")throw new TypeError("The last argument must be of type Function");var A=this||ii,k=function(){return Te.apply(A,arguments)};D.apply(this||ii,F).then(function($){t.nextTick(k.bind(null,null,$))},function($){t.nextTick(fe.bind(null,$,k))})}return Object.setPrototypeOf(j,Object.getPrototypeOf(D)),Object.defineProperties(j,e(D)),j}return xe.callbackify=ve,xe}var ce=xI();ce.format;ce.deprecate;ce.debuglog;ce.inspect;ce.types;ce.isArray;ce.isBoolean;ce.isNull;ce.isNullOrUndefined;ce.isNumber;ce.isString;ce.isSymbol;ce.isUndefined;ce.isRegExp;ce.isObject;ce.isDate;ce.isError;ce.isFunction;ce.isPrimitive;ce.isBuffer;ce.log;ce.inherits;ce._extend;ce.promisify;ce.callbackify;var FR=ce._extend,WR=ce.callbackify,zR=ce.debuglog,qR=ce.deprecate,GR=ce.format,VR=ce.inherits,JR=ce.inspect,YR=ce.isArray,XR=ce.isBoolean,QR=ce.isBuffer,e0=ce.isDate,t0=ce.isError,n0=ce.isFunction,r0=ce.isNull,i0=ce.isNullOrUndefined,a0=ce.isNumber,o0=ce.isObject,s0=ce.isPrimitive,l0=ce.isRegExp,u0=ce.isString,c0=ce.isSymbol,f0=ce.isUndefined,d0=ce.log,p0=ce.promisify,g0=ce.types,y0=ce.TextEncoder=globalThis.TextEncoder,m0=ce.TextDecoder=globalThis.TextDecoder;var yr=class{defaultOptions;constructor(e){this.defaultOptions=e}info(...e){this._log("info",e)}debug(...e){this._log("debug",e)}warn(...e){this._log("warn",e)}error(...e){this._log("error",e)}_log(e,n){this._getConsoleMethod(e)(this._serializeMessage(n))}_serializeMessage(e){let n=ce.format(...e);return J.env.BP_LOG_FORMAT==="json"?this.getJsonMessage(n):n}getJsonMessage(e){return JSON.stringify({msg:e,options:this.defaultOptions})}_getConsoleMethod(e){switch(e){case"debug":return console.debug;case"warn":return console.warn;case"error":return console.error;default:return console.info}}};var ai=class t extends yr{constructor(e){super({visibleToBotOwners:!0,...e})}with(e){return new t({...this.defaultOptions,...e})}withUserId(e){return this.with({userId:e})}withConversationId(e){return this.with({conversationId:e})}withVisibleToBotOwners(e){return this.with({visibleToBotOwners:e})}forBot(){return this.withVisibleToBotOwners(!0)}getJsonMessage(e){return JSON.stringify({msg:e,visible_to_bot_owner:this.defaultOptions.visibleToBotOwners,options:this.defaultOptions})}};C();R();O();var SI=t=>["traceparent","tracestate","sentry-trace"].reduce((e,n)=>(t[n]&&(e[n]=t[n]),e),{}),kI=(t,e,n)=>{let[,r]=(e.headers.traceparent||"").split("-"),a=new BI({botId:t.botId,integrationId:t.integrationId,integrationAlias:t.integrationAlias,retry:Wa,headers:SI(e.headers)}),o=new ti(a),i=new ai({traceId:r});return{ctx:t,req:e,client:o,logger:i,instance:n}},II=async t=>{let{ctx:e}=t;switch(e.operation){case"webhook_received":return await CI(t);case"register":return await OI(t);case"unregister":return await RI(t);case"message_created":return await DI(t);case"action_triggered":return await HI(t);case"ping":return await AI(t);case"create_user":return await MI(t);case"create_conversation":return await NI(t);default:throw new EI(`Unknown operation ${e.operation}`)}},Pv=t=>async e=>{let n=jh(e.headers),r=kI(n,e,t),{logger:a}=r;try{let o;return o=await UI(r),o?{...o,status:o.status??200}:(o=await II(r),o?{...o,status:o.status??200}:{status:200})}catch(o){if(PI(o)){let s=o.type==="Runtime"?o:new xv(o.message,o);return a.forBot().error(s.message),{status:s.code,body:JSON.stringify(s.toJSON())}}console.error(o);let i=new xv("An unexpected error occurred in the integration. Bot owners: Check logs for more informations. Integration owners: throw a RuntimeError to return a custom error message instead.");return a.forBot().error(i.message),{status:i.code,body:JSON.stringify(i.toJSON())}}},AI=async t=>{},CI=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{let{req:o}=Mt(n);return a.webhook({client:t,ctx:e,req:o,logger:r})},OI=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.register)return;let{webhookUrl:o}=Mt(n);await a.register({client:t,ctx:e,webhookUrl:o,logger:r})},RI=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.unregister)return;let{webhookUrl:o}=Mt(n);await a.unregister({ctx:e,webhookUrl:o,client:t,logger:r})},MI=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.createUser)return;let{tags:o}=Mt(n);return await a.createUser({ctx:e,client:t,tags:o,logger:r})},NI=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.createConversation)return;let{channel:o,tags:i}=Mt(n);return await a.createConversation({ctx:e,client:t,channel:o,tags:i,logger:r})},DI=async({ctx:t,req:e,client:n,logger:r,instance:a})=>{let{conversation:o,user:i,type:s,payload:l,message:f}=Mt(e),p=a.channels[o.channel];if(!p)throw new Error(`Channel ${o.channel} not found`);let y=p.messages[s];if(!y)throw new Error(`Message of type ${s} not found in channel ${o.channel}`);await y({ctx:t,conversation:o,message:f,user:i,type:s,client:n,payload:l,ack:async({tags:h})=>{await n.updateMessage({id:f.id,tags:h})},logger:r})},HI=async({req:t,ctx:e,client:n,logger:r,instance:a})=>{let{input:o,type:i}=Mt(t);if(!i)throw new Error("Missing action type");let s=a.actions[i];if(!s)throw new Error(`Action ${i} not found`);let l=new za,p={output:await s({ctx:e,input:o,client:n,type:i,logger:r,metadata:l}),meta:l.toJSON()};return{body:JSON.stringify(p)}},UI=async({instance:t,client:e,ctx:n,logger:r,req:a})=>{let o=t.unknownOperationHandler;if(o)return await o({client:e,ctx:n,logger:r,req:a})};var Hl=class{constructor(e){this.props=e;this.actions=e.actions,this.channels=e.channels,this.register=e.register,this.unregister=e.unregister,this.createUser=e.createUser,this.createConversation=e.createConversation,this.webhook=e.handler,this.unknownOperationHandler=e.__advanced?.unknownOperationHandler}actions;channels;register;unregister;createUser;createConversation;webhook;unknownOperationHandler;handler=Pv(this);start=e=>Ka(this.handler,e)};C();R();O();C();R();O();C();R();O();C();R();O();C();R();O();var Ul=class{constructor(e){this.props=e;this.integrations=e.integrations,this.plugins=e.plugins,this.user=e.user,this.conversation=e.conversation,this.message=e.message,this.states=e.states,this.configuration=e.configuration,this.events=e.events,this.recurringEvents=e.recurringEvents,this.actions=e.actions,this.tables=e.tables,this.workflows=e.workflows,this.attributes=e.attributes,this.__advanced=e.__advanced,this.withPlugins={user:e.user,conversation:e.conversation,message:e.message,states:e.states,events:e.events,recurringEvents:e.recurringEvents,actions:e.actions,tables:e.tables,workflows:e.workflows}}integrations;plugins;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;workflows;attributes;__advanced;withPlugins;addIntegration(e,n){let r=this;r.integrations||(r.integrations={});let a=n?.alias??e.name.replace("/","-");if(r.integrations[a])throw new Error(`Another integration with alias "${a}" is already installed in the bot`);return r.integrations[a]={...e,alias:a,enabled:n?.enabled,configurationType:n?.configurationType,configuration:n?.configuration,disabledChannels:n?.disabledChannels},this}addPlugin(e,n){let r=this;r.plugins||(r.plugins={});let a=n.alias??e.name.replace("/","-");if(r.plugins[a])throw new Error(`Another plugin with alias "${a}" is already installed in the bot`);return r.plugins[a]={...e,alias:a,configuration:n.configuration,interfaces:n.interfaces},r.withPlugins.user=this._mergeUser(r.withPlugins.user,e.definition.user),r.withPlugins.conversation=this._mergeConversation(r.withPlugins.conversation,e.definition.conversation),r.withPlugins.message=this._mergeMessage(r.withPlugins.message,e.definition.message),r.withPlugins.recurringEvents=this._mergeRecurringEvents(r.withPlugins.recurringEvents,e.definition.recurringEvents),r.withPlugins.tables=this._mergeTables(r.withPlugins.tables,e.definition.tables),r.withPlugins.workflows=this._mergeWorkflows(r.withPlugins.workflows,e.definition.workflows),r.withPlugins.states=this._mergeStates(r.withPlugins.states,this._prefixKeysWithPluginAlias(e.definition.states,a)),r.withPlugins.events=this._mergeEvents(r.withPlugins.events,this._prefixKeysWithPluginAlias(e.definition.events,a)),r.withPlugins.actions=this._mergeActions(r.withPlugins.actions,this._prefixKeysWithPluginAlias(e.definition.actions,a)),this}_mergeUser=(e,n)=>({tags:{...e?.tags,...n?.tags}});_mergeConversation=(e,n)=>({tags:{...e?.tags,...n?.tags}});_mergeMessage=(e,n)=>({tags:{...e?.tags,...n?.tags}});_mergeStates=(e,n)=>({...e,...n});_mergeEvents=(e,n)=>({...e,...n});_mergeRecurringEvents=(e,n)=>({...e,...n});_mergeActions=(e,n)=>({...e,...n});_mergeTables=(e,n)=>({...e,...n});_mergeWorkflows=(e,n)=>({...e,...n});_prefixKeysWithPluginAlias=(e,n)=>Le.mapKeys(e??{},r=>`${n}${gn}${r}`);dereferencePluginEntities(){let e=this._buildZuiReferenceMap();return{...this,withPlugins:{...this.withPlugins,events:this._dereferenceDefinitionSchemas(this.withPlugins.events,e),states:this._dereferenceDefinitionSchemas(this.withPlugins.states,e),tables:this._dereferenceDefinitionSchemas(this.withPlugins.tables,e),actions:this._dereferenceActionDefinitionSchemas(this.withPlugins.actions,e)},plugins:Object.fromEntries(Object.entries(this.plugins??{}).map(([n,r])=>[n,{...r,definition:{...r.definition,configuration:this._dereferenceDefinitionSchema(r.definition.configuration,e),events:this._dereferenceDefinitionSchemas(r.definition.events,e),states:this._dereferenceDefinitionSchemas(r.definition.states,e),tables:this._dereferenceDefinitionSchemas(r.definition.tables,e),actions:this._dereferenceActionDefinitionSchemas(r.definition.actions,e)}}]))}}_buildZuiReferenceMap(){let e={},n=Object.entries(this.plugins??{});for(let[r,a]of n){let o=Object.entries(a.interfaces??{});for(let[i,s]of o){let l=this.integrations?.[s.name];if(!l)throw new Error(`Interface with alias "${i}" of plugin with alias "${r}" references integration "${s.name}" which is not installed`);let f=Object.entries(s.entities??{});for(let[p,{name:y}]of f){let g=l.definition.entities?.[y]?.schema;if(!g)throw new Error(`Interface entity "${y}" does not exist in integration "${l.name}"`);e[`interface:${i}/entities/${p}`]=g}}}return e}_dereferenceZuiSchema(e,n){return e.dereference(n)}_dereferenceDefinitionSchemas(e,n){return Object.fromEntries(Object.entries(e??{}).map(([r,a])=>[r,this._dereferenceDefinitionSchema(a,n)]))}_dereferenceDefinitionSchema(e,n){return e&&{...e,schema:this._dereferenceZuiSchema(e.schema,n)}}_dereferenceActionDefinitionSchemas(e,n){return Object.fromEntries(Object.entries(e??{}).map(([r,a])=>[r,{...a,input:{schema:this._dereferenceZuiSchema(a.input.schema,n)},output:{schema:this._dereferenceZuiSchema(a.output.schema,n)}}]))}};C();R();O();C();R();O();import{isApiError as FI,Client as WI,RuntimeError as Sv}from"@botpress/client";C();R();O();var oi=class t extends yr{constructor(e){super({...e})}with(e){return new t({...this.defaultOptions,...e})}withUserId(e){return this.with({userId:e})}withConversationId(e){return this.with({conversationId:e})}withWorkflowId(e){return this.with({workflowId:e})}withEventId(e){return this.with({eventId:e})}withMessageId(e){return this.with({messageId:e})}};C();R();O();C();R();O();var nn=class{constructor(e,n={before:{},after:{}}){this._client=e;this._hooks=n}get _inner(){return this._client}getConversation=(e=>this._run("getConversation",e));listConversations=(e=>this._run("listConversations",e));updateConversation=(e=>this._run("updateConversation",e));deleteConversation=(e=>this._run("deleteConversation",e));listParticipants=(e=>this._run("listParticipants",e));addParticipant=(e=>this._run("addParticipant",e));getParticipant=(e=>this._run("getParticipant",e));removeParticipant=(e=>this._run("removeParticipant",e));createEvent=(e=>this._run("createEvent",e));getEvent=(e=>this._run("getEvent",e));listEvents=(e=>this._run("listEvents",e));createMessage=(e=>this._run("createMessage",e));getOrCreateMessage=(e=>this._run("getOrCreateMessage",e));getMessage=(e=>this._run("getMessage",e));updateMessage=(e=>this._run("updateMessage",e));listMessages=(e=>this._run("listMessages",e));deleteMessage=(e=>this._run("deleteMessage",e));getUser=(e=>this._run("getUser",e));listUsers=(e=>this._run("listUsers",e));updateUser=(e=>this._run("updateUser",e));deleteUser=(e=>this._run("deleteUser",e));getState=(e=>this._run("getState",e));setState=(e=>this._run("setState",e));getOrSetState=(e=>this._run("getOrSetState",e));patchState=(e=>this._run("patchState",e));callAction=(e=>this._run("callAction",e));uploadFile=(e=>this._run("uploadFile",e));upsertFile=(e=>this._run("upsertFile",e));deleteFile=(e=>this._run("deleteFile",e));listFiles=(e=>this._run("listFiles",e));getFile=(e=>this._run("getFile",e));updateFileMetadata=(e=>this._run("updateFileMetadata",e));searchFiles=(e=>this._run("searchFiles",e));trackAnalytics=(e=>this._run("trackAnalytics",e));getTableRow=(e=>this._run("getTableRow",e));createTableRows=(e=>this._run("createTableRows",e));findTableRows=(e=>this._run("findTableRows",e));deleteTableRows=(e=>this._run("deleteTableRows",e));updateTableRows=(e=>this._run("updateTableRows",e));upsertTableRows=(e=>this._run("upsertTableRows",e));createWorkflow=(e=>this._run("createWorkflow",e));getWorkflow=(e=>this._run("getWorkflow",e));updateWorkflow=(e=>this._run("updateWorkflow",e));deleteWorkflow=(e=>this._run("deleteWorkflow",e));listWorkflows=(e=>this._run("listWorkflows",e));createConversation=e=>this._client.createConversation(e);getOrCreateConversation=e=>this._client.getOrCreateConversation(e);createUser=e=>this._client.createUser(e);getOrCreateUser=e=>this._client.getOrCreateUser(e);_run=async(e,n)=>{let r=this._hooks.before[e];r&&(n=await r(n));let a=await this._client[e](n),o=this._hooks.after[e];return o&&(a=await o(a,n)),a}};C();R();O();var ZI=X.enum(["event_received","register","unregister","ping","action_triggered"]),Bv=t=>({botId:t[qa]||It("Missing bot id header"),operation:ZI.parse(t[Va]),type:t[$h]||It("Missing type header"),configuration:JSON.parse(q.from(t[Ga]||It("Missing configuration header"),"base64").toString("utf-8"))});C();R();O();var dt={status:200};C();R();O();C();R();O();var Zl=t=>{switch(t){case"workflow_continued":return"continued";case"workflow_started":return"started";case"workflow_timedout":return"timed_out";default:throw new Error(`Unsupported workflow update type: ${t}`)}};var $I=["child_workflow_deleted","child_workflow_finished","workflow_timedout","workflow_started","workflow_continued"],Ev=async(t,e)=>{if(t.ctx.type!=="workflow_update"||!$I.includes(e.payload.type))throw new Error("Unexpected event type");let n={...t,logger:jI(t,e)};if(!e.payload.workflow.name)return n.logger.warn("Received workflow update event without a workflow name. Assuming this workflow was not defined by the bot.",e.payload.workflow),dt;switch(e.payload.type){case"child_workflow_deleted":case"child_workflow_finished":n.logger.info(`Received child workflow event "${e.payload.type}", but child workflows are not yet supported`);break;case"workflow_timedout":case"workflow_started":case"workflow_continued":return await KI(n,e);default:e.payload.type}return dt},jI=(t,e)=>t.logger.with({eventId:e.id,workflowId:e.payload.workflow.id,conversationId:e.payload.conversation?.id,userId:e.payload.user?.id}),KI=async(t,e)=>{let n=Zl(e.payload.type),r=t.self.workflowHandlers[n]?.[e.payload.workflow.name];if(!r||r.length===0)return t.logger.warn(`No ${n} handler found for workflow "${e.payload.workflow.name}"`),dt;let{updatedWorkflow:a}=await LI(t,e);return a.status==="pending"&&t.logger.warn(`Workflow "${e.payload.workflow.name}" is still in pending status after processing "${n}" event. This may indicate that the workflow was not properly acknowledged or terminated by the handler. `),dt},LI=async(t,e)=>{let n=Zl(e.payload.type),r=t.self.workflowHandlers[n]?.[e.payload.workflow.name],a=structuredClone(e.payload.workflow);for(let o of r??[])a=await o({...t,event:e,conversation:e.payload.conversation,user:e.payload.user,workflow:a});return{updatedWorkflow:a}};C();R();O();var kv=t=>async e=>{let n=Bv(e.headers),r=new oi,a=new WI({botId:n.botId,retry:Wa}),o=new nn(a,{before:{createMessage:async s=>{let l=t.hookHandlers.before_outgoing_message[s.type]??[];for(let f of l){let p=new nn(a);s=(await f({client:p,ctx:n,logger:r.with({conversationId:s.conversationId,userId:s.userId}),data:s}))?.data??s}return s},callAction:async s=>{let l=t.hookHandlers.before_outgoing_call_action[s.type]??[];for(let f of l){let p=new nn(a);s=(await f({client:p,ctx:n,logger:r,data:s}))?.data??s}return s}},after:{createMessage:async s=>{let l=t.hookHandlers.after_outgoing_message[s.message.type]??[];for(let f of l){let p=new nn(a);s=(await f({client:p,ctx:n,logger:r.with({messageId:s.message.id,conversationId:s.message.conversationId,userId:s.message.userId}),data:s}))?.data??s}return s},callAction:async(s,l)=>{let{type:f}=l,p=t.hookHandlers.after_outgoing_call_action[f]??[];for(let y of p){let g=new nn(a);s=(await y({client:g,ctx:n,logger:r,data:{type:f,...s}}))?.data??s}return s}}}),i={req:e,ctx:n,logger:r,client:o,self:t};try{switch(n.operation){case"action_triggered":return await JI(i);case"event_received":return await VI(i);case"register":return await qI(i);case"unregister":return await GI(i);case"ping":return await zI(i);default:throw new Error(`Unknown operation ${n.operation}`)}}catch(s){let l=s instanceof Error?s:new Error(String(s));if(FI(l)){let p=l.type==="Runtime"?l:new Sv(l.message,l);return r.error(p.message),{status:p.code,body:JSON.stringify(p.toJSON())}}let f=new Sv("An unexpected error occurred in the bot.",l);return r.error(f.message,l),{status:f.code,body:JSON.stringify(f.toJSON())}}},zI=async t=>dt,qI=async t=>dt,GI=async t=>dt,VI=async t=>{let{ctx:e,logger:n,req:r,client:a,self:o}=t,i={client:a,ctx:e,logger:n},s=Mt(r);if(i.logger=i.logger.with({eventId:s.event.id,messageId:s.event.messageId,conversationId:s.event.conversationId,userId:s.event.userId}),e.type==="workflow_update")return await Ev(t,s.event);if(e.type==="message_created"){let h=s.event,w=h.payload.message;i.logger=i.logger.with({messageId:w.id,conversationId:w.conversationId,userId:w.userId});let P=o.hookHandlers.before_incoming_message[w.type]??[];for(let E of P){let H=await E({...i,data:w});if(w=H?.data??w,H?.stop)return dt}let B={...i,user:h.payload.user,conversation:h.payload.conversation,message:w,event:h},v=o.messageHandlers[w.type]??[];for(let E of v)await E(B);let S=o.hookHandlers.after_incoming_message[w.type]??[];for(let E of S){let H=await E({...i,data:w});if(w=H?.data??w,H?.stop)return dt}return dt}if(e.type==="state_expired"){let w=s.event.payload.state,P={...i,state:w},B=o.stateExpiredHandlers[w.name]??[];for(let v of B)await v(P);return dt}let l=s.event,f=o.hookHandlers.before_incoming_event[l.type]??[];for(let h of f){let w=await h({...i,data:l});if(l=w?.data??l,w?.stop)return dt}let p={...i,event:l},y=o.eventHandlers[l.type]??[];for(let h of y)await h(p);let g=o.hookHandlers.after_incoming_event[l.type]??[];for(let h of g){let w=await h({...i,data:l});if(l=w?.data??l,w?.stop)return dt}return dt},JI=async({ctx:t,logger:e,req:n,client:r,self:a})=>{let{input:o,type:i}=Mt(n);if(!i)throw new Error("Missing action type");let s=a.hookHandlers.before_incoming_call_action[i]??[];for(let g of s){let h=await g({ctx:t,logger:e,client:r,data:{type:i,input:o}});o=h?.data?.input??o,i=h?.data?.type??i}let l=a.actionHandlers[i];if(!l)throw new Error(`Action ${i} not found`);let f=await l({ctx:t,logger:e,input:o,client:r,type:i}),p=a.hookHandlers.after_incoming_call_action[i]??[];for(let g of p){let h=await g({ctx:t,logger:e,client:r,data:{type:i,output:f}});i=h?.data?.type??i,f=h?.data?.output??f}return{status:200,body:JSON.stringify({output:f})}};C();R();O();C();R();O();var rn=t=>new Proxy({},{get:(e,n)=>({listInstances:{all:r=>yn({workflowName:n,client:t,input:r}),running:r=>yn({workflowName:n,client:t,input:r,statuses:["in_progress"]}),scheduled:r=>yn({workflowName:n,client:t,input:r,statuses:["pending","listening"]}),allFinished:r=>yn({workflowName:n,client:t,input:r,statuses:["completed","cancelled","failed","timedout"]}),cancelled:r=>yn({workflowName:n,client:t,input:r,statuses:["cancelled"]}),failed:r=>yn({workflowName:n,client:t,input:r,statuses:["failed"]}),succeeded:r=>yn({workflowName:n,client:t,input:r,statuses:["completed"]}),timedOut:r=>yn({workflowName:n,client:t,input:r,statuses:["timedout"]})},startNewInstance:async r=>{let{workflow:a}=await t.createWorkflow({name:n,status:"pending",...r});return{workflow:At({client:t,workflow:a})}}})}),yn=async t=>{let e=await t.client.listWorkflows({name:t.workflowName,statuses:t.statuses,...t.input});return{...e,workflows:e.workflows.map(n=>At({client:t.client,workflow:n}))}},At=t=>{let e=!1;return{...t.workflow,async update(n){let{workflow:r}=await t.client.updateWorkflow({id:t.workflow.id,...n});return await t.onWorkflowUpdate?.(r),{workflow:At({...t,workflow:r})}},async acknowledgeStartOfProcessing(){if(!t.event||t.workflow.status!=="pending"||e)return{workflow:At(t)};let{workflow:n}=await t.client.updateWorkflow({id:t.workflow.id,status:"in_progress",eventId:t.event.id});return e=!0,await t.onWorkflowUpdate?.(n),{workflow:At({...t,workflow:n})}},async setFailed({failureReason:n}){let{workflow:r}=await t.client.updateWorkflow({id:t.workflow.id,status:"failed",failureReason:n});return await t.onWorkflowUpdate?.(r),{workflow:At({...t,workflow:r})}},async setCompleted({output:n}={}){let{workflow:r}=await t.client.updateWorkflow({id:t.workflow.id,status:"completed",output:n});return await t.onWorkflowUpdate?.(r),{workflow:At({...t,workflow:r})}},async cancel(){let{workflow:n}=await t.client.updateWorkflow({id:t.workflow.id,status:"cancelled"});return await t.onWorkflowUpdate?.(n),{workflow:At({...t,workflow:n})}}}};C();R();O();var $l=class{constructor(e){this.props=e;this._actionHandlers=e.actions,this._plugins=e.plugins}_actionHandlers;_messageHandlers={};_eventHandlers={};_stateExpiredHandlers={};_hookHandlers={before_incoming_event:{},before_incoming_message:{},before_outgoing_message:{},before_outgoing_call_action:{},before_incoming_call_action:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{},after_incoming_call_action:{}};_workflowHandlers={started:{},continued:{},timed_out:{}};_plugins={};_registerOrder=0;get actionHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._actionHandlers[n];if(r)return r;for(let[a,o]of Object.entries(this._plugins)){let[i,s]=n.split(gn);if(!(i!==a||!s)&&(r=o.actionHandlers[s],r))return ft.setName(l=>r({...l,workflows:rn(l.client)}),r.name)}}})}get messageHandlers(){return new Proxy({},{get:(e,n)=>{let r=Object.values(this._plugins).flatMap(s=>s.messageHandlers[n]??[]),a=this._messageHandlers[n]??[],o=this._messageHandlers["*"]??[],i=[...a,...o].sort((s,l)=>s.order-l.order).map(({handler:s})=>s);return ye.unique([...r,...i]).map(s=>ft.setName(l=>s({...l,workflows:rn(l.client)}),s.name))}})}get eventHandlers(){return new Proxy({},{get:(e,n)=>{let r=Object.values(this._plugins).flatMap(s=>s.eventHandlers[n]??[]),a=this._eventHandlers[n]??[],o=this._eventHandlers["*"]??[],i=[...a,...o].sort((s,l)=>s.order-l.order).map(({handler:s})=>s);return ye.unique([...r,...i]).map(s=>ft.setName(l=>s({...l,workflows:rn(l.client)}),s.name))}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,n)=>{let r=Object.values(this._plugins).flatMap(s=>s.stateExpiredHandlers[n]??[]),a=this._stateExpiredHandlers[n]??[],o=this._stateExpiredHandlers["*"]??[],i=[...a,...o].sort((s,l)=>s.order-l.order).map(({handler:s})=>s);return ye.unique([...r,...i]).map(s=>ft.setName(l=>s({...l,workflows:rn(l.client)}),s.name))}})}get hookHandlers(){return new Proxy({},{get:(e,n)=>{if(this._hookHandlers[n])return new Proxy({},{get:(a,o)=>{let i=Object.values(this._plugins).flatMap(y=>y.hookHandlers[n]?.[o]??[]),s=this._hookHandlers[n]??{},l=s[o]??[],f=s["*"]??[],p=[...l,...f].sort((y,g)=>y.order-g.order).map(({handler:y})=>y);return ye.unique([...i,...p]).map(y=>ft.setName(g=>y({...g,workflows:rn(g.client)}),y.name))}})}})}get workflowHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._workflowHandlers[n];if(r)return new Proxy({},{get:(a,o)=>{let i=r[o]?.sort((l,f)=>l.order-f.order).map(({handler:l})=>l)??[],s=Object.values(this._plugins).flatMap(l=>l.workflowHandlers[n]?.[o]??[]);return ye.unique([...i,...s]).map(l=>ft.setName(async f=>{let p=f.workflow;return await l({...f,workflow:At({...f,onWorkflowUpdate(y){p=y}}),workflows:rn(f.client)}),p},l.name))}})}})}on={message:(e,n)=>{this._messageHandlers[e]=ye.safePush(this._messageHandlers[e],{handler:n,order:this._registerOrder++})},event:(e,n)=>{this._eventHandlers[e]=ye.safePush(this._eventHandlers[e],{handler:n,order:this._registerOrder++})},stateExpired:(e,n)=>{this._stateExpiredHandlers[e]=ye.safePush(this._stateExpiredHandlers[e],{handler:n,order:this._registerOrder++})},beforeIncomingEvent:(e,n)=>{this._hookHandlers.before_incoming_event[e]=ye.safePush(this._hookHandlers.before_incoming_event[e],{handler:n,order:this._registerOrder++})},beforeIncomingMessage:(e,n)=>{this._hookHandlers.before_incoming_message[e]=ye.safePush(this._hookHandlers.before_incoming_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingMessage:(e,n)=>{this._hookHandlers.before_outgoing_message[e]=ye.safePush(this._hookHandlers.before_outgoing_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingCallAction:(e,n)=>{this._hookHandlers.before_outgoing_call_action[e]=ye.safePush(this._hookHandlers.before_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},beforeIncomingCallAction:(e,n)=>{this._hookHandlers.before_incoming_call_action[e]=ye.safePush(this._hookHandlers.before_incoming_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingEvent:(e,n)=>{this._hookHandlers.after_incoming_event[e]=ye.safePush(this._hookHandlers.after_incoming_event[e],{handler:n,order:this._registerOrder++})},afterIncomingMessage:(e,n)=>{this._hookHandlers.after_incoming_message[e]=ye.safePush(this._hookHandlers.after_incoming_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingMessage:(e,n)=>{this._hookHandlers.after_outgoing_message[e]=ye.safePush(this._hookHandlers.after_outgoing_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingCallAction:(e,n)=>{this._hookHandlers.after_outgoing_call_action[e]=ye.safePush(this._hookHandlers.after_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingCallAction:(e,n)=>{this._hookHandlers.after_incoming_call_action[e]=ye.safePush(this._hookHandlers.after_incoming_call_action[e],{handler:n,order:this._registerOrder++})},workflowStart:(e,n)=>{this._workflowHandlers.started[e]=ye.safePush(this._workflowHandlers.started[e],{handler:n,order:this._registerOrder++})},workflowContinue:(e,n)=>{this._workflowHandlers.continued[e]=ye.safePush(this._workflowHandlers.continued[e],{handler:n,order:this._registerOrder++})},workflowTimeout:(e,n)=>{this._workflowHandlers.timed_out[e]=ye.safePush(this._workflowHandlers.timed_out[e],{handler:n,order:this._registerOrder++})}};handler=kv(this);start=e=>Ka(this.handler,e)};C();R();O();C();R();O();C();R();O();C();R();O();C();R();O();var jl=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.icon=e.icon,this.title=e.title,this.description=e.description,this.readme=e.readme,this.entities=e.entities??{},this.attributes=e.attributes,this.__advanced=e.__advanced;let n=this._getEntityReference(this.entities),r=e.events===void 0?{}:Le.mapValues(e.events,i=>({...i,schema:i.schema(n)})),a=e.actions===void 0?{}:Le.mapValues(e.actions,i=>({...i,input:{...i.input,schema:i.input.schema(n)},output:{...i.output,schema:i.output.schema(n)}})),o=e.channels===void 0?{}:Le.mapValues(e.channels,i=>({...i,messages:Le.mapValues(i.messages,s=>({...s,schema:s.schema(n)}))}));this.events=r,this.actions=a,this.channels=o}name;version;title;description;icon;readme;attributes;entities;events;actions;channels;__advanced;_getEntityReference=e=>{let n={};for(let[r,a]of Object.entries(e)){let o=a.schema._def["x-zui"]?.title,i=a.schema._def.description,s=by.ref(r);o&&s.title(o),i&&s.describe(i),n[r]=s}return n}};C();R();O();C();R();O();C();R();O();C();R();O();var Kl=class{constructor(e){this.props=e;let n=Object.fromEntries(Object.entries(e.interfaces??{}).map(([r,a])=>[r,Object.fromEntries(Object.entries(a.definition.entities??{}).map(([o])=>[o,X.ref(`interface:${r}/entities/${o}`)]))]));this.name=e.name,this.version=e.version,this.icon=e.icon,this.readme=e.readme,this.title=e.title,this.description=e.description,this.integrations=e.integrations,this.interfaces=e.interfaces,this.user=e.user,this.conversation=e.conversation,this.message=e.message,this.recurringEvents=e.recurringEvents,this.workflows=e.workflows,this.attributes=e.attributes,this.__advanced=e.__advanced,this.configuration=e.configuration?{...e.configuration,schema:typeof e.configuration.schema=="object"?e.configuration.schema:e.configuration.schema({entities:n})}:void 0,this.states=Object.fromEntries(Object.entries(e.states??{}).map(([r,a])=>[r,{...a,schema:typeof a.schema=="object"?a.schema:a.schema({entities:n})}])),this.events=Object.fromEntries(Object.entries(e.events??{}).map(([r,a])=>[r,{...a,schema:typeof a.schema=="object"?a.schema:a.schema({entities:n})}])),this.actions=Object.fromEntries(Object.entries(e.actions??{}).map(([r,a])=>[r,{...a,input:{...a.input,schema:typeof a.input.schema=="object"?a.input.schema:a.input.schema({entities:n})},output:{...a.output,schema:typeof a.output.schema=="object"?a.output.schema:a.output.schema({entities:n})}}])),this.tables=Object.fromEntries(Object.entries(e.tables??{}).map(([r,a])=>[r,{...a,schema:typeof a.schema=="object"?a.schema:a.schema({entities:n})}]))}name;version;title;description;icon;readme;attributes;integrations;interfaces;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;workflows;__advanced;dereferenceEntities({intersectWithUnknownRecord:e}={intersectWithUnknownRecord:!0}){let n=this._buildZuiReferenceMap(e);return{...this,configuration:this.configuration?{...this.configuration,schema:this._dereferenceZuiSchema(this.configuration.schema,n)}:void 0,events:this._dereferenceDefinitionSchemas(this.events,n),states:this._dereferenceDefinitionSchemas(this.states,n),tables:this._dereferenceDefinitionSchemas(this.tables,n),actions:this._dereferenceActionDefinitionSchemas(this.actions,n)}}_buildZuiReferenceMap(e){return Object.fromEntries(Object.entries(this.interfaces??{}).flatMap(([n,r])=>Object.entries(r.definition.entities??{}).map(([a,o])=>[`interface:${n}/entities/${a}`,e?o.schema.and(X.record(X.string(),X.unknown())):o.schema])))}_dereferenceZuiSchema(e,n){return e.dereference(n)}_dereferenceDefinitionSchemas(e,n){return Object.fromEntries(Object.entries(e??{}).map(([r,a])=>[r,{...a,schema:this._dereferenceZuiSchema(a.schema,n)}]))}_dereferenceActionDefinitionSchemas(e,n){return Object.fromEntries(Object.entries(e??{}).map(([r,a])=>[r,{...a,input:{schema:this._dereferenceZuiSchema(a.input.schema,n)},output:{schema:this._dereferenceZuiSchema(a.output.schema,n)}}]))}};C();R();O();C();R();O();C();R();O();C();R();O();var Ll=":";var Iv=t=>{let[e,n]=t.split(Ll);return!e||!n?null:{namespace:e,eventName:n}},Av=t=>`${t.namespace}${Ll}${t.actionName}`,Cv=t=>`${t.namespace}${Ll}${t.eventName}`,Ov=(t,e)=>{let n=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},r=n.name,a=n.actions[t.actionName]?.name??t.actionName;return{namespace:r,actionName:a}},Rv=(t,e)=>{let n=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},r=n.name,a=n.events[t.eventName]?.name??t.eventName;return{namespace:r,eventName:a}};var Mv=(t,e)=>new Proxy({},{get:(n,r)=>new Proxy({},{get:(a,o)=>i=>YI({client:t,interfaces:e.interfaces,integrationOrInterfaceName:r,methodName:o,input:i})})}),YI=async({client:t,interfaces:e,integrationOrInterfaceName:n,methodName:r,input:a})=>{let o=Ov({namespace:n,actionName:r},e),i=Av(o);return(await t.callAction({type:i,input:a})).output};C();R();O();C();R();O();C();R();O();var Fl=class t{constructor(e){this._props=e}async emit(e){let{conversationId:n,userId:r,messageId:a}=this._props;await this._props.client.createEvent({type:this._props.eventName,payload:e,conversationId:n,userId:r,messageId:a})}async schedule(e,n){let{conversationId:r,userId:a,messageId:o}=this._props;await this._props.client.createEvent({type:this._props.eventName,payload:e,conversationId:r,userId:a,messageId:o,schedule:n})}withConversationId(e){return new t({...this._props,conversationId:e})}withUserId(e){return new t({...this._props,userId:e})}withMessageId(e){return new t({...this._props,messageId:e})}},Nv=(t,e)=>new Proxy({},{get:(n,r)=>{let a=e.alias!==void 0?`${e.alias}${gn}${r}`:r;return new Fl({client:t,eventName:a})}});C();R();O();C();R();O();C();R();O();var Wl=class{constructor(e,n,r){this._client=e;this._stateType=n;this._stateName=r}async get(e){return await this._client.getState({type:this._stateType,name:this._stateName,id:e}).then(n=>n.state.payload)}async set(e,n){await this._client.setState({type:this._stateType,name:this._stateName,id:e,payload:n})}async getOrSet(e,n){return await this._client.getOrSetState({type:this._stateType,name:this._stateName,id:e,payload:n}).then(r=>r.state.payload)}async delete(e){await this._client.setState({type:this._stateType,name:this._stateName,id:e,payload:null})}async patch(e,n){await this._client.patchState({type:this._stateType,name:this._stateName,id:e,payload:n})}},Dv=(t,e)=>new Proxy({},{get:(n,r)=>new Proxy({},{get:(a,o)=>{let i=e.alias!==void 0?`${e.alias}${gn}${o}`:o;return new Wl(t,r,i)}})});C();R();O();var zl=class{constructor(e){this.props=e;this._actionHandlers=e.actions}_runtimeProps;_actionHandlers;_messageHandlers={};_eventHandlers={};_stateExpiredHandlers={};_hookHandlers={before_incoming_event:{},before_incoming_message:{},before_outgoing_message:{},before_outgoing_call_action:{},before_incoming_call_action:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{},after_incoming_call_action:{}};_workflowHandlers={started:{},continued:{},timed_out:{}};_registerOrder=0;initialize(e){return this._runtimeProps=e,this}get _runtime(){if(!this._runtimeProps)throw new Error("Plugin not correctly initialized. This is likely because you access your plugin config outside of an handler.");return this._runtimeProps}_getTools(e){let{configuration:n,interfaces:r,alias:a}=this._runtime,o=Mv(e,this._runtime),i=Dv(e,this._runtime),s=rn(e),l=Nv(e,this._runtime);return{configuration:n,interfaces:r,actions:o,states:i,alias:a,workflows:s,events:l}}get actionHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._actionHandlers[n];if(r)return ft.setName(a=>r({...a,...this._getTools(a.client)}),r.name)}})}get messageHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._messageHandlers[n]??[],a=this._messageHandlers["*"]??[];return ye.unique([...r,...a]).sort((i,s)=>i.order-s.order).map(({handler:i})=>ft.setName(s=>i({...s,message:s.message,...this._getTools(s.client)}),i.name))}})}get eventHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._eventHandlers[n]??[],a=Object.entries(this._eventHandlers).filter(([s])=>this._eventResolvesTo(s,n)).flatMap(([,s])=>s??[]),o=this._eventHandlers["*"]??[];return ye.unique([...r,...a,...o]).sort((s,l)=>s.order-l.order).map(({handler:s})=>ft.setName(l=>s({...l,event:l.event,...this._getTools(l.client)}),s.name))}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._stateExpiredHandlers[n]??[],a=this._stateExpiredHandlers["*"]??[];return ye.unique([...r,...a]).sort((i,s)=>i.order-s.order).map(({handler:i})=>ft.setName(s=>i({...s,state:s.state,...this._getTools(s.client)}),i.name))}})}get hookHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._hookHandlers[n];if(r)return new Proxy({},{get:(a,o)=>{o=this._stripAliasPrefix(o);let i=r[o]??[],s=Object.entries(r).filter(([p])=>this._eventResolvesTo(p,o)).flatMap(([,p])=>p??[]),l=r["*"]??[];return ye.unique([...i,...s,...l]).sort((p,y)=>p.order-y.order).map(({handler:p})=>ft.setName(y=>p({...y,data:y.data,...this._getTools(y.client)}),p.name))}})}})}get workflowHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._workflowHandlers[n];if(r)return new Proxy({},{get:(a,o)=>(r[o]?.sort((s,l)=>s.order-l.order)??[]).map(({handler:s})=>ft.setName(async l=>{let f=l.workflow;return await s({...l,workflow:At({...l,onWorkflowUpdate(p){f=p}}),...this._getTools(l.client)}),f},s.name))})}})}on={message:(e,n)=>{this._messageHandlers[e]=ye.safePush(this._messageHandlers[e],{handler:n,order:this._registerOrder++})},event:(e,n)=>{this._eventHandlers[e]=ye.safePush(this._eventHandlers[e],{handler:n,order:this._registerOrder++})},stateExpired:(e,n)=>{this._stateExpiredHandlers[e]=ye.safePush(this._stateExpiredHandlers[e],{handler:n,order:this._registerOrder++})},beforeIncomingEvent:(e,n)=>{this._hookHandlers.before_incoming_event[e]=ye.safePush(this._hookHandlers.before_incoming_event[e],{handler:n,order:this._registerOrder++})},beforeIncomingMessage:(e,n)=>{this._hookHandlers.before_incoming_message[e]=ye.safePush(this._hookHandlers.before_incoming_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingMessage:(e,n)=>{this._hookHandlers.before_outgoing_message[e]=ye.safePush(this._hookHandlers.before_outgoing_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingCallAction:(e,n)=>{this._hookHandlers.before_outgoing_call_action[e]=ye.safePush(this._hookHandlers.before_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},beforeIncomingCallAction:(e,n)=>{this._hookHandlers.before_incoming_call_action[e]=ye.safePush(this._hookHandlers.before_incoming_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingEvent:(e,n)=>{this._hookHandlers.after_incoming_event[e]=ye.safePush(this._hookHandlers.after_incoming_event[e],{handler:n,order:this._registerOrder++})},afterIncomingMessage:(e,n)=>{this._hookHandlers.after_incoming_message[e]=ye.safePush(this._hookHandlers.after_incoming_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingMessage:(e,n)=>{this._hookHandlers.after_outgoing_message[e]=ye.safePush(this._hookHandlers.after_outgoing_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingCallAction:(e,n)=>{this._hookHandlers.after_outgoing_call_action[e]=ye.safePush(this._hookHandlers.after_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingCallAction:(e,n)=>{this._hookHandlers.after_incoming_call_action[e]=ye.safePush(this._hookHandlers.after_incoming_call_action[e],{handler:n,order:this._registerOrder++})},workflowStart:(e,n)=>{this._workflowHandlers.started[e]=ye.safePush(this._workflowHandlers.started[e],{handler:n,order:this._registerOrder++})},workflowContinue:(e,n)=>{this._workflowHandlers.continued[e]=ye.safePush(this._workflowHandlers.continued[e],{handler:n,order:this._registerOrder++})},workflowTimeout:(e,n)=>{this._workflowHandlers.timed_out[e]=ye.safePush(this._workflowHandlers.timed_out[e],{handler:n,order:this._registerOrder++})}};_eventResolvesTo=(e,n)=>{let r=Iv(e);if(!r)return!1;let a=Rv(r,this._runtime.interfaces);return Cv(a)===n};_stripAliasPrefix=e=>{let{alias:n}=this._runtime;if(!n)return e;let r=`${n}#`;return e.startsWith(r)?e.slice(r.length):e}};C();R();O();C();R();O();C();R();O();C();R();O();C();R();O();C();R();O();export{Mx as BRAND,$l as Bot,Ul as BotDefinition,oi as BotLogger,nn as BotSpecificClient,Vn as DIRTY,Ax as EMPTY_PATH,pe as INVALID,Hl as Integration,Qs as IntegrationDefinition,ai as IntegrationLogger,ti as IntegrationSpecificClient,jl as InterfaceDefinition,MP as NEVER,gt as OK,Ot as ParseInputLazyPath,Tt as ParseStatus,zl as Plugin,Kl as PluginDefinition,cU as RuntimeError,he as Schema,QA as WELL_KNOWN_ATTRIBUTES,jr as ZodAny,Kr as ZodArray,$o as ZodBigInt,jo as ZodBoolean,Ko as ZodBranded,Lo as ZodCatch,Fo as ZodDate,ma as ZodDefault,fg as ZodDiscriminatedUnion,Sn as ZodEffects,ir as ZodEnum,Wt as ZodError,Xp as ZodFirstPartyTypeKind,pg as ZodFunction,zo as ZodIntersection,G as ZodIssueCode,qo as ZodLazy,Go as ZodLiteral,yg as ZodMap,hg as ZodNaN,Vo as ZodNativeEnum,Wr as ZodNever,Jo as ZodNull,Qn as ZodNullable,Yo as ZodNumber,er as ZodObject,ln as ZodOptional,ne as ZodParsedType,Xo as ZodPipeline,va as ZodPromise,Ta as ZodReadonly,Pg as ZodRecord,Eg as ZodRef,he as ZodSchema,Sg as ZodSet,yt as ZodString,Ug as ZodSymbol,Sn as ZodTransformer,nr as ZodTuple,he as ZodType,_a as ZodUndefined,Qo as ZodUnion,Nr as ZodUnknown,Kg as ZodVoid,te as addIssueToContext,jx as agent,zx as aimodel,rP as any,sP as array,Xx as bigint,Wg as boolean,RP as coerce,Ux as conversation,ha as createZodEnum,Ig as cuid2Regex,kg as cuidRegex,ug as custom,qx as datasource,Qx as date,fP as discriminatedUnion,Gc as effect,Og as emailRegex,wP as enum,ue as errorUtil,Kx as event,TP as function,Zr as getErrorMap,sn as getParsedType,Jx as instanceof,Wx as intent,dP as intersection,Mg as ipv4Regex,Ng as ipv6Regex,To as isAborted,uU as isApiError,Si as isAsync,_o as isDirty,Nx as isEmojiRegex,$r as isValid,Gx as knowledgebase,Vx as late,_P as lazy,bP as literal,Ei as makeIssue,hP as map,zr as mergeObjectSchemas,$x as message,Cy as messages,Yx as nan,xP as nativeEnum,aP as never,nP as null,EP as nullable,Fg as number,lP as object,vo as objectUtil,OP as oboolean,CP as onumber,BP as optional,AP as ostring,Mt as parseBody,IP as pipeline,kP as preprocess,me as processCreateParams,PP as promise,Ix as quotelessJson,mP as readonly,gP as record,yP as ref,Ka as serve,vP as set,tg as setErrorMap,uP as strictObject,Lg as string,eP as symbol,Lx as table,Fx as tablerow,Gc as transformer,qv as transforms,pP as tuple,Ag as ulidRegex,tP as undefined,cP as union,iP as unknown,Zx as user,be as util,Cg as uuidRegex,Hx as variable,oP as void,X as z};
|
|
89
89
|
/*! Bundled license information:
|
|
90
90
|
|
|
91
91
|
@jspm/core/nodelibs/browser/chunk-DtuTasat.js:
|