@botpress/sdk 3.3.2 → 3.5.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/dist/index.mjs CHANGED
@@ -1,34 +1,34 @@
1
- var Ev=Object.create;var Jr=Object.defineProperty;var Bv=Object.getOwnPropertyDescriptor;var Pv=Object.getOwnPropertyNames;var Iv=Object.getPrototypeOf,Sv=Object.prototype.hasOwnProperty;var it=(t,e)=>()=>(t&&(e=t(t=0)),e);var $l=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Dn=(t,e)=>{for(var n in e)Jr(t,n,{get:e[n],enumerable:!0})},Zl=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Pv(e))!Sv.call(t,a)&&a!==n&&Jr(t,a,{get:()=>e[a],enumerable:!(r=Bv(e,a))||r.enumerable});return t};var mr=(t,e,n)=>(n=t!=null?Ev(Iv(t)):{},Zl(e||!t||!t.__esModule?Jr(n,"default",{value:t,enumerable:!0}):n,t)),Av=t=>Zl(Jr({},"__esModule",{value:!0}),t);var R=it(()=>{});var Y={};Dn(Y,{_debugEnd:()=>Cu,_debugProcess:()=>Au,_events:()=>zu,_eventsCount:()=>Gu,_exiting:()=>cu,_fatalExceptions:()=>Bu,_getActiveHandles:()=>gu,_getActiveRequests:()=>pu,_kill:()=>mu,_linkedBinding:()=>lu,_maxListeners:()=>qu,_preload_modules:()=>Lu,_rawDebug:()=>ou,_startProfilerIdleNotifier:()=>Ru,_stopProfilerIdleNotifier:()=>ku,_tickCallback:()=>Su,abort:()=>Nu,addListener:()=>Vu,allowedNodeEnvironmentFlags:()=>xu,arch:()=>zl,argv:()=>Wl,argv0:()=>Zu,assert:()=>wu,binding:()=>eu,browser:()=>au,chdir:()=>ru,config:()=>fu,cpuUsage:()=>Qr,cwd:()=>nu,debugPort:()=>$u,default:()=>rc,dlopen:()=>du,domain:()=>uu,emit:()=>Qu,emitWarning:()=>Ql,env:()=>Vl,execArgv:()=>Jl,execPath:()=>ju,exit:()=>bu,features:()=>Eu,hasUncaughtExceptionCaptureCallback:()=>Iu,hrtime:()=>Xr,kill:()=>Tu,listeners:()=>nc,memoryUsage:()=>vu,moduleLoadList:()=>su,nextTick:()=>Fl,off:()=>Ju,on:()=>Nt,once:()=>Wu,openStdin:()=>_u,pid:()=>Hu,platform:()=>Gl,ppid:()=>Uu,prependListener:()=>ec,prependOnceListener:()=>tc,reallyExit:()=>yu,release:()=>iu,removeAllListeners:()=>Xu,removeListener:()=>Yu,resourceUsage:()=>hu,setSourceMapsEnabled:()=>Fu,setUncaughtExceptionCaptureCallback:()=>Pu,stderr:()=>Mu,stdin:()=>Du,stdout:()=>Ou,title:()=>ql,umask:()=>tu,uptime:()=>Ku,version:()=>Yl,versions:()=>Xl});function Ka(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function Cv(){!Nn||!ln||(Nn=!1,ln.length?Dt=ln.concat(Dt):Yr=-1,Dt.length&&Ll())}function Ll(){if(!Nn){var t=setTimeout(Cv,0);Nn=!0;for(var e=Dt.length;e;){for(ln=Dt,Dt=[];++Yr<e;)ln&&ln[Yr].run();Yr=-1,e=Dt.length}ln=null,Nn=!1,clearTimeout(t)}}function Fl(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];Dt.push(new Kl(t,e)),Dt.length===1&&!Nn&&setTimeout(Ll,0)}function Kl(t,e){this.fun=t,this.array=e}function at(){}function lu(t){Ka("_linkedBinding")}function du(t){Ka("dlopen")}function pu(){return[]}function gu(){return[]}function wu(t,e){if(!t)throw new Error(e||"assertion error")}function Iu(){return!1}function Ku(){return Qt.now()/1e3}function Xr(t){var e=Math.floor((Date.now()-Qt.now())*.001),n=Qt.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+=Fa)),[r,a]}function Nt(){return rc}function nc(t){return[]}var Dt,Nn,ln,Yr,ql,zl,Gl,Vl,Wl,Jl,Yl,Xl,Ql,eu,tu,nu,ru,iu,au,ou,su,uu,cu,fu,yu,mu,Qr,hu,vu,Tu,bu,_u,xu,Eu,Bu,Pu,Su,Au,Cu,Ru,ku,Ou,Mu,Du,Nu,Hu,Uu,ju,$u,Zu,Lu,Fu,Qt,La,Fa,qu,zu,Gu,Vu,Wu,Ju,Yu,Xu,Qu,ec,tc,rc,ic=it(()=>{R();O();k();Dt=[],Nn=!1,Yr=-1;Kl.prototype.run=function(){this.fun.apply(null,this.array)};ql="browser",zl="x64",Gl="browser",Vl={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},Wl=["/usr/bin/node"],Jl=[],Yl="v16.8.0",Xl={},Ql=function(t,e){console.warn((e?e+": ":"")+t)},eu=function(t){Ka("binding")},tu=function(t){return 0},nu=function(){return"/"},ru=function(t){},iu={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};au=!0,ou=at,su=[];uu={},cu=!1,fu={};yu=at,mu=at,Qr=function(){return{}},hu=Qr,vu=Qr,Tu=at,bu=at,_u=at,xu={};Eu={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Bu=at,Pu=at;Su=at,Au=at,Cu=at,Ru=at,ku=at,Ou=void 0,Mu=void 0,Du=void 0,Nu=at,Hu=2,Uu=1,ju="/bin/usr/node",$u=9229,Zu="node",Lu=[],Fu=at,Qt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Qt.now===void 0&&(La=Date.now(),Qt.timing&&Qt.timing.navigationStart&&(La=Qt.timing.navigationStart),Qt.now=()=>Date.now()-La);Fa=1e9;Xr.bigint=function(t){var e=Xr(t);return typeof BigInt>"u"?e[0]*Fa+e[1]:BigInt(e[0]*Fa)+BigInt(e[1])};qu=10,zu={},Gu=0;Vu=Nt,Wu=Nt,Ju=Nt,Yu=Nt,Xu=Nt,Qu=at,ec=Nt,tc=Nt;rc={version:Yl,versions:Xl,arch:zl,platform:Gl,browser:au,release:iu,_rawDebug:ou,moduleLoadList:su,binding:eu,_linkedBinding:lu,_events:zu,_eventsCount:Gu,_maxListeners:qu,on:Nt,addListener:Vu,once:Wu,off:Ju,removeListener:Yu,removeAllListeners:Xu,emit:Qu,prependListener:ec,prependOnceListener:tc,listeners:nc,domain:uu,_exiting:cu,config:fu,dlopen:du,uptime:Ku,_getActiveRequests:pu,_getActiveHandles:gu,reallyExit:yu,_kill:mu,cpuUsage:Qr,resourceUsage:hu,memoryUsage:vu,kill:Tu,exit:bu,openStdin:_u,allowedNodeEnvironmentFlags:xu,assert:wu,features:Eu,_fatalExceptions:Bu,setUncaughtExceptionCaptureCallback:Pu,hasUncaughtExceptionCaptureCallback:Iu,emitWarning:Ql,nextTick:Fl,_tickCallback:Su,_debugProcess:Au,_debugEnd:Cu,_startProfilerIdleNotifier:Ru,_stopProfilerIdleNotifier:ku,stdout:Ou,stdin:Du,stderr:Mu,abort:Nu,umask:tu,chdir:ru,cwd:nu,env:Vl,title:ql,argv:Wl,execArgv:Jl,pid:Hu,ppid:Uu,execPath:ju,debugPort:$u,hrtime:Xr,argv0:Zu,_preload_modules:Lu,setSourceMapsEnabled:Fu}});var k=it(()=>{ic()});function Rv(){if(ac)return hr;ac=!0,hr.byteLength=s,hr.toByteArray=f,hr.fromByteArray=p;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["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63;function i(m){var _=m.length;if(_%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var E=m.indexOf("=");E===-1&&(E=_);var B=E===_?0:4-E%4;return[E,B]}function s(m){var _=i(m),E=_[0],B=_[1];return(E+B)*3/4-B}function l(m,_,E){return(_+E)*3/4-E}function f(m){var _,E=i(m),B=E[0],v=E[1],I=new n(l(m,B,v)),P=0,D=v>0?B-4:B,$;for($=0;$<D;$+=4)_=e[m.charCodeAt($)]<<18|e[m.charCodeAt($+1)]<<12|e[m.charCodeAt($+2)]<<6|e[m.charCodeAt($+3)],I[P++]=_>>16&255,I[P++]=_>>8&255,I[P++]=_&255;return v===2&&(_=e[m.charCodeAt($)]<<2|e[m.charCodeAt($+1)]>>4,I[P++]=_&255),v===1&&(_=e[m.charCodeAt($)]<<10|e[m.charCodeAt($+1)]<<4|e[m.charCodeAt($+2)]>>2,I[P++]=_>>8&255,I[P++]=_&255),I}function g(m){return t[m>>18&63]+t[m>>12&63]+t[m>>6&63]+t[m&63]}function y(m,_,E){for(var B,v=[],I=_;I<E;I+=3)B=(m[I]<<16&16711680)+(m[I+1]<<8&65280)+(m[I+2]&255),v.push(g(B));return v.join("")}function p(m){for(var _,E=m.length,B=E%3,v=[],I=16383,P=0,D=E-B;P<D;P+=I)v.push(y(m,P,P+I>D?D:P+I));return B===1?(_=m[E-1],v.push(t[_>>2]+t[_<<4&63]+"==")):B===2&&(_=(m[E-2]<<8)+m[E-1],v.push(t[_>>10]+t[_>>4&63]+t[_<<2&63]+"=")),v.join("")}return hr}function kv(){if(oc)return ei;oc=!0;return ei.read=function(t,e,n,r,a){var o,i,s=a*8-r-1,l=(1<<s)-1,f=l>>1,g=-7,y=n?a-1:0,p=n?-1:1,m=t[e+y];for(y+=p,o=m&(1<<-g)-1,m>>=-g,g+=s;g>0;o=o*256+t[e+y],y+=p,g-=8);for(i=o&(1<<-g)-1,o>>=-g,g+=r;g>0;i=i*256+t[e+y],y+=p,g-=8);if(o===0)o=1-f;else{if(o===l)return i?NaN:(m?-1:1)*(1/0);i=i+Math.pow(2,r),o=o-f}return(m?-1:1)*i*Math.pow(2,o-r)},ei.write=function(t,e,n,r,a,o){var i,s,l,f=o*8-a-1,g=(1<<f)-1,y=g>>1,p=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:o-1,_=r?1:-1,E=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=g):(i=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+y>=1?e+=p/l:e+=p*Math.pow(2,1-y),e*l>=2&&(i++,l/=2),i+y>=g?(s=0,i=g):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+m]=s&255,m+=_,s/=256,a-=8);for(i=i<<a|s,f+=a;f>0;t[n+m]=i&255,m+=_,i/=256,f-=8);t[n+m-_]|=E*128},ei}function At(){if(sc)return un;sc=!0;let t=Rv(),e=kv(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;un.Buffer=i,un.SlowBuffer=v,un.INSPECT_MAX_BYTES=50;let r=2147483647;un.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 h=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(h,u),h.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(h){if(h>r)throw new RangeError('The value "'+h+'" is invalid for option "size"');let u=new Uint8Array(h);return Object.setPrototypeOf(u,i.prototype),u}function i(h,u,c){if(typeof h=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(h)}return s(h,u,c)}i.poolSize=8192;function s(h,u,c){if(typeof h=="string")return y(h,u);if(ArrayBuffer.isView(h))return m(h);if(h==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof h);if(ht(h,ArrayBuffer)||h&&ht(h.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ht(h,SharedArrayBuffer)||h&&ht(h.buffer,SharedArrayBuffer)))return _(h,u,c);if(typeof h=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let T=h.valueOf&&h.valueOf();if(T!=null&&T!==h)return i.from(T,u,c);let A=E(h);if(A)return A;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof h[Symbol.toPrimitive]=="function")return i.from(h[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 h)}i.from=function(h,u,c){return s(h,u,c)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function l(h){if(typeof h!="number")throw new TypeError('"size" argument must be of type number');if(h<0)throw new RangeError('The value "'+h+'" is invalid for option "size"')}function f(h,u,c){return l(h),h<=0?o(h):u!==void 0?typeof c=="string"?o(h).fill(u,c):o(h).fill(u):o(h)}i.alloc=function(h,u,c){return f(h,u,c)};function g(h){return l(h),o(h<0?0:B(h)|0)}i.allocUnsafe=function(h){return g(h)},i.allocUnsafeSlow=function(h){return g(h)};function y(h,u){if((typeof u!="string"||u==="")&&(u="utf8"),!i.isEncoding(u))throw new TypeError("Unknown encoding: "+u);let c=I(h,u)|0,T=o(c),A=T.write(h,u);return A!==c&&(T=T.slice(0,A)),T}function p(h){let u=h.length<0?0:B(h.length)|0,c=o(u);for(let T=0;T<u;T+=1)c[T]=h[T]&255;return c}function m(h){if(ht(h,Uint8Array)){let u=new Uint8Array(h);return _(u.buffer,u.byteOffset,u.byteLength)}return p(h)}function _(h,u,c){if(u<0||h.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(h.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(h):c===void 0?T=new Uint8Array(h,u):T=new Uint8Array(h,u,c),Object.setPrototypeOf(T,i.prototype),T}function E(h){if(i.isBuffer(h)){let u=B(h.length)|0,c=o(u);return c.length===0||h.copy(c,0,0,u),c}if(h.length!==void 0)return typeof h.length!="number"||gr(h.length)?o(0):p(h);if(h.type==="Buffer"&&Array.isArray(h.data))return p(h.data)}function B(h){if(h>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return h|0}function v(h){return+h!=h&&(h=0),i.alloc(+h)}i.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==i.prototype},i.compare=function(u,c){if(ht(u,Uint8Array)&&(u=i.from(u,u.offset,u.byteLength)),ht(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,A=c.length;for(let N=0,K=Math.min(T,A);N<K;++N)if(u[N]!==c[N]){T=u[N],A=c[N];break}return T<A?-1:A<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 A=i.allocUnsafe(c),N=0;for(T=0;T<u.length;++T){let K=u[T];if(ht(K,Uint8Array))N+K.length>A.length?(i.isBuffer(K)||(K=i.from(K)),K.copy(A,N)):Uint8Array.prototype.set.call(A,K,N);else if(i.isBuffer(K))K.copy(A,N);else throw new TypeError('"list" argument must be an Array of Buffers');N+=K.length}return A};function I(h,u){if(i.isBuffer(h))return h.length;if(ArrayBuffer.isView(h)||ht(h,ArrayBuffer))return h.byteLength;if(typeof h!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof h);let c=h.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&c===0)return 0;let A=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return He(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c*2;case"hex":return c>>>1;case"base64":return Et(h).length;default:if(A)return T?-1:He(h).length;u=(""+u).toLowerCase(),A=!0}}i.byteLength=I;function P(h,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(h||(h="utf8");;)switch(h){case"hex":return me(this,u,c);case"utf8":case"utf-8":return $e(this,u,c);case"ascii":return We(this,u,c);case"latin1":case"binary":return Ae(this,u,c);case"base64":return Se(this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pe(this,u,c);default:if(T)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),T=!0}}i.prototype._isBuffer=!0;function D(h,u,c){let T=h[u];h[u]=h[c],h[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)D(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)D(this,c,c+3),D(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)D(this,c,c+7),D(this,c+1,c+6),D(this,c+2,c+5),D(this,c+3,c+4);return this},i.prototype.toString=function(){let u=this.length;return u===0?"":arguments.length===0?$e(this,0,u):P.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=un.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,A,N){if(ht(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),A===void 0&&(A=0),N===void 0&&(N=this.length),c<0||T>u.length||A<0||N>this.length)throw new RangeError("out of range index");if(A>=N&&c>=T)return 0;if(A>=N)return-1;if(c>=T)return 1;if(c>>>=0,T>>>=0,A>>>=0,N>>>=0,this===u)return 0;let K=N-A,we=T-c,Je=Math.min(K,we),Fe=this.slice(A,N),Ye=u.slice(c,T);for(let Ze=0;Ze<Je;++Ze)if(Fe[Ze]!==Ye[Ze]){K=Fe[Ze],we=Ye[Ze];break}return K<we?-1:we<K?1:0};function $(h,u,c,T,A){if(h.length===0)return-1;if(typeof c=="string"?(T=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,gr(c)&&(c=A?0:h.length-1),c<0&&(c=h.length+c),c>=h.length){if(A)return-1;c=h.length-1}else if(c<0)if(A)c=0;else return-1;if(typeof u=="string"&&(u=i.from(u,T)),i.isBuffer(u))return u.length===0?-1:ae(h,u,c,T,A);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?A?Uint8Array.prototype.indexOf.call(h,u,c):Uint8Array.prototype.lastIndexOf.call(h,u,c):ae(h,[u],c,T,A);throw new TypeError("val must be string, number or Buffer")}function ae(h,u,c,T,A){let N=1,K=h.length,we=u.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(h.length<2||u.length<2)return-1;N=2,K/=2,we/=2,c/=2}function Je(Ye,Ze){return N===1?Ye[Ze]:Ye.readUInt16BE(Ze*N)}let Fe;if(A){let Ye=-1;for(Fe=c;Fe<K;Fe++)if(Je(h,Fe)===Je(u,Ye===-1?0:Fe-Ye)){if(Ye===-1&&(Ye=Fe),Fe-Ye+1===we)return Ye*N}else Ye!==-1&&(Fe-=Fe-Ye),Ye=-1}else for(c+we>K&&(c=K-we),Fe=c;Fe>=0;Fe--){let Ye=!0;for(let Ze=0;Ze<we;Ze++)if(Je(h,Fe+Ze)!==Je(u,Ze)){Ye=!1;break}if(Ye)return Fe}return-1}i.prototype.includes=function(u,c,T){return this.indexOf(u,c,T)!==-1},i.prototype.indexOf=function(u,c,T){return $(this,u,c,T,!0)},i.prototype.lastIndexOf=function(u,c,T){return $(this,u,c,T,!1)};function X(h,u,c,T){c=Number(c)||0;let A=h.length-c;T?(T=Number(T),T>A&&(T=A)):T=A;let N=u.length;T>N/2&&(T=N/2);let K;for(K=0;K<T;++K){let we=parseInt(u.substr(K*2,2),16);if(gr(we))return K;h[c+K]=we}return K}function ue(h,u,c,T){return St(He(u,h.length-c),h,c,T)}function ee(h,u,c,T){return St(Te(u),h,c,T)}function ie(h,u,c,T){return St(Et(u),h,c,T)}function Oe(h,u,c,T){return St(U(u,h.length-c),h,c,T)}i.prototype.write=function(u,c,T,A){if(c===void 0)A="utf8",T=this.length,c=0;else if(T===void 0&&typeof c=="string")A=c,T=this.length,c=0;else if(isFinite(c))c=c>>>0,isFinite(T)?(T=T>>>0,A===void 0&&(A="utf8")):(A=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let N=this.length-c;if((T===void 0||T>N)&&(T=N),u.length>0&&(T<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");A||(A="utf8");let K=!1;for(;;)switch(A){case"hex":return X(this,u,c,T);case"utf8":case"utf-8":return ue(this,u,c,T);case"ascii":case"latin1":case"binary":return ee(this,u,c,T);case"base64":return ie(this,u,c,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Oe(this,u,c,T);default:if(K)throw new TypeError("Unknown encoding: "+A);A=(""+A).toLowerCase(),K=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Se(h,u,c){return u===0&&c===h.length?t.fromByteArray(h):t.fromByteArray(h.slice(u,c))}function $e(h,u,c){c=Math.min(h.length,c);let T=[],A=u;for(;A<c;){let N=h[A],K=null,we=N>239?4:N>223?3:N>191?2:1;if(A+we<=c){let Je,Fe,Ye,Ze;switch(we){case 1:N<128&&(K=N);break;case 2:Je=h[A+1],(Je&192)===128&&(Ze=(N&31)<<6|Je&63,Ze>127&&(K=Ze));break;case 3:Je=h[A+1],Fe=h[A+2],(Je&192)===128&&(Fe&192)===128&&(Ze=(N&15)<<12|(Je&63)<<6|Fe&63,Ze>2047&&(Ze<55296||Ze>57343)&&(K=Ze));break;case 4:Je=h[A+1],Fe=h[A+2],Ye=h[A+3],(Je&192)===128&&(Fe&192)===128&&(Ye&192)===128&&(Ze=(N&15)<<18|(Je&63)<<12|(Fe&63)<<6|Ye&63,Ze>65535&&Ze<1114112&&(K=Ze))}}K===null?(K=65533,we=1):K>65535&&(K-=65536,T.push(K>>>10&1023|55296),K=56320|K&1023),T.push(K),A+=we}return Me(T)}let Ne=4096;function Me(h){let u=h.length;if(u<=Ne)return String.fromCharCode.apply(String,h);let c="",T=0;for(;T<u;)c+=String.fromCharCode.apply(String,h.slice(T,T+=Ne));return c}function We(h,u,c){let T="";c=Math.min(h.length,c);for(let A=u;A<c;++A)T+=String.fromCharCode(h[A]&127);return T}function Ae(h,u,c){let T="";c=Math.min(h.length,c);for(let A=u;A<c;++A)T+=String.fromCharCode(h[A]);return T}function me(h,u,c){let T=h.length;(!u||u<0)&&(u=0),(!c||c<0||c>T)&&(c=T);let A="";for(let N=u;N<c;++N)A+=Wr[h[N]];return A}function Pe(h,u,c){let T=h.slice(u,c),A="";for(let N=0;N<T.length-1;N+=2)A+=String.fromCharCode(T[N]+T[N+1]*256);return A}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 A=this.subarray(u,c);return Object.setPrototypeOf(A,i.prototype),A};function ce(h,u,c){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+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||ce(u,c,this.length);let A=this[u],N=1,K=0;for(;++K<c&&(N*=256);)A+=this[u+K]*N;return A},i.prototype.readUintBE=i.prototype.readUIntBE=function(u,c,T){u=u>>>0,c=c>>>0,T||ce(u,c,this.length);let A=this[u+--c],N=1;for(;c>0&&(N*=256);)A+=this[u+--c]*N;return A},i.prototype.readUint8=i.prototype.readUInt8=function(u,c){return u=u>>>0,c||ce(u,1,this.length),this[u]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(u,c){return u=u>>>0,c||ce(u,2,this.length),this[u]|this[u+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(u,c){return u=u>>>0,c||ce(u,2,this.length),this[u]<<8|this[u+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(u,c){return u=u>>>0,c||ce(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||ce(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},i.prototype.readBigUInt64LE=_t(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 A=c+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,N=this[++u]+this[++u]*2**8+this[++u]*2**16+T*2**24;return BigInt(A)+(BigInt(N)<<BigInt(32))}),i.prototype.readBigUInt64BE=_t(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 A=c*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],N=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+T;return(BigInt(A)<<BigInt(32))+BigInt(N)}),i.prototype.readIntLE=function(u,c,T){u=u>>>0,c=c>>>0,T||ce(u,c,this.length);let A=this[u],N=1,K=0;for(;++K<c&&(N*=256);)A+=this[u+K]*N;return N*=128,A>=N&&(A-=Math.pow(2,8*c)),A},i.prototype.readIntBE=function(u,c,T){u=u>>>0,c=c>>>0,T||ce(u,c,this.length);let A=c,N=1,K=this[u+--A];for(;A>0&&(N*=256);)K+=this[u+--A]*N;return N*=128,K>=N&&(K-=Math.pow(2,8*c)),K},i.prototype.readInt8=function(u,c){return u=u>>>0,c||ce(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},i.prototype.readInt16LE=function(u,c){u=u>>>0,c||ce(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||ce(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||ce(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||ce(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},i.prototype.readBigInt64LE=_t(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 A=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(T<<24);return(BigInt(A)<<BigInt(32))+BigInt(c+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),i.prototype.readBigInt64BE=_t(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 A=(c<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(A)<<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||ce(u,4,this.length),e.read(this,u,!0,23,4)},i.prototype.readFloatBE=function(u,c){return u=u>>>0,c||ce(u,4,this.length),e.read(this,u,!1,23,4)},i.prototype.readDoubleLE=function(u,c){return u=u>>>0,c||ce(u,8,this.length),e.read(this,u,!0,52,8)},i.prototype.readDoubleBE=function(u,c){return u=u>>>0,c||ce(u,8,this.length),e.read(this,u,!1,52,8)};function he(h,u,c,T,A,N){if(!i.isBuffer(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>A||u<N)throw new RangeError('"value" argument is out of bounds');if(c+T>h.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(u,c,T,A){if(u=+u,c=c>>>0,T=T>>>0,!A){let we=Math.pow(2,8*T)-1;he(this,u,c,T,we,0)}let N=1,K=0;for(this[c]=u&255;++K<T&&(N*=256);)this[c+K]=u/N&255;return c+T},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(u,c,T,A){if(u=+u,c=c>>>0,T=T>>>0,!A){let we=Math.pow(2,8*T)-1;he(this,u,c,T,we,0)}let N=T-1,K=1;for(this[c+N]=u&255;--N>=0&&(K*=256);)this[c+N]=u/K&255;return c+T},i.prototype.writeUint8=i.prototype.writeUInt8=function(u,c,T){return u=+u,c=c>>>0,T||he(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||he(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||he(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||he(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||he(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 M(h,u,c,T,A){oe(u,T,A,h,c,7);let N=Number(u&BigInt(4294967295));h[c++]=N,N=N>>8,h[c++]=N,N=N>>8,h[c++]=N,N=N>>8,h[c++]=N;let K=Number(u>>BigInt(32)&BigInt(4294967295));return h[c++]=K,K=K>>8,h[c++]=K,K=K>>8,h[c++]=K,K=K>>8,h[c++]=K,c}function Z(h,u,c,T,A){oe(u,T,A,h,c,7);let N=Number(u&BigInt(4294967295));h[c+7]=N,N=N>>8,h[c+6]=N,N=N>>8,h[c+5]=N,N=N>>8,h[c+4]=N;let K=Number(u>>BigInt(32)&BigInt(4294967295));return h[c+3]=K,K=K>>8,h[c+2]=K,K=K>>8,h[c+1]=K,K=K>>8,h[c]=K,c+8}i.prototype.writeBigUInt64LE=_t(function(u,c=0){return M(this,u,c,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=_t(function(u,c=0){return Z(this,u,c,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(u,c,T,A){if(u=+u,c=c>>>0,!A){let Je=Math.pow(2,8*T-1);he(this,u,c,T,Je-1,-Je)}let N=0,K=1,we=0;for(this[c]=u&255;++N<T&&(K*=256);)u<0&&we===0&&this[c+N-1]!==0&&(we=1),this[c+N]=(u/K>>0)-we&255;return c+T},i.prototype.writeIntBE=function(u,c,T,A){if(u=+u,c=c>>>0,!A){let Je=Math.pow(2,8*T-1);he(this,u,c,T,Je-1,-Je)}let N=T-1,K=1,we=0;for(this[c+N]=u&255;--N>=0&&(K*=256);)u<0&&we===0&&this[c+N+1]!==0&&(we=1),this[c+N]=(u/K>>0)-we&255;return c+T},i.prototype.writeInt8=function(u,c,T){return u=+u,c=c>>>0,T||he(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||he(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||he(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||he(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||he(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=_t(function(u,c=0){return M(this,u,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=_t(function(u,c=0){return Z(this,u,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(h,u,c,T,A,N){if(c+T>h.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function fe(h,u,c,T,A){return u=+u,c=c>>>0,A||F(h,u,c,4),e.write(h,u,c,T,23,4),c+4}i.prototype.writeFloatLE=function(u,c,T){return fe(this,u,c,!0,T)},i.prototype.writeFloatBE=function(u,c,T){return fe(this,u,c,!1,T)};function ve(h,u,c,T,A){return u=+u,c=c>>>0,A||F(h,u,c,8),e.write(h,u,c,T,52,8),c+8}i.prototype.writeDoubleLE=function(u,c,T){return ve(this,u,c,!0,T)},i.prototype.writeDoubleBE=function(u,c,T){return ve(this,u,c,!1,T)},i.prototype.copy=function(u,c,T,A){if(!i.isBuffer(u))throw new TypeError("argument should be a Buffer");if(T||(T=0),!A&&A!==0&&(A=this.length),c>=u.length&&(c=u.length),c||(c=0),A>0&&A<T&&(A=T),A===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(A<0)throw new RangeError("sourceEnd out of bounds");A>this.length&&(A=this.length),u.length-c<A-T&&(A=u.length-c+T);let N=A-T;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(c,T,A):Uint8Array.prototype.set.call(u,this.subarray(T,A),c),N},i.prototype.fill=function(u,c,T,A){if(typeof u=="string"){if(typeof c=="string"?(A=c,c=0,T=this.length):typeof T=="string"&&(A=T,T=this.length),A!==void 0&&typeof A!="string")throw new TypeError("encoding must be a string");if(typeof A=="string"&&!i.isEncoding(A))throw new TypeError("Unknown encoding: "+A);if(u.length===1){let K=u.charCodeAt(0);(A==="utf8"&&K<128||A==="latin1")&&(u=K)}}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 N;if(typeof u=="number")for(N=c;N<T;++N)this[N]=u;else{let K=i.isBuffer(u)?u:i.from(u,A),we=K.length;if(we===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(N=0;N<T-c;++N)this[N+c]=K[N%we]}return this};let C={};function S(h,u,c){C[h]=class extends c{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${h}]`,this.stack,delete this.name}get code(){return h}set code(A){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:A,writable:!0})}toString(){return`${this.name} [${h}]: ${this.message}`}}}S("ERR_BUFFER_OUT_OF_BOUNDS",function(h){return h?`${h} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),S("ERR_INVALID_ARG_TYPE",function(h,u){return`The "${h}" argument must be of type number. Received type ${typeof u}`},TypeError),S("ERR_OUT_OF_RANGE",function(h,u,c){let T=`The value of "${h}" is out of range.`,A=c;return Number.isInteger(c)&&Math.abs(c)>2**32?A=j(String(c)):typeof c=="bigint"&&(A=String(c),(c>BigInt(2)**BigInt(32)||c<-(BigInt(2)**BigInt(32)))&&(A=j(A)),A+="n"),T+=` It must be ${u}. Received ${A}`,T},RangeError);function j(h){let u="",c=h.length,T=h[0]==="-"?1:0;for(;c>=T+4;c-=3)u=`_${h.slice(c-3,c)}${u}`;return`${h.slice(0,c)}${u}`}function V(h,u,c){b(u,"offset"),(h[u]===void 0||h[u+c]===void 0)&&x(u,h.length-(c+1))}function oe(h,u,c,T,A,N){if(h>c||h<u){let K=typeof u=="bigint"?"n":"",we;throw u===0||u===BigInt(0)?we=`>= 0${K} and < 2${K} ** ${(N+1)*8}${K}`:we=`>= -(2${K} ** ${(N+1)*8-1}${K}) and < 2 ** ${(N+1)*8-1}${K}`,new C.ERR_OUT_OF_RANGE("value",we,h)}V(T,A,N)}function b(h,u){if(typeof h!="number")throw new C.ERR_INVALID_ARG_TYPE(u,"number",h)}function x(h,u,c){throw Math.floor(h)!==h?(b(h,c),new C.ERR_OUT_OF_RANGE("offset","an integer",h)):u<0?new C.ERR_BUFFER_OUT_OF_BOUNDS:new C.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${u}`,h)}let q=/[^+/0-9A-Za-z-_]/g;function Q(h){if(h=h.split("=")[0],h=h.trim().replace(q,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function He(h,u){u=u||1/0;let c,T=h.length,A=null,N=[];for(let K=0;K<T;++K){if(c=h.charCodeAt(K),c>55295&&c<57344){if(!A){if(c>56319){(u-=3)>-1&&N.push(239,191,189);continue}else if(K+1===T){(u-=3)>-1&&N.push(239,191,189);continue}A=c;continue}if(c<56320){(u-=3)>-1&&N.push(239,191,189),A=c;continue}c=(A-55296<<10|c-56320)+65536}else A&&(u-=3)>-1&&N.push(239,191,189);if(A=null,c<128){if((u-=1)<0)break;N.push(c)}else if(c<2048){if((u-=2)<0)break;N.push(c>>6|192,c&63|128)}else if(c<65536){if((u-=3)<0)break;N.push(c>>12|224,c>>6&63|128,c&63|128)}else if(c<1114112){if((u-=4)<0)break;N.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw new Error("Invalid code point")}return N}function Te(h){let u=[];for(let c=0;c<h.length;++c)u.push(h.charCodeAt(c)&255);return u}function U(h,u){let c,T,A,N=[];for(let K=0;K<h.length&&!((u-=2)<0);++K)c=h.charCodeAt(K),T=c>>8,A=c%256,N.push(A),N.push(T);return N}function Et(h){return t.toByteArray(Q(h))}function St(h,u,c,T){let A;for(A=0;A<T&&!(A+c>=u.length||A>=h.length);++A)u[A+c]=h[A];return A}function ht(h,u){return h instanceof u||h!=null&&h.constructor!=null&&h.constructor.name!=null&&h.constructor.name===u.name}function gr(h){return h!==h}let Wr=function(){let h="0123456789abcdef",u=new Array(256);for(let c=0;c<16;++c){let T=c*16;for(let A=0;A<16;++A)u[T+A]=h[c]+h[A]}return u}();function _t(h){return typeof BigInt>"u"?yr:h}function yr(){throw new Error("BigInt not supported")}return un}var hr,ac,ei,oc,un,sc,ti=it(()=>{R();O();k();hr={},ac=!1;ei={},oc=!1;un={},sc=!1});var cn,W,fA,dA,lc=it(()=>{R();O();k();ti();cn=At();cn.Buffer;cn.SlowBuffer;cn.INSPECT_MAX_BYTES;cn.kMaxLength;W=cn.Buffer,fA=cn.INSPECT_MAX_BYTES,dA=cn.kMaxLength});var O=it(()=>{lc()});var bc=$l(Ee=>{"use strict";R();O();k();var vr=Symbol.for("react.element"),Ov=Symbol.for("react.portal"),Mv=Symbol.for("react.fragment"),Dv=Symbol.for("react.strict_mode"),Nv=Symbol.for("react.profiler"),Hv=Symbol.for("react.provider"),Uv=Symbol.for("react.context"),jv=Symbol.for("react.forward_ref"),$v=Symbol.for("react.suspense"),Zv=Symbol.for("react.memo"),Lv=Symbol.for("react.lazy"),uc=Symbol.iterator;function Fv(t){return t===null||typeof t!="object"?null:(t=uc&&t[uc]||t["@@iterator"],typeof t=="function"?t:null)}var dc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},pc=Object.assign,gc={};function Hn(t,e,n){this.props=t,this.context=e,this.refs=gc,this.updater=n||dc}Hn.prototype.isReactComponent={};Hn.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Hn.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function yc(){}yc.prototype=Hn.prototype;function za(t,e,n){this.props=t,this.context=e,this.refs=gc,this.updater=n||dc}var Ga=za.prototype=new yc;Ga.constructor=za;pc(Ga,Hn.prototype);Ga.isPureReactComponent=!0;var cc=Array.isArray,mc=Object.prototype.hasOwnProperty,Va={current:null},hc={key:!0,ref:!0,__self:!0,__source:!0};function vc(t,e,n){var r,a={},o=null,i=null;if(e!=null)for(r in e.ref!==void 0&&(i=e.ref),e.key!==void 0&&(o=""+e.key),e)mc.call(e,r)&&!hc.hasOwnProperty(r)&&(a[r]=e[r]);var s=arguments.length-2;if(s===1)a.children=n;else if(1<s){for(var l=Array(s),f=0;f<s;f++)l[f]=arguments[f+2];a.children=l}if(t&&t.defaultProps)for(r in s=t.defaultProps,s)a[r]===void 0&&(a[r]=s[r]);return{$$typeof:vr,type:t,key:o,ref:i,props:a,_owner:Va.current}}function Kv(t,e){return{$$typeof:vr,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Wa(t){return typeof t=="object"&&t!==null&&t.$$typeof===vr}function qv(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var fc=/\/+/g;function qa(t,e){return typeof t=="object"&&t!==null&&t.key!=null?qv(""+t.key):e.toString(36)}function ri(t,e,n,r,a){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(o){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case vr:case Ov:i=!0}}if(i)return i=t,a=a(i),t=r===""?"."+qa(i,0):r,cc(a)?(n="",t!=null&&(n=t.replace(fc,"$&/")+"/"),ri(a,e,n,"",function(f){return f})):a!=null&&(Wa(a)&&(a=Kv(a,n+(!a.key||i&&i.key===a.key?"":(""+a.key).replace(fc,"$&/")+"/")+t)),e.push(a)),1;if(i=0,r=r===""?".":r+":",cc(t))for(var s=0;s<t.length;s++){o=t[s];var l=r+qa(o,s);i+=ri(o,e,n,l,a)}else if(l=Fv(t),typeof l=="function")for(t=l.call(t),s=0;!(o=t.next()).done;)o=o.value,l=r+qa(o,s++),i+=ri(o,e,n,l,a);else if(o==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return i}function ni(t,e,n){if(t==null)return t;var r=[],a=0;return ri(t,r,"","",function(o){return e.call(n,o,a++)}),r}function zv(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var lt={current:null},ii={transition:null},Gv={ReactCurrentDispatcher:lt,ReactCurrentBatchConfig:ii,ReactCurrentOwner:Va};function Tc(){throw Error("act(...) is not supported in production builds of React.")}Ee.Children={map:ni,forEach:function(t,e,n){ni(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return ni(t,function(){e++}),e},toArray:function(t){return ni(t,function(e){return e})||[]},only:function(t){if(!Wa(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Ee.Component=Hn;Ee.Fragment=Mv;Ee.Profiler=Nv;Ee.PureComponent=za;Ee.StrictMode=Dv;Ee.Suspense=$v;Ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Gv;Ee.act=Tc;Ee.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=pc({},t.props),a=t.key,o=t.ref,i=t._owner;if(e!=null){if(e.ref!==void 0&&(o=e.ref,i=Va.current),e.key!==void 0&&(a=""+e.key),t.type&&t.type.defaultProps)var s=t.type.defaultProps;for(l in e)mc.call(e,l)&&!hc.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&s!==void 0?s[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){s=Array(l);for(var f=0;f<l;f++)s[f]=arguments[f+2];r.children=s}return{$$typeof:vr,type:t.type,key:a,ref:o,props:r,_owner:i}};Ee.createContext=function(t){return t={$$typeof:Uv,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Hv,_context:t},t.Consumer=t};Ee.createElement=vc;Ee.createFactory=function(t){var e=vc.bind(null,t);return e.type=t,e};Ee.createRef=function(){return{current:null}};Ee.forwardRef=function(t){return{$$typeof:jv,render:t}};Ee.isValidElement=Wa;Ee.lazy=function(t){return{$$typeof:Lv,_payload:{_status:-1,_result:t},_init:zv}};Ee.memo=function(t,e){return{$$typeof:Zv,type:t,compare:e===void 0?null:e}};Ee.startTransition=function(t){var e=ii.transition;ii.transition={};try{t()}finally{ii.transition=e}};Ee.unstable_act=Tc;Ee.useCallback=function(t,e){return lt.current.useCallback(t,e)};Ee.useContext=function(t){return lt.current.useContext(t)};Ee.useDebugValue=function(){};Ee.useDeferredValue=function(t){return lt.current.useDeferredValue(t)};Ee.useEffect=function(t,e){return lt.current.useEffect(t,e)};Ee.useId=function(){return lt.current.useId()};Ee.useImperativeHandle=function(t,e,n){return lt.current.useImperativeHandle(t,e,n)};Ee.useInsertionEffect=function(t,e){return lt.current.useInsertionEffect(t,e)};Ee.useLayoutEffect=function(t,e){return lt.current.useLayoutEffect(t,e)};Ee.useMemo=function(t,e){return lt.current.useMemo(t,e)};Ee.useReducer=function(t,e,n){return lt.current.useReducer(t,e,n)};Ee.useRef=function(t){return lt.current.useRef(t)};Ee.useState=function(t){return lt.current.useState(t)};Ee.useSyncExternalStore=function(t,e,n){return lt.current.useSyncExternalStore(t,e,n)};Ee.useTransition=function(){return lt.current.useTransition()};Ee.version="18.3.1"});var Un=$l((wA,_c)=>{"use strict";R();O();k();_c.exports=bc()});function Ct(){return Ay||(Ay=!0,typeof Object.create=="function"?ya=function(e,n){n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ya=function(e,n){if(n){e.super_=n;var r=function(){};r.prototype=n.prototype,e.prototype=new r,e.prototype.constructor=e}}),ya}var ya,Ay,Qo=it(()=>{R();O();k();ya={},Ay=!1});function Ue(){Ue.init.call(this)}function ma(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function jy(t){return t._maxListeners===void 0?Ue.defaultMaxListeners:t._maxListeners}function Oy(t,e,n,r){var a,o,i,s;if(ma(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=jy(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 XE(){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 My(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},a=XE.bind(r);return a.listener=n,r.wrapFn=a,a}function Dy(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):$y(a,a.length)}function Ny(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 $y(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}var Hy,Uy,nr,Cy,Ry,ky,gt,es=it(()=>{R();O();k();nr=typeof Reflect=="object"?Reflect:null,Cy=nr&&typeof nr.apply=="function"?nr.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};Uy=nr&&typeof nr.ownKeys=="function"?nr.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};Ry=Number.isNaN||function(t){return t!=t};Hy=Ue,Ue.EventEmitter=Ue,Ue.prototype._events=void 0,Ue.prototype._eventsCount=0,Ue.prototype._maxListeners=void 0;ky=10;Object.defineProperty(Ue,"defaultMaxListeners",{enumerable:!0,get:function(){return ky},set:function(t){if(typeof t!="number"||t<0||Ry(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");ky=t}}),Ue.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},Ue.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Ry(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},Ue.prototype.getMaxListeners=function(){return jy(this)},Ue.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")Cy(s,this,e);else{var l=s.length,f=$y(s,l);for(n=0;n<l;++n)Cy(f[n],this,e)}return!0},Ue.prototype.addListener=function(t,e){return Oy(this,t,e,!1)},Ue.prototype.on=Ue.prototype.addListener,Ue.prototype.prependListener=function(t,e){return Oy(this,t,e,!0)},Ue.prototype.once=function(t,e){return ma(e),this.on(t,My(this,t,e)),this},Ue.prototype.prependOnceListener=function(t,e){return ma(e),this.prependListener(t,My(this,t,e)),this},Ue.prototype.removeListener=function(t,e){var n,r,a,o,i;if(ma(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},Ue.prototype.off=Ue.prototype.removeListener,Ue.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},Ue.prototype.listeners=function(t){return Dy(this,t,!0)},Ue.prototype.rawListeners=function(t){return Dy(this,t,!1)},Ue.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Ny.call(t,e)},Ue.prototype.listenerCount=Ny,Ue.prototype.eventNames=function(){return this._eventsCount>0?Uy(this._events):[]};gt=Hy;gt.EventEmitter;gt.defaultMaxListeners;gt.init;gt.listenerCount;gt.EventEmitter;gt.defaultMaxListeners;gt.init;gt.listenerCount});var Zy=it(()=>{R();O();k();es();gt.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)})};gt.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 g=Promise.reject(a);return a=null,g}return o?createIterResult(void 0,!0):new Promise((g,y)=>r.push({resolve:g,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 g=r.shift();g?g.resolve(createIterResult(f,!1)):n.push(f)}function l(f){o=!0;let g=r.shift();g?g.reject(f):a=f,i.return()}}});function as(){throw new Error("setTimeout has not been defined")}function os(){throw new Error("clearTimeout has not been defined")}function tm(t){if(zt===setTimeout)return setTimeout(t,0);if((zt===as||!zt)&&setTimeout)return zt=setTimeout,setTimeout(t,0);try{return zt(t,0)}catch{try{return zt.call(null,t,0)}catch{return zt.call(this||ir,t,0)}}}function QE(){rr&&Pn&&(rr=!1,Pn.length?Vt=Pn.concat(Vt):xa=-1,Vt.length&&nm())}function nm(){if(!rr){var t=tm(QE);rr=!0;for(var e=Vt.length;e;){for(Pn=Vt,Vt=[];++xa<e;)Pn&&Pn[xa].run();xa=-1,e=Vt.length}Pn=null,rr=!1,function(n){if(Gt===clearTimeout)return clearTimeout(n);if((Gt===os||!Gt)&&clearTimeout)return Gt=clearTimeout,clearTimeout(n);try{Gt(n)}catch{try{return Gt.call(null,n)}catch{return Gt.call(this||ir,n)}}}(t)}}function Ly(t,e){(this||ir).fun=t,(this||ir).array=e}function qt(){}function Sn(t){return t.call.bind(t)}function $r(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}function Ky(t){return yt&&Tt?xt(t)!==void 0:lm(t)||um(t)||cm(t)||fm(t)||dm(t)||pm(t)||gm(t)||ym(t)||mm(t)||hm(t)||vm(t)}function lm(t){return yt&&Tt?xt(t)==="Uint8Array":Ve(t)==="[object Uint8Array]"||uB(t)&&t.buffer!==void 0}function um(t){return yt&&Tt?xt(t)==="Uint8ClampedArray":Ve(t)==="[object Uint8ClampedArray]"}function cm(t){return yt&&Tt?xt(t)==="Uint16Array":Ve(t)==="[object Uint16Array]"}function fm(t){return yt&&Tt?xt(t)==="Uint32Array":Ve(t)==="[object Uint32Array]"}function dm(t){return yt&&Tt?xt(t)==="Int8Array":Ve(t)==="[object Int8Array]"}function pm(t){return yt&&Tt?xt(t)==="Int16Array":Ve(t)==="[object Int16Array]"}function gm(t){return yt&&Tt?xt(t)==="Int32Array":Ve(t)==="[object Int32Array]"}function ym(t){return yt&&Tt?xt(t)==="Float32Array":Ve(t)==="[object Float32Array]"}function mm(t){return yt&&Tt?xt(t)==="Float64Array":Ve(t)==="[object Float64Array]"}function hm(t){return yt&&Tt?xt(t)==="BigInt64Array":Ve(t)==="[object BigInt64Array]"}function vm(t){return yt&&Tt?xt(t)==="BigUint64Array":Ve(t)==="[object BigUint64Array]"}function ha(t){return Ve(t)==="[object Map]"}function va(t){return Ve(t)==="[object Set]"}function Ta(t){return Ve(t)==="[object WeakMap]"}function ts(t){return Ve(t)==="[object WeakSet]"}function Ea(t){return Ve(t)==="[object ArrayBuffer]"}function qy(t){return typeof ArrayBuffer<"u"&&(Ea.working?Ea(t):t instanceof ArrayBuffer)}function Ba(t){return Ve(t)==="[object DataView]"}function zy(t){return typeof DataView<"u"&&(Ba.working?Ba(t):t instanceof DataView)}function Pa(t){return Ve(t)==="[object SharedArrayBuffer]"}function Gy(t){return typeof SharedArrayBuffer<"u"&&(Pa.working?Pa(t):t instanceof SharedArrayBuffer)}function Vy(t){return $r(t,gB)}function Wy(t){return $r(t,yB)}function Jy(t){return $r(t,mB)}function Yy(t){return sm&&$r(t,hB)}function Xy(t){return ls&&$r(t,vB)}function an(t,e){var n={seen:[],stylize:_B};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),us(e)?n.showHidden=e:e&&L._extend(n,e),In(n.showHidden)&&(n.showHidden=!1),In(n.depth)&&(n.depth=2),In(n.colors)&&(n.colors=!1),In(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=bB),Ia(n,t,n.depth)}function bB(t,e){var n=an.styles[e];return n?"\x1B["+an.colors[n][0]+"m"+t+"\x1B["+an.colors[n][1]+"m":t}function _B(t,e){return t}function Ia(t,e,n){if(t.customInspect&&e&&wa(e.inspect)&&e.inspect!==L.inspect&&(!e.constructor||e.constructor.prototype!==e)){var r=e.inspect(n,t);return Sa(r)||(r=Ia(t,r,n)),r}var a=function(p,m){if(In(m))return p.stylize("undefined","undefined");if(Sa(m)){var _="'"+JSON.stringify(m).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return p.stylize(_,"string")}if(_m(m))return p.stylize(""+m,"number");if(us(m))return p.stylize(""+m,"boolean");if(Ra(m))return p.stylize("null","null")}(t,e);if(a)return a;var o=Object.keys(e),i=function(p){var m={};return p.forEach(function(_,E){m[_]=!0}),m}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),jr(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return ns(e);if(o.length===0){if(wa(e)){var s=e.name?": "+e.name:"";return t.stylize("[Function"+s+"]","special")}if(Ur(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Aa(e))return t.stylize(Date.prototype.toString.call(e),"date");if(jr(e))return ns(e)}var l,f="",g=!1,y=["{","}"];return bm(e)&&(g=!0,y=["[","]"]),wa(e)&&(f=" [Function"+(e.name?": "+e.name:"")+"]"),Ur(e)&&(f=" "+RegExp.prototype.toString.call(e)),Aa(e)&&(f=" "+Date.prototype.toUTCString.call(e)),jr(e)&&(f=" "+ns(e)),o.length!==0||g&&e.length!=0?n<0?Ur(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),l=g?function(p,m,_,E,B){for(var v=[],I=0,P=m.length;I<P;++I)xm(m,String(I))?v.push(rs(p,m,_,E,String(I),!0)):v.push("");return B.forEach(function(D){D.match(/^\d+$/)||v.push(rs(p,m,_,E,D,!0))}),v}(t,e,n,i,o):o.map(function(p){return rs(t,e,n,i,p,g)}),t.seen.pop(),function(p,m,_){var E=0;return p.reduce(function(B,v){return E++,v.indexOf(`
2
- `)>=0&&E++,B+v.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?_[0]+(m===""?"":m+`
3
- `)+" "+p.join(`,
4
- `)+" "+_[1]:_[0]+m+" "+p.join(", ")+" "+_[1]}(l,f,y)):y[0]+f+y[1]}function ns(t){return"["+Error.prototype.toString.call(t)+"]"}function rs(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")),xm(r,a)||(i="["+a+"]"),s||(t.seen.indexOf(l.value)<0?(s=Ra(n)?Ia(t,l.value,null):Ia(t,l.value,n-1)).indexOf(`
5
- `)>-1&&(s=o?s.split(`
1
+ var Av=Object.create;var ei=Object.defineProperty;var Rv=Object.getOwnPropertyDescriptor;var Ov=Object.getOwnPropertyNames;var Mv=Object.getPrototypeOf,Dv=Object.prototype.hasOwnProperty;var it=(t,e)=>()=>(t&&(e=t(t=0)),e);var ql=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Hn=(t,e)=>{for(var n in e)ei(t,n,{get:e[n],enumerable:!0})},zl=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ov(e))!Dv.call(t,o)&&o!==n&&ei(t,o,{get:()=>e[o],enumerable:!(r=Rv(e,o))||r.enumerable});return t};var _r=(t,e,n)=>(n=t!=null?Av(Mv(t)):{},zl(e||!t||!t.__esModule?ei(n,"default",{value:t,enumerable:!0}):n,t)),Nv=t=>zl(ei({},"__esModule",{value:!0}),t);var A=it(()=>{});var Y={};Hn(Y,{_debugEnd:()=>Nu,_debugProcess:()=>Du,_events:()=>Xu,_eventsCount:()=>Qu,_exiting:()=>mu,_fatalExceptions:()=>Au,_getActiveHandles:()=>_u,_getActiveRequests:()=>Tu,_kill:()=>wu,_linkedBinding:()=>gu,_maxListeners:()=>Yu,_preload_modules:()=>Gu,_rawDebug:()=>du,_startProfilerIdleNotifier:()=>Uu,_stopProfilerIdleNotifier:()=>Hu,_tickCallback:()=>Mu,abort:()=>Lu,addListener:()=>ec,allowedNodeEnvironmentFlags:()=>Su,arch:()=>Xl,argv:()=>tu,argv0:()=>zu,assert:()=>Iu,binding:()=>au,browser:()=>fu,chdir:()=>uu,config:()=>hu,cpuUsage:()=>ri,cwd:()=>lu,debugPort:()=>qu,default:()=>uc,dlopen:()=>vu,domain:()=>yu,emit:()=>oc,emitWarning:()=>ou,env:()=>eu,execArgv:()=>nu,execPath:()=>Wu,exit:()=>Pu,features:()=>Cu,hasUncaughtExceptionCaptureCallback:()=>Ou,hrtime:()=>ni,kill:()=>Eu,listeners:()=>lc,memoryUsage:()=>Bu,moduleLoadList:()=>pu,nextTick:()=>Vl,off:()=>nc,on:()=>Nt,once:()=>tc,openStdin:()=>ku,pid:()=>Fu,platform:()=>Ql,ppid:()=>Ku,prependListener:()=>ac,prependOnceListener:()=>sc,reallyExit:()=>bu,release:()=>cu,removeAllListeners:()=>ic,removeListener:()=>rc,resourceUsage:()=>xu,setSourceMapsEnabled:()=>Vu,setUncaughtExceptionCaptureCallback:()=>Ru,stderr:()=>$u,stdin:()=>Zu,stdout:()=>ju,title:()=>Yl,umask:()=>su,uptime:()=>Ju,version:()=>ru,versions:()=>iu});function Yo(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function Uv(){!jn||!fn||(jn=!1,fn.length?Dt=fn.concat(Dt):ti=-1,Dt.length&&Gl())}function Gl(){if(!jn){var t=setTimeout(Uv,0);jn=!0;for(var e=Dt.length;e;){for(fn=Dt,Dt=[];++ti<e;)fn&&fn[ti].run();ti=-1,e=Dt.length}fn=null,jn=!1,clearTimeout(t)}}function Vl(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];Dt.push(new Jl(t,e)),Dt.length===1&&!jn&&setTimeout(Gl,0)}function Jl(t,e){this.fun=t,this.array=e}function ot(){}function gu(t){Yo("_linkedBinding")}function vu(t){Yo("dlopen")}function Tu(){return[]}function _u(){return[]}function Iu(t,e){if(!t)throw new Error(e||"assertion error")}function Ou(){return!1}function Ju(){return en.now()/1e3}function ni(t){var e=Math.floor((Date.now()-en.now())*.001),n=en.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+=Jo)),[r,o]}function Nt(){return uc}function lc(t){return[]}var Dt,jn,fn,ti,Yl,Xl,Ql,eu,tu,nu,ru,iu,ou,au,su,lu,uu,cu,fu,du,pu,yu,mu,hu,bu,wu,ri,xu,Bu,Eu,Pu,ku,Su,Cu,Au,Ru,Mu,Du,Nu,Uu,Hu,ju,$u,Zu,Lu,Fu,Ku,Wu,qu,zu,Gu,Vu,en,Vo,Jo,Yu,Xu,Qu,ec,tc,nc,rc,ic,oc,ac,sc,uc,cc=it(()=>{A();O();R();Dt=[],jn=!1,ti=-1;Jl.prototype.run=function(){this.fun.apply(null,this.array)};Yl="browser",Xl="x64",Ql="browser",eu={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},tu=["/usr/bin/node"],nu=[],ru="v16.8.0",iu={},ou=function(t,e){console.warn((e?e+": ":"")+t)},au=function(t){Yo("binding")},su=function(t){return 0},lu=function(){return"/"},uu=function(t){},cu={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};fu=!0,du=ot,pu=[];yu={},mu=!1,hu={};bu=ot,wu=ot,ri=function(){return{}},xu=ri,Bu=ri,Eu=ot,Pu=ot,ku=ot,Su={};Cu={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Au=ot,Ru=ot;Mu=ot,Du=ot,Nu=ot,Uu=ot,Hu=ot,ju=void 0,$u=void 0,Zu=void 0,Lu=ot,Fu=2,Ku=1,Wu="/bin/usr/node",qu=9229,zu="node",Gu=[],Vu=ot,en={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};en.now===void 0&&(Vo=Date.now(),en.timing&&en.timing.navigationStart&&(Vo=en.timing.navigationStart),en.now=()=>Date.now()-Vo);Jo=1e9;ni.bigint=function(t){var e=ni(t);return typeof BigInt>"u"?e[0]*Jo+e[1]:BigInt(e[0]*Jo)+BigInt(e[1])};Yu=10,Xu={},Qu=0;ec=Nt,tc=Nt,nc=Nt,rc=Nt,ic=Nt,oc=ot,ac=Nt,sc=Nt;uc={version:ru,versions:iu,arch:Xl,platform:Ql,browser:fu,release:cu,_rawDebug:du,moduleLoadList:pu,binding:au,_linkedBinding:gu,_events:Xu,_eventsCount:Qu,_maxListeners:Yu,on:Nt,addListener:ec,once:tc,off:nc,removeListener:rc,removeAllListeners:ic,emit:oc,prependListener:ac,prependOnceListener:sc,listeners:lc,domain:yu,_exiting:mu,config:hu,dlopen:vu,uptime:Ju,_getActiveRequests:Tu,_getActiveHandles:_u,reallyExit:bu,_kill:wu,cpuUsage:ri,resourceUsage:xu,memoryUsage:Bu,kill:Eu,exit:Pu,openStdin:ku,allowedNodeEnvironmentFlags:Su,assert:Iu,features:Cu,_fatalExceptions:Au,setUncaughtExceptionCaptureCallback:Ru,hasUncaughtExceptionCaptureCallback:Ou,emitWarning:ou,nextTick:Vl,_tickCallback:Mu,_debugProcess:Du,_debugEnd:Nu,_startProfilerIdleNotifier:Uu,_stopProfilerIdleNotifier:Hu,stdout:ju,stdin:Zu,stderr:$u,abort:Lu,umask:su,chdir:uu,cwd:lu,env:eu,title:Yl,argv:tu,execArgv:nu,pid:Fu,ppid:Ku,execPath:Wu,debugPort:qu,hrtime:ni,argv0:zu,_preload_modules:Gu,setSourceMapsEnabled:Vu}});var R=it(()=>{cc()});function Hv(){if(fc)return br;fc=!0,br.byteLength=s,br.toByteArray=f,br.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["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63;function i(m){var v=m.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var B=m.indexOf("=");B===-1&&(B=v);var E=B===v?0:4-B%4;return[B,E]}function s(m){var v=i(m),B=v[0],E=v[1];return(B+E)*3/4-E}function l(m,v,B){return(v+B)*3/4-B}function f(m){var v,B=i(m),E=B[0],T=B[1],k=new n(l(m,E,T)),P=0,M=T>0?E-4:E,$;for($=0;$<M;$+=4)v=e[m.charCodeAt($)]<<18|e[m.charCodeAt($+1)]<<12|e[m.charCodeAt($+2)]<<6|e[m.charCodeAt($+3)],k[P++]=v>>16&255,k[P++]=v>>8&255,k[P++]=v&255;return T===2&&(v=e[m.charCodeAt($)]<<2|e[m.charCodeAt($+1)]>>4,k[P++]=v&255),T===1&&(v=e[m.charCodeAt($)]<<10|e[m.charCodeAt($+1)]<<4|e[m.charCodeAt($+2)]>>2,k[P++]=v>>8&255,k[P++]=v&255),k}function d(m){return t[m>>18&63]+t[m>>12&63]+t[m>>6&63]+t[m&63]}function y(m,v,B){for(var E,T=[],k=v;k<B;k+=3)E=(m[k]<<16&16711680)+(m[k+1]<<8&65280)+(m[k+2]&255),T.push(d(E));return T.join("")}function g(m){for(var v,B=m.length,E=B%3,T=[],k=16383,P=0,M=B-E;P<M;P+=k)T.push(y(m,P,P+k>M?M:P+k));return E===1?(v=m[B-1],T.push(t[v>>2]+t[v<<4&63]+"==")):E===2&&(v=(m[B-2]<<8)+m[B-1],T.push(t[v>>10]+t[v>>4&63]+t[v<<2&63]+"=")),T.join("")}return br}function jv(){if(dc)return ii;dc=!0;return ii.read=function(t,e,n,r,o){var a,i,s=o*8-r-1,l=(1<<s)-1,f=l>>1,d=-7,y=n?o-1:0,g=n?-1:1,m=t[e+y];for(y+=g,a=m&(1<<-d)-1,m>>=-d,d+=s;d>0;a=a*256+t[e+y],y+=g,d-=8);for(i=a&(1<<-d)-1,a>>=-d,d+=r;d>0;i=i*256+t[e+y],y+=g,d-=8);if(a===0)a=1-f;else{if(a===l)return i?NaN:(m?-1:1)*(1/0);i=i+Math.pow(2,r),a=a-f}return(m?-1:1)*i*Math.pow(2,a-r)},ii.write=function(t,e,n,r,o,a){var i,s,l,f=a*8-o-1,d=(1<<f)-1,y=d>>1,g=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:a-1,v=r?1:-1,B=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=d):(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>=d?(s=0,i=d):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+m]=s&255,m+=v,s/=256,o-=8);for(i=i<<o|s,f+=o;f>0;t[n+m]=i&255,m+=v,i/=256,f-=8);t[n+m-v]|=B*128},ii}function Ct(){if(pc)return dn;pc=!0;let t=Hv(),e=jv(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;dn.Buffer=i,dn.SlowBuffer=T,dn.INSPECT_MAX_BYTES=50;let r=2147483647;dn.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 h=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(h,u),h.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(h){if(h>r)throw new RangeError('The value "'+h+'" is invalid for option "size"');let u=new Uint8Array(h);return Object.setPrototypeOf(u,i.prototype),u}function i(h,u,c){if(typeof h=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(h)}return s(h,u,c)}i.poolSize=8192;function s(h,u,c){if(typeof h=="string")return y(h,u);if(ArrayBuffer.isView(h))return m(h);if(h==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof h);if(vt(h,ArrayBuffer)||h&&vt(h.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(vt(h,SharedArrayBuffer)||h&&vt(h.buffer,SharedArrayBuffer)))return v(h,u,c);if(typeof h=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let _=h.valueOf&&h.valueOf();if(_!=null&&_!==h)return i.from(_,u,c);let I=B(h);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof h[Symbol.toPrimitive]=="function")return i.from(h[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 h)}i.from=function(h,u,c){return s(h,u,c)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function l(h){if(typeof h!="number")throw new TypeError('"size" argument must be of type number');if(h<0)throw new RangeError('The value "'+h+'" is invalid for option "size"')}function f(h,u,c){return l(h),h<=0?a(h):u!==void 0?typeof c=="string"?a(h).fill(u,c):a(h).fill(u):a(h)}i.alloc=function(h,u,c){return f(h,u,c)};function d(h){return l(h),a(h<0?0:E(h)|0)}i.allocUnsafe=function(h){return d(h)},i.allocUnsafeSlow=function(h){return d(h)};function y(h,u){if((typeof u!="string"||u==="")&&(u="utf8"),!i.isEncoding(u))throw new TypeError("Unknown encoding: "+u);let c=k(h,u)|0,_=a(c),I=_.write(h,u);return I!==c&&(_=_.slice(0,I)),_}function g(h){let u=h.length<0?0:E(h.length)|0,c=a(u);for(let _=0;_<u;_+=1)c[_]=h[_]&255;return c}function m(h){if(vt(h,Uint8Array)){let u=new Uint8Array(h);return v(u.buffer,u.byteOffset,u.byteLength)}return g(h)}function v(h,u,c){if(u<0||h.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(h.byteLength<u+(c||0))throw new RangeError('"length" is outside of buffer bounds');let _;return u===void 0&&c===void 0?_=new Uint8Array(h):c===void 0?_=new Uint8Array(h,u):_=new Uint8Array(h,u,c),Object.setPrototypeOf(_,i.prototype),_}function B(h){if(i.isBuffer(h)){let u=E(h.length)|0,c=a(u);return c.length===0||h.copy(c,0,0,u),c}if(h.length!==void 0)return typeof h.length!="number"||vr(h.length)?a(0):g(h);if(h.type==="Buffer"&&Array.isArray(h.data))return g(h.data)}function E(h){if(h>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return h|0}function T(h){return+h!=h&&(h=0),i.alloc(+h)}i.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==i.prototype},i.compare=function(u,c){if(vt(u,Uint8Array)&&(u=i.from(u,u.offset,u.byteLength)),vt(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 _=u.length,I=c.length;for(let N=0,K=Math.min(_,I);N<K;++N)if(u[N]!==c[N]){_=u[N],I=c[N];break}return _<I?-1:I<_?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 _;if(c===void 0)for(c=0,_=0;_<u.length;++_)c+=u[_].length;let I=i.allocUnsafe(c),N=0;for(_=0;_<u.length;++_){let K=u[_];if(vt(K,Uint8Array))N+K.length>I.length?(i.isBuffer(K)||(K=i.from(K)),K.copy(I,N)):Uint8Array.prototype.set.call(I,K,N);else if(i.isBuffer(K))K.copy(I,N);else throw new TypeError('"list" argument must be an Array of Buffers');N+=K.length}return I};function k(h,u){if(i.isBuffer(h))return h.length;if(ArrayBuffer.isView(h)||vt(h,ArrayBuffer))return h.byteLength;if(typeof h!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof h);let c=h.length,_=arguments.length>2&&arguments[2]===!0;if(!_&&c===0)return 0;let I=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return Ue(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c*2;case"hex":return c>>>1;case"base64":return Et(h).length;default:if(I)return _?-1:Ue(h).length;u=(""+u).toLowerCase(),I=!0}}i.byteLength=k;function P(h,u,c){let _=!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(h||(h="utf8");;)switch(h){case"hex":return me(this,u,c);case"utf8":case"utf-8":return $e(this,u,c);case"ascii":return Ve(this,u,c);case"latin1":case"binary":return Ce(this,u,c);case"base64":return Ie(this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ke(this,u,c);default:if(_)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),_=!0}}i.prototype._isBuffer=!0;function M(h,u,c){let _=h[u];h[u]=h[c],h[c]=_}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)M(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)M(this,c,c+3),M(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)M(this,c,c+7),M(this,c+1,c+6),M(this,c+2,c+5),M(this,c+3,c+4);return this},i.prototype.toString=function(){let u=this.length;return u===0?"":arguments.length===0?$e(this,0,u):P.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=dn.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,_,I,N){if(vt(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),_===void 0&&(_=u?u.length:0),I===void 0&&(I=0),N===void 0&&(N=this.length),c<0||_>u.length||I<0||N>this.length)throw new RangeError("out of range index");if(I>=N&&c>=_)return 0;if(I>=N)return-1;if(c>=_)return 1;if(c>>>=0,_>>>=0,I>>>=0,N>>>=0,this===u)return 0;let K=N-I,xe=_-c,Je=Math.min(K,xe),Fe=this.slice(I,N),Ye=u.slice(c,_);for(let Ze=0;Ze<Je;++Ze)if(Fe[Ze]!==Ye[Ze]){K=Fe[Ze],xe=Ye[Ze];break}return K<xe?-1:xe<K?1:0};function $(h,u,c,_,I){if(h.length===0)return-1;if(typeof c=="string"?(_=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,vr(c)&&(c=I?0:h.length-1),c<0&&(c=h.length+c),c>=h.length){if(I)return-1;c=h.length-1}else if(c<0)if(I)c=0;else return-1;if(typeof u=="string"&&(u=i.from(u,_)),i.isBuffer(u))return u.length===0?-1:oe(h,u,c,_,I);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?I?Uint8Array.prototype.indexOf.call(h,u,c):Uint8Array.prototype.lastIndexOf.call(h,u,c):oe(h,[u],c,_,I);throw new TypeError("val must be string, number or Buffer")}function oe(h,u,c,_,I){let N=1,K=h.length,xe=u.length;if(_!==void 0&&(_=String(_).toLowerCase(),_==="ucs2"||_==="ucs-2"||_==="utf16le"||_==="utf-16le")){if(h.length<2||u.length<2)return-1;N=2,K/=2,xe/=2,c/=2}function Je(Ye,Ze){return N===1?Ye[Ze]:Ye.readUInt16BE(Ze*N)}let Fe;if(I){let Ye=-1;for(Fe=c;Fe<K;Fe++)if(Je(h,Fe)===Je(u,Ye===-1?0:Fe-Ye)){if(Ye===-1&&(Ye=Fe),Fe-Ye+1===xe)return Ye*N}else Ye!==-1&&(Fe-=Fe-Ye),Ye=-1}else for(c+xe>K&&(c=K-xe),Fe=c;Fe>=0;Fe--){let Ye=!0;for(let Ze=0;Ze<xe;Ze++)if(Je(h,Fe+Ze)!==Je(u,Ze)){Ye=!1;break}if(Ye)return Fe}return-1}i.prototype.includes=function(u,c,_){return this.indexOf(u,c,_)!==-1},i.prototype.indexOf=function(u,c,_){return $(this,u,c,_,!0)},i.prototype.lastIndexOf=function(u,c,_){return $(this,u,c,_,!1)};function X(h,u,c,_){c=Number(c)||0;let I=h.length-c;_?(_=Number(_),_>I&&(_=I)):_=I;let N=u.length;_>N/2&&(_=N/2);let K;for(K=0;K<_;++K){let xe=parseInt(u.substr(K*2,2),16);if(vr(xe))return K;h[c+K]=xe}return K}function ue(h,u,c,_){return It(Ue(u,h.length-c),h,c,_)}function ee(h,u,c,_){return It(Te(u),h,c,_)}function ie(h,u,c,_){return It(Et(u),h,c,_)}function Oe(h,u,c,_){return It(H(u,h.length-c),h,c,_)}i.prototype.write=function(u,c,_,I){if(c===void 0)I="utf8",_=this.length,c=0;else if(_===void 0&&typeof c=="string")I=c,_=this.length,c=0;else if(isFinite(c))c=c>>>0,isFinite(_)?(_=_>>>0,I===void 0&&(I="utf8")):(I=_,_=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let N=this.length-c;if((_===void 0||_>N)&&(_=N),u.length>0&&(_<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");I||(I="utf8");let K=!1;for(;;)switch(I){case"hex":return X(this,u,c,_);case"utf8":case"utf-8":return ue(this,u,c,_);case"ascii":case"latin1":case"binary":return ee(this,u,c,_);case"base64":return ie(this,u,c,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Oe(this,u,c,_);default:if(K)throw new TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),K=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ie(h,u,c){return u===0&&c===h.length?t.fromByteArray(h):t.fromByteArray(h.slice(u,c))}function $e(h,u,c){c=Math.min(h.length,c);let _=[],I=u;for(;I<c;){let N=h[I],K=null,xe=N>239?4:N>223?3:N>191?2:1;if(I+xe<=c){let Je,Fe,Ye,Ze;switch(xe){case 1:N<128&&(K=N);break;case 2:Je=h[I+1],(Je&192)===128&&(Ze=(N&31)<<6|Je&63,Ze>127&&(K=Ze));break;case 3:Je=h[I+1],Fe=h[I+2],(Je&192)===128&&(Fe&192)===128&&(Ze=(N&15)<<12|(Je&63)<<6|Fe&63,Ze>2047&&(Ze<55296||Ze>57343)&&(K=Ze));break;case 4:Je=h[I+1],Fe=h[I+2],Ye=h[I+3],(Je&192)===128&&(Fe&192)===128&&(Ye&192)===128&&(Ze=(N&15)<<18|(Je&63)<<12|(Fe&63)<<6|Ye&63,Ze>65535&&Ze<1114112&&(K=Ze))}}K===null?(K=65533,xe=1):K>65535&&(K-=65536,_.push(K>>>10&1023|55296),K=56320|K&1023),_.push(K),I+=xe}return Me(_)}let Ne=4096;function Me(h){let u=h.length;if(u<=Ne)return String.fromCharCode.apply(String,h);let c="",_=0;for(;_<u;)c+=String.fromCharCode.apply(String,h.slice(_,_+=Ne));return c}function Ve(h,u,c){let _="";c=Math.min(h.length,c);for(let I=u;I<c;++I)_+=String.fromCharCode(h[I]&127);return _}function Ce(h,u,c){let _="";c=Math.min(h.length,c);for(let I=u;I<c;++I)_+=String.fromCharCode(h[I]);return _}function me(h,u,c){let _=h.length;(!u||u<0)&&(u=0),(!c||c<0||c>_)&&(c=_);let I="";for(let N=u;N<c;++N)I+=Qr[h[N]];return I}function ke(h,u,c){let _=h.slice(u,c),I="";for(let N=0;N<_.length-1;N+=2)I+=String.fromCharCode(_[N]+_[N+1]*256);return I}i.prototype.slice=function(u,c){let _=this.length;u=~~u,c=c===void 0?_:~~c,u<0?(u+=_,u<0&&(u=0)):u>_&&(u=_),c<0?(c+=_,c<0&&(c=0)):c>_&&(c=_),c<u&&(c=u);let I=this.subarray(u,c);return Object.setPrototypeOf(I,i.prototype),I};function ce(h,u,c){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+u>c)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(u,c,_){u=u>>>0,c=c>>>0,_||ce(u,c,this.length);let I=this[u],N=1,K=0;for(;++K<c&&(N*=256);)I+=this[u+K]*N;return I},i.prototype.readUintBE=i.prototype.readUIntBE=function(u,c,_){u=u>>>0,c=c>>>0,_||ce(u,c,this.length);let I=this[u+--c],N=1;for(;c>0&&(N*=256);)I+=this[u+--c]*N;return I},i.prototype.readUint8=i.prototype.readUInt8=function(u,c){return u=u>>>0,c||ce(u,1,this.length),this[u]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(u,c){return u=u>>>0,c||ce(u,2,this.length),this[u]|this[u+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(u,c){return u=u>>>0,c||ce(u,2,this.length),this[u]<<8|this[u+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(u,c){return u=u>>>0,c||ce(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||ce(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},i.prototype.readBigUInt64LE=wt(function(u){u=u>>>0,b(u,"offset");let c=this[u],_=this[u+7];(c===void 0||_===void 0)&&w(u,this.length-8);let I=c+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,N=this[++u]+this[++u]*2**8+this[++u]*2**16+_*2**24;return BigInt(I)+(BigInt(N)<<BigInt(32))}),i.prototype.readBigUInt64BE=wt(function(u){u=u>>>0,b(u,"offset");let c=this[u],_=this[u+7];(c===void 0||_===void 0)&&w(u,this.length-8);let I=c*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],N=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+_;return(BigInt(I)<<BigInt(32))+BigInt(N)}),i.prototype.readIntLE=function(u,c,_){u=u>>>0,c=c>>>0,_||ce(u,c,this.length);let I=this[u],N=1,K=0;for(;++K<c&&(N*=256);)I+=this[u+K]*N;return N*=128,I>=N&&(I-=Math.pow(2,8*c)),I},i.prototype.readIntBE=function(u,c,_){u=u>>>0,c=c>>>0,_||ce(u,c,this.length);let I=c,N=1,K=this[u+--I];for(;I>0&&(N*=256);)K+=this[u+--I]*N;return N*=128,K>=N&&(K-=Math.pow(2,8*c)),K},i.prototype.readInt8=function(u,c){return u=u>>>0,c||ce(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},i.prototype.readInt16LE=function(u,c){u=u>>>0,c||ce(u,2,this.length);let _=this[u]|this[u+1]<<8;return _&32768?_|4294901760:_},i.prototype.readInt16BE=function(u,c){u=u>>>0,c||ce(u,2,this.length);let _=this[u+1]|this[u]<<8;return _&32768?_|4294901760:_},i.prototype.readInt32LE=function(u,c){return u=u>>>0,c||ce(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||ce(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},i.prototype.readBigInt64LE=wt(function(u){u=u>>>0,b(u,"offset");let c=this[u],_=this[u+7];(c===void 0||_===void 0)&&w(u,this.length-8);let I=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(_<<24);return(BigInt(I)<<BigInt(32))+BigInt(c+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),i.prototype.readBigInt64BE=wt(function(u){u=u>>>0,b(u,"offset");let c=this[u],_=this[u+7];(c===void 0||_===void 0)&&w(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+_)}),i.prototype.readFloatLE=function(u,c){return u=u>>>0,c||ce(u,4,this.length),e.read(this,u,!0,23,4)},i.prototype.readFloatBE=function(u,c){return u=u>>>0,c||ce(u,4,this.length),e.read(this,u,!1,23,4)},i.prototype.readDoubleLE=function(u,c){return u=u>>>0,c||ce(u,8,this.length),e.read(this,u,!0,52,8)},i.prototype.readDoubleBE=function(u,c){return u=u>>>0,c||ce(u,8,this.length),e.read(this,u,!1,52,8)};function he(h,u,c,_,I,N){if(!i.isBuffer(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>I||u<N)throw new RangeError('"value" argument is out of bounds');if(c+_>h.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(u,c,_,I){if(u=+u,c=c>>>0,_=_>>>0,!I){let xe=Math.pow(2,8*_)-1;he(this,u,c,_,xe,0)}let N=1,K=0;for(this[c]=u&255;++K<_&&(N*=256);)this[c+K]=u/N&255;return c+_},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(u,c,_,I){if(u=+u,c=c>>>0,_=_>>>0,!I){let xe=Math.pow(2,8*_)-1;he(this,u,c,_,xe,0)}let N=_-1,K=1;for(this[c+N]=u&255;--N>=0&&(K*=256);)this[c+N]=u/K&255;return c+_},i.prototype.writeUint8=i.prototype.writeUInt8=function(u,c,_){return u=+u,c=c>>>0,_||he(this,u,c,1,255,0),this[c]=u&255,c+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(u,c,_){return u=+u,c=c>>>0,_||he(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,_){return u=+u,c=c>>>0,_||he(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,_){return u=+u,c=c>>>0,_||he(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,_){return u=+u,c=c>>>0,_||he(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(h,u,c,_,I){ae(u,_,I,h,c,7);let N=Number(u&BigInt(4294967295));h[c++]=N,N=N>>8,h[c++]=N,N=N>>8,h[c++]=N,N=N>>8,h[c++]=N;let K=Number(u>>BigInt(32)&BigInt(4294967295));return h[c++]=K,K=K>>8,h[c++]=K,K=K>>8,h[c++]=K,K=K>>8,h[c++]=K,c}function Z(h,u,c,_,I){ae(u,_,I,h,c,7);let N=Number(u&BigInt(4294967295));h[c+7]=N,N=N>>8,h[c+6]=N,N=N>>8,h[c+5]=N,N=N>>8,h[c+4]=N;let K=Number(u>>BigInt(32)&BigInt(4294967295));return h[c+3]=K,K=K>>8,h[c+2]=K,K=K>>8,h[c+1]=K,K=K>>8,h[c]=K,c+8}i.prototype.writeBigUInt64LE=wt(function(u,c=0){return D(this,u,c,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=wt(function(u,c=0){return Z(this,u,c,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(u,c,_,I){if(u=+u,c=c>>>0,!I){let Je=Math.pow(2,8*_-1);he(this,u,c,_,Je-1,-Je)}let N=0,K=1,xe=0;for(this[c]=u&255;++N<_&&(K*=256);)u<0&&xe===0&&this[c+N-1]!==0&&(xe=1),this[c+N]=(u/K>>0)-xe&255;return c+_},i.prototype.writeIntBE=function(u,c,_,I){if(u=+u,c=c>>>0,!I){let Je=Math.pow(2,8*_-1);he(this,u,c,_,Je-1,-Je)}let N=_-1,K=1,xe=0;for(this[c+N]=u&255;--N>=0&&(K*=256);)u<0&&xe===0&&this[c+N+1]!==0&&(xe=1),this[c+N]=(u/K>>0)-xe&255;return c+_},i.prototype.writeInt8=function(u,c,_){return u=+u,c=c>>>0,_||he(this,u,c,1,127,-128),u<0&&(u=255+u+1),this[c]=u&255,c+1},i.prototype.writeInt16LE=function(u,c,_){return u=+u,c=c>>>0,_||he(this,u,c,2,32767,-32768),this[c]=u&255,this[c+1]=u>>>8,c+2},i.prototype.writeInt16BE=function(u,c,_){return u=+u,c=c>>>0,_||he(this,u,c,2,32767,-32768),this[c]=u>>>8,this[c+1]=u&255,c+2},i.prototype.writeInt32LE=function(u,c,_){return u=+u,c=c>>>0,_||he(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,_){return u=+u,c=c>>>0,_||he(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=wt(function(u,c=0){return D(this,u,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=wt(function(u,c=0){return Z(this,u,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(h,u,c,_,I,N){if(c+_>h.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function fe(h,u,c,_,I){return u=+u,c=c>>>0,I||F(h,u,c,4),e.write(h,u,c,_,23,4),c+4}i.prototype.writeFloatLE=function(u,c,_){return fe(this,u,c,!0,_)},i.prototype.writeFloatBE=function(u,c,_){return fe(this,u,c,!1,_)};function ve(h,u,c,_,I){return u=+u,c=c>>>0,I||F(h,u,c,8),e.write(h,u,c,_,52,8),c+8}i.prototype.writeDoubleLE=function(u,c,_){return ve(this,u,c,!0,_)},i.prototype.writeDoubleBE=function(u,c,_){return ve(this,u,c,!1,_)},i.prototype.copy=function(u,c,_,I){if(!i.isBuffer(u))throw new TypeError("argument should be a Buffer");if(_||(_=0),!I&&I!==0&&(I=this.length),c>=u.length&&(c=u.length),c||(c=0),I>0&&I<_&&(I=_),I===_||u.length===0||this.length===0)return 0;if(c<0)throw new RangeError("targetStart out of bounds");if(_<0||_>=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-_&&(I=u.length-c+_);let N=I-_;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(c,_,I):Uint8Array.prototype.set.call(u,this.subarray(_,I),c),N},i.prototype.fill=function(u,c,_,I){if(typeof u=="string"){if(typeof c=="string"?(I=c,c=0,_=this.length):typeof _=="string"&&(I=_,_=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 K=u.charCodeAt(0);(I==="utf8"&&K<128||I==="latin1")&&(u=K)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(c<0||this.length<c||this.length<_)throw new RangeError("Out of range index");if(_<=c)return this;c=c>>>0,_=_===void 0?this.length:_>>>0,u||(u=0);let N;if(typeof u=="number")for(N=c;N<_;++N)this[N]=u;else{let K=i.isBuffer(u)?u:i.from(u,I),xe=K.length;if(xe===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(N=0;N<_-c;++N)this[N+c]=K[N%xe]}return this};let C={};function S(h,u,c){C[h]=class extends c{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${h}]`,this.stack,delete this.name}get code(){return h}set code(I){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:I,writable:!0})}toString(){return`${this.name} [${h}]: ${this.message}`}}}S("ERR_BUFFER_OUT_OF_BOUNDS",function(h){return h?`${h} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),S("ERR_INVALID_ARG_TYPE",function(h,u){return`The "${h}" argument must be of type number. Received type ${typeof u}`},TypeError),S("ERR_OUT_OF_RANGE",function(h,u,c){let _=`The value of "${h}" is out of range.`,I=c;return Number.isInteger(c)&&Math.abs(c)>2**32?I=j(String(c)):typeof c=="bigint"&&(I=String(c),(c>BigInt(2)**BigInt(32)||c<-(BigInt(2)**BigInt(32)))&&(I=j(I)),I+="n"),_+=` It must be ${u}. Received ${I}`,_},RangeError);function j(h){let u="",c=h.length,_=h[0]==="-"?1:0;for(;c>=_+4;c-=3)u=`_${h.slice(c-3,c)}${u}`;return`${h.slice(0,c)}${u}`}function V(h,u,c){b(u,"offset"),(h[u]===void 0||h[u+c]===void 0)&&w(u,h.length-(c+1))}function ae(h,u,c,_,I,N){if(h>c||h<u){let K=typeof u=="bigint"?"n":"",xe;throw u===0||u===BigInt(0)?xe=`>= 0${K} and < 2${K} ** ${(N+1)*8}${K}`:xe=`>= -(2${K} ** ${(N+1)*8-1}${K}) and < 2 ** ${(N+1)*8-1}${K}`,new C.ERR_OUT_OF_RANGE("value",xe,h)}V(_,I,N)}function b(h,u){if(typeof h!="number")throw new C.ERR_INVALID_ARG_TYPE(u,"number",h)}function w(h,u,c){throw Math.floor(h)!==h?(b(h,c),new C.ERR_OUT_OF_RANGE("offset","an integer",h)):u<0?new C.ERR_BUFFER_OUT_OF_BOUNDS:new C.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${u}`,h)}let W=/[^+/0-9A-Za-z-_]/g;function Q(h){if(h=h.split("=")[0],h=h.trim().replace(W,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function Ue(h,u){u=u||1/0;let c,_=h.length,I=null,N=[];for(let K=0;K<_;++K){if(c=h.charCodeAt(K),c>55295&&c<57344){if(!I){if(c>56319){(u-=3)>-1&&N.push(239,191,189);continue}else if(K+1===_){(u-=3)>-1&&N.push(239,191,189);continue}I=c;continue}if(c<56320){(u-=3)>-1&&N.push(239,191,189),I=c;continue}c=(I-55296<<10|c-56320)+65536}else I&&(u-=3)>-1&&N.push(239,191,189);if(I=null,c<128){if((u-=1)<0)break;N.push(c)}else if(c<2048){if((u-=2)<0)break;N.push(c>>6|192,c&63|128)}else if(c<65536){if((u-=3)<0)break;N.push(c>>12|224,c>>6&63|128,c&63|128)}else if(c<1114112){if((u-=4)<0)break;N.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw new Error("Invalid code point")}return N}function Te(h){let u=[];for(let c=0;c<h.length;++c)u.push(h.charCodeAt(c)&255);return u}function H(h,u){let c,_,I,N=[];for(let K=0;K<h.length&&!((u-=2)<0);++K)c=h.charCodeAt(K),_=c>>8,I=c%256,N.push(I),N.push(_);return N}function Et(h){return t.toByteArray(Q(h))}function It(h,u,c,_){let I;for(I=0;I<_&&!(I+c>=u.length||I>=h.length);++I)u[I+c]=h[I];return I}function vt(h,u){return h instanceof u||h!=null&&h.constructor!=null&&h.constructor.name!=null&&h.constructor.name===u.name}function vr(h){return h!==h}let Qr=function(){let h="0123456789abcdef",u=new Array(256);for(let c=0;c<16;++c){let _=c*16;for(let I=0;I<16;++I)u[_+I]=h[c]+h[I]}return u}();function wt(h){return typeof BigInt>"u"?Tr:h}function Tr(){throw new Error("BigInt not supported")}return dn}var br,fc,ii,dc,dn,pc,oi=it(()=>{A();O();R();br={},fc=!1;ii={},dc=!1;dn={},pc=!1});var pn,G,BI,EI,gc=it(()=>{A();O();R();oi();pn=Ct();pn.Buffer;pn.SlowBuffer;pn.INSPECT_MAX_BYTES;pn.kMaxLength;G=pn.Buffer,BI=pn.INSPECT_MAX_BYTES,EI=pn.kMaxLength});var O=it(()=>{gc()});var Pc=ql(Be=>{"use strict";A();O();R();var wr=Symbol.for("react.element"),$v=Symbol.for("react.portal"),Zv=Symbol.for("react.fragment"),Lv=Symbol.for("react.strict_mode"),Fv=Symbol.for("react.profiler"),Kv=Symbol.for("react.provider"),Wv=Symbol.for("react.context"),qv=Symbol.for("react.forward_ref"),zv=Symbol.for("react.suspense"),Gv=Symbol.for("react.memo"),Vv=Symbol.for("react.lazy"),yc=Symbol.iterator;function Jv(t){return t===null||typeof t!="object"?null:(t=yc&&t[yc]||t["@@iterator"],typeof t=="function"?t:null)}var vc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Tc=Object.assign,_c={};function $n(t,e,n){this.props=t,this.context=e,this.refs=_c,this.updater=n||vc}$n.prototype.isReactComponent={};$n.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};$n.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function bc(){}bc.prototype=$n.prototype;function Qo(t,e,n){this.props=t,this.context=e,this.refs=_c,this.updater=n||vc}var ea=Qo.prototype=new bc;ea.constructor=Qo;Tc(ea,$n.prototype);ea.isPureReactComponent=!0;var mc=Array.isArray,wc=Object.prototype.hasOwnProperty,ta={current:null},xc={key:!0,ref:!0,__self:!0,__source:!0};function Bc(t,e,n){var r,o={},a=null,i=null;if(e!=null)for(r in e.ref!==void 0&&(i=e.ref),e.key!==void 0&&(a=""+e.key),e)wc.call(e,r)&&!xc.hasOwnProperty(r)&&(o[r]=e[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1<s){for(var l=Array(s),f=0;f<s;f++)l[f]=arguments[f+2];o.children=l}if(t&&t.defaultProps)for(r in s=t.defaultProps,s)o[r]===void 0&&(o[r]=s[r]);return{$$typeof:wr,type:t,key:a,ref:i,props:o,_owner:ta.current}}function Yv(t,e){return{$$typeof:wr,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function na(t){return typeof t=="object"&&t!==null&&t.$$typeof===wr}function Xv(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var hc=/\/+/g;function Xo(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Xv(""+t.key):e.toString(36)}function si(t,e,n,r,o){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case wr:case $v:i=!0}}if(i)return i=t,o=o(i),t=r===""?"."+Xo(i,0):r,mc(o)?(n="",t!=null&&(n=t.replace(hc,"$&/")+"/"),si(o,e,n,"",function(f){return f})):o!=null&&(na(o)&&(o=Yv(o,n+(!o.key||i&&i.key===o.key?"":(""+o.key).replace(hc,"$&/")+"/")+t)),e.push(o)),1;if(i=0,r=r===""?".":r+":",mc(t))for(var s=0;s<t.length;s++){a=t[s];var l=r+Xo(a,s);i+=si(a,e,n,l,o)}else if(l=Jv(t),typeof l=="function")for(t=l.call(t),s=0;!(a=t.next()).done;)a=a.value,l=r+Xo(a,s++),i+=si(a,e,n,l,o);else if(a==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return i}function ai(t,e,n){if(t==null)return t;var r=[],o=0;return si(t,r,"","",function(a){return e.call(n,a,o++)}),r}function Qv(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var ut={current:null},li={transition:null},eT={ReactCurrentDispatcher:ut,ReactCurrentBatchConfig:li,ReactCurrentOwner:ta};function Ec(){throw Error("act(...) is not supported in production builds of React.")}Be.Children={map:ai,forEach:function(t,e,n){ai(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return ai(t,function(){e++}),e},toArray:function(t){return ai(t,function(e){return e})||[]},only:function(t){if(!na(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Be.Component=$n;Be.Fragment=Zv;Be.Profiler=Fv;Be.PureComponent=Qo;Be.StrictMode=Lv;Be.Suspense=zv;Be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=eT;Be.act=Ec;Be.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=Tc({},t.props),o=t.key,a=t.ref,i=t._owner;if(e!=null){if(e.ref!==void 0&&(a=e.ref,i=ta.current),e.key!==void 0&&(o=""+e.key),t.type&&t.type.defaultProps)var s=t.type.defaultProps;for(l in e)wc.call(e,l)&&!xc.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&s!==void 0?s[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){s=Array(l);for(var f=0;f<l;f++)s[f]=arguments[f+2];r.children=s}return{$$typeof:wr,type:t.type,key:o,ref:a,props:r,_owner:i}};Be.createContext=function(t){return t={$$typeof:Wv,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Kv,_context:t},t.Consumer=t};Be.createElement=Bc;Be.createFactory=function(t){var e=Bc.bind(null,t);return e.type=t,e};Be.createRef=function(){return{current:null}};Be.forwardRef=function(t){return{$$typeof:qv,render:t}};Be.isValidElement=na;Be.lazy=function(t){return{$$typeof:Vv,_payload:{_status:-1,_result:t},_init:Qv}};Be.memo=function(t,e){return{$$typeof:Gv,type:t,compare:e===void 0?null:e}};Be.startTransition=function(t){var e=li.transition;li.transition={};try{t()}finally{li.transition=e}};Be.unstable_act=Ec;Be.useCallback=function(t,e){return ut.current.useCallback(t,e)};Be.useContext=function(t){return ut.current.useContext(t)};Be.useDebugValue=function(){};Be.useDeferredValue=function(t){return ut.current.useDeferredValue(t)};Be.useEffect=function(t,e){return ut.current.useEffect(t,e)};Be.useId=function(){return ut.current.useId()};Be.useImperativeHandle=function(t,e,n){return ut.current.useImperativeHandle(t,e,n)};Be.useInsertionEffect=function(t,e){return ut.current.useInsertionEffect(t,e)};Be.useLayoutEffect=function(t,e){return ut.current.useLayoutEffect(t,e)};Be.useMemo=function(t,e){return ut.current.useMemo(t,e)};Be.useReducer=function(t,e,n){return ut.current.useReducer(t,e,n)};Be.useRef=function(t){return ut.current.useRef(t)};Be.useState=function(t){return ut.current.useState(t)};Be.useSyncExternalStore=function(t,e,n){return ut.current.useSyncExternalStore(t,e,n)};Be.useTransition=function(){return ut.current.useTransition()};Be.version="18.3.1"});var Zn=ql((NI,kc)=>{"use strict";A();O();R();kc.exports=Pc()});function At(){return Dy||(Dy=!0,typeof Object.create=="function"?_o=function(e,n){n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:_o=function(e,n){if(n){e.super_=n;var r=function(){};r.prototype=n.prototype,e.prototype=new r,e.prototype.constructor=e}}),_o}var _o,Dy,os=it(()=>{A();O();R();_o={},Dy=!1});function He(){He.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 Wy(t){return t._maxListeners===void 0?He.defaultMaxListeners:t._maxListeners}function jy(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=Wy(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 oE(){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 $y(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},o=oE.bind(r);return o.listener=n,r.wrapFn=o,o}function Zy(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,Ky,or,Ny,Uy,Hy,yt,as=it(()=>{A();O();R();or=typeof Reflect=="object"?Reflect:null,Ny=or&&typeof or.apply=="function"?or.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};Ky=or&&typeof or.ownKeys=="function"?or.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=He,He.EventEmitter=He,He.prototype._events=void 0,He.prototype._eventsCount=0,He.prototype._maxListeners=void 0;Hy=10;Object.defineProperty(He,"defaultMaxListeners",{enumerable:!0,get:function(){return Hy},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+".");Hy=t}}),He.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},He.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},He.prototype.getMaxListeners=function(){return Wy(this)},He.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")Ny(s,this,e);else{var l=s.length,f=qy(s,l);for(n=0;n<l;++n)Ny(f[n],this,e)}return!0},He.prototype.addListener=function(t,e){return jy(this,t,e,!1)},He.prototype.on=He.prototype.addListener,He.prototype.prependListener=function(t,e){return jy(this,t,e,!0)},He.prototype.once=function(t,e){return bo(e),this.on(t,$y(this,t,e)),this},He.prototype.prependOnceListener=function(t,e){return bo(e),this.prependListener(t,$y(this,t,e)),this},He.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},He.prototype.off=He.prototype.removeListener,He.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},He.prototype.listeners=function(t){return Zy(this,t,!0)},He.prototype.rawListeners=function(t){return Zy(this,t,!1)},He.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Ly.call(t,e)},He.prototype.listenerCount=Ly,He.prototype.eventNames=function(){return this._eventsCount>0?Ky(this._events):[]};yt=Fy;yt.EventEmitter;yt.defaultMaxListeners;yt.init;yt.listenerCount;yt.EventEmitter;yt.defaultMaxListeners;yt.init;yt.listenerCount});var zy=it(()=>{A();O();R();as();yt.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)})};yt.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 d=Promise.reject(o);return o=null,d}return a?createIterResult(void 0,!0):new Promise((d,y)=>r.push({resolve:d,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 d=r.shift();d?d.resolve(createIterResult(f,!1)):n.push(f)}function l(f){a=!0;let d=r.shift();d?d.reject(f):o=f,i.return()}}});function fs(){throw new Error("setTimeout has not been defined")}function ds(){throw new Error("clearTimeout has not been defined")}function sm(t){if(qt===setTimeout)return setTimeout(t,0);if((qt===fs||!qt)&&setTimeout)return qt=setTimeout,setTimeout(t,0);try{return qt(t,0)}catch{try{return qt.call(null,t,0)}catch{return qt.call(this||sr,t,0)}}}function aE(){ar&&In&&(ar=!1,In.length?Gt=In.concat(Gt):ko=-1,Gt.length&&lm())}function lm(){if(!ar){var t=sm(aE);ar=!0;for(var e=Gt.length;e;){for(In=Gt,Gt=[];++ko<e;)In&&In[ko].run();ko=-1,e=Gt.length}In=null,ar=!1,function(n){if(zt===clearTimeout)return clearTimeout(n);if((zt===ds||!zt)&&clearTimeout)return zt=clearTimeout,clearTimeout(n);try{zt(n)}catch{try{return zt.call(null,n)}catch{return zt.call(this||sr,n)}}}(t)}}function Gy(t,e){(this||sr).fun=t,(this||sr).array=e}function Wt(){}function An(t){return t.call.bind(t)}function Kr(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}function Jy(t){return mt&&_t?xt(t)!==void 0:gm(t)||ym(t)||mm(t)||hm(t)||vm(t)||Tm(t)||_m(t)||bm(t)||wm(t)||xm(t)||Bm(t)}function gm(t){return mt&&_t?xt(t)==="Uint8Array":Ge(t)==="[object Uint8Array]"||mE(t)&&t.buffer!==void 0}function ym(t){return mt&&_t?xt(t)==="Uint8ClampedArray":Ge(t)==="[object Uint8ClampedArray]"}function mm(t){return mt&&_t?xt(t)==="Uint16Array":Ge(t)==="[object Uint16Array]"}function hm(t){return mt&&_t?xt(t)==="Uint32Array":Ge(t)==="[object Uint32Array]"}function vm(t){return mt&&_t?xt(t)==="Int8Array":Ge(t)==="[object Int8Array]"}function Tm(t){return mt&&_t?xt(t)==="Int16Array":Ge(t)==="[object Int16Array]"}function _m(t){return mt&&_t?xt(t)==="Int32Array":Ge(t)==="[object Int32Array]"}function bm(t){return mt&&_t?xt(t)==="Float32Array":Ge(t)==="[object Float32Array]"}function wm(t){return mt&&_t?xt(t)==="Float64Array":Ge(t)==="[object Float64Array]"}function xm(t){return mt&&_t?xt(t)==="BigInt64Array":Ge(t)==="[object BigInt64Array]"}function Bm(t){return mt&&_t?xt(t)==="BigUint64Array":Ge(t)==="[object BigUint64Array]"}function wo(t){return Ge(t)==="[object Map]"}function xo(t){return Ge(t)==="[object Set]"}function Bo(t){return Ge(t)==="[object WeakMap]"}function ss(t){return Ge(t)==="[object WeakSet]"}function Io(t){return Ge(t)==="[object ArrayBuffer]"}function Yy(t){return typeof ArrayBuffer<"u"&&(Io.working?Io(t):t instanceof ArrayBuffer)}function Co(t){return Ge(t)==="[object DataView]"}function Xy(t){return typeof DataView<"u"&&(Co.working?Co(t):t instanceof DataView)}function Ao(t){return Ge(t)==="[object SharedArrayBuffer]"}function Qy(t){return typeof SharedArrayBuffer<"u"&&(Ao.working?Ao(t):t instanceof SharedArrayBuffer)}function em(t){return Kr(t,bE)}function tm(t){return Kr(t,wE)}function nm(t){return Kr(t,xE)}function rm(t){return pm&&Kr(t,BE)}function im(t){return gs&&Kr(t,EE)}function an(t,e){var n={seen:[],stylize:SE};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),ys(e)?n.showHidden=e:e&&L._extend(n,e),Cn(n.showHidden)&&(n.showHidden=!1),Cn(n.depth)&&(n.depth=2),Cn(n.colors)&&(n.colors=!1),Cn(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=kE),Ro(n,t,n.depth)}function kE(t,e){var n=an.styles[e];return n?"\x1B["+an.colors[n][0]+"m"+t+"\x1B["+an.colors[n][1]+"m":t}function SE(t,e){return t}function Ro(t,e,n){if(t.customInspect&&e&&So(e.inspect)&&e.inspect!==L.inspect&&(!e.constructor||e.constructor.prototype!==e)){var r=e.inspect(n,t);return Oo(r)||(r=Ro(t,r,n)),r}var o=function(g,m){if(Cn(m))return g.stylize("undefined","undefined");if(Oo(m)){var v="'"+JSON.stringify(m).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return g.stylize(v,"string")}if(km(m))return g.stylize(""+m,"number");if(ys(m))return g.stylize(""+m,"boolean");if(No(m))return g.stylize("null","null")}(t,e);if(o)return o;var a=Object.keys(e),i=function(g){var m={};return g.forEach(function(v,B){m[v]=!0}),m}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),Fr(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return ls(e);if(a.length===0){if(So(e)){var s=e.name?": "+e.name:"";return t.stylize("[Function"+s+"]","special")}if(Lr(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Mo(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Fr(e))return ls(e)}var l,f="",d=!1,y=["{","}"];return Pm(e)&&(d=!0,y=["[","]"]),So(e)&&(f=" [Function"+(e.name?": "+e.name:"")+"]"),Lr(e)&&(f=" "+RegExp.prototype.toString.call(e)),Mo(e)&&(f=" "+Date.prototype.toUTCString.call(e)),Fr(e)&&(f=" "+ls(e)),a.length!==0||d&&e.length!=0?n<0?Lr(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),l=d?function(g,m,v,B,E){for(var T=[],k=0,P=m.length;k<P;++k)Sm(m,String(k))?T.push(us(g,m,v,B,String(k),!0)):T.push("");return E.forEach(function(M){M.match(/^\d+$/)||T.push(us(g,m,v,B,M,!0))}),T}(t,e,n,i,a):a.map(function(g){return us(t,e,n,i,g,d)}),t.seen.pop(),function(g,m,v){var B=0;return g.reduce(function(E,T){return B++,T.indexOf(`
2
+ `)>=0&&B++,E+T.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?v[0]+(m===""?"":m+`
3
+ `)+" "+g.join(`,
4
+ `)+" "+v[1]:v[0]+m+" "+g.join(", ")+" "+v[1]}(l,f,y)):y[0]+f+y[1]}function ls(t){return"["+Error.prototype.toString.call(t)+"]"}function us(t,e,n,r,o,a){var i,s,l;if((l=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),Sm(r,o)||(i="["+o+"]"),s||(t.seen.indexOf(l.value)<0?(s=No(n)?Ro(t,l.value,null):Ro(t,l.value,n-1)).indexOf(`
5
+ `)>-1&&(s=a?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")),In(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 bm(t){return Array.isArray(t)}function us(t){return typeof t=="boolean"}function Ra(t){return t===null}function _m(t){return typeof t=="number"}function Sa(t){return typeof t=="string"}function In(t){return t===void 0}function Ur(t){return ar(t)&&cs(t)==="[object RegExp]"}function ar(t){return typeof t=="object"&&t!==null}function Aa(t){return ar(t)&&cs(t)==="[object Date]"}function jr(t){return ar(t)&&(cs(t)==="[object Error]"||t instanceof Error)}function wa(t){return typeof t=="function"}function cs(t){return Object.prototype.toString.call(t)}function is(t){return t<10?"0"+t.toString(10):t.toString(10)}function wB(){var t=new Date,e=[is(t.getHours()),is(t.getMinutes()),is(t.getSeconds())].join(":");return[t.getDate(),xB[t.getMonth()],e].join(" ")}function xm(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function EB(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}var em,zt,Gt,ir,et,Pn,Vt,rr,xa,Ke,eB,ss,Ca,rm,tB,nB,rB,iB,aB,im,am,Fy,oB,sB,lB,om,Be,uB,cB,fB,sm,ls,Tt,yt,dB,Ve,gB,yB,mB,Hr,L,Rt,Qy,TB,ba,Tm,_a,xB,Bn,CC,ka=it(()=>{R();O();k();ir=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,et=em={};(function(){try{zt=typeof setTimeout=="function"?setTimeout:as}catch{zt=as}try{Gt=typeof clearTimeout=="function"?clearTimeout:os}catch{Gt=os}})();Vt=[],rr=!1,xa=-1;et.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];Vt.push(new Ly(t,e)),Vt.length!==1||rr||tm(nm)},Ly.prototype.run=function(){(this||ir).fun.apply(null,(this||ir).array)},et.title="browser",et.browser=!0,et.env={},et.argv=[],et.version="",et.versions={},et.on=qt,et.addListener=qt,et.once=qt,et.off=qt,et.removeListener=qt,et.removeAllListeners=qt,et.emit=qt,et.prependListener=qt,et.prependOnceListener=qt,et.listeners=function(t){return[]},et.binding=function(t){throw new Error("process.binding is not supported")},et.cwd=function(){return"/"},et.chdir=function(t){throw new Error("process.chdir is not supported")},et.umask=function(){return 0};Ke=em;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;eB=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",ss=Object.prototype.toString,Ca=function(t){return!(eB&&t&&typeof t=="object"&&Symbol.toStringTag in t)&&ss.call(t)==="[object Arguments]"},rm=function(t){return!!Ca(t)||t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&ss.call(t)!=="[object Array]"&&ss.call(t.callee)==="[object Function]"},tB=function(){return Ca(arguments)}();Ca.isLegacyArguments=rm;nB=tB?Ca:rm,rB=Object.prototype.toString,iB=Function.prototype.toString,aB=/^\s*(?:function)?\*/,im=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",am=Object.getPrototypeOf,Fy=function(){if(!im)return!1;try{return Function("return function*() {}")()}catch{}}(),oB=Fy?am(Fy):{},sB=function(t){return typeof t=="function"&&(!!aB.test(iB.call(t))||(im?am(t)===oB:rB.call(t)==="[object GeneratorFunction]"))},lB=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}},om=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"},Be={},uB=om,cB=nB,fB=sB;sm=typeof BigInt<"u",ls=typeof Symbol<"u",Tt=ls&&Symbol.toStringTag!==void 0,yt=typeof Uint8Array<"u",dB=typeof ArrayBuffer<"u";if(yt&&Tt)var pB=Object.getPrototypeOf(Uint8Array.prototype),xt=Sn(Object.getOwnPropertyDescriptor(pB,Symbol.toStringTag).get);Ve=Sn(Object.prototype.toString),gB=Sn(Number.prototype.valueOf),yB=Sn(String.prototype.valueOf),mB=Sn(Boolean.prototype.valueOf);if(sm)var hB=Sn(BigInt.prototype.valueOf);if(ls)var vB=Sn(Symbol.prototype.valueOf);Be.isArgumentsObject=cB,Be.isGeneratorFunction=fB,Be.isPromise=function(t){return typeof Promise<"u"&&t instanceof Promise||t!==null&&typeof t=="object"&&typeof t.then=="function"&&typeof t.catch=="function"},Be.isArrayBufferView=function(t){return dB&&ArrayBuffer.isView?ArrayBuffer.isView(t):Ky(t)||zy(t)},Be.isTypedArray=Ky,Be.isUint8Array=lm,Be.isUint8ClampedArray=um,Be.isUint16Array=cm,Be.isUint32Array=fm,Be.isInt8Array=dm,Be.isInt16Array=pm,Be.isInt32Array=gm,Be.isFloat32Array=ym,Be.isFloat64Array=mm,Be.isBigInt64Array=hm,Be.isBigUint64Array=vm,ha.working=typeof Map<"u"&&ha(new Map),Be.isMap=function(t){return typeof Map<"u"&&(ha.working?ha(t):t instanceof Map)},va.working=typeof Set<"u"&&va(new Set),Be.isSet=function(t){return typeof Set<"u"&&(va.working?va(t):t instanceof Set)},Ta.working=typeof WeakMap<"u"&&Ta(new WeakMap),Be.isWeakMap=function(t){return typeof WeakMap<"u"&&(Ta.working?Ta(t):t instanceof WeakMap)},ts.working=typeof WeakSet<"u"&&ts(new WeakSet),Be.isWeakSet=function(t){return ts(t)},Ea.working=typeof ArrayBuffer<"u"&&Ea(new ArrayBuffer),Be.isArrayBuffer=qy,Ba.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Ba(new DataView(new ArrayBuffer(1),0,1)),Be.isDataView=zy,Pa.working=typeof SharedArrayBuffer<"u"&&Pa(new SharedArrayBuffer),Be.isSharedArrayBuffer=Gy,Be.isAsyncFunction=function(t){return Ve(t)==="[object AsyncFunction]"},Be.isMapIterator=function(t){return Ve(t)==="[object Map Iterator]"},Be.isSetIterator=function(t){return Ve(t)==="[object Set Iterator]"},Be.isGeneratorObject=function(t){return Ve(t)==="[object Generator]"},Be.isWebAssemblyCompiledModule=function(t){return Ve(t)==="[object WebAssembly.Module]"},Be.isNumberObject=Vy,Be.isStringObject=Wy,Be.isBooleanObject=Jy,Be.isBigIntObject=Yy,Be.isSymbolObject=Xy,Be.isBoxedPrimitive=function(t){return Vy(t)||Wy(t)||Jy(t)||Yy(t)||Xy(t)},Be.isAnyArrayBuffer=function(t){return yt&&(qy(t)||Gy(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(Be,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})});Hr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,L={},Rt=Ke,Qy=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},TB=/%[sdj%]/g;L.format=function(t){if(!Sa(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(an(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,a=r.length,o=String(t).replace(TB,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])Ra(i)||!ar(i)?o+=" "+i:o+=" "+an(i);return o},L.deprecate=function(t,e){if(Rt!==void 0&&Rt.noDeprecation===!0)return t;if(Rt===void 0)return function(){return L.deprecate(t,e).apply(this||Hr,arguments)};var n=!1;return function(){if(!n){if(Rt.throwDeprecation)throw new Error(e);Rt.traceDeprecation?console.trace(e):console.error(e),n=!0}return t.apply(this||Hr,arguments)}};ba={},Tm=/^$/;Rt.env.NODE_DEBUG&&(_a=Rt.env.NODE_DEBUG,_a=_a.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),Tm=new RegExp("^"+_a+"$","i"));L.debuglog=function(t){if(t=t.toUpperCase(),!ba[t])if(Tm.test(t)){var e=Rt.pid;ba[t]=function(){var n=L.format.apply(L,arguments);console.error("%s %d: %s",t,e,n)}}else ba[t]=function(){};return ba[t]},L.inspect=an,an.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]},an.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},L.types=Be,L.isArray=bm,L.isBoolean=us,L.isNull=Ra,L.isNullOrUndefined=function(t){return t==null},L.isNumber=_m,L.isString=Sa,L.isSymbol=function(t){return typeof t=="symbol"},L.isUndefined=In,L.isRegExp=Ur,L.types.isRegExp=Ur,L.isObject=ar,L.isDate=Aa,L.types.isDate=Aa,L.isError=jr,L.types.isNativeError=jr,L.isFunction=wa,L.isPrimitive=function(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||t===void 0},L.isBuffer=om;xB=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];L.log=function(){console.log("%s - %s",wB(),L.format.apply(L,arguments))},L.inherits=lB,L._extend=function(t,e){if(!e||!ar(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t};Bn=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(Bn&&t[Bn]){var e;if(typeof(e=t[Bn])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Bn,{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||Hr,o)}catch(s){r(s)}return a}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Bn&&Object.defineProperty(e,Bn,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,Qy(t))},L.promisify.custom=Bn,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||Hr,i=function(){return a.apply(o,arguments)};t.apply(this||Hr,n).then(function(s){Rt.nextTick(i.bind(null,null,s))},function(s){Rt.nextTick(EB.bind(null,s,i))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,Qy(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;CC=L.promisify;L.types});var NC,wm=it(()=>{R();O();k();ka();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;NC=L.promisify;L.types;L.TextEncoder=globalThis.TextEncoder;L.TextDecoder=globalThis.TextDecoder});function gs(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function BB(){!or||!An||(or=!1,An.length?Wt=An.concat(Wt):Oa=-1,Wt.length&&Em())}function Em(){if(!or){var t=setTimeout(BB,0);or=!0;for(var e=Wt.length;e;){for(An=Wt,Wt=[];++Oa<e;)An&&An[Oa].run();Oa=-1,e=Wt.length}An=null,or=!1,clearTimeout(t)}}function PB(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];Wt.push(new Bm(t,e)),Wt.length===1&&!or&&setTimeout(Em,0)}function Bm(t,e){this.fun=t,this.array=e}function st(){}function FB(t){gs("_linkedBinding")}function GB(t){gs("dlopen")}function VB(){return[]}function WB(){return[]}function iP(t,e){if(!t)throw new Error(e||"assertion error")}function lP(){return!1}function BP(){return on.now()/1e3}function ps(t){var e=Math.floor((Date.now()-on.now())*.001),n=on.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+=ds)),[r,a]}function sn(){return Pt}function HP(t){return[]}var Wt,or,An,Oa,IB,SB,AB,CB,RB,kB,OB,MB,DB,NB,HB,UB,jB,$B,ZB,LB,KB,qB,zB,JB,YB,ys,XB,QB,eP,tP,nP,rP,aP,oP,sP,uP,cP,fP,dP,pP,gP,yP,mP,hP,vP,TP,bP,_P,xP,wP,EP,on,fs,ds,PP,IP,SP,AP,CP,RP,kP,OP,MP,DP,NP,Pt,ms=it(()=>{R();O();k();Wt=[],or=!1,Oa=-1;Bm.prototype.run=function(){this.fun.apply(null,this.array)};IB="browser",SB="x64",AB="browser",CB={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},RB=["/usr/bin/node"],kB=[],OB="v16.8.0",MB={},DB=function(t,e){console.warn((e?e+": ":"")+t)},NB=function(t){gs("binding")},HB=function(t){return 0},UB=function(){return"/"},jB=function(t){},$B={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};ZB=st,LB=[];KB={},qB=!1,zB={};JB=st,YB=st,ys=function(){return{}},XB=ys,QB=ys,eP=st,tP=st,nP=st,rP={};aP={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},oP=st,sP=st;uP=st,cP=st,fP=st,dP=st,pP=st,gP=void 0,yP=void 0,mP=void 0,hP=st,vP=2,TP=1,bP="/bin/usr/node",_P=9229,xP="node",wP=[],EP=st,on={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};on.now===void 0&&(fs=Date.now(),on.timing&&on.timing.navigationStart&&(fs=on.timing.navigationStart),on.now=()=>Date.now()-fs);ds=1e9;ps.bigint=function(t){var e=ps(t);return typeof BigInt>"u"?e[0]*ds+e[1]:BigInt(e[0]*ds)+BigInt(e[1])};PP=10,IP={},SP=0;AP=sn,CP=sn,RP=sn,kP=sn,OP=sn,MP=st,DP=sn,NP=sn;Pt={version:OB,versions:MB,arch:SB,platform:AB,release:$B,_rawDebug:ZB,moduleLoadList:LB,binding:NB,_linkedBinding:FB,_events:IP,_eventsCount:SP,_maxListeners:PP,on:sn,addListener:AP,once:CP,off:RP,removeListener:kP,removeAllListeners:OP,emit:MP,prependListener:DP,prependOnceListener:NP,listeners:HP,domain:KB,_exiting:qB,config:zB,dlopen:GB,uptime:BP,_getActiveRequests:VB,_getActiveHandles:WB,reallyExit:JB,_kill:YB,cpuUsage:ys,resourceUsage:XB,memoryUsage:QB,kill:eP,exit:tP,openStdin:nP,allowedNodeEnvironmentFlags:rP,assert:iP,features:aP,_fatalExceptions:oP,setUncaughtExceptionCaptureCallback:sP,hasUncaughtExceptionCaptureCallback:lP,emitWarning:DB,nextTick:PB,_tickCallback:uP,_debugProcess:cP,_debugEnd:fP,_startProfilerIdleNotifier:dP,_stopProfilerIdleNotifier:pP,stdout:gP,stdin:mP,stderr:yP,abort:hP,umask:HB,chdir:jB,cwd:UB,env:CB,title:IB,argv:RB,execArgv:kB,pid:vP,ppid:TP,execPath:bP,debugPort:_P,hrtime:ps,argv0:xP,_preload_modules:wP,setSourceMapsEnabled:EP}});function Im(){if(Pm)return hs;Pm=!0,hs=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||vs,arguments)}return o}function e(n){try{if(!vs.localStorage)return!1}catch{return!1}var r=vs.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return hs}var hs,Pm,vs,Sm=it(()=>{R();O();k();hs={},Pm=!1,vs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global});function UP(){if(Am)return Zr;Am=!0;var t=At(),e=t.Buffer;function n(a,o){for(var i in a)o[i]=a[i]}e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?Zr=t:(n(t,Zr),Zr.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)},Zr}function jP(){if(Cm)return Ts;Cm=!0;var t=UP().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 I;;)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(I)return;v=(""+v).toLowerCase(),I=!0}}function r(v){var I=n(v);if(typeof I!="string"&&(t.isEncoding===e||!e(v)))throw new Error("Unknown encoding: "+v);return I||v}Ts.StringDecoder=a;function a(v){this.encoding=r(v);var I;switch(this.encoding){case"utf16le":this.text=y,this.end=p,I=4;break;case"utf8":this.fillLast=l,I=4;break;case"base64":this.text=m,this.end=_,I=3;break;default:this.write=E,this.end=B;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(I)}a.prototype.write=function(v){if(v.length===0)return"";var I,P;if(this.lastNeed){if(I=this.fillLast(v),I===void 0)return"";P=this.lastNeed,this.lastNeed=0}else P=0;return P<v.length?I?I+this.text(v,P):this.text(v,P):I||""},a.prototype.end=g,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,I,P){var D=I.length-1;if(D<P)return 0;var $=o(I[D]);return $>=0?($>0&&(v.lastNeed=$-1),$):--D<P||$===-2?0:($=o(I[D]),$>=0?($>0&&(v.lastNeed=$-2),$):--D<P||$===-2?0:($=o(I[D]),$>=0?($>0&&($===2?$=0:v.lastNeed=$-3),$):0))}function s(v,I,P){if((I[0]&192)!==128)return v.lastNeed=0,"\uFFFD";if(v.lastNeed>1&&I.length>1){if((I[1]&192)!==128)return v.lastNeed=1,"\uFFFD";if(v.lastNeed>2&&I.length>2&&(I[2]&192)!==128)return v.lastNeed=2,"\uFFFD"}}function l(v){var I=this.lastTotal-this.lastNeed,P=s(this,v);if(P!==void 0)return P;if(this.lastNeed<=v.length)return v.copy(this.lastChar,I,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,I,0,v.length),this.lastNeed-=v.length}function f(v,I){var P=i(this,v,I);if(!this.lastNeed)return v.toString("utf8",I);this.lastTotal=P;var D=v.length-(P-this.lastNeed);return v.copy(this.lastChar,0,D),v.toString("utf8",I,D)}function g(v){var I=v&&v.length?this.write(v):"";return this.lastNeed?I+"\uFFFD":I}function y(v,I){if((v.length-I)%2===0){var P=v.toString("utf16le",I);if(P){var D=P.charCodeAt(P.length-1);if(D>=55296&&D<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],P.slice(0,-1)}return P}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",I,v.length-1)}function p(v){var I=v&&v.length?this.write(v):"";if(this.lastNeed){var P=this.lastTotal-this.lastNeed;return I+this.lastChar.toString("utf16le",0,P)}return I}function m(v,I){var P=(v.length-I)%3;return P===0?v.toString("base64",I):(this.lastNeed=3-P,this.lastTotal=3,P===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",I,v.length-P))}function _(v){var I=v&&v.length?this.write(v):"";return this.lastNeed?I+this.lastChar.toString("base64",0,3-this.lastNeed):I}function E(v){return v.toString(this.encoding)}function B(v){return v&&v.length?this.write(v):""}return Ts}var Zr,Am,Ts,Cm,Lr,JC,Rm=it(()=>{R();O();k();ti();Zr={},Am=!1;Ts={},Cm=!1;Lr=jP();Lr.StringDecoder;JC=Lr.StringDecoder});function $P(){if(km)return bs;km=!0;var t=bs={},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(E){if(e===setTimeout)return setTimeout(E,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(E,0);try{return e(E,0)}catch{try{return e.call(null,E,0)}catch{return e.call(this||sr,E,0)}}}function i(E){if(n===clearTimeout)return clearTimeout(E);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(E);try{return n(E)}catch{try{return n.call(null,E)}catch{return n.call(this||sr,E)}}}var s=[],l=!1,f,g=-1;function y(){!l||!f||(l=!1,f.length?s=f.concat(s):g=-1,s.length&&p())}function p(){if(!l){var E=o(y);l=!0;for(var B=s.length;B;){for(f=s,s=[];++g<B;)f&&f[g].run();g=-1,B=s.length}f=null,l=!1,i(E)}}t.nextTick=function(E){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 m(E,B)),s.length===1&&!l&&o(p)};function m(E,B){(this||sr).fun=E,(this||sr).array=B}m.prototype.run=function(){(this||sr).fun.apply(null,(this||sr).array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function _(){}return t.on=_,t.addListener=_,t.once=_,t.off=_,t.removeListener=_,t.removeAllListeners=_,t.emit=_,t.prependListener=_,t.prependOnceListener=_,t.listeners=function(E){return[]},t.binding=function(E){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(E){throw new Error("process.chdir is not supported")},t.umask=function(){return 0},bs}var bs,km,sr,qe,_s=it(()=>{R();O();k();bs={},km=!1,sr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;qe=$P();qe.platform="browser";qe.addListener;qe.argv;qe.binding;qe.browser;qe.chdir;qe.cwd;qe.emit;qe.env;qe.listeners;qe.nextTick;qe.off;qe.on;qe.once;qe.prependListener;qe.prependOnceListener;qe.removeAllListeners;qe.removeListener;qe.title;qe.umask;qe.version;qe.versions});function ZP(){if(Om)return xs;Om=!0;var t=qe;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,g=0,y,p=0;p<=o.length;++p){if(p<o.length)y=o.charCodeAt(p);else{if(y===47)break;y=47}if(y===47){if(!(f===p-1||g===1))if(f!==p-1&&g===2){if(s.length<2||l!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var m=s.lastIndexOf("/");if(m!==s.length-1){m===-1?(s="",l=0):(s=s.slice(0,m),l=s.length-1-s.lastIndexOf("/")),f=p,g=0;continue}}else if(s.length===2||s.length===1){s="",l=0,f=p,g=0;continue}}i&&(s.length>0?s+="/..":s="..",l=2)}else s.length>0?s+="/"+o.slice(f+1,p):s=o.slice(f+1,p),l=p-f-1;f=p,g=0}else y===46&&g!==-1?++g:g=-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 g;f>=0?g=arguments[f]:(l===void 0&&(l=t.cwd()),g=l),e(g),g.length!==0&&(i=g+"/"+i,s=g.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,g=f-l,y=1;y<s.length&&s.charCodeAt(y)===47;++y);for(var p=s.length,m=p-y,_=g<m?g:m,E=-1,B=0;B<=_;++B){if(B===_){if(m>_){if(s.charCodeAt(y+B)===47)return s.slice(y+B+1);if(B===0)return s.slice(y+B)}else g>_&&(i.charCodeAt(l+B)===47?E=B:B===0&&(E=0));break}var v=i.charCodeAt(l+B),I=s.charCodeAt(y+B);if(v!==I)break;v===47&&(E=B)}var P="";for(B=l+E+1;B<=f;++B)(B===f||i.charCodeAt(B)===47)&&(P.length===0?P+="..":P+="/..");return P.length>0?P+s.slice(y+E):(y+=E,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,g=!0,y=i.length-1;y>=1;--y)if(s=i.charCodeAt(y),s===47){if(!g){f=y;break}}else g=!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,g=!0,y;if(s!==void 0&&s.length>0&&s.length<=i.length){if(s.length===i.length&&s===i)return"";var p=s.length-1,m=-1;for(y=i.length-1;y>=0;--y){var _=i.charCodeAt(y);if(_===47){if(!g){l=y+1;break}}else m===-1&&(g=!1,m=y+1),p>=0&&(_===s.charCodeAt(p)?--p===-1&&(f=y):(p=-1,f=m))}return l===f?f=m:f===-1&&(f=i.length),i.slice(l,f)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!g){l=y+1;break}}else f===-1&&(g=!1,f=y+1);return f===-1?"":i.slice(l,f)}},extname:function(i){e(i);for(var s=-1,l=0,f=-1,g=!0,y=0,p=i.length-1;p>=0;--p){var m=i.charCodeAt(p);if(m===47){if(!g){l=p+1;break}continue}f===-1&&(g=!1,f=p+1),m===46?s===-1?s=p: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,g;f?(s.root="/",g=1):g=0;for(var y=-1,p=0,m=-1,_=!0,E=i.length-1,B=0;E>=g;--E){if(l=i.charCodeAt(E),l===47){if(!_){p=E+1;break}continue}m===-1&&(_=!1,m=E+1),l===46?y===-1?y=E:B!==1&&(B=1):y!==-1&&(B=-1)}return y===-1||m===-1||B===0||B===1&&y===m-1&&y===p+1?m!==-1&&(p===0&&f?s.base=s.name=i.slice(1,m):s.base=s.name=i.slice(p,m)):(p===0&&f?(s.name=i.slice(1,y),s.base=i.slice(1,m)):(s.name=i.slice(p,y),s.base=i.slice(p,m)),s.ext=i.slice(y,m)),p>0?s.dir=i.slice(0,p-1):f&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return a.posix=a,xs=a,xs}function Cn(t){throw new RangeError(qP[t])}function Dm(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(KP,".")).split("."),e).join(".");return r+a}function Km(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 GP(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function wt(){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 Kr(t,e,n){if(t&&kt.isObject(t)&&t instanceof wt)return t;var r=new wt;return r.parse(t,e,n),r}function rI(){if(Lm)return Ps;Lm=!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,g=0,y,p=0;p<=o.length;++p){if(p<o.length)y=o.charCodeAt(p);else{if(y===47)break;y=47}if(y===47){if(!(f===p-1||g===1))if(f!==p-1&&g===2){if(s.length<2||l!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var m=s.lastIndexOf("/");if(m!==s.length-1){m===-1?(s="",l=0):(s=s.slice(0,m),l=s.length-1-s.lastIndexOf("/")),f=p,g=0;continue}}else if(s.length===2||s.length===1){s="",l=0,f=p,g=0;continue}}i&&(s.length>0?s+="/..":s="..",l=2)}else s.length>0?s+="/"+o.slice(f+1,p):s=o.slice(f+1,p),l=p-f-1;f=p,g=0}else y===46&&g!==-1?++g:g=-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 g;f>=0?g=arguments[f]:(l===void 0&&(l=t.cwd()),g=l),e(g),g.length!==0&&(i=g+"/"+i,s=g.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,g=f-l,y=1;y<s.length&&s.charCodeAt(y)===47;++y);for(var p=s.length,m=p-y,_=g<m?g:m,E=-1,B=0;B<=_;++B){if(B===_){if(m>_){if(s.charCodeAt(y+B)===47)return s.slice(y+B+1);if(B===0)return s.slice(y+B)}else g>_&&(i.charCodeAt(l+B)===47?E=B:B===0&&(E=0));break}var v=i.charCodeAt(l+B),I=s.charCodeAt(y+B);if(v!==I)break;v===47&&(E=B)}var P="";for(B=l+E+1;B<=f;++B)(B===f||i.charCodeAt(B)===47)&&(P.length===0?P+="..":P+="/..");return P.length>0?P+s.slice(y+E):(y+=E,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,g=!0,y=i.length-1;y>=1;--y)if(s=i.charCodeAt(y),s===47){if(!g){f=y;break}}else g=!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,g=!0,y;if(s!==void 0&&s.length>0&&s.length<=i.length){if(s.length===i.length&&s===i)return"";var p=s.length-1,m=-1;for(y=i.length-1;y>=0;--y){var _=i.charCodeAt(y);if(_===47){if(!g){l=y+1;break}}else m===-1&&(g=!1,m=y+1),p>=0&&(_===s.charCodeAt(p)?--p===-1&&(f=y):(p=-1,f=m))}return l===f?f=m:f===-1&&(f=i.length),i.slice(l,f)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!g){l=y+1;break}}else f===-1&&(g=!1,f=y+1);return f===-1?"":i.slice(l,f)}},extname:function(i){e(i);for(var s=-1,l=0,f=-1,g=!0,y=0,p=i.length-1;p>=0;--p){var m=i.charCodeAt(p);if(m===47){if(!g){l=p+1;break}continue}f===-1&&(g=!1,f=p+1),m===46?s===-1?s=p: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,g;f?(s.root="/",g=1):g=0;for(var y=-1,p=0,m=-1,_=!0,E=i.length-1,B=0;E>=g;--E){if(l=i.charCodeAt(E),l===47){if(!_){p=E+1;break}continue}m===-1&&(_=!1,m=E+1),l===46?y===-1?y=E:B!==1&&(B=1):y!==-1&&(B=-1)}return y===-1||m===-1||B===0||B===1&&y===m-1&&y===p+1?m!==-1&&(p===0&&f?s.base=s.name=i.slice(1,m):s.base=s.name=i.slice(p,m)):(p===0&&f?(s.name=i.slice(1,y),s.base=i.slice(1,m)):(s.name=i.slice(p,y),s.base=i.slice(p,m)),s.ext=i.slice(y,m)),p>0?s.dir=i.slice(0,p-1):f&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return a.posix=a,Ps=a,Ps}function yI(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 Ss?mI(t):hI(t)}function mI(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(uI,"\\"),n=decodeURIComponent(n),e!=="")return`\\\\${e}${n}`;{let r=n.codePointAt(1)|32,a=n[2];if(r<sI||r>lI||a!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return n.slice(1)}}function hI(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 vI(t){let e=Fm.resolve(t),n=t.charCodeAt(t.length-1);(n===oI||Ss&&n===aI)&&e[e.length-1]!==Fm.sep&&(e+="/");let r=new URL("file://");return e.includes("%")&&(e=e.replace(cI,"%25")),!Ss&&e.includes("\\")&&(e=e.replace(fI,"%5C")),e.includes(`
11
- `)&&(e=e.replace(dI,"%0A")),e.includes("\r")&&(e=e.replace(pI,"%0D")),e.includes(" ")&&(e=e.replace(gI,"%09")),r.pathname=e,r}function CI(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 As?RI(t):kI(t)}function RI(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(EI,"\\"),n=decodeURIComponent(n),e!=="")return`\\\\${e}${n}`;{let r=n.codePointAt(1)|32,a=n[2];if(r<xI||r>wI||a!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return n.slice(1)}}function kI(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 OI(t){let e=Mm.resolve(t),n=t.charCodeAt(t.length-1);(n===_I||As&&n===bI)&&e[e.length-1]!==Mm.sep&&(e+="/");let r=new URL("file://");return e.includes("%")&&(e=e.replace(BI,"%25")),!As&&e.includes("\\")&&(e=e.replace(PI,"%5C")),e.includes(`
12
- `)&&(e=e.replace(II,"%0A")),e.includes("\r")&&(e=e.replace(SI,"%0D")),e.includes(" ")&&(e=e.replace(AI,"%09")),r.pathname=e,r}var xs,Om,Mm,ur,LP,FP,KP,qP,Ot,ws,Nm,qm,Hm,Um,zP,VP,Fr,WP,Jt,je,JP,kt,YP,XP,QP,eI,Is,jm,$m,Zm,tI,nI,Es,lr,Bs,Ps,Lm,Fm,iI,aI,oI,sI,lI,Ss,uI,cI,fI,dI,pI,gI,TI,bI,_I,xI,wI,As,EI,BI,PI,II,SI,AI,zm=it(()=>{R();O();k();ka();_s();xs={},Om=!1;Mm=ZP(),ur=2147483647,LP=/^xn--/,FP=/[^\0-\x7E]/,KP=/[\x2E\u3002\uFF0E\uFF61]/g,qP={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Ot=Math.floor,ws=String.fromCharCode;Nm=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},qm=function(t,e,n){let r=0;for(t=n?Ot(t/700):t>>1,t+=Ot(t/e);t>455;r+=36)t=Ot(t/35);return Ot(r+36*t/(t+38))},Hm=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&&Cn("not-basic"),e.push(t.charCodeAt(l));for(let l=i>0?i+1:0;l<n;){let f=r;for(let y=1,p=36;;p+=36){l>=n&&Cn("invalid-input");let m=(s=t.charCodeAt(l++))-48<10?s-22:s-65<26?s-65:s-97<26?s-97:36;(m>=36||m>Ot((ur-r)/y))&&Cn("overflow"),r+=m*y;let _=p<=o?1:p>=o+26?26:p-o;if(m<_)break;let E=36-_;y>Ot(ur/E)&&Cn("overflow"),y*=E}let g=e.length+1;o=qm(r-f,g,f==0),Ot(r/g)>ur-a&&Cn("overflow"),a+=Ot(r/g),r%=g,e.splice(r++,0,a)}var s;return String.fromCodePoint(...e)},Um=function(t){let e=[],n=(t=Km(t)).length,r=128,a=0,o=72;for(let l of t)l<128&&e.push(ws(l));let i=e.length,s=i;for(i&&e.push("-");s<n;){let l=ur;for(let g of t)g>=r&&g<l&&(l=g);let f=s+1;l-r>Ot((ur-a)/f)&&Cn("overflow"),a+=(l-r)*f,r=l;for(let g of t)if(g<r&&++a>ur&&Cn("overflow"),g==r){let y=a;for(let p=36;;p+=36){let m=p<=o?1:p>=o+26?26:p-o;if(y<m)break;let _=y-m,E=36-m;e.push(ws(Nm(m+_%E,0))),y=Ot(_/E)}e.push(ws(Nm(y,0))),o=qm(a,f,s==i),a=0,++s}++a,++r}return e.join("")},zP={version:"2.1.0",ucs2:{decode:Km,encode:t=>String.fromCodePoint(...t)},decode:Hm,encode:Um,toASCII:function(t){return Dm(t,function(e){return FP.test(e)?"xn--"+Um(e):e})},toUnicode:function(t){return Dm(t,function(e){return LP.test(e)?Hm(e.slice(4).toLowerCase()):e})}};VP=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,g,y,p,m=t[l].replace(o,"%20"),_=m.indexOf(n);_>=0?(f=m.substr(0,_),g=m.substr(_+1)):(f=m,g=""),y=decodeURIComponent(f),p=decodeURIComponent(g),GP(a,y)?Array.isArray(a[y])?a[y].push(p):a[y]=[a[y],p]:a[y]=p}return a},Fr=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},WP=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(Fr(a))+n;return Array.isArray(t[a])?t[a].map(function(i){return o+encodeURIComponent(Fr(i))}).join(e):o+encodeURIComponent(Fr(t[a]))}).join(e):r?encodeURIComponent(Fr(r))+n+encodeURIComponent(Fr(t)):""},Jt={};Jt.decode=Jt.parse=VP,Jt.encode=Jt.stringify=WP;Jt.decode;Jt.encode;Jt.parse;Jt.stringify;je={},JP=zP,kt={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}};je.parse=Kr,je.resolve=function(t,e){return Kr(t,!1,!0).resolve(e)},je.resolveObject=function(t,e){return t?Kr(t,!1,!0).resolveObject(e):e},je.format=function(t){return kt.isString(t)&&(t=Kr(t)),t instanceof wt?t.format():wt.prototype.format.call(t)},je.Url=wt;YP=/^([a-z0-9.+-]+:)/i,XP=/:[0-9]*$/,QP=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,eI=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
13
- `," "]),Is=["'"].concat(eI),jm=["%","/","?",";","#"].concat(Is),$m=["/","?","#"],Zm=/^[+a-z0-9A-Z_-]{0,63}$/,tI=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,nI={javascript:!0,"javascript:":!0},Es={javascript:!0,"javascript:":!0},lr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Bs=Jt;wt.prototype.parse=function(t,e,n){if(!kt.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=QP.exec(i);if(s)return this.path=i,this.href=i,this.pathname=s[1],s[2]?(this.search=s[2],this.query=e?Bs.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var l=YP.exec(i);if(l){var f=(l=l[0]).toLowerCase();this.protocol=f,i=i.substr(l.length)}if(n||l||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var g=i.substr(0,2)==="//";!g||l&&Es[l]||(i=i.substr(2),this.slashes=!0)}if(!Es[l]&&(g||l&&!lr[l])){for(var y,p,m=-1,_=0;_<$m.length;_++)(E=i.indexOf($m[_]))!==-1&&(m===-1||E<m)&&(m=E);for((p=m===-1?i.lastIndexOf("@"):i.lastIndexOf("@",m))!==-1&&(y=i.slice(0,p),i=i.slice(p+1),this.auth=decodeURIComponent(y)),m=-1,_=0;_<jm.length;_++){var E;(E=i.indexOf(jm[_]))!==-1&&(m===-1||E<m)&&(m=E)}m===-1&&(m=i.length),this.host=i.slice(0,m),i=i.slice(m),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(/\./),I=(_=0,v.length);_<I;_++){var P=v[_];if(P&&!P.match(Zm)){for(var D="",$=0,ae=P.length;$<ae;$++)P.charCodeAt($)>127?D+="x":D+=P[$];if(!D.match(Zm)){var X=v.slice(0,_),ue=v.slice(_+1),ee=P.match(tI);ee&&(X.push(ee[1]),ue.unshift(ee[2])),ue.length&&(i="/"+ue.join(".")+i),this.hostname=X.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=JP.toASCII(this.hostname));var ie=this.port?":"+this.port:"",Oe=this.hostname||"";this.host=Oe+ie,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),i[0]!=="/"&&(i="/"+i))}if(!nI[f])for(_=0,I=Is.length;_<I;_++){var Se=Is[_];if(i.indexOf(Se)!==-1){var $e=encodeURIComponent(Se);$e===Se&&($e=escape(Se)),i=i.split(Se).join($e)}}var Ne=i.indexOf("#");Ne!==-1&&(this.hash=i.substr(Ne),i=i.slice(0,Ne));var Me=i.indexOf("?");if(Me!==-1?(this.search=i.substr(Me),this.query=i.substr(Me+1),e&&(this.query=Bs.parse(this.query)),i=i.slice(0,Me)):e&&(this.search="",this.query={}),i&&(this.pathname=i),lr[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){ie=this.pathname||"";var We=this.search||"";this.path=ie+We}return this.href=this.format(),this},wt.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&&kt.isObject(this.query)&&Object.keys(this.query).length&&(o=Bs.stringify(this.query));var i=this.search||o&&"?"+o||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||lr[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},wt.prototype.resolve=function(t){return this.resolveObject(Kr(t,!1,!0)).format()},wt.prototype.resolveObject=function(t){if(kt.isString(t)){var e=new wt;e.parse(t,!1,!0),t=e}for(var n=new wt,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 lr[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!lr[t.protocol]){for(var f=Object.keys(t),g=0;g<f.length;g++){var y=f[g];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 p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),p[0]!==""&&p.unshift(""),p.length<2&&p.unshift(""),n.pathname=p.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 m=n.pathname||"",_=n.search||"";n.path=m+_}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var E=n.pathname&&n.pathname.charAt(0)==="/",B=t.host||t.pathname&&t.pathname.charAt(0)==="/",v=B||E||n.host&&t.pathname,I=v,P=n.pathname&&n.pathname.split("/")||[],D=(p=t.pathname&&t.pathname.split("/")||[],n.protocol&&!lr[n.protocol]);if(D&&(n.hostname="",n.port=null,n.host&&(P[0]===""?P[0]=n.host:P.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(p[0]===""?p[0]=t.host:p.unshift(t.host)),t.host=null),v=v&&(p[0]===""||P[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,P=p;else if(p.length)P||(P=[]),P.pop(),P=P.concat(p),n.search=t.search,n.query=t.query;else if(!kt.isNullOrUndefined(t.search))return D&&(n.hostname=n.host=P.shift(),(ee=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=ee.shift(),n.host=n.hostname=ee.shift())),n.search=t.search,n.query=t.query,kt.isNull(n.pathname)&&kt.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!P.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var $=P.slice(-1)[0],ae=(n.host||t.host||P.length>1)&&($==="."||$==="..")||$==="",X=0,ue=P.length;ue>=0;ue--)($=P[ue])==="."?P.splice(ue,1):$===".."?(P.splice(ue,1),X++):X&&(P.splice(ue,1),X--);if(!v&&!I)for(;X--;X)P.unshift("..");!v||P[0]===""||P[0]&&P[0].charAt(0)==="/"||P.unshift(""),ae&&P.join("/").substr(-1)!=="/"&&P.push("");var ee,ie=P[0]===""||P[0]&&P[0].charAt(0)==="/";return D&&(n.hostname=n.host=ie?"":P.length?P.shift():"",(ee=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=ee.shift(),n.host=n.hostname=ee.shift())),(v=v||n.host&&P.length)&&!ie&&P.unshift(""),P.length?n.pathname=P.join("/"):(n.pathname=null,n.path=null),kt.isNull(n.pathname)&&kt.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},wt.prototype.parseHost=function(){var t=this.host,e=XP.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};je.Url;je.format;je.resolve;je.resolveObject;Ps={},Lm=!1;Fm=rI(),iI=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;je.URL=typeof URL<"u"?URL:null;je.pathToFileURL=vI;je.fileURLToPath=yI;je.Url;je.format;je.resolve;je.resolveObject;je.URL;aI=92,oI=47,sI=97,lI=122,Ss=iI==="win32",uI=/\//g,cI=/%/g,fI=/\\/g,dI=/\n/g,pI=/\r/g,gI=/\t/g;TI=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;je.URL=typeof URL<"u"?URL:null;je.pathToFileURL=OI;je.fileURLToPath=CI;je.Url;je.format;je.resolve;je.resolveObject;je.parse;je.URL;bI=92,_I=47,xI=97,wI=122,As=TI==="win32",EI=/\//g,BI=/%/g,PI=/\\/g,II=/\n/g,SI=/\r/g,AI=/\t/g});var Bh={};Dn(Bh,{Agent:()=>KI,ClientRequest:()=>qI,IncomingMessage:()=>zI,METHODS:()=>GI,STATUS_CODES:()=>VI,default:()=>Yt,get:()=>WI,globalAgent:()=>JI,request:()=>YI});function mh(){if(Gm)return bt;Gm=!0,bt.fetch=r(Rn.fetch)&&r(Rn.ReadableStream),bt.writableStream=r(Rn.WritableStream),bt.abortController=r(Rn.AbortController);var t;function e(){if(t!==void 0)return t;if(Rn.XMLHttpRequest){t=new Rn.XMLHttpRequest;try{t.open("GET",Rn.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 hh(){return Vm||(Vm=!0,Cs=gt.EventEmitter),Cs}function MI(){if(Wm)return Rs;Wm=!0;function t(_,E){var B=Object.keys(_);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(_);E&&(v=v.filter(function(I){return Object.getOwnPropertyDescriptor(_,I).enumerable})),B.push.apply(B,v)}return B}function e(_){for(var E=1;E<arguments.length;E++){var B=arguments[E]!=null?arguments[E]:{};E%2?t(Object(B),!0).forEach(function(v){n(_,v,B[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(_,Object.getOwnPropertyDescriptors(B)):t(Object(B)).forEach(function(v){Object.defineProperty(_,v,Object.getOwnPropertyDescriptor(B,v))})}return _}function n(_,E,B){return E=i(E),E in _?Object.defineProperty(_,E,{value:B,enumerable:!0,configurable:!0,writable:!0}):_[E]=B,_}function r(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")}function a(_,E){for(var B=0;B<E.length;B++){var v=E[B];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(_,i(v.key),v)}}function o(_,E,B){return E&&a(_.prototype,E),Object.defineProperty(_,"prototype",{writable:!1}),_}function i(_){var E=s(_,"string");return typeof E=="symbol"?E:String(E)}function s(_,E){if(typeof _!="object"||_===null)return _;var B=_[Symbol.toPrimitive];if(B!==void 0){var v=B.call(_,E||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(E==="string"?String:Number)(_)}var l=At(),f=l.Buffer,g=L,y=g.inspect,p=y&&y.custom||"inspect";function m(_,E,B){f.prototype.copy.call(_,E,B)}return Rs=function(){function _(){r(this,_),this.head=null,this.tail=null,this.length=0}return o(_,[{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,I=""+v.data;v=v.next;)I+=B+v.data;return I}},{key:"concat",value:function(B){if(this.length===0)return f.alloc(0);for(var v=f.allocUnsafe(B>>>0),I=this.head,P=0;I;)m(I.data,v,P),P+=I.data.length,I=I.next;return v}},{key:"consume",value:function(B,v){var I;return B<this.head.data.length?(I=this.head.data.slice(0,B),this.head.data=this.head.data.slice(B)):B===this.head.data.length?I=this.shift():I=v?this._getString(B):this._getBuffer(B),I}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(B){var v=this.head,I=1,P=v.data;for(B-=P.length;v=v.next;){var D=v.data,$=B>D.length?D.length:B;if($===D.length?P+=D:P+=D.slice(0,B),B-=$,B===0){$===D.length?(++I,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=D.slice($));break}++I}return this.length-=I,P}},{key:"_getBuffer",value:function(B){var v=f.allocUnsafe(B),I=this.head,P=1;for(I.data.copy(v),B-=I.data.length;I=I.next;){var D=I.data,$=B>D.length?D.length:B;if(D.copy(v,v.length-B,0,$),B-=$,B===0){$===D.length?(++P,I.next?this.head=I.next:this.head=this.tail=null):(this.head=I,I.data=D.slice($));break}++P}return this.length-=P,v}},{key:p,value:function(B,v){return y(this,e(e({},v),{},{depth:0,customInspect:!1}))}}]),_}(),Rs}function vh(){if(Jm)return ks;Jm=!0;var t=Pt;function e(s,l){var f=this,g=this._readableState&&this._readableState.destroyed,y=this._writableState&&this._writableState.destroyed;return g||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(p){!l&&p?f._writableState?f._writableState.errorEmitted?t.nextTick(r,f):(f._writableState.errorEmitted=!0,t.nextTick(n,f,p)):t.nextTick(n,f,p):l?(t.nextTick(r,f),l(p)):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,g=s._writableState;f&&f.autoDestroy||g&&g.autoDestroy?s.destroy(l):s.emit("error",l)}return ks={destroy:e,undestroy:a,errorOrDestroy:i},ks}function fr(){if(Ym)return Os;Ym=!0;let t={};function e(i,s,l){l||(l=Error);function f(y,p,m){return typeof s=="string"?s:s(y,p,m)}class g extends l{constructor(p,m,_){super(f(p,m,_))}}g.prototype.name=l.name,g.prototype.code=i,t[i]=g}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 g;if(a(i," argument"))g=`The ${i} ${f} ${n(s,"type")}`;else{let y=o(i,".")?"property":"argument";g=`The "${i}" ${y} ${f} ${n(s,"type")}`}return g+=`. Received type ${typeof l}`,g},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"),Os.codes=t,Os}function Th(){if(Xm)return Ms;Xm=!0;var t=fr().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 Ms={getHighWaterMark:n},Ms}function bh(){if(Qm)return Ds;Qm=!0;var t=Pt;Ds=ee;function e(C){var S=this;this.next=null,this.entry=null,this.finish=function(){ve(S,C)}}var n;ee.WritableState=X;var r={deprecate:Im()},a=hh(),o=At().Buffer,i=(typeof eh<"u"?eh:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(C){return o.from(C)}function l(C){return o.isBuffer(C)||C instanceof i}var f=vh(),g=Th(),y=g.getHighWaterMark,p=fr().codes,m=p.ERR_INVALID_ARG_TYPE,_=p.ERR_METHOD_NOT_IMPLEMENTED,E=p.ERR_MULTIPLE_CALLBACK,B=p.ERR_STREAM_CANNOT_PIPE,v=p.ERR_STREAM_DESTROYED,I=p.ERR_STREAM_NULL_VALUES,P=p.ERR_STREAM_WRITE_AFTER_END,D=p.ERR_UNKNOWN_ENCODING,$=f.errorOrDestroy;Ct()(ee,a);function ae(){}function X(C,S,j){n=n||cr(),C=C||{},typeof j!="boolean"&&(j=S instanceof n),this.objectMode=!!C.objectMode,j&&(this.objectMode=this.objectMode||!!C.writableObjectMode),this.highWaterMark=y(this,C,"writableHighWaterMark",j),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var V=C.decodeStrings===!1;this.decodeStrings=!V,this.defaultEncoding=C.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(oe){Ae(S,oe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=C.emitClose!==!1,this.autoDestroy=!!C.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}X.prototype.getBuffer=function(){for(var S=this.bufferedRequest,j=[];S;)j.push(S),S=S.next;return j},function(){try{Object.defineProperty(X.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var ue;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ue=Function.prototype[Symbol.hasInstance],Object.defineProperty(ee,Symbol.hasInstance,{value:function(S){return ue.call(this,S)?!0:this!==ee?!1:S&&S._writableState instanceof X}})):ue=function(S){return S instanceof this};function ee(C){n=n||cr();var S=this instanceof n;if(!S&&!ue.call(ee,this))return new ee(C);this._writableState=new X(C,this,S),this.writable=!0,C&&(typeof C.write=="function"&&(this._write=C.write),typeof C.writev=="function"&&(this._writev=C.writev),typeof C.destroy=="function"&&(this._destroy=C.destroy),typeof C.final=="function"&&(this._final=C.final)),a.call(this)}ee.prototype.pipe=function(){$(this,new B)};function ie(C,S){var j=new P;$(C,j),t.nextTick(S,j)}function Oe(C,S,j,V){var oe;return j===null?oe=new I:typeof j!="string"&&!S.objectMode&&(oe=new m("chunk",["string","Buffer"],j)),oe?($(C,oe),t.nextTick(V,oe),!1):!0}ee.prototype.write=function(C,S,j){var V=this._writableState,oe=!1,b=!V.objectMode&&l(C);return b&&!o.isBuffer(C)&&(C=s(C)),typeof S=="function"&&(j=S,S=null),b?S="buffer":S||(S=V.defaultEncoding),typeof j!="function"&&(j=ae),V.ending?ie(this,j):(b||Oe(this,V,C,j))&&(V.pendingcb++,oe=$e(this,V,b,C,S,j)),oe},ee.prototype.cork=function(){this._writableState.corked++},ee.prototype.uncork=function(){var C=this._writableState;C.corked&&(C.corked--,!C.writing&&!C.corked&&!C.bufferProcessing&&C.bufferedRequest&&ce(this,C))},ee.prototype.setDefaultEncoding=function(S){if(typeof S=="string"&&(S=S.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((S+"").toLowerCase())>-1))throw new D(S);return this._writableState.defaultEncoding=S,this},Object.defineProperty(ee.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Se(C,S,j){return!C.objectMode&&C.decodeStrings!==!1&&typeof S=="string"&&(S=o.from(S,j)),S}Object.defineProperty(ee.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $e(C,S,j,V,oe,b){if(!j){var x=Se(S,V,oe);V!==x&&(j=!0,oe="buffer",V=x)}var q=S.objectMode?1:V.length;S.length+=q;var Q=S.length<S.highWaterMark;if(Q||(S.needDrain=!0),S.writing||S.corked){var He=S.lastBufferedRequest;S.lastBufferedRequest={chunk:V,encoding:oe,isBuf:j,callback:b,next:null},He?He.next=S.lastBufferedRequest:S.bufferedRequest=S.lastBufferedRequest,S.bufferedRequestCount+=1}else Ne(C,S,!1,q,V,oe,b);return Q}function Ne(C,S,j,V,oe,b,x){S.writelen=V,S.writecb=x,S.writing=!0,S.sync=!0,S.destroyed?S.onwrite(new v("write")):j?C._writev(oe,S.onwrite):C._write(oe,b,S.onwrite),S.sync=!1}function Me(C,S,j,V,oe){--S.pendingcb,j?(t.nextTick(oe,V),t.nextTick(F,C,S),C._writableState.errorEmitted=!0,$(C,V)):(oe(V),C._writableState.errorEmitted=!0,$(C,V),F(C,S))}function We(C){C.writing=!1,C.writecb=null,C.length-=C.writelen,C.writelen=0}function Ae(C,S){var j=C._writableState,V=j.sync,oe=j.writecb;if(typeof oe!="function")throw new E;if(We(j),S)Me(C,j,V,S,oe);else{var b=he(j)||C.destroyed;!b&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&ce(C,j),V?t.nextTick(me,C,j,b,oe):me(C,j,b,oe)}}function me(C,S,j,V){j||Pe(C,S),S.pendingcb--,V(),F(C,S)}function Pe(C,S){S.length===0&&S.needDrain&&(S.needDrain=!1,C.emit("drain"))}function ce(C,S){S.bufferProcessing=!0;var j=S.bufferedRequest;if(C._writev&&j&&j.next){var V=S.bufferedRequestCount,oe=new Array(V),b=S.corkedRequestsFree;b.entry=j;for(var x=0,q=!0;j;)oe[x]=j,j.isBuf||(q=!1),j=j.next,x+=1;oe.allBuffers=q,Ne(C,S,!0,S.length,oe,"",b.finish),S.pendingcb++,S.lastBufferedRequest=null,b.next?(S.corkedRequestsFree=b.next,b.next=null):S.corkedRequestsFree=new e(S),S.bufferedRequestCount=0}else{for(;j;){var Q=j.chunk,He=j.encoding,Te=j.callback,U=S.objectMode?1:Q.length;if(Ne(C,S,!1,U,Q,He,Te),j=j.next,S.bufferedRequestCount--,S.writing)break}j===null&&(S.lastBufferedRequest=null)}S.bufferedRequest=j,S.bufferProcessing=!1}ee.prototype._write=function(C,S,j){j(new _("_write()"))},ee.prototype._writev=null,ee.prototype.end=function(C,S,j){var V=this._writableState;return typeof C=="function"?(j=C,C=null,S=null):typeof S=="function"&&(j=S,S=null),C!=null&&this.write(C,S),V.corked&&(V.corked=1,this.uncork()),V.ending||fe(this,V,j),this},Object.defineProperty(ee.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function he(C){return C.ending&&C.length===0&&C.bufferedRequest===null&&!C.finished&&!C.writing}function M(C,S){C._final(function(j){S.pendingcb--,j&&$(C,j),S.prefinished=!0,C.emit("prefinish"),F(C,S)})}function Z(C,S){!S.prefinished&&!S.finalCalled&&(typeof C._final=="function"&&!S.destroyed?(S.pendingcb++,S.finalCalled=!0,t.nextTick(M,C,S)):(S.prefinished=!0,C.emit("prefinish")))}function F(C,S){var j=he(S);if(j&&(Z(C,S),S.pendingcb===0&&(S.finished=!0,C.emit("finish"),S.autoDestroy))){var V=C._readableState;(!V||V.autoDestroy&&V.endEmitted)&&C.destroy()}return j}function fe(C,S,j){S.ending=!0,F(C,S),j&&(S.finished?t.nextTick(j):C.once("finish",j)),S.ended=!0,C.writable=!1}function ve(C,S,j){var V=C.entry;for(C.entry=null;V;){var oe=V.callback;S.pendingcb--,oe(j),V=V.next}S.corkedRequestsFree.next=C}return Object.defineProperty(ee.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(S){this._writableState&&(this._writableState.destroyed=S)}}),ee.prototype.destroy=f.destroy,ee.prototype._undestroy=f.undestroy,ee.prototype._destroy=function(C,S){S(C)},Ds}function cr(){if(th)return Ns;th=!0;var t=Pt,e=Object.keys||function(g){var y=[];for(var p in g)y.push(p);return y};Ns=s;var n=_h(),r=bh();Ct()(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(g){if(!(this instanceof s))return new s(g);n.call(this,g),r.call(this,g),this.allowHalfOpen=!0,g&&(g.readable===!1&&(this.readable=!1),g.writable===!1&&(this.writable=!1),g.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(g){g.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)}}),Ns}function Vs(){if(nh)return Hs;nh=!0;var t=fr().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,g=function(){o.writable||p()},y=o._writableState&&o._writableState.finished,p=function(){f=!1,y=!0,l||s.call(o)},m=o._readableState&&o._readableState.endEmitted,_=function(){l=!1,m=!0,f||s.call(o)},E=function(P){s.call(o,P)},B=function(){var P;if(l&&!m)return(!o._readableState||!o._readableState.ended)&&(P=new t),s.call(o,P);if(f&&!y)return(!o._writableState||!o._writableState.ended)&&(P=new t),s.call(o,P)},v=function(){o.req.on("finish",p)};return r(o)?(o.on("complete",p),o.on("abort",B),o.req?v():o.on("request",v)):f&&!o._writableState&&(o.on("end",g),o.on("close",g)),o.on("end",_),o.on("finish",p),i.error!==!1&&o.on("error",E),o.on("close",B),function(){o.removeListener("complete",p),o.removeListener("abort",B),o.removeListener("request",v),o.req&&o.req.removeListener("finish",p),o.removeListener("end",g),o.removeListener("close",g),o.removeListener("finish",p),o.removeListener("end",_),o.removeListener("error",E),o.removeListener("close",B)}}return Hs=a,Hs}function DI(){if(rh)return Us;rh=!0;var t=Pt,e;function n(D,$,ae){return $=r($),$ in D?Object.defineProperty(D,$,{value:ae,enumerable:!0,configurable:!0,writable:!0}):D[$]=ae,D}function r(D){var $=a(D,"string");return typeof $=="symbol"?$:String($)}function a(D,$){if(typeof D!="object"||D===null)return D;var ae=D[Symbol.toPrimitive];if(ae!==void 0){var X=ae.call(D,$||"default");if(typeof X!="object")return X;throw new TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var o=Vs(),i=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),f=Symbol("ended"),g=Symbol("lastPromise"),y=Symbol("handlePromise"),p=Symbol("stream");function m(D,$){return{value:D,done:$}}function _(D){var $=D[i];if($!==null){var ae=D[p].read();ae!==null&&(D[g]=null,D[i]=null,D[s]=null,$(m(ae,!1)))}}function E(D){t.nextTick(_,D)}function B(D,$){return function(ae,X){D.then(function(){if($[f]){ae(m(void 0,!0));return}$[y](ae,X)},X)}}var v=Object.getPrototypeOf(function(){}),I=Object.setPrototypeOf((e={get stream(){return this[p]},next:function(){var $=this,ae=this[l];if(ae!==null)return Promise.reject(ae);if(this[f])return Promise.resolve(m(void 0,!0));if(this[p].destroyed)return new Promise(function(ie,Oe){t.nextTick(function(){$[l]?Oe($[l]):ie(m(void 0,!0))})});var X=this[g],ue;if(X)ue=new Promise(B(X,this));else{var ee=this[p].read();if(ee!==null)return Promise.resolve(m(ee,!1));ue=new Promise(this[y])}return this[g]=ue,ue}},n(e,Symbol.asyncIterator,function(){return this}),n(e,"return",function(){var $=this;return new Promise(function(ae,X){$[p].destroy(null,function(ue){if(ue){X(ue);return}ae(m(void 0,!0))})})}),e),v),P=function($){var ae,X=Object.create(I,(ae={},n(ae,p,{value:$,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:$._readableState.endEmitted,writable:!0}),n(ae,y,{value:function(ee,ie){var Oe=X[p].read();Oe?(X[g]=null,X[i]=null,X[s]=null,ee(m(Oe,!1))):(X[i]=ee,X[s]=ie)},writable:!0}),ae));return X[g]=null,o($,function(ue){if(ue&&ue.code!=="ERR_STREAM_PREMATURE_CLOSE"){var ee=X[s];ee!==null&&(X[g]=null,X[i]=null,X[s]=null,ee(ue)),X[l]=ue;return}var ie=X[i];ie!==null&&(X[g]=null,X[i]=null,X[s]=null,ie(m(void 0,!0))),X[f]=!0}),$.on("readable",E.bind(null,X)),X};return Us=P,Us}function NI(){return ih||(ih=!0,js=function(){throw new Error("Readable.from is not available in the browser")}),js}function _h(){if(ah)return $s;ah=!0;var t=Pt;$s=ie;var e;ie.ReadableState=ee,gt.EventEmitter;var n=function(x,q){return x.listeners(q).length},r=hh(),a=At().Buffer,o=(typeof oh<"u"?oh: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 g=MI(),y=vh(),p=Th(),m=p.getHighWaterMark,_=fr().codes,E=_.ERR_INVALID_ARG_TYPE,B=_.ERR_STREAM_PUSH_AFTER_EOF,v=_.ERR_METHOD_NOT_IMPLEMENTED,I=_.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,P,D,$;Ct()(ie,r);var ae=y.errorOrDestroy,X=["error","close","destroy","pause","resume"];function ue(b,x,q){if(typeof b.prependListener=="function")return b.prependListener(x,q);!b._events||!b._events[x]?b.on(x,q):Array.isArray(b._events[x])?b._events[x].unshift(q):b._events[x]=[q,b._events[x]]}function ee(b,x,q){e=e||cr(),b=b||{},typeof q!="boolean"&&(q=x instanceof e),this.objectMode=!!b.objectMode,q&&(this.objectMode=this.objectMode||!!b.readableObjectMode),this.highWaterMark=m(this,b,"readableHighWaterMark",q),this.buffer=new g,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&&(P||(P=Lr.StringDecoder),this.decoder=new P(b.encoding),this.encoding=b.encoding)}function ie(b){if(e=e||cr(),!(this instanceof ie))return new ie(b);var x=this instanceof e;this._readableState=new ee(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(ie.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(x){this._readableState&&(this._readableState.destroyed=x)}}),ie.prototype.destroy=y.destroy,ie.prototype._undestroy=y.undestroy,ie.prototype._destroy=function(b,x){x(b)},ie.prototype.push=function(b,x){var q=this._readableState,Q;return q.objectMode?Q=!0:typeof b=="string"&&(x=x||q.defaultEncoding,x!==q.encoding&&(b=a.from(b,x),x=""),Q=!0),Oe(this,b,x,!1,Q)},ie.prototype.unshift=function(b){return Oe(this,b,null,!0,!1)};function Oe(b,x,q,Q,He){f("readableAddChunk",x);var Te=b._readableState;if(x===null)Te.reading=!1,Ae(b,Te);else{var U;if(He||(U=$e(Te,x)),U)ae(b,U);else if(Te.objectMode||x&&x.length>0)if(typeof x!="string"&&!Te.objectMode&&Object.getPrototypeOf(x)!==a.prototype&&(x=i(x)),Q)Te.endEmitted?ae(b,new I):Se(b,Te,x,!0);else if(Te.ended)ae(b,new B);else{if(Te.destroyed)return!1;Te.reading=!1,Te.decoder&&!q?(x=Te.decoder.write(x),Te.objectMode||x.length!==0?Se(b,Te,x,!1):ce(b,Te)):Se(b,Te,x,!1)}else Q||(Te.reading=!1,ce(b,Te))}return!Te.ended&&(Te.length<Te.highWaterMark||Te.length===0)}function Se(b,x,q,Q){x.flowing&&x.length===0&&!x.sync?(x.awaitDrain=0,b.emit("data",q)):(x.length+=x.objectMode?1:q.length,Q?x.buffer.unshift(q):x.buffer.push(q),x.needReadable&&me(b)),ce(b,x)}function $e(b,x){var q;return!s(x)&&typeof x!="string"&&x!==void 0&&!b.objectMode&&(q=new E("chunk",["string","Buffer","Uint8Array"],x)),q}ie.prototype.isPaused=function(){return this._readableState.flowing===!1},ie.prototype.setEncoding=function(b){P||(P=Lr.StringDecoder);var x=new P(b);this._readableState.decoder=x,this._readableState.encoding=this._readableState.decoder.encoding;for(var q=this._readableState.buffer.head,Q="";q!==null;)Q+=x.write(q.data),q=q.next;return this._readableState.buffer.clear(),Q!==""&&this._readableState.buffer.push(Q),this._readableState.length=Q.length,this};var Ne=1073741824;function Me(b){return b>=Ne?b=Ne:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}function We(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=Me(b)),b<=x.length?b:x.ended?x.length:(x.needReadable=!0,0))}ie.prototype.read=function(b){f("read",b),b=parseInt(b,10);var x=this._readableState,q=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?j(this):me(this),null;if(b=We(b,x),b===0&&x.ended)return x.length===0&&j(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=We(q,x)));var He;return b>0?He=S(b,x):He=null,He===null?(x.needReadable=x.length<=x.highWaterMark,b=0):(x.length-=b,x.awaitDrain=0),x.length===0&&(x.ended||(x.needReadable=!0),q!==b&&x.ended&&j(this)),He!==null&&this.emit("data",He),He};function Ae(b,x){if(f("onEofChunk"),!x.ended){if(x.decoder){var q=x.decoder.end();q&&q.length&&(x.buffer.push(q),x.length+=x.objectMode?1:q.length)}x.ended=!0,x.sync?me(b):(x.needReadable=!1,x.emittedReadable||(x.emittedReadable=!0,Pe(b)))}}function me(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(Pe,b))}function Pe(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,C(b)}function ce(b,x){x.readingMore||(x.readingMore=!0,t.nextTick(he,b,x))}function he(b,x){for(;!x.reading&&!x.ended&&(x.length<x.highWaterMark||x.flowing&&x.length===0);){var q=x.length;if(f("maybeReadMore read 0"),b.read(0),q===x.length)break}x.readingMore=!1}ie.prototype._read=function(b){ae(this,new v("_read()"))},ie.prototype.pipe=function(b,x){var q=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 He=(!x||x.end!==!1)&&b!==t.stdout&&b!==t.stderr,Te=He?Et:u;Q.endEmitted?t.nextTick(Te):q.once("end",Te),b.on("unpipe",U);function U(c,T){f("onunpipe"),c===q&&T&&T.hasUnpiped===!1&&(T.hasUnpiped=!0,gr())}function Et(){f("onend"),b.end()}var St=M(q);b.on("drain",St);var ht=!1;function gr(){f("cleanup"),b.removeListener("close",yr),b.removeListener("finish",h),b.removeListener("drain",St),b.removeListener("error",_t),b.removeListener("unpipe",U),q.removeListener("end",Et),q.removeListener("end",u),q.removeListener("data",Wr),ht=!0,Q.awaitDrain&&(!b._writableState||b._writableState.needDrain)&&St()}q.on("data",Wr);function Wr(c){f("ondata");var T=b.write(c);f("dest.write",T),T===!1&&((Q.pipesCount===1&&Q.pipes===b||Q.pipesCount>1&&oe(Q.pipes,b)!==-1)&&!ht&&(f("false write response, pause",Q.awaitDrain),Q.awaitDrain++),q.pause())}function _t(c){f("onerror",c),u(),b.removeListener("error",_t),n(b,"error")===0&&ae(b,c)}ue(b,"error",_t);function yr(){b.removeListener("finish",h),u()}b.once("close",yr);function h(){f("onfinish"),b.removeListener("close",yr),u()}b.once("finish",h);function u(){f("unpipe"),q.unpipe(b)}return b.emit("pipe",q),Q.flowing||(f("pipe resume"),q.resume()),b};function M(b){return function(){var q=b._readableState;f("pipeOnDrain",q.awaitDrain),q.awaitDrain&&q.awaitDrain--,q.awaitDrain===0&&n(b,"data")&&(q.flowing=!0,C(b))}}ie.prototype.unpipe=function(b){var x=this._readableState,q={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,q),this);if(!b){var Q=x.pipes,He=x.pipesCount;x.pipes=null,x.pipesCount=0,x.flowing=!1;for(var Te=0;Te<He;Te++)Q[Te].emit("unpipe",this,{hasUnpiped:!1});return this}var U=oe(x.pipes,b);return U===-1?this:(x.pipes.splice(U,1),x.pipesCount-=1,x.pipesCount===1&&(x.pipes=x.pipes[0]),b.emit("unpipe",this,q),this)},ie.prototype.on=function(b,x){var q=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?me(this):Q.reading||t.nextTick(F,this)),q},ie.prototype.addListener=ie.prototype.on,ie.prototype.removeListener=function(b,x){var q=r.prototype.removeListener.call(this,b,x);return b==="readable"&&t.nextTick(Z,this),q},ie.prototype.removeAllListeners=function(b){var x=r.prototype.removeAllListeners.apply(this,arguments);return(b==="readable"||b===void 0)&&t.nextTick(Z,this),x};function Z(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)}ie.prototype.resume=function(){var b=this._readableState;return b.flowing||(f("resume"),b.flowing=!b.readableListening,fe(this,b)),b.paused=!1,this};function fe(b,x){x.resumeScheduled||(x.resumeScheduled=!0,t.nextTick(ve,b,x))}function ve(b,x){f("resume",x.reading),x.reading||b.read(0),x.resumeScheduled=!1,b.emit("resume"),C(b),x.flowing&&!x.reading&&b.read(0)}ie.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 C(b){var x=b._readableState;for(f("flow",x.flowing);x.flowing&&b.read()!==null;);}ie.prototype.wrap=function(b){var x=this,q=this._readableState,Q=!1;b.on("end",function(){if(f("wrapped end"),q.decoder&&!q.ended){var U=q.decoder.end();U&&U.length&&x.push(U)}x.push(null)}),b.on("data",function(U){if(f("wrapped data"),q.decoder&&(U=q.decoder.write(U)),!(q.objectMode&&U==null)&&!(!q.objectMode&&(!U||!U.length))){var Et=x.push(U);Et||(Q=!0,b.pause())}});for(var He in b)this[He]===void 0&&typeof b[He]=="function"&&(this[He]=function(Et){return function(){return b[Et].apply(b,arguments)}}(He));for(var Te=0;Te<X.length;Te++)b.on(X[Te],this.emit.bind(this,X[Te]));return this._read=function(U){f("wrapped _read",U),Q&&(Q=!1,b.resume())},this},typeof Symbol=="function"&&(ie.prototype[Symbol.asyncIterator]=function(){return D===void 0&&(D=DI()),D(this)}),Object.defineProperty(ie.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(ie.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(ie.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(x){this._readableState&&(this._readableState.flowing=x)}}),ie._fromList=S,Object.defineProperty(ie.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function S(b,x){if(x.length===0)return null;var q;return x.objectMode?q=x.buffer.shift():!b||b>=x.length?(x.decoder?q=x.buffer.join(""):x.buffer.length===1?q=x.buffer.first():q=x.buffer.concat(x.length),x.buffer.clear()):q=x.buffer.consume(b,x.decoder),q}function j(b){var x=b._readableState;f("endReadable",x.endEmitted),x.endEmitted||(x.ended=!0,t.nextTick(V,x,b))}function V(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 q=x._writableState;(!q||q.autoDestroy&&q.finished)&&x.destroy()}}typeof Symbol=="function"&&(ie.from=function(b,x){return $===void 0&&($=NI()),$(ie,b,x)});function oe(b,x){for(var q=0,Q=b.length;q<Q;q++)if(b[q]===x)return q;return-1}return $s}function xh(){if(sh)return Zs;sh=!0,Zs=s;var t=fr().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=cr();Ct()(s,o);function i(g,y){var p=this._transformState;p.transforming=!1;var m=p.writecb;if(m===null)return this.emit("error",new n);p.writechunk=null,p.writecb=null,y!=null&&this.push(y),m(g);var _=this._readableState;_.reading=!1,(_.needReadable||_.length<_.highWaterMark)&&this._read(_.highWaterMark)}function s(g){if(!(this instanceof s))return new s(g);o.call(this,g),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,g&&(typeof g.transform=="function"&&(this._transform=g.transform),typeof g.flush=="function"&&(this._flush=g.flush)),this.on("prefinish",l)}function l(){var g=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(y,p){f(g,y,p)}):f(this,null,null)}s.prototype.push=function(g,y){return this._transformState.needTransform=!1,o.prototype.push.call(this,g,y)},s.prototype._transform=function(g,y,p){p(new e("_transform()"))},s.prototype._write=function(g,y,p){var m=this._transformState;if(m.writecb=p,m.writechunk=g,m.writeencoding=y,!m.transforming){var _=this._readableState;(m.needTransform||_.needReadable||_.length<_.highWaterMark)&&this._read(_.highWaterMark)}},s.prototype._read=function(g){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(g,y){o.prototype._destroy.call(this,g,function(p){y(p)})};function f(g,y,p){if(y)return g.emit("error",y);if(p!=null&&g.push(p),g._writableState.length)throw new a;if(g._transformState.transforming)throw new r;return g.push(null)}return Zs}function HI(){if(lh)return Ls;lh=!0,Ls=e;var t=xh();Ct()(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)},Ls}function UI(){if(uh)return Fs;uh=!0;var t;function e(p){var m=!1;return function(){m||(m=!0,p.apply(void 0,arguments))}}var n=fr().codes,r=n.ERR_MISSING_ARGS,a=n.ERR_STREAM_DESTROYED;function o(p){if(p)throw p}function i(p){return p.setHeader&&typeof p.abort=="function"}function s(p,m,_,E){E=e(E);var B=!1;p.on("close",function(){B=!0}),t===void 0&&(t=Vs()),t(p,{readable:m,writable:_},function(I){if(I)return E(I);B=!0,E()});var v=!1;return function(I){if(!B&&!v){if(v=!0,i(p))return p.abort();if(typeof p.destroy=="function")return p.destroy();E(I||new a("pipe"))}}}function l(p){p()}function f(p,m){return p.pipe(m)}function g(p){return!p.length||typeof p[p.length-1]!="function"?o:p.pop()}function y(){for(var p=arguments.length,m=new Array(p),_=0;_<p;_++)m[_]=arguments[_];var E=g(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new r("streams");var B,v=m.map(function(I,P){var D=P<m.length-1,$=P>0;return s(I,D,$,function(ae){B||(B=ae),ae&&v.forEach(l),!D&&(v.forEach(l),E(B))})});return m.reduce(f)}return Fs=y,Fs}function wh(){return ch||(ch=!0,mt=mt=_h(),mt.Stream=mt,mt.Readable=mt,mt.Writable=bh(),mt.Duplex=cr(),mt.Transform=xh(),mt.PassThrough=HI(),mt.finished=Vs(),mt.pipeline=UI()),mt}function Eh(){if(fh)return Ma;fh=!0;var t=At().Buffer,e=Pt,n=mh(),r=Ct(),a=wh(),o=Ma.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i=Ma.IncomingMessage=function(s,l,f,g){var y=this||Da;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(){m.read().then(function(I){if(!y._destroyed){if(g(I.done),I.done){y.push(null);return}y.push(t.from(I.value)),v()}}).catch(function(I){g(!0),y._destroyed||y.emit("error",I)})};if(y._fetchResponse=l,y.url=l.url,y.statusCode=l.status,y.statusMessage=l.statusText,l.headers.forEach(function(I,P){y.headers[P.toLowerCase()]=I,y.rawHeaders.push(P,I)}),n.writableStream){var p=new WritableStream({write:function(I){return g(!1),new Promise(function(P,D){y._destroyed?D():y.push(t.from(I))?P():y._resumeFetch=P})},close:function(){g(!0),y._destroyed||y.push(null)},abort:function(I){g(!0),y._destroyed||y.emit("error",I)}});try{l.body.pipeTo(p).catch(function(I){g(!0),y._destroyed||y.emit("error",I)});return}catch{}}var m=l.body.getReader();v()}else{y._xhr=s,y._pos=0,y.url=s.responseURL,y.statusCode=s.status,y.statusMessage=s.statusText;var _=s.getAllResponseHeaders().split(/\r?\n/);if(_.forEach(function(v){var I=v.match(/^([^:]+):\s*(.*)/);if(I){var P=I[1].toLowerCase();P==="set-cookie"?(y.headers[P]===void 0&&(y.headers[P]=[]),y.headers[P].push(I[2])):y.headers[P]!==void 0?y.headers[P]+=", "+I[2]:y.headers[P]=I[2],y.rawHeaders.push(I[1],I[2])}}),y._charset="x-user-defined",!n.overrideMimeType){var E=y.rawHeaders["mime-type"];if(E){var B=E.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||Da,l=s._resumeFetch;l&&(s._resumeFetch=null,l())},i.prototype._onXHRProgress=function(s){var l=this||Da,f=l._xhr,g=null;switch(l._mode){case"text":if(g=f.responseText,g.length>l._pos){var y=g.substr(l._pos);if(l._charset==="x-user-defined"){for(var p=t.alloc(y.length),m=0;m<y.length;m++)p[m]=y.charCodeAt(m)&255;l.push(p)}else l.push(y,l._charset);l._pos=g.length}break;case"arraybuffer":if(f.readyState!==o.DONE||!f.response)break;g=f.response,l.push(t.from(new Uint8Array(g)));break;case"moz-chunked-arraybuffer":if(g=f.response,f.readyState!==o.LOADING||!g)break;l.push(t.from(new Uint8Array(g)));break;case"ms-stream":if(g=f.response,f.readyState!==o.LOADING)break;var _=new Da.MSStreamReader;_.onprogress=function(){_.result.byteLength>l._pos&&(l.push(t.from(new Uint8Array(_.result.slice(l._pos)))),l._pos=_.result.byteLength)},_.onload=function(){s(!0),l.push(null)},_.readAsArrayBuffer(g);break}l._xhr.readyState===o.DONE&&l._mode!=="ms-stream"&&(s(!0),l.push(null))},Ma}function jI(){if(dh)return Ks;dh=!0;var t=At().Buffer,e=Pt,n=mh(),r=Ct(),a=Eh(),o=wh(),i=a.IncomingMessage,s=a.readyStates;function l(p,m){return n.fetch&&m?"fetch":n.mozchunkedarraybuffer?"moz-chunked-arraybuffer":n.msstream?"ms-stream":n.arraybuffer&&p?"arraybuffer":"text"}var f=Ks=function(p){var m=this||rt;o.Writable.call(m),m._opts=p,m._body=[],m._headers={},p.auth&&m.setHeader("Authorization","Basic "+t.from(p.auth).toString("base64")),Object.keys(p.headers).forEach(function(B){m.setHeader(B,p.headers[B])});var _,E=!0;if(p.mode==="disable-fetch"||"requestTimeout"in p&&!n.abortController)E=!1,_=!0;else if(p.mode==="prefer-streaming")_=!1;else if(p.mode==="allow-wrong-content-type")_=!n.overrideMimeType;else if(!p.mode||p.mode==="default"||p.mode==="prefer-fast")_=!0;else throw new Error("Invalid value for opts.mode");m._mode=l(_,E),m._fetchTimer=null,m._socketTimeout=null,m._socketTimer=null,m.on("finish",function(){m._onFinish()})};r(f,o.Writable),f.prototype.setHeader=function(p,m){var _=this||rt,E=p.toLowerCase();y.indexOf(E)===-1&&(_._headers[E]={name:p,value:m})},f.prototype.getHeader=function(p){var m=(this||rt)._headers[p.toLowerCase()];return m?m.value:null},f.prototype.removeHeader=function(p){var m=this||rt;delete m._headers[p.toLowerCase()]},f.prototype._onFinish=function(){var p=this||rt;if(!p._destroyed){var m=p._opts;"timeout"in m&&m.timeout!==0&&p.setTimeout(m.timeout);var _=p._headers,E=null;m.method!=="GET"&&m.method!=="HEAD"&&(E=new Blob(p._body,{type:(_["content-type"]||{}).value||""}));var B=[];if(Object.keys(_).forEach(function(D){var $=_[D].name,ae=_[D].value;Array.isArray(ae)?ae.forEach(function(X){B.push([$,X])}):B.push([$,ae])}),p._mode==="fetch"){var v=null;if(n.abortController){var I=new AbortController;v=I.signal,p._fetchAbortController=I,"requestTimeout"in m&&m.requestTimeout!==0&&(p._fetchTimer=rt.setTimeout(function(){p.emit("requestTimeout"),p._fetchAbortController&&p._fetchAbortController.abort()},m.requestTimeout))}rt.fetch(p._opts.url,{method:p._opts.method,headers:B,body:E||void 0,mode:"cors",credentials:m.withCredentials?"include":"same-origin",signal:v}).then(function(D){p._fetchResponse=D,p._resetTimers(!1),p._connect()},function(D){p._resetTimers(!0),p._destroyed||p.emit("error",D)})}else{var P=p._xhr=new rt.XMLHttpRequest;try{P.open(p._opts.method,p._opts.url,!0)}catch(D){e.nextTick(function(){p.emit("error",D)});return}"responseType"in P&&(P.responseType=p._mode),"withCredentials"in P&&(P.withCredentials=!!m.withCredentials),p._mode==="text"&&"overrideMimeType"in P&&P.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in m&&(P.timeout=m.requestTimeout,P.ontimeout=function(){p.emit("requestTimeout")}),B.forEach(function(D){P.setRequestHeader(D[0],D[1])}),p._response=null,P.onreadystatechange=function(){switch(P.readyState){case s.LOADING:case s.DONE:p._onXHRProgress();break}},p._mode==="moz-chunked-arraybuffer"&&(P.onprogress=function(){p._onXHRProgress()}),P.onerror=function(){p._destroyed||(p._resetTimers(!0),p.emit("error",new Error("XHR error")))};try{P.send(E)}catch(D){e.nextTick(function(){p.emit("error",D)});return}}}};function g(p){try{var m=p.status;return m!==null&&m!==0}catch{return!1}}f.prototype._onXHRProgress=function(){var p=this||rt;p._resetTimers(!1),!(!g(p._xhr)||p._destroyed)&&(p._response||p._connect(),p._response._onXHRProgress(p._resetTimers.bind(p)))},f.prototype._connect=function(){var p=this||rt;p._destroyed||(p._response=new i(p._xhr,p._fetchResponse,p._mode,p._resetTimers.bind(p)),p._response.on("error",function(m){p.emit("error",m)}),p.emit("response",p._response))},f.prototype._write=function(p,m,_){var E=this||rt;E._body.push(p),_()},f.prototype._resetTimers=function(p){var m=this||rt;rt.clearTimeout(m._socketTimer),m._socketTimer=null,p?(rt.clearTimeout(m._fetchTimer),m._fetchTimer=null):m._socketTimeout&&(m._socketTimer=rt.setTimeout(function(){m.emit("timeout")},m._socketTimeout))},f.prototype.abort=f.prototype.destroy=function(p){var m=this||rt;m._destroyed=!0,m._resetTimers(!0),m._response&&(m._response._destroyed=!0),m._xhr?m._xhr.abort():m._fetchAbortController&&m._fetchAbortController.abort(),p&&m.emit("error",p)},f.prototype.end=function(p,m,_){var E=this||rt;typeof p=="function"&&(_=p,p=void 0),o.Writable.prototype.end.call(E,p,m,_)},f.prototype.setTimeout=function(p,m){var _=this||rt;m&&_.once("timeout",m),_._socketTimeout=p,_._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 Ks}function $I(){if(ph)return qs;ph=!0,qs=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 qs}function ZI(){return gh||(gh=!0,zs={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"}),zs}function FI(){if(yh)return Gs;yh=!0;var t=jI(),e=Eh(),n=$I(),r=ZI(),a=je,o=Gs;return o.request=function(i,s){typeof i=="string"?i=a.parse(i):i=n(i);var l=LI.location.protocol.search(/^https?:$/)===-1?"http:":"",f=i.protocol||l,g=i.hostname||i.host,y=i.port,p=i.path||"/";g&&g.indexOf(":")!==-1&&(g="["+g+"]"),i.url=(g?f+"//"+g:"")+(y?":"+y:"")+p,i.method=(i.method||"GET").toUpperCase(),i.headers=i.headers||{};var m=new t(i);return s&&m.on("response",s),m},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"],Gs}var bt,Gm,Rn,Cs,Vm,Rs,Wm,ks,Jm,Os,Ym,Ms,Xm,Ds,Qm,eh,Ns,th,Hs,nh,Us,rh,js,ih,$s,ah,oh,Zs,sh,Ls,lh,Fs,uh,mt,ch,Ma,fh,Da,Ks,dh,rt,qs,ph,zs,gh,Gs,yh,LI,Yt,KI,qI,zI,GI,VI,WI,JI,YI,Ph=it(()=>{R();O();k();Qo();Zy();es();ti();wm();ka();ms();Sm();Rm();zm();_s();bt={},Gm=!1,Rn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Cs={},Vm=!1;Rs={},Wm=!1;ks={},Jm=!1;Os={},Ym=!1;Ms={},Xm=!1;Ds={},Qm=!1,eh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ns={},th=!1;Hs={},nh=!1;Us={},rh=!1;js={},ih=!1;$s={},ah=!1,oh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Zs={},sh=!1;Ls={},lh=!1;Fs={},uh=!1;mt={},ch=!1;Ma={},fh=!1,Da=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ks={},dh=!1,rt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;qs={},ph=!1;zs={},gh=!1;Gs={},yh=!1,LI=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Yt=FI(),KI=Yt.Agent,qI=Yt.ClientRequest,zI=Yt.IncomingMessage,GI=Yt.METHODS,VI=Yt.STATUS_CODES,WI=Yt.get,JI=Yt.globalAgent,YI=Yt.request});R();O();k();var wy={};Dn(wy,{defaults:()=>YE,markdown:()=>JE});R();O();k();R();O();k();R();O();k();var Qi=mr(Un(),1),Ge=mr(Un(),1),Zt=mr(Un(),1),Yn=mr(Un(),1),dt=mr(Un(),1),xo=Object.defineProperty,Vv=Object.defineProperties,Wv=Object.getOwnPropertyDescriptors,yi=Object.getOwnPropertySymbols,rf=Object.prototype.hasOwnProperty,af=Object.prototype.propertyIsEnumerable,xc=(t,e,n)=>e in t?xo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,w=(t,e)=>{for(var n in e||(e={}))rf.call(e,n)&&xc(t,n,e[n]);if(yi)for(var n of yi(e))af.call(e,n)&&xc(t,n,e[n]);return t},H=(t,e)=>Vv(t,Wv(e)),d=(t,e)=>xo(t,"name",{value:e,configurable:!0}),of=(t,e)=>{var n={};for(var r in t)rf.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&yi)for(var r of yi(t))e.indexOf(r)<0&&af.call(t,r)&&(n[r]=t[r]);return n},sf=(t,e)=>{for(var n in e)xo(t,n,{get:e[n],enumerable:!0})},re={};sf(re,{BRAND:()=>aw,DIRTY:()=>qn,EMPTY_PATH:()=>rw,INVALID:()=>de,NEVER:()=>xE,OK:()=>ut,ParseInputLazyPath:()=>Bt,ParseStatus:()=>pt,Schema:()=>ye,ZodAny:()=>xi,ZodArray:()=>Or,ZodBigInt:()=>Oo,ZodBoolean:()=>Mo,ZodBranded:()=>Do,ZodCatch:()=>No,ZodDate:()=>Ho,ZodDefault:()=>sa,ZodDiscriminatedUnion:()=>ng,ZodEffects:()=>vn,ZodEnum:()=>er,ZodError:()=>$t,ZodFirstPartyTypeKind:()=>Lp,ZodFunction:()=>ig,ZodIntersection:()=>jo,ZodIssueCode:()=>G,ZodLazy:()=>$o,ZodLiteral:()=>Zo,ZodMap:()=>sg,ZodNaN:()=>ug,ZodNativeEnum:()=>Lo,ZodNever:()=>hn,ZodNull:()=>Fo,ZodNullable:()=>Gn,ZodNumber:()=>Ko,ZodObject:()=>Vn,ZodOptional:()=>tn,ZodParsedType:()=>ne,ZodPipeline:()=>qo,ZodPromise:()=>ua,ZodReadonly:()=>ca,ZodRecord:()=>mg,ZodRef:()=>vg,ZodSchema:()=>ye,ZodSet:()=>Tg,ZodString:()=>ct,ZodSymbol:()=>Rg,ZodTransformer:()=>vn,ZodTuple:()=>Jn,ZodType:()=>ye,ZodUndefined:()=>zo,ZodUnion:()=>Go,ZodUnknown:()=>Pr,ZodVoid:()=>Dg,addIssueToContext:()=>te,agent:()=>Iw,aimodel:()=>kw,any:()=>Fw,array:()=>Gw,bigint:()=>Uw,boolean:()=>uy,coerce:()=>_E,conversation:()=>Ew,createZodEnum:()=>la,cuid2Regex:()=>_g,cuidRegex:()=>bg,custom:()=>eg,datasource:()=>Ow,date:()=>jw,datetimeRegex:()=>Sg,default:()=>pE,discriminatedUnion:()=>Yw,effect:()=>nf,emailRegex:()=>Eg,enum:()=>lE,errorUtil:()=>se,event:()=>Sw,fromJsonSchema:()=>TE,fromObject:()=>bE,function:()=>aE,getErrorMap:()=>Rr,getParsedType:()=>en,instanceof:()=>Nw,intent:()=>Rw,intersection:()=>Xw,ipv4Regex:()=>Pg,ipv6Regex:()=>Ig,isAborted:()=>uo,isAsync:()=>bi,isDirty:()=>co,isEmojiRegex:()=>ow,isValid:()=>kr,jsonSchemaToZui:()=>fa,knowledgebase:()=>Mw,late:()=>Dw,lazy:()=>oE,literal:()=>sE,makeIssue:()=>Ti,map:()=>rE,message:()=>Pw,nan:()=>Hw,nativeEnum:()=>uE,never:()=>qw,null:()=>Lw,nullable:()=>dE,number:()=>ly,object:()=>Vw,objectToZui:()=>Mr,objectUtil:()=>lo,oboolean:()=>vE,onumber:()=>hE,optional:()=>fE,ostring:()=>mE,pipeline:()=>yE,preprocess:()=>gE,processCreateParams:()=>ge,promise:()=>cE,quotelessJson:()=>nw,readonly:()=>nE,record:()=>eE,ref:()=>tE,set:()=>iE,setErrorMap:()=>qp,strictObject:()=>Ww,string:()=>sy,symbol:()=>$w,table:()=>Aw,tablerow:()=>Cw,transformer:()=>nf,tuple:()=>Qw,ulidRegex:()=>xg,undefined:()=>Zw,union:()=>Jw,unknown:()=>Kw,user:()=>Bw,util:()=>be,uuidRegex:()=>wg,variable:()=>ww,void:()=>zw,zuiToJsonSchema:()=>Yo});var Ie="x-zui",lf=(0,Ge.createContext)({formData:void 0,formSchema:void 0,setFormData:d(()=>{throw new Error("Must be within a FormDataProvider")},"setFormData"),setHiddenState:d(()=>{throw new Error("Must be within a FormDataProvider")},"setHiddenState"),setDisabledState:d(()=>{throw new Error("Must be within a FormDataProvider")},"setDisabledState"),hiddenState:{},disabledState:{},validation:{formValid:null,formErrors:null}}),wc=d((t,e,n)=>{var r;let a=(r=e[Ie])==null?void 0:r[t];if(typeof a>"u")return!1;if(typeof a=="boolean")return a;if(typeof a=="string"){if(typeof window>"u")return console.warn("Function evaluation is not supported in server side rendering"),!1;let i=new Function("return "+a)()(n);switch(typeof i){case"object":case"boolean":return i;default:return!1}}return!1},"parseMaskableField"),uf=d((t,e)=>{let n=(0,Ge.useContext)(lf);if(n===void 0)throw new Error("useFormData must be used within a FormDataProvider");let r=(0,Ge.useMemo)(()=>gn(n.formData,e),[n.formData,e]),a=(0,Ge.useMemo)(()=>{var m;return n.validation.formValid===null?{formValid:null,formErrors:null}:n.validation.formValid===!1?{formValid:!1,formErrors:((m=n.validation.formErrors)==null?void 0:m.filter(_=>df(_.path,e)).map(_=>({message:_.message,code:_.code,path:e})))||null}:{formValid:!0,formErrors:[]}},[n.validation.formValid,n.validation.formErrors,e]),o=n.dataTransform?n.dataTransform(r):r,i=(0,Ge.useMemo)(()=>wc("hidden",t,o),[t,o]),s=(0,Ge.useMemo)(()=>wc("disabled",t,o),[t,o]);(0,Ge.useEffect)(()=>{n.setHiddenState(m=>jn(m,e,i||{})),n.setDisabledState(m=>jn(m,e,s||{}))},[JSON.stringify({fieldSchema:t,data:r})]);let{disabled:l,hidden:f}=(0,Ge.useMemo)(()=>{let m=i===!0||gn(n.hiddenState,e),_=s===!0||gn(n.disabledState,e);return{hidden:m===!0,disabled:_===!0}},[n.hiddenState,n.disabledState,i,s,e]),g=(0,Ge.useCallback)((m,_)=>{n.setFormData(E=>jn(E,m,_))},[n.setFormData]),y=(0,Ge.useCallback)((m,_=void 0)=>{let E=Kn(t.items);n.setFormData(B=>{let v=gn(B,m)||[];return _===void 0&&(_=E),jn(B,m,Array.isArray(v)?[...v,_]:[_])})},[n.setFormData]),p=(0,Ge.useCallback)((m,_)=>{n.setFormData(E=>{let B=gn(E,m)||[];return Array.isArray(B)?(B.splice(_,1),jn(E,m,B)):E})},[n.setFormData]);return w(H(w({},n),{data:r,disabled:l,hidden:f,handlePropertyChange:g,addArrayItem:y,removeArrayItem:p}),a)},"useFormData");function jn(t,e,n){if(e.length===0)return n;let r=e.length;return e.reduce((a,o,i)=>(i===r-1?a[o]=n:a[o]||(a[o]=isNaN(Number(o))?{}:[]),a[o]),t??{}),w({},t)}d(jn,"setObjectPath");var Kn=d((t,e)=>{var n,r,a,o;if(Array.isArray(t))return Kn(t[0]);if(t.default)return t.default;if(t.nullable)return null;if(!e){if((n=t.anyOf)!=null&&n.length)return Kn(t.anyOf[0]);if(t.type==="object"&&t.properties){let i={};return Object.entries(t.properties).map(([s,l])=>{var f;i[s]=Kn(l,!((f=t.required)!=null&&f.includes(s))||cf(l)||!1)}),i}if(t.type==="array")return t.minItems&&t.minItems>0?[Kn(t.items)]:[];if(t.type==="string")return(r=t.enum)!=null&&r.length?t.enum[0]:"";if(t.type==="number")return(a=t.enum)!=null&&a.length?t.enum[0]:0;if(t.type==="boolean")return(o=t.enum)!=null&&o.length?t.enum[0]:!1}},"getDefaultValues"),Jv=d(({children:t,setFormData:e,formData:n,formSchema:r,disableValidation:a,onValidation:o,dataTransform:i})=>{let[s,l]=(0,Ge.useState)({}),[f,g]=(0,Ge.useState)({}),y=i?i(n):n,p=(0,Ge.useMemo)(()=>{if(a)return{formValid:null,formErrors:null};if(!r)return{formValid:null,formErrors:null};let m=fa(r).safeParse(y);return m.success?{formValid:!0,formErrors:[]}:{formValid:!1,formErrors:m.error.issues}},[JSON.stringify({transformedData:y})]);return(0,Ge.useEffect)(()=>{o&&o(p)},[p]),Ge.default.createElement(lf.Provider,{value:{formData:n,setFormData:e,formSchema:r,validation:p,hiddenState:s,setHiddenState:l,disabledState:f,setDisabledState:g,dataTransform:i}},t)},"FormDataProvider");function gn(t,e){return e.reduce((n,r)=>n?n[r]:null,t)}d(gn,"getPathData");function cf(t){var e;return((e=t.anyOf)==null?void 0:e.some(n=>n.not&&Object.keys(n.not).length===0))||!1}d(cf,"isOptional");function mi(t,e){let n=w({},t);for(let r in e)e.hasOwnProperty(r)&&(typeof e[r]=="object"&&e[r]!==null&&!Array.isArray(e[r])?typeof n[r]=="object"&&n[r]!==null&&!Array.isArray(n[r])?n[r]=mi(n[r],e[r]):n[r]=mi({},e[r]):n[r]=e[r]);return n}d(mi,"deepMerge");var Yv=d((t,e)=>{let{handlePropertyChange:n,data:r}=uf(t,e),{discriminator:a,value:o,discriminatedSchema:i}=(0,Qi.useMemo)(()=>{let s=ff(t.anyOf),l=s?.key?r?.[s.key]:t.default||null,f=Xv(s?.key||null,l,t.anyOf);return{discriminator:s,value:l,discriminatedSchema:f}},[t.anyOf,r]);return(0,Qi.useEffect)(()=>{a?.key&&a?.values.length&&Object.keys(r||{}).length<1&&!t.default&&n(e,{[a.key]:a.values[0]})},[]),{discriminator:a,discriminatorValue:o,discriminatedSchema:i}},"useDiscriminator"),ff=d(t=>{let e=t?.map(n=>n.type!=="object"||!n.properties?null:Object.entries(n.properties).map(([r,a])=>{var o;return a.type==="string"&&((o=a.enum)!=null&&o.length)?{key:r,value:a.enum[0]}:null}).filter(r=>!!r)).flat().reduce((n,r)=>{if(!r)return n;let{key:a,value:o}=r;return n.key===null&&(n.key=a),n.key===a&&n.values.push(o),n},{key:null,values:[]});return e?.key===null||!e?.values.length?null:e},"resolveDiscriminator"),Xv=d((t,e,n)=>{var r,a;if(!n?.length||!t||!e)return null;for(let o of n){if(o.type!=="object")continue;let i=(r=o.properties)==null?void 0:r[t];if(i?.type==="string"&&((a=i.enum)!=null&&a.length)&&i.enum[0]===e)return H(w({},o),{properties:H(w({},o.properties),{[t]:H(w({},i),{[Ie]:{hidden:!0}})})})}return null},"resolveDiscriminatedSchema"),Qv=d(t=>{var e;return(e=t.anyOf)!=null&&e.length?ff(t.anyOf)?"discriminatedUnion":"object":t.type==="integer"?"number":t.type},"getSchemaType"),eT=d((t,e)=>{var n,r,a;let o=Qv(e),i=((n=e[Ie])==null?void 0:n.displayAs)||null;if(!i||!Array.isArray(i)||i.length<2){let g=(r=t?.[o])==null?void 0:r.default;return g?{Component:g,type:o,id:"default",params:{}}:null}let s=i[0],l=((a=t?.[o])==null?void 0:a[s])||null;if(!l)return console.warn(`Component ${o}.${s} not found`),null;let f=i[1]||{};return{Component:l,type:o,id:s,params:f}},"resolveComponent");function df(t,e){return t.length!==e.length?!1:t.every((n,r)=>n===e[r])}d(df,"pathMatches");function eo(t,e){return e||(e=new RegExp("/s|-|_| ","g")),yf(t).split(e).map(pf).map(mf).reduce(gf)}d(eo,"formatTitle");function pf(t){return t.charAt(0).toUpperCase()+t.substring(1)}d(pf,"capitalize");function gf(t,e){return`${t} ${e}`}d(gf,"combine");function yf(t){return t.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()}d(yf,"decamelize");function mf(t,e,n){let r=t.toLowerCase(),a=t.toUpperCase();for(let o of aT)if(o.toLowerCase()===r)return o;return tT.includes(a)?a:e===0||e===n.length-1||t.length>=4?t:iT.includes(r)||rT.includes(r)||nT.includes(r)?r:t}d(mf,"handleSpecialWords");var tT=["2D","3D","4WD","A2O","API","BIOS","CCTV","CC","CCV","CD","CD-ROM","COBOL","CIA","CMS","CSS","CSV","CV","DIY","DVD","DB","DNA","E3","EIN","ESPN","FAQ","FAQs","FTP","FPS","FORTRAN","FBI","HTML","HTTP","ID","IP","ISO","JS","JSON","LASER","M2A","M2M","M2MM","M2O","MMORPG","NAFTA","NASA","NDA","O2M","PDF","PHP","POP","RAM","RNGR","ROM","RPG","RTFM","RTS","SCUBA","SITCOM","SKU","SMTP","SQL","SSN","SWAT","TBS","TTL","TV","TNA","UI","URL","USB","UWP","VIP","W3C","WYSIWYG","WWW","WWE","WWF"],nT=["a","an","the"],rT=["and","that","but","or","as","if","when","than","because","while","where","after","so","though","since","until","whether","before","although","nor","like","once","unless","now","except"],iT=["about","above","across","after","against","along","among","around","at","because of","before","behind","below","beneath","beside","besides","between","beyond","but","by","concerning","despite","down","during","except","excepting","for","from","in","in front of","inside","in spite of","instead of","into","like","near","of","off","on","onto","out","outside","over","past","regarding","since","through","throughout","to","toward","under","underneath","until","up","upon","up to","with","within","without","with regard to","with respect to"],aT=["2FA","3D","4K","5K","8K","AGI","BI","ChatGPT","CTA","DateTime","GitHub","GPT","HD","IBMid","ID","IDs","iMac","IMAX","iOS","IP","iPad","iPhone","iPod","LDAP","LinkedIn","LLM","M2M","M2O","macOS","McDonalds","ML","MySQL","NLG","NLP","NLU","O2M","OpenAI","PDFs","PEFT","pH","PostgreSQL","SEO","TTS","UHD","UUID","XSS","YouTube"];function hf(t){return typeof t=="symbol"?"symbol":typeof t=="bigint"?`${t.toString()}n`:jt(t)}d(hf,"primitiveToTypscriptLiteralType");function jt(t){return typeof t>"u"?"undefined":typeof t=="symbol"?t.description?`Symbol(${jt(t.description)})`:"Symbol()":typeof t=="bigint"?`BigInt(${t.toString()})`:JSON.stringify(t)}d(jt,"primitiveToTypescriptValue");function vf(t){return typeof t>"u"?"undefined":JSON.stringify(t)}d(vf,"unknownToTypescriptValue");var Ec=d(t=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)?t:jt(t),"toPropertyKey"),oT=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(oT).filter(r=>!!r).join("")},"toTypeArgumentName"),pe=d(t=>{let e=(t??"").split(`
10
+ `)):s=t.stylize("[Circular]","special")),Cn(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 Pm(t){return Array.isArray(t)}function ys(t){return typeof t=="boolean"}function No(t){return t===null}function km(t){return typeof t=="number"}function Oo(t){return typeof t=="string"}function Cn(t){return t===void 0}function Lr(t){return lr(t)&&ms(t)==="[object RegExp]"}function lr(t){return typeof t=="object"&&t!==null}function Mo(t){return lr(t)&&ms(t)==="[object Date]"}function Fr(t){return lr(t)&&(ms(t)==="[object Error]"||t instanceof Error)}function So(t){return typeof t=="function"}function ms(t){return Object.prototype.toString.call(t)}function cs(t){return t<10?"0"+t.toString(10):t.toString(10)}function CE(){var t=new Date,e=[cs(t.getHours()),cs(t.getMinutes()),cs(t.getSeconds())].join(":");return[t.getDate(),IE[t.getMonth()],e].join(" ")}function Sm(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function AE(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}var am,qt,zt,sr,et,In,Gt,ar,ko,Ke,sE,ps,Do,um,lE,uE,cE,fE,dE,cm,fm,Vy,pE,gE,yE,dm,Ee,mE,hE,vE,pm,gs,_t,mt,TE,Ge,bE,wE,xE,Zr,L,Rt,om,PE,Eo,Em,Po,IE,Sn,FC,Uo=it(()=>{A();O();R();sr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,et=am={};(function(){try{qt=typeof setTimeout=="function"?setTimeout:fs}catch{qt=fs}try{zt=typeof clearTimeout=="function"?clearTimeout:ds}catch{zt=ds}})();Gt=[],ar=!1,ko=-1;et.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];Gt.push(new Gy(t,e)),Gt.length!==1||ar||sm(lm)},Gy.prototype.run=function(){(this||sr).fun.apply(null,(this||sr).array)},et.title="browser",et.browser=!0,et.env={},et.argv=[],et.version="",et.versions={},et.on=Wt,et.addListener=Wt,et.once=Wt,et.off=Wt,et.removeListener=Wt,et.removeAllListeners=Wt,et.emit=Wt,et.prependListener=Wt,et.prependOnceListener=Wt,et.listeners=function(t){return[]},et.binding=function(t){throw new Error("process.binding is not supported")},et.cwd=function(){return"/"},et.chdir=function(t){throw new Error("process.chdir is not supported")},et.umask=function(){return 0};Ke=am;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;sE=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",ps=Object.prototype.toString,Do=function(t){return!(sE&&t&&typeof t=="object"&&Symbol.toStringTag in t)&&ps.call(t)==="[object Arguments]"},um=function(t){return!!Do(t)||t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&ps.call(t)!=="[object Array]"&&ps.call(t.callee)==="[object Function]"},lE=function(){return Do(arguments)}();Do.isLegacyArguments=um;uE=lE?Do:um,cE=Object.prototype.toString,fE=Function.prototype.toString,dE=/^\s*(?:function)?\*/,cm=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",fm=Object.getPrototypeOf,Vy=function(){if(!cm)return!1;try{return Function("return function*() {}")()}catch{}}(),pE=Vy?fm(Vy):{},gE=function(t){return typeof t=="function"&&(!!dE.test(fE.call(t))||(cm?fm(t)===pE:cE.call(t)==="[object GeneratorFunction]"))},yE=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}},dm=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"},Ee={},mE=dm,hE=uE,vE=gE;pm=typeof BigInt<"u",gs=typeof Symbol<"u",_t=gs&&Symbol.toStringTag!==void 0,mt=typeof Uint8Array<"u",TE=typeof ArrayBuffer<"u";if(mt&&_t)var _E=Object.getPrototypeOf(Uint8Array.prototype),xt=An(Object.getOwnPropertyDescriptor(_E,Symbol.toStringTag).get);Ge=An(Object.prototype.toString),bE=An(Number.prototype.valueOf),wE=An(String.prototype.valueOf),xE=An(Boolean.prototype.valueOf);if(pm)var BE=An(BigInt.prototype.valueOf);if(gs)var EE=An(Symbol.prototype.valueOf);Ee.isArgumentsObject=hE,Ee.isGeneratorFunction=vE,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 TE&&ArrayBuffer.isView?ArrayBuffer.isView(t):Jy(t)||Xy(t)},Ee.isTypedArray=Jy,Ee.isUint8Array=gm,Ee.isUint8ClampedArray=ym,Ee.isUint16Array=mm,Ee.isUint32Array=hm,Ee.isInt8Array=vm,Ee.isInt16Array=Tm,Ee.isInt32Array=_m,Ee.isFloat32Array=bm,Ee.isFloat64Array=wm,Ee.isBigInt64Array=xm,Ee.isBigUint64Array=Bm,wo.working=typeof Map<"u"&&wo(new Map),Ee.isMap=function(t){return typeof Map<"u"&&(wo.working?wo(t):t instanceof Map)},xo.working=typeof Set<"u"&&xo(new Set),Ee.isSet=function(t){return typeof Set<"u"&&(xo.working?xo(t):t instanceof Set)},Bo.working=typeof WeakMap<"u"&&Bo(new WeakMap),Ee.isWeakMap=function(t){return typeof WeakMap<"u"&&(Bo.working?Bo(t):t instanceof WeakMap)},ss.working=typeof WeakSet<"u"&&ss(new WeakSet),Ee.isWeakSet=function(t){return ss(t)},Io.working=typeof ArrayBuffer<"u"&&Io(new ArrayBuffer),Ee.isArrayBuffer=Yy,Co.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Co(new DataView(new ArrayBuffer(1),0,1)),Ee.isDataView=Xy,Ao.working=typeof SharedArrayBuffer<"u"&&Ao(new SharedArrayBuffer),Ee.isSharedArrayBuffer=Qy,Ee.isAsyncFunction=function(t){return Ge(t)==="[object AsyncFunction]"},Ee.isMapIterator=function(t){return Ge(t)==="[object Map Iterator]"},Ee.isSetIterator=function(t){return Ge(t)==="[object Set Iterator]"},Ee.isGeneratorObject=function(t){return Ge(t)==="[object Generator]"},Ee.isWebAssemblyCompiledModule=function(t){return Ge(t)==="[object WebAssembly.Module]"},Ee.isNumberObject=em,Ee.isStringObject=tm,Ee.isBooleanObject=nm,Ee.isBigIntObject=rm,Ee.isSymbolObject=im,Ee.isBoxedPrimitive=function(t){return em(t)||tm(t)||nm(t)||rm(t)||im(t)},Ee.isAnyArrayBuffer=function(t){return mt&&(Yy(t)||Qy(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(Ee,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={},Rt=Ke,om=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},PE=/%[sdj%]/g;L.format=function(t){if(!Oo(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(an(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,o=r.length,a=String(t).replace(PE,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])No(i)||!lr(i)?a+=" "+i:a+=" "+an(i);return a},L.deprecate=function(t,e){if(Rt!==void 0&&Rt.noDeprecation===!0)return t;if(Rt===void 0)return function(){return L.deprecate(t,e).apply(this||Zr,arguments)};var n=!1;return function(){if(!n){if(Rt.throwDeprecation)throw new Error(e);Rt.traceDeprecation?console.trace(e):console.error(e),n=!0}return t.apply(this||Zr,arguments)}};Eo={},Em=/^$/;Rt.env.NODE_DEBUG&&(Po=Rt.env.NODE_DEBUG,Po=Po.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),Em=new RegExp("^"+Po+"$","i"));L.debuglog=function(t){if(t=t.toUpperCase(),!Eo[t])if(Em.test(t)){var e=Rt.pid;Eo[t]=function(){var n=L.format.apply(L,arguments);console.error("%s %d: %s",t,e,n)}}else Eo[t]=function(){};return Eo[t]},L.inspect=an,an.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]},an.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},L.types=Ee,L.isArray=Pm,L.isBoolean=ys,L.isNull=No,L.isNullOrUndefined=function(t){return t==null},L.isNumber=km,L.isString=Oo,L.isSymbol=function(t){return typeof t=="symbol"},L.isUndefined=Cn,L.isRegExp=Lr,L.types.isRegExp=Lr,L.isObject=lr,L.isDate=Mo,L.types.isDate=Mo,L.isError=Fr,L.types.isNativeError=Fr,L.isFunction=So,L.isPrimitive=function(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||t===void 0},L.isBuffer=dm;IE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];L.log=function(){console.log("%s - %s",CE(),L.format.apply(L,arguments))},L.inherits=yE,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};Sn=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(Sn&&t[Sn]){var e;if(typeof(e=t[Sn])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Sn,{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)),Sn&&Object.defineProperty(e,Sn,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,om(t))},L.promisify.custom=Sn,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){Rt.nextTick(i.bind(null,null,s))},function(s){Rt.nextTick(AE.bind(null,s,i))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,om(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;FC=L.promisify;L.types});var VC,Im=it(()=>{A();O();R();Uo();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;L.TextEncoder=globalThis.TextEncoder;L.TextDecoder=globalThis.TextDecoder});function _s(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function RE(){!ur||!Rn||(ur=!1,Rn.length?Vt=Rn.concat(Vt):Ho=-1,Vt.length&&Cm())}function Cm(){if(!ur){var t=setTimeout(RE,0);ur=!0;for(var e=Vt.length;e;){for(Rn=Vt,Vt=[];++Ho<e;)Rn&&Rn[Ho].run();Ho=-1,e=Vt.length}Rn=null,ur=!1,clearTimeout(t)}}function OE(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];Vt.push(new Am(t,e)),Vt.length===1&&!ur&&setTimeout(Cm,0)}function Am(t,e){this.fun=t,this.array=e}function st(){}function JE(t){_s("_linkedBinding")}function eP(t){_s("dlopen")}function tP(){return[]}function nP(){return[]}function fP(t,e){if(!t)throw new Error(e||"assertion error")}function yP(){return!1}function RP(){return sn.now()/1e3}function Ts(t){var e=Math.floor((Date.now()-sn.now())*.001),n=sn.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+=vs)),[r,o]}function ln(){return kt}function KP(t){return[]}var Vt,ur,Rn,Ho,ME,DE,NE,UE,HE,jE,$E,ZE,LE,FE,KE,WE,qE,zE,GE,VE,YE,XE,QE,rP,iP,bs,oP,aP,sP,lP,uP,cP,dP,pP,gP,mP,hP,vP,TP,_P,bP,wP,xP,BP,EP,PP,kP,SP,IP,CP,AP,sn,hs,vs,OP,MP,DP,NP,UP,HP,jP,$P,ZP,LP,FP,kt,ws=it(()=>{A();O();R();Vt=[],ur=!1,Ho=-1;Am.prototype.run=function(){this.fun.apply(null,this.array)};ME="browser",DE="x64",NE="browser",UE={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},HE=["/usr/bin/node"],jE=[],$E="v16.8.0",ZE={},LE=function(t,e){console.warn((e?e+": ":"")+t)},FE=function(t){_s("binding")},KE=function(t){return 0},WE=function(){return"/"},qE=function(t){},zE={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};GE=st,VE=[];YE={},XE=!1,QE={};rP=st,iP=st,bs=function(){return{}},oP=bs,aP=bs,sP=st,lP=st,uP=st,cP={};dP={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},pP=st,gP=st;mP=st,hP=st,vP=st,TP=st,_P=st,bP=void 0,wP=void 0,xP=void 0,BP=st,EP=2,PP=1,kP="/bin/usr/node",SP=9229,IP="node",CP=[],AP=st,sn={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};sn.now===void 0&&(hs=Date.now(),sn.timing&&sn.timing.navigationStart&&(hs=sn.timing.navigationStart),sn.now=()=>Date.now()-hs);vs=1e9;Ts.bigint=function(t){var e=Ts(t);return typeof BigInt>"u"?e[0]*vs+e[1]:BigInt(e[0]*vs)+BigInt(e[1])};OP=10,MP={},DP=0;NP=ln,UP=ln,HP=ln,jP=ln,$P=ln,ZP=st,LP=ln,FP=ln;kt={version:$E,versions:ZE,arch:DE,platform:NE,release:zE,_rawDebug:GE,moduleLoadList:VE,binding:FE,_linkedBinding:JE,_events:MP,_eventsCount:DP,_maxListeners:OP,on:ln,addListener:NP,once:UP,off:HP,removeListener:jP,removeAllListeners:$P,emit:ZP,prependListener:LP,prependOnceListener:FP,listeners:KP,domain:YE,_exiting:XE,config:QE,dlopen:eP,uptime:RP,_getActiveRequests:tP,_getActiveHandles:nP,reallyExit:rP,_kill:iP,cpuUsage:bs,resourceUsage:oP,memoryUsage:aP,kill:sP,exit:lP,openStdin:uP,allowedNodeEnvironmentFlags:cP,assert:fP,features:dP,_fatalExceptions:pP,setUncaughtExceptionCaptureCallback:gP,hasUncaughtExceptionCaptureCallback:yP,emitWarning:LE,nextTick:OE,_tickCallback:mP,_debugProcess:hP,_debugEnd:vP,_startProfilerIdleNotifier:TP,_stopProfilerIdleNotifier:_P,stdout:bP,stdin:xP,stderr:wP,abort:BP,umask:KE,chdir:qE,cwd:WE,env:UE,title:ME,argv:HE,execArgv:jE,pid:EP,ppid:PP,execPath:kP,debugPort:SP,hrtime:Ts,argv0:IP,_preload_modules:CP,setSourceMapsEnabled:AP}});function Om(){if(Rm)return xs;Rm=!0,xs=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 xs}var xs,Rm,Bs,Mm=it(()=>{A();O();R();xs={},Rm=!1,Bs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global});function WP(){if(Dm)return Wr;Dm=!0;var t=Ct(),e=t.Buffer;function n(o,a){for(var i in o)a[i]=o[i]}e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?Wr=t:(n(t,Wr),Wr.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)},Wr}function qP(){if(Nm)return Es;Nm=!0;var t=WP().Buffer,e=t.isEncoding||function(T){switch(T=""+T,T&&T.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(T){if(!T)return"utf8";for(var k;;)switch(T){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 T;default:if(k)return;T=(""+T).toLowerCase(),k=!0}}function r(T){var k=n(T);if(typeof k!="string"&&(t.isEncoding===e||!e(T)))throw new Error("Unknown encoding: "+T);return k||T}Es.StringDecoder=o;function o(T){this.encoding=r(T);var k;switch(this.encoding){case"utf16le":this.text=y,this.end=g,k=4;break;case"utf8":this.fillLast=l,k=4;break;case"base64":this.text=m,this.end=v,k=3;break;default:this.write=B,this.end=E;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(k)}o.prototype.write=function(T){if(T.length===0)return"";var k,P;if(this.lastNeed){if(k=this.fillLast(T),k===void 0)return"";P=this.lastNeed,this.lastNeed=0}else P=0;return P<T.length?k?k+this.text(T,P):this.text(T,P):k||""},o.prototype.end=d,o.prototype.text=f,o.prototype.fillLast=function(T){if(this.lastNeed<=T.length)return T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,T.length),this.lastNeed-=T.length};function a(T){return T<=127?0:T>>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function i(T,k,P){var M=k.length-1;if(M<P)return 0;var $=a(k[M]);return $>=0?($>0&&(T.lastNeed=$-1),$):--M<P||$===-2?0:($=a(k[M]),$>=0?($>0&&(T.lastNeed=$-2),$):--M<P||$===-2?0:($=a(k[M]),$>=0?($>0&&($===2?$=0:T.lastNeed=$-3),$):0))}function s(T,k,P){if((k[0]&192)!==128)return T.lastNeed=0,"\uFFFD";if(T.lastNeed>1&&k.length>1){if((k[1]&192)!==128)return T.lastNeed=1,"\uFFFD";if(T.lastNeed>2&&k.length>2&&(k[2]&192)!==128)return T.lastNeed=2,"\uFFFD"}}function l(T){var k=this.lastTotal-this.lastNeed,P=s(this,T);if(P!==void 0)return P;if(this.lastNeed<=T.length)return T.copy(this.lastChar,k,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,k,0,T.length),this.lastNeed-=T.length}function f(T,k){var P=i(this,T,k);if(!this.lastNeed)return T.toString("utf8",k);this.lastTotal=P;var M=T.length-(P-this.lastNeed);return T.copy(this.lastChar,0,M),T.toString("utf8",k,M)}function d(T){var k=T&&T.length?this.write(T):"";return this.lastNeed?k+"\uFFFD":k}function y(T,k){if((T.length-k)%2===0){var P=T.toString("utf16le",k);if(P){var M=P.charCodeAt(P.length-1);if(M>=55296&&M<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],P.slice(0,-1)}return P}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",k,T.length-1)}function g(T){var k=T&&T.length?this.write(T):"";if(this.lastNeed){var P=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,P)}return k}function m(T,k){var P=(T.length-k)%3;return P===0?T.toString("base64",k):(this.lastNeed=3-P,this.lastTotal=3,P===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",k,T.length-P))}function v(T){var k=T&&T.length?this.write(T):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function B(T){return T.toString(this.encoding)}function E(T){return T&&T.length?this.write(T):""}return Es}var Wr,Dm,Es,Nm,qr,uA,Um=it(()=>{A();O();R();oi();Wr={},Dm=!1;Es={},Nm=!1;qr=qP();qr.StringDecoder;uA=qr.StringDecoder});function zP(){if(Hm)return Ps;Hm=!0;var t=Ps={},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(B){if(e===setTimeout)return setTimeout(B,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(B,0);try{return e(B,0)}catch{try{return e.call(null,B,0)}catch{return e.call(this||cr,B,0)}}}function i(B){if(n===clearTimeout)return clearTimeout(B);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(B);try{return n(B)}catch{try{return n.call(null,B)}catch{return n.call(this||cr,B)}}}var s=[],l=!1,f,d=-1;function y(){!l||!f||(l=!1,f.length?s=f.concat(s):d=-1,s.length&&g())}function g(){if(!l){var B=a(y);l=!0;for(var E=s.length;E;){for(f=s,s=[];++d<E;)f&&f[d].run();d=-1,E=s.length}f=null,l=!1,i(B)}}t.nextTick=function(B){var E=new Array(arguments.length-1);if(arguments.length>1)for(var T=1;T<arguments.length;T++)E[T-1]=arguments[T];s.push(new m(B,E)),s.length===1&&!l&&a(g)};function m(B,E){(this||cr).fun=B,(this||cr).array=E}m.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 v(){}return t.on=v,t.addListener=v,t.once=v,t.off=v,t.removeListener=v,t.removeAllListeners=v,t.emit=v,t.prependListener=v,t.prependOnceListener=v,t.listeners=function(B){return[]},t.binding=function(B){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(B){throw new Error("process.chdir is not supported")},t.umask=function(){return 0},Ps}var Ps,Hm,cr,We,ks=it(()=>{A();O();R();Ps={},Hm=!1,cr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;We=zP();We.platform="browser";We.addListener;We.argv;We.binding;We.browser;We.chdir;We.cwd;We.emit;We.env;We.listeners;We.nextTick;We.off;We.on;We.once;We.prependListener;We.prependOnceListener;We.removeAllListeners;We.removeListener;We.title;We.umask;We.version;We.versions});function GP(){if(jm)return Ss;jm=!0;var t=We;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,d=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||d===1))if(f!==g-1&&d===2){if(s.length<2||l!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var m=s.lastIndexOf("/");if(m!==s.length-1){m===-1?(s="",l=0):(s=s.slice(0,m),l=s.length-1-s.lastIndexOf("/")),f=g,d=0;continue}}else if(s.length===2||s.length===1){s="",l=0,f=g,d=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,d=0}else y===46&&d!==-1?++d:d=-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 d;f>=0?d=arguments[f]:(l===void 0&&(l=t.cwd()),d=l),e(d),d.length!==0&&(i=d+"/"+i,s=d.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,d=f-l,y=1;y<s.length&&s.charCodeAt(y)===47;++y);for(var g=s.length,m=g-y,v=d<m?d:m,B=-1,E=0;E<=v;++E){if(E===v){if(m>v){if(s.charCodeAt(y+E)===47)return s.slice(y+E+1);if(E===0)return s.slice(y+E)}else d>v&&(i.charCodeAt(l+E)===47?B=E:E===0&&(B=0));break}var T=i.charCodeAt(l+E),k=s.charCodeAt(y+E);if(T!==k)break;T===47&&(B=E)}var P="";for(E=l+B+1;E<=f;++E)(E===f||i.charCodeAt(E)===47)&&(P.length===0?P+="..":P+="/..");return P.length>0?P+s.slice(y+B):(y+=B,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,d=!0,y=i.length-1;y>=1;--y)if(s=i.charCodeAt(y),s===47){if(!d){f=y;break}}else d=!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,d=!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,m=-1;for(y=i.length-1;y>=0;--y){var v=i.charCodeAt(y);if(v===47){if(!d){l=y+1;break}}else m===-1&&(d=!1,m=y+1),g>=0&&(v===s.charCodeAt(g)?--g===-1&&(f=y):(g=-1,f=m))}return l===f?f=m:f===-1&&(f=i.length),i.slice(l,f)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!d){l=y+1;break}}else f===-1&&(d=!1,f=y+1);return f===-1?"":i.slice(l,f)}},extname:function(i){e(i);for(var s=-1,l=0,f=-1,d=!0,y=0,g=i.length-1;g>=0;--g){var m=i.charCodeAt(g);if(m===47){if(!d){l=g+1;break}continue}f===-1&&(d=!1,f=g+1),m===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,d;f?(s.root="/",d=1):d=0;for(var y=-1,g=0,m=-1,v=!0,B=i.length-1,E=0;B>=d;--B){if(l=i.charCodeAt(B),l===47){if(!v){g=B+1;break}continue}m===-1&&(v=!1,m=B+1),l===46?y===-1?y=B:E!==1&&(E=1):y!==-1&&(E=-1)}return y===-1||m===-1||E===0||E===1&&y===m-1&&y===g+1?m!==-1&&(g===0&&f?s.base=s.name=i.slice(1,m):s.base=s.name=i.slice(g,m)):(g===0&&f?(s.name=i.slice(1,y),s.base=i.slice(1,m)):(s.name=i.slice(g,y),s.base=i.slice(g,m)),s.ext=i.slice(y,m)),g>0?s.dir=i.slice(0,g-1):f&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return o.posix=o,Ss=o,Ss}function On(t){throw new RangeError(XP[t])}function Zm(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(YP,".")).split("."),e).join(".");return r+o}function Jm(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 ek(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Bt(){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 Gr(t,e,n){if(t&&Ot.isObject(t)&&t instanceof Bt)return t;var r=new Bt;return r.parse(t,e,n),r}function ck(){if(Gm)return Rs;Gm=!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,d=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||d===1))if(f!==g-1&&d===2){if(s.length<2||l!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var m=s.lastIndexOf("/");if(m!==s.length-1){m===-1?(s="",l=0):(s=s.slice(0,m),l=s.length-1-s.lastIndexOf("/")),f=g,d=0;continue}}else if(s.length===2||s.length===1){s="",l=0,f=g,d=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,d=0}else y===46&&d!==-1?++d:d=-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 d;f>=0?d=arguments[f]:(l===void 0&&(l=t.cwd()),d=l),e(d),d.length!==0&&(i=d+"/"+i,s=d.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,d=f-l,y=1;y<s.length&&s.charCodeAt(y)===47;++y);for(var g=s.length,m=g-y,v=d<m?d:m,B=-1,E=0;E<=v;++E){if(E===v){if(m>v){if(s.charCodeAt(y+E)===47)return s.slice(y+E+1);if(E===0)return s.slice(y+E)}else d>v&&(i.charCodeAt(l+E)===47?B=E:E===0&&(B=0));break}var T=i.charCodeAt(l+E),k=s.charCodeAt(y+E);if(T!==k)break;T===47&&(B=E)}var P="";for(E=l+B+1;E<=f;++E)(E===f||i.charCodeAt(E)===47)&&(P.length===0?P+="..":P+="/..");return P.length>0?P+s.slice(y+B):(y+=B,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,d=!0,y=i.length-1;y>=1;--y)if(s=i.charCodeAt(y),s===47){if(!d){f=y;break}}else d=!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,d=!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,m=-1;for(y=i.length-1;y>=0;--y){var v=i.charCodeAt(y);if(v===47){if(!d){l=y+1;break}}else m===-1&&(d=!1,m=y+1),g>=0&&(v===s.charCodeAt(g)?--g===-1&&(f=y):(g=-1,f=m))}return l===f?f=m:f===-1&&(f=i.length),i.slice(l,f)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!d){l=y+1;break}}else f===-1&&(d=!1,f=y+1);return f===-1?"":i.slice(l,f)}},extname:function(i){e(i);for(var s=-1,l=0,f=-1,d=!0,y=0,g=i.length-1;g>=0;--g){var m=i.charCodeAt(g);if(m===47){if(!d){l=g+1;break}continue}f===-1&&(d=!1,f=g+1),m===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,d;f?(s.root="/",d=1):d=0;for(var y=-1,g=0,m=-1,v=!0,B=i.length-1,E=0;B>=d;--B){if(l=i.charCodeAt(B),l===47){if(!v){g=B+1;break}continue}m===-1&&(v=!1,m=B+1),l===46?y===-1?y=B:E!==1&&(E=1):y!==-1&&(E=-1)}return y===-1||m===-1||E===0||E===1&&y===m-1&&y===g+1?m!==-1&&(g===0&&f?s.base=s.name=i.slice(1,m):s.base=s.name=i.slice(g,m)):(g===0&&f?(s.name=i.slice(1,y),s.base=i.slice(1,m)):(s.name=i.slice(g,y),s.base=i.slice(g,m)),s.ext=i.slice(y,m)),g>0?s.dir=i.slice(0,g-1):f&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return o.posix=o,Rs=o,Rs}function wk(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 Ms?xk(t):Bk(t)}function xk(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(mk,"\\"),n=decodeURIComponent(n),e!=="")return`\\\\${e}${n}`;{let r=n.codePointAt(1)|32,o=n[2];if(r<gk||r>yk||o!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return n.slice(1)}}function Bk(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=Vm.resolve(t),n=t.charCodeAt(t.length-1);(n===pk||Ms&&n===dk)&&e[e.length-1]!==Vm.sep&&(e+="/");let r=new URL("file://");return e.includes("%")&&(e=e.replace(hk,"%25")),!Ms&&e.includes("\\")&&(e=e.replace(vk,"%5C")),e.includes(`
11
+ `)&&(e=e.replace(Tk,"%0A")),e.includes("\r")&&(e=e.replace(_k,"%0D")),e.includes(" ")&&(e=e.replace(bk,"%09")),r.pathname=e,r}function Uk(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 Ds?Hk(t):jk(t)}function Hk(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(Ak,"\\"),n=decodeURIComponent(n),e!=="")return`\\\\${e}${n}`;{let r=n.codePointAt(1)|32,o=n[2];if(r<Ik||r>Ck||o!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return n.slice(1)}}function jk(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 $k(t){let e=$m.resolve(t),n=t.charCodeAt(t.length-1);(n===Sk||Ds&&n===kk)&&e[e.length-1]!==$m.sep&&(e+="/");let r=new URL("file://");return e.includes("%")&&(e=e.replace(Rk,"%25")),!Ds&&e.includes("\\")&&(e=e.replace(Ok,"%5C")),e.includes(`
12
+ `)&&(e=e.replace(Mk,"%0A")),e.includes("\r")&&(e=e.replace(Dk,"%0D")),e.includes(" ")&&(e=e.replace(Nk,"%09")),r.pathname=e,r}var Ss,jm,$m,dr,VP,JP,YP,XP,Mt,Is,Lm,Ym,Fm,Km,QP,tk,zr,nk,Jt,je,rk,Ot,ik,ok,ak,sk,Os,Wm,qm,zm,lk,uk,Cs,fr,As,Rs,Gm,Vm,fk,dk,pk,gk,yk,Ms,mk,hk,vk,Tk,_k,bk,Pk,kk,Sk,Ik,Ck,Ds,Ak,Rk,Ok,Mk,Dk,Nk,Xm=it(()=>{A();O();R();Uo();ks();Ss={},jm=!1;$m=GP(),dr=2147483647,VP=/^xn--/,JP=/[^\0-\x7E]/,YP=/[\x2E\u3002\uFF0E\uFF61]/g,XP={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Mt=Math.floor,Is=String.fromCharCode;Lm=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Ym=function(t,e,n){let r=0;for(t=n?Mt(t/700):t>>1,t+=Mt(t/e);t>455;r+=36)t=Mt(t/35);return Mt(r+36*t/(t+38))},Fm=function(t){let e=[],n=t.length,r=0,o=128,a=72,i=t.lastIndexOf("-");i<0&&(i=0);for(let l=0;l<i;++l)t.charCodeAt(l)>=128&&On("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&&On("invalid-input");let m=(s=t.charCodeAt(l++))-48<10?s-22:s-65<26?s-65:s-97<26?s-97:36;(m>=36||m>Mt((dr-r)/y))&&On("overflow"),r+=m*y;let v=g<=a?1:g>=a+26?26:g-a;if(m<v)break;let B=36-v;y>Mt(dr/B)&&On("overflow"),y*=B}let d=e.length+1;a=Ym(r-f,d,f==0),Mt(r/d)>dr-o&&On("overflow"),o+=Mt(r/d),r%=d,e.splice(r++,0,o)}var s;return String.fromCodePoint(...e)},Km=function(t){let e=[],n=(t=Jm(t)).length,r=128,o=0,a=72;for(let l of t)l<128&&e.push(Is(l));let i=e.length,s=i;for(i&&e.push("-");s<n;){let l=dr;for(let d of t)d>=r&&d<l&&(l=d);let f=s+1;l-r>Mt((dr-o)/f)&&On("overflow"),o+=(l-r)*f,r=l;for(let d of t)if(d<r&&++o>dr&&On("overflow"),d==r){let y=o;for(let g=36;;g+=36){let m=g<=a?1:g>=a+26?26:g-a;if(y<m)break;let v=y-m,B=36-m;e.push(Is(Lm(m+v%B,0))),y=Mt(v/B)}e.push(Is(Lm(y,0))),a=Ym(o,f,s==i),o=0,++s}++o,++r}return e.join("")},QP={version:"2.1.0",ucs2:{decode:Jm,encode:t=>String.fromCodePoint(...t)},decode:Fm,encode:Km,toASCII:function(t){return Zm(t,function(e){return JP.test(e)?"xn--"+Km(e):e})},toUnicode:function(t){return Zm(t,function(e){return VP.test(e)?Fm(e.slice(4).toLowerCase()):e})}};tk=function(t,e,n,r){e=e||"&",n=n||"=";var o={};if(typeof t!="string"||t.length===0)return o;var a=/\+/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,d,y,g,m=t[l].replace(a,"%20"),v=m.indexOf(n);v>=0?(f=m.substr(0,v),d=m.substr(v+1)):(f=m,d=""),y=decodeURIComponent(f),g=decodeURIComponent(d),ek(o,y)?Array.isArray(o[y])?o[y].push(g):o[y]=[o[y],g]:o[y]=g}return o},zr=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},nk=function(t,e,n,r){return e=e||"&",n=n||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map(function(o){var a=encodeURIComponent(zr(o))+n;return Array.isArray(t[o])?t[o].map(function(i){return a+encodeURIComponent(zr(i))}).join(e):a+encodeURIComponent(zr(t[o]))}).join(e):r?encodeURIComponent(zr(r))+n+encodeURIComponent(zr(t)):""},Jt={};Jt.decode=Jt.parse=tk,Jt.encode=Jt.stringify=nk;Jt.decode;Jt.encode;Jt.parse;Jt.stringify;je={},rk=QP,Ot={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}};je.parse=Gr,je.resolve=function(t,e){return Gr(t,!1,!0).resolve(e)},je.resolveObject=function(t,e){return t?Gr(t,!1,!0).resolveObject(e):e},je.format=function(t){return Ot.isString(t)&&(t=Gr(t)),t instanceof Bt?t.format():Bt.prototype.format.call(t)},je.Url=Bt;ik=/^([a-z0-9.+-]+:)/i,ok=/:[0-9]*$/,ak=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,sk=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
13
+ `," "]),Os=["'"].concat(sk),Wm=["%","/","?",";","#"].concat(Os),qm=["/","?","#"],zm=/^[+a-z0-9A-Z_-]{0,63}$/,lk=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,uk={javascript:!0,"javascript:":!0},Cs={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},As=Jt;Bt.prototype.parse=function(t,e,n){if(!Ot.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=ak.exec(i);if(s)return this.path=i,this.href=i,this.pathname=s[1],s[2]?(this.search=s[2],this.query=e?As.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var l=ik.exec(i);if(l){var f=(l=l[0]).toLowerCase();this.protocol=f,i=i.substr(l.length)}if(n||l||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var d=i.substr(0,2)==="//";!d||l&&Cs[l]||(i=i.substr(2),this.slashes=!0)}if(!Cs[l]&&(d||l&&!fr[l])){for(var y,g,m=-1,v=0;v<qm.length;v++)(B=i.indexOf(qm[v]))!==-1&&(m===-1||B<m)&&(m=B);for((g=m===-1?i.lastIndexOf("@"):i.lastIndexOf("@",m))!==-1&&(y=i.slice(0,g),i=i.slice(g+1),this.auth=decodeURIComponent(y)),m=-1,v=0;v<Wm.length;v++){var B;(B=i.indexOf(Wm[v]))!==-1&&(m===-1||B<m)&&(m=B)}m===-1&&(m=i.length),this.host=i.slice(0,m),i=i.slice(m),this.parseHost(),this.hostname=this.hostname||"";var E=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!E)for(var T=this.hostname.split(/\./),k=(v=0,T.length);v<k;v++){var P=T[v];if(P&&!P.match(zm)){for(var M="",$=0,oe=P.length;$<oe;$++)P.charCodeAt($)>127?M+="x":M+=P[$];if(!M.match(zm)){var X=T.slice(0,v),ue=T.slice(v+1),ee=P.match(lk);ee&&(X.push(ee[1]),ue.unshift(ee[2])),ue.length&&(i="/"+ue.join(".")+i),this.hostname=X.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),E||(this.hostname=rk.toASCII(this.hostname));var ie=this.port?":"+this.port:"",Oe=this.hostname||"";this.host=Oe+ie,this.href+=this.host,E&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),i[0]!=="/"&&(i="/"+i))}if(!uk[f])for(v=0,k=Os.length;v<k;v++){var Ie=Os[v];if(i.indexOf(Ie)!==-1){var $e=encodeURIComponent(Ie);$e===Ie&&($e=escape(Ie)),i=i.split(Ie).join($e)}}var Ne=i.indexOf("#");Ne!==-1&&(this.hash=i.substr(Ne),i=i.slice(0,Ne));var Me=i.indexOf("?");if(Me!==-1?(this.search=i.substr(Me),this.query=i.substr(Me+1),e&&(this.query=As.parse(this.query)),i=i.slice(0,Me)):e&&(this.search="",this.query={}),i&&(this.pathname=i),fr[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){ie=this.pathname||"";var Ve=this.search||"";this.path=ie+Ve}return this.href=this.format(),this},Bt.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&&Ot.isObject(this.query)&&Object.keys(this.query).length&&(a=As.stringify(this.query));var i=this.search||a&&"?"+a||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||fr[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},Bt.prototype.resolve=function(t){return this.resolveObject(Gr(t,!1,!0)).format()},Bt.prototype.resolveObject=function(t){if(Ot.isString(t)){var e=new Bt;e.parse(t,!1,!0),t=e}for(var n=new Bt,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 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),d=0;d<f.length;d++){var y=f[d];n[y]=t[y]}return n.href=n.format(),n}if(n.protocol=t.protocol,t.host||Cs[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 m=n.pathname||"",v=n.search||"";n.path=m+v}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var B=n.pathname&&n.pathname.charAt(0)==="/",E=t.host||t.pathname&&t.pathname.charAt(0)==="/",T=E||B||n.host&&t.pathname,k=T,P=n.pathname&&n.pathname.split("/")||[],M=(g=t.pathname&&t.pathname.split("/")||[],n.protocol&&!fr[n.protocol]);if(M&&(n.hostname="",n.port=null,n.host&&(P[0]===""?P[0]=n.host:P.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),T=T&&(g[0]===""||P[0]==="")),E)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,P=g;else if(g.length)P||(P=[]),P.pop(),P=P.concat(g),n.search=t.search,n.query=t.query;else if(!Ot.isNullOrUndefined(t.search))return M&&(n.hostname=n.host=P.shift(),(ee=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=ee.shift(),n.host=n.hostname=ee.shift())),n.search=t.search,n.query=t.query,Ot.isNull(n.pathname)&&Ot.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!P.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var $=P.slice(-1)[0],oe=(n.host||t.host||P.length>1)&&($==="."||$==="..")||$==="",X=0,ue=P.length;ue>=0;ue--)($=P[ue])==="."?P.splice(ue,1):$===".."?(P.splice(ue,1),X++):X&&(P.splice(ue,1),X--);if(!T&&!k)for(;X--;X)P.unshift("..");!T||P[0]===""||P[0]&&P[0].charAt(0)==="/"||P.unshift(""),oe&&P.join("/").substr(-1)!=="/"&&P.push("");var ee,ie=P[0]===""||P[0]&&P[0].charAt(0)==="/";return M&&(n.hostname=n.host=ie?"":P.length?P.shift():"",(ee=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=ee.shift(),n.host=n.hostname=ee.shift())),(T=T||n.host&&P.length)&&!ie&&P.unshift(""),P.length?n.pathname=P.join("/"):(n.pathname=null,n.path=null),Ot.isNull(n.pathname)&&Ot.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},Bt.prototype.parseHost=function(){var t=this.host,e=ok.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};je.Url;je.format;je.resolve;je.resolveObject;Rs={},Gm=!1;Vm=ck(),fk=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;je.URL=typeof URL<"u"?URL:null;je.pathToFileURL=Ek;je.fileURLToPath=wk;je.Url;je.format;je.resolve;je.resolveObject;je.URL;dk=92,pk=47,gk=97,yk=122,Ms=fk==="win32",mk=/\//g,hk=/%/g,vk=/\\/g,Tk=/\n/g,_k=/\r/g,bk=/\t/g;Pk=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;je.URL=typeof URL<"u"?URL:null;je.pathToFileURL=$k;je.fileURLToPath=Uk;je.Url;je.format;je.resolve;je.resolveObject;je.parse;je.URL;kk=92,Sk=47,Ik=97,Ck=122,Ds=Pk==="win32",Ak=/\//g,Rk=/%/g,Ok=/\\/g,Mk=/\n/g,Dk=/\r/g,Nk=/\t/g});var Ah={};Hn(Ah,{Agent:()=>Yk,ClientRequest:()=>Xk,IncomingMessage:()=>Qk,METHODS:()=>eS,STATUS_CODES:()=>tS,default:()=>Yt,get:()=>nS,globalAgent:()=>rS,request:()=>iS});function wh(){if(Qm)return bt;Qm=!0,bt.fetch=r(Mn.fetch)&&r(Mn.ReadableStream),bt.writableStream=r(Mn.WritableStream),bt.abortController=r(Mn.AbortController);var t;function e(){if(t!==void 0)return t;if(Mn.XMLHttpRequest){t=new Mn.XMLHttpRequest;try{t.open("GET",Mn.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 xh(){return eh||(eh=!0,Ns=yt.EventEmitter),Ns}function Zk(){if(th)return Us;th=!0;function t(v,B){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);B&&(T=T.filter(function(k){return Object.getOwnPropertyDescriptor(v,k).enumerable})),E.push.apply(E,T)}return E}function e(v){for(var B=1;B<arguments.length;B++){var E=arguments[B]!=null?arguments[B]:{};B%2?t(Object(E),!0).forEach(function(T){n(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):t(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function n(v,B,E){return B=i(B),B in v?Object.defineProperty(v,B,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[B]=E,v}function r(v,B){if(!(v instanceof B))throw new TypeError("Cannot call a class as a function")}function o(v,B){for(var E=0;E<B.length;E++){var T=B[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(v,i(T.key),T)}}function a(v,B,E){return B&&o(v.prototype,B),Object.defineProperty(v,"prototype",{writable:!1}),v}function i(v){var B=s(v,"string");return typeof B=="symbol"?B:String(B)}function s(v,B){if(typeof v!="object"||v===null)return v;var E=v[Symbol.toPrimitive];if(E!==void 0){var T=E.call(v,B||"default");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(B==="string"?String:Number)(v)}var l=Ct(),f=l.Buffer,d=L,y=d.inspect,g=y&&y.custom||"inspect";function m(v,B,E){f.prototype.copy.call(v,B,E)}return Us=function(){function v(){r(this,v),this.head=null,this.tail=null,this.length=0}return a(v,[{key:"push",value:function(E){var T={data:E,next:null};this.length>0?this.tail.next=T:this.head=T,this.tail=T,++this.length}},{key:"unshift",value:function(E){var T={data:E,next:this.head};this.length===0&&(this.tail=T),this.head=T,++this.length}},{key:"shift",value:function(){if(this.length!==0){var E=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,E}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(E){if(this.length===0)return"";for(var T=this.head,k=""+T.data;T=T.next;)k+=E+T.data;return k}},{key:"concat",value:function(E){if(this.length===0)return f.alloc(0);for(var T=f.allocUnsafe(E>>>0),k=this.head,P=0;k;)m(k.data,T,P),P+=k.data.length,k=k.next;return T}},{key:"consume",value:function(E,T){var k;return E<this.head.data.length?(k=this.head.data.slice(0,E),this.head.data=this.head.data.slice(E)):E===this.head.data.length?k=this.shift():k=T?this._getString(E):this._getBuffer(E),k}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(E){var T=this.head,k=1,P=T.data;for(E-=P.length;T=T.next;){var M=T.data,$=E>M.length?M.length:E;if($===M.length?P+=M:P+=M.slice(0,E),E-=$,E===0){$===M.length?(++k,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=M.slice($));break}++k}return this.length-=k,P}},{key:"_getBuffer",value:function(E){var T=f.allocUnsafe(E),k=this.head,P=1;for(k.data.copy(T),E-=k.data.length;k=k.next;){var M=k.data,$=E>M.length?M.length:E;if(M.copy(T,T.length-E,0,$),E-=$,E===0){$===M.length?(++P,k.next?this.head=k.next:this.head=this.tail=null):(this.head=k,k.data=M.slice($));break}++P}return this.length-=P,T}},{key:g,value:function(E,T){return y(this,e(e({},T),{},{depth:0,customInspect:!1}))}}]),v}(),Us}function Bh(){if(nh)return Hs;nh=!0;var t=kt;function e(s,l){var f=this,d=this._readableState&&this._readableState.destroyed,y=this._writableState&&this._writableState.destroyed;return d||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,d=s._writableState;f&&f.autoDestroy||d&&d.autoDestroy?s.destroy(l):s.emit("error",l)}return Hs={destroy:e,undestroy:o,errorOrDestroy:i},Hs}function gr(){if(rh)return js;rh=!0;let t={};function e(i,s,l){l||(l=Error);function f(y,g,m){return typeof s=="string"?s:s(y,g,m)}class d extends l{constructor(g,m,v){super(f(g,m,v))}}d.prototype.name=l.name,d.prototype.code=i,t[i]=d}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 d;if(o(i," argument"))d=`The ${i} ${f} ${n(s,"type")}`;else{let y=a(i,".")?"property":"argument";d=`The "${i}" ${y} ${f} ${n(s,"type")}`}return d+=`. Received type ${typeof l}`,d},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"),js.codes=t,js}function Eh(){if(ih)return $s;ih=!0;var t=gr().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 $s={getHighWaterMark:n},$s}function Ph(){if(oh)return Zs;oh=!0;var t=kt;Zs=ee;function e(C){var S=this;this.next=null,this.entry=null,this.finish=function(){ve(S,C)}}var n;ee.WritableState=X;var r={deprecate:Om()},o=xh(),a=Ct().Buffer,i=(typeof ah<"u"?ah:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(C){return a.from(C)}function l(C){return a.isBuffer(C)||C instanceof i}var f=Bh(),d=Eh(),y=d.getHighWaterMark,g=gr().codes,m=g.ERR_INVALID_ARG_TYPE,v=g.ERR_METHOD_NOT_IMPLEMENTED,B=g.ERR_MULTIPLE_CALLBACK,E=g.ERR_STREAM_CANNOT_PIPE,T=g.ERR_STREAM_DESTROYED,k=g.ERR_STREAM_NULL_VALUES,P=g.ERR_STREAM_WRITE_AFTER_END,M=g.ERR_UNKNOWN_ENCODING,$=f.errorOrDestroy;At()(ee,o);function oe(){}function X(C,S,j){n=n||pr(),C=C||{},typeof j!="boolean"&&(j=S instanceof n),this.objectMode=!!C.objectMode,j&&(this.objectMode=this.objectMode||!!C.writableObjectMode),this.highWaterMark=y(this,C,"writableHighWaterMark",j),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var V=C.decodeStrings===!1;this.decodeStrings=!V,this.defaultEncoding=C.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ae){Ce(S,ae)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=C.emitClose!==!1,this.autoDestroy=!!C.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}X.prototype.getBuffer=function(){for(var S=this.bufferedRequest,j=[];S;)j.push(S),S=S.next;return j},function(){try{Object.defineProperty(X.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var ue;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ue=Function.prototype[Symbol.hasInstance],Object.defineProperty(ee,Symbol.hasInstance,{value:function(S){return ue.call(this,S)?!0:this!==ee?!1:S&&S._writableState instanceof X}})):ue=function(S){return S instanceof this};function ee(C){n=n||pr();var S=this instanceof n;if(!S&&!ue.call(ee,this))return new ee(C);this._writableState=new X(C,this,S),this.writable=!0,C&&(typeof C.write=="function"&&(this._write=C.write),typeof C.writev=="function"&&(this._writev=C.writev),typeof C.destroy=="function"&&(this._destroy=C.destroy),typeof C.final=="function"&&(this._final=C.final)),o.call(this)}ee.prototype.pipe=function(){$(this,new E)};function ie(C,S){var j=new P;$(C,j),t.nextTick(S,j)}function Oe(C,S,j,V){var ae;return j===null?ae=new k:typeof j!="string"&&!S.objectMode&&(ae=new m("chunk",["string","Buffer"],j)),ae?($(C,ae),t.nextTick(V,ae),!1):!0}ee.prototype.write=function(C,S,j){var V=this._writableState,ae=!1,b=!V.objectMode&&l(C);return b&&!a.isBuffer(C)&&(C=s(C)),typeof S=="function"&&(j=S,S=null),b?S="buffer":S||(S=V.defaultEncoding),typeof j!="function"&&(j=oe),V.ending?ie(this,j):(b||Oe(this,V,C,j))&&(V.pendingcb++,ae=$e(this,V,b,C,S,j)),ae},ee.prototype.cork=function(){this._writableState.corked++},ee.prototype.uncork=function(){var C=this._writableState;C.corked&&(C.corked--,!C.writing&&!C.corked&&!C.bufferProcessing&&C.bufferedRequest&&ce(this,C))},ee.prototype.setDefaultEncoding=function(S){if(typeof S=="string"&&(S=S.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((S+"").toLowerCase())>-1))throw new M(S);return this._writableState.defaultEncoding=S,this},Object.defineProperty(ee.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Ie(C,S,j){return!C.objectMode&&C.decodeStrings!==!1&&typeof S=="string"&&(S=a.from(S,j)),S}Object.defineProperty(ee.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $e(C,S,j,V,ae,b){if(!j){var w=Ie(S,V,ae);V!==w&&(j=!0,ae="buffer",V=w)}var W=S.objectMode?1:V.length;S.length+=W;var Q=S.length<S.highWaterMark;if(Q||(S.needDrain=!0),S.writing||S.corked){var Ue=S.lastBufferedRequest;S.lastBufferedRequest={chunk:V,encoding:ae,isBuf:j,callback:b,next:null},Ue?Ue.next=S.lastBufferedRequest:S.bufferedRequest=S.lastBufferedRequest,S.bufferedRequestCount+=1}else Ne(C,S,!1,W,V,ae,b);return Q}function Ne(C,S,j,V,ae,b,w){S.writelen=V,S.writecb=w,S.writing=!0,S.sync=!0,S.destroyed?S.onwrite(new T("write")):j?C._writev(ae,S.onwrite):C._write(ae,b,S.onwrite),S.sync=!1}function Me(C,S,j,V,ae){--S.pendingcb,j?(t.nextTick(ae,V),t.nextTick(F,C,S),C._writableState.errorEmitted=!0,$(C,V)):(ae(V),C._writableState.errorEmitted=!0,$(C,V),F(C,S))}function Ve(C){C.writing=!1,C.writecb=null,C.length-=C.writelen,C.writelen=0}function Ce(C,S){var j=C._writableState,V=j.sync,ae=j.writecb;if(typeof ae!="function")throw new B;if(Ve(j),S)Me(C,j,V,S,ae);else{var b=he(j)||C.destroyed;!b&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&ce(C,j),V?t.nextTick(me,C,j,b,ae):me(C,j,b,ae)}}function me(C,S,j,V){j||ke(C,S),S.pendingcb--,V(),F(C,S)}function ke(C,S){S.length===0&&S.needDrain&&(S.needDrain=!1,C.emit("drain"))}function ce(C,S){S.bufferProcessing=!0;var j=S.bufferedRequest;if(C._writev&&j&&j.next){var V=S.bufferedRequestCount,ae=new Array(V),b=S.corkedRequestsFree;b.entry=j;for(var w=0,W=!0;j;)ae[w]=j,j.isBuf||(W=!1),j=j.next,w+=1;ae.allBuffers=W,Ne(C,S,!0,S.length,ae,"",b.finish),S.pendingcb++,S.lastBufferedRequest=null,b.next?(S.corkedRequestsFree=b.next,b.next=null):S.corkedRequestsFree=new e(S),S.bufferedRequestCount=0}else{for(;j;){var Q=j.chunk,Ue=j.encoding,Te=j.callback,H=S.objectMode?1:Q.length;if(Ne(C,S,!1,H,Q,Ue,Te),j=j.next,S.bufferedRequestCount--,S.writing)break}j===null&&(S.lastBufferedRequest=null)}S.bufferedRequest=j,S.bufferProcessing=!1}ee.prototype._write=function(C,S,j){j(new v("_write()"))},ee.prototype._writev=null,ee.prototype.end=function(C,S,j){var V=this._writableState;return typeof C=="function"?(j=C,C=null,S=null):typeof S=="function"&&(j=S,S=null),C!=null&&this.write(C,S),V.corked&&(V.corked=1,this.uncork()),V.ending||fe(this,V,j),this},Object.defineProperty(ee.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function he(C){return C.ending&&C.length===0&&C.bufferedRequest===null&&!C.finished&&!C.writing}function D(C,S){C._final(function(j){S.pendingcb--,j&&$(C,j),S.prefinished=!0,C.emit("prefinish"),F(C,S)})}function Z(C,S){!S.prefinished&&!S.finalCalled&&(typeof C._final=="function"&&!S.destroyed?(S.pendingcb++,S.finalCalled=!0,t.nextTick(D,C,S)):(S.prefinished=!0,C.emit("prefinish")))}function F(C,S){var j=he(S);if(j&&(Z(C,S),S.pendingcb===0&&(S.finished=!0,C.emit("finish"),S.autoDestroy))){var V=C._readableState;(!V||V.autoDestroy&&V.endEmitted)&&C.destroy()}return j}function fe(C,S,j){S.ending=!0,F(C,S),j&&(S.finished?t.nextTick(j):C.once("finish",j)),S.ended=!0,C.writable=!1}function ve(C,S,j){var V=C.entry;for(C.entry=null;V;){var ae=V.callback;S.pendingcb--,ae(j),V=V.next}S.corkedRequestsFree.next=C}return Object.defineProperty(ee.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(S){this._writableState&&(this._writableState.destroyed=S)}}),ee.prototype.destroy=f.destroy,ee.prototype._undestroy=f.undestroy,ee.prototype._destroy=function(C,S){S(C)},Zs}function pr(){if(sh)return Ls;sh=!0;var t=kt,e=Object.keys||function(d){var y=[];for(var g in d)y.push(g);return y};Ls=s;var n=kh(),r=Ph();At()(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(d){if(!(this instanceof s))return new s(d);n.call(this,d),r.call(this,d),this.allowHalfOpen=!0,d&&(d.readable===!1&&(this.readable=!1),d.writable===!1&&(this.writable=!1),d.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(d){d.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)}}),Ls}function el(){if(lh)return Fs;lh=!0;var t=gr().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,d=function(){a.writable||g()},y=a._writableState&&a._writableState.finished,g=function(){f=!1,y=!0,l||s.call(a)},m=a._readableState&&a._readableState.endEmitted,v=function(){l=!1,m=!0,f||s.call(a)},B=function(P){s.call(a,P)},E=function(){var P;if(l&&!m)return(!a._readableState||!a._readableState.ended)&&(P=new t),s.call(a,P);if(f&&!y)return(!a._writableState||!a._writableState.ended)&&(P=new t),s.call(a,P)},T=function(){a.req.on("finish",g)};return r(a)?(a.on("complete",g),a.on("abort",E),a.req?T():a.on("request",T)):f&&!a._writableState&&(a.on("end",d),a.on("close",d)),a.on("end",v),a.on("finish",g),i.error!==!1&&a.on("error",B),a.on("close",E),function(){a.removeListener("complete",g),a.removeListener("abort",E),a.removeListener("request",T),a.req&&a.req.removeListener("finish",g),a.removeListener("end",d),a.removeListener("close",d),a.removeListener("finish",g),a.removeListener("end",v),a.removeListener("error",B),a.removeListener("close",E)}}return Fs=o,Fs}function Lk(){if(uh)return Ks;uh=!0;var t=kt,e;function n(M,$,oe){return $=r($),$ in M?Object.defineProperty(M,$,{value:oe,enumerable:!0,configurable:!0,writable:!0}):M[$]=oe,M}function r(M){var $=o(M,"string");return typeof $=="symbol"?$:String($)}function o(M,$){if(typeof M!="object"||M===null)return M;var oe=M[Symbol.toPrimitive];if(oe!==void 0){var X=oe.call(M,$||"default");if(typeof X!="object")return X;throw new TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(M)}var a=el(),i=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),f=Symbol("ended"),d=Symbol("lastPromise"),y=Symbol("handlePromise"),g=Symbol("stream");function m(M,$){return{value:M,done:$}}function v(M){var $=M[i];if($!==null){var oe=M[g].read();oe!==null&&(M[d]=null,M[i]=null,M[s]=null,$(m(oe,!1)))}}function B(M){t.nextTick(v,M)}function E(M,$){return function(oe,X){M.then(function(){if($[f]){oe(m(void 0,!0));return}$[y](oe,X)},X)}}var T=Object.getPrototypeOf(function(){}),k=Object.setPrototypeOf((e={get stream(){return this[g]},next:function(){var $=this,oe=this[l];if(oe!==null)return Promise.reject(oe);if(this[f])return Promise.resolve(m(void 0,!0));if(this[g].destroyed)return new Promise(function(ie,Oe){t.nextTick(function(){$[l]?Oe($[l]):ie(m(void 0,!0))})});var X=this[d],ue;if(X)ue=new Promise(E(X,this));else{var ee=this[g].read();if(ee!==null)return Promise.resolve(m(ee,!1));ue=new Promise(this[y])}return this[d]=ue,ue}},n(e,Symbol.asyncIterator,function(){return this}),n(e,"return",function(){var $=this;return new Promise(function(oe,X){$[g].destroy(null,function(ue){if(ue){X(ue);return}oe(m(void 0,!0))})})}),e),T),P=function($){var oe,X=Object.create(k,(oe={},n(oe,g,{value:$,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:$._readableState.endEmitted,writable:!0}),n(oe,y,{value:function(ee,ie){var Oe=X[g].read();Oe?(X[d]=null,X[i]=null,X[s]=null,ee(m(Oe,!1))):(X[i]=ee,X[s]=ie)},writable:!0}),oe));return X[d]=null,a($,function(ue){if(ue&&ue.code!=="ERR_STREAM_PREMATURE_CLOSE"){var ee=X[s];ee!==null&&(X[d]=null,X[i]=null,X[s]=null,ee(ue)),X[l]=ue;return}var ie=X[i];ie!==null&&(X[d]=null,X[i]=null,X[s]=null,ie(m(void 0,!0))),X[f]=!0}),$.on("readable",B.bind(null,X)),X};return Ks=P,Ks}function Fk(){return ch||(ch=!0,Ws=function(){throw new Error("Readable.from is not available in the browser")}),Ws}function kh(){if(fh)return qs;fh=!0;var t=kt;qs=ie;var e;ie.ReadableState=ee,yt.EventEmitter;var n=function(w,W){return w.listeners(W).length},r=xh(),o=Ct().Buffer,a=(typeof dh<"u"?dh: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 d=Zk(),y=Bh(),g=Eh(),m=g.getHighWaterMark,v=gr().codes,B=v.ERR_INVALID_ARG_TYPE,E=v.ERR_STREAM_PUSH_AFTER_EOF,T=v.ERR_METHOD_NOT_IMPLEMENTED,k=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,P,M,$;At()(ie,r);var oe=y.errorOrDestroy,X=["error","close","destroy","pause","resume"];function ue(b,w,W){if(typeof b.prependListener=="function")return b.prependListener(w,W);!b._events||!b._events[w]?b.on(w,W):Array.isArray(b._events[w])?b._events[w].unshift(W):b._events[w]=[W,b._events[w]]}function ee(b,w,W){e=e||pr(),b=b||{},typeof W!="boolean"&&(W=w instanceof e),this.objectMode=!!b.objectMode,W&&(this.objectMode=this.objectMode||!!b.readableObjectMode),this.highWaterMark=m(this,b,"readableHighWaterMark",W),this.buffer=new d,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&&(P||(P=qr.StringDecoder),this.decoder=new P(b.encoding),this.encoding=b.encoding)}function ie(b){if(e=e||pr(),!(this instanceof ie))return new ie(b);var w=this instanceof e;this._readableState=new ee(b,this,w),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(ie.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(w){this._readableState&&(this._readableState.destroyed=w)}}),ie.prototype.destroy=y.destroy,ie.prototype._undestroy=y.undestroy,ie.prototype._destroy=function(b,w){w(b)},ie.prototype.push=function(b,w){var W=this._readableState,Q;return W.objectMode?Q=!0:typeof b=="string"&&(w=w||W.defaultEncoding,w!==W.encoding&&(b=o.from(b,w),w=""),Q=!0),Oe(this,b,w,!1,Q)},ie.prototype.unshift=function(b){return Oe(this,b,null,!0,!1)};function Oe(b,w,W,Q,Ue){f("readableAddChunk",w);var Te=b._readableState;if(w===null)Te.reading=!1,Ce(b,Te);else{var H;if(Ue||(H=$e(Te,w)),H)oe(b,H);else if(Te.objectMode||w&&w.length>0)if(typeof w!="string"&&!Te.objectMode&&Object.getPrototypeOf(w)!==o.prototype&&(w=i(w)),Q)Te.endEmitted?oe(b,new k):Ie(b,Te,w,!0);else if(Te.ended)oe(b,new E);else{if(Te.destroyed)return!1;Te.reading=!1,Te.decoder&&!W?(w=Te.decoder.write(w),Te.objectMode||w.length!==0?Ie(b,Te,w,!1):ce(b,Te)):Ie(b,Te,w,!1)}else Q||(Te.reading=!1,ce(b,Te))}return!Te.ended&&(Te.length<Te.highWaterMark||Te.length===0)}function Ie(b,w,W,Q){w.flowing&&w.length===0&&!w.sync?(w.awaitDrain=0,b.emit("data",W)):(w.length+=w.objectMode?1:W.length,Q?w.buffer.unshift(W):w.buffer.push(W),w.needReadable&&me(b)),ce(b,w)}function $e(b,w){var W;return!s(w)&&typeof w!="string"&&w!==void 0&&!b.objectMode&&(W=new B("chunk",["string","Buffer","Uint8Array"],w)),W}ie.prototype.isPaused=function(){return this._readableState.flowing===!1},ie.prototype.setEncoding=function(b){P||(P=qr.StringDecoder);var w=new P(b);this._readableState.decoder=w,this._readableState.encoding=this._readableState.decoder.encoding;for(var W=this._readableState.buffer.head,Q="";W!==null;)Q+=w.write(W.data),W=W.next;return this._readableState.buffer.clear(),Q!==""&&this._readableState.buffer.push(Q),this._readableState.length=Q.length,this};var Ne=1073741824;function Me(b){return b>=Ne?b=Ne:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}function Ve(b,w){return b<=0||w.length===0&&w.ended?0:w.objectMode?1:b!==b?w.flowing&&w.length?w.buffer.head.data.length:w.length:(b>w.highWaterMark&&(w.highWaterMark=Me(b)),b<=w.length?b:w.ended?w.length:(w.needReadable=!0,0))}ie.prototype.read=function(b){f("read",b),b=parseInt(b,10);var w=this._readableState,W=b;if(b!==0&&(w.emittedReadable=!1),b===0&&w.needReadable&&((w.highWaterMark!==0?w.length>=w.highWaterMark:w.length>0)||w.ended))return f("read: emitReadable",w.length,w.ended),w.length===0&&w.ended?j(this):me(this),null;if(b=Ve(b,w),b===0&&w.ended)return w.length===0&&j(this),null;var Q=w.needReadable;f("need readable",Q),(w.length===0||w.length-b<w.highWaterMark)&&(Q=!0,f("length less than watermark",Q)),w.ended||w.reading?(Q=!1,f("reading or ended",Q)):Q&&(f("do read"),w.reading=!0,w.sync=!0,w.length===0&&(w.needReadable=!0),this._read(w.highWaterMark),w.sync=!1,w.reading||(b=Ve(W,w)));var Ue;return b>0?Ue=S(b,w):Ue=null,Ue===null?(w.needReadable=w.length<=w.highWaterMark,b=0):(w.length-=b,w.awaitDrain=0),w.length===0&&(w.ended||(w.needReadable=!0),W!==b&&w.ended&&j(this)),Ue!==null&&this.emit("data",Ue),Ue};function Ce(b,w){if(f("onEofChunk"),!w.ended){if(w.decoder){var W=w.decoder.end();W&&W.length&&(w.buffer.push(W),w.length+=w.objectMode?1:W.length)}w.ended=!0,w.sync?me(b):(w.needReadable=!1,w.emittedReadable||(w.emittedReadable=!0,ke(b)))}}function me(b){var w=b._readableState;f("emitReadable",w.needReadable,w.emittedReadable),w.needReadable=!1,w.emittedReadable||(f("emitReadable",w.flowing),w.emittedReadable=!0,t.nextTick(ke,b))}function ke(b){var w=b._readableState;f("emitReadable_",w.destroyed,w.length,w.ended),!w.destroyed&&(w.length||w.ended)&&(b.emit("readable"),w.emittedReadable=!1),w.needReadable=!w.flowing&&!w.ended&&w.length<=w.highWaterMark,C(b)}function ce(b,w){w.readingMore||(w.readingMore=!0,t.nextTick(he,b,w))}function he(b,w){for(;!w.reading&&!w.ended&&(w.length<w.highWaterMark||w.flowing&&w.length===0);){var W=w.length;if(f("maybeReadMore read 0"),b.read(0),W===w.length)break}w.readingMore=!1}ie.prototype._read=function(b){oe(this,new T("_read()"))},ie.prototype.pipe=function(b,w){var W=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,w);var Ue=(!w||w.end!==!1)&&b!==t.stdout&&b!==t.stderr,Te=Ue?Et:u;Q.endEmitted?t.nextTick(Te):W.once("end",Te),b.on("unpipe",H);function H(c,_){f("onunpipe"),c===W&&_&&_.hasUnpiped===!1&&(_.hasUnpiped=!0,vr())}function Et(){f("onend"),b.end()}var It=D(W);b.on("drain",It);var vt=!1;function vr(){f("cleanup"),b.removeListener("close",Tr),b.removeListener("finish",h),b.removeListener("drain",It),b.removeListener("error",wt),b.removeListener("unpipe",H),W.removeListener("end",Et),W.removeListener("end",u),W.removeListener("data",Qr),vt=!0,Q.awaitDrain&&(!b._writableState||b._writableState.needDrain)&&It()}W.on("data",Qr);function Qr(c){f("ondata");var _=b.write(c);f("dest.write",_),_===!1&&((Q.pipesCount===1&&Q.pipes===b||Q.pipesCount>1&&ae(Q.pipes,b)!==-1)&&!vt&&(f("false write response, pause",Q.awaitDrain),Q.awaitDrain++),W.pause())}function wt(c){f("onerror",c),u(),b.removeListener("error",wt),n(b,"error")===0&&oe(b,c)}ue(b,"error",wt);function Tr(){b.removeListener("finish",h),u()}b.once("close",Tr);function h(){f("onfinish"),b.removeListener("close",Tr),u()}b.once("finish",h);function u(){f("unpipe"),W.unpipe(b)}return b.emit("pipe",W),Q.flowing||(f("pipe resume"),W.resume()),b};function D(b){return function(){var W=b._readableState;f("pipeOnDrain",W.awaitDrain),W.awaitDrain&&W.awaitDrain--,W.awaitDrain===0&&n(b,"data")&&(W.flowing=!0,C(b))}}ie.prototype.unpipe=function(b){var w=this._readableState,W={hasUnpiped:!1};if(w.pipesCount===0)return this;if(w.pipesCount===1)return b&&b!==w.pipes?this:(b||(b=w.pipes),w.pipes=null,w.pipesCount=0,w.flowing=!1,b&&b.emit("unpipe",this,W),this);if(!b){var Q=w.pipes,Ue=w.pipesCount;w.pipes=null,w.pipesCount=0,w.flowing=!1;for(var Te=0;Te<Ue;Te++)Q[Te].emit("unpipe",this,{hasUnpiped:!1});return this}var H=ae(w.pipes,b);return H===-1?this:(w.pipes.splice(H,1),w.pipesCount-=1,w.pipesCount===1&&(w.pipes=w.pipes[0]),b.emit("unpipe",this,W),this)},ie.prototype.on=function(b,w){var W=r.prototype.on.call(this,b,w),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?me(this):Q.reading||t.nextTick(F,this)),W},ie.prototype.addListener=ie.prototype.on,ie.prototype.removeListener=function(b,w){var W=r.prototype.removeListener.call(this,b,w);return b==="readable"&&t.nextTick(Z,this),W},ie.prototype.removeAllListeners=function(b){var w=r.prototype.removeAllListeners.apply(this,arguments);return(b==="readable"||b===void 0)&&t.nextTick(Z,this),w};function Z(b){var w=b._readableState;w.readableListening=b.listenerCount("readable")>0,w.resumeScheduled&&!w.paused?w.flowing=!0:b.listenerCount("data")>0&&b.resume()}function F(b){f("readable nexttick read 0"),b.read(0)}ie.prototype.resume=function(){var b=this._readableState;return b.flowing||(f("resume"),b.flowing=!b.readableListening,fe(this,b)),b.paused=!1,this};function fe(b,w){w.resumeScheduled||(w.resumeScheduled=!0,t.nextTick(ve,b,w))}function ve(b,w){f("resume",w.reading),w.reading||b.read(0),w.resumeScheduled=!1,b.emit("resume"),C(b),w.flowing&&!w.reading&&b.read(0)}ie.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 C(b){var w=b._readableState;for(f("flow",w.flowing);w.flowing&&b.read()!==null;);}ie.prototype.wrap=function(b){var w=this,W=this._readableState,Q=!1;b.on("end",function(){if(f("wrapped end"),W.decoder&&!W.ended){var H=W.decoder.end();H&&H.length&&w.push(H)}w.push(null)}),b.on("data",function(H){if(f("wrapped data"),W.decoder&&(H=W.decoder.write(H)),!(W.objectMode&&H==null)&&!(!W.objectMode&&(!H||!H.length))){var Et=w.push(H);Et||(Q=!0,b.pause())}});for(var Ue in b)this[Ue]===void 0&&typeof b[Ue]=="function"&&(this[Ue]=function(Et){return function(){return b[Et].apply(b,arguments)}}(Ue));for(var Te=0;Te<X.length;Te++)b.on(X[Te],this.emit.bind(this,X[Te]));return this._read=function(H){f("wrapped _read",H),Q&&(Q=!1,b.resume())},this},typeof Symbol=="function"&&(ie.prototype[Symbol.asyncIterator]=function(){return M===void 0&&(M=Lk()),M(this)}),Object.defineProperty(ie.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(ie.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(ie.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(w){this._readableState&&(this._readableState.flowing=w)}}),ie._fromList=S,Object.defineProperty(ie.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function S(b,w){if(w.length===0)return null;var W;return w.objectMode?W=w.buffer.shift():!b||b>=w.length?(w.decoder?W=w.buffer.join(""):w.buffer.length===1?W=w.buffer.first():W=w.buffer.concat(w.length),w.buffer.clear()):W=w.buffer.consume(b,w.decoder),W}function j(b){var w=b._readableState;f("endReadable",w.endEmitted),w.endEmitted||(w.ended=!0,t.nextTick(V,w,b))}function V(b,w){if(f("endReadableNT",b.endEmitted,b.length),!b.endEmitted&&b.length===0&&(b.endEmitted=!0,w.readable=!1,w.emit("end"),b.autoDestroy)){var W=w._writableState;(!W||W.autoDestroy&&W.finished)&&w.destroy()}}typeof Symbol=="function"&&(ie.from=function(b,w){return $===void 0&&($=Fk()),$(ie,b,w)});function ae(b,w){for(var W=0,Q=b.length;W<Q;W++)if(b[W]===w)return W;return-1}return qs}function Sh(){if(ph)return zs;ph=!0,zs=s;var t=gr().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=pr();At()(s,a);function i(d,y){var g=this._transformState;g.transforming=!1;var m=g.writecb;if(m===null)return this.emit("error",new n);g.writechunk=null,g.writecb=null,y!=null&&this.push(y),m(d);var v=this._readableState;v.reading=!1,(v.needReadable||v.length<v.highWaterMark)&&this._read(v.highWaterMark)}function s(d){if(!(this instanceof s))return new s(d);a.call(this,d),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",l)}function l(){var d=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(y,g){f(d,y,g)}):f(this,null,null)}s.prototype.push=function(d,y){return this._transformState.needTransform=!1,a.prototype.push.call(this,d,y)},s.prototype._transform=function(d,y,g){g(new e("_transform()"))},s.prototype._write=function(d,y,g){var m=this._transformState;if(m.writecb=g,m.writechunk=d,m.writeencoding=y,!m.transforming){var v=this._readableState;(m.needTransform||v.needReadable||v.length<v.highWaterMark)&&this._read(v.highWaterMark)}},s.prototype._read=function(d){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(d,y){a.prototype._destroy.call(this,d,function(g){y(g)})};function f(d,y,g){if(y)return d.emit("error",y);if(g!=null&&d.push(g),d._writableState.length)throw new o;if(d._transformState.transforming)throw new r;return d.push(null)}return zs}function Kk(){if(gh)return Gs;gh=!0,Gs=e;var t=Sh();At()(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)},Gs}function Wk(){if(yh)return Vs;yh=!0;var t;function e(g){var m=!1;return function(){m||(m=!0,g.apply(void 0,arguments))}}var n=gr().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,m,v,B){B=e(B);var E=!1;g.on("close",function(){E=!0}),t===void 0&&(t=el()),t(g,{readable:m,writable:v},function(k){if(k)return B(k);E=!0,B()});var T=!1;return function(k){if(!E&&!T){if(T=!0,i(g))return g.abort();if(typeof g.destroy=="function")return g.destroy();B(k||new o("pipe"))}}}function l(g){g()}function f(g,m){return g.pipe(m)}function d(g){return!g.length||typeof g[g.length-1]!="function"?a:g.pop()}function y(){for(var g=arguments.length,m=new Array(g),v=0;v<g;v++)m[v]=arguments[v];var B=d(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new r("streams");var E,T=m.map(function(k,P){var M=P<m.length-1,$=P>0;return s(k,M,$,function(oe){E||(E=oe),oe&&T.forEach(l),!M&&(T.forEach(l),B(E))})});return m.reduce(f)}return Vs=y,Vs}function Ih(){return mh||(mh=!0,ht=ht=kh(),ht.Stream=ht,ht.Readable=ht,ht.Writable=Ph(),ht.Duplex=pr(),ht.Transform=Sh(),ht.PassThrough=Kk(),ht.finished=el(),ht.pipeline=Wk()),ht}function Ch(){if(hh)return jo;hh=!0;var t=Ct().Buffer,e=kt,n=wh(),r=At(),o=Ih(),a=jo.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i=jo.IncomingMessage=function(s,l,f,d){var y=this||$o;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 T=function(){m.read().then(function(k){if(!y._destroyed){if(d(k.done),k.done){y.push(null);return}y.push(t.from(k.value)),T()}}).catch(function(k){d(!0),y._destroyed||y.emit("error",k)})};if(y._fetchResponse=l,y.url=l.url,y.statusCode=l.status,y.statusMessage=l.statusText,l.headers.forEach(function(k,P){y.headers[P.toLowerCase()]=k,y.rawHeaders.push(P,k)}),n.writableStream){var g=new WritableStream({write:function(k){return d(!1),new Promise(function(P,M){y._destroyed?M():y.push(t.from(k))?P():y._resumeFetch=P})},close:function(){d(!0),y._destroyed||y.push(null)},abort:function(k){d(!0),y._destroyed||y.emit("error",k)}});try{l.body.pipeTo(g).catch(function(k){d(!0),y._destroyed||y.emit("error",k)});return}catch{}}var m=l.body.getReader();T()}else{y._xhr=s,y._pos=0,y.url=s.responseURL,y.statusCode=s.status,y.statusMessage=s.statusText;var v=s.getAllResponseHeaders().split(/\r?\n/);if(v.forEach(function(T){var k=T.match(/^([^:]+):\s*(.*)/);if(k){var P=k[1].toLowerCase();P==="set-cookie"?(y.headers[P]===void 0&&(y.headers[P]=[]),y.headers[P].push(k[2])):y.headers[P]!==void 0?y.headers[P]+=", "+k[2]:y.headers[P]=k[2],y.rawHeaders.push(k[1],k[2])}}),y._charset="x-user-defined",!n.overrideMimeType){var B=y.rawHeaders["mime-type"];if(B){var E=B.match(/;\s*charset=([^;])(;|$)/);E&&(y._charset=E[1].toLowerCase())}y._charset||(y._charset="utf-8")}}};return r(i,o.Readable),i.prototype._read=function(){var s=this||$o,l=s._resumeFetch;l&&(s._resumeFetch=null,l())},i.prototype._onXHRProgress=function(s){var l=this||$o,f=l._xhr,d=null;switch(l._mode){case"text":if(d=f.responseText,d.length>l._pos){var y=d.substr(l._pos);if(l._charset==="x-user-defined"){for(var g=t.alloc(y.length),m=0;m<y.length;m++)g[m]=y.charCodeAt(m)&255;l.push(g)}else l.push(y,l._charset);l._pos=d.length}break;case"arraybuffer":if(f.readyState!==a.DONE||!f.response)break;d=f.response,l.push(t.from(new Uint8Array(d)));break;case"moz-chunked-arraybuffer":if(d=f.response,f.readyState!==a.LOADING||!d)break;l.push(t.from(new Uint8Array(d)));break;case"ms-stream":if(d=f.response,f.readyState!==a.LOADING)break;var v=new $o.MSStreamReader;v.onprogress=function(){v.result.byteLength>l._pos&&(l.push(t.from(new Uint8Array(v.result.slice(l._pos)))),l._pos=v.result.byteLength)},v.onload=function(){s(!0),l.push(null)},v.readAsArrayBuffer(d);break}l._xhr.readyState===a.DONE&&l._mode!=="ms-stream"&&(s(!0),l.push(null))},jo}function qk(){if(vh)return Js;vh=!0;var t=Ct().Buffer,e=kt,n=wh(),r=At(),o=Ch(),a=Ih(),i=o.IncomingMessage,s=o.readyStates;function l(g,m){return n.fetch&&m?"fetch":n.mozchunkedarraybuffer?"moz-chunked-arraybuffer":n.msstream?"ms-stream":n.arraybuffer&&g?"arraybuffer":"text"}var f=Js=function(g){var m=this||rt;a.Writable.call(m),m._opts=g,m._body=[],m._headers={},g.auth&&m.setHeader("Authorization","Basic "+t.from(g.auth).toString("base64")),Object.keys(g.headers).forEach(function(E){m.setHeader(E,g.headers[E])});var v,B=!0;if(g.mode==="disable-fetch"||"requestTimeout"in g&&!n.abortController)B=!1,v=!0;else if(g.mode==="prefer-streaming")v=!1;else if(g.mode==="allow-wrong-content-type")v=!n.overrideMimeType;else if(!g.mode||g.mode==="default"||g.mode==="prefer-fast")v=!0;else throw new Error("Invalid value for opts.mode");m._mode=l(v,B),m._fetchTimer=null,m._socketTimeout=null,m._socketTimer=null,m.on("finish",function(){m._onFinish()})};r(f,a.Writable),f.prototype.setHeader=function(g,m){var v=this||rt,B=g.toLowerCase();y.indexOf(B)===-1&&(v._headers[B]={name:g,value:m})},f.prototype.getHeader=function(g){var m=(this||rt)._headers[g.toLowerCase()];return m?m.value:null},f.prototype.removeHeader=function(g){var m=this||rt;delete m._headers[g.toLowerCase()]},f.prototype._onFinish=function(){var g=this||rt;if(!g._destroyed){var m=g._opts;"timeout"in m&&m.timeout!==0&&g.setTimeout(m.timeout);var v=g._headers,B=null;m.method!=="GET"&&m.method!=="HEAD"&&(B=new Blob(g._body,{type:(v["content-type"]||{}).value||""}));var E=[];if(Object.keys(v).forEach(function(M){var $=v[M].name,oe=v[M].value;Array.isArray(oe)?oe.forEach(function(X){E.push([$,X])}):E.push([$,oe])}),g._mode==="fetch"){var T=null;if(n.abortController){var k=new AbortController;T=k.signal,g._fetchAbortController=k,"requestTimeout"in m&&m.requestTimeout!==0&&(g._fetchTimer=rt.setTimeout(function(){g.emit("requestTimeout"),g._fetchAbortController&&g._fetchAbortController.abort()},m.requestTimeout))}rt.fetch(g._opts.url,{method:g._opts.method,headers:E,body:B||void 0,mode:"cors",credentials:m.withCredentials?"include":"same-origin",signal:T}).then(function(M){g._fetchResponse=M,g._resetTimers(!1),g._connect()},function(M){g._resetTimers(!0),g._destroyed||g.emit("error",M)})}else{var P=g._xhr=new rt.XMLHttpRequest;try{P.open(g._opts.method,g._opts.url,!0)}catch(M){e.nextTick(function(){g.emit("error",M)});return}"responseType"in P&&(P.responseType=g._mode),"withCredentials"in P&&(P.withCredentials=!!m.withCredentials),g._mode==="text"&&"overrideMimeType"in P&&P.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in m&&(P.timeout=m.requestTimeout,P.ontimeout=function(){g.emit("requestTimeout")}),E.forEach(function(M){P.setRequestHeader(M[0],M[1])}),g._response=null,P.onreadystatechange=function(){switch(P.readyState){case s.LOADING:case s.DONE:g._onXHRProgress();break}},g._mode==="moz-chunked-arraybuffer"&&(P.onprogress=function(){g._onXHRProgress()}),P.onerror=function(){g._destroyed||(g._resetTimers(!0),g.emit("error",new Error("XHR error")))};try{P.send(B)}catch(M){e.nextTick(function(){g.emit("error",M)});return}}}};function d(g){try{var m=g.status;return m!==null&&m!==0}catch{return!1}}f.prototype._onXHRProgress=function(){var g=this||rt;g._resetTimers(!1),!(!d(g._xhr)||g._destroyed)&&(g._response||g._connect(),g._response._onXHRProgress(g._resetTimers.bind(g)))},f.prototype._connect=function(){var g=this||rt;g._destroyed||(g._response=new i(g._xhr,g._fetchResponse,g._mode,g._resetTimers.bind(g)),g._response.on("error",function(m){g.emit("error",m)}),g.emit("response",g._response))},f.prototype._write=function(g,m,v){var B=this||rt;B._body.push(g),v()},f.prototype._resetTimers=function(g){var m=this||rt;rt.clearTimeout(m._socketTimer),m._socketTimer=null,g?(rt.clearTimeout(m._fetchTimer),m._fetchTimer=null):m._socketTimeout&&(m._socketTimer=rt.setTimeout(function(){m.emit("timeout")},m._socketTimeout))},f.prototype.abort=f.prototype.destroy=function(g){var m=this||rt;m._destroyed=!0,m._resetTimers(!0),m._response&&(m._response._destroyed=!0),m._xhr?m._xhr.abort():m._fetchAbortController&&m._fetchAbortController.abort(),g&&m.emit("error",g)},f.prototype.end=function(g,m,v){var B=this||rt;typeof g=="function"&&(v=g,g=void 0),a.Writable.prototype.end.call(B,g,m,v)},f.prototype.setTimeout=function(g,m){var v=this||rt;m&&v.once("timeout",m),v._socketTimeout=g,v._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 Js}function zk(){if(Th)return Ys;Th=!0,Ys=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 Ys}function Gk(){return _h||(_h=!0,Xs={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"}),Xs}function Jk(){if(bh)return Qs;bh=!0;var t=qk(),e=Ch(),n=zk(),r=Gk(),o=je,a=Qs;return a.request=function(i,s){typeof i=="string"?i=o.parse(i):i=n(i);var l=Vk.location.protocol.search(/^https?:$/)===-1?"http:":"",f=i.protocol||l,d=i.hostname||i.host,y=i.port,g=i.path||"/";d&&d.indexOf(":")!==-1&&(d="["+d+"]"),i.url=(d?f+"//"+d:"")+(y?":"+y:"")+g,i.method=(i.method||"GET").toUpperCase(),i.headers=i.headers||{};var m=new t(i);return s&&m.on("response",s),m},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"],Qs}var bt,Qm,Mn,Ns,eh,Us,th,Hs,nh,js,rh,$s,ih,Zs,oh,ah,Ls,sh,Fs,lh,Ks,uh,Ws,ch,qs,fh,dh,zs,ph,Gs,gh,Vs,yh,ht,mh,jo,hh,$o,Js,vh,rt,Ys,Th,Xs,_h,Qs,bh,Vk,Yt,Yk,Xk,Qk,eS,tS,nS,rS,iS,Rh=it(()=>{A();O();R();os();zy();as();oi();Im();Uo();ws();Mm();Um();Xm();ks();bt={},Qm=!1,Mn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ns={},eh=!1;Us={},th=!1;Hs={},nh=!1;js={},rh=!1;$s={},ih=!1;Zs={},oh=!1,ah=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ls={},sh=!1;Fs={},lh=!1;Ks={},uh=!1;Ws={},ch=!1;qs={},fh=!1,dh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;zs={},ph=!1;Gs={},gh=!1;Vs={},yh=!1;ht={},mh=!1;jo={},hh=!1,$o=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Js={},vh=!1,rt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ys={},Th=!1;Xs={},_h=!1;Qs={},bh=!1,Vk=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Yt=Jk(),Yk=Yt.Agent,Xk=Yt.ClientRequest,Qk=Yt.IncomingMessage,eS=Yt.METHODS,tS=Yt.STATUS_CODES,nS=Yt.get,rS=Yt.globalAgent,iS=Yt.request});A();O();R();var Iy={};Hn(Iy,{defaults:()=>iE,markdown:()=>rE});A();O();R();A();O();R();A();O();R();var ro=_r(Zn(),1),ze=_r(Zn(),1),Zt=_r(Zn(),1),er=_r(Zn(),1),pt=_r(Zn(),1),Sa=Object.defineProperty,tT=Object.defineProperties,nT=Object.getOwnPropertyDescriptors,Ti=Object.getOwnPropertySymbols,cf=Object.prototype.hasOwnProperty,ff=Object.prototype.propertyIsEnumerable,Sc=(t,e,n)=>e in t?Sa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,x=(t,e)=>{for(var n in e||(e={}))cf.call(e,n)&&Sc(t,n,e[n]);if(Ti)for(var n of Ti(e))ff.call(e,n)&&Sc(t,n,e[n]);return t},U=(t,e)=>tT(t,nT(e)),p=(t,e)=>Sa(t,"name",{value:e,configurable:!0}),df=(t,e)=>{var n={};for(var r in t)cf.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Ti)for(var r of Ti(t))e.indexOf(r)<0&&ff.call(t,r)&&(n[r]=t[r]);return n},pf=(t,e)=>{for(var n in e)Sa(t,n,{get:e[n],enumerable:!0})},re={};pf(re,{BRAND:()=>dx,DIRTY:()=>Gn,EMPTY_PATH:()=>cx,INVALID:()=>de,NEVER:()=>IB,OK:()=>ct,ParseInputLazyPath:()=>Pt,ParseStatus:()=>gt,Schema:()=>ye,ZodAny:()=>Pi,ZodArray:()=>Ur,ZodBigInt:()=>ja,ZodBoolean:()=>$a,ZodBranded:()=>Za,ZodCatch:()=>La,ZodDate:()=>Fa,ZodDefault:()=>fo,ZodDiscriminatedUnion:()=>lg,ZodEffects:()=>bn,ZodEnum:()=>rr,ZodError:()=>$t,ZodFirstPartyTypeKind:()=>Gp,ZodFunction:()=>cg,ZodIntersection:()=>Wa,ZodIssueCode:()=>z,ZodLazy:()=>qa,ZodLiteral:()=>za,ZodMap:()=>pg,ZodNaN:()=>yg,ZodNativeEnum:()=>Ga,ZodNever:()=>_n,ZodNull:()=>Va,ZodNullable:()=>Jn,ZodNumber:()=>Ja,ZodObject:()=>Yn,ZodOptional:()=>nn,ZodParsedType:()=>ne,ZodPipeline:()=>Ya,ZodPromise:()=>go,ZodReadonly:()=>yo,ZodRecord:()=>wg,ZodRef:()=>Bg,ZodSchema:()=>ye,ZodSet:()=>Eg,ZodString:()=>ft,ZodSymbol:()=>Ug,ZodTransformer:()=>bn,ZodTuple:()=>Qn,ZodType:()=>ye,ZodUndefined:()=>Xa,ZodUnion:()=>Qa,ZodUnknown:()=>Cr,ZodVoid:()=>Zg,addIssueToContext:()=>te,agent:()=>Mx,aimodel:()=>jx,any:()=>Jx,array:()=>eB,bigint:()=>Wx,boolean:()=>yy,coerce:()=>SB,conversation:()=>Ax,createZodEnum:()=>po,cuid2Regex:()=>kg,cuidRegex:()=>Pg,custom:()=>ag,datasource:()=>$x,date:()=>qx,datetimeRegex:()=>Mg,default:()=>_B,discriminatedUnion:()=>iB,effect:()=>uf,emailRegex:()=>Cg,enum:()=>yB,errorUtil:()=>se,event:()=>Dx,fromJsonSchema:()=>PB,fromObject:()=>kB,function:()=>dB,getErrorMap:()=>Dr,getParsedType:()=>tn,instanceof:()=>Fx,intent:()=>Hx,intersection:()=>oB,ipv4Regex:()=>Rg,ipv6Regex:()=>Og,isAborted:()=>ma,isAsync:()=>Bi,isDirty:()=>ha,isEmojiRegex:()=>px,isValid:()=>Nr,jsonSchemaToZui:()=>mo,knowledgebase:()=>Zx,late:()=>Lx,lazy:()=>pB,literal:()=>gB,makeIssue:()=>xi,map:()=>cB,message:()=>Ox,nan:()=>Kx,nativeEnum:()=>mB,never:()=>Xx,null:()=>Vx,nullable:()=>TB,number:()=>gy,object:()=>tB,objectToZui:()=>Hr,objectUtil:()=>ya,oboolean:()=>EB,onumber:()=>BB,optional:()=>vB,ostring:()=>xB,pipeline:()=>wB,preprocess:()=>bB,processCreateParams:()=>ge,promise:()=>hB,quotelessJson:()=>ux,readonly:()=>uB,record:()=>sB,ref:()=>lB,set:()=>fB,setErrorMap:()=>Yp,strictObject:()=>nB,string:()=>py,symbol:()=>zx,table:()=>Nx,tablerow:()=>Ux,transformer:()=>uf,tuple:()=>aB,ulidRegex:()=>Sg,undefined:()=>Gx,union:()=>rB,unknown:()=>Yx,user:()=>Rx,util:()=>_e,uuidRegex:()=>Ig,variable:()=>Cx,void:()=>Qx,zuiToJsonSchema:()=>rs});var Se="x-zui",gf=(0,ze.createContext)({formData:void 0,formSchema:void 0,setFormData:p(()=>{throw new Error("Must be within a FormDataProvider")},"setFormData"),setHiddenState:p(()=>{throw new Error("Must be within a FormDataProvider")},"setHiddenState"),setDisabledState:p(()=>{throw new Error("Must be within a FormDataProvider")},"setDisabledState"),hiddenState:{},disabledState:{},validation:{formValid:null,formErrors:null}}),Ic=p((t,e,n)=>{var r;let o=(r=e[Se])==null?void 0:r[t];if(typeof o>"u")return!1;if(typeof o=="boolean")return o;if(typeof o=="string"){if(typeof window>"u")return console.warn("Function evaluation is not supported in server side rendering"),!1;let i=new Function("return "+o)()(n);switch(typeof i){case"object":case"boolean":return i;default:return!1}}return!1},"parseMaskableField"),yf=p((t,e)=>{let n=(0,ze.useContext)(gf);if(n===void 0)throw new Error("useFormData must be used within a FormDataProvider");let r=(0,ze.useMemo)(()=>hn(n.formData,e),[n.formData,e]),o=(0,ze.useMemo)(()=>{var m;return n.validation.formValid===null?{formValid:null,formErrors:null}:n.validation.formValid===!1?{formValid:!1,formErrors:((m=n.validation.formErrors)==null?void 0:m.filter(v=>vf(v.path,e)).map(v=>({message:v.message,code:v.code,path:e})))||null}:{formValid:!0,formErrors:[]}},[n.validation.formValid,n.validation.formErrors,e]),a=n.dataTransform?n.dataTransform(r):r,i=(0,ze.useMemo)(()=>Ic("hidden",t,a),[t,a]),s=(0,ze.useMemo)(()=>Ic("disabled",t,a),[t,a]);(0,ze.useEffect)(()=>{n.setHiddenState(m=>Ln(m,e,i||{})),n.setDisabledState(m=>Ln(m,e,s||{}))},[JSON.stringify({fieldSchema:t,data:r})]);let{disabled:l,hidden:f}=(0,ze.useMemo)(()=>{let m=i===!0||hn(n.hiddenState,e),v=s===!0||hn(n.disabledState,e);return{hidden:m===!0,disabled:v===!0}},[n.hiddenState,n.disabledState,i,s,e]),d=(0,ze.useCallback)((m,v)=>{n.setFormData(B=>Ln(B,m,v))},[n.setFormData]),y=(0,ze.useCallback)((m,v=void 0)=>{let B=zn(t.items);n.setFormData(E=>{let T=hn(E,m)||[];return v===void 0&&(v=B),Ln(E,m,Array.isArray(T)?[...T,v]:[v])})},[n.setFormData]),g=(0,ze.useCallback)((m,v)=>{n.setFormData(B=>{let E=hn(B,m)||[];return Array.isArray(E)?(E.splice(v,1),Ln(B,m,E)):B})},[n.setFormData]);return x(U(x({},n),{data:r,disabled:l,hidden:f,handlePropertyChange:d,addArrayItem:y,removeArrayItem:g}),o)},"useFormData");function Ln(t,e,n){if(e.length===0)return n;let r=e.length;return e.reduce((o,a,i)=>(i===r-1?o[a]=n:o[a]||(o[a]=isNaN(Number(a))?{}:[]),o[a]),t??{}),x({},t)}p(Ln,"setObjectPath");var zn=p((t,e)=>{var n,r,o,a;if(Array.isArray(t))return zn(t[0]);if(t.default)return t.default;if(t.nullable)return null;if(!e){if((n=t.anyOf)!=null&&n.length)return zn(t.anyOf[0]);if(t.type==="object"&&t.properties){let i={};return Object.entries(t.properties).map(([s,l])=>{var f;i[s]=zn(l,!((f=t.required)!=null&&f.includes(s))||mf(l)||!1)}),i}if(t.type==="array")return t.minItems&&t.minItems>0?[zn(t.items)]:[];if(t.type==="string")return(r=t.enum)!=null&&r.length?t.enum[0]:"";if(t.type==="number")return(o=t.enum)!=null&&o.length?t.enum[0]:0;if(t.type==="boolean")return(a=t.enum)!=null&&a.length?t.enum[0]:!1}},"getDefaultValues"),rT=p(({children:t,setFormData:e,formData:n,formSchema:r,disableValidation:o,onValidation:a,dataTransform:i})=>{let[s,l]=(0,ze.useState)({}),[f,d]=(0,ze.useState)({}),y=i?i(n):n,g=(0,ze.useMemo)(()=>{if(o)return{formValid:null,formErrors:null};if(!r)return{formValid:null,formErrors:null};let m=mo(r).safeParse(y);return m.success?{formValid:!0,formErrors:[]}:{formValid:!1,formErrors:m.error.issues}},[JSON.stringify({transformedData:y})]);return(0,ze.useEffect)(()=>{a&&a(g)},[g]),ze.default.createElement(gf.Provider,{value:{formData:n,setFormData:e,formSchema:r,validation:g,hiddenState:s,setHiddenState:l,disabledState:f,setDisabledState:d,dataTransform:i}},t)},"FormDataProvider");function hn(t,e){return e.reduce((n,r)=>n?n[r]:null,t)}p(hn,"getPathData");function mf(t){var e;return((e=t.anyOf)==null?void 0:e.some(n=>n.not&&Object.keys(n.not).length===0))||!1}p(mf,"isOptional");function _i(t,e){let n=x({},t);for(let r in e)e.hasOwnProperty(r)&&(typeof e[r]=="object"&&e[r]!==null&&!Array.isArray(e[r])?typeof n[r]=="object"&&n[r]!==null&&!Array.isArray(n[r])?n[r]=_i(n[r],e[r]):n[r]=_i({},e[r]):n[r]=e[r]);return n}p(_i,"deepMerge");var iT=p((t,e)=>{let{handlePropertyChange:n,data:r}=yf(t,e),{discriminator:o,value:a,discriminatedSchema:i}=(0,ro.useMemo)(()=>{let s=hf(t.anyOf),l=s?.key?r?.[s.key]:t.default||null,f=oT(s?.key||null,l,t.anyOf);return{discriminator:s,value:l,discriminatedSchema:f}},[t.anyOf,r]);return(0,ro.useEffect)(()=>{o?.key&&o?.values.length&&Object.keys(r||{}).length<1&&!t.default&&n(e,{[o.key]:o.values[0]})},[]),{discriminator:o,discriminatorValue:a,discriminatedSchema:i}},"useDiscriminator"),hf=p(t=>{let e=t?.map(n=>n.type!=="object"||!n.properties?null:Object.entries(n.properties).map(([r,o])=>{var a;return o.type==="string"&&((a=o.enum)!=null&&a.length)?{key:r,value:o.enum[0]}:null}).filter(r=>!!r)).flat().reduce((n,r)=>{if(!r)return n;let{key:o,value:a}=r;return n.key===null&&(n.key=o),n.key===o&&n.values.push(a),n},{key:null,values:[]});return e?.key===null||!e?.values.length?null:e},"resolveDiscriminator"),oT=p((t,e,n)=>{var r,o;if(!n?.length||!t||!e)return null;for(let a of n){if(a.type!=="object")continue;let i=(r=a.properties)==null?void 0:r[t];if(i?.type==="string"&&((o=i.enum)!=null&&o.length)&&i.enum[0]===e)return U(x({},a),{properties:U(x({},a.properties),{[t]:U(x({},i),{[Se]:{hidden:!0}})})})}return null},"resolveDiscriminatedSchema"),aT=p(t=>{var e;return(e=t.anyOf)!=null&&e.length?hf(t.anyOf)?"discriminatedUnion":"object":t.type==="integer"?"number":t.type},"getSchemaType"),sT=p((t,e)=>{var n,r,o;let a=aT(e),i=((n=e[Se])==null?void 0:n.displayAs)||null;if(!i||!Array.isArray(i)||i.length<2){let d=(r=t?.[a])==null?void 0:r.default;return d?{Component:d,type:a,id:"default",params:{}}:null}let s=i[0],l=((o=t?.[a])==null?void 0:o[s])||null;if(!l)return console.warn(`Component ${a}.${s} not found`),null;let f=i[1]||{};return{Component:l,type:a,id:s,params:f}},"resolveComponent");function vf(t,e){return t.length!==e.length?!1:t.every((n,r)=>n===e[r])}p(vf,"pathMatches");function sa(t,e){return e||(e=new RegExp("/s|-|_| ","g")),bf(t).split(e).map(Tf).map(wf).reduce(_f)}p(sa,"formatTitle");function Tf(t){return t.charAt(0).toUpperCase()+t.substring(1)}p(Tf,"capitalize");function _f(t,e){return`${t} ${e}`}p(_f,"combine");function bf(t){return t.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()}p(bf,"decamelize");function wf(t,e,n){let r=t.toLowerCase(),o=t.toUpperCase();for(let a of dT)if(a.toLowerCase()===r)return a;return lT.includes(o)?o:e===0||e===n.length-1||t.length>=4?t:fT.includes(r)||cT.includes(r)||uT.includes(r)?r:t}p(wf,"handleSpecialWords");var lT=["2D","3D","4WD","A2O","API","BIOS","CCTV","CC","CCV","CD","CD-ROM","COBOL","CIA","CMS","CSS","CSV","CV","DIY","DVD","DB","DNA","E3","EIN","ESPN","FAQ","FAQs","FTP","FPS","FORTRAN","FBI","HTML","HTTP","ID","IP","ISO","JS","JSON","LASER","M2A","M2M","M2MM","M2O","MMORPG","NAFTA","NASA","NDA","O2M","PDF","PHP","POP","RAM","RNGR","ROM","RPG","RTFM","RTS","SCUBA","SITCOM","SKU","SMTP","SQL","SSN","SWAT","TBS","TTL","TV","TNA","UI","URL","USB","UWP","VIP","W3C","WYSIWYG","WWW","WWE","WWF"],uT=["a","an","the"],cT=["and","that","but","or","as","if","when","than","because","while","where","after","so","though","since","until","whether","before","although","nor","like","once","unless","now","except"],fT=["about","above","across","after","against","along","among","around","at","because of","before","behind","below","beneath","beside","besides","between","beyond","but","by","concerning","despite","down","during","except","excepting","for","from","in","in front of","inside","in spite of","instead of","into","like","near","of","off","on","onto","out","outside","over","past","regarding","since","through","throughout","to","toward","under","underneath","until","up","upon","up to","with","within","without","with regard to","with respect to"],dT=["2FA","3D","4K","5K","8K","AGI","BI","ChatGPT","CTA","DateTime","GitHub","GPT","HD","IBMid","ID","IDs","iMac","IMAX","iOS","IP","iPad","iPhone","iPod","LDAP","LinkedIn","LLM","M2M","M2O","macOS","McDonalds","ML","MySQL","NLG","NLP","NLU","O2M","OpenAI","PDFs","PEFT","pH","PostgreSQL","SEO","TTS","UHD","UUID","XSS","YouTube"];function xf(t){return typeof t=="symbol"?"symbol":typeof t=="bigint"?`${t.toString()}n`:jt(t)}p(xf,"primitiveToTypscriptLiteralType");function jt(t){return typeof t>"u"?"undefined":typeof t=="symbol"?t.description?`Symbol(${jt(t.description)})`:"Symbol()":typeof t=="bigint"?`BigInt(${t.toString()})`:JSON.stringify(t)}p(jt,"primitiveToTypescriptValue");function Bf(t){return typeof t>"u"?"undefined":JSON.stringify(t)}p(Bf,"unknownToTypescriptValue");var Cc=p(t=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)?t:jt(t),"toPropertyKey"),pT=p(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalize"),Ef=p(t=>{let e=/[^a-zA-Z0-9_]/g;return t.split(e).map(pT).filter(r=>!!r).join("")},"toTypeArgumentName"),pe=p(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"),bf={};sf(bf,{JsonSchemaToZuiError:()=>wf,ObjectToZuiError:()=>to,UnrepresentableGenericError:()=>no,UnsupportedZuiToJsonSchemaError:()=>sT,UnsupportedZuiToTypescriptSchemaError:()=>dn,UnsupportedZuiToTypescriptTypeError:()=>Of,UntitledDeclarationError:()=>Df,ZuiToJsonSchemaError:()=>Pf,ZuiToTypescriptSchemaError:()=>Af,ZuiToTypescriptTypeError:()=>ea,ZuiTransformError:()=>Xn});var _f=class extends Error{constructor(e,n){super(n),this.transform=e}};d(_f,"ZuiTransformError");var Xn=_f,xf=class extends Xn{constructor(e){super("json-schema-to-zui",e)}};d(xf,"JsonSchemaToZuiError");var wf=xf,Ef=class extends Xn{constructor(e){super("object-to-zui",e)}};d(Ef,"ObjectToZuiError");var to=Ef,Bf=class extends Xn{constructor(e){super("zui-to-json-schema",e)}};d(Bf,"ZuiToJsonSchemaError");var Pf=Bf,If=class extends Pf{constructor(e){super(`Zod type ${e} cannot be transformed to JSON Schema.`)}};d(If,"UnsupportedZuiToJsonSchemaError");var sT=If,Sf=class extends Xn{constructor(e){super("zui-to-typescript-schema",e)}};d(Sf,"ZuiToTypescriptSchemaError");var Af=Sf,Cf=class extends Af{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript schema.`)}};d(Cf,"UnsupportedZuiToTypescriptSchemaError");var dn=Cf,Rf=class extends Xn{constructor(e){super("zui-to-typescript-type",e)}};d(Rf,"ZuiToTypescriptTypeError");var ea=Rf,kf=class extends ea{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript type.`)}};d(kf,"UnsupportedZuiToTypescriptTypeError");var Of=kf,Mf=class extends ea{constructor(){super("Schema must have a title to be transformed to a TypeScript type with a declaration.")}};d(Mf,"UntitledDeclarationError");var Df=Mf,Nf=class extends ea{constructor(){super('ZodRef can only be transformed to a TypeScript type with a "type" declaration.')}};d(Nf,"UnrepresentableGenericError");var no=Nf,Hf=["string","number","boolean","unknown","void","any","null","undefined","never","bigint","symbol","object"],lT=d(t=>Hf.includes(t),"isPrimitive"),uT=d(t=>Hf.map(e=>`${e}[]`).includes(t),"isArrayOfPrimitives"),Bc=d(t=>t.replace(/ +/g," ").trim(),"stripSpaces"),Uf=class{constructor(e,n,r=!1){this.key=e,this.value=n,this.optional=r}};d(Uf,"KeyValue");var ai=Uf,jf=class{constructor(e){this.schema=e}};d(jf,"FnParameters");var Pc=jf,$f=class{constructor(e){this.schema=e}};d($f,"FnReturn");var Ic=$f,Zf=class{constructor(e){this.props=e}};d(Zf,"Declaration");var si=Zf;function hi(t,e={}){let n=dT(t,e),r=Ce(n,{});return e.formatter&&(r=e.formatter(r)),r}d(hi,"toTypescript");function Ce(t,e){var n,r,a;let o=H(w({},e),{parent:t});if(t===null)return"";if(t instanceof si)return cT(t,o);if(t instanceof ai){if(t.value instanceof z.ZodOptional){let m=t.value._def.innerType;return m instanceof z.Schema&&!m.description&&t.value.description&&(m=m?.describe(t.value.description)),Ce(new ai(t.key,m,!0),o)}let l=pe(t.value._def.description),f=l?.trim().length>0?`
18
- `:"",g=t.value.describe(""),p=t.optional||t.value.isOptional()?"?":"";return`${f}${l}${f}${t.key}${p}: ${Ce(g,o)}${f}`}if(t instanceof Pc){if(t.schema instanceof z.ZodTuple){let g="";for(let y=0;y<t.schema.items.length;y++){let p=(a=(r=(n=t.schema.items[y])==null?void 0:n.ui)==null?void 0:r.title)!=null?a:`arg${y}`,m=t.schema.items[y];g+=`${Ce(new ai(Ec(p),m),o)}${y<t.schema.items.length-1?", ":""} `}return g}let l=Ce(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(">")||uT(l)?`args: ${l}`:l}if(t instanceof Ic)return t.schema instanceof z.ZodOptional?`${Ce(t.schema.unwrap(),o)} | undefined`:Ce(t.schema,o);let s=t._def;switch(s.typeName){case z.ZodFirstPartyTypeKind.ZodString:return`${pe(s.description)} string`.trim();case z.ZodFirstPartyTypeKind.ZodNumber:case z.ZodFirstPartyTypeKind.ZodNaN:case z.ZodFirstPartyTypeKind.ZodBigInt:return`${pe(s.description)} number`.trim();case z.ZodFirstPartyTypeKind.ZodBoolean:return`${pe(t._def.description)} boolean`.trim();case z.ZodFirstPartyTypeKind.ZodDate:return`${pe(s.description)} Date`.trim();case z.ZodFirstPartyTypeKind.ZodUndefined:return`${pe(s.description)} undefined`.trim();case z.ZodFirstPartyTypeKind.ZodNull:return`${pe(s.description)} null`.trim();case z.ZodFirstPartyTypeKind.ZodAny:return`${pe(s.description)} any`.trim();case z.ZodFirstPartyTypeKind.ZodUnknown:return`${pe(s.description)} unknown`.trim();case z.ZodFirstPartyTypeKind.ZodNever:return`${pe(s.description)} never`.trim();case z.ZodFirstPartyTypeKind.ZodVoid:return`${pe(s.description)} void`.trim();case z.ZodFirstPartyTypeKind.ZodArray:let l=Ce(s.type,o);return lT(l)?`${l}[]`:`Array<${l}>`;case z.ZodFirstPartyTypeKind.ZodObject:return`{ ${Object.entries(s.shape()).map(([P,D])=>Ce(new ai(Ec(P),D),o)).join("; ")} }`;case z.ZodFirstPartyTypeKind.ZodUnion:let g=s.options.map(P=>Ce(P,o));return`${pe(s.description)}
19
- ${g.join(" | ")}`;case z.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let y=s.options.map(P=>Ce(P,o));return`${pe(t._def.description)}
20
- ${y.join(" | ")}`;case z.ZodFirstPartyTypeKind.ZodIntersection:return`${Ce(s.left,o)} & ${Ce(s.right,o)}`;case z.ZodFirstPartyTypeKind.ZodTuple:return s.items.length===0?"":`[${s.items.map(P=>Ce(P,o)).join(", ")}]`;case z.ZodFirstPartyTypeKind.ZodRecord:let m=Ce(s.keyType,o),_=Ce(s.valueType,o);return`${pe(s.description)} { [key: ${m}]: ${_} }`;case z.ZodFirstPartyTypeKind.ZodMap:return`Map<${Ce(s.keyType,o)}, ${Ce(s.valueType,o)}>`;case z.ZodFirstPartyTypeKind.ZodSet:return`Set<${Ce(s.valueType,o)}>`;case z.ZodFirstPartyTypeKind.ZodFunction:let E=Ce(new Pc(s.args),o),B=Ce(new Ic(s.returns),o);return`${pe(s.description)}
21
- (${E}) => ${B}`;case z.ZodFirstPartyTypeKind.ZodLazy:return Ce(s.getter(),o);case z.ZodFirstPartyTypeKind.ZodLiteral:let v=hf(s.value);return`${pe(s.description)}
22
- ${v}`.trim();case z.ZodFirstPartyTypeKind.ZodEnum:return s.values.map(jt).join(" | ");case z.ZodFirstPartyTypeKind.ZodEffects:return Ce(s.schema,o);case z.ZodFirstPartyTypeKind.ZodNativeEnum:throw new Of(z.ZodFirstPartyTypeKind.ZodNativeEnum);case z.ZodFirstPartyTypeKind.ZodOptional:return`${Ce(s.innerType,o)} | undefined`;case z.ZodFirstPartyTypeKind.ZodNullable:return`${Ce(s.innerType,o)} | null`;case z.ZodFirstPartyTypeKind.ZodDefault:return Ce(s.innerType,o);case z.ZodFirstPartyTypeKind.ZodCatch:return Ce(s.innerType,o);case z.ZodFirstPartyTypeKind.ZodPromise:return`Promise<${Ce(s.type,o)}>`;case z.ZodFirstPartyTypeKind.ZodBranded:return Ce(s.type,o);case z.ZodFirstPartyTypeKind.ZodPipeline:return Ce(s.in,o);case z.ZodFirstPartyTypeKind.ZodSymbol:return`${pe(s.description)} symbol`.trim();case z.ZodFirstPartyTypeKind.ZodReadonly:return`Readonly<${Ce(s.innerType,o)}>`;case z.ZodFirstPartyTypeKind.ZodRef:return Tf(s.uri);default:be.assertNever(s)}}d(Ce,"sUnwrapZod");var cT=d((t,e)=>{if(t.props.type==="none")return Ce(t.props.schema,e);let n=pe(t.props.schema.description),r=t.props.schema.describe(""),a=Ce(r,e);if(t.props.type==="variable")return Bc(`${n}declare const ${t.props.identifier}: ${a};`);let o=t.props.args.length>0?`<${t.props.args.map(Tf).join(", ")}>`:"";return Bc(`${n}type ${t.props.identifier}${o} = ${a};`)},"unwrapDeclaration"),fT=d(t=>t.declaration?t.declaration===!0?"variable":t.declaration:"none","getDeclarationType"),dT=d((t,e)=>{let n=fT(e),r=t.getReferences();if(n==="none"){if(r.length>0)throw new no;return new si({type:"none",schema:t})}let a="title"in t.ui?t.ui.title:null;if(!a)throw new Df;if(n==="variable"){if(r.length>0)throw new no;return new si({type:"variable",identifier:a,schema:t})}return new si({type:"type",identifier:a,schema:t,args:r})},"getDeclarationProps"),pT=typeof global=="object"&&global&&global.Object===Object&&global,Lf=pT,gT=typeof self=="object"&&self&&self.Object===Object&&self,yT=Lf||gT||Function("return this")(),Ft=yT,mT=Ft.Symbol,nn=mT,Ff=Object.prototype,hT=Ff.hasOwnProperty,vT=Ff.toString,Tr=nn?nn.toStringTag:void 0;function Kf(t){var e=hT.call(t,Tr),n=t[Tr];try{t[Tr]=void 0;var r=!0}catch{}var a=vT.call(t);return r&&(e?t[Tr]=n:delete t[Tr]),a}d(Kf,"getRawTag");var TT=Kf,bT=Object.prototype,_T=bT.toString;function qf(t){return _T.call(t)}d(qf,"objectToString");var xT=qf,wT="[object Null]",ET="[object Undefined]",Sc=nn?nn.toStringTag:void 0;function zf(t){return t==null?t===void 0?ET:wT:Sc&&Sc in Object(t)?TT(t):xT(t)}d(zf,"baseGetTag");var Qn=zf;function Gf(t){return t!=null&&typeof t=="object"}d(Gf,"isObjectLike");var zn=Gf,BT="[object Symbol]";function Vf(t){return typeof t=="symbol"||zn(t)&&Qn(t)==BT}d(Vf,"isSymbol");var wo=Vf;function Wf(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(Wf,"arrayMap");var PT=Wf,IT=Array.isArray,Lt=IT,ST=1/0,Ac=nn?nn.prototype:void 0,Cc=Ac?Ac.toString:void 0;function Eo(t){if(typeof t=="string")return t;if(Lt(t))return PT(t,Eo)+"";if(wo(t))return Cc?Cc.call(t):"";var e=t+"";return e=="0"&&1/t==-ST?"-0":e}d(Eo,"baseToString");var AT=Eo;function Jf(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}d(Jf,"isObject");var Bo=Jf;function Yf(t){return t}d(Yf,"identity");var CT=Yf,RT="[object AsyncFunction]",kT="[object Function]",OT="[object GeneratorFunction]",MT="[object Proxy]";function Xf(t){if(!Bo(t))return!1;var e=Qn(t);return e==kT||e==OT||e==RT||e==MT}d(Xf,"isFunction");var Qf=Xf,DT=Ft["__core-js_shared__"],Ja=DT,Rc=function(){var t=/[^.]+$/.exec(Ja&&Ja.keys&&Ja.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ed(t){return!!Rc&&Rc in t}d(ed,"isMasked");var NT=ed,HT=Function.prototype,UT=HT.toString;function td(t){if(t!=null){try{return UT.call(t)}catch{}try{return t+""}catch{}}return""}d(td,"toSource");var Tn=td,jT=/[\\^$.*+?()[\]{}|]/g,$T=/^\[object .+?Constructor\]$/,ZT=Function.prototype,LT=Object.prototype,FT=ZT.toString,KT=LT.hasOwnProperty,qT=RegExp("^"+FT.call(KT).replace(jT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nd(t){if(!Bo(t)||NT(t))return!1;var e=Qf(t)?qT:$T;return e.test(Tn(t))}d(nd,"baseIsNative");var zT=nd;function rd(t,e){return t?.[e]}d(rd,"getValue");var GT=rd;function id(t,e){var n=GT(t,e);return zT(n)?n:void 0}d(id,"getNative");var bn=id,VT=bn(Ft,"WeakMap"),ro=VT,WT=function(){try{var t=bn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),kc=WT,JT=9007199254740991,YT=/^(?:0|[1-9]\d*)$/;function ad(t,e){var n=typeof t;return e=e??JT,!!e&&(n=="number"||n!="symbol"&&YT.test(t))&&t>-1&&t%1==0&&t<e}d(ad,"isIndex");var od=ad;function sd(t,e,n){e=="__proto__"&&kc?kc(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}d(sd,"baseAssignValue");var XT=sd;function ld(t,e){return t===e||t!==t&&e!==e}d(ld,"eq");var ud=ld,QT=9007199254740991;function cd(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=QT}d(cd,"isLength");var Po=cd;function fd(t){return t!=null&&Po(t.length)&&!Qf(t)}d(fd,"isArrayLike");var eb=fd,tb=Object.prototype;function dd(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||tb;return t===n}d(dd,"isPrototype");var nb=dd;function pd(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}d(pd,"baseTimes");var rb=pd,ib="[object Arguments]";function gd(t){return zn(t)&&Qn(t)==ib}d(gd,"baseIsArguments");var Oc=gd,yd=Object.prototype,ab=yd.hasOwnProperty,ob=yd.propertyIsEnumerable,sb=Oc(function(){return arguments}())?Oc:function(t){return zn(t)&&ab.call(t,"callee")&&!ob.call(t,"callee")},md=sb;function hd(){return!1}d(hd,"stubFalse");var lb=hd,vd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mc=vd&&typeof module=="object"&&module&&!module.nodeType&&module,ub=Mc&&Mc.exports===vd,Dc=ub?Ft.Buffer:void 0,cb=Dc?Dc.isBuffer:void 0,fb=cb||lb,io=fb,db="[object Arguments]",pb="[object Array]",gb="[object Boolean]",yb="[object Date]",mb="[object Error]",hb="[object Function]",vb="[object Map]",Tb="[object Number]",bb="[object Object]",_b="[object RegExp]",xb="[object Set]",wb="[object String]",Eb="[object WeakMap]",Bb="[object ArrayBuffer]",Pb="[object DataView]",Ib="[object Float32Array]",Sb="[object Float64Array]",Ab="[object Int8Array]",Cb="[object Int16Array]",Rb="[object Int32Array]",kb="[object Uint8Array]",Ob="[object Uint8ClampedArray]",Mb="[object Uint16Array]",Db="[object Uint32Array]",Le={};Le[Ib]=Le[Sb]=Le[Ab]=Le[Cb]=Le[Rb]=Le[kb]=Le[Ob]=Le[Mb]=Le[Db]=!0;Le[db]=Le[pb]=Le[Bb]=Le[gb]=Le[Pb]=Le[yb]=Le[mb]=Le[hb]=Le[vb]=Le[Tb]=Le[bb]=Le[_b]=Le[xb]=Le[wb]=Le[Eb]=!1;function Td(t){return zn(t)&&Po(t.length)&&!!Le[Qn(t)]}d(Td,"baseIsTypedArray");var Nb=Td;function bd(t){return function(e){return t(e)}}d(bd,"baseUnary");var Hb=bd,_d=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Br=_d&&typeof module=="object"&&module&&!module.nodeType&&module,Ub=Br&&Br.exports===_d,Ya=Ub&&Lf.process,jb=function(){try{var t=Br&&Br.require&&Br.require("util").types;return t||Ya&&Ya.binding&&Ya.binding("util")}catch{}}(),Nc=jb,Hc=Nc&&Nc.isTypedArray,$b=Hc?Hb(Hc):Nb,xd=$b,Zb=Object.prototype,Lb=Zb.hasOwnProperty;function wd(t,e){var n=Lt(t),r=!n&&md(t),a=!n&&!r&&io(t),o=!n&&!r&&!a&&xd(t),i=n||r||a||o,s=i?rb(t.length,String):[],l=s.length;for(var f in t)(e||Lb.call(t,f))&&!(i&&(f=="length"||a&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||od(f,l)))&&s.push(f);return s}d(wd,"arrayLikeKeys");var Fb=wd;function Ed(t,e){return function(n){return t(e(n))}}d(Ed,"overArg");var Kb=Ed,qb=Kb(Object.keys,Object),zb=qb,Gb=Object.prototype,Vb=Gb.hasOwnProperty;function Bd(t){if(!nb(t))return zb(t);var e=[];for(var n in Object(t))Vb.call(t,n)&&n!="constructor"&&e.push(n);return e}d(Bd,"baseKeys");var Wb=Bd;function Pd(t){return eb(t)?Fb(t):Wb(t)}d(Pd,"keys");var Io=Pd,Jb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yb=/^\w*$/;function Id(t,e){if(Lt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||wo(t)?!0:Yb.test(t)||!Jb.test(t)||e!=null&&t in Object(e)}d(Id,"isKey");var So=Id,Xb=bn(Object,"create"),Sr=Xb;function Sd(){this.__data__=Sr?Sr(null):{},this.size=0}d(Sd,"hashClear");var Qb=Sd;function Ad(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}d(Ad,"hashDelete");var e_=Ad,t_="__lodash_hash_undefined__",n_=Object.prototype,r_=n_.hasOwnProperty;function Cd(t){var e=this.__data__;if(Sr){var n=e[t];return n===t_?void 0:n}return r_.call(e,t)?e[t]:void 0}d(Cd,"hashGet");var i_=Cd,a_=Object.prototype,o_=a_.hasOwnProperty;function Rd(t){var e=this.__data__;return Sr?e[t]!==void 0:o_.call(e,t)}d(Rd,"hashHas");var s_=Rd,l_="__lodash_hash_undefined__";function kd(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Sr&&e===void 0?l_:e,this}d(kd,"hashSet");var u_=kd;function _n(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(_n,"Hash");_n.prototype.clear=Qb;_n.prototype.delete=e_;_n.prototype.get=i_;_n.prototype.has=s_;_n.prototype.set=u_;var Uc=_n;function Od(){this.__data__=[],this.size=0}d(Od,"listCacheClear");var c_=Od;function Md(t,e){for(var n=t.length;n--;)if(ud(t[n][0],e))return n;return-1}d(Md,"assocIndexOf");var ta=Md,f_=Array.prototype,d_=f_.splice;function Dd(t){var e=this.__data__,n=ta(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():d_.call(e,n,1),--this.size,!0}d(Dd,"listCacheDelete");var p_=Dd;function Nd(t){var e=this.__data__,n=ta(e,t);return n<0?void 0:e[n][1]}d(Nd,"listCacheGet");var g_=Nd;function Hd(t){return ta(this.__data__,t)>-1}d(Hd,"listCacheHas");var y_=Hd;function Ud(t,e){var n=this.__data__,r=ta(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}d(Ud,"listCacheSet");var m_=Ud;function xn(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(xn,"ListCache");xn.prototype.clear=c_;xn.prototype.delete=p_;xn.prototype.get=g_;xn.prototype.has=y_;xn.prototype.set=m_;var na=xn,h_=bn(Ft,"Map"),Ar=h_;function jd(){this.size=0,this.__data__={hash:new Uc,map:new(Ar||na),string:new Uc}}d(jd,"mapCacheClear");var v_=jd;function $d(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}d($d,"isKeyable");var T_=$d;function Zd(t,e){var n=t.__data__;return T_(e)?n[typeof e=="string"?"string":"hash"]:n.map}d(Zd,"getMapData");var ra=Zd;function Ld(t){var e=ra(this,t).delete(t);return this.size-=e?1:0,e}d(Ld,"mapCacheDelete");var b_=Ld;function Fd(t){return ra(this,t).get(t)}d(Fd,"mapCacheGet");var __=Fd;function Kd(t){return ra(this,t).has(t)}d(Kd,"mapCacheHas");var x_=Kd;function qd(t,e){var n=ra(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}d(qd,"mapCacheSet");var w_=qd;function wn(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(wn,"MapCache");wn.prototype.clear=v_;wn.prototype.delete=b_;wn.prototype.get=__;wn.prototype.has=x_;wn.prototype.set=w_;var ia=wn,E_="Expected a function";function aa(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(E_);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(aa.Cache||ia),n}d(aa,"memoize");aa.Cache=ia;var B_=aa,P_=500;function zd(t){var e=B_(t,function(r){return n.size===P_&&n.clear(),r}),n=e.cache;return e}d(zd,"memoizeCapped");var I_=zd,S_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,A_=/\\(\\)?/g,C_=I_(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(S_,function(n,r,a,o){e.push(a?o.replace(A_,"$1"):r||n)}),e}),R_=C_;function Gd(t){return t==null?"":AT(t)}d(Gd,"toString");var k_=Gd;function Vd(t,e){return Lt(t)?t:So(t,e)?[t]:R_(k_(t))}d(Vd,"castPath");var Wd=Vd,O_=1/0;function Jd(t){if(typeof t=="string"||wo(t))return t;var e=t+"";return e=="0"&&1/t==-O_?"-0":e}d(Jd,"toKey");var oa=Jd;function Yd(t,e){e=Wd(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[oa(e[n++])];return n&&n==r?t:void 0}d(Yd,"baseGet");var Xd=Yd;function Qd(t,e,n){var r=t==null?void 0:Xd(t,e);return r===void 0?n:r}d(Qd,"get");var M_=Qd;function ep(t,e){for(var n=-1,r=e.length,a=t.length;++n<r;)t[a+n]=e[n];return t}d(ep,"arrayPush");var D_=ep;function tp(){this.__data__=new na,this.size=0}d(tp,"stackClear");var N_=tp;function np(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}d(np,"stackDelete");var H_=np;function rp(t){return this.__data__.get(t)}d(rp,"stackGet");var U_=rp;function ip(t){return this.__data__.has(t)}d(ip,"stackHas");var j_=ip,$_=200;function ap(t,e){var n=this.__data__;if(n instanceof na){var r=n.__data__;if(!Ar||r.length<$_-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ia(r)}return n.set(t,e),this.size=n.size,this}d(ap,"stackSet");var Z_=ap;function En(t){var e=this.__data__=new na(t);this.size=e.size}d(En,"Stack");En.prototype.clear=N_;En.prototype.delete=H_;En.prototype.get=U_;En.prototype.has=j_;En.prototype.set=Z_;var li=En;function op(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(op,"arrayFilter");var L_=op;function sp(){return[]}d(sp,"stubArray");var F_=sp,K_=Object.prototype,q_=K_.propertyIsEnumerable,jc=Object.getOwnPropertySymbols,z_=jc?function(t){return t==null?[]:(t=Object(t),L_(jc(t),function(e){return q_.call(t,e)}))}:F_,G_=z_;function lp(t,e,n){var r=e(t);return Lt(t)?r:D_(r,n(t))}d(lp,"baseGetAllKeys");var V_=lp;function up(t){return V_(t,Io,G_)}d(up,"getAllKeys");var $c=up,W_=bn(Ft,"DataView"),ao=W_,J_=bn(Ft,"Promise"),oo=J_,Y_=bn(Ft,"Set"),so=Y_,Zc="[object Map]",X_="[object Object]",Lc="[object Promise]",Fc="[object Set]",Kc="[object WeakMap]",qc="[object DataView]",Q_=Tn(ao),ex=Tn(Ar),tx=Tn(oo),nx=Tn(so),rx=Tn(ro),pn=Qn;(ao&&pn(new ao(new ArrayBuffer(1)))!=qc||Ar&&pn(new Ar)!=Zc||oo&&pn(oo.resolve())!=Lc||so&&pn(new so)!=Fc||ro&&pn(new ro)!=Kc)&&(pn=d(function(t){var e=Qn(t),n=e==X_?t.constructor:void 0,r=n?Tn(n):"";if(r)switch(r){case Q_:return qc;case ex:return Zc;case tx:return Lc;case nx:return Fc;case rx:return Kc}return e},"getTag"));var zc=pn,ix=Ft.Uint8Array,Gc=ix,ax="__lodash_hash_undefined__";function cp(t){return this.__data__.set(t,ax),this}d(cp,"setCacheAdd");var ox=cp;function fp(t){return this.__data__.has(t)}d(fp,"setCacheHas");var sx=fp;function Cr(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new ia;++e<n;)this.add(t[e])}d(Cr,"SetCache");Cr.prototype.add=Cr.prototype.push=ox;Cr.prototype.has=sx;var lx=Cr;function dp(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(dp,"arraySome");var ux=dp;function pp(t,e){return t.has(e)}d(pp,"cacheHas");var cx=pp,fx=1,dx=2;function gp(t,e,n,r,a,o){var i=n&fx,s=t.length,l=e.length;if(s!=l&&!(i&&l>s))return!1;var f=o.get(t),g=o.get(e);if(f&&g)return f==e&&g==t;var y=-1,p=!0,m=n&dx?new lx:void 0;for(o.set(t,e),o.set(e,t);++y<s;){var _=t[y],E=e[y];if(r)var B=i?r(E,_,y,e,t,o):r(_,E,y,t,e,o);if(B!==void 0){if(B)continue;p=!1;break}if(m){if(!ux(e,function(v,I){if(!cx(m,I)&&(_===v||a(_,v,n,r,o)))return m.push(I)})){p=!1;break}}else if(!(_===E||a(_,E,n,r,o))){p=!1;break}}return o.delete(t),o.delete(e),p}d(gp,"equalArrays");var yp=gp;function mp(t){var e=-1,n=Array(t.size);return t.forEach(function(r,a){n[++e]=[a,r]}),n}d(mp,"mapToArray");var px=mp;function hp(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}d(hp,"setToArray");var gx=hp,yx=1,mx=2,hx="[object Boolean]",vx="[object Date]",Tx="[object Error]",bx="[object Map]",_x="[object Number]",xx="[object RegExp]",wx="[object Set]",Ex="[object String]",Bx="[object Symbol]",Px="[object ArrayBuffer]",Ix="[object DataView]",Vc=nn?nn.prototype:void 0,Xa=Vc?Vc.valueOf:void 0;function vp(t,e,n,r,a,o,i){switch(n){case Ix:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Px:return!(t.byteLength!=e.byteLength||!o(new Gc(t),new Gc(e)));case hx:case vx:case _x:return ud(+t,+e);case Tx:return t.name==e.name&&t.message==e.message;case xx:case Ex:return t==e+"";case bx:var s=px;case wx:var l=r&yx;if(s||(s=gx),t.size!=e.size&&!l)return!1;var f=i.get(t);if(f)return f==e;r|=mx,i.set(t,e);var g=yp(s(t),s(e),r,a,o,i);return i.delete(t),g;case Bx:if(Xa)return Xa.call(t)==Xa.call(e)}return!1}d(vp,"equalByTag");var Sx=vp,Ax=1,Cx=Object.prototype,Rx=Cx.hasOwnProperty;function Tp(t,e,n,r,a,o){var i=n&Ax,s=$c(t),l=s.length,f=$c(e),g=f.length;if(l!=g&&!i)return!1;for(var y=l;y--;){var p=s[y];if(!(i?p in e:Rx.call(e,p)))return!1}var m=o.get(t),_=o.get(e);if(m&&_)return m==e&&_==t;var E=!0;o.set(t,e),o.set(e,t);for(var B=i;++y<l;){p=s[y];var v=t[p],I=e[p];if(r)var P=i?r(I,v,p,e,t,o):r(v,I,p,t,e,o);if(!(P===void 0?v===I||a(v,I,n,r,o):P)){E=!1;break}B||(B=p=="constructor")}if(E&&!B){var D=t.constructor,$=e.constructor;D!=$&&"constructor"in t&&"constructor"in e&&!(typeof D=="function"&&D instanceof D&&typeof $=="function"&&$ instanceof $)&&(E=!1)}return o.delete(t),o.delete(e),E}d(Tp,"equalObjects");var kx=Tp,Ox=1,Wc="[object Arguments]",Jc="[object Array]",oi="[object Object]",Mx=Object.prototype,Yc=Mx.hasOwnProperty;function bp(t,e,n,r,a,o){var i=Lt(t),s=Lt(e),l=i?Jc:zc(t),f=s?Jc:zc(e);l=l==Wc?oi:l,f=f==Wc?oi:f;var g=l==oi,y=f==oi,p=l==f;if(p&&io(t)){if(!io(e))return!1;i=!0,g=!1}if(p&&!g)return o||(o=new li),i||xd(t)?yp(t,e,n,r,a,o):Sx(t,e,l,n,r,a,o);if(!(n&Ox)){var m=g&&Yc.call(t,"__wrapped__"),_=y&&Yc.call(e,"__wrapped__");if(m||_){var E=m?t.value():t,B=_?e.value():e;return o||(o=new li),a(E,B,n,r,o)}}return p?(o||(o=new li),kx(t,e,n,r,a,o)):!1}d(bp,"baseIsEqualDeep");var Dx=bp;function Ao(t,e,n,r,a){return t===e?!0:t==null||e==null||!zn(t)&&!zn(e)?t!==t&&e!==e:Dx(t,e,n,r,Ao,a)}d(Ao,"baseIsEqual");var Co=Ao,Nx=1,Hx=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],g=s[1];if(i&&s[2]){if(f===void 0&&!(l in t))return!1}else{var y=new li;if(r)var p=r(f,g,l,t,e,y);if(!(p===void 0?Co(g,f,Nx|Hx,r,y):p))return!1}}return!0}d(_p,"baseIsMatch");var Ux=_p;function xp(t){return t===t&&!Bo(t)}d(xp,"isStrictComparable");var wp=xp;function Ep(t){for(var e=Io(t),n=e.length;n--;){var r=e[n],a=t[r];e[n]=[r,a,wp(a)]}return e}d(Ep,"getMatchData");var jx=Ep;function Bp(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}d(Bp,"matchesStrictComparable");var Pp=Bp;function Ip(t){var e=jx(t);return e.length==1&&e[0][2]?Pp(e[0][0],e[0][1]):function(n){return n===t||Ux(n,t,e)}}d(Ip,"baseMatches");var $x=Ip;function Sp(t,e){return t!=null&&e in Object(t)}d(Sp,"baseHasIn");var Zx=Sp;function Ap(t,e,n){e=Wd(e,t);for(var r=-1,a=e.length,o=!1;++r<a;){var i=oa(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&&Po(a)&&od(i,a)&&(Lt(t)||md(t)))}d(Ap,"hasPath");var Lx=Ap;function Cp(t,e){return t!=null&&Lx(t,e,Zx)}d(Cp,"hasIn");var Fx=Cp,Kx=1,qx=2;function Rp(t,e){return So(t)&&wp(e)?Pp(oa(t),e):function(n){var r=M_(n,t);return r===void 0&&r===e?Fx(n,t):Co(e,r,Kx|qx)}}d(Rp,"baseMatchesProperty");var zx=Rp;function kp(t){return function(e){return e?.[t]}}d(kp,"baseProperty");var Gx=kp;function Op(t){return function(e){return Xd(e,t)}}d(Op,"basePropertyDeep");var Vx=Op;function Mp(t){return So(t)?Gx(oa(t)):Vx(t)}d(Mp,"property");var Wx=Mp;function Dp(t){return typeof t=="function"?t:t==null?CT:typeof t=="object"?Lt(t)?zx(t[0],t[1]):$x(t):Wx(t)}d(Dp,"baseIteratee");var Jx=Dp;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 Yx=Np,Xx=Yx(),Qx=Xx;function Hp(t,e){return t&&Qx(t,e,Io)}d(Hp,"baseForOwn");var ew=Hp;function Up(t,e){return Co(t,e)}d(Up,"isEqual");var mn=Up;function jp(t,e){var n={};return e=Jx(e,3),ew(t,function(r,a,o){XT(n,a,e(r,a,o))}),n}d(jp,"mapValues");var tw=jp;function Ro(t){return Xe(t)}d(Ro,"toTypescriptSchema");function Xe(t){let n=t._def;switch(n.typeName){case z.ZodFirstPartyTypeKind.ZodString:return`${pe(n.description)}z.string()`.trim();case z.ZodFirstPartyTypeKind.ZodNumber:return`${pe(n.description)}z.number()`.trim();case z.ZodFirstPartyTypeKind.ZodNaN:return`${pe(n.description)}z.nan()`.trim();case z.ZodFirstPartyTypeKind.ZodBigInt:return`${pe(n.description)}z.bigint()`.trim();case z.ZodFirstPartyTypeKind.ZodBoolean:return`${pe(t._def.description)}z.boolean()`.trim();case z.ZodFirstPartyTypeKind.ZodDate:return`${pe(n.description)}z.date()`.trim();case z.ZodFirstPartyTypeKind.ZodUndefined:return`${pe(n.description)}z.undefined()`.trim();case z.ZodFirstPartyTypeKind.ZodNull:return`${pe(n.description)}z.null()`.trim();case z.ZodFirstPartyTypeKind.ZodAny:return`${pe(n.description)}z.any()`.trim();case z.ZodFirstPartyTypeKind.ZodUnknown:return`${pe(n.description)}z.unknown()`.trim();case z.ZodFirstPartyTypeKind.ZodNever:return`${pe(n.description)}z.never()`.trim();case z.ZodFirstPartyTypeKind.ZodVoid:return`${pe(n.description)}z.void()`.trim();case z.ZodFirstPartyTypeKind.ZodArray:return`z.array(${Xe(n.type)})`;case z.ZodFirstPartyTypeKind.ZodObject:let r=tw(n.shape(),$=>$ instanceof z.Schema?Xe($):"z.any()");return[`${pe(n.description)}z.object({`,...Object.entries(r).map(([$,ae])=>` ${$}: ${ae},`),"})"].join(`
23
- `).trim();case z.ZodFirstPartyTypeKind.ZodUnion:let a=n.options.map(Xe);return`${pe(n.description)}z.union([${a.join(", ")}])`.trim();case z.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let o=n.options.map(Xe),i=jt(n.discriminator);return`${pe(n.description)}z.discriminatedUnion(${i}, [${o.join(", ")}])`.trim();case z.ZodFirstPartyTypeKind.ZodIntersection:let s=Xe(n.left),l=Xe(n.right);return`${pe(n.description)}z.intersection(${s}, ${l})`.trim();case z.ZodFirstPartyTypeKind.ZodTuple:let f=n.items.map(Xe);return`${pe(n.description)}z.tuple([${f.join(", ")}])`.trim();case z.ZodFirstPartyTypeKind.ZodRecord:let g=Xe(n.keyType),y=Xe(n.valueType);return`${pe(n.description)}z.record(${g}, ${y})`.trim();case z.ZodFirstPartyTypeKind.ZodMap:let p=Xe(n.keyType),m=Xe(n.valueType);return`${pe(n.description)}z.map(${p}, ${m})`.trim();case z.ZodFirstPartyTypeKind.ZodSet:return`${pe(n.description)}z.set(${Xe(n.valueType)})`.trim();case z.ZodFirstPartyTypeKind.ZodFunction:let _=n.args.items.map(Xe),E=_.length?`.args(${_.join(", ")})`:"",B=Xe(n.returns);return`${pe(n.description)}z.function()${E}.returns(${B})`.trim();case z.ZodFirstPartyTypeKind.ZodLazy:return`${pe(n.description)}z.lazy(() => ${Xe(n.getter())})`.trim();case z.ZodFirstPartyTypeKind.ZodLiteral:let v=jt(n.value);return`${pe(n.description)}z.literal(${v})`.trim();case z.ZodFirstPartyTypeKind.ZodEnum:let I=n.values.map(jt);return`${pe(n.description)}z.enum([${I.join(", ")}])`.trim();case z.ZodFirstPartyTypeKind.ZodEffects:throw new dn(z.ZodFirstPartyTypeKind.ZodEffects);case z.ZodFirstPartyTypeKind.ZodNativeEnum:throw new dn(z.ZodFirstPartyTypeKind.ZodNativeEnum);case z.ZodFirstPartyTypeKind.ZodOptional:return`${pe(n.description)}z.optional(${Xe(n.innerType)})`.trim();case z.ZodFirstPartyTypeKind.ZodNullable:return`${pe(n.description)}z.nullable(${Xe(n.innerType)})`.trim();case z.ZodFirstPartyTypeKind.ZodDefault:let P=vf(n.defaultValue());return`${pe(n.description)}${Xe(n.innerType)}.default(${P})`.trim();case z.ZodFirstPartyTypeKind.ZodCatch:throw new dn(z.ZodFirstPartyTypeKind.ZodCatch);case z.ZodFirstPartyTypeKind.ZodPromise:return`${pe(n.description)}z.promise(${Xe(n.type)})`.trim();case z.ZodFirstPartyTypeKind.ZodBranded:throw new dn(z.ZodFirstPartyTypeKind.ZodBranded);case z.ZodFirstPartyTypeKind.ZodPipeline:throw new dn(z.ZodFirstPartyTypeKind.ZodPipeline);case z.ZodFirstPartyTypeKind.ZodSymbol:throw new dn(z.ZodFirstPartyTypeKind.ZodSymbol);case z.ZodFirstPartyTypeKind.ZodReadonly:return`${pe(n.description)}z.readonly(${Xe(n.innerType)})`.trim();case z.ZodFirstPartyTypeKind.ZodRef:let D=jt(n.uri);return`${pe(n.description)}z.ref(${D})`.trim();default:be.assertNever(n)}}d(Xe,"sUnwrapZod");var $p=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($p,"ParseInputLazyPath");var Bt=$p,Xc=d((t,e)=>{if(kr(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 $t(t.common.issues);return this._error=n,this._error}}},"handleResult"),Zp=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}dereference(e){return this}getReferences(){return[]}_getType(e){return en(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:en(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new pt,ctx:{common:e.parent.common,data:e.data,parsedType:en(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(bi(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:en(e)},o=this._parseSync({data:e,path:a.path,parent:a});return Xc(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:en(e)},a=this._parse({data:e,path:r.path,parent:r}),o=await(bi(a)?a:Promise.resolve(a));return Xc(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(w({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 vn({schema:this,typeName:"ZodEffects",effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return tn.create(this,this._def)}nullable(){return Gn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Or.create(this,this._def)}promise(){return ua.create(this,this._def)}or(e){return Go.create([this,e],this._def)}and(e){return jo.create(this,e,this._def)}transform(e){return new vn(H(w({},ge(this._def)),{schema:this,typeName:"ZodEffects",effect:{type:"transform",transform:e}}))}default(e){let n=typeof e=="function"?e:()=>e;return new sa(H(w({},ge(this._def)),{innerType:this,defaultValue:n,typeName:"ZodDefault"}))}brand(){return new Do(w({typeName:"ZodBranded",type:this},ge(this._def)))}catch(e){let n=typeof e=="function"?e:()=>e;return new No(H(w({},ge(this._def)),{innerType:this,catchValue:n,typeName:"ZodCatch"}))}describe(e){let n=this.constructor;return new n(H(w({},this._def),{description:e}))}pipe(e){return qo.create(this,e)}readonly(){return ca.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}metadata(e){for(let[n,r]of Object.entries(e))this._def[Ie]=H(w({},this._def[Ie]),{[n]:r});return this}getMetadata(){return w({},this._def[Ie])}setMetadata(e){this._def[Ie]=w({},e)}get ui(){let e=this._getMetadataRoot();return w({},e._def[Ie])}_setZuiMeta(e,n){let r=this._getMetadataRoot();r._def[Ie]=H(w({},r._def[Ie]),{[e]:n})}_getMetadataRoot(){let e=this._def;switch(e.typeName){case"ZodNullable":case"ZodDefault":case"ZodOptional":case"ZodReadonly":return e.innerType;case"ZodEffects":return e.schema;default:return this}}displayAs(e){var n,r,a;return(a=(n=this._def)[r=Ie])!=null||(n[r]={}),this._def[Ie].displayAs=[e.id,e.params],this}title(e){return this._setZuiMeta("title",e),this}hidden(e){let n;return e===void 0?n=!0:typeof e=="function"?n=e.toString():n=e,this._setZuiMeta("hidden",n),this}disabled(e){let n;return e===void 0?n=!0:typeof e=="function"?n=e.toString():n=e,this._setZuiMeta("disabled",n),this}placeholder(e){return this._setZuiMeta("placeholder",e),this}toJsonSchema(e){return Yo(this,e)}toTypescript(e){return hi(this,e)}toTypescriptSchema(){return Ro(this)}async toTypescriptAsync(e){let n=hi(this,H(w({},e),{formatter:void 0}));return e?.formatter&&(n=await e.formatter(n)),n}static fromObject(e,n){return Mr(e,n)}static fromJsonSchema(e){return fa(e)}};d(Zp,"ZodType");var ye=Zp,Lp=(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))(Lp||{}),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")})(be||(be={}));var lo;(t=>{t.mergeShapes=d((e,n)=>w(w({},e),n),"mergeShapes")})(lo||(lo={}));var ne=be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),en=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 ge(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:a}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a,[Ie]:t?.[Ie]}:{errorMap:d((i,s)=>i.code!=="invalid_type"?{message:s.defaultError}:typeof s.data>"u"?{message:r??s.defaultError}:{message:n??s.defaultError},"customMap"),description:a,[Ie]:t?.[Ie]}}d(ge,"processCreateParams");var ko=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=ko,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"]),nw=d(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),vi=class Fp 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 Fp))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(vi,"ZodError");vi.create=d(t=>new vi(t),"create");var $t=vi,Kp=ko;function qp(t){Kp=t}d(qp,"setErrorMap");function Rr(){return Kp}d(Rr,"getErrorMap");var Ti=d(t=>{var e;let{data:n,path:r,errorMaps:a,issueData:o}=t,i=[...r,...o.path||[]],s=H(w({},o),{path:i}),l="",f=a.filter(g=>!!g).slice().reverse();for(let g of f)l=g(s,{data:n,defaultError:l}).message;return H(w({},o),{path:i,message:(e=o.message)!=null?e:l})},"makeIssue"),rw=[];function te(t,e){let n=Ti({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Rr(),ko].filter(r=>!!r)});t.common.issues.push(n)}d(te,"addIssueToContext");var zp=class Gp{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 de;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 Gp.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 de;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(zp,"ParseStatus");var pt=zp,de=Object.freeze({status:"aborted"}),qn=d(t=>({status:"dirty",value:t}),"DIRTY"),ut=d(t=>({status:"valid",value:t}),"OK"),uo=d(t=>t.status==="aborted","isAborted"),co=d(t=>t.status==="dirty","isDirty"),kr=d(t=>t.status==="valid","isValid"),bi=d(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync"),se;(t=>{t.errToObj=d(e=>typeof e=="string"?{message:e}:e||{},"errToObj"),t.toString=d(e=>typeof e=="string"?e:e?.message,"toString")})(se||(se={}));var _i=class Vp extends ye{constructor(){super(...arguments),this._any=!0}_parse(e){return ut(e.data)}isEqual(e){return e instanceof Vp}};d(_i,"ZodAny");_i.create=d(t=>new _i(w({typeName:"ZodAny"},ge(t))),"create");var xi=_i,wi=class $n extends ye{dereference(e){return new $n(H(w({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}isEqual(e){var n,r,a,o,i,s;return e instanceof $n?mn((n=this._def.exactLength)==null?void 0:n.value,(r=e._def.exactLength)==null?void 0:r.value)&&mn((a=this._def.maxLength)==null?void 0:a.value,(o=e._def.maxLength)==null?void 0:o.value)&&mn((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}),de;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 Bt(n,i,n.path,s)))).then(i=>pt.mergeArray(r,i));let o=[...n.data].map((i,s)=>a.type._parseSync(new Bt(n,i,n.path,s)));return pt.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new $n(H(w({},this._def),{minLength:{value:e,message:se.toString(n)}}))}max(e,n){return new $n(H(w({},this._def),{maxLength:{value:e,message:se.toString(n)}}))}length(e,n){return new $n(H(w({},this._def),{exactLength:{value:e,message:se.toString(n)}}))}nonempty(e){return this.min(1,e)}};d(wi,"ZodArray");wi.create=d((t,e)=>new wi(w({type:t,minLength:null,maxLength:null,exactLength:null,typeName:"ZodArray"},ge(e))),"create");var Or=wi,iw={compare:mn},Wp=class{constructor(e=[],n={}){this._options=w(w({},iw),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(Wp,"CustomSet");var tt=Wp,Ei=class ui extends ye{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}),de}let r,a=new pt;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 ui)||this._def.coerce!==e._def.coerce)return!1;let n=new tt(this._def.checks),r=new tt(e._def.checks);return n.isEqual(r)}gte(e,n){return this.setLimit("min",e,!0,se.toString(n))}gt(e,n){return this.setLimit("min",e,!1,se.toString(n))}lte(e,n){return this.setLimit("max",e,!0,se.toString(n))}lt(e,n){return this.setLimit("max",e,!1,se.toString(n))}setLimit(e,n,r,a){return new ui(H(w({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:se.toString(a)}]}))}_addCheck(e){return new ui(H(w({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:se.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:se.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:se.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:se.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:se.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(Ei,"ZodBigInt");Ei.create=d(t=>{var e;return new Ei(w({checks:[],typeName:"ZodBigInt",coerce:(e=t?.coerce)!=null?e:!1},ge(t)))},"create");var Oo=Ei,Bi=class Jp extends ye{_parse(e){if(this._def.coerce&&(e.data=Boolean(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}),de}return ut(e.data)}isEqual(e){return e instanceof Jp?this._def.coerce===e._def.coerce:!1}};d(Bi,"ZodBoolean");Bi.create=d(t=>new Bi(w({typeName:"ZodBoolean",coerce:t?.coerce||!1},ge(t))),"create");var Mo=Bi,aw=Symbol("zod_brand"),Yp=class Xp extends ye{_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 Xp?this._def.type.isEqual(e._def.type):!1}};d(Yp,"ZodBranded");var Do=Yp,Pi=class Qp extends ye{_parse(e){let{ctx:n}=this._processInputParams(e),r=H(w({},n),{common:H(w({},n.common),{issues:[]})}),a=this._def.innerType._parse({data:r.data,path:r.path,parent:w({},r)});return bi(a)?a.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new $t(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new $t(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}isEqual(e){return e instanceof Qp?this._def.innerType.isEqual(e._def.innerType)&&be.compareFunctions(this._def.catchValue,e._def.catchValue):!1}};d(Pi,"ZodCatch");Pi.create=d((t,e)=>new Pi(w({innerType:t,typeName:"ZodCatch",catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},ge(e))),"create");var No=Pi,eg=d((t,e={},n)=>t?xi.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(H(w({code:"custom"},f),{fatal:l}))}}):xi.create(),"custom"),Ii=class fo extends ye{_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}),de}if(isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return te(o,{code:G.invalid_date}),de}let r=new pt,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 fo(H(w({},this._def),{checks:[...this._def.checks,e]}))}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:se.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:se.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 fo))return!1;let n=new tt(this._def.checks),r=new tt(e._def.checks);return n.isEqual(r)&&this._def.coerce===e._def.coerce}};d(Ii,"ZodDate");Ii.create=d(t=>new Ii(w({checks:[],coerce:t?.coerce||!1,typeName:"ZodDate"},ge(t))),"create");var Ho=Ii,Si=class po extends ye{_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 po(H(w({},this._def),{innerType:this._def.innerType.dereference(e)}))}isEqual(e){return e instanceof po?this._def.innerType.isEqual(e._def.innerType)&&mn(this._def.defaultValue(),e._def.defaultValue()):!1}};d(Si,"ZodDefault");Si.create=d((t,e,n)=>new Si(w({innerType:t,typeName:"ZodDefault",defaultValue:typeof e=="function"?e:()=>e},ge(n))),"create");var sa=Si,Kt=d(t=>Array.from(new Set(t)),"unique"),Ut=d(t=>t instanceof $o?Ut(t.schema):t instanceof vn?Ut(t.innerType()):t instanceof Zo?[t.value]:t instanceof er?t.options:t instanceof Lo?be.objectValues(t.enum):t instanceof sa?Ut(t._def.innerType):t instanceof zo?[void 0]:t instanceof Fo?[null]:t instanceof tn?[void 0,...Ut(t.unwrap())]:t instanceof Gn?[null,...Ut(t.unwrap())]:t instanceof Do||t instanceof ca?Ut(t.unwrap()):t instanceof No?Ut(t._def.innerType):[],"getDiscriminator"),tg=class Zn extends ye{dereference(e){let n=this.options.map(a=>a.dereference(e)),r=Zn._getOptionsMap(this.discriminator,n);return new Zn(H(w({},this._def),{options:n,optionsMap:r}))}getReferences(){return Kt(this.options.flatMap(e=>e.getReferences()))}_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}),de;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]}),de)}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=Zn._getOptionsMap(e,n);return new Zn(w({typeName:"ZodDiscriminatedUnion",discriminator:e,options:n,optionsMap:a},ge(r)))}static _getOptionsMap(e,n){let r=new Map;for(let a of n){let o=Ut(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 Zn)||this._def.discriminator!==e._def.discriminator)return!1;let n=d((o,i)=>o.isEqual(i),"compare"),r=new tt(this._def.options,{compare:n}),a=new tt(e._def.options,{compare:n});return r.isEqual(a)}};d(tg,"ZodDiscriminatedUnion");var ng=tg;function la(t,e){return new er(w({values:t,typeName:"ZodEnum"},ge(e)))}d(la,"createZodEnum");var Uo=class ci extends ye{_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}),de}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}),de}return ut(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 ci.create(e,w(w({},this._def),n))}exclude(e,n=this._def){return ci.create(this.options.filter(r=>!e.includes(r)),w(w({},this._def),n))}isEqual(e){if(!(e instanceof ci))return!1;let n=new tt(this._def.values),r=new tt(e._def.values);return n.isEqual(r)}};d(Uo,"ZodEnum");Uo.create=la;var er=Uo,rg=class Ln extends ye{constructor(){super(...arguments),this.validate=this.implement}dereference(e){let n=this._def.args.dereference(e),r=this._def.returns.dereference(e);return new Ln(H(w({},this._def),{args:n,returns:r}))}getReferences(){return Kt([...this._def.args.getReferences(),...this._def.returns.getReferences()])}_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}),de;function r(s,l){return Ti({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Rr(),Qc].filter(f=>!!f),issueData:{code:G.invalid_arguments,argumentsError:l}})}d(r,"makeArgsIssue");function a(s,l){return Ti({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Rr(),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 ua){let s=this;return ut(async function(...l){let f=new $t([]),g=await s._def.args.parseAsync(l,o).catch(m=>{throw f.addIssue(r(l,m)),f}),y=await Reflect.apply(i,this,g);return await s._def.returns._def.type.parseAsync(y,o).catch(m=>{throw f.addIssue(a(y,m)),f})})}else{let s=this;return ut(function(...l){let f=s._def.args.safeParse(l,o);if(!f.success)throw new $t([r(l,f.error)]);let g=Reflect.apply(i,this,f.data),y=s._def.returns.safeParse(g,o);if(!y.success)throw new $t([a(g,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ln(H(w({},this._def),{args:Jn.create(e).rest(Pr.create())}))}returns(e){return new Ln(H(w({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Ln(w({args:e||Jn.create([]).rest(Pr.create()),returns:n||Pr.create(),typeName:"ZodFunction"},ge(r)))}isEqual(e){return e instanceof Ln&&this._def.args.isEqual(e._def.args)&&this._def.returns.isEqual(e._def.returns)}};d(rg,"ZodFunction");var ig=rg;function Ai(t,e){let n=en(t),r=en(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=w(w({},t),e);for(let s of o){let l=Ai(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=Ai(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(Ai,"mergeValues");var Ci=class go extends ye{dereference(e){return new go(H(w({},this._def),{left:this._def.left.dereference(e),right:this._def.right.dereference(e)}))}getReferences(){return Kt([...this._def.left.getReferences(),...this._def.right.getReferences()])}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),a=d((o,i)=>{if(uo(o)||uo(i))return de;let s=Ai(o.value,i.value);return s.valid?((co(o)||co(i))&&n.dirty(),{status:n.value,value:s.data}):(te(r,{code:G.invalid_intersection_types}),de)},"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 go))return!1;let n=d((o,i)=>o.isEqual(i),"compare"),r=new tt([this._def.left,this._def.right],{compare:n}),a=new tt([e._def.left,e._def.right],{compare:n});return r.isEqual(a)}};d(Ci,"ZodIntersection");Ci.create=d((t,e,n)=>new Ci(w({left:t,right:e,typeName:"ZodIntersection"},ge(n))),"create");var jo=Ci,Ri=class ag extends ye{get schema(){return this._def.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 ag?this._def.getter().isEqual(e._def.getter()):!1}};d(Ri,"ZodLazy");Ri.create=d((t,e)=>new Ri(w({getter:t,typeName:"ZodLazy"},ge(e))),"create");var $o=Ri,ki=class og extends ye{_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}),de}return{status:"valid",value:e.data}}get value(){return this._def.value}isEqual(e){return e instanceof og?mn(this._def.value,e._def.value):!1}};d(ki,"ZodLiteral");ki.create=d((t,e)=>new ki(w({value:t,typeName:"ZodLiteral"},ge(e))),"create");var Zo=ki,Oi=class yo extends ye{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 yo(H(w({},this._def),{keyType:n,valueType:r}))}getReferences(){return Kt([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}_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}),de;let a=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,l],f)=>({key:a._parse(new Bt(r,s,r.path,[f,"key"])),value:o._parse(new Bt(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,g=await l.value;if(f.status==="aborted"||g.status==="aborted")return de;(f.status==="dirty"||g.status==="dirty")&&n.dirty(),s.set(f.value,g.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let l of i){let f=l.key,g=l.value;if(f.status==="aborted"||g.status==="aborted")return de;(f.status==="dirty"||g.status==="dirty")&&n.dirty(),s.set(f.value,g.value)}return{status:n.value,value:s}}}isEqual(e){return!(!(e instanceof yo)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};d(Oi,"ZodMap");Oi.create=d((t,e,n)=>new Oi(w({valueType:e,keyType:t,typeName:"ZodMap"},ge(n))),"create");var sg=Oi,Mi=class lg extends ye{_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}),de}return{status:"valid",value:e.data}}isEqual(e){return e instanceof lg}};d(Mi,"ZodNaN");Mi.create=d(t=>new Mi(w({typeName:"ZodNaN"},ge(t))),"create");var ug=Mi,Di=class cg extends ye{_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}),de}if(n.indexOf(e.data)===-1){let a=be.objectValues(n);return te(r,{received:r.data,code:G.invalid_enum_value,options:a}),de}return ut(e.data)}get enum(){return this._def.values}isEqual(e){return e instanceof cg?mn(this._def.values,e._def.values):!1}};d(Di,"ZodNativeEnum");Di.create=d((t,e)=>new Di(w({values:t,typeName:"ZodNativeEnum"},ge(e))),"create");var Lo=Di,Ni=class fg extends ye{_parse(e){let n=this._getOrReturnCtx(e);return te(n,{code:G.invalid_type,expected:ne.never,received:n.parsedType}),de}isEqual(e){return e instanceof fg}};d(Ni,"ZodNever");Ni.create=d(t=>new Ni(w({typeName:"ZodNever"},ge(t))),"create");var hn=Ni,Hi=class dg extends ye{_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}),de}return ut(e.data)}isEqual(e){return e instanceof dg}};d(Hi,"ZodNull");Hi.create=d(t=>new Hi(w({typeName:"ZodNull"},ge(t))),"create");var Fo=Hi,Ui=class mo extends ye{dereference(e){return new mo(H(w({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){return this._getType(e)===ne.null?ut(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof mo?this._def.innerType.isEqual(e._def.innerType):!1}};d(Ui,"ZodNullable");Ui.create=d((t,e)=>new Ui(w({innerType:t,typeName:"ZodNullable"},ge(e))),"create");var Gn=Ui;function pg(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(pg,"floatSafeRemainder");var ji=class fi extends ye{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}),de}let r,a=new pt;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"?pg(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,se.toString(n))}gt(e,n){return this.setLimit("min",e,!1,se.toString(n))}lte(e,n){return this.setLimit("max",e,!0,se.toString(n))}lt(e,n){return this.setLimit("max",e,!1,se.toString(n))}setLimit(e,n,r,a){return new fi(H(w({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:se.toString(a)}]}))}_addCheck(e){return new fi(H(w({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:se.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:se.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:se.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:se.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:se.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:se.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:se.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:se.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:se.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 fi))return!1;let n=new tt(this._def.checks),r=new tt(e._def.checks);return n.isEqual(r)}};d(ji,"ZodNumber");ji.create=d(t=>new ji(w({checks:[],typeName:"ZodNumber",coerce:t?.coerce||!1},ge(t))),"create");var Ko=ji;function yn(t){if(t instanceof Vn){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=tn.create(yn(r))}return new Vn(H(w({},t._def),{shape:d(()=>e,"shape")}))}else return t instanceof Or?new Or(H(w({},t._def),{type:yn(t.element)})):t instanceof tn?tn.create(yn(t.unwrap())):t instanceof Gn?Gn.create(yn(t.unwrap())):t instanceof Jn?Jn.create(t.items.map(e=>yn(e))):t}d(yn,"deepPartialify");var rn=class vt extends ye{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(H(w({},this._def),{shape:d(()=>r,"shape")}))}getReferences(){let e=this._def.shape(),n=[];for(let r in e)n.push(...e[r].getReferences());return Kt(n)}_parse(e){if(this._getType(e)!==ne.object){let f=this._getOrReturnCtx(e);return te(f,{code:G.invalid_type,expected:ne.object,received:f.parsedType}),de}let{status:r,ctx:a}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof hn&&this._def.unknownKeys==="strip"))for(let f in a.data)i.includes(f)||s.push(f);let l=[];for(let f of i){let g=o[f],y=a.data[f];l.push({key:{status:"valid",value:f},value:g._parse(new Bt(a,y,a.path,f)),alwaysSet:f in a.data})}if(this._def.catchall instanceof hn){let f=this._def.unknownKeys;if(f==="passthrough")for(let g of s)l.push({key:{status:"valid",value:g},value:{status:"valid",value:a.data[g]}});else if(f==="strict")s.length>0&&(te(a,{code:G.unrecognized_keys,keys:s}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let g of s){let y=a.data[g];l.push({key:{status:"valid",value:g},value:f._parse(new Bt(a,y,a.path,g)),alwaysSet:g in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let f=[];for(let g of l){let y=await g.key;f.push({key:y,value:await g.value,alwaysSet:g.alwaysSet})}return f}).then(f=>pt.mergeObjectSync(r,f)):pt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return se.errToObj,new vt(w(H(w({},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=se.errToObj(e).message)!=null?s:l}:{message:l}},"errorMap")}:{}))}strip(){return new vt(H(w({},this._def),{unknownKeys:"strip"}))}passthrough(){return new vt(H(w({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new vt(H(w({},this._def),{shape:d(()=>w(w({},this._def.shape()),e),"shape")}))}merge(e){return new vt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:d(()=>w(w({},this._def.shape()),e._def.shape()),"shape"),typeName:"ZodObject"})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new vt(H(w({},this._def),{catchall:e}))}pick(e){let n={};return be.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new vt(H(w({},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(H(w({},this._def),{shape:d(()=>n,"shape")}))}deepPartial(){return yn(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(H(w({},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 tn;)o=o._def.innerType;n[r]=o}}),new vt(H(w({},this._def),{shape:d(()=>n,"shape")}))}keyof(){return la(be.objectKeys(this.shape))}isEqual(e){if(!(e instanceof vt)||!this._def.catchall.isEqual(e._def.catchall)||this._def.unknownKeys!==e._def.unknownKeys)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 tt(Object.entries(n),{compare:a}),i=new tt(Object.entries(r),{compare:a});return o.isEqual(i)}};d(rn,"ZodObject");rn.create=d((t,e)=>new rn(w({shape:d(()=>t,"shape"),unknownKeys:"strip",catchall:hn.create(),typeName:"ZodObject"},ge(e))),"create");rn.strictCreate=d((t,e)=>new rn(w({shape:d(()=>t,"shape"),unknownKeys:"strict",catchall:hn.create(),typeName:"ZodObject"},ge(e))),"strictCreate");rn.lazycreate=d((t,e)=>new rn(w({shape:t,unknownKeys:"strip",catchall:hn.create(),typeName:"ZodObject"},ge(e))),"lazycreate");var Vn=rn,$i=class ho extends ye{dereference(e){return new ho(H(w({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){return this._getType(e)===ne.undefined?ut(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof ho?this._def.innerType.isEqual(e._def.innerType):!1}};d($i,"ZodOptional");$i.create=d((t,e)=>new $i(w({innerType:t,typeName:"ZodOptional"},ge(e))),"create");var tn=$i,gg=class di extends ye{dereference(e){return new di(H(w({},this._def),{in:this._def.in.dereference(e),out:this._def.out.dereference(e)}))}getReferences(){return Kt([...this._def.in.getReferences(),...this._def.out.getReferences()])}_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"?de:o.status==="dirty"?(n.dirty(),qn(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"?de: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 di({in:e,out:n,typeName:"ZodPipeline"})}isEqual(e){return!(!(e instanceof di)||!this._def.in.isEqual(e._def.in)||!this._def.out.isEqual(e._def.out))}};d(gg,"ZodPipeline");var qo=gg,Zi=class vo extends ye{unwrap(){return this._def.type}dereference(e){return new vo(H(w({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}_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}),de;let r=n.parsedType===ne.promise?n.data:Promise.resolve(n.data);return ut(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}isEqual(e){return e instanceof vo?this._def.type.isEqual(e._def.type):!1}};d(Zi,"ZodPromise");Zi.create=d((t,e)=>new Zi(w({type:t,typeName:"ZodPromise"},ge(e))),"create");var ua=Zi,Li=class To extends ye{dereference(e){return new To(H(w({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){let n=this._def.innerType._parse(e);return kr(n)&&(n.value=Object.freeze(n.value)),n}unwrap(){return this._def.innerType}isEqual(e){return e instanceof To?this._def.innerType.isEqual(e._def.innerType):!1}};d(Li,"ZodReadonly");Li.create=d((t,e)=>new Li(w({innerType:t,typeName:"ZodReadonly"},ge(e))),"create");var ca=Li,yg=class _r extends ye{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 _r(H(w({},this._def),{keyType:n,valueType:r}))}getReferences(){return Kt([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}_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}),de;let a=[],o=this._def.keyType,i=this._def.valueType;for(let s in r.data)a.push({key:o._parse(new Bt(r,s,r.path,s)),value:i._parse(new Bt(r,r.data[s],r.path,s))});return r.common.async?pt.mergeObjectAsync(n,a):pt.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof ye?new _r(w({keyType:e,valueType:n,typeName:"ZodRecord"},ge(r))):new _r(w({keyType:ct.create(),valueType:e,typeName:"ZodRecord"},ge(n)))}isEqual(e){return!(!(e instanceof _r)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};d(yg,"ZodRecord");var mg=yg,Fi=class hg extends ye{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}),de}isOptional(){return!1}isNullable(){return!1}isEqual(e){return e instanceof hg?this._def.uri===e._def.uri:!1}};d(Fi,"ZodRef");Fi.create=d(t=>new Fi({typeName:"ZodRef",uri:t}),"create");var vg=Fi,Ki=class xr extends ye{dereference(e){return new xr(H(w({},this._def),{valueType:this._def.valueType.dereference(e)}))}getReferences(){return this._def.valueType.getReferences()}_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}),de;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 g of l){if(g.status==="aborted")return de;g.status==="dirty"&&n.dirty(),f.add(g.value)}return{status:n.value,value:f}}d(i,"finalizeSet");let s=[...r.data.values()].map((l,f)=>o._parse(new Bt(r,l,r.path,f)));return r.common.async?Promise.all(s).then(l=>i(l)):i(s)}min(e,n){return new xr(H(w({},this._def),{minSize:{value:e,message:se.toString(n)}}))}max(e,n){return new xr(H(w({},this._def),{maxSize:{value:e,message:se.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 xr))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(Ki,"ZodSet");Ki.create=d((t,e)=>new Ki(w({valueType:t,minSize:null,maxSize:null,typeName:"ZodSet"},ge(e))),"create");var Tg=Ki,bg=/^c[^\s-]{8,}$/i,_g=/^[a-z][a-z0-9]*$/,xg=/^[0-9A-HJKMNP-TV-Z]{26}$/,wg=/^[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,Eg=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Bg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ow=d(t=>t===Bg,"isEmojiRegex"),Qa,Pg=/^(((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}))$/,Ig=/^(([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})))$/,Sg=d(t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex");function Ag(t,e){return!!((e==="v4"||!e)&&Pg.test(t)||(e==="v6"||!e)&&Ig.test(t))}d(Ag,"isValidIP");var qi=class Fn extends ye{_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}),de}let r=new pt,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")Eg.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")Qa||(Qa=new RegExp(Bg,"u")),Qa.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")wg.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")bg.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")_g.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")xg.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"?Sg(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"?Ag(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),w({validation:n,code:G.invalid_string},se.errToObj(r)))}_addCheck(e){return new Fn(H(w({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(w({kind:"email"},se.errToObj(e)))}url(e){return this._addCheck(w({kind:"url"},se.errToObj(e)))}emoji(e){return this._addCheck(w({kind:"emoji"},se.errToObj(e)))}uuid(e){return this._addCheck(w({kind:"uuid"},se.errToObj(e)))}cuid(e){return this._addCheck(w({kind:"cuid"},se.errToObj(e)))}cuid2(e){return this._addCheck(w({kind:"cuid2"},se.errToObj(e)))}ulid(e){return this._addCheck(w({kind:"ulid"},se.errToObj(e)))}ip(e){return this._addCheck(w({kind:"ip"},se.errToObj(e)))}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck(w({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(n=e?.offset)!=null?n:!1},se.errToObj(e?.message)))}regex(e,n){return this._addCheck(w({kind:"regex",regex:e},se.errToObj(n)))}includes(e,n){return this._addCheck(w({kind:"includes",value:e,position:n?.position},se.errToObj(n?.message)))}startsWith(e,n){return this._addCheck(w({kind:"startsWith",value:e},se.errToObj(n)))}endsWith(e,n){return this._addCheck(w({kind:"endsWith",value:e},se.errToObj(n)))}min(e,n){return this._addCheck(w({kind:"min",value:e},se.errToObj(n)))}max(e,n){return this._addCheck(w({kind:"max",value:e},se.errToObj(n)))}length(e,n){return this._addCheck(w({kind:"length",value:e},se.errToObj(n)))}nonempty(e){return this.min(1,se.errToObj(e))}trim(){return new Fn(H(w({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}secret(){return this._def[Ie]=H(w({},this._def[Ie]),{secret:!0}),this}toLowerCase(){return new Fn(H(w({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new Fn(H(w({},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 Fn))return!1;let n=new tt(this._def.checks),r=new tt(e._def.checks);return n.isEqual(r)}};d(qi,"ZodString");qi.create=d(t=>{var e;return new qi(w({checks:[],typeName:"ZodString",coerce:(e=t?.coerce)!=null?e:!1},ge(t)))},"create");var ct=qi,zi=class Cg extends ye{_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}),de}return ut(e.data)}isEqual(e){return e instanceof Cg}};d(zi,"ZodSymbol");zi.create=d(t=>new zi(w({typeName:"ZodSymbol"},ge(t))),"create");var Rg=zi,Wn=class bo extends ye{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName==="ZodEffects"?this._def.schema.sourceType():this._def.schema}dereference(e){return new bo(H(w({},this._def),{schema:this._def.schema.dereference(e)}))}getReferences(){return this._def.schema.getReferences()}_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 de;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?de:l.status==="dirty"||n.value==="dirty"?qn(l.value):l});{if(n.value==="aborted")return de;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?de:s.status==="dirty"||n.value==="dirty"?qn(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"?de:(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"?de:(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(!kr(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=>kr(i)?Promise.resolve(a.transform(i.value,o)).then(s=>({status:n.value,value:s})):i);be.assertNever(a)}isEqual(e){return!(e instanceof bo)||!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):(be.assertNever(this._def.effect),!1)}};d(Wn,"ZodEffects");Wn.create=d((t,e,n)=>new Wn(w({schema:t,typeName:"ZodEffects",effect:e},ge(n))),"create");Wn.createWithPreprocess=d((t,e,n)=>new Wn(w({schema:e,effect:{type:"preprocess",transform:t},typeName:"ZodEffects"},ge(n))),"createWithPreprocess");var vn=Wn,Gi=class pi extends ye{dereference(e){let n=this._def.items.map(a=>a.dereference(e)),r=this._def.rest?this._def.rest.dereference(e):null;return new pi(H(w({},this._def),{items:n,rest:r}))}getReferences(){return Kt([...this._def.items.flatMap(e=>e.getReferences()),...this._def.rest?this._def.rest.getReferences():[]])}_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}),de;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"}),de;!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 Bt(r,i,r.path,s)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>pt.mergeArray(n,i)):pt.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new pi(H(w({},this._def),{rest:e}))}isEqual(e){if(!(e instanceof pi)||!this._restEquals(e))return!1;let n=d((o,i)=>o.isEqual(i),"compare"),r=new tt(this._def.items,{compare:n}),a=new tt(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(Gi,"ZodTuple");Gi.create=d((t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gi(w({items:t,typeName:"ZodTuple",rest:null},ge(e)))},"create");var Jn=Gi,Vi=class kg extends ye{_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}),de}return ut(e.data)}isEqual(e){return e instanceof kg}};d(Vi,"ZodUndefined");Vi.create=d(t=>new Vi(w({typeName:"ZodUndefined"},ge(t))),"create");var zo=Vi,Wi=class _o extends ye{dereference(e){let n=this._def.options.map(r=>r.dereference(e));return new _o(H(w({},this._def),{options:n}))}getReferences(){return Kt(this._def.options.reduce((e,n)=>[...e,...n.getReferences()],[]))}_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 $t(s.ctx.common.issues));return te(n,{code:G.invalid_union,unionErrors:i}),de}if(d(a,"handleResults"),n.common.async)return Promise.all(r.map(async o=>{let i=H(w({},n),{common:H(w({},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=H(w({},n),{common:H(w({},n.common),{issues:[]}),parent:null}),g=l._parseSync({data:n.data,path:n.path,parent:f});if(g.status==="valid")return g;g.status==="dirty"&&!o&&(o={result:g,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 $t(l));return te(n,{code:G.invalid_union,unionErrors:s}),de}}get options(){return this._def.options}isEqual(e){if(!(e instanceof _o))return!1;let n=d((o,i)=>o.isEqual(i),"compare"),r=new tt([...this._def.options],{compare:n}),a=new tt([...e._def.options],{compare:n});return r.isEqual(a)}};d(Wi,"ZodUnion");Wi.create=d((t,e)=>new Wi(w({options:t,typeName:"ZodUnion"},ge(e))),"create");var Go=Wi,Ji=class Og extends ye{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ut(e.data)}isEqual(e){return e instanceof Og}};d(Ji,"ZodUnknown");Ji.create=d(t=>new Ji(w({typeName:"ZodUnknown"},ge(t))),"create");var Pr=Ji,Yi=class Mg extends ye{_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}),de}return ut(e.data)}isEqual(e){return e instanceof Mg}};d(Yi,"ZodVoid");Yi.create=d(t=>new Yi(w({typeName:"ZodVoid"},ge(t))),"create");var Dg=Yi,sw=/^\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))?$/,Mr=d((t,e,n=!0)=>{if(typeof t!="object")throw new to("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(re.null());else switch(typeof l){case"string":i[s]=sw.test(l)?r(re.string().datetime()):r(re.string());break;case"number":i[s]=r(re.number());break;case"boolean":i[s]=r(re.boolean());break;case"object":Array.isArray(l)?l.length===0?i[s]=r(re.array(re.unknown())):typeof l[0]=="object"?i[s]=r(re.array(Mr(l[0],e,!1))):["string","number","boolean"].includes(typeof l[0])&&(i[s]=r(re.array(re[typeof l[0]]()))):i[s]=r(Mr(l,e,!1));break;default:throw new to(`Unsupported type for key ${s}`)}return i},{}),o=Object.keys(a).length>0;return e?.passtrough||!n&&!o?re.object(a).passthrough():re.object(a)},"objectToZui");function Ng(){return{}}d(Ng,"parseAnyDef");function Vo(t,e,n,r){r?.errorMessages&&n&&(t.errorMessage=H(w({},t.errorMessage),{[e]:n}))}d(Vo,"addErrorMessage");function De(t,e,n,r,a){t[e]=n,Vo(t,e,r,a)}d(De,"setResponseValueAndErrors");function Hg(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=ke(t.type._def,H(w({},e),{currentPath:[...e.currentPath,"items"]}))),t.minLength&&De(a,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&De(a,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(De(a,"minItems",t.exactLength.value,t.exactLength.message,e),De(a,"maxItems",t.exactLength.value,t.exactLength.message,e)),a}d(Hg,"parseArrayDef");function Ug(t,e){let n=w({type:"integer",format:"int64"},t.coerce?{[Ie]:{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?De(n,"minimum",r.value,r.message,e):De(n,"exclusiveMinimum",r.value,r.message,e):(r.inclusive||(n.exclusiveMinimum=!0),De(n,"minimum",r.value,r.message,e));break;case"max":e.target==="jsonSchema7"?r.inclusive?De(n,"maximum",r.value,r.message,e):De(n,"exclusiveMaximum",r.value,r.message,e):(r.inclusive||(n.exclusiveMaximum=!0),De(n,"maximum",r.value,r.message,e));break;case"multipleOf":De(n,"multipleOf",r.value,r.message,e);break}return n}d(Ug,"parseBigintDef");function jg(t){return w({type:"boolean"},t.coerce?{[Ie]:{coerce:t.coerce||void 0}}:{})}d(jg,"parseBooleanDef");function $g(t,e){return ke(t.type._def,e)}d($g,"parseBrandedDef");var lw=d((t,e)=>ke(t.innerType._def,e),"parseCatchDef");function Zg(t,e){return e.dateStrategy=="integer"?uw(t,e):w({type:"string",format:"date-time"},t.coerce?{[Ie]:{coerce:t.coerce||void 0}}:{})}d(Zg,"parseDateDef");var uw=d((t,e)=>{let n=w({type:"integer",format:"unix-time"},t.coerce?{[Ie]:{coerce:t.coerce||void 0}}:{});for(let r of t.checks)switch(r.kind){case"min":e.target==="jsonSchema7"&&De(n,"minimum",r.value,r.message,e);break;case"max":e.target==="jsonSchema7"&&De(n,"maximum",r.value,r.message,e);break}return n},"integerDateParser");function Lg(t,e){return H(w({},ke(t.innerType._def,e)),{default:t.defaultValue()})}d(Lg,"parseDefaultDef");function Fg(t,e){return e.effectStrategy==="input"?ke(t.schema._def,e):{}}d(Fg,"parseEffectsDef");function Kg(t){return{type:"string",enum:t.values}}d(Kg,"parseEnumDef");var cw=d(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"isJsonSchema7AllOfType");function qg(t,e){let n=[ke(t.left._def,H(w({},e),{currentPath:[...e.currentPath,"allOf","0"]})),ke(t.right._def,H(w({},e),{currentPath:[...e.currentPath,"allOf","1"]}))].filter(o=>!!o),r=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,a=[];return n.forEach(o=>{if(cw(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=of(s,["additionalProperties"])}else r=void 0;a.push(i)}}),a.length?w({allOf:a},r):void 0}d(qg,"parseIntersectionDef");function zg(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(zg,"parseLiteralDef");var br={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 Wo(t,e){let n=w({type:"string"},t.coerce?{[Ie]:{coerce:t.coerce||void 0}}:{});function r(a){return e.patternStrategy==="escape"?fw(a):a}if(d(r,"processPattern"),t.checks)for(let a of t.checks)switch(a.kind){case"min":De(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,a.value):a.value,a.message,e);break;case"max":De(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":fn(n,"email",a.message,e);break;case"format:idn-email":fn(n,"idn-email",a.message,e);break;case"pattern:zod":Ht(n,br.email,a.message,e);break}break;case"url":fn(n,"uri",a.message,e);break;case"uuid":fn(n,"uuid",a.message,e);break;case"regex":Ht(n,a.regex.source,a.message,e);break;case"cuid":Ht(n,br.cuid,a.message,e);break;case"cuid2":Ht(n,br.cuid2,a.message,e);break;case"startsWith":Ht(n,"^"+r(a.value),a.message,e);break;case"endsWith":Ht(n,r(a.value)+"$",a.message,e);break;case"datetime":fn(n,"date-time",a.message,e);break;case"length":De(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,a.value):a.value,a.message,e),De(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,a.value):a.value,a.message,e);break;case"includes":{Ht(n,r(a.value),a.message,e);break}case"ip":{a.version!=="v6"&&fn(n,"ipv4",a.message,e),a.version!=="v4"&&fn(n,"ipv6",a.message,e);break}case"emoji":Ht(n,br.emoji,a.message,e);break;case"ulid":{Ht(n,br.ulid,a.message,e);break}case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}d(Wo,"parseStringDef");var fw=d(t=>Array.from(t).map(e=>/[a-zA-Z0-9]/.test(e)?e:`\\${e}`).join(""),"escapeNonAlphaNumeric"),fn=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(w({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(w({format:e},n&&r.errorMessages&&{errorMessage:{format:n}}))):De(t,"format",e,n,r)},"addFormat"),Ht=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(w({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(w({pattern:e},n&&r.errorMessages&&{errorMessage:{pattern:n}}))):De(t,"pattern",e,n,r)},"addPattern");function Jo(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 g;return H(w({},l),{[f]:(g=ke(t.valueType._def,H(w({},e),{currentPath:[...e.currentPath,"properties",f]})))!=null?g:{}})},{}),additionalProperties:!1};let s={type:"object",additionalProperties:(r=ke(t.valueType._def,H(w({},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(Wo(t.keyType._def,e)).reduce((f,[g,y])=>g==="type"?f:H(w({},f),{[g]:y}),{});return H(w({},s),{propertyNames:l})}else if(((i=t.keyType)==null?void 0:i._def.typeName)==="ZodEnum")return H(w({},s),{propertyNames:{enum:t.keyType._def.values}});return s}d(Jo,"parseRecordDef");function Gg(t,e){if(e.mapStrategy==="record")return Jo(t,e);let n=ke(t.keyType._def,H(w({},e),{currentPath:[...e.currentPath,"items","items","0"]}))||{},r=ke(t.valueType._def,H(w({},e),{currentPath:[...e.currentPath,"items","items","1"]}))||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}d(Gg,"parseMapDef");function Vg(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(Vg,"parseNativeEnumDef");function Wg(){return{not:{}}}d(Wg,"parseNeverDef");function Jg(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}d(Jg,"parseNullDef");var Xi={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Yg(t,e){if(e.target==="openApi3")return ef(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in Xi&&(!r._def.checks||!r._def.checks.length))){let r=n.reduce((a,o)=>{let i=Xi[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 ef(t,e)}d(Yg,"parseUnionDef");var ef=d((t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((a,o)=>ke(a._def,H(w({},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"?w({anyOf:n},r):w({oneOf:n},r)},"asUnionOf");function Xg(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Xi[t.innerType._def.typeName],nullable:!0}:{type:[Xi[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let r=ke(t.innerType._def,H(w({},e),{currentPath:[...e.currentPath]}));return r&&H(w({},r),{nullable:!0})}let n=ke(t.innerType._def,H(w({},e),{currentPath:[...e.currentPath,"anyOf","0"]}));return n&&{anyOf:[n,{type:"null"}]}}d(Xg,"parseNullableDef");function Qg(t,e){let n=w({type:"number"},t.coerce?{[Ie]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return n;for(let r of t.checks)switch(r.kind){case"int":n.type="integer",Vo(n,"type",r.message,e);break;case"min":e.target==="jsonSchema7"?r.inclusive?De(n,"minimum",r.value,r.message,e):De(n,"exclusiveMinimum",r.value,r.message,e):(r.inclusive||(n.exclusiveMinimum=!0),De(n,"minimum",r.value,r.message,e));break;case"max":e.target==="jsonSchema7"?r.inclusive?De(n,"maximum",r.value,r.message,e):De(n,"exclusiveMaximum",r.value,r.message,e):(r.inclusive||(n.exclusiveMaximum=!0),De(n,"maximum",r.value,r.message,e));break;case"multipleOf":De(n,"multipleOf",r.value,r.message,e);break}return n}d(Qg,"parseNumberDef");function ey(t,e){var n;let r=H(w({type:"object"},Object.entries(t.shape()).reduce((a,[o,i])=>{if(i===void 0||i._def===void 0)return a;let s=ke(i._def,H(w({},e),{currentPath:[...e.currentPath,"properties",o],propertyPath:[...e.currentPath,"properties",o]}));return s===void 0?a:{properties:H(w({},a.properties),{[o]:s}),required:i.isOptional()?a.required:[...a.required,o]}},{properties:{},required:[]})),{additionalProperties:t.catchall._def.typeName==="ZodNever"?t.unknownKeys==="passthrough":(n=ke(t.catchall._def,H(w({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?n:!0});return r.required.length||delete r.required,r}d(ey,"parseObjectDef");var dw=d((t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return ke(t.innerType._def,e);let r=ke(t.innerType._def,H(w({},e),{currentPath:[...e.currentPath,"anyOf","1"]}));return r?{anyOf:[{not:{}},r]}:{}},"parseOptionalDef"),pw=d((t,e)=>{if(e.pipeStrategy==="input")return ke(t.in._def,e);if(e.pipeStrategy==="output")return ke(t.out._def,e);let n=ke(t.in._def,H(w({},e),{currentPath:[...e.currentPath,"allOf","0"]})),r=ke(t.out._def,H(w({},e),{currentPath:[...e.currentPath,"allOf",n?"1":"0"]}));return{allOf:[n,r].filter(a=>a!==void 0)}},"parsePipelineDef");function ty(t,e){return ke(t.type._def,e)}d(ty,"parsePromiseDef");function ny(t,e){let r={type:"array",uniqueItems:!0,items:ke(t.valueType._def,H(w({},e),{currentPath:[...e.currentPath,"items"]}))};return t.minSize&&De(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&De(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}d(ny,"parseSetDef");function ry(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>ke(n._def,H(w({},e),{currentPath:[...e.currentPath,"items",`${r}`]}))).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:ke(t.rest._def,H(w({},e),{currentPath:[...e.currentPath,"additionalItems"]}))}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>ke(n._def,H(w({},e),{currentPath:[...e.currentPath,"items",`${r}`]}))).reduce((n,r)=>r===void 0?n:[...n,r],[])}}d(ry,"parseTupleDef");function iy(){return{not:{}}}d(iy,"parseUndefinedDef");function ay(){return{}}d(ay,"parseUnknownDef");var gw=d((t,e)=>ke(t.innerType._def,e),"parseReadonlyDef");function oy(t){return{$ref:t.uri}}d(oy,"parseRefDef");function ke(t,e,n=!1){let r=e.seen.get(t);if(r&&!n){let i=yw(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=hw(t,t.typeName,e);return o&&vw(t,e,o),a.jsonSchema=o,o}d(ke,"parseDef");var yw=d((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:mw(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"),mw=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"),hw=d((t,e,n)=>{switch(e){case"ZodString":return Wo(t,n);case"ZodNumber":return Qg(t,n);case"ZodObject":return ey(t,n);case"ZodBigInt":return Ug(t,n);case"ZodBoolean":return jg(t);case"ZodDate":return Zg(t,n);case"ZodUndefined":return iy();case"ZodNull":return Jg(n);case"ZodArray":return Hg(t,n);case"ZodUnion":case"ZodDiscriminatedUnion":return Yg(t,n);case"ZodIntersection":return qg(t,n);case"ZodTuple":return ry(t,n);case"ZodRecord":return Jo(t,n);case"ZodRef":return oy(t);case"ZodLiteral":return zg(t,n);case"ZodEnum":return Kg(t);case"ZodNativeEnum":return Vg(t);case"ZodNullable":return Xg(t,n);case"ZodOptional":return dw(t,n);case"ZodMap":return Gg(t,n);case"ZodSet":return ny(t,n);case"ZodLazy":return ke(t.getter()._def,n);case"ZodPromise":return ty(t,n);case"ZodNaN":case"ZodNever":return Wg();case"ZodEffects":return Fg(t,n);case"ZodAny":return Ng();case"ZodUnknown":return ay();case"ZodDefault":return Lg(t,n);case"ZodBranded":return $g(t,n);case"ZodReadonly":return gw(t,n);case"ZodCatch":return lw(t,n);case"ZodPipeline":return pw(t,n);case"ZodFunction":case"ZodVoid":case"ZodSymbol":return;default:return(r=>{})(e)}},"selectParser"),vw=d((t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),Object.assign(n,{[Ie]:w(w({},t[Ie]),n[Ie])}),n),"addMeta"),tf={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"},Tw=d(t=>typeof t=="string"?H(w({},tf),{name:t}):w(w({},tf),t),"getDefaultOptions"),bw=d(t=>{let e=Tw(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return H(w({},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"),_w=d((t,e)=>{var n;let r=bw(e),a=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[f,g])=>{var y;return H(w({},l),{[f]:(y=ke(g._def,H(w({},r),{currentPath:[...r.basePath,r.definitionPath,f]}),!0))!=null?y:{}})},{}):void 0,o=typeof e=="string"?e:e?.name,i=(n=ke(t._def,o===void 0?r:H(w({},r),{currentPath:[...r.basePath,r.definitionPath,o]}),!1))!=null?n:{},s=o===void 0?a?H(w({},i),{[r.definitionPath]:a}):i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:H(w({},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"),Yo=d((t,e={target:"openApi3"})=>{let n=_w(t,e);return e.$schemaUrl===!1?delete n.$schema:typeof e.$schemaUrl=="string"&&(n.$schema=e.$schemaUrl),n},"zuiToJsonSchema"),xw=["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"],qA=er.create(["any","string","number","boolean","object","pattern","date","array","target","time","enum"]),ww=d(t=>ct.create().displayAs({id:"variable",params:w({type:t?.type||"any"},t?.params)}),"variable"),Ew=d(t=>ct.create().displayAs({id:"conversation",params:w({},t?.params)}),"conversation"),Bw=d(t=>ct.create().displayAs({id:"user",params:w({},t?.params)}),"user"),Pw=d(t=>ct.create().displayAs({id:"message",params:w({},t?.params)}),"message"),Iw=d(t=>ct.create().displayAs({id:"agent",params:w({},t?.params)}),"agent"),Sw=d(t=>ct.create().displayAs({id:"event",params:w({},t?.params)}),"event"),Aw=d(t=>ct.create().displayAs({id:"table",params:w({},t?.params)}),"table"),Cw=d(t=>ct.create().displayAs({id:"tablerow",params:w({},t?.params)}),"tablerow"),Rw=d(t=>ct.create().displayAs({id:"intent",params:w({},t?.params)}),"intent"),kw=d(()=>er.create(xw).displayAs({id:"dropdown",params:{}}),"aimodel"),Ow=d(t=>ct.create().displayAs({id:"datasource",params:w({},t)}),"datasource"),Mw=d(t=>ct.create().displayAs({id:"knowledgebase",params:w({},t)}),"knowledgebase"),Dw={object:Vn.lazycreate},Nw=d((t,e={message:`Input not instance of ${t.name}`})=>eg(n=>n instanceof t,e),"instanceOfType"),sy=ct.create,ly=Ko.create,Hw=ug.create,Uw=Oo.create,uy=Mo.create,jw=Ho.create,$w=Rg.create,Zw=zo.create,Lw=Fo.create,Fw=xi.create,Kw=Pr.create,qw=hn.create,zw=Dg.create,Gw=Or.create,Vw=Vn.create,Ww=Vn.strictCreate,Jw=Go.create,Yw=ng.create,Xw=jo.create,Qw=Jn.create,eE=mg.create,tE=vg.create,nE=ca.create,rE=sg.create,iE=Tg.create,aE=ig.create,oE=$o.create,sE=Zo.create,lE=er.create,uE=Lo.create,cE=ua.create,nf=vn.create,fE=tn.create,dE=Gn.create,pE=sa.create,gE=vn.createWithPreprocess,yE=qo.create,mE=d(()=>sy().optional(),"ostring"),hE=d(()=>ly().optional(),"onumber"),vE=d(()=>uy().optional(),"oboolean"),TE=ye.fromJsonSchema,bE=ye.fromObject,_E={string:d(t=>ct.create(H(w({},t),{coerce:!0})),"string"),number:d(t=>Ko.create(H(w({},t),{coerce:!0})),"number"),boolean:d(t=>Mo.create(H(w({},t),{coerce:!0})),"boolean"),bigint:d(t=>Oo.create(H(w({},t),{coerce:!0})),"bigint"),date:d(t=>Ho.create(H(w({},t),{coerce:!0})),"date")},xE=de,z=re,cy=d((t,e)=>t.anyOf.length?t.anyOf.length===1?nt(t.anyOf[0],H(w({},e),{path:[...e.path,"anyOf",0]})):`z.union([${t.anyOf.map((n,r)=>nt(n,H(w({},e),{path:[...e.path,"anyOf",r]}))).join(", ")}])`:"z.any()","parseAnyOf"),wE=d(t=>{var e;return(e=t[Ie])!=null&&e.coerce?"z.coerce.boolean()":"z.boolean()"},"parseBoolean"),EE=d(t=>"z.any()","parseDefault"),BE=d((t,e)=>`z.union([${t.type.map(n=>nt(H(w({},t),{type:n}),e)).join(", ")}])`,"parseMultipleType"),PE=d((t,e)=>`z.any().refine((value) => !${nt(t.not,H(w({},e),{path:[...e.path,"not"]}))}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`,"parseNot"),IE=d(t=>"z.null()","parseNull"),SE=d(t=>[t.slice(0,t.length/2),t.slice(t.length/2)],"half"),AE=d((t,...e)=>Object.keys(t).reduce((n,r)=>(e.includes(r)||(n[r]=t[r]),n),{}),"omit");function ot(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(ot,"withMessage");var wr=Symbol("Original index"),CE=d(t=>{let e=[];for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="boolean")e.push(r?{[wr]:n}:{[wr]:n,not:{}});else{if(wr in r)return t;e.push(H(w({},r),{[wr]:n}))}}return e},"ensureOriginalIndex");function Dr(t,e){if(t.allOf.length===0)return"z.never()";if(t.allOf.length===1){let n=t.allOf[0];return nt(n,H(w({},e),{path:[...e.path,"allOf",n[wr]]}))}else{let[n,r]=SE(CE(t.allOf));return`z.intersection(${Dr({allOf:n},e)}, ${Dr({allOf:r},e)})`}}d(Dr,"parseAllOf");var RE=d((t,e)=>{if(Array.isArray(t.items))return`z.tuple([${t.items.map((r,a)=>nt(r,H(w({},e),{path:[...e.path,"items",a]})))}])`;let n=t.items?`z.array(${nt(t.items,H(w({},e),{path:[...e.path,"items"]}))})`:"z.array(z.any())";return n+=ot(t,"minItems",({json:r})=>[`.min(${r}`,", ",")"]),n+=ot(t,"maxItems",({json:r})=>[`.max(${r}`,", ",")"]),n},"parseArray"),kE=d(t=>`z.literal(${JSON.stringify(t.const)})`,"parseConst"),OE=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"),ME=d((t,e)=>{let n=nt(t.if,H(w({},e),{path:[...e.path,"if"]})),r=nt(t.then,H(w({},e),{path:[...e.path,"then"]})),a=nt(t.else,H(w({},e),{path:[...e.path,"else"]}));return`z.union([${r}, ${a}]).superRefine((value,ctx) => {
17
+ */`},"getMultilineComment"),Pf={};pf(Pf,{JsonSchemaToZuiError:()=>If,ObjectToZuiError:()=>la,UnrepresentableGenericError:()=>ua,UnsupportedZuiToJsonSchemaError:()=>gT,UnsupportedZuiToTypescriptSchemaError:()=>yn,UnsupportedZuiToTypescriptTypeError:()=>jf,UntitledDeclarationError:()=>Zf,ZuiToJsonSchemaError:()=>Rf,ZuiToTypescriptSchemaError:()=>Df,ZuiToTypescriptTypeError:()=>io,ZuiTransformError:()=>tr});var kf=class extends Error{constructor(e,n){super(n),this.transform=e}};p(kf,"ZuiTransformError");var tr=kf,Sf=class extends tr{constructor(e){super("json-schema-to-zui",e)}};p(Sf,"JsonSchemaToZuiError");var If=Sf,Cf=class extends tr{constructor(e){super("object-to-zui",e)}};p(Cf,"ObjectToZuiError");var la=Cf,Af=class extends tr{constructor(e){super("zui-to-json-schema",e)}};p(Af,"ZuiToJsonSchemaError");var Rf=Af,Of=class extends Rf{constructor(e){super(`Zod type ${e} cannot be transformed to JSON Schema.`)}};p(Of,"UnsupportedZuiToJsonSchemaError");var gT=Of,Mf=class extends tr{constructor(e){super("zui-to-typescript-schema",e)}};p(Mf,"ZuiToTypescriptSchemaError");var Df=Mf,Nf=class extends Df{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript schema.`)}};p(Nf,"UnsupportedZuiToTypescriptSchemaError");var yn=Nf,Uf=class extends tr{constructor(e){super("zui-to-typescript-type",e)}};p(Uf,"ZuiToTypescriptTypeError");var io=Uf,Hf=class extends io{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript type.`)}};p(Hf,"UnsupportedZuiToTypescriptTypeError");var jf=Hf,$f=class extends io{constructor(){super("Schema must have a title to be transformed to a TypeScript type with a declaration.")}};p($f,"UntitledDeclarationError");var Zf=$f,Lf=class extends io{constructor(){super('ZodRef can only be transformed to a TypeScript type with a "type" declaration.')}};p(Lf,"UnrepresentableGenericError");var ua=Lf,Ff=["string","number","boolean","unknown","void","any","null","undefined","never","bigint","symbol","object"],yT=p(t=>Ff.includes(t),"isPrimitive"),mT=p(t=>Ff.map(e=>`${e}[]`).includes(t),"isArrayOfPrimitives"),Ac=p(t=>t.replace(/ +/g," ").trim(),"stripSpaces"),Kf=class{constructor(e,n,r=!1){this.key=e,this.value=n,this.optional=r}};p(Kf,"KeyValue");var ui=Kf,Wf=class{constructor(e){this.schema=e}};p(Wf,"FnParameters");var Rc=Wf,qf=class{constructor(e){this.schema=e}};p(qf,"FnReturn");var Oc=qf,zf=class{constructor(e){this.props=e}};p(zf,"Declaration");var fi=zf;function bi(t,e={}){let n=TT(t,e),r=Ae(n,{});return e.formatter&&(r=e.formatter(r)),r}p(bi,"toTypescript");function Ae(t,e){var n,r,o;let a=U(x({},e),{parent:t});if(t===null)return"";if(t instanceof fi)return hT(t,a);if(t instanceof ui){if(t.value instanceof q.ZodOptional){let m=t.value._def.innerType;return m instanceof q.Schema&&!m.description&&t.value.description&&(m=m?.describe(t.value.description)),Ae(new ui(t.key,m,!0),a)}let l=pe(t.value._def.description),f=l?.trim().length>0?`
18
+ `:"",d=t.value.describe(""),g=t.optional||t.value.isOptional()?"?":"";return`${f}${l}${f}${t.key}${g}: ${Ae(d,a)}${f}`}if(t instanceof Rc){if(t.schema instanceof q.ZodTuple){let d="";for(let y=0;y<t.schema.items.length;y++){let g=(o=(r=(n=t.schema.items[y])==null?void 0:n.ui)==null?void 0:r.title)!=null?o:`arg${y}`,m=t.schema.items[y];d+=`${Ae(new ui(Cc(g),m),a)}${y<t.schema.items.length-1?", ":""} `}return d}let l=Ae(t.schema,a);return l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")||l.startsWith("(")&&l.endsWith(")")||l.startsWith("Array<")&&l.endsWith(">")||l.startsWith("Record<")&&l.endsWith(">")||mT(l)?`args: ${l}`:l}if(t instanceof Oc)return t.schema instanceof q.ZodOptional?`${Ae(t.schema.unwrap(),a)} | undefined`:Ae(t.schema,a);let s=t._def;switch(s.typeName){case q.ZodFirstPartyTypeKind.ZodString:return`${pe(s.description)} string`.trim();case q.ZodFirstPartyTypeKind.ZodNumber:case q.ZodFirstPartyTypeKind.ZodNaN:case q.ZodFirstPartyTypeKind.ZodBigInt:return`${pe(s.description)} number`.trim();case q.ZodFirstPartyTypeKind.ZodBoolean:return`${pe(t._def.description)} boolean`.trim();case q.ZodFirstPartyTypeKind.ZodDate:return`${pe(s.description)} Date`.trim();case q.ZodFirstPartyTypeKind.ZodUndefined:return`${pe(s.description)} undefined`.trim();case q.ZodFirstPartyTypeKind.ZodNull:return`${pe(s.description)} null`.trim();case q.ZodFirstPartyTypeKind.ZodAny:return`${pe(s.description)} any`.trim();case q.ZodFirstPartyTypeKind.ZodUnknown:return`${pe(s.description)} unknown`.trim();case q.ZodFirstPartyTypeKind.ZodNever:return`${pe(s.description)} never`.trim();case q.ZodFirstPartyTypeKind.ZodVoid:return`${pe(s.description)} void`.trim();case q.ZodFirstPartyTypeKind.ZodArray:let l=Ae(s.type,a);return yT(l)?`${l}[]`:`Array<${l}>`;case q.ZodFirstPartyTypeKind.ZodObject:return`{ ${Object.entries(s.shape()).map(([P,M])=>Ae(new ui(Cc(P),M),a)).join("; ")} }`;case q.ZodFirstPartyTypeKind.ZodUnion:let d=s.options.map(P=>Ae(P,a));return`${pe(s.description)}
19
+ ${d.join(" | ")}`;case q.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let y=s.options.map(P=>Ae(P,a));return`${pe(t._def.description)}
20
+ ${y.join(" | ")}`;case q.ZodFirstPartyTypeKind.ZodIntersection:return`${Ae(s.left,a)} & ${Ae(s.right,a)}`;case q.ZodFirstPartyTypeKind.ZodTuple:return s.items.length===0?"":`[${s.items.map(P=>Ae(P,a)).join(", ")}]`;case q.ZodFirstPartyTypeKind.ZodRecord:let m=Ae(s.keyType,a),v=Ae(s.valueType,a);return`${pe(s.description)} { [key: ${m}]: ${v} }`;case q.ZodFirstPartyTypeKind.ZodMap:return`Map<${Ae(s.keyType,a)}, ${Ae(s.valueType,a)}>`;case q.ZodFirstPartyTypeKind.ZodSet:return`Set<${Ae(s.valueType,a)}>`;case q.ZodFirstPartyTypeKind.ZodFunction:let B=Ae(new Rc(s.args),a),E=Ae(new Oc(s.returns),a);return`${pe(s.description)}
21
+ (${B}) => ${E}`;case q.ZodFirstPartyTypeKind.ZodLazy:return Ae(s.getter(),a);case q.ZodFirstPartyTypeKind.ZodLiteral:let T=xf(s.value);return`${pe(s.description)}
22
+ ${T}`.trim();case q.ZodFirstPartyTypeKind.ZodEnum:return s.values.map(jt).join(" | ");case q.ZodFirstPartyTypeKind.ZodEffects:return Ae(s.schema,a);case q.ZodFirstPartyTypeKind.ZodNativeEnum:throw new jf(q.ZodFirstPartyTypeKind.ZodNativeEnum);case q.ZodFirstPartyTypeKind.ZodOptional:return`${Ae(s.innerType,a)} | undefined`;case q.ZodFirstPartyTypeKind.ZodNullable:return`${Ae(s.innerType,a)} | null`;case q.ZodFirstPartyTypeKind.ZodDefault:return Ae(s.innerType,a);case q.ZodFirstPartyTypeKind.ZodCatch:return Ae(s.innerType,a);case q.ZodFirstPartyTypeKind.ZodPromise:return`Promise<${Ae(s.type,a)}>`;case q.ZodFirstPartyTypeKind.ZodBranded:return Ae(s.type,a);case q.ZodFirstPartyTypeKind.ZodPipeline:return Ae(s.in,a);case q.ZodFirstPartyTypeKind.ZodSymbol:return`${pe(s.description)} symbol`.trim();case q.ZodFirstPartyTypeKind.ZodReadonly:return`Readonly<${Ae(s.innerType,a)}>`;case q.ZodFirstPartyTypeKind.ZodRef:return Ef(s.uri);default:_e.assertNever(s)}}p(Ae,"sUnwrapZod");var hT=p((t,e)=>{if(t.props.type==="none")return Ae(t.props.schema,e);let n=pe(t.props.schema.description),r=t.props.schema.describe(""),o=Ae(r,e);if(t.props.type==="variable")return Ac(`${n}declare const ${t.props.identifier}: ${o};`);let a=t.props.args.length>0?`<${t.props.args.map(Ef).join(", ")}>`:"";return Ac(`${n}type ${t.props.identifier}${a} = ${o};`)},"unwrapDeclaration"),vT=p(t=>t.declaration?t.declaration===!0?"variable":t.declaration:"none","getDeclarationType"),TT=p((t,e)=>{let n=vT(e),r=t.getReferences();if(n==="none"){if(r.length>0)throw new ua;return new fi({type:"none",schema:t})}let o="title"in t.ui?t.ui.title:null;if(!o)throw new Zf;if(n==="variable"){if(r.length>0)throw new ua;return new fi({type:"variable",identifier:o,schema:t})}return new fi({type:"type",identifier:o,schema:t,args:r})},"getDeclarationProps"),_T=typeof global=="object"&&global&&global.Object===Object&&global,Gf=_T,bT=typeof self=="object"&&self&&self.Object===Object&&self,wT=Gf||bT||Function("return this")(),Ft=wT,xT=Ft.Symbol,rn=xT,Vf=Object.prototype,BT=Vf.hasOwnProperty,ET=Vf.toString,xr=rn?rn.toStringTag:void 0;function Jf(t){var e=BT.call(t,xr),n=t[xr];try{t[xr]=void 0;var r=!0}catch{}var o=ET.call(t);return r&&(e?t[xr]=n:delete t[xr]),o}p(Jf,"getRawTag");var PT=Jf,kT=Object.prototype,ST=kT.toString;function Yf(t){return ST.call(t)}p(Yf,"objectToString");var IT=Yf,CT="[object Null]",AT="[object Undefined]",Mc=rn?rn.toStringTag:void 0;function Xf(t){return t==null?t===void 0?AT:CT:Mc&&Mc in Object(t)?PT(t):IT(t)}p(Xf,"baseGetTag");var nr=Xf;function Qf(t){return t!=null&&typeof t=="object"}p(Qf,"isObjectLike");var Vn=Qf,RT="[object Symbol]";function ed(t){return typeof t=="symbol"||Vn(t)&&nr(t)==RT}p(ed,"isSymbol");var Ia=ed;function td(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}p(td,"arrayMap");var OT=td,MT=Array.isArray,Lt=MT,DT=1/0,Dc=rn?rn.prototype:void 0,Nc=Dc?Dc.toString:void 0;function Ca(t){if(typeof t=="string")return t;if(Lt(t))return OT(t,Ca)+"";if(Ia(t))return Nc?Nc.call(t):"";var e=t+"";return e=="0"&&1/t==-DT?"-0":e}p(Ca,"baseToString");var NT=Ca;function nd(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}p(nd,"isObject");var Aa=nd;function rd(t){return t}p(rd,"identity");var UT=rd,HT="[object AsyncFunction]",jT="[object Function]",$T="[object GeneratorFunction]",ZT="[object Proxy]";function id(t){if(!Aa(t))return!1;var e=nr(t);return e==jT||e==$T||e==HT||e==ZT}p(id,"isFunction");var od=id,LT=Ft["__core-js_shared__"],ra=LT,Uc=function(){var t=/[^.]+$/.exec(ra&&ra.keys&&ra.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ad(t){return!!Uc&&Uc in t}p(ad,"isMasked");var FT=ad,KT=Function.prototype,WT=KT.toString;function sd(t){if(t!=null){try{return WT.call(t)}catch{}try{return t+""}catch{}}return""}p(sd,"toSource");var wn=sd,qT=/[\\^$.*+?()[\]{}|]/g,zT=/^\[object .+?Constructor\]$/,GT=Function.prototype,VT=Object.prototype,JT=GT.toString,YT=VT.hasOwnProperty,XT=RegExp("^"+JT.call(YT).replace(qT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ld(t){if(!Aa(t)||FT(t))return!1;var e=od(t)?XT:zT;return e.test(wn(t))}p(ld,"baseIsNative");var QT=ld;function ud(t,e){return t?.[e]}p(ud,"getValue");var e_=ud;function cd(t,e){var n=e_(t,e);return QT(n)?n:void 0}p(cd,"getNative");var xn=cd,t_=xn(Ft,"WeakMap"),ca=t_,n_=function(){try{var t=xn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Hc=n_,r_=9007199254740991,i_=/^(?:0|[1-9]\d*)$/;function fd(t,e){var n=typeof t;return e=e??r_,!!e&&(n=="number"||n!="symbol"&&i_.test(t))&&t>-1&&t%1==0&&t<e}p(fd,"isIndex");var dd=fd;function pd(t,e,n){e=="__proto__"&&Hc?Hc(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}p(pd,"baseAssignValue");var o_=pd;function gd(t,e){return t===e||t!==t&&e!==e}p(gd,"eq");var yd=gd,a_=9007199254740991;function md(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=a_}p(md,"isLength");var Ra=md;function hd(t){return t!=null&&Ra(t.length)&&!od(t)}p(hd,"isArrayLike");var s_=hd,l_=Object.prototype;function vd(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||l_;return t===n}p(vd,"isPrototype");var u_=vd;function Td(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}p(Td,"baseTimes");var c_=Td,f_="[object Arguments]";function _d(t){return Vn(t)&&nr(t)==f_}p(_d,"baseIsArguments");var jc=_d,bd=Object.prototype,d_=bd.hasOwnProperty,p_=bd.propertyIsEnumerable,g_=jc(function(){return arguments}())?jc:function(t){return Vn(t)&&d_.call(t,"callee")&&!p_.call(t,"callee")},wd=g_;function xd(){return!1}p(xd,"stubFalse");var y_=xd,Bd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$c=Bd&&typeof module=="object"&&module&&!module.nodeType&&module,m_=$c&&$c.exports===Bd,Zc=m_?Ft.Buffer:void 0,h_=Zc?Zc.isBuffer:void 0,v_=h_||y_,fa=v_,T_="[object Arguments]",__="[object Array]",b_="[object Boolean]",w_="[object Date]",x_="[object Error]",B_="[object Function]",E_="[object Map]",P_="[object Number]",k_="[object Object]",S_="[object RegExp]",I_="[object Set]",C_="[object String]",A_="[object WeakMap]",R_="[object ArrayBuffer]",O_="[object DataView]",M_="[object Float32Array]",D_="[object Float64Array]",N_="[object Int8Array]",U_="[object Int16Array]",H_="[object Int32Array]",j_="[object Uint8Array]",$_="[object Uint8ClampedArray]",Z_="[object Uint16Array]",L_="[object Uint32Array]",Le={};Le[M_]=Le[D_]=Le[N_]=Le[U_]=Le[H_]=Le[j_]=Le[$_]=Le[Z_]=Le[L_]=!0;Le[T_]=Le[__]=Le[R_]=Le[b_]=Le[O_]=Le[w_]=Le[x_]=Le[B_]=Le[E_]=Le[P_]=Le[k_]=Le[S_]=Le[I_]=Le[C_]=Le[A_]=!1;function Ed(t){return Vn(t)&&Ra(t.length)&&!!Le[nr(t)]}p(Ed,"baseIsTypedArray");var F_=Ed;function Pd(t){return function(e){return t(e)}}p(Pd,"baseUnary");var K_=Pd,kd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ir=kd&&typeof module=="object"&&module&&!module.nodeType&&module,W_=Ir&&Ir.exports===kd,ia=W_&&Gf.process,q_=function(){try{var t=Ir&&Ir.require&&Ir.require("util").types;return t||ia&&ia.binding&&ia.binding("util")}catch{}}(),Lc=q_,Fc=Lc&&Lc.isTypedArray,z_=Fc?K_(Fc):F_,Sd=z_,G_=Object.prototype,V_=G_.hasOwnProperty;function Id(t,e){var n=Lt(t),r=!n&&wd(t),o=!n&&!r&&fa(t),a=!n&&!r&&!o&&Sd(t),i=n||r||o||a,s=i?c_(t.length,String):[],l=s.length;for(var f in t)(e||V_.call(t,f))&&!(i&&(f=="length"||o&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||dd(f,l)))&&s.push(f);return s}p(Id,"arrayLikeKeys");var J_=Id;function Cd(t,e){return function(n){return t(e(n))}}p(Cd,"overArg");var Y_=Cd,X_=Y_(Object.keys,Object),Q_=X_,eb=Object.prototype,tb=eb.hasOwnProperty;function Ad(t){if(!u_(t))return Q_(t);var e=[];for(var n in Object(t))tb.call(t,n)&&n!="constructor"&&e.push(n);return e}p(Ad,"baseKeys");var nb=Ad;function Rd(t){return s_(t)?J_(t):nb(t)}p(Rd,"keys");var Oa=Rd,rb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ib=/^\w*$/;function Od(t,e){if(Lt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Ia(t)?!0:ib.test(t)||!rb.test(t)||e!=null&&t in Object(e)}p(Od,"isKey");var Ma=Od,ob=xn(Object,"create"),Rr=ob;function Md(){this.__data__=Rr?Rr(null):{},this.size=0}p(Md,"hashClear");var ab=Md;function Dd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}p(Dd,"hashDelete");var sb=Dd,lb="__lodash_hash_undefined__",ub=Object.prototype,cb=ub.hasOwnProperty;function Nd(t){var e=this.__data__;if(Rr){var n=e[t];return n===lb?void 0:n}return cb.call(e,t)?e[t]:void 0}p(Nd,"hashGet");var fb=Nd,db=Object.prototype,pb=db.hasOwnProperty;function Ud(t){var e=this.__data__;return Rr?e[t]!==void 0:pb.call(e,t)}p(Ud,"hashHas");var gb=Ud,yb="__lodash_hash_undefined__";function Hd(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Rr&&e===void 0?yb:e,this}p(Hd,"hashSet");var mb=Hd;function Bn(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])}}p(Bn,"Hash");Bn.prototype.clear=ab;Bn.prototype.delete=sb;Bn.prototype.get=fb;Bn.prototype.has=gb;Bn.prototype.set=mb;var Kc=Bn;function jd(){this.__data__=[],this.size=0}p(jd,"listCacheClear");var hb=jd;function $d(t,e){for(var n=t.length;n--;)if(yd(t[n][0],e))return n;return-1}p($d,"assocIndexOf");var oo=$d,vb=Array.prototype,Tb=vb.splice;function Zd(t){var e=this.__data__,n=oo(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}p(Zd,"listCacheDelete");var _b=Zd;function Ld(t){var e=this.__data__,n=oo(e,t);return n<0?void 0:e[n][1]}p(Ld,"listCacheGet");var bb=Ld;function Fd(t){return oo(this.__data__,t)>-1}p(Fd,"listCacheHas");var wb=Fd;function Kd(t,e){var n=this.__data__,r=oo(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}p(Kd,"listCacheSet");var xb=Kd;function En(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])}}p(En,"ListCache");En.prototype.clear=hb;En.prototype.delete=_b;En.prototype.get=bb;En.prototype.has=wb;En.prototype.set=xb;var ao=En,Bb=xn(Ft,"Map"),Or=Bb;function Wd(){this.size=0,this.__data__={hash:new Kc,map:new(Or||ao),string:new Kc}}p(Wd,"mapCacheClear");var Eb=Wd;function qd(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}p(qd,"isKeyable");var Pb=qd;function zd(t,e){var n=t.__data__;return Pb(e)?n[typeof e=="string"?"string":"hash"]:n.map}p(zd,"getMapData");var so=zd;function Gd(t){var e=so(this,t).delete(t);return this.size-=e?1:0,e}p(Gd,"mapCacheDelete");var kb=Gd;function Vd(t){return so(this,t).get(t)}p(Vd,"mapCacheGet");var Sb=Vd;function Jd(t){return so(this,t).has(t)}p(Jd,"mapCacheHas");var Ib=Jd;function Yd(t,e){var n=so(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}p(Yd,"mapCacheSet");var Cb=Yd;function Pn(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])}}p(Pn,"MapCache");Pn.prototype.clear=Eb;Pn.prototype.delete=kb;Pn.prototype.get=Sb;Pn.prototype.has=Ib;Pn.prototype.set=Cb;var lo=Pn,Ab="Expected a function";function uo(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Ab);var n=p(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(uo.Cache||lo),n}p(uo,"memoize");uo.Cache=lo;var Rb=uo,Ob=500;function Xd(t){var e=Rb(t,function(r){return n.size===Ob&&n.clear(),r}),n=e.cache;return e}p(Xd,"memoizeCapped");var Mb=Xd,Db=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nb=/\\(\\)?/g,Ub=Mb(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Db,function(n,r,o,a){e.push(o?a.replace(Nb,"$1"):r||n)}),e}),Hb=Ub;function Qd(t){return t==null?"":NT(t)}p(Qd,"toString");var jb=Qd;function ep(t,e){return Lt(t)?t:Ma(t,e)?[t]:Hb(jb(t))}p(ep,"castPath");var tp=ep,$b=1/0;function np(t){if(typeof t=="string"||Ia(t))return t;var e=t+"";return e=="0"&&1/t==-$b?"-0":e}p(np,"toKey");var co=np;function rp(t,e){e=tp(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[co(e[n++])];return n&&n==r?t:void 0}p(rp,"baseGet");var ip=rp;function op(t,e,n){var r=t==null?void 0:ip(t,e);return r===void 0?n:r}p(op,"get");var Zb=op;function ap(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}p(ap,"arrayPush");var Lb=ap;function sp(){this.__data__=new ao,this.size=0}p(sp,"stackClear");var Fb=sp;function lp(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}p(lp,"stackDelete");var Kb=lp;function up(t){return this.__data__.get(t)}p(up,"stackGet");var Wb=up;function cp(t){return this.__data__.has(t)}p(cp,"stackHas");var qb=cp,zb=200;function fp(t,e){var n=this.__data__;if(n instanceof ao){var r=n.__data__;if(!Or||r.length<zb-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new lo(r)}return n.set(t,e),this.size=n.size,this}p(fp,"stackSet");var Gb=fp;function kn(t){var e=this.__data__=new ao(t);this.size=e.size}p(kn,"Stack");kn.prototype.clear=Fb;kn.prototype.delete=Kb;kn.prototype.get=Wb;kn.prototype.has=qb;kn.prototype.set=Gb;var di=kn;function dp(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}p(dp,"arrayFilter");var Vb=dp;function pp(){return[]}p(pp,"stubArray");var Jb=pp,Yb=Object.prototype,Xb=Yb.propertyIsEnumerable,Wc=Object.getOwnPropertySymbols,Qb=Wc?function(t){return t==null?[]:(t=Object(t),Vb(Wc(t),function(e){return Xb.call(t,e)}))}:Jb,ew=Qb;function gp(t,e,n){var r=e(t);return Lt(t)?r:Lb(r,n(t))}p(gp,"baseGetAllKeys");var tw=gp;function yp(t){return tw(t,Oa,ew)}p(yp,"getAllKeys");var qc=yp,nw=xn(Ft,"DataView"),da=nw,rw=xn(Ft,"Promise"),pa=rw,iw=xn(Ft,"Set"),ga=iw,zc="[object Map]",ow="[object Object]",Gc="[object Promise]",Vc="[object Set]",Jc="[object WeakMap]",Yc="[object DataView]",aw=wn(da),sw=wn(Or),lw=wn(pa),uw=wn(ga),cw=wn(ca),mn=nr;(da&&mn(new da(new ArrayBuffer(1)))!=Yc||Or&&mn(new Or)!=zc||pa&&mn(pa.resolve())!=Gc||ga&&mn(new ga)!=Vc||ca&&mn(new ca)!=Jc)&&(mn=p(function(t){var e=nr(t),n=e==ow?t.constructor:void 0,r=n?wn(n):"";if(r)switch(r){case aw:return Yc;case sw:return zc;case lw:return Gc;case uw:return Vc;case cw:return Jc}return e},"getTag"));var Xc=mn,fw=Ft.Uint8Array,Qc=fw,dw="__lodash_hash_undefined__";function mp(t){return this.__data__.set(t,dw),this}p(mp,"setCacheAdd");var pw=mp;function hp(t){return this.__data__.has(t)}p(hp,"setCacheHas");var gw=hp;function Mr(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new lo;++e<n;)this.add(t[e])}p(Mr,"SetCache");Mr.prototype.add=Mr.prototype.push=pw;Mr.prototype.has=gw;var yw=Mr;function vp(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}p(vp,"arraySome");var mw=vp;function Tp(t,e){return t.has(e)}p(Tp,"cacheHas");var hw=Tp,vw=1,Tw=2;function _p(t,e,n,r,o,a){var i=n&vw,s=t.length,l=e.length;if(s!=l&&!(i&&l>s))return!1;var f=a.get(t),d=a.get(e);if(f&&d)return f==e&&d==t;var y=-1,g=!0,m=n&Tw?new yw:void 0;for(a.set(t,e),a.set(e,t);++y<s;){var v=t[y],B=e[y];if(r)var E=i?r(B,v,y,e,t,a):r(v,B,y,t,e,a);if(E!==void 0){if(E)continue;g=!1;break}if(m){if(!mw(e,function(T,k){if(!hw(m,k)&&(v===T||o(v,T,n,r,a)))return m.push(k)})){g=!1;break}}else if(!(v===B||o(v,B,n,r,a))){g=!1;break}}return a.delete(t),a.delete(e),g}p(_p,"equalArrays");var bp=_p;function wp(t){var e=-1,n=Array(t.size);return t.forEach(function(r,o){n[++e]=[o,r]}),n}p(wp,"mapToArray");var _w=wp;function xp(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}p(xp,"setToArray");var bw=xp,ww=1,xw=2,Bw="[object Boolean]",Ew="[object Date]",Pw="[object Error]",kw="[object Map]",Sw="[object Number]",Iw="[object RegExp]",Cw="[object Set]",Aw="[object String]",Rw="[object Symbol]",Ow="[object ArrayBuffer]",Mw="[object DataView]",ef=rn?rn.prototype:void 0,oa=ef?ef.valueOf:void 0;function Bp(t,e,n,r,o,a,i){switch(n){case Mw:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ow:return!(t.byteLength!=e.byteLength||!a(new Qc(t),new Qc(e)));case Bw:case Ew:case Sw:return yd(+t,+e);case Pw:return t.name==e.name&&t.message==e.message;case Iw:case Aw:return t==e+"";case kw:var s=_w;case Cw:var l=r&ww;if(s||(s=bw),t.size!=e.size&&!l)return!1;var f=i.get(t);if(f)return f==e;r|=xw,i.set(t,e);var d=bp(s(t),s(e),r,o,a,i);return i.delete(t),d;case Rw:if(oa)return oa.call(t)==oa.call(e)}return!1}p(Bp,"equalByTag");var Dw=Bp,Nw=1,Uw=Object.prototype,Hw=Uw.hasOwnProperty;function Ep(t,e,n,r,o,a){var i=n&Nw,s=qc(t),l=s.length,f=qc(e),d=f.length;if(l!=d&&!i)return!1;for(var y=l;y--;){var g=s[y];if(!(i?g in e:Hw.call(e,g)))return!1}var m=a.get(t),v=a.get(e);if(m&&v)return m==e&&v==t;var B=!0;a.set(t,e),a.set(e,t);for(var E=i;++y<l;){g=s[y];var T=t[g],k=e[g];if(r)var P=i?r(k,T,g,e,t,a):r(T,k,g,t,e,a);if(!(P===void 0?T===k||o(T,k,n,r,a):P)){B=!1;break}E||(E=g=="constructor")}if(B&&!E){var M=t.constructor,$=e.constructor;M!=$&&"constructor"in t&&"constructor"in e&&!(typeof M=="function"&&M instanceof M&&typeof $=="function"&&$ instanceof $)&&(B=!1)}return a.delete(t),a.delete(e),B}p(Ep,"equalObjects");var jw=Ep,$w=1,tf="[object Arguments]",nf="[object Array]",ci="[object Object]",Zw=Object.prototype,rf=Zw.hasOwnProperty;function Pp(t,e,n,r,o,a){var i=Lt(t),s=Lt(e),l=i?nf:Xc(t),f=s?nf:Xc(e);l=l==tf?ci:l,f=f==tf?ci:f;var d=l==ci,y=f==ci,g=l==f;if(g&&fa(t)){if(!fa(e))return!1;i=!0,d=!1}if(g&&!d)return a||(a=new di),i||Sd(t)?bp(t,e,n,r,o,a):Dw(t,e,l,n,r,o,a);if(!(n&$w)){var m=d&&rf.call(t,"__wrapped__"),v=y&&rf.call(e,"__wrapped__");if(m||v){var B=m?t.value():t,E=v?e.value():e;return a||(a=new di),o(B,E,n,r,a)}}return g?(a||(a=new di),jw(t,e,n,r,o,a)):!1}p(Pp,"baseIsEqualDeep");var Lw=Pp;function Da(t,e,n,r,o){return t===e?!0:t==null||e==null||!Vn(t)&&!Vn(e)?t!==t&&e!==e:Lw(t,e,n,r,Da,o)}p(Da,"baseIsEqual");var Na=Da,Fw=1,Kw=2;function kp(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],d=s[1];if(i&&s[2]){if(f===void 0&&!(l in t))return!1}else{var y=new di;if(r)var g=r(f,d,l,t,e,y);if(!(g===void 0?Na(d,f,Fw|Kw,r,y):g))return!1}}return!0}p(kp,"baseIsMatch");var Ww=kp;function Sp(t){return t===t&&!Aa(t)}p(Sp,"isStrictComparable");var Ip=Sp;function Cp(t){for(var e=Oa(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Ip(o)]}return e}p(Cp,"getMatchData");var qw=Cp;function Ap(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}p(Ap,"matchesStrictComparable");var Rp=Ap;function Op(t){var e=qw(t);return e.length==1&&e[0][2]?Rp(e[0][0],e[0][1]):function(n){return n===t||Ww(n,t,e)}}p(Op,"baseMatches");var zw=Op;function Mp(t,e){return t!=null&&e in Object(t)}p(Mp,"baseHasIn");var Gw=Mp;function Dp(t,e,n){e=tp(e,t);for(var r=-1,o=e.length,a=!1;++r<o;){var i=co(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&&Ra(o)&&dd(i,o)&&(Lt(t)||wd(t)))}p(Dp,"hasPath");var Vw=Dp;function Np(t,e){return t!=null&&Vw(t,e,Gw)}p(Np,"hasIn");var Jw=Np,Yw=1,Xw=2;function Up(t,e){return Ma(t)&&Ip(e)?Rp(co(t),e):function(n){var r=Zb(n,t);return r===void 0&&r===e?Jw(n,t):Na(e,r,Yw|Xw)}}p(Up,"baseMatchesProperty");var Qw=Up;function Hp(t){return function(e){return e?.[t]}}p(Hp,"baseProperty");var ex=Hp;function jp(t){return function(e){return ip(e,t)}}p(jp,"basePropertyDeep");var tx=jp;function $p(t){return Ma(t)?ex(co(t)):tx(t)}p($p,"property");var nx=$p;function Zp(t){return typeof t=="function"?t:t==null?UT:typeof t=="object"?Lt(t)?Qw(t[0],t[1]):zw(t):nx(t)}p(Zp,"baseIteratee");var rx=Zp;function Lp(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}}p(Lp,"createBaseFor");var ix=Lp,ox=ix(),ax=ox;function Fp(t,e){return t&&ax(t,e,Oa)}p(Fp,"baseForOwn");var sx=Fp;function Kp(t,e){return Na(t,e)}p(Kp,"isEqual");var Tn=Kp;function Wp(t,e){var n={};return e=rx(e,3),sx(t,function(r,o,a){o_(n,o,e(r,o,a))}),n}p(Wp,"mapValues");var lx=Wp;function Ua(t){return Xe(t)}p(Ua,"toTypescriptSchema");function Xe(t){let n=t._def;switch(n.typeName){case q.ZodFirstPartyTypeKind.ZodString:return`${pe(n.description)}z.string()`.trim();case q.ZodFirstPartyTypeKind.ZodNumber:return`${pe(n.description)}z.number()`.trim();case q.ZodFirstPartyTypeKind.ZodNaN:return`${pe(n.description)}z.nan()`.trim();case q.ZodFirstPartyTypeKind.ZodBigInt:return`${pe(n.description)}z.bigint()`.trim();case q.ZodFirstPartyTypeKind.ZodBoolean:return`${pe(t._def.description)}z.boolean()`.trim();case q.ZodFirstPartyTypeKind.ZodDate:return`${pe(n.description)}z.date()`.trim();case q.ZodFirstPartyTypeKind.ZodUndefined:return`${pe(n.description)}z.undefined()`.trim();case q.ZodFirstPartyTypeKind.ZodNull:return`${pe(n.description)}z.null()`.trim();case q.ZodFirstPartyTypeKind.ZodAny:return`${pe(n.description)}z.any()`.trim();case q.ZodFirstPartyTypeKind.ZodUnknown:return`${pe(n.description)}z.unknown()`.trim();case q.ZodFirstPartyTypeKind.ZodNever:return`${pe(n.description)}z.never()`.trim();case q.ZodFirstPartyTypeKind.ZodVoid:return`${pe(n.description)}z.void()`.trim();case q.ZodFirstPartyTypeKind.ZodArray:return`z.array(${Xe(n.type)})`;case q.ZodFirstPartyTypeKind.ZodObject:let r=lx(n.shape(),$=>$ instanceof q.Schema?Xe($):"z.any()");return[`${pe(n.description)}z.object({`,...Object.entries(r).map(([$,oe])=>` ${$}: ${oe},`),"})"].join(`
23
+ `).trim();case q.ZodFirstPartyTypeKind.ZodUnion:let o=n.options.map(Xe);return`${pe(n.description)}z.union([${o.join(", ")}])`.trim();case q.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let a=n.options.map(Xe),i=jt(n.discriminator);return`${pe(n.description)}z.discriminatedUnion(${i}, [${a.join(", ")}])`.trim();case q.ZodFirstPartyTypeKind.ZodIntersection:let s=Xe(n.left),l=Xe(n.right);return`${pe(n.description)}z.intersection(${s}, ${l})`.trim();case q.ZodFirstPartyTypeKind.ZodTuple:let f=n.items.map(Xe);return`${pe(n.description)}z.tuple([${f.join(", ")}])`.trim();case q.ZodFirstPartyTypeKind.ZodRecord:let d=Xe(n.keyType),y=Xe(n.valueType);return`${pe(n.description)}z.record(${d}, ${y})`.trim();case q.ZodFirstPartyTypeKind.ZodMap:let g=Xe(n.keyType),m=Xe(n.valueType);return`${pe(n.description)}z.map(${g}, ${m})`.trim();case q.ZodFirstPartyTypeKind.ZodSet:return`${pe(n.description)}z.set(${Xe(n.valueType)})`.trim();case q.ZodFirstPartyTypeKind.ZodFunction:let v=n.args.items.map(Xe),B=v.length?`.args(${v.join(", ")})`:"",E=Xe(n.returns);return`${pe(n.description)}z.function()${B}.returns(${E})`.trim();case q.ZodFirstPartyTypeKind.ZodLazy:return`${pe(n.description)}z.lazy(() => ${Xe(n.getter())})`.trim();case q.ZodFirstPartyTypeKind.ZodLiteral:let T=jt(n.value);return`${pe(n.description)}z.literal(${T})`.trim();case q.ZodFirstPartyTypeKind.ZodEnum:let k=n.values.map(jt);return`${pe(n.description)}z.enum([${k.join(", ")}])`.trim();case q.ZodFirstPartyTypeKind.ZodEffects:throw new yn(q.ZodFirstPartyTypeKind.ZodEffects);case q.ZodFirstPartyTypeKind.ZodNativeEnum:throw new yn(q.ZodFirstPartyTypeKind.ZodNativeEnum);case q.ZodFirstPartyTypeKind.ZodOptional:return`${pe(n.description)}z.optional(${Xe(n.innerType)})`.trim();case q.ZodFirstPartyTypeKind.ZodNullable:return`${pe(n.description)}z.nullable(${Xe(n.innerType)})`.trim();case q.ZodFirstPartyTypeKind.ZodDefault:let P=Bf(n.defaultValue());return`${pe(n.description)}${Xe(n.innerType)}.default(${P})`.trim();case q.ZodFirstPartyTypeKind.ZodCatch:throw new yn(q.ZodFirstPartyTypeKind.ZodCatch);case q.ZodFirstPartyTypeKind.ZodPromise:return`${pe(n.description)}z.promise(${Xe(n.type)})`.trim();case q.ZodFirstPartyTypeKind.ZodBranded:throw new yn(q.ZodFirstPartyTypeKind.ZodBranded);case q.ZodFirstPartyTypeKind.ZodPipeline:throw new yn(q.ZodFirstPartyTypeKind.ZodPipeline);case q.ZodFirstPartyTypeKind.ZodSymbol:throw new yn(q.ZodFirstPartyTypeKind.ZodSymbol);case q.ZodFirstPartyTypeKind.ZodReadonly:return`${pe(n.description)}z.readonly(${Xe(n.innerType)})`.trim();case q.ZodFirstPartyTypeKind.ZodRef:let M=jt(n.uri);return`${pe(n.description)}z.ref(${M})`.trim();default:_e.assertNever(n)}}p(Xe,"sUnwrapZod");var qp=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}};p(qp,"ParseInputLazyPath");var Pt=qp,of=p((t,e)=>{if(Nr(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 $t(t.common.issues);return this._error=n,this._error}}},"handleResult"),zp=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}dereference(e){return this}getReferences(){return[]}_getType(e){return tn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:tn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new gt,ctx:{common:e.parent.common,data:e.data,parsedType:tn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Bi(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:tn(e)},a=this._parseSync({data:e,path:o.path,parent:o});return of(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:tn(e)},o=this._parse({data:e,path:r.path,parent:r}),a=await(Bi(o)?o:Promise.resolve(o));return of(r,a)}refine(e,n){let r=p(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=p(()=>a.addIssue(x({code:z.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 bn({schema:this,typeName:"ZodEffects",effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return nn.create(this,this._def)}nullable(){return Jn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ur.create(this,this._def)}promise(){return go.create(this,this._def)}or(e){return Qa.create([this,e],this._def)}and(e){return Wa.create(this,e,this._def)}transform(e){return new bn(U(x({},ge(this._def)),{schema:this,typeName:"ZodEffects",effect:{type:"transform",transform:e}}))}default(e){let n=typeof e=="function"?e:()=>e;return new fo(U(x({},ge(this._def)),{innerType:this,defaultValue:n,typeName:"ZodDefault"}))}brand(){return new Za(x({typeName:"ZodBranded",type:this},ge(this._def)))}catch(e){let n=typeof e=="function"?e:()=>e;return new La(U(x({},ge(this._def)),{innerType:this,catchValue:n,typeName:"ZodCatch"}))}describe(e){let n=this.constructor;return new n(U(x({},this._def),{description:e}))}pipe(e){return Ya.create(this,e)}readonly(){return yo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}metadata(e){for(let[n,r]of Object.entries(e))this._def[Se]=U(x({},this._def[Se]),{[n]:r});return this}getMetadata(){return x({},this._def[Se])}setMetadata(e){this._def[Se]=x({},e)}get ui(){let e=this._getMetadataRoot();return x({},e._def[Se])}_setZuiMeta(e,n){let r=this._getMetadataRoot();r._def[Se]=U(x({},r._def[Se]),{[e]:n})}_getMetadataRoot(){let e=this._def;switch(e.typeName){case"ZodNullable":case"ZodDefault":case"ZodOptional":case"ZodReadonly":return e.innerType;case"ZodEffects":return e.schema;default:return this}}displayAs(e){var n,r,o;return(o=(n=this._def)[r=Se])!=null||(n[r]={}),this._def[Se].displayAs=[e.id,e.params],this}title(e){return this._setZuiMeta("title",e),this}hidden(e){let n;return e===void 0?n=!0:typeof e=="function"?n=e.toString():n=e,this._setZuiMeta("hidden",n),this}disabled(e){let n;return e===void 0?n=!0:typeof e=="function"?n=e.toString():n=e,this._setZuiMeta("disabled",n),this}placeholder(e){return this._setZuiMeta("placeholder",e),this}toJsonSchema(e){return rs(this,e)}toTypescript(e){return bi(this,e)}toTypescriptSchema(){return Ua(this)}async toTypescriptAsync(e){let n=bi(this,U(x({},e),{formatter:void 0}));return e?.formatter&&(n=await e.formatter(n)),n}static fromObject(e,n){return Hr(e,n)}static fromJsonSchema(e){return mo(e)}};p(zp,"ZodType");var ye=zp,Gp=(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))(Gp||{}),_e;(t=>{t.assertEqual=p(o=>o,"assertEqual");function e(o){}t.assertIs=e,p(e,"assertIs");function n(o){throw new Error("assertNever called")}t.assertNever=n,p(n,"assertNever"),t.arrayToEnum=p(o=>{let a={};for(let i of o)a[i]=i;return a},"arrayToEnum"),t.getValidEnumValues=p(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=p(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=p((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,p(r,"joinValues"),t.jsonStringifyReplacer=p((o,a)=>typeof a=="bigint"?a.toString():a,"jsonStringifyReplacer"),t.compareFunctions=p((o,a)=>o.toString()===a.toString(),"compareFunctions")})(_e||(_e={}));var ya;(t=>{t.mergeShapes=p((e,n)=>x(x({},e),n),"mergeShapes")})(ya||(ya={}));var ne=_e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tn=p(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 ge(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o,[Se]:t?.[Se]}:{errorMap:p((i,s)=>i.code!=="invalid_type"?{message:s.defaultError}:typeof s.data>"u"?{message:r??s.defaultError}:{message:n??s.defaultError},"customMap"),description:o,[Se]:t?.[Se]}}p(ge,"processCreateParams");var Ha=p((t,e)=>{let n;switch(t.code){case z.invalid_type:t.received===ne.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case z.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,_e.jsonStringifyReplacer)}`;break;case z.unrecognized_keys:n=`Unrecognized key(s) in object: ${_e.joinValues(t.keys,", ")}`;break;case z.invalid_union:n="Invalid input";break;case z.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${_e.joinValues(t.options)}`;break;case z.invalid_enum_value:n=`Invalid enum value. Expected ${_e.joinValues(t.options)}, received '${t.received}'`;break;case z.invalid_arguments:n="Invalid function arguments";break;case z.invalid_return_type:n="Invalid function return type";break;case z.invalid_date:n="Invalid date";break;case z.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}"`:_e.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case z.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 z.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 z.custom:n="Invalid input";break;case z.invalid_intersection_types:n="Intersection results could not be merged";break;case z.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case z.not_finite:n="Number must be finite";break;case z.unresolved_reference:n="Unresolved reference";break;default:n=e.defaultError,_e.assertNever(t)}return{message:n}},"errorMap"),af=Ha,z=_e.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"]),ux=p(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),wi=class Vp extends Error{constructor(e){super(),this.issues=[],this.addIssue=p(r=>{this.issues=[...this.issues,r]},"addIssue"),this.addIssues=p((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=p(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 Vp))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_e.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()}};p(wi,"ZodError");wi.create=p(t=>new wi(t),"create");var $t=wi,Jp=Ha;function Yp(t){Jp=t}p(Yp,"setErrorMap");function Dr(){return Jp}p(Dr,"getErrorMap");var xi=p(t=>{var e;let{data:n,path:r,errorMaps:o,issueData:a}=t,i=[...r,...a.path||[]],s=U(x({},a),{path:i}),l="",f=o.filter(d=>!!d).slice().reverse();for(let d of f)l=d(s,{data:n,defaultError:l}).message;return U(x({},a),{path:i,message:(e=a.message)!=null?e:l})},"makeIssue"),cx=[];function te(t,e){let n=xi({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Dr(),Ha].filter(r=>!!r)});t.common.issues.push(n)}p(te,"addIssueToContext");var Xp=class Qp{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 de;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 Qp.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 de;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}}};p(Xp,"ParseStatus");var gt=Xp,de=Object.freeze({status:"aborted"}),Gn=p(t=>({status:"dirty",value:t}),"DIRTY"),ct=p(t=>({status:"valid",value:t}),"OK"),ma=p(t=>t.status==="aborted","isAborted"),ha=p(t=>t.status==="dirty","isDirty"),Nr=p(t=>t.status==="valid","isValid"),Bi=p(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync"),se;(t=>{t.errToObj=p(e=>typeof e=="string"?{message:e}:e||{},"errToObj"),t.toString=p(e=>typeof e=="string"?e:e?.message,"toString")})(se||(se={}));var Ei=class eg extends ye{constructor(){super(...arguments),this._any=!0}_parse(e){return ct(e.data)}isEqual(e){return e instanceof eg}};p(Ei,"ZodAny");Ei.create=p(t=>new Ei(x({typeName:"ZodAny"},ge(t))),"create");var Pi=Ei,ki=class Fn extends ye{dereference(e){return new Fn(U(x({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}isEqual(e){var n,r,o,a,i,s;return e instanceof Fn?Tn((n=this._def.exactLength)==null?void 0:n.value,(r=e._def.exactLength)==null?void 0:r.value)&&Tn((o=this._def.maxLength)==null?void 0:o.value,(a=e._def.maxLength)==null?void 0:a.value)&&Tn((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:z.invalid_type,expected:ne.array,received:n.parsedType}),de;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?z.too_big:z.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:z.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:z.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 Pt(n,i,n.path,s)))).then(i=>gt.mergeArray(r,i));let a=[...n.data].map((i,s)=>o.type._parseSync(new Pt(n,i,n.path,s)));return gt.mergeArray(r,a)}get element(){return this._def.type}min(e,n){return new Fn(U(x({},this._def),{minLength:{value:e,message:se.toString(n)}}))}max(e,n){return new Fn(U(x({},this._def),{maxLength:{value:e,message:se.toString(n)}}))}length(e,n){return new Fn(U(x({},this._def),{exactLength:{value:e,message:se.toString(n)}}))}nonempty(e){return this.min(1,e)}};p(ki,"ZodArray");ki.create=p((t,e)=>new ki(x({type:t,minLength:null,maxLength:null,exactLength:null,typeName:"ZodArray"},ge(e))),"create");var Ur=ki,fx={compare:Tn},tg=class{constructor(e=[],n={}){this._options=x(x({},fx),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))}};p(tg,"CustomSet");var tt=tg,Si=class pi extends ye{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:z.invalid_type,expected:ne.bigint,received:a.parsedType}),de}let r,o=new gt;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:z.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:z.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:z.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):_e.assertNever(a);return{status:o.value,value:e.data}}isEqual(e){if(!(e instanceof pi)||this._def.coerce!==e._def.coerce)return!1;let n=new tt(this._def.checks),r=new tt(e._def.checks);return n.isEqual(r)}gte(e,n){return this.setLimit("min",e,!0,se.toString(n))}gt(e,n){return this.setLimit("min",e,!1,se.toString(n))}lte(e,n){return this.setLimit("max",e,!0,se.toString(n))}lt(e,n){return this.setLimit("max",e,!1,se.toString(n))}setLimit(e,n,r,o){return new pi(U(x({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:se.toString(o)}]}))}_addCheck(e){return new pi(U(x({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:se.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:se.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:se.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:se.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:se.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}};p(Si,"ZodBigInt");Si.create=p(t=>{var e;return new Si(x({checks:[],typeName:"ZodBigInt",coerce:(e=t?.coerce)!=null?e:!1},ge(t)))},"create");var ja=Si,Ii=class ng extends ye{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==ne.boolean){let r=this._getOrReturnCtx(e);return te(r,{code:z.invalid_type,expected:ne.boolean,received:r.parsedType}),de}return ct(e.data)}isEqual(e){return e instanceof ng?this._def.coerce===e._def.coerce:!1}};p(Ii,"ZodBoolean");Ii.create=p(t=>new Ii(x({typeName:"ZodBoolean",coerce:t?.coerce||!1},ge(t))),"create");var $a=Ii,dx=Symbol("zod_brand"),rg=class ig extends ye{_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 ig?this._def.type.isEqual(e._def.type):!1}};p(rg,"ZodBranded");var Za=rg,Ci=class og extends ye{_parse(e){let{ctx:n}=this._processInputParams(e),r=U(x({},n),{common:U(x({},n.common),{issues:[]})}),o=this._def.innerType._parse({data:r.data,path:r.path,parent:x({},r)});return Bi(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new $t(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new $t(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}isEqual(e){return e instanceof og?this._def.innerType.isEqual(e._def.innerType)&&_e.compareFunctions(this._def.catchValue,e._def.catchValue):!1}};p(Ci,"ZodCatch");Ci.create=p((t,e)=>new Ci(x({innerType:t,typeName:"ZodCatch",catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},ge(e))),"create");var La=Ci,ag=p((t,e={},n)=>t?Pi.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(U(x({code:"custom"},f),{fatal:l}))}}):Pi.create(),"custom"),Ai=class va extends ye{_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:z.invalid_type,expected:ne.date,received:a.parsedType}),de}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return te(a,{code:z.invalid_date}),de}let r=new gt,o;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(o=this._getOrReturnCtx(e,o),te(o,{code:z.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:z.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):_e.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new va(U(x({},this._def),{checks:[...this._def.checks,e]}))}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:se.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:se.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 va))return!1;let n=new tt(this._def.checks),r=new tt(e._def.checks);return n.isEqual(r)&&this._def.coerce===e._def.coerce}};p(Ai,"ZodDate");Ai.create=p(t=>new Ai(x({checks:[],coerce:t?.coerce||!1,typeName:"ZodDate"},ge(t))),"create");var Fa=Ai,Ri=class Ta extends ye{_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 Ta(U(x({},this._def),{innerType:this._def.innerType.dereference(e)}))}isEqual(e){return e instanceof Ta?this._def.innerType.isEqual(e._def.innerType)&&Tn(this._def.defaultValue(),e._def.defaultValue()):!1}};p(Ri,"ZodDefault");Ri.create=p((t,e,n)=>new Ri(x({innerType:t,typeName:"ZodDefault",defaultValue:typeof e=="function"?e:()=>e},ge(n))),"create");var fo=Ri,Kt=p(t=>Array.from(new Set(t)),"unique"),Ht=p(t=>t instanceof qa?Ht(t.schema):t instanceof bn?Ht(t.innerType()):t instanceof za?[t.value]:t instanceof rr?t.options:t instanceof Ga?_e.objectValues(t.enum):t instanceof fo?Ht(t._def.innerType):t instanceof Xa?[void 0]:t instanceof Va?[null]:t instanceof nn?[void 0,...Ht(t.unwrap())]:t instanceof Jn?[null,...Ht(t.unwrap())]:t instanceof Za||t instanceof yo?Ht(t.unwrap()):t instanceof La?Ht(t._def.innerType):[],"getDiscriminator"),sg=class Kn extends ye{dereference(e){let n=this.options.map(o=>o.dereference(e)),r=Kn._getOptionsMap(this.discriminator,n);return new Kn(U(x({},this._def),{options:n,optionsMap:r}))}getReferences(){return Kt(this.options.flatMap(e=>e.getReferences()))}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.object)return te(n,{code:z.invalid_type,expected:ne.object,received:n.parsedType}),de;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:z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),de)}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=Kn._getOptionsMap(e,n);return new Kn(x({typeName:"ZodDiscriminatedUnion",discriminator:e,options:n,optionsMap:o},ge(r)))}static _getOptionsMap(e,n){let r=new Map;for(let o of n){let a=Ht(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 Kn)||this._def.discriminator!==e._def.discriminator)return!1;let n=p((a,i)=>a.isEqual(i),"compare"),r=new tt(this._def.options,{compare:n}),o=new tt(e._def.options,{compare:n});return r.isEqual(o)}};p(sg,"ZodDiscriminatedUnion");var lg=sg;function po(t,e){return new rr(x({values:t,typeName:"ZodEnum"},ge(e)))}p(po,"createZodEnum");var Ka=class gi extends ye{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return te(n,{expected:_e.joinValues(r),received:n.parsedType,code:z.invalid_type}),de}if(this._def.values.indexOf(e.data)===-1){let n=this._getOrReturnCtx(e),r=this._def.values;return te(n,{received:n.data,code:z.invalid_enum_value,options:r}),de}return ct(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 gi.create(e,x(x({},this._def),n))}exclude(e,n=this._def){return gi.create(this.options.filter(r=>!e.includes(r)),x(x({},this._def),n))}isEqual(e){if(!(e instanceof gi))return!1;let n=new tt(this._def.values),r=new tt(e._def.values);return n.isEqual(r)}};p(Ka,"ZodEnum");Ka.create=po;var rr=Ka,ug=class Wn extends ye{constructor(){super(...arguments),this.validate=this.implement}dereference(e){let n=this._def.args.dereference(e),r=this._def.returns.dereference(e);return new Wn(U(x({},this._def),{args:n,returns:r}))}getReferences(){return Kt([...this._def.args.getReferences(),...this._def.returns.getReferences()])}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.function)return te(n,{code:z.invalid_type,expected:ne.function,received:n.parsedType}),de;function r(s,l){return xi({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Dr(),af].filter(f=>!!f),issueData:{code:z.invalid_arguments,argumentsError:l}})}p(r,"makeArgsIssue");function o(s,l){return xi({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Dr(),af].filter(f=>!!f),issueData:{code:z.invalid_return_type,returnTypeError:l}})}p(o,"makeReturnsIssue");let a={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof go){let s=this;return ct(async function(...l){let f=new $t([]),d=await s._def.args.parseAsync(l,a).catch(m=>{throw f.addIssue(r(l,m)),f}),y=await Reflect.apply(i,this,d);return await s._def.returns._def.type.parseAsync(y,a).catch(m=>{throw f.addIssue(o(y,m)),f})})}else{let s=this;return ct(function(...l){let f=s._def.args.safeParse(l,a);if(!f.success)throw new $t([r(l,f.error)]);let d=Reflect.apply(i,this,f.data),y=s._def.returns.safeParse(d,a);if(!y.success)throw new $t([o(d,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Wn(U(x({},this._def),{args:Qn.create(e).rest(Cr.create())}))}returns(e){return new Wn(U(x({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Wn(x({args:e||Qn.create([]).rest(Cr.create()),returns:n||Cr.create(),typeName:"ZodFunction"},ge(r)))}isEqual(e){return e instanceof Wn&&this._def.args.isEqual(e._def.args)&&this._def.returns.isEqual(e._def.returns)}};p(ug,"ZodFunction");var cg=ug;function Oi(t,e){let n=tn(t),r=tn(e);if(t===e)return{valid:!0,data:t};if(n===ne.object&&r===ne.object){let o=_e.objectKeys(e),a=_e.objectKeys(t).filter(s=>o.indexOf(s)!==-1),i=x(x({},t),e);for(let s of a){let l=Oi(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=Oi(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}}p(Oi,"mergeValues");var Mi=class _a extends ye{dereference(e){return new _a(U(x({},this._def),{left:this._def.left.dereference(e),right:this._def.right.dereference(e)}))}getReferences(){return Kt([...this._def.left.getReferences(),...this._def.right.getReferences()])}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=p((a,i)=>{if(ma(a)||ma(i))return de;let s=Oi(a.value,i.value);return s.valid?((ha(a)||ha(i))&&n.dirty(),{status:n.value,value:s.data}):(te(r,{code:z.invalid_intersection_types}),de)},"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 _a))return!1;let n=p((a,i)=>a.isEqual(i),"compare"),r=new tt([this._def.left,this._def.right],{compare:n}),o=new tt([e._def.left,e._def.right],{compare:n});return r.isEqual(o)}};p(Mi,"ZodIntersection");Mi.create=p((t,e,n)=>new Mi(x({left:t,right:e,typeName:"ZodIntersection"},ge(n))),"create");var Wa=Mi,Di=class fg extends ye{get schema(){return this._def.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 fg?this._def.getter().isEqual(e._def.getter()):!1}};p(Di,"ZodLazy");Di.create=p((t,e)=>new Di(x({getter:t,typeName:"ZodLazy"},ge(e))),"create");var qa=Di,Ni=class dg extends ye{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return te(n,{received:n.data,code:z.invalid_literal,expected:this._def.value}),de}return{status:"valid",value:e.data}}get value(){return this._def.value}isEqual(e){return e instanceof dg?Tn(this._def.value,e._def.value):!1}};p(Ni,"ZodLiteral");Ni.create=p((t,e)=>new Ni(x({value:t,typeName:"ZodLiteral"},ge(e))),"create");var za=Ni,Ui=class ba extends ye{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 ba(U(x({},this._def),{keyType:n,valueType:r}))}getReferences(){return Kt([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.map)return te(r,{code:z.invalid_type,expected:ne.map,received:r.parsedType}),de;let o=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([s,l],f)=>({key:o._parse(new Pt(r,s,r.path,[f,"key"])),value:a._parse(new Pt(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,d=await l.value;if(f.status==="aborted"||d.status==="aborted")return de;(f.status==="dirty"||d.status==="dirty")&&n.dirty(),s.set(f.value,d.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let l of i){let f=l.key,d=l.value;if(f.status==="aborted"||d.status==="aborted")return de;(f.status==="dirty"||d.status==="dirty")&&n.dirty(),s.set(f.value,d.value)}return{status:n.value,value:s}}}isEqual(e){return!(!(e instanceof ba)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};p(Ui,"ZodMap");Ui.create=p((t,e,n)=>new Ui(x({valueType:e,keyType:t,typeName:"ZodMap"},ge(n))),"create");var pg=Ui,Hi=class gg extends ye{_parse(e){if(this._getType(e)!==ne.nan){let r=this._getOrReturnCtx(e);return te(r,{code:z.invalid_type,expected:ne.nan,received:r.parsedType}),de}return{status:"valid",value:e.data}}isEqual(e){return e instanceof gg}};p(Hi,"ZodNaN");Hi.create=p(t=>new Hi(x({typeName:"ZodNaN"},ge(t))),"create");var yg=Hi,ji=class mg extends ye{_parse(e){let n=_e.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ne.string&&r.parsedType!==ne.number){let o=_e.objectValues(n);return te(r,{expected:_e.joinValues(o),received:r.parsedType,code:z.invalid_type}),de}if(n.indexOf(e.data)===-1){let o=_e.objectValues(n);return te(r,{received:r.data,code:z.invalid_enum_value,options:o}),de}return ct(e.data)}get enum(){return this._def.values}isEqual(e){return e instanceof mg?Tn(this._def.values,e._def.values):!1}};p(ji,"ZodNativeEnum");ji.create=p((t,e)=>new ji(x({values:t,typeName:"ZodNativeEnum"},ge(e))),"create");var Ga=ji,$i=class hg extends ye{_parse(e){let n=this._getOrReturnCtx(e);return te(n,{code:z.invalid_type,expected:ne.never,received:n.parsedType}),de}isEqual(e){return e instanceof hg}};p($i,"ZodNever");$i.create=p(t=>new $i(x({typeName:"ZodNever"},ge(t))),"create");var _n=$i,Zi=class vg extends ye{_parse(e){if(this._getType(e)!==ne.null){let r=this._getOrReturnCtx(e);return te(r,{code:z.invalid_type,expected:ne.null,received:r.parsedType}),de}return ct(e.data)}isEqual(e){return e instanceof vg}};p(Zi,"ZodNull");Zi.create=p(t=>new Zi(x({typeName:"ZodNull"},ge(t))),"create");var Va=Zi,Li=class wa extends ye{dereference(e){return new wa(U(x({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){return this._getType(e)===ne.null?ct(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof wa?this._def.innerType.isEqual(e._def.innerType):!1}};p(Li,"ZodNullable");Li.create=p((t,e)=>new Li(x({innerType:t,typeName:"ZodNullable"},ge(e))),"create");var Jn=Li;function Tg(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)}p(Tg,"floatSafeRemainder");var Fi=class yi extends ye{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:z.invalid_type,expected:ne.number,received:a.parsedType}),de}let r,o=new gt;for(let a of this._def.checks)a.kind==="int"?_e.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),te(r,{code:z.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:z.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:z.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?Tg(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),te(r,{code:z.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:z.not_finite,message:a.message}),o.dirty()):_e.assertNever(a);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,se.toString(n))}gt(e,n){return this.setLimit("min",e,!1,se.toString(n))}lte(e,n){return this.setLimit("max",e,!0,se.toString(n))}lt(e,n){return this.setLimit("max",e,!1,se.toString(n))}setLimit(e,n,r,o){return new yi(U(x({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:se.toString(o)}]}))}_addCheck(e){return new yi(U(x({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:se.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:se.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:se.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:se.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:se.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:se.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:se.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:se.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:se.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"&&_e.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 yi))return!1;let n=new tt(this._def.checks),r=new tt(e._def.checks);return n.isEqual(r)}};p(Fi,"ZodNumber");Fi.create=p(t=>new Fi(x({checks:[],typeName:"ZodNumber",coerce:t?.coerce||!1},ge(t))),"create");var Ja=Fi;function vn(t){if(t instanceof Yn){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=nn.create(vn(r))}return new Yn(U(x({},t._def),{shape:p(()=>e,"shape")}))}else return t instanceof Ur?new Ur(U(x({},t._def),{type:vn(t.element)})):t instanceof nn?nn.create(vn(t.unwrap())):t instanceof Jn?Jn.create(vn(t.unwrap())):t instanceof Qn?Qn.create(t.items.map(e=>vn(e))):t}p(vn,"deepPartialify");var on=class Tt extends ye{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=_e.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 Tt(U(x({},this._def),{shape:p(()=>r,"shape")}))}getReferences(){let e=this._def.shape(),n=[];for(let r in e)n.push(...e[r].getReferences());return Kt(n)}_parse(e){if(this._getType(e)!==ne.object){let f=this._getOrReturnCtx(e);return te(f,{code:z.invalid_type,expected:ne.object,received:f.parsedType}),de}let{status:r,ctx:o}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof _n&&this._def.unknownKeys==="strip"))for(let f in o.data)i.includes(f)||s.push(f);let l=[];for(let f of i){let d=a[f],y=o.data[f];l.push({key:{status:"valid",value:f},value:d._parse(new Pt(o,y,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof _n){let f=this._def.unknownKeys;if(f==="passthrough")for(let d of s)l.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(f==="strict")s.length>0&&(te(o,{code:z.unrecognized_keys,keys:s}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let d of s){let y=o.data[d];l.push({key:{status:"valid",value:d},value:f._parse(new Pt(o,y,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let f=[];for(let d of l){let y=await d.key;f.push({key:y,value:await d.value,alwaysSet:d.alwaysSet})}return f}).then(f=>gt.mergeObjectSync(r,f)):gt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return se.errToObj,new Tt(x(U(x({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:p((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=se.errToObj(e).message)!=null?s:l}:{message:l}},"errorMap")}:{}))}strip(){return new Tt(U(x({},this._def),{unknownKeys:"strip"}))}passthrough(){return new Tt(U(x({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new Tt(U(x({},this._def),{shape:p(()=>x(x({},this._def.shape()),e),"shape")}))}merge(e){return new Tt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:p(()=>x(x({},this._def.shape()),e._def.shape()),"shape"),typeName:"ZodObject"})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Tt(U(x({},this._def),{catchall:e}))}pick(e){let n={};return _e.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Tt(U(x({},this._def),{shape:p(()=>n,"shape")}))}omit(e){let n={};return _e.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new Tt(U(x({},this._def),{shape:p(()=>n,"shape")}))}deepPartial(){return vn(this)}partial(e){let n={};return _e.objectKeys(this.shape).forEach(r=>{let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o?.optional()}),new Tt(U(x({},this._def),{shape:p(()=>n,"shape")}))}required(e){let n={};return _e.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof nn;)a=a._def.innerType;n[r]=a}}),new Tt(U(x({},this._def),{shape:p(()=>n,"shape")}))}keyof(){return po(_e.objectKeys(this.shape))}isEqual(e){if(!(e instanceof Tt)||!this._def.catchall.isEqual(e._def.catchall)||this._def.unknownKeys!==e._def.unknownKeys)return!1;let n=this._def.shape(),r=e._def.shape(),o=p((s,l)=>s[0]===l[0]&&s[1].isEqual(l[1]),"compare"),a=new tt(Object.entries(n),{compare:o}),i=new tt(Object.entries(r),{compare:o});return a.isEqual(i)}};p(on,"ZodObject");on.create=p((t,e)=>new on(x({shape:p(()=>t,"shape"),unknownKeys:"strip",catchall:_n.create(),typeName:"ZodObject"},ge(e))),"create");on.strictCreate=p((t,e)=>new on(x({shape:p(()=>t,"shape"),unknownKeys:"strict",catchall:_n.create(),typeName:"ZodObject"},ge(e))),"strictCreate");on.lazycreate=p((t,e)=>new on(x({shape:t,unknownKeys:"strip",catchall:_n.create(),typeName:"ZodObject"},ge(e))),"lazycreate");var Yn=on,Ki=class xa extends ye{dereference(e){return new xa(U(x({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){return this._getType(e)===ne.undefined?ct(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof xa?this._def.innerType.isEqual(e._def.innerType):!1}};p(Ki,"ZodOptional");Ki.create=p((t,e)=>new Ki(x({innerType:t,typeName:"ZodOptional"},ge(e))),"create");var nn=Ki,_g=class mi extends ye{dereference(e){return new mi(U(x({},this._def),{in:this._def.in.dereference(e),out:this._def.out.dereference(e)}))}getReferences(){return Kt([...this._def.in.getReferences(),...this._def.out.getReferences()])}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return p(async()=>{let a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?de: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"?de: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 mi({in:e,out:n,typeName:"ZodPipeline"})}isEqual(e){return!(!(e instanceof mi)||!this._def.in.isEqual(e._def.in)||!this._def.out.isEqual(e._def.out))}};p(_g,"ZodPipeline");var Ya=_g,Wi=class Ba extends ye{unwrap(){return this._def.type}dereference(e){return new Ba(U(x({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.promise&&n.common.async===!1)return te(n,{code:z.invalid_type,expected:ne.promise,received:n.parsedType}),de;let r=n.parsedType===ne.promise?n.data:Promise.resolve(n.data);return ct(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}isEqual(e){return e instanceof Ba?this._def.type.isEqual(e._def.type):!1}};p(Wi,"ZodPromise");Wi.create=p((t,e)=>new Wi(x({type:t,typeName:"ZodPromise"},ge(e))),"create");var go=Wi,qi=class Ea extends ye{dereference(e){return new Ea(U(x({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){let n=this._def.innerType._parse(e);return Nr(n)&&(n.value=Object.freeze(n.value)),n}unwrap(){return this._def.innerType}isEqual(e){return e instanceof Ea?this._def.innerType.isEqual(e._def.innerType):!1}};p(qi,"ZodReadonly");qi.create=p((t,e)=>new qi(x({innerType:t,typeName:"ZodReadonly"},ge(e))),"create");var yo=qi,bg=class Er extends ye{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 Er(U(x({},this._def),{keyType:n,valueType:r}))}getReferences(){return Kt([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.object)return te(r,{code:z.invalid_type,expected:ne.object,received:r.parsedType}),de;let o=[],a=this._def.keyType,i=this._def.valueType;for(let s in r.data)o.push({key:a._parse(new Pt(r,s,r.path,s)),value:i._parse(new Pt(r,r.data[s],r.path,s))});return r.common.async?gt.mergeObjectAsync(n,o):gt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof ye?new Er(x({keyType:e,valueType:n,typeName:"ZodRecord"},ge(r))):new Er(x({keyType:ft.create(),valueType:e,typeName:"ZodRecord"},ge(n)))}isEqual(e){return!(!(e instanceof Er)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};p(bg,"ZodRecord");var wg=bg,zi=class xg extends ye{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:z.unresolved_reference}),de}isOptional(){return!1}isNullable(){return!1}isEqual(e){return e instanceof xg?this._def.uri===e._def.uri:!1}};p(zi,"ZodRef");zi.create=p(t=>new zi({typeName:"ZodRef",uri:t}),"create");var Bg=zi,Gi=class Pr extends ye{dereference(e){return new Pr(U(x({},this._def),{valueType:this._def.valueType.dereference(e)}))}getReferences(){return this._def.valueType.getReferences()}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.set)return te(r,{code:z.invalid_type,expected:ne.set,received:r.parsedType}),de;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(te(r,{code:z.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:z.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 d of l){if(d.status==="aborted")return de;d.status==="dirty"&&n.dirty(),f.add(d.value)}return{status:n.value,value:f}}p(i,"finalizeSet");let s=[...r.data.values()].map((l,f)=>a._parse(new Pt(r,l,r.path,f)));return r.common.async?Promise.all(s).then(l=>i(l)):i(s)}min(e,n){return new Pr(U(x({},this._def),{minSize:{value:e,message:se.toString(n)}}))}max(e,n){return new Pr(U(x({},this._def),{maxSize:{value:e,message:se.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 Pr))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)}};p(Gi,"ZodSet");Gi.create=p((t,e)=>new Gi(x({valueType:t,minSize:null,maxSize:null,typeName:"ZodSet"},ge(e))),"create");var Eg=Gi,Pg=/^c[^\s-]{8,}$/i,kg=/^[a-z][a-z0-9]*$/,Sg=/^[0-9A-HJKMNP-TV-Z]{26}$/,Ig=/^[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,Ag="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",px=p(t=>t===Ag,"isEmojiRegex"),aa,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}))$/,Og=/^(([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})))$/,Mg=p(t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex");function Dg(t,e){return!!((e==="v4"||!e)&&Rg.test(t)||(e==="v6"||!e)&&Og.test(t))}p(Dg,"isValidIP");var Vi=class qn extends ye{_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:z.invalid_type,expected:ne.string,received:a.parsedType}),de}let r=new gt,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:z.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:z.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:z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&te(o,{code:z.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:z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")aa||(aa=new RegExp(Ag,"u")),aa.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"emoji",code:z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")Ig.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"uuid",code:z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")Pg.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"cuid",code:z.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:z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")Sg.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"ulid",code:z.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:z.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:z.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:z.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:z.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:z.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?Mg(a).test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{code:z.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="ip"?Dg(e.data,a.version)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"ip",code:z.invalid_string,message:a.message}),r.dirty()):_e.assertNever(a);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),x({validation:n,code:z.invalid_string},se.errToObj(r)))}_addCheck(e){return new qn(U(x({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(x({kind:"email"},se.errToObj(e)))}url(e){return this._addCheck(x({kind:"url"},se.errToObj(e)))}emoji(e){return this._addCheck(x({kind:"emoji"},se.errToObj(e)))}uuid(e){return this._addCheck(x({kind:"uuid"},se.errToObj(e)))}cuid(e){return this._addCheck(x({kind:"cuid"},se.errToObj(e)))}cuid2(e){return this._addCheck(x({kind:"cuid2"},se.errToObj(e)))}ulid(e){return this._addCheck(x({kind:"ulid"},se.errToObj(e)))}ip(e){return this._addCheck(x({kind:"ip"},se.errToObj(e)))}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck(x({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(n=e?.offset)!=null?n:!1},se.errToObj(e?.message)))}regex(e,n){return this._addCheck(x({kind:"regex",regex:e},se.errToObj(n)))}includes(e,n){return this._addCheck(x({kind:"includes",value:e,position:n?.position},se.errToObj(n?.message)))}startsWith(e,n){return this._addCheck(x({kind:"startsWith",value:e},se.errToObj(n)))}endsWith(e,n){return this._addCheck(x({kind:"endsWith",value:e},se.errToObj(n)))}min(e,n){return this._addCheck(x({kind:"min",value:e},se.errToObj(n)))}max(e,n){return this._addCheck(x({kind:"max",value:e},se.errToObj(n)))}length(e,n){return this._addCheck(x({kind:"length",value:e},se.errToObj(n)))}nonempty(e){return this.min(1,se.errToObj(e))}trim(){return new qn(U(x({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}secret(){return this._def[Se]=U(x({},this._def[Se]),{secret:!0}),this}toLowerCase(){return new qn(U(x({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new qn(U(x({},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 tt(this._def.checks),r=new tt(e._def.checks);return n.isEqual(r)}};p(Vi,"ZodString");Vi.create=p(t=>{var e;return new Vi(x({checks:[],typeName:"ZodString",coerce:(e=t?.coerce)!=null?e:!1},ge(t)))},"create");var ft=Vi,Ji=class Ng extends ye{_parse(e){if(this._getType(e)!==ne.symbol){let r=this._getOrReturnCtx(e);return te(r,{code:z.invalid_type,expected:ne.symbol,received:r.parsedType}),de}return ct(e.data)}isEqual(e){return e instanceof Ng}};p(Ji,"ZodSymbol");Ji.create=p(t=>new Ji(x({typeName:"ZodSymbol"},ge(t))),"create");var Ug=Ji,Xn=class Pa extends ye{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName==="ZodEffects"?this._def.schema.sourceType():this._def.schema}dereference(e){return new Pa(U(x({},this._def),{schema:this._def.schema.dereference(e)}))}getReferences(){return this._def.schema.getReferences()}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,a={addIssue:p(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 de;let l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?de:l.status==="dirty"||n.value==="dirty"?Gn(l.value):l});{if(n.value==="aborted")return de;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?de:s.status==="dirty"||n.value==="dirty"?Gn(s.value):s}}if(o.type==="refinement"){let i=p(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"?de:(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"?de:(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(!Nr(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=>Nr(i)?Promise.resolve(o.transform(i.value,a)).then(s=>({status:n.value,value:s})):i);_e.assertNever(o)}isEqual(e){return!(e instanceof Pa)||!this._def.schema.isEqual(e._def.schema)?!1:this._def.effect.type==="refinement"?e._def.effect.type!=="refinement"?!1:_e.compareFunctions(this._def.effect.refinement,e._def.effect.refinement):this._def.effect.type==="transform"?e._def.effect.type!=="transform"?!1:_e.compareFunctions(this._def.effect.transform,e._def.effect.transform):this._def.effect.type==="preprocess"?e._def.effect.type!=="preprocess"?!1:_e.compareFunctions(this._def.effect.transform,e._def.effect.transform):(_e.assertNever(this._def.effect),!1)}};p(Xn,"ZodEffects");Xn.create=p((t,e,n)=>new Xn(x({schema:t,typeName:"ZodEffects",effect:e},ge(n))),"create");Xn.createWithPreprocess=p((t,e,n)=>new Xn(x({schema:e,effect:{type:"preprocess",transform:t},typeName:"ZodEffects"},ge(n))),"createWithPreprocess");var bn=Xn,Yi=class hi extends ye{dereference(e){let n=this._def.items.map(o=>o.dereference(e)),r=this._def.rest?this._def.rest.dereference(e):null;return new hi(U(x({},this._def),{items:n,rest:r}))}getReferences(){return Kt([...this._def.items.flatMap(e=>e.getReferences()),...this._def.rest?this._def.rest.getReferences():[]])}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.array)return te(r,{code:z.invalid_type,expected:ne.array,received:r.parsedType}),de;if(r.data.length<this._def.items.length)return te(r,{code:z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),de;!this._def.rest&&r.data.length>this._def.items.length&&(te(r,{code:z.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 Pt(r,i,r.path,s)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>gt.mergeArray(n,i)):gt.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new hi(U(x({},this._def),{rest:e}))}isEqual(e){if(!(e instanceof hi)||!this._restEquals(e))return!1;let n=p((a,i)=>a.isEqual(i),"compare"),r=new tt(this._def.items,{compare:n}),o=new tt(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)}};p(Yi,"ZodTuple");Yi.create=p((t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Yi(x({items:t,typeName:"ZodTuple",rest:null},ge(e)))},"create");var Qn=Yi,Xi=class Hg extends ye{_parse(e){if(this._getType(e)!==ne.undefined){let r=this._getOrReturnCtx(e);return te(r,{code:z.invalid_type,expected:ne.undefined,received:r.parsedType}),de}return ct(e.data)}isEqual(e){return e instanceof Hg}};p(Xi,"ZodUndefined");Xi.create=p(t=>new Xi(x({typeName:"ZodUndefined"},ge(t))),"create");var Xa=Xi,Qi=class ka extends ye{dereference(e){let n=this._def.options.map(r=>r.dereference(e));return new ka(U(x({},this._def),{options:n}))}getReferences(){return Kt(this._def.options.reduce((e,n)=>[...e,...n.getReferences()],[]))}_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 $t(s.ctx.common.issues));return te(n,{code:z.invalid_union,unionErrors:i}),de}if(p(o,"handleResults"),n.common.async)return Promise.all(r.map(async a=>{let i=U(x({},n),{common:U(x({},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=U(x({},n),{common:U(x({},n.common),{issues:[]}),parent:null}),d=l._parseSync({data:n.data,path:n.path,parent:f});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,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 $t(l));return te(n,{code:z.invalid_union,unionErrors:s}),de}}get options(){return this._def.options}isEqual(e){if(!(e instanceof ka))return!1;let n=p((a,i)=>a.isEqual(i),"compare"),r=new tt([...this._def.options],{compare:n}),o=new tt([...e._def.options],{compare:n});return r.isEqual(o)}};p(Qi,"ZodUnion");Qi.create=p((t,e)=>new Qi(x({options:t,typeName:"ZodUnion"},ge(e))),"create");var Qa=Qi,eo=class jg extends ye{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ct(e.data)}isEqual(e){return e instanceof jg}};p(eo,"ZodUnknown");eo.create=p(t=>new eo(x({typeName:"ZodUnknown"},ge(t))),"create");var Cr=eo,to=class $g extends ye{_parse(e){if(this._getType(e)!==ne.undefined){let r=this._getOrReturnCtx(e);return te(r,{code:z.invalid_type,expected:ne.void,received:r.parsedType}),de}return ct(e.data)}isEqual(e){return e instanceof $g}};p(to,"ZodVoid");to.create=p(t=>new to(x({typeName:"ZodVoid"},ge(t))),"create");var Zg=to,gx=/^\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))?$/,Hr=p((t,e,n=!0)=>{if(typeof t!="object")throw new la("Input must be an object");let r=p(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(re.null());else switch(typeof l){case"string":i[s]=gx.test(l)?r(re.string().datetime()):r(re.string());break;case"number":i[s]=r(re.number());break;case"boolean":i[s]=r(re.boolean());break;case"object":Array.isArray(l)?l.length===0?i[s]=r(re.array(re.unknown())):typeof l[0]=="object"?i[s]=r(re.array(Hr(l[0],e,!1))):["string","number","boolean"].includes(typeof l[0])&&(i[s]=r(re.array(re[typeof l[0]]()))):i[s]=r(Hr(l,e,!1));break;default:throw new la(`Unsupported type for key ${s}`)}return i},{}),a=Object.keys(o).length>0;return e?.passtrough||!n&&!a?re.object(o).passthrough():re.object(o)},"objectToZui");function Lg(){return{}}p(Lg,"parseAnyDef");function es(t,e,n,r){r?.errorMessages&&n&&(t.errorMessage=U(x({},t.errorMessage),{[e]:n}))}p(es,"addErrorMessage");function De(t,e,n,r,o){t[e]=n,es(t,e,r,o)}p(De,"setResponseValueAndErrors");function Fg(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=Re(t.type._def,U(x({},e),{currentPath:[...e.currentPath,"items"]}))),t.minLength&&De(o,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&De(o,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(De(o,"minItems",t.exactLength.value,t.exactLength.message,e),De(o,"maxItems",t.exactLength.value,t.exactLength.message,e)),o}p(Fg,"parseArrayDef");function Kg(t,e){let n=x({type:"integer",format:"int64"},t.coerce?{[Se]:{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?De(n,"minimum",r.value,r.message,e):De(n,"exclusiveMinimum",r.value,r.message,e):(r.inclusive||(n.exclusiveMinimum=!0),De(n,"minimum",r.value,r.message,e));break;case"max":e.target==="jsonSchema7"?r.inclusive?De(n,"maximum",r.value,r.message,e):De(n,"exclusiveMaximum",r.value,r.message,e):(r.inclusive||(n.exclusiveMaximum=!0),De(n,"maximum",r.value,r.message,e));break;case"multipleOf":De(n,"multipleOf",r.value,r.message,e);break}return n}p(Kg,"parseBigintDef");function Wg(t){return x({type:"boolean"},t.coerce?{[Se]:{coerce:t.coerce||void 0}}:{})}p(Wg,"parseBooleanDef");function qg(t,e){return Re(t.type._def,e)}p(qg,"parseBrandedDef");var yx=p((t,e)=>Re(t.innerType._def,e),"parseCatchDef");function zg(t,e){return e.dateStrategy=="integer"?mx(t,e):x({type:"string",format:"date-time"},t.coerce?{[Se]:{coerce:t.coerce||void 0}}:{})}p(zg,"parseDateDef");var mx=p((t,e)=>{let n=x({type:"integer",format:"unix-time"},t.coerce?{[Se]:{coerce:t.coerce||void 0}}:{});for(let r of t.checks)switch(r.kind){case"min":e.target==="jsonSchema7"&&De(n,"minimum",r.value,r.message,e);break;case"max":e.target==="jsonSchema7"&&De(n,"maximum",r.value,r.message,e);break}return n},"integerDateParser");function Gg(t,e){return U(x({},Re(t.innerType._def,e)),{default:t.defaultValue()})}p(Gg,"parseDefaultDef");function Vg(t,e){return e.effectStrategy==="input"?Re(t.schema._def,e):{}}p(Vg,"parseEffectsDef");function Jg(t){return{type:"string",enum:t.values}}p(Jg,"parseEnumDef");var hx=p(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"isJsonSchema7AllOfType");function Yg(t,e){let n=[Re(t.left._def,U(x({},e),{currentPath:[...e.currentPath,"allOf","0"]})),Re(t.right._def,U(x({},e),{currentPath:[...e.currentPath,"allOf","1"]}))].filter(a=>!!a),r=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return n.forEach(a=>{if(hx(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=df(s,["additionalProperties"])}else r=void 0;o.push(i)}}),o.length?x({allOf:o},r):void 0}p(Yg,"parseIntersectionDef");function Xg(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}}p(Xg,"parseLiteralDef");var Br={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 ts(t,e){let n=x({type:"string"},t.coerce?{[Se]:{coerce:t.coerce||void 0}}:{});function r(o){return e.patternStrategy==="escape"?vx(o):o}if(p(r,"processPattern"),t.checks)for(let o of t.checks)switch(o.kind){case"min":De(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,o.message,e);break;case"max":De(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":gn(n,"email",o.message,e);break;case"format:idn-email":gn(n,"idn-email",o.message,e);break;case"pattern:zod":Ut(n,Br.email,o.message,e);break}break;case"url":gn(n,"uri",o.message,e);break;case"uuid":gn(n,"uuid",o.message,e);break;case"regex":Ut(n,o.regex.source,o.message,e);break;case"cuid":Ut(n,Br.cuid,o.message,e);break;case"cuid2":Ut(n,Br.cuid2,o.message,e);break;case"startsWith":Ut(n,"^"+r(o.value),o.message,e);break;case"endsWith":Ut(n,r(o.value)+"$",o.message,e);break;case"datetime":gn(n,"date-time",o.message,e);break;case"length":De(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,o.message,e),De(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value,o.message,e);break;case"includes":{Ut(n,r(o.value),o.message,e);break}case"ip":{o.version!=="v6"&&gn(n,"ipv4",o.message,e),o.version!=="v4"&&gn(n,"ipv6",o.message,e);break}case"emoji":Ut(n,Br.emoji,o.message,e);break;case"ulid":{Ut(n,Br.ulid,o.message,e);break}case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}p(ts,"parseStringDef");var vx=p(t=>Array.from(t).map(e=>/[a-zA-Z0-9]/.test(e)?e:`\\${e}`).join(""),"escapeNonAlphaNumeric"),gn=p((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(x({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(x({format:e},n&&r.errorMessages&&{errorMessage:{format:n}}))):De(t,"format",e,n,r)},"addFormat"),Ut=p((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(x({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(x({pattern:e},n&&r.errorMessages&&{errorMessage:{pattern:n}}))):De(t,"pattern",e,n,r)},"addPattern");function ns(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 d;return U(x({},l),{[f]:(d=Re(t.valueType._def,U(x({},e),{currentPath:[...e.currentPath,"properties",f]})))!=null?d:{}})},{}),additionalProperties:!1};let s={type:"object",additionalProperties:(r=Re(t.valueType._def,U(x({},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(ts(t.keyType._def,e)).reduce((f,[d,y])=>d==="type"?f:U(x({},f),{[d]:y}),{});return U(x({},s),{propertyNames:l})}else if(((i=t.keyType)==null?void 0:i._def.typeName)==="ZodEnum")return U(x({},s),{propertyNames:{enum:t.keyType._def.values}});return s}p(ns,"parseRecordDef");function Qg(t,e){if(e.mapStrategy==="record")return ns(t,e);let n=Re(t.keyType._def,U(x({},e),{currentPath:[...e.currentPath,"items","items","0"]}))||{},r=Re(t.valueType._def,U(x({},e),{currentPath:[...e.currentPath,"items","items","1"]}))||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}p(Qg,"parseMapDef");function ey(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")}}p(ey,"parseNativeEnumDef");function ty(){return{not:{}}}p(ty,"parseNeverDef");function ny(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}p(ny,"parseNullDef");var no={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function ry(t,e){if(e.target==="openApi3")return sf(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in no&&(!r._def.checks||!r._def.checks.length))){let r=n.reduce((o,a)=>{let i=no[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 sf(t,e)}p(ry,"parseUnionDef");var sf=p((t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((o,a)=>Re(o._def,U(x({},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"?x({anyOf:n},r):x({oneOf:n},r)},"asUnionOf");function iy(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:no[t.innerType._def.typeName],nullable:!0}:{type:[no[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let r=Re(t.innerType._def,U(x({},e),{currentPath:[...e.currentPath]}));return r&&U(x({},r),{nullable:!0})}let n=Re(t.innerType._def,U(x({},e),{currentPath:[...e.currentPath,"anyOf","0"]}));return n&&{anyOf:[n,{type:"null"}]}}p(iy,"parseNullableDef");function oy(t,e){let n=x({type:"number"},t.coerce?{[Se]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return n;for(let r of t.checks)switch(r.kind){case"int":n.type="integer",es(n,"type",r.message,e);break;case"min":e.target==="jsonSchema7"?r.inclusive?De(n,"minimum",r.value,r.message,e):De(n,"exclusiveMinimum",r.value,r.message,e):(r.inclusive||(n.exclusiveMinimum=!0),De(n,"minimum",r.value,r.message,e));break;case"max":e.target==="jsonSchema7"?r.inclusive?De(n,"maximum",r.value,r.message,e):De(n,"exclusiveMaximum",r.value,r.message,e):(r.inclusive||(n.exclusiveMaximum=!0),De(n,"maximum",r.value,r.message,e));break;case"multipleOf":De(n,"multipleOf",r.value,r.message,e);break}return n}p(oy,"parseNumberDef");function ay(t,e){var n;let r=U(x({type:"object"},Object.entries(t.shape()).reduce((o,[a,i])=>{if(i===void 0||i._def===void 0)return o;let s=Re(i._def,U(x({},e),{currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]}));return s===void 0?o:{properties:U(x({},o.properties),{[a]:s}),required:i.isOptional()?o.required:[...o.required,a]}},{properties:{},required:[]})),{additionalProperties:t.catchall._def.typeName==="ZodNever"?t.unknownKeys==="passthrough":(n=Re(t.catchall._def,U(x({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?n:!0});return r.required.length||delete r.required,r}p(ay,"parseObjectDef");var Tx=p((t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return Re(t.innerType._def,e);let r=Re(t.innerType._def,U(x({},e),{currentPath:[...e.currentPath,"anyOf","1"]}));return r?{anyOf:[{not:{}},r]}:{}},"parseOptionalDef"),_x=p((t,e)=>{if(e.pipeStrategy==="input")return Re(t.in._def,e);if(e.pipeStrategy==="output")return Re(t.out._def,e);let n=Re(t.in._def,U(x({},e),{currentPath:[...e.currentPath,"allOf","0"]})),r=Re(t.out._def,U(x({},e),{currentPath:[...e.currentPath,"allOf",n?"1":"0"]}));return{allOf:[n,r].filter(o=>o!==void 0)}},"parsePipelineDef");function sy(t,e){return Re(t.type._def,e)}p(sy,"parsePromiseDef");function ly(t,e){let r={type:"array",uniqueItems:!0,items:Re(t.valueType._def,U(x({},e),{currentPath:[...e.currentPath,"items"]}))};return t.minSize&&De(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&De(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}p(ly,"parseSetDef");function uy(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>Re(n._def,U(x({},e),{currentPath:[...e.currentPath,"items",`${r}`]}))).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Re(t.rest._def,U(x({},e),{currentPath:[...e.currentPath,"additionalItems"]}))}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>Re(n._def,U(x({},e),{currentPath:[...e.currentPath,"items",`${r}`]}))).reduce((n,r)=>r===void 0?n:[...n,r],[])}}p(uy,"parseTupleDef");function cy(){return{not:{}}}p(cy,"parseUndefinedDef");function fy(){return{}}p(fy,"parseUnknownDef");var bx=p((t,e)=>Re(t.innerType._def,e),"parseReadonlyDef");function dy(t){return{$ref:t.uri}}p(dy,"parseRefDef");function Re(t,e,n=!1){let r=e.seen.get(t);if(r&&!n){let i=wx(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=Bx(t,t.typeName,e);return a&&Ex(t,e,a),o.jsonSchema=a,a}p(Re,"parseDef");var wx=p((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:xx(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"),xx=p((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"),Bx=p((t,e,n)=>{switch(e){case"ZodString":return ts(t,n);case"ZodNumber":return oy(t,n);case"ZodObject":return ay(t,n);case"ZodBigInt":return Kg(t,n);case"ZodBoolean":return Wg(t);case"ZodDate":return zg(t,n);case"ZodUndefined":return cy();case"ZodNull":return ny(n);case"ZodArray":return Fg(t,n);case"ZodUnion":case"ZodDiscriminatedUnion":return ry(t,n);case"ZodIntersection":return Yg(t,n);case"ZodTuple":return uy(t,n);case"ZodRecord":return ns(t,n);case"ZodRef":return dy(t);case"ZodLiteral":return Xg(t,n);case"ZodEnum":return Jg(t);case"ZodNativeEnum":return ey(t);case"ZodNullable":return iy(t,n);case"ZodOptional":return Tx(t,n);case"ZodMap":return Qg(t,n);case"ZodSet":return ly(t,n);case"ZodLazy":return Re(t.getter()._def,n);case"ZodPromise":return sy(t,n);case"ZodNaN":case"ZodNever":return ty();case"ZodEffects":return Vg(t,n);case"ZodAny":return Lg();case"ZodUnknown":return fy();case"ZodDefault":return Gg(t,n);case"ZodBranded":return qg(t,n);case"ZodReadonly":return bx(t,n);case"ZodCatch":return yx(t,n);case"ZodPipeline":return _x(t,n);case"ZodFunction":case"ZodVoid":case"ZodSymbol":return;default:return(r=>{})(e)}},"selectParser"),Ex=p((t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),Object.assign(n,{[Se]:x(x({},t[Se]),n[Se])}),n),"addMeta"),lf={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"},Px=p(t=>typeof t=="string"?U(x({},lf),{name:t}):x(x({},lf),t),"getDefaultOptions"),kx=p(t=>{let e=Px(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return U(x({},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"),Sx=p((t,e)=>{var n;let r=kx(e),o=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[f,d])=>{var y;return U(x({},l),{[f]:(y=Re(d._def,U(x({},r),{currentPath:[...r.basePath,r.definitionPath,f]}),!0))!=null?y:{}})},{}):void 0,a=typeof e=="string"?e:e?.name,i=(n=Re(t._def,a===void 0?r:U(x({},r),{currentPath:[...r.basePath,r.definitionPath,a]}),!1))!=null?n:{},s=a===void 0?o?U(x({},i),{[r.definitionPath]:o}):i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,a].join("/"),[r.definitionPath]:U(x({},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"),rs=p((t,e={target:"openApi3"})=>{let n=Sx(t,e);return e.$schemaUrl===!1?delete n.$schema:typeof e.$schemaUrl=="string"&&(n.$schema=e.$schemaUrl),n},"zuiToJsonSchema"),Ix=["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"],iC=rr.create(["any","string","number","boolean","object","pattern","date","array","target","time","enum"]),Cx=p(t=>ft.create().displayAs({id:"variable",params:x({type:t?.type||"any"},t?.params)}),"variable"),Ax=p(t=>ft.create().displayAs({id:"conversation",params:x({},t?.params)}),"conversation"),Rx=p(t=>ft.create().displayAs({id:"user",params:x({},t?.params)}),"user"),Ox=p(t=>ft.create().displayAs({id:"message",params:x({},t?.params)}),"message"),Mx=p(t=>ft.create().displayAs({id:"agent",params:x({},t?.params)}),"agent"),Dx=p(t=>ft.create().displayAs({id:"event",params:x({},t?.params)}),"event"),Nx=p(t=>ft.create().displayAs({id:"table",params:x({},t?.params)}),"table"),Ux=p(t=>ft.create().displayAs({id:"tablerow",params:x({},t?.params)}),"tablerow"),Hx=p(t=>ft.create().displayAs({id:"intent",params:x({},t?.params)}),"intent"),jx=p(()=>rr.create(Ix).displayAs({id:"dropdown",params:{}}),"aimodel"),$x=p(t=>ft.create().displayAs({id:"datasource",params:x({},t)}),"datasource"),Zx=p(t=>ft.create().displayAs({id:"knowledgebase",params:x({},t)}),"knowledgebase"),Lx={object:Yn.lazycreate},Fx=p((t,e={message:`Input not instance of ${t.name}`})=>ag(n=>n instanceof t,e),"instanceOfType"),py=ft.create,gy=Ja.create,Kx=yg.create,Wx=ja.create,yy=$a.create,qx=Fa.create,zx=Ug.create,Gx=Xa.create,Vx=Va.create,Jx=Pi.create,Yx=Cr.create,Xx=_n.create,Qx=Zg.create,eB=Ur.create,tB=Yn.create,nB=Yn.strictCreate,rB=Qa.create,iB=lg.create,oB=Wa.create,aB=Qn.create,sB=wg.create,lB=Bg.create,uB=yo.create,cB=pg.create,fB=Eg.create,dB=cg.create,pB=qa.create,gB=za.create,yB=rr.create,mB=Ga.create,hB=go.create,uf=bn.create,vB=nn.create,TB=Jn.create,_B=fo.create,bB=bn.createWithPreprocess,wB=Ya.create,xB=p(()=>py().optional(),"ostring"),BB=p(()=>gy().optional(),"onumber"),EB=p(()=>yy().optional(),"oboolean"),PB=ye.fromJsonSchema,kB=ye.fromObject,SB={string:p(t=>ft.create(U(x({},t),{coerce:!0})),"string"),number:p(t=>Ja.create(U(x({},t),{coerce:!0})),"number"),boolean:p(t=>$a.create(U(x({},t),{coerce:!0})),"boolean"),bigint:p(t=>ja.create(U(x({},t),{coerce:!0})),"bigint"),date:p(t=>Fa.create(U(x({},t),{coerce:!0})),"date")},IB=de,q=re,my=p((t,e)=>t.anyOf.length?t.anyOf.length===1?nt(t.anyOf[0],U(x({},e),{path:[...e.path,"anyOf",0]})):`z.union([${t.anyOf.map((n,r)=>nt(n,U(x({},e),{path:[...e.path,"anyOf",r]}))).join(", ")}])`:"z.any()","parseAnyOf"),CB=p(t=>{var e;return(e=t[Se])!=null&&e.coerce?"z.coerce.boolean()":"z.boolean()"},"parseBoolean"),AB=p(t=>"z.any()","parseDefault"),RB=p((t,e)=>`z.union([${t.type.map(n=>nt(U(x({},t),{type:n}),e)).join(", ")}])`,"parseMultipleType"),OB=p((t,e)=>`z.any().refine((value) => !${nt(t.not,U(x({},e),{path:[...e.path,"not"]}))}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`,"parseNot"),MB=p(t=>"z.null()","parseNull"),DB=p(t=>[t.slice(0,t.length/2),t.slice(t.length/2)],"half"),NB=p((t,...e)=>Object.keys(t).reduce((n,r)=>(e.includes(r)||(n[r]=t[r]),n),{}),"omit");function at(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}p(at,"withMessage");var kr=Symbol("Original index"),UB=p(t=>{let e=[];for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="boolean")e.push(r?{[kr]:n}:{[kr]:n,not:{}});else{if(kr in r)return t;e.push(U(x({},r),{[kr]:n}))}}return e},"ensureOriginalIndex");function jr(t,e){if(t.allOf.length===0)return"z.never()";if(t.allOf.length===1){let n=t.allOf[0];return nt(n,U(x({},e),{path:[...e.path,"allOf",n[kr]]}))}else{let[n,r]=DB(UB(t.allOf));return`z.intersection(${jr({allOf:n},e)}, ${jr({allOf:r},e)})`}}p(jr,"parseAllOf");var HB=p((t,e)=>{if(Array.isArray(t.items))return`z.tuple([${t.items.map((r,o)=>nt(r,U(x({},e),{path:[...e.path,"items",o]})))}])`;let n=t.items?`z.array(${nt(t.items,U(x({},e),{path:[...e.path,"items"]}))})`:"z.array(z.any())";return n+=at(t,"minItems",({json:r})=>[`.min(${r}`,", ",")"]),n+=at(t,"maxItems",({json:r})=>[`.max(${r}`,", ",")"]),n},"parseArray"),jB=p(t=>`z.literal(${JSON.stringify(t.const)})`,"parseConst"),$B=p(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"),ZB=p((t,e)=>{let n=nt(t.if,U(x({},e),{path:[...e.path,"if"]})),r=nt(t.then,U(x({},e),{path:[...e.path,"then"]})),o=nt(t.else,U(x({},e),{path:[...e.path,"else"]}));return`z.union([${r}, ${o}]).superRefine((value,ctx) => {
24
24
  const result = ${n}.safeParse(value).success
25
25
  ? ${r}.safeParse(value)
26
- : ${a}.safeParse(value);
26
+ : ${o}.safeParse(value);
27
27
  if (!result.success) {
28
28
  result.error.errors.forEach((error) => ctx.addIssue(error))
29
29
  }
30
- })`},"parseIfThenElse"),DE=d(t=>{var e;let n="z.number()";return(e=t[Ie])!=null&&e.coerce&&(n="z.coerce.number()"),t.type==="integer"?n+=ot(t,"type",()=>[".int(",")"]):n+=ot(t,"format",({value:r})=>{if(r==="int64")return[".int(",")"]}),n+=ot(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+=ot(t,"minimum",({json:r})=>[`.gt(${r}`,", ",")"]):n+=ot(t,"minimum",({json:r})=>[`.gte(${r}`,", ",")"]):typeof t.exclusiveMinimum=="number"&&(n+=ot(t,"exclusiveMinimum",({json:r})=>[`.gt(${r}`,", ",")"])),typeof t.maximum=="number"?t.exclusiveMaximum===!0?n+=ot(t,"maximum",({json:r})=>[`.lt(${r}`,", ",")"]):n+=ot(t,"maximum",({json:r})=>[`.lte(${r}`,", ",")"]):typeof t.exclusiveMaximum=="number"&&(n+=ot(t,"exclusiveMaximum",({json:r})=>[`.lt(${r}`,", ",")"])),n},"parseNumber"),Xo=d((t,e)=>t.oneOf.length?t.oneOf.length===1?nt(t.oneOf[0],H(w({},e),{path:[...e.path,"oneOf",0]})):`z.any().superRefine((x, ctx) => {
31
- const schemas = [${t.oneOf.map((n,r)=>nt(n,H(w({},e),{path:[...e.path,"oneOf",r]}))).join(", ")}];
30
+ })`},"parseIfThenElse"),LB=p(t=>{var e;let n="z.number()";return(e=t[Se])!=null&&e.coerce&&(n="z.coerce.number()"),t.type==="integer"?n+=at(t,"type",()=>[".int(",")"]):n+=at(t,"format",({value:r})=>{if(r==="int64")return[".int(",")"]}),n+=at(t,"multipleOf",({value:r,json:o})=>r===1?n.startsWith("z.number().int(")?void 0:[".int(",")"]:[`.multipleOf(${o}`,", ",")"]),typeof t.minimum=="number"?t.exclusiveMinimum===!0?n+=at(t,"minimum",({json:r})=>[`.gt(${r}`,", ",")"]):n+=at(t,"minimum",({json:r})=>[`.gte(${r}`,", ",")"]):typeof t.exclusiveMinimum=="number"&&(n+=at(t,"exclusiveMinimum",({json:r})=>[`.gt(${r}`,", ",")"])),typeof t.maximum=="number"?t.exclusiveMaximum===!0?n+=at(t,"maximum",({json:r})=>[`.lt(${r}`,", ",")"]):n+=at(t,"maximum",({json:r})=>[`.lte(${r}`,", ",")"]):typeof t.exclusiveMaximum=="number"&&(n+=at(t,"exclusiveMaximum",({json:r})=>[`.lt(${r}`,", ",")"])),n},"parseNumber"),is=p((t,e)=>t.oneOf.length?t.oneOf.length===1?nt(t.oneOf[0],U(x({},e),{path:[...e.path,"oneOf",0]})):`z.any().superRefine((x, ctx) => {
31
+ const schemas = [${t.oneOf.map((n,r)=>nt(n,U(x({},e),{path:[...e.path,"oneOf",r]}))).join(", ")}];
32
32
  const errors = schemas.reduce(
33
33
  (errors: z.ZodError[], schema) =>
34
34
  ((result) => ("error" in result ? [...errors, result.error] : errors))(
@@ -44,15 +44,15 @@ ${v}`.trim();case z.ZodFirstPartyTypeKind.ZodEnum:return s.values.map(jt).join("
44
44
  message: "Invalid input: Should pass single schema",
45
45
  });
46
46
  }
47
- })`:"z.any()","parseOneOf");function fy(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)}: ${nt(s,H(w({},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,g=Array.isArray(t.required)?t.required.includes(i):typeof s=="object"&&s.required===!0;return!f&&!g?`${l}.optional()`:l}).join(", "),n+=" })"):n="z.object({})");let r=t.additionalProperties!==void 0?nt(t.additionalProperties,H(w({},e),{path:[...e.path,"additionalProperties"]})):void 0,a;if(t.patternProperties){let i=Object.fromEntries(Object.entries(t.patternProperties).map(([s,l])=>[s,nt(l,H(w({},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({
47
+ })`:"z.any()","parseOneOf");function hy(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)}: ${nt(s,U(x({},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,d=Array.isArray(t.required)?t.required.includes(i):typeof s=="object"&&s.required===!0;return!f&&!d?`${l}.optional()`:l}).join(", "),n+=" })"):n="z.object({})");let r=t.additionalProperties!==void 0?nt(t.additionalProperties,U(x({},e),{path:[...e.path,"additionalProperties"]})):void 0,o;if(t.patternProperties){let i=Object.fromEntries(Object.entries(t.patternProperties).map(([s,l])=>[s,nt(l,U(x({},e),{path:[...e.path,"patternProperties",s]}))],{}));o="",n?r?o+=`.catchall(z.union([${[...Object.values(i),r].join(", ")}]))`:Object.keys(i).length>1?o+=`.catchall(z.union([${Object.values(i).join(", ")}]))`:o+=`.catchall(${Object.values(i)})`:r?o+=`z.record(z.union([${[...Object.values(i),r].join(", ")}]))`:Object.keys(i).length>1?o+=`z.record(z.union([${Object.values(i).join(", ")}]))`:o+=`z.record(${Object.values(i)})`,o+=`.superRefine((value, ctx) => {
48
+ `,o+=`for (const key in value) {
49
+ `,r&&(t.properties?o+=`let evaluated = [${Object.keys(t.properties).map(s=>JSON.stringify(s)).join(", ")}].includes(key)
50
+ `:o+=`let evaluated = false
51
+ `);for(let s in t.patternProperties)o+="if (key.match(new RegExp("+JSON.stringify(s)+`))) {
52
+ `,r&&(o+=`evaluated = true
53
+ `),o+="const result = "+i[s]+`.safeParse(value[key])
54
+ `,o+=`if (!result.success) {
55
+ `,o+=`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 z.ZodFirstPartyTypeKind.ZodEnum:return s.values.map(jt).join("
60
60
  issues: result.error.issues
61
61
  }
62
62
  })
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({
63
+ `,o+=`}
64
+ `,o+=`}
65
+ `;r&&(o+=`if (!evaluated) {
66
+ `,o+="const result = "+r+`.safeParse(value[key])
67
+ `,o+=`if (!result.success) {
68
+ `,o+=`ctx.addIssue({
69
69
  path: [...ctx.path, key],
70
70
  code: 'custom',
71
71
  message: \`Invalid input: must match catchall schema\`,
@@ -73,19 +73,19 @@ ${v}`.trim();case z.ZodFirstPartyTypeKind.ZodEnum:return s.values.map(jt).join("
73
73
  issues: result.error.issues
74
74
  }
75
75
  })
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 Qe.an.anyOf(t)&&(o+=`.and(${cy(H(w({},t),{anyOf:t.anyOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?H(w({},i),{type:"object"}):i)}),e)})`),Qe.a.oneOf(t)&&(o+=`.and(${Xo(H(w({},t),{oneOf:t.oneOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?H(w({},i),{type:"object"}):i)}),e)})`),Qe.an.allOf(t)&&(o+=`.and(${Dr(H(w({},t),{allOf:t.allOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?H(w({},i),{type:"object"}):i)}),e)})`),o}d(fy,"parseObject");var NE=d(t=>{var e;let n="z.string()";if((e=t[Ie])!=null&&e.coerce){if(t.format==="date-time")return"z.coerce.date()";n="z.coerce.string()"}return n+=ot(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+=ot(t,"pattern",({json:r})=>[`.regex(new RegExp(${r})`,", ",")"]),n+=ot(t,"minLength",({json:r})=>[`.min(${r}`,", ",")"]),n+=ot(t,"maxLength",({json:r})=>[`.max(${r}`,", ",")"]),n},"parseString"),HE=d((t,e)=>`${nt(AE(t,"nullable"),e,!0)}.nullable()`,"parseNullable"),UE=d(t=>`z.ref('${t.$ref}')`,"parseRef"),jE=d((t,e)=>{var n,r;if(t.oneOf.length<=1||!((n=t.discriminator)!=null&&n.propertyName))return Xo(t,e);let a=t.oneOf.map((o,i)=>nt(o,H(w({},e),{path:[...e.path,"oneOf",i]})));return`z.discriminatedUnion("${(r=t.discriminator)==null?void 0:r.propertyName}", [${a.join(", ")}])`},"parseDiscriminator"),nt=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=LE(t,e);return n||(a=$E(t,a),e.withoutDefaults||(a=ZE(t,a))),r.r=a,a},"parseSchema"),$E=d((t,e)=>(t.description&&(e+=`.describe(${JSON.stringify(t.description)})`),e),"addMeta"),ZE=d((t,e)=>(t.default!==void 0&&(e+=`.default(${JSON.stringify(t.default)})`),e),"addDefaults"),LE=d((t,e)=>Qe.a.nullable(t)?HE(t,e):Qe.an.object(t)?fy(t,e):Qe.an.array(t)?RE(t,e):Qe.an.anyOf(t)?cy(t,e):Qe.an.allOf(t)?Dr(t,e):Qe.a.discriminator(t)?jE(t,e):Qe.a.oneOf(t)?Xo(t,e):Qe.a.not(t)?PE(t,e):Qe.an.enum(t)?OE(t):Qe.a.const(t)?kE(t):Qe.a.multipleType(t)?BE(t,e):Qe.a.primitive(t,"string")?NE(t):Qe.a.primitive(t,"number")||Qe.a.primitive(t,"integer")?DE(t):Qe.a.primitive(t,"boolean")?wE(t):Qe.a.primitive(t,"null")?IE(t):Qe.a.conditional(t)?ME(t,e):Qe.a.ref(t)?UE(t):EE(t),"selectParser"),Qe={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=>Boolean("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")}},FE=d(t=>{let e;try{e=new Function("z",`return ${t}`)(z)}catch(n){return{sucess:!1,error:`Failed to evaluate schema: ${(n instanceof Error?n:new Error(String(n))).message}`}}return e instanceof z.ZodType?{sucess:!0,value:e}:{sucess:!1,error:`String "${t}" does not evaluate to a Zod schema`}},"evalZuiString"),KE=d(t=>nt(t,{seen:new Map,path:[]}),"jsonSchemaToZodStr"),qE=d(t=>{let e=KE(t);e=e.replaceAll("errors: z.ZodError[]","errors");let n=FE(e);if(!n.sucess)throw new wf(n.error);return n.value},"jsonSchemaToZod"),Er=d((t,e)=>{var n,r;if(e[Ie]&&t._def&&(t._def[Ie]=e[Ie]),((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]&&Er(i[a],o)}),((r=t._def)==null?void 0:r.typeName)==="ZodRecord"&&e.type==="object"&&e.additionalProperties&&Er(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&&Er(o,a)}else Array.isArray(a)&&a.forEach((o,i)=>{let s=t._def;s.typeName===re.ZodFirstPartyTypeKind.ZodTuple&&Er(s.items[i],o)})}},"applyZuiPropsRecursively"),fa=d(t=>{let e=qE(t);return Er(e,t),e},"jsonSchemaToZui"),dy=class extends Yn.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("Uncaught error:",e,n)}render(){return this.state.hasError&&this.props.fallback?Yn.default.createElement(this.props.fallback,{error:this.state.error,schema:this.props.fieldSchema}):this.props.children}};d(dy,"ErrorBoundary");var Ir=dy;function zE(t,e){return n=>Yn.default.createElement(Ir,{fallback:e,fieldSchema:n.fieldSchema,path:n.path},Yn.default.createElement(t,w({},n)))}d(zE,"withErrorBoundary");var gi=d(t=>{var e=t,{components:n,fieldSchema:r,path:a,required:o,fallback:i}=e,s=of(e,["components","fieldSchema","path","required","fallback"]),l,f;let{formData:g,disabled:y,hidden:p,handlePropertyChange:m,addArrayItem:_,removeArrayItem:E,formErrors:B,formValid:v}=uf(r,a),I=(0,dt.useMemo)(()=>gn(g,a),[g,a]),P=(0,dt.useMemo)(()=>eT(n,r),[r,n]),{discriminator:D,discriminatedSchema:$,discriminatorValue:ae}=Yv(r,a);if(!P||p===!0)return null;let{Component:X,type:ue}=P,ee={type:ue,componentID:P.id,scope:a.join("."),context:{path:a,readonly:!1,formData:g,formErrors:B,formValid:v,updateForm:m,updateFormData:d(Se=>m([],Se),"updateFormData")},onChange:d(Se=>m(a,Se),"onChange"),disabled:y,errors:B?.filter(Se=>Se.path===a)||[],label:((l=r[Ie])==null?void 0:l.title)||eo(((f=a[a.length-1])==null?void 0:f.toString())||""),params:P.params,schema:r,zuiProps:r[Ie]};if(r.type==="array"&&ue==="array"){let Se=X,$e=ee.schema,Ne=Array.isArray(I)||typeof I=="object"?I:[],Me=w(H(w({},ee),{type:ue,schema:$e,data:Ne,addItem:d(We=>_(a,We),"addItem"),removeItem:d(We=>E(a,We),"removeItem")}),s);return Array.isArray(r.items)?null:dt.default.createElement(Se,H(w({key:ee.scope},Me),{isArrayChild:Me.isArrayChild}),Array.isArray(Me.data)?Me.data.map((We,Ae)=>{let me=[...a,Ae.toString()];return dt.default.createElement(Ir,{key:me.join("."),fallback:i,fieldSchema:r.items,path:me},dt.default.createElement(gi,{key:me.join("."),components:n,fieldSchema:r.items,path:me,required:o,isArrayChild:!0,index:Ae,removeSelf:()=>E(a,Ae),fallback:i}))}):[])}if(r.type==="object"&&ue==="object"&&r.properties){let Se=X,$e=w(H(w({},ee),{type:ue,schema:ee.schema,data:I||{}}),s);return dt.default.createElement(Se,H(w({key:ee.scope},$e),{isArrayChild:$e.isArrayChild}),Object.entries(r.properties).map(([Ne,Me])=>{var We;let Ae=[...a,Ne];return dt.default.createElement(Ir,{key:Ae.join("."),fallback:i,fieldSchema:Me,path:Ae},dt.default.createElement(gi,{key:Ae.join("."),components:n,fieldSchema:Me,path:Ae,required:((We=r.required)==null?void 0:We.includes(Ne))||!1,isArrayChild:!1,fallback:i}))}))}if(ue==="discriminatedUnion"){let Se=X,$e=w(H(w({},ee),{type:ue,schema:ee.schema,data:I||{},discriminatorKey:D?.key||null,discriminatorLabel:eo(D?.key||"Unknown"),discriminatorOptions:D?.values||null,discriminatorValue:ae,setDiscriminator:d(Ne=>{if(!D?.key){console.warn("No discriminator key found, cannot set discriminator");return}m(a,{[D.key]:Ne})},"setDiscriminator")}),s);return dt.default.createElement(Se,H(w({key:ee.scope},$e),{isArrayChild:$e.isArrayChild}),$&&dt.default.createElement(Ir,{key:a.join("."),fallback:i,fieldSchema:$,path:a},dt.default.createElement(gi,{components:n,fieldSchema:$,path:a,required:o,isArrayChild:!1,fallback:i})))}let ie=X,Oe=w(H(w({},ee),{type:ue,schema:ee.schema,config:{},required:o,data:I,description:r.description}),s);return dt.default.createElement(ie,w({},Oe))},"FormElementRenderer"),GA=d(({schema:t,components:e,onChange:n,value:r,disableValidation:a,fallback:o,dataTransform:i,onValidation:s})=>{let[l,f]=(0,Zt.useState)(r);return(0,Zt.useEffect)(()=>{n(l)},[l]),(0,Zt.useEffect)(()=>{let g=Kn(t);f(y=>mi(g,y))},[JSON.stringify(t),f]),Zt.default.createElement(Jv,{formData:l,setFormData:f,formSchema:t,disableValidation:a||!1,dataTransform:i,onValidation:s},Zt.default.createElement(Ir,{fallback:o,fieldSchema:t,path:[]},Zt.default.createElement(gi,{components:e,fieldSchema:t,path:[],fallback:o,required:!0,isArrayChild:!1})))},"ZuiForm"),VA={string:{},number:{slider:{id:"slider",params:z.object({})}},boolean:{switch:{id:"switch",params:z.object({})}},array:{},object:{},discriminatedUnion:{}},WA={errors:bf,jsonSchemaToZui:fa,zuiToJsonSchema:Yo,objectToZui:Mr,toTypescript:hi,toTypescriptSchema:Ro};var Nr=(t,e)=>{let n=t._def,r=e._def;if(n.typeName===re.ZodFirstPartyTypeKind.ZodObject&&r.typeName===re.ZodFirstPartyTypeKind.ZodObject){let a=n.shape(),o=r.shape();return re.object({...a,...o})}if(n.typeName===re.ZodFirstPartyTypeKind.ZodRecord&&r.typeName===re.ZodFirstPartyTypeKind.ZodRecord)return re.record(re.intersection(n.valueType,r.valueType));throw new Error("Cannot merge object schemas with record schemas")},py=re;var ft=re.string().min(1),yy=re.object({text:ft}),my=re.object({markdown:ft}),hy=re.object({imageUrl:ft}),vy=re.object({audioUrl:ft}),Ty=re.object({videoUrl:ft}),by=re.object({fileUrl:ft,title:ft.optional()}),_y=re.object({latitude:re.number(),longitude:re.number(),address:re.string().optional(),title:re.string().optional()}),xy=re.object({title:ft,subtitle:ft.optional(),imageUrl:ft.optional(),actions:re.array(re.object({action:re.enum(["postback","url","say"]),label:ft,value:ft}))}),gy=re.object({text:ft,options:re.array(re.object({label:ft,value:ft}))}),GE=re.object({items:re.array(xy)}),VE=re.union([re.object({type:re.literal("text"),payload:yy}),re.object({type:re.literal("markdown"),payload:my}),re.object({type:re.literal("image"),payload:hy}),re.object({type:re.literal("audio"),payload:vy}),re.object({type:re.literal("video"),payload:Ty}),re.object({type:re.literal("file"),payload:by}),re.object({type:re.literal("location"),payload:_y})]),WE=re.object({items:re.array(VE)}),JE={schema:my},YE={text:{schema:yy},image:{schema:hy},audio:{schema:vy},video:{schema:Ty},file:{schema:by},location:{schema:_y},carousel:{schema:GE},card:{schema:xy},dropdown:{schema:gy},choice:{schema:gy},bloc:{schema:WE}};R();O();k();var da="x-bot-id",Ey="x-bot-user-id",By="x-integration-id",Py="x-webhook-id",Iy="x-bp-configuration-type",pa="x-bp-configuration",ga="x-bp-operation",Sy="x-bp-type";R();O();k();import{isNode as XI}from"browser-or-node";R();O();k();var tr=console;function It(t){if(!t.body)throw new Error("Missing body");return JSON.parse(t.body)}async function Na(t,e=8072,n=nS){if(!XI)throw new Error("This function can only be called in Node.js");let a=(Ph(),Av(Bh)).createServer(async(o,i)=>{try{let s=await QI(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){tr.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 QI(t){let e=await tS(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:eS(r.search,"?"),headers:n,method:t.method?.toUpperCase()??"GET"}}function eS(t,e){return t.indexOf(e)===0?t.slice(e.length):t}async function tS(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 nS(t){tr.info(`Listening on port ${t}`)}import{isApiError as qD,RuntimeError as zD}from"@botpress/client";R();O();k();R();O();k();R();O();k();R();O();k();var ze={};Dn(ze,{mapValues:()=>iS,mergeRecords:()=>oS,pairs:()=>Ws,stripUndefinedProps:()=>aS,values:()=>rS});R();O();k();var Ws=t=>Object.entries(t),rS=t=>Object.values(t),iS=(t,e)=>Object.fromEntries(Ws(t).map(([n,r])=>[n,e(r,n)])),aS=t=>Object.fromEntries(Ws(t).filter(([,e])=>e!==void 0)),oS=(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 Re={};Dn(Re,{safePush:()=>sS,unique:()=>lS});R();O();k();var sS=(t,...e)=>t?[...t,...e]:[...e],lS=t=>Array.from(new Set(t));R();O();k();var kn={};Dn(kn,{setName:()=>uS});R();O();k();var uS=(t,e)=>(Object.defineProperty(t,"name",{value:e}),t);var Ih=t=>{let{name:e,version:n}=t,r={actions:{},events:{},channels:{}},a={name:e,version:n,entities:ze.mapValues(t.entities,i=>({name:i.name})),actions:{},events:{},channels:{}},o=ze.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),g=t.actions?.[i]?.name??i;r.actions[g]={...s,...t.actions?.[i]??{},input:{schema:l},output:{schema:f}},a.actions[i]={name:g}}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[g,y]of Object.entries(s.messages)){let p=y.schema.dereference(o);l[g]={...y,schema:p}}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}};R();O();k();var Ha=Symbol("schemaName"),Sh=t=>t?ze.mapValues(t,(n,r)=>({...n,[Ha]:r})):{},Ah=t=>Ha in t&&t[Ha]!==void 0,Ch=t=>t[Ha];R();O();k();var Js=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}name;version;title;description;icon;readme;configuration;configurations;events;actions;channels;states;user;secrets;identifier;entities;interfaces;__advanced;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(p=>p.name),f=l.length===0?e.name:`${e.name}<${l.join(",")}>`,{resolved:g,statement:y}=Ih({...e,entities:r,actions:ze.stripUndefinedProps(a),events:ze.stripUndefinedProps(o),channels:ze.stripUndefinedProps(i)});return s.actions=ze.mergeRecords(s.actions??{},g.actions,this._mergeActions),s.channels=ze.mergeRecords(s.channels??{},g.channels,this._mergeChannels),s.events=ze.mergeRecords(s.events??{},g.events,this._mergeEvents),s.interfaces[f]={id:e.id,...y},this}_callBuilder(e,n){let a={entities:Sh(this.entities)},o=n(a),i=ze.pairs(o.entities).find(([l,f])=>!Ah(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:ze.mapValues(o.entities,l=>({name:Ch(l),schema:l.schema})),actions:o.actions??{},events:o.events??{},channels:o.channels??{}}}_mergeActions=(e,n)=>({...e,...n,input:{schema:Nr(e.input.schema,n.input.schema)},output:{schema:Nr(e.input.schema,n.output.schema)}});_mergeEvents=(e,n)=>({...e,...n,schema:Nr(e.schema,n.schema)});_mergeChannels=(e,n)=>{let r=ze.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:Nr(e.schema,n.schema)})};R();O();k();R();O();k();import{isApiError as NS,Client as HS,RuntimeError as pv}from"@botpress/client";R();O();k();import{axiosRetry as cS}from"@botpress/client";var Ua={retries:3,retryCondition:t=>cS.isNetworkOrIdempotentRequestError(t)||[429,502].includes(t.response?.status??0),retryDelay:t=>t*1e3};R();O();k();R();O();k();var qr=class{constructor(e){this._client=e}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);updateMessage=e=>this._client.updateMessage(e);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)};R();O();k();var ja=class{_cost=0;get cost(){return this._cost}setCost(e){this._cost=e}toJSON(){return{cost:this.cost}}};R();O();k();var fS=re.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),Rh=t=>{let e=t[da],n=t[Ey],r=t[By],a=t[Py],o=t[Iy],i=t[pa],s=fS.parse(t[ga]);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(!a)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:a,operation:s,configurationType:o??null,configuration:i?JSON.parse(W.from(i,"base64").toString("utf-8")):{}}};R();O();k();R();O();k();R();O();k();R();O();k();var Ys={},kh=!1;function hl(){return kh||(kh=!0,Ys=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}),Ys}var Xs={},Oh=!1;function dS(){return Oh||(Oh=!0,Xs=Error),Xs}var Qs={},Mh=!1;function pS(){return Mh||(Mh=!0,Qs=EvalError),Qs}var el={},Dh=!1;function gS(){return Dh||(Dh=!0,el=RangeError),el}var tl={},Nh=!1;function yS(){return Nh||(Nh=!0,tl=ReferenceError),tl}var nl={},Hh=!1;function Qh(){return Hh||(Hh=!0,nl=SyntaxError),nl}var rl={},Uh=!1;function $a(){return Uh||(Uh=!0,rl=TypeError),rl}var il={},jh=!1;function mS(){return jh||(jh=!0,il=URIError),il}var al={},$h=!1;function hS(){if($h)return al;$h=!0;var t=typeof Symbol<"u"&&Symbol,e=hl();return al=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},al}var ol={},Zh=!1;function vS(){if(Zh)return ol;Zh=!0;var t={__proto__:null,foo:{}},e=Object;return ol=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},ol}var sl={},Lh=!1;function TS(){if(Lh)return sl;Lh=!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 g=[],y=0;y<l.length;y+=1)g[y]=l[y];for(var p=0;p<f.length;p+=1)g[p+l.length]=f[p];return g},o=function(l,f){for(var g=[],y=f,p=0;y<l.length;y+=1,p+=1)g[p]=l[y];return g},i=function(s,l){for(var f="",g=0;g<s.length;g+=1)f+=s[g],g+1<s.length&&(f+=l);return f};return sl=function(l){var f=this;if(typeof f!="function"||e.apply(f)!==r)throw new TypeError(t+f);for(var g=o(arguments,1),y,p=function(){if(this instanceof y){var v=f.apply(this,a(g,arguments));return Object(v)===v?v:this}return f.apply(l,a(g,arguments))},m=n(0,f.length-g.length),_=[],E=0;E<m;E++)_[E]="$"+E;if(y=Function("binder","return function ("+i(_,",")+"){ return binder.apply(this,arguments); }")(p),f.prototype){var B=function(){};B.prototype=f.prototype,y.prototype=new B,B.prototype=null}return y},sl}var ll={},Fh=!1;function vl(){if(Fh)return ll;Fh=!0;var t=TS();return ll=Function.prototype.bind||t,ll}var ul={},Kh=!1;function bS(){if(Kh)return ul;Kh=!0;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=vl();return ul=n.call(t,e),ul}var cl={},qh=!1;function Gr(){if(qh)return cl;qh=!0;var t,e=dS(),n=pS(),r=gS(),a=yS(),o=Qh(),i=$a(),s=mS(),l=Function,f=function(Ae){try{return l('"use strict"; return ('+Ae+").constructor;")()}catch{}},g=Object.getOwnPropertyDescriptor;if(g)try{g({},"")}catch{g=null}var y=function(){throw new i},p=g?function(){try{return arguments.callee,y}catch{try{return g(arguments,"callee").get}catch{return y}}}():y,m=hS()(),_=vS()(),E=Object.getPrototypeOf||(_?function(Ae){return Ae.__proto__}:null),B={},v=typeof Uint8Array>"u"||!E?t:E(Uint8Array),I={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":m&&E?E([][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%":m&&E?E(E([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!m||!E?t:E(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"||!m||!E?t:E(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m&&E?E(""[Symbol.iterator]()):t,"%Symbol%":m?Symbol:t,"%SyntaxError%":o,"%ThrowTypeError%":p,"%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(E)try{null.error}catch(Ae){var P=E(E(Ae));I["%Error.prototype%"]=P}var D=function Ae(me){var Pe;if(me==="%AsyncFunction%")Pe=f("async function () {}");else if(me==="%GeneratorFunction%")Pe=f("function* () {}");else if(me==="%AsyncGeneratorFunction%")Pe=f("async function* () {}");else if(me==="%AsyncGenerator%"){var ce=Ae("%AsyncGeneratorFunction%");ce&&(Pe=ce.prototype)}else if(me==="%AsyncIteratorPrototype%"){var he=Ae("%AsyncGenerator%");he&&E&&(Pe=E(he.prototype))}return I[me]=Pe,Pe},$={__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=vl(),X=bS(),ue=ae.call(Function.call,Array.prototype.concat),ee=ae.call(Function.apply,Array.prototype.splice),ie=ae.call(Function.call,String.prototype.replace),Oe=ae.call(Function.call,String.prototype.slice),Se=ae.call(Function.call,RegExp.prototype.exec),$e=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ne=/\\(\\)?/g,Me=function(me){var Pe=Oe(me,0,1),ce=Oe(me,-1);if(Pe==="%"&&ce!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(ce==="%"&&Pe!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var he=[];return ie(me,$e,function(M,Z,F,fe){he[he.length]=F?ie(fe,Ne,"$1"):Z||M}),he},We=function(me,Pe){var ce=me,he;if(X($,ce)&&(he=$[ce],ce="%"+he[0]+"%"),X(I,ce)){var M=I[ce];if(M===B&&(M=D(ce)),typeof M>"u"&&!Pe)throw new i("intrinsic "+me+" exists, but is not available. Please file an issue!");return{alias:he,name:ce,value:M}}throw new o("intrinsic "+me+" does not exist!")};return cl=function(me,Pe){if(typeof me!="string"||me.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Pe!="boolean")throw new i('"allowMissing" argument must be a boolean');if(Se(/^%?[^%]*%?$/,me)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ce=Me(me),he=ce.length>0?ce[0]:"",M=We("%"+he+"%",Pe),Z=M.name,F=M.value,fe=!1,ve=M.alias;ve&&(he=ve[0],ee(ce,ue([0,1],ve)));for(var C=1,S=!0;C<ce.length;C+=1){var j=ce[C],V=Oe(j,0,1),oe=Oe(j,-1);if((V==='"'||V==="'"||V==="`"||oe==='"'||oe==="'"||oe==="`")&&V!==oe)throw new o("property names with quotes must have matching quotes");if((j==="constructor"||!S)&&(fe=!0),he+="."+j,Z="%"+he+"%",X(I,Z))F=I[Z];else if(F!=null){if(!(j in F)){if(!Pe)throw new i("base intrinsic for "+me+" exists, but the property is not available.");return}if(g&&C+1>=ce.length){var b=g(F,j);S=!!b,S&&"get"in b&&!("originalValue"in b.get)?F=b.get:F=F[j]}else S=X(F,j),F=F[j];S&&!fe&&(I[Z]=F)}}return F},cl}var fl={},zh=!1;function Tl(){if(zh)return fl;zh=!0;var t=Gr(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return fl=e,fl}var dl={},Gh=!1;function Za(){if(Gh)return dl;Gh=!0;var t=Gr(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return dl=e,dl}var pl={},Vh=!1;function _S(){if(Vh)return pl;Vh=!0;var t=Tl(),e=Qh(),n=$a(),r=Za();return pl=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,g=arguments.length>5?arguments[5]:null,y=arguments.length>6?arguments[6]:!1,p=!!r&&r(o,i);if(t)t(o,i,{configurable:g===null&&p?p.configurable:!g,enumerable:l===null&&p?p.enumerable:!l,value:s,writable:f===null&&p?p.writable:!f});else if(y||!l&&!f&&!g)o[i]=s;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},pl}var gl={},Wh=!1;function xS(){if(Wh)return gl;Wh=!0;var t=Tl(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},gl=e,gl}var yl={},Jh=!1;function wS(){if(Jh)return yl;Jh=!0;var t=Gr(),e=_S(),n=xS()(),r=Za(),a=$a(),o=t("%Math.floor%");return yl=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],g=!0,y=!0;if("length"in s&&r){var p=r(s,"length");p&&!p.configurable&&(g=!1),p&&!p.writable&&(y=!1)}return(g||y||!f)&&(n?e(s,"length",l,!0,!0):e(s,"length",l)),s},yl}var zr={},Yh=!1;function bl(){if(Yh)return zr;Yh=!0;var t=vl(),e=Gr(),n=wS(),r=$a(),a=e("%Function.prototype.apply%"),o=e("%Function.prototype.call%"),i=e("%Reflect.apply%",!0)||t.call(o,a),s=Tl(),l=e("%Math.max%");zr=function(y){if(typeof y!="function")throw new r("a function is required");var p=i(t,o,arguments);return n(p,1+l(0,y.length-(arguments.length-1)),!0)};var f=function(){return i(t,a,arguments)};return s?s(zr,"apply",{value:f}):zr.apply=f,zr}var ml={},Xh=!1;function _l(){if(Xh)return ml;Xh=!0;var t=Gr(),e=bl(),n=e(t("String.prototype.indexOf"));return ml=function(a,o){var i=t(a,!!o);return typeof i=="function"&&n(a,".prototype.")>-1?e(i):i},ml}Qo();ms();var xl={},ev=!1;function kl(){if(ev)return xl;ev=!0;var t=hl();return xl=function(){return t()&&!!Symbol.toStringTag},xl}var wl={},tv=!1;function ES(){if(tv)return wl;tv=!0;var t=kl()(),e=_l(),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,wl=o?r:a,wl}var El={},nv=!1;function BS(){if(nv)return El;nv=!0;var t=Object.prototype.toString,e=Function.prototype.toString,n=/^\s*(?:function)?\*/,r=kl()(),a=Object.getPrototypeOf,o=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(!a)return!1;if(typeof i>"u"){var g=o();i=g?a(g):!1}return a(l)===i},El}var Bl={},rv=!1;function PS(){if(rv)return Bl;rv=!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(I){I!==r&&(e=null)}else e=null;var a=/^\s*class\b/,o=function(P){try{var D=t.call(P);return a.test(D)}catch{return!1}},i=function(P){try{return o(P)?!1:(t.call(P),!0)}catch{return!1}},s=Object.prototype.toString,l="[object Object]",f="[object Function]",g="[object GeneratorFunction]",y="[object HTMLAllCollection]",p="[object HTML document.all class]",m="[object HTMLCollection]",_=typeof Symbol=="function"&&!!Symbol.toStringTag,E=!(0 in[,]),B=function(){return!1};if(typeof document=="object"){var v=document.all;s.call(v)===s.call(document.all)&&(B=function(P){if((E||!P)&&(typeof P>"u"||typeof P=="object"))try{var D=s.call(P);return(D===y||D===p||D===m||D===l)&&P("")==null}catch{}return!1})}return Bl=e?function(P){if(B(P))return!0;if(!P||typeof P!="function"&&typeof P!="object")return!1;try{e(P,null,n)}catch(D){if(D!==r)return!1}return!o(P)&&i(P)}:function(P){if(B(P))return!0;if(!P||typeof P!="function"&&typeof P!="object")return!1;if(_)return i(P);if(o(P))return!1;var D=s.call(P);return D!==f&&D!==g&&!/^\[object HTML/.test(D)?!1:i(P)},Bl}var Pl={},iv=!1;function IS(){if(iv)return Pl;iv=!0;var t=PS(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(l,f,g){for(var y=0,p=l.length;y<p;y++)n.call(l,y)&&(g==null?f(l[y],y,l):f.call(g,l[y],y,l))},a=function(l,f,g){for(var y=0,p=l.length;y<p;y++)g==null?f(l.charAt(y),y,l):f.call(g,l.charAt(y),y,l)},o=function(l,f,g){for(var y in l)n.call(l,y)&&(g==null?f(l[y],y,l):f.call(g,l[y],y,l))},i=function(l,f,g){if(!t(f))throw new TypeError("iterator must be a function");var y;arguments.length>=3&&(y=g),e.call(l)==="[object Array]"?r(l,f,y):typeof l=="string"?a(l,f,y):o(l,f,y)};return Pl=i,Pl}var Il={},av=!1;function SS(){return av||(av=!0,Il=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Il}var Sl={},ov=!1,AS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function CS(){if(ov)return Sl;ov=!0;var t=SS(),e=typeof globalThis>"u"?AS:globalThis;return Sl=function(){for(var r=[],a=0;a<t.length;a++)typeof e[t[a]]=="function"&&(r[r.length]=t[a]);return r},Sl}var Al={},sv=!1,RS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function dv(){if(sv)return Al;sv=!0;var t=IS(),e=CS(),n=bl(),r=_l(),a=Za(),o=r("Object.prototype.toString"),i=kl()(),s=typeof globalThis>"u"?RS:globalThis,l=e(),f=r("String.prototype.slice"),g=Object.getPrototypeOf,y=r("Array.prototype.indexOf",!0)||function(B,v){for(var I=0;I<B.length;I+=1)if(B[I]===v)return I;return-1},p={__proto__:null};i&&a&&g?t(l,function(E){var B=new s[E];if(Symbol.toStringTag in B){var v=g(B),I=a(v,Symbol.toStringTag);if(!I){var P=g(v);I=a(P,Symbol.toStringTag)}p["$"+E]=n(I.get)}}):t(l,function(E){var B=new s[E],v=B.slice||B.set;v&&(p["$"+E]=n(v))});var m=function(B){var v=!1;return t(p,function(I,P){if(!v)try{"$"+I(B)===P&&(v=f(P,1))}catch{}}),v},_=function(B){var v=!1;return t(p,function(I,P){if(!v)try{I(B),v=f(P,1)}catch{}}),v};return Al=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:_(B)}return a?m(B):null},Al}var Cl={},lv=!1;function kS(){if(lv)return Cl;lv=!0;var t=dv();return Cl=function(n){return!!t(n)},Cl}var _e={},uv=!1;function OS(){if(uv)return _e;uv=!0;var t=ES(),e=BS(),n=dv(),r=kS();function a(U){return U.call.bind(U)}var o=typeof BigInt<"u",i=typeof Symbol<"u",s=a(Object.prototype.toString),l=a(Number.prototype.valueOf),f=a(String.prototype.valueOf),g=a(Boolean.prototype.valueOf);if(o)var y=a(BigInt.prototype.valueOf);if(i)var p=a(Symbol.prototype.valueOf);function m(U,Et){if(typeof U!="object")return!1;try{return Et(U),!0}catch{return!1}}_e.isArgumentsObject=t,_e.isGeneratorFunction=e,_e.isTypedArray=r;function _(U){return typeof Promise<"u"&&U instanceof Promise||U!==null&&typeof U=="object"&&typeof U.then=="function"&&typeof U.catch=="function"}_e.isPromise=_;function E(U){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(U):r(U)||M(U)}_e.isArrayBufferView=E;function B(U){return n(U)==="Uint8Array"}_e.isUint8Array=B;function v(U){return n(U)==="Uint8ClampedArray"}_e.isUint8ClampedArray=v;function I(U){return n(U)==="Uint16Array"}_e.isUint16Array=I;function P(U){return n(U)==="Uint32Array"}_e.isUint32Array=P;function D(U){return n(U)==="Int8Array"}_e.isInt8Array=D;function $(U){return n(U)==="Int16Array"}_e.isInt16Array=$;function ae(U){return n(U)==="Int32Array"}_e.isInt32Array=ae;function X(U){return n(U)==="Float32Array"}_e.isFloat32Array=X;function ue(U){return n(U)==="Float64Array"}_e.isFloat64Array=ue;function ee(U){return n(U)==="BigInt64Array"}_e.isBigInt64Array=ee;function ie(U){return n(U)==="BigUint64Array"}_e.isBigUint64Array=ie;function Oe(U){return s(U)==="[object Map]"}Oe.working=typeof Map<"u"&&Oe(new Map);function Se(U){return typeof Map>"u"?!1:Oe.working?Oe(U):U instanceof Map}_e.isMap=Se;function $e(U){return s(U)==="[object Set]"}$e.working=typeof Set<"u"&&$e(new Set);function Ne(U){return typeof Set>"u"?!1:$e.working?$e(U):U instanceof Set}_e.isSet=Ne;function Me(U){return s(U)==="[object WeakMap]"}Me.working=typeof WeakMap<"u"&&Me(new WeakMap);function We(U){return typeof WeakMap>"u"?!1:Me.working?Me(U):U instanceof WeakMap}_e.isWeakMap=We;function Ae(U){return s(U)==="[object WeakSet]"}Ae.working=typeof WeakSet<"u"&&Ae(new WeakSet);function me(U){return Ae(U)}_e.isWeakSet=me;function Pe(U){return s(U)==="[object ArrayBuffer]"}Pe.working=typeof ArrayBuffer<"u"&&Pe(new ArrayBuffer);function ce(U){return typeof ArrayBuffer>"u"?!1:Pe.working?Pe(U):U instanceof ArrayBuffer}_e.isArrayBuffer=ce;function he(U){return s(U)==="[object DataView]"}he.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&he(new DataView(new ArrayBuffer(1),0,1));function M(U){return typeof DataView>"u"?!1:he.working?he(U):U instanceof DataView}_e.isDataView=M;var Z=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function F(U){return s(U)==="[object SharedArrayBuffer]"}function fe(U){return typeof Z>"u"?!1:(typeof F.working>"u"&&(F.working=F(new Z)),F.working?F(U):U instanceof Z)}_e.isSharedArrayBuffer=fe;function ve(U){return s(U)==="[object AsyncFunction]"}_e.isAsyncFunction=ve;function C(U){return s(U)==="[object Map Iterator]"}_e.isMapIterator=C;function S(U){return s(U)==="[object Set Iterator]"}_e.isSetIterator=S;function j(U){return s(U)==="[object Generator]"}_e.isGeneratorObject=j;function V(U){return s(U)==="[object WebAssembly.Module]"}_e.isWebAssemblyCompiledModule=V;function oe(U){return m(U,l)}_e.isNumberObject=oe;function b(U){return m(U,f)}_e.isStringObject=b;function x(U){return m(U,g)}_e.isBooleanObject=x;function q(U){return o&&m(U,y)}_e.isBigIntObject=q;function Q(U){return i&&m(U,p)}_e.isSymbolObject=Q;function He(U){return oe(U)||b(U)||x(U)||q(U)||Q(U)}_e.isBoxedPrimitive=He;function Te(U){return typeof Uint8Array<"u"&&(ce(U)||fe(U))}return _e.isAnyArrayBuffer=Te,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(U){Object.defineProperty(_e,U,{enumerable:!1,value:function(){throw new Error(U+" is not supported in userland")}})}),_e}var Rl={},cv=!1;function MS(){return cv||(cv=!0,Rl=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),Rl}var xe={},fv=!1,Vr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function DS(){if(fv)return xe;fv=!0;var t=Pt,e=Object.getOwnPropertyDescriptors||function(Z){for(var F=Object.keys(Z),fe={},ve=0;ve<F.length;ve++)fe[F[ve]]=Object.getOwnPropertyDescriptor(Z,F[ve]);return fe},n=/%[sdj%]/g;xe.format=function(M){if(!$(M)){for(var Z=[],F=0;F<arguments.length;F++)Z.push(i(arguments[F]));return Z.join(" ")}for(var F=1,fe=arguments,ve=fe.length,C=String(M).replace(n,function(j){if(j==="%%")return"%";if(F>=ve)return j;switch(j){case"%s":return String(fe[F++]);case"%d":return Number(fe[F++]);case"%j":try{return JSON.stringify(fe[F++])}catch{return"[Circular]"}default:return j}}),S=fe[F];F<ve;S=fe[++F])I(S)||!ee(S)?C+=" "+S:C+=" "+i(S);return C},xe.deprecate=function(M,Z){if(typeof t<"u"&&t.noDeprecation===!0)return M;if(typeof t>"u")return function(){return xe.deprecate(M,Z).apply(this||Vr,arguments)};var F=!1;function fe(){if(!F){if(t.throwDeprecation)throw new Error(Z);t.traceDeprecation?console.trace(Z):console.error(Z),F=!0}return M.apply(this||Vr,arguments)}return fe};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(M){if(M=M.toUpperCase(),!r[M])if(a.test(M)){var Z=t.pid;r[M]=function(){var F=xe.format.apply(xe,arguments);console.error("%s %d: %s",M,Z,F)}}else r[M]=function(){};return r[M]};function i(M,Z){var F={seen:[],stylize:l};return arguments.length>=3&&(F.depth=arguments[2]),arguments.length>=4&&(F.colors=arguments[3]),v(Z)?F.showHidden=Z:Z&&xe._extend(F,Z),X(F.showHidden)&&(F.showHidden=!1),X(F.depth)&&(F.depth=2),X(F.colors)&&(F.colors=!1),X(F.customInspect)&&(F.customInspect=!0),F.colors&&(F.stylize=s),g(F,M,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(M,Z){var F=i.styles[Z];return F?"\x1B["+i.colors[F][0]+"m"+M+"\x1B["+i.colors[F][1]+"m":M}function l(M,Z){return M}function f(M){var Z={};return M.forEach(function(F,fe){Z[F]=!0}),Z}function g(M,Z,F){if(M.customInspect&&Z&&Se(Z.inspect)&&Z.inspect!==xe.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var fe=Z.inspect(F,M);return $(fe)||(fe=g(M,fe,F)),fe}var ve=y(M,Z);if(ve)return ve;var C=Object.keys(Z),S=f(C);if(M.showHidden&&(C=Object.getOwnPropertyNames(Z)),Oe(Z)&&(C.indexOf("message")>=0||C.indexOf("description")>=0))return p(Z);if(C.length===0){if(Se(Z)){var j=Z.name?": "+Z.name:"";return M.stylize("[Function"+j+"]","special")}if(ue(Z))return M.stylize(RegExp.prototype.toString.call(Z),"regexp");if(ie(Z))return M.stylize(Date.prototype.toString.call(Z),"date");if(Oe(Z))return p(Z)}var V="",oe=!1,b=["{","}"];if(B(Z)&&(oe=!0,b=["[","]"]),Se(Z)){var x=Z.name?": "+Z.name:"";V=" [Function"+x+"]"}if(ue(Z)&&(V=" "+RegExp.prototype.toString.call(Z)),ie(Z)&&(V=" "+Date.prototype.toUTCString.call(Z)),Oe(Z)&&(V=" "+p(Z)),C.length===0&&(!oe||Z.length==0))return b[0]+V+b[1];if(F<0)return ue(Z)?M.stylize(RegExp.prototype.toString.call(Z),"regexp"):M.stylize("[Object]","special");M.seen.push(Z);var q;return oe?q=m(M,Z,F,S,C):q=C.map(function(Q){return _(M,Z,F,S,Q,oe)}),M.seen.pop(),E(q,V,b)}function y(M,Z){if(X(Z))return M.stylize("undefined","undefined");if($(Z)){var F="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return M.stylize(F,"string")}if(D(Z))return M.stylize(""+Z,"number");if(v(Z))return M.stylize(""+Z,"boolean");if(I(Z))return M.stylize("null","null")}function p(M){return"["+Error.prototype.toString.call(M)+"]"}function m(M,Z,F,fe,ve){for(var C=[],S=0,j=Z.length;S<j;++S)me(Z,String(S))?C.push(_(M,Z,F,fe,String(S),!0)):C.push("");return ve.forEach(function(V){V.match(/^\d+$/)||C.push(_(M,Z,F,fe,V,!0))}),C}function _(M,Z,F,fe,ve,C){var S,j,V;if(V=Object.getOwnPropertyDescriptor(Z,ve)||{value:Z[ve]},V.get?V.set?j=M.stylize("[Getter/Setter]","special"):j=M.stylize("[Getter]","special"):V.set&&(j=M.stylize("[Setter]","special")),me(fe,ve)||(S="["+ve+"]"),j||(M.seen.indexOf(V.value)<0?(I(F)?j=g(M,V.value,null):j=g(M,V.value,F-1),j.indexOf(`
76
+ `,o+=`}
77
+ `,o+=`}
78
+ `),o+=`}
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 Qe.an.anyOf(t)&&(a+=`.and(${my(U(x({},t),{anyOf:t.anyOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?U(x({},i),{type:"object"}):i)}),e)})`),Qe.a.oneOf(t)&&(a+=`.and(${is(U(x({},t),{oneOf:t.oneOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?U(x({},i),{type:"object"}):i)}),e)})`),Qe.an.allOf(t)&&(a+=`.and(${jr(U(x({},t),{allOf:t.allOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?U(x({},i),{type:"object"}):i)}),e)})`),a}p(hy,"parseObject");var FB=p(t=>{var e;let n="z.string()";if((e=t[Se])!=null&&e.coerce){if(t.format==="date-time")return"z.coerce.date()";n="z.coerce.string()"}return n+=at(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+=at(t,"pattern",({json:r})=>[`.regex(new RegExp(${r})`,", ",")"]),n+=at(t,"minLength",({json:r})=>[`.min(${r}`,", ",")"]),n+=at(t,"maxLength",({json:r})=>[`.max(${r}`,", ",")"]),n},"parseString"),KB=p((t,e)=>`${nt(NB(t,"nullable"),e,!0)}.nullable()`,"parseNullable"),WB=p(t=>`z.ref('${t.$ref}')`,"parseRef"),qB=p((t,e)=>{var n,r;if(t.oneOf.length<=1||!((n=t.discriminator)!=null&&n.propertyName))return is(t,e);let o=t.oneOf.map((a,i)=>nt(a,U(x({},e),{path:[...e.path,"oneOf",i]})));return`z.discriminatedUnion("${(r=t.discriminator)==null?void 0:r.propertyName}", [${o.join(", ")}])`},"parseDiscriminator"),nt=p((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=VB(t,e);return n||(o=zB(t,o),e.withoutDefaults||(o=GB(t,o))),r.r=o,o},"parseSchema"),zB=p((t,e)=>(t.description&&(e+=`.describe(${JSON.stringify(t.description)})`),e),"addMeta"),GB=p((t,e)=>(t.default!==void 0&&(e+=`.default(${JSON.stringify(t.default)})`),e),"addDefaults"),VB=p((t,e)=>Qe.a.nullable(t)?KB(t,e):Qe.an.object(t)?hy(t,e):Qe.an.array(t)?HB(t,e):Qe.an.anyOf(t)?my(t,e):Qe.an.allOf(t)?jr(t,e):Qe.a.discriminator(t)?qB(t,e):Qe.a.oneOf(t)?is(t,e):Qe.a.not(t)?OB(t,e):Qe.an.enum(t)?$B(t):Qe.a.const(t)?jB(t):Qe.a.multipleType(t)?RB(t,e):Qe.a.primitive(t,"string")?FB(t):Qe.a.primitive(t,"number")||Qe.a.primitive(t,"integer")?LB(t):Qe.a.primitive(t,"boolean")?CB(t):Qe.a.primitive(t,"null")?MB(t):Qe.a.conditional(t)?ZB(t,e):Qe.a.ref(t)?WB(t):AB(t),"selectParser"),Qe={an:{object:p(t=>t.type==="object","object"),array:p(t=>t.type==="array","array"),anyOf:p(t=>t.anyOf!==void 0,"anyOf"),allOf:p(t=>t.allOf!==void 0,"allOf"),enum:p(t=>t.enum!==void 0,"enum")},a:{nullable:p(t=>t.nullable===!0,"nullable"),multipleType:p(t=>Array.isArray(t.type),"multipleType"),not:p(t=>t.not!==void 0,"not"),const:p(t=>t.const!==void 0,"const"),primitive:p((t,e)=>t.type===e,"primitive"),conditional:p(t=>Boolean("if"in t&&t.if&&"then"in t&&"else"in t&&t.then&&t.else),"conditional"),discriminator:p(t=>{var e;return t.oneOf!==void 0&&((e=t.discriminator)==null?void 0:e.propertyName)!==void 0},"discriminator"),oneOf:p(t=>t.oneOf!==void 0,"oneOf"),ref:p(t=>t.$ref!==void 0,"ref")}},JB=p(t=>{let e;try{e=new Function("z",`return ${t}`)(q)}catch(n){return{sucess:!1,error:`Failed to evaluate schema: ${(n instanceof Error?n:new Error(String(n))).message}`}}return e instanceof q.ZodType?{sucess:!0,value:e}:{sucess:!1,error:`String "${t}" does not evaluate to a Zod schema`}},"evalZuiString"),YB=p(t=>nt(t,{seen:new Map,path:[]}),"jsonSchemaToZodStr"),XB=p(t=>{let e=YB(t);e=e.replaceAll("errors: z.ZodError[]","errors");let n=JB(e);if(!n.sucess)throw new If(n.error);return n.value},"jsonSchemaToZod"),Sr=p((t,e)=>{var n,r;if(e[Se]&&t._def&&(t._def[Se]=e[Se]),((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]&&Sr(i[o],a)}),((r=t._def)==null?void 0:r.typeName)==="ZodRecord"&&e.type==="object"&&e.additionalProperties&&Sr(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&&Sr(a,o)}else Array.isArray(o)&&o.forEach((a,i)=>{let s=t._def;s.typeName===re.ZodFirstPartyTypeKind.ZodTuple&&Sr(s.items[i],a)})}},"applyZuiPropsRecursively"),mo=p(t=>{let e=XB(t);return Sr(e,t),e},"jsonSchemaToZui"),vy=class extends er.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("Uncaught error:",e,n)}render(){return this.state.hasError&&this.props.fallback?er.default.createElement(this.props.fallback,{error:this.state.error,schema:this.props.fieldSchema}):this.props.children}};p(vy,"ErrorBoundary");var Ar=vy;function QB(t,e){return n=>er.default.createElement(Ar,{fallback:e,fieldSchema:n.fieldSchema,path:n.path},er.default.createElement(t,x({},n)))}p(QB,"withErrorBoundary");var vi=p(t=>{var e=t,{components:n,fieldSchema:r,path:o,required:a,fallback:i}=e,s=df(e,["components","fieldSchema","path","required","fallback"]),l,f;let{formData:d,disabled:y,hidden:g,handlePropertyChange:m,addArrayItem:v,removeArrayItem:B,formErrors:E,formValid:T}=yf(r,o),k=(0,pt.useMemo)(()=>hn(d,o),[d,o]),P=(0,pt.useMemo)(()=>sT(n,r),[r,n]),{discriminator:M,discriminatedSchema:$,discriminatorValue:oe}=iT(r,o);if(!P||g===!0)return null;let{Component:X,type:ue}=P,ee={type:ue,componentID:P.id,scope:o.join("."),context:{path:o,readonly:!1,formData:d,formErrors:E,formValid:T,updateForm:m,updateFormData:p(Ie=>m([],Ie),"updateFormData")},onChange:p(Ie=>m(o,Ie),"onChange"),disabled:y,errors:E?.filter(Ie=>Ie.path===o)||[],label:((l=r[Se])==null?void 0:l.title)||sa(((f=o[o.length-1])==null?void 0:f.toString())||""),params:P.params,schema:r,zuiProps:r[Se]};if(r.type==="array"&&ue==="array"){let Ie=X,$e=ee.schema,Ne=Array.isArray(k)||typeof k=="object"?k:[],Me=x(U(x({},ee),{type:ue,schema:$e,data:Ne,addItem:p(Ve=>v(o,Ve),"addItem"),removeItem:p(Ve=>B(o,Ve),"removeItem")}),s);return Array.isArray(r.items)?null:pt.default.createElement(Ie,U(x({key:ee.scope},Me),{isArrayChild:Me.isArrayChild}),Array.isArray(Me.data)?Me.data.map((Ve,Ce)=>{let me=[...o,Ce.toString()];return pt.default.createElement(Ar,{key:me.join("."),fallback:i,fieldSchema:r.items,path:me},pt.default.createElement(vi,{key:me.join("."),components:n,fieldSchema:r.items,path:me,required:a,isArrayChild:!0,index:Ce,removeSelf:()=>B(o,Ce),fallback:i}))}):[])}if(r.type==="object"&&ue==="object"&&r.properties){let Ie=X,$e=x(U(x({},ee),{type:ue,schema:ee.schema,data:k||{}}),s);return pt.default.createElement(Ie,U(x({key:ee.scope},$e),{isArrayChild:$e.isArrayChild}),Object.entries(r.properties).map(([Ne,Me])=>{var Ve;let Ce=[...o,Ne];return pt.default.createElement(Ar,{key:Ce.join("."),fallback:i,fieldSchema:Me,path:Ce},pt.default.createElement(vi,{key:Ce.join("."),components:n,fieldSchema:Me,path:Ce,required:((Ve=r.required)==null?void 0:Ve.includes(Ne))||!1,isArrayChild:!1,fallback:i}))}))}if(ue==="discriminatedUnion"){let Ie=X,$e=x(U(x({},ee),{type:ue,schema:ee.schema,data:k||{},discriminatorKey:M?.key||null,discriminatorLabel:sa(M?.key||"Unknown"),discriminatorOptions:M?.values||null,discriminatorValue:oe,setDiscriminator:p(Ne=>{if(!M?.key){console.warn("No discriminator key found, cannot set discriminator");return}m(o,{[M.key]:Ne})},"setDiscriminator")}),s);return pt.default.createElement(Ie,U(x({key:ee.scope},$e),{isArrayChild:$e.isArrayChild}),$&&pt.default.createElement(Ar,{key:o.join("."),fallback:i,fieldSchema:$,path:o},pt.default.createElement(vi,{components:n,fieldSchema:$,path:o,required:a,isArrayChild:!1,fallback:i})))}let ie=X,Oe=x(U(x({},ee),{type:ue,schema:ee.schema,config:{},required:a,data:k,description:r.description}),s);return pt.default.createElement(ie,x({},Oe))},"FormElementRenderer"),aC=p(({schema:t,components:e,onChange:n,value:r,disableValidation:o,fallback:a,dataTransform:i,onValidation:s})=>{let[l,f]=(0,Zt.useState)(r);return(0,Zt.useEffect)(()=>{n(l)},[l]),(0,Zt.useEffect)(()=>{let d=zn(t);f(y=>_i(d,y))},[JSON.stringify(t),f]),Zt.default.createElement(rT,{formData:l,setFormData:f,formSchema:t,disableValidation:o||!1,dataTransform:i,onValidation:s},Zt.default.createElement(Ar,{fallback:a,fieldSchema:t,path:[]},Zt.default.createElement(vi,{components:e,fieldSchema:t,path:[],fallback:a,required:!0,isArrayChild:!1})))},"ZuiForm"),sC={string:{},number:{slider:{id:"slider",params:q.object({})}},boolean:{switch:{id:"switch",params:q.object({})}},array:{},object:{},discriminatedUnion:{}},lC={errors:Pf,jsonSchemaToZui:mo,zuiToJsonSchema:rs,objectToZui:Hr,toTypescript:bi,toTypescriptSchema:Ua};var $r=(t,e)=>{let n=t._def,r=e._def;if(n.typeName===re.ZodFirstPartyTypeKind.ZodObject&&r.typeName===re.ZodFirstPartyTypeKind.ZodObject){let o=n.shape(),a=r.shape();return re.object({...o,...a})}if(n.typeName===re.ZodFirstPartyTypeKind.ZodRecord&&r.typeName===re.ZodFirstPartyTypeKind.ZodRecord)return re.record(re.intersection(n.valueType,r.valueType));throw new Error("Cannot merge object schemas with record schemas")},Ty=re;var dt=re.string().min(1),by=re.object({text:dt}),wy=re.object({markdown:dt}),xy=re.object({imageUrl:dt}),By=re.object({audioUrl:dt}),Ey=re.object({videoUrl:dt}),Py=re.object({fileUrl:dt,title:dt.optional()}),ky=re.object({latitude:re.number(),longitude:re.number(),address:re.string().optional(),title:re.string().optional()}),Sy=re.object({title:dt,subtitle:dt.optional(),imageUrl:dt.optional(),actions:re.array(re.object({action:re.enum(["postback","url","say"]),label:dt,value:dt}))}),_y=re.object({text:dt,options:re.array(re.object({label:dt,value:dt}))}),eE=re.object({items:re.array(Sy)}),tE=re.union([re.object({type:re.literal("text"),payload:by}),re.object({type:re.literal("markdown"),payload:wy}),re.object({type:re.literal("image"),payload:xy}),re.object({type:re.literal("audio"),payload:By}),re.object({type:re.literal("video"),payload:Ey}),re.object({type:re.literal("file"),payload:Py}),re.object({type:re.literal("location"),payload:ky})]),nE=re.object({items:re.array(tE)}),rE={schema:wy},iE={text:{schema:by},image:{schema:xy},audio:{schema:By},video:{schema:Ey},file:{schema:Py},location:{schema:ky},carousel:{schema:eE},card:{schema:Sy},dropdown:{schema:_y},choice:{schema:_y},bloc:{schema:nE}};A();O();R();var ho="x-bot-id",Cy="x-bot-user-id",Ay="x-integration-id",Ry="x-webhook-id",Oy="x-bp-configuration-type",vo="x-bp-configuration",To="x-bp-operation",My="x-bp-type";A();O();R();import{isNode as oS}from"browser-or-node";A();O();R();var ir=console;function St(t){if(!t.body)throw new Error("Missing body");return JSON.parse(t.body)}async function Zo(t,e=8072,n=uS){if(!oS)throw new Error("This function can only be called in Node.js");let o=(Rh(),Nv(Ah)).createServer(async(a,i)=>{try{let s=await aS(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){ir.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 aS(t){let e=await lS(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:sS(r.search,"?"),headers:n,method:t.method?.toUpperCase()??"GET"}}function sS(t,e){return t.indexOf(e)===0?t.slice(e.length):t}async function lS(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 uS(t){ir.info(`Listening on port ${t}`)}import{isApiError as IN,RuntimeError as CN}from"@botpress/client";A();O();R();A();O();R();A();O();R();A();O();R();var qe={};Hn(qe,{mapKeys:()=>dS,mapValues:()=>fS,mergeRecords:()=>gS,pairs:()=>Lo,stripUndefinedProps:()=>pS,values:()=>cS});A();O();R();var Lo=t=>Object.entries(t),cS=t=>Object.values(t),fS=(t,e)=>Object.fromEntries(Lo(t).map(([n,r])=>[n,e(r,n)])),dS=(t,e)=>Object.fromEntries(Lo(t).map(([n,r])=>[e(n),r])),pS=t=>Object.fromEntries(Lo(t).filter(([,e])=>e!==void 0)),gS=(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 Pe={};Hn(Pe,{safePush:()=>yS,unique:()=>mS});A();O();R();var yS=(t,...e)=>t?[...t,...e]:[...e],mS=t=>Array.from(new Set(t));A();O();R();var Xt={};Hn(Xt,{setName:()=>hS});A();O();R();var hS=(t,e)=>(Object.defineProperty(t,"name",{value:e}),t);var Oh=t=>{let{name:e,version:n}=t,r={actions:{},events:{},channels:{}},o={name:e,version:n,entities:qe.mapValues(t.entities,i=>({name:i.name})),actions:{},events:{},channels:{}},a=qe.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),d=t.actions?.[i]?.name??i;r.actions[d]={...s,...t.actions?.[i]??{},input:{schema:l},output:{schema:f}},o.actions[i]={name:d}}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[d,y]of Object.entries(s.messages)){let g=y.schema.dereference(a);l[d]={...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}};A();O();R();var Fo=Symbol("schemaName"),Mh=t=>t?qe.mapValues(t,(n,r)=>({...n,[Fo]:r})):{},Dh=t=>Fo in t&&t[Fo]!==void 0,Nh=t=>t[Fo];A();O();R();var tl=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}name;version;title;description;icon;readme;configuration;configurations;events;actions;channels;states;user;secrets;identifier;entities;interfaces;__advanced;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:d,statement:y}=Oh({...e,entities:r,actions:qe.stripUndefinedProps(o),events:qe.stripUndefinedProps(a),channels:qe.stripUndefinedProps(i)});return s.actions=qe.mergeRecords(s.actions??{},d.actions,this._mergeActions),s.channels=qe.mergeRecords(s.channels??{},d.channels,this._mergeChannels),s.events=qe.mergeRecords(s.events??{},d.events,this._mergeEvents),s.interfaces[f]={id:e.id,...y},this}_callBuilder(e,n){let o={entities:Mh(this.entities)},a=n(o),i=qe.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:qe.mapValues(a.entities,l=>({name:Nh(l),schema:l.schema})),actions:a.actions??{},events:a.events??{},channels:a.channels??{}}}_mergeActions=(e,n)=>({...e,...n,input:{schema:$r(e.input.schema,n.input.schema)},output:{schema:$r(e.input.schema,n.output.schema)}});_mergeEvents=(e,n)=>({...e,...n,schema:$r(e.schema,n.schema)});_mergeChannels=(e,n)=>{let r=qe.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:$r(e.schema,n.schema)})};A();O();R();A();O();R();import{isApiError as KS,Client as WS,RuntimeError as Tv}from"@botpress/client";A();O();R();import{axiosRetry as vS}from"@botpress/client";var Ko={retries:3,retryCondition:t=>vS.isNetworkOrIdempotentRequestError(t)||[429,502].includes(t.response?.status??0),retryDelay:t=>t*1e3};A();O();R();A();O();R();var Vr=class{constructor(e){this._client=e}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);updateMessage=e=>this._client.updateMessage(e);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)};A();O();R();var Wo=class{_cost=0;get cost(){return this._cost}setCost(e){this._cost=e}toJSON(){return{cost:this.cost}}};A();O();R();var TS=re.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),Uh=t=>{let e=t[ho],n=t[Cy],r=t[Ay],o=t[Ry],a=t[Oy],i=t[vo],s=TS.parse(t[To]);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(G.from(i,"base64").toString("utf-8")):{}}};A();O();R();A();O();R();A();O();R();A();O();R();var nl={},Hh=!1;function wl(){return Hh||(Hh=!0,nl=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}),nl}var rl={},jh=!1;function _S(){return jh||(jh=!0,rl=Error),rl}var il={},$h=!1;function bS(){return $h||($h=!0,il=EvalError),il}var ol={},Zh=!1;function wS(){return Zh||(Zh=!0,ol=RangeError),ol}var al={},Lh=!1;function xS(){return Lh||(Lh=!0,al=ReferenceError),al}var sl={},Fh=!1;function ov(){return Fh||(Fh=!0,sl=SyntaxError),sl}var ll={},Kh=!1;function qo(){return Kh||(Kh=!0,ll=TypeError),ll}var ul={},Wh=!1;function BS(){return Wh||(Wh=!0,ul=URIError),ul}var cl={},qh=!1;function ES(){if(qh)return cl;qh=!0;var t=typeof Symbol<"u"&&Symbol,e=wl();return cl=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},cl}var fl={},zh=!1;function PS(){if(zh)return fl;zh=!0;var t={__proto__:null,foo:{}},e=Object;return fl=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},fl}var dl={},Gh=!1;function kS(){if(Gh)return dl;Gh=!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 d=[],y=0;y<l.length;y+=1)d[y]=l[y];for(var g=0;g<f.length;g+=1)d[g+l.length]=f[g];return d},a=function(l,f){for(var d=[],y=f,g=0;y<l.length;y+=1,g+=1)d[g]=l[y];return d},i=function(s,l){for(var f="",d=0;d<s.length;d+=1)f+=s[d],d+1<s.length&&(f+=l);return f};return dl=function(l){var f=this;if(typeof f!="function"||e.apply(f)!==r)throw new TypeError(t+f);for(var d=a(arguments,1),y,g=function(){if(this instanceof y){var T=f.apply(this,o(d,arguments));return Object(T)===T?T:this}return f.apply(l,o(d,arguments))},m=n(0,f.length-d.length),v=[],B=0;B<m;B++)v[B]="$"+B;if(y=Function("binder","return function ("+i(v,",")+"){ return binder.apply(this,arguments); }")(g),f.prototype){var E=function(){};E.prototype=f.prototype,y.prototype=new E,E.prototype=null}return y},dl}var pl={},Vh=!1;function xl(){if(Vh)return pl;Vh=!0;var t=kS();return pl=Function.prototype.bind||t,pl}var gl={},Jh=!1;function SS(){if(Jh)return gl;Jh=!0;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=xl();return gl=n.call(t,e),gl}var yl={},Yh=!1;function Yr(){if(Yh)return yl;Yh=!0;var t,e=_S(),n=bS(),r=wS(),o=xS(),a=ov(),i=qo(),s=BS(),l=Function,f=function(Ce){try{return l('"use strict"; return ('+Ce+").constructor;")()}catch{}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch{d=null}var y=function(){throw new i},g=d?function(){try{return arguments.callee,y}catch{try{return d(arguments,"callee").get}catch{return y}}}():y,m=ES()(),v=PS()(),B=Object.getPrototypeOf||(v?function(Ce){return Ce.__proto__}:null),E={},T=typeof Uint8Array>"u"||!B?t:B(Uint8Array),k={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":m&&B?B([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":E,"%AsyncGenerator%":E,"%AsyncGeneratorFunction%":E,"%AsyncIteratorPrototype%":E,"%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%":E,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":m&&B?B(B([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!m||!B?t:B(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"||!m||!B?t:B(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m&&B?B(""[Symbol.iterator]()):t,"%Symbol%":m?Symbol:t,"%SyntaxError%":a,"%ThrowTypeError%":g,"%TypedArray%":T,"%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(B)try{null.error}catch(Ce){var P=B(B(Ce));k["%Error.prototype%"]=P}var M=function Ce(me){var ke;if(me==="%AsyncFunction%")ke=f("async function () {}");else if(me==="%GeneratorFunction%")ke=f("function* () {}");else if(me==="%AsyncGeneratorFunction%")ke=f("async function* () {}");else if(me==="%AsyncGenerator%"){var ce=Ce("%AsyncGeneratorFunction%");ce&&(ke=ce.prototype)}else if(me==="%AsyncIteratorPrototype%"){var he=Ce("%AsyncGenerator%");he&&B&&(ke=B(he.prototype))}return k[me]=ke,ke},$={__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=xl(),X=SS(),ue=oe.call(Function.call,Array.prototype.concat),ee=oe.call(Function.apply,Array.prototype.splice),ie=oe.call(Function.call,String.prototype.replace),Oe=oe.call(Function.call,String.prototype.slice),Ie=oe.call(Function.call,RegExp.prototype.exec),$e=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ne=/\\(\\)?/g,Me=function(me){var ke=Oe(me,0,1),ce=Oe(me,-1);if(ke==="%"&&ce!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(ce==="%"&&ke!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var he=[];return ie(me,$e,function(D,Z,F,fe){he[he.length]=F?ie(fe,Ne,"$1"):Z||D}),he},Ve=function(me,ke){var ce=me,he;if(X($,ce)&&(he=$[ce],ce="%"+he[0]+"%"),X(k,ce)){var D=k[ce];if(D===E&&(D=M(ce)),typeof D>"u"&&!ke)throw new i("intrinsic "+me+" exists, but is not available. Please file an issue!");return{alias:he,name:ce,value:D}}throw new a("intrinsic "+me+" does not exist!")};return yl=function(me,ke){if(typeof me!="string"||me.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ke!="boolean")throw new i('"allowMissing" argument must be a boolean');if(Ie(/^%?[^%]*%?$/,me)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ce=Me(me),he=ce.length>0?ce[0]:"",D=Ve("%"+he+"%",ke),Z=D.name,F=D.value,fe=!1,ve=D.alias;ve&&(he=ve[0],ee(ce,ue([0,1],ve)));for(var C=1,S=!0;C<ce.length;C+=1){var j=ce[C],V=Oe(j,0,1),ae=Oe(j,-1);if((V==='"'||V==="'"||V==="`"||ae==='"'||ae==="'"||ae==="`")&&V!==ae)throw new a("property names with quotes must have matching quotes");if((j==="constructor"||!S)&&(fe=!0),he+="."+j,Z="%"+he+"%",X(k,Z))F=k[Z];else if(F!=null){if(!(j in F)){if(!ke)throw new i("base intrinsic for "+me+" exists, but the property is not available.");return}if(d&&C+1>=ce.length){var b=d(F,j);S=!!b,S&&"get"in b&&!("originalValue"in b.get)?F=b.get:F=F[j]}else S=X(F,j),F=F[j];S&&!fe&&(k[Z]=F)}}return F},yl}var ml={},Xh=!1;function Bl(){if(Xh)return ml;Xh=!0;var t=Yr(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return ml=e,ml}var hl={},Qh=!1;function zo(){if(Qh)return hl;Qh=!0;var t=Yr(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return hl=e,hl}var vl={},ev=!1;function IS(){if(ev)return vl;ev=!0;var t=Bl(),e=ov(),n=qo(),r=zo();return vl=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,d=arguments.length>5?arguments[5]:null,y=arguments.length>6?arguments[6]:!1,g=!!r&&r(a,i);if(t)t(a,i,{configurable:d===null&&g?g.configurable:!d,enumerable:l===null&&g?g.enumerable:!l,value:s,writable:f===null&&g?g.writable:!f});else if(y||!l&&!f&&!d)a[i]=s;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},vl}var Tl={},tv=!1;function CS(){if(tv)return Tl;tv=!0;var t=Bl(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Tl=e,Tl}var _l={},nv=!1;function AS(){if(nv)return _l;nv=!0;var t=Yr(),e=IS(),n=CS()(),r=zo(),o=qo(),a=t("%Math.floor%");return _l=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],d=!0,y=!0;if("length"in s&&r){var g=r(s,"length");g&&!g.configurable&&(d=!1),g&&!g.writable&&(y=!1)}return(d||y||!f)&&(n?e(s,"length",l,!0,!0):e(s,"length",l)),s},_l}var Jr={},rv=!1;function El(){if(rv)return Jr;rv=!0;var t=xl(),e=Yr(),n=AS(),r=qo(),o=e("%Function.prototype.apply%"),a=e("%Function.prototype.call%"),i=e("%Reflect.apply%",!0)||t.call(a,o),s=Bl(),l=e("%Math.max%");Jr=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(Jr,"apply",{value:f}):Jr.apply=f,Jr}var bl={},iv=!1;function Pl(){if(iv)return bl;iv=!0;var t=Yr(),e=El(),n=e(t("String.prototype.indexOf"));return bl=function(o,a){var i=t(o,!!a);return typeof i=="function"&&n(o,".prototype.")>-1?e(i):i},bl}os();ws();var kl={},av=!1;function Ul(){if(av)return kl;av=!0;var t=wl();return kl=function(){return t()&&!!Symbol.toStringTag},kl}var Sl={},sv=!1;function RS(){if(sv)return Sl;sv=!0;var t=Ul()(),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 Il={},lv=!1;function OS(){if(lv)return Il;lv=!0;var t=Object.prototype.toString,e=Function.prototype.toString,n=/^\s*(?:function)?\*/,r=Ul()(),o=Object.getPrototypeOf,a=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},i;return Il=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 d=a();i=d?o(d):!1}return o(l)===i},Il}var Cl={},uv=!1;function MS(){if(uv)return Cl;uv=!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(k){k!==r&&(e=null)}else e=null;var o=/^\s*class\b/,a=function(P){try{var M=t.call(P);return o.test(M)}catch{return!1}},i=function(P){try{return a(P)?!1:(t.call(P),!0)}catch{return!1}},s=Object.prototype.toString,l="[object Object]",f="[object Function]",d="[object GeneratorFunction]",y="[object HTMLAllCollection]",g="[object HTML document.all class]",m="[object HTMLCollection]",v=typeof Symbol=="function"&&!!Symbol.toStringTag,B=!(0 in[,]),E=function(){return!1};if(typeof document=="object"){var T=document.all;s.call(T)===s.call(document.all)&&(E=function(P){if((B||!P)&&(typeof P>"u"||typeof P=="object"))try{var M=s.call(P);return(M===y||M===g||M===m||M===l)&&P("")==null}catch{}return!1})}return Cl=e?function(P){if(E(P))return!0;if(!P||typeof P!="function"&&typeof P!="object")return!1;try{e(P,null,n)}catch(M){if(M!==r)return!1}return!a(P)&&i(P)}:function(P){if(E(P))return!0;if(!P||typeof P!="function"&&typeof P!="object")return!1;if(v)return i(P);if(a(P))return!1;var M=s.call(P);return M!==f&&M!==d&&!/^\[object HTML/.test(M)?!1:i(P)},Cl}var Al={},cv=!1;function DS(){if(cv)return Al;cv=!0;var t=MS(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(l,f,d){for(var y=0,g=l.length;y<g;y++)n.call(l,y)&&(d==null?f(l[y],y,l):f.call(d,l[y],y,l))},o=function(l,f,d){for(var y=0,g=l.length;y<g;y++)d==null?f(l.charAt(y),y,l):f.call(d,l.charAt(y),y,l)},a=function(l,f,d){for(var y in l)n.call(l,y)&&(d==null?f(l[y],y,l):f.call(d,l[y],y,l))},i=function(l,f,d){if(!t(f))throw new TypeError("iterator must be a function");var y;arguments.length>=3&&(y=d),e.call(l)==="[object Array]"?r(l,f,y):typeof l=="string"?o(l,f,y):a(l,f,y)};return Al=i,Al}var Rl={},fv=!1;function NS(){return fv||(fv=!0,Rl=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Rl}var Ol={},dv=!1,US=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function HS(){if(dv)return Ol;dv=!0;var t=NS(),e=typeof globalThis>"u"?US:globalThis;return Ol=function(){for(var r=[],o=0;o<t.length;o++)typeof e[t[o]]=="function"&&(r[r.length]=t[o]);return r},Ol}var Ml={},pv=!1,jS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function vv(){if(pv)return Ml;pv=!0;var t=DS(),e=HS(),n=El(),r=Pl(),o=zo(),a=r("Object.prototype.toString"),i=Ul()(),s=typeof globalThis>"u"?jS:globalThis,l=e(),f=r("String.prototype.slice"),d=Object.getPrototypeOf,y=r("Array.prototype.indexOf",!0)||function(E,T){for(var k=0;k<E.length;k+=1)if(E[k]===T)return k;return-1},g={__proto__:null};i&&o&&d?t(l,function(B){var E=new s[B];if(Symbol.toStringTag in E){var T=d(E),k=o(T,Symbol.toStringTag);if(!k){var P=d(T);k=o(P,Symbol.toStringTag)}g["$"+B]=n(k.get)}}):t(l,function(B){var E=new s[B],T=E.slice||E.set;T&&(g["$"+B]=n(T))});var m=function(E){var T=!1;return t(g,function(k,P){if(!T)try{"$"+k(E)===P&&(T=f(P,1))}catch{}}),T},v=function(E){var T=!1;return t(g,function(k,P){if(!T)try{k(E),T=f(P,1)}catch{}}),T};return Ml=function(E){if(!E||typeof E!="object")return!1;if(!i){var T=f(a(E),8,-1);return y(l,T)>-1?T:T!=="Object"?!1:v(E)}return o?m(E):null},Ml}var Dl={},gv=!1;function $S(){if(gv)return Dl;gv=!0;var t=vv();return Dl=function(n){return!!t(n)},Dl}var be={},yv=!1;function ZS(){if(yv)return be;yv=!0;var t=RS(),e=OS(),n=vv(),r=$S();function o(H){return H.call.bind(H)}var a=typeof BigInt<"u",i=typeof Symbol<"u",s=o(Object.prototype.toString),l=o(Number.prototype.valueOf),f=o(String.prototype.valueOf),d=o(Boolean.prototype.valueOf);if(a)var y=o(BigInt.prototype.valueOf);if(i)var g=o(Symbol.prototype.valueOf);function m(H,Et){if(typeof H!="object")return!1;try{return Et(H),!0}catch{return!1}}be.isArgumentsObject=t,be.isGeneratorFunction=e,be.isTypedArray=r;function v(H){return typeof Promise<"u"&&H instanceof Promise||H!==null&&typeof H=="object"&&typeof H.then=="function"&&typeof H.catch=="function"}be.isPromise=v;function B(H){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(H):r(H)||D(H)}be.isArrayBufferView=B;function E(H){return n(H)==="Uint8Array"}be.isUint8Array=E;function T(H){return n(H)==="Uint8ClampedArray"}be.isUint8ClampedArray=T;function k(H){return n(H)==="Uint16Array"}be.isUint16Array=k;function P(H){return n(H)==="Uint32Array"}be.isUint32Array=P;function M(H){return n(H)==="Int8Array"}be.isInt8Array=M;function $(H){return n(H)==="Int16Array"}be.isInt16Array=$;function oe(H){return n(H)==="Int32Array"}be.isInt32Array=oe;function X(H){return n(H)==="Float32Array"}be.isFloat32Array=X;function ue(H){return n(H)==="Float64Array"}be.isFloat64Array=ue;function ee(H){return n(H)==="BigInt64Array"}be.isBigInt64Array=ee;function ie(H){return n(H)==="BigUint64Array"}be.isBigUint64Array=ie;function Oe(H){return s(H)==="[object Map]"}Oe.working=typeof Map<"u"&&Oe(new Map);function Ie(H){return typeof Map>"u"?!1:Oe.working?Oe(H):H instanceof Map}be.isMap=Ie;function $e(H){return s(H)==="[object Set]"}$e.working=typeof Set<"u"&&$e(new Set);function Ne(H){return typeof Set>"u"?!1:$e.working?$e(H):H instanceof Set}be.isSet=Ne;function Me(H){return s(H)==="[object WeakMap]"}Me.working=typeof WeakMap<"u"&&Me(new WeakMap);function Ve(H){return typeof WeakMap>"u"?!1:Me.working?Me(H):H instanceof WeakMap}be.isWeakMap=Ve;function Ce(H){return s(H)==="[object WeakSet]"}Ce.working=typeof WeakSet<"u"&&Ce(new WeakSet);function me(H){return Ce(H)}be.isWeakSet=me;function ke(H){return s(H)==="[object ArrayBuffer]"}ke.working=typeof ArrayBuffer<"u"&&ke(new ArrayBuffer);function ce(H){return typeof ArrayBuffer>"u"?!1:ke.working?ke(H):H instanceof ArrayBuffer}be.isArrayBuffer=ce;function he(H){return s(H)==="[object DataView]"}he.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&he(new DataView(new ArrayBuffer(1),0,1));function D(H){return typeof DataView>"u"?!1:he.working?he(H):H instanceof DataView}be.isDataView=D;var Z=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function F(H){return s(H)==="[object SharedArrayBuffer]"}function fe(H){return typeof Z>"u"?!1:(typeof F.working>"u"&&(F.working=F(new Z)),F.working?F(H):H instanceof Z)}be.isSharedArrayBuffer=fe;function ve(H){return s(H)==="[object AsyncFunction]"}be.isAsyncFunction=ve;function C(H){return s(H)==="[object Map Iterator]"}be.isMapIterator=C;function S(H){return s(H)==="[object Set Iterator]"}be.isSetIterator=S;function j(H){return s(H)==="[object Generator]"}be.isGeneratorObject=j;function V(H){return s(H)==="[object WebAssembly.Module]"}be.isWebAssemblyCompiledModule=V;function ae(H){return m(H,l)}be.isNumberObject=ae;function b(H){return m(H,f)}be.isStringObject=b;function w(H){return m(H,d)}be.isBooleanObject=w;function W(H){return a&&m(H,y)}be.isBigIntObject=W;function Q(H){return i&&m(H,g)}be.isSymbolObject=Q;function Ue(H){return ae(H)||b(H)||w(H)||W(H)||Q(H)}be.isBoxedPrimitive=Ue;function Te(H){return typeof Uint8Array<"u"&&(ce(H)||fe(H))}return be.isAnyArrayBuffer=Te,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(H){Object.defineProperty(be,H,{enumerable:!1,value:function(){throw new Error(H+" is not supported in userland")}})}),be}var Nl={},mv=!1;function LS(){return mv||(mv=!0,Nl=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),Nl}var we={},hv=!1,Xr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function FS(){if(hv)return we;hv=!0;var t=kt,e=Object.getOwnPropertyDescriptors||function(Z){for(var F=Object.keys(Z),fe={},ve=0;ve<F.length;ve++)fe[F[ve]]=Object.getOwnPropertyDescriptor(Z,F[ve]);return fe},n=/%[sdj%]/g;we.format=function(D){if(!$(D)){for(var Z=[],F=0;F<arguments.length;F++)Z.push(i(arguments[F]));return Z.join(" ")}for(var F=1,fe=arguments,ve=fe.length,C=String(D).replace(n,function(j){if(j==="%%")return"%";if(F>=ve)return j;switch(j){case"%s":return String(fe[F++]);case"%d":return Number(fe[F++]);case"%j":try{return JSON.stringify(fe[F++])}catch{return"[Circular]"}default:return j}}),S=fe[F];F<ve;S=fe[++F])k(S)||!ee(S)?C+=" "+S:C+=" "+i(S);return C},we.deprecate=function(D,Z){if(typeof t<"u"&&t.noDeprecation===!0)return D;if(typeof t>"u")return function(){return we.deprecate(D,Z).apply(this||Xr,arguments)};var F=!1;function fe(){if(!F){if(t.throwDeprecation)throw new Error(Z);t.traceDeprecation?console.trace(Z):console.error(Z),F=!0}return D.apply(this||Xr,arguments)}return fe};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")}we.debuglog=function(D){if(D=D.toUpperCase(),!r[D])if(o.test(D)){var Z=t.pid;r[D]=function(){var F=we.format.apply(we,arguments);console.error("%s %d: %s",D,Z,F)}}else r[D]=function(){};return r[D]};function i(D,Z){var F={seen:[],stylize:l};return arguments.length>=3&&(F.depth=arguments[2]),arguments.length>=4&&(F.colors=arguments[3]),T(Z)?F.showHidden=Z:Z&&we._extend(F,Z),X(F.showHidden)&&(F.showHidden=!1),X(F.depth)&&(F.depth=2),X(F.colors)&&(F.colors=!1),X(F.customInspect)&&(F.customInspect=!0),F.colors&&(F.stylize=s),d(F,D,F.depth)}we.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,Z){var F=i.styles[Z];return F?"\x1B["+i.colors[F][0]+"m"+D+"\x1B["+i.colors[F][1]+"m":D}function l(D,Z){return D}function f(D){var Z={};return D.forEach(function(F,fe){Z[F]=!0}),Z}function d(D,Z,F){if(D.customInspect&&Z&&Ie(Z.inspect)&&Z.inspect!==we.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var fe=Z.inspect(F,D);return $(fe)||(fe=d(D,fe,F)),fe}var ve=y(D,Z);if(ve)return ve;var C=Object.keys(Z),S=f(C);if(D.showHidden&&(C=Object.getOwnPropertyNames(Z)),Oe(Z)&&(C.indexOf("message")>=0||C.indexOf("description")>=0))return g(Z);if(C.length===0){if(Ie(Z)){var j=Z.name?": "+Z.name:"";return D.stylize("[Function"+j+"]","special")}if(ue(Z))return D.stylize(RegExp.prototype.toString.call(Z),"regexp");if(ie(Z))return D.stylize(Date.prototype.toString.call(Z),"date");if(Oe(Z))return g(Z)}var V="",ae=!1,b=["{","}"];if(E(Z)&&(ae=!0,b=["[","]"]),Ie(Z)){var w=Z.name?": "+Z.name:"";V=" [Function"+w+"]"}if(ue(Z)&&(V=" "+RegExp.prototype.toString.call(Z)),ie(Z)&&(V=" "+Date.prototype.toUTCString.call(Z)),Oe(Z)&&(V=" "+g(Z)),C.length===0&&(!ae||Z.length==0))return b[0]+V+b[1];if(F<0)return ue(Z)?D.stylize(RegExp.prototype.toString.call(Z),"regexp"):D.stylize("[Object]","special");D.seen.push(Z);var W;return ae?W=m(D,Z,F,S,C):W=C.map(function(Q){return v(D,Z,F,S,Q,ae)}),D.seen.pop(),B(W,V,b)}function y(D,Z){if(X(Z))return D.stylize("undefined","undefined");if($(Z)){var F="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return D.stylize(F,"string")}if(M(Z))return D.stylize(""+Z,"number");if(T(Z))return D.stylize(""+Z,"boolean");if(k(Z))return D.stylize("null","null")}function g(D){return"["+Error.prototype.toString.call(D)+"]"}function m(D,Z,F,fe,ve){for(var C=[],S=0,j=Z.length;S<j;++S)me(Z,String(S))?C.push(v(D,Z,F,fe,String(S),!0)):C.push("");return ve.forEach(function(V){V.match(/^\d+$/)||C.push(v(D,Z,F,fe,V,!0))}),C}function v(D,Z,F,fe,ve,C){var S,j,V;if(V=Object.getOwnPropertyDescriptor(Z,ve)||{value:Z[ve]},V.get?V.set?j=D.stylize("[Getter/Setter]","special"):j=D.stylize("[Getter]","special"):V.set&&(j=D.stylize("[Setter]","special")),me(fe,ve)||(S="["+ve+"]"),j||(D.seen.indexOf(V.value)<0?(k(F)?j=d(D,V.value,null):j=d(D,V.value,F-1),j.indexOf(`
80
80
  `)>-1&&(C?j=j.split(`
81
- `).map(function(oe){return" "+oe}).join(`
81
+ `).map(function(ae){return" "+ae}).join(`
82
82
  `).slice(2):j=`
83
83
  `+j.split(`
84
- `).map(function(oe){return" "+oe}).join(`
85
- `))):j=M.stylize("[Circular]","special")),X(S)){if(C&&ve.match(/^\d+$/))return j;S=JSON.stringify(""+ve),S.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(S=S.slice(1,-1),S=M.stylize(S,"name")):(S=S.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),S=M.stylize(S,"string"))}return S+": "+j}function E(M,Z,F){var fe=M.reduce(function(ve,C){return C.indexOf(`
84
+ `).map(function(ae){return" "+ae}).join(`
85
+ `))):j=D.stylize("[Circular]","special")),X(S)){if(C&&ve.match(/^\d+$/))return j;S=JSON.stringify(""+ve),S.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(S=S.slice(1,-1),S=D.stylize(S,"name")):(S=S.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),S=D.stylize(S,"string"))}return S+": "+j}function B(D,Z,F){var fe=D.reduce(function(ve,C){return C.indexOf(`
86
86
  `)>=0,ve+C.replace(/\u001b\[\d\d?m/g,"").length+1},0);return fe>60?F[0]+(Z===""?"":Z+`
87
- `)+" "+M.join(`,
88
- `)+" "+F[1]:F[0]+Z+" "+M.join(", ")+" "+F[1]}xe.types=OS();function B(M){return Array.isArray(M)}xe.isArray=B;function v(M){return typeof M=="boolean"}xe.isBoolean=v;function I(M){return M===null}xe.isNull=I;function P(M){return M==null}xe.isNullOrUndefined=P;function D(M){return typeof M=="number"}xe.isNumber=D;function $(M){return typeof M=="string"}xe.isString=$;function ae(M){return typeof M=="symbol"}xe.isSymbol=ae;function X(M){return M===void 0}xe.isUndefined=X;function ue(M){return ee(M)&&Ne(M)==="[object RegExp]"}xe.isRegExp=ue,xe.types.isRegExp=ue;function ee(M){return typeof M=="object"&&M!==null}xe.isObject=ee;function ie(M){return ee(M)&&Ne(M)==="[object Date]"}xe.isDate=ie,xe.types.isDate=ie;function Oe(M){return ee(M)&&(Ne(M)==="[object Error]"||M instanceof Error)}xe.isError=Oe,xe.types.isNativeError=Oe;function Se(M){return typeof M=="function"}xe.isFunction=Se;function $e(M){return M===null||typeof M=="boolean"||typeof M=="number"||typeof M=="string"||typeof M=="symbol"||typeof M>"u"}xe.isPrimitive=$e,xe.isBuffer=MS();function Ne(M){return Object.prototype.toString.call(M)}function Me(M){return M<10?"0"+M.toString(10):M.toString(10)}var We=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ae(){var M=new Date,Z=[Me(M.getHours()),Me(M.getMinutes()),Me(M.getSeconds())].join(":");return[M.getDate(),We[M.getMonth()],Z].join(" ")}xe.log=function(){console.log("%s - %s",Ae(),xe.format.apply(xe,arguments))},xe.inherits=Ct(),xe._extend=function(M,Z){if(!Z||!ee(Z))return M;for(var F=Object.keys(Z),fe=F.length;fe--;)M[F[fe]]=Z[F[fe]];return M};function me(M,Z){return Object.prototype.hasOwnProperty.call(M,Z)}var Pe=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;xe.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if(Pe&&Z[Pe]){if(F=Z[Pe],typeof F!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(F,Pe,{value:F,enumerable:!1,writable:!1,configurable:!0}),F}function F(){for(var fe,ve,C=new Promise(function(V,oe){fe=V,ve=oe}),S=[],j=0;j<arguments.length;j++)S.push(arguments[j]);S.push(function(V,oe){V?ve(V):fe(oe)});try{Z.apply(this||Vr,S)}catch(V){ve(V)}return C}return Object.setPrototypeOf(F,Object.getPrototypeOf(Z)),Pe&&Object.defineProperty(F,Pe,{value:F,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(F,e(Z))},xe.promisify.custom=Pe;function ce(M,Z){if(!M){var F=new Error("Promise was rejected with a falsy value");F.reason=M,M=F}return Z(M)}function he(M){if(typeof M!="function")throw new TypeError('The "original" argument must be of type Function');function Z(){for(var F=[],fe=0;fe<arguments.length;fe++)F.push(arguments[fe]);var ve=F.pop();if(typeof ve!="function")throw new TypeError("The last argument must be of type Function");var C=this||Vr,S=function(){return ve.apply(C,arguments)};M.apply(this||Vr,F).then(function(j){t.nextTick(S.bind(null,null,j))},function(j){t.nextTick(ce.bind(null,j,S))})}return Object.setPrototypeOf(Z,Object.getPrototypeOf(M)),Object.defineProperties(Z,e(M)),Z}return xe.callbackify=he,xe}var le=DS();le.format;le.deprecate;le.debuglog;le.inspect;le.types;le.isArray;le.isBoolean;le.isNull;le.isNullOrUndefined;le.isNumber;le.isString;le.isSymbol;le.isUndefined;le.isRegExp;le.isObject;le.isDate;le.isError;le.isFunction;le.isPrimitive;le.isBuffer;le.log;le.inherits;le._extend;le.promisify;le.callbackify;var zR=le._extend,GR=le.callbackify,VR=le.debuglog,WR=le.deprecate,JR=le.format,YR=le.inherits,XR=le.inspect,QR=le.isArray,ek=le.isBoolean,tk=le.isBuffer,nk=le.isDate,rk=le.isError,ik=le.isFunction,ak=le.isNull,ok=le.isNullOrUndefined,sk=le.isNumber,lk=le.isObject,uk=le.isPrimitive,ck=le.isRegExp,fk=le.isString,dk=le.isSymbol,pk=le.isUndefined,gk=le.log,yk=le.promisify,mk=le.types,hk=le.TextEncoder=globalThis.TextEncoder,vk=le.TextDecoder=globalThis.TextDecoder;var pr=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=le.format(...e);return Y.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 On=class extends pr{constructor(e){super({visibleToBotOwners:!0,...e})}with(e){return new On({...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})}};R();O();k();var gv=t=>async e=>{let n=Rh(e.headers),r=new HS({botId:n.botId,integrationId:n.integrationId,retry:Ua}),a=new qr(r),o=new On,i={ctx:n,req:e,client:a,logger:o,instance:t};try{let s;switch(n.operation){case"webhook_received":s=await jS(i);break;case"register":s=await $S(i);break;case"unregister":s=await ZS(i);break;case"message_created":s=await KS(i);break;case"action_triggered":s=await qS(i);break;case"ping":s=await US(i);break;case"create_user":s=await LS(i);break;case"create_conversation":s=await FS(i);break;default:throw new Error(`Unknown operation ${n.operation}`)}return s?{...s,status:s.status??200}:{status:200}}catch(s){if(NS(s)){let f=s.type==="Runtime"?s:new pv(s.message,s);return o.forBot().error(f.message),{status:f.code,body:JSON.stringify(f.toJSON())}}console.error(s);let l=new pv("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(l.message),{status:l.code,body:JSON.stringify(l.toJSON())}}},US=async t=>{},jS=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{let{req:o}=It(n);return a.webhook({client:t,ctx:e,req:o,logger:r})},$S=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.register)return;let{webhookUrl:o}=It(n);await a.register({client:t,ctx:e,webhookUrl:o,logger:r})},ZS=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.unregister)return;let{webhookUrl:o}=It(n);await a.unregister({ctx:e,webhookUrl:o,client:t,logger:r})},LS=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.createUser)return;let{tags:o}=It(n);return await a.createUser({ctx:e,client:t,tags:o,logger:r})},FS=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.createConversation)return;let{channel:o,tags:i}=It(n);return await a.createConversation({ctx:e,client:t,channel:o,tags:i,logger:r})},KS=async({ctx:t,req:e,client:n,logger:r,instance:a})=>{let{conversation:o,user:i,type:s,payload:l,message:f}=It(e),g=a.channels[o.channel];if(!g)throw new Error(`Channel ${o.channel} not found`);let y=g.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:m})=>{await n.updateMessage({id:f.id,tags:m})},logger:r})},qS=async({req:t,ctx:e,client:n,logger:r,instance:a})=>{let{input:o,type:i}=It(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 ja,g={output:await s({ctx:e,input:o,client:n,type:i,logger:r,metadata:l}),meta:l.toJSON()};return{body:JSON.stringify(g)}};var Ol=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}actions;channels;register;unregister;createUser;createConversation;webhook;handler=gv(this);start=e=>Na(this.handler,e)};R();O();k();R();O();k();R();O();k();R();O();k();R();O();k();var Ml=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}integrations;plugins;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;addIntegration(e,n){let r=this;return r.integrations||(r.integrations={}),r.integrations[e.name]={enabled:n.enabled,...e,configurationType:n.configurationType,configuration:n.configuration},this}addPlugin(e,n){let r=this;return r.plugins||(r.plugins={}),r.plugins[e.name]={...e,configuration:n.configuration,interfaces:n.interfaces},r.user=this._mergeUser(r.user,e.definition.user),r.conversation=this._mergeConversation(r.conversation,e.definition.conversation),r.message=this._mergeMessage(r.message,e.definition.message),r.states=this._mergeStates(r.states,e.definition.states),r.events=this._mergeEvents(r.events,e.definition.events),r.recurringEvents=this._mergeRecurringEvents(r.recurringEvents,e.definition.recurringEvents),r.actions=this._mergeActions(r.actions,e.definition.actions),r.tables=this._mergeTables(r.tables,e.definition.tables),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})};R();O();k();R();O();k();import*as mv from"@botpress/client";R();O();k();var Mn=class extends pr{constructor(e){super({...e})}with(e){return new Mn({...this.defaultOptions,...e})}withUserId(e){return this.with({userId:e})}withConversationId(e){return this.with({conversationId:e})}withWorkflowId(e){return this.with({workflowId:e})}};R();O();k();R();O();k();var Xt=class{constructor(e,n={before:{},after:{}}){this._client=e;this._hooks=n}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);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);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)),a}};R();O();k();var zS=re.enum(["event_received","register","unregister","ping","action_triggered"]),yv=t=>{let e=t[da],n=t[pa],r=t[Sy],a=zS.parse(t[ga]);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(!a)throw new Error("Missing operation headers");return{botId:e,operation:a,type:r,configuration:n?JSON.parse(W.from(n,"base64").toString("utf-8")):{}}};R();O();k();var Mt={status:200},hv=t=>async e=>{let n=yv(e.headers),r=new Mn,a=new mv.Client({botId:n.botId,retry:Ua}),o=new Xt(a,{before:{createMessage:async s=>{let l=t.hookHandlers.before_outgoing_message[s.type]??[];for(let f of l)s=(await f({client:new Xt(a),ctx:n,logger:r,data:s}))?.data??s;return s},callAction:async s=>{let l=t.hookHandlers.before_outgoing_call_action[s.type]??[];for(let f of l)s=(await f({client:new Xt(a),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)s=(await f({client:new Xt(a),ctx:n,logger:r,data:s}))?.data??s;return s},callAction:async s=>{let l=t.hookHandlers.after_outgoing_call_action[s.output.type]??[];for(let f of l)s=(await f({client:new Xt(a),ctx:n,logger:r,data:s}))?.data??s;return s}}}),i={req:e,ctx:n,logger:r,client:o,self:t};switch(n.operation){case"action_triggered":return await YS(i);case"event_received":return await JS(i);case"register":return await VS(i);case"unregister":return await WS(i);case"ping":return await GS(i);default:throw new Error(`Unknown operation ${n.operation}`)}},GS=async({ctx:t})=>(tr.info(`Received ${t.operation} operation for bot ${t.botId} of type ${t.type}`),Mt),VS=async t=>Mt,WS=async t=>Mt,JS=async({ctx:t,logger:e,req:n,client:r,self:a})=>{let o={client:r,ctx:t,logger:e};tr.debug(`Received event ${t.type}`);let i=It(n);if(t.type==="message_created"){let p=i.event,m=p.payload.message,_=a.hookHandlers.before_incoming_message[m.type]??[];for(let I of _){let P=await I({...o,data:m});if(m=P?.data??m,P?.stop)return Mt}let E={...o,user:p.payload.user,conversation:p.payload.conversation,states:p.payload.states,message:m,event:p},B=a.messageHandlers[m.type]??[];for(let I of B)await I(E);let v=a.hookHandlers.after_incoming_message[m.type]??[];for(let I of v){let P=await I({...o,data:m});if(m=P?.data??m,P?.stop)return Mt}return Mt}if(t.type==="state_expired"){let m=i.event.payload.state,_={...o,state:m},E=a.stateExpiredHandlers["*"]??[];for(let B of E)await B(_);return Mt}let s=i.event,l=a.hookHandlers.before_incoming_event[s.type]??[];for(let p of l){let m=await p({...o,data:s});if(s=m?.data??s,m?.stop)return Mt}let f={...o,event:s},g=a.eventHandlers[s.type]??[];for(let p of g)await p(f);let y=a.hookHandlers.after_incoming_event[s.type]??[];for(let p of y){let m=await p({...o,data:s});if(s=m?.data??s,m?.stop)return Mt}return Mt},YS=async({ctx:t,logger:e,req:n,client:r,self:a})=>{let{input:o,type:i}=It(n);if(!i)throw new Error("Missing action type");let s=a.actionHandlers[i];if(!s)throw new Error(`Action ${i} not found`);let f={output:await s({ctx:t,logger:e,input:o,client:r,type:i})};return{status:200,body:JSON.stringify(f)}};var Dl=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:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{}};_plugins={};get actionHandlers(){let e=this._actionHandlers,n=Object.values(this._plugins).reduce((r,a)=>({...r,...a.actionHandlers}),{});return{...e,...n}}get messageHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._messageHandlers[n]??[],a=this._messageHandlers["*"]??[],o=[...r,...a],i=Object.values(this._plugins).flatMap(s=>s.messageHandlers[n]??[]);return Re.unique([...o,...i])}})}get eventHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._eventHandlers[n]??[],a=this._eventHandlers["*"]??[],o=[...r,...a],i=Object.values(this._plugins).flatMap(s=>s.eventHandlers[n]??[]);return Re.unique([...o,...i])}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._stateExpiredHandlers[n]??[],a=this._stateExpiredHandlers["*"]??[],o=[...r,...a],i=Object.values(this._plugins).flatMap(s=>s.stateExpiredHandlers[n]??[]);return Re.unique([...o,...i])}})}get hookHandlers(){return new Proxy({},{get:(e,n)=>new Proxy({},{get:(r,a)=>{let o=n,i=this._hookHandlers[o]??{},s=i[a]??[],l=i["*"]??[],f=[...s,...l],g=Object.values(this._plugins).flatMap(y=>y.hookHandlers[o]?.[a]??[]);return Re.unique([...f,...g])}})})}on={message:(e,n)=>{this._messageHandlers[e]=Re.safePush(this._messageHandlers[e],n)},event:(e,n)=>{this._eventHandlers[e]=Re.safePush(this._eventHandlers[e],n)},stateExpired:(e,n)=>{this._stateExpiredHandlers[e]=Re.safePush(this._stateExpiredHandlers[e],n)},beforeIncomingEvent:(e,n)=>{this._hookHandlers.before_incoming_event[e]=Re.safePush(this._hookHandlers.before_incoming_event[e],n)},beforeIncomingMessage:(e,n)=>{this._hookHandlers.before_incoming_message[e]=Re.safePush(this._hookHandlers.before_incoming_message[e],n)},beforeOutgoingMessage:(e,n)=>{this._hookHandlers.before_outgoing_message[e]=Re.safePush(this._hookHandlers.before_outgoing_message[e],n)},beforeOutgoingCallAction:(e,n)=>{this._hookHandlers.before_outgoing_call_action[e]=Re.safePush(this._hookHandlers.before_outgoing_call_action[e],n)},afterIncomingEvent:(e,n)=>{this._hookHandlers.after_incoming_event[e]=Re.safePush(this._hookHandlers.after_incoming_event[e],n)},afterIncomingMessage:(e,n)=>{this._hookHandlers.after_incoming_message[e]=Re.safePush(this._hookHandlers.after_incoming_message[e],n)},afterOutgoingMessage:(e,n)=>{this._hookHandlers.after_outgoing_message[e]=Re.safePush(this._hookHandlers.after_outgoing_message[e],n)},afterOutgoingCallAction:(e,n)=>{this._hookHandlers.after_outgoing_call_action[e]=Re.safePush(this._hookHandlers.after_outgoing_call_action[e],n)}};handler=hv(this);start=e=>Na(this.handler,e)};R();O();k();R();O();k();R();O();k();R();O();k();R();O();k();var Nl=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.entities=e.entities??{};let n=this._getEntityReference(this.entities),r=e.events===void 0?{}:ze.mapValues(e.events,i=>({...i,schema:i.schema(n)})),a=e.actions===void 0?{}:ze.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?{}:ze.mapValues(e.channels,i=>({...i,messages:ze.mapValues(i.messages,s=>({...s,schema:s.schema(n)}))}));this.events=r,this.actions=a,this.channels=o}name;version;entities;events;actions;channels;_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=py.ref(r);o&&s.title(o),i&&s.describe(i),n[r]=s}return n}};R();O();k();R();O();k();R();O();k();R();O();k();var Hl=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.description=e.description,this.integrations=e.integrations,this.interfaces=e.interfaces,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}name;version;title;description;icon;readme;integrations;interfaces;user;conversation;message;states;configuration;events;recurringEvents;actions;tables};R();O();k();R();O();k();R();O();k();R();O();k();var Ul=":";var vv=t=>{let[e,n]=t.split(Ul);return!e||!n?null:{namespace:e,eventName:n}},Tv=t=>`${t.namespace}${Ul}${t.actionName}`,bv=t=>`${t.namespace}${Ul}${t.eventName}`,_v=(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}},xv=(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 wv=(t,e)=>new Proxy({},{get:(n,r)=>new Proxy({},{get:(a,o)=>i=>XS({client:t,interfaces:e,integrationOrInterfaceName:r,methodName:o,input:i})})}),XS=async({client:t,interfaces:e,integrationOrInterfaceName:n,methodName:r,input:a})=>{let o=_v({namespace:n,actionName:r},e),i=Tv(o);return(await t.callAction({type:i,input:a})).output};R();O();k();var jl=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:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{}};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}=this._runtime,a=wv(e,r);return{configuration:n,interfaces:r,actions:a}}get actionHandlers(){let e=this._actionHandlers,n={};for(let[r,a]of ze.pairs(e))n[r]=async o=>a({...o,...this._getTools(o.client)});return n}get messageHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._messageHandlers[n]??[],a=this._messageHandlers["*"]??[];return Re.unique([...r,...a]).map(i=>kn.setName(s=>i({...s,...this._getTools(s.client)}),i.name))}})}get eventHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._eventHandlers[n]??[],a=Object.entries(this._eventHandlers).filter(([s])=>this._eventResolvesTo(s,n)).flatMap(([,s])=>s??[]),o=this._eventHandlers["*"]??[];return Re.unique([...r,...a,...o]).map(s=>kn.setName(l=>s({...l,...this._getTools(l.client)}),s.name))}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._stateExpiredHandlers[n]??[],a=this._stateExpiredHandlers["*"]??[];return Re.unique([...r,...a]).map(i=>kn.setName(s=>i({...s,...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)=>{let i=r[o]??[],s=Object.entries(r).filter(([g])=>this._eventResolvesTo(g,o)).flatMap(([,g])=>g??[]),l=r["*"]??[];return Re.unique([...i,...s,...l]).map(g=>kn.setName(y=>g({...y,...this._getTools(y.client)}),g.name))}})}})}on={message:(e,n)=>{this._messageHandlers[e]=Re.safePush(this._messageHandlers[e],n)},event:(e,n)=>{this._eventHandlers[e]=Re.safePush(this._eventHandlers[e],n)},stateExpired:(e,n)=>{this._stateExpiredHandlers[e]=Re.safePush(this._stateExpiredHandlers[e],n)},beforeIncomingEvent:(e,n)=>{this._hookHandlers.before_incoming_event[e]=Re.safePush(this._hookHandlers.before_incoming_event[e],n)},beforeIncomingMessage:(e,n)=>{this._hookHandlers.before_incoming_message[e]=Re.safePush(this._hookHandlers.before_incoming_message[e],n)},beforeOutgoingMessage:(e,n)=>{this._hookHandlers.before_outgoing_message[e]=Re.safePush(this._hookHandlers.before_outgoing_message[e],n)},beforeOutgoingCallAction:(e,n)=>{this._hookHandlers.before_outgoing_call_action[e]=Re.safePush(this._hookHandlers.before_outgoing_call_action[e],n)},afterIncomingEvent:(e,n)=>{this._hookHandlers.after_incoming_event[e]=Re.safePush(this._hookHandlers.after_incoming_event[e],n)},afterIncomingMessage:(e,n)=>{this._hookHandlers.after_incoming_message[e]=Re.safePush(this._hookHandlers.after_incoming_message[e],n)},afterOutgoingMessage:(e,n)=>{this._hookHandlers.after_outgoing_message[e]=Re.safePush(this._hookHandlers.after_outgoing_message[e],n)},afterOutgoingCallAction:(e,n)=>{this._hookHandlers.after_outgoing_call_action[e]=Re.safePush(this._hookHandlers.after_outgoing_call_action[e],n)}};_eventResolvesTo=(e,n)=>{let r=vv(e);if(!r)return!1;let a=xv(r,this._runtime.interfaces);return bv(a)===n}};R();O();k();R();O();k();R();O();k();R();O();k();R();O();k();R();O();k();export{aw as BRAND,Dl as Bot,Ml as BotDefinition,Mn as BotLogger,Xt as BotSpecificClient,qn as DIRTY,rw as EMPTY_PATH,Ir as ErrorBoundary,de as INVALID,Ol as Integration,Js as IntegrationDefinition,On as IntegrationLogger,qr as IntegrationSpecificClient,Nl as InterfaceDefinition,xE as NEVER,ut as OK,Bt as ParseInputLazyPath,pt as ParseStatus,jl as Plugin,Hl as PluginDefinition,zD as RuntimeError,ye as Schema,xi as ZodAny,Or as ZodArray,Oo as ZodBigInt,Mo as ZodBoolean,Do as ZodBranded,No as ZodCatch,Ho as ZodDate,sa as ZodDefault,ng as ZodDiscriminatedUnion,vn as ZodEffects,er as ZodEnum,$t as ZodError,Lp as ZodFirstPartyTypeKind,ig as ZodFunction,jo as ZodIntersection,G as ZodIssueCode,$o as ZodLazy,Zo as ZodLiteral,sg as ZodMap,ug as ZodNaN,Lo as ZodNativeEnum,hn as ZodNever,Fo as ZodNull,Gn as ZodNullable,Ko as ZodNumber,Vn as ZodObject,tn as ZodOptional,ne as ZodParsedType,qo as ZodPipeline,ua as ZodPromise,ca as ZodReadonly,mg as ZodRecord,vg as ZodRef,ye as ZodSchema,Tg as ZodSet,ct as ZodString,Rg as ZodSymbol,vn as ZodTransformer,Jn as ZodTuple,ye as ZodType,zo as ZodUndefined,Go as ZodUnion,Pr as ZodUnknown,Dg as ZodVoid,GA as ZuiForm,te as addIssueToContext,Iw as agent,kw as aimodel,Fw as any,Gw as array,Uw as bigint,uy as boolean,da as botIdHeader,Ey as botUserIdHeader,_E as coerce,pa as configurationHeader,Iy as configurationTypeHeader,Ew as conversation,la as createZodEnum,_g as cuid2Regex,bg as cuidRegex,eg as custom,Ow as datasource,jw as date,Sg as datetimeRegex,VA as defaultComponentDefinitions,Yw as discriminatedUnion,nf as effect,Eg as emailRegex,lE as enum,se as errorUtil,Sw as event,TE as fromJsonSchema,bE as fromObject,aE as function,Rr as getErrorMap,en as getParsedType,Nw as instanceof,By as integrationIdHeader,Rw as intent,Xw as intersection,Pg as ipv4Regex,Ig as ipv6Regex,uo as isAborted,qD as isApiError,bi as isAsync,co as isDirty,ow as isEmojiRegex,kr as isValid,fa as jsonSchemaToZui,Mw as knowledgebase,Dw as late,oE as lazy,sE as literal,Ti as makeIssue,rE as map,Nr as mergeObjectSchemas,Pw as message,wy as messages,Hw as nan,uE as nativeEnum,qw as never,Lw as null,dE as nullable,ly as number,Vw as object,Mr as objectToZui,lo as objectUtil,vE as oboolean,hE as onumber,ga as operationHeader,fE as optional,mE as ostring,It as parseBody,yE as pipeline,gE as preprocess,ge as processCreateParams,cE as promise,nw as quotelessJson,nE as readonly,eE as record,tE as ref,Na as serve,iE as set,qp as setErrorMap,Ww as strictObject,sy as string,$w as symbol,Aw as table,Cw as tablerow,nf as transformer,WA as transforms,Qw as tuple,Sy as typeHeader,xg as ulidRegex,Zw as undefined,Jw as union,Kw as unknown,Bw as user,be as util,wg as uuidRegex,ww as variable,zw as void,Py as webhookIdHeader,zE as withErrorBoundary,re as z,Yo as zuiToJsonSchema};
87
+ `)+" "+D.join(`,
88
+ `)+" "+F[1]:F[0]+Z+" "+D.join(", ")+" "+F[1]}we.types=ZS();function E(D){return Array.isArray(D)}we.isArray=E;function T(D){return typeof D=="boolean"}we.isBoolean=T;function k(D){return D===null}we.isNull=k;function P(D){return D==null}we.isNullOrUndefined=P;function M(D){return typeof D=="number"}we.isNumber=M;function $(D){return typeof D=="string"}we.isString=$;function oe(D){return typeof D=="symbol"}we.isSymbol=oe;function X(D){return D===void 0}we.isUndefined=X;function ue(D){return ee(D)&&Ne(D)==="[object RegExp]"}we.isRegExp=ue,we.types.isRegExp=ue;function ee(D){return typeof D=="object"&&D!==null}we.isObject=ee;function ie(D){return ee(D)&&Ne(D)==="[object Date]"}we.isDate=ie,we.types.isDate=ie;function Oe(D){return ee(D)&&(Ne(D)==="[object Error]"||D instanceof Error)}we.isError=Oe,we.types.isNativeError=Oe;function Ie(D){return typeof D=="function"}we.isFunction=Ie;function $e(D){return D===null||typeof D=="boolean"||typeof D=="number"||typeof D=="string"||typeof D=="symbol"||typeof D>"u"}we.isPrimitive=$e,we.isBuffer=LS();function Ne(D){return Object.prototype.toString.call(D)}function Me(D){return D<10?"0"+D.toString(10):D.toString(10)}var Ve=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ce(){var D=new Date,Z=[Me(D.getHours()),Me(D.getMinutes()),Me(D.getSeconds())].join(":");return[D.getDate(),Ve[D.getMonth()],Z].join(" ")}we.log=function(){console.log("%s - %s",Ce(),we.format.apply(we,arguments))},we.inherits=At(),we._extend=function(D,Z){if(!Z||!ee(Z))return D;for(var F=Object.keys(Z),fe=F.length;fe--;)D[F[fe]]=Z[F[fe]];return D};function me(D,Z){return Object.prototype.hasOwnProperty.call(D,Z)}var ke=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;we.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if(ke&&Z[ke]){if(F=Z[ke],typeof F!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(F,ke,{value:F,enumerable:!1,writable:!1,configurable:!0}),F}function F(){for(var fe,ve,C=new Promise(function(V,ae){fe=V,ve=ae}),S=[],j=0;j<arguments.length;j++)S.push(arguments[j]);S.push(function(V,ae){V?ve(V):fe(ae)});try{Z.apply(this||Xr,S)}catch(V){ve(V)}return C}return Object.setPrototypeOf(F,Object.getPrototypeOf(Z)),ke&&Object.defineProperty(F,ke,{value:F,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(F,e(Z))},we.promisify.custom=ke;function ce(D,Z){if(!D){var F=new Error("Promise was rejected with a falsy value");F.reason=D,D=F}return Z(D)}function he(D){if(typeof D!="function")throw new TypeError('The "original" argument must be of type Function');function Z(){for(var F=[],fe=0;fe<arguments.length;fe++)F.push(arguments[fe]);var ve=F.pop();if(typeof ve!="function")throw new TypeError("The last argument must be of type Function");var C=this||Xr,S=function(){return ve.apply(C,arguments)};D.apply(this||Xr,F).then(function(j){t.nextTick(S.bind(null,null,j))},function(j){t.nextTick(ce.bind(null,j,S))})}return Object.setPrototypeOf(Z,Object.getPrototypeOf(D)),Object.defineProperties(Z,e(D)),Z}return we.callbackify=he,we}var le=FS();le.format;le.deprecate;le.debuglog;le.inspect;le.types;le.isArray;le.isBoolean;le.isNull;le.isNullOrUndefined;le.isNumber;le.isString;le.isSymbol;le.isUndefined;le.isRegExp;le.isObject;le.isDate;le.isError;le.isFunction;le.isPrimitive;le.isBuffer;le.log;le.inherits;le._extend;le.promisify;le.callbackify;var oR=le._extend,aR=le.callbackify,sR=le.debuglog,lR=le.deprecate,uR=le.format,cR=le.inherits,fR=le.inspect,dR=le.isArray,pR=le.isBoolean,gR=le.isBuffer,yR=le.isDate,mR=le.isError,hR=le.isFunction,vR=le.isNull,TR=le.isNullOrUndefined,_R=le.isNumber,bR=le.isObject,wR=le.isPrimitive,xR=le.isRegExp,BR=le.isString,ER=le.isSymbol,PR=le.isUndefined,kR=le.log,SR=le.promisify,IR=le.types,CR=le.TextEncoder=globalThis.TextEncoder,AR=le.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=le.format(...e);return Y.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 Nn=class extends yr{constructor(e){super({visibleToBotOwners:!0,...e})}with(e){return new Nn({...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})}};A();O();R();var _v=t=>async e=>{let n=Uh(e.headers),r=new WS({botId:n.botId,integrationId:n.integrationId,retry:Ko}),o=new Vr(r),a=new Nn,i={ctx:n,req:e,client:o,logger:a,instance:t};try{let s;switch(n.operation){case"webhook_received":s=await zS(i);break;case"register":s=await GS(i);break;case"unregister":s=await VS(i);break;case"message_created":s=await XS(i);break;case"action_triggered":s=await QS(i);break;case"ping":s=await qS(i);break;case"create_user":s=await JS(i);break;case"create_conversation":s=await YS(i);break;default:throw new Error(`Unknown operation ${n.operation}`)}return s?{...s,status:s.status??200}:{status:200}}catch(s){if(KS(s)){let f=s.type==="Runtime"?s:new Tv(s.message,s);return a.forBot().error(f.message),{status:f.code,body:JSON.stringify(f.toJSON())}}console.error(s);let l=new Tv("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(l.message),{status:l.code,body:JSON.stringify(l.toJSON())}}},qS=async t=>{},zS=async({client:t,ctx:e,req:n,logger:r,instance:o})=>{let{req:a}=St(n);return o.webhook({client:t,ctx:e,req:a,logger:r})},GS=async({client:t,ctx:e,req:n,logger:r,instance:o})=>{if(!o.register)return;let{webhookUrl:a}=St(n);await o.register({client:t,ctx:e,webhookUrl:a,logger:r})},VS=async({client:t,ctx:e,req:n,logger:r,instance:o})=>{if(!o.unregister)return;let{webhookUrl:a}=St(n);await o.unregister({ctx:e,webhookUrl:a,client:t,logger:r})},JS=async({client:t,ctx:e,req:n,logger:r,instance:o})=>{if(!o.createUser)return;let{tags:a}=St(n);return await o.createUser({ctx:e,client:t,tags:a,logger:r})},YS=async({client:t,ctx:e,req:n,logger:r,instance:o})=>{if(!o.createConversation)return;let{channel:a,tags:i}=St(n);return await o.createConversation({ctx:e,client:t,channel:a,tags:i,logger:r})},XS=async({ctx:t,req:e,client:n,logger:r,instance:o})=>{let{conversation:a,user:i,type:s,payload:l,message:f}=St(e),d=o.channels[a.channel];if(!d)throw new Error(`Channel ${a.channel} not found`);let y=d.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:m})=>{await n.updateMessage({id:f.id,tags:m})},logger:r})},QS=async({req:t,ctx:e,client:n,logger:r,instance:o})=>{let{input:a,type:i}=St(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 Wo,d={output:await s({ctx:e,input:a,client:n,type:i,logger:r,metadata:l}),meta:l.toJSON()};return{body:JSON.stringify(d)}};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}actions;channels;register;unregister;createUser;createConversation;webhook;handler=_v(this);start=e=>Zo(this.handler,e)};A();O();R();A();O();R();A();O();R();A();O();R();A();O();R();var eI="#",jl=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}integrations;plugins;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;workflows;addIntegration(e,n){let r=this;return r.integrations||(r.integrations={}),r.integrations[e.name]={enabled:n.enabled,...e,configurationType:n.configurationType,configuration:n.configuration},this}addPlugin(e,n){let r=this;r.plugins||(r.plugins={});let o=n.alias??e.name;return r.plugins[o]={...e,alias:n.alias,configuration:n.configuration,interfaces:n.interfaces},r.user=this._mergeUser(r.user,e.definition.user),r.conversation=this._mergeConversation(r.conversation,e.definition.conversation),r.message=this._mergeMessage(r.message,e.definition.message),r.recurringEvents=this._mergeRecurringEvents(r.recurringEvents,e.definition.recurringEvents),r.tables=this._mergeTables(r.tables,e.definition.tables),r.workflows=this._mergeWorkflows(r.workflows,e.definition.workflows),r.states=this._mergeStates(r.states,this._prefixKeys(e.definition.states,n.alias)),r.events=this._mergeEvents(r.events,this._prefixKeys(e.definition.events,n.alias)),r.actions=this._mergeActions(r.actions,this._prefixKeys(e.definition.actions,n.alias)),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});_prefixKeys=(e,n)=>!e||!n?e:qe.mapKeys(e,r=>`${n}${eI}${r}`)};A();O();R();A();O();R();import*as xv from"@botpress/client";A();O();R();var Un=class extends yr{constructor(e){super({...e})}with(e){return new Un({...this.defaultOptions,...e})}withUserId(e){return this.with({userId:e})}withConversationId(e){return this.with({conversationId:e})}withWorkflowId(e){return this.with({workflowId:e})}};A();O();R();A();O();R();var Qt=class{constructor(e,n={before:{},after:{}}){this._client=e;this._hooks=n}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)),o}};A();O();R();A();O();R();var mr=t=>new Proxy({},{get:(e,n)=>({listInstances:{all:r=>un({workflowName:n,client:t,input:r}),running:r=>un({workflowName:n,client:t,input:r,statuses:["in_progress"]}),scheduled:r=>un({workflowName:n,client:t,input:r,statuses:["pending","listening"]}),allFinished:r=>un({workflowName:n,client:t,input:r,statuses:["completed","cancelled","failed","timedout"]}),cancelled:r=>un({workflowName:n,client:t,input:r,statuses:["cancelled"]}),failed:r=>un({workflowName:n,client:t,input:r,statuses:["failed"]}),succeeded:r=>un({workflowName:n,client:t,input:r,statuses:["completed"]}),timedOut:r=>un({workflowName:n,client:t,input:r,statuses:["timedout"]})},startNewInstance:async r=>{let{workflow:o}=await t.createWorkflow({name:n,status:"pending",...r});return{workflow:cn({client:t,workflow:o})}}})}),un=async t=>{let e=await t.client.listWorkflows({name:t.workflowName,statuses:t.statuses,...t.input});return{...e,workflows:e.workflows.map(n=>cn({client:t.client,workflow:n}))}},cn=t=>({...t.workflow,async update(e){let{workflow:n}=await t.client.updateWorkflow({id:t.workflow.id,...e});return{workflow:cn({client:t.client,workflow:n})}},async setFailed({failureReason:e}){let{workflow:n}=await t.client.updateWorkflow({id:t.workflow.id,status:"failed",failureReason:e});return{workflow:cn({client:t.client,workflow:n})}},async setCompleted({output:e}={}){let{workflow:n}=await t.client.updateWorkflow({id:t.workflow.id,status:"completed",output:e});return{workflow:cn({client:t.client,workflow:n})}},async cancel(){let{workflow:e}=await t.client.updateWorkflow({id:t.workflow.id,status:"cancelled"});return{workflow:cn({client:t.client,workflow:e})}}});A();O();R();A();O();R();var tI=re.enum(["event_received","register","unregister","ping","action_triggered"]),bv=t=>{let e=t[ho],n=t[vo],r=t[My],o=tI.parse(t[To]);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(G.from(n,"base64").toString("utf-8")):{}}};A();O();R();var lt={status:200};A();O();R();A();O();R();var $l=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}`)}},Go=t=>t==="timedOut"?"timed_out":t;var nI=["child_workflow_deleted","child_workflow_finished","workflow_timedout","workflow_started","workflow_continued"],wv=async(t,e)=>{if(t.ctx.type!=="workflow_update"||!nI.includes(e.payload.type))throw new Error("Unexpected event type");if(!e.payload.workflow.name)return t.logger.withWorkflowId(e.payload.workflow.id).warn("Received workflow update event without a workflow name. Assuming this workflow was not defined by the bot.",e.payload.workflow),lt;switch(e.payload.type){case"child_workflow_deleted":case"child_workflow_finished":t.logger.withWorkflowId(e.payload.workflow.id).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 rI(t,e);default:e.payload.type}return lt},rI=async(t,e)=>{let n=$l(e.payload.type),r=t.self.workflowHandlers[n]?.[e.payload.workflow.name];return!r||r.length===0?(t.logger.withWorkflowId(e.payload.workflow.id).warn(`No ${n} handler found for workflow "${e.payload.workflow.name}"`),lt):(await iI(t,e),await oI(t,e),lt)},iI=async(t,e)=>{e.payload.workflow.status==="pending"&&await t.client.updateWorkflow({id:e.payload.workflow.id,status:"in_progress",eventId:e.id})},oI=async(t,e)=>{let n=$l(e.payload.type),r=t.self.workflowHandlers[n]?.[e.payload.workflow.name];for(let o of r)await o({...t,conversation:e.payload.conversation,user:e.payload.user,workflow:cn({...t,workflow:e.payload.workflow}),workflows:mr(t.client)})};A();O();R();var Bv=t=>async e=>{let n=bv(e.headers),r=new Un,o=new xv.Client({botId:n.botId,retry:Ko}),a=new Qt(o,{before:{createMessage:async s=>{let l=t.hookHandlers.before_outgoing_message[s.type]??[];for(let f of l){let d=new Qt(o);s=(await f({client:d,ctx:n,logger:r,data:s,...hr({client:d})}))?.data??s}return s},callAction:async s=>{let l=t.hookHandlers.before_outgoing_call_action[s.type]??[];for(let f of l){let d=new Qt(o);s=(await f({client:d,ctx:n,logger:r,data:s,...hr({client:d})}))?.data??s}return s}},after:{createMessage:async s=>{let l=t.hookHandlers.after_outgoing_message[s.message.type]??[];for(let f of l){let d=new Qt(o);s=(await f({client:d,ctx:n,logger:r,data:s,...hr({client:d})}))?.data??s}return s},callAction:async s=>{let l=t.hookHandlers.after_outgoing_call_action[s.output.type]??[];for(let f of l){let d=new Qt(o);s=(await f({client:d,ctx:n,logger:r,data:s,...hr({client:d})}))?.data??s}return s}}}),i={req:e,ctx:n,logger:r,client:a,self:t};switch(n.operation){case"action_triggered":return await cI(i);case"event_received":return await uI(i);case"register":return await sI(i);case"unregister":return await lI(i);case"ping":return await aI(i);default:throw new Error(`Unknown operation ${n.operation}`)}},aI=async({ctx:t})=>(ir.info(`Received ${t.operation} operation for bot ${t.botId} of type ${t.type}`),lt),sI=async t=>lt,lI=async t=>lt,uI=async t=>{let{ctx:e,logger:n,req:r,client:o,self:a}=t,i={client:o,ctx:e,logger:n,...hr({client:o})};ir.debug(`Received event ${e.type}`);let s=St(r);if(e.type==="workflow_update")return await wv(t,s.event);if(e.type==="message_created"){let m=s.event,v=m.payload.message,B=a.hookHandlers.before_incoming_message[v.type]??[];for(let P of B){let M=await P({...i,data:v});if(v=M?.data??v,M?.stop)return lt}let E={...i,user:m.payload.user,conversation:m.payload.conversation,states:m.payload.states,message:v,event:m},T=a.messageHandlers[v.type]??[];for(let P of T)await P(E);let k=a.hookHandlers.after_incoming_message[v.type]??[];for(let P of k){let M=await P({...i,data:v});if(v=M?.data??v,M?.stop)return lt}return lt}if(e.type==="state_expired"){let v=s.event.payload.state,B={...i,state:v},E=a.stateExpiredHandlers["*"]??[];for(let T of E)await T(B);return lt}let l=s.event,f=a.hookHandlers.before_incoming_event[l.type]??[];for(let m of f){let v=await m({...i,data:l});if(l=v?.data??l,v?.stop)return lt}let d={...i,event:l},y=a.eventHandlers[l.type]??[];for(let m of y)await m(d);let g=a.hookHandlers.after_incoming_event[l.type]??[];for(let m of g){let v=await m({...i,data:l});if(l=v?.data??l,v?.stop)return lt}return lt},cI=async({ctx:t,logger:e,req:n,client:r,self:o})=>{let{input:a,type:i}=St(n);if(!i)throw new Error("Missing action type");let s=o.actionHandlers[i];if(!s)throw new Error(`Action ${i} not found`);let f={output:await s({ctx:t,logger:e,input:a,client:r,type:i,...hr({client:r})})};return{status:200,body:JSON.stringify(f)}},hr=t=>({workflows:mr(t.client)});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:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{}};_workflowHandlers={};_plugins={};get actionHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._actionHandlers[n];if(r)return r;for(let o of Object.values(this._plugins))if(r=o.actionHandlers[n],r)return r}})}get messageHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._messageHandlers[n]??[],o=this._messageHandlers["*"]??[],a=[...r,...o],i=Object.values(this._plugins).flatMap(s=>s.messageHandlers[n]??[]);return Pe.unique([...a,...i])}})}get eventHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._eventHandlers[n]??[],o=this._eventHandlers["*"]??[],a=[...r,...o],i=Object.values(this._plugins).flatMap(s=>s.eventHandlers[n]??[]);return Pe.unique([...a,...i])}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._stateExpiredHandlers[n]??[],o=this._stateExpiredHandlers["*"]??[],a=[...r,...o],i=Object.values(this._plugins).flatMap(s=>s.stateExpiredHandlers[n]??[]);return Pe.unique([...a,...i])}})}get hookHandlers(){return new Proxy({},{get:(e,n)=>new Proxy({},{get:(r,o)=>{let a=n,i=this._hookHandlers[a]??{},s=i[o]??[],l=i["*"]??[],f=[...s,...l],d=Object.values(this._plugins).flatMap(y=>y.hookHandlers[a]?.[o]??[]);return Pe.unique([...f,...d])}})})}get workflowHandlers(){return new Proxy({},{get:(e,n)=>new Proxy({},{get:(r,o)=>{let i=this._workflowHandlers[n]?.[o],s=Object.values(this._plugins).flatMap(l=>l.workflowHandlers[n]?.[o]??[]);return Pe.unique([...i??[],...s])}})})}on={message:(e,n)=>{this._messageHandlers[e]=Pe.safePush(this._messageHandlers[e],n)},workflows:new Proxy({},{get:(e,n)=>new Proxy({},{get:(r,o)=>a=>{let i=Go(o);this._workflowHandlers[i]??={},this._workflowHandlers[i][n]=Pe.safePush(this._workflowHandlers[i][n],a)}})}),event:(e,n)=>{this._eventHandlers[e]=Pe.safePush(this._eventHandlers[e],n)},stateExpired:(e,n)=>{this._stateExpiredHandlers[e]=Pe.safePush(this._stateExpiredHandlers[e],n)},beforeIncomingEvent:(e,n)=>{this._hookHandlers.before_incoming_event[e]=Pe.safePush(this._hookHandlers.before_incoming_event[e],n)},beforeIncomingMessage:(e,n)=>{this._hookHandlers.before_incoming_message[e]=Pe.safePush(this._hookHandlers.before_incoming_message[e],n)},beforeOutgoingMessage:(e,n)=>{this._hookHandlers.before_outgoing_message[e]=Pe.safePush(this._hookHandlers.before_outgoing_message[e],n)},beforeOutgoingCallAction:(e,n)=>{this._hookHandlers.before_outgoing_call_action[e]=Pe.safePush(this._hookHandlers.before_outgoing_call_action[e],n)},afterIncomingEvent:(e,n)=>{this._hookHandlers.after_incoming_event[e]=Pe.safePush(this._hookHandlers.after_incoming_event[e],n)},afterIncomingMessage:(e,n)=>{this._hookHandlers.after_incoming_message[e]=Pe.safePush(this._hookHandlers.after_incoming_message[e],n)},afterOutgoingMessage:(e,n)=>{this._hookHandlers.after_outgoing_message[e]=Pe.safePush(this._hookHandlers.after_outgoing_message[e],n)},afterOutgoingCallAction:(e,n)=>{this._hookHandlers.after_outgoing_call_action[e]=Pe.safePush(this._hookHandlers.after_outgoing_call_action[e],n)}};handler=Bv(this);start=e=>Zo(this.handler,e)};A();O();R();A();O();R();A();O();R();A();O();R();A();O();R();var Ll=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.entities=e.entities??{};let n=this._getEntityReference(this.entities),r=e.events===void 0?{}:qe.mapValues(e.events,i=>({...i,schema:i.schema(n)})),o=e.actions===void 0?{}:qe.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?{}:qe.mapValues(e.channels,i=>({...i,messages:qe.mapValues(i.messages,s=>({...s,schema:s.schema(n)}))}));this.events=r,this.actions=o,this.channels=a}name;version;entities;events;actions;channels;_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=Ty.ref(r);a&&s.title(a),i&&s.describe(i),n[r]=s}return n}};A();O();R();A();O();R();A();O();R();A();O();R();var Fl=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.description=e.description,this.integrations=e.integrations,this.interfaces=e.interfaces,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}name;version;title;description;icon;readme;integrations;interfaces;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;workflows};A();O();R();A();O();R();A();O();R();A();O();R();var Kl=":";var Ev=t=>{let[e,n]=t.split(Kl);return!e||!n?null:{namespace:e,eventName:n}},Pv=t=>`${t.namespace}${Kl}${t.actionName}`,kv=t=>`${t.namespace}${Kl}${t.eventName}`,Sv=(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}},Iv=(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 Cv=(t,e)=>new Proxy({},{get:(n,r)=>new Proxy({},{get:(o,a)=>i=>fI({client:t,interfaces:e,integrationOrInterfaceName:r,methodName:a,input:i})})}),fI=async({client:t,interfaces:e,integrationOrInterfaceName:n,methodName:r,input:o})=>{let a=Sv({namespace:n,actionName:r},e),i=Pv(a);return(await t.callAction({type:i,input:o})).output};A();O();R();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:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{}};_workflowHandlers={};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=Cv(e,r),i=mr(e);return{configuration:n,interfaces:r,actions:a,alias:o,workflows:i}}get actionHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._actionHandlers[n];if(r)return Xt.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 Pe.unique([...r,...o]).map(i=>Xt.setName(s=>i({...s,...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 Pe.unique([...r,...o,...a]).map(s=>Xt.setName(l=>s({...l,...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 Pe.unique([...r,...o]).map(i=>Xt.setName(s=>i({...s,...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(([d])=>this._eventResolvesTo(d,a)).flatMap(([,d])=>d??[]),l=r["*"]??[];return Pe.unique([...i,...s,...l]).map(d=>Xt.setName(y=>d({...y,...this._getTools(y.client)}),d.name))}})}})}get workflowHandlers(){return new Proxy({},{get:(e,n)=>new Proxy({},{get:(r,o)=>(this._workflowHandlers[n]?.[o]??[]).map(s=>Xt.setName(l=>s({...l,...this._getTools(l.client)}),s.name))})})}on={message:(e,n)=>{this._messageHandlers[e]=Pe.safePush(this._messageHandlers[e],n)},workflows:new Proxy({},{get:(e,n)=>new Proxy({},{get:(r,o)=>a=>{let i=Go(o);this._workflowHandlers[i]??={},this._workflowHandlers[i][n]=Pe.safePush(this._workflowHandlers[i][n],a)}})}),event:(e,n)=>{this._eventHandlers[e]=Pe.safePush(this._eventHandlers[e],n)},stateExpired:(e,n)=>{this._stateExpiredHandlers[e]=Pe.safePush(this._stateExpiredHandlers[e],n)},beforeIncomingEvent:(e,n)=>{this._hookHandlers.before_incoming_event[e]=Pe.safePush(this._hookHandlers.before_incoming_event[e],n)},beforeIncomingMessage:(e,n)=>{this._hookHandlers.before_incoming_message[e]=Pe.safePush(this._hookHandlers.before_incoming_message[e],n)},beforeOutgoingMessage:(e,n)=>{this._hookHandlers.before_outgoing_message[e]=Pe.safePush(this._hookHandlers.before_outgoing_message[e],n)},beforeOutgoingCallAction:(e,n)=>{this._hookHandlers.before_outgoing_call_action[e]=Pe.safePush(this._hookHandlers.before_outgoing_call_action[e],n)},afterIncomingEvent:(e,n)=>{this._hookHandlers.after_incoming_event[e]=Pe.safePush(this._hookHandlers.after_incoming_event[e],n)},afterIncomingMessage:(e,n)=>{this._hookHandlers.after_incoming_message[e]=Pe.safePush(this._hookHandlers.after_incoming_message[e],n)},afterOutgoingMessage:(e,n)=>{this._hookHandlers.after_outgoing_message[e]=Pe.safePush(this._hookHandlers.after_outgoing_message[e],n)},afterOutgoingCallAction:(e,n)=>{this._hookHandlers.after_outgoing_call_action[e]=Pe.safePush(this._hookHandlers.after_outgoing_call_action[e],n)}};_eventResolvesTo=(e,n)=>{let r=Ev(e);if(!r)return!1;let o=Iv(r,this._runtime.interfaces);return kv(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}};A();O();R();A();O();R();A();O();R();A();O();R();A();O();R();A();O();R();export{dx as BRAND,Zl as Bot,jl as BotDefinition,Un as BotLogger,Qt as BotSpecificClient,Gn as DIRTY,cx as EMPTY_PATH,Ar as ErrorBoundary,de as INVALID,Hl as Integration,tl as IntegrationDefinition,Nn as IntegrationLogger,Vr as IntegrationSpecificClient,Ll as InterfaceDefinition,IB as NEVER,ct as OK,Pt as ParseInputLazyPath,gt as ParseStatus,Wl as Plugin,Fl as PluginDefinition,CN as RuntimeError,ye as Schema,Pi as ZodAny,Ur as ZodArray,ja as ZodBigInt,$a as ZodBoolean,Za as ZodBranded,La as ZodCatch,Fa as ZodDate,fo as ZodDefault,lg as ZodDiscriminatedUnion,bn as ZodEffects,rr as ZodEnum,$t as ZodError,Gp as ZodFirstPartyTypeKind,cg as ZodFunction,Wa as ZodIntersection,z as ZodIssueCode,qa as ZodLazy,za as ZodLiteral,pg as ZodMap,yg as ZodNaN,Ga as ZodNativeEnum,_n as ZodNever,Va as ZodNull,Jn as ZodNullable,Ja as ZodNumber,Yn as ZodObject,nn as ZodOptional,ne as ZodParsedType,Ya as ZodPipeline,go as ZodPromise,yo as ZodReadonly,wg as ZodRecord,Bg as ZodRef,ye as ZodSchema,Eg as ZodSet,ft as ZodString,Ug as ZodSymbol,bn as ZodTransformer,Qn as ZodTuple,ye as ZodType,Xa as ZodUndefined,Qa as ZodUnion,Cr as ZodUnknown,Zg as ZodVoid,aC as ZuiForm,te as addIssueToContext,Mx as agent,jx as aimodel,Jx as any,eB as array,Wx as bigint,yy as boolean,ho as botIdHeader,Cy as botUserIdHeader,SB as coerce,vo as configurationHeader,Oy as configurationTypeHeader,Ax as conversation,po as createZodEnum,kg as cuid2Regex,Pg as cuidRegex,ag as custom,$x as datasource,qx as date,Mg as datetimeRegex,sC as defaultComponentDefinitions,iB as discriminatedUnion,uf as effect,Cg as emailRegex,yB as enum,se as errorUtil,Dx as event,PB as fromJsonSchema,kB as fromObject,dB as function,Dr as getErrorMap,tn as getParsedType,Fx as instanceof,Ay as integrationIdHeader,Hx as intent,oB as intersection,Rg as ipv4Regex,Og as ipv6Regex,ma as isAborted,IN as isApiError,Bi as isAsync,ha as isDirty,px as isEmojiRegex,Nr as isValid,mo as jsonSchemaToZui,Zx as knowledgebase,Lx as late,pB as lazy,gB as literal,xi as makeIssue,cB as map,$r as mergeObjectSchemas,Ox as message,Iy as messages,Kx as nan,mB as nativeEnum,Xx as never,Vx as null,TB as nullable,gy as number,tB as object,Hr as objectToZui,ya as objectUtil,EB as oboolean,BB as onumber,To as operationHeader,vB as optional,xB as ostring,St as parseBody,wB as pipeline,bB as preprocess,ge as processCreateParams,hB as promise,ux as quotelessJson,uB as readonly,sB as record,lB as ref,Zo as serve,fB as set,Yp as setErrorMap,nB as strictObject,py as string,zx as symbol,Nx as table,Ux as tablerow,uf as transformer,lC as transforms,aB as tuple,My as typeHeader,Sg as ulidRegex,Gx as undefined,rB as union,Yx as unknown,Rx as user,_e as util,Ig as uuidRegex,Cx as variable,Qx as void,Ry as webhookIdHeader,QB as withErrorBoundary,re as z,rs as zuiToJsonSchema};
89
89
  /*! Bundled license information:
90
90
 
91
91
  @jspm/core/nodelibs/browser/chunk-DtuTasat.js: