@botpress/sdk 2.4.3 → 3.0.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.
Files changed (81) hide show
  1. package/.turbo/turbo-build.log +11 -5
  2. package/dist/base-logger.d.ts +0 -0
  3. package/dist/bot/bot-logger.d.ts +0 -0
  4. package/dist/bot/client/index.d.ts +6 -0
  5. package/dist/bot/client/types.d.ts +87 -0
  6. package/dist/bot/client/types.test.d.ts +0 -0
  7. package/dist/bot/definition.d.ts +17 -9
  8. package/dist/bot/implementation.d.ts +11 -10
  9. package/dist/bot/index.d.ts +1 -1
  10. package/dist/bot/server/context.d.ts +0 -0
  11. package/dist/bot/server/index.d.ts +0 -0
  12. package/dist/bot/server/types.d.ts +32 -26
  13. package/dist/bot/server/types.test.d.ts +0 -0
  14. package/dist/bot/types/common.d.ts +6 -2
  15. package/dist/bot/types/common.test.d.ts +0 -0
  16. package/dist/bot/types/generic.d.ts +110 -9
  17. package/dist/bot/types/generic.test.d.ts +0 -0
  18. package/dist/bot/types/index.d.ts +0 -0
  19. package/dist/const.d.ts +0 -0
  20. package/dist/fixtures.d.ts +49 -0
  21. package/dist/index.cjs +129 -0
  22. package/dist/index.cjs.map +7 -0
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.mjs +123 -0
  25. package/dist/index.mjs.map +7 -0
  26. package/dist/integration/client/index.d.ts +0 -0
  27. package/dist/integration/client/types.d.ts +2 -1
  28. package/dist/integration/client/types.test.d.ts +0 -0
  29. package/dist/integration/definition/branded-schema.d.ts +0 -0
  30. package/dist/integration/definition/generic.d.ts +0 -0
  31. package/dist/integration/definition/index.d.ts +53 -12
  32. package/dist/integration/definition/types.d.ts +6 -1
  33. package/dist/integration/implementation.d.ts +0 -0
  34. package/dist/integration/index.d.ts +1 -1
  35. package/dist/integration/server/action-metadata.d.ts +0 -0
  36. package/dist/integration/server/context.d.ts +0 -0
  37. package/dist/integration/server/index.d.ts +0 -0
  38. package/dist/integration/server/integration-logger.d.ts +0 -0
  39. package/dist/integration/server/types.d.ts +0 -0
  40. package/dist/integration/types/common.d.ts +0 -7
  41. package/dist/integration/types/generic.d.ts +0 -0
  42. package/dist/integration/types/generic.test.d.ts +0 -0
  43. package/dist/integration/types/index.d.ts +0 -0
  44. package/dist/interface/definition.d.ts +0 -2
  45. package/dist/interface/index.d.ts +1 -0
  46. package/dist/interface/resolve.d.ts +18 -0
  47. package/dist/interface/types/generic.d.ts +0 -0
  48. package/dist/interface/types/generic.test.d.ts +0 -0
  49. package/dist/interface/types/index.d.ts +1 -0
  50. package/dist/log.d.ts +0 -0
  51. package/dist/message.d.ts +0 -0
  52. package/dist/package.d.ts +4 -2
  53. package/dist/plugin/action-proxy/index.d.ts +2 -0
  54. package/dist/plugin/action-proxy/proxy.d.ts +5 -0
  55. package/dist/plugin/action-proxy/types.d.ts +14 -0
  56. package/dist/plugin/action-proxy/types.test.d.ts +1 -0
  57. package/dist/plugin/definition.d.ts +11 -6
  58. package/dist/plugin/implementation.d.ts +21 -15
  59. package/dist/plugin/index.d.ts +2 -1
  60. package/dist/plugin/interface-resolution.d.ts +15 -0
  61. package/dist/plugin/server/index.d.ts +1 -0
  62. package/dist/plugin/server/types.d.ts +241 -1
  63. package/dist/plugin/server/types.test.d.ts +0 -0
  64. package/dist/plugin/types/common.d.ts +41 -0
  65. package/dist/plugin/types/generic.d.ts +110 -2
  66. package/dist/plugin/types/generic.test.d.ts +0 -0
  67. package/dist/plugin/types/index.d.ts +2 -0
  68. package/dist/retry.d.ts +0 -0
  69. package/dist/schema.d.ts +0 -0
  70. package/dist/serve.d.ts +2 -2
  71. package/dist/utils/array-utils.d.ts +0 -0
  72. package/dist/utils/index.d.ts +0 -0
  73. package/dist/utils/record-utils.d.ts +2 -0
  74. package/dist/utils/record-utils.test.d.ts +1 -0
  75. package/dist/utils/type-utils.d.ts +15 -0
  76. package/dist/utils/type-utils.test.d.ts +0 -0
  77. package/dist/zui.d.ts +1 -0
  78. package/package.json +18 -8
  79. package/dist/bot/merge-bots.d.ts +0 -2
  80. package/dist/index.js +0 -129
  81. package/dist/index.js.map +0 -7
package/dist/index.mjs ADDED
@@ -0,0 +1,123 @@
1
+ var wv=Object.create;var Wr=Object.defineProperty;var Ev=Object.getOwnPropertyDescriptor;var Bv=Object.getOwnPropertyNames;var Pv=Object.getPrototypeOf,Iv=Object.prototype.hasOwnProperty;var it=(t,e)=>()=>(t&&(e=t(t=0)),e);var jl=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),gr=(t,e)=>{for(var n in e)Wr(t,n,{get:e[n],enumerable:!0})},$l=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Bv(e))!Iv.call(t,a)&&a!==n&&Wr(t,a,{get:()=>e[a],enumerable:!(r=Ev(e,a))||r.enumerable});return t};var yr=(t,e,n)=>(n=t!=null?wv(Pv(t)):{},$l(e||!t||!t.__esModule?Wr(n,"default",{value:t,enumerable:!0}):n,t)),Sv=t=>$l(Wr({},"__esModule",{value:!0}),t);var R=it(()=>{});var X={};gr(X,{_debugEnd:()=>Au,_debugProcess:()=>Su,_events:()=>qu,_eventsCount:()=>zu,_exiting:()=>uu,_fatalExceptions:()=>Eu,_getActiveHandles:()=>pu,_getActiveRequests:()=>du,_kill:()=>yu,_linkedBinding:()=>su,_maxListeners:()=>Ku,_preload_modules:()=>Zu,_rawDebug:()=>au,_startProfilerIdleNotifier:()=>Cu,_stopProfilerIdleNotifier:()=>ku,_tickCallback:()=>Iu,abort:()=>Du,addListener:()=>Gu,allowedNodeEnvironmentFlags:()=>_u,arch:()=>ql,argv:()=>Vl,argv0:()=>$u,assert:()=>xu,binding:()=>Ql,browser:()=>iu,chdir:()=>nu,config:()=>cu,cpuUsage:()=>Xr,cwd:()=>tu,debugPort:()=>ju,default:()=>nc,dlopen:()=>fu,domain:()=>lu,emit:()=>Xu,emitWarning:()=>Xl,env:()=>Gl,execArgv:()=>Wl,execPath:()=>Uu,exit:()=>Tu,features:()=>wu,hasUncaughtExceptionCaptureCallback:()=>Pu,hrtime:()=>Yr,kill:()=>vu,listeners:()=>tc,memoryUsage:()=>mu,moduleLoadList:()=>ou,nextTick:()=>Ll,off:()=>Wu,on:()=>Nt,once:()=>Vu,openStdin:()=>bu,pid:()=>Nu,platform:()=>zl,ppid:()=>Hu,prependListener:()=>Qu,prependOnceListener:()=>ec,reallyExit:()=>gu,release:()=>ru,removeAllListeners:()=>Yu,removeListener:()=>Ju,resourceUsage:()=>hu,setSourceMapsEnabled:()=>Lu,setUncaughtExceptionCaptureCallback:()=>Bu,stderr:()=>Ou,stdin:()=>Mu,stdout:()=>Ru,title:()=>Kl,umask:()=>eu,uptime:()=>Fu,version:()=>Jl,versions:()=>Yl});function Fa(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function Av(){!Mn||!ln||(Mn=!1,ln.length?Dt=ln.concat(Dt):Jr=-1,Dt.length&&Zl())}function Zl(){if(!Mn){var t=setTimeout(Av,0);Mn=!0;for(var e=Dt.length;e;){for(ln=Dt,Dt=[];++Jr<e;)ln&&ln[Jr].run();Jr=-1,e=Dt.length}ln=null,Mn=!1,clearTimeout(t)}}function Ll(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 Fl(t,e)),Dt.length===1&&!Mn&&setTimeout(Zl,0)}function Fl(t,e){this.fun=t,this.array=e}function at(){}function su(t){Fa("_linkedBinding")}function fu(t){Fa("dlopen")}function du(){return[]}function pu(){return[]}function xu(t,e){if(!t)throw new Error(e||"assertion error")}function Pu(){return!1}function Fu(){return Qt.now()/1e3}function Yr(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+=La)),[r,a]}function Nt(){return nc}function tc(t){return[]}var Dt,Mn,ln,Jr,Kl,ql,zl,Gl,Vl,Wl,Jl,Yl,Xl,Ql,eu,tu,nu,ru,iu,au,ou,lu,uu,cu,gu,yu,Xr,hu,mu,vu,Tu,bu,_u,wu,Eu,Bu,Iu,Su,Au,Cu,ku,Ru,Ou,Mu,Du,Nu,Hu,Uu,ju,$u,Zu,Lu,Qt,Za,La,Ku,qu,zu,Gu,Vu,Wu,Ju,Yu,Xu,Qu,ec,nc,rc=it(()=>{R();M();O();Dt=[],Mn=!1,Jr=-1;Fl.prototype.run=function(){this.fun.apply(null,this.array)};Kl="browser",ql="x64",zl="browser",Gl={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},Vl=["/usr/bin/node"],Wl=[],Jl="v16.8.0",Yl={},Xl=function(t,e){console.warn((e?e+": ":"")+t)},Ql=function(t){Fa("binding")},eu=function(t){return 0},tu=function(){return"/"},nu=function(t){},ru={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};iu=!0,au=at,ou=[];lu={},uu=!1,cu={};gu=at,yu=at,Xr=function(){return{}},hu=Xr,mu=Xr,vu=at,Tu=at,bu=at,_u={};wu={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Eu=at,Bu=at;Iu=at,Su=at,Au=at,Cu=at,ku=at,Ru=void 0,Ou=void 0,Mu=void 0,Du=at,Nu=2,Hu=1,Uu="/bin/usr/node",ju=9229,$u="node",Zu=[],Lu=at,Qt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Qt.now===void 0&&(Za=Date.now(),Qt.timing&&Qt.timing.navigationStart&&(Za=Qt.timing.navigationStart),Qt.now=()=>Date.now()-Za);La=1e9;Yr.bigint=function(t){var e=Yr(t);return typeof BigInt>"u"?e[0]*La+e[1]:BigInt(e[0]*La)+BigInt(e[1])};Ku=10,qu={},zu=0;Gu=Nt,Vu=Nt,Wu=Nt,Ju=Nt,Yu=Nt,Xu=at,Qu=Nt,ec=Nt;nc={version:Jl,versions:Yl,arch:ql,platform:zl,browser:iu,release:ru,_rawDebug:au,moduleLoadList:ou,binding:Ql,_linkedBinding:su,_events:qu,_eventsCount:zu,_maxListeners:Ku,on:Nt,addListener:Gu,once:Vu,off:Wu,removeListener:Ju,removeAllListeners:Yu,emit:Xu,prependListener:Qu,prependOnceListener:ec,listeners:tc,domain:lu,_exiting:uu,config:cu,dlopen:fu,uptime:Fu,_getActiveRequests:du,_getActiveHandles:pu,reallyExit:gu,_kill:yu,cpuUsage:Xr,resourceUsage:hu,memoryUsage:mu,kill:vu,exit:Tu,openStdin:bu,allowedNodeEnvironmentFlags:_u,assert:xu,features:wu,_fatalExceptions:Eu,setUncaughtExceptionCaptureCallback:Bu,hasUncaughtExceptionCaptureCallback:Pu,emitWarning:Xl,nextTick:Ll,_tickCallback:Iu,_debugProcess:Su,_debugEnd:Au,_startProfilerIdleNotifier:Cu,_stopProfilerIdleNotifier:ku,stdout:Ru,stdin:Mu,stderr:Ou,abort:Du,umask:eu,chdir:nu,cwd:tu,env:Gl,title:Kl,argv:Vl,execArgv:Wl,pid:Nu,ppid:Hu,execPath:Uu,debugPort:ju,hrtime:Yr,argv0:$u,_preload_modules:Zu,setSourceMapsEnabled:Lu}});var O=it(()=>{rc()});function Cv(){if(ic)return hr;ic=!0,hr.byteLength=o,hr.toByteArray=f,hr.fromByteArray=p;for(var t=[],e=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=r.length;a<s;++a)t[a]=r[a],e[r.charCodeAt(a)]=a;e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63;function i(h){var _=h.length;if(_%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var E=h.indexOf("=");E===-1&&(E=_);var B=E===_?0:4-E%4;return[E,B]}function o(h){var _=i(h),E=_[0],B=_[1];return(E+B)*3/4-B}function l(h,_,E){return(_+E)*3/4-E}function f(h){var _,E=i(h),B=E[0],v=E[1],I=new n(l(h,B,v)),P=0,D=v>0?B-4:B,$;for($=0;$<D;$+=4)_=e[h.charCodeAt($)]<<18|e[h.charCodeAt($+1)]<<12|e[h.charCodeAt($+2)]<<6|e[h.charCodeAt($+3)],I[P++]=_>>16&255,I[P++]=_>>8&255,I[P++]=_&255;return v===2&&(_=e[h.charCodeAt($)]<<2|e[h.charCodeAt($+1)]>>4,I[P++]=_&255),v===1&&(_=e[h.charCodeAt($)]<<10|e[h.charCodeAt($+1)]<<4|e[h.charCodeAt($+2)]>>2,I[P++]=_>>8&255,I[P++]=_&255),I}function g(h){return t[h>>18&63]+t[h>>12&63]+t[h>>6&63]+t[h&63]}function y(h,_,E){for(var B,v=[],I=_;I<E;I+=3)B=(h[I]<<16&16711680)+(h[I+1]<<8&65280)+(h[I+2]&255),v.push(g(B));return v.join("")}function p(h){for(var _,E=h.length,B=E%3,v=[],I=16383,P=0,D=E-B;P<D;P+=I)v.push(y(h,P,P+I>D?D:P+I));return B===1?(_=h[E-1],v.push(t[_>>2]+t[_<<4&63]+"==")):B===2&&(_=(h[E-2]<<8)+h[E-1],v.push(t[_>>10]+t[_>>4&63]+t[_<<2&63]+"=")),v.join("")}return hr}function kv(){if(ac)return Qr;ac=!0;return Qr.read=function(t,e,n,r,a){var s,i,o=a*8-r-1,l=(1<<o)-1,f=l>>1,g=-7,y=n?a-1:0,p=n?-1:1,h=t[e+y];for(y+=p,s=h&(1<<-g)-1,h>>=-g,g+=o;g>0;s=s*256+t[e+y],y+=p,g-=8);for(i=s&(1<<-g)-1,s>>=-g,g+=r;g>0;i=i*256+t[e+y],y+=p,g-=8);if(s===0)s=1-f;else{if(s===l)return i?NaN:(h?-1:1)*(1/0);i=i+Math.pow(2,r),s=s-f}return(h?-1:1)*i*Math.pow(2,s-r)},Qr.write=function(t,e,n,r,a,s){var i,o,l,f=s*8-a-1,g=(1<<f)-1,y=g>>1,p=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:s-1,_=r?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=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?(o=0,i=g):i+y>=1?(o=(e*l-1)*Math.pow(2,a),i=i+y):(o=e*Math.pow(2,y-1)*Math.pow(2,a),i=0));a>=8;t[n+h]=o&255,h+=_,o/=256,a-=8);for(i=i<<a|o,f+=a;f>0;t[n+h]=i&255,h+=_,i/=256,f-=8);t[n+h-_]|=E*128},Qr}function At(){if(oc)return un;oc=!0;let t=Cv(),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 m=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(m,u),m.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function s(m){if(m>r)throw new RangeError('The value "'+m+'" is invalid for option "size"');let u=new Uint8Array(m);return Object.setPrototypeOf(u,i.prototype),u}function i(m,u,c){if(typeof m=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(m)}return o(m,u,c)}i.poolSize=8192;function o(m,u,c){if(typeof m=="string")return y(m,u);if(ArrayBuffer.isView(m))return h(m);if(m==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m);if(mt(m,ArrayBuffer)||m&&mt(m.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(mt(m,SharedArrayBuffer)||m&&mt(m.buffer,SharedArrayBuffer)))return _(m,u,c);if(typeof m=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let T=m.valueOf&&m.valueOf();if(T!=null&&T!==m)return i.from(T,u,c);let A=E(m);if(A)return A;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof m[Symbol.toPrimitive]=="function")return i.from(m[Symbol.toPrimitive]("string"),u,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m)}i.from=function(m,u,c){return o(m,u,c)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function l(m){if(typeof m!="number")throw new TypeError('"size" argument must be of type number');if(m<0)throw new RangeError('The value "'+m+'" is invalid for option "size"')}function f(m,u,c){return l(m),m<=0?s(m):u!==void 0?typeof c=="string"?s(m).fill(u,c):s(m).fill(u):s(m)}i.alloc=function(m,u,c){return f(m,u,c)};function g(m){return l(m),s(m<0?0:B(m)|0)}i.allocUnsafe=function(m){return g(m)},i.allocUnsafeSlow=function(m){return g(m)};function y(m,u){if((typeof u!="string"||u==="")&&(u="utf8"),!i.isEncoding(u))throw new TypeError("Unknown encoding: "+u);let c=I(m,u)|0,T=s(c),A=T.write(m,u);return A!==c&&(T=T.slice(0,A)),T}function p(m){let u=m.length<0?0:B(m.length)|0,c=s(u);for(let T=0;T<u;T+=1)c[T]=m[T]&255;return c}function h(m){if(mt(m,Uint8Array)){let u=new Uint8Array(m);return _(u.buffer,u.byteOffset,u.byteLength)}return p(m)}function _(m,u,c){if(u<0||m.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(m.byteLength<u+(c||0))throw new RangeError('"length" is outside of buffer bounds');let T;return u===void 0&&c===void 0?T=new Uint8Array(m):c===void 0?T=new Uint8Array(m,u):T=new Uint8Array(m,u,c),Object.setPrototypeOf(T,i.prototype),T}function E(m){if(i.isBuffer(m)){let u=B(m.length)|0,c=s(u);return c.length===0||m.copy(c,0,0,u),c}if(m.length!==void 0)return typeof m.length!="number"||dr(m.length)?s(0):p(m);if(m.type==="Buffer"&&Array.isArray(m.data))return p(m.data)}function B(m){if(m>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return m|0}function v(m){return+m!=m&&(m=0),i.alloc(+m)}i.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==i.prototype},i.compare=function(u,c){if(mt(u,Uint8Array)&&(u=i.from(u,u.offset,u.byteLength)),mt(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(mt(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(m,u){if(i.isBuffer(m))return m.length;if(ArrayBuffer.isView(m)||mt(m,ArrayBuffer))return m.byteLength;if(typeof m!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof m);let c=m.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&c===0)return 0;let A=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return Ne(m).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c*2;case"hex":return c>>>1;case"base64":return Et(m).length;default:if(A)return T?-1:Ne(m).length;u=(""+u).toLowerCase(),A=!0}}i.byteLength=I;function P(m,u,c){let T=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((c===void 0||c>this.length)&&(c=this.length),c<=0)||(c>>>=0,u>>>=0,c<=u))return"";for(m||(m="utf8");;)switch(m){case"hex":return he(this,u,c);case"utf8":case"utf-8":return je(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: "+m);m=(m+"").toLowerCase(),T=!0}}i.prototype._isBuffer=!0;function D(m,u,c){let T=m[u];m[u]=m[c],m[c]=T}i.prototype.swap16=function(){let u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let c=0;c<u;c+=2)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?je(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(mt(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 $e=0;$e<Je;++$e)if(Fe[$e]!==Ye[$e]){K=Fe[$e],we=Ye[$e];break}return K<we?-1:we<K?1:0};function $(m,u,c,T,A){if(m.length===0)return-1;if(typeof c=="string"?(T=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,dr(c)&&(c=A?0:m.length-1),c<0&&(c=m.length+c),c>=m.length){if(A)return-1;c=m.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(m,u,c,T,A);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?A?Uint8Array.prototype.indexOf.call(m,u,c):Uint8Array.prototype.lastIndexOf.call(m,u,c):ae(m,[u],c,T,A);throw new TypeError("val must be string, number or Buffer")}function ae(m,u,c,T,A){let N=1,K=m.length,we=u.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(m.length<2||u.length<2)return-1;N=2,K/=2,we/=2,c/=2}function Je(Ye,$e){return N===1?Ye[$e]:Ye.readUInt16BE($e*N)}let Fe;if(A){let Ye=-1;for(Fe=c;Fe<K;Fe++)if(Je(m,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 $e=0;$e<we;$e++)if(Je(m,Fe+$e)!==Je(u,$e)){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 Y(m,u,c,T){c=Number(c)||0;let A=m.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(dr(we))return K;m[c+K]=we}return K}function ue(m,u,c,T){return St(Ne(u,m.length-c),m,c,T)}function ee(m,u,c,T){return St(Te(u),m,c,T)}function ie(m,u,c,T){return St(Et(u),m,c,T)}function Re(m,u,c,T){return St(U(u,m.length-c),m,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 Y(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 Re(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(m,u,c){return u===0&&c===m.length?t.fromByteArray(m):t.fromByteArray(m.slice(u,c))}function je(m,u,c){c=Math.min(m.length,c);let T=[],A=u;for(;A<c;){let N=m[A],K=null,we=N>239?4:N>223?3:N>191?2:1;if(A+we<=c){let Je,Fe,Ye,$e;switch(we){case 1:N<128&&(K=N);break;case 2:Je=m[A+1],(Je&192)===128&&($e=(N&31)<<6|Je&63,$e>127&&(K=$e));break;case 3:Je=m[A+1],Fe=m[A+2],(Je&192)===128&&(Fe&192)===128&&($e=(N&15)<<12|(Je&63)<<6|Fe&63,$e>2047&&($e<55296||$e>57343)&&(K=$e));break;case 4:Je=m[A+1],Fe=m[A+2],Ye=m[A+3],(Je&192)===128&&(Fe&192)===128&&(Ye&192)===128&&($e=(N&15)<<18|(Je&63)<<12|(Fe&63)<<6|Ye&63,$e>65535&&$e<1114112&&(K=$e))}}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 Oe(T)}let De=4096;function Oe(m){let u=m.length;if(u<=De)return String.fromCharCode.apply(String,m);let c="",T=0;for(;T<u;)c+=String.fromCharCode.apply(String,m.slice(T,T+=De));return c}function We(m,u,c){let T="";c=Math.min(m.length,c);for(let A=u;A<c;++A)T+=String.fromCharCode(m[A]&127);return T}function Ae(m,u,c){let T="";c=Math.min(m.length,c);for(let A=u;A<c;++A)T+=String.fromCharCode(m[A]);return T}function he(m,u,c){let T=m.length;(!u||u<0)&&(u=0),(!c||c<0||c>T)&&(c=T);let A="";for(let N=u;N<c;++N)A+=Vr[m[N]];return A}function Pe(m,u,c){let T=m.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(m,u,c){if(m%1!==0||m<0)throw new RangeError("offset is not uint");if(m+u>c)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(u,c,T){u=u>>>0,c=c>>>0,T||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 me(m,u,c,T,A,N){if(!i.isBuffer(m))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>m.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;me(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;me(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||me(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||me(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||me(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||me(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||me(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 k(m,u,c,T,A){oe(u,T,A,m,c,7);let N=Number(u&BigInt(4294967295));m[c++]=N,N=N>>8,m[c++]=N,N=N>>8,m[c++]=N,N=N>>8,m[c++]=N;let K=Number(u>>BigInt(32)&BigInt(4294967295));return m[c++]=K,K=K>>8,m[c++]=K,K=K>>8,m[c++]=K,K=K>>8,m[c++]=K,c}function Z(m,u,c,T,A){oe(u,T,A,m,c,7);let N=Number(u&BigInt(4294967295));m[c+7]=N,N=N>>8,m[c+6]=N,N=N>>8,m[c+5]=N,N=N>>8,m[c+4]=N;let K=Number(u>>BigInt(32)&BigInt(4294967295));return m[c+3]=K,K=K>>8,m[c+2]=K,K=K>>8,m[c+1]=K,K=K>>8,m[c]=K,c+8}i.prototype.writeBigUInt64LE=_t(function(u,c=0){return k(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);me(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);me(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||me(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||me(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||me(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||me(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||me(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 k(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(m,u,c,T,A,N){if(c+T>m.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function fe(m,u,c,T,A){return u=+u,c=c>>>0,A||F(m,u,c,4),e.write(m,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(m,u,c,T,A){return u=+u,c=c>>>0,A||F(m,u,c,8),e.write(m,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(m,u,c){C[m]=class extends c{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${m}]`,this.stack,delete this.name}get code(){return m}set code(A){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:A,writable:!0})}toString(){return`${this.name} [${m}]: ${this.message}`}}}S("ERR_BUFFER_OUT_OF_BOUNDS",function(m){return m?`${m} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),S("ERR_INVALID_ARG_TYPE",function(m,u){return`The "${m}" argument must be of type number. Received type ${typeof u}`},TypeError),S("ERR_OUT_OF_RANGE",function(m,u,c){let T=`The value of "${m}" 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(m){let u="",c=m.length,T=m[0]==="-"?1:0;for(;c>=T+4;c-=3)u=`_${m.slice(c-3,c)}${u}`;return`${m.slice(0,c)}${u}`}function V(m,u,c){b(u,"offset"),(m[u]===void 0||m[u+c]===void 0)&&x(u,m.length-(c+1))}function oe(m,u,c,T,A,N){if(m>c||m<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,m)}V(T,A,N)}function b(m,u){if(typeof m!="number")throw new C.ERR_INVALID_ARG_TYPE(u,"number",m)}function x(m,u,c){throw Math.floor(m)!==m?(b(m,c),new C.ERR_OUT_OF_RANGE("offset","an integer",m)):u<0?new C.ERR_BUFFER_OUT_OF_BOUNDS:new C.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${u}`,m)}let q=/[^+/0-9A-Za-z-_]/g;function Q(m){if(m=m.split("=")[0],m=m.trim().replace(q,""),m.length<2)return"";for(;m.length%4!==0;)m=m+"=";return m}function Ne(m,u){u=u||1/0;let c,T=m.length,A=null,N=[];for(let K=0;K<T;++K){if(c=m.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(m){let u=[];for(let c=0;c<m.length;++c)u.push(m.charCodeAt(c)&255);return u}function U(m,u){let c,T,A,N=[];for(let K=0;K<m.length&&!((u-=2)<0);++K)c=m.charCodeAt(K),T=c>>8,A=c%256,N.push(A),N.push(T);return N}function Et(m){return t.toByteArray(Q(m))}function St(m,u,c,T){let A;for(A=0;A<T&&!(A+c>=u.length||A>=m.length);++A)u[A+c]=m[A];return A}function mt(m,u){return m instanceof u||m!=null&&m.constructor!=null&&m.constructor.name!=null&&m.constructor.name===u.name}function dr(m){return m!==m}let Vr=function(){let m="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]=m[c]+m[A]}return u}();function _t(m){return typeof BigInt>"u"?pr:m}function pr(){throw new Error("BigInt not supported")}return un}var hr,ic,Qr,ac,un,oc,ei=it(()=>{R();M();O();hr={},ic=!1;Qr={},ac=!1;un={},oc=!1});var cn,W,lA,uA,sc=it(()=>{R();M();O();ei();cn=At();cn.Buffer;cn.SlowBuffer;cn.INSPECT_MAX_BYTES;cn.kMaxLength;W=cn.Buffer,lA=cn.INSPECT_MAX_BYTES,uA=cn.kMaxLength});var M=it(()=>{sc()});var Tc=jl(Ee=>{"use strict";R();M();O();var mr=Symbol.for("react.element"),Rv=Symbol.for("react.portal"),Ov=Symbol.for("react.fragment"),Mv=Symbol.for("react.strict_mode"),Dv=Symbol.for("react.profiler"),Nv=Symbol.for("react.provider"),Hv=Symbol.for("react.context"),Uv=Symbol.for("react.forward_ref"),jv=Symbol.for("react.suspense"),$v=Symbol.for("react.memo"),Zv=Symbol.for("react.lazy"),lc=Symbol.iterator;function Lv(t){return t===null||typeof t!="object"?null:(t=lc&&t[lc]||t["@@iterator"],typeof t=="function"?t:null)}var fc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},dc=Object.assign,pc={};function Dn(t,e,n){this.props=t,this.context=e,this.refs=pc,this.updater=n||fc}Dn.prototype.isReactComponent={};Dn.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")};Dn.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function gc(){}gc.prototype=Dn.prototype;function qa(t,e,n){this.props=t,this.context=e,this.refs=pc,this.updater=n||fc}var za=qa.prototype=new gc;za.constructor=qa;dc(za,Dn.prototype);za.isPureReactComponent=!0;var uc=Array.isArray,yc=Object.prototype.hasOwnProperty,Ga={current:null},hc={key:!0,ref:!0,__self:!0,__source:!0};function mc(t,e,n){var r,a={},s=null,i=null;if(e!=null)for(r in e.ref!==void 0&&(i=e.ref),e.key!==void 0&&(s=""+e.key),e)yc.call(e,r)&&!hc.hasOwnProperty(r)&&(a[r]=e[r]);var o=arguments.length-2;if(o===1)a.children=n;else if(1<o){for(var l=Array(o),f=0;f<o;f++)l[f]=arguments[f+2];a.children=l}if(t&&t.defaultProps)for(r in o=t.defaultProps,o)a[r]===void 0&&(a[r]=o[r]);return{$$typeof:mr,type:t,key:s,ref:i,props:a,_owner:Ga.current}}function Fv(t,e){return{$$typeof:mr,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Va(t){return typeof t=="object"&&t!==null&&t.$$typeof===mr}function Kv(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var cc=/\/+/g;function Ka(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Kv(""+t.key):e.toString(36)}function ni(t,e,n,r,a){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case mr:case Rv:i=!0}}if(i)return i=t,a=a(i),t=r===""?"."+Ka(i,0):r,uc(a)?(n="",t!=null&&(n=t.replace(cc,"$&/")+"/"),ni(a,e,n,"",function(f){return f})):a!=null&&(Va(a)&&(a=Fv(a,n+(!a.key||i&&i.key===a.key?"":(""+a.key).replace(cc,"$&/")+"/")+t)),e.push(a)),1;if(i=0,r=r===""?".":r+":",uc(t))for(var o=0;o<t.length;o++){s=t[o];var l=r+Ka(s,o);i+=ni(s,e,n,l,a)}else if(l=Lv(t),typeof l=="function")for(t=l.call(t),o=0;!(s=t.next()).done;)s=s.value,l=r+Ka(s,o++),i+=ni(s,e,n,l,a);else if(s==="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 ti(t,e,n){if(t==null)return t;var r=[],a=0;return ni(t,r,"","",function(s){return e.call(n,s,a++)}),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 lt={current:null},ri={transition:null},zv={ReactCurrentDispatcher:lt,ReactCurrentBatchConfig:ri,ReactCurrentOwner:Ga};function vc(){throw Error("act(...) is not supported in production builds of React.")}Ee.Children={map:ti,forEach:function(t,e,n){ti(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return ti(t,function(){e++}),e},toArray:function(t){return ti(t,function(e){return e})||[]},only:function(t){if(!Va(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Ee.Component=Dn;Ee.Fragment=Ov;Ee.Profiler=Dv;Ee.PureComponent=qa;Ee.StrictMode=Mv;Ee.Suspense=jv;Ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=zv;Ee.act=vc;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=dc({},t.props),a=t.key,s=t.ref,i=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,i=Ga.current),e.key!==void 0&&(a=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(l in e)yc.call(e,l)&&!hc.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&o!==void 0?o[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){o=Array(l);for(var f=0;f<l;f++)o[f]=arguments[f+2];r.children=o}return{$$typeof:mr,type:t.type,key:a,ref:s,props:r,_owner:i}};Ee.createContext=function(t){return t={$$typeof:Hv,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Nv,_context:t},t.Consumer=t};Ee.createElement=mc;Ee.createFactory=function(t){var e=mc.bind(null,t);return e.type=t,e};Ee.createRef=function(){return{current:null}};Ee.forwardRef=function(t){return{$$typeof:Uv,render:t}};Ee.isValidElement=Va;Ee.lazy=function(t){return{$$typeof:Zv,_payload:{_status:-1,_result:t},_init:qv}};Ee.memo=function(t,e){return{$$typeof:$v,type:t,compare:e===void 0?null:e}};Ee.startTransition=function(t){var e=ri.transition;ri.transition={};try{t()}finally{ri.transition=e}};Ee.unstable_act=vc;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 Nn=jl((bA,bc)=>{"use strict";R();M();O();bc.exports=Tc()});function Ct(){return Sy||(Sy=!0,typeof Object.create=="function"?ga=function(e,n){n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ga=function(e,n){if(n){e.super_=n;var r=function(){};r.prototype=n.prototype,e.prototype=new r,e.prototype.constructor=e}}),ga}var ga,Sy,Xo=it(()=>{R();M();O();ga={},Sy=!1});function He(){He.init.call(this)}function ya(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function Uy(t){return t._maxListeners===void 0?He.defaultMaxListeners:t._maxListeners}function Ry(t,e,n,r){var a,s,i,o;if(ya(n),(s=t._events)===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),i=s[e]),i===void 0)i=s[e]=n,++t._eventsCount;else if(typeof i=="function"?i=s[e]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),(a=Uy(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,o=l,console&&console.warn&&console.warn(o)}return t}function YE(){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 Oy(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},a=YE.bind(r);return a.listener=n,r.wrapFn=a,a}function My(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(s){for(var i=new Array(s.length),o=0;o<i.length;++o)i[o]=s[o].listener||s[o];return i}(a):jy(a,a.length)}function Dy(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 jy(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}var Ny,Hy,er,Ay,Cy,ky,gt,Qo=it(()=>{R();M();O();er=typeof Reflect=="object"?Reflect:null,Ay=er&&typeof er.apply=="function"?er.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};Hy=er&&typeof er.ownKeys=="function"?er.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};Cy=Number.isNaN||function(t){return t!=t};Ny=He,He.EventEmitter=He,He.prototype._events=void 0,He.prototype._eventsCount=0,He.prototype._maxListeners=void 0;ky=10;Object.defineProperty(He,"defaultMaxListeners",{enumerable:!0,get:function(){return ky},set:function(t){if(typeof t!="number"||t<0||Cy(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");ky=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||Cy(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 Uy(this)},He.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 s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var i=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw i.context=s,i}var o=a[t];if(o===void 0)return!1;if(typeof o=="function")Ay(o,this,e);else{var l=o.length,f=jy(o,l);for(n=0;n<l;++n)Ay(f[n],this,e)}return!0},He.prototype.addListener=function(t,e){return Ry(this,t,e,!1)},He.prototype.on=He.prototype.addListener,He.prototype.prependListener=function(t,e){return Ry(this,t,e,!0)},He.prototype.once=function(t,e){return ya(e),this.on(t,Oy(this,t,e)),this},He.prototype.prependOnceListener=function(t,e){return ya(e),this.prependListener(t,Oy(this,t,e)),this},He.prototype.removeListener=function(t,e){var n,r,a,s,i;if(ya(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,s=n.length-1;s>=0;s--)if(n[s]===e||n[s].listener===e){i=n[s].listener,a=s;break}if(a<0)return this;a===0?n.shift():function(o,l){for(;l+1<o.length;l++)o[l]=o[l+1];o.pop()}(n,a),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 a,s=Object.keys(n);for(r=0;r<s.length;++r)(a=s[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},He.prototype.listeners=function(t){return My(this,t,!0)},He.prototype.rawListeners=function(t){return My(this,t,!1)},He.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Dy.call(t,e)},He.prototype.listenerCount=Dy,He.prototype.eventNames=function(){return this._eventsCount>0?Hy(this._events):[]};gt=Ny;gt.EventEmitter;gt.defaultMaxListeners;gt.init;gt.listenerCount;gt.EventEmitter;gt.defaultMaxListeners;gt.init;gt.listenerCount});var $y=it(()=>{R();M();O();Qo();gt.once=function(t,e){return new Promise((n,r)=>{function a(...i){s!==void 0&&t.removeListener("error",s),n(i)}let s;e!=="error"&&(s=i=>{t.removeListener(name,a),r(i)},t.once("error",s)),t.once(e,a)})};gt.on=function(t,e){let n=[],r=[],a=null,s=!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 s?createIterResult(void 0,!0):new Promise((g,y)=>r.push({resolve:g,reject:y}))},async return(){t.removeListener(e,o),t.removeListener("error",l),s=!0;for(let f of r)f.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(f){a=f,t.removeListener(e,o),t.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return t.on(e,o),t.on("error",l),i;function o(...f){let g=r.shift();g?g.resolve(createIterResult(f,!1)):n.push(f)}function l(f){s=!0;let g=r.shift();g?g.reject(f):a=f,i.return()}}});function is(){throw new Error("setTimeout has not been defined")}function as(){throw new Error("clearTimeout has not been defined")}function eh(t){if(zt===setTimeout)return setTimeout(t,0);if((zt===is||!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||nr,t,0)}}}function XE(){tr&&Pn&&(tr=!1,Pn.length?Vt=Pn.concat(Vt):_a=-1,Vt.length&&th())}function th(){if(!tr){var t=eh(XE);tr=!0;for(var e=Vt.length;e;){for(Pn=Vt,Vt=[];++_a<e;)Pn&&Pn[_a].run();_a=-1,e=Vt.length}Pn=null,tr=!1,function(n){if(Gt===clearTimeout)return clearTimeout(n);if((Gt===as||!Gt)&&clearTimeout)return Gt=clearTimeout,clearTimeout(n);try{Gt(n)}catch{try{return Gt.call(null,n)}catch{return Gt.call(this||nr,n)}}}(t)}}function Zy(t,e){(this||nr).fun=t,(this||nr).array=e}function qt(){}function Sn(t){return t.call.bind(t)}function jr(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}function Fy(t){return yt&&Tt?xt(t)!==void 0:sh(t)||lh(t)||uh(t)||ch(t)||fh(t)||dh(t)||ph(t)||gh(t)||yh(t)||hh(t)||mh(t)}function sh(t){return yt&&Tt?xt(t)==="Uint8Array":Ve(t)==="[object Uint8Array]"||lB(t)&&t.buffer!==void 0}function lh(t){return yt&&Tt?xt(t)==="Uint8ClampedArray":Ve(t)==="[object Uint8ClampedArray]"}function uh(t){return yt&&Tt?xt(t)==="Uint16Array":Ve(t)==="[object Uint16Array]"}function ch(t){return yt&&Tt?xt(t)==="Uint32Array":Ve(t)==="[object Uint32Array]"}function fh(t){return yt&&Tt?xt(t)==="Int8Array":Ve(t)==="[object Int8Array]"}function dh(t){return yt&&Tt?xt(t)==="Int16Array":Ve(t)==="[object Int16Array]"}function ph(t){return yt&&Tt?xt(t)==="Int32Array":Ve(t)==="[object Int32Array]"}function gh(t){return yt&&Tt?xt(t)==="Float32Array":Ve(t)==="[object Float32Array]"}function yh(t){return yt&&Tt?xt(t)==="Float64Array":Ve(t)==="[object Float64Array]"}function hh(t){return yt&&Tt?xt(t)==="BigInt64Array":Ve(t)==="[object BigInt64Array]"}function mh(t){return yt&&Tt?xt(t)==="BigUint64Array":Ve(t)==="[object BigUint64Array]"}function ha(t){return Ve(t)==="[object Map]"}function ma(t){return Ve(t)==="[object Set]"}function va(t){return Ve(t)==="[object WeakMap]"}function es(t){return Ve(t)==="[object WeakSet]"}function wa(t){return Ve(t)==="[object ArrayBuffer]"}function Ky(t){return typeof ArrayBuffer<"u"&&(wa.working?wa(t):t instanceof ArrayBuffer)}function Ea(t){return Ve(t)==="[object DataView]"}function qy(t){return typeof DataView<"u"&&(Ea.working?Ea(t):t instanceof DataView)}function Ba(t){return Ve(t)==="[object SharedArrayBuffer]"}function zy(t){return typeof SharedArrayBuffer<"u"&&(Ba.working?Ba(t):t instanceof SharedArrayBuffer)}function Gy(t){return jr(t,pB)}function Vy(t){return jr(t,gB)}function Wy(t){return jr(t,yB)}function Jy(t){return oh&&jr(t,hB)}function Yy(t){return ss&&jr(t,mB)}function an(t,e){var n={seen:[],stylize:bB};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),ls(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=TB),Pa(n,t,n.depth)}function TB(t,e){var n=an.styles[e];return n?"\x1B["+an.colors[n][0]+"m"+t+"\x1B["+an.colors[n][1]+"m":t}function bB(t,e){return t}function Pa(t,e,n){if(t.customInspect&&e&&xa(e.inspect)&&e.inspect!==L.inspect&&(!e.constructor||e.constructor.prototype!==e)){var r=e.inspect(n,t);return Ia(r)||(r=Pa(t,r,n)),r}var a=function(p,h){if(In(h))return p.stylize("undefined","undefined");if(Ia(h)){var _="'"+JSON.stringify(h).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return p.stylize(_,"string")}if(bh(h))return p.stylize(""+h,"number");if(ls(h))return p.stylize(""+h,"boolean");if(Ca(h))return p.stylize("null","null")}(t,e);if(a)return a;var s=Object.keys(e),i=function(p){var h={};return p.forEach(function(_,E){h[_]=!0}),h}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(e)),Ur(e)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return ts(e);if(s.length===0){if(xa(e)){var o=e.name?": "+e.name:"";return t.stylize("[Function"+o+"]","special")}if(Hr(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Sa(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Ur(e))return ts(e)}var l,f="",g=!1,y=["{","}"];return Th(e)&&(g=!0,y=["[","]"]),xa(e)&&(f=" [Function"+(e.name?": "+e.name:"")+"]"),Hr(e)&&(f=" "+RegExp.prototype.toString.call(e)),Sa(e)&&(f=" "+Date.prototype.toUTCString.call(e)),Ur(e)&&(f=" "+ts(e)),s.length!==0||g&&e.length!=0?n<0?Hr(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),l=g?function(p,h,_,E,B){for(var v=[],I=0,P=h.length;I<P;++I)_h(h,String(I))?v.push(ns(p,h,_,E,String(I),!0)):v.push("");return B.forEach(function(D){D.match(/^\d+$/)||v.push(ns(p,h,_,E,D,!0))}),v}(t,e,n,i,s):s.map(function(p){return ns(t,e,n,i,p,g)}),t.seen.pop(),function(p,h,_){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]+(h===""?"":h+`
3
+ `)+" "+p.join(`,
4
+ `)+" "+_[1]:_[0]+h+" "+p.join(", ")+" "+_[1]}(l,f,y)):y[0]+f+y[1]}function ts(t){return"["+Error.prototype.toString.call(t)+"]"}function ns(t,e,n,r,a,s){var i,o,l;if((l=Object.getOwnPropertyDescriptor(e,a)||{value:e[a]}).get?o=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(o=t.stylize("[Setter]","special")),_h(r,a)||(i="["+a+"]"),o||(t.seen.indexOf(l.value)<0?(o=Ca(n)?Pa(t,l.value,null):Pa(t,l.value,n-1)).indexOf(`
5
+ `)>-1&&(o=s?o.split(`
6
+ `).map(function(f){return" "+f}).join(`
7
+ `).substr(2):`
8
+ `+o.split(`
9
+ `).map(function(f){return" "+f}).join(`
10
+ `)):o=t.stylize("[Circular]","special")),In(i)){if(s&&a.match(/^\d+$/))return o;(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+": "+o}function Th(t){return Array.isArray(t)}function ls(t){return typeof t=="boolean"}function Ca(t){return t===null}function bh(t){return typeof t=="number"}function Ia(t){return typeof t=="string"}function In(t){return t===void 0}function Hr(t){return rr(t)&&us(t)==="[object RegExp]"}function rr(t){return typeof t=="object"&&t!==null}function Sa(t){return rr(t)&&us(t)==="[object Date]"}function Ur(t){return rr(t)&&(us(t)==="[object Error]"||t instanceof Error)}function xa(t){return typeof t=="function"}function us(t){return Object.prototype.toString.call(t)}function rs(t){return t<10?"0"+t.toString(10):t.toString(10)}function xB(){var t=new Date,e=[rs(t.getHours()),rs(t.getMinutes()),rs(t.getSeconds())].join(":");return[t.getDate(),_B[t.getMonth()],e].join(" ")}function _h(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function wB(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}var Qy,zt,Gt,nr,et,Pn,Vt,tr,_a,Ke,QE,os,Aa,nh,eB,tB,nB,rB,iB,rh,ih,Ly,aB,oB,sB,ah,Be,lB,uB,cB,oh,ss,Tt,yt,fB,Ve,pB,gB,yB,Nr,L,kt,Xy,vB,Ta,vh,ba,_B,Bn,IC,ka=it(()=>{R();M();O();nr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,et=Qy={};(function(){try{zt=typeof setTimeout=="function"?setTimeout:is}catch{zt=is}try{Gt=typeof clearTimeout=="function"?clearTimeout:as}catch{Gt=as}})();Vt=[],tr=!1,_a=-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 Zy(t,e)),Vt.length!==1||tr||eh(th)},Zy.prototype.run=function(){(this||nr).fun.apply(null,(this||nr).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=Qy;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;QE=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",os=Object.prototype.toString,Aa=function(t){return!(QE&&t&&typeof t=="object"&&Symbol.toStringTag in t)&&os.call(t)==="[object Arguments]"},nh=function(t){return!!Aa(t)||t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&os.call(t)!=="[object Array]"&&os.call(t.callee)==="[object Function]"},eB=function(){return Aa(arguments)}();Aa.isLegacyArguments=nh;tB=eB?Aa:nh,nB=Object.prototype.toString,rB=Function.prototype.toString,iB=/^\s*(?:function)?\*/,rh=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",ih=Object.getPrototypeOf,Ly=function(){if(!rh)return!1;try{return Function("return function*() {}")()}catch{}}(),aB=Ly?ih(Ly):{},oB=function(t){return typeof t=="function"&&(!!iB.test(rB.call(t))||(rh?ih(t)===aB:nB.call(t)==="[object GeneratorFunction]"))},sB=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}},ah=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"},Be={},lB=ah,uB=tB,cB=oB;oh=typeof BigInt<"u",ss=typeof Symbol<"u",Tt=ss&&Symbol.toStringTag!==void 0,yt=typeof Uint8Array<"u",fB=typeof ArrayBuffer<"u";if(yt&&Tt)var dB=Object.getPrototypeOf(Uint8Array.prototype),xt=Sn(Object.getOwnPropertyDescriptor(dB,Symbol.toStringTag).get);Ve=Sn(Object.prototype.toString),pB=Sn(Number.prototype.valueOf),gB=Sn(String.prototype.valueOf),yB=Sn(Boolean.prototype.valueOf);if(oh)var hB=Sn(BigInt.prototype.valueOf);if(ss)var mB=Sn(Symbol.prototype.valueOf);Be.isArgumentsObject=uB,Be.isGeneratorFunction=cB,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 fB&&ArrayBuffer.isView?ArrayBuffer.isView(t):Fy(t)||qy(t)},Be.isTypedArray=Fy,Be.isUint8Array=sh,Be.isUint8ClampedArray=lh,Be.isUint16Array=uh,Be.isUint32Array=ch,Be.isInt8Array=fh,Be.isInt16Array=dh,Be.isInt32Array=ph,Be.isFloat32Array=gh,Be.isFloat64Array=yh,Be.isBigInt64Array=hh,Be.isBigUint64Array=mh,ha.working=typeof Map<"u"&&ha(new Map),Be.isMap=function(t){return typeof Map<"u"&&(ha.working?ha(t):t instanceof Map)},ma.working=typeof Set<"u"&&ma(new Set),Be.isSet=function(t){return typeof Set<"u"&&(ma.working?ma(t):t instanceof Set)},va.working=typeof WeakMap<"u"&&va(new WeakMap),Be.isWeakMap=function(t){return typeof WeakMap<"u"&&(va.working?va(t):t instanceof WeakMap)},es.working=typeof WeakSet<"u"&&es(new WeakSet),Be.isWeakSet=function(t){return es(t)},wa.working=typeof ArrayBuffer<"u"&&wa(new ArrayBuffer),Be.isArrayBuffer=Ky,Ea.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Ea(new DataView(new ArrayBuffer(1),0,1)),Be.isDataView=qy,Ba.working=typeof SharedArrayBuffer<"u"&&Ba(new SharedArrayBuffer),Be.isSharedArrayBuffer=zy,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=Gy,Be.isStringObject=Vy,Be.isBooleanObject=Wy,Be.isBigIntObject=Jy,Be.isSymbolObject=Yy,Be.isBoxedPrimitive=function(t){return Gy(t)||Vy(t)||Wy(t)||Jy(t)||Yy(t)},Be.isAnyArrayBuffer=function(t){return yt&&(Ky(t)||zy(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(Be,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})});Nr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,L={},kt=Ke,Xy=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},vB=/%[sdj%]/g;L.format=function(t){if(!Ia(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,s=String(t).replace(vB,function(o){if(o==="%%")return"%";if(n>=a)return o;switch(o){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 o}}),i=r[n];n<a;i=r[++n])Ca(i)||!rr(i)?s+=" "+i:s+=" "+an(i);return s},L.deprecate=function(t,e){if(kt!==void 0&&kt.noDeprecation===!0)return t;if(kt===void 0)return function(){return L.deprecate(t,e).apply(this||Nr,arguments)};var n=!1;return function(){if(!n){if(kt.throwDeprecation)throw new Error(e);kt.traceDeprecation?console.trace(e):console.error(e),n=!0}return t.apply(this||Nr,arguments)}};Ta={},vh=/^$/;kt.env.NODE_DEBUG&&(ba=kt.env.NODE_DEBUG,ba=ba.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),vh=new RegExp("^"+ba+"$","i"));L.debuglog=function(t){if(t=t.toUpperCase(),!Ta[t])if(vh.test(t)){var e=kt.pid;Ta[t]=function(){var n=L.format.apply(L,arguments);console.error("%s %d: %s",t,e,n)}}else Ta[t]=function(){};return Ta[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=Th,L.isBoolean=ls,L.isNull=Ca,L.isNullOrUndefined=function(t){return t==null},L.isNumber=bh,L.isString=Ia,L.isSymbol=function(t){return typeof t=="symbol"},L.isUndefined=In,L.isRegExp=Hr,L.types.isRegExp=Hr,L.isObject=rr,L.isDate=Sa,L.types.isDate=Sa,L.isError=Ur,L.types.isNativeError=Ur,L.isFunction=xa,L.isPrimitive=function(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||t===void 0},L.isBuffer=ah;_B=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];L.log=function(){console.log("%s - %s",xB(),L.format.apply(L,arguments))},L.inherits=sB,L._extend=function(t,e){if(!e||!rr(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(o,l){n=o,r=l}),s=[],i=0;i<arguments.length;i++)s.push(arguments[i]);s.push(function(o,l){o?r(o):n(l)});try{t.apply(this||Nr,s)}catch(o){r(o)}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,Xy(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 s=this||Nr,i=function(){return a.apply(s,arguments)};t.apply(this||Nr,n).then(function(o){kt.nextTick(i.bind(null,null,o))},function(o){kt.nextTick(wB.bind(null,o,i))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,Xy(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;IC=L.promisify;L.types});var OC,xh=it(()=>{R();M();O();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;OC=L.promisify;L.types;L.TextEncoder=globalThis.TextEncoder;L.TextDecoder=globalThis.TextDecoder});function ps(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function EB(){!ir||!An||(ir=!1,An.length?Wt=An.concat(Wt):Ra=-1,Wt.length&&wh())}function wh(){if(!ir){var t=setTimeout(EB,0);ir=!0;for(var e=Wt.length;e;){for(An=Wt,Wt=[];++Ra<e;)An&&An[Ra].run();Ra=-1,e=Wt.length}An=null,ir=!1,clearTimeout(t)}}function BB(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 Eh(t,e)),Wt.length===1&&!ir&&setTimeout(wh,0)}function Eh(t,e){this.fun=t,this.array=e}function st(){}function LB(t){ps("_linkedBinding")}function zB(t){ps("dlopen")}function GB(){return[]}function VB(){return[]}function rP(t,e){if(!t)throw new Error(e||"assertion error")}function sP(){return!1}function EP(){return on.now()/1e3}function ds(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+=fs)),[r,a]}function sn(){return Pt}function NP(t){return[]}var Wt,ir,An,Ra,PB,IB,SB,AB,CB,kB,RB,OB,MB,DB,NB,HB,UB,jB,$B,ZB,FB,KB,qB,WB,JB,gs,YB,XB,QB,eP,tP,nP,iP,aP,oP,lP,uP,cP,fP,dP,pP,gP,yP,hP,mP,vP,TP,bP,_P,xP,wP,on,cs,fs,BP,PP,IP,SP,AP,CP,kP,RP,OP,MP,DP,Pt,ys=it(()=>{R();M();O();Wt=[],ir=!1,Ra=-1;Eh.prototype.run=function(){this.fun.apply(null,this.array)};PB="browser",IB="x64",SB="browser",AB={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},CB=["/usr/bin/node"],kB=[],RB="v16.8.0",OB={},MB=function(t,e){console.warn((e?e+": ":"")+t)},DB=function(t){ps("binding")},NB=function(t){return 0},HB=function(){return"/"},UB=function(t){},jB={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};$B=st,ZB=[];FB={},KB=!1,qB={};WB=st,JB=st,gs=function(){return{}},YB=gs,XB=gs,QB=st,eP=st,tP=st,nP={};iP={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},aP=st,oP=st;lP=st,uP=st,cP=st,fP=st,dP=st,pP=void 0,gP=void 0,yP=void 0,hP=st,mP=2,vP=1,TP="/bin/usr/node",bP=9229,_P="node",xP=[],wP=st,on={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};on.now===void 0&&(cs=Date.now(),on.timing&&on.timing.navigationStart&&(cs=on.timing.navigationStart),on.now=()=>Date.now()-cs);fs=1e9;ds.bigint=function(t){var e=ds(t);return typeof BigInt>"u"?e[0]*fs+e[1]:BigInt(e[0]*fs)+BigInt(e[1])};BP=10,PP={},IP=0;SP=sn,AP=sn,CP=sn,kP=sn,RP=sn,OP=st,MP=sn,DP=sn;Pt={version:RB,versions:OB,arch:IB,platform:SB,release:jB,_rawDebug:$B,moduleLoadList:ZB,binding:DB,_linkedBinding:LB,_events:PP,_eventsCount:IP,_maxListeners:BP,on:sn,addListener:SP,once:AP,off:CP,removeListener:kP,removeAllListeners:RP,emit:OP,prependListener:MP,prependOnceListener:DP,listeners:NP,domain:FB,_exiting:KB,config:qB,dlopen:zB,uptime:EP,_getActiveRequests:GB,_getActiveHandles:VB,reallyExit:WB,_kill:JB,cpuUsage:gs,resourceUsage:YB,memoryUsage:XB,kill:QB,exit:eP,openStdin:tP,allowedNodeEnvironmentFlags:nP,assert:rP,features:iP,_fatalExceptions:aP,setUncaughtExceptionCaptureCallback:oP,hasUncaughtExceptionCaptureCallback:sP,emitWarning:MB,nextTick:BB,_tickCallback:lP,_debugProcess:uP,_debugEnd:cP,_startProfilerIdleNotifier:fP,_stopProfilerIdleNotifier:dP,stdout:pP,stdin:yP,stderr:gP,abort:hP,umask:NB,chdir:UB,cwd:HB,env:AB,title:PB,argv:CB,execArgv:kB,pid:mP,ppid:vP,execPath:TP,debugPort:bP,hrtime:ds,argv0:_P,_preload_modules:xP,setSourceMapsEnabled:wP}});function Ph(){if(Bh)return hs;Bh=!0,hs=t;function t(n,r){if(e("noDeprecation"))return n;var a=!1;function s(){if(!a){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),a=!0}return n.apply(this||ms,arguments)}return s}function e(n){try{if(!ms.localStorage)return!1}catch{return!1}var r=ms.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return hs}var hs,Bh,ms,Ih=it(()=>{R();M();O();hs={},Bh=!1,ms=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global});function HP(){if(Sh)return $r;Sh=!0;var t=At(),e=t.Buffer;function n(a,s){for(var i in a)s[i]=a[i]}e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?$r=t:(n(t,$r),$r.Buffer=r);function r(a,s,i){return e(a,s,i)}return r.prototype=Object.create(e.prototype),n(e,r),r.from=function(a,s,i){if(typeof a=="number")throw new TypeError("Argument must not be a number");return e(a,s,i)},r.alloc=function(a,s,i){if(typeof a!="number")throw new TypeError("Argument must be a number");var o=e(a);return s!==void 0?typeof i=="string"?o.fill(s,i):o.fill(s):o.fill(0),o},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)},$r}function UP(){if(Ah)return vs;Ah=!0;var t=HP().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}vs.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=h,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 s(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 $=s(I[D]);return $>=0?($>0&&(v.lastNeed=$-1),$):--D<P||$===-2?0:($=s(I[D]),$>=0?($>0&&(v.lastNeed=$-2),$):--D<P||$===-2?0:($=s(I[D]),$>=0?($>0&&($===2?$=0:v.lastNeed=$-3),$):0))}function o(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=o(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 h(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 vs}var $r,Sh,vs,Ah,Zr,GC,Ch=it(()=>{R();M();O();ei();$r={},Sh=!1;vs={},Ah=!1;Zr=UP();Zr.StringDecoder;GC=Zr.StringDecoder});function jP(){if(kh)return Ts;kh=!0;var t=Ts={},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 s(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||ar,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||ar,E)}}}var o=[],l=!1,f,g=-1;function y(){!l||!f||(l=!1,f.length?o=f.concat(o):g=-1,o.length&&p())}function p(){if(!l){var E=s(y);l=!0;for(var B=o.length;B;){for(f=o,o=[];++g<B;)f&&f[g].run();g=-1,B=o.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];o.push(new h(E,B)),o.length===1&&!l&&s(p)};function h(E,B){(this||ar).fun=E,(this||ar).array=B}h.prototype.run=function(){(this||ar).fun.apply(null,(this||ar).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},Ts}var Ts,kh,ar,qe,bs=it(()=>{R();M();O();Ts={},kh=!1,ar=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;qe=jP();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 $P(){if(Rh)return _s;Rh=!0;var t=qe;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function n(s,i){for(var o="",l=0,f=-1,g=0,y,p=0;p<=s.length;++p){if(p<s.length)y=s.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(o.length<2||l!==2||o.charCodeAt(o.length-1)!==46||o.charCodeAt(o.length-2)!==46){if(o.length>2){var h=o.lastIndexOf("/");if(h!==o.length-1){h===-1?(o="",l=0):(o=o.slice(0,h),l=o.length-1-o.lastIndexOf("/")),f=p,g=0;continue}}else if(o.length===2||o.length===1){o="",l=0,f=p,g=0;continue}}i&&(o.length>0?o+="/..":o="..",l=2)}else o.length>0?o+="/"+s.slice(f+1,p):o=s.slice(f+1,p),l=p-f-1;f=p,g=0}else y===46&&g!==-1?++g:g=-1}return o}function r(s,i){var o=i.dir||i.root,l=i.base||(i.name||"")+(i.ext||"");return o?o===i.root?o+l:o+s+l:l}var a={resolve:function(){for(var i="",o=!1,l,f=arguments.length-1;f>=-1&&!o;f--){var g;f>=0?g=arguments[f]:(l===void 0&&(l=t.cwd()),g=l),e(g),g.length!==0&&(i=g+"/"+i,o=g.charCodeAt(0)===47)}return i=n(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var o=i.charCodeAt(0)===47,l=i.charCodeAt(i.length-1)===47;return i=n(i,!o),i.length===0&&!o&&(i="."),i.length>0&&l&&(i+="/"),o?"/"+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,o=0;o<arguments.length;++o){var l=arguments[o];e(l),l.length>0&&(i===void 0?i=l:i+="/"+l)}return i===void 0?".":a.normalize(i)},relative:function(i,o){if(e(i),e(o),i===o||(i=a.resolve(i),o=a.resolve(o),i===o))return"";for(var l=1;l<i.length&&i.charCodeAt(l)===47;++l);for(var f=i.length,g=f-l,y=1;y<o.length&&o.charCodeAt(y)===47;++y);for(var p=o.length,h=p-y,_=g<h?g:h,E=-1,B=0;B<=_;++B){if(B===_){if(h>_){if(o.charCodeAt(y+B)===47)return o.slice(y+B+1);if(B===0)return o.slice(y+B)}else g>_&&(i.charCodeAt(l+B)===47?E=B:B===0&&(E=0));break}var v=i.charCodeAt(l+B),I=o.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+o.slice(y+E):(y+=E,o.charCodeAt(y)===47&&++y,o.slice(y))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var o=i.charCodeAt(0),l=o===47,f=-1,g=!0,y=i.length-1;y>=1;--y)if(o=i.charCodeAt(y),o===47){if(!g){f=y;break}}else g=!1;return f===-1?l?"/":".":l&&f===1?"//":i.slice(0,f)},basename:function(i,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');e(i);var l=0,f=-1,g=!0,y;if(o!==void 0&&o.length>0&&o.length<=i.length){if(o.length===i.length&&o===i)return"";var p=o.length-1,h=-1;for(y=i.length-1;y>=0;--y){var _=i.charCodeAt(y);if(_===47){if(!g){l=y+1;break}}else h===-1&&(g=!1,h=y+1),p>=0&&(_===o.charCodeAt(p)?--p===-1&&(f=y):(p=-1,f=h))}return l===f?f=h:f===-1&&(f=i.length),i.slice(l,f)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!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 o=-1,l=0,f=-1,g=!0,y=0,p=i.length-1;p>=0;--p){var h=i.charCodeAt(p);if(h===47){if(!g){l=p+1;break}continue}f===-1&&(g=!1,f=p+1),h===46?o===-1?o=p:y!==1&&(y=1):o!==-1&&(y=-1)}return o===-1||f===-1||y===0||y===1&&o===f-1&&o===l+1?"":i.slice(o,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 o={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return o;var l=i.charCodeAt(0),f=l===47,g;f?(o.root="/",g=1):g=0;for(var y=-1,p=0,h=-1,_=!0,E=i.length-1,B=0;E>=g;--E){if(l=i.charCodeAt(E),l===47){if(!_){p=E+1;break}continue}h===-1&&(_=!1,h=E+1),l===46?y===-1?y=E:B!==1&&(B=1):y!==-1&&(B=-1)}return y===-1||h===-1||B===0||B===1&&y===h-1&&y===p+1?h!==-1&&(p===0&&f?o.base=o.name=i.slice(1,h):o.base=o.name=i.slice(p,h)):(p===0&&f?(o.name=i.slice(1,y),o.base=i.slice(1,h)):(o.name=i.slice(p,y),o.base=i.slice(p,h)),o.ext=i.slice(y,h)),p>0?o.dir=i.slice(0,p-1):f&&(o.dir="/"),o},sep:"/",delimiter:":",win32:null,posix:null};return a.posix=a,_s=a,_s}function Cn(t){throw new RangeError(KP[t])}function Mh(t,e){let n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]);let a=function(s,i){let o=[],l=s.length;for(;l--;)o[l]=i(s[l]);return o}((t=t.replace(FP,".")).split("."),e).join(".");return r+a}function Fh(t){let e=[],n=0,r=t.length;for(;n<r;){let a=t.charCodeAt(n++);if(a>=55296&&a<=56319&&n<r){let s=t.charCodeAt(n++);(64512&s)==56320?e.push(((1023&a)<<10)+(1023&s)+65536):(e.push(a),n--)}else e.push(a)}return e}function zP(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 Fr(t,e,n){if(t&&Rt.isObject(t)&&t instanceof wt)return t;var r=new wt;return r.parse(t,e,n),r}function nI(){if(Zh)return Bs;Zh=!0;var t=Ke;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function n(s,i){for(var o="",l=0,f=-1,g=0,y,p=0;p<=s.length;++p){if(p<s.length)y=s.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(o.length<2||l!==2||o.charCodeAt(o.length-1)!==46||o.charCodeAt(o.length-2)!==46){if(o.length>2){var h=o.lastIndexOf("/");if(h!==o.length-1){h===-1?(o="",l=0):(o=o.slice(0,h),l=o.length-1-o.lastIndexOf("/")),f=p,g=0;continue}}else if(o.length===2||o.length===1){o="",l=0,f=p,g=0;continue}}i&&(o.length>0?o+="/..":o="..",l=2)}else o.length>0?o+="/"+s.slice(f+1,p):o=s.slice(f+1,p),l=p-f-1;f=p,g=0}else y===46&&g!==-1?++g:g=-1}return o}function r(s,i){var o=i.dir||i.root,l=i.base||(i.name||"")+(i.ext||"");return o?o===i.root?o+l:o+s+l:l}var a={resolve:function(){for(var i="",o=!1,l,f=arguments.length-1;f>=-1&&!o;f--){var g;f>=0?g=arguments[f]:(l===void 0&&(l=t.cwd()),g=l),e(g),g.length!==0&&(i=g+"/"+i,o=g.charCodeAt(0)===47)}return i=n(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var o=i.charCodeAt(0)===47,l=i.charCodeAt(i.length-1)===47;return i=n(i,!o),i.length===0&&!o&&(i="."),i.length>0&&l&&(i+="/"),o?"/"+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,o=0;o<arguments.length;++o){var l=arguments[o];e(l),l.length>0&&(i===void 0?i=l:i+="/"+l)}return i===void 0?".":a.normalize(i)},relative:function(i,o){if(e(i),e(o),i===o||(i=a.resolve(i),o=a.resolve(o),i===o))return"";for(var l=1;l<i.length&&i.charCodeAt(l)===47;++l);for(var f=i.length,g=f-l,y=1;y<o.length&&o.charCodeAt(y)===47;++y);for(var p=o.length,h=p-y,_=g<h?g:h,E=-1,B=0;B<=_;++B){if(B===_){if(h>_){if(o.charCodeAt(y+B)===47)return o.slice(y+B+1);if(B===0)return o.slice(y+B)}else g>_&&(i.charCodeAt(l+B)===47?E=B:B===0&&(E=0));break}var v=i.charCodeAt(l+B),I=o.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+o.slice(y+E):(y+=E,o.charCodeAt(y)===47&&++y,o.slice(y))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var o=i.charCodeAt(0),l=o===47,f=-1,g=!0,y=i.length-1;y>=1;--y)if(o=i.charCodeAt(y),o===47){if(!g){f=y;break}}else g=!1;return f===-1?l?"/":".":l&&f===1?"//":i.slice(0,f)},basename:function(i,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');e(i);var l=0,f=-1,g=!0,y;if(o!==void 0&&o.length>0&&o.length<=i.length){if(o.length===i.length&&o===i)return"";var p=o.length-1,h=-1;for(y=i.length-1;y>=0;--y){var _=i.charCodeAt(y);if(_===47){if(!g){l=y+1;break}}else h===-1&&(g=!1,h=y+1),p>=0&&(_===o.charCodeAt(p)?--p===-1&&(f=y):(p=-1,f=h))}return l===f?f=h:f===-1&&(f=i.length),i.slice(l,f)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!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 o=-1,l=0,f=-1,g=!0,y=0,p=i.length-1;p>=0;--p){var h=i.charCodeAt(p);if(h===47){if(!g){l=p+1;break}continue}f===-1&&(g=!1,f=p+1),h===46?o===-1?o=p:y!==1&&(y=1):o!==-1&&(y=-1)}return o===-1||f===-1||y===0||y===1&&o===f-1&&o===l+1?"":i.slice(o,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 o={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return o;var l=i.charCodeAt(0),f=l===47,g;f?(o.root="/",g=1):g=0;for(var y=-1,p=0,h=-1,_=!0,E=i.length-1,B=0;E>=g;--E){if(l=i.charCodeAt(E),l===47){if(!_){p=E+1;break}continue}h===-1&&(_=!1,h=E+1),l===46?y===-1?y=E:B!==1&&(B=1):y!==-1&&(B=-1)}return y===-1||h===-1||B===0||B===1&&y===h-1&&y===p+1?h!==-1&&(p===0&&f?o.base=o.name=i.slice(1,h):o.base=o.name=i.slice(p,h)):(p===0&&f?(o.name=i.slice(1,y),o.base=i.slice(1,h)):(o.name=i.slice(p,y),o.base=i.slice(p,h)),o.ext=i.slice(y,h)),p>0?o.dir=i.slice(0,p-1):f&&(o.dir="/"),o},sep:"/",delimiter:":",win32:null,posix:null};return a.posix=a,Bs=a,Bs}function gI(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 Is?yI(t):hI(t)}function yI(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(lI,"\\"),n=decodeURIComponent(n),e!=="")return`\\\\${e}${n}`;{let r=n.codePointAt(1)|32,a=n[2];if(r<oI||r>sI||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 mI(t){let e=Lh.resolve(t),n=t.charCodeAt(t.length-1);(n===aI||Is&&n===iI)&&e[e.length-1]!==Lh.sep&&(e+="/");let r=new URL("file://");return e.includes("%")&&(e=e.replace(uI,"%25")),!Is&&e.includes("\\")&&(e=e.replace(cI,"%5C")),e.includes(`
11
+ `)&&(e=e.replace(fI,"%0A")),e.includes("\r")&&(e=e.replace(dI,"%0D")),e.includes(" ")&&(e=e.replace(pI,"%09")),r.pathname=e,r}function AI(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?CI(t):kI(t)}function CI(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(wI,"\\"),n=decodeURIComponent(n),e!=="")return`\\\\${e}${n}`;{let r=n.codePointAt(1)|32,a=n[2];if(r<_I||r>xI||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 RI(t){let e=Oh.resolve(t),n=t.charCodeAt(t.length-1);(n===bI||Ss&&n===TI)&&e[e.length-1]!==Oh.sep&&(e+="/");let r=new URL("file://");return e.includes("%")&&(e=e.replace(EI,"%25")),!Ss&&e.includes("\\")&&(e=e.replace(BI,"%5C")),e.includes(`
12
+ `)&&(e=e.replace(PI,"%0A")),e.includes("\r")&&(e=e.replace(II,"%0D")),e.includes(" ")&&(e=e.replace(SI,"%09")),r.pathname=e,r}var _s,Rh,Oh,sr,ZP,LP,FP,KP,Ot,xs,Dh,Kh,Nh,Hh,qP,GP,Lr,VP,Jt,Ue,WP,Rt,JP,YP,XP,QP,Ps,Uh,jh,$h,eI,tI,ws,or,Es,Bs,Zh,Lh,rI,iI,aI,oI,sI,Is,lI,uI,cI,fI,dI,pI,vI,TI,bI,_I,xI,Ss,wI,EI,BI,PI,II,SI,qh=it(()=>{R();M();O();ka();bs();_s={},Rh=!1;Oh=$P(),sr=2147483647,ZP=/^xn--/,LP=/[^\0-\x7E]/,FP=/[\x2E\u3002\uFF0E\uFF61]/g,KP={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,xs=String.fromCharCode;Dh=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Kh=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))},Nh=function(t){let e=[],n=t.length,r=0,a=128,s=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 h=(o=t.charCodeAt(l++))-48<10?o-22:o-65<26?o-65:o-97<26?o-97:36;(h>=36||h>Ot((sr-r)/y))&&Cn("overflow"),r+=h*y;let _=p<=s?1:p>=s+26?26:p-s;if(h<_)break;let E=36-_;y>Ot(sr/E)&&Cn("overflow"),y*=E}let g=e.length+1;s=Kh(r-f,g,f==0),Ot(r/g)>sr-a&&Cn("overflow"),a+=Ot(r/g),r%=g,e.splice(r++,0,a)}var o;return String.fromCodePoint(...e)},Hh=function(t){let e=[],n=(t=Fh(t)).length,r=128,a=0,s=72;for(let l of t)l<128&&e.push(xs(l));let i=e.length,o=i;for(i&&e.push("-");o<n;){let l=sr;for(let g of t)g>=r&&g<l&&(l=g);let f=o+1;l-r>Ot((sr-a)/f)&&Cn("overflow"),a+=(l-r)*f,r=l;for(let g of t)if(g<r&&++a>sr&&Cn("overflow"),g==r){let y=a;for(let p=36;;p+=36){let h=p<=s?1:p>=s+26?26:p-s;if(y<h)break;let _=y-h,E=36-h;e.push(xs(Dh(h+_%E,0))),y=Ot(_/E)}e.push(xs(Dh(y,0))),s=Kh(a,f,o==i),a=0,++o}++a,++r}return e.join("")},qP={version:"2.1.0",ucs2:{decode:Fh,encode:t=>String.fromCodePoint(...t)},decode:Nh,encode:Hh,toASCII:function(t){return Mh(t,function(e){return LP.test(e)?"xn--"+Hh(e):e})},toUnicode:function(t){return Mh(t,function(e){return ZP.test(e)?Nh(e.slice(4).toLowerCase()):e})}};GP=function(t,e,n,r){e=e||"&",n=n||"=";var a={};if(typeof t!="string"||t.length===0)return a;var s=/\+/g;t=t.split(e);var i=1e3;r&&typeof r.maxKeys=="number"&&(i=r.maxKeys);var o=t.length;i>0&&o>i&&(o=i);for(var l=0;l<o;++l){var f,g,y,p,h=t[l].replace(s,"%20"),_=h.indexOf(n);_>=0?(f=h.substr(0,_),g=h.substr(_+1)):(f=h,g=""),y=decodeURIComponent(f),p=decodeURIComponent(g),zP(a,y)?Array.isArray(a[y])?a[y].push(p):a[y]=[a[y],p]:a[y]=p}return a},Lr=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},VP=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 s=encodeURIComponent(Lr(a))+n;return Array.isArray(t[a])?t[a].map(function(i){return s+encodeURIComponent(Lr(i))}).join(e):s+encodeURIComponent(Lr(t[a]))}).join(e):r?encodeURIComponent(Lr(r))+n+encodeURIComponent(Lr(t)):""},Jt={};Jt.decode=Jt.parse=GP,Jt.encode=Jt.stringify=VP;Jt.decode;Jt.encode;Jt.parse;Jt.stringify;Ue={},WP=qP,Rt={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}};Ue.parse=Fr,Ue.resolve=function(t,e){return Fr(t,!1,!0).resolve(e)},Ue.resolveObject=function(t,e){return t?Fr(t,!1,!0).resolveObject(e):e},Ue.format=function(t){return Rt.isString(t)&&(t=Fr(t)),t instanceof wt?t.format():wt.prototype.format.call(t)},Ue.Url=wt;JP=/^([a-z0-9.+-]+:)/i,YP=/:[0-9]*$/,XP=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,QP=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
13
+ `," "]),Ps=["'"].concat(QP),Uh=["%","/","?",";","#"].concat(Ps),jh=["/","?","#"],$h=/^[+a-z0-9A-Z_-]{0,63}$/,eI=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,tI={javascript:!0,"javascript:":!0},ws={javascript:!0,"javascript:":!0},or={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Es=Jt;wt.prototype.parse=function(t,e,n){if(!Rt.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),a=r!==-1&&r<t.indexOf("#")?"?":"#",s=t.split(a);s[0]=s[0].replace(/\\/g,"/");var i=t=s.join(a);if(i=i.trim(),!n&&t.split("#").length===1){var o=XP.exec(i);if(o)return this.path=i,this.href=i,this.pathname=o[1],o[2]?(this.search=o[2],this.query=e?Es.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var l=JP.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&&ws[l]||(i=i.substr(2),this.slashes=!0)}if(!ws[l]&&(g||l&&!or[l])){for(var y,p,h=-1,_=0;_<jh.length;_++)(E=i.indexOf(jh[_]))!==-1&&(h===-1||E<h)&&(h=E);for((p=h===-1?i.lastIndexOf("@"):i.lastIndexOf("@",h))!==-1&&(y=i.slice(0,p),i=i.slice(p+1),this.auth=decodeURIComponent(y)),h=-1,_=0;_<Uh.length;_++){var E;(E=i.indexOf(Uh[_]))!==-1&&(h===-1||E<h)&&(h=E)}h===-1&&(h=i.length),this.host=i.slice(0,h),i=i.slice(h),this.parseHost(),this.hostname=this.hostname||"";var B=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!B)for(var v=this.hostname.split(/\./),I=(_=0,v.length);_<I;_++){var P=v[_];if(P&&!P.match($h)){for(var D="",$=0,ae=P.length;$<ae;$++)P.charCodeAt($)>127?D+="x":D+=P[$];if(!D.match($h)){var Y=v.slice(0,_),ue=v.slice(_+1),ee=P.match(eI);ee&&(Y.push(ee[1]),ue.unshift(ee[2])),ue.length&&(i="/"+ue.join(".")+i),this.hostname=Y.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=WP.toASCII(this.hostname));var ie=this.port?":"+this.port:"",Re=this.hostname||"";this.host=Re+ie,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),i[0]!=="/"&&(i="/"+i))}if(!tI[f])for(_=0,I=Ps.length;_<I;_++){var Se=Ps[_];if(i.indexOf(Se)!==-1){var je=encodeURIComponent(Se);je===Se&&(je=escape(Se)),i=i.split(Se).join(je)}}var De=i.indexOf("#");De!==-1&&(this.hash=i.substr(De),i=i.slice(0,De));var Oe=i.indexOf("?");if(Oe!==-1?(this.search=i.substr(Oe),this.query=i.substr(Oe+1),e&&(this.query=Es.parse(this.query)),i=i.slice(0,Oe)):e&&(this.search="",this.query={}),i&&(this.pathname=i),or[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,s="";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&&Rt.isObject(this.query)&&Object.keys(this.query).length&&(s=Es.stringify(this.query));var i=this.search||s&&"?"+s||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||or[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(o){return encodeURIComponent(o)}))+(i=i.replace("#","%23"))+r},wt.prototype.resolve=function(t){return this.resolveObject(Fr(t,!1,!0)).format()},wt.prototype.resolveObject=function(t){if(Rt.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 s=r[a];n[s]=this[s]}if(n.hash=t.hash,t.href==="")return n.href=n.format(),n;if(t.slashes&&!t.protocol){for(var i=Object.keys(t),o=0;o<i.length;o++){var l=i[o];l!=="protocol"&&(n[l]=t[l])}return or[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!or[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||ws[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 h=n.pathname||"",_=n.search||"";n.path=h+_}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&&!or[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(!Rt.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,Rt.isNull(n.pathname)&&Rt.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)&&($==="."||$==="..")||$==="",Y=0,ue=P.length;ue>=0;ue--)($=P[ue])==="."?P.splice(ue,1):$===".."?(P.splice(ue,1),Y++):Y&&(P.splice(ue,1),Y--);if(!v&&!I)for(;Y--;Y)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),Rt.isNull(n.pathname)&&Rt.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=YP.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};Ue.Url;Ue.format;Ue.resolve;Ue.resolveObject;Bs={},Zh=!1;Lh=nI(),rI=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;Ue.URL=typeof URL<"u"?URL:null;Ue.pathToFileURL=mI;Ue.fileURLToPath=gI;Ue.Url;Ue.format;Ue.resolve;Ue.resolveObject;Ue.URL;iI=92,aI=47,oI=97,sI=122,Is=rI==="win32",lI=/\//g,uI=/%/g,cI=/\\/g,fI=/\n/g,dI=/\r/g,pI=/\t/g;vI=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;Ue.URL=typeof URL<"u"?URL:null;Ue.pathToFileURL=RI;Ue.fileURLToPath=AI;Ue.Url;Ue.format;Ue.resolve;Ue.resolveObject;Ue.parse;Ue.URL;TI=92,bI=47,_I=97,xI=122,Ss=vI==="win32",wI=/\//g,EI=/%/g,BI=/\\/g,PI=/\n/g,II=/\r/g,SI=/\t/g});var Em={};gr(Em,{Agent:()=>FI,ClientRequest:()=>KI,IncomingMessage:()=>qI,METHODS:()=>zI,STATUS_CODES:()=>GI,default:()=>Yt,get:()=>VI,globalAgent:()=>WI,request:()=>JI});function ym(){if(zh)return bt;zh=!0,bt.fetch=r(kn.fetch)&&r(kn.ReadableStream),bt.writableStream=r(kn.WritableStream),bt.abortController=r(kn.AbortController);var t;function e(){if(t!==void 0)return t;if(kn.XMLHttpRequest){t=new kn.XMLHttpRequest;try{t.open("GET",kn.XDomainRequest?"/":"https://example.com")}catch{t=null}}else t=null;return t}function n(a){var s=e();if(!s)return!1;try{return s.responseType=a,s.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 hm(){return Gh||(Gh=!0,As=gt.EventEmitter),As}function OI(){if(Vh)return Cs;Vh=!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 s(_,E,B){return E&&a(_.prototype,E),Object.defineProperty(_,"prototype",{writable:!1}),_}function i(_){var E=o(_,"string");return typeof E=="symbol"?E:String(E)}function o(_,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 h(_,E,B){f.prototype.copy.call(_,E,B)}return Cs=function(){function _(){r(this,_),this.head=null,this.tail=null,this.length=0}return s(_,[{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;)h(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}))}}]),_}(),Cs}function mm(){if(Wh)return ks;Wh=!0;var t=Pt;function e(o,l){var f=this,g=this._readableState&&this._readableState.destroyed,y=this._writableState&&this._writableState.destroyed;return g||y?(l?l(o):o&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(s,this,o)):t.nextTick(s,this,o)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(o||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(o,l){s(o,l),r(o)}function r(o){o._writableState&&!o._writableState.emitClose||o._readableState&&!o._readableState.emitClose||o.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 s(o,l){o.emit("error",l)}function i(o,l){var f=o._readableState,g=o._writableState;f&&f.autoDestroy||g&&g.autoDestroy?o.destroy(l):o.emit("error",l)}return ks={destroy:e,undestroy:a,errorOrDestroy:i},ks}function ur(){if(Jh)return Rs;Jh=!0;let t={};function e(i,o,l){l||(l=Error);function f(y,p,h){return typeof o=="string"?o:o(y,p,h)}class g extends l{constructor(p,h,_){super(f(p,h,_))}}g.prototype.name=l.name,g.prototype.code=i,t[i]=g}function n(i,o){if(Array.isArray(i)){let l=i.length;return i=i.map(f=>String(f)),l>2?`one of ${o} ${i.slice(0,l-1).join(", ")}, or `+i[l-1]:l===2?`one of ${o} ${i[0]} or ${i[1]}`:`of ${o} ${i[0]}`}else return`of ${o} ${String(i)}`}function r(i,o,l){return i.substr(0,o.length)===o}function a(i,o,l){return(l===void 0||l>i.length)&&(l=i.length),i.substring(l-o.length,l)===o}function s(i,o,l){return typeof l!="number"&&(l=0),l+o.length>i.length?!1:i.indexOf(o,l)!==-1}return e("ERR_INVALID_OPT_VALUE",function(i,o){return'The value "'+o+'" is invalid for option "'+i+'"'},TypeError),e("ERR_INVALID_ARG_TYPE",function(i,o,l){let f;typeof o=="string"&&r(o,"not ")?(f="must not be",o=o.replace(/^not /,"")):f="must be";let g;if(a(i," argument"))g=`The ${i} ${f} ${n(o,"type")}`;else{let y=s(i,".")?"property":"argument";g=`The "${i}" ${y} ${f} ${n(o,"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"),Rs.codes=t,Rs}function vm(){if(Yh)return Os;Yh=!0;var t=ur().codes.ERR_INVALID_OPT_VALUE;function e(r,a,s){return r.highWaterMark!=null?r.highWaterMark:a?r[s]:null}function n(r,a,s,i){var o=e(a,i,s);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var l=i?s:"highWaterMark";throw new t(l,o)}return Math.floor(o)}return r.objectMode?16:16*1024}return Os={getHighWaterMark:n},Os}function Tm(){if(Xh)return Ms;Xh=!0;var t=Pt;Ms=ee;function e(C){var S=this;this.next=null,this.entry=null,this.finish=function(){ve(S,C)}}var n;ee.WritableState=Y;var r={deprecate:Ph()},a=hm(),s=At().Buffer,i=(typeof Qh<"u"?Qh:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(C){return s.from(C)}function l(C){return s.isBuffer(C)||C instanceof i}var f=mm(),g=vm(),y=g.getHighWaterMark,p=ur().codes,h=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 Y(C,S,j){n=n||lr(),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)}Y.prototype.getBuffer=function(){for(var S=this.bufferedRequest,j=[];S;)j.push(S),S=S.next;return j},function(){try{Object.defineProperty(Y.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 Y}})):ue=function(S){return S instanceof this};function ee(C){n=n||lr();var S=this instanceof n;if(!S&&!ue.call(ee,this))return new ee(C);this._writableState=new Y(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 Re(C,S,j,V){var oe;return j===null?oe=new I:typeof j!="string"&&!S.objectMode&&(oe=new h("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&&!s.isBuffer(C)&&(C=o(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||Re(this,V,C,j))&&(V.pendingcb++,oe=je(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=s.from(S,j)),S}Object.defineProperty(ee.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function je(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 Ne=S.lastBufferedRequest;S.lastBufferedRequest={chunk:V,encoding:oe,isBuf:j,callback:b,next:null},Ne?Ne.next=S.lastBufferedRequest:S.bufferedRequest=S.lastBufferedRequest,S.bufferedRequestCount+=1}else De(C,S,!1,q,V,oe,b);return Q}function De(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 Oe(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)Oe(C,j,V,S,oe);else{var b=me(j)||C.destroyed;!b&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&ce(C,j),V?t.nextTick(he,C,j,b,oe):he(C,j,b,oe)}}function he(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,De(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,Ne=j.encoding,Te=j.callback,U=S.objectMode?1:Q.length;if(De(C,S,!1,U,Q,Ne,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 me(C){return C.ending&&C.length===0&&C.bufferedRequest===null&&!C.finished&&!C.writing}function k(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(k,C,S)):(S.prefinished=!0,C.emit("prefinish")))}function F(C,S){var j=me(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)},Ms}function lr(){if(em)return Ds;em=!0;var t=Pt,e=Object.keys||function(g){var y=[];for(var p in g)y.push(p);return y};Ds=o;var n=bm(),r=Tm();Ct()(o,n);for(var a=e(r.prototype),s=0;s<a.length;s++){var i=a[s];o.prototype[i]||(o.prototype[i]=r.prototype[i])}function o(g){if(!(this instanceof o))return new o(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(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.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(o.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)}}),Ds}function Gs(){if(tm)return Ns;tm=!0;var t=ur().codes.ERR_STREAM_PREMATURE_CLOSE;function e(s){var i=!1;return function(){if(!i){i=!0;for(var o=arguments.length,l=new Array(o),f=0;f<o;f++)l[f]=arguments[f];s.apply(this,l)}}}function n(){}function r(s){return s.setHeader&&typeof s.abort=="function"}function a(s,i,o){if(typeof i=="function")return a(s,null,i);i||(i={}),o=e(o||n);var l=i.readable||i.readable!==!1&&s.readable,f=i.writable||i.writable!==!1&&s.writable,g=function(){s.writable||p()},y=s._writableState&&s._writableState.finished,p=function(){f=!1,y=!0,l||o.call(s)},h=s._readableState&&s._readableState.endEmitted,_=function(){l=!1,h=!0,f||o.call(s)},E=function(P){o.call(s,P)},B=function(){var P;if(l&&!h)return(!s._readableState||!s._readableState.ended)&&(P=new t),o.call(s,P);if(f&&!y)return(!s._writableState||!s._writableState.ended)&&(P=new t),o.call(s,P)},v=function(){s.req.on("finish",p)};return r(s)?(s.on("complete",p),s.on("abort",B),s.req?v():s.on("request",v)):f&&!s._writableState&&(s.on("end",g),s.on("close",g)),s.on("end",_),s.on("finish",p),i.error!==!1&&s.on("error",E),s.on("close",B),function(){s.removeListener("complete",p),s.removeListener("abort",B),s.removeListener("request",v),s.req&&s.req.removeListener("finish",p),s.removeListener("end",g),s.removeListener("close",g),s.removeListener("finish",p),s.removeListener("end",_),s.removeListener("error",E),s.removeListener("close",B)}}return Ns=a,Ns}function MI(){if(nm)return Hs;nm=!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 Y=ae.call(D,$||"default");if(typeof Y!="object")return Y;throw new TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var s=Gs(),i=Symbol("lastResolve"),o=Symbol("lastReject"),l=Symbol("error"),f=Symbol("ended"),g=Symbol("lastPromise"),y=Symbol("handlePromise"),p=Symbol("stream");function h(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[o]=null,$(h(ae,!1)))}}function E(D){t.nextTick(_,D)}function B(D,$){return function(ae,Y){D.then(function(){if($[f]){ae(h(void 0,!0));return}$[y](ae,Y)},Y)}}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(h(void 0,!0));if(this[p].destroyed)return new Promise(function(ie,Re){t.nextTick(function(){$[l]?Re($[l]):ie(h(void 0,!0))})});var Y=this[g],ue;if(Y)ue=new Promise(B(Y,this));else{var ee=this[p].read();if(ee!==null)return Promise.resolve(h(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,Y){$[p].destroy(null,function(ue){if(ue){Y(ue);return}ae(h(void 0,!0))})})}),e),v),P=function($){var ae,Y=Object.create(I,(ae={},n(ae,p,{value:$,writable:!0}),n(ae,i,{value:null,writable:!0}),n(ae,o,{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 Re=Y[p].read();Re?(Y[g]=null,Y[i]=null,Y[o]=null,ee(h(Re,!1))):(Y[i]=ee,Y[o]=ie)},writable:!0}),ae));return Y[g]=null,s($,function(ue){if(ue&&ue.code!=="ERR_STREAM_PREMATURE_CLOSE"){var ee=Y[o];ee!==null&&(Y[g]=null,Y[i]=null,Y[o]=null,ee(ue)),Y[l]=ue;return}var ie=Y[i];ie!==null&&(Y[g]=null,Y[i]=null,Y[o]=null,ie(h(void 0,!0))),Y[f]=!0}),$.on("readable",E.bind(null,Y)),Y};return Hs=P,Hs}function DI(){return rm||(rm=!0,Us=function(){throw new Error("Readable.from is not available in the browser")}),Us}function bm(){if(im)return js;im=!0;var t=Pt;js=ie;var e;ie.ReadableState=ee,gt.EventEmitter;var n=function(x,q){return x.listeners(q).length},r=hm(),a=At().Buffer,s=(typeof am<"u"?am:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(b){return a.from(b)}function o(b){return a.isBuffer(b)||b instanceof s}var l=L,f;l&&l.debuglog?f=l.debuglog("stream"):f=function(){};var g=OI(),y=mm(),p=vm(),h=p.getHighWaterMark,_=ur().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,Y=["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||lr(),b=b||{},typeof q!="boolean"&&(q=x instanceof e),this.objectMode=!!b.objectMode,q&&(this.objectMode=this.objectMode||!!b.readableObjectMode),this.highWaterMark=h(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=Zr.StringDecoder),this.decoder=new P(b.encoding),this.encoding=b.encoding)}function ie(b){if(e=e||lr(),!(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),Re(this,b,x,!1,Q)},ie.prototype.unshift=function(b){return Re(this,b,null,!0,!1)};function Re(b,x,q,Q,Ne){f("readableAddChunk",x);var Te=b._readableState;if(x===null)Te.reading=!1,Ae(b,Te);else{var U;if(Ne||(U=je(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&&he(b)),ce(b,x)}function je(b,x){var q;return!o(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=Zr.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 De=1073741824;function Oe(b){return b>=De?b=De:(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=Oe(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):he(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 Ne;return b>0?Ne=S(b,x):Ne=null,Ne===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)),Ne!==null&&this.emit("data",Ne),Ne};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?he(b):(x.needReadable=!1,x.emittedReadable||(x.emittedReadable=!0,Pe(b)))}}function he(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(me,b,x))}function me(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 Ne=(!x||x.end!==!1)&&b!==t.stdout&&b!==t.stderr,Te=Ne?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,dr())}function Et(){f("onend"),b.end()}var St=k(q);b.on("drain",St);var mt=!1;function dr(){f("cleanup"),b.removeListener("close",pr),b.removeListener("finish",m),b.removeListener("drain",St),b.removeListener("error",_t),b.removeListener("unpipe",U),q.removeListener("end",Et),q.removeListener("end",u),q.removeListener("data",Vr),mt=!0,Q.awaitDrain&&(!b._writableState||b._writableState.needDrain)&&St()}q.on("data",Vr);function Vr(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)&&!mt&&(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 pr(){b.removeListener("finish",m),u()}b.once("close",pr);function m(){f("onfinish"),b.removeListener("close",pr),u()}b.once("finish",m);function u(){f("unpipe"),q.unpipe(b)}return b.emit("pipe",q),Q.flowing||(f("pipe resume"),q.resume()),b};function k(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,Ne=x.pipesCount;x.pipes=null,x.pipesCount=0,x.flowing=!1;for(var Te=0;Te<Ne;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?he(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 Ne in b)this[Ne]===void 0&&typeof b[Ne]=="function"&&(this[Ne]=function(Et){return function(){return b[Et].apply(b,arguments)}}(Ne));for(var Te=0;Te<Y.length;Te++)b.on(Y[Te],this.emit.bind(this,Y[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=MI()),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&&($=DI()),$(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 js}function _m(){if(om)return $s;om=!0,$s=o;var t=ur().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,s=lr();Ct()(o,s);function i(g,y){var p=this._transformState;p.transforming=!1;var h=p.writecb;if(h===null)return this.emit("error",new n);p.writechunk=null,p.writecb=null,y!=null&&this.push(y),h(g);var _=this._readableState;_.reading=!1,(_.needReadable||_.length<_.highWaterMark)&&this._read(_.highWaterMark)}function o(g){if(!(this instanceof o))return new o(g);s.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)}o.prototype.push=function(g,y){return this._transformState.needTransform=!1,s.prototype.push.call(this,g,y)},o.prototype._transform=function(g,y,p){p(new e("_transform()"))},o.prototype._write=function(g,y,p){var h=this._transformState;if(h.writecb=p,h.writechunk=g,h.writeencoding=y,!h.transforming){var _=this._readableState;(h.needTransform||_.needReadable||_.length<_.highWaterMark)&&this._read(_.highWaterMark)}},o.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},o.prototype._destroy=function(g,y){s.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 $s}function NI(){if(sm)return Zs;sm=!0,Zs=e;var t=_m();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)},Zs}function HI(){if(lm)return Ls;lm=!0;var t;function e(p){var h=!1;return function(){h||(h=!0,p.apply(void 0,arguments))}}var n=ur().codes,r=n.ERR_MISSING_ARGS,a=n.ERR_STREAM_DESTROYED;function s(p){if(p)throw p}function i(p){return p.setHeader&&typeof p.abort=="function"}function o(p,h,_,E){E=e(E);var B=!1;p.on("close",function(){B=!0}),t===void 0&&(t=Gs()),t(p,{readable:h,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,h){return p.pipe(h)}function g(p){return!p.length||typeof p[p.length-1]!="function"?s:p.pop()}function y(){for(var p=arguments.length,h=new Array(p),_=0;_<p;_++)h[_]=arguments[_];var E=g(h);if(Array.isArray(h[0])&&(h=h[0]),h.length<2)throw new r("streams");var B,v=h.map(function(I,P){var D=P<h.length-1,$=P>0;return o(I,D,$,function(ae){B||(B=ae),ae&&v.forEach(l),!D&&(v.forEach(l),E(B))})});return h.reduce(f)}return Ls=y,Ls}function xm(){return um||(um=!0,ht=ht=bm(),ht.Stream=ht,ht.Readable=ht,ht.Writable=Tm(),ht.Duplex=lr(),ht.Transform=_m(),ht.PassThrough=NI(),ht.finished=Gs(),ht.pipeline=HI()),ht}function wm(){if(cm)return Oa;cm=!0;var t=At().Buffer,e=Pt,n=ym(),r=Ct(),a=xm(),s=Oa.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i=Oa.IncomingMessage=function(o,l,f,g){var y=this||Ma;if(a.Readable.call(y),y._mode=f,y.headers={},y.rawHeaders=[],y.trailers={},y.rawTrailers=[],y.on("end",function(){e.nextTick(function(){y.emit("close")})}),f==="fetch"){let v=function(){h.read().then(function(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 h=l.body.getReader();v()}else{y._xhr=o,y._pos=0,y.url=o.responseURL,y.statusCode=o.status,y.statusMessage=o.statusText;var _=o.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 o=this||Ma,l=o._resumeFetch;l&&(o._resumeFetch=null,l())},i.prototype._onXHRProgress=function(o){var l=this||Ma,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),h=0;h<y.length;h++)p[h]=y.charCodeAt(h)&255;l.push(p)}else l.push(y,l._charset);l._pos=g.length}break;case"arraybuffer":if(f.readyState!==s.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!==s.LOADING||!g)break;l.push(t.from(new Uint8Array(g)));break;case"ms-stream":if(g=f.response,f.readyState!==s.LOADING)break;var _=new Ma.MSStreamReader;_.onprogress=function(){_.result.byteLength>l._pos&&(l.push(t.from(new Uint8Array(_.result.slice(l._pos)))),l._pos=_.result.byteLength)},_.onload=function(){o(!0),l.push(null)},_.readAsArrayBuffer(g);break}l._xhr.readyState===s.DONE&&l._mode!=="ms-stream"&&(o(!0),l.push(null))},Oa}function UI(){if(fm)return Fs;fm=!0;var t=At().Buffer,e=Pt,n=ym(),r=Ct(),a=wm(),s=xm(),i=a.IncomingMessage,o=a.readyStates;function l(p,h){return n.fetch&&h?"fetch":n.mozchunkedarraybuffer?"moz-chunked-arraybuffer":n.msstream?"ms-stream":n.arraybuffer&&p?"arraybuffer":"text"}var f=Fs=function(p){var h=this||rt;s.Writable.call(h),h._opts=p,h._body=[],h._headers={},p.auth&&h.setHeader("Authorization","Basic "+t.from(p.auth).toString("base64")),Object.keys(p.headers).forEach(function(B){h.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");h._mode=l(_,E),h._fetchTimer=null,h._socketTimeout=null,h._socketTimer=null,h.on("finish",function(){h._onFinish()})};r(f,s.Writable),f.prototype.setHeader=function(p,h){var _=this||rt,E=p.toLowerCase();y.indexOf(E)===-1&&(_._headers[E]={name:p,value:h})},f.prototype.getHeader=function(p){var h=(this||rt)._headers[p.toLowerCase()];return h?h.value:null},f.prototype.removeHeader=function(p){var h=this||rt;delete h._headers[p.toLowerCase()]},f.prototype._onFinish=function(){var p=this||rt;if(!p._destroyed){var h=p._opts;"timeout"in h&&h.timeout!==0&&p.setTimeout(h.timeout);var _=p._headers,E=null;h.method!=="GET"&&h.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(Y){B.push([$,Y])}):B.push([$,ae])}),p._mode==="fetch"){var v=null;if(n.abortController){var I=new AbortController;v=I.signal,p._fetchAbortController=I,"requestTimeout"in h&&h.requestTimeout!==0&&(p._fetchTimer=rt.setTimeout(function(){p.emit("requestTimeout"),p._fetchAbortController&&p._fetchAbortController.abort()},h.requestTimeout))}rt.fetch(p._opts.url,{method:p._opts.method,headers:B,body:E||void 0,mode:"cors",credentials:h.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=!!h.withCredentials),p._mode==="text"&&"overrideMimeType"in P&&P.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in h&&(P.timeout=h.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 o.LOADING:case o.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 h=p.status;return h!==null&&h!==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(h){p.emit("error",h)}),p.emit("response",p._response))},f.prototype._write=function(p,h,_){var E=this||rt;E._body.push(p),_()},f.prototype._resetTimers=function(p){var h=this||rt;rt.clearTimeout(h._socketTimer),h._socketTimer=null,p?(rt.clearTimeout(h._fetchTimer),h._fetchTimer=null):h._socketTimeout&&(h._socketTimer=rt.setTimeout(function(){h.emit("timeout")},h._socketTimeout))},f.prototype.abort=f.prototype.destroy=function(p){var h=this||rt;h._destroyed=!0,h._resetTimers(!0),h._response&&(h._response._destroyed=!0),h._xhr?h._xhr.abort():h._fetchAbortController&&h._fetchAbortController.abort(),p&&h.emit("error",p)},f.prototype.end=function(p,h,_){var E=this||rt;typeof p=="function"&&(_=p,p=void 0),s.Writable.prototype.end.call(E,p,h,_)},f.prototype.setTimeout=function(p,h){var _=this||rt;h&&_.once("timeout",h),_._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 Fs}function jI(){if(dm)return Ks;dm=!0,Ks=e;var t=Object.prototype.hasOwnProperty;function e(){for(var n={},r=0;r<arguments.length;r++){var a=arguments[r];for(var s in a)t.call(a,s)&&(n[s]=a[s])}return n}return Ks}function $I(){return pm||(pm=!0,qs={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"}),qs}function LI(){if(gm)return zs;gm=!0;var t=UI(),e=wm(),n=jI(),r=$I(),a=Ue,s=zs;return s.request=function(i,o){typeof i=="string"?i=a.parse(i):i=n(i);var l=ZI.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 h=new t(i);return o&&h.on("response",o),h},s.get=function(o,l){var f=s.request(o,l);return f.end(),f},s.ClientRequest=t,s.IncomingMessage=e.IncomingMessage,s.Agent=function(){},s.Agent.defaultMaxSockets=4,s.globalAgent=new s.Agent,s.STATUS_CODES=r,s.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"],zs}var bt,zh,kn,As,Gh,Cs,Vh,ks,Wh,Rs,Jh,Os,Yh,Ms,Xh,Qh,Ds,em,Ns,tm,Hs,nm,Us,rm,js,im,am,$s,om,Zs,sm,Ls,lm,ht,um,Oa,cm,Ma,Fs,fm,rt,Ks,dm,qs,pm,zs,gm,ZI,Yt,FI,KI,qI,zI,GI,VI,WI,JI,Bm=it(()=>{R();M();O();Xo();$y();Qo();ei();xh();ka();ys();Ih();Ch();qh();bs();bt={},zh=!1,kn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;As={},Gh=!1;Cs={},Vh=!1;ks={},Wh=!1;Rs={},Jh=!1;Os={},Yh=!1;Ms={},Xh=!1,Qh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ds={},em=!1;Ns={},tm=!1;Hs={},nm=!1;Us={},rm=!1;js={},im=!1,am=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;$s={},om=!1;Zs={},sm=!1;Ls={},lm=!1;ht={},um=!1;Oa={},cm=!1,Ma=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Fs={},fm=!1,rt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ks={},dm=!1;qs={},pm=!1;zs={},gm=!1,ZI=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Yt=LI(),FI=Yt.Agent,KI=Yt.ClientRequest,qI=Yt.IncomingMessage,zI=Yt.METHODS,GI=Yt.STATUS_CODES,VI=Yt.get,WI=Yt.globalAgent,JI=Yt.request});R();M();O();var xy={};gr(xy,{defaults:()=>JE,markdown:()=>WE});R();M();O();R();M();O();R();M();O();var Xi=yr(Nn(),1),Ge=yr(Nn(),1),Zt=yr(Nn(),1),Wn=yr(Nn(),1),dt=yr(Nn(),1),_o=Object.defineProperty,Gv=Object.defineProperties,Vv=Object.getOwnPropertyDescriptors,gi=Object.getOwnPropertySymbols,nf=Object.prototype.hasOwnProperty,rf=Object.prototype.propertyIsEnumerable,_c=(t,e,n)=>e in t?_o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,w=(t,e)=>{for(var n in e||(e={}))nf.call(e,n)&&_c(t,n,e[n]);if(gi)for(var n of gi(e))rf.call(e,n)&&_c(t,n,e[n]);return t},H=(t,e)=>Gv(t,Vv(e)),d=(t,e)=>_o(t,"name",{value:e,configurable:!0}),af=(t,e)=>{var n={};for(var r in t)nf.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&gi)for(var r of gi(t))e.indexOf(r)<0&&rf.call(t,r)&&(n[r]=t[r]);return n},of=(t,e)=>{for(var n in e)_o(t,n,{get:e[n],enumerable:!0})},re={};of(re,{BRAND:()=>iw,DIRTY:()=>Fn,EMPTY_PATH:()=>nw,INVALID:()=>de,NEVER:()=>_E,OK:()=>ut,ParseInputLazyPath:()=>Bt,ParseStatus:()=>pt,Schema:()=>ye,ZodAny:()=>_i,ZodArray:()=>Rr,ZodBigInt:()=>Ro,ZodBoolean:()=>Oo,ZodBranded:()=>Mo,ZodCatch:()=>Do,ZodDate:()=>No,ZodDefault:()=>oa,ZodDiscriminatedUnion:()=>tg,ZodEffects:()=>vn,ZodEnum:()=>Xn,ZodError:()=>$t,ZodFirstPartyTypeKind:()=>Zp,ZodFunction:()=>rg,ZodIntersection:()=>Uo,ZodIssueCode:()=>G,ZodLazy:()=>jo,ZodLiteral:()=>$o,ZodMap:()=>og,ZodNaN:()=>lg,ZodNativeEnum:()=>Zo,ZodNever:()=>mn,ZodNull:()=>Lo,ZodNullable:()=>qn,ZodNumber:()=>Fo,ZodObject:()=>zn,ZodOptional:()=>tn,ZodParsedType:()=>ne,ZodPipeline:()=>Ko,ZodPromise:()=>la,ZodReadonly:()=>ua,ZodRecord:()=>yg,ZodRef:()=>mg,ZodSchema:()=>ye,ZodSet:()=>vg,ZodString:()=>ct,ZodSymbol:()=>Cg,ZodTransformer:()=>vn,ZodTuple:()=>Vn,ZodType:()=>ye,ZodUndefined:()=>qo,ZodUnion:()=>zo,ZodUnknown:()=>Br,ZodVoid:()=>Mg,addIssueToContext:()=>te,agent:()=>Pw,aimodel:()=>kw,any:()=>Lw,array:()=>zw,bigint:()=>Hw,boolean:()=>ly,coerce:()=>bE,conversation:()=>ww,createZodEnum:()=>sa,cuid2Regex:()=>bg,cuidRegex:()=>Tg,custom:()=>Qp,datasource:()=>Rw,date:()=>Uw,datetimeRegex:()=>Ig,default:()=>dE,discriminatedUnion:()=>Jw,effect:()=>tf,emailRegex:()=>wg,enum:()=>sE,errorUtil:()=>se,event:()=>Iw,fromJsonSchema:()=>vE,fromObject:()=>TE,function:()=>iE,getErrorMap:()=>Cr,getParsedType:()=>en,instanceof:()=>Dw,intent:()=>Cw,intersection:()=>Yw,ipv4Regex:()=>Bg,ipv6Regex:()=>Pg,isAborted:()=>lo,isAsync:()=>Ti,isDirty:()=>uo,isEmojiRegex:()=>aw,isValid:()=>kr,jsonSchemaToZui:()=>ca,knowledgebase:()=>Ow,late:()=>Mw,lazy:()=>aE,literal:()=>oE,makeIssue:()=>vi,map:()=>nE,message:()=>Bw,nan:()=>Nw,nativeEnum:()=>lE,never:()=>Kw,null:()=>Zw,nullable:()=>fE,number:()=>sy,object:()=>Gw,objectToZui:()=>Or,objectUtil:()=>so,oboolean:()=>mE,onumber:()=>hE,optional:()=>cE,ostring:()=>yE,pipeline:()=>gE,preprocess:()=>pE,processCreateParams:()=>ge,promise:()=>uE,quotelessJson:()=>tw,readonly:()=>tE,record:()=>Qw,ref:()=>eE,set:()=>rE,setErrorMap:()=>Kp,strictObject:()=>Vw,string:()=>oy,symbol:()=>jw,table:()=>Sw,tablerow:()=>Aw,transformer:()=>tf,tuple:()=>Xw,ulidRegex:()=>_g,undefined:()=>$w,union:()=>Ww,unknown:()=>Fw,user:()=>Ew,util:()=>be,uuidRegex:()=>xg,variable:()=>xw,void:()=>qw,zuiToJsonSchema:()=>Jo});var Ie="x-zui",sf=(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}}),xc=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"),lf=d((t,e)=>{let n=(0,Ge.useContext)(sf);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 h;return n.validation.formValid===null?{formValid:null,formErrors:null}:n.validation.formValid===!1?{formValid:!1,formErrors:((h=n.validation.formErrors)==null?void 0:h.filter(_=>ff(_.path,e)).map(_=>({message:_.message,code:_.code,path:e})))||null}:{formValid:!0,formErrors:[]}},[n.validation.formValid,n.validation.formErrors,e]),s=n.dataTransform?n.dataTransform(r):r,i=(0,Ge.useMemo)(()=>xc("hidden",t,s),[t,s]),o=(0,Ge.useMemo)(()=>xc("disabled",t,s),[t,s]);(0,Ge.useEffect)(()=>{n.setHiddenState(h=>Hn(h,e,i||{})),n.setDisabledState(h=>Hn(h,e,o||{}))},[JSON.stringify({fieldSchema:t,data:r})]);let{disabled:l,hidden:f}=(0,Ge.useMemo)(()=>{let h=i===!0||gn(n.hiddenState,e),_=o===!0||gn(n.disabledState,e);return{hidden:h===!0,disabled:_===!0}},[n.hiddenState,n.disabledState,i,o,e]),g=(0,Ge.useCallback)((h,_)=>{n.setFormData(E=>Hn(E,h,_))},[n.setFormData]),y=(0,Ge.useCallback)((h,_=void 0)=>{let E=Ln(t.items);n.setFormData(B=>{let v=gn(B,h)||[];return _===void 0&&(_=E),Hn(B,h,Array.isArray(v)?[...v,_]:[_])})},[n.setFormData]),p=(0,Ge.useCallback)((h,_)=>{n.setFormData(E=>{let B=gn(E,h)||[];return Array.isArray(B)?(B.splice(_,1),Hn(E,h,B)):E})},[n.setFormData]);return w(H(w({},n),{data:r,disabled:l,hidden:f,handlePropertyChange:g,addArrayItem:y,removeArrayItem:p}),a)},"useFormData");function Hn(t,e,n){if(e.length===0)return n;let r=e.length;return e.reduce((a,s,i)=>(i===r-1?a[s]=n:a[s]||(a[s]=isNaN(Number(s))?{}:[]),a[s]),t??{}),w({},t)}d(Hn,"setObjectPath");var Ln=d((t,e)=>{var n,r,a,s;if(Array.isArray(t))return Ln(t[0]);if(t.default)return t.default;if(t.nullable)return null;if(!e){if((n=t.anyOf)!=null&&n.length)return Ln(t.anyOf[0]);if(t.type==="object"&&t.properties){let i={};return Object.entries(t.properties).map(([o,l])=>{var f;i[o]=Ln(l,!((f=t.required)!=null&&f.includes(o))||uf(l)||!1)}),i}if(t.type==="array")return t.minItems&&t.minItems>0?[Ln(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(s=t.enum)!=null&&s.length?t.enum[0]:!1}},"getDefaultValues"),Wv=d(({children:t,setFormData:e,formData:n,formSchema:r,disableValidation:a,onValidation:s,dataTransform:i})=>{let[o,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 h=ca(r).safeParse(y);return h.success?{formValid:!0,formErrors:[]}:{formValid:!1,formErrors:h.error.issues}},[JSON.stringify({transformedData:y})]);return(0,Ge.useEffect)(()=>{s&&s(p)},[p]),Ge.default.createElement(sf.Provider,{value:{formData:n,setFormData:e,formSchema:r,validation:p,hiddenState:o,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 uf(t){var e;return((e=t.anyOf)==null?void 0:e.some(n=>n.not&&Object.keys(n.not).length===0))||!1}d(uf,"isOptional");function yi(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]=yi(n[r],e[r]):n[r]=yi({},e[r]):n[r]=e[r]);return n}d(yi,"deepMerge");var Jv=d((t,e)=>{let{handlePropertyChange:n,data:r}=lf(t,e),{discriminator:a,value:s,discriminatedSchema:i}=(0,Xi.useMemo)(()=>{let o=cf(t.anyOf),l=o?.key?r?.[o.key]:t.default||null,f=Yv(o?.key||null,l,t.anyOf);return{discriminator:o,value:l,discriminatedSchema:f}},[t.anyOf,r]);return(0,Xi.useEffect)(()=>{a?.key&&a?.values.length&&Object.keys(r||{}).length<1&&!t.default&&n(e,{[a.key]:a.values[0]})},[]),{discriminator:a,discriminatorValue:s,discriminatedSchema:i}},"useDiscriminator"),cf=d(t=>{let e=t?.map(n=>n.type!=="object"||!n.properties?null:Object.entries(n.properties).map(([r,a])=>{var s;return a.type==="string"&&((s=a.enum)!=null&&s.length)?{key:r,value:a.enum[0]}:null}).filter(r=>!!r)).flat().reduce((n,r)=>{if(!r)return n;let{key:a,value:s}=r;return n.key===null&&(n.key=a),n.key===a&&n.values.push(s),n},{key:null,values:[]});return e?.key===null||!e?.values.length?null:e},"resolveDiscriminator"),Yv=d((t,e,n)=>{var r,a;if(!n?.length||!t||!e)return null;for(let s of n){if(s.type!=="object")continue;let i=(r=s.properties)==null?void 0:r[t];if(i?.type==="string"&&((a=i.enum)!=null&&a.length)&&i.enum[0]===e)return H(w({},s),{properties:H(w({},s.properties),{[t]:H(w({},i),{[Ie]:{hidden:!0}})})})}return null},"resolveDiscriminatedSchema"),Xv=d(t=>{var e;return(e=t.anyOf)!=null&&e.length?cf(t.anyOf)?"discriminatedUnion":"object":t.type==="integer"?"number":t.type},"getSchemaType"),Qv=d((t,e)=>{var n,r,a;let s=Xv(e),i=((n=e[Ie])==null?void 0:n.displayAs)||null;if(!i||!Array.isArray(i)||i.length<2){let g=(r=t?.[s])==null?void 0:r.default;return g?{Component:g,type:s,id:"default",params:{}}:null}let o=i[0],l=((a=t?.[s])==null?void 0:a[o])||null;if(!l)return console.warn(`Component ${s}.${o} not found`),null;let f=i[1]||{};return{Component:l,type:s,id:o,params:f}},"resolveComponent");function ff(t,e){return t.length!==e.length?!1:t.every((n,r)=>n===e[r])}d(ff,"pathMatches");function Qa(t,e){return e||(e=new RegExp("/s|-|_| ","g")),gf(t).split(e).map(df).map(yf).reduce(pf)}d(Qa,"formatTitle");function df(t){return t.charAt(0).toUpperCase()+t.substring(1)}d(df,"capitalize");function pf(t,e){return`${t} ${e}`}d(pf,"combine");function gf(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(gf,"decamelize");function yf(t,e,n){let r=t.toLowerCase(),a=t.toUpperCase();for(let s of iT)if(s.toLowerCase()===r)return s;return eT.includes(a)?a:e===0||e===n.length-1||t.length>=4?t:rT.includes(r)||nT.includes(r)||tT.includes(r)?r:t}d(yf,"handleSpecialWords");var eT=["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"],tT=["a","an","the"],nT=["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"],rT=["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"],iT=["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 mf(t){return typeof t>"u"?"undefined":JSON.stringify(t)}d(mf,"unknownToTypescriptValue");var wc=d(t=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)?t:jt(t),"toPropertyKey"),aT=d(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalize"),vf=d(t=>{let e=/[^a-zA-Z0-9_]/g;return t.split(e).map(aT).filter(r=>!!r).join("")},"toTypeArgumentName"),pe=d(t=>{let e=(t??"").split(`
14
+ `).filter(n=>n.trim().length>0);return e.length===0?"":e.length===1?`/** ${e[0]} */`:`/**
15
+ * ${e.join(`
16
+ * `)}
17
+ */`},"getMultilineComment"),Tf={};of(Tf,{JsonSchemaToZuiError:()=>xf,ObjectToZuiError:()=>eo,UnrepresentableGenericError:()=>to,UnsupportedZuiToJsonSchemaError:()=>oT,UnsupportedZuiToTypescriptSchemaError:()=>dn,UnsupportedZuiToTypescriptTypeError:()=>Rf,UntitledDeclarationError:()=>Mf,ZuiToJsonSchemaError:()=>Bf,ZuiToTypescriptSchemaError:()=>Sf,ZuiToTypescriptTypeError:()=>Qi,ZuiTransformError:()=>Jn});var bf=class extends Error{constructor(e,n){super(n),this.transform=e}};d(bf,"ZuiTransformError");var Jn=bf,_f=class extends Jn{constructor(e){super("json-schema-to-zui",e)}};d(_f,"JsonSchemaToZuiError");var xf=_f,wf=class extends Jn{constructor(e){super("object-to-zui",e)}};d(wf,"ObjectToZuiError");var eo=wf,Ef=class extends Jn{constructor(e){super("zui-to-json-schema",e)}};d(Ef,"ZuiToJsonSchemaError");var Bf=Ef,Pf=class extends Bf{constructor(e){super(`Zod type ${e} cannot be transformed to JSON Schema.`)}};d(Pf,"UnsupportedZuiToJsonSchemaError");var oT=Pf,If=class extends Jn{constructor(e){super("zui-to-typescript-schema",e)}};d(If,"ZuiToTypescriptSchemaError");var Sf=If,Af=class extends Sf{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript schema.`)}};d(Af,"UnsupportedZuiToTypescriptSchemaError");var dn=Af,Cf=class extends Jn{constructor(e){super("zui-to-typescript-type",e)}};d(Cf,"ZuiToTypescriptTypeError");var Qi=Cf,kf=class extends Qi{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript type.`)}};d(kf,"UnsupportedZuiToTypescriptTypeError");var Rf=kf,Of=class extends Qi{constructor(){super("Schema must have a title to be transformed to a TypeScript type with a declaration.")}};d(Of,"UntitledDeclarationError");var Mf=Of,Df=class extends Qi{constructor(){super('ZodRef can only be transformed to a TypeScript type with a "type" declaration.')}};d(Df,"UnrepresentableGenericError");var to=Df,Nf=["string","number","boolean","unknown","void","any","null","undefined","never","bigint","symbol","object"],sT=d(t=>Nf.includes(t),"isPrimitive"),lT=d(t=>Nf.map(e=>`${e}[]`).includes(t),"isArrayOfPrimitives"),Ec=d(t=>t.replace(/ +/g," ").trim(),"stripSpaces"),Hf=class{constructor(e,n,r=!1){this.key=e,this.value=n,this.optional=r}};d(Hf,"KeyValue");var ii=Hf,Uf=class{constructor(e){this.schema=e}};d(Uf,"FnParameters");var Bc=Uf,jf=class{constructor(e){this.schema=e}};d(jf,"FnReturn");var Pc=jf,$f=class{constructor(e){this.props=e}};d($f,"Declaration");var oi=$f;function hi(t,e={}){let n=fT(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 s=H(w({},e),{parent:t});if(t===null)return"";if(t instanceof oi)return uT(t,s);if(t instanceof ii){if(t.value instanceof z.ZodOptional){let h=t.value._def.innerType;return h instanceof z.Schema&&!h.description&&t.value.description&&(h=h?.describe(t.value.description)),Ce(new ii(t.key,h,!0),s)}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,s)}${f}`}if(t instanceof Bc){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}`,h=t.schema.items[y];g+=`${Ce(new ii(wc(p),h),s)}${y<t.schema.items.length-1?", ":""} `}return g}let l=Ce(t.schema,s);return l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")||l.startsWith("(")&&l.endsWith(")")||l.startsWith("Array<")&&l.endsWith(">")||l.startsWith("Record<")&&l.endsWith(">")||lT(l)?`args: ${l}`:l}if(t instanceof Pc)return t.schema instanceof z.ZodOptional?`${Ce(t.schema.unwrap(),s)} | undefined`:Ce(t.schema,s);let o=t._def;switch(o.typeName){case z.ZodFirstPartyTypeKind.ZodString:return`${pe(o.description)} string`.trim();case z.ZodFirstPartyTypeKind.ZodNumber:case z.ZodFirstPartyTypeKind.ZodNaN:case z.ZodFirstPartyTypeKind.ZodBigInt:return`${pe(o.description)} number`.trim();case z.ZodFirstPartyTypeKind.ZodBoolean:return`${pe(t._def.description)} boolean`.trim();case z.ZodFirstPartyTypeKind.ZodDate:return`${pe(o.description)} Date`.trim();case z.ZodFirstPartyTypeKind.ZodUndefined:return`${pe(o.description)} undefined`.trim();case z.ZodFirstPartyTypeKind.ZodNull:return`${pe(o.description)} null`.trim();case z.ZodFirstPartyTypeKind.ZodAny:return`${pe(o.description)} any`.trim();case z.ZodFirstPartyTypeKind.ZodUnknown:return`${pe(o.description)} unknown`.trim();case z.ZodFirstPartyTypeKind.ZodNever:return`${pe(o.description)} never`.trim();case z.ZodFirstPartyTypeKind.ZodVoid:return`${pe(o.description)} void`.trim();case z.ZodFirstPartyTypeKind.ZodArray:let l=Ce(o.type,s);return sT(l)?`${l}[]`:`Array<${l}>`;case z.ZodFirstPartyTypeKind.ZodObject:return`{ ${Object.entries(o.shape()).map(([P,D])=>Ce(new ii(wc(P),D),s)).join("; ")} }`;case z.ZodFirstPartyTypeKind.ZodUnion:let g=o.options.map(P=>Ce(P,s));return`${pe(o.description)}
19
+ ${g.join(" | ")}`;case z.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let y=o.options.map(P=>Ce(P,s));return`${pe(t._def.description)}
20
+ ${y.join(" | ")}`;case z.ZodFirstPartyTypeKind.ZodIntersection:return`${Ce(o.left,s)} & ${Ce(o.right,s)}`;case z.ZodFirstPartyTypeKind.ZodTuple:return o.items.length===0?"":`[${o.items.map(P=>Ce(P,s)).join(", ")}]`;case z.ZodFirstPartyTypeKind.ZodRecord:let h=Ce(o.keyType,s),_=Ce(o.valueType,s);return`${pe(o.description)} { [key: ${h}]: ${_} }`;case z.ZodFirstPartyTypeKind.ZodMap:return`Map<${Ce(o.keyType,s)}, ${Ce(o.valueType,s)}>`;case z.ZodFirstPartyTypeKind.ZodSet:return`Set<${Ce(o.valueType,s)}>`;case z.ZodFirstPartyTypeKind.ZodFunction:let E=Ce(new Bc(o.args),s),B=Ce(new Pc(o.returns),s);return`${pe(o.description)}
21
+ (${E}) => ${B}`;case z.ZodFirstPartyTypeKind.ZodLazy:return Ce(o.getter(),s);case z.ZodFirstPartyTypeKind.ZodLiteral:let v=hf(o.value);return`${pe(o.description)}
22
+ ${v}`.trim();case z.ZodFirstPartyTypeKind.ZodEnum:return o.values.map(jt).join(" | ");case z.ZodFirstPartyTypeKind.ZodEffects:return Ce(o.schema,s);case z.ZodFirstPartyTypeKind.ZodNativeEnum:throw new Rf(z.ZodFirstPartyTypeKind.ZodNativeEnum);case z.ZodFirstPartyTypeKind.ZodOptional:return`${Ce(o.innerType,s)} | undefined`;case z.ZodFirstPartyTypeKind.ZodNullable:return`${Ce(o.innerType,s)} | null`;case z.ZodFirstPartyTypeKind.ZodDefault:return Ce(o.innerType,s);case z.ZodFirstPartyTypeKind.ZodCatch:return Ce(o.innerType,s);case z.ZodFirstPartyTypeKind.ZodPromise:return`Promise<${Ce(o.type,s)}>`;case z.ZodFirstPartyTypeKind.ZodBranded:return Ce(o.type,s);case z.ZodFirstPartyTypeKind.ZodPipeline:return Ce(o.in,s);case z.ZodFirstPartyTypeKind.ZodSymbol:return`${pe(o.description)} symbol`.trim();case z.ZodFirstPartyTypeKind.ZodReadonly:return`Readonly<${Ce(o.innerType,s)}>`;case z.ZodFirstPartyTypeKind.ZodRef:return vf(o.uri);default:be.assertNever(o)}}d(Ce,"sUnwrapZod");var uT=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 Ec(`${n}declare const ${t.props.identifier}: ${a};`);let s=t.props.args.length>0?`<${t.props.args.map(vf).join(", ")}>`:"";return Ec(`${n}type ${t.props.identifier}${s} = ${a};`)},"unwrapDeclaration"),cT=d(t=>t.declaration?t.declaration===!0?"variable":t.declaration:"none","getDeclarationType"),fT=d((t,e)=>{let n=cT(e),r=t.getReferences();if(n==="none"){if(r.length>0)throw new to;return new oi({type:"none",schema:t})}let a="title"in t.ui?t.ui.title:null;if(!a)throw new Mf;if(n==="variable"){if(r.length>0)throw new to;return new oi({type:"variable",identifier:a,schema:t})}return new oi({type:"type",identifier:a,schema:t,args:r})},"getDeclarationProps"),dT=typeof global=="object"&&global&&global.Object===Object&&global,Zf=dT,pT=typeof self=="object"&&self&&self.Object===Object&&self,gT=Zf||pT||Function("return this")(),Ft=gT,yT=Ft.Symbol,nn=yT,Lf=Object.prototype,hT=Lf.hasOwnProperty,mT=Lf.toString,vr=nn?nn.toStringTag:void 0;function Ff(t){var e=hT.call(t,vr),n=t[vr];try{t[vr]=void 0;var r=!0}catch{}var a=mT.call(t);return r&&(e?t[vr]=n:delete t[vr]),a}d(Ff,"getRawTag");var vT=Ff,TT=Object.prototype,bT=TT.toString;function Kf(t){return bT.call(t)}d(Kf,"objectToString");var _T=Kf,xT="[object Null]",wT="[object Undefined]",Ic=nn?nn.toStringTag:void 0;function qf(t){return t==null?t===void 0?wT:xT:Ic&&Ic in Object(t)?vT(t):_T(t)}d(qf,"baseGetTag");var Yn=qf;function zf(t){return t!=null&&typeof t=="object"}d(zf,"isObjectLike");var Kn=zf,ET="[object Symbol]";function Gf(t){return typeof t=="symbol"||Kn(t)&&Yn(t)==ET}d(Gf,"isSymbol");var xo=Gf;function Vf(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(Vf,"arrayMap");var BT=Vf,PT=Array.isArray,Lt=PT,IT=1/0,Sc=nn?nn.prototype:void 0,Ac=Sc?Sc.toString:void 0;function wo(t){if(typeof t=="string")return t;if(Lt(t))return BT(t,wo)+"";if(xo(t))return Ac?Ac.call(t):"";var e=t+"";return e=="0"&&1/t==-IT?"-0":e}d(wo,"baseToString");var ST=wo;function Wf(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}d(Wf,"isObject");var Eo=Wf;function Jf(t){return t}d(Jf,"identity");var AT=Jf,CT="[object AsyncFunction]",kT="[object Function]",RT="[object GeneratorFunction]",OT="[object Proxy]";function Yf(t){if(!Eo(t))return!1;var e=Yn(t);return e==kT||e==RT||e==CT||e==OT}d(Yf,"isFunction");var Xf=Yf,MT=Ft["__core-js_shared__"],Wa=MT,Cc=function(){var t=/[^.]+$/.exec(Wa&&Wa.keys&&Wa.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Qf(t){return!!Cc&&Cc in t}d(Qf,"isMasked");var DT=Qf,NT=Function.prototype,HT=NT.toString;function ed(t){if(t!=null){try{return HT.call(t)}catch{}try{return t+""}catch{}}return""}d(ed,"toSource");var Tn=ed,UT=/[\\^$.*+?()[\]{}|]/g,jT=/^\[object .+?Constructor\]$/,$T=Function.prototype,ZT=Object.prototype,LT=$T.toString,FT=ZT.hasOwnProperty,KT=RegExp("^"+LT.call(FT).replace(UT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function td(t){if(!Eo(t)||DT(t))return!1;var e=Xf(t)?KT:jT;return e.test(Tn(t))}d(td,"baseIsNative");var qT=td;function nd(t,e){return t?.[e]}d(nd,"getValue");var zT=nd;function rd(t,e){var n=zT(t,e);return qT(n)?n:void 0}d(rd,"getNative");var bn=rd,GT=bn(Ft,"WeakMap"),no=GT,VT=function(){try{var t=bn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),kc=VT,WT=9007199254740991,JT=/^(?:0|[1-9]\d*)$/;function id(t,e){var n=typeof t;return e=e??WT,!!e&&(n=="number"||n!="symbol"&&JT.test(t))&&t>-1&&t%1==0&&t<e}d(id,"isIndex");var ad=id;function od(t,e,n){e=="__proto__"&&kc?kc(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}d(od,"baseAssignValue");var YT=od;function sd(t,e){return t===e||t!==t&&e!==e}d(sd,"eq");var ld=sd,XT=9007199254740991;function ud(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=XT}d(ud,"isLength");var Bo=ud;function cd(t){return t!=null&&Bo(t.length)&&!Xf(t)}d(cd,"isArrayLike");var QT=cd,eb=Object.prototype;function fd(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||eb;return t===n}d(fd,"isPrototype");var tb=fd;function dd(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}d(dd,"baseTimes");var nb=dd,rb="[object Arguments]";function pd(t){return Kn(t)&&Yn(t)==rb}d(pd,"baseIsArguments");var Rc=pd,gd=Object.prototype,ib=gd.hasOwnProperty,ab=gd.propertyIsEnumerable,ob=Rc(function(){return arguments}())?Rc:function(t){return Kn(t)&&ib.call(t,"callee")&&!ab.call(t,"callee")},yd=ob;function hd(){return!1}d(hd,"stubFalse");var sb=hd,md=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Oc=md&&typeof module=="object"&&module&&!module.nodeType&&module,lb=Oc&&Oc.exports===md,Mc=lb?Ft.Buffer:void 0,ub=Mc?Mc.isBuffer:void 0,cb=ub||sb,ro=cb,fb="[object Arguments]",db="[object Array]",pb="[object Boolean]",gb="[object Date]",yb="[object Error]",hb="[object Function]",mb="[object Map]",vb="[object Number]",Tb="[object Object]",bb="[object RegExp]",_b="[object Set]",xb="[object String]",wb="[object WeakMap]",Eb="[object ArrayBuffer]",Bb="[object DataView]",Pb="[object Float32Array]",Ib="[object Float64Array]",Sb="[object Int8Array]",Ab="[object Int16Array]",Cb="[object Int32Array]",kb="[object Uint8Array]",Rb="[object Uint8ClampedArray]",Ob="[object Uint16Array]",Mb="[object Uint32Array]",Le={};Le[Pb]=Le[Ib]=Le[Sb]=Le[Ab]=Le[Cb]=Le[kb]=Le[Rb]=Le[Ob]=Le[Mb]=!0;Le[fb]=Le[db]=Le[Eb]=Le[pb]=Le[Bb]=Le[gb]=Le[yb]=Le[hb]=Le[mb]=Le[vb]=Le[Tb]=Le[bb]=Le[_b]=Le[xb]=Le[wb]=!1;function vd(t){return Kn(t)&&Bo(t.length)&&!!Le[Yn(t)]}d(vd,"baseIsTypedArray");var Db=vd;function Td(t){return function(e){return t(e)}}d(Td,"baseUnary");var Nb=Td,bd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Er=bd&&typeof module=="object"&&module&&!module.nodeType&&module,Hb=Er&&Er.exports===bd,Ja=Hb&&Zf.process,Ub=function(){try{var t=Er&&Er.require&&Er.require("util").types;return t||Ja&&Ja.binding&&Ja.binding("util")}catch{}}(),Dc=Ub,Nc=Dc&&Dc.isTypedArray,jb=Nc?Nb(Nc):Db,_d=jb,$b=Object.prototype,Zb=$b.hasOwnProperty;function xd(t,e){var n=Lt(t),r=!n&&yd(t),a=!n&&!r&&ro(t),s=!n&&!r&&!a&&_d(t),i=n||r||a||s,o=i?nb(t.length,String):[],l=o.length;for(var f in t)(e||Zb.call(t,f))&&!(i&&(f=="length"||a&&(f=="offset"||f=="parent")||s&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||ad(f,l)))&&o.push(f);return o}d(xd,"arrayLikeKeys");var Lb=xd;function wd(t,e){return function(n){return t(e(n))}}d(wd,"overArg");var Fb=wd,Kb=Fb(Object.keys,Object),qb=Kb,zb=Object.prototype,Gb=zb.hasOwnProperty;function Ed(t){if(!tb(t))return qb(t);var e=[];for(var n in Object(t))Gb.call(t,n)&&n!="constructor"&&e.push(n);return e}d(Ed,"baseKeys");var Vb=Ed;function Bd(t){return QT(t)?Lb(t):Vb(t)}d(Bd,"keys");var Po=Bd,Wb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Jb=/^\w*$/;function Pd(t,e){if(Lt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||xo(t)?!0:Jb.test(t)||!Wb.test(t)||e!=null&&t in Object(e)}d(Pd,"isKey");var Io=Pd,Yb=bn(Object,"create"),Ir=Yb;function Id(){this.__data__=Ir?Ir(null):{},this.size=0}d(Id,"hashClear");var Xb=Id;function Sd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}d(Sd,"hashDelete");var Qb=Sd,e_="__lodash_hash_undefined__",t_=Object.prototype,n_=t_.hasOwnProperty;function Ad(t){var e=this.__data__;if(Ir){var n=e[t];return n===e_?void 0:n}return n_.call(e,t)?e[t]:void 0}d(Ad,"hashGet");var r_=Ad,i_=Object.prototype,a_=i_.hasOwnProperty;function Cd(t){var e=this.__data__;return Ir?e[t]!==void 0:a_.call(e,t)}d(Cd,"hashHas");var o_=Cd,s_="__lodash_hash_undefined__";function kd(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ir&&e===void 0?s_:e,this}d(kd,"hashSet");var l_=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=Xb;_n.prototype.delete=Qb;_n.prototype.get=r_;_n.prototype.has=o_;_n.prototype.set=l_;var Hc=_n;function Rd(){this.__data__=[],this.size=0}d(Rd,"listCacheClear");var u_=Rd;function Od(t,e){for(var n=t.length;n--;)if(ld(t[n][0],e))return n;return-1}d(Od,"assocIndexOf");var ea=Od,c_=Array.prototype,f_=c_.splice;function Md(t){var e=this.__data__,n=ea(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():f_.call(e,n,1),--this.size,!0}d(Md,"listCacheDelete");var d_=Md;function Dd(t){var e=this.__data__,n=ea(e,t);return n<0?void 0:e[n][1]}d(Dd,"listCacheGet");var p_=Dd;function Nd(t){return ea(this.__data__,t)>-1}d(Nd,"listCacheHas");var g_=Nd;function Hd(t,e){var n=this.__data__,r=ea(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}d(Hd,"listCacheSet");var y_=Hd;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=u_;xn.prototype.delete=d_;xn.prototype.get=p_;xn.prototype.has=g_;xn.prototype.set=y_;var ta=xn,h_=bn(Ft,"Map"),Sr=h_;function Ud(){this.size=0,this.__data__={hash:new Hc,map:new(Sr||ta),string:new Hc}}d(Ud,"mapCacheClear");var m_=Ud;function jd(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}d(jd,"isKeyable");var v_=jd;function $d(t,e){var n=t.__data__;return v_(e)?n[typeof e=="string"?"string":"hash"]:n.map}d($d,"getMapData");var na=$d;function Zd(t){var e=na(this,t).delete(t);return this.size-=e?1:0,e}d(Zd,"mapCacheDelete");var T_=Zd;function Ld(t){return na(this,t).get(t)}d(Ld,"mapCacheGet");var b_=Ld;function Fd(t){return na(this,t).has(t)}d(Fd,"mapCacheHas");var __=Fd;function Kd(t,e){var n=na(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}d(Kd,"mapCacheSet");var x_=Kd;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=m_;wn.prototype.delete=T_;wn.prototype.get=b_;wn.prototype.has=__;wn.prototype.set=x_;var ra=wn,w_="Expected a function";function ia(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(w_);var n=d(function(){var r=arguments,a=e?e.apply(this,r):r[0],s=n.cache;if(s.has(a))return s.get(a);var i=t.apply(this,r);return n.cache=s.set(a,i)||s,i},"memoized");return n.cache=new(ia.Cache||ra),n}d(ia,"memoize");ia.Cache=ra;var E_=ia,B_=500;function qd(t){var e=E_(t,function(r){return n.size===B_&&n.clear(),r}),n=e.cache;return e}d(qd,"memoizeCapped");var P_=qd,I_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S_=/\\(\\)?/g,A_=P_(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(I_,function(n,r,a,s){e.push(a?s.replace(S_,"$1"):r||n)}),e}),C_=A_;function zd(t){return t==null?"":ST(t)}d(zd,"toString");var k_=zd;function Gd(t,e){return Lt(t)?t:Io(t,e)?[t]:C_(k_(t))}d(Gd,"castPath");var Vd=Gd,R_=1/0;function Wd(t){if(typeof t=="string"||xo(t))return t;var e=t+"";return e=="0"&&1/t==-R_?"-0":e}d(Wd,"toKey");var aa=Wd;function Jd(t,e){e=Vd(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[aa(e[n++])];return n&&n==r?t:void 0}d(Jd,"baseGet");var Yd=Jd;function Xd(t,e,n){var r=t==null?void 0:Yd(t,e);return r===void 0?n:r}d(Xd,"get");var O_=Xd;function Qd(t,e){for(var n=-1,r=e.length,a=t.length;++n<r;)t[a+n]=e[n];return t}d(Qd,"arrayPush");var M_=Qd;function ep(){this.__data__=new ta,this.size=0}d(ep,"stackClear");var D_=ep;function tp(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}d(tp,"stackDelete");var N_=tp;function np(t){return this.__data__.get(t)}d(np,"stackGet");var H_=np;function rp(t){return this.__data__.has(t)}d(rp,"stackHas");var U_=rp,j_=200;function ip(t,e){var n=this.__data__;if(n instanceof ta){var r=n.__data__;if(!Sr||r.length<j_-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ra(r)}return n.set(t,e),this.size=n.size,this}d(ip,"stackSet");var $_=ip;function En(t){var e=this.__data__=new ta(t);this.size=e.size}d(En,"Stack");En.prototype.clear=D_;En.prototype.delete=N_;En.prototype.get=H_;En.prototype.has=U_;En.prototype.set=$_;var si=En;function ap(t,e){for(var n=-1,r=t==null?0:t.length,a=0,s=[];++n<r;){var i=t[n];e(i,n,t)&&(s[a++]=i)}return s}d(ap,"arrayFilter");var Z_=ap;function op(){return[]}d(op,"stubArray");var L_=op,F_=Object.prototype,K_=F_.propertyIsEnumerable,Uc=Object.getOwnPropertySymbols,q_=Uc?function(t){return t==null?[]:(t=Object(t),Z_(Uc(t),function(e){return K_.call(t,e)}))}:L_,z_=q_;function sp(t,e,n){var r=e(t);return Lt(t)?r:M_(r,n(t))}d(sp,"baseGetAllKeys");var G_=sp;function lp(t){return G_(t,Po,z_)}d(lp,"getAllKeys");var jc=lp,V_=bn(Ft,"DataView"),io=V_,W_=bn(Ft,"Promise"),ao=W_,J_=bn(Ft,"Set"),oo=J_,$c="[object Map]",Y_="[object Object]",Zc="[object Promise]",Lc="[object Set]",Fc="[object WeakMap]",Kc="[object DataView]",X_=Tn(io),Q_=Tn(Sr),ex=Tn(ao),tx=Tn(oo),nx=Tn(no),pn=Yn;(io&&pn(new io(new ArrayBuffer(1)))!=Kc||Sr&&pn(new Sr)!=$c||ao&&pn(ao.resolve())!=Zc||oo&&pn(new oo)!=Lc||no&&pn(new no)!=Fc)&&(pn=d(function(t){var e=Yn(t),n=e==Y_?t.constructor:void 0,r=n?Tn(n):"";if(r)switch(r){case X_:return Kc;case Q_:return $c;case ex:return Zc;case tx:return Lc;case nx:return Fc}return e},"getTag"));var qc=pn,rx=Ft.Uint8Array,zc=rx,ix="__lodash_hash_undefined__";function up(t){return this.__data__.set(t,ix),this}d(up,"setCacheAdd");var ax=up;function cp(t){return this.__data__.has(t)}d(cp,"setCacheHas");var ox=cp;function Ar(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new ra;++e<n;)this.add(t[e])}d(Ar,"SetCache");Ar.prototype.add=Ar.prototype.push=ax;Ar.prototype.has=ox;var sx=Ar;function fp(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}d(fp,"arraySome");var lx=fp;function dp(t,e){return t.has(e)}d(dp,"cacheHas");var ux=dp,cx=1,fx=2;function pp(t,e,n,r,a,s){var i=n&cx,o=t.length,l=e.length;if(o!=l&&!(i&&l>o))return!1;var f=s.get(t),g=s.get(e);if(f&&g)return f==e&&g==t;var y=-1,p=!0,h=n&fx?new sx:void 0;for(s.set(t,e),s.set(e,t);++y<o;){var _=t[y],E=e[y];if(r)var B=i?r(E,_,y,e,t,s):r(_,E,y,t,e,s);if(B!==void 0){if(B)continue;p=!1;break}if(h){if(!lx(e,function(v,I){if(!ux(h,I)&&(_===v||a(_,v,n,r,s)))return h.push(I)})){p=!1;break}}else if(!(_===E||a(_,E,n,r,s))){p=!1;break}}return s.delete(t),s.delete(e),p}d(pp,"equalArrays");var gp=pp;function yp(t){var e=-1,n=Array(t.size);return t.forEach(function(r,a){n[++e]=[a,r]}),n}d(yp,"mapToArray");var dx=yp;function hp(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}d(hp,"setToArray");var px=hp,gx=1,yx=2,hx="[object Boolean]",mx="[object Date]",vx="[object Error]",Tx="[object Map]",bx="[object Number]",_x="[object RegExp]",xx="[object Set]",wx="[object String]",Ex="[object Symbol]",Bx="[object ArrayBuffer]",Px="[object DataView]",Gc=nn?nn.prototype:void 0,Ya=Gc?Gc.valueOf:void 0;function mp(t,e,n,r,a,s,i){switch(n){case Px:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Bx:return!(t.byteLength!=e.byteLength||!s(new zc(t),new zc(e)));case hx:case mx:case bx:return ld(+t,+e);case vx:return t.name==e.name&&t.message==e.message;case _x:case wx:return t==e+"";case Tx:var o=dx;case xx:var l=r&gx;if(o||(o=px),t.size!=e.size&&!l)return!1;var f=i.get(t);if(f)return f==e;r|=yx,i.set(t,e);var g=gp(o(t),o(e),r,a,s,i);return i.delete(t),g;case Ex:if(Ya)return Ya.call(t)==Ya.call(e)}return!1}d(mp,"equalByTag");var Ix=mp,Sx=1,Ax=Object.prototype,Cx=Ax.hasOwnProperty;function vp(t,e,n,r,a,s){var i=n&Sx,o=jc(t),l=o.length,f=jc(e),g=f.length;if(l!=g&&!i)return!1;for(var y=l;y--;){var p=o[y];if(!(i?p in e:Cx.call(e,p)))return!1}var h=s.get(t),_=s.get(e);if(h&&_)return h==e&&_==t;var E=!0;s.set(t,e),s.set(e,t);for(var B=i;++y<l;){p=o[y];var v=t[p],I=e[p];if(r)var P=i?r(I,v,p,e,t,s):r(v,I,p,t,e,s);if(!(P===void 0?v===I||a(v,I,n,r,s):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 s.delete(t),s.delete(e),E}d(vp,"equalObjects");var kx=vp,Rx=1,Vc="[object Arguments]",Wc="[object Array]",ai="[object Object]",Ox=Object.prototype,Jc=Ox.hasOwnProperty;function Tp(t,e,n,r,a,s){var i=Lt(t),o=Lt(e),l=i?Wc:qc(t),f=o?Wc:qc(e);l=l==Vc?ai:l,f=f==Vc?ai:f;var g=l==ai,y=f==ai,p=l==f;if(p&&ro(t)){if(!ro(e))return!1;i=!0,g=!1}if(p&&!g)return s||(s=new si),i||_d(t)?gp(t,e,n,r,a,s):Ix(t,e,l,n,r,a,s);if(!(n&Rx)){var h=g&&Jc.call(t,"__wrapped__"),_=y&&Jc.call(e,"__wrapped__");if(h||_){var E=h?t.value():t,B=_?e.value():e;return s||(s=new si),a(E,B,n,r,s)}}return p?(s||(s=new si),kx(t,e,n,r,a,s)):!1}d(Tp,"baseIsEqualDeep");var Mx=Tp;function So(t,e,n,r,a){return t===e?!0:t==null||e==null||!Kn(t)&&!Kn(e)?t!==t&&e!==e:Mx(t,e,n,r,So,a)}d(So,"baseIsEqual");var Ao=So,Dx=1,Nx=2;function bp(t,e,n,r){var a=n.length,s=a,i=!r;if(t==null)return!s;for(t=Object(t);a--;){var o=n[a];if(i&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++a<s;){o=n[a];var l=o[0],f=t[l],g=o[1];if(i&&o[2]){if(f===void 0&&!(l in t))return!1}else{var y=new si;if(r)var p=r(f,g,l,t,e,y);if(!(p===void 0?Ao(g,f,Dx|Nx,r,y):p))return!1}}return!0}d(bp,"baseIsMatch");var Hx=bp;function _p(t){return t===t&&!Eo(t)}d(_p,"isStrictComparable");var xp=_p;function wp(t){for(var e=Po(t),n=e.length;n--;){var r=e[n],a=t[r];e[n]=[r,a,xp(a)]}return e}d(wp,"getMatchData");var Ux=wp;function Ep(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}d(Ep,"matchesStrictComparable");var Bp=Ep;function Pp(t){var e=Ux(t);return e.length==1&&e[0][2]?Bp(e[0][0],e[0][1]):function(n){return n===t||Hx(n,t,e)}}d(Pp,"baseMatches");var jx=Pp;function Ip(t,e){return t!=null&&e in Object(t)}d(Ip,"baseHasIn");var $x=Ip;function Sp(t,e,n){e=Vd(e,t);for(var r=-1,a=e.length,s=!1;++r<a;){var i=aa(e[r]);if(!(s=t!=null&&n(t,i)))break;t=t[i]}return s||++r!=a?s:(a=t==null?0:t.length,!!a&&Bo(a)&&ad(i,a)&&(Lt(t)||yd(t)))}d(Sp,"hasPath");var Zx=Sp;function Ap(t,e){return t!=null&&Zx(t,e,$x)}d(Ap,"hasIn");var Lx=Ap,Fx=1,Kx=2;function Cp(t,e){return Io(t)&&xp(e)?Bp(aa(t),e):function(n){var r=O_(n,t);return r===void 0&&r===e?Lx(n,t):Ao(e,r,Fx|Kx)}}d(Cp,"baseMatchesProperty");var qx=Cp;function kp(t){return function(e){return e?.[t]}}d(kp,"baseProperty");var zx=kp;function Rp(t){return function(e){return Yd(e,t)}}d(Rp,"basePropertyDeep");var Gx=Rp;function Op(t){return Io(t)?zx(aa(t)):Gx(t)}d(Op,"property");var Vx=Op;function Mp(t){return typeof t=="function"?t:t==null?AT:typeof t=="object"?Lt(t)?qx(t[0],t[1]):jx(t):Vx(t)}d(Mp,"baseIteratee");var Wx=Mp;function Dp(t){return function(e,n,r){for(var a=-1,s=Object(e),i=r(e),o=i.length;o--;){var l=i[t?o:++a];if(n(s[l],l,s)===!1)break}return e}}d(Dp,"createBaseFor");var Jx=Dp,Yx=Jx(),Xx=Yx;function Np(t,e){return t&&Xx(t,e,Po)}d(Np,"baseForOwn");var Qx=Np;function Hp(t,e){return Ao(t,e)}d(Hp,"isEqual");var hn=Hp;function Up(t,e){var n={};return e=Wx(e,3),Qx(t,function(r,a,s){YT(n,a,e(r,a,s))}),n}d(Up,"mapValues");var ew=Up;function Co(t){return Xe(t)}d(Co,"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=ew(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 s=n.options.map(Xe),i=jt(n.discriminator);return`${pe(n.description)}z.discriminatedUnion(${i}, [${s.join(", ")}])`.trim();case z.ZodFirstPartyTypeKind.ZodIntersection:let o=Xe(n.left),l=Xe(n.right);return`${pe(n.description)}z.intersection(${o}, ${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),h=Xe(n.valueType);return`${pe(n.description)}z.map(${p}, ${h})`.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=mf(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 jp=class{constructor(e,n,r,a){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};d(jp,"ParseInputLazyPath");var Bt=jp,Yc=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"),$p=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(Ti(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)},s=this._parseSync({data:e,path:a.path,parent:a});return Yc(a,s)}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}),s=await(Ti(a)?a:Promise.resolve(a));return Yc(r,s)}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,s)=>{let i=e(a),o=d(()=>s.addIssue(w({code:G.custom},r(a))),"setError");return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(o(),!1)):i?!0:(o(),!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 qn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Rr.create(this,this._def)}promise(){return la.create(this,this._def)}or(e){return zo.create([this,e],this._def)}and(e){return Uo.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 oa(H(w({},ge(this._def)),{innerType:this,defaultValue:n,typeName:"ZodDefault"}))}brand(){return new Mo(w({typeName:"ZodBranded",type:this},ge(this._def)))}catch(e){let n=typeof e=="function"?e:()=>e;return new Do(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 Ko.create(this,e)}readonly(){return ua.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 Jo(this,e)}toTypescript(e){return hi(this,e)}toTypescriptSchema(){return Co(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 Or(e,n)}static fromJsonSchema(e){return ca(e)}};d($p,"ZodType");var ye=$p,Zp=(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))(Zp||{}),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 s={};for(let i of a)s[i]=i;return s},"arrayToEnum"),t.getValidEnumValues=d(a=>{let s=(0,t.objectKeys)(a).filter(o=>typeof a[a[o]]!="number"),i={};for(let o of s)i[o]=a[o];return(0,t.objectValues)(i)},"getValidEnumValues"),t.objectValues=d(a=>(0,t.objectKeys)(a).map(function(s){return a[s]}),"objectValues"),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let i in a)Object.prototype.hasOwnProperty.call(a,i)&&s.push(i);return s},t.find=d((a,s)=>{for(let i of a)if(s(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,s=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,d(r,"joinValues"),t.jsonStringifyReplacer=d((a,s)=>typeof s=="bigint"?s.toString():s,"jsonStringifyReplacer"),t.compareFunctions=d((a,s)=>a.toString()===s.toString(),"compareFunctions")})(be||(be={}));var so;(t=>{t.mergeShapes=d((e,n)=>w(w({},e),n),"mergeShapes")})(so||(so={}));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,o)=>i.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:r??o.defaultError}:{message:n??o.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"),Xc=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"]),tw=d(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),mi=class Lp 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(s){return s.message},r={_errors:[]},a=d(s=>{for(let i of s.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 o=r,l=0;for(;l<i.path.length;){let f=i.path[l];l===i.path.length-1?(o[f]=o[f]||{_errors:[]},o[f]._errors.push(n(i))):o[f]=o[f]||{_errors:[]},o=o[f],l++}}},"processError");return a(this),r}static assert(e){if(!(e instanceof Lp))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(mi,"ZodError");mi.create=d(t=>new mi(t),"create");var $t=mi,Fp=ko;function Kp(t){Fp=t}d(Kp,"setErrorMap");function Cr(){return Fp}d(Cr,"getErrorMap");var vi=d(t=>{var e;let{data:n,path:r,errorMaps:a,issueData:s}=t,i=[...r,...s.path||[]],o=H(w({},s),{path:i}),l="",f=a.filter(g=>!!g).slice().reverse();for(let g of f)l=g(o,{data:n,defaultError:l}).message;return H(w({},s),{path:i,message:(e=s.message)!=null?e:l})},"makeIssue"),nw=[];function te(t,e){let n=vi({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Cr(),ko].filter(r=>!!r)});t.common.issues.push(n)}d(te,"addIssueToContext");var qp=class zp{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 zp.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let a of n){let{key:s,value:i}=a;if(s.status==="aborted"||i.status==="aborted")return de;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}};d(qp,"ParseStatus");var pt=qp,de=Object.freeze({status:"aborted"}),Fn=d(t=>({status:"dirty",value:t}),"DIRTY"),ut=d(t=>({status:"valid",value:t}),"OK"),lo=d(t=>t.status==="aborted","isAborted"),uo=d(t=>t.status==="dirty","isDirty"),kr=d(t=>t.status==="valid","isValid"),Ti=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 bi=class Gp extends ye{constructor(){super(...arguments),this._any=!0}_parse(e){return ut(e.data)}isEqual(e){return e instanceof Gp}};d(bi,"ZodAny");bi.create=d(t=>new bi(w({typeName:"ZodAny"},ge(t))),"create");var _i=bi,xi=class Un extends ye{dereference(e){return new Un(H(w({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}isEqual(e){var n,r,a,s,i,o;return e instanceof Un?hn((n=this._def.exactLength)==null?void 0:n.value,(r=e._def.exactLength)==null?void 0:r.value)&&hn((a=this._def.maxLength)==null?void 0:a.value,(s=e._def.maxLength)==null?void 0:s.value)&&hn((i=this._def.minLength)==null?void 0:i.value,(o=e._def.minLength)==null?void 0:o.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,o=n.data.length<a.exactLength.value;(i||o)&&(te(n,{code:i?G.too_big:G.too_small,minimum:o?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,o)=>a.type._parseAsync(new Bt(n,i,n.path,o)))).then(i=>pt.mergeArray(r,i));let s=[...n.data].map((i,o)=>a.type._parseSync(new Bt(n,i,n.path,o)));return pt.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new Un(H(w({},this._def),{minLength:{value:e,message:se.toString(n)}}))}max(e,n){return new Un(H(w({},this._def),{maxLength:{value:e,message:se.toString(n)}}))}length(e,n){return new Un(H(w({},this._def),{exactLength:{value:e,message:se.toString(n)}}))}nonempty(e){return this.min(1,e)}};d(xi,"ZodArray");xi.create=d((t,e)=>new xi(w({type:t,minLength:null,maxLength:null,exactLength:null,typeName:"ZodArray"},ge(e))),"create");var Rr=xi,rw={compare:hn},Vp=class{constructor(e=[],n={}){this._options=w(w({},rw),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(Vp,"CustomSet");var tt=Vp,wi=class li 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 s=this._getOrReturnCtx(e);return te(s,{code:G.invalid_type,expected:ne.bigint,received:s.parsedType}),de}let r,a=new pt;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):be.assertNever(s);return{status:a.value,value:e.data}}isEqual(e){if(!(e instanceof li)||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 li(H(w({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:se.toString(a)}]}))}_addCheck(e){return new li(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(wi,"ZodBigInt");wi.create=d(t=>{var e;return new wi(w({checks:[],typeName:"ZodBigInt",coerce:(e=t?.coerce)!=null?e:!1},ge(t)))},"create");var Ro=wi,Ei=class Wp 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 Wp?this._def.coerce===e._def.coerce:!1}};d(Ei,"ZodBoolean");Ei.create=d(t=>new Ei(w({typeName:"ZodBoolean",coerce:t?.coerce||!1},ge(t))),"create");var Oo=Ei,iw=Symbol("zod_brand"),Jp=class Yp 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 Yp?this._def.type.isEqual(e._def.type):!1}};d(Jp,"ZodBranded");var Mo=Jp,Bi=class Xp 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 Ti(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.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 Xp?this._def.innerType.isEqual(e._def.innerType)&&be.compareFunctions(this._def.catchValue,e._def.catchValue):!1}};d(Bi,"ZodCatch");Bi.create=d((t,e)=>new Bi(w({innerType:t,typeName:"ZodCatch",catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},ge(e))),"create");var Do=Bi,Qp=d((t,e={},n)=>t?_i.create().superRefine((r,a)=>{var s,i;if(!t(r)){let o=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(i=(s=o.fatal)!=null?s:n)!=null?i:!0,f=typeof o=="string"?{message:o}:o;a.addIssue(H(w({code:"custom"},f),{fatal:l}))}}):_i.create(),"custom"),Pi=class co extends ye{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ne.date){let s=this._getOrReturnCtx(e);return te(s,{code:G.invalid_type,expected:ne.date,received:s.parsedType}),de}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return te(s,{code:G.invalid_date}),de}let r=new pt,a;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),te(a,{code:G.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),te(a,{code:G.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):be.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new co(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 co))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(Pi,"ZodDate");Pi.create=d(t=>new Pi(w({checks:[],coerce:t?.coerce||!1,typeName:"ZodDate"},ge(t))),"create");var No=Pi,Ii=class fo 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 fo(H(w({},this._def),{innerType:this._def.innerType.dereference(e)}))}isEqual(e){return e instanceof fo?this._def.innerType.isEqual(e._def.innerType)&&hn(this._def.defaultValue(),e._def.defaultValue()):!1}};d(Ii,"ZodDefault");Ii.create=d((t,e,n)=>new Ii(w({innerType:t,typeName:"ZodDefault",defaultValue:typeof e=="function"?e:()=>e},ge(n))),"create");var oa=Ii,Kt=d(t=>Array.from(new Set(t)),"unique"),Ut=d(t=>t instanceof jo?Ut(t.schema):t instanceof vn?Ut(t.innerType()):t instanceof $o?[t.value]:t instanceof Xn?t.options:t instanceof Zo?be.objectValues(t.enum):t instanceof oa?Ut(t._def.innerType):t instanceof qo?[void 0]:t instanceof Lo?[null]:t instanceof tn?[void 0,...Ut(t.unwrap())]:t instanceof qn?[null,...Ut(t.unwrap())]:t instanceof Mo||t instanceof ua?Ut(t.unwrap()):t instanceof Do?Ut(t._def.innerType):[],"getDiscriminator"),eg=class jn extends ye{dereference(e){let n=this.options.map(a=>a.dereference(e)),r=jn._getOptionsMap(this.discriminator,n);return new jn(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],s=this.optionsMap.get(a);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._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=jn._getOptionsMap(e,n);return new jn(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 s=Ut(a.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of s){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 jn)||this._def.discriminator!==e._def.discriminator)return!1;let n=d((s,i)=>s.isEqual(i),"compare"),r=new tt(this._def.options,{compare:n}),a=new tt(e._def.options,{compare:n});return r.isEqual(a)}};d(eg,"ZodDiscriminatedUnion");var tg=eg;function sa(t,e){return new Xn(w({values:t,typeName:"ZodEnum"},ge(e)))}d(sa,"createZodEnum");var Ho=class ui 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 ui.create(e,w(w({},this._def),n))}exclude(e,n=this._def){return ui.create(this.options.filter(r=>!e.includes(r)),w(w({},this._def),n))}isEqual(e){if(!(e instanceof ui))return!1;let n=new tt(this._def.values),r=new tt(e._def.values);return n.isEqual(r)}};d(Ho,"ZodEnum");Ho.create=sa;var Xn=Ho,ng=class $n 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 $n(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(o,l){return vi({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Cr(),Xc].filter(f=>!!f),issueData:{code:G.invalid_arguments,argumentsError:l}})}d(r,"makeArgsIssue");function a(o,l){return vi({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Cr(),Xc].filter(f=>!!f),issueData:{code:G.invalid_return_type,returnTypeError:l}})}d(a,"makeReturnsIssue");let s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof la){let o=this;return ut(async function(...l){let f=new $t([]),g=await o._def.args.parseAsync(l,s).catch(h=>{throw f.addIssue(r(l,h)),f}),y=await Reflect.apply(i,this,g);return await o._def.returns._def.type.parseAsync(y,s).catch(h=>{throw f.addIssue(a(y,h)),f})})}else{let o=this;return ut(function(...l){let f=o._def.args.safeParse(l,s);if(!f.success)throw new $t([r(l,f.error)]);let g=Reflect.apply(i,this,f.data),y=o._def.returns.safeParse(g,s);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 $n(H(w({},this._def),{args:Vn.create(e).rest(Br.create())}))}returns(e){return new $n(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 $n(w({args:e||Vn.create([]).rest(Br.create()),returns:n||Br.create(),typeName:"ZodFunction"},ge(r)))}isEqual(e){return e instanceof $n&&this._def.args.isEqual(e._def.args)&&this._def.returns.isEqual(e._def.returns)}};d(ng,"ZodFunction");var rg=ng;function Si(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),s=be.objectKeys(t).filter(o=>a.indexOf(o)!==-1),i=w(w({},t),e);for(let o of s){let l=Si(t[o],e[o]);if(!l.valid)return{valid:!1};i[o]=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 s=0;s<t.length;s++){let i=t[s],o=e[s],l=Si(i,o);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(Si,"mergeValues");var Ai=class po extends ye{dereference(e){return new po(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((s,i)=>{if(lo(s)||lo(i))return de;let o=Si(s.value,i.value);return o.valid?((uo(s)||uo(i))&&n.dirty(),{status:n.value,value:o.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(([s,i])=>a(s,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 po))return!1;let n=d((s,i)=>s.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(Ai,"ZodIntersection");Ai.create=d((t,e,n)=>new Ai(w({left:t,right:e,typeName:"ZodIntersection"},ge(n))),"create");var Uo=Ai,Ci=class ig 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 ig?this._def.getter().isEqual(e._def.getter()):!1}};d(Ci,"ZodLazy");Ci.create=d((t,e)=>new Ci(w({getter:t,typeName:"ZodLazy"},ge(e))),"create");var jo=Ci,ki=class ag 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 ag?hn(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 $o=ki,Ri=class go 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 go(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,s=this._def.valueType,i=[...r.data.entries()].map(([o,l],f)=>({key:a._parse(new Bt(r,o,r.path,[f,"key"])),value:s._parse(new Bt(r,l,r.path,[f,"value"]))}));if(r.common.async){let o=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(),o.set(f.value,g.value)}return{status:n.value,value:o}})}else{let o=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(),o.set(f.value,g.value)}return{status:n.value,value:o}}}isEqual(e){return!(!(e instanceof go)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};d(Ri,"ZodMap");Ri.create=d((t,e,n)=>new Ri(w({valueType:e,keyType:t,typeName:"ZodMap"},ge(n))),"create");var og=Ri,Oi=class sg 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 sg}};d(Oi,"ZodNaN");Oi.create=d(t=>new Oi(w({typeName:"ZodNaN"},ge(t))),"create");var lg=Oi,Mi=class ug 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 ug?hn(this._def.values,e._def.values):!1}};d(Mi,"ZodNativeEnum");Mi.create=d((t,e)=>new Mi(w({values:t,typeName:"ZodNativeEnum"},ge(e))),"create");var Zo=Mi,Di=class cg 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 cg}};d(Di,"ZodNever");Di.create=d(t=>new Di(w({typeName:"ZodNever"},ge(t))),"create");var mn=Di,Ni=class fg 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 fg}};d(Ni,"ZodNull");Ni.create=d(t=>new Ni(w({typeName:"ZodNull"},ge(t))),"create");var Lo=Ni,Hi=class yo extends ye{dereference(e){return new yo(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 yo?this._def.innerType.isEqual(e._def.innerType):!1}};d(Hi,"ZodNullable");Hi.create=d((t,e)=>new Hi(w({innerType:t,typeName:"ZodNullable"},ge(e))),"create");var qn=Hi;function dg(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=n>r?n:r,s=parseInt(t.toFixed(a).replace(".","")),i=parseInt(e.toFixed(a).replace(".",""));return s%i/Math.pow(10,a)}d(dg,"floatSafeRemainder");var Ui=class ci 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 s=this._getOrReturnCtx(e);return te(s,{code:G.invalid_type,expected:ne.number,received:s.parsedType}),de}let r,a=new pt;for(let s of this._def.checks)s.kind==="int"?be.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),te(r,{code:G.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?dg(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),te(r,{code:G.not_finite,message:s.message}),a.dirty()):be.assertNever(s);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 ci(H(w({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:se.toString(a)}]}))}_addCheck(e){return new ci(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 ci))return!1;let n=new tt(this._def.checks),r=new tt(e._def.checks);return n.isEqual(r)}};d(Ui,"ZodNumber");Ui.create=d(t=>new Ui(w({checks:[],typeName:"ZodNumber",coerce:t?.coerce||!1},ge(t))),"create");var Fo=Ui;function yn(t){if(t instanceof zn){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=tn.create(yn(r))}return new zn(H(w({},t._def),{shape:d(()=>e,"shape")}))}else return t instanceof Rr?new Rr(H(w({},t._def),{type:yn(t.element)})):t instanceof tn?tn.create(yn(t.unwrap())):t instanceof qn?qn.create(yn(t.unwrap())):t instanceof Vn?Vn.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:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof mn&&this._def.unknownKeys==="strip"))for(let f in a.data)i.includes(f)||o.push(f);let l=[];for(let f of i){let g=s[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 mn){let f=this._def.unknownKeys;if(f==="passthrough")for(let g of o)l.push({key:{status:"valid",value:g},value:{status:"valid",value:a.data[g]}});else if(f==="strict")o.length>0&&(te(a,{code:G.unrecognized_keys,keys:o}),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 o){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,s,i,o;let l=(i=(s=(a=this._def).errorMap)==null?void 0:s.call(a,n,r).message)!=null?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(o=se.errToObj(e).message)!=null?o: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 s=this.shape[r];for(;s instanceof tn;)s=s._def.innerType;n[r]=s}}),new vt(H(w({},this._def),{shape:d(()=>n,"shape")}))}keyof(){return sa(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((o,l)=>o[0]===l[0]&&o[1].isEqual(l[1]),"compare"),s=new tt(Object.entries(n),{compare:a}),i=new tt(Object.entries(r),{compare:a});return s.isEqual(i)}};d(rn,"ZodObject");rn.create=d((t,e)=>new rn(w({shape:d(()=>t,"shape"),unknownKeys:"strip",catchall:mn.create(),typeName:"ZodObject"},ge(e))),"create");rn.strictCreate=d((t,e)=>new rn(w({shape:d(()=>t,"shape"),unknownKeys:"strict",catchall:mn.create(),typeName:"ZodObject"},ge(e))),"strictCreate");rn.lazycreate=d((t,e)=>new rn(w({shape:t,unknownKeys:"strip",catchall:mn.create(),typeName:"ZodObject"},ge(e))),"lazycreate");var zn=rn,ji=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(ji,"ZodOptional");ji.create=d((t,e)=>new ji(w({innerType:t,typeName:"ZodOptional"},ge(e))),"create");var tn=ji,pg=class fi extends ye{dereference(e){return new fi(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 s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?de:s.status==="dirty"?(n.dirty(),Fn(s.value)):this._def.out._parseAsync({data:s.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 fi({in:e,out:n,typeName:"ZodPipeline"})}isEqual(e){return!(!(e instanceof fi)||!this._def.in.isEqual(e._def.in)||!this._def.out.isEqual(e._def.out))}};d(pg,"ZodPipeline");var Ko=pg,$i=class mo extends ye{unwrap(){return this._def.type}dereference(e){return new mo(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 mo?this._def.type.isEqual(e._def.type):!1}};d($i,"ZodPromise");$i.create=d((t,e)=>new $i(w({type:t,typeName:"ZodPromise"},ge(e))),"create");var la=$i,Zi=class vo extends ye{dereference(e){return new vo(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 vo?this._def.innerType.isEqual(e._def.innerType):!1}};d(Zi,"ZodReadonly");Zi.create=d((t,e)=>new Zi(w({innerType:t,typeName:"ZodReadonly"},ge(e))),"create");var ua=Zi,gg=class br 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 br(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=[],s=this._def.keyType,i=this._def.valueType;for(let o in r.data)a.push({key:s._parse(new Bt(r,o,r.path,o)),value:i._parse(new Bt(r,r.data[o],r.path,o))});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 br(w({keyType:e,valueType:n,typeName:"ZodRecord"},ge(r))):new br(w({keyType:ct.create(),valueType:e,typeName:"ZodRecord"},ge(n)))}isEqual(e){return!(!(e instanceof br)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};d(gg,"ZodRecord");var yg=gg,Li=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(Li,"ZodRef");Li.create=d(t=>new Li({typeName:"ZodRef",uri:t}),"create");var mg=Li,Fi=class _r extends ye{dereference(e){return new _r(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 s=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 o=[...r.data.values()].map((l,f)=>s._parse(new Bt(r,l,r.path,f)));return r.common.async?Promise.all(o).then(l=>i(l)):i(o)}min(e,n){return new _r(H(w({},this._def),{minSize:{value:e,message:se.toString(n)}}))}max(e,n){return new _r(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,s;if(!(e instanceof _r))return!1;let i=(n=this._def.minSize)==null?void 0:n.value,o=(r=e._def.minSize)==null?void 0:r.value;if(i!==o)return!1;let l=(a=this._def.maxSize)==null?void 0:a.value,f=(s=e._def.maxSize)==null?void 0:s.value;return l!==f?!1:this._def.valueType.isEqual(e._def.valueType)}};d(Fi,"ZodSet");Fi.create=d((t,e)=>new Fi(w({valueType:t,minSize:null,maxSize:null,typeName:"ZodSet"},ge(e))),"create");var vg=Fi,Tg=/^c[^\s-]{8,}$/i,bg=/^[a-z][a-z0-9]*$/,_g=/^[0-9A-HJKMNP-TV-Z]{26}$/,xg=/^[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,wg=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Eg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",aw=d(t=>t===Eg,"isEmojiRegex"),Xa,Bg=/^(((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}))$/,Pg=/^(([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})))$/,Ig=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 Sg(t,e){return!!((e==="v4"||!e)&&Bg.test(t)||(e==="v6"||!e)&&Pg.test(t))}d(Sg,"isValidIP");var Ki=class Zn extends ye{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ne.string){let s=this._getOrReturnCtx(e);return te(s,{code:G.invalid_type,expected:ne.string,received:s.parsedType}),de}let r=new pt,a;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),te(a,{code:G.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),te(a,{code:G.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(a=this._getOrReturnCtx(e,a),i?te(a,{code:G.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&te(a,{code:G.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")wg.test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"email",code:G.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Xa||(Xa=new RegExp(Eg,"u")),Xa.test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"emoji",code:G.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")xg.test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"uuid",code:G.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")Tg.test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"cuid",code:G.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")bg.test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"cuid2",code:G.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")_g.test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"ulid",code:G.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),te(a,{validation:"url",code:G.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"regex",code:G.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),te(a,{code:G.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),te(a,{code:G.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),te(a,{code:G.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Ig(s).test(e.data)||(a=this._getOrReturnCtx(e,a),te(a,{code:G.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="ip"?Sg(e.data,s.version)||(a=this._getOrReturnCtx(e,a),te(a,{validation:"ip",code:G.invalid_string,message:s.message}),r.dirty()):be.assertNever(s);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 Zn(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 Zn(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 Zn(H(w({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new Zn(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 Zn))return!1;let n=new tt(this._def.checks),r=new tt(e._def.checks);return n.isEqual(r)}};d(Ki,"ZodString");Ki.create=d(t=>{var e;return new Ki(w({checks:[],typeName:"ZodString",coerce:(e=t?.coerce)!=null?e:!1},ge(t)))},"create");var ct=Ki,qi=class Ag 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 Ag}};d(qi,"ZodSymbol");qi.create=d(t=>new qi(w({typeName:"ZodSymbol"},ge(t))),"create");var Cg=qi,Gn=class To 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 To(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,s={addIssue:d(i=>{te(r,i),i.fatal?n.abort():n.dirty()},"addIssue"),get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){let i=a.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async o=>{if(n.value==="aborted")return de;let l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?de:l.status==="dirty"||n.value==="dirty"?Fn(l.value):l});{if(n.value==="aborted")return de;let o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?de:o.status==="dirty"||n.value==="dirty"?Fn(o.value):o}}if(a.type==="refinement"){let i=d(o=>{let l=a.refinement(o,s);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 o},"executeRefinement");if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?de:(o.status==="dirty"&&n.dirty(),i(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?de:(o.status==="dirty"&&n.dirty(),i(o.value).then(()=>({status:n.value,value:o.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 o=a.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>kr(i)?Promise.resolve(a.transform(i.value,s)).then(o=>({status:n.value,value:o})):i);be.assertNever(a)}isEqual(e){return!(e instanceof To)||!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(Gn,"ZodEffects");Gn.create=d((t,e,n)=>new Gn(w({schema:t,typeName:"ZodEffects",effect:e},ge(n))),"create");Gn.createWithPreprocess=d((t,e,n)=>new Gn(w({schema:e,effect:{type:"preprocess",transform:t},typeName:"ZodEffects"},ge(n))),"createWithPreprocess");var vn=Gn,zi=class di 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 di(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 s=[...r.data].map((i,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new Bt(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>pt.mergeArray(n,i)):pt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new di(H(w({},this._def),{rest:e}))}isEqual(e){if(!(e instanceof di)||!this._restEquals(e))return!1;let n=d((s,i)=>s.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(zi,"ZodTuple");zi.create=d((t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new zi(w({items:t,typeName:"ZodTuple",rest:null},ge(e)))},"create");var Vn=zi,Gi=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(Gi,"ZodUndefined");Gi.create=d(t=>new Gi(w({typeName:"ZodUndefined"},ge(t))),"create");var qo=Gi,Vi=class bo extends ye{dereference(e){let n=this._def.options.map(r=>r.dereference(e));return new bo(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(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map(o=>new $t(o.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 s=>{let i=H(w({},n),{common:H(w({},n.common),{issues:[]}),parent:null});return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(a);{let s,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"&&!s&&(s={result:g,ctx:f}),f.common.issues.length&&i.push(f.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let o=i.map(l=>new $t(l));return te(n,{code:G.invalid_union,unionErrors:o}),de}}get options(){return this._def.options}isEqual(e){if(!(e instanceof bo))return!1;let n=d((s,i)=>s.isEqual(i),"compare"),r=new tt([...this._def.options],{compare:n}),a=new tt([...e._def.options],{compare:n});return r.isEqual(a)}};d(Vi,"ZodUnion");Vi.create=d((t,e)=>new Vi(w({options:t,typeName:"ZodUnion"},ge(e))),"create");var zo=Vi,Wi=class Rg extends ye{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ut(e.data)}isEqual(e){return e instanceof Rg}};d(Wi,"ZodUnknown");Wi.create=d(t=>new Wi(w({typeName:"ZodUnknown"},ge(t))),"create");var Br=Wi,Ji=class Og 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 Og}};d(Ji,"ZodVoid");Ji.create=d(t=>new Ji(w({typeName:"ZodVoid"},ge(t))),"create");var Mg=Ji,ow=/^\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))?$/,Or=d((t,e,n=!0)=>{if(typeof t!="object")throw new eo("Input must be an object");let r=d(i=>{let o=i;return e?.nullable&&(o=o.nullable()),e?.optional&&(o=o.optional()),e?.passtrough&&typeof o.passthrough=="function"&&(o=o.passthrough()),o},"applyOptions"),a=Object.entries(t).reduce((i,[o,l])=>{if(l===null)i[o]=r(re.null());else switch(typeof l){case"string":i[o]=ow.test(l)?r(re.string().datetime()):r(re.string());break;case"number":i[o]=r(re.number());break;case"boolean":i[o]=r(re.boolean());break;case"object":Array.isArray(l)?l.length===0?i[o]=r(re.array(re.unknown())):typeof l[0]=="object"?i[o]=r(re.array(Or(l[0],e,!1))):["string","number","boolean"].includes(typeof l[0])&&(i[o]=r(re.array(re[typeof l[0]]()))):i[o]=r(Or(l,e,!1));break;default:throw new eo(`Unsupported type for key ${o}`)}return i},{}),s=Object.keys(a).length>0;return e?.passtrough||!n&&!s?re.object(a).passthrough():re.object(a)},"objectToZui");function Dg(){return{}}d(Dg,"parseAnyDef");function Go(t,e,n,r){r?.errorMessages&&n&&(t.errorMessage=H(w({},t.errorMessage),{[e]:n}))}d(Go,"addErrorMessage");function Me(t,e,n,r,a){t[e]=n,Go(t,e,r,a)}d(Me,"setResponseValueAndErrors");function Ng(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&&Me(a,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&Me(a,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(Me(a,"minItems",t.exactLength.value,t.exactLength.message,e),Me(a,"maxItems",t.exactLength.value,t.exactLength.message,e)),a}d(Ng,"parseArrayDef");function Hg(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?Me(n,"minimum",r.value,r.message,e):Me(n,"exclusiveMinimum",r.value,r.message,e):(r.inclusive||(n.exclusiveMinimum=!0),Me(n,"minimum",r.value,r.message,e));break;case"max":e.target==="jsonSchema7"?r.inclusive?Me(n,"maximum",r.value,r.message,e):Me(n,"exclusiveMaximum",r.value,r.message,e):(r.inclusive||(n.exclusiveMaximum=!0),Me(n,"maximum",r.value,r.message,e));break;case"multipleOf":Me(n,"multipleOf",r.value,r.message,e);break}return n}d(Hg,"parseBigintDef");function Ug(t){return w({type:"boolean"},t.coerce?{[Ie]:{coerce:t.coerce||void 0}}:{})}d(Ug,"parseBooleanDef");function jg(t,e){return ke(t.type._def,e)}d(jg,"parseBrandedDef");var sw=d((t,e)=>ke(t.innerType._def,e),"parseCatchDef");function $g(t,e){return e.dateStrategy=="integer"?lw(t,e):w({type:"string",format:"date-time"},t.coerce?{[Ie]:{coerce:t.coerce||void 0}}:{})}d($g,"parseDateDef");var lw=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"&&Me(n,"minimum",r.value,r.message,e);break;case"max":e.target==="jsonSchema7"&&Me(n,"maximum",r.value,r.message,e);break}return n},"integerDateParser");function Zg(t,e){return H(w({},ke(t.innerType._def,e)),{default:t.defaultValue()})}d(Zg,"parseDefaultDef");function Lg(t,e){return e.effectStrategy==="input"?ke(t.schema._def,e):{}}d(Lg,"parseEffectsDef");function Fg(t){return{type:"string",enum:t.values}}d(Fg,"parseEnumDef");var uw=d(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"isJsonSchema7AllOfType");function Kg(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(s=>!!s),r=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,a=[];return n.forEach(s=>{if(uw(s))a.push(...s.allOf),s.unevaluatedProperties===void 0&&(r=void 0);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){let o=s,{additionalProperties:l}=o;i=af(o,["additionalProperties"])}else r=void 0;a.push(i)}}),a.length?w({allOf:a},r):void 0}d(Kg,"parseIntersectionDef");function qg(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(qg,"parseLiteralDef");var Tr={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 Vo(t,e){let n=w({type:"string"},t.coerce?{[Ie]:{coerce:t.coerce||void 0}}:{});function r(a){return e.patternStrategy==="escape"?cw(a):a}if(d(r,"processPattern"),t.checks)for(let a of t.checks)switch(a.kind){case"min":Me(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,a.value):a.value,a.message,e);break;case"max":Me(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,Tr.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,Tr.cuid,a.message,e);break;case"cuid2":Ht(n,Tr.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":Me(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,a.value):a.value,a.message,e),Me(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,Tr.emoji,a.message,e);break;case"ulid":{Ht(n,Tr.ulid,a.message,e);break}case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}d(Vo,"parseStringDef");var cw=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(s=>s.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}}))):Me(t,"format",e,n,r)},"addFormat"),Ht=d((t,e,n,r)=>{var a;t.pattern||(a=t.allOf)!=null&&a.some(s=>s.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}}))):Me(t,"pattern",e,n,r)},"addPattern");function Wo(t,e){var n,r,a,s,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 o={type:"object",additionalProperties:(r=ke(t.valueType._def,H(w({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?r:{}};if(e.target==="openApi3")return o;if(((a=t.keyType)==null?void 0:a._def.typeName)==="ZodString"&&((s=t.keyType._def.checks)!=null&&s.length)){let l=Object.entries(Vo(t.keyType._def,e)).reduce((f,[g,y])=>g==="type"?f:H(w({},f),{[g]:y}),{});return H(w({},o),{propertyNames:l})}else if(((i=t.keyType)==null?void 0:i._def.typeName)==="ZodEnum")return H(w({},o),{propertyNames:{enum:t.keyType._def.values}});return o}d(Wo,"parseRecordDef");function zg(t,e){if(e.mapStrategy==="record")return Wo(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(zg,"parseMapDef");function Gg(t){let e=t.values,r=Object.keys(t.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),a=Array.from(new Set(r.map(s=>typeof s)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:r.filter(s=>typeof s=="string"||typeof s=="number")}}d(Gg,"parseNativeEnumDef");function Vg(){return{not:{}}}d(Vg,"parseNeverDef");function Wg(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}d(Wg,"parseNullDef");var Yi={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Jg(t,e){if(e.target==="openApi3")return Qc(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in Yi&&(!r._def.checks||!r._def.checks.length))){let r=n.reduce((a,s)=>{let i=Yi[s._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,s)=>{let i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...a,i];case"bigint":return[...a,"integer"];case"object":if(s._def.value===null)return[...a,"null"];case"symbol":case"undefined":case"function":default:return a}},[]);if(r.length===n.length){let a=r.filter((s,i,o)=>o.indexOf(s)===i);return{type:a.length>1?a:a[0],enum:n.reduce((s,i)=>s.includes(i._def.value)?s:[...s,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(s=>!r.includes(s))],[])};return Qc(t,e)}d(Jg,"parseUnionDef");var Qc=d((t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((a,s)=>ke(a._def,H(w({},e),{currentPath:[...e.currentPath,e.unionStrategy,`${s}`]}))).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 Yg(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:Yi[t.innerType._def.typeName],nullable:!0}:{type:[Yi[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(Yg,"parseNullableDef");function Xg(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",Go(n,"type",r.message,e);break;case"min":e.target==="jsonSchema7"?r.inclusive?Me(n,"minimum",r.value,r.message,e):Me(n,"exclusiveMinimum",r.value,r.message,e):(r.inclusive||(n.exclusiveMinimum=!0),Me(n,"minimum",r.value,r.message,e));break;case"max":e.target==="jsonSchema7"?r.inclusive?Me(n,"maximum",r.value,r.message,e):Me(n,"exclusiveMaximum",r.value,r.message,e):(r.inclusive||(n.exclusiveMaximum=!0),Me(n,"maximum",r.value,r.message,e));break;case"multipleOf":Me(n,"multipleOf",r.value,r.message,e);break}return n}d(Xg,"parseNumberDef");function Qg(t,e){var n;let r=H(w({type:"object"},Object.entries(t.shape()).reduce((a,[s,i])=>{if(i===void 0||i._def===void 0)return a;let o=ke(i._def,H(w({},e),{currentPath:[...e.currentPath,"properties",s],propertyPath:[...e.currentPath,"properties",s]}));return o===void 0?a:{properties:H(w({},a.properties),{[s]:o}),required:i.isOptional()?a.required:[...a.required,s]}},{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(Qg,"parseObjectDef");var fw=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"),dw=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 ey(t,e){return ke(t.type._def,e)}d(ey,"parsePromiseDef");function ty(t,e){let r={type:"array",uniqueItems:!0,items:ke(t.valueType._def,H(w({},e),{currentPath:[...e.currentPath,"items"]}))};return t.minSize&&Me(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&Me(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}d(ty,"parseSetDef");function ny(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(ny,"parseTupleDef");function ry(){return{not:{}}}d(ry,"parseUndefinedDef");function iy(){return{}}d(iy,"parseUnknownDef");var pw=d((t,e)=>ke(t.innerType._def,e),"parseReadonlyDef");function ay(t){return{$ref:t.uri}}d(ay,"parseRefDef");function ke(t,e,n=!1){let r=e.seen.get(t);if(r&&!n){let i=gw(r,e);if(i!==void 0)return i}let a={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,a);let s=hw(t,t.typeName,e);return s&&mw(t,e,s),a.jsonSchema=s,s}d(ke,"parseDef");var gw=d((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:yw(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"),yw=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 Vo(t,n);case"ZodNumber":return Xg(t,n);case"ZodObject":return Qg(t,n);case"ZodBigInt":return Hg(t,n);case"ZodBoolean":return Ug(t);case"ZodDate":return $g(t,n);case"ZodUndefined":return ry();case"ZodNull":return Wg(n);case"ZodArray":return Ng(t,n);case"ZodUnion":case"ZodDiscriminatedUnion":return Jg(t,n);case"ZodIntersection":return Kg(t,n);case"ZodTuple":return ny(t,n);case"ZodRecord":return Wo(t,n);case"ZodRef":return ay(t);case"ZodLiteral":return qg(t,n);case"ZodEnum":return Fg(t);case"ZodNativeEnum":return Gg(t);case"ZodNullable":return Yg(t,n);case"ZodOptional":return fw(t,n);case"ZodMap":return zg(t,n);case"ZodSet":return ty(t,n);case"ZodLazy":return ke(t.getter()._def,n);case"ZodPromise":return ey(t,n);case"ZodNaN":case"ZodNever":return Vg();case"ZodEffects":return Lg(t,n);case"ZodAny":return Dg();case"ZodUnknown":return iy();case"ZodDefault":return Zg(t,n);case"ZodBranded":return jg(t,n);case"ZodReadonly":return pw(t,n);case"ZodCatch":return sw(t,n);case"ZodPipeline":return dw(t,n);case"ZodFunction":case"ZodVoid":case"ZodSymbol":return;default:return(r=>{})(e)}},"selectParser"),mw=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"),ef={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"},vw=d(t=>typeof t=="string"?H(w({},ef),{name:t}):w(w({},ef),t),"getDefaultOptions"),Tw=d(t=>{let e=vw(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"),bw=d((t,e)=>{var n;let r=Tw(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,s=typeof e=="string"?e:e?.name,i=(n=ke(t._def,s===void 0?r:H(w({},r),{currentPath:[...r.basePath,r.definitionPath,s]}),!1))!=null?n:{},o=s===void 0?a?H(w({},i),{[r.definitionPath]:a}):i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:H(w({},a),{[s]:i})};return r.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":r.target==="jsonSchema2019-09"&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),o},"zodToJsonSchema"),Jo=d((t,e={target:"openApi3"})=>{let n=bw(t,e);return e.$schemaUrl===!1?delete n.$schema:typeof e.$schemaUrl=="string"&&(n.$schema=e.$schemaUrl),n},"zuiToJsonSchema"),_w=["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"],LA=Xn.create(["any","string","number","boolean","object","pattern","date","array","target","time","enum"]),xw=d(t=>ct.create().displayAs({id:"variable",params:w({type:t?.type||"any"},t?.params)}),"variable"),ww=d(t=>ct.create().displayAs({id:"conversation",params:w({},t?.params)}),"conversation"),Ew=d(t=>ct.create().displayAs({id:"user",params:w({},t?.params)}),"user"),Bw=d(t=>ct.create().displayAs({id:"message",params:w({},t?.params)}),"message"),Pw=d(t=>ct.create().displayAs({id:"agent",params:w({},t?.params)}),"agent"),Iw=d(t=>ct.create().displayAs({id:"event",params:w({},t?.params)}),"event"),Sw=d(t=>ct.create().displayAs({id:"table",params:w({},t?.params)}),"table"),Aw=d(t=>ct.create().displayAs({id:"tablerow",params:w({},t?.params)}),"tablerow"),Cw=d(t=>ct.create().displayAs({id:"intent",params:w({},t?.params)}),"intent"),kw=d(()=>Xn.create(_w).displayAs({id:"dropdown",params:{}}),"aimodel"),Rw=d(t=>ct.create().displayAs({id:"datasource",params:w({},t)}),"datasource"),Ow=d(t=>ct.create().displayAs({id:"knowledgebase",params:w({},t)}),"knowledgebase"),Mw={object:zn.lazycreate},Dw=d((t,e={message:`Input not instance of ${t.name}`})=>Qp(n=>n instanceof t,e),"instanceOfType"),oy=ct.create,sy=Fo.create,Nw=lg.create,Hw=Ro.create,ly=Oo.create,Uw=No.create,jw=Cg.create,$w=qo.create,Zw=Lo.create,Lw=_i.create,Fw=Br.create,Kw=mn.create,qw=Mg.create,zw=Rr.create,Gw=zn.create,Vw=zn.strictCreate,Ww=zo.create,Jw=tg.create,Yw=Uo.create,Xw=Vn.create,Qw=yg.create,eE=mg.create,tE=ua.create,nE=og.create,rE=vg.create,iE=rg.create,aE=jo.create,oE=$o.create,sE=Xn.create,lE=Zo.create,uE=la.create,tf=vn.create,cE=tn.create,fE=qn.create,dE=oa.create,pE=vn.createWithPreprocess,gE=Ko.create,yE=d(()=>oy().optional(),"ostring"),hE=d(()=>sy().optional(),"onumber"),mE=d(()=>ly().optional(),"oboolean"),vE=ye.fromJsonSchema,TE=ye.fromObject,bE={string:d(t=>ct.create(H(w({},t),{coerce:!0})),"string"),number:d(t=>Fo.create(H(w({},t),{coerce:!0})),"number"),boolean:d(t=>Oo.create(H(w({},t),{coerce:!0})),"boolean"),bigint:d(t=>Ro.create(H(w({},t),{coerce:!0})),"bigint"),date:d(t=>No.create(H(w({},t),{coerce:!0})),"date")},_E=de,z=re,uy=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"),xE=d(t=>{var e;return(e=t[Ie])!=null&&e.coerce?"z.coerce.boolean()":"z.boolean()"},"parseBoolean"),wE=d(t=>"z.any()","parseDefault"),EE=d((t,e)=>`z.union([${t.type.map(n=>nt(H(w({},t),{type:n}),e)).join(", ")}])`,"parseMultipleType"),BE=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"),PE=d(t=>"z.null()","parseNull"),IE=d(t=>[t.slice(0,t.length/2),t.slice(t.length/2)],"half"),SE=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],s="";if(a!==void 0){let i=n({value:a,json:JSON.stringify(a)});if(i){let o=i[0],l=i.length===3?i[1]:"",f=i.length===3?i[2]:i[1];s+=o,((r=t.errorMessage)==null?void 0:r[e])!==void 0&&(s+=l+JSON.stringify(t.errorMessage[e])),s+=f}}return s}d(ot,"withMessage");var xr=Symbol("Original index"),AE=d(t=>{let e=[];for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="boolean")e.push(r?{[xr]:n}:{[xr]:n,not:{}});else{if(xr in r)return t;e.push(H(w({},r),{[xr]:n}))}}return e},"ensureOriginalIndex");function Mr(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[xr]]}))}else{let[n,r]=IE(AE(t.allOf));return`z.intersection(${Mr({allOf:n},e)}, ${Mr({allOf:r},e)})`}}d(Mr,"parseAllOf");var CE=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"),RE=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"),OE=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) => {
24
+ const result = ${n}.safeParse(value).success
25
+ ? ${r}.safeParse(value)
26
+ : ${a}.safeParse(value);
27
+ if (!result.success) {
28
+ result.error.errors.forEach((error) => ctx.addIssue(error))
29
+ }
30
+ })`},"parseIfThenElse"),ME=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"),Yo=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(", ")}];
32
+ const errors = schemas.reduce(
33
+ (errors: z.ZodError[], schema) =>
34
+ ((result) => ("error" in result ? [...errors, result.error] : errors))(
35
+ schema.safeParse(x)
36
+ ),
37
+ []
38
+ );
39
+ if (schemas.length - errors.length !== 1) {
40
+ ctx.addIssue({
41
+ path: ctx.path,
42
+ code: "invalid_union",
43
+ unionErrors: errors,
44
+ message: "Invalid input: Should pass single schema",
45
+ });
46
+ }
47
+ })`:"z.any()","parseOneOf");function cy(t,e){let n;t.properties&&(Object.keys(t.properties).length?(n="z.object({ ",n+=Object.keys(t.properties).map(i=>{let o=t.properties[i],l=`${JSON.stringify(i)}: ${nt(o,H(w({},e),{path:[...e.path,"properties",i]}))}`,f=typeof o=="object"&&o.default!==void 0||typeof t.default=="object"&&t.default!==null&&i in t.default,g=Array.isArray(t.required)?t.required.includes(i):typeof o=="object"&&o.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(([o,l])=>[o,nt(l,H(w({},e),{path:[...e.path,"patternProperties",o]}))],{}));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(o=>JSON.stringify(o)).join(", ")}].includes(key)
50
+ `:a+=`let evaluated = false
51
+ `);for(let o in t.patternProperties)a+="if (key.match(new RegExp("+JSON.stringify(o)+`))) {
52
+ `,r&&(a+=`evaluated = true
53
+ `),a+="const result = "+i[o]+`.safeParse(value[key])
54
+ `,a+=`if (!result.success) {
55
+ `,a+=`ctx.addIssue({
56
+ path: [...ctx.path, key],
57
+ code: 'custom',
58
+ message: \`Invalid input: Key matching regex /\${key}/ must match schema\`,
59
+ params: {
60
+ issues: result.error.issues
61
+ }
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({
69
+ path: [...ctx.path, key],
70
+ code: 'custom',
71
+ message: \`Invalid input: must match catchall schema\`,
72
+ params: {
73
+ issues: result.error.issues
74
+ }
75
+ })
76
+ `,a+=`}
77
+ `,a+=`}
78
+ `),a+=`}
79
+ `,a+="})"}let s=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)&&(s+=`.and(${uy(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)&&(s+=`.and(${Yo(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)&&(s+=`.and(${Mr(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)})`),s}d(cy,"parseObject");var DE=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"),NE=d((t,e)=>`${nt(SE(t,"nullable"),e,!0)}.nullable()`,"parseNullable"),HE=d(t=>`z.ref('${t.$ref}')`,"parseRef"),UE=d((t,e)=>{var n,r;if(t.oneOf.length<=1||!((n=t.discriminator)!=null&&n.propertyName))return Yo(t,e);let a=t.oneOf.map((s,i)=>nt(s,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 s=e.parserOverride(t,e);if(typeof s=="string")return s}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=ZE(t,e);return n||(a=jE(t,a),e.withoutDefaults||(a=$E(t,a))),r.r=a,a},"parseSchema"),jE=d((t,e)=>(t.description&&(e+=`.describe(${JSON.stringify(t.description)})`),e),"addMeta"),$E=d((t,e)=>(t.default!==void 0&&(e+=`.default(${JSON.stringify(t.default)})`),e),"addDefaults"),ZE=d((t,e)=>Qe.a.nullable(t)?NE(t,e):Qe.an.object(t)?cy(t,e):Qe.an.array(t)?CE(t,e):Qe.an.anyOf(t)?uy(t,e):Qe.an.allOf(t)?Mr(t,e):Qe.a.discriminator(t)?UE(t,e):Qe.a.oneOf(t)?Yo(t,e):Qe.a.not(t)?BE(t,e):Qe.an.enum(t)?RE(t):Qe.a.const(t)?kE(t):Qe.a.multipleType(t)?EE(t,e):Qe.a.primitive(t,"string")?DE(t):Qe.a.primitive(t,"number")||Qe.a.primitive(t,"integer")?ME(t):Qe.a.primitive(t,"boolean")?xE(t):Qe.a.primitive(t,"null")?PE(t):Qe.a.conditional(t)?OE(t,e):Qe.a.ref(t)?HE(t):wE(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")}},LE=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"),FE=d(t=>nt(t,{seen:new Map,path:[]}),"jsonSchemaToZodStr"),KE=d(t=>{let e=FE(t);e=e.replaceAll("errors: z.ZodError[]","errors");let n=LE(e);if(!n.sucess)throw new xf(n.error);return n.value},"jsonSchemaToZod"),wr=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,s])=>{let i=typeof t._def.shape=="function"?t._def.shape():t._def.shape;i[a]&&wr(i[a],s)}),((r=t._def)==null?void 0:r.typeName)==="ZodRecord"&&e.type==="object"&&e.additionalProperties&&wr(t._def.valueType,e.additionalProperties),e.type==="array"&&e.items){let a=e.items;if(typeof a=="object"&&!Array.isArray(a)){let s=t._def.type;s&&wr(s,a)}else Array.isArray(a)&&a.forEach((s,i)=>{let o=t._def;o.typeName===re.ZodFirstPartyTypeKind.ZodTuple&&wr(o.items[i],s)})}},"applyZuiPropsRecursively"),ca=d(t=>{let e=KE(t);return wr(e,t),e},"jsonSchemaToZui"),fy=class extends Wn.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?Wn.default.createElement(this.props.fallback,{error:this.state.error,schema:this.props.fieldSchema}):this.props.children}};d(fy,"ErrorBoundary");var Pr=fy;function qE(t,e){return n=>Wn.default.createElement(Pr,{fallback:e,fieldSchema:n.fieldSchema,path:n.path},Wn.default.createElement(t,w({},n)))}d(qE,"withErrorBoundary");var pi=d(t=>{var e=t,{components:n,fieldSchema:r,path:a,required:s,fallback:i}=e,o=af(e,["components","fieldSchema","path","required","fallback"]),l,f;let{formData:g,disabled:y,hidden:p,handlePropertyChange:h,addArrayItem:_,removeArrayItem:E,formErrors:B,formValid:v}=lf(r,a),I=(0,dt.useMemo)(()=>gn(g,a),[g,a]),P=(0,dt.useMemo)(()=>Qv(n,r),[r,n]),{discriminator:D,discriminatedSchema:$,discriminatorValue:ae}=Jv(r,a);if(!P||p===!0)return null;let{Component:Y,type:ue}=P,ee={type:ue,componentID:P.id,scope:a.join("."),context:{path:a,readonly:!1,formData:g,formErrors:B,formValid:v,updateForm:h,updateFormData:d(Se=>h([],Se),"updateFormData")},onChange:d(Se=>h(a,Se),"onChange"),disabled:y,errors:B?.filter(Se=>Se.path===a)||[],label:((l=r[Ie])==null?void 0:l.title)||Qa(((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=Y,je=ee.schema,De=Array.isArray(I)||typeof I=="object"?I:[],Oe=w(H(w({},ee),{type:ue,schema:je,data:De,addItem:d(We=>_(a,We),"addItem"),removeItem:d(We=>E(a,We),"removeItem")}),o);return Array.isArray(r.items)?null:dt.default.createElement(Se,H(w({key:ee.scope},Oe),{isArrayChild:Oe.isArrayChild}),Array.isArray(Oe.data)?Oe.data.map((We,Ae)=>{let he=[...a,Ae.toString()];return dt.default.createElement(Pr,{key:he.join("."),fallback:i,fieldSchema:r.items,path:he},dt.default.createElement(pi,{key:he.join("."),components:n,fieldSchema:r.items,path:he,required:s,isArrayChild:!0,index:Ae,removeSelf:()=>E(a,Ae),fallback:i}))}):[])}if(r.type==="object"&&ue==="object"&&r.properties){let Se=Y,je=w(H(w({},ee),{type:ue,schema:ee.schema,data:I||{}}),o);return dt.default.createElement(Se,H(w({key:ee.scope},je),{isArrayChild:je.isArrayChild}),Object.entries(r.properties).map(([De,Oe])=>{var We;let Ae=[...a,De];return dt.default.createElement(Pr,{key:Ae.join("."),fallback:i,fieldSchema:Oe,path:Ae},dt.default.createElement(pi,{key:Ae.join("."),components:n,fieldSchema:Oe,path:Ae,required:((We=r.required)==null?void 0:We.includes(De))||!1,isArrayChild:!1,fallback:i}))}))}if(ue==="discriminatedUnion"){let Se=Y,je=w(H(w({},ee),{type:ue,schema:ee.schema,data:I||{},discriminatorKey:D?.key||null,discriminatorLabel:Qa(D?.key||"Unknown"),discriminatorOptions:D?.values||null,discriminatorValue:ae,setDiscriminator:d(De=>{if(!D?.key){console.warn("No discriminator key found, cannot set discriminator");return}h(a,{[D.key]:De})},"setDiscriminator")}),o);return dt.default.createElement(Se,H(w({key:ee.scope},je),{isArrayChild:je.isArrayChild}),$&&dt.default.createElement(Pr,{key:a.join("."),fallback:i,fieldSchema:$,path:a},dt.default.createElement(pi,{components:n,fieldSchema:$,path:a,required:s,isArrayChild:!1,fallback:i})))}let ie=Y,Re=w(H(w({},ee),{type:ue,schema:ee.schema,config:{},required:s,data:I,description:r.description}),o);return dt.default.createElement(ie,w({},Re))},"FormElementRenderer"),KA=d(({schema:t,components:e,onChange:n,value:r,disableValidation:a,fallback:s,dataTransform:i,onValidation:o})=>{let[l,f]=(0,Zt.useState)(r);return(0,Zt.useEffect)(()=>{n(l)},[l]),(0,Zt.useEffect)(()=>{let g=Ln(t);f(y=>yi(g,y))},[JSON.stringify(t),f]),Zt.default.createElement(Wv,{formData:l,setFormData:f,formSchema:t,disableValidation:a||!1,dataTransform:i,onValidation:o},Zt.default.createElement(Pr,{fallback:s,fieldSchema:t,path:[]},Zt.default.createElement(pi,{components:e,fieldSchema:t,path:[],fallback:s,required:!0,isArrayChild:!1})))},"ZuiForm"),qA={string:{},number:{slider:{id:"slider",params:z.object({})}},boolean:{switch:{id:"switch",params:z.object({})}},array:{},object:{},discriminatedUnion:{}},zA={errors:Tf,jsonSchemaToZui:ca,zuiToJsonSchema:Jo,objectToZui:Or,toTypescript:hi,toTypescriptSchema:Co};var Dr=(t,e)=>{let n=t._def,r=e._def;if(n.typeName===re.ZodFirstPartyTypeKind.ZodObject&&r.typeName===re.ZodFirstPartyTypeKind.ZodObject){let a=n.shape(),s=r.shape();return re.object({...a,...s})}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")},dy=re;var ft=re.string().min(1),gy=re.object({text:ft}),yy=re.object({markdown:ft}),hy=re.object({imageUrl:ft}),my=re.object({audioUrl:ft}),vy=re.object({videoUrl:ft}),Ty=re.object({fileUrl:ft,title:ft.optional()}),by=re.object({latitude:re.number(),longitude:re.number(),address:re.string().optional(),title:re.string().optional()}),_y=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}))}),py=re.object({text:ft,options:re.array(re.object({label:ft,value:ft}))}),zE=re.object({items:re.array(_y)}),GE=re.union([re.object({type:re.literal("text"),payload:gy}),re.object({type:re.literal("markdown"),payload:yy}),re.object({type:re.literal("image"),payload:hy}),re.object({type:re.literal("audio"),payload:my}),re.object({type:re.literal("video"),payload:vy}),re.object({type:re.literal("file"),payload:Ty}),re.object({type:re.literal("location"),payload:by})]),VE=re.object({items:re.array(GE)}),WE={schema:yy},JE={text:{schema:gy},image:{schema:hy},audio:{schema:my},video:{schema:vy},file:{schema:Ty},location:{schema:by},carousel:{schema:zE},card:{schema:_y},dropdown:{schema:py},choice:{schema:py},bloc:{schema:VE}};R();M();O();var fa="x-bot-id",wy="x-bot-user-id",Ey="x-integration-id",By="x-webhook-id",Py="x-bp-configuration-type",da="x-bp-configuration",pa="x-bp-operation",Iy="x-bp-type";R();M();O();import{isNode as YI}from"browser-or-node";R();M();O();var Qn=console;function It(t){if(!t.body)throw new Error("Missing body");return JSON.parse(t.body)}async function Da(t,e=8072,n=tS){if(!YI)throw new Error("This function can only be called in Node.js");let a=(Bm(),Sv(Em)).createServer(async(s,i)=>{try{let o=await XI(s);if(o.path==="/health"){i.writeHead(200).end("ok");return}let l=await t(o);i.writeHead(l?.status??200,l?.headers??{}).end(l?.body??"{}")}catch(o){Qn.error("Error while handling request",{error:o?.message??"Internal error occured"}),i.writeHead(500).end(JSON.stringify({error:o?.message??"Internal error occured"}))}});return a.listen(e,()=>n(e)),a}async function XI(t){let e=await eS(t),n={};for(let a=0;a<t.rawHeaders.length;a+=2){let s=t.rawHeaders[a].toLowerCase(),i=t.rawHeaders[a+1];n[s]=i}let r=new URL(t.url??"",t.headers.host?`http://${t.headers.host}`:"http://botpress.cloud");return{body:e,path:r.pathname,query:QI(r.search,"?"),headers:n,method:t.method?.toUpperCase()??"GET"}}function QI(t,e){return t.indexOf(e)===0?t.slice(e.length):t}async function eS(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 tS(t){Qn.info(`Listening on port ${t}`)}import{isApiError as jD,RuntimeError as $D}from"@botpress/client";R();M();O();R();M();O();R();M();O();R();M();O();var ze={};gr(ze,{mapValues:()=>rS,mergeRecords:()=>aS,pairs:()=>Vs,stripUndefinedProps:()=>iS,values:()=>nS});R();M();O();var Vs=t=>Object.entries(t),nS=t=>Object.values(t),rS=(t,e)=>Object.fromEntries(Vs(t).map(([n,r])=>[n,e(r,n)])),iS=t=>Object.fromEntries(Vs(t).filter(([,e])=>e!==void 0)),aS=(t,e,n)=>{let r=[...Object.keys(t),...Object.keys(e)],a=[...new Set(r)],s={};for(let i of a){let o=t[i],l=e[i];o&&l?s[i]=n(o,l):o?s[i]=o:l&&(s[i]=l)}return s};var Ze={};gr(Ze,{safePush:()=>oS});R();M();O();var oS=(t,...e)=>t?[...t,...e]:[...e];R();M();O();var Pm=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:{}},s=ze.mapValues(t.entities,i=>i.schema);for(let[i,o]of Object.entries(t.definition.actions??{})){let l=o.input.schema.dereference(s),f=o.output.schema.dereference(s),g=t.actions?.[i]?.name??i;r.actions[g]={...o,...t.actions?.[i]??{},input:{schema:l},output:{schema:f}},a.actions[i]={name:g}}for(let[i,o]of Object.entries(t.definition.events??{})){let l=o.schema.dereference(s),f=t.events?.[i]?.name??i;r.events[f]={...o,...t.events?.[i]??{},schema:l},a.events[i]={name:f}}for(let[i,o]of Object.entries(t.definition.channels??{})){let l={};for(let[g,y]of Object.entries(o.messages)){let p=y.schema.dereference(s);l[g]={...y,schema:p}}let f=t.channels?.[i]?.name??i;r.channels[f]={...o,...t.channels?.[i]??{},message:{...o.message??{},tags:{...o.message?.tags??{},...t.channels?.[i]?.message?.tags??{}}},conversation:{...o.conversation??{},tags:{...o.conversation?.tags??{},...t.channels?.[i]?.conversation?.tags??{}}},messages:l},a.channels[i]={name:f}}return{resolved:r,statement:a}};R();M();O();var Na=Symbol("schemaName"),Im=t=>t?ze.mapValues(t,(n,r)=>({...n,[Na]:r})):{},Sm=t=>Na in t&&t[Na]!==void 0,Am=t=>t[Na];R();M();O();var Ws=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:s,channels:i}=this._callBuilder(e,n),o=this;o.interfaces??={};let l=Object.values(r).map(p=>p.name),f=l.length===0?e.name:`${e.name}<${l.join(",")}>`,{resolved:g,statement:y}=Pm({...e,entities:r,actions:ze.stripUndefinedProps(a),events:ze.stripUndefinedProps(s),channels:ze.stripUndefinedProps(i)});return o.actions=ze.mergeRecords(o.actions??{},g.actions,this._mergeActions),o.channels=ze.mergeRecords(o.channels??{},g.channels,this._mergeChannels),o.events=ze.mergeRecords(o.events??{},g.events,this._mergeEvents),o.interfaces[f]={id:e.id,...y},this}_callBuilder(e,n){let a={entities:Im(this.entities)},s=n(a),i=ze.pairs(s.entities).find(([l,f])=>!Sm(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(s.entities,l=>({name:Am(l),schema:l.schema})),actions:s.actions??{},events:s.events??{},channels:s.channels??{}}}_mergeActions=(e,n)=>({...e,...n,input:{schema:Dr(e.input.schema,n.input.schema)},output:{schema:Dr(e.input.schema,n.output.schema)}});_mergeEvents=(e,n)=>({...e,...n,schema:Dr(e.schema,n.schema)});_mergeChannels=(e,n)=>{let r=ze.mergeRecords(e.messages,n.messages,this._mergeMessage);return{...e,...n,messages:r}};_mergeMessage=(e,n)=>({schema:Dr(e.schema,n.schema)})};R();M();O();R();M();O();import{isApiError as OS,Client as MS,RuntimeError as dv}from"@botpress/client";R();M();O();import{axiosRetry as sS}from"@botpress/client";var Ha={retries:3,retryCondition:t=>sS.isNetworkOrIdempotentRequestError(t)||[429,502].includes(t.response?.status??0),retryDelay:t=>t*1e3};R();M();O();R();M();O();var Kr=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();M();O();var Ua=class{_cost=0;get cost(){return this._cost}setCost(e){this._cost=e}toJSON(){return{cost:this.cost}}};R();M();O();var lS=re.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),Cm=t=>{let e=t[fa],n=t[wy],r=t[Ey],a=t[By],s=t[Py],i=t[da],o=lS.parse(t[pa]);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(!o)throw new Error("Missing operation headers");return{botId:e,botUserId:n,integrationId:r,webhookId:a,operation:o,configurationType:s??null,configuration:i?JSON.parse(W.from(i,"base64").toString("utf-8")):{}}};R();M();O();R();M();O();R();M();O();R();M();O();var Js={},km=!1;function hl(){return km||(km=!0,Js=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 s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[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}),Js}var Ys={},Rm=!1;function uS(){return Rm||(Rm=!0,Ys=Error),Ys}var Xs={},Om=!1;function cS(){return Om||(Om=!0,Xs=EvalError),Xs}var Qs={},Mm=!1;function fS(){return Mm||(Mm=!0,Qs=RangeError),Qs}var el={},Dm=!1;function dS(){return Dm||(Dm=!0,el=ReferenceError),el}var tl={},Nm=!1;function Xm(){return Nm||(Nm=!0,tl=SyntaxError),tl}var nl={},Hm=!1;function ja(){return Hm||(Hm=!0,nl=TypeError),nl}var rl={},Um=!1;function pS(){return Um||(Um=!0,rl=URIError),rl}var il={},jm=!1;function gS(){if(jm)return il;jm=!0;var t=typeof Symbol<"u"&&Symbol,e=hl();return il=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},il}var al={},$m=!1;function yS(){if($m)return al;$m=!0;var t={__proto__:null,foo:{}},e=Object;return al=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},al}var ol={},Zm=!1;function hS(){if(Zm)return ol;Zm=!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},s=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(o,l){for(var f="",g=0;g<o.length;g+=1)f+=o[g],g+1<o.length&&(f+=l);return f};return ol=function(l){var f=this;if(typeof f!="function"||e.apply(f)!==r)throw new TypeError(t+f);for(var g=s(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))},h=n(0,f.length-g.length),_=[],E=0;E<h;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},ol}var sl={},Lm=!1;function ml(){if(Lm)return sl;Lm=!0;var t=hS();return sl=Function.prototype.bind||t,sl}var ll={},Fm=!1;function mS(){if(Fm)return ll;Fm=!0;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=ml();return ll=n.call(t,e),ll}var ul={},Km=!1;function zr(){if(Km)return ul;Km=!0;var t,e=uS(),n=cS(),r=fS(),a=dS(),s=Xm(),i=ja(),o=pS(),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,h=gS()(),_=yS()(),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%":h&&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%":h&&E?E(E([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!h||!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"||!h||!E?t:E(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&E?E(""[Symbol.iterator]()):t,"%Symbol%":h?Symbol:t,"%SyntaxError%":s,"%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%":o,"%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(he){var Pe;if(he==="%AsyncFunction%")Pe=f("async function () {}");else if(he==="%GeneratorFunction%")Pe=f("function* () {}");else if(he==="%AsyncGeneratorFunction%")Pe=f("async function* () {}");else if(he==="%AsyncGenerator%"){var ce=Ae("%AsyncGeneratorFunction%");ce&&(Pe=ce.prototype)}else if(he==="%AsyncIteratorPrototype%"){var me=Ae("%AsyncGenerator%");me&&E&&(Pe=E(me.prototype))}return I[he]=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=ml(),Y=mS(),ue=ae.call(Function.call,Array.prototype.concat),ee=ae.call(Function.apply,Array.prototype.splice),ie=ae.call(Function.call,String.prototype.replace),Re=ae.call(Function.call,String.prototype.slice),Se=ae.call(Function.call,RegExp.prototype.exec),je=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,De=/\\(\\)?/g,Oe=function(he){var Pe=Re(he,0,1),ce=Re(he,-1);if(Pe==="%"&&ce!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(ce==="%"&&Pe!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var me=[];return ie(he,je,function(k,Z,F,fe){me[me.length]=F?ie(fe,De,"$1"):Z||k}),me},We=function(he,Pe){var ce=he,me;if(Y($,ce)&&(me=$[ce],ce="%"+me[0]+"%"),Y(I,ce)){var k=I[ce];if(k===B&&(k=D(ce)),typeof k>"u"&&!Pe)throw new i("intrinsic "+he+" exists, but is not available. Please file an issue!");return{alias:me,name:ce,value:k}}throw new s("intrinsic "+he+" does not exist!")};return ul=function(he,Pe){if(typeof he!="string"||he.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(/^%?[^%]*%?$/,he)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ce=Oe(he),me=ce.length>0?ce[0]:"",k=We("%"+me+"%",Pe),Z=k.name,F=k.value,fe=!1,ve=k.alias;ve&&(me=ve[0],ee(ce,ue([0,1],ve)));for(var C=1,S=!0;C<ce.length;C+=1){var j=ce[C],V=Re(j,0,1),oe=Re(j,-1);if((V==='"'||V==="'"||V==="`"||oe==='"'||oe==="'"||oe==="`")&&V!==oe)throw new s("property names with quotes must have matching quotes");if((j==="constructor"||!S)&&(fe=!0),me+="."+j,Z="%"+me+"%",Y(I,Z))F=I[Z];else if(F!=null){if(!(j in F)){if(!Pe)throw new i("base intrinsic for "+he+" 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=Y(F,j),F=F[j];S&&!fe&&(I[Z]=F)}}return F},ul}var cl={},qm=!1;function vl(){if(qm)return cl;qm=!0;var t=zr(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return cl=e,cl}var fl={},zm=!1;function $a(){if(zm)return fl;zm=!0;var t=zr(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return fl=e,fl}var dl={},Gm=!1;function vS(){if(Gm)return dl;Gm=!0;var t=vl(),e=Xm(),n=ja(),r=$a();return dl=function(s,i,o){if(!s||typeof s!="object"&&typeof s!="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(s,i);if(t)t(s,i,{configurable:g===null&&p?p.configurable:!g,enumerable:l===null&&p?p.enumerable:!l,value:o,writable:f===null&&p?p.writable:!f});else if(y||!l&&!f&&!g)s[i]=o;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},dl}var pl={},Vm=!1;function TS(){if(Vm)return pl;Vm=!0;var t=vl(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},pl=e,pl}var gl={},Wm=!1;function bS(){if(Wm)return gl;Wm=!0;var t=zr(),e=vS(),n=TS()(),r=$a(),a=ja(),s=t("%Math.floor%");return gl=function(o,l){if(typeof o!="function")throw new a("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||s(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 o&&r){var p=r(o,"length");p&&!p.configurable&&(g=!1),p&&!p.writable&&(y=!1)}return(g||y||!f)&&(n?e(o,"length",l,!0,!0):e(o,"length",l)),o},gl}var qr={},Jm=!1;function Tl(){if(Jm)return qr;Jm=!0;var t=ml(),e=zr(),n=bS(),r=ja(),a=e("%Function.prototype.apply%"),s=e("%Function.prototype.call%"),i=e("%Reflect.apply%",!0)||t.call(s,a),o=vl(),l=e("%Math.max%");qr=function(y){if(typeof y!="function")throw new r("a function is required");var p=i(t,s,arguments);return n(p,1+l(0,y.length-(arguments.length-1)),!0)};var f=function(){return i(t,a,arguments)};return o?o(qr,"apply",{value:f}):qr.apply=f,qr}var yl={},Ym=!1;function bl(){if(Ym)return yl;Ym=!0;var t=zr(),e=Tl(),n=e(t("String.prototype.indexOf"));return yl=function(a,s){var i=t(a,!!s);return typeof i=="function"&&n(a,".prototype.")>-1?e(i):i},yl}Xo();ys();var _l={},Qm=!1;function kl(){if(Qm)return _l;Qm=!0;var t=hl();return _l=function(){return t()&&!!Symbol.toStringTag},_l}var xl={},ev=!1;function _S(){if(ev)return xl;ev=!0;var t=kl()(),e=bl(),n=e("Object.prototype.toString"),r=function(o){return t&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:n(o)==="[object Arguments]"},a=function(o){return r(o)?!0:o!==null&&typeof o=="object"&&typeof o.length=="number"&&o.length>=0&&n(o)!=="[object Array]"&&n(o.callee)==="[object Function]"},s=function(){return r(arguments)}();return r.isLegacyArguments=a,xl=s?r:a,xl}var wl={},tv=!1;function xS(){if(tv)return wl;tv=!0;var t=Object.prototype.toString,e=Function.prototype.toString,n=/^\s*(?:function)?\*/,r=kl()(),a=Object.getPrototypeOf,s=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},i;return wl=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=s();i=g?a(g):!1}return a(l)===i},wl}var El={},nv=!1;function wS(){if(nv)return El;nv=!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/,s=function(P){try{var D=t.call(P);return a.test(D)}catch{return!1}},i=function(P){try{return s(P)?!1:(t.call(P),!0)}catch{return!1}},o=Object.prototype.toString,l="[object Object]",f="[object Function]",g="[object GeneratorFunction]",y="[object HTMLAllCollection]",p="[object HTML document.all class]",h="[object HTMLCollection]",_=typeof Symbol=="function"&&!!Symbol.toStringTag,E=!(0 in[,]),B=function(){return!1};if(typeof document=="object"){var v=document.all;o.call(v)===o.call(document.all)&&(B=function(P){if((E||!P)&&(typeof P>"u"||typeof P=="object"))try{var D=o.call(P);return(D===y||D===p||D===h||D===l)&&P("")==null}catch{}return!1})}return El=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!s(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(s(P))return!1;var D=o.call(P);return D!==f&&D!==g&&!/^\[object HTML/.test(D)?!1:i(P)},El}var Bl={},rv=!1;function ES(){if(rv)return Bl;rv=!0;var t=wS(),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)},s=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):s(l,f,y)};return Bl=i,Bl}var Pl={},iv=!1;function BS(){return iv||(iv=!0,Pl=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Pl}var Il={},av=!1,PS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function IS(){if(av)return Il;av=!0;var t=BS(),e=typeof globalThis>"u"?PS:globalThis;return Il=function(){for(var r=[],a=0;a<t.length;a++)typeof e[t[a]]=="function"&&(r[r.length]=t[a]);return r},Il}var Sl={},ov=!1,SS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function fv(){if(ov)return Sl;ov=!0;var t=ES(),e=IS(),n=Tl(),r=bl(),a=$a(),s=r("Object.prototype.toString"),i=kl()(),o=typeof globalThis>"u"?SS: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 o[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 o[E],v=B.slice||B.set;v&&(p["$"+E]=n(v))});var h=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 Sl=function(B){if(!B||typeof B!="object")return!1;if(!i){var v=f(s(B),8,-1);return y(l,v)>-1?v:v!=="Object"?!1:_(B)}return a?h(B):null},Sl}var Al={},sv=!1;function AS(){if(sv)return Al;sv=!0;var t=fv();return Al=function(n){return!!t(n)},Al}var _e={},lv=!1;function CS(){if(lv)return _e;lv=!0;var t=_S(),e=xS(),n=fv(),r=AS();function a(U){return U.call.bind(U)}var s=typeof BigInt<"u",i=typeof Symbol<"u",o=a(Object.prototype.toString),l=a(Number.prototype.valueOf),f=a(String.prototype.valueOf),g=a(Boolean.prototype.valueOf);if(s)var y=a(BigInt.prototype.valueOf);if(i)var p=a(Symbol.prototype.valueOf);function h(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)||k(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 Y(U){return n(U)==="Float32Array"}_e.isFloat32Array=Y;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 Re(U){return o(U)==="[object Map]"}Re.working=typeof Map<"u"&&Re(new Map);function Se(U){return typeof Map>"u"?!1:Re.working?Re(U):U instanceof Map}_e.isMap=Se;function je(U){return o(U)==="[object Set]"}je.working=typeof Set<"u"&&je(new Set);function De(U){return typeof Set>"u"?!1:je.working?je(U):U instanceof Set}_e.isSet=De;function Oe(U){return o(U)==="[object WeakMap]"}Oe.working=typeof WeakMap<"u"&&Oe(new WeakMap);function We(U){return typeof WeakMap>"u"?!1:Oe.working?Oe(U):U instanceof WeakMap}_e.isWeakMap=We;function Ae(U){return o(U)==="[object WeakSet]"}Ae.working=typeof WeakSet<"u"&&Ae(new WeakSet);function he(U){return Ae(U)}_e.isWeakSet=he;function Pe(U){return o(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 me(U){return o(U)==="[object DataView]"}me.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&me(new DataView(new ArrayBuffer(1),0,1));function k(U){return typeof DataView>"u"?!1:me.working?me(U):U instanceof DataView}_e.isDataView=k;var Z=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function F(U){return o(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 o(U)==="[object AsyncFunction]"}_e.isAsyncFunction=ve;function C(U){return o(U)==="[object Map Iterator]"}_e.isMapIterator=C;function S(U){return o(U)==="[object Set Iterator]"}_e.isSetIterator=S;function j(U){return o(U)==="[object Generator]"}_e.isGeneratorObject=j;function V(U){return o(U)==="[object WebAssembly.Module]"}_e.isWebAssemblyCompiledModule=V;function oe(U){return h(U,l)}_e.isNumberObject=oe;function b(U){return h(U,f)}_e.isStringObject=b;function x(U){return h(U,g)}_e.isBooleanObject=x;function q(U){return s&&h(U,y)}_e.isBigIntObject=q;function Q(U){return i&&h(U,p)}_e.isSymbolObject=Q;function Ne(U){return oe(U)||b(U)||x(U)||q(U)||Q(U)}_e.isBoxedPrimitive=Ne;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 Cl={},uv=!1;function kS(){return uv||(uv=!0,Cl=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),Cl}var xe={},cv=!1,Gr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function RS(){if(cv)return xe;cv=!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(k){if(!$(k)){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(k).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(k,Z){if(typeof t<"u"&&t.noDeprecation===!0)return k;if(typeof t>"u")return function(){return xe.deprecate(k,Z).apply(this||Gr,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 k.apply(this||Gr,arguments)}return fe};var r={},a=/^$/;if(t.env.NODE_DEBUG){var s=t.env.NODE_DEBUG;s=s.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+s+"$","i")}xe.debuglog=function(k){if(k=k.toUpperCase(),!r[k])if(a.test(k)){var Z=t.pid;r[k]=function(){var F=xe.format.apply(xe,arguments);console.error("%s %d: %s",k,Z,F)}}else r[k]=function(){};return r[k]};function i(k,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),Y(F.showHidden)&&(F.showHidden=!1),Y(F.depth)&&(F.depth=2),Y(F.colors)&&(F.colors=!1),Y(F.customInspect)&&(F.customInspect=!0),F.colors&&(F.stylize=o),g(F,k,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 o(k,Z){var F=i.styles[Z];return F?"\x1B["+i.colors[F][0]+"m"+k+"\x1B["+i.colors[F][1]+"m":k}function l(k,Z){return k}function f(k){var Z={};return k.forEach(function(F,fe){Z[F]=!0}),Z}function g(k,Z,F){if(k.customInspect&&Z&&Se(Z.inspect)&&Z.inspect!==xe.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var fe=Z.inspect(F,k);return $(fe)||(fe=g(k,fe,F)),fe}var ve=y(k,Z);if(ve)return ve;var C=Object.keys(Z),S=f(C);if(k.showHidden&&(C=Object.getOwnPropertyNames(Z)),Re(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 k.stylize("[Function"+j+"]","special")}if(ue(Z))return k.stylize(RegExp.prototype.toString.call(Z),"regexp");if(ie(Z))return k.stylize(Date.prototype.toString.call(Z),"date");if(Re(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)),Re(Z)&&(V=" "+p(Z)),C.length===0&&(!oe||Z.length==0))return b[0]+V+b[1];if(F<0)return ue(Z)?k.stylize(RegExp.prototype.toString.call(Z),"regexp"):k.stylize("[Object]","special");k.seen.push(Z);var q;return oe?q=h(k,Z,F,S,C):q=C.map(function(Q){return _(k,Z,F,S,Q,oe)}),k.seen.pop(),E(q,V,b)}function y(k,Z){if(Y(Z))return k.stylize("undefined","undefined");if($(Z)){var F="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return k.stylize(F,"string")}if(D(Z))return k.stylize(""+Z,"number");if(v(Z))return k.stylize(""+Z,"boolean");if(I(Z))return k.stylize("null","null")}function p(k){return"["+Error.prototype.toString.call(k)+"]"}function h(k,Z,F,fe,ve){for(var C=[],S=0,j=Z.length;S<j;++S)he(Z,String(S))?C.push(_(k,Z,F,fe,String(S),!0)):C.push("");return ve.forEach(function(V){V.match(/^\d+$/)||C.push(_(k,Z,F,fe,V,!0))}),C}function _(k,Z,F,fe,ve,C){var S,j,V;if(V=Object.getOwnPropertyDescriptor(Z,ve)||{value:Z[ve]},V.get?V.set?j=k.stylize("[Getter/Setter]","special"):j=k.stylize("[Getter]","special"):V.set&&(j=k.stylize("[Setter]","special")),he(fe,ve)||(S="["+ve+"]"),j||(k.seen.indexOf(V.value)<0?(I(F)?j=g(k,V.value,null):j=g(k,V.value,F-1),j.indexOf(`
80
+ `)>-1&&(C?j=j.split(`
81
+ `).map(function(oe){return" "+oe}).join(`
82
+ `).slice(2):j=`
83
+ `+j.split(`
84
+ `).map(function(oe){return" "+oe}).join(`
85
+ `))):j=k.stylize("[Circular]","special")),Y(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=k.stylize(S,"name")):(S=S.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),S=k.stylize(S,"string"))}return S+": "+j}function E(k,Z,F){var fe=k.reduce(function(ve,C){return C.indexOf(`
86
+ `)>=0,ve+C.replace(/\u001b\[\d\d?m/g,"").length+1},0);return fe>60?F[0]+(Z===""?"":Z+`
87
+ `)+" "+k.join(`,
88
+ `)+" "+F[1]:F[0]+Z+" "+k.join(", ")+" "+F[1]}xe.types=CS();function B(k){return Array.isArray(k)}xe.isArray=B;function v(k){return typeof k=="boolean"}xe.isBoolean=v;function I(k){return k===null}xe.isNull=I;function P(k){return k==null}xe.isNullOrUndefined=P;function D(k){return typeof k=="number"}xe.isNumber=D;function $(k){return typeof k=="string"}xe.isString=$;function ae(k){return typeof k=="symbol"}xe.isSymbol=ae;function Y(k){return k===void 0}xe.isUndefined=Y;function ue(k){return ee(k)&&De(k)==="[object RegExp]"}xe.isRegExp=ue,xe.types.isRegExp=ue;function ee(k){return typeof k=="object"&&k!==null}xe.isObject=ee;function ie(k){return ee(k)&&De(k)==="[object Date]"}xe.isDate=ie,xe.types.isDate=ie;function Re(k){return ee(k)&&(De(k)==="[object Error]"||k instanceof Error)}xe.isError=Re,xe.types.isNativeError=Re;function Se(k){return typeof k=="function"}xe.isFunction=Se;function je(k){return k===null||typeof k=="boolean"||typeof k=="number"||typeof k=="string"||typeof k=="symbol"||typeof k>"u"}xe.isPrimitive=je,xe.isBuffer=kS();function De(k){return Object.prototype.toString.call(k)}function Oe(k){return k<10?"0"+k.toString(10):k.toString(10)}var We=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ae(){var k=new Date,Z=[Oe(k.getHours()),Oe(k.getMinutes()),Oe(k.getSeconds())].join(":");return[k.getDate(),We[k.getMonth()],Z].join(" ")}xe.log=function(){console.log("%s - %s",Ae(),xe.format.apply(xe,arguments))},xe.inherits=Ct(),xe._extend=function(k,Z){if(!Z||!ee(Z))return k;for(var F=Object.keys(Z),fe=F.length;fe--;)k[F[fe]]=Z[F[fe]];return k};function he(k,Z){return Object.prototype.hasOwnProperty.call(k,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||Gr,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(k,Z){if(!k){var F=new Error("Promise was rejected with a falsy value");F.reason=k,k=F}return Z(k)}function me(k){if(typeof k!="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||Gr,S=function(){return ve.apply(C,arguments)};k.apply(this||Gr,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(k)),Object.defineProperties(Z,e(k)),Z}return xe.callbackify=me,xe}var le=RS();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 $k=le._extend,Zk=le.callbackify,Lk=le.debuglog,Fk=le.deprecate,Kk=le.format,qk=le.inherits,zk=le.inspect,Gk=le.isArray,Vk=le.isBoolean,Wk=le.isBuffer,Jk=le.isDate,Yk=le.isError,Xk=le.isFunction,Qk=le.isNull,eR=le.isNullOrUndefined,tR=le.isNumber,nR=le.isObject,rR=le.isPrimitive,iR=le.isRegExp,aR=le.isString,oR=le.isSymbol,sR=le.isUndefined,lR=le.log,uR=le.promisify,cR=le.types,fR=le.TextEncoder=globalThis.TextEncoder,dR=le.TextDecoder=globalThis.TextDecoder;var fr=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 X.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 Rn=class extends fr{constructor(e){super({visibleToBotOwners:!0,...e})}with(e){return new Rn({...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();M();O();var pv=t=>async e=>{let n=Cm(e.headers),r=new MS({botId:n.botId,integrationId:n.integrationId,retry:Ha}),a=new Kr(r),s=new Rn,i={ctx:n,req:e,client:a,logger:s,instance:t};try{let o;switch(n.operation){case"webhook_received":o=await NS(i);break;case"register":o=await HS(i);break;case"unregister":o=await US(i);break;case"message_created":o=await ZS(i);break;case"action_triggered":o=await LS(i);break;case"ping":o=await DS(i);break;case"create_user":o=await jS(i);break;case"create_conversation":o=await $S(i);break;default:throw new Error(`Unknown operation ${n.operation}`)}return o?{...o,status:o.status??200}:{status:200}}catch(o){if(OS(o)){let f=o.type==="Runtime"?o:new dv(o.message,o);return s.forBot().error(f.message),{status:f.code,body:JSON.stringify(f.toJSON())}}console.error(o);let l=new dv("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 s.forBot().error(l.message),{status:l.code,body:JSON.stringify(l.toJSON())}}},DS=async t=>{},NS=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{let{req:s}=It(n);return a.webhook({client:t,ctx:e,req:s,logger:r})},HS=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.register)return;let{webhookUrl:s}=It(n);await a.register({client:t,ctx:e,webhookUrl:s,logger:r})},US=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.unregister)return;let{webhookUrl:s}=It(n);await a.unregister({ctx:e,webhookUrl:s,client:t,logger:r})},jS=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.createUser)return;let{tags:s}=It(n);return await a.createUser({ctx:e,client:t,tags:s,logger:r})},$S=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.createConversation)return;let{channel:s,tags:i}=It(n);return await a.createConversation({ctx:e,client:t,channel:s,tags:i,logger:r})},ZS=async({ctx:t,req:e,client:n,logger:r,instance:a})=>{let{conversation:s,user:i,type:o,payload:l,message:f}=It(e),g=a.channels[s.channel];if(!g)throw new Error(`Channel ${s.channel} not found`);let y=g.messages[o];if(!y)throw new Error(`Message of type ${o} not found in channel ${s.channel}`);await y({ctx:t,conversation:s,message:f,user:i,type:o,client:n,payload:l,ack:async({tags:h})=>{await n.updateMessage({id:f.id,tags:h})},logger:r})},LS=async({req:t,ctx:e,client:n,logger:r,instance:a})=>{let{input:s,type:i}=It(t);if(!i)throw new Error("Missing action type");let o=a.actions[i];if(!o)throw new Error(`Action ${i} not found`);let l=new Ua,g={output:await o({ctx:e,input:s,client:n,type:i,logger:r,metadata:l}),meta:l.toJSON()};return{body:JSON.stringify(g)}};var Rl=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=pv(this);start=e=>Da(this.handler,e)};R();M();O();R();M();O();R();M();O();R();M();O();R();M();O();var Ol=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();M();O();R();M();O();import*as yv from"@botpress/client";R();M();O();var On=class extends fr{constructor(e){super({...e})}with(e){return new On({...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();M();O();R();M();O();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),s=this._hooks.after[e];return s&&(a=await s(a)),a}};R();M();O();var FS=re.enum(["event_received","register","unregister","ping","action_triggered"]),gv=t=>{let e=t[fa],n=t[da],r=t[Iy],a=FS.parse(t[pa]);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();M();O();var Mt={status:200},hv=t=>async e=>{let n=gv(e.headers),r=new On,a=new yv.Client({botId:n.botId,retry:Ha}),s=new Xt(a,{before:{createMessage:async o=>{let l=t.hookHandlers.before_outgoing_message[o.type]??[];for(let f of l)o=(await f({client:new Xt(a),ctx:n,logger:r,data:o}))?.data??o;return o},callAction:async o=>{let l=t.hookHandlers.before_outgoing_call_action[o.type]??[];for(let f of l)o=(await f({client:new Xt(a),ctx:n,logger:r,data:o}))?.data??o;return o}},after:{createMessage:async o=>{let l=t.hookHandlers.after_outgoing_message[o.message.type]??[];for(let f of l)o=(await f({client:new Xt(a),ctx:n,logger:r,data:o}))?.data??o;return o},callAction:async o=>{let l=t.hookHandlers.after_outgoing_call_action[o.output.type]??[];for(let f of l)o=(await f({client:new Xt(a),ctx:n,logger:r,data:o}))?.data??o;return o}}}),i={req:e,ctx:n,logger:r,client:s,self:t};switch(n.operation){case"action_triggered":return await VS(i);case"event_received":return await GS(i);case"register":return await qS(i);case"unregister":return await zS(i);case"ping":return await KS(i);default:throw new Error(`Unknown operation ${n.operation}`)}},KS=async({ctx:t})=>(Qn.info(`Received ${t.operation} operation for bot ${t.botId} of type ${t.type}`),Mt),qS=async t=>Mt,zS=async t=>Mt,GS=async({ctx:t,logger:e,req:n,client:r,self:a})=>{let s={client:r,ctx:t,logger:e};Qn.debug(`Received event ${t.type}`);let i=It(n);if(t.type==="message_created"){let p=i.event,h=p.payload.message,_=a.hookHandlers.before_incoming_message[h.type]??[];for(let I of _){let P=await I({...s,data:h});if(h=P?.data??h,P?.stop)return Mt}let E={...s,user:p.payload.user,conversation:p.payload.conversation,states:p.payload.states,message:h,event:p},B=a.messageHandlers[h.type]??[];for(let I of B)await I(E);let v=a.hookHandlers.after_incoming_message[h.type]??[];for(let I of v){let P=await I({...s,data:h});if(h=P?.data??h,P?.stop)return Mt}return Mt}if(t.type==="state_expired"){let h=i.event.payload.state,_={...s,state:h},E=a.stateExpiredHandlers["*"]??[];for(let B of E)await B(_);return Mt}let o=i.event,l=a.hookHandlers.before_incoming_event[o.type]??[];for(let p of l){let h=await p({...s,data:o});if(o=h?.data??o,h?.stop)return Mt}let f={...s,event:o},g=a.eventHandlers[o.type]??[];for(let p of g)await p(f);let y=a.hookHandlers.after_incoming_event[o.type]??[];for(let p of y){let h=await p({...s,data:o});if(o=h?.data??o,h?.stop)return Mt}return Mt},VS=async({ctx:t,logger:e,req:n,client:r,self:a})=>{let{input:s,type:i}=It(n);if(!i)throw new Error("Missing action type");let o=a.actionHandlers[i];if(!o)throw new Error(`Action ${i} not found`);let f={output:await o({ctx:t,logger:e,input:s,client:r,type:i})};return{status:200,body:JSON.stringify(f)}};var Ml=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["*"]??[],s=[...r,...a],i=Object.values(this._plugins).flatMap(o=>o.messageHandlers[n]??[]);return[...s,...i]}})}get eventHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._eventHandlers[n]??[],a=this._eventHandlers["*"]??[],s=[...r,...a],i=Object.values(this._plugins).flatMap(o=>o.eventHandlers[n]??[]);return[...s,...i]}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._stateExpiredHandlers[n]??[],a=this._stateExpiredHandlers["*"]??[],s=[...r,...a],i=Object.values(this._plugins).flatMap(o=>o.stateExpiredHandlers[n]??[]);return[...s,...i]}})}get hookHandlers(){return new Proxy({},{get:(e,n)=>new Proxy({},{get:(r,a)=>{let s=n,i=this._hookHandlers[s]??{},o=i[a]??[],l=i["*"]??[],f=[...o,...l],g=Object.values(this._plugins).flatMap(y=>y.hookHandlers[s]?.[a]??[]);return[...f,...g]}})})}on={message:(e,n)=>{this._messageHandlers[e]=Ze.safePush(this._messageHandlers[e],n)},event:(e,n)=>{this._eventHandlers[e]=Ze.safePush(this._eventHandlers[e],n)},stateExpired:(e,n)=>{this._stateExpiredHandlers[e]=Ze.safePush(this._stateExpiredHandlers[e],n)},beforeIncomingEvent:(e,n)=>{this._hookHandlers.before_incoming_event[e]=Ze.safePush(this._hookHandlers.before_incoming_event[e],n)},beforeIncomingMessage:(e,n)=>{this._hookHandlers.before_incoming_message[e]=Ze.safePush(this._hookHandlers.before_incoming_message[e],n)},beforeOutgoingMessage:(e,n)=>{this._hookHandlers.before_outgoing_message[e]=Ze.safePush(this._hookHandlers.before_outgoing_message[e],n)},beforeOutgoingCallAction:(e,n)=>{this._hookHandlers.before_outgoing_call_action[e]=Ze.safePush(this._hookHandlers.before_outgoing_call_action[e],n)},afterIncomingEvent:(e,n)=>{this._hookHandlers.after_incoming_event[e]=Ze.safePush(this._hookHandlers.after_incoming_event[e],n)},afterIncomingMessage:(e,n)=>{this._hookHandlers.after_incoming_message[e]=Ze.safePush(this._hookHandlers.after_incoming_message[e],n)},afterOutgoingMessage:(e,n)=>{this._hookHandlers.after_outgoing_message[e]=Ze.safePush(this._hookHandlers.after_outgoing_message[e],n)},afterOutgoingCallAction:(e,n)=>{this._hookHandlers.after_outgoing_call_action[e]=Ze.safePush(this._hookHandlers.after_outgoing_call_action[e],n)}};handler=hv(this);start=e=>Da(this.handler,e)};R();M();O();R();M();O();R();M();O();R();M();O();R();M();O();var Dl=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)}})),s=e.channels===void 0?{}:ze.mapValues(e.channels,i=>({...i,messages:ze.mapValues(i.messages,o=>({...o,schema:o.schema(n)}))}));this.events=r,this.actions=a,this.channels=s}name;version;entities;events;actions;channels;_getEntityReference=e=>{let n={};for(let[r,a]of Object.entries(e)){let s=a.schema._def["x-zui"]?.title,i=a.schema._def.description,o=dy.ref(r);s&&o.title(s),i&&o.describe(i),n[r]=o}return n}};R();M();O();R();M();O();R();M();O();R();M();O();var Nl=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,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;integrations;interfaces;user;conversation;message;states;configuration;events;recurringEvents;actions;tables};R();M();O();R();M();O();R();M();O();R();M();O();var Hl=":";var mv=t=>{let[e,n]=t.split(Hl);return!e||!n?null:{namespace:e,eventName:n}},vv=t=>`${t.namespace}${Hl}${t.actionName}`,Tv=t=>`${t.namespace}${Hl}${t.eventName}`,bv=(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}},_v=(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 xv=(t,e)=>new Proxy({},{get:(n,r)=>new Proxy({},{get:(a,s)=>i=>WS({client:t,interfaces:e,integrationOrInterfaceName:r,methodName:s,input:i})})}),WS=async({client:t,interfaces:e,integrationOrInterfaceName:n,methodName:r,input:a})=>{let s=bv({namespace:n,actionName:r},e),i=vv(s);return(await t.callAction({type:i,input:a})).output};R();M();O();var Ul=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=xv(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 s=>a({...s,...this._getTools(s.client)});return n}get messageHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._messageHandlers[n]??[],a=this._messageHandlers["*"]??[];return[...r,...a].map(i=>o=>i({...o,...this._getTools(o.client)}))}})}get eventHandlers(){return new Proxy({},{get:(e,n)=>{let r=Object.entries(this._eventHandlers).filter(([i])=>this._eventResolvesTo(i,n)).flatMap(([,i])=>i??[]),a=this._eventHandlers["*"]??[];return[...r,...a].map(i=>o=>i({...o,...this._getTools(o.client)}))}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._stateExpiredHandlers[n]??[],a=this._stateExpiredHandlers["*"]??[];return[...r,...a].map(i=>o=>i({...o,...this._getTools(o.client)}))}})}get hookHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._hookHandlers[n];if(r)return new Proxy({},{get:(a,s)=>{let i=r[s]??[],o=r["*"]??[];return[...i,...o].map(f=>g=>f({...g,...this._getTools(g.client)}))}})}})}on={message:(e,n)=>{this._messageHandlers[e]=Ze.safePush(this._messageHandlers[e],n)},event:(e,n)=>{this._eventHandlers[e]=Ze.safePush(this._eventHandlers[e],n)},stateExpired:(e,n)=>{this._stateExpiredHandlers[e]=Ze.safePush(this._stateExpiredHandlers[e],n)},beforeIncomingEvent:(e,n)=>{this._hookHandlers.before_incoming_event[e]=Ze.safePush(this._hookHandlers.before_incoming_event[e],n)},beforeIncomingMessage:(e,n)=>{this._hookHandlers.before_incoming_message[e]=Ze.safePush(this._hookHandlers.before_incoming_message[e],n)},beforeOutgoingMessage:(e,n)=>{this._hookHandlers.before_outgoing_message[e]=Ze.safePush(this._hookHandlers.before_outgoing_message[e],n)},beforeOutgoingCallAction:(e,n)=>{this._hookHandlers.before_outgoing_call_action[e]=Ze.safePush(this._hookHandlers.before_outgoing_call_action[e],n)},afterIncomingEvent:(e,n)=>{this._hookHandlers.after_incoming_event[e]=Ze.safePush(this._hookHandlers.after_incoming_event[e],n)},afterIncomingMessage:(e,n)=>{this._hookHandlers.after_incoming_message[e]=Ze.safePush(this._hookHandlers.after_incoming_message[e],n)},afterOutgoingMessage:(e,n)=>{this._hookHandlers.after_outgoing_message[e]=Ze.safePush(this._hookHandlers.after_outgoing_message[e],n)},afterOutgoingCallAction:(e,n)=>{this._hookHandlers.after_outgoing_call_action[e]=Ze.safePush(this._hookHandlers.after_outgoing_call_action[e],n)}};_eventResolvesTo=(e,n)=>{let r=mv(e);if(!r)return!1;let a=_v(r,this._runtime.interfaces);return Tv(a)===n}};R();M();O();R();M();O();R();M();O();R();M();O();R();M();O();R();M();O();export{iw as BRAND,Ml as Bot,Ol as BotDefinition,On as BotLogger,Xt as BotSpecificClient,Fn as DIRTY,nw as EMPTY_PATH,Pr as ErrorBoundary,de as INVALID,Rl as Integration,Ws as IntegrationDefinition,Rn as IntegrationLogger,Kr as IntegrationSpecificClient,Dl as InterfaceDefinition,_E as NEVER,ut as OK,Bt as ParseInputLazyPath,pt as ParseStatus,Ul as Plugin,Nl as PluginDefinition,$D as RuntimeError,ye as Schema,_i as ZodAny,Rr as ZodArray,Ro as ZodBigInt,Oo as ZodBoolean,Mo as ZodBranded,Do as ZodCatch,No as ZodDate,oa as ZodDefault,tg as ZodDiscriminatedUnion,vn as ZodEffects,Xn as ZodEnum,$t as ZodError,Zp as ZodFirstPartyTypeKind,rg as ZodFunction,Uo as ZodIntersection,G as ZodIssueCode,jo as ZodLazy,$o as ZodLiteral,og as ZodMap,lg as ZodNaN,Zo as ZodNativeEnum,mn as ZodNever,Lo as ZodNull,qn as ZodNullable,Fo as ZodNumber,zn as ZodObject,tn as ZodOptional,ne as ZodParsedType,Ko as ZodPipeline,la as ZodPromise,ua as ZodReadonly,yg as ZodRecord,mg as ZodRef,ye as ZodSchema,vg as ZodSet,ct as ZodString,Cg as ZodSymbol,vn as ZodTransformer,Vn as ZodTuple,ye as ZodType,qo as ZodUndefined,zo as ZodUnion,Br as ZodUnknown,Mg as ZodVoid,KA as ZuiForm,te as addIssueToContext,Pw as agent,kw as aimodel,Lw as any,zw as array,Hw as bigint,ly as boolean,fa as botIdHeader,wy as botUserIdHeader,bE as coerce,da as configurationHeader,Py as configurationTypeHeader,ww as conversation,sa as createZodEnum,bg as cuid2Regex,Tg as cuidRegex,Qp as custom,Rw as datasource,Uw as date,Ig as datetimeRegex,qA as defaultComponentDefinitions,Jw as discriminatedUnion,tf as effect,wg as emailRegex,sE as enum,se as errorUtil,Iw as event,vE as fromJsonSchema,TE as fromObject,iE as function,Cr as getErrorMap,en as getParsedType,Dw as instanceof,Ey as integrationIdHeader,Cw as intent,Yw as intersection,Bg as ipv4Regex,Pg as ipv6Regex,lo as isAborted,jD as isApiError,Ti as isAsync,uo as isDirty,aw as isEmojiRegex,kr as isValid,ca as jsonSchemaToZui,Ow as knowledgebase,Mw as late,aE as lazy,oE as literal,vi as makeIssue,nE as map,Dr as mergeObjectSchemas,Bw as message,xy as messages,Nw as nan,lE as nativeEnum,Kw as never,Zw as null,fE as nullable,sy as number,Gw as object,Or as objectToZui,so as objectUtil,mE as oboolean,hE as onumber,pa as operationHeader,cE as optional,yE as ostring,It as parseBody,gE as pipeline,pE as preprocess,ge as processCreateParams,uE as promise,tw as quotelessJson,tE as readonly,Qw as record,eE as ref,Da as serve,rE as set,Kp as setErrorMap,Vw as strictObject,oy as string,jw as symbol,Sw as table,Aw as tablerow,tf as transformer,zA as transforms,Xw as tuple,Iy as typeHeader,_g as ulidRegex,$w as undefined,Ww as union,Fw as unknown,Ew as user,be as util,xg as uuidRegex,xw as variable,qw as void,By as webhookIdHeader,qE as withErrorBoundary,re as z,Jo as zuiToJsonSchema};
89
+ /*! Bundled license information:
90
+
91
+ @jspm/core/nodelibs/browser/chunk-DtuTasat.js:
92
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
93
+
94
+ react/cjs/react.production.min.js:
95
+ (**
96
+ * @license React
97
+ * react.production.min.js
98
+ *
99
+ * Copyright (c) Facebook, Inc. and its affiliates.
100
+ *
101
+ * This source code is licensed under the MIT license found in the
102
+ * LICENSE file in the root directory of this source tree.
103
+ *)
104
+
105
+ @jspm/core/nodelibs/browser/chunk-CcCWfKp1.js:
106
+ (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
107
+
108
+ @bpinternal/zui/dist/index.js:
109
+ (*! Bundled license information:
110
+
111
+ lodash-es/lodash.js:
112
+ (**
113
+ * @license
114
+ * Lodash (Custom Build) <https://lodash.com/>
115
+ * Build: `lodash modularize exports="es" -o ./`
116
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
117
+ * Released under MIT license <https://lodash.com/license>
118
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
119
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
120
+ *)
121
+ *)
122
+ */
123
+ //# sourceMappingURL=index.mjs.map